summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/comparison_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/comparison_spec.rb')
-rw-r--r--spec/ruby/core/array/comparison_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/ruby/core/array/comparison_spec.rb b/spec/ruby/core/array/comparison_spec.rb
index 5d1c3265f1..14e8931e5a 100644
--- a/spec/ruby/core/array/comparison_spec.rb
+++ b/spec/ruby/core/array/comparison_spec.rb
@@ -92,6 +92,6 @@ describe "Array#<=>" do
end
it "returns nil when the argument is not array-like" do
- ([] <=> false).should be_nil
+ ([] <=> false).should == nil
end
end
mp;id2=f11b54213ad169975f98bbf0a39e1b303bc2795f'>ChangeLog21826
-rw-r--r--KNOWNBUGS.rb6
-rw-r--r--LEGAL123
-rw-r--r--Makefile.in194
-rw-r--r--NEWS611
-rw-r--r--README166
-rw-r--r--README.EXT1500
-rw-r--r--README.EXT.ja1635
-rw-r--r--README.ja192
-rw-r--r--README.ja.md171
-rw-r--r--README.md164
-rw-r--r--aclocal.m446
-rw-r--r--addr2line.c426
-rw-r--r--addr2line.h2
-rw-r--r--array.c834
-rw-r--r--benchmark/bm_app_aobench.rb7
-rw-r--r--benchmark/bm_app_lc_fizzbuzz.rb52
-rw-r--r--benchmark/bm_array_shift.rb14
-rw-r--r--benchmark/bm_hash_aref_dsym.rb4
-rw-r--r--benchmark/bm_hash_aref_dsym_long.rb21
-rw-r--r--benchmark/bm_hash_aref_fix.rb4
-rw-r--r--benchmark/bm_hash_aref_flo.rb4
-rw-r--r--benchmark/bm_hash_aref_miss.rb5
-rw-r--r--benchmark/bm_hash_aref_str.rb4
-rw-r--r--benchmark/bm_hash_aref_sym.rb9
-rw-r--r--benchmark/bm_hash_aref_sym_long.rb13
-rw-r--r--benchmark/bm_hash_ident_flo.rb4
-rw-r--r--benchmark/bm_hash_ident_num.rb4
-rw-r--r--benchmark/bm_hash_ident_obj.rb4
-rw-r--r--benchmark/bm_hash_ident_str.rb4
-rw-r--r--benchmark/bm_hash_ident_sym.rb4
-rw-r--r--benchmark/bm_hash_shift_u16.rb10
-rw-r--r--benchmark/bm_hash_shift_u24.rb10
-rw-r--r--benchmark/bm_hash_shift_u32.rb10
-rw-r--r--benchmark/bm_hash_to_proc.rb9
-rw-r--r--benchmark/bm_io_nonblock_noex.rb22
-rw-r--r--benchmark/bm_io_nonblock_noex2.rb21
-rw-r--r--benchmark/bm_marshal_dump_flo.rb2
-rw-r--r--benchmark/bm_marshal_dump_load_geniv.rb10
-rw-r--r--benchmark/bm_marshal_dump_load_time.rb1
-rw-r--r--benchmark/bm_require.rb7
-rw-r--r--benchmark/bm_require_thread.rb15
-rw-r--r--benchmark/bm_securerandom.rb5
-rw-r--r--benchmark/bm_so_meteor_contest.rb14
-rw-r--r--benchmark/bm_vm1_gc_wb_ary.rb10
-rw-r--r--benchmark/bm_vm1_gc_wb_ary_promoted.rb14
-rw-r--r--benchmark/bm_vm1_gc_wb_obj.rb10
-rw-r--r--benchmark/bm_vm1_gc_wb_obj_promoted.rb17
-rw-r--r--benchmark/bm_vm2_case_lit.rb19
-rw-r--r--benchmark/bm_vm2_newlambda.rb5
-rw-r--r--benchmark/bm_vm2_string_literal.rb5
-rw-r--r--benchmark/bm_vm2_struct_big_aref_hi.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_aref_lo.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_aset.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_href_hi.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_href_lo.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_hset.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_aref.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_aset.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_href.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_hset.rb7
-rw-r--r--[-rwxr-xr-x]benchmark/bm_vm3_gc.rb1
-rw-r--r--benchmark/bm_vm_symbol_block_pass.rb13
-rw-r--r--benchmark/bm_vm_thread_close.rb6
-rw-r--r--benchmark/bm_vm_thread_pipe.rb2
-rw-r--r--benchmark/driver.rb121
-rw-r--r--benchmark/prepare_require.rb25
-rw-r--r--benchmark/prepare_require_thread.rb2
-rw-r--r--benchmark/prepare_so_k_nucleotide.rb2
-rw-r--r--benchmark/prepare_so_reverse_complement.rb2
-rw-r--r--bignum.c705
-rwxr-xr-xbin/erb34
-rwxr-xr-xbin/rake33
-rwxr-xr-xbin/testrb3
-rwxr-xr-xbootstraptest/runner.rb58
-rw-r--r--bootstraptest/test_block.rb14
-rw-r--r--bootstraptest/test_fork.rb30
-rw-r--r--bootstraptest/test_io.rb14
-rw-r--r--bootstraptest/test_literal.rb2
-rw-r--r--bootstraptest/test_method.rb36
-rw-r--r--bootstraptest/test_string.rb3
-rw-r--r--bootstraptest/test_syntax.rb2
-rw-r--r--bootstraptest/test_thread.rb58
-rw-r--r--ccan/build_assert/build_assert.h40
-rw-r--r--ccan/check_type/check_type.h63
-rw-r--r--ccan/container_of/container_of.h142
-rw-r--r--ccan/licenses/BSD-MIT17
-rw-r--r--ccan/licenses/CC028
-rw-r--r--ccan/list/list.h773
-rw-r--r--ccan/str/str.h16
-rw-r--r--class.c594
-rw-r--r--common.mk2063
-rw-r--r--compar.c48
-rw-r--r--compile.c4566
-rw-r--r--complex.c266
-rw-r--r--configure.in1359
-rw-r--r--constant.h22
-rw-r--r--cont.c610
-rw-r--r--coverage/README17
-rw-r--r--cygwin/GNUmakefile.in16
-rw-r--r--debug.c56
-rw-r--r--defs/default_gems5
-rw-r--r--defs/gmake.mk63
-rw-r--r--defs/id.def73
-rw-r--r--defs/keywords6
-rw-r--r--defs/known_errors.def3
-rw-r--r--defs/lex.c.src6
-rw-r--r--defs/opt_operand.def2
-rw-r--r--dir.c741
-rw-r--r--dln.c161
-rw-r--r--dln_find.c21
-rw-r--r--dmyenc.c10
-rw-r--r--dmyext.c5
-rw-r--r--doc/ChangeLog-0.06_to_0.521147
-rw-r--r--doc/ChangeLog-0.50_to_0.60462
-rw-r--r--doc/ChangeLog-0.60_to_1.13955
-rw-r--r--doc/ChangeLog-1.8.06
-rw-r--r--doc/ChangeLog-1.9.338
-rw-r--r--doc/ChangeLog-2.1.018060
-rw-r--r--doc/ChangeLog-2.2.012157
-rw-r--r--doc/ChangeLog-YARV10
-rw-r--r--doc/NEWS-1.8.74
-rw-r--r--doc/NEWS-2.0.02
-rw-r--r--doc/NEWS-2.1.0376
-rw-r--r--doc/NEWS-2.2.0361
-rw-r--r--doc/contributing.rdoc45
-rw-r--r--doc/contributors.rdoc2
-rw-r--r--doc/dtrace_probes.rdoc10
-rw-r--r--doc/etc.rd.ja4
-rw-r--r--doc/extension.ja.rdoc1799
-rw-r--r--doc/extension.rdoc1828
-rw-r--r--doc/forwardable.rd.ja6
-rw-r--r--doc/globals.rdoc1
-rw-r--r--doc/irb/irb-tools.rd.ja10
-rw-r--r--doc/keywords.rdoc158
-rw-r--r--doc/maintainers.rdoc4
-rw-r--r--doc/pty/README.ja2
-rw-r--r--doc/regexp.rdoc16
-rw-r--r--doc/security.rdoc36
-rw-r--r--doc/shell.rd.ja8
-rw-r--r--doc/standard_library.rdoc12
-rw-r--r--doc/syntax/assignment.rdoc19
-rw-r--r--doc/syntax/calling_methods.rdoc27
-rw-r--r--doc/syntax/control_expressions.rdoc27
-rw-r--r--doc/syntax/exceptions.rdoc7
-rw-r--r--doc/syntax/literals.rdoc81
-rw-r--r--doc/syntax/methods.rdoc85
-rw-r--r--doc/syntax/miscellaneous.rdoc11
-rw-r--r--doc/syntax/modules_and_classes.rdoc5
-rw-r--r--doc/syntax/refinements.rdoc74
-rw-r--r--enc/Makefile.in6
-rw-r--r--enc/ascii.c6
-rw-r--r--enc/big5.c6
-rw-r--r--enc/depend462
-rw-r--r--enc/ebcdic.h11
-rw-r--r--enc/encdb.c9
-rw-r--r--enc/encinit.c.erb17
-rw-r--r--enc/euc_jp.c49
-rw-r--r--enc/iso_2022_jp.h2
-rw-r--r--enc/iso_8859_1.c12
-rw-r--r--enc/iso_8859_10.c4
-rw-r--r--enc/iso_8859_13.c8
-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.c12
-rw-r--r--enc/iso_8859_3.c4
-rw-r--r--enc/iso_8859_4.c5
-rw-r--r--enc/iso_8859_5.c4
-rw-r--r--enc/iso_8859_7.c4
-rw-r--r--enc/iso_8859_9.c4
-rw-r--r--enc/jis/props.h227
-rw-r--r--enc/jis/props.h.blt227
-rw-r--r--enc/jis/props.kwd52
-rw-r--r--enc/jis/props.src52
-rw-r--r--enc/koi8_r.c4
-rw-r--r--enc/koi8_u.c4
-rwxr-xr-xenc/make_encmake.rb25
-rw-r--r--enc/prelude.rb8
-rw-r--r--enc/shift_jis.c47
-rw-r--r--enc/trans/JIS/JISX0201-KANA%UCS.src51
-rw-r--r--enc/trans/JIS/JISX0208@1990%UCS.src54
-rw-r--r--enc/trans/JIS/JISX0212%UCS.src62
-rw-r--r--enc/trans/JIS/UCS%JISX0201-KANA.src52
-rw-r--r--enc/trans/JIS/UCS%JISX0208@1990.src53
-rw-r--r--enc/trans/JIS/UCS%JISX0212.src61
-rw-r--r--enc/trans/ebcdic.trans278
-rw-r--r--enc/trans/escape.trans6
-rw-r--r--enc/trans/euckr-tbl.rb2
-rw-r--r--enc/trans/gb18030.trans8
-rw-r--r--enc/unicode.c193
-rwxr-xr-xenc/unicode/case-folding.rb196
-rw-r--r--enc/unicode/casefold.h8460
-rw-r--r--enc/unicode/name2ctype.h11629
-rw-r--r--enc/unicode/name2ctype.h.blt9915
-rw-r--r--enc/us_ascii.c12
-rw-r--r--enc/utf_16_32.h2
-rw-r--r--enc/utf_16be.c6
-rw-r--r--enc/utf_16le.c6
-rw-r--r--enc/utf_32be.c18
-rw-r--r--enc/utf_32le.c18
-rw-r--r--enc/utf_7.h2
-rw-r--r--enc/utf_8.c31
-rw-r--r--enc/windows_1250.c220
-rw-r--r--enc/windows_1251.c4
-rw-r--r--enc/windows_1252.c211
-rw-r--r--encindex.h67
-rw-r--r--encoding.c287
-rw-r--r--enum.c1251
-rw-r--r--enumerator.c107
-rw-r--r--error.c607
-rw-r--r--eval.c465
-rw-r--r--eval_error.c110
-rw-r--r--eval_intern.h158
-rw-r--r--eval_jump.c13
-rw-r--r--ext/-test-/array/resize/extconf.rb1
-rw-r--r--ext/-test-/bignum/big2str.c1
-rw-r--r--ext/-test-/bignum/bigzero.c6
-rw-r--r--ext/-test-/bignum/depend107
-rw-r--r--ext/-test-/bignum/div.c1
-rw-r--r--ext/-test-/bignum/extconf.rb1
-rw-r--r--ext/-test-/bignum/intpack.c5
-rw-r--r--ext/-test-/bignum/mul.c5
-rw-r--r--ext/-test-/bignum/str2big.c1
-rw-r--r--ext/-test-/bug-3571/extconf.rb1
-rw-r--r--ext/-test-/bug-3662/extconf.rb1
-rw-r--r--ext/-test-/bug-5832/extconf.rb1
-rw-r--r--ext/-test-/bug_reporter/extconf.rb1
-rw-r--r--ext/-test-/class/extconf.rb1
-rw-r--r--ext/-test-/debug/depend35
-rw-r--r--ext/-test-/debug/extconf.rb1
-rw-r--r--ext/-test-/dln/empty/empty.c4
-rw-r--r--ext/-test-/dln/empty/extconf.rb2
-rw-r--r--ext/-test-/exception/depend46
-rw-r--r--ext/-test-/exception/extconf.rb1
-rw-r--r--ext/-test-/fatal/extconf.rb1
-rw-r--r--ext/-test-/file/depend38
-rw-r--r--ext/-test-/file/extconf.rb16
-rw-r--r--ext/-test-/file/fs.c108
-rw-r--r--ext/-test-/float/depend3
-rw-r--r--ext/-test-/float/extconf.rb8
-rw-r--r--ext/-test-/float/init.c11
-rw-r--r--ext/-test-/float/nextafter.c36
-rw-r--r--ext/-test-/funcall/extconf.rb1
-rw-r--r--ext/-test-/gvl/call_without_gvl/call_without_gvl.c34
-rw-r--r--ext/-test-/gvl/call_without_gvl/extconf.rb2
-rw-r--r--ext/-test-/hash/delete.c16
-rw-r--r--ext/-test-/hash/extconf.rb8
-rw-r--r--ext/-test-/hash/init.c11
-rw-r--r--ext/-test-/iseq_load/extconf.rb2
-rw-r--r--ext/-test-/iseq_load/iseq_load.c21
-rw-r--r--ext/-test-/iter/extconf.rb1
-rw-r--r--ext/-test-/load/dot.dot/extconf.rb1
-rw-r--r--ext/-test-/marshal/compat/extconf.rb1
-rw-r--r--ext/-test-/marshal/internal_ivar/extconf.rb2
-rw-r--r--ext/-test-/marshal/internal_ivar/internal_ivar.c39
-rw-r--r--ext/-test-/marshal/usr/extconf.rb1
-rw-r--r--ext/-test-/marshal/usr/usrmarshal.c21
-rw-r--r--ext/-test-/method/extconf.rb1
-rw-r--r--ext/-test-/notimplement/bug.c (renamed from ext/-test-/bug-3662/bug.c)2
-rw-r--r--ext/-test-/notimplement/extconf.rb2
-rw-r--r--ext/-test-/num2int/extconf.rb1
-rw-r--r--ext/-test-/old_thread_select/depend4
-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.rb1
-rw-r--r--ext/-test-/popen_deadlock/extconf.rb5
-rw-r--r--ext/-test-/popen_deadlock/infinite_loop_dlsym.c50
-rw-r--r--ext/-test-/postponed_job/extconf.rb1
-rw-r--r--ext/-test-/printf/extconf.rb1
-rw-r--r--ext/-test-/printf/printf.c37
-rw-r--r--ext/-test-/proc/extconf.rb8
-rw-r--r--ext/-test-/proc/init.c11
-rw-r--r--ext/-test-/proc/receiver.c21
-rw-r--r--ext/-test-/proc/super.c27
-rw-r--r--ext/-test-/rational/depend17
-rw-r--r--ext/-test-/rational/extconf.rb1
-rw-r--r--ext/-test-/rational/rat.c1
-rw-r--r--ext/-test-/recursion/extconf.rb1
-rw-r--r--ext/-test-/st/foreach/extconf.rb2
-rw-r--r--ext/-test-/st/foreach/foreach.c175
-rw-r--r--ext/-test-/st/numhash/extconf.rb1
-rw-r--r--ext/-test-/st/numhash/numhash.c34
-rw-r--r--ext/-test-/st/update/extconf.rb1
-rw-r--r--ext/-test-/string/coderange.c21
-rw-r--r--ext/-test-/string/cstr.c105
-rw-r--r--ext/-test-/string/depend118
-rw-r--r--ext/-test-/string/enc_associate.c8
-rw-r--r--ext/-test-/string/extconf.rb3
-rw-r--r--ext/-test-/string/fstring.c15
-rw-r--r--ext/-test-/string/nofree.c13
-rw-r--r--ext/-test-/string/normalize.c1
-rw-r--r--ext/-test-/struct/duplicate.c24
-rw-r--r--ext/-test-/struct/extconf.rb8
-rw-r--r--ext/-test-/struct/init.c11
-rw-r--r--ext/-test-/struct/member.c18
-rw-r--r--ext/-test-/symbol/extconf.rb2
-rw-r--r--ext/-test-/symbol/init.c14
-rw-r--r--ext/-test-/symbol/intern.c14
-rw-r--r--ext/-test-/symbol/type.c30
-rw-r--r--ext/-test-/thread_fd_close/depend14
-rw-r--r--ext/-test-/thread_fd_close/extconf.rb2
-rw-r--r--ext/-test-/thread_fd_close/thread_fd_close.c14
-rw-r--r--ext/-test-/time/extconf.rb8
-rw-r--r--ext/-test-/time/init.c11
-rw-r--r--ext/-test-/time/new.c34
-rw-r--r--ext/-test-/tracepoint/depend23
-rw-r--r--ext/-test-/tracepoint/extconf.rb1
-rw-r--r--ext/-test-/tracepoint/tracepoint.c3
-rw-r--r--ext/-test-/typeddata/extconf.rb1
-rw-r--r--ext/-test-/typeddata/typeddata.c24
-rw-r--r--ext/-test-/vm/at_exit.c44
-rw-r--r--ext/-test-/vm/extconf.rb1
-rw-r--r--ext/-test-/wait_for_single_fd/depend18
-rw-r--r--ext/-test-/wait_for_single_fd/extconf.rb1
-rw-r--r--ext/-test-/win32/console/attribute.c56
-rw-r--r--ext/-test-/win32/console/depend1
-rw-r--r--ext/-test-/win32/console/extconf.rb9
-rw-r--r--ext/-test-/win32/console/init.c11
-rw-r--r--ext/-test-/win32/dln/depend9
-rw-r--r--ext/-test-/win32/dln/extconf.rb40
-rw-r--r--ext/-test-/win32/dln/libdlntest.c2
-rw-r--r--ext/-test-/win32/fd_setsize/depend3
-rw-r--r--ext/-test-/win32/fd_setsize/extconf.rb1
-rw-r--r--ext/.document4
-rw-r--r--ext/Setup23
-rw-r--r--ext/Setup.atheos2
-rw-r--r--ext/Setup.emx32
-rw-r--r--ext/Setup.nacl6
-rw-r--r--ext/Setup.nt2
-rw-r--r--ext/bigdecimal/README60
-rw-r--r--ext/bigdecimal/bigdecimal.c472
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec6
-rw-r--r--ext/bigdecimal/bigdecimal.h33
-rw-r--r--ext/bigdecimal/depend14
-rw-r--r--ext/bigdecimal/extconf.rb5
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb3
-rw-r--r--ext/bigdecimal/lib/bigdecimal/ludcmp.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb17
-rw-r--r--ext/bigdecimal/lib/bigdecimal/newton.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb1
-rw-r--r--ext/bigdecimal/sample/linear.rb21
-rw-r--r--ext/bigdecimal/sample/nlsolve.rb22
-rw-r--r--ext/bigdecimal/sample/pi.rb1
-rw-r--r--ext/cgi/escape/escape.c105
-rw-r--r--ext/cgi/escape/extconf.rb3
-rw-r--r--ext/continuation/continuation.c5
-rw-r--r--ext/continuation/extconf.rb1
-rw-r--r--ext/coverage/coverage.c42
-rw-r--r--ext/coverage/depend32
-rw-r--r--ext/coverage/extconf.rb1
-rw-r--r--ext/date/date_core.c515
-rw-r--r--ext/date/date_parse.c34
-rw-r--r--ext/date/date_strftime.c9
-rw-r--r--ext/date/date_strptime.c14
-rw-r--r--ext/date/depend58
-rw-r--r--ext/date/extconf.rb2
-rw-r--r--ext/date/lib/date.rb18
-rw-r--r--ext/date/lib/date/format.rb1
-rw-r--r--ext/dbm/dbm.c61
-rw-r--r--ext/dbm/extconf.rb18
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c4
-rw-r--r--ext/digest/bubblebabble/depend14
-rw-r--r--ext/digest/bubblebabble/extconf.rb2
-rw-r--r--ext/digest/depend14
-rw-r--r--ext/digest/digest.c48
-rw-r--r--ext/digest/digest.h25
-rw-r--r--ext/digest/digest_conf.rb30
-rw-r--r--ext/digest/extconf.rb1
-rw-r--r--ext/digest/lib/digest.rb25
-rw-r--r--ext/digest/lib/digest/hmac.rb302
-rw-r--r--ext/digest/md5/depend17
-rw-r--r--ext/digest/md5/extconf.rb15
-rw-r--r--ext/digest/md5/md5.c10
-rw-r--r--ext/digest/md5/md5.h6
-rw-r--r--ext/digest/md5/md5cc.h12
-rw-r--r--ext/digest/md5/md5init.c15
-rw-r--r--ext/digest/md5/md5ossl.c9
-rw-r--r--ext/digest/md5/md5ossl.h4
-rw-r--r--ext/digest/rmd160/depend29
-rw-r--r--ext/digest/rmd160/extconf.rb14
-rw-r--r--ext/digest/rmd160/rmd160.c6
-rw-r--r--ext/digest/rmd160/rmd160.h6
-rw-r--r--ext/digest/rmd160/rmd160init.c13
-rw-r--r--ext/digest/rmd160/rmd160ossl.c8
-rw-r--r--ext/digest/rmd160/rmd160ossl.h3
-rw-r--r--ext/digest/sha1/depend29
-rw-r--r--ext/digest/sha1/extconf.rb14
-rw-r--r--ext/digest/sha1/sha1.c6
-rw-r--r--ext/digest/sha1/sha1.h6
-rw-r--r--ext/digest/sha1/sha1cc.h14
-rw-r--r--ext/digest/sha1/sha1init.c15
-rw-r--r--ext/digest/sha1/sha1ossl.c10
-rw-r--r--ext/digest/sha1/sha1ossl.h4
-rw-r--r--ext/digest/sha2/depend29
-rw-r--r--ext/digest/sha2/extconf.rb20
-rw-r--r--ext/digest/sha2/lib/sha2.rb1
-rw-r--r--ext/digest/sha2/sha2.c28
-rw-r--r--ext/digest/sha2/sha2.h30
-rw-r--r--ext/digest/sha2/sha2cc.h31
-rw-r--r--ext/digest/sha2/sha2init.c13
-rw-r--r--ext/digest/sha2/sha2ossl.c13
-rw-r--r--ext/digest/sha2/sha2ossl.h16
-rw-r--r--ext/dl/callback/depend15
-rw-r--r--ext/dl/callback/extconf.rb14
-rw-r--r--ext/dl/callback/mkcallback.rb242
-rw-r--r--ext/dl/cfunc.c677
-rw-r--r--ext/dl/cptr.c670
-rw-r--r--ext/dl/depend14
-rw-r--r--ext/dl/dl.c569
-rw-r--r--ext/dl/dl.h217
-rw-r--r--ext/dl/extconf.rb43
-rw-r--r--ext/dl/handle.c430
-rw-r--r--ext/dl/lib/dl.rb15
-rw-r--r--ext/dl/lib/dl/callback.rb112
-rw-r--r--ext/dl/lib/dl/cparser.rb156
-rw-r--r--ext/dl/lib/dl/func.rb251
-rw-r--r--ext/dl/lib/dl/import.rb268
-rw-r--r--ext/dl/lib/dl/pack.rb128
-rw-r--r--ext/dl/lib/dl/stack.rb116
-rw-r--r--ext/dl/lib/dl/struct.rb236
-rw-r--r--ext/dl/lib/dl/types.rb71
-rw-r--r--ext/dl/lib/dl/value.rb114
-rw-r--r--ext/etc/depend8
-rw-r--r--ext/etc/etc.c416
-rw-r--r--ext/etc/extconf.rb60
-rw-r--r--ext/etc/mkconstants.rb332
-rwxr-xr-xext/extmk.rb122
-rw-r--r--ext/fcntl/extconf.rb1
-rw-r--r--ext/fcntl/fcntl.c2
-rw-r--r--ext/fiber/extconf.rb1
-rw-r--r--ext/fiddle/closure.c102
-rw-r--r--ext/fiddle/closure.h2
-rw-r--r--ext/fiddle/conversions.h4
-rw-r--r--ext/fiddle/depend55
-rw-r--r--ext/fiddle/extconf.rb149
-rw-r--r--ext/fiddle/extlibs2
-rw-r--r--ext/fiddle/fiddle.c4
-rw-r--r--ext/fiddle/fiddle.h5
-rw-r--r--ext/fiddle/function.c147
-rw-r--r--ext/fiddle/function.h2
-rw-r--r--ext/fiddle/handle.c26
-rw-r--r--ext/fiddle/lib/fiddle.rb1
-rw-r--r--ext/fiddle/lib/fiddle/closure.rb1
-rw-r--r--ext/fiddle/lib/fiddle/cparser.rb158
-rw-r--r--ext/fiddle/lib/fiddle/function.rb1
-rw-r--r--ext/fiddle/lib/fiddle/import.rb5
-rw-r--r--ext/fiddle/lib/fiddle/pack.rb1
-rw-r--r--ext/fiddle/lib/fiddle/struct.rb1
-rw-r--r--ext/fiddle/lib/fiddle/types.rb1
-rw-r--r--ext/fiddle/lib/fiddle/value.rb1
-rw-r--r--ext/fiddle/pointer.c18
-rwxr-xr-xext/fiddle/win32/fficonfig.h29
-rw-r--r--ext/fiddle/win32/libffi-3.2.1-mswin.patch191
-rwxr-xr-xext/fiddle/win32/libffi-config.rb48
-rwxr-xr-xext/fiddle/win32/libffi.mk.tmpl96
-rw-r--r--ext/gdbm/extconf.rb12
-rw-r--r--ext/gdbm/gdbm.c51
-rwxr-xr-xext/io/console/buildgem.sh5
-rw-r--r--ext/io/console/console.c347
-rw-r--r--ext/io/console/depend21
-rw-r--r--ext/io/console/extconf.rb23
-rw-r--r--ext/io/console/io-console.gemspec8
-rw-r--r--ext/io/console/lib/console/size.rb1
-rw-r--r--ext/io/console/win32_vk.chksum1
-rw-r--r--ext/io/console/win32_vk.inc1400
-rw-r--r--ext/io/console/win32_vk.list166
-rw-r--r--ext/io/nonblock/extconf.rb1
-rw-r--r--ext/io/nonblock/nonblock.c15
-rw-r--r--ext/io/wait/extconf.rb1
-rw-r--r--ext/io/wait/wait.c94
-rw-r--r--ext/json/extconf.rb1
-rw-r--r--ext/json/fbuffer/fbuffer.h11
-rw-r--r--ext/json/generator/depend20
-rw-r--r--ext/json/generator/extconf.rb1
-rw-r--r--ext/json/generator/generator.c85
-rw-r--r--ext/json/generator/generator.h29
-rw-r--r--ext/json/json.gemspec7
-rw-r--r--ext/json/lib/json.rb1
-rw-r--r--ext/json/lib/json/add/bigdecimal.rb1
-rw-r--r--ext/json/lib/json/add/complex.rb7
-rw-r--r--ext/json/lib/json/add/core.rb1
-rw-r--r--ext/json/lib/json/add/date.rb2
-rw-r--r--ext/json/lib/json/add/date_time.rb2
-rw-r--r--ext/json/lib/json/add/exception.rb2
-rw-r--r--ext/json/lib/json/add/ostruct.rb2
-rw-r--r--ext/json/lib/json/add/range.rb2
-rw-r--r--ext/json/lib/json/add/rational.rb6
-rw-r--r--ext/json/lib/json/add/regexp.rb2
-rw-r--r--ext/json/lib/json/add/struct.rb2
-rw-r--r--ext/json/lib/json/add/symbol.rb2
-rw-r--r--ext/json/lib/json/add/time.rb4
-rw-r--r--ext/json/lib/json/common.rb9
-rw-r--r--ext/json/lib/json/ext.rb1
-rw-r--r--ext/json/lib/json/generic_object.rb9
-rw-r--r--ext/json/lib/json/version.rb3
-rw-r--r--ext/json/parser/depend19
-rw-r--r--ext/json/parser/extconf.rb3
-rw-r--r--ext/json/parser/parser.c360
-rw-r--r--ext/json/parser/parser.h23
-rw-r--r--ext/json/parser/parser.rl132
-rw-r--r--ext/json/parser/prereq.mk3
-rw-r--r--ext/mathn/complex/extconf.rb1
-rw-r--r--ext/mathn/rational/extconf.rb1
-rw-r--r--ext/nkf/depend28
-rw-r--r--ext/nkf/extconf.rb1
-rw-r--r--ext/nkf/lib/kconv.rb1
-rw-r--r--ext/nkf/nkf-utf8/nkf.c37
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c2
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h2
-rw-r--r--ext/nkf/nkf.c2
-rw-r--r--ext/objspace/depend80
-rw-r--r--ext/objspace/extconf.rb2
-rw-r--r--ext/objspace/object_tracing.c8
-rw-r--r--ext/objspace/objspace.c295
-rw-r--r--ext/objspace/objspace_dump.c90
-rw-r--r--ext/openssl/depend1097
-rw-r--r--ext/openssl/deprecation.rb1
-rw-r--r--ext/openssl/extconf.rb15
-rw-r--r--ext/openssl/lib/openssl.rb9
-rw-r--r--ext/openssl/lib/openssl/bn.rb17
-rw-r--r--ext/openssl/lib/openssl/buffering.rb10
-rw-r--r--ext/openssl/lib/openssl/cipher.rb10
-rw-r--r--ext/openssl/lib/openssl/config.rb3
-rw-r--r--ext/openssl/lib/openssl/digest.rb11
-rw-r--r--ext/openssl/lib/openssl/pkey.rb37
-rw-r--r--ext/openssl/lib/openssl/ssl.rb270
-rw-r--r--ext/openssl/lib/openssl/x509.rb32
-rw-r--r--ext/openssl/openssl_missing.c18
-rw-r--r--ext/openssl/openssl_missing.h13
-rw-r--r--ext/openssl/ossl.c88
-rw-r--r--ext/openssl/ossl.h24
-rw-r--r--ext/openssl/ossl_asn1.c57
-rw-r--r--ext/openssl/ossl_asn1.h3
-rw-r--r--ext/openssl/ossl_bio.c8
-rw-r--r--ext/openssl/ossl_bio.h4
-rw-r--r--ext/openssl/ossl_bn.c448
-rw-r--r--ext/openssl/ossl_bn.h4
-rw-r--r--ext/openssl/ossl_cipher.c116
-rw-r--r--ext/openssl/ossl_cipher.h4
-rw-r--r--ext/openssl/ossl_config.c18
-rw-r--r--ext/openssl/ossl_config.h5
-rw-r--r--ext/openssl/ossl_digest.c31
-rw-r--r--ext/openssl/ossl_digest.h4
-rw-r--r--ext/openssl/ossl_engine.c55
-rw-r--r--ext/openssl/ossl_engine.h3
-rw-r--r--ext/openssl/ossl_hmac.c23
-rw-r--r--ext/openssl/ossl_hmac.h3
-rw-r--r--ext/openssl/ossl_ns_spki.c32
-rw-r--r--ext/openssl/ossl_ns_spki.h4
-rw-r--r--ext/openssl/ossl_ocsp.c639
-rw-r--r--ext/openssl/ossl_ocsp.h3
-rw-r--r--ext/openssl/ossl_pkcs12.c40
-rw-r--r--ext/openssl/ossl_pkcs12.h4
-rw-r--r--ext/openssl/ossl_pkcs5.c3
-rw-r--r--ext/openssl/ossl_pkcs7.c123
-rw-r--r--ext/openssl/ossl_pkcs7.h4
-rw-r--r--ext/openssl/ossl_pkey.c41
-rw-r--r--ext/openssl/ossl_pkey.h14
-rw-r--r--ext/openssl/ossl_pkey_dh.c88
-rw-r--r--ext/openssl/ossl_pkey_dsa.c24
-rw-r--r--ext/openssl/ossl_pkey_ec.c74
-rw-r--r--ext/openssl/ossl_pkey_rsa.c32
-rw-r--r--ext/openssl/ossl_rand.c108
-rw-r--r--ext/openssl/ossl_rand.h4
-rw-r--r--ext/openssl/ossl_ssl.c714
-rw-r--r--ext/openssl/ossl_ssl.h14
-rw-r--r--ext/openssl/ossl_ssl_session.c37
-rw-r--r--ext/openssl/ossl_version.h3
-rw-r--r--ext/openssl/ossl_x509.c6
-rw-r--r--ext/openssl/ossl_x509.h5
-rw-r--r--ext/openssl/ossl_x509attr.c53
-rw-r--r--ext/openssl/ossl_x509cert.c82
-rw-r--r--ext/openssl/ossl_x509crl.c52
-rw-r--r--ext/openssl/ossl_x509ext.c112
-rw-r--r--ext/openssl/ossl_x509name.c38
-rw-r--r--ext/openssl/ossl_x509req.c44
-rw-r--r--ext/openssl/ossl_x509revoked.c44
-rw-r--r--ext/openssl/ossl_x509store.c73
-rw-r--r--ext/openssl/ruby_missing.h3
-rw-r--r--ext/pathname/extconf.rb2
-rw-r--r--ext/pathname/lib/pathname.rb50
-rw-r--r--ext/pathname/pathname.c23
-rw-r--r--ext/psych/extconf.rb1
-rw-r--r--ext/psych/lib/psych.rb37
-rw-r--r--ext/psych/lib/psych/class_loader.rb1
-rw-r--r--ext/psych/lib/psych/coder.rb1
-rw-r--r--ext/psych/lib/psych/core_ext.rb1
-rw-r--r--ext/psych/lib/psych/deprecated.rb1
-rw-r--r--ext/psych/lib/psych/exception.rb1
-rw-r--r--ext/psych/lib/psych/handler.rb1
-rw-r--r--ext/psych/lib/psych/handlers/document_stream.rb1
-rw-r--r--ext/psych/lib/psych/handlers/recorder.rb1
-rw-r--r--ext/psych/lib/psych/json/ruby_events.rb1
-rw-r--r--ext/psych/lib/psych/json/stream.rb1
-rw-r--r--ext/psych/lib/psych/json/tree_builder.rb1
-rw-r--r--ext/psych/lib/psych/json/yaml_events.rb1
-rw-r--r--ext/psych/lib/psych/nodes.rb1
-rw-r--r--ext/psych/lib/psych/nodes/alias.rb1
-rw-r--r--ext/psych/lib/psych/nodes/document.rb1
-rw-r--r--ext/psych/lib/psych/nodes/mapping.rb1
-rw-r--r--ext/psych/lib/psych/nodes/node.rb1
-rw-r--r--ext/psych/lib/psych/nodes/scalar.rb1
-rw-r--r--ext/psych/lib/psych/nodes/sequence.rb3
-rw-r--r--ext/psych/lib/psych/nodes/stream.rb1
-rw-r--r--ext/psych/lib/psych/omap.rb1
-rw-r--r--ext/psych/lib/psych/parser.rb1
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb3
-rw-r--r--ext/psych/lib/psych/set.rb1
-rw-r--r--ext/psych/lib/psych/stream.rb1
-rw-r--r--ext/psych/lib/psych/streaming.rb1
-rw-r--r--ext/psych/lib/psych/syntax_error.rb1
-rw-r--r--ext/psych/lib/psych/tree_builder.rb1
-rw-r--r--ext/psych/lib/psych/versions.rb4
-rw-r--r--ext/psych/lib/psych/visitors.rb1
-rw-r--r--ext/psych/lib/psych/visitors/depth_first.rb1
-rw-r--r--ext/psych/lib/psych/visitors/emitter.rb1
-rw-r--r--ext/psych/lib/psych/visitors/json_tree.rb1
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb54
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb1
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb196
-rw-r--r--ext/psych/lib/psych/y.rb1
-rw-r--r--ext/psych/lib/psych_jars.rb6
-rw-r--r--ext/psych/psych.c2
-rw-r--r--ext/psych/psych.gemspec37
-rw-r--r--ext/psych/psych_emitter.c90
-rw-r--r--ext/psych/psych_emitter.h2
-rw-r--r--ext/psych/psych_parser.c28
-rw-r--r--ext/psych/psych_parser.h2
-rw-r--r--ext/psych/yaml/api.c2
-rw-r--r--ext/psych/yaml/config.h13
-rw-r--r--ext/psych/yaml/emitter.c6
-rw-r--r--ext/psych/yaml/loader.c16
-rw-r--r--ext/psych/yaml/reader.c4
-rw-r--r--ext/psych/yaml/scanner.c42
-rw-r--r--ext/psych/yaml/yaml_private.h25
-rw-r--r--ext/pty/depend23
-rw-r--r--ext/pty/extconf.rb1
-rw-r--r--ext/pty/lib/expect.rb1
-rw-r--r--ext/pty/pty.c42
-rw-r--r--ext/racc/cparse/cparse.c58
-rw-r--r--ext/racc/cparse/extconf.rb1
-rw-r--r--ext/rbconfig/sizeof/depend18
-rw-r--r--ext/rbconfig/sizeof/extconf.rb34
-rw-r--r--ext/readline/depend22
-rw-r--r--ext/readline/extconf.rb14
-rw-r--r--ext/readline/readline.c71
-rw-r--r--ext/ripper/depend45
-rw-r--r--ext/ripper/eventids2.c523
-rw-r--r--ext/ripper/extconf.rb1
-rw-r--r--ext/ripper/lib/ripper.rb1
-rw-r--r--ext/ripper/lib/ripper/core.rb22
-rw-r--r--ext/ripper/lib/ripper/filter.rb1
-rw-r--r--ext/ripper/lib/ripper/lexer.rb54
-rw-r--r--ext/ripper/lib/ripper/sexp.rb98
-rwxr-xr-xext/ripper/tools/generate-param-macros.rb1
-rwxr-xr-xext/ripper/tools/generate.rb34
-rwxr-xr-xext/ripper/tools/preproc.rb1
-rwxr-xr-xext/ripper/tools/strip.rb1
-rw-r--r--ext/sdbm/_sdbm.c17
-rw-r--r--ext/sdbm/depend21
-rw-r--r--ext/sdbm/extconf.rb1
-rw-r--r--ext/sdbm/init.c55
-rw-r--r--ext/socket/ancdata.c308
-rw-r--r--ext/socket/basicsocket.c113
-rw-r--r--ext/socket/constants.c2
-rw-r--r--ext/socket/depend312
-rw-r--r--ext/socket/extconf.rb93
-rw-r--r--ext/socket/getaddrinfo.c15
-rw-r--r--ext/socket/getnameinfo.c27
-rw-r--r--ext/socket/ifaddr.c28
-rw-r--r--ext/socket/init.c421
-rw-r--r--ext/socket/ipsocket.c42
-rw-r--r--ext/socket/lib/socket.rb524
-rw-r--r--ext/socket/mkconstants.rb60
-rw-r--r--ext/socket/option.c477
-rw-r--r--ext/socket/raddrinfo.c264
-rw-r--r--ext/socket/rubysocket.h102
-rw-r--r--ext/socket/socket.c584
-rw-r--r--ext/socket/sockport.h15
-rw-r--r--ext/socket/sockssocket.c3
-rw-r--r--ext/socket/tcpserver.c44
-rw-r--r--ext/socket/tcpsocket.c6
-rw-r--r--ext/socket/udpsocket.c190
-rw-r--r--ext/socket/unixserver.c43
-rw-r--r--ext/socket/unixsocket.c39
-rw-r--r--ext/stringio/extconf.rb1
-rw-r--r--ext/stringio/stringio.c196
-rw-r--r--ext/strscan/depend24
-rw-r--r--ext/strscan/extconf.rb1
-rw-r--r--ext/strscan/strscan.c123
-rw-r--r--ext/syslog/depend14
-rw-r--r--ext/syslog/extconf.rb1
-rw-r--r--ext/syslog/lib/syslog/logger.rb3
-rw-r--r--ext/syslog/syslog.c14
-rw-r--r--ext/thread/extconf.rb1
-rw-r--r--ext/thread/thread.c598
-rw-r--r--ext/tk/MANUAL_tcltklib.eng14
-rw-r--r--ext/tk/MANUAL_tcltklib.ja12
-rw-r--r--ext/tk/README.macosx-aqua2
-rw-r--r--ext/tk/README.tcltklib2
-rw-r--r--ext/tk/extconf.rb27
-rw-r--r--ext/tk/lib/README2
-rw-r--r--ext/tk/lib/multi-tk.rb35
-rw-r--r--ext/tk/lib/remote-tk.rb9
-rw-r--r--ext/tk/lib/tcltk.rb5
-rw-r--r--ext/tk/lib/tk.rb51
-rw-r--r--ext/tk/lib/tk/after.rb1
-rw-r--r--ext/tk/lib/tk/autoload.rb3
-rw-r--r--ext/tk/lib/tk/bgerror.rb1
-rw-r--r--ext/tk/lib/tk/bindtag.rb1
-rw-r--r--ext/tk/lib/tk/busy.rb1
-rw-r--r--ext/tk/lib/tk/button.rb1
-rw-r--r--ext/tk/lib/tk/canvas.rb1
-rw-r--r--ext/tk/lib/tk/canvastag.rb1
-rw-r--r--ext/tk/lib/tk/checkbutton.rb1
-rw-r--r--ext/tk/lib/tk/clipboard.rb1
-rw-r--r--ext/tk/lib/tk/clock.rb1
-rw-r--r--ext/tk/lib/tk/composite.rb1
-rw-r--r--ext/tk/lib/tk/console.rb1
-rw-r--r--ext/tk/lib/tk/dialog.rb1
-rw-r--r--ext/tk/lib/tk/encodedstr.rb1
-rw-r--r--ext/tk/lib/tk/entry.rb1
-rw-r--r--ext/tk/lib/tk/event.rb1
-rw-r--r--ext/tk/lib/tk/font.rb1
-rw-r--r--ext/tk/lib/tk/fontchooser.rb7
-rw-r--r--ext/tk/lib/tk/frame.rb1
-rw-r--r--ext/tk/lib/tk/grid.rb1
-rw-r--r--ext/tk/lib/tk/image.rb1
-rw-r--r--ext/tk/lib/tk/itemconfig.rb2
-rw-r--r--ext/tk/lib/tk/itemfont.rb1
-rw-r--r--ext/tk/lib/tk/kinput.rb1
-rw-r--r--ext/tk/lib/tk/label.rb1
-rw-r--r--ext/tk/lib/tk/labelframe.rb1
-rw-r--r--ext/tk/lib/tk/listbox.rb1
-rw-r--r--ext/tk/lib/tk/macpkg.rb1
-rw-r--r--ext/tk/lib/tk/menu.rb1
-rw-r--r--ext/tk/lib/tk/menubar.rb3
-rw-r--r--ext/tk/lib/tk/menuspec.rb1
-rw-r--r--ext/tk/lib/tk/message.rb1
-rw-r--r--ext/tk/lib/tk/mngfocus.rb1
-rw-r--r--ext/tk/lib/tk/msgcat.rb1
-rw-r--r--ext/tk/lib/tk/namespace.rb1
-rw-r--r--ext/tk/lib/tk/optiondb.rb7
-rw-r--r--ext/tk/lib/tk/optionobj.rb1
-rw-r--r--ext/tk/lib/tk/pack.rb1
-rw-r--r--ext/tk/lib/tk/package.rb1
-rw-r--r--ext/tk/lib/tk/palette.rb1
-rw-r--r--ext/tk/lib/tk/panedwindow.rb1
-rw-r--r--ext/tk/lib/tk/place.rb1
-rw-r--r--ext/tk/lib/tk/radiobutton.rb1
-rw-r--r--ext/tk/lib/tk/root.rb1
-rw-r--r--ext/tk/lib/tk/scale.rb1
-rw-r--r--ext/tk/lib/tk/scrollable.rb1
-rw-r--r--ext/tk/lib/tk/scrollbar.rb1
-rw-r--r--ext/tk/lib/tk/scrollbox.rb1
-rw-r--r--ext/tk/lib/tk/selection.rb1
-rw-r--r--ext/tk/lib/tk/spinbox.rb1
-rw-r--r--ext/tk/lib/tk/tagfont.rb1
-rw-r--r--ext/tk/lib/tk/text.rb1
-rw-r--r--ext/tk/lib/tk/textimage.rb1
-rw-r--r--ext/tk/lib/tk/textmark.rb1
-rw-r--r--ext/tk/lib/tk/texttag.rb1
-rw-r--r--ext/tk/lib/tk/textwindow.rb1
-rw-r--r--ext/tk/lib/tk/timer.rb5
-rw-r--r--ext/tk/lib/tk/tk_mac.rb159
-rw-r--r--ext/tk/lib/tk/toplevel.rb1
-rw-r--r--ext/tk/lib/tk/ttk_selector.rb1
-rw-r--r--ext/tk/lib/tk/txtwin_abst.rb1
-rw-r--r--ext/tk/lib/tk/validation.rb1
-rw-r--r--ext/tk/lib/tk/variable.rb4
-rw-r--r--ext/tk/lib/tk/virtevent.rb1
-rw-r--r--ext/tk/lib/tk/winfo.rb1
-rw-r--r--ext/tk/lib/tk/winpkg.rb1
-rw-r--r--ext/tk/lib/tk/wm.rb1
-rw-r--r--ext/tk/lib/tk/xim.rb1
-rw-r--r--ext/tk/lib/tkafter.rb1
-rw-r--r--ext/tk/lib/tkbgerror.rb1
-rw-r--r--ext/tk/lib/tkcanvas.rb1
-rw-r--r--ext/tk/lib/tkclass.rb1
-rw-r--r--ext/tk/lib/tkconsole.rb1
-rw-r--r--ext/tk/lib/tkdialog.rb1
-rw-r--r--ext/tk/lib/tkentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/ICONS.rb1
-rw-r--r--ext/tk/lib/tkextlib/ICONS/icons.rb1
-rw-r--r--ext/tk/lib/tkextlib/ICONS/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/SUPPORT_STATUS2
-rw-r--r--ext/tk/lib/tkextlib/blt.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/barchart.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/bitmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/busy.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/component.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/container.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/cutbuffer.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/dragdrop.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/eps.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/graph.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/htext.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/spline.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/stripchart.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/table.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tabnotebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tabset.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/ted.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/button.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/checkbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/frame.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/label.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/radiobutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/scrollbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/toplevel.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tree.rb3
-rw-r--r--ext/tk/lib/tkextlib/blt/treeview.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/unix_dnd.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/vector.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/watch.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/win_printer.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/winop.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/arrowbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/bitmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/button.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/buttonbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/combobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dragsite.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dropsite.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dynamichelp.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/entry.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/label.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/listbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/mainframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/messagedlg.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/notebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/pagesmanager.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panedwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/passwddlg.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressdlg.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollableframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollview.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectcolor.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectfont.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/separator.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/spinbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/statusbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/titleframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/tree.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/widget.rb1
-rw-r--r--ext/tk/lib/tkextlib/itcl.rb1
-rw-r--r--ext/tk/lib/tkextlib/itcl/incr_tcl.rb1
-rw-r--r--ext/tk/lib/tkextlib/itcl/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/itk.rb1
-rw-r--r--ext/tk/lib/tkextlib/itk/incr_tk.rb1
-rw-r--r--ext/tk/lib/tkextlib/itk/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/buttonbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/calendar.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/checkbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/combobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dateentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/datefield.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialogshell.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/entryfield.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/feedback.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/finddialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hierarchy.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/mainwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/menubar.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagebox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagedialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/notebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/optionmenu.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/panedwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/promptdialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/pushbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/radiobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scopedobject.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectionbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/shell.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spindate.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinint.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinner.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spintime.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabset.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timeentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timefield.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/toolbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/watch.rb1
-rwxr-xr-xext/tk/lib/tkextlib/pkg_checker.rb1
-rw-r--r--ext/tk/lib/tkextlib/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/autoscroll.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/calendar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/chatwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/crosshair.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ctext.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/cursor.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dateentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/datefield.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/diagrams.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/getstring.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/history.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ico.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ip_entry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/khim.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/menuentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ntext.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/panelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/plotchart.rb7
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ruler.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/screenruler.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrollwin.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/statusbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/style.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/superframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/swaplist.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_core.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb3
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tkpiechart.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/toolbar.rb3
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tooltip.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/validator.rb66
-rw-r--r--ext/tk/lib/tkextlib/tcllib/widget.rb1
-rw-r--r--ext/tk/lib/tkextlib/tclx.rb1
-rw-r--r--ext/tk/lib/tkextlib/tclx/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tclx/tclx.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/sizegrip.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/style.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tcheckbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tcombobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabel.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tmenubutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tnotebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tpaned.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tprogressbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tradiobutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/treeview.rb31
-rw-r--r--ext/tk/lib/tkextlib/tile/tscale.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tscrollbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tseparator.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tspinbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tsquare.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND/shape.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND/tkdnd.rb3
-rw-r--r--ext/tk/lib/tkextlib/tkHTML.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/bmp.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/dted.rb34
-rw-r--r--ext/tk/lib/tkextlib/tkimg/gif.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ico.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/jpeg.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/pcx.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/pixmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/png.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ppm.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ps.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/raw.rb34
-rw-r--r--ext/tk/lib/tkextlib/tkimg/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/sgi.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/sun.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/tga.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/tiff.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/window.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/xbm.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/xpm.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktable.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktable/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktable/tktable.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktrans.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktrans/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktrans/tktrans.rb1
-rw-r--r--ext/tk/lib/tkextlib/treectrl.rb1
-rw-r--r--ext/tk/lib/tkextlib/treectrl/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/treectrl/tktreectrl.rb1
-rw-r--r--ext/tk/lib/tkextlib/trofs.rb1
-rw-r--r--ext/tk/lib/tkextlib/trofs/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/trofs/trofs.rb1
-rw-r--r--ext/tk/lib/tkextlib/version.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/bargraph.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/charts.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/dial.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/pie.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/spinbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/winico.rb1
-rw-r--r--ext/tk/lib/tkextlib/winico/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/winico/winico.rb1
-rw-r--r--ext/tk/lib/tkfont.rb1
-rw-r--r--ext/tk/lib/tkmacpkg.rb1
-rw-r--r--ext/tk/lib/tkmenubar.rb1
-rw-r--r--ext/tk/lib/tkmngfocus.rb1
-rw-r--r--ext/tk/lib/tkpalette.rb1
-rw-r--r--ext/tk/lib/tkscrollbox.rb1
-rw-r--r--ext/tk/lib/tktext.rb1
-rw-r--r--ext/tk/lib/tkvirtevent.rb1
-rw-r--r--ext/tk/lib/tkwinpkg.rb1
-rw-r--r--ext/tk/old-extconf.rb1
-rw-r--r--ext/tk/sample/24hr_clock.rb1
-rw-r--r--ext/tk/sample/binding_sample.rb1
-rw-r--r--ext/tk/sample/bindtag_sample.rb1
-rw-r--r--ext/tk/sample/binstr_usage.rb1
-rw-r--r--ext/tk/sample/btn_with_frame.rb1
-rw-r--r--ext/tk/sample/cd_timer.rb1
-rw-r--r--ext/tk/sample/cmd_res_test.rb1
-rw-r--r--ext/tk/sample/demos-en/anilabel.rb1
-rw-r--r--ext/tk/sample/demos-en/aniwave.rb1
-rw-r--r--ext/tk/sample/demos-en/arrow.rb1
-rw-r--r--ext/tk/sample/demos-en/bind.rb1
-rw-r--r--ext/tk/sample/demos-en/bitmap.rb1
-rw-r--r--ext/tk/sample/demos-en/button.rb1
-rw-r--r--ext/tk/sample/demos-en/check.rb1
-rw-r--r--ext/tk/sample/demos-en/check2.rb1
-rw-r--r--ext/tk/sample/demos-en/clrpick.rb1
-rw-r--r--ext/tk/sample/demos-en/colors.rb1
-rw-r--r--ext/tk/sample/demos-en/combo.rb3
-rw-r--r--ext/tk/sample/demos-en/cscroll.rb1
-rw-r--r--ext/tk/sample/demos-en/ctext.rb1
-rw-r--r--ext/tk/sample/demos-en/dialog1.rb1
-rw-r--r--ext/tk/sample/demos-en/dialog2.rb1
-rw-r--r--ext/tk/sample/demos-en/entry1.rb1
-rw-r--r--ext/tk/sample/demos-en/entry2.rb1
-rw-r--r--ext/tk/sample/demos-en/entry3.rb1
-rw-r--r--ext/tk/sample/demos-en/filebox.rb1
-rw-r--r--ext/tk/sample/demos-en/floor.rb1
-rw-r--r--ext/tk/sample/demos-en/floor2.rb1
-rw-r--r--ext/tk/sample/demos-en/form.rb1
-rw-r--r--ext/tk/sample/demos-en/goldberg.rb1
-rw-r--r--ext/tk/sample/demos-en/hscale.rb1
-rw-r--r--ext/tk/sample/demos-en/icon.rb1
-rw-r--r--ext/tk/sample/demos-en/image1.rb1
-rw-r--r--ext/tk/sample/demos-en/image2.rb1
-rw-r--r--ext/tk/sample/demos-en/image3.rb1
-rw-r--r--ext/tk/sample/demos-en/items.rb1
-rw-r--r--ext/tk/sample/demos-en/knightstour.rb1
-rw-r--r--ext/tk/sample/demos-en/label.rb1
-rw-r--r--ext/tk/sample/demos-en/labelframe.rb1
-rw-r--r--ext/tk/sample/demos-en/mclist.rb1
-rw-r--r--ext/tk/sample/demos-en/menu.rb1
-rw-r--r--ext/tk/sample/demos-en/menu84.rb1
-rw-r--r--ext/tk/sample/demos-en/menubu.rb1
-rw-r--r--ext/tk/sample/demos-en/msgbox.rb1
-rw-r--r--ext/tk/sample/demos-en/msgbox2.rb1
-rw-r--r--ext/tk/sample/demos-en/paned1.rb1
-rw-r--r--ext/tk/sample/demos-en/paned2.rb1
-rw-r--r--ext/tk/sample/demos-en/pendulum.rb1
-rw-r--r--ext/tk/sample/demos-en/plot.rb1
-rw-r--r--ext/tk/sample/demos-en/puzzle.rb1
-rw-r--r--ext/tk/sample/demos-en/radio.rb1
-rw-r--r--ext/tk/sample/demos-en/radio2.rb1
-rw-r--r--ext/tk/sample/demos-en/radio3.rb1
-rw-r--r--ext/tk/sample/demos-en/rolodex2
-rw-r--r--ext/tk/sample/demos-en/ruler.rb1
-rw-r--r--ext/tk/sample/demos-en/sayings.rb1
-rw-r--r--ext/tk/sample/demos-en/search.rb1
-rw-r--r--ext/tk/sample/demos-en/spin.rb1
-rw-r--r--ext/tk/sample/demos-en/states.rb1
-rw-r--r--ext/tk/sample/demos-en/style.rb1
-rw-r--r--ext/tk/sample/demos-en/text.rb1
-rw-r--r--ext/tk/sample/demos-en/textpeer.rb1
-rw-r--r--ext/tk/sample/demos-en/tkencoding.rb1
-rw-r--r--ext/tk/sample/demos-en/toolbar.rb1
-rw-r--r--ext/tk/sample/demos-en/tree.rb1
-rw-r--r--ext/tk/sample/demos-en/ttkbut.rb1
-rw-r--r--ext/tk/sample/demos-en/ttkmenu.rb1
-rw-r--r--ext/tk/sample/demos-en/ttknote.rb1
-rw-r--r--ext/tk/sample/demos-en/ttkpane.rb1
-rw-r--r--ext/tk/sample/demos-en/ttkprogress.rb1
-rw-r--r--ext/tk/sample/demos-en/twind.rb1
-rw-r--r--ext/tk/sample/demos-en/twind2.rb1
-rw-r--r--ext/tk/sample/demos-en/unicodeout.rb1
-rw-r--r--ext/tk/sample/demos-en/vscale.rb1
-rw-r--r--ext/tk/sample/demos-jp/anilabel.rb1
-rw-r--r--ext/tk/sample/demos-jp/aniwave.rb1
-rw-r--r--ext/tk/sample/demos-jp/arrow.rb1
-rw-r--r--ext/tk/sample/demos-jp/bind.rb1
-rw-r--r--ext/tk/sample/demos-jp/bitmap.rb1
-rw-r--r--ext/tk/sample/demos-jp/button.rb1
-rw-r--r--ext/tk/sample/demos-jp/check.rb1
-rw-r--r--ext/tk/sample/demos-jp/check2.rb1
-rw-r--r--ext/tk/sample/demos-jp/clrpick.rb1
-rw-r--r--ext/tk/sample/demos-jp/colors.rb1
-rw-r--r--ext/tk/sample/demos-jp/combo.rb1
-rw-r--r--ext/tk/sample/demos-jp/cscroll.rb1
-rw-r--r--ext/tk/sample/demos-jp/ctext.rb1
-rw-r--r--ext/tk/sample/demos-jp/dialog1.rb1
-rw-r--r--ext/tk/sample/demos-jp/dialog2.rb1
-rw-r--r--ext/tk/sample/demos-jp/entry1.rb1
-rw-r--r--ext/tk/sample/demos-jp/entry2.rb1
-rw-r--r--ext/tk/sample/demos-jp/entry3.rb1
-rw-r--r--ext/tk/sample/demos-jp/filebox.rb1
-rw-r--r--ext/tk/sample/demos-jp/floor.rb1
-rw-r--r--ext/tk/sample/demos-jp/floor2.rb1
-rw-r--r--ext/tk/sample/demos-jp/form.rb1
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb1
-rw-r--r--ext/tk/sample/demos-jp/hscale.rb1
-rw-r--r--ext/tk/sample/demos-jp/icon.rb1
-rw-r--r--ext/tk/sample/demos-jp/image1.rb1
-rw-r--r--ext/tk/sample/demos-jp/image2.rb1
-rw-r--r--ext/tk/sample/demos-jp/image3.rb1
-rw-r--r--ext/tk/sample/demos-jp/items.rb1
-rw-r--r--ext/tk/sample/demos-jp/knightstour.rb1
-rw-r--r--ext/tk/sample/demos-jp/label.rb1
-rw-r--r--ext/tk/sample/demos-jp/labelframe.rb1
-rw-r--r--ext/tk/sample/demos-jp/mclist.rb1
-rw-r--r--ext/tk/sample/demos-jp/menu.rb1
-rw-r--r--ext/tk/sample/demos-jp/menu84.rb1
-rw-r--r--ext/tk/sample/demos-jp/menu8x.rb1
-rw-r--r--ext/tk/sample/demos-jp/menubu.rb1
-rw-r--r--ext/tk/sample/demos-jp/msgbox.rb1
-rw-r--r--ext/tk/sample/demos-jp/msgbox2.rb1
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb1
-rw-r--r--ext/tk/sample/demos-jp/paned2.rb1
-rw-r--r--ext/tk/sample/demos-jp/pendulum.rb1
-rw-r--r--ext/tk/sample/demos-jp/plot.rb1
-rw-r--r--ext/tk/sample/demos-jp/puzzle.rb1
-rw-r--r--ext/tk/sample/demos-jp/radio.rb1
-rw-r--r--ext/tk/sample/demos-jp/radio2.rb1
-rw-r--r--ext/tk/sample/demos-jp/radio3.rb1
-rw-r--r--ext/tk/sample/demos-jp/rolodex2
-rw-r--r--ext/tk/sample/demos-jp/ruler.rb1
-rw-r--r--ext/tk/sample/demos-jp/sayings.rb1
-rw-r--r--ext/tk/sample/demos-jp/search.rb1
-rw-r--r--ext/tk/sample/demos-jp/spin.rb1
-rw-r--r--ext/tk/sample/demos-jp/states.rb1
-rw-r--r--ext/tk/sample/demos-jp/style.rb1
-rw-r--r--ext/tk/sample/demos-jp/text.rb1
-rw-r--r--ext/tk/sample/demos-jp/textpeer.rb1
-rw-r--r--ext/tk/sample/demos-jp/toolbar.rb1
-rw-r--r--ext/tk/sample/demos-jp/tree.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttkbut.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttkmenu.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttknote.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttkpane.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttkprogress.rb1
-rw-r--r--ext/tk/sample/demos-jp/twind.rb1
-rw-r--r--ext/tk/sample/demos-jp/twind2.rb1
-rw-r--r--ext/tk/sample/demos-jp/unicodeout.rb1
-rw-r--r--ext/tk/sample/demos-jp/vscale.rb1
-rw-r--r--ext/tk/sample/editable_listbox.rb1
-rw-r--r--ext/tk/sample/encstr_usage.rb1
-rw-r--r--ext/tk/sample/figmemo_sample.rb3
-rw-r--r--ext/tk/sample/irbtk.rb1
-rw-r--r--ext/tk/sample/menubar1.rb3
-rw-r--r--ext/tk/sample/menubar2.rb5
-rw-r--r--ext/tk/sample/menubar3.rb3
-rw-r--r--ext/tk/sample/multi-ip_sample.rb1
-rw-r--r--ext/tk/sample/multi-ip_sample2.rb1
-rw-r--r--ext/tk/sample/optobj_sample.rb1
-rw-r--r--ext/tk/sample/propagate.rb1
-rw-r--r--ext/tk/sample/remote-ip_sample.rb1
-rw-r--r--ext/tk/sample/remote-ip_sample2.rb1
-rwxr-xr-x[-rw-r--r--]ext/tk/sample/safe-tk.rb4
-rw-r--r--ext/tk/sample/scrollframe.rb1
-rw-r--r--ext/tk/sample/tcltklib/lines1.rb1
-rw-r--r--ext/tk/sample/tcltklib/lines2.rb1
-rw-r--r--ext/tk/sample/tcltklib/lines3.rb1
-rw-r--r--ext/tk/sample/tcltklib/lines4.rb1
-rw-r--r--ext/tk/sample/tcltklib/safeTk.rb1
-rw-r--r--ext/tk/sample/tcltklib/sample0.rb1
-rw-r--r--ext/tk/sample/tcltklib/sample1.rb1
-rw-r--r--ext/tk/sample/tcltklib/sample2.rb1
-rw-r--r--ext/tk/sample/tkalignbox.rb1
-rw-r--r--ext/tk/sample/tkballoonhelp.rb1
-rw-r--r--ext/tk/sample/tkbiff.rb1
-rw-r--r--ext/tk/sample/tkbrowse.rb1
-rw-r--r--ext/tk/sample/tkcombobox.rb1
-rw-r--r--ext/tk/sample/tkdialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/ICONS/viewIcons.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/barchart5.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/calendar.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph6.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7a.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7b.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7c.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/pareto.rb3
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1b.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/scripts/stipples.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/winop1.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/winop2.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/basic.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/dnd.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/manager.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/select.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tmpldlg.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tree.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/shell.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/watch.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/datefield.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos1.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos2.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos3.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/xyplot.rb1
-rw-r--r--ext/tk/sample/tkextlib/tile/demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc.rb1
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/hv.rb1
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/index.html2
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/ss.rb1
-rw-r--r--ext/tk/sample/tkextlib/tkimg/demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/basic.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/buttons.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/command.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/debug.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/dynarows.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/maxsize.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/spreadsheet.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/valid.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/bitmaps.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/explorer.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/help.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/imovie.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/layout.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/mailwasher.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-folders.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/random.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/www-options.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/canvItems.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker2.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/dial_demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/oscilloscope.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/pie.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/vu_demo.rb1
-rw-r--r--ext/tk/sample/tkfrom.rb1
-rw-r--r--ext/tk/sample/tkhello.rb1
-rw-r--r--ext/tk/sample/tkline.rb1
-rw-r--r--ext/tk/sample/tkmenubutton.rb1
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb.rb1
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb2.rb1
-rw-r--r--ext/tk/sample/tkmsgcat-load_tk.rb1
-rw-r--r--ext/tk/sample/tkmulticolumnlist.rb1
-rw-r--r--ext/tk/sample/tkmultilistbox.rb1
-rw-r--r--ext/tk/sample/tkmultilistframe.rb1
-rwxr-xr-x[-rw-r--r--]ext/tk/sample/tkoptdb-safeTk.rb3
-rw-r--r--ext/tk/sample/tkoptdb.rb1
-rw-r--r--ext/tk/sample/tkrttimer.rb1
-rw-r--r--ext/tk/sample/tksleep_sample.rb1
-rw-r--r--ext/tk/sample/tktextframe.rb1
-rw-r--r--ext/tk/sample/tktextio.rb3
-rw-r--r--ext/tk/sample/tktimer.rb1
-rw-r--r--ext/tk/sample/tktimer2.rb1
-rw-r--r--ext/tk/sample/tktimer3.rb1
-rw-r--r--ext/tk/sample/tktree.rb1
-rw-r--r--ext/tk/sample/ttk_wrapper.rb1
-rw-r--r--ext/tk/stubs.c36
-rw-r--r--ext/tk/stubs.h10
-rw-r--r--ext/tk/tcltklib.c460
-rw-r--r--ext/tk/tkutil/extconf.rb12
-rw-r--r--ext/tk/tkutil/tkutil.c501
-rw-r--r--ext/win32/extconf.rb3
-rw-r--r--ext/win32/lib/Win32API.rb23
-rw-r--r--ext/win32/lib/win32/importer.rb11
-rw-r--r--ext/win32/lib/win32/registry.rb55
-rw-r--r--ext/win32/lib/win32/resolv.rb16
-rw-r--r--ext/win32/lib/win32/sspi.rb1
-rw-r--r--ext/win32ole/depend13
-rw-r--r--ext/win32ole/extconf.rb1
-rw-r--r--ext/win32ole/lib/win32ole/property.rb1
-rw-r--r--ext/win32ole/sample/excel1.rb6
-rw-r--r--ext/win32ole/sample/excel2.rb11
-rw-r--r--ext/win32ole/sample/excel3.rb8
-rw-r--r--ext/win32ole/sample/ie.rb1
-rw-r--r--ext/win32ole/sample/ieconst.rb1
-rw-r--r--ext/win32ole/sample/ienavi.rb1
-rw-r--r--ext/win32ole/sample/ienavi2.rb1
-rw-r--r--ext/win32ole/sample/oledirs.rb1
-rw-r--r--ext/win32ole/sample/olegen.rb1
-rw-r--r--ext/win32ole/sample/xml.rb1
-rw-r--r--ext/win32ole/win32ole.c6318
-rw-r--r--ext/win32ole/win32ole.h155
-rw-r--r--ext/win32ole/win32ole_error.c83
-rw-r--r--ext/win32ole/win32ole_error.h8
-rw-r--r--ext/win32ole/win32ole_event.c1278
-rw-r--r--ext/win32ole/win32ole_event.h6
-rw-r--r--ext/win32ole/win32ole_method.c950
-rw-r--r--ext/win32ole/win32ole_method.h16
-rw-r--r--ext/win32ole/win32ole_param.c438
-rw-r--r--ext/win32ole/win32ole_param.h8
-rw-r--r--ext/win32ole/win32ole_record.c604
-rw-r--r--ext/win32ole/win32ole_record.h10
-rw-r--r--ext/win32ole/win32ole_type.c915
-rw-r--r--ext/win32ole/win32ole_type.h8
-rw-r--r--ext/win32ole/win32ole_typelib.c844
-rw-r--r--ext/win32ole/win32ole_typelib.h11
-rw-r--r--ext/win32ole/win32ole_variable.c380
-rw-r--r--ext/win32ole/win32ole_variable.h8
-rw-r--r--ext/win32ole/win32ole_variant.c732
-rw-r--r--ext/win32ole/win32ole_variant.h9
-rw-r--r--ext/win32ole/win32ole_variant_m.c149
-rw-r--r--ext/win32ole/win32ole_variant_m.h7
-rw-r--r--ext/zlib/extconf.rb4
-rw-r--r--ext/zlib/zlib.c205
-rw-r--r--file.c839
-rw-r--r--gc.c5744
-rw-r--r--gc.h15
-rw-r--r--gem_prelude.rb8
-rw-r--r--gems/bundled_gems6
-rw-r--r--goruby.c6
-rw-r--r--hash.c904
-rw-r--r--id_table.c1583
-rw-r--r--id_table.h30
-rw-r--r--include/ruby/backward/classext.h2
-rw-r--r--include/ruby/backward/rubyio.h2
-rw-r--r--include/ruby/backward/rubysig.h7
-rw-r--r--include/ruby/backward/st.h2
-rw-r--r--include/ruby/backward/util.h2
-rw-r--r--include/ruby/defines.h105
-rw-r--r--include/ruby/encoding.h212
-rw-r--r--include/ruby/intern.h232
-rw-r--r--include/ruby/io.h59
-rw-r--r--include/ruby/missing.h38
-rw-r--r--include/ruby/oniguruma.h54
-rw-r--r--include/ruby/re.h1
-rw-r--r--include/ruby/ruby.h1152
-rw-r--r--include/ruby/st.h7
-rw-r--r--include/ruby/thread_native.h56
-rw-r--r--include/ruby/util.h15
-rw-r--r--include/ruby/version.h4
-rw-r--r--include/ruby/win32.h121
-rw-r--r--inits.c6
-rw-r--r--insns.def470
-rw-r--r--internal.h739
-rw-r--r--io.c1930
-rw-r--r--iseq.c1576
-rw-r--r--iseq.h157
-rw-r--r--lex.c.blt197
-rw-r--r--lib/English.rb5
-rw-r--r--[-rwxr-xr-x]lib/abbrev.rb96
-rw-r--r--lib/base64.rb22
-rw-r--r--lib/benchmark.rb56
-rw-r--r--lib/cgi.rb5
-rw-r--r--lib/cgi/cookie.rb60
-rw-r--r--lib/cgi/core.rb46
-rw-r--r--lib/cgi/html.rb3
-rw-r--r--lib/cgi/session.rb29
-rw-r--r--lib/cgi/session/pstore.rb14
-rw-r--r--lib/cgi/util.rb22
-rw-r--r--lib/cmath.rb263
-rw-r--r--lib/complex.rb28
-rw-r--r--lib/csv.rb157
-rw-r--r--lib/debug.rb24
-rw-r--r--lib/delegate.rb75
-rw-r--r--lib/drb.rb1
-rw-r--r--lib/drb/acl.rb21
-rw-r--r--lib/drb/drb.rb77
-rw-r--r--lib/drb/eq.rb1
-rw-r--r--lib/drb/extserv.rb31
-rw-r--r--lib/drb/extservm.rb3
-rw-r--r--lib/drb/gw.rb1
-rw-r--r--lib/drb/invokemethod.rb1
-rw-r--r--lib/drb/observer.rb1
-rw-r--r--lib/drb/ssl.rb6
-rw-r--r--lib/drb/timeridconv.rb41
-rw-r--r--lib/drb/unix.rb7
-rw-r--r--lib/e2mmap.rb5
-rw-r--r--lib/erb.rb48
-rw-r--r--lib/fileutils.rb185
-rw-r--r--lib/find.rb8
-rw-r--r--lib/forwardable.rb62
-rw-r--r--lib/getoptlong.rb3
-rw-r--r--lib/gserver.rb310
-rw-r--r--lib/ipaddr.rb282
-rw-r--r--lib/irb.rb45
-rw-r--r--lib/irb/cmd/chws.rb7
-rw-r--r--lib/irb/cmd/fork.rb30
-rw-r--r--lib/irb/cmd/help.rb1
-rw-r--r--lib/irb/cmd/load.rb49
-rw-r--r--lib/irb/cmd/nop.rb12
-rw-r--r--lib/irb/cmd/pushws.rb11
-rw-r--r--lib/irb/cmd/subirb.rb9
-rw-r--r--lib/irb/completion.rb265
-rw-r--r--lib/irb/context.rb176
-rw-r--r--lib/irb/ext/change-ws.rb35
-rw-r--r--lib/irb/ext/history.rb59
-rw-r--r--lib/irb/ext/loader.rb119
-rw-r--r--lib/irb/ext/math-mode.rb9
-rw-r--r--lib/irb/ext/multi-irb.rb176
-rw-r--r--lib/irb/ext/save-history.rb69
-rw-r--r--lib/irb/ext/tracer.rb27
-rw-r--r--lib/irb/ext/use-loader.rb29
-rw-r--r--lib/irb/ext/workspaces.rb27
-rw-r--r--lib/irb/extend-command.rb219
-rw-r--r--lib/irb/frame.rb5
-rw-r--r--lib/irb/help.rb19
-rw-r--r--lib/irb/init.rb213
-rw-r--r--lib/irb/input-method.rb37
-rw-r--r--lib/irb/inspector.rb15
-rw-r--r--lib/irb/lc/error.rb1
-rw-r--r--lib/irb/lc/ja/encoding_aliases.rb1
-rw-r--r--lib/irb/lc/ja/error.rb1
-rw-r--r--lib/irb/locale.rb72
-rw-r--r--lib/irb/magic-file.rb1
-rw-r--r--lib/irb/notifier.rb81
-rw-r--r--lib/irb/output-method.rb7
-rw-r--r--lib/irb/ruby-lex.rb704
-rw-r--r--lib/irb/ruby-token.rb30
-rw-r--r--lib/irb/slex.rb262
-rw-r--r--lib/irb/src_encoding.rb1
-rw-r--r--lib/irb/version.rb1
-rw-r--r--lib/irb/workspace.rb115
-rw-r--r--lib/irb/ws-for-case-2.rb1
-rw-r--r--lib/irb/xmp.rb39
-rw-r--r--lib/logger.rb310
-rw-r--r--lib/mathn.rb152
-rw-r--r--lib/matrix.rb345
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb215
-rw-r--r--lib/matrix/lup_decomposition.rb1
-rw-r--r--lib/minitest/.document2
-rw-r--r--lib/minitest/autorun.rb19
-rw-r--r--lib/minitest/hell.rb20
-rw-r--r--lib/minitest/parallel_each.rb80
-rw-r--r--lib/minitest/pride.rb119
-rw-r--r--lib/minitest/spec.rb551
-rw-r--r--lib/mkmf.rb209
-rw-r--r--lib/monitor.rb3
-rw-r--r--lib/mutex_m.rb1
-rw-r--r--lib/net/ftp.rb464
-rw-r--r--lib/net/http.rb75
-rw-r--r--lib/net/http/backward.rb1
-rw-r--r--lib/net/http/exceptions.rb1
-rw-r--r--lib/net/http/generic_request.rb69
-rw-r--r--lib/net/http/header.rb37
-rw-r--r--lib/net/http/proxy_delta.rb1
-rw-r--r--lib/net/http/request.rb1
-rw-r--r--lib/net/http/requests.rb3
-rw-r--r--lib/net/http/response.rb20
-rw-r--r--lib/net/http/responses.rb6
-rw-r--r--lib/net/https.rb3
-rw-r--r--lib/net/imap.rb552
-rw-r--r--lib/net/pop.rb1
-rw-r--r--lib/net/protocol.rb56
-rw-r--r--lib/net/smtp.rb34
-rw-r--r--lib/net/telnet.rb763
-rw-r--r--lib/observer.rb3
-rw-r--r--lib/open-uri.rb40
-rw-r--r--lib/open3.rb60
-rw-r--r--lib/optionparser.rb2
-rw-r--r--lib/optparse.rb356
-rw-r--r--lib/optparse/ac.rb1
-rw-r--r--lib/optparse/date.rb1
-rw-r--r--lib/optparse/shellwords.rb1
-rw-r--r--lib/optparse/time.rb1
-rw-r--r--lib/optparse/uri.rb1
-rw-r--r--lib/optparse/version.rb3
-rw-r--r--lib/ostruct.rb60
-rw-r--r--lib/pp.rb12
-rw-r--r--lib/prettyprint.rb30
-rw-r--r--lib/prime.rb132
-rw-r--r--lib/profile.rb1
-rw-r--r--lib/profiler.rb1
-rw-r--r--lib/pstore.rb25
-rw-r--r--lib/racc/parser.rb3
-rw-r--r--lib/racc/rdoc/grammar.en.rdoc83
-rw-r--r--lib/rake.rb73
-rw-r--r--lib/rake/alt_system.rb108
-rw-r--r--lib/rake/application.rb728
-rw-r--r--lib/rake/backtrace.rb20
-rw-r--r--lib/rake/clean.rb55
-rw-r--r--lib/rake/cloneable.rb16
-rw-r--r--lib/rake/contrib/compositepublisher.rb21
-rw-r--r--lib/rake/contrib/ftptools.rb139
-rw-r--r--lib/rake/contrib/publisher.rb73
-rw-r--r--lib/rake/contrib/rubyforgepublisher.rb16
-rw-r--r--lib/rake/contrib/sshpublisher.rb50
-rw-r--r--lib/rake/contrib/sys.rb2
-rw-r--r--lib/rake/default_loader.rb10
-rw-r--r--lib/rake/dsl_definition.rb157
-rw-r--r--lib/rake/early_time.rb18
-rw-r--r--lib/rake/ext/core.rb28
-rw-r--r--lib/rake/ext/module.rb1
-rw-r--r--lib/rake/ext/string.rb166
-rw-r--r--lib/rake/ext/time.rb15
-rw-r--r--lib/rake/file_creation_task.rb24
-rw-r--r--lib/rake/file_list.rb416
-rw-r--r--lib/rake/file_task.rb46
-rw-r--r--lib/rake/file_utils.rb116
-rw-r--r--lib/rake/file_utils_ext.rb144
-rw-r--r--lib/rake/gempackagetask.rb2
-rw-r--r--lib/rake/invocation_chain.rb57
-rw-r--r--lib/rake/invocation_exception_mixin.rb16
-rw-r--r--lib/rake/lib/.document1
-rw-r--r--lib/rake/lib/project.rake21
-rw-r--r--lib/rake/linked_list.rb103
-rw-r--r--lib/rake/loaders/makefile.rb40
-rw-r--r--lib/rake/multi_task.rb13
-rw-r--r--lib/rake/name_space.rb25
-rw-r--r--lib/rake/packagetask.rb190
-rw-r--r--lib/rake/pathmap.rb1
-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/pseudo_status.rb29
-rw-r--r--lib/rake/rake_module.rb37
-rw-r--r--lib/rake/rake_test_loader.rb22
-rw-r--r--lib/rake/rdoctask.rb2
-rw-r--r--lib/rake/ruby182_test_unit_fix.rb27
-rw-r--r--lib/rake/rule_recursion_overflow_error.rb20
-rw-r--r--lib/rake/runtest.rb22
-rw-r--r--lib/rake/scope.rb42
-rw-r--r--lib/rake/task.rb378
-rw-r--r--lib/rake/task_argument_error.rb7
-rw-r--r--lib/rake/task_arguments.rb89
-rw-r--r--lib/rake/task_manager.rb297
-rw-r--r--lib/rake/tasklib.rb22
-rw-r--r--lib/rake/testtask.rb201
-rw-r--r--lib/rake/thread_history_display.rb48
-rw-r--r--lib/rake/thread_pool.rb161
-rw-r--r--lib/rake/trace_output.rb22
-rw-r--r--lib/rake/version.rb9
-rw-r--r--lib/rake/win32.rb56
-rw-r--r--lib/rational.rb23
-rw-r--r--lib/rbconfig/datadir.rb1
-rw-r--r--lib/rbconfig/obsolete.rb38
-rw-r--r--lib/rdoc.rb7
-rw-r--r--lib/rdoc/alias.rb1
-rw-r--r--lib/rdoc/anon_class.rb1
-rw-r--r--lib/rdoc/any_method.rb11
-rw-r--r--lib/rdoc/attr.rb1
-rw-r--r--lib/rdoc/class_module.rb1
-rw-r--r--lib/rdoc/code_object.rb1
-rw-r--r--lib/rdoc/code_objects.rb1
-rw-r--r--lib/rdoc/comment.rb1
-rw-r--r--lib/rdoc/constant.rb1
-rw-r--r--lib/rdoc/context.rb12
-rw-r--r--lib/rdoc/context/section.rb1
-rw-r--r--lib/rdoc/cross_reference.rb1
-rw-r--r--lib/rdoc/encoding.rb5
-rw-r--r--lib/rdoc/erb_partial.rb1
-rw-r--r--lib/rdoc/erbio.rb1
-rw-r--r--lib/rdoc/extend.rb1
-rw-r--r--lib/rdoc/generator.rb2
-rw-r--r--lib/rdoc/generator/darkfish.rb6
-rw-r--r--lib/rdoc/generator/json_index.rb50
-rw-r--r--lib/rdoc/generator/markup.rb1
-rw-r--r--lib/rdoc/generator/pot.rb98
-rw-r--r--lib/rdoc/generator/pot/message_extractor.rb68
-rw-r--r--lib/rdoc/generator/pot/po.rb84
-rw-r--r--lib/rdoc/generator/pot/po_entry.rb141
-rw-r--r--lib/rdoc/generator/ri.rb1
-rw-r--r--lib/rdoc/generator/template/darkfish/_footer.rhtml4
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml21
-rw-r--r--lib/rdoc/generator/template/darkfish/css/fonts.css (renamed from lib/rdoc/generator/template/darkfish/fonts.css)0
-rw-r--r--lib/rdoc/generator/template/darkfish/css/rdoc.css (renamed from lib/rdoc/generator/template/darkfish/rdoc.css)12
-rw-r--r--[-rwxr-xr-x]lib/rdoc/generator/template/darkfish/images/add.pngbin733 -> 733 bytes-rw-r--r--[-rwxr-xr-x]lib/rdoc/generator/template/darkfish/images/arrow_up.pngbin372 -> 372 bytes-rw-r--r--[-rwxr-xr-x]lib/rdoc/generator/template/darkfish/images/delete.pngbin715 -> 715 bytes-rw-r--r--[-rwxr-xr-x]lib/rdoc/generator/template/darkfish/images/tag_blue.pngbin1880 -> 1880 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/js/darkfish.js43
-rw-r--r--lib/rdoc/generator/template/darkfish/js/jquery.js22
-rw-r--r--lib/rdoc/generator/template/json_index/js/searcher.js4
-rw-r--r--lib/rdoc/ghost_method.rb1
-rw-r--r--lib/rdoc/i18n.rb10
-rw-r--r--lib/rdoc/i18n/locale.rb102
-rw-r--r--lib/rdoc/i18n/text.rb126
-rw-r--r--lib/rdoc/include.rb1
-rw-r--r--lib/rdoc/known_classes.rb2
-rw-r--r--lib/rdoc/markdown.rb177
-rw-r--r--lib/rdoc/markdown/entities.rb1
-rw-r--r--lib/rdoc/markdown/literals_1_9.rb1
-rw-r--r--lib/rdoc/markup.rb5
-rw-r--r--lib/rdoc/markup/attr_changer.rb1
-rw-r--r--lib/rdoc/markup/attr_span.rb1
-rw-r--r--lib/rdoc/markup/attribute_manager.rb3
-rw-r--r--lib/rdoc/markup/attributes.rb1
-rw-r--r--lib/rdoc/markup/blank_line.rb1
-rw-r--r--lib/rdoc/markup/block_quote.rb1
-rw-r--r--lib/rdoc/markup/document.rb1
-rw-r--r--lib/rdoc/markup/formatter.rb1
-rw-r--r--lib/rdoc/markup/formatter_test_case.rb1
-rw-r--r--lib/rdoc/markup/hard_break.rb1
-rw-r--r--lib/rdoc/markup/heading.rb1
-rw-r--r--lib/rdoc/markup/include.rb1
-rw-r--r--lib/rdoc/markup/indented_paragraph.rb1
-rw-r--r--lib/rdoc/markup/inline.rb1
-rw-r--r--lib/rdoc/markup/list.rb1
-rw-r--r--lib/rdoc/markup/list_item.rb1
-rw-r--r--lib/rdoc/markup/paragraph.rb1
-rw-r--r--lib/rdoc/markup/parser.rb1
-rw-r--r--lib/rdoc/markup/pre_process.rb1
-rw-r--r--lib/rdoc/markup/raw.rb1
-rw-r--r--lib/rdoc/markup/rule.rb1
-rw-r--r--lib/rdoc/markup/special.rb1
-rw-r--r--lib/rdoc/markup/text_formatter_test_case.rb1
-rw-r--r--lib/rdoc/markup/to_ansi.rb1
-rw-r--r--lib/rdoc/markup/to_bs.rb1
-rw-r--r--lib/rdoc/markup/to_html.rb10
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb1
-rw-r--r--lib/rdoc/markup/to_html_snippet.rb1
-rw-r--r--lib/rdoc/markup/to_joined_paragraph.rb1
-rw-r--r--lib/rdoc/markup/to_label.rb3
-rw-r--r--lib/rdoc/markup/to_markdown.rb1
-rw-r--r--lib/rdoc/markup/to_rdoc.rb1
-rw-r--r--lib/rdoc/markup/to_table_of_contents.rb1
-rw-r--r--lib/rdoc/markup/to_test.rb1
-rw-r--r--lib/rdoc/markup/to_tt_only.rb1
-rw-r--r--lib/rdoc/markup/verbatim.rb1
-rw-r--r--lib/rdoc/meta_method.rb1
-rw-r--r--lib/rdoc/method_attr.rb15
-rw-r--r--lib/rdoc/mixin.rb1
-rw-r--r--lib/rdoc/normal_class.rb1
-rw-r--r--lib/rdoc/normal_module.rb1
-rw-r--r--lib/rdoc/options.rb59
-rw-r--r--lib/rdoc/parser.rb3
-rw-r--r--lib/rdoc/parser/c.rb19
-rw-r--r--lib/rdoc/parser/changelog.rb11
-rw-r--r--lib/rdoc/parser/markdown.rb1
-rw-r--r--lib/rdoc/parser/rd.rb1
-rw-r--r--lib/rdoc/parser/ruby.rb25
-rw-r--r--lib/rdoc/parser/ruby_tools.rb1
-rw-r--r--lib/rdoc/parser/simple.rb1
-rw-r--r--lib/rdoc/parser/text.rb1
-rw-r--r--lib/rdoc/rd.rb1
-rw-r--r--lib/rdoc/rd/block_parser.rb7
-rw-r--r--lib/rdoc/rd/inline.rb1
-rw-r--r--lib/rdoc/rd/inline_parser.rb3
-rw-r--r--lib/rdoc/rdoc.gemspec7
-rw-r--r--lib/rdoc/rdoc.rb15
-rw-r--r--lib/rdoc/require.rb1
-rw-r--r--lib/rdoc/ri.rb1
-rw-r--r--lib/rdoc/ri/driver.rb1
-rw-r--r--lib/rdoc/ri/formatter.rb1
-rw-r--r--lib/rdoc/ri/paths.rb1
-rw-r--r--lib/rdoc/ri/store.rb1
-rw-r--r--lib/rdoc/ri/task.rb72
-rw-r--r--lib/rdoc/ruby_lex.rb7
-rw-r--r--lib/rdoc/ruby_token.rb15
-rw-r--r--lib/rdoc/rubygems_hook.rb9
-rw-r--r--lib/rdoc/servlet.rb3
-rw-r--r--lib/rdoc/single_class.rb5
-rw-r--r--lib/rdoc/stats.rb5
-rw-r--r--lib/rdoc/stats/normal.rb34
-rw-r--r--lib/rdoc/stats/quiet.rb1
-rw-r--r--lib/rdoc/stats/verbose.rb1
-rw-r--r--lib/rdoc/store.rb1
-rw-r--r--lib/rdoc/task.rb3
-rw-r--r--lib/rdoc/test_case.rb3
-rw-r--r--lib/rdoc/text.rb19
-rw-r--r--lib/rdoc/token_stream.rb3
-rw-r--r--lib/rdoc/tom_doc.rb1
-rw-r--r--lib/rdoc/top_level.rb1
-rw-r--r--lib/resolv-replace.rb2
-rw-r--r--lib/resolv.rb132
-rw-r--r--lib/rexml/attlistdecl.rb3
-rw-r--r--lib/rexml/attribute.rb5
-rw-r--r--lib/rexml/cdata.rb1
-rw-r--r--lib/rexml/child.rb1
-rw-r--r--lib/rexml/comment.rb2
-rw-r--r--lib/rexml/doctype.rb1
-rw-r--r--lib/rexml/document.rb7
-rw-r--r--lib/rexml/dtd/attlistdecl.rb1
-rw-r--r--lib/rexml/dtd/dtd.rb6
-rw-r--r--lib/rexml/dtd/elementdecl.rb5
-rw-r--r--lib/rexml/dtd/entitydecl.rb1
-rw-r--r--lib/rexml/dtd/notationdecl.rb1
-rw-r--r--lib/rexml/element.rb7
-rw-r--r--lib/rexml/encoding.rb1
-rw-r--r--lib/rexml/entity.rb8
-rw-r--r--lib/rexml/formatters/default.rb1
-rw-r--r--lib/rexml/formatters/pretty.rb1
-rw-r--r--lib/rexml/formatters/transitive.rb1
-rw-r--r--lib/rexml/functions.rb32
-rw-r--r--lib/rexml/instruction.rb1
-rw-r--r--lib/rexml/light/node.rb1
-rw-r--r--lib/rexml/namespace.rb1
-rw-r--r--lib/rexml/node.rb1
-rw-r--r--lib/rexml/output.rb1
-rw-r--r--lib/rexml/parent.rb3
-rw-r--r--lib/rexml/parseexception.rb1
-rw-r--r--lib/rexml/parsers/baseparser.rb1
-rw-r--r--lib/rexml/parsers/lightparser.rb1
-rw-r--r--lib/rexml/parsers/pullparser.rb1
-rw-r--r--lib/rexml/parsers/sax2parser.rb2
-rw-r--r--lib/rexml/parsers/streamparser.rb9
-rw-r--r--lib/rexml/parsers/treeparser.rb1
-rw-r--r--lib/rexml/parsers/ultralightparser.rb1
-rw-r--r--lib/rexml/parsers/xpathparser.rb44
-rw-r--r--lib/rexml/quickpath.rb1
-rw-r--r--lib/rexml/rexml.rb1
-rw-r--r--lib/rexml/sax2listener.rb1
-rw-r--r--lib/rexml/security.rb1
-rw-r--r--lib/rexml/source.rb7
-rw-r--r--lib/rexml/streamlistener.rb3
-rw-r--r--lib/rexml/syncenumerator.rb1
-rw-r--r--lib/rexml/text.rb1
-rw-r--r--lib/rexml/undefinednamespaceexception.rb1
-rw-r--r--lib/rexml/validation/relaxng.rb22
-rw-r--r--lib/rexml/validation/validation.rb13
-rw-r--r--lib/rexml/validation/validationexception.rb1
-rw-r--r--lib/rexml/xmldecl.rb1
-rw-r--r--lib/rexml/xmltokens.rb77
-rw-r--r--lib/rexml/xpath.rb1
-rw-r--r--lib/rexml/xpath_parser.rb109
-rw-r--r--lib/rinda/rinda.rb1
-rw-r--r--lib/rinda/ring.rb58
-rw-r--r--lib/rinda/tuplespace.rb4
-rw-r--r--lib/rss.rb1
-rw-r--r--lib/rss/0.9.rb1
-rw-r--r--lib/rss/1.0.rb1
-rw-r--r--lib/rss/2.0.rb1
-rw-r--r--lib/rss/atom.rb1
-rw-r--r--lib/rss/content.rb1
-rw-r--r--lib/rss/content/1.0.rb1
-rw-r--r--lib/rss/content/2.0.rb1
-rw-r--r--lib/rss/converter.rb1
-rw-r--r--lib/rss/dublincore.rb1
-rw-r--r--lib/rss/dublincore/1.0.rb1
-rw-r--r--lib/rss/dublincore/2.0.rb1
-rw-r--r--lib/rss/dublincore/atom.rb1
-rw-r--r--lib/rss/image.rb1
-rw-r--r--lib/rss/itunes.rb1
-rw-r--r--lib/rss/maker.rb1
-rw-r--r--lib/rss/maker/0.9.rb1
-rw-r--r--lib/rss/maker/1.0.rb1
-rw-r--r--lib/rss/maker/2.0.rb1
-rw-r--r--lib/rss/maker/atom.rb1
-rw-r--r--lib/rss/maker/base.rb3
-rw-r--r--lib/rss/maker/content.rb1
-rw-r--r--lib/rss/maker/dublincore.rb1
-rw-r--r--lib/rss/maker/entry.rb1
-rw-r--r--lib/rss/maker/feed.rb1
-rw-r--r--lib/rss/maker/image.rb1
-rw-r--r--lib/rss/maker/itunes.rb1
-rw-r--r--lib/rss/maker/slash.rb1
-rw-r--r--lib/rss/maker/syndication.rb1
-rw-r--r--lib/rss/maker/taxonomy.rb1
-rw-r--r--lib/rss/maker/trackback.rb1
-rw-r--r--lib/rss/parser.rb1
-rw-r--r--lib/rss/rexmlparser.rb1
-rw-r--r--lib/rss/rss.rb9
-rw-r--r--lib/rss/slash.rb1
-rw-r--r--lib/rss/syndication.rb3
-rw-r--r--lib/rss/taxonomy.rb1
-rw-r--r--lib/rss/trackback.rb1
-rw-r--r--lib/rss/utils.rb3
-rw-r--r--lib/rss/xml-stylesheet.rb1
-rw-r--r--lib/rss/xml.rb1
-rw-r--r--lib/rss/xmlparser.rb3
-rw-r--r--lib/rss/xmlscanner.rb1
-rw-r--r--lib/rubygems.rb135
-rw-r--r--lib/rubygems/available_set.rb6
-rw-r--r--lib/rubygems/basic_specification.rb176
-rw-r--r--lib/rubygems/command.rb14
-rw-r--r--lib/rubygems/command_manager.rb4
-rw-r--r--lib/rubygems/commands/build_command.rb5
-rw-r--r--lib/rubygems/commands/cert_command.rb25
-rw-r--r--lib/rubygems/commands/check_command.rb1
-rw-r--r--lib/rubygems/commands/cleanup_command.rb5
-rw-r--r--lib/rubygems/commands/contents_command.rb35
-rw-r--r--lib/rubygems/commands/dependency_command.rb49
-rw-r--r--lib/rubygems/commands/environment_command.rb15
-rw-r--r--lib/rubygems/commands/fetch_command.rb1
-rw-r--r--lib/rubygems/commands/generate_index_command.rb3
-rw-r--r--lib/rubygems/commands/help_command.rb230
-rw-r--r--lib/rubygems/commands/install_command.rb95
-rw-r--r--lib/rubygems/commands/list_command.rb9
-rw-r--r--lib/rubygems/commands/lock_command.rb1
-rw-r--r--lib/rubygems/commands/mirror_command.rb33
-rw-r--r--lib/rubygems/commands/open_command.rb77
-rw-r--r--lib/rubygems/commands/outdated_command.rb1
-rw-r--r--lib/rubygems/commands/owner_command.rb5
-rw-r--r--lib/rubygems/commands/pristine_command.rb29
-rw-r--r--lib/rubygems/commands/push_command.rb1
-rw-r--r--lib/rubygems/commands/query_command.rb24
-rw-r--r--lib/rubygems/commands/rdoc_command.rb1
-rw-r--r--lib/rubygems/commands/search_command.rb11
-rw-r--r--lib/rubygems/commands/server_command.rb1
-rw-r--r--lib/rubygems/commands/setup_command.rb19
-rw-r--r--lib/rubygems/commands/sources_command.rb3
-rw-r--r--lib/rubygems/commands/specification_command.rb1
-rw-r--r--lib/rubygems/commands/stale_command.rb1
-rw-r--r--lib/rubygems/commands/uninstall_command.rb17
-rw-r--r--lib/rubygems/commands/unpack_command.rb1
-rw-r--r--lib/rubygems/commands/update_command.rb25
-rw-r--r--lib/rubygems/commands/which_command.rb1
-rw-r--r--lib/rubygems/commands/yank_command.rb41
-rw-r--r--lib/rubygems/compatibility.rb8
-rw-r--r--lib/rubygems/config_file.rb42
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb19
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb41
-rw-r--r--lib/rubygems/defaults.rb45
-rw-r--r--lib/rubygems/dependency.rb71
-rw-r--r--lib/rubygems/dependency_installer.rb73
-rw-r--r--lib/rubygems/dependency_list.rb10
-rw-r--r--lib/rubygems/deprecate.rb3
-rw-r--r--lib/rubygems/doctor.rb3
-rw-r--r--lib/rubygems/errors.rb31
-rw-r--r--lib/rubygems/exceptions.rb28
-rw-r--r--lib/rubygems/ext.rb1
-rw-r--r--lib/rubygems/ext/build_error.rb1
-rw-r--r--lib/rubygems/ext/builder.rb5
-rw-r--r--lib/rubygems/ext/cmake_builder.rb1
-rw-r--r--lib/rubygems/ext/configure_builder.rb1
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb50
-rw-r--r--lib/rubygems/ext/rake_builder.rb1
-rw-r--r--lib/rubygems/gem_runner.rb1
-rw-r--r--lib/rubygems/gemcutter_utilities.rb14
-rw-r--r--lib/rubygems/indexer.rb120
-rw-r--r--lib/rubygems/install_default_message.rb1
-rw-r--r--lib/rubygems/install_message.rb1
-rw-r--r--lib/rubygems/install_update_options.rb23
-rw-r--r--lib/rubygems/installer.rb193
-rw-r--r--lib/rubygems/installer_test_case.rb7
-rw-r--r--lib/rubygems/local_remote_options.rb7
-rw-r--r--lib/rubygems/mock_gem_ui.rb1
-rw-r--r--lib/rubygems/name_tuple.rb7
-rw-r--r--lib/rubygems/package.rb69
-rw-r--r--lib/rubygems/package/digest_io.rb1
-rw-r--r--lib/rubygems/package/file_source.rb34
-rw-r--r--lib/rubygems/package/io_source.rb46
-rw-r--r--lib/rubygems/package/old.rb28
-rw-r--r--lib/rubygems/package/source.rb4
-rw-r--r--lib/rubygems/package/tar_header.rb4
-rw-r--r--lib/rubygems/package/tar_reader.rb2
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb11
-rw-r--r--lib/rubygems/package/tar_test_case.rb16
-rw-r--r--lib/rubygems/package/tar_writer.rb33
-rw-r--r--lib/rubygems/package_task.rb1
-rw-r--r--lib/rubygems/path_support.rb27
-rw-r--r--lib/rubygems/platform.rb11
-rw-r--r--lib/rubygems/psych_additions.rb3
-rw-r--r--lib/rubygems/psych_tree.rb1
-rw-r--r--lib/rubygems/rdoc.rb9
-rw-r--r--lib/rubygems/remote_fetcher.rb143
-rw-r--r--lib/rubygems/request.rb186
-rw-r--r--lib/rubygems/request/connection_pools.rb88
-rw-r--r--lib/rubygems/request/http_pool.rb48
-rw-r--r--lib/rubygems/request/https_pool.rb11
-rw-r--r--lib/rubygems/request_set.rb186
-rw-r--r--lib/rubygems/request_set/gem_dependency_api.rb392
-rw-r--r--lib/rubygems/request_set/lockfile.rb485
-rw-r--r--lib/rubygems/request_set/lockfile/parser.rb354
-rw-r--r--lib/rubygems/request_set/lockfile/tokenizer.rb112
-rw-r--r--lib/rubygems/requirement.rb23
-rw-r--r--lib/rubygems/resolver.rb353
-rw-r--r--lib/rubygems/resolver/activation_request.rb33
-rw-r--r--lib/rubygems/resolver/api_set.rb22
-rw-r--r--lib/rubygems/resolver/api_specification.rb9
-rw-r--r--lib/rubygems/resolver/best_set.rb50
-rw-r--r--lib/rubygems/resolver/composed_set.rb28
-rw-r--r--lib/rubygems/resolver/conflict.rb54
-rw-r--r--lib/rubygems/resolver/current_set.rb1
-rw-r--r--lib/rubygems/resolver/dependency_request.rb27
-rw-r--r--lib/rubygems/resolver/git_set.rb6
-rw-r--r--lib/rubygems/resolver/git_specification.rb30
-rw-r--r--lib/rubygems/resolver/index_set.rb11
-rw-r--r--lib/rubygems/resolver/index_specification.rb1
-rw-r--r--lib/rubygems/resolver/installed_specification.rb21
-rw-r--r--lib/rubygems/resolver/installer_set.rb142
-rw-r--r--lib/rubygems/resolver/local_specification.rb26
-rw-r--r--lib/rubygems/resolver/lock_set.rb27
-rw-r--r--lib/rubygems/resolver/lock_specification.rb36
-rw-r--r--lib/rubygems/resolver/molinillo.rb2
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo.rb10
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb287
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb75
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb5
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb100
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb64
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb436
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb45
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/state.rb52
-rw-r--r--lib/rubygems/resolver/requirement_list.rb1
-rw-r--r--lib/rubygems/resolver/set.rb30
-rw-r--r--lib/rubygems/resolver/source_set.rb48
-rw-r--r--lib/rubygems/resolver/spec_specification.rb3
-rw-r--r--lib/rubygems/resolver/specification.rb28
-rw-r--r--lib/rubygems/resolver/stats.rb1
-rw-r--r--lib/rubygems/resolver/vendor_set.rb7
-rw-r--r--lib/rubygems/resolver/vendor_specification.rb3
-rw-r--r--lib/rubygems/safe_yaml.rb48
-rw-r--r--lib/rubygems/security.rb11
-rw-r--r--lib/rubygems/security/policies.rb1
-rw-r--r--lib/rubygems/security/policy.rb5
-rw-r--r--lib/rubygems/security/signer.rb3
-rw-r--r--lib/rubygems/security/trust_dir.rb1
-rw-r--r--lib/rubygems/server.rb38
-rw-r--r--lib/rubygems/source.rb21
-rw-r--r--lib/rubygems/source/git.rb31
-rw-r--r--lib/rubygems/source/installed.rb8
-rw-r--r--lib/rubygems/source/local.rb1
-rw-r--r--lib/rubygems/source/lock.rb1
-rw-r--r--lib/rubygems/source/specific_file.rb8
-rw-r--r--lib/rubygems/source/vendor.rb1
-rw-r--r--lib/rubygems/source_list.rb3
-rw-r--r--lib/rubygems/source_local.rb1
-rw-r--r--lib/rubygems/source_specific_file.rb1
-rw-r--r--lib/rubygems/spec_fetcher.rb20
-rw-r--r--lib/rubygems/specification.rb717
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem25
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem32
-rw-r--r--lib/rubygems/ssl_certs/GlobalSignRootCA.pem21
-rw-r--r--lib/rubygems/stub_specification.rb185
-rw-r--r--lib/rubygems/syck_hack.rb1
-rw-r--r--lib/rubygems/test_case.rb224
-rw-r--r--lib/rubygems/test_utilities.rb39
-rw-r--r--lib/rubygems/text.rb39
-rw-r--r--lib/rubygems/uninstaller.rb10
-rw-r--r--lib/rubygems/uri_formatter.rb1
-rw-r--r--lib/rubygems/user_interaction.rb28
-rw-r--r--lib/rubygems/util.rb24
-rw-r--r--lib/rubygems/util/licenses.rb343
-rw-r--r--lib/rubygems/util/list.rb31
-rw-r--r--lib/rubygems/util/stringio.rb34
-rw-r--r--lib/rubygems/validator.rb1
-rw-r--r--lib/rubygems/version.rb78
-rw-r--r--lib/rubygems/version_option.rb1
-rw-r--r--lib/scanf.rb8
-rw-r--r--lib/securerandom.rb227
-rw-r--r--lib/set.rb126
-rw-r--r--lib/shell.rb48
-rw-r--r--lib/shell/builtin-command.rb15
-rw-r--r--lib/shell/command-processor.rb6
-rw-r--r--lib/shell/error.rb1
-rw-r--r--lib/shell/filter.rb1
-rw-r--r--lib/shell/process-controller.rb10
-rw-r--r--lib/shell/system-command.rb2
-rw-r--r--lib/shell/version.rb1
-rw-r--r--lib/shellwords.rb32
-rw-r--r--lib/singleton.rb1
-rw-r--r--lib/sync.rb1
-rw-r--r--lib/tempfile.rb144
-rw-r--r--lib/test/unit/assertions.rb403
-rw-r--r--lib/test/unit/test-unit.gemspec14
-rw-r--r--lib/thwait.rb5
-rw-r--r--lib/time.rb120
-rw-r--r--lib/timeout.rb58
-rw-r--r--lib/tmpdir.rb44
-rw-r--r--lib/tracer.rb1
-rw-r--r--lib/tsort.rb16
-rw-r--r--lib/ubygems.rb1
-rw-r--r--lib/un.rb9
-rw-r--r--lib/unicode_normalize.rb79
-rw-r--r--lib/unicode_normalize/normalize.rb161
-rw-r--r--lib/unicode_normalize/tables.rb1160
-rw-r--r--lib/uri.rb3
-rw-r--r--lib/uri/common.rb574
-rw-r--r--lib/uri/ftp.rb26
-rw-r--r--lib/uri/generic.rb278
-rw-r--r--lib/uri/http.rb17
-rw-r--r--lib/uri/https.rb1
-rw-r--r--lib/uri/ldap.rb1
-rw-r--r--lib/uri/ldaps.rb1
-rw-r--r--lib/uri/mailto.rb164
-rw-r--r--lib/uri/rfc2396_parser.rb544
-rw-r--r--lib/uri/rfc3986_parser.rb125
-rw-r--r--lib/weakref.rb12
-rw-r--r--lib/webrick.rb3
-rw-r--r--lib/webrick/accesslog.rb1
-rw-r--r--lib/webrick/cgi.rb1
-rw-r--r--lib/webrick/compat.rb1
-rw-r--r--lib/webrick/config.rb1
-rw-r--r--lib/webrick/cookie.rb1
-rw-r--r--lib/webrick/htmlutils.rb1
-rw-r--r--lib/webrick/httpauth.rb1
-rw-r--r--lib/webrick/httpauth/authenticator.rb1
-rw-r--r--lib/webrick/httpauth/basicauth.rb4
-rw-r--r--lib/webrick/httpauth/digestauth.rb4
-rw-r--r--lib/webrick/httpauth/htdigest.rb1
-rw-r--r--lib/webrick/httpauth/htgroup.rb1
-rw-r--r--lib/webrick/httpauth/htpasswd.rb1
-rw-r--r--lib/webrick/httpauth/userdb.rb1
-rw-r--r--lib/webrick/httpproxy.rb9
-rw-r--r--lib/webrick/httprequest.rb3
-rw-r--r--lib/webrick/httpresponse.rb3
-rw-r--r--lib/webrick/https.rb1
-rw-r--r--lib/webrick/httpserver.rb12
-rw-r--r--lib/webrick/httpservlet.rb1
-rw-r--r--lib/webrick/httpservlet/abstract.rb1
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb1
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb5
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb3
-rw-r--r--lib/webrick/httpservlet/filehandler.rb4
-rw-r--r--lib/webrick/httpservlet/prochandler.rb1
-rw-r--r--lib/webrick/httpstatus.rb7
-rw-r--r--lib/webrick/httputils.rb1
-rw-r--r--lib/webrick/httpversion.rb1
-rw-r--r--lib/webrick/log.rb5
-rw-r--r--lib/webrick/server.rb151
-rw-r--r--lib/webrick/ssl.rb6
-rw-r--r--lib/webrick/utils.rb111
-rw-r--r--lib/webrick/version.rb1
-rw-r--r--lib/xmlrpc.rb15
-rw-r--r--lib/xmlrpc/base64.rb1
-rw-r--r--lib/xmlrpc/client.rb31
-rw-r--r--lib/xmlrpc/config.rb2
-rw-r--r--lib/xmlrpc/create.rb1
-rw-r--r--lib/xmlrpc/datetime.rb1
-rw-r--r--lib/xmlrpc/httpserver.rb173
-rw-r--r--lib/xmlrpc/marshal.rb1
-rw-r--r--lib/xmlrpc/parser.rb35
-rw-r--r--lib/xmlrpc/server.rb1
-rw-r--r--lib/xmlrpc/utils.rb1
-rw-r--r--lib/yaml.rb41
-rw-r--r--lib/yaml/dbm.rb1
-rw-r--r--lib/yaml/store.rb1
-rw-r--r--load.c310
-rw-r--r--localeinit.c69
-rw-r--r--man/erb.12
-rw-r--r--man/goruby.12
-rw-r--r--man/irb.16
-rw-r--r--man/rake.1205
-rw-r--r--man/ri.12
-rw-r--r--man/ruby.1173
-rw-r--r--marshal.c586
-rw-r--r--math.c294
-rw-r--r--method.h195
-rw-r--r--miniinit.c21
-rw-r--r--misc/README2
-rw-r--r--misc/rdoc-mode.el40
-rw-r--r--misc/ruby-additional.el18
-rw-r--r--misc/ruby-electric.el280
-rw-r--r--misc/ruby-mode.el4
-rw-r--r--missing/crypt.c91
-rw-r--r--missing/explicit_bzero.c88
-rw-r--r--missing/lgamma_r.c2
-rw-r--r--missing/nextafter.c77
-rw-r--r--missing/os2.c138
-rw-r--r--missing/setproctitle.c7
-rw-r--r--nacl/GNUmakefile.in49
-rw-r--r--nacl/README.nacl23
-rw-r--r--nacl/ioctl.h7
-rwxr-xr-x[-rw-r--r--]nacl/nacl-config.rb16
-rw-r--r--nacl/package.rb6
-rw-r--r--nacl/pepper_main.c248
-rw-r--r--node.c343
-rw-r--r--node.h67
-rw-r--r--numeric.c684
-rw-r--r--object.c981
-rw-r--r--pack.c468
-rw-r--r--parse.y4718
-rw-r--r--prelude.rb125
-rw-r--r--probes.d6
-rw-r--r--probes_helper.h70
-rw-r--r--proc.c1280
-rw-r--r--process.c2206
-rw-r--r--random.c497
-rw-r--r--range.c205
-rw-r--r--rational.c103
-rw-r--r--re.c285
-rw-r--r--regcomp.c291
-rw-r--r--regenc.c76
-rw-r--r--regenc.h32
-rw-r--r--regerror.c24
-rw-r--r--regexec.c815
-rw-r--r--regint.h116
-rw-r--r--regparse.c490
-rw-r--r--regparse.h10
-rw-r--r--ruby.c576
-rw-r--r--ruby_atomic.h84
-rw-r--r--safe.c33
-rw-r--r--sample/benchmark.rb19
-rw-r--r--sample/cgi-session-pstore.rb11
-rw-r--r--sample/delegate.rb31
-rw-r--r--sample/drb/acl.rb15
-rw-r--r--sample/drb/ring_place.rb6
-rw-r--r--sample/exyacc.rb2
-rw-r--r--sample/iseq_loader.rb243
-rw-r--r--sample/list.rb2
-rw-r--r--sample/net-imap.rb167
-rw-r--r--sample/open3.rb12
-rw-r--r--sample/pstore.rb19
-rw-r--r--sample/pty/shl.rb47
-rw-r--r--sample/rinda-ring.rb22
-rw-r--r--sample/simple-bench.rb140
-rw-r--r--sample/tempfile.rb8
-rwxr-xr-xsample/test.rb14
-rw-r--r--sample/timeout.rb2
-rw-r--r--sample/trick2013/README.md15
-rw-r--r--sample/trick2013/kinaba/authors.markdown3
-rw-r--r--sample/trick2013/kinaba/entry.rb1
-rw-r--r--sample/trick2013/kinaba/remarks.markdown37
-rw-r--r--sample/trick2013/mame/authors.markdown3
-rw-r--r--sample/trick2013/mame/entry.rb97
-rw-r--r--sample/trick2013/mame/music-box.mp4bin0 -> 580724 bytes-rw-r--r--sample/trick2013/mame/remarks.markdown47
-rw-r--r--sample/trick2013/shinh/authors.markdown2
-rw-r--r--sample/trick2013/shinh/entry.rb10
-rw-r--r--sample/trick2013/shinh/remarks.markdown4
-rw-r--r--sample/trick2013/yhara/authors.markdown3
-rw-r--r--sample/trick2013/yhara/entry.rb28
-rw-r--r--sample/trick2013/yhara/remarks.en.markdown23
-rw-r--r--sample/trick2013/yhara/remarks.markdown24
-rw-r--r--sample/trick2015/README.md16
-rw-r--r--sample/trick2015/eregon/authors.markdown3
-rw-r--r--sample/trick2015/eregon/entry.rb16
-rw-r--r--sample/trick2015/eregon/remarks.markdown70
-rw-r--r--sample/trick2015/kinaba/authors.markdown4
-rw-r--r--sample/trick2015/kinaba/entry.rb150
-rw-r--r--sample/trick2015/kinaba/remarks.markdown85
-rw-r--r--sample/trick2015/ksk_1/authors.markdown3
-rw-r--r--sample/trick2015/ksk_1/entry.rb1
-rw-r--r--sample/trick2015/ksk_1/remarks.markdown120
-rw-r--r--sample/trick2015/ksk_2/abnormal.cnf6
-rw-r--r--sample/trick2015/ksk_2/authors.markdown3
-rw-r--r--sample/trick2015/ksk_2/entry.rb1
-rw-r--r--sample/trick2015/ksk_2/quinn.cnf21
-rw-r--r--sample/trick2015/ksk_2/remarks.markdown204
-rw-r--r--sample/trick2015/ksk_2/sample.cnf9
-rw-r--r--sample/trick2015/ksk_2/uf20-01.cnf99
-rw-r--r--sample/trick2015/ksk_2/unsat.cnf11
-rw-r--r--sample/trick2015/monae/authors.markdown1
-rw-r--r--sample/trick2015/monae/entry.rb26
-rw-r--r--sample/trick2015/monae/remarks.markdown25
-rw-r--r--sample/weakref.rb9
-rw-r--r--signal.c477
-rw-r--r--siphash.c1
-rw-r--r--spec/default.mspec11
-rw-r--r--sprintf.c353
-rw-r--r--st.c535
-rw-r--r--strftime.c2
-rw-r--r--string.c2915
-rw-r--r--struct.c475
-rw-r--r--symbian/README.SYMBIAN93
-rw-r--r--symbian/configure.bat123
-rw-r--r--symbian/missing-aeabi.c18
-rw-r--r--symbian/missing-pips.c65
-rw-r--r--symbian/pre-build83
-rw-r--r--symbian/setup440
-rw-r--r--symbol.c1134
-rw-r--r--symbol.h108
-rw-r--r--template/Doxyfile.tmpl2
-rw-r--r--template/fake.rb.in77
-rw-r--r--template/id.c.tmpl16
-rw-r--r--template/id.h.tmpl66
-rw-r--r--template/insns.inc.tmpl2
-rw-r--r--template/insns_info.inc.tmpl2
-rw-r--r--template/known_errors.inc.tmpl2
-rw-r--r--template/minsns.inc.tmpl2
-rw-r--r--template/opt_sc.inc.tmpl2
-rw-r--r--template/optinsn.inc.tmpl2
-rw-r--r--template/optunifs.inc.tmpl2
-rw-r--r--template/prelude.c.tmpl (renamed from tool/compile_prelude.rb)125
-rw-r--r--template/ruby-runner.c.in37
-rw-r--r--template/sizes.c.tmpl6
-rw-r--r--template/unicode_norm_gen.tmpl222
-rw-r--r--template/verconf.h.tmpl (renamed from template/verconf.h.in)12
-rw-r--r--template/vm.inc.tmpl2
-rw-r--r--test/-ext-/array/test_resize.rb1
-rw-r--r--test/-ext-/bignum/test_big2str.rb3
-rw-r--r--test/-ext-/bignum/test_bigzero.rb1
-rw-r--r--test/-ext-/bignum/test_div.rb3
-rw-r--r--test/-ext-/bignum/test_mul.rb3
-rw-r--r--test/-ext-/bignum/test_pack.rb25
-rw-r--r--test/-ext-/bignum/test_str2big.rb3
-rw-r--r--test/-ext-/bug_reporter/test_bug_reporter.rb21
-rw-r--r--test/-ext-/class/test_class2name.rb1
-rw-r--r--test/-ext-/debug/test_debug.rb1
-rw-r--r--test/-ext-/debug/test_profile_frames.rb26
-rw-r--r--test/-ext-/exception/test_data_error.rb2
-rw-r--r--test/-ext-/exception/test_enc_raise.rb1
-rw-r--r--test/-ext-/exception/test_ensured.rb2
-rw-r--r--test/-ext-/file/test_stat.rb1
-rw-r--r--test/-ext-/float/test_nextafter.rb65
-rw-r--r--test/-ext-/funcall/test_passing_block.rb1
-rw-r--r--test/-ext-/gvl/test_last_thread.rb23
-rw-r--r--test/-ext-/hash/test_delete.rb20
-rw-r--r--test/-ext-/iseq_load/test_iseq_load.rb117
-rw-r--r--test/-ext-/iter/test_iter_break.rb1
-rw-r--r--test/-ext-/iter/test_yield_block.rb1
-rw-r--r--test/-ext-/load/test_dot_dot.rb1
-rw-r--r--test/-ext-/marshal/test_internal_ivar.rb20
-rw-r--r--test/-ext-/marshal/test_usrmarshal.rb2
-rw-r--r--test/-ext-/method/test_arity.rb1
-rw-r--r--test/-ext-/num2int/test_num2int.rb1
-rw-r--r--test/-ext-/old_thread_select/test_old_thread_select.rb103
-rw-r--r--test/-ext-/path_to_class/test_path_to_class.rb1
-rw-r--r--test/-ext-/popen_deadlock/test_popen_deadlock.rb36
-rw-r--r--test/-ext-/postponed_job/test_postponed_job.rb1
-rw-r--r--test/-ext-/proc/test_bmethod.rb38
-rw-r--r--test/-ext-/rational/test_rat.rb1
-rw-r--r--test/-ext-/st/test_foreach.rb16
-rw-r--r--test/-ext-/st/test_numhash.rb1
-rw-r--r--test/-ext-/st/test_update.rb1
-rw-r--r--test/-ext-/string/test_coderange.rb60
-rw-r--r--test/-ext-/string/test_cstr.rb124
-rw-r--r--test/-ext-/string/test_ellipsize.rb3
-rw-r--r--test/-ext-/string/test_enc_associate.rb14
-rw-r--r--test/-ext-/string/test_enc_str_buf_cat.rb3
-rw-r--r--test/-ext-/string/test_fstring.rb74
-rw-r--r--test/-ext-/string/test_modify_expand.rb17
-rw-r--r--test/-ext-/string/test_nofree.rb13
-rw-r--r--test/-ext-/string/test_normalize.rb14
-rw-r--r--test/-ext-/string/test_qsort.rb3
-rw-r--r--test/-ext-/string/test_set_len.rb3
-rw-r--r--test/-ext-/struct/test_duplicate.rb22
-rw-r--r--test/-ext-/struct/test_member.rb16
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb265
-rw-r--r--test/-ext-/symbol/test_type.rb23
-rw-r--r--test/-ext-/test_bug-3571.rb2
-rw-r--r--test/-ext-/test_bug-3662.rb10
-rw-r--r--test/-ext-/test_bug-5832.rb1
-rw-r--r--test/-ext-/test_notimplement.rb15
-rw-r--r--test/-ext-/test_printf.rb11
-rw-r--r--test/-ext-/test_recursion.rb2
-rw-r--r--test/-ext-/thread_fd_close/test_thread_fd_close.rb23
-rw-r--r--test/-ext-/time/test_new.rb44
-rw-r--r--test/-ext-/tracepoint/test_tracepoint.rb6
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb15
-rw-r--r--test/-ext-/vm/test_at_exit.rb19
-rw-r--r--test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb1
-rw-r--r--test/-ext-/win32/test_console_attr.rb44
-rw-r--r--test/-ext-/win32/test_dln.rb24
-rw-r--r--test/-ext-/win32/test_fd_setsize.rb2
-rw-r--r--test/base64/test_base64.rb15
-rw-r--r--test/benchmark/test_benchmark.rb137
-rw-r--r--test/bigdecimal/test_bigdecimal.rb52
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb1
-rw-r--r--test/bigdecimal/test_bigmath.rb18
-rw-r--r--test/bigdecimal/testbase.rb1
-rw-r--r--test/cgi/test_cgi_cookie.rb20
-rw-r--r--test/cgi/test_cgi_core.rb136
-rw-r--r--test/cgi/test_cgi_header.rb19
-rw-r--r--test/cgi/test_cgi_modruby.rb11
-rw-r--r--test/cgi/test_cgi_multipart.rb78
-rw-r--r--test/cgi/test_cgi_session.rb47
-rw-r--r--test/cgi/test_cgi_tag_helper.rb28
-rw-r--r--test/cgi/test_cgi_util.rb80
-rw-r--r--test/cgi/update_env.rb9
-rw-r--r--test/colors3
-rw-r--r--test/coverage/test_coverage.rb61
-rw-r--r--test/csv/base.rb3
-rwxr-xr-xtest/csv/test_csv_parsing.rb1
-rwxr-xr-xtest/csv/test_csv_writing.rb1
-rwxr-xr-xtest/csv/test_data_converters.rb5
-rwxr-xr-xtest/csv/test_encodings.rb39
-rwxr-xr-xtest/csv/test_features.rb55
-rwxr-xr-xtest/csv/test_headers.rb35
-rwxr-xr-xtest/csv/test_interface.rb13
-rwxr-xr-xtest/csv/test_row.rb48
-rwxr-xr-xtest/csv/test_table.rb28
-rw-r--r--test/csv/ts_all.rb1
-rw-r--r--test/date/test_date.rb6
-rw-r--r--test/date/test_date_arith.rb31
-rw-r--r--test/date/test_date_attr.rb10
-rw-r--r--test/date/test_date_base.rb1
-rw-r--r--test/date/test_date_compat.rb1
-rw-r--r--test/date/test_date_conv.rb1
-rw-r--r--test/date/test_date_marshal.rb1
-rw-r--r--test/date/test_date_new.rb1
-rw-r--r--test/date/test_date_parse.rb14
-rw-r--r--test/date/test_date_strftime.rb9
-rw-r--r--test/date/test_date_strptime.rb23
-rw-r--r--test/date/test_switch_hitter.rb3
-rw-r--r--test/dbm/test_dbm.rb19
-rw-r--r--test/digest/digest/foo.rb11
-rw-r--r--[-rwxr-xr-x]test/digest/test_digest.rb79
-rw-r--r--test/digest/test_digest_extend.rb5
-rw-r--r--test/digest/test_digest_hmac.rb2
-rw-r--r--test/dl/test_base.rb143
-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.rb72
-rw-r--r--test/dl/test_cfunc.rb80
-rw-r--r--test/dl/test_cparser.rb33
-rw-r--r--test/dl/test_cptr.rb222
-rw-r--r--test/dl/test_dl2.rb140
-rw-r--r--test/dl/test_func.rb184
-rw-r--r--test/dl/test_handle.rb187
-rw-r--r--test/dl/test_import.rb165
-rw-r--r--test/dl/test_win32.rb54
-rw-r--r--test/drb/drbtest.rb70
-rw-r--r--test/drb/ignore_test_drb.rb4
-rw-r--r--test/drb/test_acl.rb5
-rw-r--r--test/drb/test_drb.rb38
-rw-r--r--test/drb/test_drbssl.rb15
-rw-r--r--test/drb/test_drbunix.rb14
-rw-r--r--test/drb/ut_array.rb2
-rw-r--r--test/drb/ut_array_drbssl.rb12
-rw-r--r--test/drb/ut_array_drbunix.rb2
-rw-r--r--test/drb/ut_drb.rb9
-rw-r--r--test/drb/ut_drb_drbssl.rb14
-rw-r--r--test/drb/ut_drb_drbunix.rb4
-rw-r--r--test/drb/ut_eq.rb9
-rw-r--r--test/drb/ut_eval.rb8
-rw-r--r--test/drb/ut_large.rb8
-rw-r--r--test/drb/ut_port.rb2
-rw-r--r--test/drb/ut_safe1.rb2
-rw-r--r--test/drb/ut_timerholder.rb75
-rw-r--r--test/dtrace/dummy.rb1
-rw-r--r--test/dtrace/helper.rb12
-rw-r--r--test/dtrace/test_array_create.rb1
-rw-r--r--test/dtrace/test_cmethod.rb1
-rw-r--r--test/dtrace/test_function_entry.rb1
-rw-r--r--test/dtrace/test_gc.rb1
-rw-r--r--test/dtrace/test_hash_create.rb1
-rw-r--r--test/dtrace/test_load.rb1
-rw-r--r--test/dtrace/test_method_cache.rb1
-rw-r--r--test/dtrace/test_object_create_start.rb1
-rw-r--r--test/dtrace/test_raise.rb1
-rw-r--r--test/dtrace/test_require.rb1
-rw-r--r--test/dtrace/test_singleton_function.rb1
-rw-r--r--test/dtrace/test_string.rb1
-rw-r--r--test/erb/test_erb.rb44
-rw-r--r--test/erb/test_erb_command.rb12
-rw-r--r--test/erb/test_erb_m17n.rb3
-rw-r--r--test/etc/test_etc.rb71
-rw-r--r--test/excludes/TestException.rb9
-rw-r--r--test/excludes/TestIO_Console.rb2
-rw-r--r--test/excludes/TestISeq.rb1
-rw-r--r--test/excludes/TestThread.rb2
-rw-r--r--test/fiddle/helper.rb8
-rw-r--r--test/fiddle/test_c_struct_entry.rb1
-rw-r--r--test/fiddle/test_c_union_entity.rb1
-rw-r--r--test/fiddle/test_closure.rb1
-rw-r--r--test/fiddle/test_cparser.rb178
-rw-r--r--test/fiddle/test_fiddle.rb1
-rw-r--r--test/fiddle/test_func.rb1
-rw-r--r--test/fiddle/test_function.rb40
-rw-r--r--test/fiddle/test_handle.rb107
-rw-r--r--test/fiddle/test_import.rb11
-rw-r--r--test/fiddle/test_pointer.rb14
-rw-r--r--test/fileutils/clobber.rb1
-rw-r--r--test/fileutils/fileasserts.rb19
-rw-r--r--test/fileutils/test_dryrun.rb1
-rw-r--r--test/fileutils/test_fileutils.rb456
-rw-r--r--test/fileutils/test_nowrite.rb1
-rw-r--r--test/fileutils/test_verbose.rb1
-rw-r--r--test/fileutils/visibility_tests.rb1
-rw-r--r--test/gdbm/test_gdbm.rb26
-rw-r--r--test/inlinetest.rb55
-rw-r--r--test/io/console/test_io_console.rb133
-rw-r--r--test/io/nonblock/test_flush.rb17
-rw-r--r--test/io/wait/test_io_wait.rb19
-rw-r--r--test/irb/test_completion.rb2
-rw-r--r--test/irb/test_option.rb2
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb14
-rw-r--r--test/json/setup_variant.rb1
-rwxr-xr-xtest/json/test_json.rb102
-rw-r--r--[-rwxr-xr-x]test/json/test_json_addition.rb5
-rw-r--r--test/json/test_json_encoding.rb3
-rw-r--r--[-rwxr-xr-x]test/json/test_json_fixtures.rb3
-rw-r--r--[-rwxr-xr-x]test/json/test_json_generate.rb88
-rw-r--r--test/json/test_json_generic_object.rb1
-rw-r--r--test/json/test_json_string_matching.rb1
-rw-r--r--[-rwxr-xr-x]test/json/test_json_unicode.rb1
-rw-r--r--test/lib/envutil.rb267
-rw-r--r--test/lib/find_executable.rb22
-rw-r--r--test/lib/iseq_loader_checker.rb75
-rw-r--r--test/lib/leakchecker.rb201
-rw-r--r--test/lib/memory_status.rb (renamed from test/ruby/memory_status.rb)80
-rw-r--r--test/lib/minitest/README.txt (renamed from lib/minitest/README.txt)0
-rw-r--r--test/lib/minitest/autorun.rb14
-rw-r--r--test/lib/minitest/benchmark.rb (renamed from lib/minitest/benchmark.rb)7
-rw-r--r--test/lib/minitest/mock.rb (renamed from lib/minitest/mock.rb)6
-rw-r--r--test/lib/minitest/unit.rb (renamed from lib/minitest/unit.rb)70
-rw-r--r--test/lib/profile_test_all.rb (renamed from test/profile_test_all.rb)1
-rw-r--r--test/lib/test/unit.rb (renamed from lib/test/unit.rb)753
-rw-r--r--test/lib/test/unit/assertions.rb854
-rw-r--r--test/lib/test/unit/parallel.rb (renamed from lib/test/unit/parallel.rb)22
-rw-r--r--test/lib/test/unit/testcase.rb (renamed from lib/test/unit/testcase.rb)2
-rw-r--r--test/lib/tracepointchecker.rb119
-rw-r--r--test/lib/with_different_ofs.rb (renamed from test/with_different_ofs.rb)1
-rw-r--r--test/lib/zombie_hunter.rb9
-rw-r--r--test/logger/test_logdevice.rb655
-rw-r--r--test/logger/test_logger.rb455
-rw-r--r--test/logger/test_severity.rb16
-rw-r--r--test/matrix/test_matrix.rb194
-rw-r--r--test/matrix/test_vector.rb71
-rw-r--r--test/minitest/metametameta.rb9
-rw-r--r--test/minitest/test_minitest_benchmark.rb6
-rw-r--r--test/minitest/test_minitest_mock.rb10
-rw-r--r--test/minitest/test_minitest_spec.rb811
-rw-r--r--test/minitest/test_minitest_unit.rb93
-rw-r--r--test/misc/test_ruby_mode.rb12
-rw-r--r--test/mkmf/base.rb18
-rw-r--r--test/mkmf/test_config.rb2
-rw-r--r--test/mkmf/test_constant.rb1
-rw-r--r--test/mkmf/test_convertible.rb1
-rw-r--r--test/mkmf/test_find_executable.rb1
-rw-r--r--test/mkmf/test_flags.rb22
-rw-r--r--test/mkmf/test_framework.rb13
-rw-r--r--test/mkmf/test_have_func.rb1
-rw-r--r--test/mkmf/test_have_library.rb1
-rw-r--r--test/mkmf/test_have_macro.rb1
-rw-r--r--test/mkmf/test_libs.rb1
-rw-r--r--test/mkmf/test_signedness.rb1
-rw-r--r--test/mkmf/test_sizeof.rb1
-rw-r--r--test/monitor/test_monitor.rb158
-rw-r--r--test/net/ftp/test_buffered_socket.rb42
-rw-r--r--test/net/ftp/test_ftp.rb1174
-rw-r--r--test/net/ftp/test_mlsx_entry.rb98
-rw-r--r--test/net/http/test_buffered_io.rb1
-rw-r--r--test/net/http/test_http.rb166
-rw-r--r--test/net/http/test_http_request.rb1
-rw-r--r--test/net/http/test_httpheader.rb20
-rw-r--r--test/net/http/test_httpresponse.rb141
-rw-r--r--test/net/http/test_httpresponses.rb1
-rw-r--r--test/net/http/test_https.rb46
-rw-r--r--test/net/http/test_https_proxy.rb32
-rw-r--r--test/net/http/utils.rb22
-rw-r--r--test/net/imap/Makefile15
-rw-r--r--test/net/imap/cacert.pem84
-rw-r--r--test/net/imap/server.crt65
-rw-r--r--test/net/imap/test_imap.rb475
-rw-r--r--test/net/imap/test_imap_response_parser.rb53
-rw-r--r--test/net/pop/test_pop.rb31
-rw-r--r--test/net/protocol/test_protocol.rb10
-rw-r--r--test/net/smtp/test_response.rb5
-rw-r--r--test/net/smtp/test_smtp.rb125
-rw-r--r--test/net/smtp/test_ssl_socket.rb12
-rw-r--r--test/nkf/test_kconv.rb1
-rw-r--r--test/nkf/test_nkf.rb1
-rw-r--r--test/objspace/test_objspace.rb133
-rw-r--r--test/open-uri/test_open-uri.rb206
-rw-r--r--test/open-uri/test_ssl.rb144
-rw-r--r--test/openssl/ssl_server.rb81
-rw-r--r--test/openssl/test_asn1.rb28
-rw-r--r--test/openssl/test_bn.rb38
-rw-r--r--test/openssl/test_buffering.rb5
-rw-r--r--test/openssl/test_cipher.rb39
-rw-r--r--test/openssl/test_config.rb7
-rw-r--r--test/openssl/test_digest.rb18
-rw-r--r--test/openssl/test_engine.rb3
-rw-r--r--test/openssl/test_fips.rb3
-rw-r--r--test/openssl/test_hmac.rb12
-rw-r--r--test/openssl/test_ns_spki.rb3
-rw-r--r--test/openssl/test_ocsp.rb3
-rw-r--r--test/openssl/test_pair.rb286
-rw-r--r--test/openssl/test_partial_record_read.rb35
-rw-r--r--test/openssl/test_pkcs12.rb9
-rw-r--r--test/openssl/test_pkcs5.rb3
-rw-r--r--test/openssl/test_pkcs7.rb144
-rw-r--r--test/openssl/test_pkey_dh.rb26
-rw-r--r--test/openssl/test_pkey_dsa.rb3
-rw-r--r--test/openssl/test_pkey_ec.rb3
-rw-r--r--test/openssl/test_pkey_rsa.rb33
-rw-r--r--test/openssl/test_random.rb17
-rw-r--r--test/openssl/test_ssl.rb651
-rw-r--r--test/openssl/test_ssl_session.rb128
-rw-r--r--test/openssl/test_x509cert.rb38
-rw-r--r--test/openssl/test_x509crl.rb3
-rw-r--r--test/openssl/test_x509ext.rb27
-rw-r--r--test/openssl/test_x509name.rb3
-rw-r--r--test/openssl/test_x509req.rb33
-rw-r--r--test/openssl/test_x509store.rb30
-rw-r--r--test/openssl/utils.rb129
-rw-r--r--test/optparse/test_acceptable.rb46
-rw-r--r--test/optparse/test_autoconf.rb1
-rw-r--r--test/optparse/test_bash_completion.rb1
-rw-r--r--test/optparse/test_cclass.rb18
-rw-r--r--test/optparse/test_getopts.rb1
-rw-r--r--test/optparse/test_noarg.rb1
-rw-r--r--test/optparse/test_optarg.rb1
-rw-r--r--test/optparse/test_optparse.rb1
-rw-r--r--test/optparse/test_placearg.rb1
-rw-r--r--test/optparse/test_reqarg.rb1
-rw-r--r--test/optparse/test_summary.rb1
-rw-r--r--test/optparse/test_zsh_completion.rb1
-rw-r--r--test/ostruct/test_ostruct.rb56
-rw-r--r--test/pathname/test_pathname.rb128
-rw-r--r--test/psych/handlers/test_recorder.rb1
-rw-r--r--test/psych/helper.rb12
-rw-r--r--test/psych/json/test_stream.rb3
-rw-r--r--test/psych/nodes/test_enumerable.rb1
-rw-r--r--test/psych/test_alias_and_anchor.rb1
-rw-r--r--test/psych/test_array.rb1
-rw-r--r--test/psych/test_boolean.rb1
-rw-r--r--test/psych/test_class.rb1
-rw-r--r--test/psych/test_coder.rb23
-rw-r--r--test/psych/test_date_time.rb1
-rw-r--r--test/psych/test_deprecated.rb1
-rw-r--r--test/psych/test_document.rb1
-rw-r--r--test/psych/test_emitter.rb22
-rw-r--r--test/psych/test_encoding.rb15
-rw-r--r--test/psych/test_engine_manager.rb47
-rw-r--r--test/psych/test_exception.rb7
-rw-r--r--test/psych/test_hash.rb51
-rw-r--r--test/psych/test_json_tree.rb3
-rw-r--r--test/psych/test_marshalable.rb55
-rw-r--r--test/psych/test_merge_keys.rb31
-rw-r--r--test/psych/test_nil.rb1
-rw-r--r--test/psych/test_null.rb1
-rw-r--r--test/psych/test_numeric.rb1
-rw-r--r--test/psych/test_object.rb1
-rw-r--r--test/psych/test_object_references.rb5
-rw-r--r--test/psych/test_omap.rb1
-rw-r--r--test/psych/test_parser.rb1
-rw-r--r--test/psych/test_psych.rb18
-rw-r--r--test/psych/test_safe_load.rb1
-rw-r--r--test/psych/test_scalar.rb1
-rw-r--r--test/psych/test_scalar_scanner.rb1
-rw-r--r--test/psych/test_serialize_subclasses.rb1
-rw-r--r--test/psych/test_set.rb1
-rw-r--r--test/psych/test_stream.rb1
-rw-r--r--test/psych/test_string.rb75
-rw-r--r--test/psych/test_struct.rb1
-rw-r--r--test/psych/test_symbol.rb9
-rw-r--r--test/psych/test_tainted.rb1
-rw-r--r--test/psych/test_to_yaml_properties.rb3
-rw-r--r--test/psych/test_tree_builder.rb1
-rw-r--r--test/psych/test_yaml.rb8
-rw-r--r--test/psych/test_yamldbm.rb6
-rw-r--r--test/psych/test_yamlstore.rb3
-rw-r--r--test/psych/visitors/test_depth_first.rb1
-rw-r--r--test/psych/visitors/test_emitter.rb1
-rw-r--r--test/psych/visitors/test_to_ruby.rb24
-rw-r--r--test/psych/visitors/test_yaml_tree.rb7
-rw-r--r--test/rake/file_creation.rb34
-rw-r--r--test/rake/helper.rb128
-rw-r--r--test/rake/support/rakefile_definitions.rb444
-rw-r--r--test/rake/support/ruby_runner.rb33
-rw-r--r--test/rake/test_private_reader.rb42
-rw-r--r--test/rake/test_rake.rb40
-rw-r--r--test/rake/test_rake_application.rb517
-rw-r--r--test/rake/test_rake_application_options.rb457
-rw-r--r--test/rake/test_rake_backtrace.rb113
-rw-r--r--test/rake/test_rake_clean.rb52
-rw-r--r--test/rake/test_rake_definitions.rb79
-rw-r--r--test/rake/test_rake_directory_task.rb57
-rw-r--r--test/rake/test_rake_dsl.rb40
-rw-r--r--test/rake/test_rake_early_time.rb31
-rw-r--r--test/rake/test_rake_extension.rb59
-rw-r--r--test/rake/test_rake_file_creation_task.rb56
-rw-r--r--test/rake/test_rake_file_list.rb627
-rw-r--r--test/rake/test_rake_file_list_path_map.rb8
-rw-r--r--test/rake/test_rake_file_task.rb122
-rw-r--r--test/rake/test_rake_file_utils.rb309
-rw-r--r--test/rake/test_rake_ftp_file.rb74
-rw-r--r--test/rake/test_rake_functional.rb466
-rw-r--r--test/rake/test_rake_invocation_chain.rb64
-rw-r--r--test/rake/test_rake_linked_list.rb84
-rw-r--r--test/rake/test_rake_makefile_loader.rb46
-rw-r--r--test/rake/test_rake_multi_task.rb58
-rw-r--r--test/rake/test_rake_name_space.rb43
-rw-r--r--test/rake/test_rake_package_task.rb79
-rw-r--r--test/rake/test_rake_path_map.rb168
-rw-r--r--test/rake/test_rake_path_map_explode.rb34
-rw-r--r--test/rake/test_rake_path_map_partial.rb18
-rw-r--r--test/rake/test_rake_pseudo_status.rb21
-rw-r--r--test/rake/test_rake_rake_test_loader.rb20
-rw-r--r--test/rake/test_rake_reduce_compat.rb26
-rw-r--r--test/rake/test_rake_require.rb40
-rw-r--r--test/rake/test_rake_rules.rb362
-rw-r--r--test/rake/test_rake_scope.rb44
-rw-r--r--test/rake/test_rake_task.rb376
-rw-r--r--test/rake/test_rake_task_argument_parsing.rb103
-rw-r--r--test/rake/test_rake_task_arguments.rb121
-rw-r--r--test/rake/test_rake_task_lib.rb9
-rw-r--r--test/rake/test_rake_task_manager.rb158
-rw-r--r--test/rake/test_rake_task_manager_argument_resolution.rb19
-rw-r--r--test/rake/test_rake_task_with_arguments.rb171
-rw-r--r--test/rake/test_rake_test_task.rb119
-rw-r--r--test/rake/test_rake_thread_pool.rb142
-rw-r--r--test/rake/test_rake_top_level_functions.rb71
-rw-r--r--test/rake/test_rake_win32.rb72
-rw-r--r--test/rake/test_thread_history_display.rb101
-rw-r--r--test/rake/test_trace_output.rb52
-rw-r--r--test/rdoc/test.ja.large.rdoc3
-rw-r--r--test/rdoc/test_attribute_manager.rb120
-rw-r--r--test/rdoc/test_rdoc_alias.rb1
-rw-r--r--test/rdoc/test_rdoc_any_method.rb30
-rw-r--r--test/rdoc/test_rdoc_attr.rb1
-rw-r--r--test/rdoc/test_rdoc_class_module.rb1
-rw-r--r--test/rdoc/test_rdoc_code_object.rb1
-rw-r--r--test/rdoc/test_rdoc_comment.rb1
-rw-r--r--test/rdoc/test_rdoc_constant.rb31
-rw-r--r--test/rdoc/test_rdoc_context.rb3
-rw-r--r--test/rdoc/test_rdoc_context_section.rb1
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb1
-rw-r--r--test/rdoc/test_rdoc_encoding.rb24
-rw-r--r--test/rdoc/test_rdoc_extend.rb1
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb5
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb61
-rw-r--r--test/rdoc/test_rdoc_generator_markup.rb3
-rw-r--r--test/rdoc/test_rdoc_generator_pot.rb92
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po.rb52
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po_entry.rb140
-rw-r--r--test/rdoc/test_rdoc_generator_ri.rb1
-rw-r--r--test/rdoc/test_rdoc_i18n_locale.rb74
-rw-r--r--test/rdoc/test_rdoc_i18n_text.rb124
-rw-r--r--test/rdoc/test_rdoc_include.rb1
-rw-r--r--test/rdoc/test_rdoc_markdown.rb1
-rw-r--r--test/rdoc/test_rdoc_markdown_test.rb1
-rw-r--r--test/rdoc/test_rdoc_markup.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb7
-rw-r--r--test/rdoc/test_rdoc_markup_attributes.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_document.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_formatter.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_hard_break.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_heading.rb9
-rw-r--r--test/rdoc/test_rdoc_markup_include.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_indented_paragraph.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_paragraph.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_parser.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_raw.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_ansi.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_bs.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb72
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb16
-rw-r--r--test/rdoc/test_rdoc_markup_to_joined_paragraph.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_label.rb9
-rw-r--r--test/rdoc/test_rdoc_markup_to_markdown.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_rdoc.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_table_of_contents.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_tt_only.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_verbatim.rb1
-rw-r--r--test/rdoc/test_rdoc_method_attr.rb33
-rw-r--r--test/rdoc/test_rdoc_normal_class.rb9
-rw-r--r--test/rdoc/test_rdoc_normal_module.rb1
-rw-r--r--test/rdoc/test_rdoc_options.rb20
-rw-r--r--test/rdoc/test_rdoc_parser.rb18
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb74
-rw-r--r--test/rdoc/test_rdoc_parser_changelog.rb3
-rw-r--r--test/rdoc/test_rdoc_parser_markdown.rb3
-rw-r--r--test/rdoc/test_rdoc_parser_rd.rb3
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb63
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb3
-rw-r--r--test/rdoc/test_rdoc_rd.rb1
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb5
-rw-r--r--test/rdoc/test_rdoc_rd_inline.rb1
-rw-r--r--test/rdoc/test_rdoc_rd_inline_parser.rb1
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb28
-rw-r--r--test/rdoc/test_rdoc_require.rb1
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb1
-rw-r--r--test/rdoc/test_rdoc_ri_paths.rb1
-rw-r--r--test/rdoc/test_rdoc_ruby_lex.rb12
-rw-r--r--test/rdoc/test_rdoc_ruby_token.rb1
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb4
-rw-r--r--test/rdoc/test_rdoc_servlet.rb4
-rw-r--r--test/rdoc/test_rdoc_single_class.rb19
-rw-r--r--test/rdoc/test_rdoc_stats.rb56
-rw-r--r--test/rdoc/test_rdoc_store.rb1
-rw-r--r--test/rdoc/test_rdoc_task.rb58
-rw-r--r--test/rdoc/test_rdoc_text.rb4
-rw-r--r--test/rdoc/test_rdoc_token_stream.rb1
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb1
-rw-r--r--test/rdoc/test_rdoc_top_level.rb1
-rw-r--r--test/rdoc/xref_data.rb1
-rw-r--r--test/rdoc/xref_test_case.rb1
-rw-r--r--test/readline/test_readline.rb18
-rw-r--r--test/readline/test_readline_history.rb1
-rw-r--r--test/resolv/test_addr.rb14
-rw-r--r--test/resolv/test_dns.rb205
-rw-r--r--test/resolv/test_resource.rb22
-rw-r--r--test/rexml/data/utf16.xml (renamed from test/rexml/data/ticket_110_utf16.xml)bin207464 -> 207464 bytes-rw-r--r--test/rexml/listener.rb95
-rw-r--r--test/rexml/parse/test_document_type_declaration.rb57
-rw-r--r--test/rexml/parse/test_notation_declaration.rb119
-rw-r--r--test/rexml/parser/test_sax2.rb3
-rw-r--r--test/rexml/parser/test_stream.rb32
-rw-r--r--test/rexml/parser/test_tree.rb3
-rw-r--r--test/rexml/parser/test_ultra_light.rb3
-rw-r--r--test/rexml/rexml_test_utils.rb1
-rw-r--r--test/rexml/test_attributes.rb343
-rw-r--r--test/rexml/test_attributes_mixin.rb49
-rw-r--r--test/rexml/test_changing_encoding.rb68
-rw-r--r--test/rexml/test_comment.rb3
-rw-r--r--test/rexml/test_contrib.rb882
-rw-r--r--test/rexml/test_core.rb2458
-rw-r--r--test/rexml/test_doctype.rb191
-rw-r--r--test/rexml/test_document.rb475
-rw-r--r--test/rexml/test_elements.rb197
-rw-r--r--test/rexml/test_encoding.rb162
-rw-r--r--test/rexml/test_encoding_2.rb59
-rw-r--r--test/rexml/test_entity.rb329
-rw-r--r--test/rexml/test_functions.rb415
-rw-r--r--test/rexml/test_functions_number.rb53
-rw-r--r--test/rexml/test_jaxen.rb210
-rw-r--r--test/rexml/test_light.rb171
-rw-r--r--test/rexml/test_lightparser.rb18
-rw-r--r--test/rexml/test_listener.rb202
-rw-r--r--test/rexml/test_martin_fowler.rb41
-rw-r--r--test/rexml/test_namespace.rb55
-rw-r--r--test/rexml/test_order.rb175
-rw-r--r--test/rexml/test_preceding_sibling.rb57
-rw-r--r--test/rexml/test_pullparser.rb161
-rw-r--r--test/rexml/test_rexml_issuezilla.rb21
-rw-r--r--test/rexml/test_sax.rb484
-rw-r--r--test/rexml/test_stream.rb195
-rw-r--r--test/rexml/test_text.rb29
-rw-r--r--test/rexml/test_ticket_80.rb47
-rw-r--r--test/rexml/test_validation_rng.rb617
-rw-r--r--test/rexml/test_xml_declaration.rb43
-rw-r--r--test/rexml/test_xpath.rb1079
-rw-r--r--test/rexml/test_xpath_attribute_query.rb89
-rw-r--r--test/rexml/test_xpath_msw.rb38
-rw-r--r--test/rexml/test_xpath_pred.rb80
-rw-r--r--test/rexml/test_xpathtext.rb72
-rw-r--r--test/rexml/xpath/test_attribute.rb30
-rw-r--r--test/rexml/xpath/test_axis_preceding_sibling.rb40
-rw-r--r--test/rexml/xpath/test_base.rb1090
-rw-r--r--test/rexml/xpath/test_node.rb43
-rw-r--r--test/rexml/xpath/test_predicate.rb83
-rw-r--r--test/rexml/xpath/test_text.rb75
-rw-r--r--test/rinda/test_rinda.rb147
-rw-r--r--test/rinda/test_tuplebag.rb1
-rw-r--r--test/ripper/dummyparser.rb9
-rw-r--r--test/ripper/test_files.rb10
-rw-r--r--test/ripper/test_filter.rb3
-rw-r--r--test/ripper/test_lexer.rb35
-rw-r--r--test/ripper/test_parser_events.rb212
-rw-r--r--test/ripper/test_ripper.rb34
-rw-r--r--test/ripper/test_scanner_events.rb36
-rw-r--r--test/ripper/test_sexp.rb85
-rw-r--r--test/rss/rss-assertions.rb3
-rw-r--r--test/rss/rss-testcase.rb1
-rw-r--r--test/rss/test_1.0.rb1
-rw-r--r--test/rss/test_2.0.rb1
-rw-r--r--test/rss/test_accessor.rb1
-rw-r--r--test/rss/test_atom.rb1
-rw-r--r--test/rss/test_content.rb1
-rw-r--r--test/rss/test_dublincore.rb1
-rw-r--r--test/rss/test_image.rb1
-rw-r--r--test/rss/test_inherit.rb1
-rw-r--r--test/rss/test_itunes.rb1
-rw-r--r--test/rss/test_maker_0.9.rb1
-rw-r--r--test/rss/test_maker_1.0.rb1
-rw-r--r--test/rss/test_maker_2.0.rb1
-rw-r--r--test/rss/test_maker_atom_entry.rb1
-rw-r--r--test/rss/test_maker_atom_feed.rb1
-rw-r--r--test/rss/test_maker_content.rb1
-rw-r--r--test/rss/test_maker_dc.rb1
-rw-r--r--test/rss/test_maker_image.rb1
-rw-r--r--test/rss/test_maker_itunes.rb5
-rw-r--r--test/rss/test_maker_slash.rb1
-rw-r--r--test/rss/test_maker_sy.rb1
-rw-r--r--test/rss/test_maker_taxo.rb1
-rw-r--r--test/rss/test_maker_trackback.rb1
-rw-r--r--test/rss/test_maker_xml-stylesheet.rb1
-rw-r--r--test/rss/test_parser.rb1
-rw-r--r--test/rss/test_parser_1.0.rb1
-rw-r--r--test/rss/test_parser_2.0.rb1
-rw-r--r--test/rss/test_parser_atom_entry.rb1
-rw-r--r--test/rss/test_parser_atom_feed.rb1
-rw-r--r--test/rss/test_setup_maker_0.9.rb1
-rw-r--r--test/rss/test_setup_maker_1.0.rb1
-rw-r--r--test/rss/test_setup_maker_2.0.rb1
-rw-r--r--test/rss/test_setup_maker_atom_entry.rb1
-rw-r--r--test/rss/test_setup_maker_atom_feed.rb1
-rw-r--r--test/rss/test_setup_maker_itunes.rb2
-rw-r--r--test/rss/test_setup_maker_slash.rb1
-rw-r--r--test/rss/test_slash.rb1
-rw-r--r--test/rss/test_syndication.rb1
-rw-r--r--test/rss/test_taxonomy.rb1
-rw-r--r--test/rss/test_to_s.rb31
-rw-r--r--test/rss/test_trackback.rb1
-rw-r--r--test/rss/test_version.rb1
-rw-r--r--test/rss/test_xml-stylesheet.rb1
-rw-r--r--test/ruby/allpairs.rb1
-rw-r--r--test/ruby/beginmainend.rb5
-rw-r--r--test/ruby/bug-11928.rb14
-rw-r--r--test/ruby/bug-13526.rb20
-rw-r--r--test/ruby/enc/test_big5.rb1
-rw-r--r--test/ruby/enc/test_cp949.rb1
-rw-r--r--test/ruby/enc/test_emoji.rb1
-rw-r--r--test/ruby/enc/test_euc_jp.rb1
-rw-r--r--test/ruby/enc/test_euc_kr.rb9
-rw-r--r--test/ruby/enc/test_euc_tw.rb1
-rw-r--r--test/ruby/enc/test_gb18030.rb1
-rw-r--r--test/ruby/enc/test_gbk.rb1
-rw-r--r--test/ruby/enc/test_iso_8859.rb1
-rw-r--r--test/ruby/enc/test_koi8.rb1
-rw-r--r--test/ruby/enc/test_shift_jis.rb1
-rw-r--r--test/ruby/enc/test_utf16.rb1
-rw-r--r--test/ruby/enc/test_utf32.rb69
-rw-r--r--test/ruby/enc/test_windows_1251.rb1
-rw-r--r--test/ruby/enc/test_windows_1252.rb26
-rw-r--r--test/ruby/endblockwarn_rb12
-rw-r--r--test/ruby/envutil.rb450
-rw-r--r--test/ruby/lbtest.rb1
-rw-r--r--test/ruby/marshaltestlib.rb1
-rw-r--r--test/ruby/sentence.rb1
-rw-r--r--test/ruby/test_alias.rb75
-rw-r--r--test/ruby/test_argf.rb71
-rw-r--r--test/ruby/test_arity.rb45
-rw-r--r--test/ruby/test_array.rb317
-rw-r--r--test/ruby/test_assignment.rb74
-rw-r--r--test/ruby/test_autoload.rb152
-rw-r--r--test/ruby/test_backtrace.rb150
-rw-r--r--test/ruby/test_basicinstructions.rb1
-rw-r--r--test/ruby/test_beginendblock.rb182
-rw-r--r--test/ruby/test_bignum.rb15
-rw-r--r--test/ruby/test_call.rb82
-rw-r--r--test/ruby/test_case.rb23
-rw-r--r--test/ruby/test_class.rb219
-rw-r--r--test/ruby/test_clone.rb1
-rw-r--r--test/ruby/test_comparable.rb17
-rw-r--r--test/ruby/test_complex.rb433
-rw-r--r--test/ruby/test_complex2.rb1
-rw-r--r--test/ruby/test_complexrational.rb1
-rw-r--r--test/ruby/test_condition.rb1
-rw-r--r--test/ruby/test_const.rb20
-rw-r--r--test/ruby/test_continuation.rb4
-rw-r--r--test/ruby/test_defined.rb48
-rw-r--r--test/ruby/test_dir.rb89
-rw-r--r--test/ruby/test_dir_m17n.rb131
-rw-r--r--test/ruby/test_econv.rb18
-rw-r--r--test/ruby/test_encoding.rb9
-rw-r--r--test/ruby/test_enum.rb432
-rw-r--r--test/ruby/test_enumerator.rb24
-rw-r--r--test/ruby/test_env.rb101
-rw-r--r--test/ruby/test_eval.rb58
-rw-r--r--test/ruby/test_exception.rb432
-rw-r--r--test/ruby/test_extlibs.rb87
-rw-r--r--test/ruby/test_fiber.rb12
-rw-r--r--test/ruby/test_file.rb89
-rw-r--r--test/ruby/test_file_exhaustive.rb1116
-rw-r--r--test/ruby/test_fixnum.rb25
-rw-r--r--test/ruby/test_flip.rb2
-rw-r--r--test/ruby/test_float.rb107
-rw-r--r--test/ruby/test_fnmatch.rb2
-rw-r--r--test/ruby/test_gc.rb162
-rw-r--r--test/ruby/test_hash.rb208
-rw-r--r--test/ruby/test_ifunless.rb1
-rw-r--r--test/ruby/test_integer.rb1
-rw-r--r--test/ruby/test_integer_comb.rb5
-rw-r--r--test/ruby/test_io.rb804
-rw-r--r--test/ruby/test_io_m17n.rb163
-rw-r--r--test/ruby/test_iseq.rb124
-rw-r--r--test/ruby/test_iterator.rb1
-rw-r--r--test/ruby/test_keyword.rb219
-rw-r--r--test/ruby/test_lambda.rb51
-rw-r--r--test/ruby/test_lazy_enumerator.rb59
-rw-r--r--test/ruby/test_literal.rb73
-rw-r--r--test/ruby/test_m17n.rb189
-rw-r--r--test/ruby/test_m17n_comb.rb99
-rw-r--r--test/ruby/test_marshal.rb172
-rw-r--r--test/ruby/test_math.rb166
-rw-r--r--test/ruby/test_metaclass.rb1
-rw-r--r--test/ruby/test_method.rb359
-rw-r--r--test/ruby/test_mixed_unicode_escapes.rb3
-rw-r--r--test/ruby/test_module.rb362
-rw-r--r--test/ruby/test_not.rb1
-rw-r--r--test/ruby/test_notimp.rb1
-rw-r--r--test/ruby/test_numeric.rb230
-rw-r--r--test/ruby/test_object.rb126
-rw-r--r--test/ruby/test_objectspace.rb107
-rw-r--r--test/ruby/test_optimization.rb379
-rw-r--r--test/ruby/test_pack.rb125
-rw-r--r--test/ruby/test_parse.rb105
-rw-r--r--test/ruby/test_path.rb4
-rw-r--r--test/ruby/test_pipe.rb14
-rw-r--r--test/ruby/test_primitive.rb1
-rw-r--r--test/ruby/test_proc.rb110
-rw-r--r--test/ruby/test_process.rb680
-rw-r--r--test/ruby/test_rand.rb24
-rw-r--r--test/ruby/test_range.rb68
-rw-r--r--test/ruby/test_rational.rb396
-rw-r--r--test/ruby/test_rational2.rb1
-rw-r--r--test/ruby/test_readpartial.rb9
-rw-r--r--test/ruby/test_refinement.rb618
-rw-r--r--test/ruby/test_regexp.rb112
-rw-r--r--test/ruby/test_require.rb141
-rw-r--r--test/ruby/test_rubyoptions.rb318
-rw-r--r--test/ruby/test_rubyvm.rb2
-rw-r--r--test/ruby/test_settracefunc.rb600
-rw-r--r--test/ruby/test_signal.rb86
-rw-r--r--test/ruby/test_sleep.rb15
-rw-r--r--test/ruby/test_sprintf.rb121
-rw-r--r--test/ruby/test_sprintf_comb.rb1
-rw-r--r--test/ruby/test_string.rb212
-rw-r--r--test/ruby/test_stringchar.rb1
-rw-r--r--test/ruby/test_struct.rb86
-rw-r--r--test/ruby/test_super.rb173
-rw-r--r--test/ruby/test_symbol.rb215
-rw-r--r--test/ruby/test_syntax.rb455
-rw-r--r--test/ruby/test_system.rb4
-rw-r--r--test/ruby/test_thread.rb211
-rw-r--r--test/ruby/test_threadgroup.rb11
-rw-r--r--test/ruby/test_time.rb60
-rw-r--r--test/ruby/test_time_tz.rb174
-rw-r--r--test/ruby/test_trace.rb16
-rw-r--r--test/ruby/test_transcode.rb64
-rw-r--r--test/ruby/test_undef.rb1
-rw-r--r--test/ruby/test_unicode_escape.rb2
-rw-r--r--test/ruby/test_variable.rb62
-rw-r--r--test/ruby/test_weakmap.rb10
-rw-r--r--test/ruby/test_whileuntil.rb2
-rw-r--r--test/ruby/test_yield.rb50
-rw-r--r--test/ruby/ut_eof.rb1
-rw-r--r--test/rubygems/bad_rake.rb1
-rw-r--r--test/rubygems/bogussources.rb1
-rw-r--r--test/rubygems/fake_certlib/openssl.rb1
-rw-r--r--test/rubygems/fix_openssl_warnings.rb1
-rw-r--r--test/rubygems/foo/discover.rb1
-rw-r--r--test/rubygems/good_rake.rb1
-rw-r--r--test/rubygems/plugin/exception/rubygems_plugin.rb1
-rw-r--r--test/rubygems/plugin/load/rubygems_plugin.rb1
-rw-r--r--test/rubygems/plugin/standarderror/rubygems_plugin.rb1
-rw-r--r--test/rubygems/rubygems/commands/crash_command.rb1
-rw-r--r--test/rubygems/rubygems_plugin.rb1
-rw-r--r--test/rubygems/sff/discover.rb1
-rw-r--r--test/rubygems/simple_gem.rb3
-rw-r--r--test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec (renamed from test/rubygems/specifications/foo-0.0.1.gemspec)bin269 -> 269 bytes-rw-r--r--test/rubygems/test_bundled_ca.rb79
-rw-r--r--test/rubygems/test_config.rb12
-rw-r--r--test/rubygems/test_deprecate.rb1
-rw-r--r--test/rubygems/test_gem.rb437
-rw-r--r--test/rubygems/test_gem_available_set.rb23
-rw-r--r--test/rubygems/test_gem_command.rb56
-rw-r--r--test/rubygems/test_gem_command_manager.rb1
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb11
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb58
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb11
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb4
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb8
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb190
-rw-r--r--test/rubygems/test_gem_commands_list_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_mirror.rb14
-rw-r--r--test/rubygems/test_gem_commands_open_command.rb53
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb6
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb129
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb28
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb299
-rw-r--r--test/rubygems/test_gem_commands_search_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb5
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb25
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb9
-rw-r--r--test/rubygems/test_gem_commands_stale_command.rb3
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb46
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb15
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb141
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb27
-rw-r--r--test/rubygems/test_gem_config_file.rb52
-rw-r--r--test/rubygems/test_gem_dependency.rb147
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb279
-rw-r--r--test/rubygems/test_gem_dependency_list.rb1
-rw-r--r--test/rubygems/test_gem_dependency_resolution_error.rb1
-rw-r--r--test/rubygems/test_gem_doctor.rb3
-rw-r--r--test/rubygems/test_gem_ext_builder.rb26
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb3
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb13
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb101
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb1
-rw-r--r--test/rubygems/test_gem_gem_runner.rb1
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb10
-rw-r--r--test/rubygems/test_gem_impossible_dependencies_error.rb33
-rw-r--r--test/rubygems/test_gem_indexer.rb9
-rw-r--r--test/rubygems/test_gem_install_update_options.rb51
-rw-r--r--test/rubygems/test_gem_installer.rb196
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb14
-rw-r--r--test/rubygems/test_gem_name_tuple.rb8
-rw-r--r--test/rubygems/test_gem_package.rb81
-rw-r--r--test/rubygems/test_gem_package_old.rb1
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb17
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb13
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb31
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb29
-rw-r--r--test/rubygems/test_gem_package_task.rb8
-rw-r--r--test/rubygems/test_gem_path_support.rb1
-rw-r--r--test/rubygems/test_gem_platform.rb18
-rw-r--r--test/rubygems/test_gem_rdoc.rb1
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb255
-rw-r--r--test/rubygems/test_gem_request.rb164
-rw-r--r--test/rubygems/test_gem_request_connection_pools.rb130
-rw-r--r--test/rubygems/test_gem_request_set.rb293
-rw-r--r--test/rubygems/test_gem_request_set_gem_dependency_api.rb275
-rw-r--r--test/rubygems/test_gem_request_set_lockfile.rb591
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_parser.rb549
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_tokenizer.rb306
-rw-r--r--test/rubygems/test_gem_requirement.rb24
-rw-r--r--test/rubygems/test_gem_resolver.rb172
-rw-r--r--test/rubygems/test_gem_resolver_activation_request.rb11
-rw-r--r--test/rubygems/test_gem_resolver_api_set.rb46
-rw-r--r--test/rubygems/test_gem_resolver_api_specification.rb45
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb108
-rw-r--r--test/rubygems/test_gem_resolver_composed_set.rb46
-rw-r--r--test/rubygems/test_gem_resolver_conflict.rb33
-rw-r--r--test/rubygems/test_gem_resolver_dependency_request.rb65
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb42
-rw-r--r--test/rubygems/test_gem_resolver_git_specification.rb14
-rw-r--r--test/rubygems/test_gem_resolver_index_set.rb62
-rw-r--r--test/rubygems/test_gem_resolver_index_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_installed_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_installer_set.rb236
-rw-r--r--test/rubygems/test_gem_resolver_local_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_lock_set.rb19
-rw-r--r--test/rubygems/test_gem_resolver_lock_specification.rb29
-rw-r--r--test/rubygems/test_gem_resolver_requirement_list.rb1
-rw-r--r--test/rubygems/test_gem_resolver_specification.rb33
-rw-r--r--test/rubygems/test_gem_resolver_vendor_set.rb19
-rw-r--r--test/rubygems/test_gem_resolver_vendor_specification.rb1
-rw-r--r--test/rubygems/test_gem_security.rb1
-rw-r--r--test/rubygems/test_gem_security_policy.rb5
-rw-r--r--test/rubygems/test_gem_security_signer.rb1
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb3
-rw-r--r--test/rubygems/test_gem_server.rb78
-rw-r--r--test/rubygems/test_gem_silent_ui.rb6
-rw-r--r--test/rubygems/test_gem_source.rb33
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb1
-rw-r--r--test/rubygems/test_gem_source_git.rb82
-rw-r--r--test/rubygems/test_gem_source_installed.rb9
-rw-r--r--test/rubygems/test_gem_source_list.rb1
-rw-r--r--test/rubygems/test_gem_source_local.rb1
-rw-r--r--test/rubygems/test_gem_source_lock.rb5
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb5
-rw-r--r--test/rubygems/test_gem_source_vendor.rb5
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb1
-rw-r--r--test/rubygems/test_gem_specification.rb916
-rw-r--r--test/rubygems/test_gem_stream_ui.rb13
-rw-r--r--test/rubygems/test_gem_stub_specification.rb132
-rw-r--r--test/rubygems/test_gem_text.rb30
-rw-r--r--test/rubygems/test_gem_uninstaller.rb48
-rw-r--r--test/rubygems/test_gem_unsatisfiable_dependency_error.rb33
-rw-r--r--test/rubygems/test_gem_uri_formatter.rb1
-rw-r--r--test/rubygems/test_gem_util.rb9
-rw-r--r--test/rubygems/test_gem_validator.rb1
-rw-r--r--test/rubygems/test_gem_version.rb11
-rw-r--r--test/rubygems/test_gem_version_option.rb1
-rw-r--r--test/rubygems/test_kernel.rb31
-rw-r--r--test/rubygems/test_require.rb357
-rw-r--r--test/runner.rb32
-rw-r--r--test/scanf/test_scanf.rb39
-rw-r--r--test/scanf/test_scanfblocks.rb1
-rw-r--r--test/scanf/test_scanfio.rb1
-rw-r--r--test/sdbm/test_sdbm.rb4
-rw-r--r--test/shell/test_command_processor.rb2
-rw-r--r--test/socket/test_addrinfo.rb26
-rw-r--r--test/socket/test_ancdata.rb2
-rw-r--r--test/socket/test_basicsocket.rb89
-rw-r--r--test/socket/test_nonblock.rb117
-rw-r--r--test/socket/test_socket.rb113
-rw-r--r--test/socket/test_sockopt.rb29
-rw-r--r--test/socket/test_tcp.rb63
-rw-r--r--test/socket/test_udp.rb33
-rw-r--r--test/socket/test_unix.rb249
-rw-r--r--test/stringio/test_stringio.rb125
-rw-r--r--test/strscan/test_stringscanner.rb14
-rw-r--r--test/syslog/test_syslog_logger.rb1
-rw-r--r--test/test_abbrev.rb1
-rw-r--r--test/test_cmath.rb68
-rw-r--r--test/test_delegate.rb58
-rw-r--r--test/test_find.rb56
-rw-r--r--test/test_forwardable.rb296
-rw-r--r--test/test_ipaddr.rb277
-rw-r--r--test/test_mathn.rb18
-rw-r--r--test/test_mutex_m.rb1
-rw-r--r--test/test_observer.rb66
-rw-r--r--test/test_open3.rb46
-rw-r--r--test/test_pp.rb58
-rw-r--r--test/test_prettyprint.rb14
-rw-r--r--test/test_prime.rb119
-rw-r--r--test/test_pstore.rb22
-rw-r--r--test/test_pty.rb46
-rw-r--r--test/test_rbconfig.rb1
-rw-r--r--test/test_securerandom.rb30
-rw-r--r--test/test_set.rb216
-rw-r--r--test/test_shellwords.rb73
-rw-r--r--test/test_singleton.rb13
-rw-r--r--test/test_syslog.rb113
-rw-r--r--test/test_tempfile.rb43
-rw-r--r--test/test_time.rb302
-rw-r--r--test/test_timeout.rb72
-rw-r--r--test/test_tmpdir.rb26
-rw-r--r--test/test_tracer.rb11
-rw-r--r--test/test_tsort.rb15
-rw-r--r--test/test_unicode_normalize.rb185
-rw-r--r--test/test_weakref.rb21
-rw-r--r--test/test_win32api.rb24
-rw-r--r--test/testunit/test4test_hideskip.rb3
-rw-r--r--test/testunit/test4test_redefinition.rb3
-rw-r--r--test/testunit/test4test_sorting.rb3
-rw-r--r--test/testunit/test_assertion.rb1
-rw-r--r--test/testunit/test_hideskip.rb3
-rw-r--r--test/testunit/test_parallel.rb45
-rw-r--r--test/testunit/test_rake_integration.rb35
-rw-r--r--test/testunit/test_redefinition.rb5
-rw-r--r--test/testunit/test_sorting.rb3
-rw-r--r--test/testunit/tests_for_parallel/ptest_first.rb1
-rw-r--r--test/testunit/tests_for_parallel/ptest_forth.rb9
-rw-r--r--test/testunit/tests_for_parallel/ptest_second.rb1
-rw-r--r--test/testunit/tests_for_parallel/ptest_third.rb1
-rw-r--r--test/testunit/tests_for_parallel/runner.rb4
-rw-r--r--test/thread/test_cv.rb37
-rw-r--r--test/thread/test_queue.rb411
-rw-r--r--test/thread/test_sync.rb7
-rw-r--r--test/uri/test_common.rb60
-rw-r--r--test/uri/test_ftp.rb1
-rw-r--r--test/uri/test_generic.rb71
-rw-r--r--test/uri/test_http.rb1
-rw-r--r--test/uri/test_ldap.rb1
-rw-r--r--test/uri/test_mailto.rb81
-rw-r--r--test/uri/test_parser.rb7
-rw-r--r--test/webrick/test_cgi.rb45
-rw-r--r--test/webrick/test_cookie.rb1
-rw-r--r--test/webrick/test_do_not_reverse_lookup.rb71
-rw-r--r--test/webrick/test_filehandler.rb68
-rw-r--r--test/webrick/test_htmlutils.rb1
-rw-r--r--test/webrick/test_httpauth.rb72
-rw-r--r--test/webrick/test_httpproxy.rb7
-rw-r--r--test/webrick/test_httprequest.rb3
-rw-r--r--test/webrick/test_httpresponse.rb91
-rw-r--r--test/webrick/test_httpserver.rb125
-rw-r--r--test/webrick/test_httputils.rb1
-rw-r--r--test/webrick/test_httpversion.rb1
-rw-r--r--test/webrick/test_server.rb112
-rw-r--r--test/webrick/test_ssl_server.rb60
-rw-r--r--test/webrick/test_utils.rb91
-rw-r--r--test/webrick/utils.rb55
-rw-r--r--test/webrick/webrick.cgi6
-rw-r--r--test/webrick/webrick_long_filename.cgi2
-rw-r--r--test/win32ole/err_in_callback.rb1
-rw-r--r--test/win32ole/test_err_in_callback.rb5
-rw-r--r--test/win32ole/test_folderitem2_invokeverb.rb1
-rw-r--r--test/win32ole/test_nil2vtempty.rb1
-rw-r--r--test/win32ole/test_ole_methods.rb1
-rw-r--r--test/win32ole/test_propertyputref.rb1
-rw-r--r--test/win32ole/test_thread.rb1
-rw-r--r--test/win32ole/test_win32ole.rb48
-rw-r--r--test/win32ole/test_win32ole_event.rb169
-rw-r--r--test/win32ole/test_win32ole_method.rb9
-rw-r--r--test/win32ole/test_win32ole_param.rb1
-rw-r--r--test/win32ole/test_win32ole_record.rb213
-rw-r--r--test/win32ole/test_win32ole_type.rb1
-rw-r--r--test/win32ole/test_win32ole_typelib.rb3
-rw-r--r--test/win32ole/test_win32ole_variable.rb1
-rw-r--r--test/win32ole/test_win32ole_variant.rb86
-rw-r--r--test/win32ole/test_win32ole_variant_m.rb1
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb3
-rw-r--r--test/win32ole/test_word.rb18
-rw-r--r--test/xmlrpc/test_client.rb19
-rw-r--r--test/xmlrpc/test_cookie.rb22
-rw-r--r--test/xmlrpc/test_datetime.rb1
-rw-r--r--test/xmlrpc/test_features.rb5
-rw-r--r--test/xmlrpc/test_marshal.rb1
-rw-r--r--test/xmlrpc/test_parser.rb1
-rw-r--r--test/xmlrpc/test_webrick_server.rb35
-rw-r--r--test/xmlrpc/webrick_testing.rb36
-rw-r--r--test/zlib/test_zlib.rb66
-rw-r--r--thread.c1702
-rw-r--r--thread_native.h23
-rw-r--r--thread_pthread.c668
-rw-r--r--thread_pthread.h12
-rw-r--r--thread_sync.c1313
-rw-r--r--thread_win32.c99
-rw-r--r--thread_win32.h9
-rw-r--r--time.c364
-rw-r--r--timev.h20
-rwxr-xr-xtool/bisect.sh2
-rwxr-xr-xtool/checksum.rb72
-rw-r--r--tool/config_files.rb8
-rw-r--r--tool/downloader.rb200
-rwxr-xr-xtool/enc-unicode.rb104
-rwxr-xr-xtool/expand-config.rb33
-rwxr-xr-xtool/extlibs.rb143
-rw-r--r--tool/fake.rb64
-rwxr-xr-xtool/file2lastrev.rb63
-rwxr-xr-xtool/gem-unpack.rb15
-rw-r--r--tool/generic_erb.rb21
-rwxr-xr-xtool/get-config_files7
-rwxr-xr-xtool/ifchange30
-rwxr-xr-xtool/instruction.rb17
-rwxr-xr-xtool/make-snapshot241
-rw-r--r--tool/make_hgraph.rb95
-rwxr-xr-xtool/mdoc2man.rb8
-rwxr-xr-xtool/merger.rb99
-rw-r--r--tool/mk_call_iseq_optimized.rb72
-rwxr-xr-xtool/mkconfig.rb65
-rwxr-xr-xtool/mkrunnable.rb11
-rwxr-xr-xtool/rbinstall.rb295
-rwxr-xr-xtool/redmine-backporter.rb583
-rwxr-xr-xtool/release.sh38
-rwxr-xr-xtool/runruby.rb15
-rw-r--r--tool/transcode-tblgen.rb60
-rwxr-xr-xtool/update-deps544
-rw-r--r--tool/vcs.rb294
-rw-r--r--tool/vpath.rb5
-rwxr-xr-xtool/ytab.sed26
-rw-r--r--transcode.c105
-rw-r--r--transcode_data.h30
-rw-r--r--util.c93
-rw-r--r--variable.c1452
-rw-r--r--version.c25
-rw-r--r--version.h16
-rw-r--r--vm.c1757
-rw-r--r--vm_args.c828
-rw-r--r--vm_backtrace.c201
-rw-r--r--vm_core.h743
-rw-r--r--vm_dump.c433
-rw-r--r--vm_eval.c1062
-rw-r--r--vm_exec.c20
-rw-r--r--vm_insnhelper.c2517
-rw-r--r--vm_insnhelper.h150
-rw-r--r--vm_method.c1411
-rw-r--r--vm_opts.h13
-rw-r--r--vm_trace.c164
-rw-r--r--vsnprintf.c92
-rw-r--r--win32/Makefile.sub166
-rwxr-xr-xwin32/configure.bat56
-rw-r--r--win32/dir.h15
-rw-r--r--win32/file.c293
-rw-r--r--win32/file.h45
-rwxr-xr-xwin32/mkexports.rb6
-rwxr-xr-xwin32/resource.rb2
-rwxr-xr-xwin32/rmall.bat6
-rwxr-xr-xwin32/rmdirs.bat1
-rw-r--r--win32/rtname.cmd33
-rw-r--r--win32/setup.mak66
-rw-r--r--win32/stub.c24
-rw-r--r--win32/win32.c1611
3314 files changed, 210946 insertions, 107533 deletions
diff --git a/.document b/.document
index 9a5067bc52..fb27ba325d 100644
--- a/.document
+++ b/.document
@@ -20,9 +20,7 @@ ChangeLog
NEWS
-README
-README.EXT
-README.EXT.ja
-README.ja
+README.md
+README.ja.md
doc
diff --git a/.gdbinit b/.gdbinit
index 17be7d8779..03c2b653cb 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -50,7 +50,7 @@ define rp
end
else
set $flags = ((struct RBasic*)($arg0))->flags
- if ($flags & RUBY_FL_PROMOTED)
+ if ($flags & RUBY_FL_PROMOTED) == RUBY_FL_PROMOTED
printf "[PROMOTED] "
end
if ($flags & RUBY_T_MASK) == RUBY_T_NONE
@@ -211,12 +211,46 @@ define rp
else
if ($flags & RUBY_T_MASK) == RUBY_T_SYMBOL
printf "%sT_SYMBOL%s: ", $color_type, $color_end
- print (struct RBasic *)($arg0)
+ print (struct RSymbol *)($arg0)
+ set $id_type = ((struct RSymbol *)($arg0))->id & RUBY_ID_SCOPE_MASK
+ if $id_type == RUBY_ID_LOCAL
+ printf "l"
+ else
+ if $id_type == RUBY_ID_INSTANCE
+ printf "i"
+ else
+ if $id_type == RUBY_ID_GLOBAL
+ printf "G"
+ else
+ if $id_type == RUBY_ID_ATTRSET
+ printf "a"
+ else
+ if $id_type == RUBY_ID_CONST
+ printf "C"
+ else
+ if $id_type == RUBY_ID_CLASS
+ printf "c"
+ else
+ printf "j"
+ end
+ end
+ end
+ end
+ end
+ end
+ set $id_fstr = ((struct RSymbol *)($arg0))->fstr
+ rp_string $id_fstr
else
if ($flags & RUBY_T_MASK) == RUBY_T_UNDEF
printf "%sT_UNDEF%s: ", $color_type, $color_end
print (struct RBasic *)($arg0)
else
+ if ($flags & RUBY_T_MASK) == RUBY_T_IMEMO
+ printf "%sT_IMEMO%s(", $color_type, $color_end
+ output (enum imemo_type)(($flags>>RUBY_FL_USHIFT)&imemo_mask)
+ printf "): "
+ rp_imemo $arg0
+ else
if ($flags & RUBY_T_MASK) == RUBY_T_NODE
printf "%sT_NODE%s(", $color_type, $color_end
output (enum node_type)(($flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
@@ -261,6 +295,7 @@ define rp
end
end
end
+ end
end
document rp
Print a Ruby's VALUE.
@@ -350,9 +385,9 @@ define rp_id
end
end
printf "(%ld): ", $id
- rb_numtable_entry global_symbols.id_str $id
- if $rb_numtable_rec
- rp_string $rb_numtable_rec
+ set $str = lookup_id_str($id)
+ if $str
+ rp_string $str
else
echo undef\n
end
@@ -420,8 +455,8 @@ end
define rp_class
printf "(struct RClass *) %p", (void*)$arg0
- if ((struct RClass *)($arg0))->ptr.origin != $arg0
- printf " -> %p", ((struct RClass *)($arg0))->ptr.origin
+ if ((struct RClass *)($arg0))->ptr.origin_ != $arg0
+ printf " -> %p", ((struct RClass *)($arg0))->ptr.origin_
end
printf "\n"
rb_classname $arg0
@@ -432,6 +467,40 @@ document rp_class
Print the content of a Class/Module.
end
+define rp_imemo
+ set $flags = (((struct RBasic *)($arg0))->flags >> RUBY_FL_USHIFT) & imemo_mask
+ if $flags == imemo_cref
+ printf "(rb_cref_t *) %p\n", (void*)$arg0
+ print *(rb_cref_t *)$arg0
+ else
+ if $flags == imemo_svar
+ printf "(struct vm_svar *) %p\n", (void*)$arg0
+ print *(struct vm_svar *)$arg0
+ else
+ if $flags == imemo_throw_data
+ printf "(struct vm_throw_data *) %p\n", (void*)$arg0
+ print *(struct vm_throw_data *)$arg0
+ else
+ if $flags == imemo_ifunc
+ printf "(struct vm_ifunc *) %p\n", (void*)$arg0
+ print *(struct vm_ifunc *)$arg0
+ else
+ if $flags == imemo_memo
+ printf "(struct MEMO *) %p\n", (void*)$arg0
+ print *(struct MEMO *)$arg0
+ else
+ printf "(struct RIMemo *) %p\n", (void*)$arg0
+ print *(struct RIMemo *)$arg0
+ end
+ end
+ end
+ end
+ end
+end
+document rp_imemo
+ Print the content of a memo
+end
+
define nd_type
print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
end
@@ -710,6 +779,12 @@ define nd_tval
rp ($arg0).u2.value
end
+define nd_tree
+ set $buf = (struct RString *)rb_str_buf_new(0)
+ call dump_node((VALUE)($buf), rb_str_new(0, 0), 0, ($arg0))
+ printf "%s\n", $buf->as.heap.ptr
+end
+
define rb_p
call rb_p($arg0)
end
@@ -731,7 +806,7 @@ define rb_numtable_entry
end
end
else
- set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[$rb_numtable_id % $rb_numtable_tbl->num_bins]
+ set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[st_numhash($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
@@ -761,7 +836,7 @@ define rb_method_entry
rb_numtable_entry $rb_method_entry_klass->m_tbl_wrapper->tbl $rb_method_entry_id
set $rb_method_entry_me = (rb_method_entry_t *)$rb_numtable_rec
if !$rb_method_entry_me
- set $rb_method_entry_klass = (struct RClass *)$rb_method_entry_klass->ptr->super
+ set $rb_method_entry_klass = (struct RClass *)RCLASS_SUPER($rb_method_entry_klass)
end
end
if $rb_method_entry_me
@@ -790,7 +865,7 @@ define rb_ancestors
set $rb_ancestors_module = $arg0
while $rb_ancestors_module
rp_class $rb_ancestors_module
- set $rb_ancestors_module = ((struct RClass *)($rb_ancestors_module))->ptr.super
+ set $rb_ancestors_module = RCLASS_SUPER($rb_ancestors_module)
end
end
document rb_ancestors
@@ -835,23 +910,16 @@ end
define rb_ps_vm
print $ps_vm = (rb_vm_t*)$arg0
- set $ps_threads = (st_table*)$ps_vm->living_threads
- 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->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
- else
- set $ps_threads_ptr = (st_table_entry*)$ps_threads->head
- while $ps_threads_ptr
- set $ps_threads_key = (st_data_t)$ps_threads_ptr->key
- set $ps_threads_val = (st_data_t)$ps_threads_ptr->record
- rb_ps_thread $ps_threads_key $ps_threads_val
- set $ps_threads_ptr = (st_table_entry*)$ps_threads_ptr->fore
+ set $ps_thread_ln = $ps_vm->living_threads.n.next
+ set $ps_thread_ln_last = $ps_vm->living_threads.n.prev
+ while 1
+ set $ps_thread_th = (rb_thread_t *)$ps_thread_ln
+ set $ps_thread = (VALUE)($ps_thread_th->self)
+ rb_ps_thread $ps_thread
+ if $ps_thread_ln == $ps_thread_ln_last
+ loop_break
end
+ set $ps_thread_ln = $ps_thread_ln->next
end
end
document rb_ps_vm
@@ -860,8 +928,9 @@ end
define rb_ps_thread
set $ps_thread = (struct RTypedData*)$arg0
- set $ps_thread_id = $arg1
- print $ps_thread_th = (rb_thread_t*)$ps_thread->data
+ set $ps_thread_th = (rb_thread_t*)$ps_thread->data
+ printf "* #<Thread:%p rb_thread_t:%p native_thread:%p>\n", \
+ $ps_thread, $ps_thread_th, $ps_thread_th->thread_id
end
# Details: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
@@ -880,3 +949,18 @@ define SDR
call rb_vmdebug_stack_dump_raw_current()
end
+define rbi
+ if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_LABEL
+ p *(LABEL*)$arg0
+ else
+ if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_INSN
+ p *(INSN*)$arg0
+ else
+ if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_ADJUST
+ p *(ADJUST*)$arg0
+ else
+ print *$arg0
+ end
+ end
+ end
+end
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..d9785fad00
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+*.gemspec diff=ruby
+*.rb diff=ruby
+bin/* diff=ruby
+tool/update-deps diff=ruby
+tool/make-snapshot diff=ruby
diff --git a/.gitignore b/.gitignore
index dee365b3c6..80c12594dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
*-*-*.def
+*-*-*.exp
+*-*-*.lib
*.a
*.bak
*.dSYM
@@ -8,10 +10,13 @@
*.inc
*.log
*.o
+*.obj
*.orig
+*.pdb
*.rej
*.sav
*.swp
+*.yarb
*~
.*-*
.*.list
@@ -24,15 +29,21 @@
.svn
Makefile
Makefile.old
+cygruby*.def
extconf.h
y.output
y.tab.c
# /
+/*-fake.rb
+/*.dll
+/*.exe
+/*.res
/*.pc
+/*.rc
/*_prelude.c
/COPYING.LIB
-/ChangeLog-1.8.0
+/ChangeLog-*
/ChangeLog.pre-alpha
/ChangeLog.pre1_1
/Doxyfile
@@ -46,6 +57,7 @@ y.tab.c
/autom4te*.cache
/automake
/beos
+/bmlog-*
/breakpoints.gdb
/config.cache
/config.h
@@ -53,6 +65,13 @@ y.tab.c
/config.status
/config.status.lineno
/configure
+/coverage/simplecov
+/coverage/simplecov-html
+/coverage/doclie
+/coverage/.last_run.json
+/coverage/.resultset.json*
+/coverage/assets
+/coverage/index.html
/doc/capi
/enc.mk
/encdb.h
@@ -83,6 +102,8 @@ y.tab.c
/riscos
/rubicon
/ruby
+/ruby-runner
+/ruby-runner.c
/ruby-man.rd.gz
/sizes.c
/test.rb
@@ -90,22 +111,44 @@ y.tab.c
/transdb.h
/uncommon.mk
/verconf.h
+/verconf.mk
/web
/yasmdata.rb
# /benchmark/
/benchmark/bmx_*.rb
+/benchmark/fasta.output.*
+/benchmark/wc.input
+
+/enc/*.def
+/enc/*.exp
+/enc/*.lib
+/enc/unicode/data
# /enc/trans/
/enc/trans/*.c
+/enc/trans/*.def
+/enc/trans/*.exp
+/enc/trans/*.lib
+/enc/trans/.time
# /ext/
/ext/extinit.c
+# /ext/-test-/win32/dln/
+/ext/-test-/win32/dln/dlntest.exp
+/ext/-test-/win32/dln/dlntest.lib
+
# /ext/dl/callback/
/ext/dl/callback/callback-*.c
/ext/dl/callback/callback.c
+# /ext/etc/
+/ext/etc/constdefs.h
+
+# /ext/fiddle/
+/ext/fiddle/libffi-*
+
# /ext/rbconfig/
/ext/rbconfig/sizeof/sizes.c
@@ -124,6 +167,9 @@ y.tab.c
# /ext/tk/
/ext/tk/config_list
+# /gems
+/gems/*.gem
+
# /spec/
/spec/mspec
/spec/rubyspec
diff --git a/.travis.yml b/.travis.yml
index 8db00587d6..f87ffd3483 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,45 +18,56 @@
# Language specification.
language: c
+sudo: false
# 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
+
+os:
+ - linux
# 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"
+ - "CONFIG_FLAG="
+ - "JOBS='-j 4'"
# 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:
- - "make -f common.mk BASERUBY=ruby srcdir=. update-config_files"
+ - "uname -a"
+ - "uname -r"
+ - "rm -fr .ext autom4te.cache"
+ - "echo $TERM"
+ - "make -f common.mk BASERUBY=ruby MAKEDIRS='mkdir -p' srcdir=. update-config_files"
- "autoconf"
- "mkdir config_1st config_2nd"
- - "./configure -C --with-gcc=$CC"
+ - "./configure -C --disable-install-doc --with-gcc=$CC $CONFIG_FLAG"
- "cp -pr config.status .ext/include config_1st"
- "make reconfig"
- "cp -pr config.status .ext/include config_2nd"
- "diff -ru config_1st config_2nd"
- - "make -sj encs"
- - "make -sj exts"
+ - "make after-update BASERUBY=ruby"
+ - "make -s $JOBS"
+ - "make update-rubyspec"
script:
- - "make test OPTS=-v"
-# - "make test-all TESTS='-v'"
+ - "make test TESTOPTS=--color=never"
+ - "make test-all TESTOPTS='-q -j3 --color=never --job-status=normal'"
+ - "make test-rubyspec MSPECOPT=-fm"
# Branch matrix. Not all branches are Travis-ready so we limit branches here.
branches:
only:
- trunk
- - ruby_1_9_3
+ - ruby_2_0_0
+ - ruby_2_1
+ - ruby_2_2
+ - ruby_2_3
# We want to be notified when something happens.
notifications:
@@ -65,7 +76,7 @@ notifications:
- "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
+ on_failure: always # [always|never|change] # default: always
template:
- "%{message} by @%{author}: See %{build_url}"
@@ -76,6 +87,10 @@ notifications:
on_success: always
on_failure: never
+ email:
+ - ko1c-failure@atdot.net
+ - shibata.hiroshi@gmail.com
+
# Local Variables:
# mode: YAML
# coding: utf-8-unix
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..ffdf2dd4b8
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,4 @@
+Please see the [official issue tracker] and wiki [HowToContribute].
+
+[official issue tracker]: https://bugs.ruby-lang.org
+[HowToContribute]: https://bugs.ruby-lang.org/projects/ruby/wiki/HowToContribute
diff --git a/ChangeLog b/ChangeLog
index d346ba0940..2d26904f0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18045 +1,14543 @@
-Fri Dec 20 17:52:50 2013 Koichi Sasada <ko1@atdot.net>
+Thu Dec 14 23:53:41 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_method.c: check definition of
- GLOBAL_METHOD_CACHE_SIZE and GLOBAL_METHOD_CACHE_MASK.
+ * test/net/ftp/test_ftp.rb (process_port_or_eprt): merge a part of
+ r56973 to pass the test introduced at previous commit.
-Fri Dec 20 17:03:10 2013 Koichi Sasada <ko1@atdot.net>
+Thu Dec 14 22:55:05 2017 Shugo Maeda <shugo@ruby-lang.org>
- * include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN into
- RB_OBJ_WRITE and RB_OBJ_WRITTEN.
+ Fix a command injection vulnerability in Net::FTP.
- * array.c, class.c, compile.c, hash.c, internal.h, iseq.c,
- proc.c, process.c, re.c, string.c, variable.c, vm.c,
- vm_eval.c, vm_insnhelper.c, vm_insnhelper.h,
- vm_method.c: catch up this change.
+Thu Dec 14 22:35:19 2017 Eric Wong <normalperson@yhbt.net>
-Fri Dec 20 16:01:35 2013 Koichi Sasada <ko1@atdot.net>
+ webrick: compile RE correctly for beginning and end match
- * include/ruby/ruby.h: add a comment for WB interfaces.
+ Using ^ and $ in regexps means we can accidentally get fooled
+ by "%0a" in HTTP request paths being decoded to newline
+ characters. Use \A and \z to match beginning and end-of-string
+ respectively, instead.
-Fri Dec 20 16:00:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Thanks to mame and hsbt for reporting.
- * configure.in: DLDFLAGS is defined in --with-opt-dir handler, so
- ${DLDFLAGS=} does not work now. use RUBY_APPEND_OPTIONS instead.
- [ruby-dev:47855] [Bug #9256]
+ * lib/webrick/httpserver.rb (MountTable#compile):
+ use \A and \z instead of ^ and $
+ * lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $
+ * test/webrick/test_httpserver.rb (test_cntrl_in_path): new test
-Fri Dec 20 14:19:12 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 14 22:29:04 2017 Eric Wong <normalperson@yhbt.net>
- * configure.in (AC_ARG_WITH): use withval directly.
- fix failure on FreeBSD.
- http://fb32.rubyci.org/~chkbuild/ruby-trunk/log/20131217T070301Z.diff.html.gz
+ webrick: do not hang acceptor on slow TLS connections
-Fri Dec 20 14:00:01 2013 Aman Gupta <ruby@tmm1.net>
+ OpenSSL::SSL::SSLSocket#accept may block indefinitely on clients
+ which negotiate the TCP connection, but fail (or are slow) to
+ negotiate the subsequent TLS handshake. This prevents the
+ multi-threaded WEBrick server from accepting other connections.
- * include/ruby/ruby.h (struct RClass): add super, remove iv_index_tbl.
- since RCLASS_SUPER() is commonly used inside while loops, we move it
- back inside struct RClass to improve cache hits. this provides a
- small improvement (1%) in hotspots like rb_obj_is_kind_of()
- * internal.h (struct rb_classext_struct): remove super, add
- iv_index_table
- * internal.h (RCLASS_SUPER): update for new location
- * internal.h (RCLASS_SET_SUPER): ditto
- * internal.h (RCLASS_IV_INDEX_TBL): ditto
- * object.c (rb_class_get_superclass): ditto
- * include/ruby/backward/classext.h (RCLASS_SUPER): ditto
+ Since the TLS handshake (via OpenSSL::SSL::SSLSocket#accept)
+ consists of normal read/write traffic over TCP, handle it in the
+ per-client thread, instead.
-Fri Dec 20 07:07:35 2013 Eric Hodel <drbrain@segment7.net>
+ Furthermore, using non-blocking accept() is useful for non-TLS
+ sockets anyways because spurious wakeups are possible from
+ select(2).
- * lib/rubygems: Update to RubyGems master 03d6ae7. Changes include:
+ * lib/webrick/server.rb (accept_client): use TCPServer#accept_nonblock
+ and remove OpenSSL::SSL::SSLSocket#accept call
+ * lib/webrick/server.rb (start_thread): call OpenSSL::SSL::SSLSocket#acc
+ept
+ * test/webrick/test_ssl_server.rb (test_slow_connect): new test
+ [ruby-core:83221] [Bug #14005]
- * Fixed typos.
+ webrick: fix up r60172
- * Relaxed Gem.ruby test for ruby packagers that do not use `ruby`.
+ By making the socket non-blocking in r60172, TLS/SSL negotiation
+ via the SSL_accept function must handle non-blocking sockets
+ properly and retry on SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE.
+ OpenSSL::SSL::SSLSocket#accept cannot do that properly with a
+ non-blocking socket, so it must use non-blocking logic of
+ OpenSSL::SSL::SSLSocket#accept_nonblock.
- * test/rubygems: ditto.
-
-Thu Dec 19 14:03:04 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (heap_get_freeobj): improve hot path performance.
-
- * gc.c (heap_get_freeobj_from_next_freepage): replace with
- heap_get_freepage(). It returns freeobj instead of freepage.
- This is not on hot path.
-
-Thu Dec 19 12:05:17 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master af60443. Changes include:
-
- * Improved speed of `gem install --ignore-dependencies`.
-
- * Open read-write for exclusive flock. [ruby-trunk - Bug #9257]
-
- * Remove specification before install to prevent infinite loop.
-
-Thu Dec 19 11:23:49 2013 Aman Gupta <ruby@tmm1.net>
-
- * vm_insnhelper.c (vm_call_iseq_setup_normal): simple for loop
- condition optimization. this area shows up as a hotspot in VM
- profiles.
-
-Thu Dec 19 10:50:13 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (newobj_of): don't need to RBASIC_SET_CLASS() which includes WB
- here because created obj is always YOUNG/INFANT.
-
-Thu Dec 19 10:48:37 2013 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/gc/gcbench.rb: check GC::OPTS availability
- for not MRI 2.1.0.
-
-Thu Dec 19 03:10:30 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c (heap_get_freeobj): remove redundant assignment. heap->freelist
- is set after the while() loop already.
-
-Thu Dec 19 01:54:30 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/runner.rb: fix commit miss on r44278.
-
-Thu Dec 19 00:26:11 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (garbage_collect_body): lazy_sweep setting should work
- without USE_RGENGC.
-
-Wed Dec 18 23:31:04 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_profile_dump_major_reason): fix this function because major_reason
- can be OR of multiple reasons.
-
- * gc.c (gc_profile_dump_on): ditto.
-
-Wed Dec 18 17:03:00 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_profile_record_get): should return an empty array
- when profiling is active.
-
-Wed Dec 18 16:49:40 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_profile_clear, gc_profile_enable): remove rest_sweep().
-
- * gc.c: check objspace->profile.current_record before inserting
- profiling record by new macro gc_prof_enabled().
-
-Wed Dec 18 14:32:06 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_exec.h (VM_DEBUG_STACKOVERFLOW): added.
- disable stack overflow check for every stack pushing as default.
-
- * vm_exec.c (vm_stack_overflow_for_insn): ditto.
-
-Wed Dec 18 10:00:22 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master d8f12e2. This increases the
- speed of `gem install --ignore-dependencies` which helps bundler
- tests.
- * test/rubygems: ditto.
-
-Wed Dec 18 09:00:17 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_gc.rb (test_expand_heap): allow +/-1 diff.
-
-Tue Dec 17 23:44:15 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * test/ruby/test_io.rb: fix duplicated test name.
-
-Tue Dec 17 20:15:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_reject): revert to deprecated behavior, with
- warnings, due to compatibility for HashWithDifferentAccess.
- [ruby-core:59154] [Bug #9223]
-
-Tue Dec 17 17:30:56 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el: Import version 2.1.1 from
- https://github.com/knu/ruby-electric.el.
-
- * ruby-electric-delete-backward-char: Enable support for number
- prefix.
-
- * ruby-electric-curlies: Fix electric operation after an open
- curly.
-
-Tue Dec 17 16:19:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_trace.c (rb_postponed_job_flush): isolate exceptions in
- postponed jobs and restore outer ones. based on a patch by
- tarui. [ruby-core:58652] [Bug #9168]
-
-Tue Dec 17 10:48:04 2013 Aman Gupta <ruby@tmm1.net>
-
- * configure.in (RUBY_DTRACE_POSTPROCESS): Fix compatibility with
- systemtap on linux. stap requires `dtrace -G` post-processing, but
- the dtrace compatibility wrapper is very strict about probes.d
- syntax.
-
-Tue Dec 17 05:18:17 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master 1c5f4b3. Allows rubygems
- repackagers to disable backward-compatible shared gem directory
- behavior.
- * test/rubygems: ditto.
-
-Tue Dec 17 05:14:35 2013 Eric Hodel <drbrain@segment7.net>
-
- * NEWS (RDoc): Update version number so I don't have to change it
- for the final release.
-
-Mon Dec 16 19:19:19 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_objspace_markable_object_p): should check special_const_p
- first (by is_markable_object()).
-
-Mon Dec 16 19:12:54 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c (reachable_object_from_root_i): use
- compare_by_identity hash to avoid hash modify problem
- during iteration.
- [Bug #9252]
-
- * ext/objspace/objspace.c (reachable_objects_from_root): ditto.
-
-Mon Dec 16 18:16:28 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_verify_internal_consistency): should not use
- rb_objspace_each_objects() because it call rest_sweep().
-
-Mon Dec 16 18:07:30 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_objspace_markable_object_p): fix last commit (build error).
-
-Mon Dec 16 18:04:28 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_objspace_markable_object_p): it should be live objects.
-
-Mon Dec 16 18:00:51 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_objspace_each_objects): should not clear dont_lazy_sweep
- flag in nested case.
-
-Mon Dec 16 16:40:35 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_method_entry_make): fix WB miss.
- Note that rb_method_entry_t::klass is not constified.
- We may constify this field.
-
- * test/ruby/test_alias.rb: add a test.
-
-Mon Dec 16 14:14:22 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: use gc_verify_internal_consistency() instead of
- gc_check_before_marks_i() for check consistency
- on RGENGC_CHECK_MODE >= 2.
-
-Mon Dec 16 14:01:48 2013 NARUSE, Yui <naruse@ruby-lang.org>
-
- * process.c (make_clock_result): add :second as a unit for
- Process.clock_gettime.
-
-Mon Dec 16 13:10:54 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: introduce GC.verify_internal_consistency method to verify GC
- internal data structure.
-
- Now this method only checks generation (old/young) consistency.
-
-Mon Dec 16 11:49:26 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c (gc_info_decode): Fix build errors when compiled with
- RGENGC_ESTIMATE_OLDMALLOC=0
- * gc.c (objspace_malloc_increase): ditto
-
-Sun Dec 15 13:38:29 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c (reachable_object_from_root_i):
- reachable objects should not include categories and
- category_objects because it is noisy information.
-
- In fact, objects created after calling
- ObjectSpace.reachable_objects_from_root should not be included
- as a returning hash objects. Currently, mswin64 platform has a
- problem because of this behavior. Should we trace new objects?
-
-Sun Dec 15 07:09:28 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc: Update to RDoc master 263a9e5. This improves the
- accessibility of the search box.
-
-Sat Dec 14 17:39:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_callee_setup_arg_complex): count post
- arguments as mandatory arguments. [ruby-core:57706] [Bug #8993]
-
- * vm_insnhelper.c (vm_yield_setup_block_args): ditto.
+ Thanks to MSP-Greg (Greg L) for finding this.
-Sat Dec 14 16:26:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/server.rb (start_thread): use SSL_accept properly
+ with non-blocking socket.
+ [Bug #14013] [Bug #14005]
- * configure.in (rubylibprefix): replace exec_prefix as well as
- bindir and libdir. a patch by kimuraw (Wataru Kimura) at
- [ruby-dev:47852]. [Bug #9160]
+ webrick: fix up r60172 and revert r60189
-Sat Dec 14 14:42:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Thanks to MSP-Greg (Greg L) for helping with this.
- * lib/logger.rb (lock_shift_log): no need to rotate the log file
- if it has been rotated by another process. based on the patch
- by no6v (Nobuhiro IMAI) in [ruby-core:58620]. [Bug #9133]
+ * lib/webrick/server.rb (start_thread): ignore ECONNRESET, ECONNABORTED,
+ EPROTO, and EINVAL on TLS negotiation errors the same way they
+ were ignored before r60172 in the accept_client method of the
+ main acceptor thread.
+ [Bug #14013] [Bug #14005]
-Sat Dec 14 13:01:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ webrick: fix up r60172 and r60208
- * proc.c (mnew_from_me): method by respond_to_missing? should be
- owned by the original class.
+ Thanks to MSP-Greg (Greg L) for helping with this.
-Sat Dec 14 11:55:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/server.rb (start_thread): fix non-local return
+ introduced in r60208
- * lib/scanf.rb (IO#scanf): fix mistaken use of rescue modifier.
- a patch by Mon_Ouie at [ruby-core:52813]. [Bug #7940]
+ webrick: fix up r60172 and r60210
-Sat Dec 14 11:44:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Thanks to MSP-Greg (Greg L) for helping with this.
- * util.c (ruby_qsort): fix potential stack overflow on a large
- machine. based on the patch by Conrad Irwin <conrad.irwin AT
- gmail.com> at [ruby-core:51816]. [Bug #7772]
+ * lib/webrick/server.rb (start_thread): properly fix non-local return
+ introduced in r60208 and r60210
-Sat Dec 14 11:25:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 30 23:37:08 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (rb_mod_const_defined): support nested class path as
- well as const_get. [Feature #7414]
+ parse.y: fix line in rescue
-Sat Dec 14 01:31:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (set_line_body, primary): fix line number of bodystmt as the
+ beginning of the block. [Bug #13181]
- * eval.c (rb_rescue2): reuse tags pushed for body proc to protect
- rescue proc too.
+Thu Nov 30 23:29:00 2017 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sat Dec 14 01:15:51 2013 Masaya Tarui <tarui@ruby-lang.org>
+ Merge rubygems-2.6.14 changes.
- * gc.c (wmap_final_func): Bugfix. Should update *value to new pointer.
+ It fixed http://blog.rubygems.org/2017/10/09/unsafe-object-deserialization-vulnerability.html
-Sat Dec 14 01:05:46 2013 Tanaka Akira <akr@fsij.org>
+Fri Sep 15 05:40:40 2017 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/socket/lib/socket.rb: Don't test $! in "ensure" clause because
- it may be set before the body.
- Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247]
+ fix --with-gmp (broken by r57490)
- * lib/cgi/core.rb: Ditto.
+ Looking at the generated shell script (also the autoconf manual), it
+ seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
+ preprocessor macros, unlike AC_CHECK_LIB() which does define them.
+ This previous change effectively killed building with GMP because
+ building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]
- * lib/drb/ssl.rb: Ditto.
+Thu Sep 14 20:25:55 2017 Yusuke Endoh <mame@ruby-lang.org>
-Sat Dec 14 00:34:31 2013 Naohisa Goto <ngotogenome@gmail.com>
+ lib/webrick/log.rb: sanitize any type of logs
- * internal.h (ruby_sized_xrealloc2): fix typo introduced in r44117,
- which cause compile error on Solaris.
+ It had failed to sanitize some type of exception messages. Reported and
+ patched by Yusuke Endoh (mame) at https://hackerone.com/reports/223363
-Sat Dec 14 00:22:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 14 13:32:39 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c: (exec_recursive): use rb_catch_protect() instead of
- rb_catch_obj() and PUSH_TAG(), and reduce pushing tags and
- machine stack usage.
+ parse.y: empty hash in defined
-Sat Dec 14 00:18:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (command): NODE_ARRAY with NULL is invalid. traversal
+ in defined_expr0 is simplified than iseq_compile_each0.
+ [ruby-core:82113] [Bug #13756]
- * proc.c (mnew_from_me): achieve the original defined_class from
- prepended iclass, to fix inherited owner.
+Thu Sep 14 13:26:31 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (method_owner): return the defined class, but not the
- class which the method object is created from.
+ string.c: fix false coderange
-Fri Dec 13 22:29:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_enc_str_scrub): enc can differ from the actual encoding
+ of the string, the cached coderange is useless then. [Bug #13874]
- * proc.c (method_owner): return the class where alias is defined, not
- the class original method is defined.
+Thu Sep 14 13:24:51 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_method.c (rb_method_entry_make, rb_alias): store the originally
- defined class in me. [Bug #7993] [Bug #7842] [Bug #9236]
+ parse.y: primary should not be 0
- * vm_method.c (rb_method_entry_get_without_cache): cache included
- module but not iclass.
+ * parse.y (primary): should not be 0, since it can be a receiver.
+ [ruby-core:82447] [Bug #13836]
-Fri Dec 13 16:27:17 2013 Aman Gupta <ruby@tmm1.net>
+Thu Sep 14 13:19:30 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (gc_info_decode): Use :major_by=>:nofree as fallback reason
- when other trigger conditions are present.
+ vm_method.c: alias warning at refined method
-Fri Dec 13 13:25:30 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_method.c (rb_method_entry_make): suppress a warning at
+ refined method which will not be redefined.
+ [ruby-core:82385] [Bug #13817]
- * error.c: add Exception#backtrace_locations.
- Now, there are no setter and independent from Exception#backtrace.
- [Feature #8960]
+Thu Sep 14 13:14:19 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (setup_exception): set backtrace locations for `bt_location'
- special attribute.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_hash): st_index_t may not be
+ fixable on 64bit mswin/mingw.
- * vm_backtrace.c (rb_backtrace_to_location_ary): added.
+ * ext/date/date_core.c (d_lite_hash): ditto.
+ [Backport #13877]
- * internal.h: ditto.
-
- * test/ruby/test_backtrace.rb: add a test for
- Exception#backtrace_locations.
-
-Fri Dec 13 12:01:07 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (garbage_collect_body): use rb_bug() and explicit error message
- instead of using assert().
- [Bug #9222]
-
-Fri Dec 13 11:52:41 2013 Koichi Sasada <ko1@atdot.net>
-
- * array.c: fix comment to remove the word "shady".
-
- * variable.c: ditto.
-
-Fri Dec 13 11:33:55 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: rename *shady* func/macros.
- * RVALUE_RAW_SHADY() -> RVALUE_WB_PROTECTED_RAW()
- * RVALUE_SHADY() -> RVALUE_RAW_SHADY()
- * rgengc_check_shady() -> rgengc_check_relation().
- And fix some messages using "shady" to "non-WB-protected".
-
-Fri Dec 13 10:04:23 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems/request_set/lockfile.rb: Import RubyGems master a8d0669
- with a 1.8.7 compatibility fix.
- * test/rubygems/test_gem_request_set_lockfile.rb: ditto.
-
-Fri Dec 13 09:50:49 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master ddac51f. Changes:
-
- * Allow override for the shared gem installation directory for
- rubygems packagers.
-
- * Lock gem cache files for read and write to improve thread safety.
-
- * Use io/console when available.
-
- * Minor cleanup.
-
- * test/rubygems: ditto.
-
-Fri Dec 13 08:15:31 2013 Aman Gupta <ruby@tmm1.net>
-
- * class.c (include_modules_at): use RCLASS_M_TBL_WRAPPER for
- equality checks. this avoids an unnecessary deference inside a tight
- loop, fixing a performance regression from r43973.
- * object.c (rb_obj_is_kind_of): ditto.
- * object.c (rb_class_inherited_p): ditto.
-
-Wed Dec 13 02:00:00 2013 Kenta Murata <mrkn@mrkn.jp>
-
- * ext/bigdecimal/bigdecimal.c (VpSetPTR): fix for limitation of the resulting
- precision.
- [ruby-core:50269] [Bug #7458]
-
- * test/bigdecimal/test_bigdecimal.rb (test_limit): add tests for the above
- change.
-
-Wed Dec 13 01:56:00 2013 Kenta Murata <mrkn@mrkn.jp>
-
- * ext/bigdecimal/bigdecimal.c (VpAddAbs): put out a conditional branch from
- the inside of while-loop.
-
- * ext/bigdecimal/bigdecimal.c (VpSubAbs): ditto.
-
-Wed Dec 13 01:53:00 2013 Kenta Murata <mrkn@mrkn.jp>
-
- * ext/bigdecimal/bigdecimal.c (VPrint): be a static function, support another
- dump formats, and add more information of the given bigdecimal.
-
- * ext/bigdecimal/bigdecimal.h: ditto.
-
-Wed Dec 11 16:45:58 2013 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_raise_jump): call c_return hook immediately after
- popping `raise' frame.
- Patches by deivid (David Rodriguez). [Bug #8886]
-
- * test/ruby/test_settracefunc.rb: catch up this fix.
-
-Wed Dec 11 16:01:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_reject): return a plain hash, without copying
- the class, default value, instance variables, and taintedness.
- they had been copied just by accident.
- [ruby-core:59045] [Bug #9223]
-
-Wed Dec 11 15:36:15 2013 Aman Gupta <ruby@tmm1.net>
-
- * compile.c (iseq_specialized_instruction): emit opt_aset instruction
- to optimize Hash#[]= and Array#[]= when called with Fixnum argument.
- [Bug #9227] [ruby-core:58956]
-
-Wed Dec 11 04:54:03 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master ec8ed22. Notable changes
- include:
-
- * Renamed extension_install_dir to extension_dir (backwards
- compatible).
-
- * Fixed creation of gem.deps.rb.lock file from
- TestGemRequestSet#test_install_from_gemdeps_install_dir
-
- * Fixed a typo and some documentation.
-
- * test/rubygems: ditto.
+ * ext/openssl/ossl_bn.c (ossl_bn_hash): ditto.
-Wed Dec 11 03:18:08 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Sat Sep 9 23:05:31 2017 Kazuki Yamaguchi <k@rhe.jp>
- * insns.def: Fix optimization bug of Float#/ [Bug #9238]
+ asn1: fix out-of-bounds read in decoding constructed objects
-Tue Dec 10 23:58:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * OpenSSL::ASN1.{decode,decode_all,traverse}: have a bug of
+ out-of-bounds read. int_ossl_asn1_decode0_cons() does not give the
+ correct available length to ossl_asn1_decode() when decoding the
+ inner components of a constructed object. This can cause
+ out-of-bounds read if a crafted input given.
- * ext/date/date_strptime.c (date__strptime_internal): unset
- case-insensitive flag for [:alpha:], which already implies both
- cases, to get rid of backtrack explosion. [ruby-core:58984]
- [Bug #9221]
+ Reference: https://hackerone.com/reports/170316
+ https://github.com/ruby/openssl/commit/1648afef33c1d97fb203c82291b8a61269e85d3b
-Tue Dec 10 23:44:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 9 22:57:24 2017 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * array.c (rb_ary_hash): add salt to differentiate false and empty
- array. [ruby-core:58993] [Bug #9231]
+ * ext/json: bump to version 1.8.3.1. [Backport #13853]
- * hash.c (rb_any_hash, rb_hash_hash): ditto.
+Sat Sep 9 22:50:10 2017 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Dec 10 18:16:09 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ A HTTP Header value must not contain CR or LF.
+ to_str -> to_s
- * man/ruby.1: [DOC] Use www.ruby-toolbox.com instead of RAA.
+ * lib/net/http/header.rb (set_field): `val` can not have `to_str`.
-Tue Dec 10 17:21:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 9 22:42:22 2017 Kouhei Sutou <kou@cozmixng.org>
- * gc.c (wmap_finalize, wmap_aset_update): use simple malloced array
- instead of T_ARRAY, to reduce GC pressure.
+ * REXML: Fix a bug that unexpected methods can be called as a XPath
+ function. [HackerOne:249295] Reported by Andrea Jegher. Thanks!!!
-Tue Dec 10 15:56:48 2013 Aman Gupta <ruby@tmm1.net>
+Sat Sep 9 22:16:01 2017 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (reflist_add): revert changes from r44109. it is unnecessary
- after r44113
- * gc.c (allrefs_i): fix whitespace
- * gc.c (allrefs_roots_i): fix whitespace
+ * lib/rubygems: fix several vulnerabilities in RubyGems; bump to version
+ 2.5.2.1. [Backport #13842]
-Tue Dec 10 15:46:03 2013 Koichi Sasada <ko1@atdot.net>
+Wed Aug 9 22:27:23 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (allrefs_add): push obj only if allrefs table doesn't have
- obj.
+ * test/ruby/test_syntax.rb (test_invalid_{break,next}): use
+ assert_in_out_err instead of assert_syntax_error because on ruby_2_3
+ assert_syntax_error uses eval.
- * gc.c (allrefs_roots_i): ditto.
+Wed Aug 9 22:27:23 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 10 15:28:10 2013 Koichi Sasada <ko1@atdot.net>
+ * compile.c (iseq_compile_each0): turned dregx context in "once"
+ into "guarded" type from "block" type, to disallow `next`,
+ `break`, `redo` as well as outside "once".
+ [Bug #13690]
- * gc.c (RGENGC_CHECK_MODE): separate checkers to different modes.
- * 2: enable generational bits check (for debugging)
- * 3: enable livness check
- * 4: show all references
+Wed Aug 9 21:28:34 2017 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Dec 10 15:15:37 2013 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_process.rb (test_rlimit_{name,value}): test in UTF-8
+ encoding. fix test failures introduced at r59531 on some platforms.
- * gc.c (gc_marks_check): disable GC during checking and
- restore malloc_increase info.
+Wed Aug 9 21:16:22 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 10 14:41:53 2013 Aman Gupta <ruby@tmm1.net>
+ * marshal.c (rb_marshal_dump_limited): do not free dump_arg, which
+ may be dereferenced in check_dump_arg due to continuation, and
+ get rid of dangling pointers.
- * gc.c (reflist_add): return 0 if reference already exists
- * gc.c (allrefs_add): return 1 on newly added references
- * gc.c (allrefs_i): follow references to construct complete object
- graph. before this patch, RGENGC_CHECK could fail to verify some WB
- miss issues. [Bug #9226] [ruby-core:58959]
+ * marshal.c (rb_marshal_load_with_proc): ditto for load_arg.
-Tue Dec 10 11:20:56 2013 Aman Gupta <ruby@tmm1.net>
+Wed Aug 9 21:13:24 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/objspace/objspace_dump.c (dump_object): include fstring flag on
- strings. include gc flags (old, remembered, wb_protected) on all objects.
- * ext/objspace/objspace_dump.c (Init_objspace_dump): initialize lazy
- IDs before first use.
- * gc.c (rb_obj_gc_flags): new function to retrieve object flags
- * internal.h (RB_OBJ_GC_FLAGS_MAX): maximum flags allowed for one obj
- * test/objspace/test_objspace.rb (test_dump_flags): test for above
- * test/objspace/test_objspace.rb (test_trace_object_allocations):
- resolve name before dump (for rb_class_path_cached)
+ * compile.c (iseq_compile_each): remove unused definition of unused
+ variable derived from original patch.
-Tue Dec 10 07:48:29 2013 Aman Gupta <ruby@tmm1.net>
+Wed Aug 9 19:45:16 2017 sorah (Shota Fukumori) <her@sorah.jp>
- * vm_method.c (rb_clear_method_cache_by_class): fire
- ruby::method-cache-clear probe on global or klass-level method cache
- clear [Bug #9190]
- * probes.d (provider ruby): new dtrace probe
- * doc/dtrace_probes.rdoc: docs for new probe
- * test/dtrace/test_method_cache.rb: test for new probe
+ Init_frozen_strings definition is removed in r51511.
+ https://bugs.ruby-lang.org/issues/11423
-Tue Dec 10 06:14:11 2013 Eric Hodel <drbrain@segment7.net>
+ Patch by Kohei Suzuki <eagletmt@gmail.com>
- * ext/.document: Remove curses from documentable directories.
+ * internal.h: Remove declaration of unexist function
+ [Fix GH-1558]
-Tue Dec 10 04:55:36 2013 Zachary Scott <e@zzak.io>
+Wed Aug 9 19:34:17 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/digest.rb: Deprecate OpenSSL::Digest::Digest
- [Fixes GH-446] https://github.com/ruby/ruby/pull/446
+ * internal.h (THROW_DATA_P): parenthesize the argument which is
+ casted.
-Tue Dec 10 00:41:42 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+Wed Aug 9 19:34:17 2017 Koichi Sasada <ko1@atdot.net>
- * ext/thread/thread.c: [DOC] add call-seq alias for Queue#enq, #<<, etc.
+ * vm.c: get return_value from imemo_throw_data object (THROW_DATA_VAL()).
+ imemo_throw_data (TAG_BREAK) contains returned value.
+ However, imemo_throw_data (TAG_BREAK) can skip several frames so that
+ we need to use it only once (at most internal frame). To record it,
+ we introduced THROW_DATA_CONSUMED and check it.
- * ext/thread/thread.c (Init_thread): use rb_define_alias instead of
- rb_alias to document alias.
+ * internal.h: define THROW_DATA_CONSUMED flag.
-Mon Dec 9 20:00:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: add tests for [Bug #13369]
- * internal.h (RCLASS_SERIAL): Add RCLASS_SERIAL as a convenience
- accessor for RCLASS_EXT(klass)->class_serial.
+ * vm_insnhelper.h: add THROW_DATA_CONSUMED_P() and
+ THROW_DATA_CONSUMED_SET().
- * class.c, vm_insnhelper.c, vm_method.c: Use RCLASS_SERIAL
+Wed Aug 9 19:32:17 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 9 19:50:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * random.c (get_rnd, try_get_rnd): ensure initialized to get rid
+ of crash in forked processes. [Bug #13753]
- * compile.c, insns.def, test/ruby/test_rubyvm.rb, vm.c, vm_core.h,
- vm_insnhelper.c, vm_insnhelper.h, vm_method.c: Rename method_serial
- to global_method_state and constant_serial to global_constant_state
- after discussion with ko1.
+Wed Aug 9 19:30:34 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 9 18:50:43 2013 Aman Gupta <ruby@tmm1.net>
+ * ext/strscan/strscan.c (strscan_aref): fix segfault after
+ get_byte or getch which do not apply regexp.
+ [Bug #13759]
- * hash.c (rb_hash_replace): fix segv on `{}.replace({})` introduced
- in r44060 [Bug #9230] [ruby-core:58991]
- * test/ruby/test_hash.rb: regression test for above
+Wed Aug 9 19:28:40 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 9 18:10:10 2013 Koichi Sasada <ko1@atdot.net>
+ * configure.in: add rpath flags which is needed for OPTDIR as well
+ as -L options, when it is given. [Bug #13411]
- * vm.c (vm_stat): renamed from ruby_vm_stat.
- Should not use ruby_ prefix here.
+Wed Aug 9 19:14:07 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 9 16:13:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_throw_start): size of catch table has been
+ included in iseq_catch_table struct, which could be NULL, since
+ 2.2. e.g., proc-closure in `once'.
- * gc.c (wmap_size): add ObjectSpace::WeakMap#size and #length.
+Wed Aug 9 19:09:20 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 9 15:26:17 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * node.h (nd_line): should sign-extend. shifting `VALUE` extends
+ with zero bits if `sizeof(VALUE)` equals to `sizeof(int)`. the
+ zero bits are truncated if `sizeof(VALUE)` is bigger enough.
+ [ruby-core:80920] [Bug #13523]
- * test/test_curses.rb: removed.
+Wed Aug 9 17:53:09 2017 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Dec 9 13:36:55 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * compile.c (iseq_compile_each): the lifetime of new_opt have to be
+ until this case block is end. this is a part of r57971.
+ [Backport #13766]
- * ext/curses, sample/curses: removed curses.
+Wed Aug 9 17:35:47 2017 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * NEWS: added an entry for the above change.
+ this patch contains r54158, r57410, r57631 and r57954.
-Mon Dec 9 12:26:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Prevent GC by volatile [Bug #13150]
- * ext/objspace/object_tracing.c (newobj_i): use cached class path
- only to get rid object allocation during NEWOBJ hook.
- [ruby-core:58853] [Bug #9212]
+ test/ruby/test_marshal.rb test_context_switch (load) and test_gc (dump)
+ are failed on FreeBSD 10.3 and gcc7 (FreeBSD Ports Collection) 7.0.0
+ 20170115 (experimental); RB_GC_GUARD looks not worked well.
- * variable.c (rb_class_path_cached): returns cached class path
- only, without searching and allocating new class path string.
+ * include/ruby/ruby.h (RB_GC_GUARD): prevent guarded pointer from
+ optimization by using as an input to inline asm.
-Mon Dec 9 11:14:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ruby.h: remove comment
- * ext/date/date_parse.c (parse_time): unset case-insensitive flag
- for [:alpha:], which already implies both cases, to get rid of
- backtrack explosion. [ruby-core:58876] [Bug #9221]
+ * include/ruby/ruby.h (RB_GC_GUARD): remove comment unsupported by
+ Solaris AS.
-Mon Dec 9 08:40:40 2013 Eric Hodel <drbrain@segment7.net>
+ Hidden objects (klass == 0) are not visible to Ruby code invoked
+ from other threads or signal handlers, so they can never be
+ accessed from other contexts. This makes it safe to call
+ rb_gc_force_recycle on the object slot after releasing malloc
+ memory.
- * lib/rubygems: Update to RubyGems master bf37240. Fixes useless
- error message with `gem install -g` with no gem dependencies file.
- * test/rubygems: ditto.
+ * marshal.c (rb_marshal_dump_limited): hide dump_arg and recycle when
+ done (rb_marshal_load_with_proc): hide load_arg and recycle when done
+ [ruby-core:79518]
-Mon Dec 9 04:52:25 2013 Eric Hodel <drbrain@segment7.net>
+ * marshal.c (rb_marshal_dump_limited): do not free dump_arg, which
+ may be dereferenced in check_dump_arg due to continuation, and
+ get rid of dangling pointers.
- * NEWS: Update RubyGems entry with notable features.
+ * marshal.c (rb_marshal_load_with_proc): ditto for load_arg.
-Mon Dec 9 04:43:54 2013 Eric Hodel <drbrain@segment7.net>
+Wed Aug 9 17:28:35 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/.document: Add syslog/lib and thread/thread.c to documentable
- items. [ruby-trunk - Bug #9228]
+ * eval.c (setup_exception): make unfrozen copy of special
+ exception before setting up a cause.
-Mon Dec 9 04:28:50 2013 Eric Hodel <drbrain@segment7.net>
+Wed Aug 9 17:22:29 2017 TAKANO `takano32' Mitsuhiro <tak@no32.tk>
- * lib/rubygems: Update to RubyGems master 096db36. Changes include
- support for PATH in Gemfile.lock and a typo fix from Akira Matsuda.
- * test/rubygems: ditto.
+ a64: fix crash on register stack mark/sweep pass
-Mon Dec 9 02:10:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread_pthread.c: move 'register_stack_start' earlier.
+ [ruby-core:79928] [Bug #13284] [Fix GH-1625]
- * lib/net/http/responses.rb:
- Add `HTTPIMUsed`, as it is also supported by rack/rails.
- RFC - http://tools.ietf.org/html/rfc3229
- by Vipul A M <vipulnsward@gmail.com>
- https://github.com/ruby/ruby/pull/447 fix GH-447
+ Author: Sergei Trofimovich <slyfox@gentoo.org>
-Sun Dec 8 20:47:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 9 17:10:27 2017 Shugo Maeda <shugo@ruby-lang.org>
- * class.c (rb_get_kwargs): when values is non-null, remove
- extracted keywords from the rest keyword argument.
+ * test/net/smtp/test_smtp.rb (test_tls_connect, test_tls_connect):
+ use Socket.tcp_server_sockets in case localhost is resolved to ::1.
-Sun Dec 8 20:26:54 2013 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+Wed Aug 9 17:10:27 2017 Shugo Maeda <shugo@ruby-lang.org>
- * common.mk (ruby.imp): avoid circular dependency on AIX
+ * lib/net/smtp.rb (tlsconnect): support timeout for TLS handshake.
+ [ruby-core:76893] [Bug #12678]
-Sun Dec 8 20:21:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * lib/net/protocol.rb (ssl_socket_connect): new method to implement
+ timeout for TLS handshake.
- * bigdecimal.c (BigDecimal_coerce): convert a Float to a BigDecimal instead
- of converting the receiver to a Float. The reason is there are BigDecimal
- instances with precisions that is smaller than the Float's precision.
- [ruby-core:58756] [Bug #9192]
+ * lib/net/http.rb (connect): use Net::Protocol#ssl_socket_connect.
- * test/bigdecimal/test_bigdecimal.rb: add tests for the above change.
+Wed Aug 9 17:08:01 2017 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 8 18:28:20 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ Zlib::GzipReader#pos underflows after calling #ungetbyte or #ungetc at start of file [Bug #13616]
- * NEWS: [DOC] update NEWS about GC.
+ patched by Andrew Haines <andrew@haines.org.nz> [ruby-core:81488]
+ zlib.c: fix unnormalized Fixnum
-Sun Dec 8 17:52:24 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * ext/zlib/zlib.c (rb_gzfile_total_out): cast to long not to
+ result in an unsigned long to normalized to Fixnum on LLP64
+ platforms. [ruby-core:81488]
- * object.c: [DOC] document Module#singleton_class?.
+Wed Aug 9 17:03:00 2017 Eric Wong <normalperson@yhbt.net>
-Sun Dec 8 16:19:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ process.c: handle dynamic :rlimit_* symbols in spawn execopts
- * class.c (rb_get_kwargs): if optional is negative, unknown
- keywords are allowed.
+ * process.c (rb_execarg_addopt_rlimit): hoist out of rb_execarg_addopt
+ (rlimit_type_by_sym): new wrapper for dynamic symbol
+ (rb_execarg_addopt): check for dsym via rlimit_type_by_sym
+ * test/ruby/test_process.rb (test_execopts_rlimit): check dsym w/o pindown
+ Add extra check for bogus rlimit args, too.
+ [ruby-core:82033] [Bug #13744]
+ process.c: null bytes
- * vm_insnhelper.c (vm_callee_setup_keyword_arg): check unknown
- keywords.
+ * process.c (rlimit_type_by_sym): prohibit null bytes in key
+ names. [ruby-core:82033] [Bug #13744]
-Sun Dec 8 14:55:12 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+Wed Aug 9 16:56:52 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_shuffle_bang, rb_ary_sample): rename local variables.
+ optparse.rb: get rid of eval
-Sun Dec 8 13:59:38 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * lib/optparse.rb: try Float() and Integer() instead of eval,
+ which does too much things.
- * array.c (rb_ary_shuffle_bang, rb_ary_sample): check
- unknown keywords.
- * test/ruby/test_array.rb (test_shuffle, test_sample): tests for
- the above.
+Fri Jul 7 10:58:10 2017 Eric Wong <e@80x24.org>
-Sun Dec 8 13:01:11 2013 Aman Gupta <ruby@tmm1.net>
+ This backport of r58812 is necessary to ease backporting r59028,
+ which fixes a real bug.
- * vm.c (ruby_vm_stat): add RubyVM.stat() for access to internal cache
- counters. this methods behaves like GC.stat, accepting an optional
- hash or symbol argument. [Bug #9190] [ruby-core:58750]
- * test/ruby/test_rubyvm.rb: test for new method
+ * thread.c (struct waiting_fd): declare
+ (rb_thread_io_blocking_region): use on-stack list waiter
+ (rb_notify_fd_close): walk vm->waiting_fds instead
+ (call_without_gvl): remove old field setting
+ (th_init): ditto
+ [Feature #9632]
-Sun Dec 8 11:59:40 2013 Aman Gupta <ruby@tmm1.net>
+ * vm_core.h (typedef struct rb_vm_struct): add waiting_fds list
- * hash.c (rb_hash_replace): add a write barrier to fix GC mark miss on
- hashes using Hash#replace [Bug #9226] [ruby-core:58948]
+ * (typedef struct rb_thread_struct): remove waiting_fd field
+ (rb_vm_living_threads_init): initialize waiting_fds list
-Sun Dec 8 11:21:00 2013 Aman Gupta <ruby@tmm1.net>
+ This should fix bad interactions with test_race_gets_and_close
+ in test/ruby/test_io.rb since we ensure rb_notify_fd_close
+ continues returning the busy flag after enqueuing the interrupt.
- * include/ruby/ruby.h: add RGENGC_WB_PROTECTED_NODE_CREF setting
- In a large app, this reduces the size of
- remembered_shady_object_count by 80%. [Bug #9225] [ruby-core:58947]
- * gc.c (rb_node_newnode): add FL_WB_PROTECTED flag to NODE_CREF
- * class.c (rewrite_cref_stack): insert OBJ_WRITE for NODE_CREF
- * iseq.c (set_relation): ditto
- * iseq.c (rb_iseq_clone): ditto
- * vm_eval.c (rb_yield_refine_block): ditto
- * vm_insnhelper.c (vm_cref_push): ditto
- * vm_insnhelper.h (COPY_CREF): ditto
+ * thread.c (rb_notify_fd_close): do not enqueue multiple interrupts
+ [ruby-core:81581] [Bug #13632]
-Sun Dec 8 10:45:05 2013 Aman Gupta <ruby@tmm1.net>
+ * test/ruby/test_io.rb (test_single_exception_on_close):
+ new test based on script from Nikolay
- * hash.c (hash_aset_str): revert r43870 due to performance issue
- [Bug #9188] [ruby-core:58730]
- * parse.y (assoc): convert literal string hash keys to fstrings
- * test/ruby/test_hash.rb (class TestHash): expand test
+Wed Jul 5 15:55:35 2017 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Dec 8 10:22:38 2013 Aman Gupta <ruby@tmm1.net>
+ * ext/openssl/ossl_cipher.c: remove the encryption key initialization
+ from Cipher#initialize. This is effectively a revert of r32723
+ ("Avoid possible SEGV from AES encryption/decryption", 2011-07-28).
+ the patch is derived from https://github.com/ruby/openssl/commit/8108e0a6db133f3375608303fdd2083eb5115062,
+ written by Kazuki Yamaguchi.
+ [Backport #8221]
- * parse.y (register_symid_str): use fstrings in symbol table
- [Bug #9171] [ruby-core:58656]
- * parse.y (rb_id2str): ditto
- * string.c (rb_fstring): create frozen_strings on first usage. this
- allows rb_fstring() calls from the parser (before cString is created)
- * string.c (fstring_set_class_i): set klass on fstrings generated
- before cString was defined
- * string.c (Init_String): convert frozen_strings table to String
- objects after boot
- * ext/-test-/symbol/type.c (bug_sym_id2str): expose rb_id2str()
- * test/-ext-/symbol/test_type.rb (module Test_Symbol): verify symbol
- table entries are fstrings
+Sat Jul 1 00:28:22 2017 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Dec 8 10:24:20 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/psych/yaml: update libyaml to 0.1.7.
- * lib/rubygems.rb: Update version for upcoming ruby 2.1.0 RC.
+ * ext/psych/psych.gemspec: bump version to 2.1.0.1.
-Sun Dec 8 10:21:36 2013 Eric Hodel <drbrain@segment7.net>
+Fri Jun 30 22:05:39 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems: Update to RubyGems master 14749ce. This fixes bugs
- handling of gem dependencies lockfiles (Gemfile.lock).
+ * parse.y (parser_precise_mbclen): check invalid multibyte char at
+ skipping strings following ?x literal string, not to stuck in a
+ infinite loop. [Bug #13672]
- * test/rubygems: ditto.
+Fri Jun 30 22:00:56 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 8 09:40:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs
+ a separator. File.basename returns "/" on UNC root, as well as sole
+ drive letter, even if it does not end with a separator. [Bug #13515]
- * array.c (rb_ary_or): use RHASH_TBL_RAW instead of RHASH_TBL
+Fri Jun 30 21:57:27 2017 Kouhei Sutou <kou@cozmixng.org>
- * process.c (rb_execarg_fixup): use RHASH_TBL_RAW and insert write
- barriers where appropriate
+ * lib/rexml/parsers/streamparser.rb: add close tag check on end of
+ document to StreamParser [Bug #13636]
+ Reported by Anton Sivakov. Thanks!!!
- * vm.c (kwmerge_i): use RHASH_TBL_RAW
+Fri Jun 30 21:54:01 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c (HASH_ASET): use rb_hash_aset instead of calling directly into
- st_insert
+ * array.c (rb_ary_insert): check position to insert even if no elements
+ to be inserted. [Bug #13558]
-Sat Dec 7 11:15:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 30 21:51:40 2017 Marcus Stollsteimer <sto.mar@web.de>
- * hash.c (rb_hash_reject): copy unrejected elements only to new hash,
- so that the change on the original receiver can affect.
- [ruby-core:58914] [Bug #9223]
+ * ext/date/date_core.c: [DOC] fix documentation for %Z format of
+ {Date,DateTime}.strftime.
+ Reported by Damon Timm. Based on a patch by nano.
+ [Bug #13231] [Fix GH-1565]
-Sat Dec 7 08:25:00 2013 Richo Healey <richo@psych0tik.net>
+Fri Jun 30 21:46:50 2017 Kouhei Sutou <kou@cozmixng.org>
- * test/ruby/test_struct.rb: Add regression test for question marks and
- bangs in struct members. [Closes GH-468]
+ * lib/rss/rss.rb: Accept empty text element as valid element
+ Parser has been accepted it but XML serializer wasn't accepted.
+ Reported by stefano frabetti. Thanks!!!
+ [Bug #13531]
-Fri Dec 6 19:33:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 30 21:40:42 2017 Kazuki Yamaguchi <k@rhe.jp>
- * class.c (rb_extract_keywords, rb_get_kwargs): move from
- vm_insnhelper.c.
+ * ext/openssl/ossl_x509store.c: clear error queue after calling
+ X509_LOOKUP_load_file()
-Fri Dec 6 19:18:02 2013 Koichi Sasada <ko1@atdot.net>
+ X509_LOOKUP_load_file(), which ends up calling
+ X509_load_cert_crl_file()
+ internally, may leave error entries in the queue even when it returns
+ non-zero value (which indicates success).
- * gc.c: change oldmalloc meaning.
- Increase oldmalloc_increase with malloc_increase
- instead of using obj_memsize_of().
+ This will be fixed by OpenSSL 1.1.1, but can be worked around by
+ clearing the error queue ourselves.
- This change will avoid the danger of memory full without major GC.
+ Fixes: [Backport #11033]
-Fri Dec 6 19:08:48 2013 Koichi Sasada <ko1@atdot.net>
+Fri Jun 30 21:35:16 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (atomic_sub_nounderflow): not 0 but val itself.
+ * gc.c (heap_page_allocate): expand sorted pages before inserting
+ allocated new page. [Bug #12670]
-Fri Dec 6 18:37:11 2013 Koichi Sasada <ko1@atdot.net>
+Fri Jun 30 21:33:39 2017 Koichi Sasada <ko1@atdot.net>
- * gc.c (rb_objspace_alloc, Init_heap): initialize
- oldmalloc_increase_limit at Init_heap.
+ * gc.c (heap_page_resurrect): do not return tomb_pages when
+ page->freelist == NULL.
+ [Bug #12670]
- rb_objspace_alloc() is not called on some platforms.
+Fri Jun 30 21:23:20 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 6 18:33:39 2013 Koichi Sasada <ko1@atdot.net>
+ * vsnprintf.c (BSD_vfprintf): sign and hex-prefix should not be counted
+ in precision. [Bug #8916]
- * gc.c (garbage_collect_body): bug fix.
- initialize after recording.
+Fri Jun 30 21:20:14 2017 Koichi Sasada <ko1@atdot.net>
-Fri Dec 6 17:49:46 2013 Koichi Sasada <ko1@atdot.net>
+ * thread.c (ruby_thread_stack_overflow): disable VM events when stack
+ overflow occurred; it causes another stack overflow again in making
+ backtrace object, and crashes. [Bug #13425]
- * gc.c (atomic_sub_nounderflow): added to simplify atomic sub with
- care about underflow.
+ * vm.c (hook_before_rewind): skip rewind hooks if err is
+ SystemStackError because rewind hooks can cause stack overflow again
+ and again.
- * gc.c (objspace_malloc_increase): use it.
+ * thread.c (ruby_thread_stack_overflow): do not disable all hooks.
+ Additionally, clearing ruby_vm_event_flags is not suitable way
+ to disable hooks.
-Fri Dec 6 17:10:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 30 21:13:25 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c (rb_get_kwargs): get keyword argument values from an
- option hash, not only checking keys.
+ * proc.c (method_super_method): skip prepended modules and continue from
+ the super class of the original class. [Bug #13656]
- * dir.c (dir_initialize): use rb_get_kwargs.
+Fri Jun 30 21:10:48 2017 Shugo Maeda <shugo@ruby-lang.org>
- * gc.c (gc_start_internal): ditto.
+ * lib/net/smtp.rb (getok, get_response): raise an ArgumentError when
+ CR or LF is included in a line, because they are not allowed in
+ RFC5321. Thanks, Jeremy Daer.
-Fri Dec 6 16:47:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 30 21:07:56 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * misc/ruby-mode.el (ruby-brace-to-do-end): split single line block.
+ * eval.c (exc_setup_cause): need to unfreeze(=dup) the exception before
+ setting cause if its frozen.
- * misc/ruby-mode.el (ruby-do-end-to-brace): shrink single line block
- to one line.
+Fri Jun 30 21:07:14 2017 Eric Wong <e@80x24.org>
-Fri Dec 6 16:16:30 2013 Koichi Sasada <ko1@atdot.net>
+ thread.c: avoid busy looping on rb_thread_fd_close
- * gc.c (gc_start_internal): do not use rb_gc_start() and rb_gc().
+ We no longer use it this function, but extensions do, and
+ we need to ensure it continues to work for them.
-Fri Dec 6 15:24:30 2013 Koichi Sasada <ko1@atdot.net>
+ * thread.c (rb_thread_fd_close): schedule other threads in loop
- * gc.c (gc_start_internal, rb_gc): do not need
- heap_pages_free_unused_pages() here.
- It was done in after_sweep().
+ * ext/-test-/thread_fd_close/thread_fd_close.c: new file
- * gc.c (rb_gc): The reason is now GPR_FLAG_CAPI.
+ * ext/-test-/thread_fd_close/depend: ditto
-Fri Dec 6 14:05:19 2013 Aman Gupta <ruby@tmm1.net>
+ * ext/-test-/thread_fd_close/extconf.rb: ditto
- * gc.c (gc_start_internal): GC.start() now accepts two optional
- keyword arguments. These can be used to disable full_mark (minor
- mark only) or disable immediate_sweep (use lazy sweep). These new
- options are useful for benchmarking GC behavior, or performing minor
- GC out-of-band.
- * test/ruby/test_gc.rb (class TestGc): tests for new options.
+ * test/-ext-/thread_fd_close/test_thread_fd_close.rb: new test
-Fri Dec 6 11:51:28 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Fri Jun 30 20:34:49 2017 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/erb.rb: [DOC] fix broken link, Use rubygems.org and www.ruby-toolbox.com instead of RAA.
- [Bug #9197]
+ * sample/pty/shl.rb: update sample
+ * Specify frozen_string_literal: true.
+ * Fix TypeError of raise.
+ * Use a character literal instead of Integer.
-Fri Dec 6 10:50:54 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Fri Jun 30 20:31:59 2017 Marcus Stollsteimer <sto.mar@web.de>
- * lib/webrick/httprequest.rb: [DOC] Fix broken link of CGI specification by @udzura [fix GH-466]
+ * string.c: [DOC] clarify docs for String#split when called with limit
+ and capture groups. Reported by Cichol Tsai. [Bug #13621]
-Thu Dec 6 01:27:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Fri Jun 30 20:23:31 2017 Takashi Kokubun <takashikkbn@gmail.com>
- * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec):
- treat 0.0 and -0.0 of floating-point numbers specially for an optimization
- and to correctly propagate its signbit to the result.
- [Bug #9214] [ruby-core:58858]
+ * lib/erb.rb: Allow explicit trimming carriage return when trim_mode is
+ "-", for Windows environments. [Bug #5339]
- * test/bigdecimal/test_bigdecimal.rb: add tests case for the above change.
+ * lib/erb.rb: Allow trimming CR in all trim_modes to unify a behavior
+ with r58823 and r58825.
- * test/bigdecimal/test_bigdecimal_util.rb: ditto.
+Fri Jun 30 20:16:15 2017 Takashi Kokubun <takashikkbn@gmail.com>
-Thu Dec 5 22:18:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/erb.rb: Allow trimming carriage return when trim_mode is "<>", for
+ Windows environments. [Bug #11464]
- * lib/mkmf.rb (configuration): strip destdir part from prefix to get
- rid of duplication. a patch by arton at [ruby-core:58859].
- [ruby-core:58856] [Bug #9213]
+Fri Jun 30 20:07:37 2017 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Dec 5 21:53:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * util.c (ruby_strtod) Merge latest dtoa.c [Bug #13545]
+ Apply some part of http://www.netlib.org/fp/dtoa.c with my eyes...
- * array.c (rb_ary_or): lhs elements are preferred, so should not
- replace with rhs elements.
+Fri Jun 30 20:00:18 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_array.rb (test_OR_in_order): import the test failed
- by r43969 from rubyspec/core/array/union_spec.rb.
+ * dir.c (is_case_sensitive): use getattrlist() if fgetattrlist() is
+ unavailable, on OSX 10.5. [Bug #11054]
-Thu Dec 5 21:05:42 2013 Koichi Sasada <ko1@atdot.net>
+Fri Jun 30 19:58:16 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (gc_info_decode): fix to avoid syntax error on VS2012.
+ * tool/mkconfig.rb (RbConfig): prefix SDKROOT to oldincludedir
+ not includedir, the latter is outside the ruby installation.
+ [ruby-core:72496] [Bug #11881]
-Thu Dec 5 19:35:35 2013 Martin Duerst <duerst@it.aoyama.ac.jp>
+Fri Jun 30 19:56:06 2017 Eric Wong <e@80x24.org>
- * st.c: tweaked comment
+ * variable.c (check_autoload_required): do not assume a provided feature
+ means autoload is complete, always wait if autoload is being performed
+ by another thread. [Bug #11384] Thanks to s.wanabe@gmail.com
-Thu Dec 5 19:21:10 2013 Aman Gupta <ruby@tmm1.net>
+Fri Jun 30 19:53:30 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (struct rb_objspace): rename internal last_collection_flags to
- latest_gc_info
- * gc.c (gc_latest_collection_info): add GC.latest_gc_info() with similar
- behavior to GC.stat()
- * gc.c (rb_gc_latest_gc_info): new c-api for above
- * gc.c (gc_stat_internal): remove :last_collection_flags from GC.stat
- * gc.c (gc_profile_decode_flags): remove GC::Profiler.decode_flags
- * include/ruby/intern.h (rb_gc_latest_gc_info): export new c-api
- * test/ruby/test_gc.rb (class TestGc): test for new behavior
- * NEWS: note about new api
+ * process.c (obj2uid, obj2gid): use temporary string as the buffer
+ instead of rb_alloc_tmp_buffer, which is NODE_ALLOCA since r51492.
+ [Bug #13554]
- * gc.c (gc_stat_internal): raise TypeError on wrong type
- * gc.c (gc_stat): fix error message
+Fri Jun 30 19:50:25 2017 Eric Wong <e@80x24.org>
-Thu Dec 5 18:18:08 2013 Aman Gupta <ruby@tmm1.net>
+ * variable.c (autoload_reset): use idempotent list_del_init
- * ext/objspace/gc_hook.c: remove this file
- * ext/-test-/tracepoint/gc_hook.c: new filename for above
- * ext/objspace/objspace.c: remove ObjectSpace.after_gc_start_hook=
- * test/objspace/test_objspace.rb: remove test
- * test/-ext-/tracepoint/test_tracepoint.rb: add above test for
- tracepoint re-entry
+ * variable.c (autoload_sleep): moved code from rb_autoload_load
-Thu Dec 5 17:44:53 2013 Koichi Sasada <ko1@atdot.net>
+ * variable.c (autoload_sleep_done): cleanup for use with rb_ensure
- * gc.c: change function names vm_ prefix to objspace_ prefix.
- They are objspace_ functionality.
+ * variable.c (rb_autoload_load): ensure list delete happens in case the
+ thread dies during sleep
-Thu Dec 5 16:11:04 2013 Aman Gupta <ruby@tmm1.net>
+ * test/ruby/bug-13526.rb: new script for separate execution
- * include/ruby/intern.h: add rb_gc_stat() for access to GC.stat
- variables from c-api
- * gc.c (rb_gc_stat): new c-api method. accepts either VALUE hash like
- GC.stat, or VALUE symbol key and returns size_t directly. the second
- form is useful to avoid allocations, i.e. for usage inside
- INTERNAL_EVENT_GC tracepoints.
- * gc.c (gc_stat): add GC.stat(:key) to return single value instead of hash
- * gc.c (gc_stat_internal): helper method to retrieve single or all stat values
- * test/ruby/test_gc.rb (class TestGc): test for new behavior
- * NEWS: note about this new api
+ * test/ruby/test_autoload.rb (test_bug_13526): new test [Bug #13526]
-Thu Dec 5 14:40:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 30 19:46:46 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_hash): revert r43981 and bail out to the outermost frame
- when recursion is detected.
+ * sprintf.c (rb_str_format): while "% 2f" and "% 4f" result in " Inf"
+ and " Inf" respectively, "% 3f" results in "Inf" (no space).
-Thu Dec 5 13:47:15 2013 Koichi Sasada <ko1@atdot.net>
+ * sprintf.c (rb_str_format): as for non-finite float, calculate the
+ exact needed size with the space flag.
- * gc.c (vm_malloc_size): added.
- return malloc_usable_size() if possible.
+Fri Jun 30 19:41:48 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (MALLOC_ALLOCATED_SIZE): add new setting macro to enable
- GC.allocated_size.
- If platform supports `malloc_usable_size()' (or similar one),
- GC.allocated_size can be implemented with this function.
- Default is 0.
+ * thread_win32.c (w32_wait_events): do not acquire GVL, to fix deadlock
+ at read/close race condition. instead, just ignore interrupt_event if
+ it is closed.
- * gc.c (vm_xmalloc, vm_xrealloc, vm_xfree): use vm_malloc_size()
- to detect collect allocated size.
+ * thread_win32.c (w32_wait_events): fix wait object index in the case of
+ interrupt_event is not usable.
- * gc.c (vm_malloc_increase): refactoring.
+Fri Jun 30 19:37:47 2017 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Dec 5 13:19:03 2013 Aman Gupta <ruby@tmm1.net>
+ * io.c (nogvl_wait_for_single_fd): nogvl_wait_for_single_fd must wait
+ as its name.
+ poll(fds, n, 0) mean no timeout and immediately return. If you want to
+ wait something, you need to use -1 instead.
- * include/ruby/ruby.h: remove INTERNAL_EVENT_GC_END and replace with
- two new events: GC_END_MARK and GC_END_SWEEP
- * gc.c (gc_after_sweep): emit GC_END_SWEEP after lazy sweep is done
- * gc.c (gc_marks_body): emit GC_END_MARK at end of minor/major mark
- * ext/-test-/tracepoint/tracepoint.c (struct tracepoint_track): tests
- for new events.
- * test/-ext-/tracepoint/test_tracepoint.rb (class TestTracepointObj):
- ditto.
- * NEWS: remove ObjectSpace.after_gc_*_hook. These are only a sample,
- and will be removed before ruby 2.1.
- * ext/objspace/gc_hook.c: remove ObjectSpace.after_gc_end_hook=
+Fri Jun 30 19:35:31 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 5 10:47:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (Init_class_hierarchy): prevent rb_cObject which is the class
+ tree root, from GC. [Bug #12492]
- * ruby_atomic.h (ATOMIC_PTR_EXCHANGE): atomic exchange function for
- a generic pointer.
+Fri Jun 30 19:32:52 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 5 10:47:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (Init_class_hierarchy): prevent rb_cObject which is the
+ class tree root, from GC. [ruby-dev:49666] [Bug #12492]
- * gc.c (finalize_deferred): flush all deferred finalizers while other
- finalizers can get ready to run newly by lazy sweep.
- [ruby-core:58833] [Bug #9205]
+Fri Jun 30 19:29:45 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 5 09:07:59 2013 Aman Gupta <ruby@tmm1.net>
+ * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): fix for nested
+ indedented here documents, where Elems are nested too. [Bug #13536]
- * gc.c (ruby_gc_set_params): Accept safe_level argument so GC tuning
- settings can be applied before rb_safe_level() is available.
- * internal.h (rb_gc_set_params): ditto.
- * ruby.c (process_options): Apply GC tuning early during boot process
- so boot-time allocations can benefit. This also benefits any code
- loaded in via `ruby -r`.
+ * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): insert stripped
+ leading spaces as on_ignored_sp elements, so that the original source
+ can be reconsructed. [Bug #13536]
-Wed Dec 4 13:02:13 2013 Aman Gupta <ruby@tmm1.net>
+Mon May 1 06:36:57 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_trace.c (rb_suppress_tracing): Fix initialization of stack
- allocated rb_trace_arg_t structure. Without this patch, sometimes
- INTERNAL_EVENT_GC would be skipped accidentally inside
- rb_threadptr_exec_event_hooks_orig().
+ * parse.y (parser_parse_string): set the mark of term to `nd_func`
+ because in this version `u2.id` is not used for this purpose.
+ fixed failure of ruby/spec introduced at r58518.
+ see also [Backport #13363]
-Wed Dec 4 12:57:24 2013 Aman Gupta <ruby@tmm1.net>
+Sun Apr 30 23:01:00 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (fstr_update_callback): Improve implementation in r43968
- based on feedback from @nagachika. In the existing case, we can
- return ST_STOP to prevent any hash modification. In the !existing
- case, set both key and value to the fstr.
+ class.c: ensure_includable
-Wed Dec 4 12:47:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (ensure_includable): extract checks to include and
+ prepend.
- * lib/delegate.rb (Delegator#method_missing): ignore the target if not
- set, and delegate to global methods. [ruby-core:58572] [Bug #9155]
+ class.c: prohibit refinement module
- * lib/delegate.rb (Delegator#respond_to_missing): ditto.
+ * class.c (ensure_includable): cannot include refinement
+ module, or the type and the class do not match.
+ [ruby-core:79632] [Bug #13236]
- * lib/delegate.rb (SimpleDelegator#__getobj__): yield and return if
- not delegated but a block is given, like as Hash#fetch.
+Sun Apr 30 22:55:41 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/delegate.rb (DelegateClass#__getobj__): ditto.
+ keep line number after unterminated string literal
-Tue Dec 3 23:48:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (parser_parse_string): keep line number even after an
+ unterminated string literal. it does not matter in the parser,
+ ripper needs this value after this error.
- * configure.in: check malloc_size() availability.
+ parse.y: unterminated content token
- * gc.c: use malloc_size() with malloc/malloc.h if available.
+ * parse.y (parser_parse_string): defer the end token to next
+ reading, to yield tSTRING_CONTENT with the unterminated content.
+ [Bug #13363]
-Tue Dec 3 23:06:20 2013 Narihiro Nakamura <authornari@gmail.com>
+Sun Apr 30 22:52:38 2017 Marcus Stollsteimer <sto.mar@web.de>
- * object.c (rb_obj_clone): don't copy FL_WB_PROTECTED of a
- original object.
+ * io.c: [DOC] expand docs for IO#puts
+ [Bug #13306]
-Tue Dec 3 22:32:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Apr 30 22:38:44 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_hash_recursive): make similar (recursive) constructs
- return same hash value. execute recursively, and rewind to the
- topmost frame with an object which .eql? to the recursive
- object, if recursion is detected.
+ sample/pty/shl.rb: update [ci skip]
- * hash.c (rb_hash): detect recursion for all `hash' methods. each
- `hash' methods no longer need to use rb_exec_recursive().
+ * sample/pty/shl.rb: stop writer loop when the child exited.
+ PTY::ChildExited no longer raises asynchronously since r20298.
+ [ruby-dev:49974] [Bug #13191]
-Tue Dec 3 21:53:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * sample/pty/shl.rb: use io/console instead of stty.
+ [ruby-dev:49974] [Bug #13191]
- * vm_eval.c (rb_catch_protect): new function similar to
- rb_catch_obj(), but protect from all global jumps like as
- rb_load_protect(), rb_protect(), etc.
+ * sample/pty/shl.rb: do not manage array length separately.
+ [ruby-dev:49974] [Bug #13191]
-Tue Dec 3 20:18:46 2013 Narihiro Nakamura <authornari@gmail.com>
+ * sample/pty/shl.rb: leap exited child process.
+ [ruby-dev:49974] [Bug #13191]
- * object.c (rb_obj_clone): Protect FL_PROMOTED and FL_WB_PROTECTED
- flags of a destination object.
+Sun Apr 30 22:35:10 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 3 20:16:38 2013 Masaki Matsushita <glass.saga@gmail.com>
+ configure.in: use AC_SEARCH_LIBS
- * array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new(),
- to hide temporary object from ObjectSpace. [Bug #9187]
+ * configure.in (--with-gmp, --with-jemalloc): use AC_SEARCH_LIBS
+ to check if no library is required, instead of AC_CHECK_LIB.
+ [ruby-core:79368] [Bug #13175]
-Tue Dec 3 17:11:47 2013 Aman Gupta <ruby@tmm1.net>
+Sun Apr 30 22:24:25 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * load.c (features_index_add_single): Move loaded_features_index array values off
- the ruby heap. [Bug #9201] [ruby-core:58805]
- * load.c (loaded_features_index_clear_i): Clean up off-heap array structure.
- * vm.c (rb_vm_mark): Remove unnecessary mark_tbl for loaded_features_index.
- This improves minor GC time by 15% in a large application.
+ * numeric.c (flo_round): [EXPERIMENTAL] adjust the case that the
+ receiver is close to the exact but unrepresentable middle value
+ of two values in the given precision.
+ http://d.hatena.ne.jp/hnw/20160702
-Tue Dec 3 17:01:45 2013 Aman Gupta <ruby@tmm1.net>
+Sun Apr 9 22:21:23 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * include/ruby/ruby.h (struct RClass): Add wrapper struct around
- RClass->m_tbl with serial. This prevents double marking method
- tables, since many classes/modules can share the same method table.
- This improves minor mark time in a large application by 30%.
- * internal.h (struct method_table_wrapper): Define new
- wrapper struct with additional serial.
- * internal.h (RCLASS_M_TBL_INIT): New macro for initializing method
- table wrapper and st_table.
- * method.h (void rb_sweep_method_entry): Rename rb_free_m_table to
- rb_free_m_tbl for consistency
- * .gdbinit (define rb_method_entry): Update rb_method_entry gdb helper
- for new method table structure.
- * class.c: Use RCLASS_M_TBL_WRAPPER and
- RCLASS_M_TBL_INIT macros.
- * class.c (rb_include_class_new): Share WRAPPER between module and
- iclass, so serial can prevent double marking.
- * eval.c (rb_prepend_module): ditto.
- * eval.c (rb_using_refinement): ditto.
- * gc.c: Mark and free new wrapper struct.
- * gc.c (obj_memsize_of): Count size of additional wrapper struct.
+ thread.c: rb_thread_fd_close [ci skip]
-Tue Dec 3 14:05:49 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * thread.c (rb_thread_fd_close): re-define because of a couple of
+ external libraries used it.
- * array.c (rb_ary_uniq_bang): remove duplicate code.
+Wed Mar 29 23:47:31 2017 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Tue Dec 3 13:40:42 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * hash.c (any_hash): fix CI failure on L32LLP64 architecture.
+ The patch was provided by usa. [ruby-core:80484] [Bug #13376]
- * array.c (ary_add_hash): set and return values because string keys
- will be frozen. [ruby-core:58809] [Bug #9202]
+Wed Mar 29 06:22:27 2017 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * array.c (rb_ary_uniq_bang): ditto.
+ * hash.c (any_hash): fix Symbol#hash to be nondeterministic.
+ The patch was provided by Eric Wong. [ruby-core:80433] [Bug #13376]
- * array.c (rb_ary_or): ditto.
+ * test/ruby/test_symbol.rb: add test for above.
- * array.c (rb_ary_uniq): ditto.
+Tue Mar 28 00:38:39 2017 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_array.rb: tests for above.
+ * win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets
+ errno internally, then should not set it here.
- The patch is from normalperson (Eric Wong).
+Mon Mar 27 20:15:17 2017 Kazuki Tsujimoto <kazuki@callcc.net>
-Tue Dec 3 12:20:21 2013 Aman Gupta <ruby@tmm1.net>
+ * eval.c, method.h, proc.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c:
+ TracePoint#method_id should return method_id, not callee_id.
+ [ruby-core:77241] [Feature #12747]
- * string.c (rb_fstring): Use st_update instead of st_lookup +
- st_insert.
- * string.c (fstr_update_callback): New callback for st_update.
+ * test/ruby/test_settracefunc.rb: change accordingly.
-Tue Dec 3 12:17:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 27 20:12:23 2017 Anton Davydov <mail@davydovanton.com>
- * lib/rdoc/constant.rb (RDoc::Constant#documented?): workaround for
- NoMethodError when the original of alias is not found.
+ * lib/uri/mailto.rb: Removed needless `return` and use `.`` instead of `::`
+ with class method.
+ * test/uri/test_mailto.rb: Added tests for coverage.
-Tue Dec 3 10:43:58 2013 Eric Hodel <drbrain@segment7.net>
+Mon Mar 20 06:35:08 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/buffering.rb: Return ASCII-8BIT strings from
- SSLSocket methods. [ruby-trunk - Bug #9028]
- * test/openssl/test_ssl.rb: Test for the above.
+ * ruby.c (process_options): convert -e script to the encoding
+ given by a command line option on Windows. assume it is the
+ expected encoding. [ruby-dev:49461] [Bug #11900]
-Tue Dec 3 09:42:27 2013 Eric Hodel <drbrain@segment7.net>
+Mon Mar 20 05:47:49 2017 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc: Update to RDoc master 900de99. Changes include:
+ * test/ruby/test_exception.rb: fix thread issues.
+ * use Queue instead of a local variable for synchronization.
+ * join created thread to soleve leaking threads warning.
- Fixed documentation display of constants
+Mon Mar 20 05:47:49 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Fixed handling of unknown parsers
+ * thread.c (rb_threadptr_raise): set cause from the called thread,
+ but not from the thread to be interrupted.
+ [ruby-core:77222] [Bug #12741]
- * test/rdoc: ditto.
+Wed Feb 8 02:17:02 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 2 22:30:10 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/forwardable.rb (Forwardable._delegator_method): extract
+ method generator and deal with non-module objects.
+ [ruby-dev:49656] [Bug #12478]
- * hash.c (getenv): fixed test failures introduced by r43950.
- [ruby-core:58774] [Bug #9195] reported by phasis68 (Heesob Park).
+Wed Feb 8 02:17:02 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 2 21:49:19 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/forwardable.rb (def_instance_delegator): adjust backtrace of
+ method body by tail call optimization. adjusting the delegated
+ target is still done by deleting backtrace.
- * hash.c (rb_hash_rehash): make temporary st_table under the control
- of GC. [Bug #9187]
+ * lib/forwardable.rb (def_single_delegator): ditto.
- * test/ruby/test_hash.rb: add a test for above.
+Tue Jan 17 03:51:48 2017 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 2 17:23:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * compile.c (setup_args): duplicate splatting array if more
+ arguments present to obey left-to-right execution order.
+ [ruby-core:77701] [Bug# 12860]
- * variable.c (rb_mod_constants): when calling Module#constants with
- inherit=false, there is no need to use a hashtable to deduplicate
- constant names. [Feature #9196] [ruby-core:58786]
+Thu Nov 24 05:47:18 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Mon Dec 2 14:16:52 2013 Eric Hodel <drbrain@segment7.net>
+ * test/fileutils/test_fileutils.rb (TestFileUtils#setup): Use primary
+ group as well as supplementary groups.
+ based on the patch by Vit Ondruch at [Bug #12910]
- * lib/net/smtp.rb (Net::SMTP#critical): Always return a
- Net::SMTP::Response. Patch by Pawel Veselov.
- [ruby-trunk - Bug #9125]
- * test/net/smtp/test_smtp.rb: Test for the above.
+Thu Nov 24 05:44:04 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Mon Dec 2 05:52:33 2013 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_dir_m17n.rb: Don't encode to UTF-8 if it's unnecessary.
+ If the file system encoding is ISO-8851-1 or if the encoding of the
+ target string is invalid, don't encode to UTF-8. [Bug#12972]
- * lib/rubygems: Update to RubyGems master baa965b. Notable changes:
+Mon Nov 21 16:55:15 2016 boshan <boshan@subsplash.com>
- Copy directories to lib/ when installing extensions. This completes
- the fix for [ruby-trunk - Bug #9106]
+ * lib/tempfile.rb (Tempfile#initialize): [DOC] the first parameter
+ `basename` is optional and defaulted to an empty string since
+ [GH-523]. [Fix GH-1225]
- * test/rubygems: ditto.
+Sat Nov 19 14:06:07 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Mon Dec 2 02:03:47 2013 Shota Fukumori <her@sorah.jp>
+ * iseq.c (proc_dup): don't duplicate sym_procs. [Fix GH-1479]
+ [ruby-core:78100] [Bug #12927]
+ Based on the patch provided by Emiliano Ritiro.
- * test/ruby/test_case.rb (test_nomethoderror):
- Add test related to r43913, r43914
+Sat Nov 19 11:48:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 2 00:53:01 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * iseq.c (iseqw_s_compile_file): deal with syntax error as well as
+ compile, and should not abort when rescued.
- * hash.c (getenv): use ANSI codepage version of getenv() for miniruby
- on Windows.
- [ruby-core:58732] [Bug #9189] reported by phasis68 (Heesob Park).
-
-Sun Dec 1 22:14:27 2013 Zachary Scott <e@zzak.io>
-
- * doc/contributors.rdoc: [DOC] Import contributors from redmine wiki
- Many wiki pages have become outdated and spam-ridden, we will import
- these to trunk and begin maintaining them in ruby-trunk. This will
- also allow new contributors to easily contribute patches to update
- these pages, where previously a redmine account with wiki access was
- required. Another bonus is having a contributors file to show thanks
- to all of the people who have submitted a patch to Ruby.
+Wed Nov 16 23:40:29 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Sun Dec 1 18:03:26 2013 Zachary Scott <e@zzak.io>
+ * vm_eval.c (vm_call0_body): refined module should not be skipped as
+ prepended. [Bug #12920]
- * doc/maintainers.rdoc: [DOC] Current maintainers of Ruby
+Tue Nov 15 03:14:02 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 1 17:17:36 2013 Zachary Scott <e@zzak.io>
+ * ext/-test/file/fs.c (get_atime_p): Updating of file access times
+ is enabled or not.
- * doc/contributing.rdoc: [DOC] Current branch maintainers
+Tue Nov 15 03:14:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 1 17:16:36 2013 Zachary Scott <e@zzak.io>
+ * test/ruby/test_file.rb (TestFile#test_stat): fix noatime case.
+ [ruby-core:77943] [Bug #12903]
- * doc/contributing.rdoc: [DOC] Reporting other (ruby-lang.org) issues
+Tue Nov 15 03:09:39 2016 Shugo Maeda <shugo@ruby-lang.org>
-Sun Dec 1 17:15:51 2013 Zachary Scott <e@zzak.io>
+ * test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast,
+ test_make_socket_ipv6_multicast_hops): skip if IPv6 multicast
+ address is not available.
- * doc/contributing.rdoc: [DOC] Current platform maintainers
+Tue Nov 15 02:49:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 1 17:14:55 2013 Zachary Scott <e@zzak.io>
+ * vm_eval.c (vm_call0_body): follow the original class, not to
+ loop the prepended module. [ruby-core:77784] [Bug #12876]
- * doc/contributing.rdoc: [DOC] Reporting downstream distro issues
+Tue Nov 15 02:45:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 1 14:37:20 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/net/http.rb (transport_request): other than HTTPContinue
+ in 1xx (HTTPInformation) also needs to continue. [Bug #12890]
- * hash.c (rb_hash_to_a): specify array capa.
+Sat Nov 12 01:05:45 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Dec 1 14:15:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * object.c: Improve documentation for Float conversion.
+ [ruby-core:71661][Bug #11736][ci skip]
- * hash.c (rb_hash_rehash): fix to free new st_table when exception
- is raised in do_hash(). [Bug #9187]
+Sat Nov 12 00:50:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 1 11:57:59 2013 Zachary Scott <e@zzak.io>
+ * proc.c (mnew_internal): follow the original class, not to loop
+ the prepended module. [ruby-core:77591] [Bug #12832]
- * ext/openssl/lib/openssl/buffering.rb: Fix warning in copyright
+Sat Nov 12 00:46:50 2016 Shugo Maeda <shugo@ruby-lang.org>
-Sun Dec 1 08:27:28 2013 Eric Hodel <drbrain@segment7.net>
+ * cont.c (cont_new): disable optimization if clang's version is
+ 3.8.0. [ruby-core:77894] [Bug #12893]
- * lib/rubygems: Update to RubyGems master 66e5c39. Notable changes:
+Sat Nov 12 00:27:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Implement gem.deps.rb (Gemfile) .lock support
+ * compile.c (iseq_peephole_optimize): enable tail call
+ optimization inside a conditional block.
- Fixed `gem uninstall` for a relative directory in GEM_HOME.
-
- * test/rubygems: ditto.
+Sat Nov 5 11:53:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 1 06:00:49 2013 Aman Gupta <ruby@tmm1.net>
+ * io.c (copy_stream_body): use IO to write to copy to duplex IO.
+ http://twitter.com/knu/status/786505317974585344
- * test/ruby/test_gc.rb (test_gc_reason): Force minor GC by consuming
- free slots to fix test.
+Sat Nov 5 11:49:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 30 21:22:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * sprintf.c (rb_str_format): format exact number more exactly.
- * dir.c (dir_initialize): check unknown keywords. [ruby-dev:47152]
- [Bug #8060]
+Sat Nov 5 11:45:32 2016 Kazuki Yamaguchi <k@rhe.jp>
-Sat Nov 30 18:05:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl.c (Init_openssl): register an ex_data index for
+ X509_STORE and X509_STORE_CTX respectively. Since they don't share
+ the ex_data index registry, we can't use the same index.
+ (ossl_verify_cb): use the the correct index.
- * ext/win32ole/win32ole.c (hash2named_arg): correct declaration to fix
- build failure. a patch by phasis68 (Heesob Park) at
- [ruby-core:58710]. [Bug #9184]
+ * ext/openssl/ossl_ssl.c (ossl_ssl_verify_callback): ditto.
-Sat Nov 30 17:46:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_vfy_cb): ditto.
+ (ossl_x509stctx_verify): ditto.
- * eval.c (ruby_cleanup): determine exit status and signal to terminate
- before finalization, to get rid of access destroyed T_DATA exception
- object. [ruby-core:58643] [Bug #9167]
+ * ext/openssl/ossl.h (void ossl_clear_error): add extern declarations
+ of ossl_store_{ctx_,}ex_verify_cb_idx.
-Sat Nov 30 16:25:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/openssl_missing.c: remove X509_STORE_set_ex_data and
+ X509_STORE_get_ex_data.
- * enumerator.c (enumerator_with_index): should not store local variable
- address to memoize the arguments. it is invalidated after the return.
- [ruby-core:58692] [Bug #9178]
+ * ext/openssl/openssl_missing.h: implement X509_STORE_get_ex_data,
+ X509_STORE_set_ex_data and X509_STORE_get_ex_new_index as macros.
-Sat Nov 30 13:28:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 5 11:35:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * siphash.c (sip_hash24): fix for aligned word access little endian
- platforms. [ruby-core:58658] [Bug #9172]
+ * thread.c (rb_thread_pending_interrupt_p): no pending interrupt
+ before initialization.
-Sat Nov 30 13:21:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (thread_raise_m, rb_thread_kill): uninitialized thread
+ cannot interrupt. [ruby-core:72732] [Bug #11959]
- * vm_eval.c (rb_yield_block): implement non-nil block argument.
+Sat Nov 5 11:16:58 2016 Kenta Murata <mrkn@mrkn.jp>
-Fri Nov 29 20:59:39 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c: Import changes from ruby/bigdecimal
+ repository.
- * vm_dump.c (rb_vmdebug_debug_print_pre): Bugfix. Get PC directly.
- PC is cached into local stack and cfp->pc is incorrect at next of
- branch or jump.
- * vm_exec.h (DEBUG_ENTER_INSN): catch up this change.
- * vm_core.h: update signature of rb_vmdebug_debug_print_pre.
+Tue Oct 18 02:58:22 2016 Kazuki Yamaguchi <k@rhe.jp>
-Fri Nov 29 20:43:57 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * eval_intern.h (TH_PUSH_TAG): Initialize struct rb_vm_tag::tag with
+ Qundef rather than 0 which is equal to Qfalse. Since Kernel#throw(obj)
+ searches a tag with rb_vm_tag::tag == obj, throw(false) can
+ accidentally find an unrelated tag which is not created by
+ Kernel#catch. [ruby-core:77229] [Bug #12743]
- * compile.c: Bugsfix for dump_disasm_list.
- rb_inspect denies a hidden object. So, insert wrapper that creates
- the unhidden one.
- adjust->label is null sometimes.
- insn_data_line_no makes no sense at all.
+ * test/ruby/test_exception.rb (test_throw_false): Add a test case for
+ this.
-Fri Nov 29 18:06:45 2013 Shota Fukumori <her@sorah.jp>
+Tue Oct 18 02:24:29 2016 Aurelien Jacobs <aurel@gnuage.org>
- * test/ruby/test_case.rb (test_method_missing): Test for r43913.
+ * lib/logger.rb (Logger::Period#next_rotate_time): fix monthly log
+ rotate when DST is applied during a month of 31 days.
+ [Fix GH-1458]
-Fri Nov 29 17:53:22 2013 Shota Fukumori <her@sorah.jp>
+Wed Oct 12 22:31:09 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * vm_insnhelper.c (check_match): Fix SEGV with VM_CHECKMATCH_TYPE_CASE
- and class of `pattern` has `method_missing`
- [Bug #8872] [ruby-core:58606]
+ * tool/downloader.rb: Removed verification of gem certification.
+ Because signed gem is not working on rubygems ecosystem.
+ * tool/gem-unpack.rb: ditto.
-Fri Nov 29 17:06:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 7 02:48:06 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * vm_eval.c (rb_yield_block): yield block with rb_block_call_func
- arguments.
+ * lib/rubygems/ssl_certs/GlobalSignRootCA.pem: add for RugyGems.org.
- * range.c (range_each): use rb_yield_block.
+Mon Sep 26 23:51:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): constify argv.
+ * variable.c (rb_const_search): raise with the actual class/module
+ name which defines the private constant.
- * enum.c (rb_enum_values_pack): ditto.
+Mon Sep 26 23:34:09 2016 Kazuki Yamaguchi <k@rhe.jp>
- * vm_eval.c (rb_block_call, rb_check_block_call): ditto.
+ * ext/openssl/ossl_pkcs12.c (ossl_pkcs12_initialize): pop errors
+ leaked by PKCS12_parse(). This is a bug in OpenSSL, which exists
+ in the versions before the version 1.0.0t, 1.0.1p, 1.0.2d.
- * include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration
- argument list of rb_block_call_func.
+Mon Sep 26 23:10:43 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 29 11:26:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c (backtrace): use rip in the saved context for the case
+ the SIGSEGV is received when the process is in userland.
+ Note that ip in the stack should be used if the signal is received
+ when it is in kernel (when it is calling syscall) [Bug #12711]
- * include/ruby/ruby.h (rb_block_call_func): add blockarg. block
- function can take block argument, e.g., proc {|&blockarg| ...}.
+Mon Sep 26 20:23:32 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Thu Nov 28 21:43:48 2013 Zachary Scott <e@zzak.io>
+ * gems/bundled_gems: update minitest to 5.8.5.
- * doc/dtrace_probes.rdoc: [DOC] Import dtrace probes doc from wiki
+ * tool/downloader.rb: revert workarounds.
-Thu Nov 28 21:17:32 2013 Zachary Scott <e@zzak.io>
+ * tool/gem-unpack.rb: ditto.
- * doc/contributing.rdoc: [DOC] Add heading above ChangeLog tips to
- setup entry for commits, its not required. Actually easier if
- contributors don't include a ChangeLog entry.
+Mon Sep 26 07:26:44 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Thu Nov 28 21:16:18 2013 Zachary Scott <e@zzak.io>
+ * tool/gem-unpack.rb: don't set security policy.
+ workaround for certificate expiration of minitest-5.8.3.gem.
- * doc/contributing.rdoc: [DOC] Add coding style heading for patch
- rules
+Mon Sep 26 06:33:16 2016 Aaron Patterson <tenderlove@ruby-lang.org>
-Thu Nov 28 21:15:45 2013 Zachary Scott <e@zzak.io>
+ * lib/uri/generic.rb (def check_password): don't include bad password
+ in URI exception output
- * doc/contributing.rdoc: [DOC] Add notes about deciding what to patch
+ * test/uri/test_generic.rb (def test_set_component): test for behavior
-Thu Nov 28 19:43:45 2013 Masaki Matsushita <glass.saga@gmail.com>
+Mon Sep 26 06:20:58 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * benchmark/bm_hash_flatten.rb: added. r43896 is about 4 times faster
- than 2.0.0p353.
+ * tool/downloader.rb: comment out gem package verification.
+ workaround for certificate expiration of minitest-5.8.3.gem.
- * benchmark/bm_hash_keys.rb: added. r43896 is about 5 times faster
- than 2.0.0p353.
+Sun Sep 25 16:37:22 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * benchmark/bm_hash_values.rb: added. r43896 is about 5 times faster
- than 2.0.0p353.
+ * io.c (nogvl_fsync, nogvl_fdatasync): on Windows, just ignore if the
+ fd is associated to non-disk device. if call fsync and/or fdatasync
+ with such fds, it causes Errno::EBADF exception and the behavior is
+ incompatible with ruby 2.1 and earlier unintentionally introduced.
-Thu Nov 28 19:29:04 2013 Zachary Scott <e@zzak.io>
+Sun Sep 25 15:09:04 2016 Kazuki Tsujimoto <kazuki@callcc.net>
- * doc/contributing.rdoc: [DOC] Add notes about slideshow proposals
- from wiki page: HowToRequestFeatures
+ * array.c (flatten): use rb_obj_class instead of rb_class_of
+ because rb_class_of may return a singleton class.
+ [ruby-dev:49781] [Bug #12738]
-Thu Nov 28 17:34:42 2013 Masaki Matsushita <glass.saga@gmail.com>
+Sun Sep 25 15:07:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * st.c: add st_values() and st_values_check().
+ * man/irb.1: remove useless -width option.
+ [ruby-dev:49767] [Bug #12692]
- * include/ruby/st.h: add prototypes for above.
+Tue Aug 30 05:24:33 2016 Kazuki Yamaguchi <k@rhe.jp>
- * hash.c (rb_hash_values): use st_values_check() for performance
- improvement if VALUE and st_data_t are compatible.
+ * ext/openssl/ossl_x509ext.c: additional fix memory leak.
+ [ruby-core:76922] [Bug #12680]
-Thu Nov 28 17:14:14 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * text/openssl/test_x509ext.rb: test for above.
- * st.c (st_keys): fix not to use Qundef in st.c.
+Sun Aug 28 00:26:58 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * include/ruby/st.h: define modified prototype.
+ * vm_method.c: revert r55869. it breaks Integer#days with
+ ActiveSupport-4.1.x. [ruby-core:76949] [Bug #12353]
- * hash.c (rb_hash_keys): use modified st_keys().
+ * test/ruby/test_marshal.rb: ditto.
-Thu Nov 28 16:34:43 2013 Aman Gupta <ruby@tmm1.net>
+Sat Aug 27 03:51:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: Expose details about last garbage collection via GC.stat.
- * gc.c (gc_stat): Add :last_collection_flags for reason/trigger/type of
- last GC run.
- * gc.c (gc_prof_sweep_timer_stop): Record HAVE_FINALIZE GPR even
- without GC_PROFILE_MORE_DETAIL.
- * gc.c (gc_profile_flags): Add GC::Profiler.decode_flags to make sense
- of GC.stat[:last_collection_flags]
- * test/ruby/test_gc.rb (class TestGc): Test for above.
+ * id_table.c (hash_table_extend): should not shrink the table than
+ the previous capacity. [ruby-core:76534] [Bug #12614]
-Thu Nov 28 16:15:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 27 03:37:49 2016 Kazuki Yamaguchi <k@rhe.jp>
- * win32/win32.c (rb_w32_dup2): extract from rb_cloexec_dup2() and
- redirect_dup2().
+ * ext/openssl/ossl_config.c: fix memory leak.
+ [ruby-core:76922] [Bug #12680]
-Tue Nov 28 14:40:00 2013 Akira Matsuda <ronnie@dio.jp>
+ * ext/openssl/ossl_ocsp.c: ditto.
- * lib/drb/ssl.rb: [Doc] Fix typo
+ * ext/openssl/ossl_pkcs12.c: ditto.
-Thu Nov 28 13:56:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_pkcs7.c: ditto.
- * common.mk (Doxyfile): tool/file2lastrev.rb needs running with
- BASERUBY since r43617. [ruby-dev:47823] [Bug #9169]
+ * ext/openssl/ossl_pkey_ec.c: ditto.
-Thu Nov 28 09:18:39 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_x509.h: ditto.
- * string.c (rb_fstring): fstrings should be ELTS_SHARED.
- If we resurrect dying objects (non-marked, but not swept yet),
- pointing shared string can be collected.
- To avoid such issue, fstrings (recorded to fstring_table)
- should not be ELTS_SHARED (should not have a shared string).
+ * ext/openssl/ossl_x509attr.c: ditto.
-Thu Nov 28 01:35:08 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * ext/openssl/ossl_x509crl.c: ditto.
- * st.c (st_keys): fix to use st_index_t for size of hash.
+ * ext/openssl/ossl_x509ext.c: ditto.
-Thu Nov 28 00:36:52 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * ext/openssl/ossl_x509req.c: ditto.
- * st.c (st_keys): define st_keys(). it writes each key to buffer.
+ * ext/openssl/ossl_x509revoked.c: ditto.
- * hash.c (rb_hash_keys): use st_keys() for performance improvement
- if st_data_t and VALUE are compatible.
+Thu Aug 25 00:19:24 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * include/ruby/st.h: define macro ST_DATA_COMPATIBLE_P() to predicate
- whether st_data_t and passed type are compatible.
+ * lib/rubygems/specification.rb: `coding` is affect only first line except
+ shebang.
+ * lib/rubygems/package.rb, lib/rubygems/package/*: ditto.
- * configure.in: check existence of builtin function to use in
- ST_DATA_COMPATIBLE_P().
+Thu Aug 25 00:19:24 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Nov 28 00:07:28 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.
+ It supports to enable frozen string literal and add `--norc` option for
+ disable to `.gemrc` configuration.
+ See 2.5.2 release notes for other fixes and enhancements.
+ https://github.com/rubygems/rubygems/blob/a8aa3bac723f045c52471c7b9328310a048561e0/History.txt#L3
- * ruby_atomic.h: remove duplicate definitions between ATOMIC_XXX
- and ATOMIC_SIZE_XXX.
+Wed Aug 24 23:54:40 2016 Charles Oliver Nutter <headius@headius.com>
-Wed Nov 27 23:55:50 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * test/ruby/test_array.rb: split out the test for no stack error
+ on large input for test_permutation, test_repeated_permutation,
+ and test_repeated_combination, and make them all timeout:30.
- * ruby_atomic.h: define ATOMIC_SIZE_CAS() with
- __atomic_compare_exchange_n() and refactoring.
+Tue Aug 23 03:22:34 2016 Naohisa Goto <ngotogenome@gmail.com>
-Tue Nov 27 21:43:00 2013 Akira Matsuda <ronnie@dio.jp>
+ * test/fiddle/test_pointer.rb (test_to_str, test_to_s, test_aref_aset):
+ Attempt to use independent strings for destructive tests that
+ directly modify values on memory by using Fiddle::Pointer.
+ [Bug #12537] [ruby-dev:49700]
- * lib/irb/notifier.rb: [Doc] Fix typo
- * ext/json/lib/json/common.rb: Ditto.
+Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
-Tue Nov 27 18:04:57 2013 Akira Matsuda <ronnie@dio.jp>
+ * string.c (str_buf_cat): Fix capa size for embed string.
+ Fix bug in r55547. [Bug #12536]
- * lib/irb/notifier.rb: Fix typo
+Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
-Wed Nov 27 17:54:57 2013 Koichi Sasada <ko1@atdot.net>
+ * string.c (rb_str_change_terminator_length): New function to change
+ termlen and resize heap for the terminator. This is split from
+ rb_str_fill_terminator (str_fill_term) because filling terminator
+ and changing terminator length are different things. [Bug #12536]
- * gc.c (gc_mark_stacked_objects): check only when check_mode > 0.
+ * internal.h: declaration for rb_str_change_terminator_length.
-Wed Nov 27 16:07:19 2013 Aman Gupta <ruby@tmm1.net>
+ * string.c (str_fill_term): Simplify only to zero-fill the terminator.
+ For non-shared strings, it assumes that (capa + termlen) bytes of
+ heap is allocated. This partially reverts r55557.
- * test/ruby/test_gc.rb (class TestGc): Fix warning in
- test_expand_heap.
+ * encoding.c (rb_enc_associate_index): rb_str_change_terminator_length
+ is used, and it should be called whenever the termlen is changed.
-Wed Nov 27 15:55:52 2013 Aman Gupta <ruby@tmm1.net>
+ * string.c (str_capacity): New static function to return capacity
+ of a string with the given termlen, because the termlen may
+ sometimes be different from TERM_LEN(str) especially during
+ changing termlen or filling terminator with specific termlen.
- * gc.c (Init_GC): Add new GC::INTERNAL_CONSTANTS for information about
- GC heap/page/slot sizing.
- * test/ruby/test_gc.rb (class TestGc): test for above.
+ * string.c (rb_str_capacity): Use str_capacity.
-Wed Nov 27 15:21:17 2013 Aman Gupta <ruby@tmm1.net>
+Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
- * gc.c (gc_page_sweep): Fix compile warning from last commit.
- * hash.c (hash_aset_str): Re-use existing variable to avoid
- unnecessary pointer dereferencing.
+ * string.c: Partially reverts r55547 and r55555.
+ ChangeLog about the reverted changes are also deleted in this file.
+ [Bug #12536] [ruby-dev:49699] [ruby-dev:49702]
-Wed Nov 27 15:12:55 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
- * gc.c (gc_page_sweep): disable debug print.
+ * string.c (str_fill_term): When termlen increases, re-allocation
+ of memory for termlen should always be needed.
+ In this fix, if possible, decrease capa instead of realloc.
+ [Bug #12536] [ruby-dev:49699]
-Wed Nov 27 15:05:59 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
- * gc.c (gc_stat): add new information heap_eden_page_length and
- heap_tomb_page_length.
+ * string.c: Specify termlen as far as possible.
+ Additional fix for [Bug #12536] [ruby-dev:49699].
- * test/ruby/test_gc.rb: fix to use GC.stat[:heap_eden_page_length]
- instead of GC.stat[:heap_length].
- This test expects `heap_eden_page_length' (used pages size).
+ * string.c (str_new_static): Specify termlen from the given encoding
+ when creating a new String object is needed.
-Wed Nov 27 15:02:53 2013 Aman Gupta <ruby@tmm1.net>
+ * string.c (rb_tainted_str_new_with_enc): New function to create a
+ tainted String object with the given encoding. This means that
+ the termlen is correctly specified. Currently static function.
+ The function name might be renamed to rb_tainted_enc_str_new
+ or rb_enc_tainted_str_new.
- * test/ruby/test_eval.rb (class TestEval): Use assert_same instead of
- assert_equal.
- * test/ruby/test_hash.rb (class TestHash): ditto.
- * test/ruby/test_iseq.rb (class TestISeq): ditto.
+ * string.c (rb_external_str_new_with_enc): Use encoding by using the
+ above rb_tainted_str_new_with_enc().
-Wed Nov 27 14:50:02 2013 Eric Hodel <drbrain@segment7.net>
+Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
- * lib/rinda/ring.rb: Announce RingServer for the same process.
- [ruby-trunk - Bug #9163]
- * test/rinda/test_rinda.rb: Tests for the above.
+ * string.c (rb_str_subseq, str_substr): When RSTRING_EMBED_LEN_MAX
+ is used, TERM_LEN(str) should be considered with it because
+ embedded strings are also processed by TERM_FILL.
+ Additional fix for [Bug #12536] [ruby-dev:49699].
-Wed Nov 27 14:37:33 2013 Aman Gupta <ruby@tmm1.net>
+Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
- * test/ruby/test_eval.rb (class TestEval): Add test for shared eval
- filenames via rb_fstring().
- * test/ruby/test_iseq.rb (class TestISeq): Add test for shared
- iseq labels via rb_fstring(). [Bug #9159]
+ * string.c: Fix memory corruptions when using UTF-16/32 strings.
+ [Bug #12536] [ruby-dev:49699]
-Wed Nov 27 14:24:55 2013 Aman Gupta <ruby@tmm1.net>
+ * string.c (rb_str_new_with_class): Use TERM_LEN of the "obj".
- * hash.c (hash_aset_str): Use rb_fstring() to de-duplicate hash string
- keys. Patch by Eric Wong. [Bug #8998] [ruby-core:57727]
- * test/ruby/test_hash.rb (class TestHash): test for above.
+ * string.c (rb_str_plus, rb_str_justify): Use str_new0 which is aware
+ of termlen.
-Wed Nov 27 10:39:39 2013 Aman Gupta <ruby@tmm1.net>
+ * string.c (str_shared_replace): Copy +termlen bytes instead of +1.
- * gc.c: Rename rb_heap_t members:
- used -> page_length
- limit -> total_slots
+ * string.c (rb_str_times): termlen should not be included in capa.
-Wed Nov 27 08:24:49 2013 Aman Gupta <ruby@tmm1.net>
+ * string.c (RESIZE_CAPA_TERM): When using RSTRING_EMBED_LEN_MAX,
+ termlen should be counted with it because embedded strings are
+ also processed by TERM_FILL.
- * compile.c: Use rb_fstring() to de-duplicate string literals in code.
- [ruby-core:58599] [Bug #9159] [ruby-core:54405]
- * iseq.c (prepare_iseq_build): De-duplicate iseq labels and source
- locations.
- * re.c (rb_reg_initialize): Use rb_fstring() for regex string.
- * string.c (rb_fstring): Handle non-string and already-fstr arguments.
- * vm_eval.c (eval_string_with_cref): De-duplicate eval source
- filename.
+ * string.c (rb_str_capacity, str_shared_replace, str_buf_cat): ditto.
-Wed Nov 27 07:13:54 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * string.c (rb_str_drop_bytes, rb_str_setbyte, str_byte_substr): ditto.
- * ext/psych/lib/psych.rb: psych version 2.0.2
- * ext/psych/psych.gemspec: ditto
+Thu Aug 18 23:43:33 2016 Eric Wong <e@80x24.org>
-Wed Nov 27 06:40:18 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/openssl/ossl_ssl.c (ossl_ssl_write_internal):
+ avoid undefined behavior
+ * test/openssl/test_pair.rb (test_write_zero): new test
+ [ruby-core:76751] [Bug #12660]
- * ext/psych/lib/psych/scalar_scanner.rb: fix support for negative
- years.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
- * test/psych/test_date_time.rb: test for change.
- Fixes: https://github.com/tenderlove/psych/issues/168
+Thu Aug 18 23:18:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 27 04:46:55 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/socket/option.c, ext/socket/rubysocket.h (inet_ntop): share
+ the fallback definition. [ruby-core:76646] [Bug #12645]
- * ext/psych/lib/psych/scalar_scanner.rb: fix regexp for matching TIME
- strings.
- * test/psych/test_date_time.rb: test for change.
- Fixes: https://github.com/tenderlove/psych/issues/171
+Thu Aug 18 23:07:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 27 02:26:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (vm_set_main_stack): remove unnecessary check. toplevel
+ binding must be initialized. [Bug #12611] (N1)
- * string.c (str_new4): copy the original capacity so that memsize of
- frozen shared string returns correct size.
+ * win32/win32.c (w32_symlink): fix return type. [Bug #12611] (N3)
-Wed Nov 27 02:20:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_split_m): simplify the condition.
+ [Bug #12611](N4)
- * array.c (rb_ary_hash): should not ignore the rest of recursive
- constructs.
+Thu Aug 18 23:06:20 2016 Kouhei Sutou <kou@cozmixng.org>
- * hash.c (rb_hash_hash): ditto.
+ * lib/rexml/attribute.rb (REXML::Attribute#to_string): Fix wrong
+ entry reference name of double quote.
+ [Bug #12609][ruby-core:76509]
+ Patch by Joseph Marrero. Thanks!!!
- * range.c (range_hash): ditto.
+Thu Aug 18 23:04:59 2016 Naohisa Goto <ngotogenome@gmail.com>
- * struct.c (rb_struct_hash): ditto.
+ * thread.c (rb_wait_for_single_fd): Clean up fds.revents every time
+ before calling ppoll(2). [Bug #12575] [ruby-dev:49725]
- * test/-ext-/test_recursion.rb (TestRecursion): separate from
- test/ruby/test_thread.rb.
+Thu Aug 18 22:52:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Nov 26 22:43:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_args.c (setup_parameters_complex): don't raise ArgumentError
+ if an array is given for instance_exec with optional argument.
+ [ruby-core:76300] [Bug #12568]
+ https://github.com/rails/rails/pull/25699
- * hash.c (rb_hash): cut off if recursion detected to get rid of stack
- overflow. [ruby-core:58567] [Bug #9151]
+Tue Aug 16 12:27:48 2016 Koichi Sasada <ko1@atdot.net>
-Tue Nov 26 20:02:39 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (gc_mark_roots): should mark the VM object itself to mark
+ singleton class of the VM object.
+ Before this patch, we only set mark bit for the VM object and
+ invoke mark function separately.
+ [Bug #12583]
- * test/ruby/test_settracefunc.rb: add tests for a_call/a_return
- by Brandur <brandur@mutelight.org> [Feature #9120]
+ * test/ruby/test_gc.rb: add a test.
-Tue Nov 26 19:29:52 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 16 12:01:35 2016 Naohisa Goto <ngotogenome@gmail.com>
- * common.mk: add useful config "set breakpoint pending on"
- for run.gdb.
+ * ext/digest/md5/md5ossl.h: Remove excess semicolons.
+ Suppress warning on Solaris with Oracle Solaris Studio 12.
+ [ruby-dev:49692] [Bug #12524]
-Tue Nov 26 19:17:47 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/digest/md5/md5cc.h: ditto.
+ * ext/digest/sha1/sha1cc.h: ditto.
+ * ext/digest/sha1/sha1ossl.h: ditto.
+ * ext/digest/sha2/sha2cc.h: ditto.
+ * ext/digest/sha2/sha2ossl.h: ditto.
- * ext/objspace/object_tracing.c (newobj_i): skip class_path if class
- is frozen.
+Tue Aug 16 11:51:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- rb_class_path() can modify frozen classes (and causes errors).
- This patch is temporary. We need no-modification/no-allocation
- class path function.
+ * compile.c (ADD_TRACE): ignore trace instruction on non-positive
+ line.
-Tue Nov 26 18:12:13 2013 Koichi Sasada <ko1@atdot.net>
+ * parse.y (coverage): get rid of ArgumentError when the starting
+ line number is not positive. [ruby-core:76141] [Bug #12517]
- * vm_trace.c: skip "exception check" and "reentrant check (only normal
- events) for internal events.
+Tue Aug 16 11:51:52 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- Reentrant check for internal events are remaining.
+ * test/coverage/test_coverage.rb: ignored test when enabled to coverage.
+ It lead to crash with `make test-all`.
-Tue Nov 26 17:38:16 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 16 11:46:07 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_trace.c: prohibit to specify normal events and internal events
- simultaneously.
- I will introduce special care for internal events later.
+ * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque
+ only if the URI has path-rootless, not path-empty.
+ [ruby-core:76055] [Bug #12498]
+ patched by Chris Heisterkamp <cheister@squareup.com>
- * ext/-test-/tracepoint/tracepoint.c: test this behavior.
+Tue Aug 16 04:57:28 2016 Shugo Maeda <shugo@ruby-lang.org>
- * test/-ext-/tracepoint/test_tracepoint.rb: ditto.
+ * lib/net/http/generic_request.rb (write_header): A Request-Line must
+ not contain CR or LF.
-Tue Nov 26 16:30:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 16 04:54:12 2016 Shugo Maeda <shugo@ruby-lang.org>
- * file.c (rb_readlink): fix buffer overflow on a long symlink. since
- rb_str_modify_expand() expands from its length but not its capacity,
- need to set the length properly for each expansion.
- [ruby-core:58592] [Bug #9157]
+ * lib/net/ftp.rb (putline): raise an ArgumentError when
+ CR or LF is included in a line.
-Tue Nov 26 14:23:17 2013 Aman Gupta <ruby@tmm1.net>
+Tue Aug 16 04:38:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/objspace_dump.c (dump_append_string_value): Escape
- control characters for strict json parsers.
- * ext/objspace/objspace_dump.c (objspace_dump): Document File/IO
- output option.
+ * ext/date/date_strftime.c (date_strftime_with_tmx): reject too
+ large precision to get rid of buffer overflow.
+ reported by Guido Vranken <guido AT guidovranken.nl>.
-Tue Nov 26 11:43:19 2013 Masaki Matsushita <glass.saga@gmail.com>
+Tue Aug 16 04:28:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby_atomic.h: use __atomic builtin functions supported by GCC.
- __sync family are legacy functions now and it is recommended
- that new code use the __atomic functions.
- http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
+ * file.c (append_fspath): normalize directory name to be appended
+ on OS X. [ruby-core:75957] [Ruby trunk Bug#12483]
+ https://github.com/rails/rails/issues/25303#issuecomment-224834804
- * configure.in: check existence of __atomic functions.
+Tue Aug 16 04:16:14 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Nov 26 10:57:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * regcomp.c (noname_disable_map): don't optimize out group 0
+ Ruby's Regexp doesn't allow normal numbered groups if the regexp
+ has named groups. On such case it optimizes out related NT_ENCLOSE.
+ But even on the case it can use \g<0>.
+ This fix not to remove NT_ENCLOSE whose regnum is 0.
+ [ruby-core:75828] [Bug #12454]
- * ext/bigdecimal/bigdecimal.gemspec: revert Gem::Specification#date
- for snapshot/release tarballs.
+Tue Aug 16 04:06:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 26 06:42:50 2013 Aman Gupta <ruby@tmm1.net>
+ * missing/crypt.c: fix size macros to use configured values
+ for platforms long is larger than 32bit.
+ [ruby-core:75792] [Bug #12446]
- * NEWS: Add ObjectSpace.after_gc_{start,end}_hook=
- * ext/objspace/objspace_dump.c: [DOC] catch up dump/dump_all to r43679
+Tue Aug 16 04:03:25 2016 Kazuki Yamaguchi <k@rhe.jp>
-Tue Nov 26 04:12:10 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/openssl/ossl_bn.c (try_convert_to_bnptr): Extracted from
+ GetBNPtr(). This doesn't raise exception but returns NULL on error.
+ (GetBNPtr): Raise TypeError if conversion fails.
+ (ossl_bn_eq): Implement BN#==.
+ (ossl_bn_eql): #eql? should not raise TypeError even if the argument
+ is not compatible with BN.
+ (ossl_bn_hash): Implement BN#hash.
- * lib/rubygems: Update to RubyGems master 612f85a. Notable changes:
+ * ext/openssl/ossl_bn.c (Init_ossl_bn): Define #== and #hash.
- Fixed installation and activation of git: and path: gems via
- Gem.use_gemdeps
+ * test/openssl/test_bn.rb: Test BN#eql?, #== and #hash
- Improved documentation coverage
+Tue Aug 16 03:51:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rubygems: ditto.
+ * transcode.c (str_transcode0): scrub in the given encoding when
+ the source encoding is given, not in the encoding of the
+ receiver. [ruby-core:75732] [Bug #12431]
-Mon Nov 25 22:23:03 2013 Zachary Scott <e@zzak.io>
+Tue Aug 16 03:41:21 2016 Kazuki Yamaguchi <k@rhe.jp>
- * lib/xmlrpc.rb: [DOC] Fix link to xmlrpc4r site [Bug #9148]
- Patch by Giorgos Tsiftsis
+ * ext/openssl/ossl_pkey_dh.c (ossl_dh_compute_key): Check that the DH
+ has 'p' (the prime) before calling DH_size(). We can create a DH with
+ no parameter but DH_size() does not check and dereferences NULL.
+ [ruby-core:75720] [Bug #12428]
-Mon Nov 25 19:48:10 2013 Zachary Scott <e@zzak.io>
+ * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_sign): Ditto. DSA_size() does
+ not check dsa->q.
- * lib/uri/common.rb: [DOC] typo fixes by @vipulnsward [Fixes GH-456]
- https://github.com/ruby/ruby/pull/456
- * lib/uri/generic.rb: [DOC] ditto.
+ * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,
+ ossl_rsa_public_decrypt, ossl_rsa_private_encrypt,
+ ossl_rsa_private_decrypt): Ditto. RSA_size() does not check rsa->n.
-Mon Nov 25 14:34:42 2013 Zachary Scott <e@zzak.io>
+Tue Aug 16 03:10:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.gemspec: bump BigDecimal to 1.2.3 for
- proper release date in RubyGems
+ * transcode.c (enc_arg, str_transcode_enc_args, econv_args):
+ remove volatile, and add GC guards in callers.
+ [ruby-core:75664] [Bug #12411]
-Mon Nov 25 14:25:08 2013 Zachary Scott <e@zzak.io>
+Tue Aug 16 02:45:52 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.gemspec: Remove Gem::Specification#date
- We should rely on rubygems to create the date the gem was released
- for each version.
+ * ext/psych/*, test/psych/*: Update psych 2.1.0
+ This version fixed [Bug #11988][ruby-core:72850]
-Mon Nov 25 06:53:30 2013 Koichi Sasada <ko1@atdot.net>
+Fri Aug 12 04:15:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: do not use ruby_sized_xrealloc() and ruby_sized_xfree()
- if HAVE_MALLOC_USABLE_SIZE (or _WIN32) is defined.
+ * common.mk (build-ext), ext/extmk.rb: use variable EXTENCS
+ different than ENCOBJS, to get rid of circular dependency.
+ build libencs when linking encodings statically.
+ [ruby-core:75618] [Bug #12401]
- We don't need these function if malloc_usable_size() is available.
+Fri Aug 12 04:04:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: catch up this change.
+ * process.c (rb_execarg_commandline): build command line string
+ from argument vector in rb_execarg.
+ [ruby-core:75611] [Bug #12398]
- * gc.c: define HAVE_MALLOC_USABLE_SIZE on _WIN32.
+Fri Aug 12 03:30:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (ary_resize_capa): do not use ruby_sized_xfree() with
- local variable to avoid "unused local variable" warning.
- This change only has few impact.
+ * variable.c (rb_local_constants_i): exclude private constants
+ when excluding inherited constants too. [Bug #12345]
- * string.c (rb_str_resize): ditto.
+Fri Aug 12 03:00:05 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Mon Nov 25 05:05:04 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/drb/timeridconv.rb: don't use keeper thread. [Bug #12342]
- * test/-ext-/tracepoint/test_tracepoint.rb: catch up GC.stat changes
- at r43835.
+ * test/drb/ut_timerholder.rb: ditto.
-Mon Nov 25 04:45:59 2013 Koichi Sasada <ko1@atdot.net>
+Fri Aug 12 02:46:37 2016 Kazuki Yamaguchi <k@rhe.jp>
- * gc.c: continue to change OLDSPACE -> OLDMALLOC.
- RGENGC_ESTIMATE_OLDSPACE -> RGENGC_ESTIMATE_OLDMALLOC.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_stop): Don't free the SSL struct
+ here. Since some methods such as SSLSocket#connect releases GVL,
+ there is a chance of use after free if we free the SSL from another
+ thread. SSLSocket#stop was documented as "prepares it for another
+ connection" so this is a slightly incompatible change. However when
+ this sentence was added (r30090, Add toplevel documentation for
+ OpenSSL, 2010-12-06), it didn't actually. The current behavior is
+ from r40304 (Correct shutdown behavior w.r.t GC., 2013-04-15).
+ [ruby-core:74978] [Bug #12292]
- * gc.c: add a new major GC reason GPR_FLAG_MAJOR_BY_OLDMALLOC.
+ * ext/openssl/lib/openssl/ssl.rb (sysclose): Update doc.
-Mon Nov 25 04:16:09 2013 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_ssl.rb: Test this.
- * gc.c: change terminology "..._num" to "..._slots" about slot operation.
- * final_num -> final_slots
- * objspace_live_num() -> objspace_live_slots()
- * objspace_limit_num() -> objspace_limit_slots()
- * objspace_free_num() -> objspace_free_slots()
+Thu Aug 11 01:30:29 2016 Marcus Stollsteimer <sto.mar@web.de>
-Mon Nov 25 04:03:12 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/json/lib/*.rb: Removed some comments. Because these are unnecessary
+ class description. [ci skip][Bug #12255][ruby-core:74835]
- * gc.c (gc_stat): add internal information.
- * heap_swept_slot
- * malloc_increase
- * malloc_limit
- * remembered_shady_object
- * remembered_shady_object_limit
- * old_object
- * old_object_limit
- * oldmalloc_increase
- * oldmalloc_limit
+Thu Aug 11 01:09:43 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c (gc_stat): rename names.
- * heap_live_num -> heap_live_slot
- * heap_free_num -> heap_free_slot
- * heap_final_slot -> heap_final_slot
+ * pack.c (pack_pack): use union instead of bare variable to ease
+ optimizations and avoid assigning x87 floating point number.
+ [ruby-core:74496] [Bug #12209]
- Quote from RDoc of GC.stat():
- "The contents of the hash are implementation specific and may
- be changed in the future."
+ * pack.c (pack_unpack): ditto.
- * test/ruby/test_gc.rb: catch up this change.
+Tue Aug 2 01:34:12 2016 Eric Wong <e@80x24.org>
-Mon Nov 25 03:59:45 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/webrick/httpservlet/cgihandler.rb (do_GET): delete HTTP_PROXY
+ * test/webrick/test_cgi.rb (test_cgi_env): new test
+ * test/webrick/webrick.cgi (do_GET): new endpoint to dump env
+ [ruby-core:76511] [Bug #12610]
- * test/ruby/test_gc.rb: catch up last commit.
- Now RUBY_GC_OLDSPACE_LIMIT(...) is RUBY_GC_OLDMALLOC_LIMIT(...).
+Tue Aug 2 01:33:11 2016 Shugo Maeda <shugo@ruby-lang.org>
-Mon Nov 25 03:10:46 2013 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_refinement.rb: skip
+ test_prepend_after_refine_wb_miss on ARM or MIPS.
+ [ruby-core:76031] [Bug #12491]
- * gc.c: change terminology OLDSPACE -> OLDMALLOC.
- (oldspace -> oldmalloc for variable names)
+Sat Jul 30 12:23:29 2016 Shugo Maeda <shugo@ruby-lang.org>
- OLDSPACE is confusing because it is not includes slots.
- To more clearly, rename such as (oldspace_limit -> oldmalloc_limit).
- It is clear that it measures (estimates) malloc()'ed size.
+ * vm_args.c (vm_caller_setup_arg_block): disable symbol block
+ argument optimization when tail call optimization is enabled,
+ in order to avoid SEGV. [ruby-core:76288] [Bug #12565]
-Mon Nov 25 00:50:03 2013 Masaki Matsushita <glass.saga@gmail.com>
+Sat Jul 30 12:10:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: use __builtin_bswap16() if possible.
+ * proc.c (passed_block): convert passed block symbol to proc.
+ based on the patch by Daisuke Sato in [ruby-dev:49695].
+ [Bug #12531]
- * configure.in: check existence of __builtin_bswap16().
+Sat Jul 30 10:58:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 24 22:24:19 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_throw_start): check if the iseq is symbol
+ proc, class definition should not be a symbol proc.
+ [ruby-core:75856] [Bug #12462]
- * bignum.c (bigxor_int): Apply BIGLO for long in a BDIGIT expression.
- (bigor_int): Ditto.
- (bigand_int): Ditto.
+Mon Jul 11 22:35:00 2016 Kenta Murata <mrkn@mrkn.jp>
-Sun Nov 24 18:13:23 2013 Tanaka Akira <akr@fsij.org>
+ * bignum.c (rb_big_hash): make it public function to be available in
+ other source files, and remove documentation comment for Bignum#hash.
- * include/ruby/defines.h (SIZEOF_ACTUAL_BDIGIT): Defined.
+ * bignum.c (Bignum#hash): remove its definition because it is unified
+ with Object#hash.
- * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Use
- SIZEOF_ACTUAL_BDIGIT instead of SIZEOF_BDIGITS.
- SIZEOF_BDIGITS can be different to sizeof(BDIGIT).
+ * include/ruby/intern.h (rb_big_hash): add a prototype declaration.
-Sun Nov 24 13:49:08 2013 Tanaka Akira <akr@fsij.org>
+ * hash.c (any_hash): treat Bignum values directly.
- * include/ruby/defines.h: Don't use int128_t for Bignum.
- It's not always faster.
+Sat Jul 2 04:00:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c: Ditto.
+ * string.c (tr_trans): consider terminator length and fix heap
+ overflow. reported by Guido Vranken <guido AT guidovranken.nl>.
-Sun Nov 24 10:18:15 2013 Aman Gupta <ruby@tmm1.net>
+Sat Jul 2 03:33:28 2016 Shugo Maeda <shugo@ruby-lang.org>
- * NEWS: Add details about new debugging features and APIs.
+ * vm.c (invoke_bmethod, invoke_block_from_c_0): revert r52104
+ partially to avoid "self has wrong type to call super in this
+ context" errors.
+ [ruby-core:72724] [Bug #11954]
-Sun Nov 24 09:37:20 2013 Andrew Vit <andrew@avit.ca>
+Mon Jun 20 02:38:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/csv.rb: Optimize header hashes by freezing string keys.
- [ruby-core:58510]
+ * lib/optparse.rb (OptionParser::Completion.candidate): get rid of
+ nil as key names. [ruby-core:75773] [Bug #12438]
-Sun Nov 24 09:18:06 2013 Aman Gupta <ruby@tmm1.net>
+ * lib/optparse.rb (OptionParser#make_switch): char class option
+ cannot be NoArgument, default to RequiredArgument.
- * ext/objspace/objspace_dump.c (dump_object): Use PRIuSIZE to print
- size_t for better win32 compatibility.
- * test/objspace/test_objspace.rb (test_dump_all): Hold reference to
- test string to avoid failure due to GC. Reduce size of failure message
- using grep(/TEST STRING/).
+Mon Jun 20 02:25:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Nov 24 08:38:00 2013 Kyle Stevens <kstevens715@gmail.com>
+ * re.c (unescape_nonascii): scan hex up to only 3 characters.
+ [Bug #12420] [Bug #12423]
- * lib/csv.rb: If skip_lines is set to a String, convert it to a Regexp
- to prevent the alternative, which is that each line in the CSV gets
- converted to a Regexp when calling skip_lines#match.
+Mon Jun 20 02:25:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Nov 24 01:03:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * regparse.c (fetch_token_in_cc): raise error if given octal escaped
+ character is too big. [Bug #12420] [Bug #12423]
- * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead
- of FIX2INT to avoid conversion error.
+Sun Jun 19 04:29:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 24 00:44:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/missing.h (isfinite): move from numeric.c.
- * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros
- defined in defines.h, instead of complex and repeated expression.
+Sun Jun 19 04:29:13 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Nov 23 22:22:26 2013 Tanaka Akira <akr@fsij.org>
+ * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning on
+ cygwin. [Bug #12417][ruby-core:75691]
- * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Limit the value to
- less than 8.
+Sun Jun 19 04:29:13 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Nov 23 19:52:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * ext/bigdecimal/bigdecimal.c (isfinite): isfinite does not always
+ exist. fixed build error on Windows introduced at r55123.
- * ext/bigdecimal/lib/bigdecimal/math.rb (BigMath.E): Use BigMath.exp.
- [Feature #6857] [ruby-core:47130]
+Sun Jun 19 04:29:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 23 19:46:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider
+ non-finite float values not to raise FloatDomainError.
+ [ruby-core:75682] [Bug #12414]
- * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Optimize the
- calculation algorithm to reduce the number of divisions.
- This optimization was proposed by Rafal Michalski.
- [Feature #6857] [ruby-core:47130]
+Thu Jun 16 00:42:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 23 19:20:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * string.c (rb_str_modify_expand): check integer overflow.
+ [ruby-core:75592] [Bug #12390]
- * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): The signature was
- changed to allow us to pass arguments directly.
+Thu Jun 16 00:29:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_div3): Added for the role of
- the old BigDecimal_div2.
+ * vm_insnhelper.c (vm_get_ev_const): warn deprecated constant even
+ in the class context. [ruby-core:75505] [Bug #12382]
-Sat Nov 23 12:31:00 2013 Koichi Sasada <ko1@atdot.net>
+Tue Jun 14 03:49:28 2016 Eric Wong <e@80x24.org>
- * gc.c: fix global variable name.
- Now we have following environments (and related variable names).
+ * dir.c (dir_close): update RDoc for 2.3 #close change
+ [ruby-core:75679] [Bug #12413]
- * RUBY_GC_HEAP_INIT_SLOTS
- * RUBY_GC_HEAP_FREE_SLOTS
- * RUBY_GC_HEAP_GROWTH_FACTOR (new from 2.1)
- * RUBY_GC_HEAP_GROWTH_MAX_SLOTS (new from 2.1)
+Tue Jun 14 03:47:29 2016 Eric Wong <e@80x24.org>
- * obsolete
- * RUBY_FREE_MIN -> RUBY_GC_HEAP_FREE_SLOTS (from 2.1)
- * RUBY_HEAP_MIN_SLOTS -> RUBY_GC_HEAP_INIT_SLOTS (from 2.1)
+ * proc.c: fix RDoc of Proc#===/call/yield/[]
+ [Bug #12332]
- * RUBY_GC_MALLOC_LIMIT
- * RUBY_GC_MALLOC_LIMIT_MAX (new from 2.1)
- * RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR (new from 2.1)
+Tue Jun 14 03:34:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * RUBY_GC_OLDSPACE_LIMIT (new from 2.1)
- * RUBY_GC_OLDSPACE_LIMIT_MAX (new from 2.1)
- * RUBY_GC_OLDSPACE_LIMIT_GROWTH_FACTOR (new from 2.1)
+ * variable.c (rb_local_constants_i): exclude hidden constants.
+ [ruby-core:75575] [Bug #12389]
- * test/ruby/test_gc.rb: catch up this change.
+Tue Jun 14 03:25:14 2016 Benoit Daloze <eregontp@gmail.com>
-Sat Nov 23 09:45:49 2013 Aman Gupta <ruby@tmm1.net>
+ * insns.def (defineclass): Also raise an error when redeclaring the
+ superclass of a class as Object and it has another superclass.
+ [Bug #12367] [ruby-core:75446]
- * marshal.c (w_object): Use HASH_PROC_DEFAULT directly from internal.h
+ * test/ruby/test_class.rb: test for above.
-Sat Nov 23 08:43:23 2013 Aman Gupta <ruby@tmm1.net>
+Tue Jun 14 03:15:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: Rename heap_pages_swept_num to heap_pages_swept_slots to
- clarify meaning (number of slots, not pages).
+ * process.c (rb_exec_getargs): honor the expected argument types
+ over the conversion method. the basic language functionality
+ should be robust. [ruby-core:75388] [Bug #12355]
-Sat Nov 23 08:23:23 2013 Aman Gupta <ruby@tmm1.net>
+Tue Jun 14 03:02:38 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/set.rb (class SortedSet): Fix source_location for methods
- defined via eval.
+ * win32/win32.c, include/ruby/win32.h (rb_w32_utruncate): implements new
+ truncate alternative which accepts UTF-8 path.
-Sat Nov 23 03:44:03 2013 Eric Hodel <drbrain@segment7.net>
+ * file.c (truncate): use above function.
+ [Bug #12340]
- * lib/rubygems: Update to RubyGems master dcce4ff. Important changes
- in this commit:
+Tue Jun 14 02:58:41 2016 Marcus Stollsteimer <sto.mar@web.de>
- Remove automatic detection of gem dependencies files. This prevents a
- security hole as described in [ruby-core:58490]
+ * ext/date/date_core.c (Init_date_core): [DOC] Convert DateTime
+ documentation to RDoc from Markdown.
+ [ruby-core:75136] [Bug #12311]
- Fixed bugs for installing git gems.
+Sun Jun 12 02:36:52 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * test/rubygems: ditto.
+ * regcomp.c (compile_length_tree): return error code immediately
+ if compile_length_tree raised error [Bug #12418]
-Fri Nov 22 22:30:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Sun Jun 12 02:27:07 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_power):
- Round the result value only if the precision is given.
+ * thread.c (recursive_list_access): a object id may be a Bignum. so,
+ the list must be a objhash, instead of a identhash.
+ this fixes many test errors on mswin64 CI.
-Fri Nov 22 17:20:50 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Jun 12 01:59:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * transcode.c (str_transcode0): don't scrub invalid chars if
- str.encode doesn't have explicit invalid: :replace.
- workaround fix for see #8995
+ * parse.y (new_if_gen): set newline flag to NODE_IF to trace all
+ if/elsif statements. [ruby-core:67720] [Bug #10763]
-Fri Nov 22 17:11:26 2013 Narihiro Nakamura <authornari@gmail.com>
+Sun May 15 02:33:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/intern.h, internal.h: Expose rb_gc_count().
+ * lib/mkmf.rb (pkg_config): use xsystem consistently to set up
+ library path environment variable as well as latter pkg-config
+ calls. [ruby-dev:49619] [Bug #12379]
-Fri Nov 22 17:07:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Fri May 6 02:30:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.gemspec: version 1.2.2.
+ * lib/optparse.rb: [DOC] fix example code. base on the code by
+ Semyon Gaivoronskiy in [ruby-core:75224]. [Bug #12323]
-Fri Nov 22 17:04:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Fri May 6 02:28:31 2016 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_data_type):
- Use RUBY_TYPED_FREE_IMMEDIATELY only if it is available.
+ * ext/win32ole/win32ole.c (ole_vstr2wc, ole_variant2val): fix blank
+ string conversion.
+ [Bug #11880]
+ Thanks Akio Tajima for the patch!
-Fri Nov 22 16:49:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Fri May 6 02:24:13 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Round the result value.
- [Bug #8818] [ruby-core:56802]
+ * bignum.c: [DOC] Update result of 123456789 ** -2.
+ [ruby-dev:49606] [Bug #12339]
- * test/bigdecimal/test_bigdecimal.rb: Add a test for the above fix.
+Wed May 4 02:38:08 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-Fri Nov 22 16:25:43 2013 Koichi Sasada <ko1@atdot.net>
+ * internal.h (RCOMPLEX_SET_IMAG): undef RCOMPLEX_SET_IMAG
+ instead of duplicated undef RCOMPLEX_SET_REAL.
- * gc.c (heap_set_increment): accept minimum additional page number.
+Wed May 4 02:38:08 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
- * gc.c (gc_after_sweep): allocate pages to allocate at least
- RUBY_HEAP_MIN_SLOTS.
- [Bug #9137]
+ * complex.c (rb_complex_set_imag): Fix to properly set imag
+ of complex.
-Fri Nov 22 16:19:52 2013 Narihiro Nakamura <authornari@gmail.com>
+Tue Apr 26 23:34:45 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * include/ruby/intern.h (rb_gc_set_params): Deprecate
- rb_gc_set_params because it's only used in ruby internal.
+ * version.h: Bump versionto 2.3.2.
- * internal.h (ruby_gc_set_params): Declare rb_gc_set_params's
- alias function.
+Tue Apr 26 02:58:51 2016 Marcus Stollsteimer <sto.mar@web.de>
- * gc.c: ditto.
+ * doc/extension.rdoc: Improvements to english grammers.
+ [Bug #12246][ruby-core:74792][ci skip]
- * ruby.c: use ruby_gc_set_params.
+Tue Apr 26 02:58:51 2016 craft4coder <yooobuntu@163.com>
-Fri Nov 22 14:55:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * doc/extension.rdoc: [DOC] `nul` should be uppercase.
+ change 'nul' => 'NUL'. [Fix GH-1172]
- * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Insert rb_thread_check_ints.
+Tue Apr 26 02:54:57 2016 Marcus Stollsteimer <sto.mar@web.de>
-Fri Nov 22 14:35:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * encoding.c: Fix return value of `Encoding::ISO8859_1.name`
+ [Bug #12313][ruby-core:75147][ci skip]
+ * ext/bigdecimal/bigdecimal.c: Fix code sample of `BigDecimal.new`
- * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix the inserting points
- of RB_GC_GUARDs.
+Mon Apr 25 02:29:07 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Fri Nov 22 14:31:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * configure.in: add missing -lm for AIX.
- * ext/bigdecimal/bigdecimal.c: Fix indentation.
+Mon Apr 25 02:29:07 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Fri Nov 22 14:03:00 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in: don't use the system-provided round(3) on AIX.
+ In AIX, round(0.49999999999999994) returns 1.0.
+ Use round() in numeric.c instead.
- * ext/nkf: merge nkf 2.1.3 2a2f2c5.
+Sun Apr 24 03:05:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 22 12:43:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ruby.c: cygwin does not use w32_cmdvector, command line can be
+ other than UTF-8. [ruby-dev:49519] [Bug #12184]
- * util.c (ruby_strtod): ignore too long fraction part, which does not
- affect the result.
+Sat Apr 23 01:01:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 22 12:17:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval_jump.c (exec_end_procs_chain): restore previous error info
+ for each end procs. [ruby-core:75038] [Bug #12302]
- * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#initialize):
- initialize of a module should pass arguments to super.
+Sat Apr 23 00:51:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 22 12:02:58 2013 Tanaka Akira <akr@fsij.org>
+ * compile.c (new_label_body): initialize bit fields, since
+ compile_data_alloc does not clear the memory. [Bug #12082]
- * test/ruby/test_settracefunc.rb: Ignore events from other threads.
+Sat Apr 23 00:51:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 22 10:35:57 2013 Koichi Sasada <ko1@atdot.net>
+ * compile.c (iseq_optimize): disable tail call optimization in
+ rescued, rescue, and ensure blocks.
+ [ruby-core:73871] [Bug #12082]
- * vm.c (ruby_vm_destruct): do not use ruby_xfree() after freeing
- objspace.
+Sat Apr 23 00:33:04 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c (ruby_mimfree): added. It is similar to ruby_mimmalloc().
+ * ext/nkf/nkf-utf8/nkf.c (mime_putc): fix typo.
+ [Bug #12202] [ruby-core:74802]
- * internal.h: ditto.
+Sat Apr 23 00:33:04 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 22 09:42:35 2013 Zachary Scott <e@zzak.io>
+ * ext/nkf/nkf-utf8/nkf.c: Merge upstream 4f3edf80a0.
+ patched by Anton Sivakov [Bug #12201] [Bug #12202]
- * test/digest/test_digest.rb: Reverse order of assert_equal
- Reported by @splattael
+Sat Apr 23 00:29:15 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 22 09:03:16 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/securerandom.rb (gen_random): to avoid blocking on Windows.
+ On Windows OpenSSL RAND_bytes (underlying implementation is
+ RAND_poll in crypto/rand/rand_win.c) may be blocked at
+ NetStatisticsGet.
+ https://wiki.openssl.org/index.php/Random_Numbers#Windows_Issues
+ Instead of this, use Random.raw_seed directly (whose implementation
+ CryptGenRandom is one of the source of
+ entropy of RAND_poll on Windows).
+ https://wiki.openssl.org/index.php/Random_Numbers
+ Note: CryptGenRandom function is PRNG and doesn't check its entropy,
+ so it won't block. [Bug #12139]
+ https://msdn.microsoft.com/ja-jp/library/windows/desktop/aa379942.aspx
+ https://tools.ietf.org/html/rfc4086#section-7.1.3
+ https://eprint.iacr.org/2007/419.pdf
+ http://www.cs.huji.ac.il/~dolev/pubs/thesis/msc-thesis-leo.pdf
- * gc.c: fix build failure on FreeBSD introduced by r43763.
- malloc_usable_size() is defined by malloc_np.h on FreeBSD.
+Sat Apr 23 00:25:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: check malloc.h and malloc_np.h.
+ * miniinit.c (Init_enc): add some common aliases of built-in
+ encodings. [ruby-core:72481] [Bug #11872]
-Fri Nov 22 08:27:13 2013 Eric Hodel <drbrain@segment7.net>
+Sat Apr 23 00:13:50 2016 sorah (Shota Fukumori) <her@sorah.jp>
- * lib/rubygems: Update to RubyGems master 50a8210. Important changes
- in this commit:
+ * lib/forwardable.rb: Convert given accessors to String.
- RubyGems now automatically checks for gem.deps.rb or Gemfile when
- running ruby executables. This behavior is similar to `bundle exec
- rake`. This change may be reverted before Ruby 2.1.0 if too many bugs
- are found.
+ r53381 changed to accept only Symbol or String for accessors, but
+ there are several rubygems that pass classes (e.g. Array,
+ Hash, ...) as accessors. Prior r53381, it was accepted because Class#to_s
+ returns its class name. After r53381 given accessors are checked
+ with define_method, but it accepts only Symbol or String, otherwise
+ raises TypeError.
- * test/rubygems: ditto.
+ def_delegator Foo, :some_method
-Thu Nov 21 22:33:59 2013 Koichi Sasada <ko1@atdot.net>
+ This change is to revert unexpected incompatibility. But this behavior
+ may change in the future.
- * gc.c: RGENGC_CHECK_MODE should be 0.
+Sat Apr 23 00:02:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 21:40:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * configure.in: check if succeeded in creating config.h.
- * ext/bigdecimal/bigdecimal.c (VpAlloc): Fix the expr to adjust the size
- of the digit array.
+ * tool/ifchange: ignore failures when TEST_COLORS unmatched. just
+ use the default value if expected name is not contained in it.
+ [ruby-core:75046] [Bug #12303]
-Thu Nov 21 21:36:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Fri Apr 22 23:47:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix the precision of
- the result BigDecimal of sqrt.
- [Bug #5266] [ruby-dev:44450]
+ * doc/regexp.rdoc (comments): [DOC] terminators cannot appear in
+ comments. [ruby-core:74838] [Bug #12256]
- * test/bigdecimal/test_bigdecimal.rb: add tests for the above changes.
+Fri Apr 22 23:44:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 18:49:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * extension.rdoc, extension.ja.rdoc: [DOC] Fix some errors.
+ Renamed files, wrong method names or argument types; the example
+ GetDBM macro is now updated to the current version of the actual
+ code. patch by Marcus Stollsteimer in [ruby-core:74690].
+ [Bug #12228]
- * gc.c (vm_xrealloc, vm_xfree): use malloc_usable_size() to obtain old
- size if available.
+Fri Apr 22 23:32:19 2016 Tanaka Akira <akr@fsij.org>
-Thu Nov 21 18:47:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_time_tz.rb: Tests depends on Europe/Moscow removed
+ to avoid test failures due to the tzdata change.
+ https://github.com/eggert/tz/commit/8ee11a301cf173afb0c76e0315b9f9ec8ebb9d95
+ Found by naruse.
- * lib/delegate.rb (SimpleDelegator#__getobj__): target object must be set.
+Tue Apr 19 02:32:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/delegate.rb (DelegateClass#__getobj__): ditto.
+ * configure.in (rb_cv_lgamma_r_m0): fix the condition for
+ lgamma_r(-0.0). [Bug #12249]
-Thu Nov 21 18:28:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 19 02:32:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/tempfile.rb (Tempfile#initialize): use class method to get rid
- of warnings when $VERBOSE.
+ * configure.in (rb_cv_lgamma_r_m0): check if lgamma_r(-0.0)
+ returns negative infinity. [Bug #12249]
-Thu Nov 21 17:43:29 2013 Koichi Sasada <ko1@atdot.net>
+ * math.c (ruby_lgamma_r): define by the configured result.
- * gc.c: rename initial_xxx variables to gc_params.xxx.
- They are not only used initial values.
+Tue Apr 19 02:32:50 2016 cremno phobia <cremno@mail.ru>
- Chikanaga-san: Congratulations on RubyPrize!
+ * math.c (ruby_lgamma_r): missing/lgamma_r.c is used on Windows,
+ since msvcrt does not provide it.
-Thu Nov 21 17:16:00 2013 Koichi Sasada <ko1@atdot.net>
+ * missing/lgamma_r.c (lgamma_r): fix lgamma(-0.0).
+ [ruby-core:74823] [Bug #12249]
- * gc.c: enable "RGENGC_ESTIMATE_OLDSPACE" option as default.
- Without this option, some application consumes huge memory.
- (and there are only a few performance down)
+Tue Apr 19 02:32:50 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- Introduced new environment variables:
- * RUBY_GC_HEAP_OLDSPACE (default 16MB)
- * RUBY_GC_HEAP_OLDSPACE_MAX (default 128 MB)
- * RUBY_GC_HEAP_OLDSPACE_GROWTH_FACTOR (default 1.2)
+ * math.c (ruby_lgamma_r): mswin's lgamma_r also seems to be wrong.
+ cf. [Bug #12249]
- * gc.c (initial_malloc_limit): rename to initial_malloc_limit_min.
+Tue Apr 19 02:32:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 16:51:34 2013 Zachary Scott <e@zzak.io>
+ * math.c (ruby_tgamma): fix tgamma(-0.0) on mingw.
+ [ruby-core:74817] [Bug #12249]
- * ext/digest/bubblebabble/bubblebabble.c: Teach RDoc digest/bubblebabble
+Tue Apr 19 01:53:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 16:50:16 2013 Zachary Scott <e@zzak.io>
+ * defs/keywords (alias, undef): symbol literals are allowed.
- * test/digest/test_digest.rb: Add more tests for digest/bubblebabble
+ * parse.y (parse_percent): should parse symbol literals for alias
+ and undef. [ruby-dev:47681] [Bug #8851]
-Thu Nov 21 16:32:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Apr 18 18:05:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/delegate.rb (Delegator#method_missing): try private methods defined in
- Kernel after the target. [Fixes GH-449]
+ * struct.c (struct_make_members_list, rb_struct_s_def): member
+ names should be unique. [ruby-core:74971] [Bug #12291]
-Thu Nov 21 16:25:08 2013 Akinori MUSHA <knu@iDaemons.org>
+ * struct.c (struct_make_members_list): extract making member name
+ list from char* va_list, with creating symbols without
+ intermediate IDs.
- * test/uri/test_generic.rb (URI#test_merge): Test uri + URI(path)
- in addition to uri + path.
+Mon Apr 18 17:54:40 2016 Joe Swatosh <joe.swatosh@gmail.com>
-Thu Nov 21 15:36:08 2013 Zachary Scott <e@zzak.io>
+ * ext/win32/lib/win32/registry.rb (DeleteValue, DeleteKey): fix
+ API names. [ruby-core:74863] [Bug #12264]
- * ext/openssl/lib/openssl/buffering.rb: [DOC] Fix HEREDOC comment for
- OpenSSL::Buffering which breaks overview because of RDoc bug
+Mon Apr 18 17:27:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 14:46:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * compile.c (iseq_peephole_optimize): should not replace the
+ current target INSN, not to follow the replaced dangling link in
+ the caller. [ruby-core:74993] [Bug #11816]
- * eval_intern.h (SAVE_ROOT_JMPBUF): workaround for the failure of
- test/ruby/test_exception.rb on Windows.
- wrap by __try and __exception statements on mswin to raise SIGSEGV
- when EXCEPTION_STACK_OVERFLOW is occurred, because MSVCRT doesn't
- handle the exception.
- however, (1) mingw-gcc doesn't support __try and __exception
- statements, and (2) we cannot retry SystemStackError after this
- change yet (maybe crashed) because SEH and longjmp() are too
- uncongenial.
+Mon Apr 18 17:18:25 2016 cremno phobia <cremno@mail.ru>
- * signal.c (check_stack_overflow, CHECK_STACK_OVERFLOW): now defined on
- Windows, too.
+ * cont.c (fiber_initialize_machine_stack_context): fix wrong
+ _MSC_VER check, should be decimal but not hexadecimal.
+ [ruby-core:74936] [Bug #12279]
- * thread_win32.c (ruby_stack_overflowed_p): ditto.
+Mon Apr 18 17:18:25 2016 cremno phobia <cremno@mail.ru>
-Thu Nov 21 14:18:24 2013 Zachary Scott <e@zzak.io>
+ * cont.c (fiber_initialize_machine_stack_context): fix wrong
+ _MSC_VER check, should be decimal but not hexadecimal.
+ [ruby-core:74936] [Bug #12279]
- * object.c: [DOC] Clarify Object#dup vs #clone [Bug #9128]
- Moving existing doc for this comparison to separate section of #dup
- Adding examples to document behavior of #dup with Module#extend.
- Based on a patch by stevegoobermanhill
+Mon Apr 18 17:08:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 14:06:02 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_core.h (rb_vm_struct): make at_exit a single linked list but
+ not RArray, not to mark the registered functions by the write
+ barrier. based on the patches by Evan Phoenix.
+ [ruby-core:73908] [Bug #12095]
- * gc.c (gc_marks_check): do not dump all refs.
+Mon Apr 18 16:56:31 2016 Benoit Daloze <eregontp@gmail.com>
- * gc.c (allrefs_dump_i): fix output format.
+ * thread.c (update_coverage): Do not track coverage in loaded files
+ after Coverage.result. Avoids out-of-bounds access. [Bug #12237]
-Thu Nov 21 13:43:07 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/coverage/coverage.c (coverage_clear_result_i): document.
- * gc.c: change RGENGC_CHECK_MODE (>= 2) logic.
- Basically, make an object graph of all of living objects before and
- after marking and check status.
+Mon Apr 18 16:33:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- [Before marking: check WB sanity]
- If there is a non-old object `obj' pointed from old object
- (`parent') then `parent' or `obj' should be remembered.
+ * ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
+ of DateTime. [ruby-core:74729] [Bug #12233]
- [After marking: check marking miss]
- Traversible objects with the object graph should be marked.
- (However, this alert about objects pointed by machine context
- can be false positive. We only display alert.)
+Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- [Implementation memo]
- objspace_allrefs() creates an object graph.
- The object graph is represented by st_table, key is object (VALUE)
- and value is referring objects. Referring objects are stored by
- "struct reflist".
+ * cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL_PARAM):
+ * add missing parentheses and remove double quotes.
+ * rename to get rid of recursive references.
+ * as --excludes-dir option is for a path name, its argument
+ should be converted.
+ [ruby-dev:49526] [Bug #12199]
- * gc.c (init_mark_stack): do not use push_mark_stack_chunk() at init.
- This pre-allocation causes failure on is_mark_stack_empty()
- without any pushing.
+Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 13:40:20 2013 Zachary Scott <e@zzak.io>
+ * common.mk (TEST_EXCLUDES, EXCLUDE_TESTFRAMEWORK): use full spell
+ long option.
- * lib/observer.rb: [DOC] Clarify default observer method.
- By @edward [Fixes GH-450] https://github.com/ruby/ruby/pull/450
+ * cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL): suppress path name
+ conversions by msys2. [ruby-dev:49525] [Bug #12199]
-Thu Nov 21 13:32:53 2013 Zachary Scott <e@zzak.io>
+Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_engine.c: [DOC] Documentation for OpenSSL::Engine
- This patch is based off work by @vbatts in GH-436 completing the
- documentation for this class and its methods.
- https://github.com/ruby/ruby/pull/436
+ * test/lib/test/unit.rb (Options#non_options): make regexp name
+ options prefixed with "!" negative filters.
-Thu Nov 21 10:45:22 2013 Zachary Scott <e@zzak.io>
+ * common.mk (TEST_EXCLUDES): use negative filter to exclude memory
+ leak tests. -x option excludes test files, not test methods.
- * ext/openssl/lib/openssl/buffering.rb: Remove unused arguments from
- OpenSSL::Buffering.new [Fixes GH-445]
+Sun Apr 17 04:30:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 21 10:30:47 2013 Zachary Scott <e@zzak.io>
+ * parse.y (parse_ident): allow keyword arguments just after a
+ method where the same name local variable is defined.
+ [ruby-core:73816] [Bug#12073]
- * test/digest/test_digest.rb: Add test for Digest::SHA256.bubblebabble
+Sun Apr 17 04:20:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 20 20:54:01 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * eval.c (setup_exception): set the cause only if it is explicitly
+ given or not set yet. [Bug #12068]
- * tool/instruction.rb : fix typo.
+Sat Apr 16 00:56:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 20 19:45:22 2013 Tanaka Akira <akr@fsij.org>
+ * thread.c (rb_thread_setname): defer setting native thread name
+ set in initialize until the native thread is created.
+ [ruby-core:74963] [Bug #12290]
- * random.c (rand_init): Make it possible to specify arbitrary array
- for init_genrand().
+Fri Apr 15 21:10:00 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Nov 20 17:34:13 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/irb/ext/save-history.rb: Fix NoMethodError when method is not defined.
- * parse.y (rb_gc_mark_symbols): set global_symbols.minor_marked only
- when full_mark is 0.
- rb_gc_mark_symbols() (with full_mark == 1) can be called by other
- than GC (such as rb_objspace_reachable_objects_from_root()).
+Fri Apr 15 14:52:06 2016 Elliot Winkler <elliot.winkler@gmail.com>
-Wed Nov 20 11:46:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/forwardable.rb (def_instance_delegator) fix delegating to
+ 'args' and 'block', clashing with local variables in generated
+ methods. [ruby-core:72579] [Bug #11916]
- * ext/json: merge JSON 1.8.1.
- https://github.com/nurse/json/compare/002ac2771ce32776b32ccd2d06e5604de6c36dcd...e09ffc0d7da25d0393873936c118c188c78dbac3
- * Remove Rubinius exception since transcoding should be working now.
- * Fix https://github.com/flori/json/issues/162 reported by Marc-Andre
- Lafortune <github_rocks@marc-andre.ca>. Thanks!
- * Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress
- warning with -Wchar-subscripts and better validate UTF-8 strings.
- * Applied patch by ginriki@github to remove unnecessary if.
- * Add load/dump interface to JSON::GenericObject to make
- serialize :some_attribute, JSON::GenericObject
- work in Rails active models for convenient
- SomeModel#some_attribute.foo.bar access to serialised JSON data.
+ * lib/forwardable.rb (def_single_delegator): ditto.
-Wed Nov 20 01:39:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 15 14:27:48 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/constant.rb (RDoc::Constant#documented?): workaround for
- NoMethodError when the original of alias is not found.
+ * lib/irb/ext/save-history.rb: suppress warning: method redefined;
+ discarding old save_history=.
-Tue Nov 19 23:38:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 12 16:15:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (--with-os-version-style): option to transform target
- OS version string.
+ * configure.in: improve ICC (Intel C Compiler) support.
-Tue Nov 19 21:27:33 2013 Tanaka Akira <akr@fsij.org>
+ * configure.in (CXX): The name of icc's c++ compiler is `icpc`.
- * test/net/http/utils.rb (spawn_server): Specify zero for port to
- avoid reusing an allocated port.
+ * configure.in (warnings): Add `-diag-disable=2259` to suppress
+ noisy warnings: "non-pointer conversion from "..." to "..." may
+ lose significant bits".
- * test/net/http/test_http.rb: Don't specify port here.
+ * configure.in (optflags): Add `-fp-model precise` like -fno-fast-math.
- * test/net/http/test_https.rb: Ditto.
+ * lib/mkmf.rb: icc supports -Werror=division-by-zero
+ and -Werror=deprecated-declarations, but doesn't support
+ -Wdivision-by-zero and -Wdeprecated-declarations.
-Tue Nov 19 18:52:10 2013 Koichi Sasada <ko1@atdot.net>
+Tue Apr 12 14:29:01 2016 Kazuki Yamaguchi <k@rhe.jp>
- * gc.c (heap_is_swept_object): use heap_page::before_sweep flag.
+ * ext/openssl/extconf.rb: check SSL_CTX_set_next_proto_select_cb
+ function rather than OPENSSL_NPN_NEGOTIATED macro. it exists
+ even if it is disabled by OpenSSL configuration.
+ [ruby-core:74384] [Bug #12182]
-Tue Nov 19 18:49:32 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_ssl.c: update #ifdef(s) as above.
- * gc.c (rb_objspace_reachable_objects_from_root): do major marking.
+ * test/openssl/test_ssl.rb: skip NPN tests if NPN is disabled.
-Tue Nov 19 18:45:40 2013 Koichi Sasada <ko1@atdot.net>
+Tue Apr 12 14:27:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_gc_resurrect): added.
- rb_fstring() used rb_gc_mark() to avoid freeing used string.
- However, rb_gc_mark() set mark bit *and* pushes mark_stack.
- rb_gc_resurrect() does only set mark bit if it is before sweeping.
+ * lib/uri/http.rb (URI::HTTP#initialize): [DOC] fix example,
+ missing mandatory arguments. [ruby-core:74540] [Bug #12215]
- * string.c (rb_fstring): use rb_gc_resurrect.
+Thu Apr 7 01:07:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: add decl.
+ * sprintf.c (rb_str_format): fix buffer overflow, length must be
+ greater than precision. reported by William Bowling <will AT
+ wbowling.info>.
-Tue Nov 19 09:47:02 2013 Eric Hodel <drbrain@segment7.net>
+Wed Apr 6 00:33:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc: Update to RDoc master a1195ce. Changes include:
+ * lib/rubygems/security.rb (DIGEST_ALGORITHM, KEY_ALGORITHM):
+ should check same name as the used constants.
+ [ruby-core:72674] [Bug #11940]
- Improved accessibility of the main sidebar navigation.
+Mon Apr 4 00:31:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Fixed handling of regexp options in HTML source highlighting.
+ * compile.c (compile_massign_lhs): when index ends with splat,
+ append rhs value to it like POSTARG, since VM_CALL_ARGS_SPLAT
+ splats the last argument only. [ruby-core:72777] [Bug #11970]
- * test/rdoc: ditto.
+Sat Apr 2 02:07:29 2016 Seiei Miyagi <hanachin@gmail.com>
-Tue Nov 19 09:33:52 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
+ Ripper.lex error in dedenting squiggly heredoc. heredoc tree is
+ also an array of Elem in the outer tree. [Fix GH-1234]
- * lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:
+Wed Mar 30 02:28:13 2016 Eric Wong <e@80x24.org>
- Compatibly renamed Gem::DependencyResolver to Gem::Resolver.
+ * thread_pthread.c (setup_communication_pipe): delay setting owner
+ (rb_thread_create_timer_thread): until thread creation succeeds
+ [ruby-core:72590] [Bug #11922]
- Added support for git gems in gem.deps.rb and Gemfile.
+Wed Mar 30 02:20:06 2016 NARUSE, Yui <naruse@ruby-lang.org>
- Fixed resolver bugs.
+ * localeinit.c (rb_locale_charmap_index): fix prototype.
+ patched by Andreas Schwab [Bug #12218]
- * test/rubygems: ditto.
+Wed Mar 30 02:20:06 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rubygems/LICENSE.txt: Updated to license from RubyGems trunk.
- [ruby-trunk - Bug #9086]
+ * thread_pthread.c (reserve_stack): fix reserving position where
+ the stack growing bottom to top. [Bug #12118]
- * lib/rubygems/commands/which_command.rb: RubyGems now indicates
- failure when any file is missing. [ruby-trunk - Bug #9004]
+Wed Mar 30 02:17:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/ext/builder: Extensions are now installed into the
- extension install directory and the first directory in the require
- path from the gem. This allows backwards compatibility with msgpack
- and other gems that calculate full require paths.
- [ruby-trunk - Bug #9106]
+ * win32/file.c (rb_readlink): drop garbage after the substitute
+ name, as rb_w32_read_reparse_point returns the expected buffer
+ size but "\??\" prefix is dropped from the result.
+ * win32/win32.c (w32_readlink): ditto, including NUL-terminator.
-Tue Nov 19 07:21:56 2013 Tanaka Akira <akr@fsij.org>
+Wed Mar 30 02:17:33 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (LOCALTIME_OVERFLOW_PROBLEM): Define it for cross
- compiling.
- [ruby-core:58391] [Bug #9119] Reported by Luis Lavena.
- Analyzed by Heesob Park.
+ * win32/win32.c (fileattr_to_unixmode, rb_w32_reparse_symlink_p): volume
+ mount point should be treated as directory, not symlink.
+ [ruby-core:72483] [Bug #11874]
-Tue Nov 19 05:55:05 2013 Eric Hodel <drbrain@segment7.net>
+ * win32/win32.c (rb_w32_read_reparse_point): check the reparse point is
+ a volume mount point or not.
- * lib/rdoc/rubygems_hook.rb: Remove debugging puts committed by
- accident.
+ * win32/file.c (rb_readlink): follow above change (but this pass won't
+ be used).
-Mon Nov 18 22:47:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 30 01:32:14 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * eval_intern.h (TH_PUSH_TAG, TH_EXEC_TAG): refine stack overflow
- detection. chain local tag after setjmp() successed on it, because
- calling setjmp() also can overflow the stack.
- [ruby-dev:47804] [Bug #9109]
+ * test/-ext-/time/test_new.rb (test_timespec_new): change a gmtoff
+ test to a better one that does not depend on whether the current
+ time is in summer time or not.
- * vm_eval.c (rb_catch_obj): now th->tag points previous tag until
- TH_EXEC_TAG().
+Wed Mar 30 01:32:14 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * thread_pthread.c (ruby_init_stack): set stack_start properly by
- get_main_stack() if possible.
+ * test/-ext-/time/test_new.rb (test_timespec_new): Time#gmtoff values
+ are the same only when both or neither of the Time objects are in
+ summer time (daylight-saving time).
-Mon Nov 18 22:45:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 30 01:30:54 2016 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * eval_jump.c (rb_exec_end_proc): unlink and free procs data before
- calling for each procs. [Bug #9110]
+ * lib/rubygems/test_case.rb: Fix test on Windows for inconsistent temp path.
+ https://github.com/rubygems/rubygems/pull/1554
+ [Bug #12193][ruby-core:74431]
-Sun Nov 17 06:33:32 2013 Shota Fukumori <her@sorah.jp>
+Wed Mar 30 01:25:46 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in: Use $LIBS for base of $SOLIBS, also in darwin.
- By this fix, environment that libgmp is located in $LIBS can build
- ruby.
+ * string.c (str_new_frozen): if the given string is embeddedable
+ but not embedded, embed a new copied string. [Bug #11946]
-Sun Nov 17 01:56:32 2013 Tanaka Akira <akr@fsij.org>
+Wed Mar 30 01:23:57 2016 Marcus Stollsteimer <sto.mar@web.de>
- * thread_pthread.c (rb_thread_create_timer_thread): Show error
- message instead of error number.
- (thread_create_core): Ditto.
+ * doc/extension.ja.rdoc: Fix RDoc markup in doc/extension*.rdoc.
+ [ci skip][Bug #12143][ruby-core:74143]
+ * doc/extension.rdoc: ditto.
- * cont.c (fiber_machine_stack_alloc): Ditto.
+Wed Mar 30 01:00:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 16 18:28:08 2013 Kouhei Sutou <kou@cozmixng.org>
+ * proc.c (proc_binding): proc from symbol can not make a binding.
+ [ruby-core:74100] [Bug #12137]
- * lib/rexml/parsers/ultralightparser.rb
- (REXML::Parsers::UltraLightParser#parse): Fix wrong :start_doctype
- position.
- [Bug #9061] [ruby-dev:47778]
- Patch by Ippei Obayashi. Thanks!!!
+Wed Mar 30 00:54:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rexml/parser/test_ultra_light.rb: Add a test for this case.
+ * include/ruby/win32.h (O_SHARE_DELETE): change to fit Fixnum
+ limit. [ruby-core:74285] [Bug #12171]
-Sat Nov 16 02:13:56 2013 Masaya Tarui <tarui@ruby-lang.org>
+Wed Mar 30 00:52:47 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * cont.c : Introduce ensure rollback mechanism. Please see below.
+ * test/net/imap/test_imap.rb (test_idle_timeout): Because of the
+ timeout specified in "imap.idle(0.2)", there is no gurantee that
+ the server thread has done all the work before the client thread
+ performs the assertions. It depends on the thread scheduling.
+ Add checks to avoid false positives (on AIX, particularly).
- * internal.h (ruby_register_rollback_func_for_ensure): catch up above change.
- Add rollback mechanism API.
+Wed Mar 30 00:41:42 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * vm_core.h (typedef struct rb_vm_struct): catch up above change.
- Introduce ensure-rollback relation table.
+ * test/socket/test_socket.rb (test_udp_recvmsg_truncation):
+ AIX does not set the MSG_TRUNC flag for a message partially read
+ by recvmsg(2) with the MSG_PEEK flag set.
- * vm_core.h (typedef struct rb_thread_struct): catch up above change.
- Introduce ensure stack.
+Wed Mar 30 00:00:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_ensure): catch up above change.
- Introduce ensure stack.
+ * doc/extension.rdoc, doc/extension.ja.rdoc: add editor local
+ variables, with commenting out by :enddoc: directives which are
+ just ignored unless code object mode. [Bug #12111]
- * hash.c : New function for rollback ensure, and register it to
- ensure-rollback relation table. [ruby-dev:47803] [Bug #9105]
+Wed Mar 30 00:00:47 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- Ensure Rollback Mechanism:
- A rollback's function is a function to rollback a state before ensure's
- function execution.
- When the jump of callcc is across the scope of rb_ensure,
- ensure's functions and rollback's functions are executed appropriately
- for keeping consistency.
+ * doc/extension.ja.rdoc: removed rendering error caused by editor specific
+ configuration on http://docs.ruby-lang.org/en/trunk/extension_rdoc.html .
+ [Bug #12111][ruby-core:73990]
- Current API is unstable, and only internal use.
+Tue Mar 29 23:54:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- ruby_register_rollback_func_for_ensure(ensure_func,rollback_func)
- This API create relation ensure's function to rollback's function.
- By registered rollback's function, it is executed When jumping into
- corresponding rb_ensure scope.
+ * object.c (rb_mod_const_get): make error message at uninterned
+ string consistent with symbols. [ruby-dev:49498] [Bug #12089]
-Sat Nov 16 00:18:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+Tue Mar 29 23:45:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval_jump.c (rb_exec_end_proc): fix double free or corruption error
- when reentering by callcc. [ruby-core:58329] [Bug #9110]
+ * dir.c (push_pattern, push_glob): deal with read paths as UTF-8
+ to stat later, on Windows as well as OS X.
+ [ruby-core:73868] [Bug #12081]
- * test/ruby/test_beginendblock.rb: test for above.
+Tue Mar 29 23:36:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 15 01:06:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/extmk.rb: add cygwin case, nothing excluded.
+ [ruby-core:73806] [Bug#12071]
- * ext/objspace/objspace_dump.c (dump_output): allow IO object as
- output, and use Tempfile.create and return open file instead of
- mkstemp() and path name for :file output.
- [ruby-core:58266] [Bug #9102]
+Tue Mar 29 23:10:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/objspace/test_objspace.rb (TestObjSpace#dump_my_heap_please):
- remove temporary output file.
+ * iseq.c (rb_iseq_mark): mark parent iseq to prevent dynamically
+ generated iseq by eval from GC. [ruby-core:72620] [Bug #11928]
-Thu Nov 14 23:39:00 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Tue Mar 29 22:56:44 2016 Eric Wong <e@80x24.org>
- * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] remove example of
- Rational#to_d without argument. [Bug #8958]
+ * lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
+ * test/resolv/test_dns.rb (test_ipv6_create): test for above
+ [Bug #11910] [ruby-core:72559]
-Thu Nov 14 20:24:15 2013 Naohisa Goto <ngotogenome@gmail.com>
+Tue Mar 29 22:31:48 2016 Shugo Maeda <shugo@ruby-lang.org>
- * ruby_atomic.h (ATOMIC_SIZE_CAS): fix compile error on Solaris
- since r43460.
+ * range.c (range_eqq): revert r11113 because rb_call_super() is
+ called in range_include() and thus r11113 doesn't work when the
+ receiver Range object consists of non linear objects such as Date
+ objects.
+ [ruby-core:72908] [Bug #12003]
-Thu Nov 14 19:53:00 2013 Tanaka Akira <akr@fsij.org>
+Tue Mar 29 22:26:55 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/openssl/test_cipher.rb (test_aes_gcm_wrong_tag): Don't use
- String#succ because it can make modified (wrong) auth_tag longer
- than 16 bytes. The longer auth_tag makes that
- EVP_CIPHER_CTX_ctrl (and internally aes_gcm_ctrl) fail.
- [ruby-core:55143] [Bug #8439] reported by Vit Ondruch.
+ * vm_eval.c (rb_check_funcall_with_hook): also should call the
+ given hook before returning Qundef when overridden respond_to?
+ method returned false. [ruby-core:73556] [Bug #12030]
-Thu Nov 14 11:33:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 29 22:08:36 2016 Kazuki Yamaguchi <k@rhe.jp>
- * hash.c (foreach_safe_i, hash_foreach_iter): deal with error detected
- by ST_CHECK.
+ * compile.c (iseq_peephole_optimize): don't apply tailcall
+ optimization to send/invokesuper instructions with blockiseq.
+ This is a follow-up to the changes in r51903; blockiseq is now
+ the third operand of send/invokesuper instructions.
+ [ruby-core:73413] [Bug #12018]
- * st.c (st_foreach_check): call with non-error argument in normal case.
+Tue Mar 29 21:22:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 14 02:37:14 2013 Zachary Scott <e@zzak.io>
+ * parse.y (xstring): reset heredoc indent after dedenting,
+ so that following string literal would not be dedented.
+ [ruby-core:72857] [Bug #11990]
- * ext/thread/thread.c: [DOC] This patch accomplishes the following:
+Tue Mar 29 21:22:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- - Teach RDoc about ConditionVariable
- - Teach RDoc about Queue
- - Teach RDoc about SizedQueue
- - Use fully-qualified namespace for Document-method
- This is necessary to separate definitions between classes
- - Fix rdoc bug in call_seq vs. call-seq
- - Correct doc for SizedQueue#pop patch by @jackdanger [Bug #8988]
+ * parse.y (string1): reset heredoc indent fore each string leteral
+ so that concatenated string would not be dedented.
+ [ruby-core:72857] [Bug #11990]
-Thu Nov 14 01:11:54 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 21:18:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] +precision+ is required
+ * parse.y (parser_here_document): update indent for each line in
+ indented here document with single-quotes.
+ [ruby-core:72479] [Bug #11871]
-Wed Nov 13 19:21:36 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 21:03:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] Document the required
- +precision+ argument for Rational#to_d [Bug #8958]
+ * symbol.h (is_attrset_id): ASET is an attrset ID. fix
+ unexpected safe call instead of an ordinary ASET.
-Wed Nov 13 19:02:05 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 21:01:07 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/digest/*: [DOC] Fix several typos and broken http links.
- Improved examples for Digest overview and fixed a broken example in
- Digest::HMAC overview. This patch also adds a description of
- Digest::SHA256.bubblebabble to the Digest overview.
+ * doc/syntax/calling_methods.rdoc: fix old operator for safe navigation
+ operator. [ci skip][fix GH-1182] Patch by @dougo
- Patched by @stomar [Bug #9027]
+Tue Mar 29 18:49:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 13 18:32:12 2013 Zachary Scott <e@zzak.io>
+ * lib/ostruct.rb (freeze): define deferred accessors before
+ freezing to get rid of an error when just reading frozen
+ OpenStruct.
- * ext/openssl/ossl_config.c: [DOC] Document the following:
+Tue Mar 29 18:49:54 2016 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- - OpenSSL::ConfigError
- - OpenSSL::Config::DEFAULT_CONFIG_FILE
+ * lib/ostruct.rb: Fix new_ostruct_member to correctly avoid
+ redefinition [#11901]
- Patched by @vbatts via GH-436
- https://github.com/ruby/ruby/pull/436
+Tue Mar 29 17:54:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 13 18:03:00 2013 Zachary Scott <e@zzak.io>
+ * lib/ostruct.rb (OpenStruct): make respond_to? working on
+ just-allocated objects for workaround of Psych.
+ [ruby-core:72501] [Bug #11884]
- * ext/openssl/ossl_asn1.c: [DOC] Document parts of
- OpenSSL::ASN1::ObjectId included a fix for the class overview, which
- previously showed the documentation for Constructive due to missing
- ObjectId overview. This patch also includes a note for Primitive.
+Tue Mar 29 17:04:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Based on a patch by @vbatts via GH-436
- https://github.com/ruby/ruby/pull/436
+ * vm_eval.c (rb_f_catch): [DOC] fix malformed RDoc syntax, "+...+"
+ cannot enclose non-identifier characters.
+ a patch by Sebastian S in [ruby-core:74278]. [Bug#12170]
-Wed Nov 13 17:19:36 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 17:03:28 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * ext/openssl/lib/openssl/config.rb: In #parse use +string+ for +str+
+ * test/-ext-/float/test_nextafter.rb: In AIX,
+ nextafter(+0.0,-0.0)=+0.0, and nextafter(-0.0,+0.0)=-0.0,
+ but they should return -0.0 and +0.0, respectively. This is
+ a known bug in nextafter(3) on AIX, so skip related tests.
-Wed Nov 13 17:09:45 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 16:54:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/*.rb: [DOC] Document the following:
+ * string.c (enc_succ_alnum_char): try to skip an invalid character
+ gap between GREEK CAPITAL RHO and SIGMA.
+ [ruby-core:74478] [Bug #12204]
- - Integer#to_bn
- - OpenSSL::Buffering module
- - Deprecated OpenSSL::Digest::Digest compatibility class
- - OpenSSL::Config
+Tue Mar 29 16:45:58 2016 Victor Nawothnig <Victor.Nawothnig@gmail.com>
- These changes were based on a patch by @vbatts via GH-436
- https://github.com/ruby/ruby/pull/436
+ * parse.y (parse_numvar): NTH_REF must be less than a half of
+ INT_MAX, as it is left-shifted to be ORed with back-ref flag.
+ [ruby-core:74444] [Bug#12192] [Fix GH-1296]
-Wed Nov 13 10:55:43 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 16:44:54 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * doc/regexp.rdoc: [DOC] Fix typo in Special global variables section.
- Reported by Alex Johnson on ruby-doc.org
+ * enc/trans/JIS: update Unicode's notice. [Bug #11844]
-Wed Nov 13 10:43:19 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 16:41:27 2016 Eric Hodel <drbrain@segment7.net>
- * hash.c: [DOC] Adds an example for Hash#store
+ * marshal.c (r_object0): raise ArgumentError when linking to undefined
+ object.
-Wed Nov 13 09:03:40 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 16:41:27 2016 Eric Hodel <drbrain@segment7.net>
- * doc/regexp.rdoc: [DOC] add note about Bug #4044 as suggested by
- duerst-san in [ruby-core:43612] [Fixes GH-443] Patched by @rosenfeld
- https://github.com/ruby/ruby/pull/443
+ * marshal.c (r_object0): Fix Marshal crash for corrupt extended object.
-Tue Nov 12 10:15:14 2013 Eric Hodel <drbrain@segment7.net>
+Tue Mar 29 16:40:48 2016 Eric Wong <e@80x24.org>
- * test/rubygems/insure_session.rb: Remove unused test file.
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): document as MT-unsafe
+ [ruby-core:73803] [Bug #12069]
-Tue Nov 12 09:16:24 2013 Eric Hodel <drbrain@segment7.net>
+Tue Mar 29 16:29:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rubygems: Update to RubyGems master b9213d7. Changes include:
+ * insns.def (opt_mod): show its method name on ZeroDivisionError.
+ [Bug #12158]
- Fixed tests on Windows (I hope) by forcing platform for
- platform-dependent tests.
+Tue Mar 29 16:25:27 2016 Anthony Dmitriyev <antstorm@gmail.com>
- Fixed File.exists? warnings.
+ * net/ftp.rb: add NullSocket#closed? to fix closing not opened
+ connection. [Fix GH-1232]
- Improved testing infrastructure.
+Tue Mar 29 16:12:08 2016 Koichi ITO <koic.ito@gmail.com>
- * test/rubygems: ditto.
+ * variable.c: Added documentation about order of `Module#constants`
+ [ci skip][Bug #12121][ruby-dev:49505][fix GH-1301]
- * test/rdoc/test_rdoc_rubygems_hook.rb: Switch to util_spec like
- RubyGems.
+Tue Mar 29 16:02:26 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Mon Nov 11 18:31:12 2013 Aman Gupta <ruby@tmm1.net>
+ * test/ruby/test_process.rb (test_execopts_gid): Skip a test
+ that is known to fail on AIX. AIX allows setgid to
+ a supplementary group, but Ruby does not allow the "-e"
+ option when setgid'ed, so the test does not work as intended.
- * internal.h: move common string/hash flags to include file.
- * ext/objspace/objspace_dump.c: remove flags shared above.
- * hash.c: ditto.
- * string.c: ditto.
+Tue Mar 29 15:58:18 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Mon Nov 11 04:36:14 2013 Eric Hodel <drbrain@segment7.net>
+ * test/socket/test_addrinfo.rb (test_ipv6_address_predicates):
+ IN6_IS_ADDR_V4COMPAT and IN6_IS_ADDR_V4MAPPED are broken
+ on AIX, so skip related tests.
- * lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking
- if extensions should be built. Fixes a ruby-ci failure.
- * test/rubygems/test_gem_specification.rb: Test for the above.
+Tue Mar 29 15:31:06 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Mon Nov 11 03:15:56 2013 Koichi Sasada <ko1@atdot.net>
+ * test/rinda/test_rinda.rb (test_make_socket_ipv4_multicast):
+ The fifth argument to getsockopt(2) should be modified to
+ indicate the actual size of the value on return,
+ but not in AIX. This is a know bug. Skip related tests.
+ * test/rinda/test_rinda.rb (test_ring_server_ipv4_multicast):
+ ditto.
+ * test/rinda/test_rinda.rb (test_make_socket_unicast): ditto.
+ * test/socket/test_basicsocket.rb (test_getsockopt): ditto.
+ * test/socket/test_sockopt.rb (test_bool): ditto.
- * vm_trace.c (symbol2event_flag): add secret feature.
- add a_call/a_return events.
- a_call is call | b_call | c_call, and same as a_return.
+Tue Mar 29 15:27:14 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Mon Nov 11 02:51:17 2013 Eric Hodel <drbrain@segment7.net>
+ * test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine):
+ Skip two tests on AIX because zconf.h in zlib does not correctly
+ recognize _LARGE_FILES in AIX. The problem was already reported
+ to zlib, and skip these tests until it is fixed.
- * lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes
- in this commit:
+Tue Mar 29 15:10:31 2016 Rei Odaira <Rei.Odaira@gmail.com>
- RubyGems now chooses the test server port reliably. Patch by akr.
+ * thread_pthread.c (getstack): __pi_stacksize returned by
+ pthread_getthrds_np() is wrong on AIX. Use
+ __pi_stackend - __pi_stackaddr instead.
- Partial implementation of bundler's Gemfile format.
+Tue Mar 29 15:10:05 2016 Alex Boyd <alex@opengroove.org>
- Refactorings to improve the new resolver.
+ * lib/irb.rb: avoid to needless truncation when using back_trace_limit option.
+ [fix GH-1205][ruby-core:72773][Bug #11969]
- Fixes bugs in the resolver.
+Tue Mar 29 15:05:16 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * test/rubygems: Tests for the above.
+ * ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb: fix method name typo.
+ [ruby-core:72513] [Bug #11893] The patch provided by Akira Matsuda.
-Mon Nov 11 01:02:06 2013 Zachary Scott <e@zzak.io>
- * lib/timeout.rb: [DOC] Add note about change from #8730 [Fixes GH-440]
- * NEWS: [DOC] Improve grammar on change to Timeout
- Patched by @srawlins in https://github.com/ruby/ruby/pull/440
+Tue Mar 29 15:05:02 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Sun Nov 10 23:47:05 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * ext/tk/lib/tkextlib/tcllib/toolbar.rb: fix method name typo.
+ [ruby-core:72511] [Bug #11891] The patch provided by Akira Matsuda.
- * gc.c (rb_gcdebug_print_obj_condition): catch up recent changes
- to compile on GC_DEBUG.
-Sun Nov 10 22:16:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 29 15:04:42 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * error.c (exc_cause): captured previous exception.
+ * ext/tk/lib/tkextlib/blt/tree.rb: fix method name typo.
+ [ruby-core:72510] [Bug #11890] The patch provided by Akira Matsuda.
- * eval.c (make_exception): capture previous exception automagically.
- [Feature #8257]
-Sun Nov 10 08:37:20 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 15:04:19 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * thread.c: [DOC] Remove duplicate reference
+ * ext/tk/lib/tk/menubar.rb: fix a typo in font name. [ruby-core:72505]
+ [Bug #11886] The patch provided by Akira Matsuda.
-Sun Nov 10 08:09:29 2013 Zachary Scott <e@zzak.io>
+ * ext/tk/sample/*.rb: ditto.
- * lib/drb/drb.rb: [DOC] promote better windows-safe filename regular
- expression in DRb Logger example. Reported by Chris Pheonix
- [Bug #9074]
+Tue Mar 29 15:03:03 2016 Kenta Murata <mrkn@mrkn.jp>
-Sun Nov 10 08:03:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
+ and HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P on C++.
+ [ruby-core:72736] [Bug #11962]
- * gc.c (rb_define_finalizer, rb_undefine_finalizer): rename and export
- finalizer functions.
+Tue Mar 29 14:58:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 10 07:41:22 2013 Zachary Scott <e@zzak.io>
+ * ext/socket/option.c (inspect_tcpi_msec): more accurate condition
+ for TCPI msec member inspection function.
+ [ruby-core:74388] [Bug #12185]
- * lib/weakref.rb: [DOC] fix typos by @xaviershay [Fixes GH-439]
- https://github.com/ruby/ruby/pull/439
+Tue Mar 29 14:53:58 2016 Naotoshi Seo <sonots@gmail.com>
-Sun Nov 10 06:14:39 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * lib/logger.rb: Remove block from Logger.add as it's not needed
+ patch provided by Daniel Lobato Garcia [fix GH-1240] [Bug #12054]
- * compile.c (iseq_compile_each): emit opt_str_freeze if the #freeze
- method is called on a static string literal with no arguments.
+Tue Mar 29 14:52:20 2016 Zachary Scott <zzak@ruby-lang.org>
- * defs/id.def (firstline): add freeze so idFreeze is available
+ * re.c: Remove deprecated kcode argument from Regexp.new and compile
+ patch provided by Dylan Pulliam [Bug #11495]
- * insns.def (opt_str_freeze): add opt_str_freeze instruction which
- pushes a frozen string literal without allocating a new object if
- String#freeze is not overridden
+Tue Mar 29 14:44:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (Init_String): define String#freeze
+ * ext/socket/socket.c (sock_gethostname): support unlimited size
+ hostname.
- * vm.c (vm_init_redefined_flag): define BOP_FREEZE on String class as
- a basic operation
+Tue Mar 29 14:35:06 2016 Kouhei Sutou <kou@cozmixng.org>
- * vm_insnhelper.h: ditto
+ * lib/xmlrpc/client.rb: Support SSL options in async methods of
+ XMLRPC::Client.
+ [Bug #11489]
+ Reported by Aleksandar Kostadinov. Thanks!!!
- [Feature #8992] [ruby-core:57705]
+Tue Mar 29 14:22:57 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Nov 10 01:34:14 2013 Koichi Sasada <ko1@atdot.net>
+ * marshal.c (r_object0): honor Marshal.load post proc
+ value for TYPE_LINK. by Hiroshi Nakamura <nahi@ruby-lang.org>
+ https://github.com/ruby/ruby/pull/1204 fix GH-1204
- * gc.c (vm_malloc_increase): sweep immediately on GC due to malloc().
- To reduce memory usage, sweep as soon as possible.
- This behavior is same as Ruby 2.0.0 and before.
+Tue Mar 29 14:18:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Nov 10 00:39:26 2013 Koichi Sasada <ko1@atdot.net>
+ * .travis.yml: removed commented-out code.
- * benchmark/gc/gcbench.rb: output version description and GC::OPTS.
+Tue Mar 29 14:18:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Nov 10 00:36:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * .travis.yml: removed osx code. follow up with r53517
- * gc.c (should_be_callable): allow private call since rb_eval_cmd
- calls even private methods.
+Tue Mar 29 14:12:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 10 00:33:17 2013 Zachary Scott <e@zzak.io>
+ * ext/socket/option.c (sockopt_bool): relax boolean size to be one
+ too not only sizeof(int). Winsock getsockopt() returns a single
+ byte as a boolean socket option. [ruby-core:72730] [Bug #11958]
- * lib/racc/rdoc/grammar.en.rdoc: [DOC] fix typo by Tsuyoshi Sawada
- [Bug #9077]
+Tue Mar 29 14:12:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 9 22:35:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/option.c (check_size): extract a macro to check
+ binary data size, with a consistent message.
- * tool/rbinstall.rb (Gem::Specification.load): obtain spec date from
- VCS for the case using git, RUBY_RELEASE_DATE is the last resort.
- probably fixes [Bug #9085].
+ * ext/socket/option.c (sockopt_byte): fix error message,
+ sizeof(int) differs from sizeof(unsigned char) in general.
-Sat Nov 9 20:56:12 2013 Narihiro Nakamura <authornari@gmail.com>
+Tue Mar 29 14:01:14 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/objspace/object_tracing.c: use declarations in internal.h.
+ * process.c (rb_execarg_parent_start1): need to convert the encoding to
+ ospath's one.
- * ext/objspace/objspace.c: ditto
+Tue Mar 29 14:01:14 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Nov 9 20:32:59 2013 Tanaka Akira <akr@fsij.org>
+ * process.c: use rb_w32_uchdir() instead of plain chdir() on Windows.
+ reported by naruse via twitter.
- * test/objspace/test_objspace.rb (test_dump_all): Make the test string
- shorter to be an embedded string on 32bit environment as well as
- 64bit environment.
+ * process.c (rb_execarg_addopt): need to convert the encoding to
+ ospath's one.
-Sat Nov 9 15:00:16 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 13:56:36 2016 Eric Wong <e@80x24.org>
- * io.c: [DOC] ARGF.gets may return nil [Bug #9029] patch by znz
+ * ext/stringio/stringio.c (strio_binmode): implement to set encoding
+ * test/stringio/test_stringio.rb (test_binmode): new test
+ [ruby-core:72699] [Bug #11945]
-Sat Nov 9 14:54:52 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 13:50:30 2016 Eric Wong <e@80x24.org>
- * lib/rss/*: [DOC] document various constants @steveklabnik [Bug #8812]
+ * io.c (io_getpartial): remove unused kwarg from template
+ * test/ruby/test_io.rb (test_readpartial_bad_args): new
+ [Bug #11885]
-Sat Nov 9 14:50:09 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 13:41:03 2016 Tadashi Saito <tad.a.digger@gmail.com>
- * lib/rss/rss.rb: [DOC] document Time#w3cdtf by @steveklabnik
- [Bug #8821]
+ * compile.c, cont.c, doc, man: fix common misspelling.
+ [ruby-core:72466] [Bug #11870]
-Sat Nov 9 14:29:04 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 13:31:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/dl/cfunc.c: [DOC] fix typo in example [Bug #8944]
- Patched by Heesob Park
+ * parse.y (regexp): set_yylval_num sets u1, should use nd_tag
+ instead of nd_state. [ruby-core:72638] [Bug #11932]
-Sat Nov 9 13:59:58 2013 Zachary Scott <e@zzak.io>
+Tue Mar 29 13:31:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/assertions.rb: [DOC] better example for assert_send()
- Patch by Andrew Grimm [Bug #8975]
+ * parse.y (set_yylval_num): should be used as nd_state, set to u3.
+ [ruby-core:72638] [Bug #11932]
-Sat Nov 9 12:45:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Tue Mar 29 13:26:15 2016 Joseph Tibbertsma <josephtibbertsma@gmail.com>
- * insns.def: unify ic_constant_serial and ic_class_serial into one field
- ic_serial. This is possible because these fields are only ever used
- exclusively with each other.
+ * gc.c (RVALUE_PAGE_WB_UNPROTECTED): fix a typo of argument name.
+ [Fix GH-1221]
- * insns.def: ditto
- * vm_core.h: ditto
- * vm_insnhelper.c: ditto
+Thu Jan 21 16:39:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Nov 9 12:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * Makefile.in (update-rubyspec): fix r53208 like r53451.
- * class.c: unify names of vm state version counters to 'serial'.
- This includes renaming 'vm_state_version_t' to 'rb_serial_t',
- 'method_state' to 'method_serial', 'seq' to 'class_serial',
- 'vmstat' to 'constant_serial', etc.
+Fri Jan 15 00:05:57 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * insns.def: ditto
- * internal.h: ditto
- * vm.c: ditto
- * vm_core.h: ditto
- * vm_insnhelper.c: ditto
- * vm_insnhelper.h: ditto
- * vm_method.c: ditto
+ * lib/uri/generic.rb (URI::Generic#to_s): change encoding to
+ UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com>
+ https://github.com/ruby/ruby/pull/1188 fix GH-1188
-Sat Nov 9 09:22:29 2013 Masaya Tarui <tarui@ruby-lang.org>
+Tue Jan 12 17:23:39 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (gc_page_sweep, rgengc_rememberset_mark): Refactoring.
- Get bitmaps directly.
+ * process.c (rb_execarg_parent_start1): need to convert the encoding to
+ ospath's one.
-Sat Nov 9 09:16:36 2013 Masaya Tarui <tarui@ruby-lang.org>
+Tue Jan 12 17:23:39 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (RVALUE_PROMOTE_INFANT): Refactoring. Remove duplicated nonsense
- code.
+ * process.c: use rb_w32_uchdir() instead of plain chdir() on Windows.
+ reported by naruse via twitter.
-Sat Nov 9 09:04:48 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * process.c (rb_execarg_addopt): need to convert the encoding to
+ ospath's one.
- * gc.c (gc_marks_test): Bugfix. Fix a struct member name for build
- with RGENGC_CHECK_MODE.
+Tue Jan 12 15:21:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 9 08:58:23 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * include/ruby/missing.h (explicit_bzero_by_memset_s): remove
+ inline implementation by memset_s, which needs a macro before
+ including headers and can cause problems in extension libraries
+ by the order of the macro and headers.
- * gc.c : Add GC_PROFILE_DETAIL_MEMORY option.
- If GC_PROFILE_MORE_DETAIL && GC_PROFILE_DETAIL_MEMORY,
- maxrss, minflt and majflt are added to each profile record.
+Thu Dec 24 23:01:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sat Nov 9 07:41:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: added entry for CGI.escapeHTML optimization.
- * internal.h (rb_vm_backtrace_object, rb_gc_count): make prototype
- declarations, not old-K&R style.
+Thu Dec 24 18:43:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 9 06:11:14 2013 vo.x (Vit Ondruch) <vondruch@redhat.com>
+ * error.c (rb_compile_error_with_enc, rb_compile_error),
+ (rb_compile_bug): deprecate internal functions.
- * tool/rbinstall.rb (Gem::Specification#collect): make stable
- Gem::Specification.files in default .gemspecs the different order of
- "files" in .gemspec files makes them different therefore possibly
- conflicting in multilib scenario. patch by vo.x (Vit Ondruch) at
- [ruby-core:57544] [Bug #8623].
+ * parse.y (parser_yyerror): construct exception message with
+ source code and caret.
-Sat Nov 9 01:59:18 2013 Aman Gupta <ruby@tmm1.net>
+Thu Dec 24 17:25:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/objspace_dump.c: Add experimental methods to
- dump objectspace as json: ObjectSpace.dump_all and
- ObjectSpace.dump(obj). These methods are useful for debugging
- reference leaks and memory growth in large ruby applications.
- [Bug #9026] [ruby-core:57893] [Fixes GH-423]
- * test/objspace/test_objspace.rb: tests for above.
+ * compile.c (append_compile_error), parse.y (compile_error):
+ preserve encoding of source file name in exceptions.
-Sat Nov 9 00:26:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (rb_compile_error_str, rb_compile_bug_str): add.
- * file.c (GetLastError): already defined in windows.h on nowadays
- cygwin, and caused the confliction with the system provided
- definition on cygwin64. by @kou1okada [Fixes GH-433].
+Thu Dec 24 16:17:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 8 18:35:31 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * common.mk (fake.rb): $(arch)-fake.rb must depend on miniruby because
+ it may depend on miniruby.
- * lib/open3.rb: receive arguments as keyword arguments.
+Thu Dec 24 16:13:05 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 8 13:19:26 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * common.mk (ripper.c): r50045 wrongly replace $(PWD) with ../..
+ It is the top of build directory, not topsrcdir.
- * io.c (rb_io_open_with_args): use RARRAY_CONST_PTR().
+Thu Dec 24 15:02:42 2015 sorah (Shota Fukumori) <her@sorah.jp>
- * io.c (rb_scan_open_args): use const qualifier for above.
+ * tool/vcs.rb (IO.popen): Refactor. Avoid assigning in condition.
- * io.c (rb_open_file): ditto.
+Thu Dec 24 15:01:38 2015 sorah (Shota Fukumori) <her@sorah.jp>
- * io.c (rb_io_open_with_args): ditto.
+ * tool/file2lastrev.rb: Fix ArgumentError to work on Ruby 1.8.7.
-Fri Nov 8 11:35:06 2013 Masaki Matsushita <glass.saga@gmail.com>
+Thu Dec 24 14:44:08 2015 sorah (Shota Fukumori) <her@sorah.jp>
- * dir.c, pack.c, ruby.c, struct.c, vm_eval.c: use RARRAY_CONST_PTR().
+ * tool/vcs.rb (IO.popen): Enable on Ruby 1.9 where chdir option is not
+ supported on IO.popen
-Fri Nov 8 10:58:02 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * tool/vcs.rb (IO.popen): Fix NoMethodError. I guess r49705 was not
+ tested... :/
- * compile.c (iseq_build_from_ary_exception): use RARRAY_CONST_PTR().
+Thu Dec 24 14:57:03 2015 Koichi Sasada <ko1@atdot.net>
- * compile.c (iseq_build_from_ary_body): ditto.
+ * NEWS: rename
+ "Implementation changes" section to
+ "Supported platform changes" section.
-Fri Nov 8 10:49:34 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * NEWS: add "Implementation improvements" and add several entries.
- * enumerator.c (append_method): use RARRAY_CONST_PTR().
+ * NEWS: add NEWS entries by Eric Wong. [ruby-core:72450]
- * enumerator.c (lazy_init_iterator): ditto.
+Thu Dec 24 00:26:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 8 02:44:29 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/io/console/extconf.rb: fix gem build failure on Windows.
+ only win32_vk.inc is included in the gem and no dependencies for
+ the header, so that gperf will not be mandatory.
+ [ruby-core:72453] [Bug #11866]
- * gc.c (vm_malloc_increase): check GVL before gc_rest_sweep().
- vm_malloc_increase() can be called without GVL.
- However, gc_rest_sweep() assumes acquiring GVL.
- To avoid this problem, check GVL before gc_rest_sweep().
- [Bug #9090]
+ * ext/io/console/io-console.gemspec: include depend file and
+ win32_vk header.
- This workaround introduces possibility to set malloc_limit as
- wrong value (*1). However, this may be rare case. So I commit it.
+Wed Dec 23 23:58:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- *1: Without rest_sweep() here, gc_rest_sweep() can decrease
- malloc_increase due to ruby_sized_xfree().
+ * io.c (rb_readwrite_syserr_fail): works with the given errno than
+ thread local errno.
-Fri Nov 8 02:50:25 2013 Zachary Scott <e@zzak.io>
+Wed Dec 23 17:57:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/securerandom.rb: [DOC] specify arguments passed to ::random_bytes
- By @chastell [Fixes GH-412] https://github.com/ruby/ruby/pull/412
+ * file.c, io.c, util.c: prefer rb_syserr_fail with saved errno
+ over setting errno then call rb_sys_fail, not to be clobbered
+ potentially and to reduce thread local errno accesses.
-Fri Nov 8 02:43:01 2013 Zachary Scott <e@zzak.io>
+Wed Dec 23 11:58:52 2015 Yuichiro Kaneko <yui-knk@ruby-lang.org>
- * ext/objspace/object_tracing.c: [DOC] trace_object_allocations_stop
- By @srawlins [Fixes GH-421] https://github.com/ruby/ruby/pull/421
+ * string.c: Fix document. Default value of the first
+ argument of `String#split` is not `$;` but `nil`.
+ When `nil` is passed as first argument, `$;` is used.
+ [ci skip] [Bug #11729] [ruby-dev:49378]
-Fri Nov 8 02:34:20 2013 Zachary Scott <e@zzak.io>
+Wed Dec 23 07:15:17 2015 Eric Wong <e@80x24.org>
- * lib/net/ftp.rb: [DOC] Document Net::FTP.mdtm and .set_socket and fix
- spelling typo, based on patch by @artfuldodger [Fixes GH-426]
- https://github.com/ruby/ruby/pull/426
+ * ext/socket/init.c (rsock_init_sock): reject reserved FDs
+ [ruby-core:72445] [Bug #11862]
-Fri Nov 8 02:14:37 2013 Zachary Scott <e@zzak.io>
+Wed Dec 23 02:59:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c: [DOC] Add note about negative indices in Array overview
- By @ckaenzig [Fixes GH-427] https://github.com/ruby/ruby/pull/427
+ * configure.in (__STDC_WANT_LIB_EXT1__): necessary to use memset_s
+ in strict C99 mode.
-Fri Nov 8 02:09:12 2013 Zachary Scott <e@zzak.io>
+Wed Dec 23 02:34:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/csv.rb: [DOC] Fix typo in CSV.parse_line by @funky-bibimbap
- [Fixes GH-430] https://github.com/ruby/ruby/pull/430
+ * regexec.c (match_at): move direct threaded VM code to get rid of
+ mixed declarations and code, and enable it only for gcc since it
+ depends on a gcc extension.
-Fri Nov 8 01:01:54 2013 Zachary Scott <e@zzak.io>
+Wed Dec 23 02:23:19 2015 Yuki Nishijima <mail@yukinishijima.net>
- * golf_prelude.rb: syntax formatting for whitespace [Fixes GH-425]
- Patch by @edward https://github.com/ruby/ruby/pull/425
+ * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0
-Thu Nov 7 19:36:09 2013 Koichi Sasada <ko1@atdot.net>
+ * NEWS: Add news about the did_you_mean gem
- * gc.c: modify malloc_limit strategy.
+Wed Dec 23 02:18:57 2015 Jake Worth <jakeworth82@gmail.com>
- * fix default values:
- GC_MALLOC_LIMIT_GROWTH_FACTOR
- GC_MALLOC_LIMIT: 8MB -> 16MB
- GC_MALLOC_LIMIT_MAX: 384MB -> 32MB
+ * doc/contributing.rdoc: [DOC] remove an extra word "here".
+ [Fix GH-1169]
- * algorithm of malloc_limit increment.
- if (malloc_increase < malloc_limit) {
- next_malloc_limit = malloc_limit * factor
- if (malloc_limit > malloc_limit_max) {
- malloc_limit = malloc_increase
- }
- }
- This algorithm change malloc_limit from
- 16MB -> 32MB slowly.
- If malloc_limit exceeds malloc_limit_max, then
- increase with malloc_increase.
+Wed Dec 23 01:58:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 7 11:06:05 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * regexec.c (USE_DIRECT_THREADED_VM): enable direct threaded VM by
+ the default.
- * array.c (rb_ary_shuffle_bang): use RARRAY_PTR_USE() without WB
- because there are not new relations.
+Tue Dec 22 22:15:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 7 10:34:12 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * gc.c (internal_object_p): should not expose singleton classes
+ without a metaclass. based on patches by ko1 and shugo.
+ [Bug #11740]
- * array.c (rb_ary_sample): use rb_ary_dup().
+ * class.c (rb_singleton_class_object_p): added.
-Thu Nov 7 09:39:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 22 22:15:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_trace.c (rb_threadptr_exec_event_hooks_orig): errinfo should not
- be propagated to trace blocks so that no argument raise does not
- throw internal objects. [ruby-dev:47793] [Bug #9088]
+ * ext/io/console/io-console.gemspec: bump up to 0.4.4.
-Wed Nov 6 21:30:55 2013 Masaya Tarui <tarui@ruby-lang.org>
+Tue Dec 22 22:11:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (gc_before_sweep): Change algorithm of malloc_limit to
- conservative for closing to memory consumption of ruby 2.0.
+ * NEWS: Added news entry of Psych 2.0.17
- * gc.c (GC_MALLOC_LIMIT, GC_MALLOC_LIMIT_GROWTH_FACTOR):
- Adjust parameters for new algorithm.
+Tue Dec 22 22:09:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Nov 6 21:16:51 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * NEWS: Added news entry of RDoc 4.2.1
- * array.c (rb_ary_shift_m): use RARRAY_PTR_USE() without WB because
- there are not new relations.
+Tue Dec 22 21:20:00 2015 Kenta Murata <mrkn@mrkn.jp>
-Wed Nov 6 21:05:20 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * ext/bigdecimal/bigdecimal.gemspec: bump version to 1.2.8.
- * array.c (rb_ary_reverse): use RARRAY_PTR_USE().
+Tue Dec 22 21:08:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Nov 6 19:30:44 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * lib/rdoc.rb: bump version to 4.2.1. It contains following fixes.
+ https://github.com/rdoc/rdoc/pull/340
+ https://github.com/rdoc/rdoc/pull/341
+ https://github.com/rdoc/rdoc/pull/367
+ https://github.com/rdoc/rdoc/pull/368
+ * lib/rdoc/*: ditto.
+ * test/rdoc/*: ditto.
- * common.mk (help): add texts about gcbench.
+Tue Dec 22 20:25:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Nov 6 16:32:32 2013 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * ext/psych/lib/psych.rb: bump version to 2.0.17
+ * ext/psych/psych.gemspec: ditto.
- * lib/open3.rb: tweaked grammar in comments
+Tue Dec 22 20:14:47 2015 Koichi Sasada <ko1@atdot.net>
-Wed Nov 6 11:46:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * vm_insnhelper.c: move vm_callee_setup_block_arg() (and related
+ functions) to the latter location.
+ This moving recovers performance a little.
+ [Bug #11829]
- * array.c (rb_ary_sample): use RARRAY_AREF() and RARRAY_PTR_USE()
- instead of RARRAY_PTR().
+Tue Dec 22 15:21:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 6 10:37:07 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * string.c (str_compat_and_valid): as scrub does nothing for dummy
+ encoding string now, incompatible encoding is not a matter.
- * array.c (rb_ary_and): defer hash creation and some refactoring.
+Tue Dec 22 14:31:28 2015 Toru Iwase <tietew@tietew.net>
-Wed Nov 6 09:14:31 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/cgi/escape/escape.c (optimized_escape_html): CGI.escapeHTML
+ should return unfrozen new string.
+ [ruby-core:72426] [Bug #11858]
- * benchmark/bm_vm1_gc_short_lived.rb: added.
- These GC benchmarks do not reflect practical applications.
- They are only for tuning.
+Tue Dec 22 05:39:58 2015 Takashi Kokubun <takashikkbn@gmail.com>
- * benchmark/bm_vm1_gc_short_with_complex_long.rb: added.
+ * ext/cgi/escape/escape.c (preserve_original_state): Preserve
+ original state for tainted and frozen. [Fix GH-1166]
+ [ruby-dev:49451] [Bug #11855]
- * benchmark/bm_vm1_gc_short_with_long.rb: added.
+Tue Dec 22 03:57:20 2015 Eric Wong <e@80x24.org>
- * benchmark/bm_vm1_gc_short_with_symbol.rb: added.
+ * ext/socket/init.c (rsock_init_sock): check FD after validating
+ * test/socket/test_basicsocket.rb (test_for_fd): new
+ [ruby-core:72418] [Bug #11854]
- * benchmark/bm_vm1_gc_wb_ary.rb: added.
+Mon Dec 21 21:29:45 2015 Naohisa Goto <ngotogenome@gmail.com>
- * benchmark/bm_vm1_gc_wb_obj.rb: added.
+ * variable.c (struct ivar_update): rename "extended" to "iv_extended"
+ to avoid name conflict with /usr/include/floatingpoint.h on
+ Solaris. [Bug #11853] [ruby-dev:49448]
- * benchmark/bm_vm_thread_queue.rb: added.
- This benchmark is added to know how fast C version of thread.so.
+Mon Dec 21 12:15:32 2015 Kimura Wataru <kimuraw@i.nifty.jp>
-Wed Nov 6 09:13:32 2013 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_io.rb: handled rlimit value same as r52277
+ [Bug #11852][ruby-dev:49446]
- * gc.c: define RGENGC_ESTIMATE_OLDSPACE == 0 if USE_RGENGC is 0.
+Mon Dec 21 10:21:22 2015 Ilya Vassilevsky <vassilevsky@gmail.com>
-Wed Nov 6 07:13:18 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/net/http.rb (open_timeout): update default value in RDoc
+ [ruby-core:72413]
- * gc.c (Init_GC): add GC::OPTS to show options.
+Mon Dec 21 10:18:46 2015 Kazuki Yamaguchi <k@rhe.jp>
-Wed Nov 6 07:12:17 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_backtrace.c (rb_profile_frames): ignore ifunc frames as it
+ did before. [ruby-core:72409] [Bug #11851]
- * benchmark/gc/gcbench.rb: add some options to make quiet.
+Mon Dec 21 09:33:17 2015 Karol Bucek <kares@users.noreply.github.com>
-Wed Nov 6 04:14:25 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket): fix
+ NotImplementedError typo. [Fix GH-1165]
- * ext/psych/lib/psych/visitors/to_ruby.rb: process merge keys before
- reviving objects. Fixes GH psych #168
- * test/psych/test_merge_keys.rb: test for change
- https://github.com/tenderlove/psych/issues/168
+Sun Dec 20 20:54:51 2015 Takashi Kokubun <takashikkbn@gmail.com>
-Tue Nov 5 21:21:47 2013 Tanaka Akira <akr@fsij.org>
+ * cgi/escape/escape.c: Optimize CGI.escapeHTML for
+ ASCII-compatible encodings. [Fix GH-1164]
- * test/ruby/test_thread.rb (test_thread_join_in_trap):
- Run the test in a different process.
+Sun Dec 20 15:36:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Tue Nov 5 20:14:32 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * lib/erb.rb: revert r53123. It breaks compatibility like thor and
+ rspec-rails.
+ We should try with Ruby 2.4 or 3.0.
+ [Bug #11842][ruby-core:72374]
+ * lib/rdoc/erb_partial.rb: ditto.
+ * template/verconf.h.tmpl: ditto.
- * gc.c (is_live_object): A hidden object may be a live object.
- [ruby-dev:47788] [Bug #9072]
+Sun Dec 20 11:43:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 5 13:37:19 2013 Koichi Sasada <ko1@atdot.net>
+ * parse.y (parser_yylex): allow here documents in labeled
+ argument. [ruby-core:72396] [Bug #11849]
- * gc.c: add support to estimate increase of oldspace memory usage.
- This is another approach to solve an issue discussed at r43530.
- This feature is disabled as default.
+Sun Dec 20 11:14:11 2015 Koichi Sasada <ko1@atdot.net>
- This feature measures an increment of memory consumption by oldgen
- objects. It measures memory consumption for each objects when
- the object is promoted. However, measurement of memory consumption
- is not accurate now. So that this measurement is `estimation'.
+ * proc.c (rb_mod_define_method): should check Symbol or not.
+ [Bug #11850]
- To implement this feature, move memsize_of() function from
- ext/objspace/objspace.c and expose rb_obj_memsize_of().
+ * test/ruby/test_method.rb: add a test.
- Some memsize() functions for T_DATA (T_TYPEDDATA) have problem to
- measure memory size, so that we ignores T_DATA objects now.
- For example, some functions skip NULL check for pointer.
+Sun Dec 20 11:01:57 2015 Koichi Sasada <ko1@atdot.net>
- The macro RGENGC_ESTIMATE_OLDSPACE enables/disables this feature,
- and turned off as default.
+ * proc.c (rb_mod_define_method): fix notation.
- We need to compare 3gen GC and this feature carefully.
- (it is possible to enable both feature)
- We need a help to compare them.
+Sun Dec 20 10:54:15 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h: expose rb_obj_memsize_of().
+ * proc.c (proc_new): fix notation.
- * ext/objspace/objspace.c: use rb_obj_memsize_of() function.
+Sun Dec 20 00:29:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * cont.c (fiber_memsize): fix to check NULL.
+ * proc.c (rb_proc_get_iseq): proc made from symbol does not have
+ iseq. fix infinite loop. [ruby-core:72381] [Bug #11845]
- * variable.c (autoload_memsize): ditto.
+Sat Dec 19 20:06:10 2015 Naohisa Goto <ngotogenome@gmail.com>
- * vm.c (vm_memsize): ditto.
+ * enc/windows_1250.c: Should not use C++ style comments (C99 feature).
+ [Bug #11843]
-Tue Nov 5 04:03:07 2013 Koichi Sasada <ko1@atdot.net>
+Sat Dec 19 17:17:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (GC_MALLOC_LIMIT_MAX): fix default value 512MB -> 384MB.
- 512MB is huge.
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
+ use WEBrick::Utils::TimeoutHandler::Thread, which is ignored by
+ LeakChecker#find_threads, instead of ::Thread to get rid of
+ thread leak checker. since this TimeoutHandler is resident
+ during tests because of Singleton, it waits for the next timeout
+ if it has any schedules. in the case of nested timeouts, inner
+ timeout does not cancel outer timeouts and then those schedules
+ still remain.
-Tue Nov 5 03:31:23 2013 Koichi Sasada <ko1@atdot.net>
+Sat Dec 19 14:28:01 2015 Jake Worth <jakeworth82@gmail.com>
- * gc.c: add 3gen GC patch, but disabled as default.
+ * ext/zlib/zlib.c (Init_zlib): [DOC] Fix double-word typo and
+ grammatical error. [Fix GH-1162]
- RGenGC is designed as 2 generational GC, young and old generation.
- Young objects will be promoted to old objects after one GC.
- Old objects are not collect until major (full) GC.
+Sat Dec 19 14:23:59 2015 Jake Worth <jakeworth82@gmail.com>
- The issue of this approach is some objects can promoted as old
- objects accidentally and not freed until major GC.
- Major GC is not frequently so short-lived but accidentally becoming
- old objects are not freed.
+ * lib/csv.rb (CSV#initialize): [DOC] Fix double-word typo.
+ [Fix GH-1161]
- For example, the program "loop{Array.new(1_000_000)}" consumes huge
- memories because short lived objects (an array which has 1M
- elements) are promoted while GC and they are not freed before major
- GC.
+Sat Dec 19 10:33:33 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- To solve this problem, generational GC with more generations
- technique is known. This patch implements three generations gen GC.
+ * enc/iso_8859_2.c, enc/windows_1250.c: separate Windows-1250
+ from ISO-8859-2 to fix 0x80..0x9e range (from Kimihito Matsui)
- At first, newly created objects are "Infant" objects.
- After surviving one GC, "Infant" objects are promoted to "Young"
- objects.
- "Young" objects are promoted to "Old" objects after surviving
- next GC.
- "Infant" and "Young" objects are collected if it is not marked
- while minor GC. So that this technique solves this problem.
+Fri Dec 18 21:26:54 2015 Naohisa Goto <ngotogenome@gmail.com>
- Representation of generations:
- * Infant: !FL_PROMOTED and !oldgen_bitmap [00]
- * Young : FL_PROMOTED and !oldgen_bitmap [10]
- * Old : FL_PROMOTED and oldgen_bitmap [11]
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): To prevent
+ potential deadlocks, Queue is used to tell update of @timeout_info
+ instead of sleep and wakeup. [Bug #11742] [ruby-dev:49387]
- The macro "RGENGC_THREEGEN" enables/disables this feature, and
- turned off as default because there are several problems.
- (1) Failed sometimes (Heisenbugs).
- (2) Performance down.
- Especially on write barriers. We need to detect Young or Old
- object by oldgen_bitmap. It is slower than checking flags.
+Fri Dec 18 17:24:09 2015 Koichi Sasada <ko1@atdot.net>
- To evaluate this feature on more applications, I commit this patch.
- Reports are very welcome.
+ * compile.c (ibf_load_object_string): use fstring if frozen string.
- This patch includes some refactoring (renaming names, etc).
+Fri Dec 18 16:54:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h: catch up 3gen GC.
+ * ext/stringio/stringio.c (strio_set_encoding): add StringIO's own
+ encoding and separate it from the buffer string to override the
+ encoding of string when reading. [ruby-core:72189] [Bug #11827]
+ note that setting the encoding of its buffer string directly
+ without StringIO#set_encoding may cause unpredictable behavior.
- * .gdbinit: fix to show a prompt "[PROMOTED]" for promoted objects.
+Fri Dec 18 16:50:35 2015 Koichi Sasada <ko1@atdot.net>
-Tue Nov 5 00:05:51 2013 Koichi Sasada <ko1@atdot.net>
+ * compile.c (ibf_load_setup): check tainted string argument.
- * node.h: catch up comments for last commit.
+Fri Dec 18 16:12:13 2015 Koichi Sasada <ko1@atdot.net>
-Tue Nov 5 00:02:00 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_core.h: define USE_LAZY_LOAD if it is not defined.
- * include/ruby/ruby.h: rename FL_OLDGEN to FL_PROMOTED.
- This flag represents that "this object is promoted at least once."
+Fri Dec 18 15:40:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c, debug.c, object.c: catch up this change.
+ * ext/stringio/stringio.c (strio_unget_bytes): extract from
+ strio_ungetbyte to share with strio_ungetc.
-Mon Nov 4 22:20:16 2013 Tanaka Akira <akr@fsij.org>
+Fri Dec 18 12:39:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/xmlrpc: Don't use fixed ports: 8070 and 8071.
+ * doc/syntax/*.rdoc: separated modifier at sentence.
+ [ci skip][fix GH-1121] Patch by @clandry94
-Mon Nov 4 15:25:52 2013 Tanaka Akira <akr@fsij.org>
+Fri Dec 18 12:09:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/xmlrpc/webrick_testing.rb (start_server): Initialize the server
- at main thread to fail early.
+ * ext/stringio/stringio.c (strio_ungetbyte): pad with \000 when
+ the current position is after the end.
-Mon Nov 4 10:08:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 18 11:24:48 2015 Shugo Maeda <shugo@ruby-lang.org>
- * eval_intern.h (TH_EXEC_TAG, TH_JUMP_TAG): get rid of undefined
- behavior of setjmp() in rhs of assignment expression.
- [ISO/IEC 9899:1999] 7.13.1.1
+ * vm_method.c (rb_method_entry_make, check_override_opt_method):
+ should check whether a newly created method overrides an optimize
+ method in case the method is defined in a prepended module of a
+ built-in class.
+ [ruby-core:72226] [Bug #11836]
-Sun Nov 3 23:06:51 2013 Tanaka Akira <akr@fsij.org>
+Fri Dec 18 11:09:38 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * sample/test.rb: Make temporary file names unique.
+ * vm.c (vm_exec): call RUBY_DTRACE_CMETHOD_RETURN_HOOK instead of
+ RUBY_DTRACE_METHOD_RETURN_HOOK.
-Sun Nov 3 20:41:17 2013 Tanaka Akira <akr@fsij.org>
+Fri Dec 18 10:24:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/xmlrpc: Wrap definitions by TestXMLRPC module.
+ * lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.
+ [fix GH-1127] Patch by @koic
-Sun Nov 3 20:23:38 2013 Tanaka Akira <akr@fsij.org>
+Fri Dec 18 09:44:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/xmlrpc/webrick_testing.rb (stop_server): Don't try to shutdown
- the server if the server is not started.
+ * ext/pty/pty.c: fix double words typo.
+ [ci skip][fix GH-1157] Patch by @jwworth
-Sun Nov 3 09:35:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 18 09:42:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * load.c (rb_feature_p): deal with default loadable suffixes.
+ * ext/nkf/nkf-utf8/utf8tbl.c: fix a typo.
+ [ci skip][fix GH-1159] Patch by @akshay-vishnoi
+ * ext/nkf/nkf-utf8/utf8tbl.h: ditto.
- * load.c (load_lock): initialize statically linked extensions.
+Fri Dec 18 07:39:01 2015 Shugo Maeda <shugo@ruby-lang.org>
- * load.c (search_required, rb_require_safe): deal with statically
- linked extensions.
+ * vm.c (rb_vm_check_redefinition_opt_method): should check the real
+ class instead of the origin iclass.
+ [ruby-core:72188] [Bug #11826]
- * load.c (ruby_init_ext): defer initialization of statically linked
- extensions until required actually. [Bug #8883]
+Thu Dec 17 22:13:10 2015 Shugo Maeda <shugo@ruby-lang.org>
-Sat Nov 2 15:14:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_args.c (vm_caller_setup_arg_block): remove code for ifunc
+ because it was made unnecessary by r52138.
- * lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log):
- open file can't be removed or renamed on Windows. [ruby-dev:47790]
- [Bug #9046]
+Thu Dec 17 16:13:10 2015 Shugo Maeda <shugo@ruby-lang.org>
- * test/logger/test_logger.rb (TestLogDevice#run_children): don't use
- fork.
+ * proc.c (rb_block_arity): should not call GetProcPtr() for symbols.
+ [ruby-core:72205] [Bug #11830]
-Sat Nov 2 07:08:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 17 14:16:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/logger.rb: Inter-process locking for log rotation
- Current implementation fails log rotation on multi process env.
- by sonots <sonots@gmail.com>
- https://github.com/ruby/ruby/pull/428 fix GH-428 [Bug #9046]
+ * string.c (rb_str_scrub): the result should be infected by the
+ original string.
-Fri Nov 1 23:24:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 17 13:35:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (wmap_mark_map): mark live objects only, but delete zombies.
- [ruby-dev:47787] [Bug #9069]
+ * transcode.c (rb_econv_substr_append, econv_primitive_convert):
+ the result should be infected by the original string.
-Fri Nov 1 22:45:54 2013 Masaya Tarui <tarui@ruby-lang.org>
+Thu Dec 17 09:46:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (struct heap_page, gc_page_sweep, gc_sweep): Refactoring for
- performance. Add before_sweep condition to heap_page structure.
+ * re.c (reg_names_iter): should consider encoding of regexp.
+ [ruby-core:72185] [Bug #11825]
- * gc.c (rb_gc_force_recycle): Use before_sweep member.
+Thu Dec 17 03:52:10 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (heap_is_before_sweep, is_before_sweep): Remove. They have not
- already been used.
+ * vm.c (vm_make_env_each): should not compare with Qfalse and FALSE.
+ Pointed at http://d.hatena.ne.jp/nagachika/20151216/ruby_trunk_changes_53128_53163
-Fri Nov 1 22:20:28 2013 Masaya Tarui <tarui@ruby-lang.org>
+Thu Dec 17 03:15:25 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (make_deferred): Refactoring. Collect codes which should be
- atomic.
+ * vm_insnhelper.c (vm_call_method_each_type): should not set fastpath
+ with keyword arguments for VM_METHOD_TYPE_ATTRSET type methods.
- * gc.c (make_io_deferred, obj_free, rb_objspace_call_finalizer,
- gc_page_sweep): Correspond to the above.
+ Normally, we can not use keyword arguments for this kind of methods,
+ (obj.foo = 1), but we can set alias names for them.
+ [Bug #11657]
-Fri Nov 1 21:40:35 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * test/ruby/test_keyword.rb: add a test for this fix.
- * gc.c (typedef struct rb_objspace): Refactoring. Move some members
- into profile member.
+Wed Dec 16 20:32:43 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * gc.c (newobj_of): Correspond to the above.
+ * ext/fiddle/handle.c: check tainted string arguments.
+ Patch provided by tenderlove and nobu.
- * gc.c (finalize_list): Ditto.
+ * test/fiddle/test_handle.rb (class TestHandle): add test for above.
- * gc.c (objspace_live_num): Ditto.
- * gc.c (gc_page_sweep): Ditto.
+Wed Dec 16 19:30:56 2015 Shugo Maeda <shugo@ruby-lang.org>
- * gc.c (rb_gc_force_recycle): Ditto.
+ * vm.c (vm_make_proc_from_block): should convert a Symbol to a Proc.
+ [ruby-core:72083] [Bug #11811]
- * gc.c (garbage_collect_body): Ditto.
+Wed Dec 16 16:17:34 2015 Eric Wong <e@80x24.org>
- * gc.c (rb_gc_count): Ditto.
+ * test/ruby/test_io.rb: fix spelling errors
- * gc.c (gc_stat): Ditto.
+Wed Dec 16 16:04:49 2015 Eric Wong <e@80x24.org>
- * gc.c (gc_prof_set_heap_info): Ditto.
+ * NEWS: note IO#advise change [ruby-core:72168]
- * gc.c (gc_profile_dump_on): Ditto.
+Wed Dec 16 15:35:13 2015 Koichi Sasada <ko1@atdot.net>
-Fri Nov 1 20:53:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c: fix mark miss for proc given as passed block.
+ [Bug #11750]
- * string.c (rb_str_scrub): fix typo, should yield invalid byte
- sequence to be scrubbed. reported by znz at IRC.
+ * vm.c (vm_make_proc_from_block): should return a Proc object
+ if block is given. Previous implementation returns
+ a Proc object only when corresponding Proc object is not
+ available.
-Fri Nov 1 17:25:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (vm_make_env_each): ditto.
- * gc.c (is_live_object): finalizer may not run because of lazy-sweep.
- [ruby-dev:47786] [Bug #9069]
+ * test/ruby/test_proc.rb: add a test for this bug.
-Fri Nov 1 16:55:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 16 12:24:59 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * string.c (rb_str_scrub): export with fixed length arguments, and
- allow nil as replacement string instead of omitting.
+ * test_struct.rb: Test that initialize is overridable [#11708]
-Fri Nov 1 06:20:44 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Dec 16 10:49:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (rb_mutex_struct): reduce rb_mutex_t size by 8 bytes
- on 64bit platform. Patch by Eric Wong. [Feature #9068][ruby-core:58114]
+ * parse.y (block_command, block_call): fix `&.` calls after
+ block_call. [Feature #11537]
-Fri Nov 1 01:08:33 2013 Koichi Sasada <ko1@atdot.net>
+Wed Dec 16 00:53:45 2015 Naohisa Goto <ngotogenome@gmail.com>
- * benchmark/gc/gcbench.rb: print HWM (high water mark) if possible.
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): Acquire
+ TimeoutMutex only when accessing @timeout_info for avoiding
+ potential deadlock. [Bug #11742] [ruby-dev:49387]
-Thu Oct 31 21:48:31 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 16 00:39:27 2015 Jake Worth <jakeworth82@gmail.com>
- * lib/rexml/parsers/streamparser.rb: Add dependency file require.
- [Bug #9062] [ruby-dev:47779]
- Reported by Ippei Obayashi. Thanks!!!
+ * doc/extension.rdoc: [DOC] fix double-word typo. [Fix GH-1153]
-Thu Oct 31 14:09:32 2013 Koichi Sasada <ko1@atdot.net>
+Wed Dec 16 00:25:41 2015 Naohisa Goto <ngotogenome@gmail.com>
- * vm_method.c (rb_method_entry_make): fix to pass an ISeq value.
- OBJ_WRITTEN() accepts only VALUE.
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
+ TimeoutMutex should be acquired when accessing @timeout_info.
+ To avoid deadlock, interrupt() calls are delayed.
+ Due to the mutex, it is safe to treat ary without ary.dup.
+ [Bug #11742] [ruby-dev:49387]
-Wed Oct 30 19:07:57 2013 Akinori MUSHA <knu@iDaemons.org>
+Tue Dec 15 23:13:10 2015 Naohisa Goto <ngotogenome@gmail.com>
- * misc/ruby-additional.el (ruby-brace-to-do-end)
- (ruby-do-end-to-brace, ruby-toggle-block): Remove functions that
- are already in the latest released version of Emacs (24.3).
- [Bug #7565]
+ * gc.c: Delete excess semicolon after RUBY_ALIAS_FUNCTION().
+ Suppress "syntax error: empty declaration" warnings by
+ Oracle Solaris Studio 12.x on Solaris. [Bug #11821]
-Wed Oct 30 12:44:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c: ditto, after NOINSERT_UPDATE_CALLBACK().
- * win32/Makefile.sub (config.status): add missing variables,
- PLATFORM_DIR and THREAD_MODEL.
+Tue Dec 15 18:04:04 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-Wed Oct 30 12:20:32 2013 Tanaka Akira <akr@fsij.org>
+ * NEWS: added news about EBCDIC encoding
- * time.c (v2w): Normalize a rational value to an integer if possible.
- [ruby-core:58070] [Bug #9059] reported by Isaac Schwabacher.
+Tue Dec 15 17:57:57 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-Wed Oct 30 12:08:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * enc/ebcdic.h, enc/trans/ebcdic.trans,
+ test/ruby/test_transcode.rb: Fixed encoding name
+ to the correct one in the IANA registry (IBM037)
+ and added an alias (ebcdic-cp-us)
- * array.c (rb_ary_uniq_bang): use rb_ary_modify_check() instead of
- rb_ary_modify() because the array will be unshared soon.
+Tue Dec 15 16:19:26 2015 Takashi Kokubun <takashikkbn@gmail.com>
-Wed Oct 30 03:25:10 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/erb.rb: Render erb with array buffer for function call optimization.
+ [fix GH-1143]
+ * lib/rdoc/erb_partial.rb: ditto.
+ * template/verconf.h.tmpl: ditto.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: make less garbage when
- testing if a string is binary.
+Tue Dec 15 13:50:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 30 03:08:24 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * string.c (rb_str_oct): [DOC] mention radix indicators.
+ [ruby-core:71310] [Bug #11648]
- * ext/psych/lib/psych/visitors/yaml_tree.rb: string subclasses should
- not be considered to be binary. Fixes Psych / GH 166
- https://github.com/tenderlove/psych/issues/166
+Tue Dec 15 12:20:30 2015 Takashi Kokubun <takashikkbn@gmail.com>
- * test/psych/test_string.rb: test for fix
+ * lib/erb.rb: Simplify regexp to optimize erb scanner.
+ [fix GH-1144]
-Tue Oct 29 23:01:18 2013 Masaki Matsushita <glass.saga@gmail.com>
+Tue Dec 15 11:56:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * array.c (rb_ary_zip): some refactoring.
+ * lib/uri/common.rb: make code block for rdoc.
+ [ci skip][fix GH-1152] Patch by @Tonkpils
-Tue Oct 29 22:11:37 2013 Masaki Matsushita <glass.saga@gmail.com>
+Tue Dec 15 11:55:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * array.c (rb_ary_uniq_bang): use st_foreach() instead of for loop.
+ * ext/zlib/zlib.c: fix a typo.
+ [ci skip][fix GH-1149] Patch by @crismali
-Tue Oct 29 20:01:58 2013 Koichi Sasada <ko1@atdot.net>
+Tue Dec 15 09:14:14 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * add RUBY_TYPED_FREE_IMMEDIATELY to data types which only use
- safe functions during garbage collection such as xfree().
+ * tool/transcode_tablegen.rb: detailed documentation
+ for transcode_tblgen function [ci skip]
- On default, T_DATA objects are freed at same points as finalizers.
- This approach protects issues such as reported by [ruby-dev:35578].
- However, freeing T_DATA objects immediately helps heap usage.
+Mon Dec 14 22:11:11 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- Most of T_DATA (in other words, most of dfree functions) are safe.
- However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default
- for safety.
+ * enc/ebcdic.h: new dummy encoding EBCDIC-US
+ * enc/trans/ebcdic.trans: transcodings between EBCDIC-US
+ and iso-8859-1 [with code from Andrea Ribuoli]
+ * test/ruby/test_transcode.rb: tests for above
+ * tool/transcode_tablegen.rb: additional argument for
+ method transcode_tblgen
- * cont.c: ditto.
+Mon Dec 14 17:04:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * dir.c: ditto.
+ * ext/socket/lib/socket.rb: use safe navigation operator.
+ [fix GH-1142] Patch by @mlarraz
+ * lib/drb/extservm.rb: ditto.
+ * lib/net/http.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * lib/scanf.rb: ditto.
+ * lib/uri/generic.rb: ditto.
- * encoding.c: ditto.
+Mon Dec 14 17:03:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * enumerator.c: ditto.
+ * bootstraptest/runner.rb: use safe navigation operator.
+ [fix GH-1142] Patch by @mlarraz
+ * test/openssl/test_pair.rb: ditto.
+ * test/ruby/test_econv.rb: ditto.
+ * test/ruby/test_settracefunc.rb: ditto.
+ * test/thread/test_queue.rb: ditto.
- * error.c: ditto.
+Mon Dec 14 14:33:35 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * file.c: ditto.
+ * lib/xmlrpc.rb: added documentation for parser details.
+ [ci skip][fix GH-1124] Patch by @jrafanie
- * gc.c: ditto.
+Mon Dec 14 11:46:52 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * enum.c: fix a typo in documentation.
+ [ci skip][fix GH-1140] Patch by @jutaz
* io.c: ditto.
-
* iseq.c: ditto.
-
- * marshal.c: ditto.
-
- * parse.y: ditto.
-
- * proc.c: ditto.
-
+ * numeric.c: ditto.
* process.c: ditto.
-
- * random.c: ditto.
-
- * thread.c: ditto.
-
- * time.c: ditto.
-
- * transcode.c: ditto.
-
- * variable.c: ditto.
-
- * vm.c: ditto.
-
- * vm_backtrace.c: ditto.
-
- * vm_trace.c: ditto.
-
- * ext/bigdecimal/bigdecimal.c: ditto.
-
- * ext/objspace/objspace.c: ditto.
-
- * ext/stringio/stringio.c: ditto.
-
- * ext/strscan/strscan.c: ditto.
-
-Tue Oct 29 19:48:33 2013 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: fix typo (FL_WB_PROTECT -> FL_WB_PROTECTED).
-
-Tue Oct 29 18:45:08 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (tp_free): removed because empty free function.
- Use RUBY_TYPED_NEVER_FREE instead.
-
-Tue Oct 29 18:37:33 2013 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: introduce new flags for T_TYPEDDATA.
- * RUBY_TYPED_FREE_IMMEDIATELY: free the data given by DATA_PTR()
- with dfree function immediately. Otherwise (default), the data
- freed at finalization point.
- * RUBY_TYPED_WB_PROTECTED: make this object with FL_WB_PROTECT
- (not shady).
-
- * gc.c (obj_free): support RUBY_TYPED_FREE_IMMEDIATELY.
-
-Tue Oct 29 16:49:03 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (vm_malloc_increase): decrease it more carefully.
-
-Tue Oct 29 16:24:52 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (heap_page_resurrect): return a page in tomb heap even if
- freelist is NULL.
-
-Tue Oct 29 15:46:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby_atomic.h (ATOMIC_SIZE_CAS): new macro, compare and swap size_t.
-
-Tue Oct 29 12:08:05 2013 Tanaka Akira <akr@fsij.org>
-
- * ext/readline/readline.c (readline_getc): Consider
- NULL as input.
-
-Tue Oct 29 11:10:08 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c (gc_profile_total_time): fix off-by-one error in
- GC::Profiler.total_time.
- * test/ruby/test_gc.rb (class TestGc): test for above.
-
-Tue Oct 29 09:53:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: split
- ruby_vm_global_state_version into two separate counters - one for the
- global method state and one for the global constant state. This means
- changes to constants do not affect method caches, and changes to
- methods do not affect constant caches. In particular, this means
- inclusions of modules containing constants no longer globally
- invalidate the method cache.
-
- * class.c, eval.c, include/ruby/intern.h, insns.def, vm.c, vm_method.c:
- rename rb_clear_cache_by_class to rb_clear_method_cache_by_class
-
- * class.c, include/ruby/intern.h, variable.c, vm_method.c: add
- rb_clear_constant_cache
-
- * compile.c, vm_core.h, vm_insnhelper.c: rename vmstat field in
- rb_call_info_struct to method_state
-
- * vm_method.c: rename vmstat field in struct cache_entry to method_state
-
-Mon Oct 28 23:26:04 2013 Tanaka Akira <akr@fsij.org>
-
- * test/readline/test_readline.rb (teardown): Clear Readline.input and
- Readline.output.
-
-Mon Oct 28 21:35:31 2013 Tanaka Akira <akr@fsij.org>
-
- * ext/-test-/file/depend, ext/-test-/postponed_job/depend,
- ext/-test-/tracepoint/depend: New files for dependencies.
-
-Mon Oct 28 15:32:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/depend (ossl.o): work around of dependency of
- thread_native.h, which depends on headers by THREAD_MODEL.
- [ruby-dev:47777]
-
- * ext/openssl/extconf.rb: need THREAD_MODEL.
-
-Mon Oct 28 14:57:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (ruby_init_ext): share feature names between frame name and
- provided features.
-
-Mon Oct 28 14:41:27 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el: Import ruby-electric.el 2.1 from
- https://github.com/knu/ruby-electric.el.
-
- * Hitting the newline-and-indent key within a comment fires
- comment-indent-new-line.
-
- * Introduce a new feature
- `ruby-electric-autoindent-on-closing-char`.
-
- * Fix fallback behavior of ruby-electric-space/return that
- caused error with auto-complete.
-
-Mon Oct 28 13:17:17 2013 Or Cohen <orc@fewbytes.com>
-
- * error.c (name_err_to_s): remove no longer needed overriding, since
- r30455 which made exc_to_s almost same. Fixes [GH-413].
-
-Mon Oct 28 12:42:11 2013 Tanaka Akira <akr@fsij.org>
-
- * common.mk, ext/objspace/depend, ext/coverage/depend,
- ext/-test-/debug/depend, ext/date/depend: Update dependencies.
-
-Mon Oct 28 09:29:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * vm.c: vm_clear_all_cache is not necessary now we use a 64 bit counter
- for global state version.
-
- * vm_insnhelper.h: ruby_vm_global_state_version overflow is unnecessary
-
-Mon Oct 28 07:47:32 2013 Aman Gupta <ruby@tmm1.net>
-
- * vm_backtrace.c (rb_profile_frame_classpath): do not use rb_inspect
- directly, since it might have a custom implementation or show ivars.
-
-Mon Oct 28 04:10:41 2013 Aman Gupta <ruby@tmm1.net>
-
- * vm_backtrace.c (rb_profile_frame_classpath): handle singleton
- methods defined directly on an object.
- * test/-ext-/debug/test_profile_frames.rb: test for above.
-
-Mon Oct 28 00:52:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * struct.c (new_struct): fix warning message, class name and encoding.
-
-Sun Oct 27 20:53:08 2013 Tanaka Akira <akr@fsij.org>
-
- * ext/readline/readline.c: Include ruby/thread.h for
- rb_thread_call_without_gvl2.
- (readline_rl_instream, readline_rl_outstream): Record FILE
- structures allocated by this extension.
- (getc_body): New function extracted from readline_getc.
- (getc_func): New function.
- (readline_getc): Use rb_thread_call_without_gvl2 to invoke getc_func.
- [ruby-dev:47033] [Bug #8749]
- (clear_rl_instream, clear_rl_outstream): Close FILE structure
- allocated by this extension reliably. [ruby-core:57951] [Bug #9040]
- (readline_readline): Use clear_rl_instream and clear_rl_outstream.
- (readline_s_set_input): Set readline_rl_instream.
- (readline_s_set_output): Set readline_rl_outstream.
- (Init_readline): Don't call readline_s_set_input because
- readline_getc doesn't block other threads for any FILE structure now.
-
- [ruby-dev:47033] [Bug #8749] reported by Nobuhiro IMAI.
- [ruby-core:57951] [Bug #9040] reported by Eamonn Webster.
-
-Sat Oct 26 19:31:28 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * gc.c: catch up recent changes to compile on GC_DEBUG,
- RGENGC_CHECK_MODE.
-
-Sat Oct 26 19:08:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (range_initialize_copy): disallow to modify after
- initialized.
-
-Sat Oct 26 17:48:54 2013 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (meta_add_field): : Re-implemented.
- [ruby-core:58017] [Bug #9051] patch by Eamonn Webster.
-
-Sat Oct 26 14:35:09 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_profile_dump_on): use "Page" terminology.
-
-Sat Oct 26 13:25:45 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_sweep, gc_heap_lazy_sweep): fix measurement code.
- We only need one sweep time measurement without lazy sweep.
-
-Sat Oct 26 11:59:13 2013 Tanaka Akira <akr@fsij.org>
-
- * addr2line.c: Include ELF header after system headers (especially
- sys/types.h) to avoid compilation failure,
- "usr/include/sh3/elf_machdep.h:4:2: error: #error Define _BYTE_ORDER!",
- on NetBSD/sh3 (dreamcast, hpcsh, landisk, mmeye).
-
-Sat Oct 26 11:35:22 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: tuning parameters.
-
- * gc.c (GC_MALLOC_LIMIT): change default value to 16MB.
-
- * gc.c (GC_MALLOC_LIMIT_GROWTH_FACTOR): change default value to 2.0.
-
- * gc.c (gc_before_sweep): change decrease ratio of `malloc_limit'
- from 1/4 to 1/10.
-
-Sat Oct 26 11:30:07 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (vm_malloc_increase): do gc_rest_sweep() before GC.
- gc_rest_sweep() can reduce malloc_increase, so try it before GC.
- Otherwise, malloc_increase can be less than malloc_limit at
- gc_before_sweep(). This means that re-calculation of malloc_limit
- may be wrong value.
-
-Sat Oct 26 06:35:41 2013 Masaya Tarui <tarui@ruby-lang.org>
-
- * gc.c (gc_before_heap_sweep): Restructure code to mean clearly.
- heap->freelist is connected to end of list.
-
-Sat Oct 26 04:01:35 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_before_heap_sweep): fix freelist management.
- After rb_gc_force_recycle() for a object belonging to heap->freelist,
- `heap->using_page->freelist' is not null.
-
-Thu Oct 24 21:57:24 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * parse.y: Remove +(binary) and -(binary) special cases
- [Feature #9048]
-
-Thu Oct 24 12:45:53 2013 Zachary Scott <e@zzak.io>
-
- * object.c: [DOC] Document first argument also takes string for:
-
- rb_mod_const_get, rb_mod_const_set, rb_mod_const_defined
-
- Also added note about NameError exception for invalid constant name
-
-Thu Oct 24 12:23:58 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * thread.c (rb_thread_terminate_all): add a comment why we need
- state check and call terminate_i again.
-
-Thu Oct 24 12:15:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * thread.c (rb_thread_terminate_all): add a comment why infinite
- sleep is safe.
-
-Thu Oct 24 07:41:42 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c: add new initial_growth_max tuning parameter.
- [ruby-core:57928] [Bug #9035]
- * gc.c (heap_set_increment): when initial_growth_max is set,
- do not grow number of slots by more than growth_max at a time.
- * gc.c (rb_gc_set_params): load optional new tuning value from
- RUBY_HEAP_SLOTS_GROWTH_MAX environment variable.
- * test/ruby/test_gc.rb (class TestGc): test for above.
-
-Thu Oct 24 01:34:12 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/win32.h (rb_infinity_float): suppress overflow in
- constant arithmetic warnings. [ruby-core:57981] [Bug #9044]
-
-Thu Oct 24 00:11:24 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/ostruct.rb: raise NoMethodError with a #name and #args.
- Raise RuntimeError when modifying frozen instances
- instead of TypeError.
- (OpenStruct#each_pair): Return an enumerator with size
- (OpenStruct#delete): Use the converted argument.
- Patches by Kenichi Kamiya. [Fixes GH-383]
-
- * test/ostruct/test_ostruct.rb: Added tests for above.
-
-Thu Oct 24 00:10:22 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * array.c: Add Array#to_h [Feature #7292]
-
- * enum.c: Add Enumerable#to_h
-
-Wed Oct 23 23:48:28 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c: Rename free_min to min_free_slots and free_min_page to
- max_free_slots. The algorithm for heap growth is:
- if (swept_slots < min_free_slots) pages++
- if (swept_slots > max_free_slots) pages--
-
-Wed Oct 23 22:51:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): VC 2013 supports C99 mathematics
- functions. [ruby-core:57981] [Bug #9044]
-
-Wed Oct 23 19:13:18 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: move increment from heap to heap_pages.
- Share `increment' information with heaps.
-
- * gc.c: change ratio of heap_pages_free_min_page
- to 0.80.
- This change means slow down page freeing speed.
-
-Wed Oct 23 17:52:03 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (heap_pages_free_unused_pages): cast to (int) for size_t
- variable `i'.
-
-Wed Oct 23 17:39:35 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: introduce tomb heap.
- Tomb heap is where zombie objects and ghost (freed slot) lived in.
- Separate from other heaps (now there is only eden heap) at sweeping
- helps freeing pages more efficiently.
- Before this patch, even if there is an empty page at former phase
- of sweeping, we can't free it.
-
- Algorithm:
- (1) Sweeping all pages in a heap and move empty pages from the
- heap to tomb_heap.
- (2) Check all existing pages and free a page
- if all slots of this page are empty and
- there is enough empty slots (checking by swept_num)
-
- To introduce this patch, there are several tuning of GC parameters.
-
-Wed Oct 23 14:20:56 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_prof_sweep_timer_stop): catch up recent changes
- to compile on GC_PROFILE_MORE_DETAIL=1.
-
-Wed Oct 23 11:43:27 2013 Zachary Scott <e@zzak.io>
-
- * file.c: [DOC] fix rdoc format of File#expand_path from r43386
-
-Tue Oct 22 21:58:28 2013 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * vm_core.h (enum): avoid syntax error.
-
- * method.h: ditto.
-
- * internal.h: ditto.
-
-Tue Oct 22 19:53:16 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (Init_heap): move logics from heap_pages_init() and remove
- heap_pages_init().
-
-Tue Oct 22 19:19:05 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: allow multiple heaps.
- Now, objects are managed by page. And a set of pages is called heap.
- This commit supports multiple heaps in the object space.
-
- * Functions heap_* and rb_heap_t manages heap data structure.
- * Functions heap_page_* and struct heap_page manage page data
- structure.
- * Functions heap_pages_* and struct rb_objspace_t::heap_pages
- maintains all pages.
- For example, pages are allocated from the heap_pages.
-
- See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/GC_design
- and https://bugs.ruby-lang.org/attachments/4015/data-heap_structure_with_multiple_heaps.png
- for more details.
-
- Now, there is only one heap called `eden', which is a space for all
- new generated objects.
-
-Tue Oct 22 18:26:12 2013 Tanaka Akira <akr@fsij.org>
-
- * lib/pp.rb (object_address_group): Use Kernel#to_s to obtain the class
- name and object address.
- This fix a problem caused by %p in C generates variable length
- address.
- Reported by ko1 via IRC.
-
-Tue Oct 22 16:57:48 2013 Benoit Daloze <eregontp@gmail.com>
-
- * file.c (File#expand_path): [DOC] improve documentation of File#expand_path.
- Based on patch by Prathamesh Sonpatki. [ruby-core:57734] [Bug #9002]
-
-Tue Oct 22 15:59:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): don't skip current directories if FNM_DOTMATCH
- is given. [ruby-core:53108] [Bug #8006]
-
-Tue Oct 22 14:53:11 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c: exterminate Zombies.
- There is a bug that T_ZOMBIE objects are not collected.
- Because there is a pass to miss finalizer postponed job
- with multi-threading. This patch solve this issue.
-
- * vm_trace.c (rb_postponed_job_register_one): set
- RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) if another same job
- is registered.
- There is a possibility to remain a postponed job without
- interrupt flag.
-
- * vm_trace.c (rb_postponed_job_register_one): check interrupt
- carefully.
-
- * vm_trace.c (rb_postponed_job_register_one): use additional space
- to avoid buffer full.
-
- * gc.c (gc_finalize_deferred_register): check failure.
-
- * thread.c (rb_threadptr_execute_interrupts): check
- `postponed_job_interrupt' immediately. There is a possibility
- to miss this flag.
-
-Tue Oct 22 12:11:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: check if the given CFLAGS and LDFLAGS are working, and
- bail out early if not.
-
-Tue Oct 22 00:06:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_exists_p): warn deprecated name. [Bug #9041]
-
-Mon Oct 21 23:57:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (load_encoding): should preserve outer errinfo, so that
- expected exception may not be lost. [ruby-core:57949] [Bug #9038]
-
-Sun Oct 20 15:41:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_reopen): create a new, temporary FD via rb_sysopen and
- call rb_cloexec_dup2 on it to atomically replace the file fptr->fd
- points to. This leaves no possible window where fptr->fd is invalid
- to userspace (even for any threads running w/o GVL). based on the
- patch by Eric Wong <normalperson@yhbt.net> at [ruby-core:57943].
- [Bug #9036]
-
-Sun Oct 20 15:29:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_syserr_fail_path_in): new function split from
- rb_sys_fail_path_in to raise SystemCallError without errno.
-
- * internal.h (rb_syserr_fail_path): like rb_sys_fail_path but without
- errno.
-
-Sun Oct 20 13:58:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_obj_wb_unprotect, rb_obj_written),
- (rb_obj_write): suppress unused-parameter warnings.
-
-Sun Oct 20 10:32:48 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update RubyGems to master 0886307. This commit
- improves documentation and should bring ruby above 75% documented on
- rubyci.
-
-Sun Oct 20 09:30:56 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master 3de7e0f. Changes:
-
- Only attempt to build extensions for newly-installed gems. This
- prevents compilation attempts at gem activation time for gems that
- already have extensions built.
-
- Fix crash in the dependency resolver for dependencies that cannot be
- resolved.
-
- * test/rubygems: ditto.
-
-Sun Oct 20 05:24:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_class2name): should return real class name, not
- singleton class or iclass.
-
-Sun Oct 20 04:18:48 2013 Aman Gupta <ruby@tmm1.net>
-
- * variable.c (rb_class2name): call rb_tmp_class_path() directly to
- avoid extra rb_str_dup() from rb_class_name().
-
-Sat Oct 19 19:59:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/file.c (code_page): use simple array instead of st_table.
-
- * encoding.c (rb_locale_encindex): defer initialization of win32 code
- page table until encoding db loaded.
-
-Sat Oct 19 08:25:05 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: fix rb_objspace_t.
- * make "struct heap" and move most of variables
- in rb_objspace_t::heap.
- * rename rb_objspace_t::heap::sorted to
- rb_objspace_t::heap_sorted_pages
- and make a macro heap_sorted_pages.
- * rename rb_objspace_t::heap::range to
- rb_objspace_t::heap_range and rename macros
- lomem/himem to heap_lomem/heap_himem.
-
-Sat Oct 19 07:14:40 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master 42543b6. Changes:
-
- Fix `gem update` for gems with multiple platforms.
-
- * test/rubygems: ditto.
-
-Sat Oct 19 06:55:52 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master 0a3814b. Changes:
-
- Fixed extension directory in Gem::Specification#require_paths.
-
- Allow installation of gems when $HOME is nonexistent or unwritable.
-
- Use proper API in InstallCommand.
-
- Improve support for path option in gem dependency files.
-
- Remove warnings.
-
- * test/rubygems: ditto.
-
-Fri Oct 18 15:23:34 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: change terminology of heap.
- Change "slot" to "page". "Slot" is a space of RVALUE.
- 1. "Heap" consists of a set of "heap_page"s (pages).
- 2. Each "heap_page" has "heap_page_body".
- 3. "heap_page_body" has RVALUE (a.k.a. "slot") spaces.
- 4. "sorted" is a sorted array of "heap_page"s, sorted
- by address of heap_page_body (for "is_pointer_to_heap").
-
- See https://bugs.ruby-lang.org/attachments/4008/data-heap_structure.png.
-
-Fri Oct 18 09:40:43 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master cee6788. Changes:
-
- Fix test failure on vc10-x64 Server on rubyci.org due to attempting
- to File.chmod where it is not supported.
-
- Continuing work on improved gem dependencies file (Gemfile) support.
-
- * test: ditto.
-
-Fri Oct 18 06:02:49 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master f738c67. Changes:
-
- Fixed test bug for ruby with ENABLE_SHARED = no
-
- * test/rubygems: ditto.
-
-Fri Oct 18 00:57:07 2013 Tanaka Akira <akr@fsij.org>
-
- * lib/tsort.rb (TSort.tsort): Extracted from TSort#tsort.
- (TSort.tsort_each): Extracted from TSort#tsort_each.
- (TSort.strongly_connected_components): Extracted from
- TSort#strongly_connected_components.
- (TSort.each_strongly_connected_component): Extracted from
- TSort#each_strongly_connected_component.
-
-Thu Oct 17 18:50:08 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (CALC_EXACT_MALLOC_SIZE_CHECK_OLD_SIZE): introduced.
- This macro enable checker compare with allocated memory and
- declared old_size of sized_xfree and sized_xrealloc.
-
-Thu Oct 17 18:45:41 2013 Koichi Sasada <ko1@atdot.net>
-
- * string.c (STR_HEAP_SIZE): includes TERM_LEN(str).
-
- * string.c (rb_str_memsize): use STR_HEAP_SIZE().
-
-Thu Oct 17 17:43:00 2013 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_insnhelper.c (vm_call_method): set ci->me to 0 when the
- original method of a refined method is undef to avoid SEGV.
-
- * vm_method.c (rb_method_entry_without_refinements): return 0 when
- the original method of a refined method is undef to avoid SEGV.
-
- * test/ruby/test_refinement.rb: related test.
-
-Thu Oct 17 17:38:36 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c, internal.h: rename ruby_xsizefree/realloc to
- rb_sized_free/realloc.
-
- * array.c: catch up these changes.
-
* string.c: ditto.
+ * vm_trace.c: ditto.
-Thu Oct 17 17:32:51 2013 Koichi Sasada <ko1@atdot.net>
-
- * array.c, string.c: use ruby_xsizedfree() and ruby_xsizedrealloc().
-
- * internal.h (SIZED_REALLOC_N): define a macro as REALLOC_N().
-
-Thu Oct 17 17:11:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (console_emulator_p): check by comparison between
- module handle of WriteConsoleW and kernel32.dll.
-
- * configure.in, win32/Makefile.sub, win32/setup.mak: no longer need
- psapi.lib.
-
-Thu Oct 17 16:53:30 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c, internal.h: add new internal memory management functions.
- * void *ruby_xsizedrealloc(void *ptr, size_t new_size, size_t old_size)
- * void ruby_xsizedfree(void *x, size_t size)
- These functions accept additional size parameter to calculate more
- accurate malloc_increase parameter which control GC timing.
- [Feature #8985]
-
-Thu Oct 17 14:21:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/file.c (rb_file_expand_path_internal): fix memory leaks at
- a non-absolute home exception.
-
-Thu Oct 17 14:06:39 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/object_tracing.c (newobj_i): fix memory leak.
- There is possibility to remain info due to missing FREEOBJ event.
- FREEOBJ events are skipped while suppress_tracing state, for example,
- during trace events are invoking.
-
-Thu Oct 17 12:30:16 2013 Tanaka Akira <akr@fsij.org>
-
- * lib/tsort.rb (TSort.each_strongly_connected_component_from):
- Extracted from TSort#each_strongly_connected_component_from.
-
-Thu Oct 17 11:07:06 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master 941c21a. Changes:
-
- Restored method bundler wants to remove for compatibility.
-
- Improvements to Gemfile compatibility.
-
- * test/rubygems: ditto.
-
-Thu Oct 17 08:08:11 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/object_tracing.c (newobj_i): add workaround.
- some bugs hits this check.
-
- * ext/objspace/object_tracing.c (object_allocations_reporter_i): cast as pointer.
-
-Thu Oct 17 07:36:53 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master 2abce58. Changes:
-
- Fixed documentation generation when sdoc and json are installed as
- gems.
-
- Added some missing documentation.
-
-Thu Oct 17 07:10:26 2013 Zachary Scott <e@zzak.io>
-
- * ext/curses/curses.c: [DOC] Cleaned up formatting consistency of rdoc
- comments for Curses, including period spacing and column width.
-
- This patch also fixed some typos. Thanks to @postmodern for the patch!
- [Fixes GH-420] https://github.com/ruby/ruby/pull/420
-
-Thu Oct 17 06:58:42 2013 Zachary Scott <e@zzak.io>
-
- * ext/date/date_core.c: [DOC] plural grammar fixed by @scott113341
- Contributed via documenting-ruby.org: documenting-ruby/ruby#16
- https://github.com/documenting-ruby/ruby/pull/16
-
-Thu Oct 17 05:52:31 2013 Zachary Scott <e@zzak.io>
-
- * ext/io/nonblock/nonblock.c: [DOC] Document io/nonblock by reprah
- [Fixes GH-418] https://github.com/ruby/ruby/pull/418 based on the
- original discussion from documenting-ruby/ruby#18
-
-Thu Oct 17 05:40:33 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (objspace_each_objects): do not skip empty RVALUEs.
-
-Thu Oct 17 05:31:31 2013 Koichi Sasada <ko1@atdot.net>
-
- * error.c (rb_bug_reporter_add): return simply 0 if failed.
- Please check return value.
-
-Thu Oct 17 05:17:33 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/object_tracing.c: add new method
- ObjectSpace.trace_object_allocations_debug_start for GC debugging.
- If you encounter the BUG "... is T_NONE" (and so on) on your
- application, please try this method at the beginning of your app.
-
-Wed Oct 16 22:35:27 2013 Zachary Scott <e@zzak.io>
-
- * ext/io/nonblock/nonblock.c: use rb_cIO instead of VALUE
-
-Wed Oct 16 17:45:13 2013 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/runner.rb: check nil before calling `signal?'
- for a process status.
-
-Wed Oct 16 17:37:17 2013 Koichi Sasada <ko1@atdot.net>
-
- * error.c, internal.h (rb_bug_reporter_add): add a new C-API.
- rb_bug_reporter_add() allows to register a function which
- is called at rb_bug() called.
-
- * ext/-test-/bug_reporter/bug_reporter.c: add a test for this C-API.
-
- * ext/-test-/bug_reporter/extconf.rb: ditto.
-
- * test/-ext-/bug_reporter/test_bug_reporter.rb: ditto.
-
-Wed Oct 16 15:14:21 2013 Koichi Sasada <ko1@atdot.net>
-
- * NEWS: add a line into NEWS for last commit.
-
-Wed Oct 16 15:09:14 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c: add a new method `reachable_objects_from_root'.
- ObjectSpace.reachable_objects_from_root returns all objects referred
- from root (called "root objects").
- This feature is for deep object analysis.
-
- * test/objspace/test_objspace.rb: add a test.
-
-Wed Oct 16 15:00:21 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master b955554. Changes:
-
- Fixed NameError for Gem::Ext due to re-entering file lookup in
- RubyGems' overridden require. Bug by Koichi Sasada.
-
- Fixed possible circular require warning in tests.
-
- Used existing constant for `gem install -g` dependency file list.
-
- * test/rubygems: ditto.
-
-Wed Oct 16 09:42:42 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master 278d00d. Changes:
-
- Fixes building extensions without a "clean" make rule
-
- Adds gem dependency file autodetection to "gem install -g"
-
- * test/rubygems: Tests for the above.
-
-Wed Oct 16 09:12:23 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems master commit 2a74263. This fixes
- several bugs in RubyGems 2.2.0.preview.1.
-
- * test/rubygems: ditto.
-
-Wed Oct 16 07:25:02 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c (gc_mark_roots): rename roots to be categories
- instead of function names.
-
-Tue Oct 15 19:18:13 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.h (rb_objspace_reachable_objects_from_root): added.
- This API provides information which objects are root objects.
- `category' shows what kind of root objects.
-
- * gc.c (gc_mark_roots): separate from gc_marks_body().
-
-Tue Oct 15 17:47:59 2013 Tanaka Akira <akr@fsij.org>
-
- * process.c: Fix a typo. MacOS X doesn't have ENOTSUPP.
-
-Mon Oct 14 12:32:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): load statically linked extensions before
- rubygems, because of ext/thread.
-
- * ruby.c (process_options): use gem_prelude instead of requiring
- rubygems directly when --enable=gems is given.
-
- * Makefile.in (DEFAULT_PRELUDES): always use gem_prelude regardless of
- --disable-rubygems.
-
-Mon Oct 14 11:07:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (have_framework): should append framework options to
- $LIBS, not $LDFLAGS. The former is propagated to exts.mk when
- enable-static-linked-ext.
-
- * lib/mkmf.rb (create_makefile): ranlib on static library, not DLLIB.
-
-Sun Oct 13 23:53:40 2013 Andrew Grimm <andrew.j.grimm@gmail.com>
-
- * vsnprintf.c: Fix spelling from compliment to complement.
- Patch by @agrimm.
-
- * include/ruby/ruby.h: ditto
-
-Sun Oct 13 20:59:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (Init_BareVM): initialize defined_module_hash here,
- Init_top_self() is too late to register core classes/modules.
-
- * compile.c (compile_array_): no hash to merge if it is empty.
-
- * vm.c (m_core_hash_merge_kwd): just check keys if only one argument
- is given, without merging.
-
-Sat Oct 12 06:35:01 2013-10-11 Eric Hodel <drbrain@segment7.net>
-
- * lib/rake: Update to rake 10.1.0
- * bin/rake: ditto.
- * test/rake: ditto.
-
- * NEWS: Update NEWS to include rake 10.1.0 and links to release notes.
-
-Sat Oct 12 03:26:04 2013 Koichi Sasada <ko1@atdot.net>
-
- * class.c, variable.c, gc.c (rb_class_tbl): removed.
-
- * vm.c, vm_core.h (rb_vm_add_root_module): added to register as a
- defined root module or class.
- This guard helps mark miss from defined classes/modules they are
- only referred from C's global variables in C-exts.
- Basically, it is extension's bug.
- Register to hash object VM has.
- Marking a hash objects allows generational GC supports.
-
- * gc.c (RGENGC_PRINT_TICK): disable (revert).
-
-Sat Oct 12 03:24:49 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_gc_mark_unlinked_live_method_entries):
- revert last commit to introduce debug prints.
-
-Fri Oct 11 21:05:19 2013 Koichi Sasada <ko1@atdot.net>
-
- * internal.h, parse.y: use `full_mark' instead of `full_marking'.
-
-Fri Oct 11 20:58:16 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: use terminology `full_mark' instead of `minor_gc'
- in mark functions.
-
-Fri Oct 11 20:46:09 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: use __GNUC__ instead of __GCC__.
-
-Fri Oct 11 20:35:59 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c, parse.y: support generational Symbol related marking.
- Each symbols has String objects respectively to represent
- Symbols.
- These objects are marked only when:
- * full marking
- * new symbols are added
- This hack reduce symbols (related strings) marking time.
- For example, on my Linux environment, the following code
- "20_000_000.times{''}"
- with 40k symbols (similar symbol number on Rails 3.2.14 app,
- @jugyo tells me) boosts, from 7.3sec to 4.2sec.
-
- * internal.h: change prototype of rb_gc_mark_symbols().
-
-Fri Oct 11 19:27:22 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el: Import ruby-electric.el 2.0.1 which fixes
- a bug and a flaw with auto-end introduced in the revamp.
-
- * ruby-forward-sexp is inappropriate here because it moves the
- cursor past the keyword.
-
- * Fix a reversed looking-back check in
- ruby-electric--block-beg-keyword-at-point-p.
-
- * Do not add end again if space or return is hit repeatedly
- after a block beginning keyword.
-
-Fri Oct 11 18:12:47 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/gc_hook.c: prohibit reentrant.
-
-Fri Oct 11 18:11:34 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (rb_postponed_job_flush): fix bit operation.
-
-Fri Oct 11 17:33:24 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el: Import ruby-electric.el 2.0 from
- https://github.com/knu/ruby-electric.el which integrates changes
- from another fork by @qoobaa.
-
- * Allow ruby-electric-mode to be disabled by introducing a
- dedicated key map. Electric key bindings are now defined in
- ruby-electric-mode-map instead of overwriting ruby-mode-map.
-
- * Add ruby-electric-mode-hook.
-
- * Use a remap in binding ruby-electric-delete-backward-char.
-
- * Totally revamp electric keywords and then introduce electric
- return. Modifier keywords are now properly detected making
- use of ruby-mode's indentation level calculator, and
-
- * block-mid keywords (then, else, elsif, when, rescue and
- ensure) also become electric with automatic reindentation.
-
- * Add standardized comments for ELPA integration.
-
- * Fix interaction with smartparens-mode by disabling its end
- keyword completion, since ruby-electric has become more clever
- at it.
-
- * The custom variable `ruby-electric-keywords` is changed to
- `ruby-electric-keywords-alist`, allowing user to fine-grained
- configuration.
-
-Fri Oct 11 16:53:28 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (rb_postponed_job_flush): simplify.
-
-Fri Oct 11 03:36:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_threadptr_execute_interrupts): flush postponed job only
- once at last.
-
- * vm_trace.c (rb_postponed_job_flush): defer calling postponed jobs
- registered while flushing to get rid of infinite reentrance of
- ObjectSpace.after_gc_start_hook. [ruby-dev:47400] [Bug #8492]
-
-Thu Oct 10 23:04:00 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * array.c (rb_ary_or): remove unused variables.
-
-Thu Oct 10 23:01:16 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * array.c (rb_ary_or): use rb_hash_keys().
-
-Thu Oct 10 21:36:16 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * array.c (rb_ary_compact_bang): use ary_resize_smaller().
-
-Thu Oct 10 17:25:28 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (vm_exec): support :b_return event for "lambda{return}.call".
- [Bug #8622]
-
- * test/ruby/test_settracefunc.rb: add a test.
-
-Thu Oct 10 13:52:37 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (postponed_job): use preallocated buffer.
- Pre-allocate MAX_POSTPONED_JOB (1024) sized buffer
- and use it.
- If rb_postponed_job_register() cause overflow, simply it
- fails and returns 0.
- And maybe rb_postponed_job_register() is signal safe.
-
- * vm_core.h: change data structure.
-
-Thu Oct 10 11:11:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (Init_VM): hide also the singleton class of frozen-core, not
- only frozen-core itself.
-
-Thu Oct 10 06:02:08 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_rand.rb: fix r43224. local variable `e' is
- no longer available.
-
-Thu Oct 10 00:02:35 2013 Yusuke Endoh <mame@tsg.ne.jp>
-
- * numeric.c (fix_aref): avoid a possible undefined behavior.
- 1L << 63 on 64-bit platform is undefined, at least, according to
- ISO/IEC 9899 (C99) 6.5.7.
-
-Wed Oct 9 23:57:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (id_for_attr): avoid inadvertent symbol creation.
-
-Wed Oct 9 18:03:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (rb_attr): preserve encoding of the attribute ID in
- error message.
-
-Wed Oct 9 17:40:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_fstring): because of lazy sweep, str may be unmarked
- already and swept at next time, so mark it for the time being.
- [ruby-core:57756]
-
-Wed Oct 9 13:53:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compar.c (cmp_eq): fail if recursion. [ruby-core:57736] [Bug #9003]
-
- * thread.c (rb_exec_recursive_paired_outer): new function which is
- combination of paired and outer variants.
-
-Wed Oct 9 09:18:14 2013 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/debug.h,
- vm_backtrace.c (rb_profile_frame_full_label): add new C API
- rb_profile_frame_full_label() which returns label with
- qualified method name.
- Note that in future version of Ruby label() may return
- same return value of full_label().
-
- * ext/-test-/debug/profile_frames.c,
- test/-ext-/debug/test_profile_frames.rb: fix a test for this change.
-
-
-Wed Oct 9 00:55:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (load_lock): display backtrace to $stderr at circular
- require.
-
- * vm_backtrace.c (rb_backtrace_print_to): new function to print
- backtrace to the given output.
-
-Tue Oct 8 21:03:35 2013 Koichi Sasada <ko1@atdot.net>
-
- * vm_backtrace.c, include/ruby/debug.h: add new APIs
- * VALUE rb_profile_frame_method_name(VALUE frame)
- * VALUE rb_profile_frame_qualified_method_name(VALUE frame)
-
- * iseq.c (rb_iseq_klass), internal.h: add new internal function
- rb_iseq_method_name().
-
- * ext/-test-/debug/profile_frames.c (profile_frames),
- test/-ext-/debug/test_profile_frames.rb: add a test.
-
-Tue Oct 8 16:11:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_uniq): use rb_hash_values(), as well as the case no
- block is given.
-
- * internal.h: define rb_hash_values() as internal API.
-
-Tue Oct 8 13:53:21 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * array.c (rb_ary_uniq): use rb_hash_keys().
-
- * internal.h: define rb_hash_keys() as internal API.
-
- * hash.c (rb_hash_keys): ditto.
-
-Tue Oct 8 10:56:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * cont.c: disable FIBER_USE_NATIVE on GNU/Hurd because it doesn't
- support a combination getcontext() and threads. Patch by
- Gabriele Giacone (1o5g4r8o@gmail.com). [Bug #8990][ruby-core:57685]
-
-Tue Oct 8 05:58:12 2013 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.strptime): Time.strptime('0', '%s') returns local
- time Time object as Ruby 2.0 and before.
-
-Tue Oct 8 05:40:37 2013 Eric Hodel <drbrain@segment7.net>
-
- * .travis.yml: Rebuild Travis CI's "ruby-head" version on successful
- build. Patch by Konstantin Haase. [Fixes GH-417]
- https://github.com/ruby/ruby/pull/417
-
-Tue Oct 8 04:28:25 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-mode.el: Use preceding-char/following-char
- (returning 0 at BOF/EOF) instead of char-before/char-after
- (returning nil at BOF/EOF) to avoid error from char-syntax when
- at BOF/EOF.
-
-Tue Oct 8 04:12:45 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-additional.el (ruby-mode-set-encoding): Add a missing
- else clause to unbreak with `cp932`, etc.
-
- * misc/ruby-mode.el (ruby-mode-set-encoding): Ditto.
-
-Tue Oct 8 03:57:34 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-additional.el (ruby-mode-set-encoding): Use
- `default-buffer-file-coding-system` if the :prefer-utf-8
- property is not available.
-
- * misc/ruby-mode.el (ruby-mode-set-encoding): Ditto.
-
- * misc/ruby-additional.el (ruby-encoding-map): Override the
- default value.
-
-Tue Oct 8 03:19:19 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-additional.el (ruby-mode-set-encoding): Add support
- for `prefer-utf-8` which was introduced in Emacs trunk.
-
- * misc/ruby-additional.el (ruby-encoding-map): Add a mapping from
- `japanese-cp932` to `cp932` to fix the problem where saving a
- source file written in Shift_JIS twice would end up having
- `coding: japanese-cp932` which Ruby could not recognize.
-
- * misc/ruby-additional.el (ruby-mode-set-encoding): Add support
- for encodings mapped to nil in `ruby-encoding-map`.
-
- * misc/ruby-additional.el (ruby-encoding-map): Map `us-ascii` and
- `utf-8` to nil by default, meaning they need not be explicitly
- declared in magic comment.
-
- * misc/ruby-additional.el (ruby-encoding-map): Add type
- declaration for better customize UI.
-
- * misc/ruby-mode.el: Ditto for the above.
-
-Tue Oct 8 00:14:53 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-additional.el: Add a standard header and footer,
- including (provide 'ruby-additional).
-
-Mon Oct 7 22:52:45 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el (ruby-electric-space-can-be-expanded-p):
- Return nil to avoid "end" insertion when in smartparens-mode
- that is configured to insert "end" for the same keyword.
-
- * misc/ruby-electric.el (ruby-electric-keywords): New custom
- variable to replace `ruby-electric-simple-keywords-re` with.
-
-Mon Oct 7 22:52:16 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-additional.el: Use preceding-char/following-char
- (returning 0 at BOF/EOF) instead of char-before/char-after
- (returning nil at BOF/EOF) to avoid error from char-syntax when
- at BOF/EOF.
-
-Mon Oct 7 22:45:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c (FIBER_USE_NATIVE): split long conditions.
-
-Mon Oct 7 20:29:31 2013 Zachary Scott <e@zzak.io>
-
- * lib/time.rb: [DOC] typo in Time.rb overview by @srt32 [Fixes GH-416]
- https://github.com/ruby/ruby/pull/416
-
-Mon Oct 7 20:07:20 2013 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.strptime): Use :offset.
- Patch by Felipe Contreras. [ruby-core:57694]
-
-Mon Oct 7 16:47:27 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/-ext-/debug/test_profile_frames.rb: rename class C to
- something long name because one test depends on absence of
- class ::C.
-
-Mon Oct 7 16:33:10 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/-test-/debug/profile_frames.c:
- test/-ext-/debug/test_profile_frames.rb: add a test for new C-APIs.
-
-Mon Oct 7 16:12:36 2013 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/debug.h: add backtrace collecting APIs for profiler.
- * int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
- Collect information of frame information.
-
- * VALUE rb_profile_frame_path(VALUE frame);
- * VALUE rb_profile_frame_absolute_path(VALUE frame);
- * VALUE rb_profile_frame_label(VALUE frame);
- * VALUE rb_profile_frame_base_label(VALUE frame);
- * VALUE rb_profile_frame_first_lineno(VALUE frame);
- * VALUE rb_profile_frame_classpath(VALUE frame);
- * VALUE rb_profile_frame_singleton_method_p(VALUE frame);
- Get information about each frame.
-
- These APIs are designed for profilers, for example, no object allocation,
- and enough information for profilers.
- In this version, this API collects only Ruby level frames.
- This issue will be fixed after Ruby 2.1.
-
- * vm_backtrace.c: implement above APIs.
-
- * iseq.c (rb_iseq_klass): return local_iseq's class.
-
-Mon Oct 7 14:26:01 2013 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: catch up last commit.
- Type of return value of rb_iseq_first_lineno() is now VALUE.
-
- * vm_insnhelper.c (argument_error): ditto.
-
- * vm_method.c (rb_method_entry_make): ditto.
-
-Mon Oct 7 14:07:45 2013 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c, internal.h: change to public (but internal) functions
- * VALUE rb_iseq_path(VALUE iseqval);
- * VALUE rb_iseq_absolute_path(VALUE iseqval);
- * VALUE rb_iseq_label(VALUE iseqval);
- * VALUE rb_iseq_base_label(VALUE iseqval);
- * VALUE rb_iseq_first_lineno(VALUE iseqval);
- And new (temporary) function:
- * VALUE rb_iseq_klass(VALUE iseqval);
-
- * iseq.c. vm_core.h (int rb_iseq_first_lineno): remove
- function `int rb_iseq_first_lineno(const rb_iseq_t *iseq)'.
- Use `VALUE rb_iseq_first_lineno(VALUE iseqval)' instead.
-
- * proc.c. vm_insnhelper.c, vm_method.c: catch up this change.
-
-Sun Oct 6 08:37:39 2013 Zachary Scott <e@zzak.io>
-
- * lib/webrick.rb: [DOC] fix grammar in WEBrick overview [Fixes GH-413]
- Based on patch by @chastell https://github.com/ruby/ruby/pull/413
-
-Sat Oct 5 11:21:01 2013 Aaron Pfeifer <aaron.pfeifer@gmail.com>
-
- * thread.c (terminate_atfork_i): fix locking mutexes not unlocked in
- forks when not tracked in thread. [ruby-core:55102] [Bug #8433]
-
-Fri Oct 4 19:54:09 2013 Zachary Scott <e@zzak.io>
-
- * ext/dbm/dbm.c: [DOC] Fix wrong constant name in DBM by @edward
- [Fixes GH-409] https://github.com/ruby/ruby/pull/409
-
-Fri Oct 4 19:49:42 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c: rename heap.free_num as heap.swept_num to clarify meaning and
- avoid confusion with objspace_free_num().
-
-Fri Oct 4 19:02:01 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c (objspace_free_num): new method for available/free slots on
- heap. [ruby-core:57633] [Bug #8983]
- * gc.c (gc_stat): change heap_free_num definition to use new method.
- * test/ruby/test_gc.rb: test for above.
-
-Fri Oct 4 18:53:42 2013 Aman Gupta <ruby@tmm1.net>
-
- * gc.c: add rb_objspace.limit to keep accurate count of total heap
- slots [ruby-core:57633] [Bug #8983]
-
-Fri Oct 4 09:32:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/csv.rb (CSV.foreach): support enumerator. based on a patch by
- Hanmac (Hans Mackowiak) at [ruby-core:57643]. [ruby-core:57283]
- [Feature #8929]
-
-Thu Oct 3 18:20:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (console_emulator_p, constat_handle): disable built-in
- console colorizing when console-emulator-like DLL is injected.
- [Feature #8201]
-
-Thu Oct 3 18:01:44 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: define gc_profile_record::allocated_size if
- CALC_EXACT_MALLOC_SIZE is true.
-
-Thu Oct 3 13:42:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (yes-test-sample): use RUNRUBY instead of MINIRUBY to set
- runtime library path and run the built ruby. [Bug #8971]
-
-Thu Oct 3 00:17:15 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-additional.el: Properly quote the body. An unquoted
- body given to eval-after-load is evaluated immediately!
-
-Wed Oct 2 21:38:30 2013 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/socket/ifaddr.c (rsock_getifaddrs): fix possible memory leak.
- When a system had no interface, this function used xmalloc for root
- but did not return any reference to it. This patch fixes it by
- immediately returning an empty array if no interface is found.
- Coverity Scan found this bug.
-
-Wed Oct 2 21:37:04 2013 Yusuke Endoh <mame@tsg.ne.jp>
-
- * random.c (make_seed_value): a local array declaration was accessed
- out of scope. Coverity Scan found this bug.
-
-Wed Oct 2 18:52:40 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: relax GC condition due to malloc_limit.
-
- * gc.c (GC_MALLOC_LIMIT_MAX): change default value
- (256MB -> 512MB) and permit zero to ignore max value.
-
- * gc.c (vm_malloc_increase, vm_xrealloc): do not cause GC on realloc.
-
- * gc.c (gc_before_sweep): change debug messages.
-
-Wed Oct 2 16:26:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_close_read): duplex IO should wait its child process
- even after close_read.
-
-Wed Oct 2 15:39:13 2013 NARUSE, Yui <naruse@ruby-lang.org>
-
- * vm_core.h: use __has_attribute() instead of __clang__major__ because
- clang says "Note that marketing version numbers should not be used
- to check for language features, as different vendors use different
- numbering schemes. Instead, use the Feature Checking Macros."
- http://clang.llvm.org/docs/LanguageExtensions.html
-
-Wed Oct 2 14:19:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_close_write): detach tied IO for writing before closing
- to get rid of race condition. [ruby-list:49598]
-
- * io.c (rb_io_close_read): keep fptr in write_io to be discarded, to
- fix freed pointer access when it is in use by other threads, and get
- rid of potential memory/fd leak.
-
-Tue Oct 1 23:44:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * vm_core.h: use __attribute__((unused)) in UNINITIALIZED_VAR on clang
- 4.0+ instead of just on 4.2. Clang has supported the unused attribute
- since before version 4, so this should be safe.
-
-Tue Oct 1 22:03:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile#unlink): finalizer is no longer needed
- after unlinking. patched by by normalperson (Eric Wong) at
- [ruby-core:56521] [Bug #8768]
-
-Tue Oct 1 20:54:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (stat_new_0): constify.
-
- * file.c (rb_stat_new): constify and export. based on a patch by
- Hanmac (Hans Mackowiak) at [ruby-core:53225]. [Feature #8050]
-
-Tue Oct 1 16:03:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (ruby_safe_level_4_warning): needed by extension
- libraries which check safe level 4. [ruby-dev:47517] [Bug #8652]
-
-Mon Sep 30 23:14:36 2013 Zachary Scott <e@zzak.io>
-
- * ext/objspace/objspace.c: [DOC] Cleaned up many rdoc formatting
- issues and several duplicate grammar bugs.
-
-Mon Sep 30 23:01:01 2013 Zachary Scott <e@zzak.io>
-
- * ext/objspace/object_tracing.c: [DOC] Adjust rdoc formatting and fix
- small grammar typo
-
-Mon Sep 30 17:28:39 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/object_tracing.c: [DOC] add some notes for
- ObjectSpace::trace_object_allocations.
-
-Mon Sep 30 16:46:58 2013 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/object_tracing.c: add new 3 methods to control tracing.
- * ObjectSpace::trace_object_allocations_start
- * ObjectSpace::trace_object_allocations_stop
- * ObjectSpace::trace_object_allocations_clear
- And some refactoring.
-
- * test/objspace/test_objspace.rb: add a test for new methods.
-
- * NEWS: add a description for new methods.
-
-Mon Sep 30 11:18:04 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_gc_disable): do rest_sweep() before disable GC.
- This fix may solve a failure of
- TestTracepointObj#test_tracks_objspace_events
- [test/-ext-/tracepoint/test_tracepoint.rb:43].
-
-Mon Sep 30 10:40:20 2013 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_method.c (rb_undef): raise a NameError if the original method
- of a refined method is not defined.
-
- * vm_insnhelper.c (rb_method_entry_eq): added NULL check to avoid SEGV.
-
- * test/ruby/test_refinement.rb: related test.
-
-Sun Sep 29 23:45:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_id_attrset, intern_str): allow junk attrset ID for
- Struct.
-
- * parse.y (rb_id_attrset): fix inconsistency with literals, allow
- ID_ATTRSET and return it itself, but ID_JUNK cannot make ID_ATTRSET.
- and raise a NameError instead of rb_bug() for invalid argument.
-
-Sun Sep 29 18:45:05 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args):
- clear keyword arguments to prevent GC bug which occurs
- while marking VM stack.
- [ruby-dev:47729] [Bug #8964]
-
- * test/ruby/test_keyword.rb: tests for the above.
-
-Sat Sep 28 23:25:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * math.c (math_log, math_log2, math_log10): fix for Bignum argument.
- numbits should be add only when right shifted.
-
-Sat Sep 28 14:30:29 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * test/dl/test_base.rb: {libc, libm} detection now handle GNU/Hurd
- correctly. Patch by Gabriele Giacone (1o5g4r8o@gmail.com).
- [Bug #8937][ruby-core:57311]
- * test/fiddle/helper.rb: ditto.
-
-Sat Sep 28 00:19:41 2013 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/curses/extconf.rb: check the size of chtype.
-
- * ext/curses/curses.c (NUM2CH, CH2NUM): use proper macros for
- the size of chtype.
-
- [ruby-core:56090] [Bug #8659]
-
-Fri Sep 27 18:33:23 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: add two GC tuning environment variables.
- RUBY_GC_MALLOC_LIMIT_MAX and RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR.
- See r43067 for details.
-
- * gc.c (rb_gc_set_params): refactoring. And change verbose notation.
- Mostly duplicated functions get_envparam_int/double is not cool.
- Please rewrite it.
-
- * test/ruby/test_gc.rb: fix a test for this change.
-
-Fri Sep 27 17:44:41 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (GC_MALLOC_LIMIT): 8,000,000 -> 8 * 1,024 * 1,024.
-
-Fri Sep 27 17:19:39 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_before_sweep): cast to size_t to suppress warnings.
-
-Fri Sep 27 17:07:55 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: add some fine-grained profiling codes to tuning marking phase.
- If you enable RGENGC_PRINT_TICK to 1, then profiling results by RDTSC
- (on x86/amd64 environment) are printed at last.
- Thanks Yoshii-san.
-
-Fri Sep 27 16:32:27 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: simplify threshold of GC caused by malloc_increase.
- Now, malloc_limit is increased/decreased by mysterious logic.
- This fix simplify malloc_limit increase/decrease logic such as:
- if (malloc_increase > malloc_limit) /* so many malloc */
- malloc_limit += malloc_limit * (GC_MALLOC_LIMIT_FACTOR-1);
- else
- malloc_limit -= malloc_limit * (GC_MALLOC_LIMIT_FACTOR-1)/4;
- Default value of GC_MALLOC_LIMIT_FACTOR is 1.8.
- malloc_limit is bounded by GC_MALLOC_LIMIT_MAX (256MB by default).
- This logic runs at gc_before_sweep(). So there are no effect from
- caused by lazy sweep. And we can remove malloc_increase2.
-
- * gc.c (HEAP_MIN_SLOTS, FREE_MIN, HEAP_GROWTH_FACTOR): rename to
- GC_HEAP_MIN_SLOTS, GC_FREE_MIN, GC_HEAP_GROWTH_FACTOR respectively.
- Check them by `#ifndef' so you can specify these values outside gc.c.
-
- * gc.c (ruby_gc_params_t): add initial_malloc_limit_factor and
- initial_malloc_limit_max.
-
- * gc.c (vm_malloc_prepare, vm_xrealloc): use vm_malloc_increase to
- add and check malloc_increase.
-
-Fri Sep 27 01:05:00 2013 Zachary Scott <e@zzak.io>
-
- * re.c: [DOC] arguments of Regexp::union receive #to_regexp [Bug #8205]
-
-Fri Sep 27 00:39:27 2013 Zachary Scott <e@zzak.io>
-
- * struct.c: [DOC] grammar of ArgumentError in Struct.new [Bug #8936]
- Patch by Prathamesh Sonpatki
-
-Thu Sep 26 22:11:56 2013 Zachary Scott <e@zzak.io>
-
- * ext/bigdecimal/bigdecimal.c: [DOC] several fixes by @chastell
- This includes fixing the capitalization of Infinity, return value of
- example "BigDecimal.new('NaN') == 0.0", and code style in example.
- [Fixes GH-398] https://github.com/ruby/ruby/pull/398
-
-Thu Sep 26 22:08:11 2013 Zachary Scott <e@zzak.io>
-
- * lib/observer.rb: [DOC] syntax improvement in example by @chastell
- [Fixes GH-400] https://github.com/ruby/ruby/pull/400
-
-Thu Sep 26 22:03:15 2013 Zachary Scott <e@zzak.io>
-
- * ext/digest/digest.c: [DOC] typo in overview by @chastell
- [Fixes GH-399] https://github.com/ruby/ruby/pull/399
-
-Thu Sep 26 22:00:42 2013 Zachary Scott <e@zzak.io>
-
- * ext/openssl/ossl.c: [DOC] typo in example by @zoranzaric
- [Fixes GH-401] https://github.com/ruby/ruby/pull/401
-
-Thu Sep 26 21:07:49 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el (ruby-electric-delete-backward-char): Add
- support for smartparens-mode.
-
- * misc/ruby-electric.el (ruby-electric-cua-replace-region-maybe)
- (ruby-electric-cua-delete-region-maybe): New functions that
- combine `ruby-electric-cua-*-region` with
- `ruby-electric-cua-*-region-p`, using a slightly better way to
- detect if it is in cua-mode.
-
-Thu Sep 26 16:51:00 2013 Shota Fukumori <her@sorah.jp>
-
- * insns.def (opt_regexpmatch2): Check String#=~ hasn't overridden
- before calling rb_reg_match().
-
- * test/ruby/test_string.rb: Test for above.
-
- * vm.c (vm_init_redefined_flag): Add BOP flag for String#=~
-
- [ruby-core:57385] [Bug #8953]
-
-Thu Sep 26 16:43:42 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el: Avoid use of the interactive function
- `self-insert-command` which fires `post-self-insert-hook` and
- `post-command-hook`, to make the ruby-electric commands work
- nicely with those minor modes that make use of them to do
- similar input assistance, such as electric-pair-mode,
- autopair-mode and smartparens-mode.
-
-Thu Sep 26 16:24:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * insns.def (opt_regexpmatch1): check Regexp#=~ is not defined before
- calling rb_reg_match()
-
- * test/ruby/test_regexp.rb: add test
-
- * vm.c (ruby_vm_redefined_flag): change type to short[]
-
- * vm.c (vm_redefinition_check_flag): return REGEXP_REDEFINED_OP_FLAG if
- klass == rb_cRegexp
-
- * vm.c (vm_init_redefined_flag): setup BOP flag for Regexp#=~
-
- * vm_insnhelper.h: add REGEXP_REDEFINED_OP_FLAG
-
- [ruby-core:57385] [Bug #8953]
-
-Thu Sep 26 14:46:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (mark_locations_array): disable AddressSanitizer. based on a
- patch by halfie (Ruby Guy) at [ruby-core:57372].
- [ruby-core:56155] [Bug #8680]
-
-Wed Sep 25 17:41:29 2013 Koichi Sasada <ko1@atdot.net>
-
- * README.EXT, README.EXT.ja: remove description of RARRAY_PTR()
- and add a caution of accessing internal data structure directly.
- Also add a description of rb_ary_store().
- [Bug #8399]
-
-Wed Sep 25 17:12:08 2013 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: rename RARRAY_RAWPTR() to RARRAY_CONST_PTR().
- RARRAY_RAWPTR(ary) returns (const VALUE *) type pointer and
- usecase of this macro is not acquire raw pointer, but acquire
- read-only pointer. So we rename to better name.
- RSTRUCT_RAWPTR() is also renamed to RSTRUCT_CONST_PTR()
- (I expect that nobody use it).
-
- * array.c, compile.c, cont.c, enumerator.c, gc.c, proc.c, random.c,
- string.c, struct.c, thread.c, vm_eval.c, vm_insnhelper.c:
- catch up this change.
-
-Wed Sep 25 16:58:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (rb_float_value, rb_float_new): move inline functions
- from ruby/ruby.h.
-
- * numeric.c (rb_float_value, rb_float_new): define external functions
- for extension libraries.
-
-Wed Sep 25 15:37:02 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/rdoc/test_rdoc_generator_darkfish.rb: add a guard for windows.
-
-Wed Sep 25 09:53:11 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Fix CVE-2013-4363. Miscellaneous minor improvements.
-
- * test/rubygems: Tests for the above.
-
-Tue Sep 24 17:38:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_inspect): get rid of out-of-bound access.
-
- * string.c (rb_str_inspect): when a UTF-16/32 string doesn't have a
- BOM, inspect as a dummy encoding string.
-
-Tue Sep 24 17:15:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/encdb.c (ENC_DUMMY_UNICODE): make BOM-encodings dummy.
-
- * encoding.c (enc_autoload): keep dummy encodings dummy.
-
-Tue Sep 24 16:41:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry#write): data size
- is in bytes, not chars. terminators should be placed automatically.
-
-Tue Sep 24 16:39:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry#each_value): encode
- name.
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry#each_key): ditto.
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry#export_string):
- encode to locale encoding if default internal is not set.
-
-Tue Sep 24 16:35:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumKey):
- size of the name is in WCHARs, not in bytes.
-
-Tue Sep 24 14:07:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * gc.c (free_method_cache_entry_i): unused function
-
- * gc.c (rb_free_mc_table): ditto
-
- * internal.h (method_cache_entry_t): unused struct
-
- * vm_method.c (verify_method_cache): remove unused variable
-
- * vm_method.c (rb_method_entry): ditto
-
-Tue Sep 24 14:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * class.c (class_alloc): remove mc_tbl
-
- * gc.c (obj_free): ditto
-
- * internal.h (struct rb_classext_struct): ditto
-
- * method.h (rb_method_entry): remove ent param
-
- * vm_method.c: restore the global method cache. Per class cache tables
- turned out to be far too slow.
-
- [ruby-core:57289] [Bug #8930]
-
-Tue Sep 24 12:51:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry::API): need
- Constants.
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumValue):
- size of the name is in WCHARs, not in bytes.
-
-Mon Sep 23 22:16:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): Unicode with BOM
- must be based on big endian variants, so that actual encodings would
- work. [ruby-core:57318] [Bug #8940]
-
-Mon Sep 23 12:11:26 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * hash.c (env_each_pair): do not call rb_assoc_new() if
- it isn't needed.
-
-Mon Sep 23 10:42:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_module.rb (TestModule#test_include_toplevel): test
- for top level main.include. based on a part of the patch by
- kyrylo at [GH-395].
-
-Mon Sep 23 05:07:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_ary_cat): move from internal.h, since it
- is described in README.EXT.
-
-Sun Sep 22 20:55:20 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * vm_insnhelper.c (vm_make_proc_with_iseq): fix bug message.
- This is follow up to changes in r42637.
-
-Sun Sep 22 20:35:38 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * ext/-test-/tracepoint/tracepoint.c (Init_tracepoint): prevent from GC.
-
-Sun Sep 22 19:00:28 2013 Benoit Daloze <eregontp@gmail.com>
-
- * benchmark/bm_app_answer.rb: revert r42990, benchmark scripts should
- be self-contained and avoid dependencies, especially such small one.
- See https://github.com/ruby/ruby/pull/393#issuecomment-24861301.
-
-Sat Sep 21 20:11:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_fork_internal): remove cloexec setting on pipes
- created by rb_cloexec_pipe. patch by normalperson (Eric Wong) at
- [ruby-core:56523]. [Bug #8769]
-
-Sat Sep 21 01:04:25 2013 Zachary Scott <e@zzak.io>
-
- * lib/benchmark.rb: [DOC] grammar of Benchmark#bm [Bug #8888]
- Patch by Prathamesh Sonpatki
-
-Sat Sep 21 00:50:02 2013 Zachary Scott <e@zzak.io>
-
- * enumerator.c: [DOC] Enumerator#each arguments documentation [GH-388]
- Patch by @kachick https://github.com/ruby/ruby/pull/388
-
-Sat Sep 21 00:49:16 2013 Zachary Scott <e@zzak.io>
-
- * enum.c: [DOC] Enumerable#to_a accepts arguments [GH-388]
- Patch by @kachick https://github.com/ruby/ruby/pull/388
-
-Sat Sep 21 00:47:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_conv_enc_opts): make sure to scan coderange to get
- rid of unnecessary conversion.
-
-Sat Sep 21 00:21:08 2013 Zachary Scott <e@zzak.io>
-
- * ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer
- Based on a patch by Rafal Lisowski [Bug #8758]
-
-Fri Sep 20 23:54:03 2013 Zachary Scott <e@zzak.io>
-
- * lib/gserver.rb: [DOC] correct gserver.rb license [Bug #8913]
-
-Fri Sep 20 23:48:34 2013 Zachary Scott <e@zzak.io>
-
- * ext/psych/yaml/yaml.h: [DOC] merge upstream typo fix by @GreenGeorge
- https://github.com/tenderlove/psych/pull/161
-
-Fri Sep 20 23:37:40 2013 Zachary Scott <e@zzak.io>
-
- * lib/securerandom.rb: [DOC] SecureRandom.hex length argument
- [Fixes GH-394] Patch by @avdi https://github.com/ruby/ruby/pull/394
-
-Fri Sep 20 23:34:48 2013 Zachary Scott <e@zzak.io>
-
- * benchmark/bm_app_answer.rb: removed duplicate code [Fixes GH-393]
- Patch by @gouravtiwari https://github.com/ruby/ruby/pull/393
-
-Fri Sep 20 23:24:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (btest, btest-ruby, test-knownbug): add $(RUN_OPTS) to
- ruby to be run, so that tests are runnable before making exts.
-
- * common.mk (test-sample): ditto, and use $(MINIRUBY) as rubytest.rb
- does not need extension libraries.
-
- * tool/rubytest.rb: pass $(RUN_OPTS) to testing ruby using --run-opt.
-
-Fri Sep 20 15:01:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (intern_str): sigil only names are junk, at least one
- identifier character is needed. [ruby-dev:47723] [Bug #8928]
-
- * parse.y (rb_enc_symname_type): fix out of bound access.
-
-Fri Sep 20 14:14:32 2013 Tanaka Akira <akr@fsij.org>
-
- * ext/-test-/printf/printf.c (printf_test_call): Fix an end of buffer
- argument.
-
-Thu Sep 19 16:59:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (lambda): adjust position to the beginning of the block.
-
-Thu Sep 19 16:25:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vsnprintf.c (BSD_vfprintf): initialize cp so that size is 0 in the
- commented case. fix an accidental bug at r16716.
-
-Thu Sep 19 14:33:14 2013 Koichi Sasada <ko1@atdot.net>
-
- * NEWS: add a news for r42974.
-
-Thu Sep 19 14:12:02 2013 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: make Symbol objects frozen.
- [Feature #8906]
- I want to freeze this good day, too.
-
- * test/ruby/test_eval.rb: catch up this change.
-
- * test/ruby/test_symbol.rb: add a test to check frozen symbols.
-
-Thu Sep 19 09:11:33 2013 Eric Hodel <drbrain@segment7.net>
-
- * NEWS: Update for RDoc 4.1.0.preview.1 and RubyGems 2.2.0.preview.1
-
-Thu Sep 19 08:59:41 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/markdown/literals_1_9.rb: Fix trailing whitespace.
-
- Previously kpeg (which generates this file) added trailing
- whitespace, but this bug is now fixed.
-
- * lib/rdoc/markdown.rb: ditto.
-
-Thu Sep 19 08:33:14 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc: Update to RDoc 4.1.0.preview.1
-
- RDoc 4.1.0 contains a number of enhancements including a new default
- style and accessibility support. You can see the changelog here:
-
- https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc
-
- * test/rdoc: ditto.
-
-Thu Sep 19 07:16:26 2013 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych.rb: updating Psych version
-
- * ext/psych/psych.gemspec: ditto
-
-Thu Sep 19 06:39:40 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems/dependency_resolver.rb: Switch the iterative resolver
- algorithm from recursive to iterative to avoid possible
- SystemStackError.
-
-Thu Sep 19 06:29:30 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems 2.2.0.preview.1
-
- This brings several new features to RubyGems summarized here:
-
- https://github.com/rubygems/rubygems/blob/v2.2.0.preview.1/History.txt
-
- * test/rubygems: ditto.
-
-Wed Sep 18 23:14:58 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * string.c (rb_str_enumerate_lines): make String#each_line and
- #lines not raise invalid byte sequence error when it is called
- with an argument. The patch also causes performance improvement.
- [ruby-dev:47549] [Bug #8698]
-
- * test/ruby/test_m17n_comb.rb (test_str_each_line): remove
- assertions which check that String#each_line and #lines will
- raise an error if the receiver includes invalid byte sequence.
-
-Wed Sep 18 16:32:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (mnew_from_me): allocate structs after allocated wrapper
- object successfully, to get rid of potential memory leak.
-
-Tue Sep 17 15:54:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/shell/command-processor.rb (Shell::CommandProcessor#find_system_command):
- return executable file only, should ignore directories and
- unexecutable files. [ruby-core:57235] [Bug #8918]
-
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert_throw):
- assertion for throw. MiniTest::Assertions#assert_throws discards
- the caught value.
-
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert_nothing_thrown):
- returns the result of the given block.
-
-Tue Sep 17 12:55:58 2013 Eric Hodel <drbrain@segment7.net>
-
- * doc/regexp.rdoc: [DOC] Replace paragraphs in verbatim sections with
- plain paragraphs to improve readability as ri and HTML.
-
-Mon Sep 16 07:32:35 2013 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: removed meaningless lines.
- * rational.c: ditto.
-
-Mon Sep 16 00:44:23 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * ext/socket/mkconstants.rb: define MSG_FASTOPEN.
- [ruby-core:57138] [Feature #8897]
-
-Sun Sep 15 13:31:23 2013 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_div): reverted r28844, r28886 and r28887.
- REASON: Nobuyoshi Nakada <nobu@ruby-lang.org>'s commits are buggy.
- So Rational#/ may produce exact number with inexact number.
- Moreover, without reducing.
- REALLY NONSENSE COMMITS.
- A bug report by me [ruby-dev:44710] is also caused by this behavior.
- Kenta Murata <mrkn@mrkn.jp> patched it up.
- But he did not fix the origin.
- Today, the bug is still alive in ruby 1.9.3 and 2.0.0.
-
-Sat Sep 14 06:08:10 2013 Eric Hodel <drbrain@segment7.net>
-
- * dir.c (dir_s_glob): [DOC] Improve wording and layout.
-
- * dir.c (file_s_fnmatch): ditto.
-
- * dir.c (Init_Dir): [DOC] Document File::Constants::FNM_XXX
- constants. (These won't show up in RDoc until a new RDoc is
- imported.)
-
-Thu Sep 12 14:58:58 2013 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/uri/generic.rb (URI::Generic.find_proxy): return nil if
- http_proxy environment variable is empty string.
- [ruby-core:57140] [Bug #8898]
-
-Fri Sep 13 10:40:28 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems 2.1.3
-
- Fixed installing platform gems
-
- Restored concurrent requires
-
- Fixed installing gems with extensions with --install-dir
-
- Fixed `gem fetch -v` to install the latest version
-
- Fixed installing gems with "./" in their files entries
-
- * test/rubygems/test_gem_package.rb: Tests for the above.
-
- * NEWS: Updated for RubyGems 2.1.3
-
-Thu Sep 12 22:40:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SIGNEDNESS): macro to check signedness of a
- type.
-
- * configure.in (size_t): must be unsigned.
- [ruby-core:57149] [Feature #8890]
-
-Thu Sep 12 22:37:08 2013 Anton Ovchinnikov <revolver112@gmail.com>
-
- * ext/bigdecimal/bigdecimal.c, ext/digest/md5/md5.c,
- ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c:
- Eliminate less-than-zero checks for unsigned variables.
- According to section 4.1.5 of C89 standard, size_t is an unsigned
- type. These checks were found with 'cppcheck' static analysis tool.
- [ruby-core:57117] [Feature #8890]
-
-Thu Sep 12 21:35:46 2013 Naohisa Goto <ngotogenome@gmail.com>
-
- * Makefile.in (libruby-static.a): change LDFLAGS order. LDFLAGS may
- include library path that should be specified before LIBS.
- [ruby-dev:47707] [Bug #8901]
-
-Thu Sep 12 20:07:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vsnprintf.c (MAXEXP, MAXFRACT): calculate depending on constants in
- float.h.
-
- * vsnprintf.c (BSD_vfprintf): limit length for cvt() to get rid of
- buffer overflow. [ruby-core:57023] [Bug #8864]
-
- * vsnprintf.c (exponent): make expbuf size more precise.
-
-Wed Sep 11 17:30:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUNRUBY): append -- only after runruby.rb, not
- cross-compiling baseruby, so that $(RUN_OPT) can be command line
- options. [ruby-dev:47703] [Bug #8893]
-
-Wed Sep 11 07:55:17 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * thread.c (rb_mutex_unlock): Mutex#unlock no longer raise
- an exception even if uses on trap. [Bug #8891]
-
-Tue Sep 10 14:37:01 2013 Shota Fukumori <sorah@tubusu.net>
-
- * vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument if
- it is nil. [Bug #8884] [ruby-core:57094]
-
- * test/ruby/test_backtrace.rb (test_caller_with_nil_length):
- Test for above.
-
-Tue Sep 10 12:39:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c (method_entry_i): should exclude refined methods from
- instance method list. [ruby-core:57080] [Bug #8881]
-
-Tue Sep 10 12:05:04 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * io.c (rb_f_printf): [DOC] add missing parenthesis in rdoc.
-
-Tue Sep 10 10:08:00 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: Update RubyGems note.
-
-Tue Sep 10 09:51:22 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems 2.1.0. Fixes CVE-2013-4287.
-
- See http://rubygems.rubyforge.org/rubygems-update/CVE-2013-4287_txt.html
- for CVE information.
-
- See http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.1.0+%2F+2013-09-09
- for release notes.
-
- * test/rubygems: Tests for the above.
-
-Mon Sep 9 21:31:45 2013 Tanaka Akira <akr@fsij.org>
-
- * process.c: Remove spaces between SI prefix and unit to follow
- SI brochure.
- http://www.bipm.org/en/si/si_brochure/
- https://www.nmij.jp/library/units/si/
-
- * time.c: Ditto.
-
- * ext/socket/ancdata.c: Ditto.
-
-Mon Sep 9 16:55:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (rb_add_refined_method_entry): clear cache in the
- refined class since refining a method entry is modifying the class.
- [ruby-core:57079] [Bug #8880]
-
-Mon Sep 9 09:14:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/rbinstall.rb (Gem::Specification#initialize): default date to
- RUBY_RELEASE_DATE. [ruby-core:57072] [Bug #8878]
-
- * tool/rbinstall.rb (Gem::Specification#to_ruby): add date.
-
-Sun Sep 8 16:01:54 2013 Tanaka Akira <akr@fsij.org>
-
- * rational.c (f_gcd): Relax the condition to use GMP.
-
-Sun Sep 8 13:56:38 2013 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (folevariant_initialize): check type of
- element of array.
-
- * test/win32ole/test_win32ole_variant.rb (test_s_new_ary): ditto.
-
-Sat Sep 7 21:33:10 2013 Tanaka Akira <akr@fsij.org>
-
- * math.c (math_log): Test the sign for bignums.
- (math_log2): Ditto.
- (math_log10): Ditto.
-
-Sat Sep 7 20:25:47 2013 Tanaka Akira <akr@fsij.org>
-
- * math.c (math_log): Support bignums bigger than 2**1024.
- (math_log2): Ditto.
- (math_log10): Ditto.
-
-Sat Sep 7 15:36:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * vm_eval.c (vm_call0): fix prototype, the id parameter should be of
- type ID, not VALUE
-
- * vm_insnhelper.c (check_match): the rb_funcall family of functions
- does not care about refinements. We need to use
- rb_method_entry_with_refinements instead to call === with
- refinements. Thanks to Jon Conley for reporting this bug.
- [ruby-core:57051] [Bug #8872]
-
- * test/ruby/test_refinement.rb: add test
-
-Sat Sep 7 13:49:40 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * variable.c (classname): the name of class that has
- non class id should not be nil. This bug was introduced
- in r36577.
-
- * test/thread/test_cv.rb: test for change.
-
-Sat Sep 7 13:29:22 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * lib/find.rb (Find.find): respect the encodings of arguments.
- [ruby-dev:47530] [Feature #8657]
-
- * test/test_find.rb: add tests.
-
-Sat Sep 7 10:40:32 2013 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb (TCP_FASTOPEN): Defined for TCP fast open.
- [ruby-core:57048] [Feature #8871] patch by Masaki Matsushita.
-
-Fri Sep 6 23:53:31 2013 Masaki Matsushita <glass.saga@gmail.com>
-
- * common.mk: use RUNRUBY instead of MINIRUBY because MINIRUBY can't
- require extension libraries. The patch is from nobu
- (Nobuyoshi Nakada).
-
- * ext/thread/extconf.rb: for build ext/thread/thread.c.
-
- * include/ruby/intern.h: ditto.
-
- * thread.c: ditto.
-
- * lib/thread.rb: removed and replaced by ext/thread/thread.c.
-
- * ext/thread/thread.c: Queue, SizedQueue and ConditionVariable
- implementations in C. This patch is based on patches from panaggio
- (Ricardo Panaggio) and funny_falcon (Yura Sokolov) and ko1
- (Koichi Sasada). [ruby-core:31513] [Feature #3620]
-
- * test/thread/test_queue.rb (test_queue_thread_raise): add a test for
- ensuring that killed thread should be removed from waiting threads.
- It is based on a code by ko1 (Koichi Sasada). [ruby-core:45950]
-
-Fri Sep 6 22:47:12 2013 Tanaka Akira <akr@fsij.org>
-
- * configure.in: Define ac_cv_func_clock_getres to yes for mingw*.
-
-Fri Sep 6 21:04:10 2013 Tanaka Akira <akr@fsij.org>
-
- * rational.c: Include gmp.h if GMP is used.
- (GMP_GCD_DIGITS): New macro.
- (rb_gcd_gmp): New function.
- (f_gcd_normal): Renamed from f_gcd.
- (rb_gcd_normal): New function.
- (f_gcd): Invoke rb_gcd_gmp or f_gcd_normal.
-
- * internal.h (rb_gcd_normal): Declared.
- (rb_gcd_gmp): Ditto.
-
- * ext/-test-/rational: New directory.
-
- * test/-ext-/rational: New directory.
-
-Fri Sep 6 14:23:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (clock_getres): required as well as clock_gettime().
- [ruby-dev:47699] [Bug #8869]
-
-Fri Sep 6 11:45:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (rb_econv_append): new function to append a string data
- with converting its encoding. split from rb_econv_substr_append.
-
-Fri Sep 6 02:37:22 2013 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb: use double quotes when
- strings start with special characters.
- https://github.com/tenderlove/psych/issues/157
-
- * test/psych/test_string.rb: test for change.
-
-Fri Sep 6 00:05:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c (rewrite_cref_stack): remove recursion.
-
-Thu Sep 5 18:05:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * string.c (fstring_cmp): take string encoding into account when
- comparing fstrings [ruby-core:57037] [Bug #8866]
-
- * test/ruby/test_string.rb: add test
-
-Thu Sep 5 17:25:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_fstring, rb_str_free): use st_data_t instead of VALUE.
-
- * string.c (rb_fstring): get rid of duplicating already frozen object.
-
-Thu Sep 5 14:01:22 2013 Eric Hodel <drbrain@segment7.net>
-
- * lib/optparse.rb: The Integer acceptable now allows binary and
- hexadecimal numbers per the documentation. [ruby-trunk - Bug #8865]
-
- DecimalInteger, OctalInteger, DecimalNumeric now validate their input
- before converting to a number. [ruby-trunk - Bug #8865]
-
- * test/optparse/test_acceptable.rb: Tests for the above, tests for all
- numeric acceptables for existing behavior.
-
-Thu Sep 5 13:49:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * include/ruby/ruby.h: add RSTRING_FSTR flag
-
- * internal.h: add rb_fstring() prototype
-
- * string.c (rb_fstring): deduplicate frozen string literals
-
- * string.c (rb_str_free): delete fstrings from frozen_strings table when
- they are GC'd
-
- * string.c (Init_String): initialize frozen_strings table
-
-Thu Sep 5 12:48:00 2013 Kenta Murata <mrkn@cookpad.com>
-
- * configure.in (with_gmp): set with_gmp no if it is empty.
-
-Thu Sep 5 10:41:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
-
- * vm_insnhelper.c (vm_getivar): use class sequence to check class
- identity, instead of pointer + vm state
-
- * vm_insnhelper.c (vm_setivar): ditto
-
-Thu Sep 5 08:20:58 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (GMP_DIV_DIGITS): New macro.
- (bary_divmod_gmp): New function.
- (rb_big_divrem_gmp): Ditto.
- (bary_divmod_branch): Ditto.
- (bary_divmod): Use bary_divmod_branch.
- (bigdivrem): Ditto.
+Mon Dec 14 11:41:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * internal.h (rb_big_divrem_gmp): Declared.
+ * lib/cgi.rb: fix a typo in documentation.
+ [ci skip][fix GH-1140] Patch by @jutaz
-Thu Sep 5 06:22:42 2013 Tanaka Akira <akr@fsij.org>
+Mon Dec 14 11:31:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (bary_divmod_normal): Reduce temporary array allocations.
+ * compile.c: fix typos.
+ [ci skip][fix GH-1140] Patch by @jutaz
+ * dir.c: ditto.
+ * gc.c: ditto.
+ * io.c: ditto.
+ * node.h: ditto.
+ * thread_pthread.c: ditto.
+ * vm_insnhelper.c: ditto.
+ * vsnprintf.c: ditto.
-Thu Sep 5 02:17:06 2013 Tanaka Akira <akr@fsij.org>
+Mon Dec 14 11:27:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (rb_big_divrem_normal): Add GC guards.
+ * enc/iso_2022_jp.h: fix typos.
+ [ci skip][fix GH-1140] Patch by @jutaz
+ * enc/utf_16_32.h: ditto.
+ * enc/utf_7.h: ditto.
-Thu Sep 5 00:38:32 2013 Tanaka Akira <akr@fsij.org>
+Mon Dec 14 11:25:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (rb_big_divrem_normal): New function.
+ * benchmark/bm_app_aobench.rb: fix typos.
+ [ci skip][fix GH-1140] Patch by @jutaz
+ * benchmark/bm_vm_thread_pipe.rb: ditto.
- * internal.h (rb_big_divrem_normal): Declared.
+Sun Dec 13 23:46:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/-test-/bignum/div.c: New file.
+ * parse.y (trace_lex_state): trace lex_state changes if yydebug is
+ set, and send the messages to rb_stdout.
- * test/-ext-/bignum/test_div.rb: New file.
+ * parse.y (rb_parser_printf): store YYPRINTF messages per lines
+ so that lex_state traces do not mix.
-Thu Sep 5 00:08:44 2013 Tanaka Akira <akr@fsij.org>
+ * tool/ytab.sed: add parser argument to yy_stack_print too.
- * bignum.c (bigdivrem_normal): Removed.
- (bary_divmod_normal): New function.
- (bary_divmod): Use bary_divmod_normal.
- (bigdivrem): Use bary_divmod_normal.
+Sun Dec 13 20:41:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Sep 4 23:02:12 2013 Tanaka Akira <akr@fsij.org>
+ * parse.y (build_lex_state_name, trace_lex_state): lex_state is
+ now bit flags and can be set 2 bits or more.
- * bignum.c (bigdivrem): Useless declaration removed.
+Sun Dec 13 20:26:30 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-Wed Sep 4 22:56:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_syntax.rb: fix typo in test
- * numeric.c (NUM_STEP_GET_INF): split from NUM_STEP_SCAN_ARGS(), since
- inf is not used in num_step_size().
+Sun Dec 13 20:12:14 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-Wed Sep 4 20:22:43 2013 Tanaka Akira <akr@fsij.org>
+ * parse.y (parse_percent): Allow %-literals in labeled arg as
+ r51624 did for parentheses.
+ Fixes [ruby-core:72084] [Bug #11812].
- * bignum.c (bigdivrem_normal): Add assertions.
+Sun Dec 13 20:02:15 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Sep 4 19:18:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ChangeLog: fix a typo
- * internal.h (vm_state_version_t): prefer LONG_LONG to uint64_t.
+Sun Dec 13 19:54:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Sep 4 16:28:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/lib/envutil.rb: move envutil's assertions under Test::Unit::Assertion.
+ * test/lib/test/unit/assertions.rb: ditto.
- * internal.h (vm_state_version_t): use uint64_t when it is larger than
- LONG_LONG, and fallback to unsigned long.
+Sun Dec 13 19:24:20 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-Wed Sep 4 15:37:05 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * parse.y (lex_state_name): Make it return the correct names.
+ Add new names to follow r51617; Indices ffs(2) returns are 1-origin.
- * enc/trans/utf8_mac-tbl.rb: fix r42789.
- Fix conversion table and logic. [ruby-dev:47680]
+Sun Dec 13 18:40:45 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-Wed Sep 4 14:08:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * parse.y: debug output of lex_state transition if PARSER_DEBUG
- * class.c, compile.c, eval.c, gc.h, insns.def, internal.h, method.h,
- variable.c, vm.c, vm_core.c, vm_insnhelper.c, vm_insnhelper.h,
- vm_method.c: Implement class hierarchy method cache invalidation.
+Sun Dec 13 18:49:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- [ruby-core:55053] [Feature #8426] [GH-387]
+ * io.c (parse_mode_enc): preserve encoding of mode string in
+ warnings.
-Wed Sep 4 11:13:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (io_encname_bom_p): check BOM prefix only, not including
+ UTF prefix.
- * string.c (str_gsub): use BEG(0) for whole matched position not
- return value from rb_reg_search(), for \K matching.
- [ruby-dev:47694] [Bug #8856]
+ * io.c (parse_mode_enc): warn BOM with non-UTF encoding.
-Wed Sep 4 11:11:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (parse_mode_enc): fix buffer overflow.
- * configure.in (SOLIBS): LIBRUBY_SO also needs linking with gmp, to
- run worker processes in test-all on non-ELF platforms.
+Sun Dec 13 18:35:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 3 23:01:41 2013 Kouhei Sutou <kou@cozmixng.org>
+ * ext/fiddle/function.c (initialize): check all arguments first.
+ reported by Marcin 'Icewall' Noga of Cisco Talos.
- * test/rexml/parser/test_tree.rb
- (TestTreeParser::TestInvalid#test_unmatched_close_tag):
- Compute expected value from test value.
+ * ext/fiddle/conversions.h (PTR2NUM): use signed integer to make
+ Fixnum for negative values.
-Tue Sep 3 22:59:58 2013 Kouhei Sutou <kou@cozmixng.org>
+Sun Dec 13 18:33:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rexml/parsers/treeparser.rb (REXML::Parsers::TreeParser#parse):
- Add source information to parse exception on no close tag error.
- [Bug #8844] [ruby-dev:47672]
- Patch by Ippei Obayashi. Thanks!!!
- * test/rexml/parser/test_tree.rb: Add a test for the above case.
+ * pack.c (pack_pack): always check index range against the
+ receiver array length, which can be shortened by elements
+ conversion. reported by Marcin 'Icewall' Noga of Cisco Talos.
-Tue Sep 3 22:57:57 2013 Kouhei Sutou <kou@cozmixng.org>
+Sun Dec 13 18:28:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rexml/parser/test_tree.rb: Fix test name to describe test
- content.
+ * ext/psych/psych_emitter.c (start_document): should not exceed
+ tags array range.
-Tue Sep 3 22:54:46 2013 Kouhei Sutou <kou@cozmixng.org>
+ * ext/psych/psych_emitter.c (start_document): ensure string before
+ encoding conversion.
- * lib/rexml/parsers/treeparser.rb (REXML::Parsers::TreeParser#parse):
- Remove needless nested parse exception information.
- [Bug #8844] [ruby-dev:47672]
- Reported by Ippei Obayashi. Thanks!!!
- * test/rexml/parser/test_tree.rb: Add a test for the above case.
+Sun Dec 13 18:26:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 3 22:03:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/tkutil/tkutil.c (tk_hash_kv): check types of array
+ argument. reported by Marcin 'Icewall' Noga of Cisco Talos.
- * string.c (rb_enc_str_new_cstr): new function to create a string from
- the C-string pointer with the specified encoding.
+ * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check length of
+ argument arrays for each access, as callback methods can modify
+ them. reported by Marcin 'Icewall' Noga of Cisco Talos.
-Tue Sep 3 21:41:37 2013 Akira Matsuda <ronnie@dio.jp>
+ * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check types of
+ argument elements. reported by Marcin 'Icewall' Noga of Cisco
+ Talos.
- * eval.c (Init_eval): Make Module#include and Module#prepend public
- [Feature #8846]
+Sun Dec 13 18:19:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_module.rb (class TestModule): Test for above
+ * ext/win32ole/win32ole.c (ole_vstr2wc): check argument type, vstr
+ must be a String here. reported by Marcin 'Icewall' Noga of
+ Cisco Talos.
-Tue Sep 3 21:35:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 13 16:41:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread_pthread.c (sys/dyntune.h): for gettune().
+ * configure.in (BOOTSTRAPRUBY): make BASERUBY full path before
+ building ruby to get rid of unexpectedly invoking built ruby.
+ [ruby-core:72065] [Bug #11807]
- * thread_pthread.c (hpux_attr_getstackaddr): fix missing *.
- [ruby-core:56983] [Feature #8793]
+ * configure.in (BOOTSTRAPRUBY): use MINIRUBY but not BASERUBY
+ unless cross compiling. [ruby-core:72065] [Bug #11807]
-Tue Sep 3 20:12:46 2013 Tanaka Akira <akr@fsij.org>
+Sun Dec 13 14:17:19 2015 Akinori MUSHA <knu@iDaemons.org>
- * bignum.c (GMP_STR2BIG_DIGITS): New macro.
- (str2big_gmp): New function.
- (rb_cstr_to_inum): Use str2big_gmp for big bignums.
- (rb_str2big_gmp): New function.
+ * test/test_shellwords.rb (TestShellwords): Add many more tests
+ for handling whitespace characters and frozenness.
- * internal.h (rb_str2big_gmp): Declared.
+Sun Dec 13 14:16:09 2015 Akinori MUSHA <knu@iDaemons.org>
-Tue Sep 3 19:44:40 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/shellwords.rb (Shellwords#shellsplit): Document that this
+ method does not treat shell metacharacters as such.
- * ext/win32/lib/win32/registry.rb (Win32::Registry#values): added.
- [Feature #7763] [ruby-core:51783]
+Sun Dec 13 12:17:43 2015 Eric Wong <e@80x24.org>
-Tue Sep 3 18:26:00 2013 Akinori MUSHA <knu@iDaemons.org>
+ * lib/shellwords.rb (shellescape): duplicate frozen literal
+ * test/test_shellwords.rb (test_stringification): new test
- * misc/inf-ruby.el (inf-ruby-keys, run-ruby): Add magic autoload
- comments.
+Sun Dec 13 11:47:35 2015 Shugo Maeda <shugo@ruby-lang.org>
- * misc/rdoc-mode.el (rdoc-mode): Ditto.
+ * object.c (rb_inspect): check the default internal encoding as
+ String#inspect do.
+ [ruby-dev:49415] [Bug #11787]
- * misc/ruby-electric.el (ruby-electric-mode): Ditto.
+Sun Dec 13 11:38:12 2015 Akinori MUSHA <knu@iDaemons.org>
- * misc/ruby-style.el (ruby-style-c-mode): Ditto.
+ * lib/shellwords.rb: Turn on frozen-string-literal after fixing
+ shellsplit.
-Tue Sep 3 17:06:15 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Dec 13 10:44:44 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * test/ruby/test_rubyoptions.rb
- (TestRubyOptions::SEGVTest::ExpectedStderr): the URL was changed at
- r42800.
+ * KNOWNBUGS.rb: Fixed typo, made more explicit [ci skip]
-Tue Sep 3 14:48:25 2013 Zachary Scott <e@zzak.io>
+Sun Dec 13 10:26:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/thread.rb: [DOC] CV#wait typo by @avdi [Fixes GH-386]
- https://github.com/ruby/ruby/pull/386
+ * ext/openssl/ossl_ssl.c (ssl_npn_select_cb_common): fix parsing
+ protocol list.
+ The protocol list from OpenSSL is not null-terminated.
+ patched by Kazuki Yamaguchi [Bug #11810] [ruby-core:72082]
-Tue Sep 3 14:37:53 2013 Zachary Scott <e@zzak.io>
+Sun Dec 13 06:40:30 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * error.c: [DOC] Update bug tracker url by @ScotterC [Fixes GH-390]
- https://github.com/ruby/ruby/pull/390
+ * lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a
+ symbol
+ nor a string. See [#11762]
-Tue Sep 3 12:45:23 2013 Tanaka Akira <akr@fsij.org>
+Sun Dec 13 00:05:42 2015 Shugo Maeda <shugo@ruby-lang.org>
- * bignum.c (rb_str2big_poweroftwo): New function.
- (rb_str2big_normal): Ditto.
- (rb_str2big_karatsuba): Ditto.
+ * vm_insnhelper.c (vm_call_method_missing): method_missing should
+ not be refined.
+ [ruby-core:72080] [Bug #11809]
- * internal.h (rb_str2big_poweroftwo): Declared.
- (rb_str2big_normal): Ditto.
- (rb_str2big_karatsuba): Ditto.
+Sat Dec 12 23:00:17 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/-test-/bignum/str2big.c: New file.
+ * ext/nkf/nkf-utf8/nkf.c: Merge nkf 2.1.4.
- * test/-ext-/bignum/test_str2big.rb: New file.
+Sat Dec 12 18:52:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/-test-/bignum/depend: Add the dependency for str2big.c.
+ * object.c (rb_obj_dig): raise TypeError if an element does not
+ have #dig method. [ruby-core:71798] [Bug #11762]
-Tue Sep 3 12:09:08 2013 Tanaka Akira <akr@fsij.org>
+Sat Dec 12 17:59:07 2015 Yuichiro Kaneko <yui-knk@ruby-lang.org>
- * process.c (rb_clock_gettime): Support times() based monotonic clock.
- (rb_clock_getres): Ditto.
+ * test/ruby/test_regexp.rb: Add test cases for `$KCODE` and `$=` warning
+ [Misc #11770][ruby-dev:49398]
-Tue Sep 3 12:03:02 2013 Tanaka Akira <akr@fsij.org>
+Sat Dec 12 17:11:57 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * bignum.c (str2big_scan_digits): Extracted from rb_cstr_to_inum.
+ * doc/NEWS-0.2.2: add description about incompatible change in Hash
+ duplicated key overriding policy. [Bug #10315] [Bug #11501]
-Tue Sep 3 11:23:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 12 07:44:38 2015 Eric Wong <e@80x24.org>
- * win32/win32.c (rb_w32_select_with_thread): rounding up the fraction of
- tv_usec instead of rounding down.
- this change is an experiment to get rid of failures on vc10-x64 CI.
+ * io.c (do_io_advise): do not raise on ENOSYS
+ * test/ruby/test_io.rb (test_advise): do not skip on Errno::ENOSYS
+ (test_advise_pipe): ditto
+ [ruby-core:72066] [Feature #11806]
-Tue Sep 3 11:00:28 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 12 07:05:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (do_select): constify timeout.
+ * enc/windows_1252.c: separate from ISO-8859-1 to fix 0x80..0x9e
+ range. [ruby-core:64049] [Bug #10097]
- * win32/win32.c (rb_w32_select_with_thread): constify 10ms wait and
- 0ms wait structs.
+Fri Dec 11 23:33:40 2015 Yusuke Endoh <mame@ruby-lang.org>
-Tue Sep 3 10:03:42 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * sample/trick2015/: added the award-winning entries of TRICK 2015.
+ See https://github.com/tric/trick2015 for the contest outline.
- * test/openssl/test_pair.rb
- (OpenSSL::TestPair#test_write_nonblock_no_exceptions): on some CIs
- such as Debian 6.0, Ubuntu 10.04, CentOS and vc10-x64 (maybe depend
- on OpenSSL version), writing to SSLSocket after SSL_ERROR_WANT_WRITE
- causes SSL_ERROR_SSL "bad write retry".
+Fri Dec 11 17:59:05 2015 Eric Wong <e@80x24.org>
-Tue Sep 3 08:20:46 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * insns.def (opt_case_dispatch): avoid converting Infinity
+ * test/ruby/test_optimization.rb (test_opt_case_dispatch_inf): new
+ [ruby-dev:49423] [Bug #11804]'
- * enc/trans/utf8_mac-tbl.rb: update conversion table to recent OS X.
- Previous table is used on Mac OS X 10.1 or prior.
- This table is used on 10.2 or later. [ruby-dev:47680]
+Fri Dec 11 16:48:57 2015 Eric Wong <e@80x24.org>
-Tue Sep 3 07:49:25 2013 Akinori MUSHA <knu@iDaemons.org>
+ * hash.c (rb_num_hash_start): avoid pathological behavior
+ [ruby-core:72028] [Feature #11405]
- * numeric.c (NUM_STEP_SCAN_ARGS): On second thought, keep
- Numeric#step backward compatible in that it raises TypeError
- when nil is given as second argument.
+Fri Dec 11 11:58:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/ruby/test_float.rb (TestFloat#test_num2dbl): Revert.
+ * NEWS: Mentioned rubygems-2.5.1
- * test/ruby/test_numeric.rb (TestNumeric#test_step): Fix test
- cases for the above change.
+Fri Dec 11 11:52:39 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Tue Sep 3 07:39:58 2013 Tanaka Akira <akr@fsij.org>
+ * lib/rubygems: Update to RubyGems 2.5.1
+ * test/rubygems: ditto.
- * bignum.c (bytes_2comp): Define it only for little endian
- environment.
+Fri Dec 11 11:38:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 3 07:31:29 2013 Akinori MUSHA <knu@iDaemons.org>
+ * compile.c (iseq_compile_each, ibf_load_object_hash): rehash
+ case-dispatch hash to reduce collisions.
+ http://d.hatena.ne.jp/ku-ma-me/20151210
- * numeric.c (NUM_STEP_SCAN_ARGS): Numeric#step should raise
- TypeError if a non-numeric parameter is given.
+Fri Dec 11 03:44:43 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_float.rb (TestFloat#test_num2dbl): Allow nil as
- step, as with the keyword argument.
+ * object.c (rb_inspect): dump inspected result with rb_str_escape()
+ instead of raising Encoding::CompatibilityError. [Feature #11801]
- * test/ruby/test_numeric.rb (TestNumeric#test_step): Add tests for
- nil as step or limit.
+ * string.c (rb_str_escape): added to dump given string like
+ rb_str_inspect without quotes and always dump in US-ASCII
+ like rb_str_dump.
-Tue Sep 3 07:28:49 2013 Tanaka Akira <akr@fsij.org>
+Thu Dec 10 14:59:59 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h (bit_length): Add casts to fix compilation error with
- clang 3.0 -Werror,-Wshorten-64-to-32.
- [ruby-dev:47687] reported by SASADA Koichi.
+ * test/ruby/test_gc.rb (test_expand_heap): relax condition (1->2).
-Tue Sep 3 03:17:26 2013 Koichi Sasada <ko1@atdot.net>
+Thu Dec 10 14:15:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * vm_insnhelper.c (vm_search_super_method): use ci->argc instead of
- ci->orig_argc. ci->argc can be changed by splat arguments.
- [ruby-list:49575]
- This fix should be applied to Ruby 2.0.0 series.
+ * cont.c: fix a double word typo.
+ [Bug #11313][ruby-core:69749]
- * test/ruby/test_super.rb: add a test for above.
+Thu Dec 10 14:13:34 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Sep 2 23:46:29 2013 Akinori MUSHA <knu@iDaemons.org>
+ * ext/tk/lib/multi-tk.rb: fix typos.
+ [Bug #11764][ruby-core:71800]
- * numeric.c (num_step): Default the limit argument to infinity and
- allow it to be omitted. Keyword arguments (by: and to:) are
- introduced for ease of use. [Feature #8838] [ruby-dev:47662]
- [ruby-dev:42194]
+Thu Dec 10 11:33:34 2015 Eric Wong <e@80x24.org>
- * numeric.c (num_step): Optimize for infinite loop.
+ * compile.c (iseq_compile_each): reduce needless rb_str_dup
+ [ruby-core:72018] <5668DB6E.8000101@ruby-lang.org>
-Mon Sep 2 22:55:59 2013 Tanaka Akira <akr@fsij.org>
+Thu Dec 10 09:32:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (ISDIGIT): Unused macro removed.
+ * lib/mkmf.rb, lib/shellwords.rb: disable frozen-string-literal.
+ [ruby-core:72011] [Bug #11800]
-Mon Sep 2 22:49:15 2013 Tanaka Akira <akr@fsij.org>
+Thu Dec 10 06:33:39 2015 Eric Wong <e@80x24.org>
- * bignum.c (str2big_poweroftwo): Extracted from rb_cstr_to_inum.
- (str2big_normal): Ditto.
- (str2big_karatsuba): Ditto.
+ * marshal.c (memsize_dump_arg): remove NULL check
+ (memsize_load_arg): ditto
-Mon Sep 2 14:39:29 2013 Akinori MUSHA <knu@iDaemons.org>
+Thu Dec 10 05:53:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (Process#setproctitle): [DOC] Fix and improve rdoc.
+ * tool/mkconfig.rb: rbconfig must not be frozen-string-literal to
+ expand CONFIG hash. [ruby-core:72006] [Bug #11798]
- * ruby.c (Process#argv0): [DOC] Improve rdoc.
+Thu Dec 10 05:03:51 2015 Eric Wong <e@80x24.org>
-Mon Sep 2 14:15:00 2013 Kenta Murata <mrkn@cookpad.com>
+ * ext/socket/ifaddr.c (ifaddr_mark): remove empty function
+ (ifaddr_type): pass zero to rb_data_type_t.function.dmark
- * NEWS: fix description of number literal suffixes.
+Thu Dec 10 04:49:16 2015 Eric Wong <e@80x24.org>
-Mon Sep 2 14:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * proc.c (bm_free): remove, use default free
+ (method_data_type): use RUBY_TYPED_DEFAULT_FREE
- * test/rake/test_rake_rules.rb: add space after string literal to
- prevent conflict with string options syntax "foo"opts
+Thu Dec 10 02:01:41 2015 Koichi Sasada <ko1@atdot.net>
- * test/rss/rss-assertions.rb: ditto
+ * compile.c (iseq_compile_each): do not add debug information
+ without --debug or --debug=frozen-string-literal option
+ because String#dup slows down with debug information.
+ [Feature #11725]
-Mon Sep 2 12:28:38 2013 Tanaka Akira <akr@fsij.org>
+ * NEWS: apply about it.
- * test/ruby/test_bignum.rb (test_interrupt_during_to_s): Disable it
- when GMP is used.
+ * test/ruby/test_rubyoptions.rb: catch up this fix with refactoring.
-Mon Sep 2 07:02:10 2013 Tanaka Akira <akr@fsij.org>
+Thu Dec 10 00:06:56 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (Init_Bignum): Define Bignum::GMP_VERSION when GMP is used.
+ * iseq.c: rename methods
+ RubyVM::InstructionSequence#to_binary_format -> #to_binary
+ RubyVM::InstructionSequence.from_binary_format -> .load_from_binary
+ RubyVM::InstructionSequence.from_binary_format_extra_data ->
+ .load_from_binary_extra_data
-Mon Sep 2 01:46:14 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c: fix document of iseq.to_binary.
+ [Fix GH-1134]
- * bignum.c (big2str_generic): Reduce arguments.
- (big2str_gmp): Ditto.
- (rb_big2str1): Follow the above change.
+ * sample/iseq_loader.rb: catch up this change.
-Mon Sep 2 00:08:08 2013 Tanaka Akira <akr@fsij.org>
+ * test/lib/iseq_loader_checker.rb: ditto.
- * process.c (get_mach_timebase_info): Extracted from rb_clock_gettime.
- (rb_clock_gettime): Use get_mach_timebase_info.
- (rb_clock_getres): Support MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC.
+Wed Dec 9 17:02:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 1 23:30:47 2013 Tanaka Akira <akr@fsij.org>
+ * regparse.h (SET_NTYPE): get rid of breaking strict aliasing.
+ patch by Zarko Todorovski in [ruby-core:71953]. [Bug #11790]
- * bignum.c (GMP_BIG2STR_DIGITS): New constant.
- (big2str_gmp): New function.
- (rb_big2str1): Use big2str_gmp for big bignums.
+Wed Dec 9 16:10:37 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h (rb_big2str_gmp): Declared.
+ * vm.c (rb_vm_cref_in_context): Module#define_method in non-class
+ expression should be public.
+ [Bug #11754]
- * ext/-test-/bignum/big2str.c (big2str_gmp): New method.
+ * test/ruby/test_method.rb: add a test.
-Sun Sep 1 22:37:51 2013 Tanaka Akira <akr@fsij.org>
+Wed Dec 9 14:45:27 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (bary_mul_gmp): Use mpz_init and mpz_clear instead of
- mpz_inits and mpz_clears.
- Older GMP don't have them.
+ * gc.c (gc_mark_stacked_objects): fix typo.
+ reported by XIE Zhibang. [Bug #11763]
-Sun Sep 1 21:17:54 2013 Tanaka Akira <akr@fsij.org>
+Wed Dec 9 14:37:51 2015 Shugo Maeda <shugo@ruby-lang.org>
- * test/net/http/test_http.rb (test_bind_to_local_port): Choose an open
- port more reliably.
+ * doc/syntax/refinements.rdoc: remove outdated description.
-Sun Sep 1 20:32:40 2013 Tanaka Akira <akr@fsij.org>
+Wed Dec 9 09:58:09 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (big2str_base_poweroftwo): Renamed from
- big2str_base_powerof2.
- (rb_big2str_poweroftwo): New function for test.
- (big2str_generic): Extracted from rb_big2str1.
- (rb_big2str_generic): New function for test.
+ * ext/**/*.c (*_memsize): same as r52986 for extensions.
- * internal.h (rb_big2str_poweroftwo): Declared.
- (rb_big2str_generic): Ditto.
+Wed Dec 9 09:46:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/-test-/bignum/big2str.c: New file.
+ * .gitignore: ignored ISeq binary format.
- * test/-ext-/bignum/test_big2str.rb: New file.
+Wed Dec 9 09:34:41 2015 Koichi Sasada <ko1@atdot.net>
-Sun Sep 1 15:21:21 2013 Tanaka Akira <akr@fsij.org>
+ * *.c (*_memsize): do not check ptr.
+ NULL checking is finished Before call of memsize functions.
+ See r52979.
- * bignum.c (big2str_2bdigits): Renamed from big2str_orig.
+Wed Dec 9 09:25:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Sep 1 13:02:24 2013 Tanaka Akira <akr@fsij.org>
+ * test/net/smtp/test_response.rb: use Test::Unit. We should use Test::Unit
+ without rubygems and rdoc.
- * bignum.c: Remove BITSPERDIG >= INT_MAX test. The static assertion,
- SIZEOF_BDIGITS <= sizeof(BDIGIT) is enough.
+Wed Dec 9 06:26:23 2015 Colin Kelley <colindkelley@gmail.com>
-Sun Sep 1 11:38:26 2013 Tanaka Akira <akr@fsij.org>
+ * lib/uri/generic.rb: enable frozen_string_literal
+ (split_userinfo): remove explicit .freeze for string literals
+ (check_path): ditto
+ (query): ditto
+ (fragment): ditto
+ (to_s): ditto
+ [ruby-core:71910] [Bug #11759]
- * bignum.c (maxpow_in_bdigit): Removed.
+Wed Dec 9 06:25:47 2015 Eric Wong <e@80x24.org>
-Sun Sep 1 10:30:42 2013 Tanaka Akira <akr@fsij.org>
+ * test/uri/test_generic.rb (to_s): new test
+ [ruby-core:71820]
- * numeric.c (rb_fix_bit_length): Moved from bignum.c.
+Wed Dec 9 02:18:52 2015 Koichi Sasada <ko1@atdot.net>
-Sun Sep 1 09:55:45 2013 Tanaka Akira <akr@fsij.org>
+ * compile.c (ibf_dump_memsize): should check NULL.
- * internal.h (bit_length): Moved from bignum.c.
- (nlz_int): Ditto.
- (nlz_long): Ditto.
- (nlz_long_long): Ditto.
- (nlz_int128): Ditto.
+Wed Dec 9 01:46:35 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Sep 1 03:32:22 2013 Tanaka Akira <akr@fsij.org>
+ * string.c (rb_str_init): now accepts new option parameter `encoding'.
+ [Feature #11785]
- * bignum.c (bit_length): Renamed from bitsize.
+Wed Dec 9 00:52:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 1 00:07:09 2013 Tanaka Akira <akr@fsij.org>
+ * file.c (rb_stat_wr, rb_stat_ww): call get_stat only once and
+ reduce checking struct. patch by Yuki Kurihara in
+ [ruby-core:71949]. [Misc #11789]
- * bignum.c (rb_big_bit_length): New method.
- (rb_fix_bit_length): Ditto.
- [ruby-core:56247] [Feature #8700]
+Wed Dec 9 00:24:33 2015 Koichi Sasada <ko1@atdot.net>
-Sat Aug 31 22:18:29 2013 Tanaka Akira <akr@fsij.org>
+ * compile.c (iseq_ibf_dump): dump extra data just string length.
- * process.c (rb_clock_getres): New method.
- (timetick2dblnum_reciprocal): New function.
+ * sample/iseq_loader.rb: add using
+ RubyVM::InstructionSequence.from_binary_format_extra_data method
+ (commented out).
- * configure.in: Check clock_getres.
+Mon Dec 9 00:21:19 2015 Yuki Nishijima <mail@yukinishijima.net>
- [ruby-core:56780] [Feature #8809] accepted as a CRuby feature at
- DevelopersMeeting20130831Japan
- https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130831Japan
+ * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.rc1
-Sat Aug 31 21:02:07 2013 Tanaka Akira <akr@fsij.org>
+Wed Dec 9 00:17:49 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c: Use GMP to accelerate big Bignum multiplication.
- (bary_mul_gmp): New function.
- (bary_mul): Use bary_mul_gmp.
- (bigsq): Use different threshold with GMP.
+ * compile.c (ibf_load_setup): cast to int.
- * configure.in: Detect GMP.
+Wed Dec 9 00:13:09 2015 Koichi Sasada <ko1@atdot.net>
- [ruby-core:56658] [Feature #8796]
+ * compile.c (ibf_setup_load): rename to ibf_load_setup().
-Sat Aug 31 15:03:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * compile.c (iseq_load_setup): check binary format.
- * compile.c (NODE_MATCH3): pass CALL_INFO to opt_regexpmatch2
+Tue Dec 8 23:30:07 2015 Naohisa Goto <ngotogenome@gmail.com>
- * insns.def (opt_regexpmatch2): use CALL_SIMPLE_METHOD to call =~ if
- the receiver is not a T_STRING [Bug #8847] [ruby-core:56916]
+ * test/io/console/test_io_console.rb (run_pty): Avoid waiting twice
+ for a process. Fix Errno::ECHILD in TestIO_Console#test_close and
+ TestIO_Console#test_sync.
-Sat Aug 31 14:07:11 2013 Tanaka Akira <akr@fsij.org>
+Tue Dec 8 23:05:47 2015 Koichi Sasada <ko1@atdot.net>
- * lib/securerandom.rb (random_bytes): Use Process.clock_gettime.
+ * compile.c (iseq_ibf_dump): fix for clang type checker.
-Sat Aug 31 00:25:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 23:04:02 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/encoding.h (rb_{ascii8bit,utf8,usascii}_encindex): get
- rid of conflict with macros defined in internal.h.
+ * iseq.c (iseq_s_load): fix mysterious bug.
-Fri Aug 30 22:37:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 22:31:58 2015 Koichi Sasada <ko1@atdot.net>
- * thread_pthread.c (native_thread_init_stack): wait the creator thread
- to fill machine stack info, if get_stack_of() is available.
+ * introduce new ISeq binary format serializer/de-serializer
+ and a pre-compilation/runtime loader sample.
+ [Feature #11788]
- * thread_pthread.c (native_thread_create): fill the created thread
- stack info after starting, if get_stack_of() is available.
+ * iseq.c: add new methods:
+ * RubyVM::InstructionSequence#to_binary_format(extra_data = nil)
+ * RubyVM::InstructionSequence.from_binary_format(binary)
+ * RubyVM::InstructionSequence.from_binary_format_extra_data(binary)
- * thread_pthread.c (native_thread_create): define attr only if it is
- used, and merge pthread_create() calls.
+ * compile.c: implement body of this new feature.
- * thread_pthread.c (get_main_stack): separate function to get stack of
- main thread.
+ * load.c (rb_load_internal0), iseq.c (rb_iseq_load_iseq):
+ call RubyVM::InstructionSequence.load_iseq(fname) with
+ loading script name if this method is defined.
-Thu Aug 29 18:05:33 2013 Koichi Sasada <ko1@atdot.net>
+ We can return any ISeq object as a result value.
+ Otherwise loading will be continue as usual.
- * struct.c (rb_struct_define_without_accessor_under): added.
- This function is similar to rb_define_class_under() against
- rb_define_class().
+ This interface is not matured and is not extensible.
+ So that we don't guarantee the future compatibility of this method.
+ Basically, you shouldn't use this method.
- * include/ruby/intern.h: add a declaration of this function.
+ * iseq.h: move ISEQ_MAJOR/MINOR_VERSION (and some definitions)
+ from iseq.c.
-Thu Aug 29 17:03:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * encoding.c (rb_data_is_encoding), internal.h: added.
- * vm_insnhelper.c (vm_call_method): a method entry refers the based
- class/module, so should search superclass from the origin i-class
- where the entry belongs to, to get rid of infinite loop when zsuper
- in a prepended class/module. [ruby-core:54105] [Bug #8238]
+ * vm_core.h: add several supports for lazy load.
+ * add USE_LAZY_LOAD macro to specify enable or disable of
+ this feature.
+ * add several fields to rb_iseq_t.
+ * introduce new macro rb_iseq_check().
-Thu Aug 29 05:35:58 2013 Eric Hodel <drbrain@segment7.net>
+ * insns.def: some check for lazy loading feature.
- * ext/zlib/zlib.c (zstream_run): Fix handling of deflate streams that
- need a dictionary but are being decompressed by Zlib::Inflate.inflate
- (which has no option to set a dictionary). Now Zlib::NeedDict is
- raised instead of crashing. [ruby-trunk - Bug #8829]
- * test/zlib/test_zlib.rb (TestZlibInflate): Test for the above.
+ * vm_insnhelper.c: ditto.
-Thu Aug 29 02:40:45 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * proc.c: ditto.
- * ext/psych/lib/psych/scalar_scanner.rb: invalid floats should be
- treated as strings.
- https://github.com/tenderlove/psych/issues/156
+ * vm.c: ditto.
- * test/psych/test_string.rb: test for change
+ * test/lib/iseq_loader_checker.rb: enabled iff suitable
+ environment variables are provided.
-Wed Aug 28 17:20:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/runner.rb: enable lib/iseq_loader_checker.rb.
- * thread_pthread.c (hpux_attr_getstackaddr): basic support for the
- get_stack() under HP-UX. based on the patch by michal@rokos.cz
- (Michal Rokos) at [ruby-core:56645]. [Feature #8793]
+ * sample/iseq_loader.rb: add sample compiler and loader.
-Wed Aug 28 11:24:20 2013 Michal Rokos <michal@rokos.cz>
+ $ ruby sample/iseq_loader.rb [dir]
- * configure.in (sys/pstat.h): fix missing header check for
- missing/setproctitle.c on HP-UX. [ruby-core:56644] [Bug #8792]
+ will compile all ruby scripts in [dir].
+ With default setting, this compile creates *.rb.yarb files
+ in same directory of target .rb scripts.
-Wed Aug 28 04:54:33 2013 Eric Hodel <drbrain@segment7.net>
+ $ ruby -r sample/iseq_loader.rb [app]
- * ext/openssl/ossl_ssl.c (ossl_ssl_read): Replace duplicate
- wait_writable with wait_readable.
+ will run with enable to load compiled binary data.
-Tue Aug 27 17:18:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 21:21:16 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/timeout.rb (Timeout#timeout): skip rescue clause only when no
- exception class is given.
+ * NEWS: mention about Enumerator::Lazy#grep_v.
+ [ruby-core:71845] [Feature #11773]
-Tue Aug 27 17:02:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 17:36:36 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * io.c (copy_stream_body): should write in binary mode. based on a
- patch by godfat (Lin Jen-Shin) at [ruby-core:56556].
- [ruby-core:56518] [Bug #8767]
+ * string.c: removed unused variable
-Tue Aug 27 17:02:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 16:23:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (copy_stream_body): move common open flags.
+ * enumerator.c (lazy_grep_v): add Enumerator::Lazy#grep_v as well
+ as Enumerable, to enumerate lazily.
+ [ruby-core:71845] [Feature #11773]
-Tue Aug 27 16:56:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 14:27:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enumerator.c (enumerator_size): use rb_check_funcall() instead of
- respond_to? and call.
+ * error.c (name_err_local_variables): new method
+ NameError#local_variables for internal use only.
+ [Feature #11777]
- * enumerator.c (enumerator_each): ensure that argument array size
- does not overflow at appending.
+Tue Dec 8 14:20:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 27 16:46:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * marshal.c (w_objivar): skip internal instance variables in
+ T_OBJECT too.
- * array.c (rb_ary_index, rb_ary_rindex): use optimized equality to
- improve performance. [Feature #8820]
+Tue Dec 8 12:58:04 2015 Naohisa Goto <ngotogenome@gmail.com>
- * vm_insnhelper.c (rb_equal_opt): optimized equality function.
+ * test/io/console/test_io_console.rb (test_getpass): s.getpass
+ should be tested. Narrow ensure block. This reverts r52911.
+ [Bug #11780] [ruby-dev:49412]
-Tue Aug 27 16:11:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 10:40:21 2015 Eric Wong <e@80x24.org>
- * vm_insnhelper.c (opt_eq_func): use RBASIC_CLASS() instead of HEAP_CLASS_OF().
+ * benchmark/bm_vm2_case_lit.rb: new benchmark
+ * compile.c (case_when_optimizable_literal): add nil/true/false
+ * insns.def (opt_case_dispatch): ditto
+ * vm.c (vm_redefinition_check_flag): ditto
+ * vm.c (vm_init_redefined_flag): ditto
+ * vm_core.h: ditto
+ * object.c (InitVM_Object): define === explicitly for nil/true/false
+ * test/ruby/test_case.rb (test_deoptimize_nil): new test
+ * test/ruby/test_optimization.rb (test_opt_case_dispatch): update
+ (test_eqq): new test
+ [ruby-core:71923] [Feature #11769]
+ Original patch by Aaron Patterson <tenderlove@ruby-lang.org>
- * insns.def (opt_plus, opt_minus, opt_mult, opt_div, opt_mod, opt_lt),
- (opt_gt, opt_ltlt, opt_aref, opt_aset, opt_length, opt_size),
- (opt_empty_p, opt_succ): ditto.
+Tue Dec 8 10:19:02 2015 Jake Worth <jakeworth82@gmail.com>
-Tue Aug 27 16:08:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/optparse.rb: fix double word typo in the document.
+ [Misc #10608] [Fix GH-1126]
- * vm_eval.c (rb_check_funcall, rb_check_funcall_with_hook): constify
- argv.
+Tue Dec 8 09:03:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 27 13:03:33 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/date/date_core.c (d_lite_lshift): should check the argument
+ before negation.
- * ext/stringio/stringio.c (strio_read_nonblock): declare local
- variables at the first of function.
+Tue Dec 8 08:56:16 2015 Eric Wong <e@80x24.org>
-Tue Aug 27 11:51:37 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * insns.def (opt_case_dispatch): check Float#=== redefinition
+ * test/ruby/test_optimization.rb (test_opt_case_dispatch): new
+ [ruby-core:71920] [Bug #11784]
- * enumerator.c: Allow Enumerator size argument to be any callable.
- Patch by Avdi Grimm. [bug #8641] [ruby-core:56032] [fix GH-362]
+Tue Dec 8 03:56:05 2015 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_enumerator.rb: Test for above
+ * test/lib/iseq_loader_checker.rb: add iseq dumper/loader checker.
+ If you enable this checker (remove `#' in test/runner.rb),
+ you can see comparison results between an original iseq disassembed
+ result and dumped and loaded iseq disassembed result.
-Tue Aug 27 11:46:31 2013 Koichi Sasada <ko1@atdot.net>
+ There are several bugs around there, because of inexact stack depth
+ calculation. Now, I leave these bugs because they are not critical
+ and difficult to solve completely.
- * gc.c (gc_profile_clear): do rest_sweep() before clearing
- profile.current_record.
+ * test/runner.rb: require test/lib/iseq_loader_checker.rb but
+ disabled at default (commented out).
-Tue Aug 27 07:35:05 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+Tue Dec 8 03:45:47 2015 Eric Wong <e@80x24.org>
- * io.c (io_read_nonblock): support non-blocking reads without raising
- exceptions. As in: `io.read_nonblock(size, exception: false)`
- [ruby-core:38666] [Feature #5138]
- * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): ditto
- * ext/stringio/stringio.c (strio_sysread): ditto
- * io.c (rb_io_write_nonblock): support non-blocking writes without
- raising an exception.
- * ext/openssl/ossl_ssl.c (ossl_ssl_write_internal): ditto
- * test/openssl/test_pair.rb (class OpenSSL): tests
- * test/ruby/test_io.rb (class TestIO): ditto
- * test/socket/test_nonblock.rb (class TestSocketNonblock): ditto
- * test/stringio/test_stringio.rb (class TestStringIO): ditto
+ * doc/extension.rdoc: warn about kwargs performance in C
+ [Feature #11339] [ci skip]
-Tue Aug 27 05:24:34 2013 Eric Hodel <drbrain@segment7.net>
+Tue Dec 8 03:44:51 2015 Koichi Sasada <ko1@atdot.net>
- * lib/rubygems: Import RubyGems 2.1.0 Release Candidate
- * test/rubygems: ditto.
+ * iseq.c (iseq_load): disable peephole optimization option
+ because apply it multiple times change the sequence.
+ (iseq != peephole_optimize(load(iseq.to_a)))
-Mon Aug 26 16:24:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 03:43:21 2015 Koichi Sasada <ko1@atdot.net>
- * parse.y (parser_nextc): warn carriage return in middle of line.
- [ruby-core:56240] [Feature #8699]
+ * compile.c (rb_iseq_build_from_ary): do not allocate table
+ if table_size is 0.
-Mon Aug 26 15:27:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 8 03:30:34 2015 Eric Wong <e@80x24.org>
- * lib/timeout.rb (Timeout#timeout): should not be caught by rescue
- clause. [Bug #8730]
+ * ext/socket/unixsocket.c (unix_send_io): document args
+ (unix_recv_io): ditto
+ * test/socket/test_unix.rb (test_fd_passing_class_mode): added
-Mon Aug 26 14:44:26 2013 Koichi Sasada <ko1@atdot.net>
+Tue Dec 08 02:21:35 2015 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_splice): use RARRAY_PTR_USE() without WB because
- there are not new relations.
+ * iseq.c (iseq_translate): at the end of constructing an iseq,
+ call RubyVM::InstructionSequence.translate(iseq) if this method
+ is defined. If the return value is also an object of
+ RubyVM::InstructionSequence, then use it instead of created one.
- * enum.c (enum_sort_by): ditto.
+ For example, this method is useful to test iseq dumper/loader
+ such as RubyVM::InstructionSequence#to_a and rb_iseq_load().
- * struct.c (setup_struct): use RARRAY_RAWPTR().
+ Because this method is for such internal experimental usage,
+ the interface is not matured. For example, this interface has
+ no extensibility. Two or more translators can not run
+ simultaneously.
- * vm_eval.c (yield_under): ditto.
+ So that we don't guarantee future compatibility of this method.
+ Basically, do not use this method.
- * ext/pathname/pathname.c (path_entries): use RARRAY_AREF().
+Tue Dec 8 01:57:13 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * ext/pathname/pathname.c (path_s_glob): ditto.
+ * ext/psych/*: update psych to 2.0.16
+ * test/psych/*: ditto
-Mon Aug 26 13:11:10 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Dec 7 23:45:20 2015 Koichi Sasada <ko1@atdot.net>
- * array.c (ary_ensure_room_for_push): fix typo in r42658.
+ * string.c: introduce String#+@ and String#-@ to control
+ String mutability.
+ [Feature #11782]
-Mon Aug 26 12:37:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 7 23:39:49 2015 Ben Miller <bjmllr@gmail.com>
- * template/sizes.c.tmpl: generate automatically by extracting
- RUBY_CHECK_SIZEOF from configure.in.
+ * parse.y: add heredoc <<~ syntax. [Feature #9098]
-Mon Aug 26 10:16:59 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Dec 7 23:06:16 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * process.c (gcd_timetick_int): Renamed from gcd_timtick_int.
+ * prelude.rb (IO#read_nonblock): [DOC] add missing options to
+ call-seq. [ruby-core:71627] [Bug #11730]
-Sun Aug 25 21:02:15 2013 Tanaka Akira <akr@fsij.org>
+Mon Dec 7 15:50:50 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * sizes.c (Init_sizes): Define the size of clock_t.
+ * .gitignore: added cygruby*.def for Cygwin
-Sun Aug 25 01:47:47 2013 Tanaka Akira <akr@fsij.org>
+Sun Dec 6 19:52:31 2015 Eric Wong <e@80x24.org>
- * bignum.c (BARY_SHORT_MUL): Renamed from BARY_MUL1.
- (bary_short_mul): Renamed from bary_mul1.
+ * include/ruby/intern.h (rb_autoload): deprecate
+ * internal.h (rb_autoload_str): declare
+ * load.c (rb_mod_autoload): use rb_autoload_str
+ * variable.c (rb_autoload): become compatibility wrapper
+ (rb_autoload_str): hoisted out from old rb_autoload
+ [ruby-core:71369] [Feature #11664]
-Sat Aug 24 10:35:09 2013 Tanaka Akira <akr@fsij.org>
+Sun Dec 6 18:25:22 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * process.c (rb_clock_gettime): The emulated clock names changed.
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): gave up the test
+ of binary path info test on Windows because the test had passed
+ occasionally as the comment said.
-Fri Aug 23 22:22:07 2013 Tanaka Akira <akr@fsij.org>
+Sun Dec 6 15:25:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (rb_clock_gettime): Add a cast to fix compile error by
- -Werror,-Wshorten-64-to-32.
+ * ext/io/console/console.c (console_getpass): add IO#getpass
+ method.
-Fri Aug 23 22:12:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 6 08:39:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * process.c (rb_intern): no symbol cache while initialization.
+ * ext/json/json.gemspec: bump version to json 1.8.3. CRuby already contained
+ upstream changes.
-Fri Aug 23 22:07:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ https://github.com/ruby/ruby/commit/4d059bf9f5f10f3d3088de49fc87e5555db7770d
+ https://github.com/flori/json/commit/d4c99de78905d96c3f301f48b2c789943bb3f098
- * configure.in (clock_t): needs time.h.
+ * ext/json/lib/json/version.rb: ditto.
-Fri Aug 23 21:37:28 2013 Tanaka Akira <akr@fsij.org>
+Sat Dec 5 17:48:25 2015 Lars Kanis <lars@greiz-reinsdorf.de>
- * process.c (reduce_factors): New function.
- (timetick2dblnum): Use reduce_factors.
- (timetick2integer): Ditto.
- (make_clock_result): Follow the above change.
- (rb_clock_gettime): Ditto.
+ * tool/fake.rb: Fix cross build when srcdir is an absolute path.
-Fri Aug 23 21:00:55 2013 Tanaka Akira <akr@fsij.org>
+ * Makefile.in: PREP dependency is needed when cross build too, not
+ "-r$(arch)-fake" to be used before created. [Fix GH-1125]
- * process.c (timetick_int_t): Renamed from timetick_giga_count_t.
- (gcd_timtick_int): Renamed from gcd_ul and make the arguments
- timetick_giga_count_t.
- (reduce_fraction): Make the arguments timetick_int_t.
- (timetick2integer): Ditto.
- (make_clock_result): Ditto.
- (timetick2dblnum): Fix the return type.
- (rb_clock_gettime): Use timetick_int_t.
+Sat Dec 5 17:26:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 23 20:50:40 2013 Tanaka Akira <akr@fsij.org>
+ * hash.c (env_str_new, env_path_str_new): make default string
+ UTF-8 for the case conversion is not possible. [Bug #8822]
- * process.c (gcd_ul): New function.
- (reduce_fraction): Ditto.
- (reduce_fraction): Ditto.
- (timetick2dblnum): Ditto.
- (timetick2integer): Ditto.
- (make_clock_result): Use timetick2dblnum and timetick2integer.
- (rb_clock_gettime): Follow the make_clock_result change.
+ * hash.c (get_env_cstr): convert non-ASCII string to UTF-8 string.
-Fri Aug 23 18:39:04 2013 Koichi Sasada <ko1@atdot.net>
+ * hash.c (ruby_setenv): use wide char version to put environment
+ variable to deal with non-ASCII value.
- * array.c (ary_make_shared): shared ary as shady. Need more effort to
- make it normal object.
+Sat Dec 5 09:56:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_modify): use RARRAY_PTR_USE() without WB because
- there are not new relations.
+ * ruby_atomic.h (ATOMIC_CAS): old value to be swapped should be
+ same as the destination. immediate value may need type
+ promotion.
- * array.c (ary_ensure_room_for_unshift): use RARRAY_RAWPTR() because
- there are not new relations.
+ * ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
+ InterlockedCompareExchange64. new value and then old value is
+ the last.
-Fri Aug 23 11:25:57 2013 Koichi Sasada <ko1@atdot.net>
+Sat Dec 5 09:23:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c: introduce ARY_SHARED_OCCUPIED(shared).
+ * random.c (fill_random_seed): fix the size to be filled, not the
+ size of element, but the whole size of array.
-Fri Aug 23 11:07:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 5 06:03:54 2015 Eric Wong <e@80x24.org>
- * win32/Makefile.sub (config.h): now SIZEOF_CLOCK_T is needed for
- unsigned_clock_t.
+ * vm.c (ruby_vm_verbose_ptr): make static
+ (ruby_vm_debug_ptr): ditto
-Thu Aug 22 22:01:04 2013 Tanaka Akira <akr@fsij.org>
+Sat Dec 5 00:56:29 2015 Naohisa Goto <ngotogenome@gmail.com>
- * process.c (rb_clock_gettime): Strip "s" from unit names.
+ * include/ruby/ruby.h (RB_OBJ_TAINT): follow-up of r52881.
+ Turn into void expression not to use unexpected result.
+ Fix "operands have incompatible types" error with
+ Oracle Solaris Studio 12.x on Solaris.
-Thu Aug 22 20:14:59 2013 Tanaka Akira <akr@fsij.org>
+Fri Dec 4 19:52:52 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * process.c (unsigned_clock_t): Defined.
- (rb_clock_gettime): Consider clock_t overflow for
- ISO_C_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID.
+ * enc/iso_8859_13.c: Added three missing lower/upper-case
+ character pairs (from Kimihito Matsui)
- * configure.in: Check the size of clock_t.
+Fri Dec 4 18:57:57 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Aug 22 16:22:48 2013 Koichi Sasada <ko1@atdot.net>
+ * enc/iso_8859_4.c: Added missing lower/upper-case character
+ pair (U+014A and U+014B, LATIN CAPITAL/SMALL LETTER ENG)
+ (from Kimihito Matsui)
- * compile.c (build_postexe_iseq): fix to setup the local table.
+Fri Dec 4 16:48:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 22 15:42:43 2013 Koichi Sasada <ko1@atdot.net>
+ * string.c (rb_obj_as_string): fstring should not be infected.
+ re-apply r52872 and fix a typo.
+ TODO: other frozen strings also may not be.
- * compile.c (rb_iseq_compile_node): accept NODE_IFUNC to support
- custom compilation.
+Fri Dec 4 15:21:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * compile.c (NODE_POSTEXE): compile to
- "ONCE{ VMFrozenCore::core#set_postexe{...} }" with a new custom
- compiler `build_postexe_iseq()'.
+ * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).
+ this version includes #1396, #1397, #1398, #1399
+ * test/rubygems: ditto.
- * vm.c (m_core_set_postexe): remove parameters (passed by a block).
+Fri Dec 4 11:22:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 22 06:54:15 2013 Tanaka Akira <akr@fsij.org>
+ * thread.c (rb_thread_setname): name must be ascii-compatible, as
+ pthread APIs do not accept legacy wide char strings.
- * process.c (rb_clock_gettime): Change emulation symbols for
- Process.clock_gettime.
+Thu Dec 3 15:39:21 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Aug 22 06:24:54 2013 Tanaka Akira <akr@fsij.org>
+ * lib/scanf.rb: fixed double words typo.
+ [ci skip][fix GH-1123] Patch by @jwworth
- * process.c (make_clock_result): Extracted from rb_clock_gettime.
+Thu Dec 3 15:37:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Aug 21 22:30:51 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_mixed_unicode_escapes.rb: fixed typo.
+ [fix GH-1122] Patch by @davydovanton
+ * test/ruby/test_object.rb: ditto.
+ * test/socket/test_tcp.rb: ditto.
- * process.c (rb_clock_gettime): clock() based CLOCK_PROCESS_CPUTIME_ID
- emulation implemented.
+Thu Dec 3 15:33:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 21 21:02:37 2013 Tanaka Akira <akr@fsij.org>
+ * sprintf.c (rb_str_format): fix wrong shifting position in
+ Rational conversion when not at the beginning of the result.
+ [ruby-core:71806] [Bug #11766]
- * process.c (rb_proc_times): Use RB_GC_GUARD to guard objects from GC.
+Thu Dec 3 14:22:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 21 20:33:01 2013 Tanaka Akira <akr@fsij.org>
+ * range.c (range_to_s): should be infected by the receiver.
+ str2 infects by appending. [ruby-core:71811] [Bug #11767]
- * process.c (get_clk_tck): Extracted from rb_proc_times.
- (rb_clock_gettime): times() based CLOCK_PROCESS_CPUTIME_ID emulation
- is implemented.
+Thu Dec 3 11:57:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 21 19:31:48 2013 Tanaka Akira <akr@fsij.org>
+ * configure.in: separate SET_CURRENT_THREAD_NAME, which can set
+ the name of current thread only, and SET_ANOTHER_THREAD_NAME,
+ which can set the name of other threads.
- * process.c: POSIX_GETTIMEOFDAY_CLOCK_REALTIME is renamed to
- SUS_GETTIMEOFDAY_CLOCK_REALTIME.
+ * thread.c (rb_thread_setname): use SET_ANOTHER_THREAD_NAME. OS X
+ is not possible to set another thread name.
-Wed Aug 21 19:17:46 2013 Tanaka Akira <akr@fsij.org>
+ * thread_pthread.c (native_set_thread_name, thread_timer): use
+ SET_CURRENT_THREAD_NAME.
- * process.c (rb_clock_gettime): CLOCK_PROCESS_CPUTIME_ID emulation
- using getrusage is implemented.
+Wed Dec 02 22:57:46 2015 Koichi Sasada <ko1@atdot.net>
-Wed Aug 21 17:34:27 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h, iseq.h: remove rb_iseq_t::variable_body.
+ Fields in rb_iseq_t::variable_body are contained by
+ rb_iseq_t::body::mark_ary (hidden Array object).
- * gc.c (getrusage_time): Fallback clock_gettime to getrusage when
- clock_gettime fails.
- Reported by Eric Saxby. [ruby-core:56762] [Bug #8805]
+ Index 0 to 2 of mark_ary are reserved by these objects.
-Wed Aug 21 02:32:32 2013 Koichi Sasada <ko1@atdot.net>
+ * iseq.c: catch up this fix.
- * insns.def: fix regexp's once option behavior.
- fix [ruby-trunk - Bug #6701]
+ * compile.c (rb_iseq_original_iseq): trivial rewrite.
- * insns.def: remove `onceinlinecache' and introduce `once' instruction.
- `once' doesn't use `setinlinecache' insn any more.
+Wed Dec 2 17:19:02 2015 Koichi Sasada <ko1@atdot.net>
- * vm_core.h: `union iseq_inline_storage_entry' to store once data.
+ * iseq.h: introduce ISEQ_ORIGINAL_ISEQ() and
+ ISEQ_ORIGINAL_ISEQ_ALLOC() macro.
- * compile.c: catch up above changes.
+ * compile.c: use them to access original iseq buffer.
* iseq.c: ditto.
- * vm.c, vm_insnhelper.c: ditto. fix `m_core_set_postexe()' which
- is depend on `onceinlinecache' insn.
-
- * test/ruby/test_regexp.rb: add tests.
-
- * iseq.c: ISEQ_MINOR_VERSION to 1 (should increment major?)
-
-Wed Aug 21 02:30:15 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_gcdebug_print_obj_condition): add printing information.
-
-Tue Aug 20 13:38:00 2013 Naohisa Goto <ngotogenome@gmail.com>
-
- * test/gdbm/test_gdbm.rb: skip TestGDBM#test_s_open_lock on Solaris.
- On Solaris (and platforms which do not have flock and have lockf),
- with GDBM 1.10, gdbm_open(3) blocks when opening already locked
- gdbm file. [Bug #8790] [ruby-dev:47631]
-
-Tue Aug 20 02:32:52 2013 Zachary Scott <e@zzak.io>
-
- * lib/test/: [DOC] Document Test::Unit, hide most submodules and
- classes from rdoc. Since lib/test is only present as a compatibility
- layer with the legacy test suite many test/unit users will be using
- minitest or the test/unit gem instead. It is recommended to use one
- of these alternatives for writing new tests.
-
- This patch was based on a patch submitted by Steve Klabnik.
- [ruby-core:56694] [Bug #8778]
-
-Tue Aug 20 02:10:19 2013 Zachary Scott <e@zzak.io>
-
- * lib/rss/rss.rb: [DOC] Document for constants by Steve Klabnik
- [ruby-core:56705] [Bug #8798]
-
-Tue Aug 20 02:01:10 2013 Zachary Scott <e@zzak.io>
-
- * lib/rss/xmlparser.rb: [DOC] Hide legacy constant from rdoc
- Patch by Steve Klabnik [ruby-core:56708] [Bug #8799]
-
-Tue Aug 20 01:52:05 2013 Zachary Scott <e@zzak.io>
-
- * ext/socket/unixserver.c: [DOC] Document #accept
- * ext/socket/tcpserver.c: ditto
- * ext/socket/udpsocket.c: [DOC] Fix indentation of documentation
- * ext/socket/socket.c: ditto
- Patches by David Rodr'iguez [ruby-core:56734] [Bug #8802]
-
-Tue Aug 20 01:19:22 2013 Tanaka Akira <akr@fsij.org>
-
- * configure.in: Define ac_cv_func_clock_gettime to yes for mingw*.
+ * vm_core.h: rename iseq field to support this fix.
-Mon Aug 19 21:31:35 2013 Tanaka Akira <akr@fsij.org>
+Wed Dec 2 17:10:32 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/defines.h: Fix a compilation error with
- i586-mingw32msvc-gcc of gcc-mingw32 package on Debian squeeze.
- ruby/missing.h should be included before include/ruby/win32.h
- because struct timespec, used in the clock_gettime declaration in
- include/ruby/win32.h, is defined in ruby/missing.h instead of
- system headers.
+ * iseq.h: introduce ISEQ_FLIP_CNT_INCREMENT() macro.
-Mon Aug 19 20:55:12 2013 Koichi Sasada <ko1@atdot.net>
+ * compile.c (iseq_compile_each): use it.
- * gc.c: fix around GC_DEBUG.
+ * vm_core.h: rename flip_cnt field to support this fix.
- * gc.c (RVALUE::line): should be VALUE. On some environment
- (such as mswin64), `int' introduces alignment mismatch.
+Wed Dec 2 17:05:15 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (newobj_of): add an assertion to check VALUE alignment.
+ * iseq.h: introduce ISEQ_COVERAGE() and ISEQ_COVERAGE_SET() macro.
- * gc.c (aligned_malloc): `&' is low priority than `=='.
+ * compile.c: use them.
- * gc.c: define GC_DEBUG everytime and use it as value 0 or 1.
-
-Mon Aug 19 17:43:44 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_fiber.rb: collect garbage fibers immediately.
-
-Mon Aug 19 17:41:49 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/profile_test_all.rb: add `failed?' information.
-
-Mon Aug 19 17:00:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (retry_fork): retry with GC if ENOMEM occurred, to free
- swap/kernel space.
-
-Mon Aug 19 13:28:47 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h (CLOCK_MONOTONIC): typo.
-
- * win32/win32.c: removed duplicated declarations.
-
-Mon Aug 19 13:03:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (clock_gettime): should not overwrite cache variable
- with different condition. otherwise -lrt is not linked and the link
- fails, after reconfig.
-
-Mon Aug 19 12:56:49 2013 Tanaka Akira <akr@fsij.org>
-
- * process.c (Init_process): Add constants: CLOCK_REALTIME_ALARM and
- CLOCK_BOOTTIME_ALARM.
-
-Sun Aug 18 20:17:41 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * variable.c, vm_method.c: remove dead code.
-
- * test/ruby/test_fiber.rb, test/ruby/test_thread.rb:
- change accordingly.
-
-Sun Aug 18 19:32:26 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * error.c, file.c, gc.c, hash.c, thread.c, variable.c, vm_eval.c, bin/erb:
- $SAFE=4 is obsolete.
-
-Sun Aug 18 14:30:47 2013 Tanaka Akira <akr@fsij.org>
-
- * process.c (rb_clock_gettime): Rename POSIX_TIME_CLOCK_REALTIME to
- ISO_C_TIME_CLOCK_REALTIME.
-
-Sun Aug 18 14:22:45 2013 Tanaka Akira <akr@fsij.org>
-
- * configure.in: Revert r42604. It causes linking librt on systems
- with newer glibc uselessly.
-
-Sun Aug 18 13:18:38 2013 Tanaka Akira <akr@fsij.org>
-
- * process.c (Init_process): Add constants: CLOCK_REALTIME_COARSE,
- CLOCK_MONOTONIC_COARSE and CLOCK_BOOTTIME.
-
-Sun Aug 18 12:41:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (clock_gettime): need to check with -lrt prior to check
- for the function only. otherwise -lrt is not linked and the link
- fails, when ac_cv_func_clock_gettime is cached as yes.
-
-Sun Aug 18 10:05:12 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (rb_big2str1): Make an expression more explicit.
-
-Sun Aug 18 03:18:45 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (rb_big2str1): Use power_level instead of bitsize(xn).
-
-Sun Aug 18 00:44:58 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (BIGDIVREM_EXTRA_WORDS): Redefine to 1.
- (bigdivrem_num_extra_words): Removed.
- (bigdivrem_normal): Simplified.
- (big2str_karatsuba): Ditto.
-
-Sat Aug 17 23:25:19 2013 Benoit Daloze <eregontp@gmail.com>
-
- * test/ruby/test_time.rb: use the in_timezone() helper
- and define it at the top with other helpers.
-
-Sat Aug 17 22:20:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_mload): ignore auxiliary data, offset and zone, if
- invalid. [ruby-core:56648] [Bug #8795]
-
-Sat Aug 17 20:11:49 2013 Benoit Daloze <eregontp@gmail.com>
-
- * process.c: [DOC] MACH_ABSOLUTE_TIME_CLOCK_MONOTONIC is an
- available emulation for a monotonic clock on Darwin.
- https://developer.apple.com/library/mac/qa/qa1398/_index.html
-
-Fri Aug 16 18:12:05 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/profile_test_all.rb: fix typo.
-
-Fri Aug 16 18:09:20 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/profile_test_all.rb: remove space characters from test names.
-
-Fri Aug 16 17:32:02 2013 Koichi Sasada <ko1@atdot.net>
-
- * test/profile_test_all.rb: refactoring memory profiling tool for
- test-all.
- Add profiling targets /proc/meminfo and /proc/self/status.
-
- * test/runner.rb: accept other than 'true'.
-
-Fri Aug 16 11:23:35 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (rb_file_size, rb_file_flock): improve performance of Windows.
-
- * file.c (rb_file_truncate): removed unnecessary #ifdef.
-
- * test/test_file.rb (TestFile#test_truncate_size): added an assertion
- for File#size.
-
-Fri Aug 16 10:07:59 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bigdivrem_single1): Renamed from bigdivrem_single. Add
- x_higher_bdigit argument.
- (bigdivrem_single): Just call bigdivrem_single1.
- (bigdivrem_restoring): Use bigdivrem_single1 to avoid memmove.
-
-Fri Aug 16 09:17:00 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bary_small_rshift): Specify the higher BDIGIT instead of
- sign bit.
- (big_shift3): Follow the above change.
-
-Fri Aug 16 02:20:39 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bary_mul_toom3): Reduce a branch.
-
-Fri Aug 16 02:14:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
-
- * process.c (rb_clock_gettime): add CLOCK_MONOTONIC support on OS X.
- http://developer.apple.com/library/mac/qa/qa1398/_index.html
- [Feature #8658]
-
-Fri Aug 16 01:37:43 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bigdivrem_single): Use shift when y is a power of two.
-
-Fri Aug 16 01:09:33 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bigdivrem_restoring): Use bigdivrem_single if non-topmost
- BDIGITs of y are zero.
-
-Fri Aug 16 00:33:12 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (rb_big2str1): Truncate topmost zeros of x.
-
-Fri Aug 16 00:00:57 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bary_divmod): Simplify an expression.
-
-Thu Aug 15 23:26:12 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bigdivrem_normal): Remove a local variable.
-
-Thu Aug 15 23:08:32 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (big2str_karatsuba): Use bigdivrem_restoring directly to
- reduce working buffer and memory copy.
- (rb_big2str1): Allocate working buffer for big2str_karatsuba here.
-
-Thu Aug 15 20:51:29 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c, internal.h (rb_io_flush_raw): new function to select calling
- fsync() (on Windows).
-
- * io.c (rb_io_flush_raw): use above function.
-
- * file.c (rb_file_truncate): use above function.
-
- * test/ruby/test_file.rb (TestFile#test_truncate_size): test for
- above changes.
-
-Thu Aug 15 18:39:31 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (clock_gettime): improve precision when freq is less
- than and nearly equals 10**9.
-
-Thu Aug 15 17:43:15 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_lazy_sweep): remove heap_increment() here because heap_inc
- may be 0.
-
-Thu Aug 15 16:59:56 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (rb_io_rewind): remove fsync() for Windows to improve the
- performance.
-
-Thu Aug 15 16:30:23 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/fileutils/test_fileutils.rb (TestFileUtils#test_rmdir):
- FileUtils.rmdir ignores Errno::ENOTEMPTY, so, in such cases, this
- assertion is nonsense.
-
-Thu Aug 15 15:49:35 2013 Tanaka Akira <akr@fsij.org>
-
- * process.c (rb_clock_gettime): [DOC] FreeBSD 7.1 supports
- CLOCK_THREAD_CPUTIME_ID.
- http://www.freebsd.org/releases/7.1R/relnotes.html
-
-Thu Aug 15 14:30:23 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h, win32/Makefile.sub, win32/win32.c
- (clock_gettime): [experimental] emulates clock_gettime(2) of posix.
-
-Thu Aug 15 02:32:40 2013 Zachary Scott <e@zzak.io>
-
- * hash.c (rb_hash_aset): [DOC] Document key dup patch by @kachick
- [Fixes GH-382] https://github.com/ruby/ruby/pull/382
-
-Wed Aug 14 14:28:39 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * proc.c (rb_mod_define_method): now they return the symbols of the
- defined methods, not the methods/procs themselves.
- [ruby-dev:42151] [Feature #3753]
-
- * NEWS: documents about above change and def-expr (see r42337).
-
- * test/ruby/test_module.rb: tests about above change.
-
-Wed Aug 14 00:51:14 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bigdivrem_restoring): xn argument removed.
- (bigdivrem_normal): Follow the above change.
-
-Wed Aug 14 00:18:39 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (big_div_struct): Remove xn and j field. Add zn field.
- (bigdivrem1): Follow the above change.
- (bigdivrem_restoring): Ditto.
-
-Tue Aug 13 23:38:17 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (big_div_struct): ynzero field removed.
- (bigdivrem1): Follow the above change.
- (bigdivrem_restoring): Ditto.
-
-Tue Aug 13 23:01:16 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bigdivrem_restoring): Extracted from bigdivrem_normal.
-
-Tue Aug 13 22:12:59 2013 Kenichi Kamiya <kachick1@gmail.com>
-
- * random.c (rb_random_ulong_limited): coerce before check negative.
- [Fixes GH-379]
-
-Tue Aug 13 21:52:15 2013 Kenichi Kamiya <kachick1@gmail.com>
-
- * object.c (Init_Object): undef Module#prepend_features on Class, as
- well as Module#append_features. [Fixes GH-376]
-
- * test_class.rb: Added test for above. And ensure type checking
- on similar methods as module_function.
-
-Tue Aug 13 08:52:18 2013 Zachary Scott <e@zzak.io>
-
- * doc/syntax/literals.rdoc: [DOC] String literal concat by @cknadler
- [Fixes GH-380] https://github.com/ruby/ruby/pull/380
-
-Mon Aug 12 23:07:21 2013 Masaya Tarui <tarui@ruby-lang.org>
-
- * gc.c (gc_marks_test): inhibit gc for st's operation.
-
-Mon Aug 12 15:59:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_whole_match_p): treat CR in middle of a line as a
- mere whitespace.
-
-Mon Aug 12 15:16:58 2013 Koichi Sasada <ko1@atdot.net>
+ * iseq.c: ditto.
- * class.c (rb_prepend_module): make T_ICLASS object shady because
- this T_ICLASS object seems to share method table with other class
- objects. It was causes WB miss.
- TODO: need to know the data structure.
+ * iseq.c (rb_iseq_coverage): added.
- * test/ruby/test_module.rb: add a test for WB miss.
+ * thread.c (update_coverage): use rb_iseq_coverage().
-Mon Aug 12 13:47:54 2013 Zachary Scott <e@zzak.io>
+ * vm_core.h: rename coverage field name to support this fix.
- * process.c: [DOC] RDoc formatting of Process.clock_gettime
+Wed Dec 2 17:00:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Aug 12 13:29:09 2013 Zachary Scott <e@zzak.io>
+ * encoding.c (enc_name, rb_enc_name_list_i, rb_enc_aliases_enc_i):
+ make fstring instead of making each copies.
- * lib/yaml/dbm.rb: [DOC] Document call-seq for YAML::DBM
+Wed Dec 2 16:32:08 2015 Koichi Sasada <ko1@atdot.net>
-Mon Aug 12 12:57:26 2013 Zachary Scott <e@zzak.io>
+ * iseq.h: introduce ISEQ_COMPILE_DATA() macro.
- * ext/dbm/extconf.rb: [DOC] Hide from RDoc
- Some libraries might want to document extconf.rb so RDoc treats it
- like any other ruby program. However, DBM users shouldn't care about
- these methods.
+ * compile.c, iseq.c: use ISEQ_COMPILE_DATA().
-Mon Aug 12 12:53:39 2013 Zachary Scott <e@zzak.io>
+ * vm_core.h: rename compile_data field to support this fix.
- * ext/dbm/dbm.c: [DOC] Reformat headings of DBM class
+Wed Dec 2 16:27:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Aug 12 12:46:31 2013 Zachary Scott <e@zzak.io>
+ * encoding.c (enc_m_loader): defer finding encoding object not to
+ be infected by marshal source. [ruby-core:71793] [Bug #11760]
- * lib/yaml.rb, lib/yaml/: [DOC] Document YAML::DBM#key and add
- references to similar methods with more detail. This patch brings
- lib/yaml to 100% documentation coverage.
+ * marshal.c (r_object0): enable compatible loader on USERDEF
+ class. the loader function is called with the class itself,
+ instead of an allocated object, and the loaded data.
-Mon Aug 12 02:51:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * marshal.c (compat_allocator_table): initialize
+ compat_allocator_tbl on demand.
- * ext/readline/readline.c (readline_s_set_input): on OS X with editline,
- Readline.readline doesn't work because readline_get doesn't use
- rl_getc. The difference is introduced by r42402 [ruby-dev:47509]
- [Bug #8644]. Before it rb_io_stdio_file set ifp->stdio_file.
- Therefore add manually setting the value.
+ * object.c (rb_undefined_alloc): extract from rb_obj_alloc.
- * ext/readline/readline.c (readline_s_set_output): ditto.
+Wed Dec 2 15:12:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Aug 11 23:27:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: Fixed double negative comments.
+ [Bug #11698][ruby-core:71506]
- * file.c (rb_str_encode_ospath): OS path encoding on Mac OS X is also
- fixed.
+Wed Dec 2 14:55:01 2015 yui-knk <spiketeika@gmail.com>
-Sun Aug 11 22:57:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_string.rb: removed non executing tests.
+ [Misc #11757][ruby-dev:49397]
- * test/ruby/test_require.rb (assert_require_nonascii_path): OS path
- encoding on Windows is fixed, so encoding of __FILE__ should be it.
- [ruby-core:56498] [Bug #8764]
+Wed Dec 2 11:23:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Aug 11 19:11:45 2013 Kouhei Sutou <kou@cozmixng.org>
+ * lib/csv.rb: enable frozen_string_literal.
+ [fix GH-1116] Patch by @marshall-lee
- * test/rexml/parser/test_sax2.rb: Expand abbreviated class name.
+Wed Dec 2 10:36:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Aug 11 19:06:03 2013 Kouhei Sutou <kou@cozmixng.org>
+ * ext/bigdecimal/bigdecimal.c: Fix double word typo.
+ [ci skip][fix GH-1120] Patch by @jwworth
- * lib/rexml/sax2listener.rb (REXML::SAX2Listener#notationdecl): Fix
- wrong number of arguments in the template listener.
- [Bug #8731] [ruby-dev:47582]
- Reported by Ippei Obayashi.
- * test/rexml/parser/test_sax2.rb: Add tests for parsing notation
- declarations with SAX2 API.
+Wed Dec 2 07:43:51 2015 Eric Wong <e@80x24.org>
-Sun Aug 11 18:44:04 2013 Kouhei Sutou <kou@cozmixng.org>
+ * ext/openssl/ossl_ssl.c (mSSLExtConfig): make static
+ (eSSLError): ditto
+ (ID_callback_state): ditto
+ (ossl_ssl_ex_vcb_idx): ditto
+ (ossl_ssl_ex_store_p): ditto
+ (ossl_ssl_ex_ptr_idx): ditto
+ * ext/openssl/ossl_ssl.h: remove extern declarations for
+ mSSLExtConfig and eSSLError
- * lib/rexml/sax2listener.rb (REXML::SAX2Listener#elementdecl): Fix wrong
- examples. [Bug #8731] [ruby-dev:47582]
- Reported by Ippei Obayashi.
+Wed Dec 2 07:41:08 2015 Eric Wong <e@80x24.org>
-Sun Aug 11 18:42:13 2013 Kouhei Sutou <kou@cozmixng.org>
+ * missing/explicit_bzero.c (explicit_bzero): fixup r52839
+ for compilers with "weak" attribute
- * lib/rexml/parsers/sax2parser.rb
- (REXML::Parsers::SAX2Parser#handle_entitydecl): Extract.
+Wed Dec 2 06:47:25 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 11 18:40:25 2013 Kouhei Sutou <kou@cozmixng.org>
+ * missing/explicit_bzero.c: add ruby_explicit_bzero_hook_unused
+ for preventing optimization. Inspired from OpenBSD.
- * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):
- Fix wrong "%" position in parameter entity declaration event argument.
- * test/rexml/parser/test_sax2.rb: Add tests for the above case.
+Tue Dec 1 23:36:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Aug 11 18:08:40 2013 Kouhei Sutou <kou@cozmixng.org>
+ * thread.c (rb_thread_setname): allow to reset thread name.
- * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):
- Support NDATA in external ID entity declaration.
- * test/rexml/parser/test_sax2.rb: Add tests for the above case.
+Tue Dec 1 23:14:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Aug 11 18:07:39 2013 Kouhei Sutou <kou@cozmixng.org>
+ * thread.c (rb_thread_setname): check the argument if valid
+ string. [ruby-core:71774] [Bug #11756]
- * lib/rexml/parsers/baseparser.rb
- (REXML::Parsers::BaseParser#pull_event): Support optional NDATA
- in external ID entity declaration.
+Tue Dec 1 17:13:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Aug 11 17:54:07 2013 Kouhei Sutou <kou@cozmixng.org>
+ * string.c (rb_string_value_cstr): should not raise on frozen
+ string.
- * NEWS (REXML::Parsers::SAX2Parser): Add about this change.
- * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):
- Fix wrong number of arguments. Document says "an array of the
- entity declaration" but it passes two or more arguments.
- This is a bug but it break backward compatibility.
- Reported by Ippei Obayashi. [Bug #8731] [ruby-dev:47582]
- * lib/rexml/sax2listener.rb (REXML::SAX2Listener#entitydecl): ditto.
- The listener template accepted two arguments.
- * test/rexml/parser/test_sax2.rb: Add tests for external ID case.
+Tue Dec 1 09:35:29 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 11 17:41:41 2013 Kouhei Sutou <kou@cozmixng.org>
+ * missing/explicit_bzero.c: add a few comment.
- * test/rexml/parser/test_sax2.rb: Add SAX2 API test.
+Tue Dec 1 09:31:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 11 15:10:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * missing/explicit_bzero.c: add disabling optimization on gcc.
- * parse.y (rb_enc_symname_type): allow ID_ATTRSET for ID_INSTANCE,
- ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756]
+Tue Dec 1 07:50:33 2015 Eric Wong <e@80x24.org>
-Sun Aug 11 13:17:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * missing/explicit_bzero.c: new file. define explicit_bzero.
+ Fixup r52806
- * include/ruby/encoding.h: Reduce ENCODING_INLINE_MAX to 127 as this
- should be sufficient to represent all the encodings Ruby supports.
+Thu Oct 22 12:54:43 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 11 11:54:38 2013 Tanaka Akira <akr@fsij.org>
+ * thread_pthread.c (register_ubf_list): renamed from
+ add_signal_thread_list.
+ * thread_pthread.c (unregister_ubf_list): renamed
+ from remove_signal_thread_list.
+ * thread_pthread.c (ubf_wakeup_all_threads): renamed from
+ ping_signal_thread_list.
+ * thread_pthread.c (ubf_wakeup_thread): renamed from
+ ubf_select_each.
+ * thread_pthread.c (ubf_threads_empty): renamed from
+ check_signal_thread_list().
+ * thread_pthread.c (ubf_list_lock): renamed from
+ signal_thread_list_lock.
- * process.c (rb_clock_gettime): New method.
- This is accepted in the meeting:
- https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130809
- This method is accepted as a CRuby feature.
- I.e. Other Ruby implementations don't need to implement it.
- [ruby-core:56087] [Feature #8658]
+ * thread_pthread.c (register_ubf_list): large simplification
+ by using ccan/list.h.
+ bonus: removed malloc() and exit(EXIT_FAILURE).
+ * thread_pthread.c (unregister_ubf_list): ditto.
+ * thread_pthread.c (ubf_threads_empty): ditto.
+ * thread_pthread.c (ubf_wakeup_all_threads): ditto.
-Sun Aug 11 10:40:48 2013 Zachary Scott <e@zzak.io>
+ * thread_pthread.c (print_signal_list): removed.
- * lib/time.rb: [DOC] Correcting rdoc visibility of time.rb constants
- Reported by Tanaka Akira [ruby-core:56517]
+Thu Oct 22 08:03:49 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 11 04:48:14 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_rand.rb (TestRand#test_default_seed): add
+ srand case.
- * file.c (rb_str_normalize_ospath):
- HFS Plus (Mac OS Extended) uses a variant of Normal Form D in which
- U+2000 through U+2FFF, U+F900 through U+FAFF, and U+2F800 through
- U+2FAFF are not decomposed (this avoids problems with round trip
- conversions from old Mac text encodings).
- http://developer.apple.com/library/mac/qa/qa1173/_index.html
- Therefore fix r42457 to exclude the range.
+Thu Oct 22 06:33:38 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 11 03:26:07 2013 Tanaka Akira <akr@fsij.org>
+ * random.c (InitVM_Random): move Random::DEFAULT initialization
+ bits to Init_Random_default.
+ * random.c (Init_Random_default): renamed from Init_RandomSeed2.
+ * random.c (Init_RandomSeedCore): renamed from Init_RandomSeed.
- * bignum.c (bitsize): Fix a conditional expression.
+Thu Oct 22 06:20:48 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Aug 11 02:44:03 2013 Zachary Scott <e@zzak.io>
+ * random.c (Init_RandomSeed): move all Random::DEFAULT
+ construction bits to Init_RandomSeed2. Random::DEFAULT
+ and Ruby internal hashes are no longer shared their seed.
+ * random.c (Init_RandomSeed2): ditto. And, kill evil
+ rb_obj_reveal() stuff.
- * lib/time.rb: [DOC] Document constants by @markijbema [Fixes GH-377]
- https://github.com/ruby/ruby/pull/377
+ * random.c (init_hashseed): add MT argument.
+ * random.c: (init_siphash): ditto.
-Sun Aug 11 01:28:52 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_rand.rb (TestRand#test_default_seed): new
+ test for Random::DEFAULT::seed.
- * configure.in: Revert r42458.
- It removes the HAVE_CLOCK_GETTIME from config.h.
- http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20130809T044800Z.diff.html.gz
+Thu Oct 22 05:23:48 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Aug 10 13:53:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * random.c (init_hashseed, init_siphash): extract initialize
+ functions.
- * parse.y (rb_id_attrset): allow other than ID_ATTRSET.
+Thu Oct 22 01:01:34 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * parse.y (intern_str): ditto. try stem ID for ID_INSTANCE,
- ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756]
+ * configure.in: sort AC_CHECK_HEADERS() by alphabetical order.
-Sat Aug 10 12:49:50 2013 Kouhei Sutou <kou@cozmixng.org>
+Thu Oct 22 00:19:07 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rexml/parsers/baseparser.rb
- (REXML::Parsers::BaseParser::CDATA_END): Use "\A" instead of "^".
- It is not an used constant but I fix it. (Or should I remove it?)
+ * random.c (init_randomseed): remove "initial" argument. It never
+ be used from outside of this function.
-Sat Aug 10 12:47:19 2013 Kouhei Sutou <kou@cozmixng.org>
+Thu Oct 22 00:12:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):
- Fix wrong constant name. "]>" pattern match is the same but
- it is used for "<!DOCTYPE" end mark not "<![CDATA[" end mark.
+ * lib/securerandom.rb (SecureRandom::gen_random): use /dev/urandom
+ for initialize OpenSSL's rand.
-Sat Aug 10 12:43:15 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 21 12:10:04 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):
- Use "\A" instead of "^" in document type declaration patterns
- because they are used as the head match in content not the head
- match in line. They don't cause any problems in the current code
- but it should be fixed.
+ * ext/openssl/ossl_rand.c (ossl_rand_bytes): RAND_bytes could
+ be return -1 as an error. Therefore, added error handling.
+ * ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto.
-Sat Aug 10 12:39:00 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 21 09:04:09 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/rexml/parse/test_document_type_declaration.rb: Add tests for
- parsing document type declaration.
+ * include/ruby/util.h: remove a warning suppression C4723
+ (potential divide by zero) for VisualC++. It's meaningless.
+ Before r26197, there is ruby_div0() in this place and it
+ actually made divide by zero. But now it's just garbage.
-Sat Aug 10 12:00:45 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 21 08:23:36 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::SYSTEM):
- Fix loose "head" match regular expression. It doesn't cause any
- problem in the current code but it should be fixed because readers
- may confuse it.
- Patch by Ippei Obayashi. Thanks!!!
+ * random.c: random_raw_seed don't use GRND_NONBLOCK. GRND_NONBLOCK
+ mean the result might not have an enough cryptic strength and
+ easy predictable. That's no good for SecureRandom.
-Sat Aug 10 11:58:24 2013 Kouhei Sutou <kou@cozmixng.org>
+Sun Oct 18 17:26:53 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/rexml/parse/test_notation_declaration.rb (#test_system_public):
- Add a test for PUBLIC notation and SYSTEM notation order case.
+ * common.mk: add a rule for explicit_bzero.o.
+ * configure.in: detect explicit_bzero and memset_s.
+ * include/ruby/missing.h: add explicit_bzero.
+ * random.c (init_randomseed): use explicit_bzero() instead of
+ memset(). memset could be eliminated by compiler optimization.
-Sat Aug 10 11:31:35 2013 Kouhei Sutou <kou@cozmixng.org>
+Mon Nov 30 18:46:44 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::PUBLIC):
- Fix loose "head" match regular expression.
- [Bug #8701] [ruby-dev:47551]
- Patch by Ippei Obayashi. Thanks!!!
- * test/rexml/parse/test_notation_declaration.rb (#test_system_public):
- Add a test for the above case.
+ * ext/readline/extconf.rb: call dir_config("libedit")
+ if --enable-libedit is specified. [Bug #11751]
+ patched by John Hein
-Sat Aug 10 09:20:21 2013 Zachary Scott <e@zzak.io>
+Mon Nov 30 08:44:29 2015 Eric Wong <e@80x24.org>
- * NEWS: [DOC] typo in example reported by @moretea
- https://github.com/ruby/ruby/commit/a39e724#commitcomment-3831489
+ * variable.c: remove spurious #define for globals
+ [ruby-core:71735] [Feature #11749]
-Sat Aug 10 09:19:04 2013 Zachary Scott <e@zzak.io>
+Sun Nov 29 09:13:03 2015 Conor Landry <clandry94@gmail.com>
- * proc.c: [DOC] rdoc code formatting
+ * NEWS: [DOC] Various grammar corrections and clarifications to
+ increase readability. [Fix GH-1115]
-Sat Aug 10 09:12:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 28 19:33:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (rb_id_attrset): check if the argument is valid type as an
- attribute.
+ * parse.y (parser_here_document): store dispatched result of
+ on_tstring_content at the last fragment of a here document.
-Sat Aug 10 05:44:08 2013 Zachary Scott <e@zzak.io>
+Fri Nov 27 19:19:44 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss/trackback.rb: [DOC] Hide RSS::Trackback from rdoc
- Patch by Steve Klabnik [Bug #8755] [ruby-core:56456]
+ * lib/net/http.rb (connect): detect closed connection and reconnect
+ If the server closes a keep-alive http connection, the client socket
+ reaches EOF. To avoid an EOFError, detect the closed connection and
+ reconnect.
+ Added test to ensure HTTP#post succeeds even if the
+ keep-alive-connection has been closed by the server.
+ by Kristian Hanekamp <kris.hanekamp@gmail.com>
+ https://github.com/ruby/ruby/pull/1089 fix GH-1089
-Sat Aug 10 04:52:21 2013 Tanaka Akira <akr@fsij.org>
+Thu Nov 26 21:36:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (big_div_struct): Use size_t.
- (bigdivrem1): Ditto.
- (bigdivrem_num_extra_words): Ditto.
- (bigdivrem_single): Ditto.
- (bigdivrem_normal): Ditto.
- (bary_divmod): Ditto.
+ * compile.c (iseq_peephole_optimize): enable tail call
+ optimization for specialized indexers.
-Fri Aug 9 23:47:15 2013 Kouhei Sutou <kou@cozmixng.org>
+ * compile.c (iseq_compile_each): blockiseq should be NULL, but not
+ Qnil.
- * lib/rss/rexmlparser.rb: Remove needless REXML version check.
- Both RSS Parser and REXML are bundled in Ruby. RSS Parser can
- always use the latest REXML. [Bug #8754] [ruby-core:56454]
- Patch by Steve Klabnik. Thanks!!!
+Thu Nov 26 17:22:53 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Aug 9 22:51:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:
+ Merge Onigmo 58fa099ed1a34367de67fb3d06dd48d076839692
+ + https://github.com/k-takata/Onigmo/pull/52
- * configure.in (XLDFLAGS, LIBRUBYARG_STATIC): CoreFoundation framework
- option is now needed always, regardless enable-shared.
- [ruby-core:56467] [Bug #8759]
+Thu Nov 26 09:50:02 2015 yui-knk <spiketeika@gmail.com>
-Fri Aug 9 22:20:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/coverage/test_coverage.rb: Added test-case for Coverage.restart.
+ [Misc #11732][ruby-dev:49379]
- * ruby.c (load_file_internal): use rb_parser_compile_string_path and
- rb_parser_compile_file_path, String path name versions. [Bug #8753]
+Thu Nov 26 09:46:36 2015 yui-knk <spiketeika@gmail.com>
-Fri Aug 9 07:16:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * test/coverage/test_coverage.rb: Added test-case for Coverage.peek_result
+ without Coverage.start. [Misc #11726][ruby-core:71622]
- * ext/io/console/console.c: delete redefinition of rb_cloexec_open.
- drop support for 1.8 and 1.9 from the next release of io-console gem.
+Thu Nov 26 07:22:55 2015 Eric Wong <e@80x24.org>
-Fri Aug 9 19:13:54 2013 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_ssl.rb (test_copy_stream): new test
- * NEWS: update about new methods for Binding.
+Wed Nov 25 21:23:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 9 18:48:09 2013 Koichi Sasada <ko1@atdot.net>
+ * io.c (copy_stream_body): try to_io conversion before read,
+ readpartial, and write methods. [ruby-dev:49008] [Bug #11199]
- * proc.c: add Binding#local_variable_get/set/defined?
- to access local variables which a binding contains.
- Most part of implementation by nobu.
+Wed Nov 25 10:55:21 2015 Shugo Maeda <shugo@ruby-lang.org>
- * test/ruby/test_proc.rb: add a tests for above.
+ * io.c (argf_getpartial): should not resize str if the second
+ argument is not given.
+ [ruby-core:71668] [Bug #11738]
- * vm.c, vm_core.h (rb_binding_add_dynavars): add a new function
- to add a new environment to create space for new local variables.
+Tue Nov 24 23:56:25 2015 Naohisa Goto <ngotogenome@gmail.com>
-Fri Aug 9 14:02:01 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * configure.in: On Solaris, it is safe to define _LARGEFILE_SOURCE
+ when _FILE_OFFSET_BITS=64 is defined (= when 32-bit compile).
- * tool/make-snapshot: Fix order of priority for option parameter.
+Tue Nov 24 10:00:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Aug 9 12:06:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/installer.rb: Fix two double-word typos.
+ [ci skip][fix GH-1108] Patch by @jwworth
- * file.c (rb_str_normalize_ospath): normalize to Normalization Form C
- using CFString.
+Tue Nov 24 09:17:02 2015 Alexander von Gluck IV <kallisti5@unixzen.com>
-Fri Aug 9 10:53:57 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * beos: Drop support for BeOS now that Haiku is stable.
+ [Fix GH-1112]
- * time.c (get_timeval, get_new_timeval): use rb_obj_class()
- instead of CLASS_OF() because CLASS_OF() may return
- a singleton class.
+Tue Nov 24 09:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 9 10:42:11 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * internal.h (rb_gc_for_fd): move to export, as referred by
+ ext/socket.
- * vm_insnhelper.c (vm_invoke_block): returning from lambda proc
- now always exits from the Proc. [ruby-core:56193] [Feature #8693]
+Tue Nov 24 09:04:29 2015 David Rodriguez <deivid.rodriguez@gmail.com>
- * NEWS, test/ruby/test_lambda.rb: ditto. Patch by nobu.
+ * file.c: [DOC] add a missing period to File docs, to terminate
+ the sentence and separate from the next sentence. [Fix GH-1111]
-Fri Aug 9 00:10:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 24 08:30:06 2015 JuanitoFatas <katehuang0320@gmail.com>
- * enumerator.c (lazy_zip_func): fix non-single argument. fix
- out-of-bound access and pack multiple yielded values.
- [ruby-core:56383] [Bug #8735]
+ * NEWS: Fix the issue number of `Struct#dig`, which should be
+ [Feature #11688]. [Fix GH-1110]
-Thu Aug 8 23:01:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 24 07:56:54 2015 Eric Wong <e@80x24.org>
- * object.c (rb_mod_singleton_p): new method Module#singleton_class? to
- return whether the receiver is a singleton class or not.
- [ruby-core:51087] [Feature #7609]
+ * ext/socket/init.c (rsock_s_accept): handle ENOMEM
-Thu Aug 8 21:56:44 2013 Tanaka Akira <akr@fsij.org>
+Tue Nov 24 07:50:15 2015 Eric Wong <e@80x24.org>
- * time.c (time_overflow_p): Avoid signed integer overflow.
- (rb_time_new): Fix overflow condition.
+ * dir.c (dir_initialize): use rb_gc_for_fd for ENOMEM
+ * ext/socket/init.c (rsock_socket): ditto
+ * ext/socket/socket.c (rsock_socketpair): ditto
+ * internal.h (rb_gc_for_fd): prototype
+ * io.c (rb_gc_for_fd): remove static
+ [ruby-core:71623] [Feature #11727]
-Thu Aug 8 19:58:02 2013 Koichi Sasada <ko1@atdot.net>
+Tue Nov 24 06:46:27 2015 Eric Wong <e@80x24.org>
- * thread.c (rb_threadptr_pending_interrupt_check_mask):
- use RARRAY_RAWPTR() instead of RARRAY_PTR() because
- there is no new reference.
+ * io.c (rb_gc_for_fd): new helper function
+ (ruby_dup): use rb_gc_for_fd
+ (rb_sysopen): ditto
+ (rb_fdopen): ditto
+ (rb_pipe): ditto
+ [ruby-core:71623] [Feature #11727]
-Thu Aug 8 19:56:52 2013 Koichi Sasada <ko1@atdot.net>
+Tue Nov 24 05:13:35 2015 Eric Wong <e@80x24.org>
- * string.c (rb_str_format_m): use RARRAY_RAWPTR() instead of
- RARRAY_PTR() because there is no new reference.
+ * ext/fiddle/function.c (struct nogvl_ffi_call_args):
+ new struct for GVL release
+ (nogvl_ffi_call): new function
+ (function_call): adjust for GVL release
+ [ruby-core:71642] [Feature #11607]
+ * ext/fiddle/closure.c (struct callback_args):
+ new struct for GVL acquire
+ (with_gvl_callback): adjusted original callback function
+ (callback): wrapper for conditional GVL acquire
+ * ext/fiddle/depend: add dependencies
+ * ext/fiddle/extconf.rb: include top_srcdir for internal.h
+ * internal.h (ruby_thread_has_gvl_p): expose for fiddle
+ * vm_core.h (ruby_thread_has_gvl_p): moved to internal.h
+ * test/fiddle/test_function.rb (test_nogvl_poll): new test
-Thu Aug 8 19:55:51 2013 Koichi Sasada <ko1@atdot.net>
+Mon Nov 23 19:53:12 2015 Naohisa Goto <ngotogenome@gmail.com>
- * include/ruby/ruby.h: define USE_RGENGC_LOGGING_WB_UNPROTECT.
+ * configure.in: On Solaris, with gcc, "-std=iso9899:1999"
+ in $ansi_options is often also needed in CPPFLAGS,
+ because some feature definitions vary depending on such
+ standards options.
-Thu Aug 8 16:44:25 2013 Koichi Sasada <ko1@atdot.net>
+Mon Nov 23 12:54:39 2015 Hamish Morrison <hamishm53@gmail.com>
- * include/ruby/ruby.h: add old macro name `RUBY_EVENT_SWITCH'.
- This macro name is obsolete because it is renamed to
- RUBY_INTERNAL_EVENT_SWITCH, but it has compatibility problem
- using this macro name like ruby-prof.
- I want to remove this macro after ruby 2.1.
+ * configure.in: remove obsolete workarounds for Haiku.
-Thu Aug 8 15:37:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * dln.c, file.c, io.c: remove obsolete Haiku workarounds.
- * test/coverage/test_coverage.rb (TestCoverage#test_big_code): use `1'
- instead of `p' to get rid of a side effect.
- Kernel#p without any argument seems to do nothing, but flushes stdout.
- and, if stdout is redirected to file, fsync() will be called on
- Windows. so, when running test-all on Windows with redirection, such
- as CI environment, this test took a lot of time.
+ * thread_pthread.c: add stack bounds detection for Haiku.
-Thu Aug 8 14:54:18 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * signal.c: get stack pointer from signal context on Haiku.
+ [ruby-core:67923] [Bug #10811] [Fix GH-1109]
- * NEWS: add description of incompatibility introduced by r42396.
- [ruby-core:56329] [Bug #8722]
+Mon Nov 23 11:44:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Aug 8 14:50:36 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * gems/bundled_gems: bump version to minitest-5.8.3
- * common.mk (mini): portable target to build miniruby
+Mon Nov 23 08:55:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * common.mk (bisect): run git-bisect with miniruby
+ * ChangeLog: fix wrong reference for r52714
- * common.mk (bisect-ruby): run git-bisect with ruby
+Sun Nov 22 22:23:37 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * tool/bisect.sh: script for git-bisect
+ * gc.c (rb_raw_obj_info): fix compile errors when USE_RGENGC
+ is 0.
-Thu Aug 8 12:11:43 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Nov 22 21:58:09 2015 Naohisa Goto <ngotogenome@gmail.com>
- * test/webrick/test_httpresponse.rb (test_send_body_*_chunked): these
- expectations assumes that the IOs are binmode. fixed test failures
- introduced at r42427 on Windows.
+ * lib/cmath.rb: methods which has suffix '!' are now deprecated.
+ Re-apply r52469 made by Kazuki Tanaka, with fixing bug about
+ mathn.rb compatibility. [ruby-core:68528] [Feature #10974]
-Thu Aug 8 10:27:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 22 19:36:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * range.c (range_last): revert r42400. [Bug #8739]
+ * ext/openssl/ossl.c: fix brew command for installation of openssl.
+ [ci skip][fix GH-1107] Patch by @arthurnn
-Thu Aug 8 10:26:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 22 17:59:50 2015 Naohisa Goto <ngotogenome@gmail.com>
- * file.c (rb_str_normalize_ospath): extract and move from dir.c.
+ * configure.in: On Solaris, add -D_XOPEN_SOURCE=n only when both
+ AC_TRY_CPP and AC_TRY_COMPILE pass, because some options
+ (e.g. -std=iso9899:1999) are not set when running C preprocessor
+ or building ext.
-Thu Aug 8 05:59:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Sun Nov 22 16:53:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/openssl/test_ssl.rb: Fix test for CVE-2013-4073.
- Patch by Antonio Terceiro. [Bug #8750] [ruby-core:56437]
+ * compile.c (iseq_peephole_optimize): remove unreachable code
+ chunk after jump/leave.
-Thu Aug 8 03:37:38 2013 Eric Hodel <drbrain@segment7.net>
+ * parse.y: move dead code elimination of logical operation to
+ compile.c. not to warn logical operation of literal constants.
- * lib/webrick/httpresponse.rb: Allow #body to be an IO-like object
- that responds to #readpartial and #read.
- [ruby-trunk - Feature #8155]
- * NEWS: NEWS for above
- * test/webrick/test_httpresponse.rb: Tests for above.
+Sun Nov 22 16:37:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 7 23:06:26 2013 Akinori MUSHA <knu@iDaemons.org>
+ * compile.c (iseq_peephole_optimize): eliminate always/never
+ branches after a literal object and when the value is used after
+ the branch.
- * ruby.c (Process.argv0): New method to return the original value
- of $0. [Feature #8696]
+Sun Nov 22 01:23:43 2015 Naohisa Goto <ngotogenome@gmail.com>
-Wed Aug 7 23:05:55 2013 Akinori MUSHA <knu@iDaemons.org>
+ * configure.in: Add -D_XOPEN_SOURCE=500 (or 600 or 700) on Solaris
+ if available, mainly for enabling some features in sockets.
- * ruby.c (Process.setproctitle): New method to change the title of
- the running process that is shown in ps(1). [Feature #8696]
+Sun Nov 22 00:17:22 2015 Naohisa Goto <ngotogenome@gmail.com>
-Wed Aug 7 20:05:38 2013 Tanaka Akira <akr@fsij.org>
+ * test/socket/test_socket.rb (test/socket/test_socket.rb): skip
+ the test when Socket::SO_TIMESTAMP is not defined. Fix error
+ on Solaris 10. [Bug #11728] [ruby-dev:49377]
- * bignum.c (rb_big_odd_p): Check the bignum length.
- (rb_big_even_p): Ditto.
+Sat Nov 21 18:57:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 7 19:29:26 2013 Tanaka Akira <akr@fsij.org>
+ * ruby.c (need_argument): move frozen-string-literal-debug option
+ from --enable to --debug. [Feature #11725]
- * bignum.c (dbl2big): A condition simplified.
+ * ruby.c (proc_options): fix pointer overrun. do not advance argv
+ until it is valid.
-Wed Aug 7 16:34:30 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Nov 21 13:59:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * test/webrick/test_cgi.rb (TestWEBrickCGI#{start_cgi_server,test_cgi}):
- mswin is not only mswin32 but also mswin64. [Bug #8746]
+ * ext/digest/sha1/extconf.rb: OpenSSL's struct name for SHA1 is
+ SHA_CTX. http://openssl.org/docs/man0.9.8/crypto/SHA1.html
-Wed Aug 7 16:19:12 2013 Koichi Sasada <ko1@atdot.net>
+Sat Nov 21 13:31:52 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * cont.c (rb_fiber_start): use RARRAY_RAWPTR() instead of
- RARRAY_PTR() because there is no new reference.
+ * ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid
+ including ext/digest/extconf.h. [Bug #3231]
+ https://msdn.microsoft.com/library/36k2cdd4.aspx
- * proc.c (curry): ditto.
+ * ext/digest/*/extconf.rb: remove ext/digest from include search path
+ to avoid confusion of cl.exe.
- * proc.c (rb_proc_call): remove line break.
+ * ext/digest/*/*.[ch]: explicitly specify def.h's path.
-Wed Aug 7 13:20:12 2013 Koichi Sasada <ko1@atdot.net>
+Sat Nov 21 13:05:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * random.c (random_load): use RARRAY_RAWPTR() instead of
- RARRAY_PTR() because there is no new reference.
+ * ext/openssl/ossl.h: LibreSSL doesn't have and need e_os2.h.
-Wed Aug 7 12:58:23 2013 Koichi Sasada <ko1@atdot.net>
+Sat Nov 21 09:18:10 2015 Koichi Sasada <ko1@atdot.net>
- * thread.c (thread_start_func_2): use RARRAY_RAWPTR() instead of
- RARRAY_PTR() because there is no new reference.
+ * thread_sync.c: reduce the specification of Queue#close.
+ * Queue#close accepts no arguments.
+ * deq'ing on closed queue returns nil, always.
+ [Feature #10600]
-Wed Aug 7 09:00:24 2013 Zachary Scott <e@zzak.io>
+ * test/thread/test_queue.rb: catch up this fix.
- * string.c: [DOC] Description of rb_str_equal [Fixes GH-375]
- Based on a patch by @markijbema
- https://github.com/ruby/ruby/pull/375
+Sat Nov 21 08:44:21 2015 Koichi Sasada <ko1@atdot.net>
-Wed Aug 7 08:30:38 2013 Zachary Scott <e@zzak.io>
+ * compile.c (iseq_compile_each): add debug information to NODE_STR
+ strings as default.
+ [Feature #11725]
- * ext/openssl/ossl_hmac.c: [DOC] Documentation for OpenSSL::HMAC
- based on a patch by @repah documenting-ruby/ruby#14
- https://github.com/documenting-ruby/ruby/pull/14
+ * insns.def (freezestring): add new instruction to support adding
+ debug information for dynamically constructed strings.
-Wed Aug 7 07:46:23 2013 Zachary Scott <e@zzak.io>
+ * compile.c (iseq_compile_each): support adding debug information
+ for NODE_DSTR with freezestring instruction.
- * lib/rss/utils.rb: [DOC] RSS::Utils by Steve Klabnik [Bug #8745]
+ * error.c (rb_error_frozen): change the debug information ID name
+ id_debug_created_info and this field should have a 2 element array
+ containing path and line information.
-Wed Aug 7 07:38:39 2013 Tanaka Akira <akr@fsij.org>
+ * defs/id.def: ditto.
- * bignum.c (nlz16): Removed.
- (nlz32): Ditto.
- (nlz64): Ditto.
- (nlz128): Ditto.
- (nlz_int): New function.
- (nlz_long): New function.
- (nlz_long_long): New function.
- (nlz_int128): New function.
- (nlz): Follow above changes.
- (bitsize): Follow above changes.
+ * test/ruby/test_rubyoptions.rb: catch up this fix.
-Tue Aug 6 22:38:15 2013 Zachary Scott <e@zzak.io>
+ * test/ruby/test_iseq.rb: now frozen strings are not same.
- * time.c: [DOC] Typo in Time overview by @sparr [Fixes GH-374]
- https://github.com/ruby/ruby/pull/374
+Sat Nov 21 04:34:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 6 22:35:32 2013 Zachary Scott <e@zzak.io>
+ * symbol.c (rb_str_intern): should not freeze the receiver itself
+ unexpectedly. [ruby-core:71611] [Bug #11721]
- * lib/rss/1.0.rb: [DOC] Document RSS10 by Steve Klabnik [Bug #8740]
+Fri Nov 20 23:15:18 2015 Naotoshi Seo <sonots@gmail.com>
-Tue Aug 6 22:14:11 2013 Kouji Takao <kouji.takao@gmail.com>
+ * lib/logger.rb: expose logger mutex
+ [fix GH-541] Patch by @arthurnn
- * ext/readline/readline.c (readline_s_delete_text): remove
- checking "$SAFE == 4".
+Fri Nov 20 15:05:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/readline/readline.c: fix rdoc, remove "Raises SecurityError"
- and add "Raises NotImplementedError".
+ * Added missing reference of GitHub
-Tue Aug 6 22:04:38 2013 Kouji Takao <kouji.takao@gmail.com>
+Fri Nov 20 14:57:01 2015 Trevor Rowe <trevorrowe@gmail.com>
- * ext/readline/readline.c, test/readline/test_readline.rb: fix
- indent.
+ * lib/net/http.rb: Fixed regression for Net::HTTP::PUT with "Expect-100"
+ header. [fix GH-949]
+ * test/net/http/test_http.rb: added test.
-Tue Aug 6 21:59:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 20 14:39:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * range.c (range_last): return nil for empty range, or in the case the
- predecessor is smaller than the begin. [Bug #8739]
+ * lib/net/http.rb: set hostname before call ossl_ssl_set_session.
+ [Bug #11401][ruby-core:70152][fix GH-964] Patch by @mkarnebeek
-Tue Aug 6 21:48:31 2013 Kouji Takao <kouji.takao@gmail.com>
+Fri Nov 20 12:53:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/readline/readline.c (readline_s_set_point, Init_readline):
- add Readline.point=(pos). Patched by naruse. [ruby-dev:47535]
- [Feature #8675]
+ * array.c: clarify docs for take_while/drop_while samples.
+ [ci skip][fix GH-1028] Patch by @leriksen
-Tue Aug 6 21:14:11 2013 Kouji Takao <kouji.takao@gmail.com>
+Fri Nov 20 12:48:04 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/readline/readline.c (Init_readline, readline_s_set_output)
- (clear_rl_outstream, readline_s_set_input, clear_rl_instream)
- (readline_readline): fix causing SEGV if closed IO object that is
- set Readline.input or Readline.output. Patched by akr
- [ruby-dev:47509] [Bug #8644]
+ * ext/socket/socket.c: remove mention of :UNIX in getaddrinfo().
+ It's typically not a support option.
+ [ci skip][fix GH-990] Patch by @eam
-Tue Aug 6 17:56:40 2013 Koichi Sasada <ko1@atdot.net>
+Fri Nov 20 12:44:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * vm_insnhelper.c (vm_push_frame): change type of stack_max to size_t.
+ * lib/rss/syndication.rb: Add nodoc marker for #validate_sy_updatePeriod.
+ [ci skip][fix GH-1105] Patch by @davydovanton
-Tue Aug 6 17:42:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 20 09:05:21 2015 Koichi Sasada <ko1@atdot.net>
- * range.c (range_last): exclude the last number of the exclusive range
- if the end is Numeric. [ruby-dev:47587] [Bug #8739]
+ * vm.c (rb_vm_cref_replace_with_duplicated_cref): added.
-Tue Aug 6 17:42:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ CREFs should not be shared by methods between `using'.
+ [Bug #11247]
- * win32/win32.c (rb_w32_conv_from_wchar): converted string to CP_UTF8
- should have UTF-8 encoding. otherwise no conversion takes place
- later.
+ * vm_insnhelper.c (vm_cref_replace_with_duplicated_cref): ditto.
-Tue Aug 6 17:21:38 2013 Koichi Sasada <ko1@atdot.net>
+ * vm.c (vm_cref_dup): should copy refinements correctly.
- * vm_insnhelper.c (vm_push_frame): fix stack overflow check codes.
- Stack overflow check should be done *after* pushing a stack frame.
- However, some stack overflow checking codes checked *before*
- pushing a stack frame with iseq->stack_max.
- To solve this problem, add a new parameter `stack_max' to specify
- a possible consuming stack size.
+ * eval.c: use rb_vm_cref_replace_with_duplicated_cref().
- * vm_core.h (CHECK_VM_STACK_OVERFLOW0): add to share the stack overflow
- checking code.
+ * eval_intern.h: add a decl. of
+ rb_vm_cref_replace_with_duplicated_cref().
- * insns.def: catch up this change.
+ * vm_eval.c (eval_string_with_cref): do not need to pass
+ scope's CREF because VM can find out CREF from stack frames.
- * vm.c, vm_eval.c: ditto.
+ * test/ruby/test_refinement.rb: add a test.
- * test/ruby/test_exception.rb: add a stack overflow test.
- This code is reported by nobu.
+Fri Nov 20 06:52:53 2015 Eric Wong <e@80x24.org>
-Tue Aug 6 17:02:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * .gitattributes: new file for git users
+ [ruby-core:71578] [Feature #11713]
- * win32/win32.c (rb_w32_conv_from_wchar): use WideCharToMultiByte(),
- as like as mbstr_to_wstr(), in the first step of the conversion from
- WCHAR.
+Thu Nov 19 22:35:31 2015 Tanaka Akira <akr@fsij.org>
-Tue Aug 6 16:14:32 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/socket/ancdata.c: Check buffer full and ignore MSG_TRUNC flag.
+ buffer fullness is more robust to detect the message is too big for
+ the buffer.
+ AIX 7.1 recvmsg doesn't set MSG_TRUNC for rflags when MSG_PEEK is
+ given.
- * vm_eval.c (eval_string_with_cref): copy cref to limit the scope of
- refinements in the eval string. [ruby-core:56329] [Bug #8722]
+Thu Nov 19 21:55:11 2015 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_refinement.rb: related test.
+ * gc.c (gc_start): force to invoke GC by GC.start
+ even if it is GC.disable'd.
-Tue Aug 6 12:23:12 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_gc.rb: add a test.
- * bignum.c (rb_big_realloc): Use VALGRIND_MAKE_MEM_UNDEFINED to
- declare undefined memory area.
- (bignew_1): Ditto.
+Thu Nov 19 20:08:59 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h (VALGRIND_MAKE_MEM_DEFINED): Moved from gc.c
- (VALGRIND_MAKE_MEM_UNDEFINED): Ditto.
+ * gc.c: trivial performance improvements.
-Tue Aug 6 01:40:37 2013 Zachary Scott <e@zzak.io>
+ name modified
+ vm1_gc_short_lived* 1.015
+ vm1_gc_short_with_complex_long* 1.014
+ vm1_gc_short_with_long* 1.000
+ vm1_gc_short_with_symbol* 1.016
+ vm1_gc_wb_ary* 1.002
+ vm1_gc_wb_ary_promoted* 0.996
+ vm1_gc_wb_obj* 1.045
+ vm1_gc_wb_obj_promoted* 1.014
+ vm3_gc 1.021
- * process.c: [DOC] Document caveats of command form of Process.spawn
- with regard to the shell and OS. Patched by Steve Klabnik [Bug #8550]
+ * gc.c (gc_writebarrier_generational): reorder parameters to optimize
+ register passing function call.
-Tue Aug 6 01:28:35 2013 Zachary Scott <e@zzak.io>
+ * gc.c (gc_writebarrier_incremental): ditto.
- * lib/rss/0.9.rb: [DOC] Typo in example [Bug #8732]
+ * gc.c (rb_gc_writebarrier): remove LIKELY().
+ LIKELY() seems to move related functions not better places.
-Tue Aug 6 01:22:37 2013 Zachary Scott <e@zzak.io>
+Thu Nov 19 19:45:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/2.0.rb: [DOC] Document RSS::Rss by Steve Klabnik #8740
- * lib/rss/atom.rb: [DOC] Typo in rdoc by Steve Klabnik
+ * ruby.c (ruby_prog_init): [DOC] ARGV does not contain the name of
+ the executable. [ruby-core:71561] [Bug #11711]
-Mon Aug 5 23:47:59 2013 Tanaka Akira <akr@fsij.org>
+Thu Nov 19 15:53:21 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c: Rename local variables.
+ * signal.c: should also clear ruby_disable_gc.
+ [Bug #11692]
-Mon Aug 5 22:23:59 2013 Zachary Scott <e@zzak.io>
+Thu Nov 19 15:31:45 2015 Koichi Sasada <ko1@atdot.net>
- * vm_trace.c: [DOC] Fix TracePoint return values in examples
- Based on a patch by @sho-h [Fixes GH-373]
- https://github.com/ruby/ruby/pull/373
+ * compile.c (iseq_compile_each): T_IMEMO/iseq objects should be
+ wrap with ISeq wrappers. [Bug #11676]
-Mon Aug 5 17:38:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 19 15:16:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * win32/win32.c (rb_w32_write_console): use MultiByteToWideChar() for
- the last step of conversion to WCHAR, to get rid of warnings from
- rb_enc_find() in miniruby. [ruby-dev:47584] [Bug #8733]
+ * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(c6b4946).
+ this version includes #1114, #1314, #1322, #1375, #1383, #1387
+ * test/rubygems: ditto.
- * win32/win32.c (wstr_to_mbstr, mbstr_to_wstr): fix wrong trimming.
- WideCharToMultiByte() and MultiByteToWideChar() do not count
- NUL-terminator in the size for conversion result, unless the input
- length is -1.
+Thu Nov 19 14:14:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Aug 5 11:51:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * win32/win32.c (finish_overlapped_socket): return value of this
+ function should be only 0 or SOCKET_ERROR.
- * include/ruby/encoding.h: document which user flags are used by
- ENCODING_MASK for better greppability
+Thu Nov 19 14:12:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Aug 5 10:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * compile.c (iseq_tailcall_optimize): apply tail call optimization
+ before conversion to specialized instructions. when looking
+ back from `leave` instruction, `send` instructions have been
+ translated already.
- * object.c (rb_class_inherited_p): allow iclasses to be tested for
- inheritance. [Bug #8686] [ruby-core:56174]
+Thu Nov 19 13:57:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_method.rb: add test
+ * win32/win32.c (finish_overlapped_socket): ignore EMSGSIZE when input,
+ because POSIX platforms just do so. fixes test errors revealed by
+ r52647.
-Mon Aug 5 06:13:48 2013 Zachary Scott <e@zzak.io>
+Thu Nov 19 02:52:30 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * enumerator.c: [DOC] Remove reference to Enumerator::Lazy#cycle
- Patch by @kachick [Fixes GH-372]
- https://github.com/ruby/ruby/pull/372
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): stretch the buffer size
+ only when vmaxdatlen is nil.
-Mon Aug 5 03:57:16 2013 Zachary Scott <e@zzak.io>
+Thu Nov 19 02:20:11 2015 Tanaka Akira <akr@fsij.org>
- * lib/rss/0.9.rb: [DOC] Document RSS09 by Steve Klabnik [Bug #8732]
+ * test/socket/test_socket.rb (test_udp_recvmsg_truncation): rflags is
+ nil on Solaris 10 which have no HAVE_STRUCT_MSGHDR_MSG_CONTROL.
+ Reported by Naohisa Goto. [ruby-core:71557] [Bug #11709]
-Mon Aug 5 03:35:11 2013 Zachary Scott <e@zzak.io>
+Thu Nov 19 01:48:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rexml/attribute.rb: [DOC] Update example for #namespace
- Patch by Ippei Obayashi [Bug #8685] [ruby-core:56173]
+ * configure.in: add -static-libgcc for mingw automatically if available.
-Sun Aug 4 21:08:29 2013 Masaki Matsushita <glass.saga@gmail.com>
+Thu Nov 19 00:53:26 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * array.c (rb_ary_zip): performance implement by using
- ALLOCA_N() to allocate tmp buffer.
+ * ext/extmk.rb (--extflags): new option to pass EXTLDFLAGS to children,
+ especially exts.mk.
-Sun Aug 4 07:14:49 2013 Tanaka Akira <akr@fsij.org>
+ * common.mk (EXTMK_ARGS): use above option.
- * README.EXT, README.EXT.ja: Mention rb_integer_pack and
- rb_integer_unpack.
+Wed Nov 18 22:50:43 2015 Koichi Sasada <ko1@atdot.net>
-Sun Aug 4 01:54:45 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c (rb_class_clear_method_cache): should clear all
+ RCLASS_CALLABLE_M_TBLs of all sub-classes (T_ICLASS).
- * bignum.c (BARY_TRUNC): New macro.
- (bary_cmp): Use BARY_TRUNC.
- (bary_mul_toom3): Ditto.
- (bary_divmod): Ditto.
- (abs2twocomp): Ditto.
- (bigfixize): Ditto.
- (rb_cstr_to_inum): Ditto.
- (big2str_karatsuba): Ditto.
- (bigdivrem): Ditto.
+ RCLASS_CALLABLE_M_TBL() caches complemented method entries.
+ It should be cleared when the modules are cleared.
+ On previous version clears only for direct children.
+ It is enough for normal modules because corresponding T_ICLASSes
+ are direct children.
-Sun Aug 4 00:57:58 2013 Tanaka Akira <akr@fsij.org>
+ However, refinements create complex data structure. So that
+ we need to clear all children (and descendants).
+ [ruby-core:71423] [Bug #11672]
- * bignum.c (big2str_karatsuba): Don't allocate new temporary buffer
- if the buffer is enough for current invocation.
+ * vm_method.c (rb_clear_method_cache_by_class): rb_mKernel
+ doesn't call rb_class_clear_method_cache, so that
+ clear child T_ICLASSes.
-Sun Aug 4 00:22:34 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_refinement.rb: enable disabled test.
- * bignum.c (bary2bdigitdbl): New function.
- (bdigitdbl2bary): Ditto.
- (bary_mul_single): Use bdigitdbl2bary.
- (power_cache_get_power): Ditto.
- (bary_divmod): Use bary2bdigitdbl.
- (big2str_orig): Ditto.
- (bigdivrem): Ditto.
+Wed Nov 18 21:09:08 2015 Koichi Sasada <ko1@atdot.net>
-Sat Aug 3 22:47:11 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c (prepare_callable_method_entry): use
+ RCLASS_CALLABLE_M_TBL() instead of accessing a filed directly.
- * bignum.c: The branch condition of selecting multiplication
- algorithms should check smaller argument because Karatsuba and Toom3
- is effective only if both arguments are big.
- (bary_mul_toom3_branch): Compare the smaller argument to
- TOOM3_MUL_DIGITS.
- (bary_mul): Compare the smaller argument to KARATSUBA_MUL_DIGITS.
+Wed Nov 18 17:08:18 2015 Koichi Sasada <ko1@atdot.net>
-Sat Aug 3 22:23:31 2013 Tanaka Akira <akr@fsij.org>
+ * method.h: introduce the following field and macros.
- * bignum.c (big2str_orig): Receive the number to stringize as
- BDIGIT array and size.
- (big2str_karatsuba): Receive the number to stringize as BDIGIT array
- and size. Use an temporary array of BDIGIT.
- (rb_big2str1): Follow the above change.
+ * rb_method_definition_t::complemented_count to count shared method
+ entries because of complemented method entries and separate from
+ alias_count.
-Sat Aug 3 13:30:04 2013 Tanaka Akira <akr@fsij.org>
+ Shared `def' only by complemented method entries should not prevent
+ method re-definition warning.
- * bignum.c (MAX_BASE36_POWER_TABLE_ENTRIES): Renamed from
- MAX_BIG2STR_TABLE_ENTRIES.
- (base36_power_cache): Renamed from big2str_power_cache.
- (base36_numdigits_cache): Renamed from big2str_numdigits_cache.
+ * METHOD_ENTRY_COMPLEMENTED(me) to represent complemented method entry.
+ * METHOD_ENTRY_COMPLEMENTED_SET(me) to check it as complemented me.
-Sat Aug 3 10:33:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (aliased_callable_method_entry): should also
+ check me->def->complemented_count.
- * parse.y (parser_set_integer_literal): use rb_rational_raw1() for
- integral rational because no reduction is needed with 1.
+ * vm_method.c (method_definition_addref_complement): add to count
+ complemented method entries number.
-Sat Aug 3 09:46:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (rb_method_definition_release): release `def' iff
+ alias_count == 0 and complemented_count == 0.
- * ext/etc/etc.c (setup_passwd, setup_group): set proper encodings to
- string members.
+ * test/ruby/test_module.rb: add a test.
-Sat Aug 3 09:30:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 18 17:06:19 2015 Koichi Sasada <ko1@atdot.net>
- * struct.c (rb_struct_define_under): new function to define Struct
- under the given namespace, not under Struct. [Feature #8264]
+ * gc.c (rb_raw_obj_info): fix trivial issues.
- * ext/etc/etc.c: use rb_struct_define_under.
+ * support SPECIAL_CONSTs.
+ * fix IMEMO/ment outputs.
-Sat Aug 3 06:55:29 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Nov 18 11:32:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (value_expr_gen): now NODE_DEFN and NODE_DEFS are not void
- value expressions. get rid of wrong warning with -w, and make to
- pass tests with chkbuild. ref. [Feature #3753]
+ * compile.c (iseq_peephole_optimize): eliminate always/never
+ branches after a literal object. this sequence typically
+ appears by defined? operator for a method call on a local
+ variable.
-Sat Aug 3 04:23:48 2013 Eric Hodel <drbrain@segment7.net>
+Wed Nov 18 10:33:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * doc/syntax/refinements.rdoc: Remove mention of instance_eval and
- module_eval from scope section per:
- http://twitter.com/shugomaeda/status/363219951336693761
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): stretch the buffer size
+ when EMSGSIZE occurs on non HAVE_STRUCT_MSGHDR_MSG_CONTROL platforms
+ (such as, Windows). fixes a test error revealed by r52625.
-Sat Aug 3 02:22:05 2013 Tanaka Akira <akr@fsij.org>
+Wed Nov 18 10:12:36 2015 Eric Wong <e@80x24.org>
- * bignum.c (big2str_orig): Refactored.
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): use 4096 as
+ default size to match pre-r52610, which also maps to a common
+ page size.
-Sat Aug 3 01:20:19 2013 Tanaka Akira <akr@fsij.org>
+Wed Nov 18 10:05:25 2015 Shugo Maeda <shugo@ruby-lang.org>
- * bignum.c (bigadd_core): Removed.
- (bigadd): Use bary_add instead of bigadd_core.
+ * doc/syntax/refinements.rdoc: update documentation to reflect
+ recent changes.
+ [ci skip] [ruby-core:71466] [Misc #11681] Patch by James Adam
-Sat Aug 3 00:52:43 2013 Tanaka Akira <akr@fsij.org>
+Wed Nov 18 09:50:21 2015 Naotoshi Seo <sonots@gmail.com>
- * bignum.c (rb_big2str1): Simplify power_level calculation.
+ * test/logger/test_logdevice.rb: Fix tests of logger to make it work on
+ windows (windows can not remove opened file) [Bug #11702]
-Sat Aug 3 00:34:20 2013 Masaki Matsushita <glass.saga@gmail.com>
+Wed Nov 18 06:59:52 2015 Eric Wong <e@80x24.org>
- * array.c (rb_ary_zip): use rb_ary_new2() to create buffer
- if rb_block_arity() > 1.
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): grow buffer
+ on unspecified maxdatlen
+ [ruby-core:71517] [Bug #11701]
+ * ext/socket/lib/socket.rb (Socket#recvmsg): nil default for dlen
+ (Socket#recvmsg_nonblock): ditto
+ * test/socket/test_socket.rb (test_recvmsg_udp_no_arg): new test
-Sat Aug 3 00:12:00 2013 Masaki Matsushita <glass.saga@gmail.com>
+Tue Nov 17 19:50:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * NEWS: Add the description that IO#seek supports SEEK_DATA
- and SEEK_HOLE.
+ * win32/win32.c (fstat): declare for mingw.
-Fri Aug 2 23:57:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 17 19:02:59 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm.c (m_core_define_method, m_core_define_singleton_method): now
- the value of def-expr is the Symbol of the name of the method, not
- nil.
- ref. [ruby-dev:42151] [Feature #3753]
+ * configure.in (BASERUBY): use Kernel#print instead of Kernel#p because
+ the baseruby may output CRLF as end of line.
- * test/ruby/test_syntax.rb (TestSyntax#test_value_of_def): test for
- above changes.
+Tue Nov 17 15:34:34 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * NEWS: Added update from Unicode 7.0.0 to 8.0.0 [ci skip]
-Fri Aug 2 23:54:11 2013 Masaki Matsushita <glass.saga@gmail.com>
+Tue Nov 17 15:30:30 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * enc/unicode/casefold.h, name2ctype.h: Change Unicode
+ Version for regular expressions from 7.0.0 to
+ 8.0.0 (with help from Kimihito Matsui) [Feature #11563]
- * array.c (rb_ary_zip): performance improvement by avoiding
- array creation if rb_block_arity() > 1.
+Tue Nov 17 14:36:00 2015 Kenichi Kamiya <kachick1@gmail.com>
-Fri Aug 2 23:50:53 2013 Tanaka Akira <akr@fsij.org>
+ * lib/ostruct.rb (dig): Implement OpenStruct#dig
+ [Feature #11688]
- * bignum.c (power_cache_get_power): Apply bigtrunc to the result of
- bigsq.
- (big2str_karatsuba): Fix number of leading zero characters.
+Tue Nov 17 14:04:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Aug 2 23:48:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/lib/socket.rb (Socket#recvmsg{,_nonblock}): default values
+ of clen must be nil.
- * parse.y (parser_yylex): calculate denominator directly as powers of
- ten, not parsing string.
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): handle nil of clen.
+ fixes test errors introduced at r52602.
- * parse.y (parser_number_literal_suffix): return bit set of found
- suffixes.
+Tue Nov 17 13:43:46 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * parse.y (parser_set_number_literal, parser_set_integer_literal):
- split from parser_number_literal_suffix to set yylval.
+ * ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes
+ install error on Windows, introduced at r52601.
- * parse.y (parser_yylex): parse rational number literal with decimal
- point precisely.
+Tue Nov 17 11:27:23 2015 Eric Wong <e@80x24.org>
- * parse.y (simple_numeric): integrate numeric literals and simplify
- numeric rules.
+ * ext/socket/lib/socket.rb (Socket#recvfrom_nonblock):
+ UDPSocket#recvfrom_nonblock):
+ update doc for `exception: false` and destination buffer
+ [ruby-core:69542] [Feature #11229]
+ [ruby-core:69543] [Feature #11242]
- * ext/ripper/eventids2.c (ripper_init_eventids2): ripper support for
- new literals, tRATIONAL and tIMAGINARY.
+Tue Nov 17 11:25:05 2015 Eric Turner <ericturnerdev@gmail.com>
-Fri Aug 2 18:33:28 2013 Tanaka Akira <akr@fsij.org>
+ * array.c (rb_ary_dig), hash.c (rb_hash_dig): [DOC] Update
+ comments describing dig methods. [Fix GH-1103]
- * bignum.c (big2str_karatsuba): Reduce power_level more than one at
- recursion, if possible.
- (rb_big2str1): Follow the above change.
+ * struct.c (rb_struct_dig): [DOC] add rdoc.
-Fri Aug 2 12:25:15 2013 Tanaka Akira <akr@fsij.org>
+Tue Nov 17 11:22:22 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * NEWS: Small grammatical fix [ci skip]
- * bignum.c (bary_mul): Swap x and y for bary_mul1 if x is longer than y.
- [ruby-dev:47565] [Bug #8719] Reported by Narihiro Nakamura.
+Tue Nov 17 10:12:30 2015 Eric Wong <e@80x24.org>
-Fri Aug 2 10:39:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * ext/socket/lib/socket.rb (Socket.accept_loop): avoid exceptions
+ (Socket.udp_server_recv): ditto
- * parse.y (negate_lit): add T_RATIONAL and T_COMPLEX to the switch
- statement, and call rb_bug() if an unknown type is passed to
- negate_lit(). [ruby-core:56316] [Bug #8717]
+Tue Nov 17 09:59:00 2015 Eric Wong <e@80x24.org>
- * bootstraptest/test_literal_suffix.rb (assert_equal): add test
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): avoid arg parsing
+ [ruby-core:71439] [Feature #11339]
+ (rsock_bsock_sendmsg): make private, adjust for above
+ (rsock_bsock_sendmsg_nonblock): ditto
+ * ext/socket/rubysocket.h: adjust prototypes
+ (rsock_opt_false_p): remove
+ * ext/socket/basicsocket.c (rsock_init_basicsocket):
+ define private methods
+ * ext/socket/lib/socket.rb (BasicSocket#sendmsg): new wrapper
+ (BasicSocket#sendmsg_nonblock): ditto
-Fri Aug 2 09:14:47 2013 Eric Hodel <drbrain@segment7.net>
+Tue Nov 17 09:45:18 2015 Eric Wong <e@80x24.org>
- * doc/syntax/refinements.rdoc: Improve description of where you may
- activate refinements.
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): avoid arg parsing
+ (rsock_bsock_recvmsg): adjust for above change
+ (rsock_bsock_recvmsg_nonblock): ditto
+ [ruby-core:71439] [Feature #11339]
+ * ext/socket/rubysocket.h: adjust prototypes for above
+ * ext/socket/basicsocket.c (rsock_init_basicsocket):
+ adjust private methods
+ * ext/socket/lib/socket.rb (BasicSocket#recvmsg): wrapper method
+ (BasicSocket#recvmsg_nonblock): ditto
-Fri Aug 2 07:45:55 2013 Tanaka Akira <akr@fsij.org>
+Tue Nov 17 08:36:34 2015 Eric Wong <e@80x24.org>
- * bignum.c (big2str_orig): Remove len argument.
- (big2str_karatsuba): Ditto.
- (rb_big2str1): Follow above change.
+ * ext/socket/init.c (rsock_s_accept_nonblock): avoid parsing args
+ [ruby-core:71439] [Feature #11339]
+ * ext/socket/rubysocket.h: adjust prototype
+ * ext/socket/socket.c (sock_accept_nonblock): make private
+ * ext/socket/tcpserver.c (tcp_accept_nonblock): ditto
+ * ext/socket/unixserver.c (unix_accept_nonblock): ditto
+ * ext/socket/lib/socket.rb (Socket#accept_nonblock):
+ implement as wrapper, move RDoc
+ (TCPServer#accept_nonblock): ditto
+ (UNIXServer#accept_nonblock): ditto
-Thu Aug 2 02:32:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Tue Nov 17 08:25:57 2015 Eric Wong <e@80x24.org>
- * NEWS: Add the description of number literal suffixes.
+ * ext/socket/socket.c (sock_connect_nonblock):
+ avoid argument parsing in C.
+ [ruby-core:71439] [Feature #11339]
+ * ext/socket/lib/socket.rb (Socket#connect_nonblock):
+ new wrapper for private method, move RDoc
-Thu Aug 2 00:02:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Tue Nov 17 08:16:09 2015 Eric Wong <e@80x24.org>
- * bootstraptest/test_literal_suffix.rb: add two test cases to
- examine that "1if true" and "1rescue nil" are recognized as 1.
+ * ext/socket/init.c (rsock_s_recvfrom_nonblock):
+ avoid arg parsing with C API
+ [ruby-core:71439] [Feature #11339]
+ * ext/socket/basicsocket.c (bsock_recv_nonblock):
+ adjust for above change, make private
+ * ext/socket/socket.c (sock_recvfrom_nonblock): ditto
+ * ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
+ * ext/socket/lib/socket.rb (BasicSocket#recv_nonblock):
+ new wrapper for private method, move RDoc
+ (Socket#recvfrom_nonblock): ditto
+ (UDPSocket#recvfrom_nonblock): ditto
-Thu Aug 1 23:45:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Mon Nov 16 21:27:54 2015 Naohisa Goto <ngotogenome@gmail.com>
- * rational.c (rb_flt_rationalize_with_prec): new public C function
- to rationalize a Float instance with a precision.
+ * test/dtrace/helper.rb (Dtrace::TestCase#trap_probe): dtrace buffer
+ size is set as 8m on Solaris (default 4m). [Bug #11697]
- * rational.c (rb_flt_rationalize): new public C function to
- rationalize a Float instance. A precision is calculated from
- the given float number.
+Mon Nov 16 20:03:14 2015 Naotoshi Seo <sonots@gmail.com>
- * include/ruby/intern.h: Add rb_flt_rationalize_with_prec and
- rb_flt_rationalize.
+ * lib/logger.rb: Add Logger#reopen
- * parse.y: implement number literal suffixes, 'r' and 'i'.
- [ruby-core:55096] [Feature #8430]
+Mon Nov 16 18:21:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bootstraptest/test_literal_suffix.rb: add tests for parser to scan
- number literals with the above tsuffixes.
+ * object.c (rb_obj_dig): dig in nested structs too.
-Thu Aug 1 23:55:08 2013 Tanaka Akira <akr@fsij.org>
+ * struct.c (rb_struct_dig): new method Struct#dig.
+ [Feature #11688]
- * bignum.c (rb_big2str1): Remove a local variable.
+Mon Nov 16 17:41:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 1 23:33:01 2013 Tanaka Akira <akr@fsij.org>
+ * compile.c (iseq_peephole_optimize): optimize tail calls on aref
+ and aset specialized instructions.
- * bignum.c (rb_cstr_to_inum): Use power_cache_get_power.
+ * compile.c (iseq_peephole_optimize): optimize replaced leave
+ instruction copied to jump instruction too.
-Thu Aug 1 21:02:48 2013 Tanaka Akira <akr@fsij.org>
+Mon Nov 16 16:39:38 2015 Akinori MUSHA <knu@iDaemons.org>
- * bignum.c (rb_big2str1): Raise an error for too big number.
+ * lib/set.rb: Enable frozen_string_literal.
-Thu Aug 1 20:46:29 2013 Tanaka Akira <akr@fsij.org>
+ * lib/set.rb: Move << out of the begin block that ensures pop.
- * bignum.c (power_cache_get_power): Hide cached Bignum objects.
+Mon Nov 16 16:28:30 2015 Akinori MUSHA <knu@iDaemons.org>
-Thu Aug 1 19:15:05 2013 Tanaka Akira <akr@fsij.org>
+ * lib/set.rb (Hash#flatten!, #add?, #delete?, #collect!, #reject!,
+ #select!, #^, #classify): Micro-optimize some methods for
+ performance and readability.
- * bignum.c (rb_big2str1): Remove non-trim mode.
- (rb_big2str0): Non-trim mode implemented here.
- (big2str_find_n1): Change the result type to long again.
- (big2str_base_powerof2): Don't take arguments: len and trim.
- (rb_big2str): Follow above change.
+Mon Nov 16 16:17:58 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Aug 1 12:37:58 2013 Tanaka Akira <akr@fsij.org>
+ * ChangeLog: fixed accidentally commit.
- * bignum.c (big2str_alloc): New function to allocate the result string.
- It is called after actual length is calculated.
- (big2str_struct): Add fields: negative, result and ptr.
- (big2str_orig): Write out the result via b2s->ptr.
- (big2str_orig): Ditto.
- (rb_big2str1): Don't allocate the result string at beginning.
+Mon Nov 16 16:10:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Aug 1 07:36:27 2013 Tanaka Akira <akr@fsij.org>
+ * mkconfig.rb: Add some high-level documentation.
+ [ci skip][fix GH-1081] Patch by @ulfalizer
- * bignum.c (big2str_orig): Use temporary buffer when trim mode.
+Mon Nov 16 15:59:14 2015 yui-knk <spiketeika@gmail.com>
-Thu Aug 1 06:28:48 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c: Add call-seq of `Method#super_method`
+ [ci skip][fix GH-1094]
- * bignum.c (big2str_orig): Simplified because RBIGNUM_LEN(x) <= 2 now.
- (big2str_struct): Two fields added: hbase2, hbase2_numdigits.
- (rb_big2str1): Initialize above fields.
+Mon Nov 16 15:58:39 2015 Kenichi Kamiya <kachick1@gmail.com>
-Thu Aug 1 04:06:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * struct.c: Standardize a method signature of Struct#[]=.
+ [ci skip][fix GH-1095]
- * lib/rdoc/options.rb (RDoc#finish): include root path in include
- paths, to work in another directory than the source directory.
- [ruby-core:56282] [Bug #8712]
+Mon Nov 16 15:42:36 2015 Akinori MUSHA <knu@iDaemons.org>
- * test/test_rdoc_markup_pre_process.rb (TestRDocMarkupPreProcess#setup):
- fix input_file_name, as the test script is not pre-processed.
+ * lib/set.rb (#>=, #>, #<=, #<): Make use of Hash#>=, #>, #<, and
+ #<= when comparing against an instance of the same kind.
-Thu Aug 1 01:45:18 2013 Tanaka Akira <akr@fsij.org>
+Mon Nov 16 15:37:11 2015 Naotoshi Seo <sonots@gmail.com>
- * bignum.c (big2str_karatsuba): Fix a condition of power_level.
+ * lib/logger.rb: Support symbol and string log level setting
-Thu Aug 1 01:09:02 2013 Tanaka Akira <akr@fsij.org>
+Mon Nov 16 15:33:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (LOG2_KARATSUBA_BIG2STR_DIGITS): Removed.
- (KARATSUBA_BIG2STR_DIGITS): Removed.
- (big2str_numdigits_cache): New variable.
- (power_cache_get_power): Merged with power_cache_get_power0.
- This function returns maxpow_in_bdigit_dbl(base)**(2**power_level).
- (rb_big2str1): use power_cache_get_power.
+ * tool/rbinstall.rb: fix wrong permission for gem specification without
+ zlib runtime. [Bug #11685][ruby-dev:49343]
-Wed Jul 31 23:59:28 2013 Tanaka Akira <akr@fsij.org>
+Mon Nov 16 12:11:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (big2str_find_n1): Change the return type to size_t.
- (big2str_orig): Ditto.
- (big2str_karatsuba): Ditto.
- (rb_big2str1): Follow the above changes.
+ * lib/webrick/httpauth/basicauth.rb: fix a typo.
+ [ci skip][fix GH-1099] Patch by @jwworth
+ * lib/webrick/httpauth/digestauth.rb: ditto.
-Wed Jul 31 23:19:06 2013 Tanaka Akira <akr@fsij.org>
+Sun Nov 15 18:28:43 2015 Kenichi Kamiya <kachick1@gmail.com>
- * bignum.c (power_cache_get_power): Change numdigits_ret to size_t *.
- (big2str_orig): Change len argument to size_t.
- (big2str_karatsuba): Ditto.
- (rb_big2str1): Follow the above changes.
+ * vm_method.c (set_method_visibility): should fail if the receiver
+ is frozen. [ruby-core:71489] [Bug #11687]
-Wed Jul 31 22:59:47 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Nov 14 22:15:07 2015 Tanaka Akira <akr@fsij.org>
- * test/rexml/parse/test_notation_declaration.rb: Change class
- name to follow file name change.
+ * ext/socket/lib/socket.rb: Specify frozen_string_literal: true.
-Wed Jul 31 22:57:50 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Nov 14 21:44:56 2015 Tanaka Akira <akr@fsij.org>
- * test/rexml/test_notationdecl_parsetest.rb: Rename to ...
- * test/rexml/parse/test_notation_declaration.rb: ... this.
+ * lib/time.rb: Use "<<" to reduce string allocation.
-Wed Jul 31 22:54:39 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Nov 14 17:45:49 2015 Tanaka Akira <akr@fsij.org>
- * test/rexml/test_notationdecl_mixin.rb: Remove duplicated tests.
+ * lib/tsort.rb: Specify frozen_string_literal: true.
-Wed Jul 31 22:52:55 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Nov 14 17:25:15 2015 Tanaka Akira <akr@fsij.org>
- * test/rexml/test_notationdecl_parsetest.rb: Fix typos in expected
- value.
- pubilc ->
- public
- ^^
+ * lib/resolv-replace.rb: Specify frozen_string_literal: true.
-Wed Jul 31 22:50:51 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Nov 14 17:00:13 2015 Tanaka Akira <akr@fsij.org>
- * test/rexml/test_notationdecl_parsetest.rb: Add tests that focus
- system literal in external ID system notation declaration.
+ * lib/time.rb: Specify frozen_string_literal: true.
-Wed Jul 31 22:36:21 2013 Tanaka Akira <akr@fsij.org>
+Sat Nov 14 16:43:02 2015 Tanaka Akira <akr@fsij.org>
- * bignum.c (bary_cmp): Extracted from rb_big_cmp.
- (power_cache_get_power): Change n1 argument (number of digits) to
- power_level which is just passed to power_cache_get_power0.
- (big2str_karatsuba): Ditto.
- (rb_big2str1): Calculate the initial power_level.
+ * lib/open3.rb: Specify frozen_string_literal: true.
-Wed Jul 31 22:04:36 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Nov 14 05:04:09 2015 Koichi Sasada <ko1@atdot.net>
- * test/rexml/test_notationdecl_parsetest.rb: Fix a typo.
- Extern ID ->
- ExternalID
- ^^
+ * node.h: remove old comments.
-Wed Jul 31 22:01:36 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Nov 14 04:55:36 2015 Koichi Sasada <ko1@atdot.net>
- * test/rexml/test_notationdecl_parsetest.rb: Add tests that focus
- public ID in external ID notation declaration.
+ * refactoring CREF related code.
-Wed Jul 31 22:01:24 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * eval_intern.h: remove unused setter functions.
+ CREF_CLASS_SET()
+ CREF_NEXT_SET()
+ CREF_SCOPE_VISI_COPY()
- * parse.y: fix build error with bison-3.0.
+ * eval_intern.h: rename flags:
+ * NODE_FL_CREF_PUSHED_BY_EVAL_ -> CREF_FL_PUSHED_BY_EVAL
+ * NODE_FL_CREF_OMOD_SHARED_ -> CREF_FL_OMOD_SHARED
+ and use IMEMO_FL_USER1/2.
-Wed Jul 31 21:58:53 2013 Kouhei Sutou <kou@cozmixng.org>
+ * vm.c (vm_cref_new): accept push_by_eval parameter.
- * test/rexml/test_notationdecl_parsetest.rb: Split test patterns.
+ * vm.c (vm_cref_new_use_prev): added for rb_vm_rewrite_cref().
-Wed Jul 31 21:42:33 2013 Kouhei Sutou <kou@cozmixng.org>
+ * vm_insnhelper.c (vm_cref_push): accept pushed_by_eval parameter.
- * test/rexml/test_notationdecl_parsetest.rb: Group tests.
+ * vm_insnhelper.h: remove unused macros:
+ COPY_CREF_OMOD() and COPY_CREF().
-Wed Jul 31 21:37:51 2013 Kouhei Sutou <kou@cozmixng.org>
+ * vm_eval.c, insns.def: catch up this fix.
- * test/rexml/test_notationdecl_mixin.rb (TestNotationDecl#test_name):
- Move to ...
- * test/rexml/test_notationdecl_parsetest.rb
- (TestNotationDecl#test_name): ... here.
+Sat Nov 14 02:58:03 2015 Koichi Sasada <ko1@atdot.net>
-Wed Jul 31 21:37:47 2013 Kouhei Sutou <kou@cozmixng.org>
+ * vm.c (vm_define_method): refactoring.
+ * get CREF in this function.
+ * cbase is no longer needed (CREF_CLASS(cref) is enough).
-Wed Jul 31 21:31:49 2013 Kouhei Sutou <kou@cozmixng.org>
+ * compile.c: RubyVM::FrozenCore.define_method only accept 2 args.
- * test/rexml/test_notationdecl_parsetest.rb: Remove setup because it
- doesn't share anything with other tests.
+Sat Nov 14 02:34:43 2015 Koichi Sasada <ko1@atdot.net>
-Wed Jul 31 21:24:55 2013 Kouhei Sutou <kou@cozmixng.org>
+ * vm.c (vm_define_method): do not use current CREF immediately,
+ but check CREF in environment or methods. Methods defined in methods
+ should be public.
+ [Bug #11571]
- * test/rexml/test_attributes_mixin.rb: Remove a needless shebang.
- * test/rexml/test_notationdecl_mixin.rb: ditto.
- * test/rexml/test_doctype.rb: ditto.
- * test/rexml/test_xml_declaration.rb: ditto.
- * test/rexml/test_changing_encoding.rb: ditto.
+ * vm_method.c (rb_scope_module_func_check): check CREF in env or me.
+ if CREF is contained by `me', then return FALSE.
-Wed Jul 31 21:20:08 2013 Kouhei Sutou <kou@cozmixng.org>
+ * test/ruby/test_method.rb: add a test.
- * test/rexml/test_notationdecl_parsetest.rb: remove a needless shebang.
+Sat Nov 14 02:19:16 2015 Koichi Sasada <ko1@atdot.net>
-Wed Jul 31 20:11:01 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * method.h: constify rb_cref_t::scope_visi;
- * string.c (rb_str_rindex): fix bug introduced in r42269.
- "".rindex("") should return 0.
- (str_rindex): ditto.
+ * eval_intern.h (CREF_SCOPE_VISI_COPY): catch up this fix.
-Wed Jul 31 19:55:33 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c: ditto.
- * bignum.c (MAX_BIG2STR_TABLE_ENTRIES): Use SIZEOF_SIZE_T.
- (power_cache_get_power0): Add rb_bug call for too bit i argument.
- (power_cache_get_power): Simplified.
+Sat Nov 14 01:53:52 2015 Naohisa Goto <ngotogenome@gmail.com>
-Wed Jul 31 18:32:25 2013 Akinori MUSHA <knu@iDaemons.org>
+ * pack.c (pack_unpack, AVOID_CC_BUG): Very ugly workaround for
+ optimization bug of Oracle Solaris Studio 12.4 on Solaris
+ with -xO4 optimization option. [Bug #11684]
- * lib/uri/common.rb (URI.decode_www_form_component): Use String#b.
+Fri Nov 13 23:00:23 2015 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Jul 31 18:24:02 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * configure.in: unset LD_PRELOAD on mingw. msys2 child processes
+ crash at make test-all with LD_PRELOAD.
+ [ruby-core:71461] [Bug #11680]
- * eval.c (rb_mod_refine, mod_using, top_using): don't show
- warnings because Refinements are no longer experimental.
- [ruby-core:55993] [Feature #8632]
+Fri Nov 13 14:00:43 2015 Zachary Scott <zzak@ruby-lang.org>
- * test/ruby/test_refinement.rb: related test.
+ * ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735]
- * NEWS: fixes for the above change.
+Fri Nov 13 13:09:16 2015 Zachary Scott <zzak@ruby-lang.org>
-Wed Jul 31 17:55:55 2013 Shota Fukumori <her@sorah.jp>
+ * ext/openssl/ossl_ssl.c: Merge ruby/openssl@81e1a30
- * lib/uri/common.rb (URI.decode_www_form_component):
- Don't raise error when str includes multibyte characters.
+ * test/openssl/test_ssl.rb: ditto
-Wed Jul 31 17:45:39 2013 Masaki Matsushita <glass.saga@gmail.com>
+Fri Nov 13 13:05:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_rindex): performance improvement by using
- memrchr(3).
+ * prelude.rb (Thread.exclusive): warn as deprecated.
-Wed Jul 31 16:43:30 2013 Masaki Matsushita <glass.saga@gmail.com>
+Fri Nov 13 10:36:39 2015 Victor Nawothnig <Victor.Nawothnig@gmail.com>
- * string.c (rb_str_rindex): refactoring and avoid to call str_nth() if
- pos == 0.
+ * parse.y (new_unless): optimize constant condition for `unless`
+ as well as `if`. [Fix GH-1092]
-Wed Jul 31 14:41:36 2013 Akinori MUSHA <knu@iDaemons.org>
+Fri Nov 13 10:08:41 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/set.rb: [DOC] Add a couple of notes on Hash as storage.
- ref. [Feature #6589]
+ * ext/psych/psych.gemspec: bump version to 2.0.15
-Wed Jul 31 14:38:52 2013 Akinori MUSHA <knu@iDaemons.org>
+Thu Nov 12 18:44:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/set.rb: [DOC] Fix example result. Hash is now ordered.
+ * parse.y (parser_magic_comment): should match exactly.
+ [ruby-core:71460] [Bug #11679]
-Wed Jul 31 14:38:10 2013 Akinori MUSHA <knu@iDaemons.org>
+Thu Nov 12 16:16:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/set.rb: [DOC] Use the term "sorted" instead of "ordered"
- when mentioning SortSet.
+ * template/prelude.c.tmpl: enable tail call optimization.
-Wed Jul 31 12:18:47 2013 Tanaka Akira <akr@fsij.org>
+Thu Nov 12 14:17:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (big2str_struct): New structure.
- (big2str_orig): Use big2str_struct.
- (big2str_karatsuba): Ditto.
- (rb_big2str1): Ditto.
+ * parse.y (parser_yylex): ANDDOT at the head of the line denote
+ line continuation from previous one to support fluent interface,
+ as well as single dot.
-Wed Jul 31 12:02:16 2013 Zachary Scott <e@zzak.io>
+Thu Nov 12 13:49:50 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/rubygems.rb: [DOC] typo in url patch by @Red54 [Fixes #369]
- https://github.com/ruby/ruby/pull/369
+ * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(db78980).
+ this version includes #1367 , #1373 , #1375
+ * test/rubygems: ditto.
-Wed Jul 31 07:09:07 2013 Eric Hodel <drbrain@segment7.net>
+Thu Nov 12 10:53:41 2015 Eric Wong <e@80x24.org>
- * lib/rubygems: Import RubyGems from master as of commit 523551c
- * test/rubygems: ditto.
+ * benchmark/bm_io_nonblock_noex2.rb: new benchmark based
+ on bm_io_nonblock_noex.rb
+ * io.c (io_read_nonblock): move documentation to prelude.rb
+ (io_write_nonblock): ditto
+ (Init_io): private, internal methods for prelude.rb use only
+ * prelude.rb (IO#read_nonblock): wrapper + documentation
+ (IO#write_nonblock): ditto
+ [ruby-core:71439] [Feature #11339]
-Tue Jul 30 22:21:54 2013 Masaki Matsushita <glass.saga@gmail.com>
+Wed Nov 11 18:30:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_hash.rb: add a test for enumeration order of Hash.
+ * sprintf.c (rb_str_format): look up the key, then get default
+ value and raise KeyError if the returned value is nil.
+ [ruby-dev:49338] [Ruby trunk - Bug #11677]
-Tue Jul 30 18:52:27 2013 Akinori MUSHA <knu@iDaemons.org>
+Wed Nov 11 17:38:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/set.rb (Set#intersect?, Set#disjoint?): Add new methods for
- testing if two sets have any element in common.
- [ruby-core:45641] [Feature #6588] Based on the code by marcandre.
+ * vm_eval.c (local_var_list_add): skip internal local variable
+ name by its type but not if it has a name. internal local
+ variable names are just unique per frame, not globally.
+ [ruby-core:71437] [Bug #11674]
-Tue Jul 30 17:16:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (ruby__sfvextra): add QUOTE flag to escape unprintable
- characters.
+Wed Nov 11 14:14:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Tue Jul 30 11:00:52 2013 Zachary Scott <e@zzak.io>
+ * transcode.c: fix a typo
+ [ci skip][fix GH-1091] Patch by @jwworth
- * ext/curses/extconf.rb: [DOC] nodoc to reduce Object pollution
+Wed Nov 11 11:58:38 2015 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jul 30 08:19:42 2013 Tanaka Akira <akr@fsij.org>
+ * lib/net/ftp.rb (initialize): Connections are in passive mode per
+ default now. The default mode can be changed by
+ Net::FTP.default_passive=.
+ [ruby-core:71146] [Feature #11612]
- * sizes.c (Init_sizes): Define sizes only if the type actually exists.
+ * lib/net/ftp.rb (default_passive=, default_passive): new methods.
-Mon Jul 29 22:55:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 11 09:03:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sizes.c (Init_sizes): define RbConfig::SIZEOF. [Feature #8568]
+ * sprintf.c (rb_str_format): respect default value of a hash. no
+ longer raises KeyError unless the default value of the hash is
+ nil. [ruby-core:71354] [Bug #11661]
-Mon Jul 29 22:25:20 2013 Zachary Scott <e@zzak.io>
+Tue Nov 10 20:35:12 2015 Tanaka Akira <akr@fsij.org>
- * ext/curses/curses.c: [DOC] Update location of samples
- * samples/curses/*: Move Curses samples and refactor from mixin
- The samples are included in rdoc for module and use of mixin is
- confusing
+ * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true".
-Mon Jul 29 22:16:11 2013 Tanaka Akira <akr@fsij.org>
+ * lib/pp.rb: Ditto.
- * bignum.c (LOG2_KARATSUBA_BIG2STR_DIGITS): Renamed from
- LOG2_KARATSUBA_DIGITS.
- (KARATSUBA_BIG2STR_DIGITS): Renamed from KARATSUBA_DIGITS.
+ * lib/prettyprint.rb: Ditto.
-Mon Jul 29 22:04:45 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/resolv.rb: Ditto.
- * hash.c (rb_hash_compare_by_id): add function prototype.
+ * lib/securerandom.rb: Ditto.
-Mon Jul 29 21:53:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/tmpdir.rb: Ditto.
- * hash.c (rb_hash_compare_by_id): don't call rb_hash_rehash()
- if self.compare_by_identity? == true.
+ * lib/unicode_normalize/tables.rb: Ditto.
-Mon Jul 29 21:29:48 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * test/net/ftp/test_buffered_socket.rb: Ditto.
- * hash.c (rb_hash_assoc): performance improvement by replacing
- compare function in RHASH(hash)->ntbl->type temporarily like r42224.
- it falls back to rb_hash_foreach() if st_lookup() doesn't find the key.
+ * test/net/ftp/test_mlsx_entry.rb: Ditto.
- * test/ruby/test_hash.rb: add a test for above.
+ * test/open-uri/test_open-uri.rb: Ditto.
-Mon Jul 29 21:15:30 2013 Akinori MUSHA <knu@iDaemons.org>
+ * test/open-uri/test_ssl.rb: Ditto.
- * test/ruby/test_lazy_enumerator.rb
- (TestLazyEnumerator#test_initialize): Make sure
- Enumerator::Lazy#initialize raises error if the object is
- frozen. The check was performed by rb_ivar_set() before
- rb_check_frozen() was added to enumerator_init().
+ * test/pathname/test_pathname.rb: Ditto.
-Mon Jul 29 21:06:42 2013 Akinori MUSHA <knu@iDaemons.org>
+ * test/test_pp.rb: Ditto.
- * enumerator.c (enumerator_init): Add a frozenness check to
- prevent a frozen Enumerator object from being reinitialized with
- a different enumerable object. This is the least we should do,
- and more fixes will follow. [Fixes GH-368] Patch by Kenichi
- Kamiya.
+ * test/test_prettyprint.rb: Ditto.
- * enumerator.c (generator_init): Ditto.
+ * tool/transcode-tblgen.rb: Ditto.
-Mon Jul 29 20:14:24 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * ext/pathname/lib/pathname.rb: Ditto.
- * hash.c (rb_hash_assoc): revert r42224. table->type->compare is
- called only if hashes are matched.
+Tue Nov 10 18:42:24 2015 Aleksandrs Ledovskis <aleksandrs@ledovskis.lv>
- * test/ruby/test_hash.rb: add a test to check using #== to compare.
+ * defs/id.def, parse.y: Switch internal token name to reflect
+ current form of safe-call operator. [Fix GH-1090]
-Mon Jul 29 17:00:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 10 18:25:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (yycompile): store file name as String to keep the encoding.
+ * hash.c (rb_hash_to_proc): use rb_func_proc_new to make light
+ weight proc. [Feature #11653]
- * parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path):
- new functions to pass file name as a String.
+Tue Nov 10 18:23:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (gettable_gen): return a copy of the original file name, not
- a copy in filesystem encoding.
+ * proc.c (cfunc_proc_t): add room for me.
- * vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)".
+ * proc.c (cfunc_proc_new): generalise for cfunc proc without env.
-Mon Jul 29 16:53:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (rb_func_proc_new, rb_func_lambda_new): new functions to
+ make proc/lambda without env from cfunc.
- * hash.c (rb_hash_initialize_copy): copy st_table type even if empty.
- [ruby-core:56256] [Bug #8703]
+Tue Nov 10 17:32:35 2015 Naohisa Goto <ngotogenome@gmail.com>
-Mon Jul 29 16:34:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bootstraptest/test_fork.rb ([ruby-dev:37934]): :NPROC (RLIMIT_NPROC)
+ is not supported on some platforms (e.g. Solaris 10).
- * hash.c (rb_hash_initialize_copy): clear old table before copy new
- table.
+Tue Nov 10 16:57:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 29 16:34:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (rb_hash_to_proc): new method Hash#to_proc.
+ [Feature #11653]
- * hash.c (rb_hash_assoc): aggregate object can be initialized only
- with link time constants.
+Tue Nov 10 14:34:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jul 29 14:54:44 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * time.c (rb_time_timespec_new): swap utc and localtime
+ to generate gmt flag by INT_MAX - gmtoff.
- * hash.c (rb_hash_assoc): performance improvement by replacing
- compare function in RHASH(hash)->ntbl->type temporarily.
+Tue Nov 10 14:01:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 29 14:52:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (rb_hash_{le,lt,ge,gt}): new methods, Hash#<=, Hash#<,
+ Hash#>=, Hash#>, to test if all elements of a hash are also
+ included in another hash, and vice versa.
+ [ruby-core:68561] [Feature #10984]
- * lib/mkmf.rb (xsystem): expand environment variable in all macros not
- expanded with RbConfig. [Bug #8702]
+Tue Nov 10 11:25:29 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * test/mkmf/test_framework.rb (create_framework): replace all $@ not
- only once.
+ * time.c (rb_timespec_now): added. [Feature #11558]
-Mon Jul 29 06:54:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * time.c (rb_time_timespec_new): added. [Feature #11558]
- * win32/win32.c (rb_w32_pipe): use enum for compile time constants,
- instead of const int for debugging.
+Tue Nov 10 06:17:17 2015 Eric Wong <e@80x24.org>
-Mon Jul 29 00:11:49 2013 Tanaka Akira <akr@fsij.org>
+ * variable.c (rb_autoload_load): allow recursive calls
+ [ruby-core:71345] [Bug #11658]
+ * test/ruby/test_autoload.rb (test_autoload_while_autoloading):
+ new test by: Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ [ruby-core:71390]
- * bignum.c (bigdivrem): Specialized implementation added for
- nx == 2 && ny == 2
+Tue Nov 10 00:36:46 2015 Tanaka Akira <akr@fsij.org>
-Sun Jul 28 20:28:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/resolv.rb (Resolv::DNS::Message::MessageEncoder#put_labels):
+ Prevent overflow of pointer to labels.
+ Patch by Hannes Georg. [ruby-core:71248] [Bug #11632]
- * io.c (io_getpartial): use rb_str_locktmp_ensure().
- [ruby-core:56121] [Bug #8669]
+Tue Nov 10 00:25:41 2015 Kazuki Tsujimoto <kazuki@callcc.net>
- * io.c (rb_io_sysread): ditto.
+ * gems/bundled_gems: update to power_assert 0.2.6.
- * test/ruby/test_io.rb: add tests for above.
+Mon Nov 9 21:48:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jul 28 20:10:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (rb_check_funcall_default): split from
+ rb_check_funcall to return the given fallback value.
- * ext/extmk.rb (extmake): should make static libraries for extensions
- to be statically linked. [Bug #7948]
+ * object.c (rb_obj_dig): use rb_check_funcall_default so that tail
+ call optimization will be possible. [Feature #11643]
-Sun Jul 28 17:38:32 2013 Masaki Matsushita <glass.saga@gmail.com>
+Mon Nov 9 21:27:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c: add internal API rb_str_locktmp_ensure().
+ * array.c (rb_ary_dig): new method Array#dig.
- * io.c (io_fread): use rb_str_locktmp_ensure().
- [ruby-core:56121] [Bug #8669]
+ * hash.c (rb_hash_dig): new method Hash#dig.
- * test/ruby/test_io.rb: add a test for above.
+ * object.c (rb_obj_dig): dig in nested arrays/hashes.
+ [Feature #11643]
-Sun Jul 28 13:04:39 2013 Masaki Matsushita <glass.saga@gmail.com>
+Mon Nov 9 18:00:47 2015 Yuki Nishijima <mail@yukinishijima.net>
- * io.c (interpret_seek_whence): support SEEK_DATA and SEEK_HOLE.
- These are whences for lseek(2) supported by Linux since version 3.1.
- [ruby-core:56123] [Feature #8671]
+ * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta3
- * test/ruby/test_io.rb: Add tests for above.
+Mon Nov 9 17:38:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Jul 28 12:41:39 2013 Tanaka Akira <akr@fsij.org>
+ * test/runner.rb: use official repository for coverage tool.
+ * Makefile.in: ditto.
+ * common.mk: ditto.
+ * .gitignore: ignored third party repositories.
- * bignum.c (absint_numwords_generic): The char_bit variable changed
- to static constant.
+Mon Nov 9 17:29:09 2015 Shugo Maeda <shugo@ruby-lang.org>
-Sun Jul 28 12:03:23 2013 Tanaka Akira <akr@fsij.org>
+ * compile.c (iseq_compile_each): Dynamic string literals should be
+ frozen.
+ [ruby-core:57574] [Feature #8976]
- * bignum.c: Constify bary_* functions.
+Mon Nov 9 15:56:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Jul 28 11:12:07 2013 Tanaka Akira <akr@fsij.org>
+ * common.mk: Use ruby organization url for simplecov repository.
- * include/ruby/intern.h (rb_absint_size): Declaration moved from
- internal.h to calculate required buffer size to pack integers.
- (rb_absint_numwords): Ditto.
- (rb_absint_singlebit_p): Ditto.
- [ruby-core:42813] [Feature #6065]
+Sun Nov 8 16:24:09 2015 Masaki Matsushita <glass.saga@gmail.com>
-Sun Jul 28 10:54:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: describe addition of File::TMPFILE
- * win32/win32.c (rb_w32_pipe): fix pipe name formatting. as "%x" may
- not contain '0' at all, fill at fixed position instead.
+Sun Nov 8 15:19:17 2015 Masaki Matsushita <glass.saga@gmail.com>
-Sun Jul 28 00:35:14 2013 Tanaka Akira <akr@fsij.org>
+ * file.c: Add O_TMPFILE.
- * bignum.c (rb_big_size): Return the bignum "bytewise" size.
- [ruby-core:55578] [Feature #8553]
- This is accepted by matz on DevelopersMeeting20130727Japan.
+Sun Nov 8 14:24:43 2015 windwiny <windwiny.ubt@gmail.com>
-Sun Jul 28 00:07:48 2013 Tanaka Akira <akr@fsij.org>
+ * method.h (METHOD_ENTRY_{VISI,BASIC,FLAGS}_SET): suppress
+ shift-op-parentheses warnings. [Fix GH-1082]
- * include/ruby/intern.h (rb_integer_pack): Declaration moved from
- internal.h.
- (rb_integer_unpack): Ditto.
- [ruby-core:42813] [Feature #6065]
+Sun Nov 8 14:01:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Jul 26 23:18:13 2013 Kouhei Sutou <kou@cozmixng.org>
+ * ext/psych/psych_emitter.c: backport 5bd7744 from tenderlove/psych.
+ support backward compatibility of Ruby 2.0
- * NEWS: Add a new feature that REXML::Parsers::StreamParser
- supports "entity" event.
+Sun Nov 8 10:55:10 2015 Anton Davydov <antondavydov.o@gmail.com>
-Fri Jul 26 23:14:31 2013 Kouhei Sutou <kou@cozmixng.org>
+ * io.c (rb_io_gets_m): Update IO#gets doc for characters more than
+ 1 byte. [Fix GH-1085]
- * lib/rexml/parsers/streamparser.rb
- (REXML::Parsers::StreamParser#parse): Add "entity" event support to
- listener. [Bug #8689] [ruby-dev:47542]
- Reported by Ippei Obayashi.
- * test/rexml/test_stream.rb (StreamTester#entity): Add a test for
- the above case.
+Sun Nov 8 10:37:58 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Jul 26 23:05:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/ftp.rb: fix a typo.
+ [fix GH-1084][ci skip] Patch by @windwiny
- * parse.y (parser_yylex): separate numeric literal from succeeding
- token, and treat 'e' as floating point number only if followed by
- exponent part.
+Sun Nov 8 08:10:31 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jul 26 22:14:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c (exec_hooks_precheck): check need_clean everytime
+ to clean-up unused hooks.
- * vm_exec.h (CHECK_VM_STACK_OVERFLOW_FOR_INSN): surround with
- do/while (0), and remove unnecessary casts.
+ * vm_trace.c (list->need_clean): use as boolean value.
-Fri Jul 26 20:12:07 2013 Akinori MUSHA <knu@iDaemons.org>
+Sun Nov 8 01:31:27 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syslog/lib/syslog/logger.rb (Syslog::Logger): Add facility
- to Syslog::Logger. [Fixes GH-305] patch by Max Shytikov
- https://github.com/ruby/ruby/pull/305
+ * lib/net/http.rb (Net::HTTP#initialize):
+ default value of Net::HTTP#open_timeout is now 60 (was nil).
-Fri Jul 26 19:25:17 2013 Koichi Sasada <ko1@atdot.net>
+Sat Nov 7 12:18:05 2015 Eric Wong <e@80x24.org>
- * vm_exec.h, tool/instruction.rb: not an error, but a BUG if stack
- overflow checking failed just before/after the beginning of an
- instruction. It should be treated as a BUG.
- Please tell us if your code cause BUG with this problem.
- This check will removed soon (for performance).
+ * string.c (id_to_s): remove redundant variable
+ (rb_obj_as_string): trade id_to_s for idTo_s
+ (rb_str_equal): replace rb_intern(...) with pre-defined ID
+ (rb_str_cmp_m): ditto
+ (rb_str_match): ditto
+ (str_upto_each): ditto
+ (rb_str_sum): ditto
+ (Init_String): remove id_to_s initialization
-Fri Jul 26 18:30:14 2013 Koichi Sasada <ko1@atdot.net>
+Sat Nov 7 11:40:05 2015 Eric Wong <e@80x24.org>
- * array.c (ary_memcpy): cast to int to suppress a warning.
+ * thread.c (rb_cThreadShield): make static
-Fri Jul 26 18:21:58 2013 Koichi Sasada <ko1@atdot.net>
+Sat Nov 7 09:51:38 2015 Koichi Sasada <ko1@atdot.net>
- * array.c (ary_memcpy): try to enable optimization.
- At least on my environments, I don't see any errors
- with many trials. Please tell us if you find any GC bugs.
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig):
+ maintain trace_running counter on internal events.
-Fri Jul 26 17:49:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
+ [Bug #11603] https://github.com/ruby/ruby/pull/1059
- * win32/file.c (fix_string_encoding): fix target encoding. the
- parameter `encoding' is not the target encoding but the original
- encoding.
+Sat Nov 7 03:32:27 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jul 26 14:05:19 2013 Zachary Scott <e@zzak.io>
+ * include/ruby/ruby.h (RSTRUCT_PTR): need a close parenthesis.
- * ext/fiddle/*: [DOC] More doc on dlopen and RTLD_DEFAULT from r42184
+Sat Nov 7 01:32:06 2015 Naohisa Goto <ngotogenome@gmail.com>
-Fri Jul 26 13:08:53 2013 Zachary Scott <e@zzak.io>
+ * dir.c (dir_fileno, dirfd): support of Dir#fileno on Solaris 10.
+ Solaris 10 does not have dirfd, but the file descriptor of a
+ directory is stored in the d_fd or dd_fd member in the DIR struct.
+ Note that Solaris 11 has dirfd(3C).
- * ext/fiddle/lib/fiddle.rb: [DOC] Document Fiddle.dlopen(nil)
- * ext/fiddle/handle.c: [DOC] Document Fiddle::Handle.new(nil)
+ * configure.in: checks for DIR.d_fd and DIR.dd_fd on Solaris 10.
-Fri Jul 26 13:04:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 6 23:13:53 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * load.c (rb_load_internal): use rb_load_file_str() to keep path
- encoding.
+ * array.c: clarifies Array#reject! documentation.
+ [fix GH-894][ci skip] Patch by @GxSplinter
- * load.c (rb_require_safe): search in OS path encoding for Windows.
+Fri Nov 6 20:18:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ruby.c (rb_load_file_str): load file with keeping path encoding.
+ * test/runner.rb: extracted test helper.
+ * test/lib/zombie_hunter.rb: ditto.
- * win32/file.c (rb_file_load_ok): use WCHAR type API assuming incoming
- path is encoded in UTF-8. [ruby-core:56136] [Bug #8676]
+Fri Nov 6 18:07:47 2015 Naohisa Goto <ngotogenome@gmail.com>
- * file.c (rb_str_encode_ospath): simplify using rb_str_conv_enc().
+ * include/ruby/ruby.h (rb_array_const_ptr, rb_struct_const_ptr):
+ Suppress pointer type mismatch warnings occurred with old version
+ of Fujitsu C Compiler (fcc) on Solaris 10. The warnings cause
+ failure of TestMkmf::TestConvertible. [Bug #11644] [ruby-dev:49326]
+ * include/ruby/ruby.h (FIX_CONST_VALUE_PTR): macro for the above,
+ only effective with fcc.
- * win32/file.c (fix_string_encoding): simplify with rb_str_conv_enc().
+Fri Nov 6 12:39:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/file.c (convert_mb_to_wchar): use bare pointer instead of
- VALUE, and remove useless argument.
+ * defs/id.def (token_ops), parse.y (parser_yylex): change DOTQ
+ from ".?" to "&.". [ruby-core:71363] [Feature #11537]
-Fri Jul 26 11:42:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 6 09:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * rational.c (f_round_common): Rational is expected to be returned by
- Rational#*, but mathn.rb breaks that assumption. [ruby-core:56177]
- [Bug #8687]
+ * parse.y (kwd_append): fix segv after invalid keyword argument,
+ preceding keyword list is NULL when syntax error is there.
+ [ruby-core:71356] [Bug #11663]
-Fri Jul 26 01:37:45 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 6 06:59:37 2015 Eric Wong <e@80x24.org>
- * include/ruby/ruby.h: check defined(USE_RGENGC_LOGGING_WB_UNPROTECT)
+ * test/ruby/test_autoload: hoist out ruby_impl_require
-Fri Jul 26 01:21:41 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Nov 5 13:03:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_file_expand_path_internal): fix r42160; skip '~'.
+ * defs/id.def (token_ops): gather associations between IDs,
+ operators, and parser tokens.
-Thu Jul 25 17:53:18 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Nov 5 10:17:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb (Net::HTTP#connect): disable Nagle's algorithm on
- HTTP connection. [ruby-core:56158] [Feature #8681]
+ * ext/socket/socket.c (make_addrinfo): use RARRAY_ASET for
+ write-barrier.
-Thu Jul 25 17:49:42 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/tk/tcltklib.c ({call,eval,invoke}_queue_handler): ditto.
- * re.c (rb_reg_to_s): convert closing parenthesis to the target encoding
- if it is ASCII incompatible encoding. [ruby-core:56063] [Bug #8650]
+ * ext/tk/tkutil/tkutil.c (ary2list, ary2list2): ditto.
-Thu Jul 25 17:21:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 5 10:09:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c (is_obj_encoding): new macro to check if obj is an
- Encoding. obj can be any type while is_data_encoding expects T_DATA
- only.
+ * ext/**/*.c: prefer RARRAY_AREF to indexing RARRAY_CONST_PTR.
+ pointed out by hanmac.
+ https://github.com/ruby/ruby/commit/3553a86#commitcomment-14187670
-Thu Jul 25 17:17:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 4 17:33:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * file.c (rb_file_expand_path_internal): should clear coderange after
- copying user name as binary data.
+ * lib/debug.rb: Add documentation for #thread_list_all.
+ [Misc #11580][ci skip]
-Thu Jul 25 16:17:55 2013 Koichi Sasada <ko1@atdot.net>
+Wed Nov 4 15:45:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * encoding.c (check_encoding): Check T_DATA or not.
- is_data_encoding(obj) assumes that `obj' is T_DATA.
+ * class.c: fix documentation for rb_define_class{_id}_under.
+ [fix GH-991][ci skip] Patch by @kachick
-Thu Jul 25 13:06:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 4 15:40:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * dir.c (dir_s_home): use rb_home_dir_of and rb_default_home_dir.
+ * method.h: fix typo. Patch by @davydovanton
+ [fix GH-1076][ci skip]
- * file.c (rb_home_dir_of): split from rb_home_dir() for the home
- directry of the given user, and the user name is a VALUE, not a bare
- pointer. should raise if the user does not exist.
+Wed Nov 4 15:39:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * file.c (rb_default_home_dir): split from rb_home_dir() for the home
- directry of the current user.
+ * hash.c: use correct grammar. Patch by @tveastman
+ [fix GH-1079][ci skip]
-Thu Jul 25 12:32:11 2013 Koichi Sasada <ko1@atdot.net>
+Wed Nov 4 11:38:23 2015 Jake Worth <jakeworth82@gmail.com>
- * ext/openssl/ossl.c: support additional three thread synchronization
- functions. [ruby-trunk - Bug #8386]
+ * process.c (proc_getsid): [DOC] Fix double word 'for' and typo.
+ [Fix GH-1080]
-Thu Jul 25 07:15:58 2013 Eric Hodel <drbrain@segment7.net>
+Wed Nov 4 06:01:52 2015 Eric Wong <e@80x24.org>
- * lib/rubygems: Import RubyGems from master as of commit 4ff70cc
- * test/rubygems: ditto.
+ * include/ruby/ruby.h (struct RObject): hide iv_index_tbl type
+ [ruby-core:71306] [Feature #11647]
-Wed Jul 24 20:57:44 2013 Koichi Sasada <ko1@atdot.net>
+Tue Nov 3 06:48:58 2015 Eric Wong <e@80x24.org>
- * compile.c (iseq_set_arguments): use RARRAY_RAWPTR() instead of
- RARRAY_PTR() because there is no new reference.
+ * variable.c (find_class_path): remove cast for rb_class_ivar_set
+ (rb_ivar_set): ditto
+ (rb_cvar_set): ditto
- * compile.c (iseq_set_exception_table): ditto.
+Tue Nov 3 06:18:21 2015 Eric Wong <e@80x24.org>
-Wed Jul 24 19:49:54 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * variable.c (rb_global_tbl): convert to id_table
- * lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is
- a relative URI. [Bug #8645]
+Tue Nov 3 01:58:46 2015 Naohisa Goto <ngotogenome@gmail.com>
-Wed Jul 24 18:56:06 2013 Koichi Sasada <ko1@atdot.net>
+ * parse.y (NO_QCALL): fix type mismatch of operands that causes
+ compile error with Oracle Solaris Studio on Solaris.
+ [Bug #11645] [ruby-dev:49327]
- * vm_insnhelper.c (vm_expandarray): use RARRAY_RAWPTR() instead of
- RARRAY_PTR() because there is no new reference.
+Sun Nov 1 17:14:36 2015 Koichi Sasada <ko1@atdot.net>
- * vm_insnhelper.c (vm_caller_setup_args): ditto.
+ * id_table.c (mix_id_table_insert): do not touch list during
+ list->hash transition because GC can run during transition.
- * vm_insnhelper.c (vm_yield_setup_block_args): ditto.
+Sun Nov 1 11:07:31 2015 Eric Wong <e@80x24.org>
-Wed Jul 24 18:40:11 2013 Koichi Sasada <ko1@atdot.net>
+ * iseq.c (iseq_memsize): account for rb_call_cache entries
- * array.c, gc.c: move ary_unprotect_logging() into
- rb_gc_unprotect_logging() which is general version
+Sun Nov 1 09:12:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h: add USE_RGENGC_LOGGING_WB_UNPROTECT
- to enable.
+ * parse.y (parser_yylex): ':' separated by a comment and a newline
+ is not valid as symbol.
-Wed Jul 24 17:37:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 31 20:15:48 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * file.c (rb_file_expand_path_internal): preserve the file name
- encoding in an exception message.
+ * test/openssl/test_pair.rb: skipped tests if openssl doesn't support
+ ECDH cipher.
-Wed Jul 24 08:04:49 2013 Koichi Sasada <ko1@atdot.net>
+Sat Oct 31 14:58:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/-ext-/tracepoint/test_tracepoint.rb: add GC on/off to count
- GC events strictly.
+ * man/ruby.1 (SYNOPSIS): remove extraneous space for -F option as
+ it does not allow spaces before its argument.
+ [ruby-core:71283] [Bug #11641]
-Tue Jul 23 23:19:24 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Oct 31 14:58:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/extconf.rb (CRYPTO_THREADID): check exist or not.
+ * man/ruby.1 (SYNOPSIS): remove extraneous space for -F option as
+ it does not allow spaces before its argument.
+ [ruby-core:71283] [Bug #11641]
- * ext/openssl/ossl.c (ossl_thread_id): use rb_nativethread_self()
- implemented at r42137 to allow threads which doesn't associated with
- Ruby thread to use openssl functions.
+Sat Oct 31 10:22:49 2015 yui-knk <spiketeika@gmail.com>
- * ext/openssl/ossl.c (Init_ossl_locks): If CRYPTO_THREADID is defined
- (OpenSSL 1.0.0 or later has it) use CRYPTO_THREADID_set_callback()
- instead of CRYPTO_set_id_callback() because its argument is
- unsigned long; it may cause id collision on mswin64
- whose sizeof(unsigned long) < sizeof(void*).
- http://www.openssl.org/docs/crypto/threads.html
+ * eval_error.c (undef_mesg_for): fix typo. Before this commit
+ `ArgumentError: malformed format string - %$` was raised when
+ `NameError#message` is called. [ruby-core:71282] [Bug #11640]
+ [Fix GH-1077]
- * ext/openssl/ossl.c (ossl_threadid_func): defined for above.
+Fri Oct 30 21:12:45 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-Tue Jul 23 20:47:36 2013 Tanaka Akira <akr@fsij.org>
+ * gems/bundled_gems: update to power_assert 0.2.5.
- * bignum.c: Move functions.
+Fri Oct 30 19:29:52 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jul 23 20:14:55 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (newobj_slowpath): do not need to use flags hack (commit miss).
- * bignum.c (bary_divmod): Add special cases for x < y easily detected
- and nx == 2 && ny == 2.
+Fri Oct 30 19:08:48 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jul 23 19:48:38 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (heap_get_freeobj_from_next_freepage): not so UNLIKELY.
- * thread_(pthread|win32).h: rename rb_thread_cond_t to
- rb_nativethread_cond_t.
+Fri Oct 30 18:09:51 2015 Koichi Sasada <ko1@atdot.net>
- * thread.c, thread_pthread.c, thread_win32.c, vm_core.h: catch up
- renaming.
+ * gc.c (newobj_slowpath): reduce 1 parameter to use only registers
+ for performance.
-Tue Jul 23 19:44:32 2013 Koichi Sasada <ko1@atdot.net>
+ On my laptop, 'N.times{x = []}' (where N = 29_000_000) is
+ 1.86 sec -> 1.74 sec.
- * thread_native.h: add rb_nativethread_self() which returns
- current running native thread identifier.
+Fri Oct 30 12:53:21 2015 yui-knk <spiketeika@gmail.com>
- * thread_[pthread|win32].c: implement rb_nativethread_self().
+ * test/ruby/test_call.rb: added test for safe navigation operator.
+ [fix GH-1066]
-Tue Jul 23 19:34:11 2013 Koichi Sasada <ko1@atdot.net>
+Fri Oct 30 12:47:34 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * thread_pthread.h, thread_win32.h: rename rb_thread_id_t to
- rb_nativethread_id_t.
+ * ChangeLog: fix wrong commit name.
- * thread_pthread.c, vm_core.h: use rb_nativethread_id_t.
+Fri Oct 30 12:36:16 2015 yui-knk <spiketeika@gmail.com>
-Tue Jul 23 18:56:11 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_method.c: added documentation of protected/private methods.
+ [fix GH-1072]
+ * test/ruby/test_module.rb: added testcase for method_defined?
+ [fix GH-1071]
- * ext/openssl/ossl.c: use system native (system provided)
- thread locking APIs added by last commit.
- This patch fixes [Bug #8386].
- "rb_mutex_*" APIs control only "Ruby" threads.
- Not for native threads.
+Fri Oct 30 12:06:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 23 18:44:15 2013 Koichi Sasada <ko1@atdot.net>
+ * variable.c (rb_class_ivar_set): rename as class specific ivar
+ setter, and st_table is no longer involved.
- * thread_native.h: added.
- Move native thread related lines from vm_core.h.
- And declare several functions "rb_nativethread_lock_*",
- manipulate locking.
+Fri Oct 30 11:36:33 2015 Eric Wong <e@80x24.org>
- * common.mk: add thread_native.h.
+ * variable.c (generic_ivar_remove): adjust type, set valp
+ (rb_obj_remove_instance_variable): simplify call
+ * test/ruby/test_object.rb (test_remove_instance_variable):
+ expand for implementation details
- * thread.c: add functions "rb_nativethread_lock_*".
+Fri Oct 30 10:37:56 2015 Eric Wong <e@80x24.org>
- * thread.c, thread_[pthread,win32].[ch]: rename rb_thread_lock_t
- to rb_nativethread_lock_t to make it clear that this lock is for
- native threads, not for ruby threads.
+ * internal.h (rb_st_insert_id_and_value): update prototype
+ * variable.c (rb_st_insert_id_and_value): reduce args
+ (find_class_path): adjust call for less args
+ (rb_ivar_set): ditto
+ (rb_cvar_set): ditto
+ * class.c (rb_singleton_class_attached): ditto
-Tue Jul 23 16:14:57 2013 Koichi Sasada <ko1@atdot.net>
+Fri Oct 30 09:57:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (gc_before_sweep): fix spacing.
+ * gems/bundled_gems: update latest gems.
+ test-unit-3.1.5 and minitest-5.8.2
-Tue Jul 23 15:57:11 2013 Koichi Sasada <ko1@atdot.net>
+Fri Oct 30 09:54:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (heap_get_freeobj): clear slot->freelist here.
- This means that this slot doesn't have any free objects.
- And store this slot with objspace->heap.using_slot.
+ * lib/rubygems: Update to RubyGems HEAD(60d7972).
+ this version contains pull requests number of #1343, #1356, #1357, #1363
+ at https://github.com/rubygems/rubygems/pulls
+ * test/rubygems: ditto.
- * gc.c (gc_before_sweep): restore objspace->freelist
- into objspace->heap.using_slot->freelist.
- This means that using_slot has free objects which are
- pointed from objspace->freelist.
+Fri Oct 30 07:38:29 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (gc_slot_sweep): do not need to clear slot->freelist.
+ * insns.def (getinlinecache/setinlinecache): compare ic->ic_cref and
+ current cref only when cached CREF list includes singleton class.
-Tue Jul 23 09:34:49 2013 Zachary Scott <e@zzak.io>
+ Singleton classes have own namespaces, so that we need to check
+ cref as a key (#10943).
- * sample/drb/README*.rdoc: [DOC] migrate DRb sample READMEs to rdoc
+ However, if current CREF list does not include singleton class,
+ no need to check CREF because it should be same name space.
-Tue Jul 23 09:28:05 2013 Zachary Scott <e@zzak.io>
+ * vm_insnhelper.c (vm_get_const_key_cref): add a function returns
+ CREF only when it includes singleton class.
- * lib/drb/invokemethod.rb: [DOC] nodoc InvokeMethod18Mixin
+ * vm_core.h: constify iseq_inline_cache_entry::ic_cref.
-Tue Jul 23 08:44:37 2013 Eric Hodel <drbrain@segment7.net>
+Fri Oct 30 06:43:50 2015 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_asn1.c (asn1time_to_time): Implement YYMMDDhhmmZ
- format for ASN.1 UTCTime. [ruby-trunk - Bug #8664]
- * test/openssl/test_asn1.rb: Test for the above.
+ * vm_insnhelper.c (vm_env_cref): make it inline for performance.
-Tue Jul 23 08:11:32 2013 Zachary Scott <e@zzak.io>
+ * vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0.
- * lib/rexml/streamlistener.rb: [DOC] Fix examples in
- REXML::StreamListener#entitydecl patch by Ippei Obayashi [Bug #8665]
+Fri Oct 30 06:20:40 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jul 23 07:44:59 2013 Eric Hodel <drbrain@segment7.net>
+ * insns.def: nobody set ic->ic_value.value to Qundef.
- * lib/rubygems: Import RubyGems from master as of commit b165260
- * test/rubygems: ditto.
+Fri Oct 30 06:15:50 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jul 23 07:14:31 2013 Tanaka Akira <akr@fsij.org>
+ * vm.c: add ifndef guard for VM_CHECK_MODE.
- * bignum.c (bary_mulsub_1xN): New function.
- (bary_mul_toom3): Use bary_mulsub_1xN.
+Fri Oct 30 06:13:10 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jul 23 03:32:23 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_check_frame_detail): should require me for
+ VM_FRAME_FLAG_BMETHOD type frame.
- * bignum.c (KARATSUBA_BALANCED): New macro.
- (TOOM3_BALANCED): Ditto.
- (bary_mul_balance_with_mulfunc): Use KARATSUBA_BALANCED and
- TOOM3_BALANCED.
- (rb_big_mul_balance): Relax a condition.
- (rb_big_mul_karatsuba): Use KARATSUBA_BALANCED.
- (rb_big_mul_toom3): Use TOOM3_BALANCED.
- (bary_mul_karatsuba_branch): Use KARATSUBA_BALANCED.
- (bary_mul_toom3_branch): Use TOOM3_BALANCED.
+Thu Oct 29 18:42:30 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jul 23 01:34:45 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (gc_mark_ptr): specify NOINLINE so that gc_mark() can return
+ immediately when obj is not a markable object.
- * bignum.c (bigdivrem_mulsub): Extracted from bigdivrem1.
- (bigdivrem1): Use bary_add.
+Thu Oct 29 18:05:22 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jul 22 18:39:52 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * encoding.c (rb_enc_check_str): add for performance.
+ This function only accepts T_STRING (and T_REGEXP).
- * string.c (rb_str_enumerate_chars): specify array capa
- with str_strlen().
+ This patch improves performance of a tiny_segmenter benchmark
+ (num=2) 2.54sec -> 2.42sec on my machine.
+ https://github.com/chezou/TinySegmenter.jl/blob/master/benchmark/benchmark.rb
- * string.c (rb_str_enumerate_codepoints): ditto.
+ * encoding.c: add ENC_DEBUG and ENC_ASSERT() macros.
-Mon Jul 22 18:01:33 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * internal.h: add a decl. of rb_enc_check_str().
- * string.c (rb_str_enumerate_chars): specify array capa.
+ * string.c (rb_str_plus): use rb_enc_check_str().
-Mon Jul 22 17:24:14 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * string.c (rb_str_subpat_set): ditto.
- * string.c (rb_str_each_char_size): performance improvement by
- using rb_str_length().
+Thu Oct 29 17:16:40 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jul 22 16:32:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h: export rb_wb_(un)protected_newobj_of()
+ because some extensions include internal.h.
- * vm_eval.c (eval_string_with_cref): check by Check_TypedStruct
- instead of rb_obj_is_kind_of.
+Thu Oct 29 16:42:19 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jul 22 13:19:22 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (rb_imemo_new): should not pass FL_WB_PROTECTED flag.
- * array.c (ary_resize_capa): use RARRAY_RAWPTR() because
- this code creates no new references.
+ * gc.c (rb_wb_protected_newobj_of): add more assertions.
-Mon Jul 22 12:58:18 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (rb_wb_unprotected_newobj_of): ditto.
- * array.c (ary_memfill): added.
+Thu Oct 29 16:20:26 2015 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_initialize): use ary_memfill().
+ * gc.c: introduce rb_wb_unprotected_newobj_of() and
+ rb_wb_protected_newobj_of(), pass the WB_PROTECTED
+ information explicitly.
- * array.c (rb_ary_fill): ditto.
+ * internal.h: use introduced functions by NEWOBJ_OF().
+ `flag' is immediate value, so that C compilers can
+ solve them at compile time.
- * array.c (rb_ary_slice_bang): use RARRAY_RAWPTR() because
- this code creates no new references.
+ * include/ruby/ruby.h: add a comment about that.
-Mon Jul 22 10:09:46 2013 Koichi Sasada <ko1@atdot.net>
+Thu Oct 29 14:52:03 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (gc_slot_sweep): need to add empty RVALUE as freeobj.
+ * gc.c: add rb_objspace::flags::has_hook to represent hook availability.
-Mon Jul 22 09:48:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c: add gc_event_hook_available_p(objspace) to check that flag.
- * vm_eval.c (eval_string_with_cref): use the given file name unless
- eval even if scope is given. additional fix for [Bug #8436].
- based on the patch by srawlins at [ruby-core:56099] [Bug #8662].
+ * gc.c (newobj_of): use gc_event_hook_available_p() instead of
+ checking gc_event_hook_needed_p(objspace, RUBY_INTERNAL_EVENT_NEWOBJ).
+ for performance.
-Mon Jul 22 09:24:19 2013 Kouji Takao <kouji@takao7.net>
+ * gc.c (newobj_init): add UNLIKELY() for FL_WB_PROTECTED flag.
- * ext/readline/readline.c (Init_readline): added
- Readline.delete_text. [ruby-dev:45789] [Feature #6626]
- * ext/readline/extconf.rb: check for rl_delete_text() in Readline library.
+ * gc.c (newobj_init): change parameters order (trivial change).
- Thanks, Nobuyoshi Nakada, for the patch.
+Thu Oct 29 14:45:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 22 03:15:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (rb_thread_struct): move forward declarations before
+ used.
- * ext/date/date_parse.c (rfc2822_cb): check if wday is given, since it
- can be omitted.
+Thu Oct 29 14:07:54 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jul 22 00:15:20 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (gc_mark_ptr): remove debug code for #11244.
- * bignum.c (bary_sq_fast): Refine expressions.
+Thu Oct 29 10:08:33 2015 Eric Wong <e@80x24.org>
-Sun Jul 21 21:08:59 2013 Tanaka Akira <akr@fsij.org>
+ * variable.c (struct autoload_state): usable as wait-queue head
+ (struct autoload_data_i): remove 2 words of overhead
+ (autoload_i_mark): remove marking for thread
+ (autoload_reset): adjust for struct changes
+ (rb_autoload): ditto
+ (rb_autoloading_value): ditto
+ (rb_autoload_load): ditto
+ (const_update): ditto
- * bignum.c (bary_mul): Use simple multiplication if yl is small.
- (rb_cstr_to_inum): Invoke bigsq instead of bigmul0.
- (bigsq): Re-implemented.
- (bigmul0): Invoke bigsq if two arguments are identical.
+Thu Oct 29 08:48:05 2015 Eric Wong <e@80x24.org>
-Sun Jul 21 09:58:19 2013 Tanaka Akira <akr@fsij.org>
+ * variable.c (struct autoload_data_i): add waitq_head
+ (struct autoload_state): new struct
+ (autoload_require): save result in autoload_state for use
+ in autoload_reset
+ (autoload_reset): wake up other waiters with open-coded
+ wait-queues
+ (rb_autoload_load): add ensure autoload_const_set happens
+ atomically w.r.t. autoload-triggered "require"
+ [ruby-core:70075] [ruby-core:71239] [Bug #11384]
- * bignum.c (bary_mul_toom3): New function based on bigmul1_toom3.
- (bary_mul_toom3_branch): Call bary_mul_toom3.
- (rb_big_mul_toom3): Ditto.
- (bigmul1_toom3): Removed.
- (big_real_len): Ditto.
- (big_split): Ditto.
- (big_split3): Ditto.
+Wed Oct 29 00:39:50 2015 Naohisa Goto <ngotogenome@gmail.com>
-Sun Jul 21 08:12:16 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * test/rubygems/test_gem_commands_server_command.rb
+ (test_handle_options_port): change port from http to discard.
+ Solaris does not include "http 80/tcp" in its default
+ /etc/inet/services. AFAIK, discard (9/tcp) is older than http
+ and it is expected that all OS can resolve the service name.
+ [Bug #10004] [ruby-core:63518]
- * proc.c (proc_to_s): use PRIsVALUE to preserve the result encoding.
+Wed Oct 28 23:52:48 2015 Naohisa Goto <ngotogenome@gmail.com>
-Sun Jul 21 03:36:18 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * probes_helper.h (RUBY_DTRACE_HOOK): add RB_GC_GUARD, though paranoic.
- * hash.c (rb_hash_flatten): use NUM2INT to raise TypeError on 32bit
- platform. it's introduced by r42039
+Wed Oct 28 15:36:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jul 21 01:07:45 2013 Benoit Daloze <eregontp@gmail.com>
+ * error.c (rb_name_err_new): store the receiver directly.
- * common.mk (help): Fix environment variable name and argument.
- Actually it can also be a directory or any argument for
- test/unit runner. [Fixes GH-363]
+ * error.c (name_err_receiver): return directly stored receiver.
+ [Feature #10881]
-Sat Jul 20 22:44:50 2013 Zachary Scott <e@zzak.io>
+ * error.c (name_err_mesg_to_str): quote the name if unprintable.
- * common.mk: Document running a single test [Fixes GH-363]
- Patch by Avdi Grimm https://github.com/ruby/ruby/pull/363
+ * object.c (check_setter_id): use rb_check_id to convert names.
-Sat Jul 20 22:39:56 2013 Zachary Scott <e@zzak.io>
+ * variable.c (uninitialized_constant): use NameError::message to
+ keep the receiver of uninitialized constant. [Feature #10881]
- * sample/*: whitespace patch by Sergio Campama [Fixes GH-364]
- https://github.com/ruby/ruby/pull/364
+ * error.c (rb_name_err_new): new function to create NameError
+ exception instance. [Feature #10881]
-Sat Jul 20 22:33:13 2013 Zachary Scott <e@zzak.io>
+Wed Oct 28 13:29:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * doc/regexp.rdoc: [DOC] Fix typo in example [Fixes GH-365]
- Patch by Juanito Fatas https://github.com/ruby/ruby/pull/365
+ * parse.y (new_attr_op_assign): fix op_assign type, which is
+ already an ID since r52284. [Feature #11537]
-Sat Jul 20 17:46:03 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Oct 27 23:14:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_succ): add missing case NEIGHBOR_WRAPPED.
- r42078 caused buggy behavior like "\xFF".b -> "\x01\xFF".b
+ * defs/id.def: enable anonymous IDs not to expose internal IDs for
+ frozen-string-literal-debug by Marshal.dump.
-Sat Jul 20 15:22:38 2013 Koichi Sasada <ko1@atdot.net>
+Tue Oct 27 17:06:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_resize): use simple memcpy because there are no new
- references.
+ * defs/id.def: move internal IDs for frozen-string-literal-debug.
-Sat Jul 20 15:02:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 27 16:41:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * safe.c (ruby_safe_level_4_warning): define for old extension
- libraries. [Bug #8652]
+ * error.c (rb_error_frozen_object): use rb_attr_get instead of
+ rb_ivar_get to get rid of warnings for string objects created
+ when frozen-string-literal-debug is disabled.
-Sat Jul 20 14:38:00 2013 Koichi Sasada <ko1@atdot.net>
+Tue Oct 27 16:18:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (ary_make_shared): make shared array shady.
- Making non-shady shared array causes SEGV (see rubyci).
- It seems a bug around shared array.
+ * lib/logger.rb (Logger::Period#previous_period_end): as weekly
+ rotation shifts the log file on Sundays, the end date of the
+ previous period should be Saturdays. fix r45072.
+ [ruby-dev:49314] [Bug #11622]
-Sat Jul 20 12:14:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 27 16:12:37 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (enc_succ_char, enc_pred_char): consider wchar case.
- [ruby-core:56071] [Bug #8653]
+ * vm_dump.c (rb_print_backtrace): our addr2line doesn't work on sparc.
+ http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20151027T043311Z.log.html.gz
- * string.c (rb_str_succ): do not replace with invalid char.
+Tue Oct 27 12:00:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c (rb_enc_code_to_mbclen): add new function which returns
- mbclen from codepoint like as rb_enc_codelen() but 0 for invalid
- char.
+ * lib/logger.rb (Logger::Period#next_rotate_time): get rid of
+ adding to mday not to exceed the days of the month.
+ [ruby-core:71185] [Bug #11620]
- * include/ruby/encoding.h (rb_enc_code_to_mbclen): declaration and
- shortcut macro.
+Mon Oct 26 22:43:03 2015 yui-knk <spiketeika@gmail.com>
-Fri Jul 19 21:59:12 2013 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_module.rb (test_method_defined): Add test cases
+ for `public/protected/private _method_defined?`
+ These methods accept string as argument, so add string argument
+ cases. [Fix GH-1067]
- * gc.c: declare type_name() at the beginning of file.
+Mon Oct 26 22:23:30 2015 SimonDKnight <simondknight@hotmail.com>
-Fri Jul 19 21:35:09 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/racc/rdoc/grammar.en.rdoc: Grammatical errors fixed.
+ [Fix GH-1070]
- * array.c: reduce shady operations.
+Mon Oct 26 18:36:43 2015 Shota Fukumori (sora_h) <her@sorah.jp>
- * array.c (rb_ary_modify, ary_make_partial, rb_ary_splice,
- rb_ary_replace, rb_ary_eql, rb_ary_compact_bang):
- use RARRAY_RAWPTR() instead of RARRAY_PTR().
+ * vm_method.c(rb_method_entry_make):
+ [DOC] [ci skip] Remove a needless space from comment
+ [Fixes GH-1069] Patch by @yui-knk
- * array.c (rb_ary_shift): use RARRAY_PTR_USE() without WB because
- there are not new relations.
+Mon Oct 26 17:30:13 2015 Ryan Hosford <tad.hosford@gmail.com>
- * array.c (ary_ensure_room_for_unshift): ditto.
+ * lib/fileutils.rb: rename tailing to trailing.
+ [Misc #11548]
- * array.c (rb_ary_sort_bang): ditto.
+Mon Oct 26 17:11:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_delete_at): ditto.
+ * parse.y (call_op, call_op2): fix values on ripper. [Feature #11537]
- * array.c (rb_ary_reverse_m): use RARRAY_RAWPTR() because
- there are not new relations.
+Mon Oct 26 12:55:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 19 20:58:20 2013 Koichi Sasada <ko1@atdot.net>
+ * parse.y (call_op2): separate from call_op and also allow "::",
+ while dot_or_colon should not allow ".?". [Feature #11537]
- * array.c: reduce shade operations.
+Mon Oct 26 01:03:23 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * array.c (rb_ary_modify): use RARRAY_RAWPTR().
+ * thread_pthread.c: fix compile errors when
+ USE_SLEEPY_TIMER_THREAD is disabled.
- * array.c (ary_make_substitution, rb_ary_s_create, ary_make_partial,
- rb_ary_splice, rb_ary_resize, rb_ary_rotate_m, rb_ary_times):
- use ary_memcpy().
+Sun Oct 25 10:12:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 19 19:55:28 2013 Koichi Sasada <ko1@atdot.net>
+ * symbol.c (op_tbl): add DOTQ for ripper. [Feature #11537]
- * array.c (ary_mem_clear): added. This operation doesn't need WB
- because this operation creates a reference to Qnil.
+Sat Oct 24 22:51:18 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * array.c (ary_make_shared, rb_ary_store, rb_ary_shift_m,
- rb_ary_splice, rb_ary_resize, rb_ary_fill): use ary_mem_clear()
- instead of rb_mem_clear().
+ * configure.in: fixed build failure of Haiku.
+ [fix GH-984] Patch by @kallisti5
+ * ext/socket/getaddrinfo.c: ditto.
+ * ext/socket/getnameinfo.c: ditto.
+ * ext/socket/rubysocket.h: ditto.
- * array.c (ary_make_shared): use RARRAY_RAWPTR() instead of RARRAY_PTR().
+Sat Oct 24 21:16:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 19 19:18:51 2013 Koichi Sasada <ko1@atdot.net>
+ * test/fileutils/test_fileutils.rb (test_uptodate): relax error
+ message format. [Feature #9025], [ruby-core:71178] [Bug #11617]
- * array.c: fix commit miss.
- RGENGC_UNPROTECT_LOGGING should be 0.
+Sat Oct 24 21:06:43 2015 Shota Fukumori (sora_h) <her@sorah.jp>
-Fri Jul 19 19:15:30 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/mkmf.rb: Revert r45640 because it may lead to link
+ with different libruby. [Bug #9760]
- * array.c (rb_ary_resurrect): use RARRAY_RAWPTR() because there is no
- writing.
+Sat Oct 24 15:42:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_new_from_values): use ary_memcpy().
+ * bootstraptest/test_method.rb: relax error message format.
-Fri Jul 19 19:07:31 2013 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_arity.rb (err_mess): ditto.
+ [Feature #9025], [ruby-core:71178] [Bug #11617]
- * array.c (ary_memcpy): add a function to copy VALUEs into ary
- with write barrier. If ary is promoted, use write barrier correctly.
+Sat Oct 24 12:47:47 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * array.c (rb_ary_cat, rb_ary_unshift_m, rb_ary_dup,
- rb_ary_sort_bang, rb_ary_replace, rb_ary_plus): use ary_memcpy().
+ * vm_insnhelper.c: improved error message for "wrong number
+ of arguments", distinguishing given and expected argument
+ numbers clearly. [Feature #9025]
-Fri Jul 19 15:32:57 2013 Koichi Sasada <ko1@atdot.net>
+Sat Oct 24 11:57:59 2015 Shugo Maeda <shugo@ruby-lang.org>
- * array.c (rb_ary_store): use RARRAY_PTR_USE() instead of RARRAY_PTR().
- Clearing memory space doesn't need WBs.
+ * vm_insnhelper.c: remove the typedef redeclaration of
+ vm_call_handler.
-Fri Jul 19 15:19:37 2013 Koichi Sasada <ko1@atdot.net>
+Sat Oct 24 07:29:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (ary_ensure_room_for_push): use RARRAY_RAWPTR() instead of
- RARRAY_PTR. In this code, there are no "write" operation.
+ * lib/forwardable.rb (def_instance_delegator, def_single_delegator):
+ match backtraces against ::Forwardable in case the target class
+ is a subclass of BasicObject and does not include Kernel.
+ [ruby-core:71176] [Bug #11616]
- * array.c (rb_ary_equal): ditto.
+Sat Oct 24 04:10:13 2015 Koichi Sasada <ko1@atdot.net>
- * array.c (recursive_equal): ditto.
+ * iseq.c (make_compile_option_value): include frozen_string_literal*
+ in a made option value.
-Fri Jul 19 15:09:22 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_opts.h: forgot to add OPT_FROZEN_STRING_LITERAL_DEBUG
+ at last commit.
- * gc.c, internal.h (rb_gc_writebarrier_remember_promoted): add a new
- function to remember an specified object. This api is only
- experimental (strongly depend on WB/rgengc strategy).
+Sat Oct 24 03:58:02 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jul 19 14:56:00 2013 Koichi Sasada <ko1@atdot.net>
+ * ruby.c: introduce --enable-frozen-string-literal-debug option.
+ If this option is enabled, the modify error will be:
+ can't modify frozen String (RuntimeError) =>
+ can't modify frozen String, created at test.rb:3 (RuntimeError)
- * array.c (ary_unprotect_logging): use (void *) for first parameter
- because VALUE is not defined before including ruby/ruby.h.
+ * iseq.h: add compile option frozen_string_literal_debug.
-Fri Jul 19 14:19:48 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * compile.c: catch up this fix.
- * ext/pathname/pathname.c (path_inspect): use PRIsVALUE to preserve
- the result encoding.
+ * error.c (rb_error_frozen): ditto.
-Fri Jul 19 12:35:41 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c (set_compile_option_from_hash): ditto.
- * test/socket/test_tcp.rb (test_initialize_failure): Use EADDRNOTAVAIL
- to test an error message generated by bind() failure.
+ * test/ruby/test_rubyoptions.rb: add a test for this fix.
-Fri Jul 19 11:27:38 2013 Zachary Scott <e@zzak.io>
+Sat Oct 24 02:02:24 2015 Koichi Sasada <ko1@atdot.net>
- * lib/racc/parser.rb: [DOC] Capitalize "Ruby" in documentation
- Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+ * vm_insnhelper.c: introduce new call handler for simple ISeqs.
-Fri Jul 19 11:26:28 2013 Zachary Scott <e@zzak.io>
+ vm_call_iseq_setup_normal_0start() is simple, however it has
+ some loops/conditions depends on ISeq::param.size and
+ ISeq::local_size (in vm_push_frame(), inlined into this function).
- * ext/psych/lib/psych*: [DOC] Capitalize "Ruby" in documentation
- Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+ There are many simple methods which has a few parameters and local
+ variables. So that this patch introduces several special functions
+ generated in vm_call_iseq_optimized.inc by
+ tool/mk_call_iseq_optimized.rb.
-Fri Jul 19 11:25:12 2013 Zachary Scott <e@zzak.io>
+ This script makes
+ vm_call_iseq_setup_normal_0start_Xparams_Ylocals()
+ where X is 0 to 3 and Y is 1 to 6 (as current setting).
+ In this case, X * Y = 24 functions are created.
- * lib/rdoc/*: [DOC] Capitalize "Ruby" in documentation
- Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+ These functions creates fast method dispatch by inlining
+ vm_push_frame() with immediate params/locals sizes.
-Fri Jul 19 11:23:55 2013 Zachary Scott <e@zzak.io>
+ On my laptop, we can have the following results.
- * lib/rubygems*: [DOC] Capitalize "Ruby" in documentation
- Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+ vm2_method* 1.083 (8.3% faster)
+ vm2_poly_method* 0.961 (3.4% slower)
-Fri Jul 19 11:16:54 2013 Akinori MUSHA <knu@iDaemons.org>
+ It shows 8.3% faster for inner loop method dispatch (hit inline
+ cache), but 3.4% slower when inline cache miss because we need
+ to find a suitable call handler.
- * lib/set.rb (Set#to_set): Define Set#to_set so that aSet.to_set
- returns self. [Fixes GH-359]
+ * common.mk: add a rule for vm_call_iseq_optimized.inc.
-Fri Jul 19 11:10:23 2013 Zachary Scott <e@zzak.io>
+ * tool/mk_call_iseq_optimized.rb: added.
- * lib/rake/*: [DOC] Capitalize "Ruby" in documentation
- Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+ * vm.c: include vm_call_iseq_optimized.inc.
-Fri Jul 19 01:04:14 2013 Tanaka Akira <akr@fsij.org>
+Sat Oct 24 01:58:50 2015 Koichi Sasada <ko1@atdot.net>
- * ext/-test-/bignum/intpack.c: Renamed from ext/-test-/bignum/pack.c.
- (Init_intpack): Renamed from Init_pack.
- Reported by Naohisa Goto. [ruby-dev:47526] [Bug #8655]
+ * vm_core.h: define vm_call_handler.
-Fri Jul 19 00:54:27 2013 Benoit Daloze <eregontp@gmail.com>
+Sat Oct 24 01:56:01 2015 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_array.rb (test_count): add a test case for #count
- with an argument. See Bug #8654.
+ * vm_core.h, vm_insnhelper.h: move definition of VMDEBUG
+ from vm_insnhelper.h to vm_core.h.
-Thu Jul 18 23:45:06 2013 Masaki Matsushita <glass.saga@gmail.com>
+Sat Oct 24 01:51:01 2015 Akinori MUSHA <knu@iDaemons.org>
- * array.c (rb_ary_eql): compare RARRAY_PTR() for performance
- improvement in case of that self and other are shared.
+ * NEWS: [DOC] In the new safe call syntax, arguments are evaluated
+ only if a call is made.
-Thu Jul 18 22:46:42 2013 Zachary Scott <e@zzak.io>
+ * doc/syntax/calling_methods.rdoc: Fix a typo.
- * lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]
- Patch by Dave Worth https://github.com/ruby/ruby/pull/341
- * lib/webrick.rb: ditto
- * lib/scanf.rb: ditto
- * lib/xmlrpc/config.rb: ditto
- * lib/resolv.rb: ditto
- * lib/e2mmap.rb: ditto
- * lib/fileutils.rb: ditto
- * lib/mkmf.rb: ditto
- * lib/cgi/session.rb: ditto
- * lib/yaml.rb: ditto
- * lib/erb.rb: ditto
- * lib/irb.rb: ditto
- * lib/tracer.rb: ditto
- * lib/net/http.rb: ditto
- * ext/syslog/lib/syslog/logger.rb: ditto
- * sample/pty/expect_sample.rb: ditto
+Sat Oct 24 00:38:34 2015 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 18 21:30:50 2013 Tanaka Akira <akr@fsij.org>
+ * lib/forwardable (def_instance_delegator, def_single_delegator):
+ rescue ::Exception instead of Exception in case Exception is
+ defined under the target class.
+ [ruby-core:71175] [Ruby trunk - Bug #11615]
- * bignum.c (bary_sq_fast): Specialize the last iteration of the
- outer loop.
- (bigfixize): A condition simplified.
+Fri Oct 23 21:10:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 18 21:15:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * error.c (name_err_mesg_to_str): separate class names from the
+ receiver description.
- * array.c (rb_ary_equal): compare RARRAY_PTR() for performance
- improvement in case of that self and other are shared.
+ * vm_eval.c (make_no_method_exception, raise_method_missing): add
+ format specifiers for class names.
-Thu Jul 18 20:44:51 2013 Masaki Matsushita <glass.saga@gmail.com>
+Fri Oct 23 18:10:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * array.c (rb_ary_fill): use memfill().
+ * .gitignore: ignored environmental wrapper files.
-Thu Jul 18 20:35:14 2013 Benoit Daloze <eregontp@gmail.com>
+Fri Oct 23 17:55:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * array.c (rb_ary_count): check length to avoid SEGV
- while iterating. Remove other pointer loop when arg is given.
+ * lib/irb.rb: Ignored assignment of STDOUT.sync = true
+ when irb.rb loaded. It's affected to IDE such as Jetbrain.
+ [fix GH-864] Patch by @os97673
- * test/ruby/test_array.rb (test_count): add test for bug.
- [ruby-core:56072] [Bug #8654]
+Fri Oct 23 16:35:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Jul 18 18:14:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address contained
+ EOL string. Patch by @kachick [fix GH-942][Bug #11513]
- * array.c (rb_ary_count): iterate items appropriately.
- [Bug #8654]
+Fri Oct 23 16:03:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Jul 18 17:35:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * file.c: fix indent style. [fix GH-977]
+ * test/ruby/test_string.rb: indent. [fix GH-975]
+ [ci skip] These patches are contributed from @yui-knk
- * hash.c (rb_hash_flatten): performance improvement by not using
- rb_hash_to_a() to avoid array creation with rb_assoc_new().
+Fri Oct 23 15:46:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Jul 18 16:16:17 2013 Koichi Sasada <ko1@atdot.net>
+ * string.c: Added method signature to include hash. It's inconsistency
+ with `gsub` method signature.
+ [ci skip][fix GH-1023] Patch by @danielevans
- * array.c: add logging feature for RGenGC's write barrier unprotect
- event.
+Fri Oct 23 15:25:51 2015 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 18 15:45:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/imap.rb: remove an empty comment line and -*-.
- * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): make only
- rb_set_safe_level(4) an error always but make rb_secure(4) an error
- only in the core. [ruby-dev:47517] [Bug #8652]
+Fri Oct 23 15:20:02 2015 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 18 15:42:01 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/net/ftp.rb (gettextfile, getbinaryfile): use the safe
+ navigation operator.
- * include/ruby/ruby.h: fix spell miss.
+Fri Oct 23 13:51:33 2015 yui-knk <spiketeika@gmail.com>
-Thu Jul 18 15:11:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test_call.rb (test_safe_call): Add test cases for safe
+ navigation operator assignment. [Fix GH-1064]
+ Validate:
+ * can assign an attribute which is `nil`
+ * can "or assign" an attribute which is `nil`
- * include/ruby/ruby.h (ruby_safe_level_4): get rid of special
- character. [ruby-dev:47512] [misc #8646]
+Fri Oct 23 11:58:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 18 14:51:39 2013 Koichi Sasada <ko1@atdot.net>
+ * compile.c (iseq_peephole_optimize): optimize lengthy safe
+ navigation method chain. [Feature #11537]
- * array.c (ary_alloc): slim setup process.
+Fri Oct 23 10:58:41 2015 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 18 14:37:57 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/matrix/eigenvalue_decomposition.rb (tridiagonalize): fix
+ indentation to avoid a warning when the command line option -w of
+ ruby is specified.
- * string.c (str_alloc): no need to clear RString (already cleared).
+ * lib/matrix/eigenvalue_decomposition.rb (hessenberg_to_real_schur):
+ change the name of a block parameter to avoid a warning when the
+ command line option -w of ruby is specified.
-Thu Jul 18 12:57:47 2013 Tanaka Akira <akr@fsij.org>
+Fri Oct 23 10:49:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (BDIGITS_ZERO): Defined.
- (bary_pack): Use BDIGITS_ZERO.
- (bary_unpack): Ditto.
- (bary_mul_single): Ditto.
- (bary_mul_normal): Ditto.
- (bary_sq_fast): Ditto.
- (bary_mul_balance_with_mulfunc): Ditto.
- (bary_mul_precheck): Ditto.
- (bary_mul_toom3_branch): Ditto.
- (rb_cstr_to_inum): Ditto.
- (big_shift3): Ditto.
- (bigmul1_toom3): Ditto.
- (bary_divmod): Ditto.
+ * compile.c (iseq_compile_each): support safe navigation of simple
+ attribute assignment. [Feature #11537]
-Thu Jul 18 06:30:02 2013 Koichi Sasada <ko1@atdot.net>
+ * parse.y (mlhs_node, lhs, attrset_gen): ditto. keep mid
+ non-attrset as the sign of safe navigation.
- * gc.c: rename gc related functions with prefix "gc_".
- * before_gc_sweep() -> gc_before_sweep().
- * after_gc_sweep() -> gc_after_sweep().
- * lazy_sweep() -> gc_lazy_sweep().
- * rest_sweep() -> gc_rest_sweep().
- * slot_sweep() -> gc_slot_sweep().
+Fri Oct 23 07:17:11 2015 Eric Wong <e@80x24.org>
- * gc.c: rename a heap management function with prefix "heap_".
- * get_freeobj() -> heap_get_freeobj().
+ * test/io/wait/test_io_wait.rb (test_wait_eof): test return value
- * gc.c: rename markable_object_p() to is_markable_object().
+Fri Oct 23 00:32:02 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jul 17 22:57:40 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * ext/openssl/ossl_ssl.c (ssl_npn_select_cb): explicitly raise error
+ in ext/openssl instead of OpenSSL itself because LibreSSL
+ silently truncate the selected protocol name by casting the length
+ from int to unsigned char. [Bug #11369]
+ Patch by Jeremy Evans <merch-redmine@jeremyevans.net>
- * hash.c (delete_if_i): use ST_DELETE.
+Fri Oct 23 00:49:45 2015 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jul 17 22:34:47 2013 Tanaka Akira <akr@fsij.org>
+ * lib/un.rb (help): change the name of a block parameter to avoid
+ a warning when the command line option -w of ruby is specified.
- * bignum.c: An static assertion for relation of SIZEOF_LONG and
- SIZEOF_BDIGITS is added.
- (bary_mul_precheck): Reduce comparisons.
- (bary_mul): Invoke bary_sq_fast or bary_mul1 if the bignum size is
- small.
- (bigfixize): Resize the argument bignum here.
- (bignorm): Don't call bigtrunc after bigfixize.
+Fri Oct 23 00:22:20 2015 Josef Simanek <josef.simanek@gmail.com>
-Wed Jul 17 22:13:26 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * string.c (rb_str_tr): [DOC] Escape backslash in String#tr
+ documentation. [Fix GH-1063]
- * hash.c (rb_hash_replace): performance improvement by using
- st_copy().
+Fri Oct 23 00:19:04 2015 yui-knk <spiketeika@gmail.com>
-Wed Jul 17 17:19:54 2013 Koichi Sasada <ko1@atdot.net>
+ * array.c (rb_ary_collect): [DOC] Fix space of code example of
+ Array#map. [Fix GH-1062]
- * gc.c: rename heap management functions with prefix "heap_".
- * allocate_sorted_array() -> heap_allocate_sorted_array().
- * slot_add_freeobj() -> heap_slot_add_freeobj().
- * assign_heap_slot() -> heap_assign_slot().
- * add_heap_slots() -> heap_add_slots().
- * init_heap() -> heap_init().
- * set_heap_increment() -> heap_set_increment().
+Thu Oct 22 18:52:53 2015 Akinori MUSHA <knu@iDaemons.org>
- * gc.c (initial_expand_heap): inlined in rb_gc_set_params().
+ * vm_eval.c (rb_f_loop): When a loop is stopped by a StopIteration
+ exception, return what the enumerator has returned instead of
+ nil. [ruby-core:71133] [Feature #11498]
-Wed Jul 17 17:12:23 2013 Matthew M. Boedicker <matthewm@boedicker.org>
+Thu Oct 22 18:25:10 2015 Shugo Maeda <shugo@ruby-lang.org>
- * hash.c (env_fetch): Add key name to message on ENV.fetch KeyError,
- as well as Hash#fetch. [ruby-core:56062] [Feature #8649]
+ * lib/net/imap.rb (idle): add a new argument timeout for keep-alive.
+ [ruby-core:63693] [Bug #10031]
-Wed Jul 17 15:59:33 2013 Koichi Sasada <ko1@atdot.net>
+Thu Oct 22 15:30:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: catch up last changes for debugging/checking mode.
+ * compile.c (iseq_peephole_optimize): peephole optimization for
+ branchnil jumps.
-Wed Jul 17 15:50:10 2013 Koichi Sasada <ko1@atdot.net>
+ * compile.c (iseq_compile_each): generate save navigation operator
+ code.
- * gc.c (rb_objspace_free): free slot itself.
+ * insns.def (branchnil): new opcode to pop the tos and branch if
+ it is nil.
- * gc.c (objspace_each_objects): fix condition.
- Use slot->body instead of slot.
+ * parse.y (NEW_QCALL, call_op, parser_yylex): parse token '.?'.
+ [Feature #11537]
- * gc.c (count_objects): use "slot" variable.
+Thu Oct 22 13:16:19 2015 Guilherme Reis Campos <guilhermekbsa@gmail.com>
-Wed Jul 17 15:21:10 2013 Koichi Sasada <ko1@atdot.net>
+ * dir.c (ruby_brace_expand): glob brace expansion edge case fix.
+ When there are closing braces '}' before a open brace '{' it
+ must be ignored and considered as literal.
+ [ruby-core:71138] [Bug #11609]
- * gc.c (unlink_heap_slot): fix memory leak.
- free slot itself at free_heap_slot().
+Thu Oct 22 13:13:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Reproduce-able code is here:
- N1 = 100_000; N2 = 1_000_000
- N1.times{ary = []; N2.times{ary << ''}}
- Maybe this problem is remaining in Ruby 2.0.0.
+ * io.c (argf_next_argv): check ARGV element type, and try
+ conversion if necessary. [ruby-core:71140] [Bug #11610]
- * gc.c (unlink_heap_slot): remove not working code.
+Thu Oct 22 11:11:16 2015 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jul 17 14:31:13 2013 Koichi Sasada <ko1@atdot.net>
+ * test/net/ftp/test_ftp.rb: add tests for getbinaryfile and
+ gettextfile.
- * gc.c: re-design the heap structure.
+Wed Oct 21 18:34:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- (1) The heap is consists of a set of slots.
- (2) Each "slot" has a "slot_body".
- slot::start and slot::limit specify RVALUE beginning address
- and number of RVALUE in a "slot_body".
- (3) "slot_body" contains a pointer to slot (slot_body::header::slot)
- and an array of RVALUE.
- (4) heap::sorted is an array of "slots", sorted by an address of
- slot::body.
+ * parse.y (parser_magic_comment): allow a sole magic comment without
+ indicators, neither other non-space comments. [Feature #8976]
- See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/GC_design
- for more details (figure).
+Tue Oct 20 12:17:56 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * gc.c: Avoid "heaps" terminology. It is ambiguous.
+ * lib/prime.rb: Add basic argument checking to Prime.prime?
+ [Bug #11606]
-Wed Jul 17 13:29:16 2013 Koichi Sasada <ko1@atdot.net>
+Tue Oct 20 12:17:50 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * gc.c: fix heaps_header and heaps_slot to reduce memory consumption.
- (1) move heaps_header::start and limit to heaps_slot.
- (2) remove heaps_header::end which can be calculated by start+limit.
+ * lib/prime.rb: Optimize Integer#prime?
+ Patch by Nick Slocum [Bug #10354]
- * gc.c: catch up above change.
+Tue Oct 20 08:12:47 2015 Rei Odaira <Rei.Odaira@gmail.com>
-Wed Jul 17 12:30:05 2013 Tanaka Akira <akr@fsij.org>
+ * configure.in: pthread_getattr_np is broken on AIX.
+ More specifically, the stack address and size returned are
+ not correct.
- * include/ruby/st.h (st_strcasecmp): Macro defined for compatibility.
- (st_strncasecmp): Ditto.
+Tue Oct 20 05:54:46 2015 Eric Wong <e@80x24.org>
-Wed Jul 17 11:57:45 2013 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+ * ext/fiddle/closure.c (callback): static function
- * lib/cgi/util.rb (CGI::Util#escape, unescape): Avoid use of regexp
- special global variable. [Feature #8648] Thanks to fotos.
+Mon Oct 19 10:33:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 17 11:57:10 2013 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+ * ext/socket/init.c (rsock_raise_socket_error): get rid of a glibc
+ bug. [ruby-core:71100] [Bug #11600]
- * lib/erb.rb (ERB::Util#url_encode): Avoid use of regexp special global
- variable. [Feature #8648] Thanks to fotos.
+Mon Oct 19 01:26:26 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jul 17 08:12:41 2013 Tanaka Akira <akr@fsij.org>
+ * file.c (rb_file_identical_p): not necessary to compare the paths after
+ comparing the file indexes on Windows. designate by kosaki.
- * st.c (st_locale_insensitive_strcasecmp): Renamed from st_strcasecmp.
- (st_locale_insensitive_strncasecmp): Renamed from st_strncasecmp.
+Sun Oct 18 21:17:27 2015 Tanaka Akira <akr@fsij.org>
- * include/ruby/st.h: Follow above changes.
+ * lib/open-uri.rb: Specify frozen_string_literal: true.
- * include/ruby/ruby.h: Ditto.
+Sun Oct 18 14:37:56 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Jul 17 00:14:59 2013 Tanaka Akira <akr@fsij.org>
+ * random.c (fill_random_bytes_urandom): add a comment why using
+ O_NONBLOCK and O_NOCTTY.
- * bignum.c (bigmul1_toom3): Use bigdivrem_single instead of bigdivrem.
- (big_three): Removed.
- (Init_Bignum): Don't initialize big_three.
+Sun Oct 18 13:24:17 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Jul 16 21:46:03 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * random.c (fill_random_bytes_syscall): use ATOMIC_SET() for
+ updating try_syscall.
- * configure.in: revert r42008. strcasecmp() uses the current locale.
+Sun Oct 18 13:03:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * include/ruby/ruby.h: ditto.
+ * include/ruby/backward/util.h: Good-by Borland-C.
- * st.c (st_strcasecmp): ditto.
+Sun Oct 18 13:03:09 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Jul 16 21:07:04 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * common.mk: add a comment how to use "make test-all"
- * configure.in: check strcasecmp().
+Sun Oct 18 12:59:22 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * include/ruby/ruby.h: use strcasecmp() as st_strcasecmp() if it
- exists.
+ * common.mk: add comments how to use "make benchmark"
- * st.c (st_strcasecmp): define the function only if strcasecmp()
- doesn't exist.
+Sun Oct 18 12:58:15 2015 Tanaka Akira <akr@fsij.org>
-Tue Jul 16 20:21:28 2013 Tanaka Akira <akr@fsij.org>
+ * lib/securerandom.rb: Specify frozen_string_literal: true.
- * bignum.c (bigsq): Renamed from bigsqr.
+Sun Oct 18 11:22:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Jul 16 19:42:08 2013 Tanaka Akira <akr@fsij.org>
+ * dln.c: remove defined(__WATCOMC__).
- * bignum.c (USHORT): Unused macro removed.
+Sun Oct 18 11:16:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Jul 16 19:18:51 2013 Koichi Sasada <ko1@atdot.net>
+ * lib/mkmf.rb: Good-by Borland-C.
- * gc.c: slim a path of newobj_of().
+Sun Oct 18 11:04:36 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (objspace): add a new field objspace::freelist, which contains
- available RVALUEs.
+ * numeric.c: Good-by Borland-C.
+ * include/ruby/backward/rubyio.h: ditto.
+ * include/ruby/backward/st.h: ditto.
+ * include/ruby/backward/util.h: ditto.
+ * include/ruby/backward/rubysig.h: ditto.
+ * include/ruby/backward/classext.h: ditto.
+ * dln.c: ditto.
+ * gc.c: ditto.
+ * win32/resource.rb: ditto.
+ * win32/dir.h: ditto.
+ * ext/tk/tcltklib.c: ditto.
+ * NEWS: announce that Borland-C is no longer supported.
- * gc.c (newobj_of): simply call new function `get_freeobj()'.
- get_freeobj() returns objspace::freelist. If objspace::freelist
- is not available, refill objspace::freelist with a slot pointed by
- objspace::heap::free_slots.
+Sun Oct 18 10:54:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (before_gc_sweep): clear objspace::freelist.
+ * dln.c: simplify #ifdef. _WIN32 and __CYGWIN__ are exclusive.
+ see include/ruby/defines.h
+ * gc.c: ditto.
+ * ext/sdbm/_sdbm.c: ditto.
- * gc.c (slot_sweep): clear slot::freelist.
+Sun Oct 18 10:42:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (heaps_prepare_freeslot): renamed to heaps_prepare_freeslot.
+ * ruby.c (open_load_file): add a comment.
- * gc.c (unlink_free_heap_slot): remove unused function.
+Sun Oct 18 10:12:46 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (rb_free_const_table): remove unused function.
+ * file.c (rb_file_identical_p): simplify ifdefs
-Tue Jul 16 19:05:12 2013 Tanaka Akira <akr@fsij.org>
+Sun Oct 18 10:01:40 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * bignum.c (big_shift3): Big shift width is not a problem for right
- shift.
+ * ChangeLog: Good-bye OS/2.
+ * common.mk: ditto.
+ * configure.in: ditto.
+ * dln_find.c: ditto.
+ * ext/Setup.emx: ditto.
+ * ext/extmk.rb: ditto.
+ * ext/socket/extconf.rb: ditto.
+ * ext/zlib/extconf.rb: ditto.
+ * file.c: ditto.
+ * include/ruby/defines.h: ditto.
+ * io.c: ditto.
+ * lib/mkmf.rb: ditto.
+ * missing/os2.c: ditto.
+ * process.c: ditto.
+ * ruby.c: ditto.
+ * NEWS: announce OS/2 is no longer supported.
-Tue Jul 16 18:50:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 18 08:50:15 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * array.c (rb_ary_count): [DOC] fix typo. Array#count uses ==, not
- ===. a question at asakusa.rb ML.
+ * include/ruby/defines.h (DOSISH): add comments.
-Tue Jul 16 18:35:48 2013 Tanaka Akira <akr@fsij.org>
+Sun Oct 18 08:26:51 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * bignum.c (bary_mul_karatsuba): Avoid duplicate calculation when
- squaring.
- (bary_mul_toom3_branch): Ditto.
+ * io.c (fptr_finalize): don't release gvl if fptr is not writable.
+ writable fd may block on close(2) when it's on NFS. But readonly
+ fd doesn't. [Bug #11559]
+ result: make benchmark OPTS="-p bm_require_t -e ruby-trunk -e ruby-2.2.2"
+ build-ruby: 0.171
+ ruby 2.3.0dev(r52151): 0.659
+ ruby 2.2.0p95 (r50295): 0.834
-Tue Jul 16 17:43:22 2013 Koichi Sasada <ko1@atdot.net>
+Sun Oct 18 09:32:58 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (link_free_heap_slot): removed.
+ * file.c (ruby_is_fd_loadable): this should be fail if st_mode is
+ not regular file nor FIFO.
- * gc.c (slot_sweep): use `heaps_add_freeslot' instead of
- `link_free_heap_slot'.
+Sun Oct 18 09:20:17 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (assign_heap_slot): use local variable `slot' instead of
- `heaps'.
+ * ruby.c (open_load_file): use rb_thread_wait_fd() instead of reopen.
-Tue Jul 16 17:21:39 2013 Koichi Sasada <ko1@atdot.net>
+Sun Oct 18 05:11:22 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (assign_heap_slot): refactoring variable names.
+ * ruby.c (open_load_file): reset O_NONBLOCK after open.
+ Even if S_ISREG() is true, the file may be file on FUSE filesystem
+ or something. We can't assume O_NONBLOCK is safe.
+ Moreover, we should wait if the path is point to FIFO. That's
+ FIFO semantics. GVL should be transparent from ruby script.
+ Thus, just reopen without O_NONBLOCK for filling the requirements.
+ [Bug #11060][Bug #11559]
- * gc.c (slot_add_freeobj): added.
+ * ruby.c (loadopen_func): new for the above.
- * gc.c (heaps_add_freeslot): added.
+ * file.c (ruby_is_fd_loadable): new. for checks loadable file type
+ of not.
+ * file.c (rb_file_load_ok): use ruby_is_fd_loadble()
+ * internal.h: add ruby_is_fd_loadble()
- * gc.c (finalize_list, rb_gc_force_recycle, slot_sweep): use
- `slot_add_freeobj' instead of modifying linked list directly.
+ * common.mk: now, ruby.o depend on thread.h.
-Tue Jul 16 16:30:58 2013 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_require.rb
+ (TestRequire#test_loading_fifo_threading_success): new test.
+ This test successful case that loading from FIFO.
- * gc.c (lazy_sweep): refactoring.
+ * test/ruby/test_require.rb
+ (TestRequire#test_loading_fifo_threading_raise): rename from
+ test_loading_fifo_threading. You shouldn't rescue an exception
+ if you test raise or not.
+ Moreover, this case should be caught IOError because load(FIFO)
+ should be blocked until given any input.
-Tue Jul 16 13:32:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 17 13:55:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c (enc_set_index): since r41967, old terminator is dealt
- with in str_fill_term(). should not consider it here because this
- function is called before any encoding is set.
+ * file.c (rb_file_expand_path_internal): concatenate converted
+ string to the result instead of making converted string and
+ append it.
-Tue Jul 16 11:12:03 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * string.c (rb_str_cat_conv_enc_opts): from rb_str_conv_enc_opts,
+ separate function to concatenate with transcoding.
- * proc.c (rb_block_arity): raise ArgumentError if no block given.
+Sat Oct 17 13:19:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 16 08:15:22 2013 Zachary Scott <e@zzak.io>
+ * ruby.c (load_file): unify each preparations and clean-ups by
+ merging load_file_internal and load_file_internal2, and remove
+ nested rb_protect and rb_ensure.
- * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] document top-level
- classes from BigDecimal utils native extensions
+Sat Oct 17 05:28:32 2015 Rei Odaira <Rei.Odaira@gmail.com>
-Tue Jul 16 03:23:03 2013 Zachary Scott <e@zzak.io>
+ * test/ruby/test_symbol.rb (test_symbol_fstr_leak): add a warm-up
+ code and check RSS to avoid false positive on AIX and false
+ negative on Mac OS X. [Bug #10686]
- * numeric.c: [DOC] improve rdoc formatting for parameters and links
+Fri Oct 16 15:54:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 15 14:40:00 2013 Tanaka Akira <akr@fsij.org>
+ * file.c (rb_file_load_ok): open in non-blocking mode withoout
+ releasing GVL. don't care about others than regular files and
+ directories. [ruby-dev:49272] [Bug #11559]
- * include/ruby/intern.h (rb_big2str0): Deprecated.
+ * ruby.c (load_file_internal): ditto.
- * bignum.c (rb_big2str1): Renamed from rb_big2str0.
- (rb_big2str0): Deprecated wrapper for rb_big2str1.
- (rb_big2str): Invoke rb_big2str1 instead of rb_big2str0.
+Thu Oct 15 23:56:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 15 14:13:02 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * proc.c (rb_sym_to_proc): make void env.
- * struct.c (rb_struct_each_pair): use rb_yield_values(2, key, value)
- instead of rb_yield(rb_assoc_new(key, value)) if rb_block_arity()
- is greater than 1.
+Thu Oct 15 13:37:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 15 13:46:26 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c (rb_sym_to_proc): move from string.c and create a Proc
+ with no environments. [ruby-core:71088] [Bug #11594]
- * bignum.c: Add static assertions.
+Thu Oct 15 01:57:03 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Mon Jul 15 13:36:02 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * test/objspace/test_objspace.rb
+ (test_trace_object_allocations_start_stop_clear): clear object
+ allocation table first to get rid of erroneous detection for obj3.
+ [ruby-dev:49095] [Bug #11271]
- * hash.c (rb_hash_each_pair): performance improvement by using
- rb_block_arity().
+Thu Oct 15 01:53:38 2015 Benoit Daloze <eregontp@gmail.com>
-Mon Jul 15 13:15:37 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * test/ostruct/test_ostruct.rb: Add tests for OpenStruct#respond_to.
+ Patch by @jeremy in [GH-1041]: https://github.com/ruby/ruby/pull/1041
- * proc.c (rb_block_arity): create internal API rb_block_arity().
- it returns arity of given block.
+Thu Oct 15 01:49:25 2015 Benoit Daloze <eregontp@gmail.com>
-Mon Jul 15 13:07:27 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
+ * lib/ostruct.rb: Finish defining OpenStruct attributes lazily.
+ Patch by @sferik in [GH-1037]: https://github.com/ruby/ruby/pull/1037
+ This commit is an addendum to https://github.com/ruby/ruby/pull/1033.
+ It:
+ 1. lazily defines attribute accessors for copied and marshaled objects,
+ 2. returns nil when an attribute reader is not defined, and
+ 3. defines respond_to_missing? to maintain the same respond_to? behavior
- * lib/prime.rb (Prime::EratosthenesGenerator,
- Prime::EratosthenesSieve): New implementation by
- robertjlooby <robertjlooby AT gmail.com>.
+Wed Oct 14 16:56:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/test_prime.rb: updated with new method name
+ * configure.in: check for libunwind.h, which is not available in
+ very old OS X SDK. [ruby-core:71080] [Bug #11591]
-Mon Jul 15 11:32:46 2013 Zachary Scott <e@zzak.io>
+Wed Oct 14 14:11:42 2015 Brian Black <bblack@veracode.com>
- * numeric.c (rb_cNumeric): [DOC] Added comment for Numeric to fix doc
+ * iseq.c (rb_insn_operand_intern): change kw in callinfo disasm from the
+ number of keyword arguments to an ordered list of the keywords used.
+ [Feature #11589]
-Mon Jul 15 11:24:48 2013 Tanaka Akira <akr@fsij.org>
+Wed Oct 14 13:58:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (maxpow_in_bdigit_dbl): Useless #if removed.
+ * parse.y (parser_nextc): send a warning to ripper, not to STDERR
+ always.
-Mon Jul 15 11:10:46 2013 Zachary Scott <e@zzak.io>
+ * parse.y (rb_warn1, rb_warning1): move argument conversions to
+ callers. PRIsVALUE is not valid in String#%.
- * bignum.c (rb_big_coerce): [DOC] Add docs for Bignum#coerce
- Based on patch by Juanito Fatas [Fixes GH-360]
- https://github.com/ruby/ruby/pull/360
+Wed Oct 14 13:37:23 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Jul 15 10:56:01 2013 Zachary Scott <e@zzak.io>
+ * lib/racc/rdoc/grammar.en.rdoc: fix spell error.
+ [fix GH-1053][ci skip] Patch by @Matrixbirds
- * thread.c (mutex_sleep): [DOC] Awake thread will reacquire lock
- By Tim Abdulla [Fixes GH-342] https://github.com/ruby/ruby/pull/342
+Tue Oct 13 22:06:50 2015 Tanaka Akira <akr@fsij.org>
-Mon Jul 15 10:45:09 2013 Tanaka Akira <akr@fsij.org>
+ * ext/socket/raddrinfo.c (rsock_fd_family): Check sa_len.
- * bignum.c (nlz16): Use __builtin_clz if possible.
- (nlz32): Use __builtin_clz or __builtin_clzl if possible.
- (nlz64): Use __builtin_clzl or __builtin_clzll if possible.
- (nlz128): Use __builtin_clzll if possible.
+Tue Oct 13 12:14:10 2015 Craig Davison <craig65535@gmail.com>
- * configure.in: Check __builtin_clz, __builtin_clzl and
- __builtin_clzll.
+ * ext/socket/rsock_addrinfo (rsock_addrinfo): specify address
+ family. [Fix GH-1052]
-Mon Jul 15 09:39:07 2013 Tanaka Akira <akr@fsij.org>
+ * ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send):
+ address family by the receiver.
- * bignum.c (power_cache_get_power): Use bitsize instead of ceil_log2.
- (ones): Removed.
- (next_pow2): Removed.
- (floor_log2): Removed.
- (ceil_log2): Removed.
+Sun Oct 11 07:09:19 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in (__builtin_popcountl): Don't check.
+ * vm_insnhelper.c (vm_push_frame): initialize other than sp (and ep)
+ first for performance.
-Mon Jul 15 02:47:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 11 06:21:50 2015 Koichi Sasada <ko1@atdot.net>
- * localeinit.c (rb_locale_charmap, Init_enc_set_filesystem_encoding):
- move from encoding.c.
+ * vm_eval.c, internal.h (rb_yield_1): added for performance which
+ doesn't check Qundef.
- * miniinit.c (rb_locale_charmap, Init_enc_set_filesystem_encoding):
- define miniruby specific functions only.
+ * numeric.c (int_dotimes): use rb_yield_1.
-Mon Jul 15 02:32:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 11 06:19:49 2015 Koichi Sasada <ko1@atdot.net>
- * encoding.c (rb_enc_init): no longer needs NO_PRESERVED_ENCODING.
+ * vm_insnhelper.c (vm_call_iseq_setup_normal): setup sp first
+ for performance.
- * encoding.c (enc_inspect): defer loading autoloaded encoding.
+Sun Oct 11 05:29:51 2015 Koichi Sasada <ko1@atdot.net>
- * encoding.c (enc_check_encoding): use is_data_encoding() to check
- type consistently.
+ * vm.c (invoke_block_from_c): split this function into several
+ functions.
- * encoding.c (must_encoding): return rb_encoding* instead of encoding
- index.
+ * vm_insnhelper.c (vm_yield_callee_setup_arg): remove this function
+ because it is only delegation function.
- * encoding.c (enc_check_encoding): use is_data_encoding() to check
- type consistently.
+Sun Oct 11 03:48:46 2015 Koichi Sasada <ko1@atdot.net>
- * encoding.c (must_encoding): return rb_encoding* instead of encoding
- index.
+ * gc.c (newobj_of_slowpass): fix typo (pass -> path).
+ Pointed out by Yukihiro Matsumoto <matz@ruby-lang.org>.
-Mon Jul 15 02:21:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (newobj_of_...): `of' is unnecessary.
- * string.c (str_fill_term): consider old terminator length, and should
- not use rb_enc_ascget since it depends on the current encoding which
- may not be compatible with the new terminator. [Bug #8634]
+Sat Oct 10 19:04:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c (enc_inspect): use PRIsVALUE to preserve the result
- encoding.
+ * ext/socket/udpsocket.c (udp_connect, udp_bind): get open files
+ inside ensure functions.
-Sun Jul 14 23:21:47 2013 Tanaka Akira <akr@fsij.org>
+Sat Oct 10 18:35:12 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: Check __builtin_popcountl, __builtin_bswap32 and
- __builtin_bswap64.
+ * vm_insnhelper.c (vm_call_method0): do not propagate enable_fastpath,
+ but pass dummy CC to prevent wrong caching.
- * internal.h (swap32): Use the configure result for the condition to
- use __builtin_bswap32.
- (swap64): Use the configure result for the condition to use
- __builtin_bswap64.
+Sat Oct 10 15:28:45 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (ones): Use the configure result for the condition to use
- __builtin_popcountl.
- (bary_unpack_internal): Use appropriate types for swap argument.
+ * import a github pull request
+ https://github.com/ruby/ruby/pull/1050
+ by Kazuho Oku <kazuho@natadeco.co>.
-Sun Jul 14 22:21:11 2013 Tanaka Akira <akr@fsij.org>
+ This pull request has the following commits.
- * bignum.c (bary_subb): Support xn < yn.
- (bigsub_core): Removed.
- (bigsub): Don't compare before subtraction. Just subtract and
- get the two's complement if the subtraction causes a borrow.
+ * gc.c: reduce # of args to 6 (max. of register args on x86-64) so
+ that the `newobj_of_slowpass` can be called via TCO.
-Sun Jul 14 00:36:03 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (newobj_of), string.c (str_duplicate): for performance,
+ the hot functions must be inlined.
- * bignum.c (DIGSPERLONG): Unused macro removed.
- (DIGSPERLL): Ditto.
+ * gc.c: for performance, preceding arguments of `.*newobj_of.*`
+ must be same, so that the arg registers can be reused in case of
+ TCO.
-Sun Jul 14 00:32:51 2013 Tanaka Akira <akr@fsij.org>
+Sat Oct 10 08:52:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_big_aref): Less scan when the number is negative.
+ * ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send): fix
+ memory leaks at closed socket.
-Sun Jul 14 00:17:42 2013 Tanaka Akira <akr@fsij.org>
+Fri Oct 9 17:29:07 2015 Shugo Maeda <shugo@ruby-lang.org>
- * bignum.c (big_shift): Avoid signed integer overflow.
+ * lib/net/ftp.rb (parse257): refactor.
-Sun Jul 14 00:14:15 2013 Tanaka Akira <akr@fsij.org>
+Fri Oct 9 16:42:26 2015 Shugo Maeda <shugo@ruby-lang.org>
- * bignum.c (bary_mul_precheck): Use bary_small_lshift or
- bary_mul_normal if xl is 1.
+ * lib/net/imap.rb: use frozen_string_literal: true.
-Sat Jul 13 22:58:16 2013 Tanaka Akira <akr@fsij.org>
+ * test/net/imap/test_imap.rb: ditto.
- * bignum.c (big_shift3): New function.
- big_lshift and big_rshift are merged.
- (big_shift2): New function.
- (big_lshift): Use big_shift3.
- (big_rshift): Ditto.
- (check_shiftdown): Removed.
- (rb_big_lshift): Use big_shift2 and big_shift3.
- (rb_big_rshift): Ditto.
- (big_lshift): Removed.
- (big_rshift): Ditto.
+ * test/net/imap/test_imap_response_parser.rb: ditto.
-Sat Jul 13 15:51:38 2013 Tanaka Akira <akr@fsij.org>
+Fri Oct 9 15:52:28 2015 Shugo Maeda <shugo@ruby-lang.org>
- * bignum.c (bary_small_lshift): Use size_t instead of long.
- (bary_small_rshift): Ditto.
+ * lib/net/ftp.rb: use frozen_string_literal: true.
-Sat Jul 13 15:33:33 2013 Tanaka Akira <akr@fsij.org>
+ * test/net/ftp/test_buffered_socket.rb: ditto.
- * bignum.c (bary_small_lshift): Functions moved to remove
- declaration.
- (bary_small_rshift): Ditto.
+ * test/net/ftp/test_ftp.rb: ditto.
-Sat Jul 13 12:27:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/net/ftp/test_mlsx_entry.rb: ditto.
- * encoding.c (rb_enc_associate_index): fill new terminator length, not
- old one.
+Fri Oct 9 14:12:35 2015 Shota Fukumori (sora_h) <her@sorah.jp>
-Sat Jul 13 12:24:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/lib/openssl/ssl.rb: Revert r52082 because it was
+ dropping TLS v1.1 support too. Supporting only TLS v1.2 is too
+ early, because many popular websites still don't support it.
- * ext/win32: move from ext/dl and ext/fiddle. since ext/extmk.rb
- builds extensions in alphabetical order, compiled?('fiddle') under
- ext/dl makes no sense.
+ For instance, Servers where aws-sdk connects to still don't support
+ TLS v1.2 and it became broken.
-Sat Jul 13 09:26:09 2013 Tanaka Akira <akr@fsij.org>
+ We should consider more carefully about this.
- * bignum.c (biglsh_bang): Removed.
- (bigrsh_bang): Ditto.
- (bigmul1_toom3): Use bary_small_lshift and bary_small_rshift.
+ [Fix GH-873] [Feature #11524]
-Sat Jul 13 01:04:43 2013 Zachary Scott <e@zzak.io>
+Fri Oct 9 12:52:08 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rubygems/psych_additions.rb: Ignore Psych docs here
+ * compile.c (iseq_compile_each): Dynamic string literals (e.g.,
+ "#{x}") should not be frozen because they don't literally
+ represent strings.
+ https://twitter.com/shugomaeda/status/651937650027401216
+ https://twitter.com/yukihiro_matz/status/651942882312482817
+ https://twitter.com/yukihiro_matz/status/651980835181096960
-Fri Jul 12 18:10:46 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Oct 9 06:52:49 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/fiddle/win32/lib/win32/registry.rb
- (Win32::Registry::API#make_wstr): same as r41922.
+ * benchmark/prepare_require.rb: skip file creation if it already
+ exist. Suggested by ko1.
-Fri Jul 12 16:28:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 9 06:18:04 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * benchmark/bm_require.rb: new benchmark for require.
+ * benchmark/bm_require_thread.rb: new benchmark for conflicting
+ require vs thread. like [Bug #11559]
+ * prepare_require.rb: new file for preparing above tests.
+ * prepare_require.rb: ditto.
- * encoding.c (rb_enc_associate_index): refill the terminator if it
- becomes longer than before. [ruby-dev:47500] [Bug #8624]
+Thu Oct 8 14:10:45 2015 Zachary Scott <zzak@ruby-lang.org>
- * string.c (str_null_char, str_fill_term): get rid of out of bound
- access.
+ * ext/openssl/lib/openssl/ssl.rb: Default to TLSv1.2 and drop TLS v1
+ Patch provided by @claudijd [Fixes GH-873] [Feature #11524]:
+ https://github.com/ruby/ruby/pull/873
- * string.c (rb_str_fill_terminator): add a parameter for the length of
- new terminator.
+Wed Oct 7 22:55:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 12 11:26:25 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * test/minitest/metametameta.rb (with_output): restore output to
+ fix mixing test result output in worker responses.
- * hash.c (rb_hash_reject_bang): do not call rb_hash_foreach() if RHash
- has ntbl and it is empty.
+Wed Oct 7 21:32:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 12 11:17:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * string.c (str_duplicate): move from rb_str_resurrect to short
+ circuit initialization.
- * hash.c (recursive_hash): use RHASH_SIZE() to check hash size.
+Wed Oct 7 20:43:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 12 00:20:00 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * string.c (rb_str_resurrect): fix resurrection of short enough to
+ be embedded but not embedded string.
- * hash.c (rb_hash_size): use RHASH_SIZE().
+Wed Oct 7 20:17:29 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jul 12 00:08:24 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * gc.c (newobj_of): divide fast path and slow path
+ to avoid register savings for fast path.
- * hash.c (rb_hash_values): set array capa to RHASH_SIZE().
+ This idea is given by Kazuho Oku <kazuho@natadeco.co>.
-Thu Jul 11 23:54:45 2013 Masaki Matsushita <glass.saga@gmail.com>
+Wed Oct 7 17:30:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_hash_keys): set array capa to RHASH_SIZE().
+ * string.c (rb_str_times): optimize for the argument 0 and 1.
-Thu Jul 11 21:30:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 7 01:20:46 2015 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (rb_w32_pow): undef pow to get rid of infinite
- recursive call. re-fix [Bug #8495]. [ruby-core:55923] [Bug #8621]
+ * gc.h, gc.c: introduce new debug function rb_obj_info_dump(VALUE obj)
+ which prints the result of rb_raw_obj_info(..., obj).
-Thu Jul 11 20:18:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 7 01:16:11 2015 Koichi Sasada <ko1@atdot.net>
- * ext/dl/win32/lib/win32/registry.rb (Win32::Registry::API#make_wstr):
- remove workaround to append WCHAR terminator.
+ * vm_args.c: remove an unused field args_info::calling.
- * transcode.c (str_encode_associate): fill terminator after conversion.
+Tue Oct 6 23:43:10 2015 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_enc_str_new, rb_str_set_len, rb_str_resize): fill
- minimum length of the encoding as the terminator.
+ * proc.c (rb_method_entry_min_max_arity): should support
+ OPTIMIZED_METHOD_TYPE_CALL.
- * string.c (str_buf_cat, rb_str_buf_append, rb_str_splice_0): ditto.
+Tue Oct 6 21:29:08 2015 Tanaka Akira <akr@fsij.org>
- * string.c (str_make_independent_expand, rb_str_modify_expand): make
- the capacity enough for multi-byte terminator.
+ * lib/tmpdir.rb (Dir.tmpdir): return duplicated string to be
+ modify safely even when $SAFE > 0.
- * string.c (rb_string_value_cstr): fill minimum length of the encoding
- as the terminator.
+Tue Oct 6 19:24:38 2015 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_string_value_cstr): check null char in char, not in
- byte.
+ * vm_insnhelper.c (vm_call_method0): use switch() for visibilities
+ (for readability).
-Thu Jul 11 14:48:35 2013 Zachary Scott <e@zzak.io>
+Tue Oct 6 19:23:58 2015 Koichi Sasada <ko1@atdot.net>
- * array.c: Replace confusing example for #reverse_each in overview
- Patch by Earl St Sauver [Fixes documenting-ruby/ruby-12]
- https://github.com/documenting-ruby/ruby/pull/12
+ * proc.c (Init_Proc): Proc#call and others should be public.
-Thu Jul 11 14:22:37 2013 Zachary Scott <e@zzak.io>
+Tue Oct 6 18:51:51 2015 Koichi Sasada <ko1@atdot.net>
- * test/drb/ut_eq.rb: Use localhost for drb tests [Bug #7311]
- Patch by Vit Ondruch [ruby-core:49101]
- * test/drb/ut_array.rb: ditto
- * test/drb/ut_array_drbssl.rb: ditto
+ * method.h: IMEMO_FL_USER3 and IMEMO_FL_USER4 is not needed any more.
-Thu Jul 11 13:48:03 2013 Zachary Scott <e@zzak.io>
+Tue Oct 6 18:47:45 2015 Koichi Sasada <ko1@atdot.net>
- * sprintf.c: Fix typo patch by @hynkle [Fixes GH-357]
- https://github.com/ruby/ruby/pull/357
+ * method.h: remove METHOD_ENTRY_SAFE(me) and related code
+ because $SAFE = 3 and 4 is not available.
+ Now, $SAFE is not checked on method dispatch at all.
-Thu Jul 11 13:00:34 2013 Zachary Scott <e@zzak.io>
+ * vm_eval.c, vm_insnhelper.c, vm_method.c: ditto.
- * lib/securerandom.rb: Refactor conditions by Rafal Chmiel
- [Fixes GH-326] https://github.com/ruby/ruby/pull/326
+Tue Oct 6 13:56:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 11 12:04:47 2013 Tanaka Akira <akr@fsij.org>
+ * include/ruby/ruby.h: turn function macros into inline functions,
+ for debuggers.
- * bignum.c: Don't use toom3 after once karatsuba is chosen.
- (mulfunc_t): New type.
- (bary_mul_toom3_start): Renamed from bary_mul.
- (bary_mul_karatsuba_start): Renamed from bary_mul.
- (bary_mul_balance_with_mulfunc): Renamed from bary_mul_balance and
- new argument, mulfunc, is added.
- (rb_big_mul_balance): Invoke bary_mul_balance_with_mulfunc with
- bary_mul_toom3_start.
- (bary_mul_karatsuba): Invoke bary_mul_karatsuba_start instead of
- bary_mul.
- (bary_mul_precheck): Extracted from bary_mul.
- (bary_mul_karatsuba_branch): Extracted from bary_mul.
- (bary_mul_karatsuba_start): New function to call bary_mul_precheck
- and bary_mul_karatsuba_branch.
- (bary_mul_toom3_branch): Extracted from bary_mul.
- (bary_mul_toom3_start): New function to call bary_mul_precheck and
- bary_mul_toom3_branch.
- (bary_mul): Just call bary_mul_toom3_start.
- Arguments for work memory are removed.
- (rb_cstr_to_inum): Follow the bary_mul change.
- (bigmul0): Ditto.
+ * include/ruby/ruby.h: turn constant macros into enums, for
+ debuggers.
-Thu Jul 11 10:46:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 6 13:48:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * tool/probes_to_wiki.rb: fix usage comment. use Enumerable#grep
- which yields each elements to reduce unnecessary array.
+ * method.h: typo fix. Patch by @davydovanton [fix GH-1032][ci skip]
-Thu Jul 11 10:09:18 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Oct 6 06:54:34 2015 Koichi Sasada <ko1@atdot.net>
- * process.c (rb_daemon): daemon(3) is implemented with fork(2).
- Therefore it needs rb_thread_atfork(). (and revert r41903)
+ * iseq.c (rb_iseq_free): free iseq::variable_body to avoid memory
+ leak.
-Thu Jul 11 03:22:10 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+Tue Oct 6 06:32:52 2015 Koichi Sasada <ko1@atdot.net>
- * tool/probes_to_wiki.rb: adding a script to convert probes.d to wiki
- format for easy wiki updates.
+ * proc.c: enable optimization of Proc#call.
+ [Feature #11569]
-Thu Jul 11 00:54:07 2013 Zachary Scott <zachary@zacharyscott.net>
+ * NEWS: write about this optimization and incompatibilities.
- * man/ri.1: Incorrect use of .Dd macro [Bug #8620] by Tristan Hill
+ * test/ruby/test_backtrace.rb: catch up this fix.
-Thu Jul 11 00:48:29 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue Oct 6 04:41:03 2015 Koichi Sasada <ko1@atdot.net>
- * lib/delegate.rb: Add example for __setobj__ and __getobj__
- [Bug #8615] Patch by Caleb Thompson
+ * vm_insnhelper.c: solve goto spaghetti.
-Wed Jul 10 23:29:22 2013 Zachary Scott <zachary@zacharyscott.net>
+ Change all goto statement across blocks to tail call functions.
- * lib/logger.rb: Use :call-seq: for method signature rdoc
+Tue Oct 6 02:29:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 10 23:23:18 2013 Zachary Scott <zachary@zacharyscott.net>
+ * string.c (rb_str_resurrect): optimize by short circuit to copy
+ hidden string without checking length, encoding and so on.
- * lib/logger.rb (#add): Remove incorrect rdoc for return value
- [Bug #8567] Reported by Tim Pease.
+Mon Oct 5 23:08:17 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Wed Jul 10 23:12:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_thread.rb (test_handle_interrupt_blocking): check if
+ exception handling was postponed until sleep.
- * string.c (rb_str_subpos): make public function.
+Mon Oct 5 22:25:49 2015 Tanaka Akira <akr@fsij.org>
-Wed Jul 10 22:44:19 2013 Tanaka Akira <akr@fsij.org>
+ * lib/pp.rb: Use frozen_string_literal: true.
- * bignum.c: Add a static assertion for RBIGNUM_EMBED_LEN_MAX.
+ * lib/prettyprint.rb: Ditto.
-Wed Jul 10 22:31:25 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * lib/resolv.rb: Ditto.
- * string.c (rb_str_index): cache single byte flag and some
- cosmetic changes.
+ * lib/tmpdir.rb: Ditto.
-Wed Jul 10 22:03:27 2013 Tanaka Akira <akr@fsij.org>
+ * test/test_pp.rb: Ditto.
- * bignum.c (bary_2comp): Don't use bary_plus_one.
- (bary_add_one): Replaced by the implementation of bary_plus_one.
+ * test/test_prettyprint.rb: Ditto.
-Wed Jul 10 20:48:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/transcode-tblgen.rb: Ditto.
- * bignum.c (sizeof_bdigit_dbl): check sizeof(BDIGIT_DBL).
+Mon Oct 5 20:39:32 2015 Benoit Daloze <eregontp@gmail.com>
- * internal.h (STATIC_ASSERT): move from enum.c.
+ * test/ruby/test_thread.rb: fix potential race condition.
+ The thread could have a "sleep" status because it tries
+ to acquire the mutex, but does not have it yet.
-Wed Jul 10 20:08:21 2013 Tanaka Akira <akr@fsij.org>
+Mon Oct 5 15:39:30 2015 Zachary Scott <zzak@ruby-lang.org>
- * bignum.c (SIZEOF_BDIGIT_DBL): Add a ifdef guard for test.
+ * numeric.c: [DOC] Overview for Numeric class by Joe Corcoran
+ This patch was created at ROSSConf Berlin 2015 [Bug #11555]
-Wed Jul 10 14:18:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 5 15:34:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (fork_daemon): kill the other threads all and abandon the
- kept mutexes.
+ * proc.c (proc_new): link ep to calling block.
+ [ruby-core:70980] [Bug #11566]
-Wed Jul 10 11:35:36 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 5 00:53:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/net/http/test_http.rb (TestNetHTTP_v1_2#test_get,
- TestNetHTTP_v1_2_chunked#test_get): shouldn't check
- HttpResponse#decode_content if Zlib is not available.
- ko1 complained via IRC.
+ * dir.c (rb_dir_getwd): make ASCII-8BIT if filesystem encoding is
+ US-ASCII, like as Dir.glob.
-Wed Jul 10 10:20:07 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Oct 4 23:39:09 2015 Tanaka Akira <akr@fsij.org>
- * tool/rbinstall.rb: always require rubygems to stabilize rubygems
- related status like whether Gem::Specification is defined or not.
+ * enum.c (nmin_filter): Fix limit value.
+ patch by Helder Pereira.
+ [Bug #11471] [ruby-core:70477]
- * tool/rbinstall.rb (Gem::Specification.unresolved_deps): define stub.
+Sun Oct 4 15:11:48 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jul 10 08:21:15 2013 Eric Hodel <drbrain@segment7.net>
+ * enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
+ and if invalid, return 1. [Bug #11486]
- * lib/rubygems: Import RubyGems 2.1
- * test/rubygems: Ditto.
+Sun Oct 4 10:09:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 10 07:34:34 2013 Eric Hodel <drbrain@segment7.net>
+ * dir.c (rb_dir_getwd): normalize OS path to UTF-8 on OS X.
- * lib/rubygems/ext/ext_conf_builder.rb: Remove siteconf file after
- building the gem.
- * test/rubygems/test_gem_ext_ext_conf_builder.rb: Test for the above.
+Sun Oct 4 00:09:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/psych_tree.rb (module Gem): Add backward compatibility
- for r41148
+ * template/ruby-runner.c.in: wrapper to set dynamic loading path
+ environment variable. /bin/sh on Mac OS X 10.11 (El Capitan)
+ clears DYLD_LIBRARY_PATH.
- * test/rubygems/test_gem_package.rb: Add backward compatibility for
- double-slash elimination.
+ it must:
+ - do nothing even if current directory is not present
+ - do not set other environment variables, e.g. PWD, SHLVL, etc
+ - do not open other FDs, e.g. pipes for timer thread
-Wed Jul 10 06:22:27 2013 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Oct 2 10:59:00 2015 schneems <richard.schneeman@gmail.com>
- * ext/date/date_parse.c (date_zone_to_diff): [ruby-core:55831].
+ * ext/pathname/lib/pathname.rb: freeze string literals for
+ reduced object allocation.
+ [Feature #11375] [ruby-core:70043]
-Wed Jul 10 00:41:42 2013 Tanaka Akira <akr@fsij.org>
+Fri Oct 2 09:20:20 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * bignum.c (bary_mul): x*1 is x.
+ * common.mk, lib/unicode_normalize/tables.rb: Change Unicode
+ Version for character normalization data from 7.0.0 to
+ 8.0.0.
-Tue Jul 9 22:24:39 2013 Tanaka Akira <akr@fsij.org>
+Fri Oct 2 00:18:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (bary_mul1): No need to invoke MEMZERO at last.
- (bary_mul_single): Invoke MEMZERO here.
+ * proc.c (proc_mark): block.ep of Proc from Symbol is now NULL.
+ [ruby-core:70961] [Bug #11560]
-Tue Jul 9 21:40:01 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Sep 30 15:47:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rexml/test_text.rb: Add missing tests for Text#<<.
- Reported by nagachika. Thanks!!!
+ * vm_args.c (vm_caller_setup_arg_block): bypass Symbol#to_proc
+ call to optimize symbol block passing.
-Tue Jul 9 18:02:38 2013 Akinori MUSHA <knu@iDaemons.org>
+Wed Sep 30 01:34:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb (FileUtils#chown_R): Do not skip traversal even
- if user and group are both nil, to be consistent with #chown and
- other commands.
+ * parse.y (parser_free): fix memory leak at syntax error when
+ warn-indent is enabled.
-Tue Jul 9 17:58:26 2013 Akinori MUSHA <knu@iDaemons.org>
+Tue Sep 29 22:27:50 2015 Benoit Daloze <eregontp@gmail.com>
- * test/fileutils/test_fileutils.rb
- (TestFileUtils#assert_output_lines): New utility assertion
- method for testing verbose output.
+ * parse.y: fix minor typo. [ci skip][fix GH-1038].
+ Patch by @ltratt.
-Tue Jul 9 17:43:57 2013 Koichi Sasada <ko1@atdot.net>
+Tue Sep 29 16:53:53 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * test/test_tracer.rb: catch up recent rubygems changes.
+ * tool/unicode_norm_gen.tmpl, lib/unicode_normalize/tables.rb:
+ get rid of many .freeze commands by using frozen_string_literal
+ pragma.
-Tue Jul 9 16:58:30 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Sep 29 16:37:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/{dl,fiddle}/win32/lib/win32/registry.rb: hope that the final
- resolution to fix the failure of test-all. and includes Win64
- support (fixed a potential bug).
+ * compile.c (compile_dstr_fragments): fix performance by omitting
+ the first empty string only for keeping literal encoding if
+ other literals are too. [ruby-core:70930] [Bug #11556]
-Tue Jul 9 15:57:20 2013 Akinori MUSHA <knu@iDaemons.org>
+ * string.c (rb_str_append_literal): append but keep encoding non
+ US-ASCII.
- * object.c: Fix rdoc for Kernel#<=>. [Fixes GH-352]
+Mon Sep 28 17:40:17 2015 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jul 9 15:53:51 2013 Akinori MUSHA <knu@iDaemons.org>
+ * lib/net/ftp.rb (mtime): use usec instead of fractions to parse
+ decimal fractions of a second correctly when the number of digits
+ is not 6.
- * lib/fileutils.rb (FileUtils#mode_to_s): Define mode_to_s() also
- as singleton method, or FileUtils.chmod fails in verbose mode.
+Mon Sep 28 16:07:08 2015 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jul 9 15:16:02 2013 Akinori MUSHA <knu@iDaemons.org>
+ * lib/net/ftp.rb (mtime): parse decimal fractions of a second as
+ specified in RFC 3659.
- * test/fileutils/fileasserts.rb
- (Test::Unit::FileAssertions#assert_not_symlink): Add a missing
- optional argument "message".
+Mon Sep 28 10:31:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Tue Jul 9 15:03:24 2013 Akinori MUSHA <knu@iDaemons.org>
+ * test/test_forwardable.rb: Write basic tests for lib/forwardable.
+ [fix GH-1035] Patch by @kachick
- * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user
- and group are both nil, print ":".
+Sun Sep 27 23:32:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 9 12:47:08 2013 Masaki Matsushita <glass.saga@gmail.com>
+ * class.c (rb_define_class, rb_define_class_id_under): refine
+ error messages.
- * io.c (appendline): use READ_CHAR_PENDING_XXX macros and
- RSTRING_END().
+ * class.c (rb_define_module, rb_define_module_id_under): ditto,
+ and make consistent with class.
- * io.c (rb_io_getline_1): rewrite nested if statement into one
- statement.
+Sun Sep 27 18:44:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Tue Jul 9 11:04:35 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ChangeLog: removed duplicated message.
- * ext/{dl,fiddle}/win32/lib/win32/registry.rb (Win32::Registry#check):
- should report the position of the error.
+Sun Sep 27 15:46:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/{dl,fiddle}/win32/lib/win32/registry.rb
- (Win32::Registry#QueryValue): workaround for test-all crash.
+ * ruby.c (process_options): add an option to enable/disable
+ frozen-string-literal. [Feature #8976]
-Tue Jul 9 10:27:56 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * compile.c (iseq_compile_each): override compile option by option
+ given by pragma.
- * ext/{dl,fiddle}/win32/lib/win32/registry.rb
- (Win32::Registry.expand_environ): use suitable encoding for the
- string.
+ * iseq.c (rb_iseq_make_compile_option): extract a function to
+ overwrite rb_compile_option_t.
- * ext/{dl,fiddle}/win32/lib/win32/registry.rb (Win32::Registry#read):
- should return REG_SZ, REG_EXPAND_SZ and REG_MULTI_SZ values with
- the expected encoding -- assumed as the same encoding of name.
+ * parse.y (parser_set_compile_option_flag): introduce pragma to
+ override compile options.
-Tue Jul 9 10:02:45 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (magic_comments): new pragma "frozen-string-literal".
+ [Feature #8976]
- * ext/{dl,fiddle}/win32/lib/win32/registry.rb
- (Win32::Registry::Error#initialize): use suitable encoding for the
- string.
+Sun Sep 27 08:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 9 09:46:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/ostruct.rb (delete_field): do not raise NameError for
+ existing keys. [Fix GH-1033]
- * ext/dl/win32/lib/win32/registry.rb (Win32::Registry.expand_environ):
- use suitable encoding for the string. fixed a test-all error of
- r41838.
+Sun Sep 27 00:34:31 2015 Zachary Scott <zzak@ruby-lang.org>
- * ext/fiddle/win32/lib/win32/registry.rb: same changes of r41838 and
- this revision of dl's win32/registry.rb.
+ * lib/ostruct.rb: Move method definitions for getter/setter to be lazy
+ Patch by @sferik in [GH-1033]: https://github.com/ruby/ruby/pull/1033
-Tue Jul 9 07:39:45 2013 Eric Hodel <drbrain@segment7.net>
+Fri Sep 25 10:07:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/rubygems: Update to RubyGems 2.0.4. See
- https://github.com/rubygems/rubygems/blob/2.0/History.txt for changes
+ * lib/net/http.rb: removed unused variable. It's removed at r13648.
+ [fix GH-1022] Patch by @nkondratyev
-Tue Jul 9 01:47:16 2013 Tanaka Akira <akr@fsij.org>
+Fri Sep 25 09:48:27 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (biglsh_bang): Don't shift a BDIGIT with BITSPERDIG bits.
- (bigrsh_bang): Ditto.
+ * gems/bundled_gems: upgrade to minitest-5.8.1
-Tue Jul 9 01:17:57 2013 Tanaka Akira <akr@fsij.org>
+Fri Sep 25 09:47:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (bigrsh_bang): Fix bignum digits overrun.
+ * id_table.c: fix typo. [ci skip][fix GH-1031] Patch @davydovanton
-Tue Jul 9 00:46:22 2013 Tanaka Akira <akr@fsij.org>
+Fri Sep 25 07:54:05 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * bignum.c (biglsh_bang): Fix bignum digits under-run.
+ * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_lock): skip
+ this test on AIX. The issue is the same as on Solaris.
+ [ruby-dev:47631]
-Mon Jul 8 23:36:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 24 17:25:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/dl/win32/lib/win32/registry.rb (Error, API): use WCHAR
- interfaces. c.f. [Bug #8508]
+ * parse.y (paren_args): fix separator token at `foo::bar()` in
+ ripper.
-Mon Jul 8 23:13:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 24 00:00:17 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * win32/win32.c (rb_w32_pow): move from win32.h and disable strict
- ANSI mode macro to let _controlfp() stuff defined.
- [ruby-core:55312] [Bug #8495]
+ * complex.c: ruby/config.h must be included before math.h
+ because it defines _LARGE_FILES on AIX and _LARGE_FILES
+ must be defined before sys/types.h is included from math.h.
+ [Bug #11483]
- * numeric.c (finite): add declaration for strict ANSI.
- [ruby-core:55312] [Bug #8495]
+Wed Sep 23 22:22:38 2015 Zachary Scott <zzak@ruby-lang.org>
- * thread_win32.c (w32_thread_start_func, thread_start_func_1),
- (timer_thread_func): use __stdcall instead of _stdcall which is
- unavailable in strict ANSI mode. [ruby-core:55312] [Bug #8495]
+ * ext/openssl/ossl_pkcs12*: Remove svn commit id macro
- * win32/win32.c (gettimeofday): use __cdecl instead of _cdecl.
+Wed Sep 23 01:11:28 2015 Zachary Scott <zzak@ruby-lang.org>
-Mon Jul 8 22:41:12 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/*: Remove svn commit id macros to make sync easier
- * bignum.c (bary_mul): Arguments for work memory added.
- (bary_mul_balance): Ditto.
- (bary_mul_karatsuba): Ditto.
+Tue Sep 22 04:20:01 2015 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Mon Jul 8 22:03:30 2013 Tanaka Akira <akr@fsij.org>
+ * test/drb/test_drb.rb: Run Rinda/DRb tests on localhost. [Fix GH-1027]
+ patch by voxik.
- * bignum.c (rb_big_sq_fast): New function for testing.
- (rb_big_mul_toom3): Ditto.
+ * test/rinda/test_rinda.rb: ditto
- * internal.h (rb_big_sq_fast): Declared.
- (rb_big_mul_toom3): Ditto.
+Mon Sep 21 20:53:39 2015 tbpgr <tbpgr@tbpgr.jp>
-Mon Jul 8 21:59:34 2013 Tanaka Akira <akr@fsij.org>
+ * test/win32ole/test_win32ole_event.rb: fix typo.
+ swbemsink_avairable? => swbemsink_available? [Fix GH-1025]
- * bignum.c (bary_mul_balance): Initialize a local variable to suppress
- a warning.
+Sun Sep 20 10:07:35 2015 Anton Davydov <antondavydov.o@gmail.com>
-Mon Jul 8 20:55:22 2013 Tanaka Akira <akr@fsij.org>
+ * cont.c (rb_callcc): [DOC] append continuations example accros
+ methods. [Fix GH-1026]
- * bignum.c (bary_mul_balance): Reduce work memory.
+Sun Sep 20 03:20:21 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jul 8 08:26:15 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+ * iseq.c (rb_iseq_free): free rb_iseq_t::body::cc_entries.
- * test/openssl/test_pkey_ec.rb: Skip tests for "Oakley" curves as
- they are not suitable for ECDSA.
- [ruby-core:54881] [Bug #8384]
+Sun Sep 20 02:46:34 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jul 8 08:03:01 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h: split rb_call_info_t into several structs.
+ * rb_call_info (ci) has compiled fixed information.
+ * if ci->flag & VM_CALL_KWARG, then rb_call_info is
+ also rb_call_info_with_kwarg. This technique reduce one word
+ for major rb_call_info data.
+ * rb_calling_info has temporary data (argc, blockptr, recv).
+ for each method dispatch. This data is allocated only on
+ machine stack.
+ * rb_call_cache is for inline method cache.
- * bignum.c (bary_mul): Add a RB_GC_GUARD.
+ Before this patch, only rb_call_info_t data is passed.
+ After this patch, above three structs are passed.
-Sun Jul 7 23:56:32 2013 Tanaka Akira <akr@fsij.org>
+ This patch improves:
+ * data locality (rb_call_info is now read-only data).
+ * reduce memory consumption (rb_call_info_with_kwarg,
+ rb_calling_info).
- * bignum.c (bary_mul_karatsuba): Unreachable code removed. Remove
- several branches.
+ * compile.c: use above data.
-Sun Jul 7 22:59:06 2013 Tanaka Akira <akr@fsij.org>
+ * insns.def: ditto.
- * internal.h (rb_big_mul_normal): Declared.
- (rb_big_mul_balance): Ditto.
- (rb_big_mul_karatsuba): Ditto.
+ * iseq.c: ditto.
- * bignum.c (rb_big_mul_normal): New function for tests.
- (rb_big_mul_balance): Ditto.
- (rb_big_mul_karatsuba): Ditto.
+ * vm_args.c: ditto.
-Sun Jul 7 19:21:30 2013 Tanaka Akira <akr@fsij.org>
+ * vm_eval.c: ditto.
- * bignum.c: Reorder functions to decrease forward reference.
+ * vm_insnhelper.c: ditto.
-Sun Jul 7 14:41:57 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.h: ditto.
- * bignum.c: (bigsub_core): Use bary_sub.
- (bary_sub): Returns a borrow flag. Use bary_subb.
- (bary_subb): New function for actually calculating subtraction with
- borrow.
- (bary_sub_one): New function.
- (bigadd_core): Use bary_add.
- (bary_add): Returns a carry flag. Use bary_addc.
- (bary_addc): New function for actually calculating addition with
- carry.
- (bary_add_one): New function.
- (bary_muladd_1xN): Extracted from bary_mul_normal.
- (bigmul1_normal): Removed.
- (bary_mul_karatsuba): New function.
- (bary_mul1): Invoke rb_thread_check_ints after bary_mul_normal.
- (bary_mul): Remove most and least significant zeros before actual
- multiplication. Use bary_sq_fast, bary_mul_balance,
- bary_mul_karatsuba and bigmul1_toom3 as bigmul0.
- (bigmul1_balance): Removed.
- (bigmul1_karatsuba): Removed.
- (bigsqr_fast): Removed.
- (bary_sparse_p): Extracted from big_sparse_p.
- (big_sparse_p): Removed.
- (bigmul0): Use bary_mul.
+ * iseq.h: add iseq_compile_data::ci_index and
+ iseq_compile_data::ci_kw_index.
-Sun Jul 7 11:54:33 2013 Kouhei Sutou <kou@cozmixng.org>
+ * tool/instruction.rb: introduce TS_CALLCACHE operand type.
- * NEWS: Add REXML::Text#<< related updates.
+Sun Sep 20 02:18:10 2015 Tanaka Akira <akr@fsij.org>
-Sun Jul 7 11:49:19 2013 Kouhei Sutou <kou@cozmixng.org>
+ * test/lib/envutil.rb: mkfifo command based File.mkfifo method
+ definition removed.
- * lib/rexml/text.rb (REXML::Text#<<): Support appending in not
- "raw" mode. [Bug #8602] [ruby-dev:47482]
- Reported by Ippei Obayashi. Thanks!!!
+Fri Sep 18 20:11:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jul 7 11:43:13 2013 Kouhei Sutou <kou@cozmixng.org>
+ * file.c (rb_file_s_mkfifo): implement File.mkfifo.
+ [Feature #11536]
- * lib/rexml/text.rb (REXML::Text#<<): Support method chain use by "<<"
- like other objects.
+Fri Sep 18 16:56:19 2015 Shugo Maeda <shugo@ruby-lang.org>
-Sun Jul 7 11:34:18 2013 Kouhei Sutou <kou@cozmixng.org>
+ * NEWS: add Net::FTP#mlst and Net::FTP#mlsd.
- * lib/rexml/text.rb (REXML::Text#clear_cache): Extract common
- cache clear code.
+Fri Sep 18 07:39:22 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Sun Jul 7 11:01:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace_dump.c (obj_type): add IMEMO types to the heap
+ dump information.
- * configure.in (RUBY_DTRACE_POSTPROCESS): dtrace version SUN D 1.11
- introduces a check in the dtrace compiler to ensure that probes
- actually exist. If there are no probes, then the -G step will
- fail. As this test is only being used to determine whether -G is
- necessary (for instance, on OSX it is not), adding a real probe to
- the conftest allows it to succeed on newer versions of dtrace.
- Patch by Eric Saxby <sax AT livinginthepast.org> at
- [ruby-core:55826]. [Fixes GH-351], [Bug #8606].
+Thu Sep 17 22:33:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Jul 7 10:07:22 2013 Tanaka Akira <akr@fsij.org>
+ * common.mk: fix command error with outside builddir.
- * bignum.c (bary_sq_fast): Extracted from bigsqr_fast and
- ensure not to access zds[2*xn].
- (bigsqr_fast): Allocate the result bignum with 2*xn words.
+Thu Sep 17 17:42:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sat Jul 6 07:37:43 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+ * common.mk: separated test for test-framework from test-all task.
+ They should be invoke at first before tests of test-all.
- * ext/openssl/ossl_pkey_ec.c: Ensure compatibility to builds of
- OpenSSL with OPENSSL_NO_EC2M defined, but OPENSSL_NO_EC not
- defined.
- * test/openssl/test_pkey_ec.rb: Iterate over built-in curves
- (and assert their non-emptiness!) instead of hard-coding them, as
- this may cause problems with respect to the different availability
- of individual curves in individual OpenSSL builds.
- [ruby-core:54881] [Bug #8384]
+Thu Sep 17 12:05:54 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- Thanks to Vit Ondruch for providing the patch!
+ * test/ruby/test_dir.rb (TestDir#test_fileno): s/?x/"x"/. Don't
+ use tricky code, please.
-Sat Jul 6 07:12:39 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+Wed Sep 16 20:49:56 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * test/openssl/test_x509crl.rb: Remove unused variable.
- [ruby-core:53501] [Bug #8114]
+ * encindex.h: fix typo of last #endif comment. [ci skip]
- Thanks, Vipul Amler, for pointing this out!
+Wed Sep 16 20:39:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jul 6 06:37:10 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+ * variable.c (set_const_visibility): fail if the class/module is
+ frozen. [ruby-core:70828] [Bug #11532]
- * ext/openssl/ossl.c: Provide CRYPTO_set_locking_callback() and
- CRYPTO_set_id_callback() callback functions ossl_thread_id and
- ossl_lock_callback to ensure the OpenSSL extension is usable in
- multi-threaded environments.
- [ruby-core:54900] [Bug #8386]
+Wed Sep 16 17:16:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Thanks, Dirkjan Bussink, for the patch!
+ * vm_core.h (ENABLE_VM_OBJSPACE): enable per-VM object space on
+ Windows by default, as rb_w32_sysinit() no longer depends on
+ ruby_xmalloc.
-Sat Jul 6 06:06:16 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+Wed Sep 16 15:08:17 2015 Akinori MUSHA <knu@iDaemons.org>
- * lib/openssl/ssl.rb: Fix SSL client connection crash for SAN marked
- critical.
- The patch for CVE-2013-4073 caused SSL crash when a SSL server returns
- the certificate that has critical SAN value. X509 extension could
- include 2 or 3 elements in it:
+ * doc/syntax/literals.rdoc (Strings): [DOC] Revise the character
+ literal part.
- [id, criticality, octet_string] if critical,
- [id, octet_string] if not.
+Wed Sep 16 14:55:33 2015 Akinori MUSHA <knu@iDaemons.org>
- Making sure to pick the last element of X509 extension and use it as
- SAN value.
- [ruby-core:55685] [Bug #8575]
+ * doc/syntax/literals.rdoc (Strings): [DOC] Document the full list
+ of supported escape sequences in string literals.
- Thank you @nahi for providing the patch!
+Wed Sep 16 14:49:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jul 6 04:49:38 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * string.c (rb_str_setbyte): keep the code range as possible.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: register time objects so
- they are referenced as ids during output.
- * test/psych/test_date_time.rb: corresponding test.
+Wed Sep 16 13:23:48 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jul 5 20:46:39 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * doc/syntax/literals.rdoc (Strings): mention about ?a literal.
- * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic): this
- assertion doesn't seems to be checking the unicode string on command
- line, but seems to be checking how to treat the unicode string from
- stdin. so, should escape '\' before 'u'. this fixes a test failure
- on Windows.
+Wed Sep 16 12:06:53 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 5 19:05:40 2013 Akinori MUSHA <knu@iDaemons.org>
+ * dir.c (glob_helper): check pathtype once again by lstat(2) if
+ dp->d_type is DT_UNKNOWN. XFS may return DT_UNKNOWN.
- * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): Fix the
- wrong output message when user is nil, which should be "chown
- :group file" instead of "chown group file".
+Wed Sep 16 03:49:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 5 16:21:56 2013 Akinori MUSHA <knu@iDaemons.org>
+ * test/ruby/test_thread.rb (TestThread#test_mutex_synchronize):
+ insert waste loop for invoking preemptive thread context switch.
+ [Bug #11496]
- * test/ruby/test_regexp.rb
- (TestRegexp#test_options_in_look_behind)
- (TestRegexp#assert_match_at): Add tests for another problem
- fixed in Onigmo 5.13.5. Previously Onigmo did not allow option
- enclosures in look-behind, which makes it impossible to
- interpolate a regexp into another in the middle of a look-behind
- pattern. cf. https://github.com/k-takata/Onigmo/pull/17
+Tue Sep 15 19:38:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_regexp.rb
- (TestRegexp#test_options_in_look_behind)
- (TestRegexp#assert_match_at): Parse regexps in run time rather
- than in compile time.
+ * gc.c (rb_objspace_alloc, rb_objspace_free): define always
+ regardless ENABLE_VM_OBJSPACE, and free heap pages.
-Fri Jul 5 12:14:40 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Sep 15 15:15:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_notfound): after
- r41710, the path of command uses backslash as the separator on
- Windows.
+ * win32/win32.c (rb_w32_sysinit, rb_w32_readdir): compare by
+ encoding index to get rid of encoding initialization before VM
+ object space allocation.
-Fri Jul 5 11:29:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c (fundamental_encoding_p, push_glob): compare by encoding
+ index immediately.
- * lib/test/unit/assertions.rb (assert_raise_with_message): move from
- test/fileutils/test_fileutils.rb. this is still experimental and
- the interface may be changed.
+ * enc/{ascii,us_ascii,utf_8}.c: set encoding indexes of
+ fundamental built-in encodings so that usable as well as
+ allocated rb_encoding before rb_enc_init().
-Fri Jul 5 11:08:00 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * encindex.h: separate encoding index constants from internal.h.
- * win32/win32.c (w32_spawn): r41710 made that if the command starts with
- a quote and includes slash, removed the top quote and NOT removed the
- last quote.
- this fixes test failures on test/ruby/test_process.rb and
- test/webrick.
+Tue Sep 15 13:13:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 5 09:53:15 2013 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/mkmf.rb (CONFIG['CPPOUTFILE']): fix r41769; CONFIG['CPPOUTFILE']
- may be nil.
+ * array.c (rb_ary_sort_bang, rb_ary_sort): [DOC] correct block
+ return values, which may be a negative or positive integer, not
+ only -1 or +1.
-Fri Jul 5 05:39:53 2013 Tanaka Akira <akr@fsij.org>
+Tue Sep 15 12:49:10 2015 Jason Barnabe <jason.barnabe@gmail.com>
- * bignum.c (BARY_MUL1): Renamed from BARY_MUL.
- (bary_mul1): Renamed from bary_mul.
- (bary_mul): Renamed from bary_mul2.
+ * array.c (rb_ary_sort_bang, rb_ary_sort): [DOC] Correct
+ description of array sort block return values. And also fix up
+ the grammar a bit. [Fix GH-1020]
-Fri Jul 5 04:58:05 2013 Tanaka Akira <akr@fsij.org>
+Tue Sep 15 12:44:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (bary_mul_balance): Extracted from bigmul1_balance and
- use bary_mul2 and bary_add to decrease allocations.
+ * util.c (ruby_qsort): use BSD-style qsort_r if available.
-Fri Jul 5 02:14:00 2013 Akinori MUSHA <knu@iDaemons.org>
+Mon Sep 14 19:26:34 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): Fix the wrong
- character class [+-=], which happened to match all desired
- characters but also match undesired characters.
+ * lib/net/ftp.rb (parse_mlsx_entry): parse pathnames including
+ space correctly.
- * lib/fileutils.rb (FileUtils.chmod{,_R}): Enhance the symbolic
- mode parser to support the permission symbols u/g/o and multiple
- actions as defined in SUS, so that chmod("g=o+w", file) works as
- expected. Invalid symbolic modes are now rejected with
- ArgumentError.
+Mon Sep 14 11:12:10 2015 Anton Davydov <antondavydov.o@gmail.com>
-Fri Jul 5 00:25:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/racc/rdoc/grammar.en.rdoc: [DOC] fix typo, "convertion" to
+ "conversion". [Fix GH-1016]
- * lib/mkmf.rb (have_framework): allow header file to check.
- [ruby-core:55745] [Bug #8593]
+Sun Sep 13 11:03:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 4 22:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * include/ruby/ruby.h: prefix RUBY or RB to global symbols to get
+ rid of name conflicts with other headers.
- * object.c (rb_obj_equal): Fixed an rb_obj_equal documentation typo
- where "a" was used instead of "obj".
- Fixes GH-349. Patch by @adnandoric
+ * include/ruby/encoding.h, include/ruby/intern.h: ditto.
-Thu Jul 4 20:39:20 2013 Tanaka Akira <akr@fsij.org>
+Sun Sep 13 09:38:51 2015 Shugo Maeda <shugo@ruby-lang.org>
- * tool/make-snapshot: Exit with EXIT_FAILURE when it fails.
+ * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang,
+ media_type, charset): new methods to return standard facts.
-Thu Jul 4 20:20:23 2013 Tanaka Akira <akr@fsij.org>
+Sat Sep 12 19:43:49 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (maxpow_in_bdigit_dbl): Use tables if available.
- (maxpow_in_bdigit): Ditto.
- (U16): New macro.
- (U32): Ditto.
- (U64): Ditto.
- (U128): Ditto.
- (maxpow16_exp): New table.
- (maxpow16_num): New table.
- (maxpow32_exp): New table.
- (maxpow32_num): New table.
- (maxpow64_exp): New table.
- (maxpow64_num): New table.
- (maxpow128_exp): New table.
- (maxpow128_num): New table.
+ * vm_insnhelper.c (vm_call_iseq_setup_normal): do not clear local
+ variables here. vm_push_frame() clears.
-Thu Jul 4 18:25:25 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_call_iseq_setup_tailcall): ditto.
- * bignum.c (rb_cstr_to_inum): Avoid temporary buffer allocation except
- very big base non-power-of-2 numbers.
+ * vm_insnhelper.c (vm_push_frame): move check code to
+ vm_check_frame().
-Thu Jul 4 15:51:56 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ Reorder initialization timing to reuse same values (sp).
- * string.c (rb_str_succ): use ONIGENC_MBCLEN_CHARFOUND_P correctly.
+ * compile.c (rb_iseq_compile_node): use
+ iseq_set_exception_local_table() for ISEQ_TYPE_DEFINED_GUARD.
- * string.c (rb_str_dump): ditto.
+Sat Sep 12 23:06:51 2015 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 4 10:04:11 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/net/ftp.rb (file?, directory?, appendable?, creatable?,
+ deletable?, enterable?, renamable?, listable?, directory_makable?,
+ purgeable?, readable?, writable?): new methods.
- * regcomp.c (): Merge Onigmo 5.13.5 23b523076d6f1161.
+Sat Sep 12 21:27:22 2015 Shugo Maeda <shugo@ruby-lang.org>
- * [bug] (thanks Akinori MUSHA and Ippei Obayashi)
- Fix a renumbering bug in condition regexp with a named
- capture. [Bug #8583]
- * [spec] (thanks Akinori MUSHA)
- Allow ENCLOSE_OPTION in look-behind.
+ * lib/net/ftp.rb (FACT_PARSERS): support system dependent facts
+ UNIX.mode, UNIX.owner, UNIX.group, UNIX.ctime, and UNIX.atime.
-Thu Jul 4 00:36:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 12 19:08:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h (SIGNED_INTEGER_MAX): suppress warning C4146 on VC6.
- seems a logical ORed expression becomes unsigned.
+ * win32/win32.c (rb_w32_dup2): should return the new fd on
+ success, while msvcrt returns 0 wrongly.
-Thu Jul 4 00:13:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 12 18:14:11 2015 Shugo Maeda <shugo@ruby-lang.org>
- * ruby_atomic.h (rb_w32_atomic_cas): call InterlockedCompareExchange
- directly.
+ * lib/net/ftp.rb (parse_mlsx_entry, mlst) raise an FTPProtoError
+ when parsing failed.
- * ruby_atomic.h (ATOMIC_CAS): fix missing function call.
+Sat Sep 12 18:00:35 2015 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jul 3 23:47:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "+00:00" to
+ get UTC time. Thanks, Wilson Bilkovich.
- * ruby_atomic.h (ATOMIC_CAS): suppress C4022 and C4047 warnings in
- VC6. only InterlockedCompareExchange is declared using PVOID.
+Sat Sep 12 17:55:24 2015 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jul 3 22:29:20 2013 Tanaka Akira <akr@fsij.org>
+ * lib/net/ftp.rb (mlst, mlsd): support new commands MLST and MLSD
+ specified in RFC 3659.
- * internal.h (ruby_digit36_to_number_table): Declared.
+Sat Sep 12 16:14:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * util.c (ruby_digit36_to_number_table): Moved from scan_digits.
+ * file.c: access()/eaccess() wrapping methods check more than just uid.
+ [fix GH-1007][ci skip] Patch by @eam
- * bignum.c (conv_digit): Use ruby_digit36_to_number_table.
+Sat Sep 12 16:07:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * pack.c (hex2num): Ditto.
+ * README.md: improve markdown rendering for readability.
+ [fix GH-1015][ci skip] Patch by @Matrixbirds
-Wed Jul 3 18:12:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 12 14:30:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (install_dirs): revert DESTDIR prefix by r39841, since
- it is fixed by r41648. [ruby-core:55760] [Bug #8115]
+ * process.c (save_redirect_fd): make saved FDs close-on-exec not
+ to be inherited.
-Wed Jul 3 14:15:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (run_exec_dup2): restore close-on-exec flags too.
- * dir.c (do_stat): use rb_w32_ustati64() in win32.c to get rid of
- mysterious behavior of FindFirstFile() Windows API which treat "<"
- and ">" like as wildcard characters. [ruby-core:55764] [Bug #8597]
+ * win32/win32.c (fcntl): implement F_GETFD, F_SETFD, and
+ F_DUPFD_CLOEXEC.
-Wed Jul 3 12:06:42 2013 Tanaka Akira <akr@fsij.org>
+Sat Sep 12 05:35:24 2015 Eric Wong <e@80x24.org>
- * bignum.c (maxpow_in_bdigit): Renamed from calc_hbase and return
- maxpow.
+ * rational.c (string_to_r_strict): preserve encoding in exception
-Tue Jul 2 23:47:50 2013 Tanaka Akira <akr@fsij.org>
+Fri Sep 11 20:23:35 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (roomof): Cast to long.
- (rb_ull2big): Fix bignew arguments.
+ * vm_core.h: remove rb_call_info_t::aux.opt_pc.
-Tue Jul 2 21:17:37 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c: introduce shortcut functions for opt_pc == 0
+ because opt_pc is always 0 on shortcut function.
- * bignum.c (rb_cstr_to_inum): Merge two temporary buffers.
+Fri Sep 11 17:49:36 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jul 2 20:25:04 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c: disable ISeq.load. It enabled accidentally at r51794.
- * bignum.c (rb_cstr_to_inum): Use BDIGIT_DBL to collect adjacent digits.
- (BDIGIT_DBL_MAX): New macro.
- (maxpow_in_bdigit_dbl): New function.
+Fri Sep 11 11:15:12 2015 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jul 2 17:23:33 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/net/ftp.rb (size, mdtm, system): parse responses according to
+ RFC 959 and 3659, where reply codes must be followed by SP.
- * doc/syntax/refinements.rdoc: add description of Module#using and
- refinement inheritance by module inclusion.
+ * lib/net/ftp.rb (system): remove LF from the return value.
-Tue Jul 2 17:22:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 10 22:48:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: add EUC-JP and Windows-31J.
+ * parse.y (literal_concat_gen, evstr2dstr_gen): keep literal
+ encoding beginning with an interpolation same as the source file
+ encoding. [ruby-core:70703] [Bug #11519]
- * re.c (rb_char_to_option_kcode): use built-in encoding indexes in
- internal.h.
+Thu Sep 10 22:15:51 2015 Joe Rafaniello <jrafanie@redhat.com>
- * internal.h: add UTF8-MAC.
+ * process.c (rb_f_spawn): Be more specific regarding "other
+ values" by having "non-zero positive integers" Add nil, the
+ default value, as a possible value and what it means.
- * dir.c (rb_utf8mac_encoding): use built-in encoding indexes in
- internal.h.
+ Try to use more consistent language.
+ [Fix GH-1008]
- * internal.h: add UTF-{16,32} dummy encodings.
+Thu Sep 10 15:16:02 2015 Shugo Maeda <shugo@ruby-lang.org>
- * string.c (rb_str_inspect, str_scrub0): use built-in encoding indexes
- in internal.h.
+ * lib/net/ftp.rb (getmultiline): refactor.
- * internal.h: add UTF-{16,32}{BE,LE}.
+Thu Sep 10 12:17:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (io_strip_bom): use built-in encoding indexes in internal.h.
+ * compile.c (iseq_build_from_ary_body): register cdhash to the
+ iseq constant body instead of compile time mark array, not to
+ get GCed. [ruby-core:70708] [Feature #8543]
- * internal.h (rb_{ascii8bit,utf8,usascii}_encindex): use built-in
- encoding indexes for optimization.
+Wed Sep 9 18:16:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * encoding.c (enc_inspect, rb_locale_encindex),
- (enc_set_filesystem_encoding, rb_filesystem_encindex): use built-in
- encoding indexes directly.
+ * lib/rubygems/stub_specification.rb (Gem::StubSpecification#data):
+ should not change the value of $. when `require`ing gems.
+ this fixed test failures introduced by r51813.
- * encoding.c (rb_enc_set_index, rb_enc_associate_index): validate
- argument encoding index.
+Wed Sep 9 16:55:45 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * include/ruby/encoding.h (ENCODING_SET): use rb_enc_set_index()
- instead of setting inlined bits directly.
+ * ruby.c (usage, enable_option, disable_option, process_options): new
+ option `--disable-did_you_mean`.
- * encoding.c (rb_enc_init): register preserved indexes.
+ * gem_prelude.rb: now requires did_you_mean gem by default if available.
- * internal.h (ruby_preserved_encindex): move from encoding.c.
+Wed Sep 9 13:38:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 2 11:14:36 2013 Shota Fukumori <sorah@cookpad.com>
+ * tool/extlibs.rb (do_patch): let "patch" command change the
+ working directory and open the patch file there, instead of
+ spawn options, so that proper error message will be shown by the
+ command not just "chdir" or "open".
- * lib/mkmf.rb (try_config): Fix to not replace $LDFLAGS with $libs
- (1.9.3 behavior) [ruby-core:55752] [Bug #8595]
+Wed Sep 9 11:33:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jul 2 00:39:59 2013 Tanaka Akira <akr@fsij.org>
+ * common.mk (update-gems): use BASERUBY instead of RUNRUBY.
- * ext/socket/ipsocket.c (init_inetsock_internal): Don't try mismatched
- address family if already failed.
+Wed Sep 9 11:08:59 2015 Zachary Scott <zzak@ruby-lang.org>
-Mon Jul 1 23:07:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/delegate.rb: Remove backtrace cleaning for delegated methods
+ This patch was provided by Rafael Franca and greatly improves
+ performance when an exception is raised. [Bug #11461]
- * template/encdb.h.tmpl: define encoding index macros to use the index
- statically from C source.
+Wed Sep 9 10:05:41 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Jul 1 22:57:19 2013 Tanaka Akira <akr@fsij.org>
+ * test/rubygems/test_config.rb: fix broken tests for Windows platform.
- * bignum.c (bary_mul2): New function.
- (rb_cstr_to_inum): Use a better algorithm to compose the result
- if input length is very long.
+Wed Sep 9 07:46:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Jul 1 20:22:00 2013 Kenta Murata <mrkn@cookpad.com>
+ * lib/rubygems: Update to RubyGems HEAD(fe61e4c112).
+ this version contains new feature that warn invalid SPDX license
+ identifiers. https://github.com/rubygems/rubygems/pull/1249
+ and #1032, #1023, #1332, #1328, #1306, #1321, #1324
+ * test/rubygems: ditto.
- * ext/bigdecimal/bigdecimal.h (RB_UNUSED_VAR, UNREACHABLE):
- import macros from ruby.h for 1.9.3.
- [Bug #8588] [ruby-core:55730]
+Tue Sep 8 23:17:36 2015 Yuki Nishijima <mail@yukinishijima.net>
- * ext/bigdecimal/bigdecimal.gemspec: Bump version to 1.2.1.
+ * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta2.
-Mon Jul 1 20:03:39 2013 Tanaka Akira <akr@fsij.org>
+Tue Sep 8 23:09:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/ipsocket.c (init_inetsock_internal): Use an address
- family for local address which is different to the remote
- address if no other choice.
+ * io.c (rb_io_s_popen): do not wait the child process during being
+ killed. [ruby-core:70671] [Bug #11510]
-Mon Jul 1 15:05:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 8 22:18:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/csv.rb (CSV#<<): use StringIO#set_encoding instead of creating
- new StringIO instance with String#force_encoding, forcing encoding
- discards the cached coderange bits and can make further operations
- very slow. [ruby-core:55714] [Bug #8585]
+ * gems/bundled_gems: revert because ruby trunk never be able to install
+ the did_you_mean gem. retry after enough test.
- * ext/stringio/stringio.c (strio_write): keep coderange of
- ptr->string.
+Tue Sep 8 21:48:22 2015 Yuki Nishijima <mail@yukinishijima.net>
- * string.c (rb_enc_cr_str_buf_cat, rb_str_append): consider an empty
- string 7bit-clean and should not discard cached coderange of string
- to be appended.
+ * gems/bundled_gems: Automatically install the did_you_mean gem
+ as a bundled gem. [Feature #11252]
-Mon Jul 1 12:56:41 2013 Shugo Maeda <shugo@ruby-lang.org>
+Tue Sep 8 17:17:48 2015 Koichi Sasada <ko1@atdot.net>
- * eval.c (rb_using_module): activate refinements in the ancestors of
- the argument module to support refinement inheritance by
- Module#include. [ruby-core:55671] [Feature #8571]
+ * vm_core.h: remove rb_call_info_t::blockiseq.
- * test/ruby/test_refinement.rb: related test.
+ * insns.def (send, invokesuper): pass blockiseq explicitly.
-Mon Jul 1 12:02:39 2013 Tanaka Akira <akr@fsij.org>
+ * compile.c: catch up this fix.
- * bignum.c (rb_cstr_to_inum): Skip leading zeros.
+ * iseq.c: ditto.
-Mon Jul 1 00:59:23 2013 Tanaka Akira <akr@fsij.org>
+ * vm_args.c: ditto.
- * bignum.c (nlz16): New function.
- (nlz32): Ditto.
- (nlz64): Ditto.
- (nlz128): Ditto.
- (nlz): Redefined using an above function.
- (bitsize): New macro.
- (rb_cstr_to_inum): Use bitsize instead of nlz.
+ * iseq.c (ISEQ_MINOR_VERSION): 2->3 because instruction spec was
+ changed.
-Sun Jun 30 22:40:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Tue Sep 8 15:01:19 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/prime.rb: Corrected a few comments. Patch by @Nullset14.
- Fixes GH-346.
+ * lib/net/ftp.rb (list): fetch all the lines before yielding a block
+ to allow other commands in the block. [Feature #11454]
+ Patched by Srikanth Shreenivas.
-Sun Jun 30 21:53:38 2013 Tanaka Akira <akr@fsij.org>
+Tue Sep 8 12:05:00 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * bignum.c (rb_cstr_to_inum): Use rb_integer_unpack if base is a power
- of 2.
+ * win32/win32.c (rb_w32_read_reparse_point): return correct required
+ buffer size for IO_REPARSE_TAG_MOUNT_POINT.
-Sun Jun 30 10:59:23 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 8 00:14:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (join_argv): use backslash instead of slash in program
- path, otherwise cannot invoke "./c\u{1ee7}a.exe" for some reason.
- [ruby-core:24309] [Bug #1771]
+ * process.c (rb_execarg_parent_start1): raise with the target path
+ name when open() failed.
- * io.c (spawnv, spawn): use UTF-8 spawn family. [Bug #1771]
+Mon Sep 7 23:45:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_exec_sh, proc_spawn_cmd, proc_spawn_sh): ditto.
+ * process.c (rb_exec_fail): raise with the target directory name
+ when chdir() failed. pointed out by sorah.
- * win32/win32.c (translate_char, join_argv, has_redirection): make
- codepage aware.
+Mon Sep 7 22:05:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_udln_find_exe_r, rb_w32_udln_find_file_r):
- codepage independent versions.
+ * win32/win32.c (insert): should use plain strdup() instead of
+ ruby_strdup() at startup time, and plain free()ed in cmdglob().
- * win32/win32.c (w32_spawn): extract codepage aware code from
- rb_w32_spawn().
+Mon Sep 7 16:49:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_uspawn): add UTF-8 version function.
+ * vm_core.h (rb_vm_struct): define objspace always regardless
+ ENABLE_VM_OBJSPACE.
- * win32/win32.c (w32_aspawn_flags): extract codepage aware code from
- rb_w32_aspawn_flags().
+Mon Sep 7 15:54:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_uaspawn_flags, rb_w32_uaspawn_flags): add
- UTF-8 version functions.
+ * ruby_atomic.h (ATOMIC_VALUE_CAS): fix typo.
+ TODO: make arguments of all CAS macros consistent.
- * win32/win32.c (w32_getenv): extract codepage aware code from
- rb_w32_ugetenv() and rb_w32_getenv().
+Sun Sep 6 16:07:22 2015 Eric Wong <e@80x24.org>
- * win32/win32.c (w32_stati64): extract codepage aware code from
- rb_w32_ustati64() and rb_w32_stati64().
+ * ccan/list/list.h: suppress unused argument warnings
+ [ccan commit 6aaca17e07588997417a73fac19dcf0ff17ed81b]
- * dln.h (DLN_FIND_EXTRA_ARG, DLN_FIND_EXTRA_ARG_DECL): allow extra
- arguments to dln_find_{exe,file}_r().
+Sat Sep 5 11:39:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dln_find.c (dln_find_exe_r, dln_find_file_r): add extract arguments.
+ * lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction
+ digits. [ruby-core:70667] [Bug #11509]
- * process.c (EXPORT_STR, EXPORT_DUP): convert to default process
- encoding if defined.
+Sat Sep 5 08:28:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (check_exec_env_i): convert environment variables too.
+ * hash.c (rb_hash_equal, rb_hash_eql): [DOC] the orders of each
+ hashes are not compared. [Bug #11508]
- * process.c (rb_exec_fillarg): convert program path and arguments too.
+Fri Sep 4 23:26:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 30 01:57:08 2013 Tanaka Akira <akr@fsij.org>
+ * include/ruby/win32.h: fix macro name for VC runtime version,
+ RT_VER is only in Makefile.
- * bignum.c (big_rshift): Use abs2twocomp and twocomp2abs_bang.
+Fri Sep 4 17:46:17 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Jun 30 00:14:20 2013 Tanaka Akira <akr@fsij.org>
+ * doc/contributing.rdoc: fix configuration option.
+ [ci skip] [fix GH-1009]
- * bignum.c (RBIGNUM_SET_NEGATIVE_SIGN): New macro.
- (RBIGNUM_SET_POSITIVE_SIGN): Ditto.
- (rb_big_neg): Inline get2comp to avoid double negation.
+Fri Sep 4 04:46:54 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 29 23:26:41 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c (iseq_memsize): functions for wrapper object should have
+ iseqw_ prefix.
- * bignum.c (bary_neg): Extracted from bary_2comp.
- (bary_plus_one): Extracted from bary_2comp.
- (bary_2comp): Use bary_neg and bary_plus_one.
- (big_extend_carry): Extracted from get2comp.
- (get2comp): Use big_extend_carry.
- (rb_integer_unpack): Use big_extend_carry.
- (rb_big_neg): Use bary_neg.
+Thu Sep 3 21:12:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 29 22:31:59 2013 Tanaka Akira <akr@fsij.org>
+ * lib/cgi/session.rb (create_new_id): use SHA512 instead of MD5.
+ pointed out by SARWAR JAHAN.
- * bignum.c (bary_2comp): Simplified.
+Thu Sep 3 20:29:18 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 29 09:33:53 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (rb_raw_obj_info): iseq->body->location.first_lineno is Fixnum.
- * bignum.c (bigor_int): Return -1 if y == -1.
+Thu Sep 3 17:54:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 29 09:07:16 2013 Tanaka Akira <akr@fsij.org>
+ * vm_eval.c (raise_method_missing): "names" should be singular.
+ pointed out by Filip Bartuzi.
- * bignum.c (bigor_int): Use RB_GC_GUARD.
- (bigxor_int): Take xn and hibitsx arguments. Use twocomp2abs_bang.
- (rb_big_xor): Use abs2twocomp and twocomp2abs_bang.
+Thu Sep 3 17:50:09 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 29 08:19:58 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (rb_raw_obj_info): should support IMEMO/iseq.
- * bignum.c (bigand_int): Don't apply bitwise and for BDIGIT and long.
- (bigor_int): Take xn and hibitsx arguments. Use twocomp2abs_bang.
- (rb_big_or): Use abs2twocomp and twocomp2abs_bang.
+Thu Sep 3 10:07:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 29 01:08:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * vm_eval.c (raise_method_missing): refine error messages when a
+ symbol is not given. [Fix GH-1013]
- * numeric.c (fix_mul): remove FIT_SQRT_LONG test as it was causing
- fix_mul to return an incorrect result for -2147483648*-2147483648
- on 64 bit platforms
+Wed Sep 2 18:49:55 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/ruby/test_integer_comb.rb (class TestIntegerComb): add test case
+ * ext/psych/*: merge psych master(8737e5b). It contains following fixes.
+ https://github.com/tenderlove/psych/pull/242
+ https://github.com/tenderlove/psych/pull/246 [ruby-list:50219]
+ * test/psych/*: ditto.
-Fri Jun 28 12:26:53 2013 Tanaka Akira <akr@fsij.org>
+Wed Sep 2 18:04:13 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (rb_big_and): Allocate new bignum with same size to shorter
- argument if it's high bits are zero.
+ * vm_insnhelper.h (GET_PC_COUNT): remove unused macro.
-Fri Jun 28 12:14:04 2013 Tanaka Akira <akr@fsij.org>
+Wed Sep 2 17:18:37 2015 Chris Schneider <chris@christopher-schneider.com>
- * ext/socket/ipsocket.c (init_inetsock_internal): Don't use local
- addresses which address family is different to remote address.
+ * process.c (proc_detach): [DOC] fix typo "intent" as "intend" in
+ rdoc. [Fix GH-1011]
-Fri Jun 28 08:06:22 2013 Tanaka Akira <akr@fsij.org>
+Wed Sep 2 16:58:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (bigand_int): Add arguments, xn and hibitsx.
- Use twocomp2abs_bang.
+ * file.c (rb_realpath_internal): use filesystem encoding if the
+ argument is in ASCII encodings.
-Thu Jun 27 23:58:13 2013 Tanaka Akira <akr@fsij.org>
+ * win32/file.c (rb_readlink): needs the result encoding.
- * bignum.c (abs2twocomp_bang): Removed.
- (abs2twocomp): Take n_ret argument to return actual length.
- (rb_big_and): Follow above change.
+Tue Sep 1 18:37:15 2015 Koichi Sasada <ko1@atdot.net>
-Thu Jun 27 22:52:19 2013 Tanaka Akira <akr@fsij.org>
+ * test/thread/test_queue.rb: catch up last commit.
- * bignum.c (get2comp): Use bary_2comp.
- (abs2twocomp_bang): New function.
- (abs2twocomp): New function.
- (twocomp2abs_bang): New function.
- (rb_big_and): Use abs2twocomp and twocomp2abs_bang.
+Tue Sep 1 18:16:32 2015 Koichi Sasada <ko1@atdot.net>
-Thu Jun 27 20:03:13 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * thread_sync.c (queue_do_close): ignore multiple close to allow
+ multiple producers.
+ https://bugs.ruby-lang.org/issues/10600#note-14
- * ext/openssl/lib/openssl/ssl.rb (verify_certificate_identity): fix
- hostname verification. Patched by nahi.
+Tue Sep 1 18:06:26 2015 Koichi Sasada <ko1@atdot.net>
- * test/openssl/test_ssl.rb (test_verify_certificate_identity): test for
- above.
+ * thread_tools.c: rename thread_tools.c to thread_sync.c.
+Mon Aug 31 17:04:45 2015 Koichi Sasada <ko1@atdot.net>
-Thu Jun 27 00:23:57 2013 Tanaka Akira <akr@fsij.org>
+ * class.c (move_refined_method): should insert a write barrier
+ from an original class to a created (cloned) method entry.
- * bignum.c (rb_big_pow): Retry if y is a Bignum and it is
- representable as a Fixnum.
- Use rb_absint_numwords.
+ * test/ruby/test_refinement.rb: add a test.
-Wed Jun 26 23:53:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Sun Aug 30 02:42:22 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode): fix typo.
- Fixes GH-343. Patch by @jgarber.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_method_tab): Only add SSLv3 support
+ if the SSL library supports it. Thanks Kurt Roeckx <kurt@roeckx.be>
+ [Bug #11376]
-Wed Jun 26 23:22:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/extconf.rb: check for SSLv3 support in the SSL
+ implementation.
- * enumerator.c (rb_enumeratorize_with_size): use strict definition
- rb_enumerator_size_func.
+ * test/openssl/test_ssl.rb (class OpenSSL): Skip tests that need SSLv3
+ if there is no support.
-Wed Jun 26 23:11:14 2013 Kouhei Sutou <kou@cozmixng.org>
+Fri Aug 28 16:05:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (is_before_sweep): Add a missing space before a parenthesis.
- * gc.c (rb_gc_force_recycle): Add a missing space around a parenthesis.
+ * lib/rdoc/*: Update rdoc master(cfffed5)
+ https://github.com/rdoc/rdoc/pull/337
+ https://github.com/rdoc/rdoc/pull/367
-Wed Jun 26 22:44:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 28 10:16:20 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/intern.h (rb_enumeratorize_with_size): cast for
- backward compatibility.
+ * vm.c (hook_before_rewind): prevent kicking :return event while
+ finishing vm_exec func because invoke_block_from_c() kick a :return
+ event for bmethods.
+ [Bug #11492]
- * include/ruby/intern.h (rb_enumerator_size_func): define strict
- function declaration for rb_enumeratorize_with_size().
+ * test/ruby/test_settracefunc.rb: add a test.
-Wed Jun 26 21:01:22 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Thu Aug 27 18:05:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): skip if
- writing a file is slow.
- [ruby-core:55541] [Bug #8519]
+ * lib/webrick/server.rb: use IO::NULL instead of '/dev/null'
+ * test/ruby/test_string.rb: ditto.
-Wed Jun 26 16:42:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Aug 27 15:24:57 2015 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb: should use expanded values for header directories
- unless extmk. patch by vo.x (Vit Ondruch) at [ruby-core:55653]
- [Bug #8115], rhbz#921650.
+ * compile.c (iseq_set_sequence): rename variable names
+ to make it readable.
-Wed Jun 26 12:48:22 2013 Tanaka Akira <akr@fsij.org>
+Thu Aug 27 07:45:34 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (bigxor_int): Fix a buffer over read.
+ * thread_tools.c: add Queue#close(exception=false) and
+ SizedQueue#close(exception=false).
+ [Feature #10600]
-Wed Jun 26 12:13:12 2013 Tanaka Akira <akr@fsij.org>
+ Trying to deq from a closed empty queue return nil
+ if exception parameter equals to false (default).
- * bignum.c (bigand_int): Consider negative values.
- (bigor_int): The allocated bignum should have enough size
- to store long.
- This fixes (bignum fits in a BDIGIT) | (fixnum bigger than BDIGIT)
- on platforms which SIZEOF_BDIGITS < SIZEOF_LONG,
- such as LP64 with 32bit BDIGIT (no int128).
+ If exception parameter is truthy, it raises
+ ClosedQueueError (< StopIteration).
+ ClosedQueueError inherits StopIteration so that you can write:
-Wed Jun 26 12:08:51 2013 Tanaka Akira <akr@fsij.org>
+ loop{ e = q.deq; (using e) }
- * test/socket/test_udp.rb: Close sockets explicitly.
- Don't use fixed port number.
+ Trying to close a closed queue raises ClosedQueueError.
-Wed Jun 26 07:27:17 2013 Tanaka Akira <akr@fsij.org>
+ Blocking threads to wait deq for Queue and SizedQueue will be
+ restarted immediately by returning nil (exception=false) or
+ raising a ClosedQueueError (exception=true).
- * bignum.c (bigand_int): Fix a buffer over read.
+ Blocking threads to wait enq for SizedQueue will be
+ restarted by raising a ClosedQueueError immediately.
-Wed Jun 26 06:48:07 2013 Tanaka Akira <akr@fsij.org>
+ The above specification is not proposed specification, so that
+ we need to continue discussion to conclude specification this
+ method.
- * bignum.c (bigadd_int): Fix a buffer over read.
+ * test/thread/test_queue.rb: add tests originally written by
+ John Anderson and modify detailed behavior.
-Wed Jun 26 01:18:13 2013 Masaya Tarui <tarui@ruby-lang.org>
+Wed Aug 26 10:52:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (is_before_sweep): Add new helper function that check the object
- is before sweep?
- * gc.c (rb_gc_force_recycle): Have to clear mark bit if object's slot
- already ready to minor sweep.
+ * re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching
+ till the end of string. [ruby-core:70592] [Bug #11488]
-Wed Jun 26 01:17:29 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_m17n.rb (test_include?, test_index): add tests by
+ Tom Stuart.
- * bignum.c (bigsub_int): Fix a buffer over read.
+Wed Aug 26 09:26:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 25 22:45:43 2013 Tanaka Akira <akr@fsij.org>
+ * id_table.c (list_table_extend, hash_table_extend): remove C99
+ features. [ruby-dev:49239] [Bug #11487]
- * bignum.c (rb_absint_singlebit_p): Use POW2_P.
- (bary_pack): Ditto.
- (rb_big2str0): Ditto.
- (POW2_P): Moved to top.
+Tue Aug 25 06:34:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 25 22:28:07 2013 Akinori MUSHA <knu@iDaemons.org>
+ * win32/win32.c (w32_symlink): implement symlink().
- * lib/rubygems/ext/builder.rb (Gem::Ext::Builder.make): Pass
- DESTDIR via command line to override what's in MAKEFLAGS. This
- fixes an installation problem under a package building
- environment where DESTDIR is specified in the (parent) command
- line. [Fixes GH-327]
+Mon Aug 24 16:01:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 25 21:43:13 2013 Tanaka Akira <akr@fsij.org>
+ * encoding.c (rb_locale_encindex): find encoding index without
+ making a string object every time. [ruby-core:58160] [Bug #9080]
- * bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL.
- (bary_mul_normal): Remove a useless cast.
+Sat Aug 22 15:43:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 25 21:26:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * vm_eval.c (check_funcall_failed, check_funcall_missing): cache
+ results of respond_to? and respond_to_missing?, and search a
+ public method only for compatibility with rb_respond_to.
- * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases when
- the argument x is not a BigDecimal.
- This change is based on the patch made by Heesob Park and Garth Snyder.
- [Bug #6862] [ruby-core:47145]
- [Fixes GH-332] https://github.com/ruby/ruby/pull/332
+Sat Aug 22 08:23:32 2015 Koichi Sasada <ko1@atdot.net>
-Tue Jun 25 20:36:31 2013 Tanaka Akira <akr@fsij.org>
+ * ext/thread/thread.c: move definitions of Queue, SizedQueue
+ and ConditionalVariables to thread_tools.c. In other words,
+ such classes are built-in.
+ [Feature #8919]
- * bignum.c (big2ulong): "check" argument removed.
- (rb_big2ulong): Follow above change.
- (rb_big2long): Ditto.
- (rb_big_rshift): Ditto.
- (rb_big_aref): Ditto.
+ At first, I planned to embed only a Queue class.
+ However, rubygems requires 'thread.rb' (rubygems are
+ required at first, when launch MRI without --disable-gems).
+ So most of people require 'thread.rb' as an embedded library.
-Tue Jun 25 20:08:29 2013 Tanaka Akira <akr@fsij.org>
+ Now, ext/thread/thread.c is empty, only for a dummy for
+ compatibility.
- * bignum.c (rb_big2ulong_pack): Use rb_integer_pack.
- (rb_big_aref): Call big2ulong with TRUE for "check" argument.
- It should be non-effective.
+ * thread.c: move a definition of Mutex class to thread_tools.c.
-Tue Jun 25 19:07:33 2013 Tanaka Akira <akr@fsij.org>
+ And define Mutex class under Thread (so now Mutex is Thread::Mutex).
+ Because other thread related classes are also defined under Thread.
+ We remain ::Mutex as Thread::Mutex. Only an inspect result is changed.
- * bignum.c (LSHIFTX): Revert r41611.
- The redundant expression suppresses a warning, C4293, by Visual
- Studio.
- http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130625T072854Z.log.html.gz#miniruby
+ * common.mk: add dependency from thread.o to thread_tools.c.
-Tue Jun 25 19:03:00 2013 Tanaka Akira <akr@fsij.org>
+Sat Aug 22 05:31:37 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (big2ulong): Add a cast.
- (big2ull): Add a specialized code for SIZEOF_LONG_LONG <=
- SIZEOF_BDIGITS.
+ * vm_opts.h, iseq.c, iseq.h: add compile option to force frozen
+ string literals.
+ [Feature #11473]
-Tue Jun 25 12:42:57 2013 Tanaka Akira <akr@fsij.org>
+ This addition is not specification change, but to try frozen
+ string literal world discussed on [Feature #11473].
- * bignum.c (integer_unpack_single_bdigit): Use "1 + ~u" instead of
- "-u" to suppress warning (C4146) by Visual Studio.
- Reported by ko1 via IRC.
+ You can try frozen string literal world using this magical line:
-Tue Jun 25 12:28:57 2013 Tanaka Akira <akr@fsij.org>
+ RubyVM::InstructionSequence.compile_option =
+ {frozen_string_literal: true}
- * bignum.c (big2ulong): Add code specialized for SIZEOF_LONG <=
- SIZEOF_BDIGITS.
- This prevents shift width warning from "num <<= BITSPERDIG".
+ Note that this is a global compilation option, so that you need to
+ compile another script like that:
-Tue Jun 25 12:23:30 2013 Koichi Sasada <ko1@atdot.net>
+ p 'foo'.frozen? #=> false
+ RubyVM::InstructionSequence.compile_option =
+ {frozen_string_literal: true}
+ p 'foo'.frozen? #=> false, because this line is already compiled.
+ p eval("'foo'.frozen?") #=> true
- * gc.c: fix oldgen/remembered_shady counting algorithm.
+ Details:
+ * String literals are deduped by rb_fstring().
+ * Dynamic string literals ("...#{xyz}...") is now only frozen,
+ not deduped. Maybe you have other ideas.
- * gc.c (rgengc_check_shady): increment
- `objspace->rgengc.remembered_shady_object_count' here.
+ Now, please do not use this option on your productions :)
+ Of course, current specification can be changed.
- * gc.c (rgengc_remember): return FALSE if obj is already remembered.
+ * compile.c: ditto.
- * gc.c (rgengc_rememberset_mark): make it void.
+ * test/ruby/test_iseq.rb: add a test.
- * gc.c (gc_mark_children): fix to double counting oldgen_object_count
- at minor GC.
+Sat Aug 22 02:53:12 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Tue Jun 25 12:07:18 2013 Tanaka Akira <akr@fsij.org>
+ * ext/psych/*: update to Psych 2.0.14
- * bignum.c (MSB): Removed.
- (BDIGIT_MSB): Defined using BIGRAD_HALF.
- (bary_2comp): Apply BIGLO after possible over flow of BDIGIT.
- (get2comp): Ditto.
- (bary_unpack_internal): Use BDIGIT_MSB.
- Apply BIGLO after possible over flow of BDIGIT.
- (rb_integer_unpack): Use BDIGIT_MSB.
- (calc_hbase): Use BDIGMAX.
- (big2dbl): Use BDIGMAX.
- Apply BIGLO after possible over flow of BDIGIT.
- (rb_big_neg): Apply BIGLO after possible over flow of BDIGIT.
- (biglsh_bang): Ditto.
- (bigrsh_bang): Ditto.
- (bary_divmod): Use BDIGIT_MSB.
- (bigdivrem): Ditto.
- (bigxor_int): Apply BIGLO after possible over flow of BDIGIT.
+ * test/psych/*: ditto
- * marshal.c (shortlen): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT).
+Fri Aug 21 19:58:48 2015 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use SIZEOF_BDIGITS
- instead of sizeof(BDIGIT).
+ * ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols.
+ [Feature #11158]
-Tue Jun 25 11:40:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * symbol.c (rb_sym_immortal_count): added to count immortal symbols.
- * bignum.c (big2ulong): suppress shorten-64-to-32 warning. BDIGIT can
- be bigger than long now.
+ * symbol.h: ditto.
- * bignum.c (LSHIFTX): remove redundant never-true expression.
+ * test/objspace/test_objspace.rb: add a test for this method.
-Tue Jun 25 00:55:54 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * NEWS: describe about this method.
- * gc.c (typedef struct rb_objspace): Change members for monitor objects.
- * gc.c (gc_marks_test): Check all WriteBarrier Errors and track them in obj-tree.
- * gc.c (rgengc_check_shady): Ditto.
- * gc.c (gc_marks): Move 2 function calls to gc_marks_test for test initialize.
+Fri Aug 21 19:48:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 24 23:30:31 2013 Tanaka Akira <akr@fsij.org>
+ * win32/Makefile.sub ($(LIBRUBY_SO)): needs additional libraries
+ for extension libraries to link statically.
+ [ruby-core:70499] [Feature #9018]
- * bignum.c (integer_unpack_single_bdigit): Refine code to filling
- higher bits and use BIGLO.
+Fri Aug 21 18:49:22 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jun 24 22:26:31 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ * include/ruby/ruby.h, cont.c, vm_trace.c: add a new event
+ fiber_switch. We need more discussion about this feature
+ so that I don't write it on NEWS.
+ [Feature #11348]
- * test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6):
- ifindex() function may not be implemented on Windows. We use another
- check for the case.
+ * test/ruby/test_settracefunc.rb: add tests.
-Mon Jun 24 22:11:37 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Fri Aug 21 17:32:42 2015 Koichi Sasada <ko1@atdot.net>
- * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_nolock):
- skip a failing test on Windows because flock() implementation is
- different from Unix.
+ * vm_insnhelper.c (vm_invoke_block): we should not expect ci->argc is
+ stable after invoking a block. [Bug #11451]
-Mon Jun 24 22:06:14 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ * test/ruby/test_yield.rb: add a test. This test script is given by
+ Alex Dowad.
- * test/rubygems/test_gem_installer.rb (test_install_extension_flat):
- use ruby in build directory in case ruby is not installed.
- [ruby-core:53265] [Bug #8058]
+Fri Aug 21 06:35:50 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Mon Jun 24 22:04:02 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ * test/openssl/test_ssl_session.rb: Fix tests so that they take in to
+ account OpenSSL installations that have SSLv3 disabled by default.
+ Thanks Jeremy Evans <code@jeremyevans.net> for the patches.
+ [Bug #11366] [Bug #11367]
- * ext/dl/cfunc.c (rb_dlcfunc_call): fix conversion from Bignum to
- pointer. sizeof(DLSTACK_TYPE) is larger than sizeof(long) on
- Windows x64 and higher bits over sizeof(long) of DLSTACK_TYPE was
- zero even if a pointer value was over 32 bits which causes SEGV on
- DL::TestCPtr#test_to_ptr_io. Adding a cast solves the bug.
+Thu Aug 20 22:19:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 24 22:04:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * vm_method.c (basic_obj_respond_to): call respond_to_missing?
+ only when redefined. [ruby-core:70460] [Bug #11465]
- * eval_error.c (warn_printf): use rb_vsprintf instead so ruby specific
- extensions like PRIsVALUE can be used in format strings
- * eval_error.c (error_print): use warn_print_str (alias for
- rb_write_error_str) to print a string value instead of using
- RSTRING_PTR and RSTRING_LEN manually
- * eval.c (setup_exception): use PRIsVALUE instead of %s and RSTRING_PTR
+Thu Aug 20 14:13:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 24 20:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * vm_eval.c (check_funcall_respond_to): share the behavior with
+ rb_obj_respond_to. [ruby-core:70460] [Bug #11465]
- * compile.c (make_name_for_block): use PRIsVALUE in format string
- instead of %s and RSTRING_PTR to protect objects from being garbage
- collected too soon
- * encoding.c (str_to_encindex): ditto
- * hash.c (rb_hash_fetch_m): ditto
- * io.c (rb_io_reopen): ditto
- * parse.y (reg_fragment_check_gen): ditto
- * parse.y (reg_compile_gen): ditto
- * parse.y (ripper_assert_Qundef): ditto
- * re.c (rb_reg_raise): ditto
- * ruby.c (set_option_encoding_once): ditto
- * vm_eval.c (rb_throw_obj): ditto
+ * vm_method.c (vm_respond_to): extract from rb_obj_respond_to and
+ merge r39881.
-Mon Jun 24 07:57:18 2013 Masaya Tarui <tarui@ruby-lang.org>
+Thu Aug 20 08:53:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (after_gc_sweep): Have to record malloc info before reset.
- * gc.c (gc_prof_timer_start): Pick out part of new record creation as gc_prof_setup_new_record.
- * gc.c (gc_prof_set_malloc_info): Move point of recording allocation size to front of mark.
+ * vm_method.c (rb_obj_respond_to): reuse found method entry
+ instead of searching same entry repeatedly.
-Mon Jun 24 02:53:09 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu Aug 20 08:31:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c: Return value in Array overview example found by @PragTob
- [Fixes GH-336] https://github.com/ruby/ruby/pull/336
+ * dir.c (replace_real_basename), win32/win32.c (opendir_internal):
+ check reparse point tags and treat supported tags only as
+ symbolic links. [ruby-core:70454] [Bug #11462]
-Mon Jun 24 02:45:51 2013 Zachary Scott <zachary@zacharyscott.net>
+Wed Aug 19 23:59:28 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * array.c (rb_ary_zip): typo by @PragTob [Fixes GH-337]
- https://github.com/ruby/ruby/pull/337
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add OP_ALL to
+ existing options rather than just setting it. Some vendors apply
+ custom patches to their versions of OpenSSL that set default values
+ for options. This commit respects the custom patches they've
+ applied.
-Mon Jun 24 02:42:01 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/openssl/test_ssl.rb (class OpenSSL): check that OP_ALL has been
+ added to the options.
- * win32/README.win32: grammar typo by @blankenshipz [Fixes GH-334]
- https://github.com/ruby/ruby/pull/334
+Wed Aug 19 23:55:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 24 00:59:35 2013 Tanaka Akira <akr@fsij.org>
+ * process.c (rb_f_spawn): [DOC] elaborate environment variable
+ values. [ruby-core:70456] [Bug #11463]
- * bignum.c (BIGUP): Use LSHIFTX and avoid cast to consider the type
- of x is bigger than BDIGIT_DBL.
- (big2ulong): Use unsigned long to store the result.
- (big2ull): Use unsigned LONG_LONG to store the result.
- (bigand_int): Use long for num to avoid data loss.
- (bigor_int): Ditto.
- (bigxor_int): Ditto.
+Wed Aug 19 23:48:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 23 23:05:58 2013 Tanaka Akira <akr@fsij.org>
+ * win32/win32.c (winnt_lstat): check reparse point tags and treat
+ supported tags only as symbolic links.
+ [ruby-core:70454] [Bug #11462]
- * include/ruby/defines.h (BDIGIT): Define it only if it is not defined
- yet. This eases tests and debug.
- (SIZEOF_BDIGITS): Ditto.
- (BDIGIT_DBL): Ditto.
- (BDIGIT_DBL_SIGNED): Ditto.
- (PRI_BDIGIT_PREFIX): Ditto.
- (PRI_BDIGIT_DBL_PREFIX): Ditto.
- (PRIdBDIGIT): Define it only if PRI_BDIGIT_PREFIX is defined.
- (PRIiBDIGIT): Ditto.
- (PRIoBDIGIT): Ditto.
- (PRIuBDIGIT): Ditto.
- (PRIxBDIGIT): Ditto.
- (PRIXBDIGIT): Ditto.
- (PRIdBDIGIT_DBL): Ditto.
- (PRIiBDIGIT_DBL): Ditto.
- (PRIoBDIGIT_DBL): Ditto.
- (PRIuBDIGIT_DBL): Ditto.
- (PRIxBDIGIT_DBL): Ditto.
- (PRIXBDIGIT_DBL): Ditto.
+Tue Aug 18 20:05:49 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Define it only if it is
- not defined yet.
+ * thread_pthread.c (reserve_stack): ensure the memory is really
+ allocated. [Bug #11457]
-Sun Jun 23 17:29:51 2013 Tanaka Akira <akr@fsij.org>
+Tue Aug 18 17:19:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (integer_unpack_single_bdigit): Use a cast.
+ * parse.y (IS_BEG): include labeled argument state, which was
+ EXPR_LABELARG. [ruby-dev:49221] [Bug #11456]
-Sun Jun 23 15:38:07 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 18 16:16:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bootstraptest/test_thread.rb: rescue resource limitation errors.
+ * include/ruby/ruby.h (RClass): define only in C, `__attribute__`
+ between `struct` and the name can't compile with g++.
+ [ruby-core:70297] [Bug #11426]
-Sun Jun 23 08:19:27 2013 Tanaka Akira <akr@fsij.org>
+Mon Aug 17 20:56:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (integer_unpack_single_bdigit): Extracted from
- bary_unpack_internal.
+ * parse.y: fix syntax error at do-block after a conditional
+ operator. separate label-allowed and after-a-label states from
+ others as bit flags. [ruby-dev:48790] [Bug #10653]
-Sun Jun 23 07:41:52 2013 Tanaka Akira <akr@fsij.org>
+Mon Aug 17 11:57:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (bary_unpack_internal): Suppress warnings (C4146) on Visual Studio.
- Reported by ko1 via IRC.
+ * io.c (rb_io_each_codepoint): raise an exception at incomplete
+ character before EOF when conversion takes place. [Bug #11444]
-Sun Jun 23 06:49:28 2013 Koichi Sasada <ko1@atdot.net>
+Sun Aug 16 17:33:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * include/ruby/ruby.h, gc.c: rename macros and functions:
- OBJ_WB_GIVEUP() -> OBJ_WB_UNPROTECT(),
- rb_obj_wb_giveup() -> rb_obj_wb_unprotect(),
- rb_gc_giveup_promoted_writebarrier() ->
- rb_gc_writebarrier_unprotect_promoted(),
+ * gems/bundled_gems: update latest version of bundled gems.
+ It includes minitest-5.8.0 and test-unit 3.1.3.
- * class.c, eval.c, hash.c: use OBJ_WB_UNPROTECT().
+Sun Aug 16 17:24:10 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-Sun Jun 23 05:41:32 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (gc_mark_children): check if RCLASS_EXT is valid
+ before marking. This fixes the following test failure
+ introduced in r51126:
- * class.c (rb_include_class_new), eval.c (rb_using_refinement):
- make classes/modules (who share method table) shady.
- If module `a' and `b' shares method table m_tbl and new method
- with iseq is added, then write barrier is applied only `a' or `b'.
- To avoid this issue, shade such classes/modules.
+ make test-all TESTOPTS='--gc-stress ruby/test_refinement.rb'
- * vm_method.c (rb_method_entry_make): add write barriers.
+Sat Aug 15 10:51:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 23 01:27:54 2013 Tanaka Akira <akr@fsij.org>
+ * ext/win32/lib/win32/registry.rb (API#SetValue): data size should
+ be in bytes, not in chars. [ruby-core:70365] [Bug #11439]
- * bignum.c (bytes_zero_p): Removed.
- (bary_pack): Don't call bytes_zero_p.
+Sat Aug 15 10:15:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 23 00:51:29 2013 Tanaka Akira <akr@fsij.org>
+ * io.c (rb_io_each_codepoint): read more data when read partially.
+ [ruby-core:70379] [Bug #11444]
- * bignum.c (bytes_zero_p): Extracted from bary_pack.
- (bary_pack): Use bytes_zero_p.
+Sat Aug 15 04:33:39 2015 Eric Wong <e@80x24.org>
-Sun Jun 23 00:16:57 2013 Tanaka Akira <akr@fsij.org>
+ * hash.c (any_hash): skip rb_objid_hash for static syms
+ (rb_num_hash_start): extract from rb_ident_hash
+ (rb_objid_hash): call rb_num_hash_start
+ (rb_ident_hash): ditto
+ [ruby-core:70181] [Feature #11405]
- * bignum.c (MSB): New macro.
- (bary_unpack_internal): Use MSB.
- (bary_divmod): Ditto.
- (bigdivrem): Ditto.
+Sat Aug 15 04:16:13 2015 Eric Wong <e@80x24.org>
-Sat Jun 22 23:45:22 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c (rb_iseq_mark): reduce NULL checks
- * bignum.c (bary_swap): New function.
- (bary_pack): Use bary_swap.
- (bary_unpack_internal): Ditto.
+Fri Aug 14 18:50:57 2015 Eric Wong <e@80x24.org>
-Sat Jun 22 23:18:39 2013 Tanaka Akira <akr@fsij.org>
+ * method.h (METHOD_ENTRY_VISI_SET): cast visi to int
+ (METHOD_ENTRY_FLAGS_SET): ditto
- * bignum.c (bytes_2comp): Renamed from quad_buf_complement.
- (bary_pack): Use bytes_2comp.
- (rb_quad_pack): Use rb_integer_pack.
- (rb_quad_unpack): Use rb_integer_unpack.
+Fri Aug 14 18:43:11 2015 Eric Wong <e@80x24.org>
-Sat Jun 22 21:46:18 2013 Tanaka Akira <akr@fsij.org>
+ * process.c (close_unless_reserved): add extra check
+ (dup2_with_divert): remove
+ (redirect_dup2): use dup2 without divert
+ (before_exec_non_async_signal_safe): adjust call + comment
+ (rb_f_exec): stop timer thread for all OSes
+ (rb_exec_without_timer_thread): remove
+ * eval.c (ruby_cleanup): adjust call
+ * thread.c (rb_thread_stop_timer_thread): always close pipes
+ * thread_pthread.c (struct timer_thread_pipe): add writing field,
+ mark owner_process volatile for signal handlers
+ (rb_thread_wakeup_timer_thread_fd): check valid FD
+ (rb_thread_wakeup_timer_thread): set writing flag to prevent close
+ (rb_thread_wakeup_timer_thread_low): ditto
+ (CLOSE_INVALIDATE): new macro
+ (close_invalidate): new function
+ (close_communication_pipe): removed
+ (setup_communication_pipe_internal): make errors non-fatal
+ (setup_communication_pipe): ditto
+ (thread_timer): close reading ends inside timer thread
+ (rb_thread_create_timer_thread): make errors non-fatal
+ (native_stop_timer_thread): close write ends only, always,
+ wait for signal handlers to finish
+ (rb_divert_reserved_fd): remove
+ * thread_win32.c (native_stop_timer_thread): adjust (untested)
+ (rb_divert_reserved_fd): remove
+ * vm_core.h: adjust prototype
+ [ruby-core:70386] [Bug #11336]
- * bignum.c (rb_integer_unpack): Don't allocate a Bignum if possible.
+Fri Aug 14 18:40:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 22 21:03:58 2013 Tanaka Akira <akr@fsij.org>
+ * ext/win32/lib/win32/registry.rb (API#SetValue): add terminator
+ size, not 1 byte. [ruby-core:70365] [Bug #11439]
- * pack.c (pack_unpack): Remove specialized unpackers for integers.
+Thu Aug 13 22:49:42 2015 Juanito Fatas <katehuang0320@gmail.com>
-Sat Jun 22 20:36:50 2013 Tanaka Akira <akr@fsij.org>
+ * lib/timeout.rb (Timeout#timeout): freeze a string message to
+ reduce string allocations. [Fix GH-996]
- * bignum.c (bary_unpack_internal): Specialized unpacker implemented.
- (bary_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION.
- (rb_integer_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION.
+Thu Aug 13 17:42:34 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 22 18:53:10 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h (rb_call_info_kw_arg_bytes): move the definition
+ to iseq.h because this function is shared with iseq.c and compile.c.
- * bignum.c (bary_pack): Support
- INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION flag.
- Fix byte order and word order handling in code specialized for
- wordsize % SIZEOF_BDIGITS == 0.
+Thu Aug 13 14:36:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h (INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION): Defined.
+ * object.c (rb_num_to_dbl): move from num2dbl_with_to_f in math.c.
-Sat Jun 22 15:41:25 2013 Koichi Sasada <ko1@atdot.net>
+Thu Aug 13 09:01:25 2015 Eric Wong <e@80x24.org>
- * gc.c (rgengc_check_shady): add new WB miss checking
- on RGENGC_CHECK_MODE >= 2.
+ * load.c (features_index_add): avoid repeat calculation
- (1) Save bitmaps before marking
- (2) Run full marking
- (3) On each traceable object,
- (a) object was not oldgen (== newly or shady object) &&
- (b) parent object was oldgen &&
- (c) parent object was not remembered &&
- (d) object was not remembered
- then, it should be WB miss.
+Wed Aug 12 21:57:31 2015 Koichi Sasada <ko1@atdot.net>
- This idea of this checker is by Masaya Tarui <tarui@ruby-lang.org>.
+ * id_table.c: IMPL() macro accept op as _opname instead of opname
+ because jemalloc seems to replace the word `free' to `je_free'.
-Sat Jun 22 15:25:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Wed Aug 12 21:51:11 2015 Koichi Sasada <ko1@atdot.net>
- * ext/etc/etc.c (setup_passwd): revert r41560, unnecessary
+ * id_table.c (mix_id_table_insert): fix memory leak.
-Sat Jun 22 14:39:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Wed Aug 12 21:17:38 2015 Eric Wong <e@80x24.org>
- * ext/etc/etc.c (Init_etc): omit 'passwd' from definition of Etc::Passwd
- if HAVE_STRUCT_PASSWD_PW_PASSWD is not defined to prevent mismatch of
- fields and values in setup_passwd
+ * iseq.c (iseq_memsize): reimplement for wrapper
+ (param_keyword_size): extracted from iseq_memsize
+ (iseqw_mark): new mark function
+ (iseqw_data_type): new data type
+ (iseqw_new): wrap as iseqw_data_type
+ (iseqw_check): adjust for wrapper
+ (Init_ISeq): remove iseqw_iseq_key initialization
+ * test/objspace/test_objspace.rb: new test
+ [ruby-core:70344] [Feature #11435]
-Sat Jun 22 14:35:40 2013 Tanaka Akira <akr@fsij.org>
+Wed Aug 12 21:15:27 2015 Eric Wong <e@80x24.org>
- * ext/dl/cfunc.c (rb_dlcfunc_call): Use rb_big_pack instead of
- rb_big2ulong_pack and rb_big2ull.
+ * vm_core.h (rb_call_info_kw_arg_bytes): extract from compile.c
+ * compile.c (iseq_build_callinfo_from_hash): use above function
- * include/ruby/intern.h (rb_big2ulong_pack): Deprecated.
+Wed Aug 12 18:00:17 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 22 14:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * class.c (move_refined_method): same as the last commit.
- * ext/etc/etc.c (setup_passwd): pass 0 as VALUE to rb_struct_new to
- prevent segfault if the compiler passes it as a 32 bit integer on
- a 64 bit ruby
+Wed Aug 12 17:57:53 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 22 13:47:13 2013 Tanaka Akira <akr@fsij.org>
+ * class.c, gc.c vm.c: use ID_TABLE_* instead of ST_*
+ (such as ST_CONTINUE) for enum rb_id_table_iterator_result.
- * bignum.c (bary_pack): MEMZERO can be used even if nails is not zero.
+Wed Aug 12 17:05:36 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 22 13:43:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * id_table.h: introduce ID key table.
+ [Feature #11420]
- * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
- of %s and RSTRING_PTR
+ This table only manage ID->VALUE table to reduce overhead of st.
- * ext/etc/etc.c (etc_getgrnam): ditto
+ Some functions prefixed rb_id_table_* are provided.
-Sat Jun 22 13:07:15 2013 Tanaka Akira <akr@fsij.org>
+ * id_table.c: implement rb_id_table_*.
- * bignum.c (CLEAR_LOWBITS): Rewritten without RSHIFTX.
- (RSHIFTX): Removed.
+ There are several algorithms to implement it.
-Sat Jun 22 10:38:03 2013 Tanaka Akira <akr@fsij.org>
+ Now, there are roughly 4 types:
- * pack.c (num2i32): Removed.
- (pack_pack): Don't use num2i32.
+ * st
+ * array
+ * hash (implemented by Yura Sokolov)
+ * mix of array and hash
-Sat Jun 22 09:55:13 2013 Tanaka Akira <akr@fsij.org>
+ The macro ID_TABLE_IMPL can choose implementation.
+ You can see detailes about them at the head of id_table.c.
- * bignum.c (LSHIFTX): Defined to suppress a warning.
- (RSHIFTX): Ditto.
- (CLEAR_LOWBITS): Use LSHIFTX and RSHIFTX.
- (FILL_LOWBITS): Use LSHIFTX.
- Reported by ko1 via IRC.
+ At the default, I choose 34 (mix of list and hash).
+ This is not final decision.
+ Please report your suitable parameters or
+ your data structure.
-Sat Jun 22 09:11:33 2013 Ryan Davis <ryand-ruby@zenspider.com>
+ * symbol.c: introduce rb_id_serial_t and rb_id_to_serial()
+ to represent ID by serial number.
- * lib/minitest/*: Imported minitest 4.7.5 (r8724)
- * test/minitest/*: ditto
+ * internal.h: use id_table for method tables.
-Sat Jun 22 07:20:30 2013 Koichi Sasada <ko1@atdot.net>
+ * class.c, gc.c, marshal.c, vm.c, vm_method.c: ditto.
- * gc.c (gc_prof_set_heap_info, after_gc_sweep): call
- gc_prof_set_heap_info() just after sweeping to calculate
- live object number correctly.
- (live object number = total generated number (before marking) -
- total freed number (after sweeping))
+Wed Aug 12 05:19:11 2015 Eric Wong <e@80x24.org>
- * gc.c (gc_marks): record `oldgen_object_count' into current profile`
- record directly.
+ * parse.y (rb_parser_compile_cstr): remove volatile arg
+ (rb_parser_compile_string): ditto
+ (rb_parser_compile_file): ditto
+ (rb_parser_compile_string_path): ditto
+ (rb_parser_compile_file_path): ditto
+ [ruby-core:70323] [Misc #11431]
- * gc.c (rgengc_rememberset_mark): same for remembered_normal_objects
- and remembered_shady_objects.
+Tue Aug 11 22:59:57 2015 Tanaka Akira <akr@fsij.org>
-Sat Jun 22 06:46:04 2013 Koichi Sasada <ko1@atdot.net>
+ * numeric.c (Init_Numeric): Fix document for Float::MIN and
+ Float::EPSILON.
- * gc.c (rb_objspace::profile): rename rb_objspace::profile::record to
- records (because it points a set of records) and add a field
- rb_objspace::profile::current_record to point a current profiling
- record.
+Tue Aug 11 15:22:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: use above fields.
+ * include/ruby/ruby.h (ALLOCV_N): check integer overflow, as well
+ as ruby_xmalloc2. pointed out by Paul <pawlkt AT gmail.com>.
-Sat Jun 22 06:05:36 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 11 14:57:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_gc_giveup_promoted_writebarrier): remove `rest_sweep()'
- because all of remembered objects are called for gc_mark_children().
+ * array.c (rb_ary_repeated_permutation): fix buffer size, ALLOCV_N
+ already multiplies element size.
-Sat Jun 22 05:08:03 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 11 12:13:20 2015 Jeremy Evans <merch-redmine@jeremyevans.net>
- * gc.c (rgengc_rememberset_mark): call gc_mark_children() for
- remembered objects directly instead of pushing on the mark stack.
+ * test/openssl/test_ssl.rb: Fix LocalJumpErrors being raised
+ in OpenSSL tests. [ruby-core:70020][Bug #11368]
-Sat Jun 22 04:48:53 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 11 11:54:13 2015 Alexey Lipnyagov <liptonshmidt@gmail.com>
- * include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for second
- parameter `slot'. You don't need to write a cast (VALUE *) any more.
+ * string.c: Fix documentation for String#slice
+ [ruby-core:70298][Bug #11427]
- * class.c, compile.c, hash.c, iseq.c, proc.c, re.c, variable.c,
- vm.c, vm_method.c: remove cast expressions for OBJ_WRITE().
+Tue Aug 11 11:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 22 04:37:08 2013 Koichi Sasada <ko1@atdot.net>
+ * parse.y (superclass): make superclass rule optional and allow
+ any contents without a terminator. [EXPERIMENTAL]
- * gc.c (slot_sweep_body): rename to slot_sweep().
- No need to separate major/minor GC.
+Tue Aug 11 10:58:42 2015 Juanito Fatas <juanitofatas@gmail.com>
- * gc.c (gc_setup_mark_bits): remove gc_clear_mark_bits() and unify to
- this function.
+ * string.c: [DOC] Make #end_with? example doc symmetry
+ with #start_with? [fix GH-992][ci skip]
-Sat Jun 22 04:20:21 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 11 10:51:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (check_bitmap_consistency): add to check flag and bitmap consistency.
- Use this function in several places.
+ * test/ruby/test_array.rb: Add test for `Array#flatten` with level 1
+ [fix GH-986] Patch @yui-knk
-Sat Jun 22 02:18:07 2013 Tanaka Akira <akr@fsij.org>
+Tue Aug 11 10:48:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (bary_pack): Specialized packers implemented.
- (HOST_BIGENDIAN_P): New macro.
- (ALIGNOF): New macro.
- (CLEAR_LOWBITS): New macro.
- (FILL_LOWBITS): New macro.
- (swap_bdigit): New macro.
- (bary_2comp): Returns an int.
+ * enum.c: added doc for Enumerable#zip
+ [fix GH-985] Patch by @yui-knk
+ * test/ruby/test_enum.rb: added tests for Enumerable#zip
+ [fix GH-985] Patch @yui-knk
- * internal.h (swap16): Moved from pack.c
- (swap32): Ditto.
- (swap64): Ditto.
+Tue Aug 11 10:33:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Jun 21 21:29:49 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * vm_method.c: typo fix [fix GH-993][ci skip] Patch by @0x0dea
+ * test/ruby/test_refinement.rb: ditto.
- * gc.c (typedef enum): Introduce flags of major gc reason.
- * gc.c (garbage_collect_body): Ditto.
- * gc.c (gc_profile_flags): Ditto.
- * gc.c (gc_profile_dump_on): Ditto.
+Sun Aug 9 14:15:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 21 21:11:53 2013 Koichi Sasada <ko1@atdot.net>
+ * vm.c (Init_vm_objects, rb_vm_fstring_table): use frozen_strings
+ table in rb_vm_t. [ruby-core:70274] [Bug #11423]
- * gc.c (allocate_sorted_heaps): remove unused variable `add'.
+Sat Aug 8 03:59:51 2015 Zachary Scott <zzak@ruby-lang.org>
-Fri Jun 21 20:50:32 2013 Koichi Sasada <ko1@atdot.net>
+ * object.c: [DOC] Improve grammar for Module#===
+ Patch by @SkyBirdSoar in documenting-ruby/ruby#52:
+ https://github.com/documenting-ruby/ruby/pull/52
- * include/ruby/ruby.h: constify RArray::as::ary and RArray::heap::ptr.
- Use RARRAY_ASET() or RARRAY_PTR_USE() to modify Array objects.
+Sat Aug 8 03:39:33 2015 Zachary Scott <zzak@ruby-lang.org>
- * array.c, gc.c: catch up above changes.
+ * hash.c: [DOC] Improve description of symbol key syntax
+ Patch by Raphael Das Gupta in documenting-ruby/ruby#51:
+ https://github.com/documenting-ruby/ruby/pull/51
-Fri Jun 21 20:32:13 2013 Koichi Sasada <ko1@atdot.net>
+Fri Aug 7 21:04:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_eval.c (eval_string_with_cref): fix WB miss.
+ * parse.y (parser_params): turn in_def and in_single into bit
+ flags and reduce the size by 2-words.
-Fri Jun 21 20:15:49 2013 Koichi Sasada <ko1@atdot.net>
+ * parse.y (parser_params): remove redundant prefixes.
- * include/ruby/ruby.h: support write barrier protection for T_STRUCT.
- Introduce the following C APIs:
- * RSTRUCT_RAWPTR(st) returns pointer (do WB on your risk).
- The type of returned pointer is (const VALUE *).
- * RSTRUCT_GET(st, idx) returns idx-th value of struct.
- * RSTRUCT_SET(st, idx, v) set idx-th value by v with WB.
- And
- * RSTRUCT_PTR(st) returns pointer with shady operation.
- The type of returned pointer is (VALUE *).
+ * parse.y (yylex): non-pure parser has not been supported since
+ merger of ripper. change argument types from void pointers.
- * struct.c, re.c, gc.c, marshal.c: rewrite with above APIs.
+Fri Aug 7 17:07:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 21 19:38:37 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c (method_super_method): uncallable method entry does not
+ have the defined class, use the owner instead.
+ [ruby-core:70254] [Bug #11419]
- * bignum.c (BDIGMAX): Use BIGRAD.
- (BIGLO): Use BDIGMAX.
- (bigdivrem1): Ditto.
- (bigor_int): Ditto.
- (rb_big_or): Ditto.
+ * test/ruby/test_method.rb (test_super_method_unbound): add test
+ by Akira Matsuda.
-Fri Jun 21 19:18:48 2013 Tanaka Akira <akr@fsij.org>
+Thu Aug 6 10:49:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * pack.c (pack_pack): Move the implementation for 'c' directive after
- pack_integer label.
+ * node.c (rb_alloc_tmp_buffer): round up the size and check the
+ range.
-Fri Jun 21 19:11:56 2013 Koichi Sasada <ko1@atdot.net>
+ * ruby_atomic.h (ATOMIC_VALUE_EXCHANGE, ATOMIC_VALUE_CAS): add
+ atomic operations for VALUE.
- * include/ruby/ruby.h, re.c: support write barrier for T_REGEXP.
+Thu Aug 6 08:15:49 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- Note: T_MATCH object is also easy to support write barriers.
- However, most of T_MATCH objects are short-lived objects.
- So I skipped to support non-shady T_MATCH.
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
+ SSLSocket#sysclose to Ruby.
-Fri Jun 21 18:56:58 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_ssl.c (ossl_ssl_close): ditto
- * bignum.c (bigsub_int): Use bdigit_roomof.
- (bigadd_int): Ditto.
- (bigand_int): Ditto.
- (bigor_int): Ditto.
- (bigxor_int): Ditto.
+Thu Aug 6 07:57:21 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Fri Jun 21 17:56:25 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move nonblock
+ enable to SSLSocket#initialize and remove Nonblock module.
- * benchmark/gc/gcbench.rb: fix summary of benchmark result notation.
+Thu Aug 6 07:53:47 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Fri Jun 21 16:38:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
+ OpenSSL::SSL::SSLSocket#initialize to Ruby.
- * ext/openssl/ossl_x509attr.c: change OSSL_X509ATTR_IS_SINGLE and
- OSSL_X509ATTR_SET_SINGLE macros to use ->value.set rather than
- ->set to fix compile failure
+ * ext/openssl/ossl_ssl.c: ditto
-Fri Jun 21 15:26:45 2013 Koichi Sasada <ko1@atdot.net>
+Thu Aug 6 02:25:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (gc_sweep): profile sweep time correctly when LAZY_SWEEP is
- disabled.
+ * node.c (rb_alloc_tmp_buffer): use NODE_ALLOCA to mark locations
+ like as builtin alloca. [ruby-core:70251] [Bug #11418]
- * gc.c (gc_marks_test): store oldgen count and shady count
- before test marking and restore them after marking.
+Wed Aug 5 14:37:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 21 15:07:42 2013 Koichi Sasada <ko1@atdot.net>
+ * transcode.c (rb_econv_open0): rb_econv_t::source_encoding_name
+ and rb_econv_t::destination_encoding_name should refer static
+ strings always or NULL. [ruby-core:70247] [Bug #11416]
- * gc.c: enable lazy sweep (commit miss).
+Tue Aug 4 16:53:43 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Fri Jun 21 14:31:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callback
+ lookup to private Ruby methods. This means we can keep the default
+ DH callback logic hidden from consumers. Also, since the SSLSocket
+ always has a context, we can remove conditionals about that
+ instance.
- * hash.c (ruby_setenv): refine error message so include the variable
- name.
+ * ext/openssl/ossl_ssl.c: move callback lookup methods to private Ruby
+ methods.
-Fri Jun 21 14:15:08 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 4 16:40:26 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c: fix to use total_allocated_object_num and heaps_used
- at the GC time for profiler.
+ * test/ruby/test_module.rb: should not expect a method table ordering.
+ [Feature #11414]
-Fri Jun 21 12:35:35 2013 Koichi Sasada <ko1@atdot.net>
+Tue Aug 04 15:30:04 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c: RGENGC_CHECK_MODE should be 0.
+ * proc.c (rb_block_clear_env_self): clear by Qfalse instead of Qnil.
+ [Bug #11409]
-Fri Jun 21 11:18:25 2013 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_eval.rb: add tests for this issue,
+ written by @0x0dea.
+ https://github.com/ruby/ruby/pull/988
- * gc.c (gc_marks_body): fix to get `th' in this function.
+Tue Aug 4 12:12:14 2015 Eric Wong <e@80x24.org>
-Fri Jun 21 10:21:44 2013 Koichi Sasada <ko1@atdot.net>
+ * variable.c: wrap long lines
- * gc.c (heaps_header/heaps_slot): embed bitmaps into heaps_slot.
- no need to maintain allocation/free bitmaps.
+Tue Aug 4 09:32:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Jun 21 09:22:16 2013 Koichi Sasada <ko1@atdot.net>
+ * proc.c: Removing duplicate doc [fix GH-987][ci skip]
+ Patch by @ronakjangir47
- * gc.c (slot_sweep_body): add counters at a time.
+Tue Aug 4 09:21:58 2015 Richard Schneeman <richard.schneeman+foo@gmail.com>
- * gc.c (gc_profile_dump_on): fix line break position.
+ * doc/contributing.rdoc: fixed wrong instructions with OS X
+ [fix GH-989][ci skip] Patch by @schneems
-Fri Jun 21 08:14:00 2013 Masaya Tarui <tarui@ruby-lang.org>
+Mon Aug 3 10:08:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: refactoring bitmaps. introduce bits_t type and some Consts.
+ * re.c (rb_memsearch): should match only char boundaries in wide
+ character encodings. [ruby-core:70220] [Bug #11413]
-Fri Jun 21 08:04:32 2013 Koichi Sasada <ko1@atdot.net>
+Sun Aug 2 07:01:17 2015 Eric Wong <e@80x24.org>
- * gc.c: fix to support USE_RGENGC == 0 (disable RGenGC).
- If USE_RGENGC==0, it caused compilation error.
+ * ext/openssl/lib/openssl/buffering.rb (gets):
+ avoid comparing fixnum with nil
+ * test/openssl/test_pair.rb: test gets with limit when EOF is hit
+ Thanks to Bar Hofesh <bar.hofesh@safe-t.com> for the bug report
+ and testing.
+ [ruby-core:70149] [Bug #11400]
-Fri Jun 21 08:08:11 2013 Masaya Tarui <tarui@ruby-lang.org>
+Sat Aug 1 17:13:15 2015 Kazuki Tsujimoto <kazuki@callcc.net>
- * gc.c (lazy_sweep): Use is_lazy_sweeping()
- * gc.c (rest_sweep): Ditto.
- * gc.c (gc_prepare_free_objects): Ditto.
+ * lib/net/http/response.rb (Net::HTTPResponse::Inflater#finish):
+ fix a bug that empty gzipped response body causes Zlib::BufError.
+ [ruby-core:68846] [Bug #11058]
-Fri Jun 21 07:34:47 2013 Koichi Sasada <ko1@atdot.net>
+ * test/net/http/test_httpresponse.rb: tests for the above.
- * gc.c (gc_profile_record::oldgen_objects): added.
+Sat Aug 1 17:05:18 2015 Kazuki Tsujimoto <kazuki@callcc.net>
- * gc.c (gc_profile_dump_on): print the following information:
- * Living object counts
- * Free object counts
- If RGENGC_PROFILE > 0 then
- * Oldgen object counts
- * Remembered normal object counts
- * Remembered shady object counts
+ * lib/net/http/response.rb (Net::HTTPResponse#inflater):
+ fix TypeError. An exception object might be nil.
+ [ruby-core:68846] [Bug #11058]
-Fri Jun 21 06:43:59 2013 Tanaka Akira <akr@fsij.org>
+Sat Aug 1 09:09:46 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * bignum.c (rb_ull2big): Refactored.
- (rb_uint2big): Useless code removed.
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): Implement
+ SSLContext#options and options= using SSL_CTX_set_options and
+ SSL_CTX_get_options. This reduces the number of ivars we need and
+ simplifies `ossl_sslctx_setup`.
-Fri Jun 21 05:37:39 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): Default `options`
+ to SSL_OP_ALL
- * gc.c (gc_prof_sweep_timer_stop): accumulate sweep time only when
- record->gc_time > 0.
+Sat Aug 1 06:54:36 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Fri Jun 21 00:37:31 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_ssl.c (Init_ossl_ssl): OpenSSL declares these
+ constants as longs, so we should follow that and use LONG2NUM.
+ http://git.io/vOqxD
- * ext/bigdecimal: Workaround fix for bigdecimal test failures caused
- by [ruby-dev:47413] [Feature #8509]
+Sat Aug 1 04:06:29 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.h (BDIGIT): Make it independent from the
- definition for bignum.c.
- (SIZEOF_BDIGITS): Ditto.
- (BDIGIT_DBL): Ditto.
- (BDIGIT_DBL_SIGNED): Ditto.
- (PRI_BDIGIT_PREFIX): Undefine the definition.
- (PRI_BDIGIT_DBL_PREFIX): Ditto.
+ * ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): change callback
+ to return the Ruby dh (or ecdh) object that the caller cares about
+ instead of doing rb_iv_get / set to communicate. This means we can
+ remove an rb_iv_get call, and only use the set calls for their
+ intended purpose (to prevent the object from being GC'd).
- * ext/bigdecimal/bigdecimal.c (RBIGNUM_ZERO_P): Use rb_bigzero_p.
- (bigzero_p): Removed.
- (is_even): Use rb_big_pack.
+ * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
+ * ext/openssl/ossl_ssl.c (ossl_call_tmp_ecdh_callback): ditto
+ * ext/openssl/ossl_ssl.c (ossl_tmp_ecdh_callback): ditto
-Thu Jun 20 22:52:42 2013 Tanaka Akira <akr@fsij.org>
+Sat Aug 1 03:49:31 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * bignum.c (bigmul1_toom3): Don't call bignorm twice.
+ * ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): Similarly to the
+ tmp_ecdh_callback, the SSLSocket instance always holds a reference
+ to the SSLContext object (it's always set in `initialize`). The
+ SSLContext holds a reference to the tmp_dh_callback. Ask the
+ context for the callback instead of storing the callback in two
+ places.
-Thu Jun 20 22:49:27 2013 Tanaka Akira <akr@fsij.org>
+Sat Aug 1 03:43:10 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum.
+ * ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): create an array
+ and use `rb_apply` to clean up calls to `rb_protect`.
-Thu Jun 20 22:29:42 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
- * bignum.c (rb_uint2big): Refactored.
+Sat Aug 1 03:27:12 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Thu Jun 20 22:24:41 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_ssl.c (ossl_call_tmp_ecdh_callback): The SSL socket
+ always holds a reference to the SSLContext object, which will have
+ the callback object. Ask the context for the callback instead of
+ storing the callback in two places.
- * bignum.c (dump_bignum): Use SIZEOF_BDIGITS.
+Sat Aug 1 03:14:07 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Thu Jun 20 22:22:46 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): convert
+ `tmp_dh_callback` to Ruby, and call it when setting up an SSL
+ connection. This allows us to move the "default" behavior to the
+ reader method.
- * bignum.c (big2ulong): Change the return type to unsigned long.
- (rb_big2ulong_pack): Follow the above change.
- (rb_big2long): Ditto.
- (rb_big_lshift): Ditto.
- (rb_big_rshift): Ditto.
- (rb_big_aref): Ditto.
+ * ext/openssl/ossl_ssl.c: call the tmp_dh_callback instead of
+ accessing the SSLContext's internals.
-Thu Jun 20 22:02:46 2013 Tanaka Akira <akr@fsij.org>
+Fri Jul 31 23:34:27 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * bignum.c (bary_unpack_internal): Return -2 when negative overflow.
- (bary_unpack): Set the overflowed bit if an extra BDIGIT exists.
- (rb_integer_unpack): Set the overflowed bit.
+ * .travis.yml: update libssl before running tests.
+ Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for figuring out the
+ travis settings!
-Thu Jun 20 21:17:19 2013 Koichi Sasada <ko1@atdot.net>
+Fri Jul 31 21:34:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rgengc_rememberset_mark): record
- (1) normal objects count in remember set
- (2) shady objects count in remember set
- each GC timing.
+ * load.c (rb_require_internal): use rb_load_internal0 not to raise
+ a exception to be caught.
- * gc.c (gc_profile_record_get): enable to access above information
- and REMOVING_OBJECTS, EMPTY_OBJECTS.
+Thu Jul 30 13:19:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 20 18:29:26 2013 Koichi Sasada <ko1@atdot.net>
+ * variable.c (rb_const_get_0): warn deprecated constant reference.
- * benchmark/gc/gcbench.rb: Do not use GC::Profiler::disable because
- GC::Profiler::disable prohibit to access profiling data. It should
- be spec bug.
+ * variable.c (rb_mod_deprecate_constant): mark constants to be
+ warned as deprecated. [Feature #11398]
- Skip GC::Profiler::report if RUBY_VERSION < '2.0.0'
+Thu Jul 30 11:53:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 20 17:59:08 2013 Koichi Sasada <ko1@atdot.net>
+ * thread.c (rb_thread_s_handle_interrupt): make identity hash, to
+ compare masking classes just by their IDs.
- * benchmark/gc/gcbench.rb: stop GC::Profiler before output results.
- Generating GC::Profiler result under profiling causes infinite loop.
+Thu Jul 30 11:52:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 20 17:24:24 2013 Koichi Sasada <ko1@atdot.net>
+ * load.c (rb_load_internal0): stop separating exits at loading
+ from exits from execution. TAG_FATAL is the only case that
+ `errinfo` is a Fixnum, and should continue to exit by JUMP_TAG
+ but not raising as an ordinary exception.
+ [ruby-core:70169] [Bug #11404]
- * benchmark/gc/gcbench.rb: don't use __dir__ to make compatible
- with ruby 1.9.3.
+Thu Jul 30 10:42:27 2015 Alex Dowad <alexinbeijing@gmail.com>
-Thu Jun 20 16:57:19 2013 Koichi Sasada <ko1@atdot.net>
+ * load.c (rb_load_internal0): extra check before returning
+ TAG_RAISE when a non-local transfer of control happens while
+ loading and parsing a Ruby source file.
+ [ruby-core:70169] [Bug #11404]
- * benchmark/bm_app_aobench.rb: use attr_accessor/reader instead of
- defining methods.
+Thu Jul 30 08:48:42 2015 Eric Wong <e@80x24.org>
-Thu Jun 20 16:46:46 2013 Koichi Sasada <ko1@atdot.net>
+ * st.c (find_entry): constify st_table*
+ (find_packed_index_from): ditto
+ (find_packed_index): ditto
+ (get_keys): ditto
+ (get_values): ditto
- * benchmark/bm_app_aobench.rb: added.
+Thu Jul 30 04:29:25 2015 Eric Wong <e@80x24.org>
- * benchmark/gc/aobench.rb: added.
+ * benchmark/bm_hash_aref_dsym.rb: new benchmark
+ * benchmark/bm_hash_aref_dsym_long.rb: ditto
+ * benchmark/bm_hash_aref_fix.rb: ditto
-Thu Jun 20 16:28:33 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jul 29 21:38:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/bm_so_binary_trees.rb: disable `puts' method
- and change iteration parameter to increase execution time.
+ * hash.c (any_hash), symbol.c (dsymbol_alloc): fix dynamic symbol
+ hash value by restricting in Fixnum range, that is `long`.
- * benchmark/gc/binarytree.rb: added.
+Wed Jul 29 17:25:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 20 16:06:37 2013 Koichi Sasada <ko1@atdot.net>
+ * hash.c (rb_obj_hash): move in order to share with rb_any_hash.
- * benchmark/gc/pentomino.rb: added.
- Simply load pentomino puzzle in the benchmark/ directory.
+Wed Jul 29 16:00:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 20 15:32:56 2013 Koichi Sasada <ko1@atdot.net>
+ * string.c (str_buf_cat): consider empty non-embed string case,
+ not to loop infinitely. [ruby-core:70074] [Bug #11383]
- * benchmark/gc/redblack.rb: import red black tree benchmark from
- https://github.com/jruby/rubybench/blob/master/time/bench_red_black.rb
+Wed Jul 29 15:25:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/gc/ring.rb: add a benchmark. This benchmark create many
- old objects.
+ * vm_eval.c (send_internal): set method_missing_reason before
+ invoking overriding method_missing method so that the default
+ method_missing can achieve it properly.
+ [ruby-core:68515] [Bug #10969]
-Thu Jun 20 15:14:00 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jul 29 14:54:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/gc: create a directory to store GC related benchmark.
+ * hash.c (rb_sym_hash): return same value as rb_any_hash() of
+ Symbol. [Bug #9381]
- * benchmark/gc/gcbench.rb: moved from tool/gcbench.rb.
+ * hash.c (rb_any_hash): fix Float hash. rb_dbl_hash() returns a
+ Fixnum, but not a long. [Bug #9381]
- * benchmark/gc/hash(1|2).rb: ditto.
+Wed Jul 29 11:07:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/gc/rdoc.rb: ditto.
+ * internal.h (LIKELY, UNLIKELY): make a boolean to enforce 1 or 0.
- * benchmark/gc/null.rb: added.
+Wed Jul 29 10:44:43 2015 Alex Dowad <alexinbeijing@gmail.com>
- * common.mk: fix rule.
+ * gc.c: document argument passed to finalizer proc.
+ [fix GH-976][ci skip] Patch by @alexdowad
-Thu Jun 20 14:09:54 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jul 29 10:36:58 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * tool/hashbench1.rb: fix parameter too. Increase temporary objects.
+ * io.c (rb_io_extract_modeenc): add option parameter `flags'
+ to append extra oflags to normal mode.
+ [Feature #11253] [ruby-core:69539]
-Thu Jun 20 14:01:35 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jul 29 04:54:47 2015 Eric Wong <e@80x24.org>
- * tool/hashbench1.rb: fix parameters.
+ * test/rubygems/test_gem_remote_fetcher.rb: pre-generate test key
+ [ruby-core:70151] [Bug #11397]
-Thu Jun 20 14:00:34 2013 Koichi Sasada <ko1@atdot.net>
+Tue Jul 28 10:32:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk: remove dependency from ruby.
+ * internal.h (struct RClass): moved from ruby/ruby.h to hide the
+ internals.
-Thu Jun 20 13:14:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 28 08:48:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c (rb_check_backtrace): evaluate RARRAY_AREF only once.
- the first argument of RB_TYPE_P is expanded twice for non-immediate
+ * configure.in (RUBY_TYPE_ATTRIBUTE): attribute declaration for
types.
-Thu Jun 20 08:09:29 2013 Koichi Sasada <ko1@atdot.net>
-
- * tool/gcbench.rb: Summary in one line.
-
- * common.mk: separate gcbench-hash to gcbench-hash1 and gcbench-hash2.
-
-Thu Jun 20 08:07:23 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (BIGSIZE): New macro.
- (bigfixize): Use BIGSIZE.
- (big2ulong): Ditto.
- (check_shiftdown): Ditto.
- (rb_big_aref): Ditto.
-
-Thu Jun 20 07:46:48 2013 Masaya Tarui <tarui@ruby-lang.org>
-
- * gc.c (rb_gc_writebarrier): give up rescan A and register B directly
- if A has huge number of children.
-
-Thu Jun 20 07:30:35 2013 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: add new rules `gcbench-rdoc', `gcbench-hash'.
-
- * tool/gcbench.rb: separate GC bench framework and process.
-
- * tool/hashbench1.rb, tool/hashbench2.rb: add two types GC bench.
- hashbench1: many temporal objects (GC by newobj)
- hashbench2: hash size becomes bigger and bigger (GC by malloc)
- Two benches are executed by `gcbench-hash' rule.
-
- * tool/rdocbench.rb: separated.
-
-Thu Jun 20 06:25:39 2013 Koichi Sasada <ko1@atdot.net>
-
- * tool/rdocbench.rb: add summary.
-
-Thu Jun 20 06:18:01 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_profile_total_time): check objspace->profile.next_index > 0.
-
-Thu Jun 20 05:47:41 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_prof_sweep_timer_start): fix merge miss.
-
- * gc.c (GC_PROFILE_MORE_DETAIL): set it 0.
-
-Thu Jun 20 05:38:56 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: Accumulate sweep time to GC time.
- Now [GC time] is [mark time] + [sweep time] + [misc].
- ([GC time] >= [mark time] + [sweep time])
-
- * gc.c (gc_prof_sweep_slot_timer_start/stop): rename to
- gc_prof_sweep_timer_start/stop and locate at lazy_sweep().
-
- * gc.c (elapsed_time_from): add a utility function.
-
-Thu Jun 20 05:08:53 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_marks): fix wrong option. FALSE means major/full GC.
- It should be TRUE (minor marking).
-
-Thu Jun 20 02:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (waitpid): should not return 0 but wait until exit
- unless WNOHANG is given. waiting huge process may return while
- active, for some reason.
-
-Thu Jun 20 01:34:15 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bdigit_roomof): Use SIZEOF_BDIGITS.
- (bigfixize): Refine an ifdef condition.
- (rb_absint_size): Use bdigit_roomof.
- (rb_absint_singlebit_p): Ditto.
- (rb_integer_pack): Ditto.
- (integer_pack_fill_dd): Use BITSPERDIG.
- (integer_unpack_push_bits): Use BITSPERDIG, BIGLO and BIGDN.
-
-Thu Jun 20 01:07:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (MARKED_IN_BITMAP, FL_TEST2): return boolean value since always
- used as boolean value.
-
- * gc.c (MARK_IN_BITMAP, CLEAR_IN_BITMAP): evaluate bits once.
-
-Thu Jun 20 00:05:07 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (RVALUE_PROMOTED): fix type.
+Tue Jul 28 07:23:03 2015 Eric Wong <e@80x24.org>
-Wed Jun 19 23:39:01 2013 Koichi Sasada <ko1@atdot.net>
+ * symbol.h (struct RSymbol): add hashval field
+ * symbol.c (dsymbol_alloc): setup hashval field once
+ * hash.c (rb_any_hash): return RSymbol->hashval directly
+ * common.mk: hash.o depends on symbol.h
+ Thanks to Bruno Escherl <bruno@escherl.net> for the bug report
+ [ruby-core:70129] [Bug #11396]
- * gc.c (gc_marks_test): rewrite checking code.
- When RGENGC_CHECK_MODE >= 2, all minor marking, run normal minor
- marking *and* major/full marking. After that, compare the results
- and shows BUG if a object living with major/full marking but dead
- with minor marking.
- After detecting bugs, print references information.
- (RGENGC_CHECK_MODE == 2, show references to dead object)
- (RGENGC_CHECK_MODE == 3, show all references)
+Tue Jul 28 03:26:15 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Wed Jun 19 23:51:48 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): raise a more
+ helpful exception when verifying the peer connection and an
+ anonymous cipher has been selected. [ruby-core:68330] [Bug #10910]
+ Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for the patch.
- * bignum.c (bigfixize): Use rb_absint_size.
- (check_shiftdown): Ditto.
- (big2ulong): Use bdigit_roomof.
+ * test/openssl/test_ssl.rb (class OpenSSL): test for change
-Wed Jun 19 23:32:23 2013 Koichi Sasada <ko1@atdot.net>
+Mon Jul 27 13:24:11 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (RVALUE_PROMOTED): check consistency between oldgen flag and
- oldgen bitmap if RGENGC_CHECK_MODE > 0.
+ * template/id.h.tmpl (ID2ATTRSET): remove an unused macro.
-Wed Jun 19 23:29:29 2013 Koichi Sasada <ko1@atdot.net>
+Mon Jul 27 12:21:15 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (rb_gc_force_recycle): clear oldgen bitmap, too.
+ * test/openssl/test_ssl.rb: run tests on non-Unix platforms.
-Wed Jun 19 21:02:13 2013 Tanaka Akira <akr@fsij.org>
+Sun Jul 26 19:21:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_uint2big): Consider environments BDIGIT is bigger than
- long.
- (big2ulong): Ditto.
- (rb_big_aref): Ditto.
- (rb_big_pack): Just call rb_integer_pack.
- (rb_big_unpack): Just call rb_integer_unpack.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_alpn_protocol): fix condition
+ to compile, needs ALPN to be available. [Feature #9390]
-Wed Jun 19 20:51:21 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Sun Jul 26 11:29:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (gc_stress_get): GC.stress can be Fixnum.
+ * signal.c (default_handler, Init_signal): discard SIGSYS, ENOSYS
+ should raise a SystemCallError always instead.
-Wed Jun 19 19:31:30 2013 Tanaka Akira <akr@fsij.org>
+Sun Jul 26 10:26:35 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * bignum.c (DIGSPERLONG): Don't define if BDIGIT is bigger than long.
- (DIGSPERLL): Don't define if BDIGIT is bigger than LONG_LONG
- (rb_absint_size): Consider environments BDIGIT is bigger than long.
- Use BIGLO and BIGDN.
- (rb_absint_singlebit_p): Ditto.
- (rb_integer_pack): Ditto.
- (bigsub_int): Consider environments BDIGIT is bigger than long.
- Use SIZEOF_BDIGITS instead of sizeof(BDIGIT).
- (bigadd_int): Ditto.
- (bigand_int): Ditto.
- (bigor_int): Ditto.
- (bigxor_int): Ditto.
+ * ext/openssl/ossl_ssl.c (ossl_call_servername_cb): set the ssl context
+ object returned by the servername callback on to the socket as an
+ instance variable. If the callback allocated a new context object
+ and didn't keep a reference to it, it could be GC'd out from under
+ the socket object.
-Wed Jun 19 15:14:30 2013 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_ssl.rb (class OpenSSL): test for change.
- * include/ruby/ruby.h (struct rb_data_type_struct), gc.c: add
- rb_data_type_struct::flags. Now, this flags is passed
- at T_DATA object creation. You can specify FL_WB_PROTECTED
- on this flag.
+Sun Jul 26 10:07:26 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * iseq.c: making non-shady iseq objects.
+ * test/openssl/test_ssl.rb (class OpenSSL): add test coverage around
+ OpenSSL::SSL::SSLContext#servername_cb
- * class.c, compile.c, proc.c, vm.c: add WB for iseq objects.
+Sun Jul 26 09:10:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * vm_core.h, iseq.h: constify fields to detect WB insertion.
+ * gems/bundled_gems: update latest version of bundled power_assert.
-Wed Jun 19 15:11:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 26 08:49:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (gc_mark_children): show more info for broken object.
+ * test/rubygems/test_gem_remote_fetcher.rb: backport rubygems upstream
+ change for OpenSSL key length. see detail to
+ https://github.com/rubygems/rubygems/pull/1290
-Wed Jun 19 14:04:41 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Sun Jul 26 08:33:03 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * test/ruby/envutil.rb (EnvUtil#rubybin): remove unnecessary
- unless expression.
+ * ext/openssl/lib/openssl/pkey.rb: implement DEFAULT_512 and
+ DEFAULT_1024 constants in Ruby.
-Wed Jun 19 07:47:48 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): Ask PKey for the
+ default DH callback since it already must check whether openssl has
+ been compiled with DH support.
- * gc.c (garbage_collect_body): use FIX2INT for ruby_gc_stress.
+ * ext/openssl/ossl_pkey_dh.c (OSSL_PKEY_BN): Remove C definitions of
+ DEFAULT_512 and DEFAULT_1024
-Wed Jun 19 07:44:31 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto
- * gc.c (rb_objspace::gc_stress): int -> VALUE to store Fixnum object.
+ * test/openssl/test_pkey_dh.rb (class OpenSSL): add test to ensure the
+ Ruby definitions are the same as the C definitions were.
-Wed Jun 19 07:25:35 2013 Koichi Sasada <ko1@atdot.net>
+Sun Jul 26 08:14:59 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * gc.c (make_deferred): clear flags to T_ZOMBIE.
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): support
+ specifically setting the tmp_dh_callback to nil.
- * gc.c (slot_sweep_body): fix indent.
+ * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
-Wed Jun 19 07:18:47 2013 Tanaka Akira <akr@fsij.org>
+ * test/openssl/test_pair.rb (module OpenSSL): add a test
- * bignum.c (rb_big_aref): Apply BIGLO to ~xds[i] for environment which
- BDIGIT is 16bit.
+Sun Jul 26 07:47:14 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Wed Jun 19 07:09:26 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move the default
+ tmp_dh_callback Ruby code and set it as a default in `initialize`.
- * gc.c (rgengc_remember): fix output level.
+ * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_512_GEN):
+ move this constant to Ruby.
- * gc.c (rgengc_rememberset_mark): fix to output clear count.
- (shady_object_count + clear_count = count of remembered objects)
+ * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_1024_GEN):
+ ditto
-Wed Jun 19 07:06:21 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto
- * gc.c (rgengc_remember): check T_NONE and T_ZOMBIE
- if RGENGC_CHECK_MODE > 0.
+ * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
-Wed Jun 19 07:02:19 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): tmp_dh_callback should
+ always be set, so we can remove this conditional
- * gc.c (RGENGC_CHECK_MODE): add new check mode `3'.
- In this mode, show all references if there is
- a miss-corrected object.
+Sun Jul 26 06:22:24 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Wed Jun 19 06:31:08 2013 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_pair.rb: add a test ensuring that the default DH
+ callback is used when no DH callback is specified.
- * gc.c (gc_stress_set): add special option of GC.stress.
- `GC.stress=(flag)' accepts integer to control behavior of GC.
- See code for details. Of course, this feature is only for MRI.
+Sun Jul 26 04:08:27 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- You can debug RGenGC (WB) using `GC.stress = 1'.
- Using this option, do minor marking at all possible places.
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add missing
+ instance variables to squash warnings with alpn.
- GC::STRESS_MINOR_MARK = 1 and GC::STRESS_LAZY_SWEEP = 2
- seem good to add.
+Sun Jul 26 03:42:19 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Wed Jun 19 06:29:31 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
+ OpenSSL::SSL::SSLContext#initialize implementation to pure Ruby.
- * vm.c (kwmerge_i): add WB.
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): ditto
-Wed Jun 19 06:26:49 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
- * hash.c: `st_update()' also has same issue of last fix.
- write barriers at callback function are too early.
- All write barriers are executed after `st_update()'
+Sat Jul 25 21:03:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 19 04:33:22 2013 Koichi Sasada <ko1@atdot.net>
+ * random.c (fill_random_bytes_syscall): get rid of blocking when
+ no entropy is available. based on the patch by mame in
+ [ruby-core:70114]. [Bug #11395]
- * variable.c (rb_const_set): fix WB miss.
+Sat Jul 25 11:05:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- WBs had located before creating reference between a klass
- and constant value. It causes GC bug.
+ * string.c (str_replace_shared_without_enc): fill the terminator
+ of embedded strings in wide char encodings.
- # pseudo code:
- WB(klass, value); # WB and remember klass
- st_insert(klass->const_table, const_id, value);
+Sat Jul 25 06:38:36 2015 Koichi Sasada <ko1@atdot.net>
- `st_insert()' can cause GC before inserting `value' and
- forget `klass' from the remember set. After that, relationship
- between `klass' and `value' are created with constant table.
- Now, `value' can be young (shady) object and `klass' can be old
- object, without remembering `klass' object.
- At the next GC, old `klass' object will be skipped and
- young (shady) `value' will be miss-collected. -> GC bug
+ * vm_core.h: size should be unsigned.
+ * rb_call_info_t::index
+ * rb_iseq_constant_body::stack_max
+ * rb_iseq_constant_body::local_size
+ * rb_iseq_constant_body::param::size
+ * rb_iseq_constant_body::local_table_size
+ * rb_iseq_constant_body::is_size
+ * rb_iseq_constant_body::callinfo_size
- Lesson: The place of a WB is important.
+ * iseq.h: same for iseq_catch_table::size.
-Tue Jun 18 22:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * compile.c: catch up these fix.
- * vm_insnhelper.c (vm_call_method): ensure methods of type
- VM_METHOD_TYPE_ATTR_SET are called with 1 argument
-
- * test/ruby/test_module.rb
- (TestModule#test_attr_writer_with_no_arguments): add test
- [ruby-core:55543] [Bug #8540]
-
-Tue Jun 18 22:36:23 2013 Masaya Tarui <tarui@ruby-lang.org>
-
- * gc.c (gc_profile_record_flag): fix typo.
-
-Tue Jun 18 22:08:53 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * ext/objspace/object_tracing.c: Return for ::allocation_generation
-
-Tue Jun 18 22:04:35 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * ext/objspace/object_tracing.c: Document object_tracing methods.
-
-Tue Jun 18 21:58:17 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * gc.c: Rename rb_mObSpace -> rb_mObjSpace
-
-Tue Jun 18 20:55:05 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * ext/objspace/objspace.c: Document ObjectSpace::InternalObjectWrapper.
-
-Tue Jun 18 20:39:04 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * ext/objspace/object_tracing.c: Teach rdoc object_tracing.c [Bug #8537]
-
-Tue Jun 18 20:29:47 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * ext/.document: add object_tracing.c to document file
-
-Tue Jun 18 20:20:27 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * ext/objspace/objspace.c: rdoc on require to overview from r41355
-
-Tue Jun 18 18:39:58 2013 Tanaka Akira <akr@fsij.org>
-
- * configure.in: Check __int128.
-
- * include/ruby/defines.h (BDIGIT_DBL): Use uint128_t if it is available.
- (BDIGIT): Use uint64_t if uint128_t is available.
- (SIZEOF_BDIGITS): Defined for above case.
- (BDIGIT_DBL_SIGNED): Ditto.
- (PRI_BDIGIT_PREFIX): Ditto.
-
- * include/ruby/ruby.h (PRI_64_PREFIX): Defined.
-
- * bignum.c (rb_big_pow): Don't use BITSPERDIG for the condition which
- rb_big_pow returns Float or Bignum.
-
- [ruby-dev:47413] [Feature #8509]
-
-Tue Jun 18 16:43:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_heredoc_restore): clear lex_strterm always to get
- rid of marking recycled node. this bug is revealed by r41372 with
- GC.stress=true.
-
-Tue Jun 18 12:53:25 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (nlz): Cast the result explicitly.
- (big2dbl): Don't assign BDIGIT values to int variable.
-
-Tue Jun 18 12:25:16 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (rb_big_xor): Non-effective code removed.
-
-Tue Jun 18 11:26:05 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_stat): add `generated_normal_object_count_types' for
- RGENGC_PROFILE >= 2.
-
-Tue Jun 18 11:02:18 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_maybe): check to skip T_NONE.
-
- * gc.c (markable_object_p): do not need to check (flags == 0) here.
-
-Tue Jun 18 10:17:37 2013 Koichi Sasada <ko1@atdot.net>
-
- * variable.c (rb_autoload): fix WB miss.
-
-Tue Jun 18 04:20:18 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_children): don't need to care about T_ZOMBIE here.
-
-Mon Jun 17 22:16:02 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * test/ruby/test_proc.rb (TestProc#test_block_given_method_to_proc):
- run test for r41359.
-
-Mon Jun 17 21:42:18 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * include/ruby/ruby.h, vm_eval.c (rb_funcall_with_block):
- new function to invoke a method with a block passed
- as an argument.
-
- * string.c (sym_call): use the above function to avoid
- a block sharing. [ruby-dev:47438] [Bug #8531]
-
- * vm_insnhelper.c (vm_yield_with_cfunc): don't set block
- in the frame.
-
- * test/ruby/test_symbol.rb (TestSymbol#test_block_given_to_proc):
- run related tests.
-
-Mon Jun 17 21:33:27 2013 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * include/ruby/intern.h, proc.c (rb_method_call_with_block):
- new function to invoke a Method object with a block passed
- as an argument.
-
- * proc.c (bmcall): use the above function to avoid a block sharing.
- [ruby-core:54626] [Bug #8341]
-
- * test/ruby/test_proc.rb (TestProc#test_block_persist_between_calls):
- run related tests.
-
-Mon Jun 17 20:53:21 2013 Tanaka Akira <akr@fsij.org>
-
- * loadpath.c (RUBY_REVISION): Defined to suppress revision.h
- inclusion actually. r41352 removes the dependency.
-
-Mon Jun 17 18:15:57 2013 Benoit Daloze <eregontp@gmail.com>
-
- * ext/objspace/objspace.c: let rdoc know about objspace methods.
- Specify 'objspace' should be required. See #8537.
-
-Mon Jun 17 17:44:31 2013 Benoit Daloze <eregontp@gmail.com>
-
- * gc.c (ObjectSpace): is a module not a class.
-
- * ext/objspace/objspace.c: try to include overview in rdoc,
- see #8537.
-
-Mon Jun 17 17:38:24 2013 Benoit Daloze <eregontp@gmail.com>
-
- * gc.c: fix example of ObjectSpace.define_finalizer in overview
-
-Mon Jun 17 16:59:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tkutil/tkutil.c: use rb_sprintf(), rb_id2str(), and
- rb_intern_str() instead of rb_intern() and RSTRING_PTR() with
- RB_GC_GUARD(), to prevent temporary objects from GC.
- [ruby-core:39000] [Bug #5199]
-
-Mon Jun 17 14:27:54 2013 Zachary Scott <zachary@zacharyscott.net>
-
- * vm_backtrace.c: Update rdoc for Backtrace#label with @_ko1
-
-Mon Jun 17 13:04:01 2013 Akinori MUSHA <knu@iDaemons.org>
-
- * tool/ifchange (until): Fix the condition, although harmless in
- this case.
-
-Mon Jun 17 11:50:29 2013 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_maybe): added. check `is_pointer_to_heap()' and
- type is not T_ZOMBIE.
-
- * gc.c: use `gc_mark_maybe()'. T_ZOMBIE objects should not be pushed
- to the mark stack.
-
-Mon Jun 17 07:56:24 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bary_small_lshift): Renamed from bdigs_small_lshift.
- (bary_small_rshift): Renamed from bdigs_small_rshift.
-
-Mon Jun 17 07:38:48 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (absint_numwords_bytes): Removed.
- (rb_absint_numwords): Don't call absint_numwords_bytes.
-
-Sun Jun 16 23:14:58 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (BARY_ADD): New macro.
- (BARY_SUB): Ditto.
- (BARY_MUL): Ditto.
- (BARY_DIVMOD): Ditto.
- (BARY_ZERO_P): Ditto.
- (absint_numwords_generic): Use these macros.
-
-Sun Jun 16 21:41:39 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bary_2comp): Extracted from get2comp.
- (integer_unpack_num_bdigits): Extracted from
- rb_integer_unpack_internal.
- (bary_unpack_internal): Renamed from bary_unpack and support
- INTEGER_PACK_2COMP.
- (bary_unpack): New function to validate arguments and invoke
- bary_unpack_internal.
- (rb_integer_unpack_internal): Removed.
- (rb_integer_unpack): Invoke bary_unpack_internal.
- (rb_integer_unpack_2comp): Removed.
-
- * internal.h (rb_integer_unpack_2comp): Removed.
-
- * pack.c: Follow the above change.
-
-Sun Jun 16 18:41:42 2013 Tanaka Akira <akr@fsij.org>
-
- * internal.h (INTEGER_PACK_2COMP): Defined.
- (rb_integer_pack_2comp): Removed.
-
- * bignum.c (bary_pack): Support INTEGER_PACK_2COMP.
- (rb_integer_pack): Invoke bary_pack directly.
- (rb_integer_pack_2comp): Removed.
- (rb_integer_pack_internal): Ditto.
- (absint_numwords_generic): Follow the above change.
-
- * pack.c (pack_pack): Ditto.
-
- * sprintf.c (rb_str_format): Ditto.
-
-Sun Jun 16 17:48:14 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (absint_numwords_generic): rb_funcall invocations removed.
-
-Sun Jun 16 16:04:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/config_files.rb: use URI.read to allow it runs with Ruby 1.8.5.
-
-Sun Jun 16 14:32:25 2013 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (bary_pack) Extracted from rb_integer_pack_internal.
- (absint_numwords_generic): Use bary_pack.
-
-Sun Jun 16 11:01:57 2013 Kouhei Sutou <kou@cozmixng.org>
-
- * NEWS (XMLRPC::Client#http): Add.
- [ruby-core:55197] [Feature #8461]
+ * iseq.c: ditto.
-Sun Jun 16 10:38:45 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c: ditto.
- * bignum.c (bary_add): New function.
- (bary_zero_p): Extracted from bigzero_p.
- (absint_numwords_generic): Use bary_zero_p and bary_add.
- (bary_mul): Fix an argument for bary_mul_single.
- (bary_divmod): Use size_t for arguments.
+ * vm.c: ditto.
-Sun Jun 16 08:55:22 2013 Tanaka Akira <akr@fsij.org>
+ * vm_args.c: ditto.
- * bignum.c (bigdivrem): Use a BDIGIT variable to store the return
- value of bigdivrem_single.
+ * vm_eval.c: ditto.
-Sun Jun 16 08:43:59 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c: ditto.
- * bignum.c (bary_divmod): New function.
- (absint_numwords_generic): Use bary_divmod.
- (bigdivrem_num_extra_words): Extracted from bigdivrem.
- (bigdivrem_single): Ditto.
- (bigdivrem_normal): Ditto.
- (BIGDIVREM_EXTRA_WORDS): Defined.
+Sat Jul 25 06:00:09 2015 Koichi Sasada <ko1@atdot.net>
-Sun Jun 16 05:51:51 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * vm_core.h: constify rb_iseq_constant_body::line_info_table.
- * gc.c: Fixup around GC by MALLOC.
- Add allocate size to malloc_increase before GC
- for updating limit in after_gc_sweep.
- Reset malloc_increase into garbage_collect()
- for preventing GC again soon.
+ * iseq.c: catch up this fix.
-Sun Jun 16 05:15:36 2013 Masaya Tarui <tarui@ruby-lang.org>
+Sat Jul 25 05:56:43 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c: Add some columns to more detail profile.
- new columns: Allocated size, Prepare Time, Removing Objects, Empty Objects
+ * vm_core.h: constify rb_iseq_constant_body::param::opt_table and
+ rb_iseq_constant_body::param::keyword.
-Sun Jun 16 02:04:40 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * compile.c: catch up this fix.
- * gc.c (gc_prof_timer_stop): Merge function codes of GC_PROFILE_MORE_DETAIL and !GC_PROFILE_MORE_DETAIL.
- * gc.c (gc_prof_mark_timer_start): Ditto.
- * gc.c (gc_prof_mark_timer_stop): Ditto.
- * gc.c (gc_prof_sweep_slot_timer_start): Ditto.
- * gc.c (gc_prof_sweep_slot_timer_stop): Ditto.
- * gc.c (gc_prof_set_malloc_info): Ditto.
- * gc.c (gc_prof_set_heap_info): Ditto.
+Sat Jul 25 04:47:01 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 15 23:50:24 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h: constify rb_iseq_constant_body::catch_table.
- * bignum.c (bary_sub): New function.
- (absint_numwords_generic): Use bary_sub.
- (bigsub_core): Skip unnecessary copy.
+ * compile.c (iseq_set_exception_table): catch up this fix.
-Sat Jun 15 22:05:30 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c: ditto.
- * bignum.c (bary_mul): New function.
- (absint_numwords_generic): Use bary_mul.
- (bary_mul_single): Extracted from bigmul1_single.
- (bary_mul_normal): Extracted from bigmul1_normal.
+ * vm.c (vm_exec): ditto.
-Sat Jun 15 20:13:46 2013 Tanaka Akira <akr@fsij.org>
+Fri Jul 24 21:29:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (bary_unpack): Extracted from rb_integer_unpack_internal.
- (absint_numwords_generic): Use bary_unpack.
- (roomof): Defined.
- (bdigit_roomof): Defined.
- (BARY_ARGS): Defined.
- (bary_unpack): Declared.
+ * st.c (EQUAL, st_delete_safe): fix arguments order to compare
+ function, searching key is the first and stored key is the
+ second always.
-Sat Jun 15 19:35:04 2013 Tanaka Akira <akr@fsij.org>
+Fri Jul 24 21:27:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (absint_numwords_bytes): Make it static.
- (absint_numwords_small): Ditto.
- (absint_numwords_generic): Ditto.
+ * string.c (fstr_update_callback): fstring must not be a shared
+ string, or the content without RSTRING_FSTR may be freed.
+ [ruby-dev:49188] [Bug #11386]
-Sat Jun 15 17:14:32 2013 Tanaka Akira <akr@fsij.org>
+Fri Jul 24 20:09:43 2015 Naohisa Goto <ngotogenome@gmail.com>
- * bignum.c (bigmul1_normal): Shrink the result Bignum length.
+ * test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6): prevent to use
+ IPv6 loopback interface for
+ Rinda::TestRingFinger#test_make_socket_ipv6_multicast and
+ Rinda::TestRingFinger#test_make_socket_ipv6_multicast_hops.
+ The tests are skipped if there are no IPv6 devices other than the
+ loopback device. [Bug #11394] [ruby-dev:49199]
-Sat Jun 15 10:19:42 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast): ditto
+ for Rinda::TestRingServer#test_make_socket_ipv6_multicast.
- * ext/bigdecimal/bigdecimal.c: Update overview formatting of headers
+ * test/rinda/test_rinda.rb (test_ring_server_ipv6_multicast): ditto
+ for Rinda::TestRingServer#test_ring_server_ipv6_multicast.
-Sat Jun 15 10:19:06 2013 Zachary Scott <zachary@zacharyscott.net>
+Fri Jul 24 16:35:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.gemspec: Update authors
+ * string.c (fstr_update_callback): pool bare strings only.
-Sat Jun 15 10:02:26 2013 Tanaka Akira <akr@fsij.org>
+ * string.c (rb_fstring): return the original string with sharing a
+ fstring if it has extra attributes, not the fstring itself.
+ [ruby-dev:49188] [Bug #11386]
- * bignum.c (bdigs_small_rshift): Extracted from big_rshift.
- (bigdivrem): Use bdigs_small_rshift.
+Fri Jul 24 16:35:34 2015 yui-knk <spiketeika@gmail.com>
-Sat Jun 15 08:37:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rb_file_s_extname): [DOC] add an example.
- * vm_eval.c (eval_string_with_cref): propagate absolute path from the
- binding if it is given explicitly. patch by Gat (Dawid Janczak) at
- [ruby-core:55123]. [Bug #8436]
+ * test/ruby/test_path.rb (test_extname): add tests. [Fix GH-978]
+ * path starts with dot ('.a.rb')
+ * path includes dir name ('a/b/d/test.rb')
+ * path includes dir name and dir name starts with dot
+ ('.a/b/d/test.rb')
-Sat Jun 15 02:40:18 2013 Tanaka Akira <akr@fsij.org>
+Thu Jul 23 18:50:43 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (bdigs_small_lshift): Extracted from big_lshift.
- (bigdivrem): Use bdigs_small_lshift.
+ * vm_core.h: constify rb_iseq_constant_body::local_table and
+ rb_iseq_param_keyword::table and
+ rb_iseq_param_keyword::default_values.
-Fri Jun 14 20:47:41 2013 Tanaka Akira <akr@fsij.org>
+ * compile.c: catch up this fix.
- * bignum.c (bigdivrem): Reduce number of digits before bignew() for div.
+ * iseq.c: ditto.
-Fri Jun 14 20:12:37 2013 Tanaka Akira <akr@fsij.org>
+Thu Jul 23 17:30:43 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (bigdivrem): Use bignew when ny == 1.
+ * vm_core.h: constify rb_iseq_constant_body::iseq_encoded and
+ rb_control_frame_t::pc.
-Fri Jun 14 18:52:51 2013 Koichi Sasada <ko1@atdot.net>
+ * compile.c (rb_iseq_translate_threaded_code): catch up this fix.
- * compile.c (rb_iseq_compile_node): fix location of a `trace'
- instruction (b_return event).
- [ruby-core:55305] [ruby-trunk - Bug #8489]
- (need a backport to 2.0.0?)
+ * iseq.c: ditto.
- * test/ruby/test_settracefunc.rb: add a test.
+ * vm_exec.c (vm_exec_core): ditto.
-Fri Jun 14 18:18:07 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jul 23 10:25:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c, include/ruby/ruby.h: add write barriers for T_CLASS,
- T_MODULE, T_ICLASS.
+ * include/ruby/ruby.h: add raw FL macros, which assume always the
+ argument object is not a special constant.
- * constant.h: constify rb_const_entry_t::value and file to detect
- assignment.
+ * internal.h (STR_EMBED_P, STR_SHARED_P): valid only for T_STRING.
- * variable.c, internal.h (rb_st_insert_id_and_value, rb_st_copy):
- added. update table with write barrier.
+ * string.c: deal with taint flags directly across String instances.
- * method.h: constify some variables to detect assignment.
+Thu Jul 23 09:05:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (init_copy): add WBs.
+ * parse.y (lambda_body): pop cmdarg stack for lookahead
+ token. [ruby-core:70067] [Bug #11380]
- * variable.c: ditto.
+Thu Jul 23 04:03:03 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * vm_method.c (rb_add_method): ditto.
+ * ext/openssl/ossl_ssl.c: fix tests by not setting the instance
+ variable on the frozen ssl instance.
-Fri Jun 14 14:33:47 2013 Shugo Maeda <shugo@ruby-lang.org>
+Thu Jul 23 03:32:26 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * NEWS: add a note for Module#using.
+ * ext/openssl/ossl_ssl.c: add ECDH callback support. [Feature #11356]
-Fri Jun 14 13:40:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_pair.rb: test for ECDH callback support
- * .travis.yml (before_script): update config files.
+Thu Jul 23 03:29:49 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * common.mk ($(srcdir)/tool/config.{guess,sub}): use get-config_files.
+ * ext/openssl/ossl_ssl.c: add ALPN support. [Feature #9390]
- * tool/config_files.rb: split get-config_files.
+ * ext/openssl/extconf.rb: detect ALPN support in OpenSSL
- * common.mk (update-config_files): rule to download config files.
+ * test/openssl/test_ssl.rb: test for ALPN
- * tool/config.guess, tool/config.sub: remove and download from the
- upstream.
+Wed Jul 22 23:44:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/config_files.rb: download config files from GNU.
+ * string.c (rb_str_reverse): reversed string is not a substring,
+ and should not set coderange of the original string.
+ [ruby-dev:49189] [Bug #11387]
-Fri Jun 14 12:21:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 22 20:17:51 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): suppress warnings
- "left-hand operand of comma expression has no effect", on gcc 4.4.
+ * vm_core.h: modify layout of rb_iseq_constant_body.
-Fri Jun 14 09:48:48 2013 Shugo Maeda <shugo@ruby-lang.org>
+ Move frequent accessing fields to upper part.
- * NEWS: add notes for $SAFE.
+Wed Jul 22 19:57:47 2015 Koichi Sasada <ko1@atdot.net>
- * doc/security.rdoc: remove the description of $SAFE=4.
+ * vm_core.h: remove unused declaration of
+ iseq_compile_data_ensure_node_stack.
-Fri Jun 14 00:14:29 2013 Tanaka Akira <akr@fsij.org>
+Wed Jul 22 19:52:45 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (bigdivrem): Zero test condition simplified.
+ * vm_core.h: separate rb_iseq_body into rb_iseq_constant_body and
+ rb_iseq_variable_body (rb_iseq_t::variable_body).
-Thu Jun 13 23:43:11 2013 Zachary Scott <zachary@zacharyscott.net>
+ rb_iseq_variable_body can be modified after compilation.
- * ext/bigdecimal/*: improve documentation, nodoc samples with @mrkn
+ * compile.c: use rb_iseq_t::variable_body.
-Thu Jun 13 23:02:14 2013 Kouhei Sutou <kou@cozmixng.org>
+ * iseq.c: ditto.
- * lib/xmlrpc/client.rb (XMLRPC::Client#http): Add reader for raw
- Net::HTTP. [ruby-core:55197] [Feature #8461]
- Reported by Herwin Weststrate. Thanks!!!
+ * thread.c: ditto.
-Thu Jun 13 22:44:52 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Jul 22 17:50:35 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/xmlrpc/client.rb (XMLRPC::Client#parse_set_cookies): Support
- multiple names in a response. [ruby-core:41711] [Bug #5774]
- Reported by Roman Riha. Thanks!!!
- * test/xmlrpc/test_client.rb (XMLRPC::ClientTest#test_cookie_override):
- Add a test of the above case.
+ * lib/matrix/eigenvalue_decomposition.rb: refine code style.
+ [fix GH-959][ci skip] Patch by @bogdanvlviv
-Thu Jun 13 22:35:50 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Jul 22 15:48:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/xmlrpc/client.rb (XMLRPC::Client#parse_set_cookies): Use
- guard style.
+ * test/ruby/test_range.rb: Add test case for Range#end with
+ exclude_end true case. [fix GH-968] Patch by @yui-knk
-Thu Jun 13 22:12:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 22 09:45:31 2015 Maksim Sitnikov <sitnikovme@undev.ru>
- * lib/fileutils.rb (FileUtils#rmdir): fix traversal loop, not trying
- remove same directory only.
+ * numeric.c (num_coerce): [DOC] fix doc for Numeric#coerce,
+ missing '+'. [Fix GH-974]
-Thu Jun 13 21:30:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 22 07:24:18 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in (opt-dir), tool/ifchange: get rid of "alternate value"
- expansion for legacy sh. [ruby-dev:47420] [Bug #8524]
+ * make rb_iseq_t T_IMEMO object (type is imemo_iseq).
-Thu Jun 13 21:24:09 2013 Tanaka Akira <akr@fsij.org>
+ All contents of previous rb_iseq_t is in rb_iseq_t::body.
+ Remove rb_iseq_t::self because rb_iseq_t is an object.
- * bignum.c (bigdivrem): Refactored to use ALLOCV_N for temporary
- buffers.
+ RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq.
+ So RubyVM::ISeq.of(something) method returns different wrapper
+ objects but they point the same T_IMEMO/iseq object.
-Thu Jun 13 18:54:11 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ This patch is big, but most of difference is replacement of
+ iseq->xxx to iseq->body->xxx.
- * bignum.c (integer_unpack_num_bdigits_generic): reorder terms (but not
- changed the intention of the expression) because VC++ reports a
- warning for it. reported by ko1 via IRC.
+ (previous) rb_iseq_t::compile_data is also located to
+ rb_iseq_t::compile_data.
+ It was moved from rb_iseq_body::compile_data.
-Thu Jun 13 18:53:14 2013 Tanaka Akira <akr@fsij.org>
+ Now rb_iseq_t has empty two pointers.
+ I will split rb_iseq_body data into static data and dynamic data.
- * test/ruby/test_thread.rb (test_thread_local_security): Don't create
- an unused thread.
+ * compile.c: rename some functions/macros.
+ Now, we don't need to separate iseq and iseqval (only VALUE).
-Thu Jun 13 18:34:20 2013 Tanaka Akira <akr@fsij.org>
+ * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
- * bignum.c (bigdivrem): Use nlz.
+ * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
-Thu Jun 13 14:51:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c: check T_IMEMO/iseq.
- * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): check constant safe
- level at compile time.
+ * internal.h: add imemo_type::imemo_iseq.
-Thu Jun 13 14:39:08 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * iseq.c: define RubyVM::InstructionSequence as T_OBJECT.
+ Methods are implemented by functions named iseqw_....
- * test/-ext-/test_printf.rb, test/rss/test_parser.rb,
- test/ruby/test_array.rb, test/ruby/test_hash.rb,
- test/ruby/test_m17n.rb, test/ruby/test_marshal.rb,
- test/ruby/test_object.rb, test/ruby/test_string.rb: don't use
- untrusted?, untrust, and trust to avoid warnings in case $VERBOSE is
- true.
+ * load.c (rb_load_internal0): rb_iseq_new_top() returns
+ rb_iseq_t (T_IMEMO/iesq).
-Thu Jun 13 10:47:16 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
- * bootstraptest/test_autoload.rb, bootstraptest/test_method.rb:
- remove tests for $SAFE=4.
+ * vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
- * lib/pp.rb: use taint instead of untrust to avoid warnings when
- $VERBOSE is set to true.
+ * vm_core.h (struct rb_iseq_body): remove padding for
+ [Bug #10037][ruby-core:63721].
-Thu Jun 13 06:12:18 2013 Tanaka Akira <akr@fsij.org>
+Wed Jul 22 07:15:33 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (integer_unpack_num_bdigits_small): Fix a compile error on
- clang -Werror,-Wshorten-64-to-32
- Reported by Eric Hodel. [ruby-core:55467] [Bug #8522]
+ * ext/objspace/objspace.c (total_i): no need to skip singleton classes.
-Thu Jun 13 05:32:13 2013 Eric Hodel <drbrain@segment7.net>
+Wed Jul 22 06:37:54 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X
- 10.7+. [ruby-trunk - Bug #8517]
+ * vm_core.h: constify rb_call_info_t::kw_arg,
+ rb_control_frame_t::iseq and rb_control_frame_t::block_iseq.
-Thu Jun 13 00:17:18 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c (iseq_free): catch up this fix.
- * bignum.c (rb_integer_unpack_2comp): New function.
- (rb_integer_unpack_internal): Extracted from rb_integer_unpack and
- nlp_bits_ret argument added.
- (integer_unpack_num_bdigits_small): nlp_bits_ret argument added to
- return number of leading padding bits.
- (integer_unpack_num_bdigits_generic): Ditto.
+ * vm.c: ditto.
- * internal.h (rb_integer_unpack_2comp): Declared.
+ * vm_dump.c: ditto.
- * pack.c (pack_unpack): Use rb_integer_unpack_2comp and
- rb_integer_unpack.
+Wed Jul 22 06:25:45 2015 Koichi Sasada <ko1@atdot.net>
-Wed Jun 12 23:27:03 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_core.h: constify rb_call_info_t::blockiseq and rb_block_t::iseq.
- * eval.c (mod_using): new method Module#using, which activates
- refinements of the specified module only in the current class or
- module definition. [ruby-core:55273] [Feature #8481]
+ * vm.c, vm_insnhelper.c: catch up this fix.
- * test/ruby/test_refinement.rb: related test.
+ * iseq.c (iseq_data_to_ary): constify the first iseq parameter.
-Wed Jun 12 22:58:48 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_insnhelper.c (vm_make_proc_with_iseq): ditto.
- * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
- when $SAFE is set to 4. $SAFE=4 is now obsolete.
- [ruby-core:55222] [Feature #8468]
+Wed Jul 22 06:17:35 2015 Koichi Sasada <ko1@atdot.net>
- * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust):
- Kernel#untrusted?, untrust, and trust are now deprecated.
- Their behavior is same as tainted?, taint, and untaint,
- respectively.
+ * method.h: constify rb_method_iseq_t::iseqptr.
- * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED()
- and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(),
- respectively.
+ * proc.c (rb_method_entry_min_max_arity): catch up this fix.
- * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c,
- ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c,
- ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c,
- ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c,
- ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c,
- ext/socket/socket.c, ext/socket/udpsocket.c,
- ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c,
- ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c,
- load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c,
- safe.c, string.c, thread.c, transcode.c, variable.c,
- vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for
- $SAFE=4.
+ * vm_insnhelper.c (def_iseq_ptr): constify.
- * test/dl/test_dl2.rb, test/erb/test_erb.rb,
- test/readline/test_readline.rb,
- test/readline/test_readline_history.rb, test/ruby/test_alias.rb,
- test/ruby/test_array.rb, test/ruby/test_dir.rb,
- test/ruby/test_encoding.rb, test/ruby/test_env.rb,
- test/ruby/test_eval.rb, test/ruby/test_exception.rb,
- test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb,
- test/ruby/test_io.rb, test/ruby/test_method.rb,
- test/ruby/test_module.rb, test/ruby/test_object.rb,
- test/ruby/test_pack.rb, test/ruby/test_rand.rb,
- test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb,
- test/ruby/test_struct.rb, test/ruby/test_thread.rb,
- test/ruby/test_time.rb: remove tests for $SAFE=4.
+Wed Jul 22 03:37:39 2015 Koichi Sasada <ko1@atdot.net>
-Wed Jun 12 22:18:23 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (internal_object_p): Now a singleton classes appear by
+ ObjectSpace.each_object. [Bug #11360]
- * bignum.c (integer_unpack_num_bdigits_generic): Rewritten without
- rb_funcall.
- (integer_unpack_num_bdigits_bytes): Removed.
- (rb_integer_unpack): integer_unpack_num_bdigits_bytes invocation
- removed.
+ * test/ruby/test_objectspace.rb: add a test about it.
-Wed Jun 12 20:18:03 2013 Kouhei Sutou <kou@cozmixng.org>
+Tue Jul 21 21:21:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/xmlrpc/client.rb (XMLRPC::Client#parse_set_cookies): Extract.
+ * thread.c (do_select): replace switch and goto with a loop to
+ suppress maybe-uninitialized warnings by gcc6.
-Wed Jun 12 18:19:41 2013 Tanaka Akira <akr@fsij.org>
+ * thread.c (set_unblock_function, rb_wait_for_single_fd): ditto.
- * bignum.c (validate_integer_pack_format): supported_flags argument
- added and validate given flags.
- (rb_integer_pack_internal): Specify supported_flags.
- (rb_integer_unpack): Ditto.
+Tue Jul 21 20:32:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Jun 12 16:41:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_range.rb: Add test for Range#hash
+ [fix GH-969] Patch by @yui-knk
- * array.c (rb_ary_sort_bang): remove duplicated assertions.
- ARY_HEAP_PTR() implies ary not to be embedded. [ruby-dev:47419]
- [Bug #8518]
+Tue Jul 21 19:43:20 2015 Koichi Sasada <ko1@atdot.net>
-Wed Jun 12 12:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c: constify the first parameter (iseq).
+ * iseq_add_mark_object()
+ * iseq_add_mark_object_compile_time()
- * io.c (io_getc): fix 7bit coderange condition, check if ascii read
- data instead of read length. [ruby-core:55444] [Bug #8516]
+ * iseq.c, iseq.h (rb_iseq_add_mark_object): ditto.
-Wed Jun 12 12:35:13 2013 Tanaka Akira <akr@fsij.org>
+Tue Jul 21 16:18:48 2015 Eric Wong <e@80x24.org>
- * pack.c (pack_pack): Use rb_integer_pack_2comp.
+ * test/socket/test_nonblock.rb: increase buffer sizes
+ to OpenBSD limits. Thanks to Jeremy Evans <code@jeremyevans.net>
+ [ruby-core:70058]
-Wed Jun 12 12:07:04 2013 Tanaka Akira <akr@fsij.org>
+Tue Jul 21 16:08:53 2015 Eric Wong <e@80x24.org>
- * sprintf.c (rb_str_format): Fix a dynamic format string.
+ * load.c (ruby_dln_librefs): make static
-Wed Jun 12 12:04:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 21 13:36:54 2015 yuuji.yaginuma <yuuji.yaginuma@gmail.com>
- * array.c (rb_ary_uniq_bang): must not be modified once frozen even in
- a callback method.
+ * lib/optparse.rb (complete): [DOC] fix typo. [Fix GH-973]
-Wed Jun 12 12:03:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 21 05:20:21 2015 Eric Wong <e@80x24.org>
- * array.c (rb_ary_sort_bang): must not be modified once frozen even in
- a callback method.
+ * io.c (nogvl_wait_for_single_fd): new function for Linux
+ (maygvl_copy_stream_wait_read): Linux-specific version
+ (nogvl_copy_stream_wait_write): use nogvl_wait_for_single_fd
+ [ruby-core:70051] [Feature #11377]
-Wed Jun 12 12:00:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 20 15:04:30 2015 Eric Wong <e@80x24.org>
- * array.c (FL_SET_EMBED): shared object is frozen even when get
- unshared.
+ * parse.y (parser_initialize): avoid redundant zero-ing
- * array.c (rb_ary_modify): ARY_SET_CAPA needs unshared array.
+Mon Jul 20 12:12:05 2015 Eric Wong <e@80x24.org>
-Wed Jun 12 07:32:01 2013 Tanaka Akira <akr@fsij.org>
+ * parse.y (struct parser_params): pack: 88 => 256 bytes on 64-bit
+ [ruby-core:70034] [Feature #11371]
- * random.c (rand_int): Use rb_big_uminus.
+Sun Jul 19 14:29:18 2015 windwiny <windwiny.ubt@gmail.com>
-Wed Jun 12 07:12:54 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/pty/pty.c: [DOC] fix example typo, an old name at move from
+ PTY.open. [Fix GH-972]
- * struct.c: Improve documentation: replace "instance variable" with
- "member", recommend the use of a block to customize structs, note
- that member accessors are created, general cleanup.
+Sat Jul 18 21:29:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 12 06:35:01 2013 Tanaka Akira <akr@fsij.org>
+ * thread.c (vm_check_ints_blocking): gather common statements at
+ the end, and prefer LIKELY for Visual C optimization.
- * internal.h (INTEGER_PACK_NEGATIVE): Defined.
- (rb_integer_unpack): sign argument removed.
+Sat Jul 18 20:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_integer_unpack): sign argument removed.
- Non-negative integers generated by default.
- INTEGER_PACK_NEGATIVE flag is used to generate non-positive integers.
+ * load.c (rb_load_internal0): do not raise any exceptions but
+ return the result tag state.
- * pack.c (pack_unpack): Follow the above change.
+ * load.c (rb_load_protect): reduce nested EXEC_TAGs.
- * random.c (int_pair_to_real_inclusive): Ditto.
- (make_seed_value): Ditto.
- (mt_state): Ditto.
- (limited_big_rand): Ditto.
+Sat Jul 18 19:52:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * marshal.c (r_object0): Ditto.
+ * gc.c (run_finalizer): set and restore safe level here to reduce
+ nested EXEC_TAGs.
-Wed Jun 12 00:07:46 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Jul 18 18:45:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/xmlrpc/test_client.rb (XMLRPC::ClientTest#test_cookie_simple):
- Add a test for the extracted method.
+ * eval.c (ruby_cleanup): error_handle() returns exit status to the
+ system, not internal error state, do not convert the exit status
+ again.
-Tue Jun 11 23:56:24 2013 Kouhei Sutou <kou@cozmixng.org>
+Sat Jul 18 10:29:03 2015 Eric Wong <e@80x24.org>
- * test/xmlrpc/test_client.rb (XMLRPC::ClientTest::Fake::HTTP#started):
- Add a missing empty line.
+ * test/ruby/test_process.rb: test thread+sigs work after failed exec
-Tue Jun 11 23:37:19 2013 Tanaka Akira <akr@fsij.org>
+Sat Jul 18 07:20:18 2015 Jeremy Evans <code@jeremyevans.net>
- * bignum.c (validate_integer_pack_format): Don't require a word order
- flag if numwords is 1 or less.
- (absint_numwords_generic): Don't specify a word order for
- rb_integer_pack.
+ * test/socket/test_nonblock: use smaller buffer for sendmsg
+ [ruby-core:70016] [Bug #11364]
- * hash.c (rb_hash): Ditto.
+Sat Jul 18 07:04:24 2015 Eric Wong <e@80x24.org>
- * time.c (v2w_bignum): Ditto.
+ * signal.c (trap_handler): cleanup to use RSTRING_GETMEM + memcmp
-Tue Jun 11 23:01:57 2013 Tanaka Akira <akr@fsij.org>
+Sat Jul 18 02:53:06 2015 Eric Wong <e@80x24.org>
- * bignum.c (validate_integer_pack_format): Refine error messages.
+ * io.c (argf_read_nonblock): support `exception: false'
+ (io_nonblock_eof): new function
+ (io_read_nonblock): use io_nonblock_eof
+ (argf_getpartial): accept kwargs hash for `exception: false'
+ * test/ruby/test_argf.rb (test_read_nonblock): new test
+ * NEWS: add item for ARGF.read_nonblock
+ [ruby-core:70000] [Feature #11358]
-Tue Jun 11 22:25:04 2013 Tanaka Akira <akr@fsij.org>
+Fri Jul 17 23:51:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (validate_integer_pack_format): numwords argument added.
- Move a varidation from rb_integer_pack_internal and rb_integer_unpack.
- (rb_integer_pack_internal): Follow above change.
- (rb_integer_unpack): Ditto.
+ * vm_eval.c (rb_eval_cmd): $SAFE=4 has been deprecated.
-Tue Jun 11 20:52:43 2013 Tanaka Akira <akr@fsij.org>
+Fri Jul 17 22:18:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_integer_pack_internal): Renamed from rb_integer_pack
- and overflow_2comp argument added.
- (rb_integer_pack): Just call rb_integer_pack_internal.
- (rb_integer_pack_2comp): New function.
+ * compile.c (iseq_compile_each): use enum ruby_tag_type names.
- * internal.h (rb_integer_pack_2comp): Declared.
+ * vm_core.h (ruby_tag_type): move from eval_intern.h for compiling
+ break/next/redo/return.
- * sprintf.c (rb_str_format): Use rb_integer_pack and
- rb_integer_pack_2comp to format binary/octal/hexadecimal integers.
- (ruby_digitmap): Declared.
- (remove_sign_bits): Removed.
- (BITSPERDIG): Ditto.
- (EXTENDSIGN): Ditto.
+Fri Jul 17 15:39:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 11 16:15:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/encoding.h (ENC_CODERANGE_CLEAN_P): predicate that
+ tells if the coderange is clean, that is 7bit or valid, and no
+ needs to scrub.
- * array.c (ary_shrink_capa): shrink the capacity so it fits just with
- the length.
+ * re.c (rb_reg_expr_str): use ENC_CODERANGE_CLEAN_P.
- * array.c (ary_make_shared): release never used elements from frozen
- array to be shared. [ruby-dev:47416] [Bug #8510]
+ * string.c (enc_strlen, rb_enc_cr_str_buf_cat, rb_str_scrub):
+ ditto.
-Tue Jun 11 12:49:01 2013 Zachary Scott <zachary@zacharyscott.net>
+ * string.c (rb_str_enumerate_chars): ditto, and suppress a warning
+ by gcc6.
- * doc/re.rdoc: Rename to doc/regexp.rdoc
- * re.c: Update rdoc include for rename of file
+Fri Jul 17 15:36:52 2015 yui-knk <spiketeika@gmail.com>
-Tue Jun 11 07:13:13 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * test/ruby/test_range.rb (test_first_last): Add test for
+ `Range.new`. [Fix GH-971]
- * eval_error.c (error_print): keep that errat is non-shady object.
- and guard errat from GC.
+Fri Jul 17 15:36:40 2015 yui-knk <spiketeika@gmail.com>
-Tue Jun 11 05:04:25 2013 Benoit Daloze <eregontp@gmail.com>
+ * test/ruby/test_range.rb (test_first_last): Add assertions to
+ test of `Range#last` with exclude_end true case. [Fix GH-970]
- * ext/racc/cparse/cparse.c: use rb_ary_entry() and
- rb_ary_subseq() instead of RARRAY_PTR.
- Based on a patch by Dirkjan Bussink. See Bug #8399.
+Fri Jul 17 09:59:14 2015 Eric Wong <e@80x24.org>
-Mon Jun 10 23:51:51 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * thread.c (rb_thread_alone): simplify
- * array.c (rb_ary_new_from_values): fix a typo. pointed out by
- nagachika.
- http://d.hatena.ne.jp/nagachika/20130610/ruby_trunk_changes_41199_41220
+Fri Jul 17 09:58:32 2015 Eric Wong <e@80x24.org>
-Mon Jun 10 21:51:03 2013 Kouhei Sutou <kou@cozmixng.org>
+ * lib/rinda/tuplespace.rb: remove enumerator require
+ * test/pathname/test_pathname.rb: ditto
- * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Fix indent.
+Fri Jul 17 05:33:58 2015 Eric Wong <e@80x24.org>
-Mon Jun 10 21:49:43 2013 Kouhei Sutou <kou@cozmixng.org>
+ * iseq.c (rb_iseq_compile_with_option): reuse result of previous
+ GET_THREAD() call
+ * thread.c (thread_create_core): ditto
+ (rb_mutex_trylock): ditto
+ (rb_mutex_lock): ditto
+ * process.c (rb_waitpid): avoid multiple eval from RUBY_VM_CHECK_INTS
+ * thread.c (rb_thread_check_ints): ditto
- * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Add missing return
- value assignment.
+Thu Jul 16 19:12:30 2015 Eric Wong <e@80x24.org>
-Mon Jun 10 20:58:11 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c (mutex_alloc): remove needless volatile
- * ext/socket/raddrinfo.c (nogvl_getaddrinfo): work around for Ubuntu
- 13.04's getaddrinfo issue with mdns4. [ruby-list:49420]
+Thu Jul 16 22:05:29 2015 Koichi Sasada <ko1@atdot.net>
-Mon Jun 10 19:34:39 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h: constify rb_iseq_t::parent_iseq.
- * bignum.c (rb_integer_pack): Returns sign instead of words.
- (absint_numwords_generic): Follow the above change.
- (big2str_base_powerof2): Follow the above change.
+ rb_iseq_t::local_iseq is not constant data because
+ local_iseq::flip_cnt can be modified (commented).
- * internal.h: Ditto.
+ * compile.c: catch up this fix.
- * hash.c (rb_hash): Ditto.
+ * iseq.c: ditto.
- * pack.c (pack_pack): Ditto.
+ * vm_insnhelper.c: ditto.
- * random.c (int_pair_to_real_inclusive): Ditto.
- (rand_init): Ditto.
- (random_load): Ditto.
- (limited_big_rand): Ditto.
+Thu Jul 16 21:47:47 2015 Naohisa Goto <ngotogenome@gmail.com>
- * time.c (v2w_bignum): Ditto.
+ * process.c (redirect_dup2): when the new FD of dup2() conflicts
+ with one of the timer thread FDs, the internal FD is diverted.
+ [Bug #11336] [ruby-core:69886] [Bug #11350] [ruby-core:69961]
-Mon Jun 10 17:20:01 2013 Koichi Sasada <ko1@atdot.net>
+ * process.c (dup2_with_divert): new function for the above purpose.
- * gc.c (rgengc_remember): permit promoted object.
- (rb_gc_writebarrier -> remember)
+ * thread_pthread.c (rb_divert_reserved_fd): new function for
+ diverting reserved FD. If the given FD is the same as one of the
+ reserved FDs, the reserved FD number is internally changed.
+ It returns -1 when error. Otherwise, returns 0. It also returns
+ 0 if there is no need to change reserved FD number.
-Mon Jun 10 17:14:01 2013 Koichi Sasada <ko1@atdot.net>
+ * thread_win32.c (rb_divert_reserved_fd): always returns 0 because
+ of no reserved FDs.
- * gc.c (RVALUE_PROMOTE): fix parameter name (`x' to `obj')
- and make it inline function (like RVALUE_PROMOTE).
+ * internal.h (rb_divert_reserved_fd): prototype declaration.
+ It is Ruby internal use only.
-Mon Jun 10 16:22:50 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jul 16 21:47:46 2015 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_new_from_values): add assertion
- (ary should be young object).
+ * iseq.c (rb_iseq_disasm): rename rb_iseq_t *iseqdat to iseq
+ and VALUE *iseq to code.
-Mon Jun 10 16:05:59 2013 Koichi Sasada <ko1@atdot.net>
+ * iseq.c (rb_iseq_disasm_insn): ditto.
- * gc.c (wmap_mark): check allocation of `w->obj2wmap'.
- (no-allocation `w->obj2wmap' will be NULL pointer reference)
+Thu Jul 16 14:34:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 10 15:36:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (REWIND_CFP): keep the arguments region inside the valid
+ value stack. [ruby-core:69969] [Bug #11352]
- * eval_error.c (error_print): use checking functions instead of
- catching exceptions.
+Thu Jul 16 11:38:21 2015 Eric Wong <e@80x24.org>
- * eval_error.c (error_print): restore errinfo for the case new
- exception raised while printing the message. [ruby-core:55365]
- [Bug #8501]
+ * process.c (close_unless_reserved): declare type of `fd' arg
- * eval_error.c (error_print): reduce calling setjmp.
+Thu Jul 16 08:47:29 2015 Eric Wong <e@80x24.org>
-Mon Jun 10 12:10:06 2013 Tanaka Akira <akr@fsij.org>
+ * load.c (rb_construct_expanded_load_path): fstring expanded path
+ (get_loaded_features_index): fstring feature path
+ (rb_provide_feature): ditto
+ [ruby-core:69871] [Feature #11331]
- * bignum.c (integer_unpack_num_bdigits_small: Extracted from
- rb_integer_unpack.
- (integer_unpack_num_bdigits_generic): Ditto.
- (integer_unpack_num_bdigits_bytes): New function.
- (rb_integer_unpack): Use above functions.
- Return a Bignum for INTEGER_PACK_FORCE_BIGNUM even when the result
- is zero.
+Thu Jul 16 02:56:14 2015 Eric Wong <e@80x24.org>
-Mon Jun 10 05:38:23 2013 Tanaka Akira <akr@fsij.org>
+ * thread.c (thread_initialize): avoid RSTRING_PTR and NUMT2INT
- * bignum.c (absint_numwords_small): New function.
- (absint_numwords_generic): Use absint_numwords_small if possible.
+Thu Jul 16 01:00:46 2015 Naohisa Goto <ngotogenome@gmail.com>
-Mon Jun 10 01:07:57 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_process.rb (test_exec_close_reserved_fd): test for
+ [Bug #11353]
- * bignum.c (absint_numwords_bytes): New function.
- (absint_numwords_generic): Extracted from rb_absint_numwords.
- (rb_absint_numwords): Use absint_numwords_bytes if possible.
+Thu Jul 16 00:35:42 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sun Jun 9 21:33:15 2013 Tanaka Akira <akr@fsij.org>
+ * .gitignore: ignore version.i.
- * bignum.c (rb_absint_numwords): Return (size_t)-1 when overflow.
- Refine variable names.
- (rb_absint_size): Refine variable names.
+Wed Jul 15 23:40:32 2015 Naohisa Goto <ngotogenome@gmail.com>
- * internal.h (rb_absint_size): Refine an argument name.
- (rb_absint_numwords): Ditto.
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ use RUBY (= EnvUtil.rubybin)
-Sun Jun 9 16:51:41 2013 Tanaka Akira <akr@fsij.org>
+Wed Jul 15 23:01:22 2015 Naohisa Goto <ngotogenome@gmail.com>
- * bignum.c (rb_absint_numwords): Renamed from rb_absint_size_in_word.
+ * process.c (redirect_close, parent_redirect_close): should not close
+ reserved FD. It should be closed in the exec system call due to the
+ O_CLOEXEC or FD_CLOEXEC flag. [Bug #11353] [ruby-core:69977]
- * internal.h (rb_absint_numwords): Follow the above change.
+ * process.c (close_unless_reserved): new function to close FD unless
+ it is reserved for internal communication.
- * pack.c (pack_pack): Ditto.
+ * thread_pthread.c (rb_reserved_fd_p): should check owner_process pid
+ to avoid false positive in forked child process.
- * random.c (rand_init): Ditto.
- (limited_big_rand): Ditto.
+Wed Jul 15 18:31:18 2015 Eric Wong <e@80x24.org>
-Sun Jun 9 14:41:05 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c (proc_mark): remove redundant check
+ * vm.c (env_mark): ditto
- * bignum.c (rb_integer_pack): numwords_allocated argument removed.
+Wed Jul 15 17:27:40 2015 Eric Wong <e@80x24.org>
- * internal.h (rb_integer_pack): Follow the above change.
+ * iseq.c (iseq_mark): remove check for data pointer
+ * proc.c (binding_mark): ditto
+ * vm.c (rb_thread_mark): ditto
+ * vm_trace.c (tp_mark): ditto
- * hash.c (rb_hash): Ditto.
+Wed Jul 15 16:55:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (v2w_bignum): Ditto.
+ * encoding.c (enc_autoload): drop dummy encoding flag from
+ the loaded encoding index. this flag is used only in this
+ source.
- * pack.c (pack_pack): Ditto.
+Wed Jul 15 14:39:29 2015 Koichi Sasada <ko1@atdot.net>
- * random.c (int_pair_to_real_inclusive): Ditto.
- (rand_init): Ditto.
- (random_load): Ditto.
- (limited_big_rand): Ditto.
+ * vm.c (vm_make_env_each): add comments about env layout.
+ Do not use `i' to specify `new_ep'.
-Sun Jun 9 09:34:44 2013 Tanaka Akira <akr@fsij.org>
+ * vm.c (rb_proc_create, rb_vm_make_proc_lambda): envval is not used.
- * bignum.c (big2str_base_powerof2): New function.
- (rb_big2str0): Use big2str_base_powerof2 if base is 2, 4, 8, 16 or 32.
+Wed Jul 15 08:59:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 9 00:59:04 2013 Tanaka Akira <akr@fsij.org>
+ * gc.h (RUBY_MARK_UNLESS_NULL): evaluate the argument only once
+ to get rid of inadvertent side effects.
- * hash.c (rb_hash): Use rb_integer_pack to obtain least significant
- long integer.
+Wed Jul 15 02:53:11 2015 Koichi Sasada <ko1@atdot.net>
-Sat Jun 8 23:56:00 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h, vm.c: remove rb_proc_t::envval because we can know it via
+ rb_proc_t::block::ep.
- * numeric.c (rb_num_to_uint): Use rb_absint_size instead of
- RBIGNUM_LEN.
+ rb_vm_proc_envval(const rb_proc_t *proc) returns an Env object which
+ the Proc object use.
-Sat Jun 8 22:53:45 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c: catch up this fix.
- * marshal.c (r_object0): Use rb_integer_unpack.
+ * vm_dump.c (rb_vmdebug_proc_dump_raw): ditto.
-Sat Jun 8 22:18:57 2013 Tanaka Akira <akr@fsij.org>
+Wed Jul 15 02:27:22 2015 Koichi Sasada <ko1@atdot.net>
- * time.c (v2w): Use rb_absint_size instead of RBIGNUM_LEN.
+ * vm_core.h, vm.c: remove rb_env_t::prev_envval because we can know it
+ via env->ep.
-Sat Jun 8 21:47:33 2013 Tanaka Akira <akr@fsij.org>
+ rb_vm_env_prev_envval(env) returns prev_envval via env->ep.
- * time.c (v2w_bignum): Simplified using rb_integer_pack.
- (rb_big_abs_find_maxbit): Removed.
+ * vm_core.h (rb_vm_env_local_variables): change parameter type
+ from VALUE (T_DATA/env) to `const rb_env_t *' to make same as
+ rb_vm_env_prev_envval().
-Sat Jun 8 21:03:40 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c: catch up these changes.
- * bignum.c (rb_absint_singlebit_p): New function.
+ * vm_dump.c: ditto.
- * internal.h (rb_absint_singlebit_p): Declared.
+ * vm.c: rename macros.
- * time.c (v2w_bignum): Use rb_absint_singlebit_p instead of
- rb_big_abs_find_minbit.
- (rb_big_abs_find_minbit): Removed.
+ * ENV_IN_HEAP_P() to VM_EP_IN_HEAP_P() because it uses ep.
+ * ENV_VAL() to VM_ENV_EP_ENVVAL() because it is too short.
-Sat Jun 8 20:24:23 2013 Tanaka Akira <akr@fsij.org>
+Wed Jul 15 01:09:09 2015 Koichi Sasada <ko1@atdot.net>
- * time.c (rb_big_abs_find_maxbit): Use rb_absint_size.
- (bdigit_find_maxbit): Removed.
+ * vm.c: refactoring Proc/Env related code.
-Sat Jun 8 19:47:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * vm_core.h: remove blockprocval field from rb_proc_t and rb_binding_t.
+ Instead of this field, mark given block in Proc at rb_env_t::env.
- * class.c (include_modules_at): invalidate method cache if included
- module contains constants
+ * vm.c (vm_make_env_each): make an Env object with this layout.
+ And also simplify parameters.
- * test/ruby/test_module.rb: add test
+ * proc.c: catch up this fix.
-Sat Jun 8 19:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * vm_core.h: remove rb_env_t::local_size because it is not used.
- * random.c (limited_big_rand): declare rnd, lim and mask as uint32_t
- to avoid 64 bit to 32 bit shorten warnings.
+ * vm_dump.c (rb_vmdebug_env_dump_raw): catch up this fix.
-Sat Jun 8 19:23:53 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_core.h (rb_vm_make_env_object): remove rb_vm_make_env_object()
+ because it is only referred from vm.c.
- * win32/Makefile.sub: r41163 changed win32/win32.c and configure.in
- but it didn't treat about mswin32/mswin64, so fix it.
- NOTE: this needs a review by usa whether additional condition is
- required or not.
+ * vm_eval.c (eval_string_with_cref): catch up this fix.
-Sat Jun 8 19:06:26 2013 Tanaka Akira <akr@fsij.org>
+Wed Jul 15 00:03:36 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * random.c: Unused RBignum internal accessing macros removed.
+ * gc.c (__has_feature): move into internal.h.
-Sat Jun 8 19:04:15 2013 Tanaka Akira <akr@fsij.org>
+ * internal.h (__has_feature): ditto.
- * random.c (limited_big_rand): The argument, limit, is changed to
- VALUE. Use rb_integer_pack and rb_integer_unpack.
+ * internal.h (__has_extension): new macro.
-Sat Jun 8 17:15:18 2013 Tanaka Akira <akr@fsij.org>
+ * internal.h (STATIC_ASSERT): use _Static_assert with
+ clang. [ruby-core:69931] [Bug #11343]
- * random.c (make_seed_value): Fix the length given for
- rb_integer_unpack.
+Wed Jul 15 00:00:00 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sat Jun 8 16:38:02 2013 Tanaka Akira <akr@fsij.org>
+ * random.c (fill_random_bytes_syscall): fix compile error with
+ clang. [ruby-core:69931] [Bug #11343]
- * bignum.c (rb_integer_unpack): Don't use rb_funcall if possible.
+Tue Jul 14 11:22:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * random.c: Use uint32_t for elements of seed.
- (make_seed_value): Use rb_integer_unpack.
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#register):
+ notify the handler thread of new timeout registration.
-Sat Jun 8 15:58:18 2013 Tanaka Akira <akr@fsij.org>
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
+ make sleep intervals adaptive than fixed period intervals.
- * random.c (rand_init): Add a cast to fix clang compile error:
- random.c:410:32: error: implicit conversion loses integer precision:
- 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
- This cast doesn't cause a problem because len is not bigger than
- MT_MAX_STATE.
+ * lib/webrick/server.rb (WEBrick::GenericServer#start): flush
+ shutdown pipe.
-Sat Jun 8 15:30:03 2013 Tanaka Akira <akr@fsij.org>
+ * lib/webrick/server.rb (WEBrick::GenericServer#stop): request the
+ server to stop immediately by sending data via shutdown pipe.
- * random.c (rand_init): Use rb_integer_pack.
- (roomof): Removed.
+Mon Jul 13 23:58:08 2015 Stefano Tortarolo <stefano.tortarolo@gmail.com>
-Sat Jun 8 14:58:32 2013 Tanaka Akira <akr@fsij.org>
+ * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT):
+ fix typos in debugger statements. [Fix GH-967]
- * internal.h (INTEGER_PACK_FORCE_BIGNUM): New flag constant.
+Mon Jul 13 19:11:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_integer_unpack): Support INTEGER_PACK_FORCE_BIGNUM.
+ * lib/timeout.rb (timeout): warn as deprecated for a long time.
- * random.c (int_pair_to_real_inclusive): Use
- INTEGER_PACK_FORCE_BIGNUM to use rb_big_mul instead of rb_funcall.
+Mon Jul 13 01:37:27 2015 Zachary Scott <zzak@ruby-lang.org>
-Sat Jun 8 14:17:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl.c: [DOC] Backport ruby/openssl@dbb3fdb [Bug #11345]
+ Thanks to Tomoya Chiba for the report and help with patch.
- * configure.in: check for NET_LUID. header macro varies across
- compiler versions.
+Sun Jul 12 09:20:02 2015 Shota Fukumori <her@sorah.jp>
- * win32/win32.c: use configured macro.
+ * ext/socket/basicsocket.c: [DOC] typo (Errno::AGAIN -> Errno::EAGAIN)
-Sat Jun 8 11:59:55 2013 Tanaka Akira <akr@fsij.org>
+ * ext/socket/socket.c: ditto
- * random.c (int_pair_to_real_inclusive): Use rb_funcall instead of
- rb_big_mul because rb_integer_unpack can return a Fixnum.
+ * ext/socket/tcpserver.c: ditto
-Sat Jun 8 11:17:39 2013 Tanaka Akira <akr@fsij.org>
+ * ext/socket/udpsocket.c: ditto
- * random.c (int_pair_to_real_inclusive): Use rb_integer_pack.
+ * ext/socket/unixserver.c: ditto
-Sat Jun 8 09:49:42 2013 Tanaka Akira <akr@fsij.org>
+ * io.c: ditto
- * random.c (int_pair_to_real_inclusive): Use rb_integer_unpack.
+Sun Jul 12 06:42:23 2015 ksss <co000ri@gmail.com>
-Sat Jun 8 08:12:22 2013 Tanaka Akira <akr@fsij.org>
+ * test/stringio/test_stringio.rb (test_sysread): add a test for
+ StringIO#sysread. [Fix GH-966]
- * random.c (random_load): Use rb_integer_pack.
+Sat Jul 11 21:16:34 2015 ksss <co000ri@gmail.com>
-Sat Jun 8 06:15:46 2013 Tanaka Akira <akr@fsij.org>
+ * ext/stringio/stringio.c (Init_stringio): [DOC] Fix an example,
+ StringIO#puts should be set "\n" at last. [Fix GH-965]
- * random.c (numberof): Removed.
+Sat Jul 11 12:45:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 8 06:00:47 2013 Tanaka Akira <akr@fsij.org>
+ * lib/timeout.rb (Timeout#timeout): remove regexp with wrong line
+ number and fix caller depth.
- * random.c: include internal.h.
- (mt_state): Use rb_integer_unpack.
+Fri Jul 10 22:05:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 8 00:55:51 2013 Tanaka Akira <akr@fsij.org>
+ * lib/timeout.rb (ExitException): removed internal exception class
+ and use Timeout::Error instead, as using throw/catch to isolate
+ each timeouts now. [ruby-dev:49179] [Bug #11344]
- * bignum.c (integer_pack_loop_setup): word_num_nailbytes_ret argument
- removed.
- (rb_integer_pack): Follow the above change.
- (rb_integer_unpack): Follow the above change.
+Fri Jul 10 17:41:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 8 00:37:32 2013 Tanaka Akira <akr@fsij.org>
+ * dir.c (is_case_sensitive): get attributes by the file descriptor
+ of open directory, instead of using mount point name.
- * bignum.c (validate_integer_pack_format): Renamed from
- validate_integer_format.
- (integer_pack_loop_setup): Renamed from integer_format_loop_setup.
- (integer_pack_fill_dd): Renamed from int_export_fill_dd.
- (integer_pack_take_lowbits): Renamed from int_export_take_lowbits.
- (integer_unpack_push_bits): Renamed from int_import_push_bits.
+Fri Jul 10 10:46:02 2015 ksss <co000ri@gmail.com>
-Fri Jun 7 23:58:06 2013 Tanaka Akira <akr@fsij.org>
+ * ext/stringio/stringio.c (writable): remove unnecessary check for
+ deprecated safe level 4. [Fix GH-963]
- * bignum.c (rb_integer_pack): Arguments changed. Use flags to
- specify word order and byte order.
- (rb_integer_unpack): Ditto.
- (validate_integer_format): Follow the above change.
- (integer_format_loop_setup): Ditto.
+Thu Jul 9 15:07:12 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * pack.c: Ditto.
+ * win32/win32.c (waitpid): return immediately if interrupted.
+ reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340]
- * internal.h: Ditto.
- (INTEGER_PACK_MSWORD_FIRST): Defined.
- (INTEGER_PACK_LSWORD_FIRST): Ditto.
- (INTEGER_PACK_MSBYTE_FIRST): Ditto.
- (INTEGER_PACK_LSBYTE_FIRST): Ditto.
- (INTEGER_PACK_NATIVE_BYTE_ORDER): Ditto.
- (INTEGER_PACK_LITTLE_ENDIAN): Ditto.
- (INTEGER_PACK_BIG_ENDIAN): Ditto.
+Thu Jul 9 13:03:46 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jun 7 22:10:50 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_insnhelper.c (vm_search_super_method): use CI_SET_FASTPATH().
- * lib/rubygems/specification.rb (Gem::Specification#to_yaml):
- use Gem::NoAliasYAMLTree.create instead of Gem::NoAliasYAMLTree.new
- to suppress deprecated warnings.
+Thu Jul 9 11:07:06 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jun 7 21:39:39 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h: remove rb_call_info_t::klass because
+ rb_callable_method_entry_t has information about defined class.
- * bignum.c (rb_integer_pack): Renamed from rb_int_export.
- (rb_integer_unpack): Renamed from rb_int_import.
+ * vm_insnhelper.c (vm_search_method): don't set ci->klass because
+ it is removed.
- * internal.h, pack.c: Follow the above change.
+ * vm_insnhelper.c (rb_equal_opt): ditto.
-Fri Jun 7 21:05:26 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_search_superclass): removed because it is too
+ simple to write code directly.
- * bignum.c (integer_format_loop_setup): Extracted from rb_int_export
- and rb_int_import.
+ * vm_insnhelper.c (vm_defined): don't use vm_search_superclass().
+ This fix avoid searching current callable `me' twice.
-Fri Jun 7 19:48:38 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_search_super_method): ditto.
- * bignum.c (validate_integer_format): Extracted from rb_int_export and
- rb_int_import.
+Thu Jul 9 10:03:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Jun 7 19:23:15 2013 Tanaka Akira <akr@fsij.org>
+ * lib/net/http/responses.rb: Added 308 status to CODE_TO_OBJ list.
+ [fix GH-961] Patch by @billinghamj
- * bignum.c (rb_absint_size): Use numberof.
- (rb_int_export): Ditto.
+Thu Jul 9 09:34:14 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jun 7 18:58:56 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h (rb_control_frame_t): fix comments (layout index).
- * internal.h (numberof): Gathered from various files.
+Thu Jul 9 09:25:50 2015 Zachary Scott <e@zzak.io>
- * array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c,
- load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c,
- error.c, ruby.c: Remove the definitions of numberof.
+ * parse.y: Improve duplicate key warning with patch by @andremedeiros
+ [Fix GH-938] https://github.com/ruby/ruby/pull/938 [Bug #11327]
-Fri Jun 7 18:24:39 2013 Tanaka Akira <akr@fsij.org>
+Wed Jul 8 07:43:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (rb_absint_size): Declare a variable, i, just before used
- to suppress a warning.
- (rb_int_export): Ditto.
+ * lib/csv.rb: typo fix [ci skip][fix GH-958] Patch by @henrik
-Fri Jun 7 17:41:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Wed Jul 8 04:42:27 2015 Eric Wong <e@80x24.org>
- * bignum.c (rb_absint_size): explicit cast to BDIGIT to avoid implicit
- 64 bit to 32 bit shortening warning
- * bignum.c (rb_int_export): ditto
- * bignum.c (int_import_push_bits): ditto
+ * iseq.c (iseq_data_to_ary): dump kw_arg as symbol
+ * test/-ext-/iseq_load/test_iseq_load.rb: test kw_arg roundtrip
+ [ruby-core:69891] [Bug #11338]
-Fri Jun 7 17:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Tue Jul 7 18:18:41 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * internal.h (RCLASS_SUPER): use descriptive variable name
- * internal.h (RCLASS_SET_SUPER): ditto
+ * random.c (fill_random_bytes_syscall): fix compile error.
-Fri Jun 7 13:25:27 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Jul 7 16:47:30 2015 Eric Wong <e@80x24.org>
- * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
- RB_GC_GUARD. it should be after the object is used.
+ * compile.c (COMPILE_ERROR): reduce GET_THREAD() calls
-Fri Jun 7 13:22:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Jul 7 16:39:04 2015 Eric Wong <e@80x24.org>
- * gc.c (before_gc_sweep): noinline can also avoid the segv instead of
- -O0 of r41084. this way is expected less slow.
+ * random.c (fill_random_bytes_syscall): return -1 for error
+ * random.c (fill_random_bytes): try urandom on syscall failure
-Fri Jun 7 11:45:42 2013 Kenta Murata <mrkn@cookpad.com>
+Tue Jul 7 15:02:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * rational.c (numeric_quo): move num_quo in numeric.c to numeric_quo
- in rational.c to refer canonicalization state for mathn support.
- [ruby-core:41575] [Bug #5736]
+ * file.c (rb_str_normalize_ospath): skip invalid byte sequence not
+ to loop infinitely. this case usually does not happen as the
+ input name should come from real file systems.
- * numeric.c (num_quo): ditto.
+Tue Jul 7 14:40:08 2015 Koichi Sasada <ko1@atdot.net>
- * test/test_mathn.rb: add a test for the change at r41109.
+ * vm_backtrace.c: remove debug flag introduced accidentally.
-Fri Jun 7 11:41:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 7 12:05:37 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: revert r41106. size_t may not be unsigned
+ * cont.c (cont_free): remove mysterious fflush()
+ introduced at r19890, maybe accidentally.
- * bignum.c (rb_absint_size_in_word, rb_int_export, rb_int_import): use
- NUM2SIZET() and SIZET2NUM() already defined in ruby/ruby.h.
+Tue Jul 7 11:45:14 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jun 7 11:28:37 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * proc.c (rb_method_call): because data->me should be non-NULL,
+ do not check data->me
- * gc.c: use oldgen bitmap as initial mark bitmap when major gc.
- so can skip oldgen bitmap check around mark & sweep.
- * gc.c (slot_sweep_body): change scan algorithm for performance:
- from object's pointer base to bitmap one.
+ * proc.c (method_inspect): ditto.
-Fri Jun 7 11:25:56 2013 Masaya Tarui <tarui@ruby-lang.org>
+Tue Jul 7 11:37:25 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c: introduce oldgen bitmap for preparing performance tuning.
+ * vm_core.h: remove rb_iseq_t::orig because rb_iseq_clone()
+ no longer exists.
-Fri Jun 7 11:20:57 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * iseq.c: don't use rb_iseq_t::orig.
- * gc.c (MARKED_IN_BITMAP, MARK_IN_BITMAP, CLEAR_IN_BITMAP): bring
- bitmap macros in one place, and introduce BITMAP_BIT.
+Tue Jul 07 11:25:57 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jun 7 11:18:35 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * iseq.c, internal.h (rb_iseq_clone): removed because we don't need to
+ clone iseq any more.
- * array.c (ary_new): change order of allocation in order
- to remove FL_OLDGEN operation.
+ * class.c (clone_method): share iseq between cloned methods. All of
+ method dependent information are able to refer from method entry.
-Fri Jun 7 11:16:28 2013 Masaya Tarui <tarui@ruby-lang.org>
+Tue Jul 7 04:42:25 2015 Eric Wong <e@80x24.org>
- * tool/rdocbench.rb: add gc total time information.
+ * string.c (Init_String): use rb_str_freeze for String#freeze
+ to resize internal buffer
+ [ruby-core:69870] [Feature #11330]
-Fri Jun 7 10:12:01 2013 Koichi Sasada <ko1@atdot.net>
+Tue Jul 7 04:12:32 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c: remove "Sunny" terminology.
- "Sunny" doesn't mean antonym of "Shady" (questionable, doubtful, etc).
- Instead of "Sunny", use "non-shady" or "normal".
+ * vm.c (vm_define_method): remove an unused local variable.
-Fri Jun 7 09:29:33 2013 Kenta Murata <mrkn@cookpad.com>
+Tue Jul 7 03:57:28 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (rb_int_import): explicitly casting BDIGIT_DBL to BDIGIT
- to prevent warning.
+ * vm_core.h: remove rb_iseq_t::defined_method_id because it is not
+ needed.
-Fri Jun 7 07:29:33 2013 Tanaka Akira <akr@fsij.org>
+ * eval.c (frame_func_id): simplify. rb_callable_method_entry_t
+ has enough information.
- * internal.h (rb_int_export): countp argument is split into
- wordcount_allocated and wordcount.
+ * eval.c (frame_called_id): ditto.
- * bignum.c (rb_int_export): Follow the above change.
+ * iseq.c (prepare_iseq_build): catch up this fix.
- * pack.c (pack_pack): Ditto.
+ * proc.c (rb_mod_define_method): ditto.
-Fri Jun 7 07:17:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * vm.c (vm_define_method): ditto.
- * NEWS: describe a compatibility issue of Numeric#quo
- introduced at r41109.
+Tue Jul 7 03:47:26 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jun 7 07:15:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * vm_core.h: remove a useless declaration.
- * NEWS: fix style.
+Tue Jul 7 03:33:20 2015 Koichi Sasada <ko1@atdot.net>
-Fri Jun 7 06:48:17 2013 Benoit Daloze <eregontp@gmail.com>
+ * vm_core.h: remove rb_iseq_t::klass to reduce dynamic data.
- * numeric.c: remove unused ID id_to_r introduced in r41109.
+ * internal.h, iseq.c (rb_iseq_klass): remove it because
+ rb_iseq_t::klass is removed.
-Fri Jun 7 06:15:31 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_super_outside): do not see cfp->iseq, but
+ check callable method entry on a frame.
+ This fix simplify the logic to search super class.
- * bignum.c (rb_int_import): New function.
- (int_import_push_bits): Ditto.
+ * test/ruby/test_method.rb: support super() from Proc.
+ Now, [Bug #4881] and [Bug #3136] was solved.
- * internal.h (rb_int_import): Declared.
+ * proc.c (rb_mod_define_method): catch up this change.
- * pack.c (pack_unpack): Use rb_int_import for BER compressed integer.
+ * vm.c (vm_define_method): ditto.
-Thu Jun 6 22:24:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * vm_backtrace.c (rb_profile_frames): now, each `frame' objects
+ are rb_callable_method_entry_t data or iseq VALUEs.
- * numeric.c (num_quo): Use to_r method to convert the receiver to
- rational. [ruby-core:41575] [Bug #5736]
+ This fix introduce minor compatibility issue that
+ rb_profile_frame_label() always returns
+ rb_profile_frame_base_label().
- * test/ruby/test_numeric.rb: add a test for the above change.
+ * test/-ext-/debug/test_profile_frames.rb: catch up this change.
-Thu Jun 6 20:40:17 2013 Tanaka Akira <akr@fsij.org>
+Tue Jul 7 01:52:14 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: Invoke RUBY_REPLACE_TYPE for size_t.
- Don't invoke RUBY_CHECK_PRINTF_PREFIX for size_t to avoid conflict
- with RUBY_REPLACE_TYPE.
+ * cont.c (fiber_init): initialize control frame correctly.
+ This fix does not affect any ordinal execution, but
+ affects debug prints.
- * internal.h (rb_absint_size): Declared.
- (rb_absint_size_in_word): Ditto.
- (rb_int_export): Ditto.
+Mon Jul 6 17:59:05 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (rb_absint_size): New function.
- (rb_absint_size_in_word): Ditto.
- (int_export_fill_dd): Ditto.
- (int_export_take_lowbits): Ditto.
- (rb_int_export): Ditto.
+ * vm_insnhelper.c (vm_search_super_method): do not skip calling
+ same methods in super.
+ [Bug #3351]
- * pack.c (pack_pack): Use rb_int_export for BER compressed integer.
+ * test/ruby/test_super.rb: fix a test.
-Thu Jun 6 19:31:33 2013 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jul 6 17:59:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/date/date_core.c: fixed coding error [ruby-core:55337].
- reported by Riley Lynch.
+ * ext/tk/tcltklib.c: removed deprecated safe level.
-Thu Jun 6 14:16:37 2013 Narihiro Nakamura <authornari@gmail.com>
+Mon Jul 6 17:16:37 2015 Koichi Sasada <ko1@atdot.net>
- * ext/objspace/object_tracing.c: rename allocation_info to
- lookup_allocation_info. At times I confused "struct
- allocation_info" with "function allocation_info".
+ * method.h, proc.c (rb_method_entry_location): make it static
+ and remove prefix `rb_' because it is used only in proc.c.
-Thu Jun 6 13:57:06 2013 Narihiro Nakamura <authornari@gmail.com>
+Mon Jul 6 16:42:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/objspace/object_tracing.c: allocation_info function isn't
- called by any other file.
+ * test/lib/memory_status.rb: removed redundant path.
-Thu Jun 6 09:41:00 2013 Kenta Murata <mrkn@cookpad.com>
+Mon Jul 6 01:18:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (num_quo): should return a Float for a Float argument.
- [ruby-dev:44710] [Bug #5515]
+ * test/lib/test/unit/parallel.rb: make @@project_dir one level
+ upper as this file had moved one level deeper.
- * test/ruby/test_fixnum.rb: Add an assertion for the above change.
+Sun Jul 5 23:54:10 2015 mizokami <suzunatsu@yahoo.com>
- * test/ruby/test_bignum.rb: ditto.
+ * lib/optparse.rb: [DOC] Fix typo.
-Thu Jun 6 00:59:44 2013 Masaya Tarui <tarui@ruby-lang.org>
+Sun Jul 5 18:25:37 2015 Eric Wong <e@80x24.org>
- * gc.c (gc_mark): get rid of pushing useless objects.
- * gc.c (rgengc_rememberset_mark): bypass gc_mark() in order to push
- sunny old object at minor gc.
- * gc.c (gc_mark_children): move sunny old check to gc_mark().
- * gc.c (rgengc_check_shady): remove DEMOTE that already unnecessary.
- * gc.c (rb_gc_writebarrier): ditto.
+ * gc.c (gc_profile_record_get): fix spelling error in keys
- change sunny old check point in order to save mark stack and
- remove unnatural rest_sweep & demote.
+Sun Jul 5 14:49:01 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Thu Jun 6 00:52:42 2013 Masaya Tarui <tarui@ruby-lang.org>
+ * README.md: fix a typo pointed out by raoulvdberge.
+ https://github.com/ruby/ruby/pull/953#commitcomment-11998186
- * gc.c (rgengc_rememberset_mark): change scan algorithm for performance:
- from object's pointer base to bitmap one.
+Sun Jul 5 12:56:20 2015 Irvi Firqotul Aini <viarc7@gmail.com>
-Thu Jun 6 00:30:04 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * README.md: Added link HowToReport bugs.
- * win32/win32.c (NET_LUID): define it on MinGW32.
- mingw-w64 has NET_LUID but mingw32 (mingw.org) still doesn't have
- NET_LUID. reported by taco on IRC
+Sun Jul 5 10:51:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 6 00:05:08 2013 Akinori MUSHA <knu@iDaemons.org>
+ * array.c (rb_ary_sort_bang): the original array may not be
+ embedded even if a substitution array is embedded, as it is
+ embedded when the original array is short enough but not
+ embedded. [ruby-dev:49166] [Bug #11332]
- * string.c (String#b): Allow code range scan to happen later so
- ascii_only? on a result string returns the correct value.
- [ruby-core:55315] [Bug #8496]
+Sun Jul 5 09:31:40 2015 Eric Wong <e@80x24.org>
-Wed Jun 5 22:40:42 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * test/ruby/test_process.rb: test for fd=3 usability in child
- * lib/net/imap.rb (capability_response): should ignore trailing
- spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]
+Sat Jul 4 19:43:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/net/imap/test_imap_response_parser.rb: related test.
+ * Add test case for empty array and first method with args.
+ Patch by @yui-knk [fix GH-955]
-Wed Jun 5 21:17:08 2013 Tanaka Akira <akr@fsij.org>
+Sat Jul 4 19:39:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * bignum.c (big_fdiv): Use nlz() instead of bdigbitsize().
- (bdigbitsize): Removed.
+ * Add test for `Enumerable#sort` with block. Patch by @yui-knk
+ [fix GH-954]
-Wed Jun 5 20:32:00 2013 Kenta Murata <mrkn@cookpad.com>
+Sat Jul 4 14:38:43 2015 Eric Wong <e@80x24.org>
- * include/ruby/ruby.h: fix alignment in comment.
+ * enum.c (zip_ary): remove volatile, use RB_GC_GUARD
+ (zip_i): ditto
-Wed Jun 5 20:05:29 2013 Tanaka Akira <akr@fsij.org>
+Sat Jul 4 10:42:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * random.c (int_pair_to_real_inclusive): Add a cast to BDIGIT.
- (random_load): Fix shift width for fixnums.
- Re-implement bignum extraction without ifdefs.
+ * lib/rubygems/test_case.rb (teardown): do not delete features
+ loaded from the original load paths, the same libraries should
+ be loaded again when the same features are required.
+ [ruby-dev:49031] [Bug #11222]
-Wed Jun 5 15:26:10 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jul 4 09:38:52 2015 Eric Wong <e@80x24.org>
- * gc.c (before_gc_sweep): don't optimize it to avoid segv on Ubuntu
- 10.04 gcc 4.4.
- http://u32.rubyci.org/~chkbuild/ruby-trunk/log/20130527T190301Z.diff.html.gz
+ * vm.c (rb_vm_mark): reduce branches for always-set VM fields
+ (rb_vm_add_root_module): ditto
-Wed Jun 5 09:46:46 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Jul 03 20:05:10 2015 Koichi Sasada <ko1@atdot.net>
- * test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
- EACCES for Windows.
+ * method.h: introduce rb_callable_method_entry_t to remove
+ rb_control_frame_t::klass.
+ [Bug #11278], [Bug #11279]
-Wed Jun 5 08:13:37 2013 Tanaka Akira <akr@fsij.org>
+ rb_method_entry_t data belong to modules/classes.
+ rb_method_entry_t::owner points defined module or class.
- * bignum.c (rb_big_pow): Don't need to multiply SIZEOF_BDIGITS.
- Use nlz instead of bitlength_bdigit.
- (bitlength_bdigit): Removed.
+ module M
+ def foo; end
+ end
-Wed Jun 5 07:14:18 2013 Tadayoshi Funaba <tadf@dotrb.org>
+ In this case, owner is M.
- * ext/date/date_core.c (d_lite_cmp, d_lite_equal): simplified.
+ rb_callable_method_entry_t data belong to only classes.
+ For modules, MRI creates corresponding T_ICLASS internally.
+ rb_callable_method_entry_t can also belong to T_ICLASS.
-Wed Jun 5 07:07:01 2013 Tadayoshi Funaba <tadf@dotrb.org>
+ rb_callable_method_entry_t::defined_class points T_CLASS or
+ T_ICLASS.
+ rb_method_entry_t data for classes (not for modules) are also
+ rb_callable_method_entry_t data because it is completely same data.
+ In this case, rb_method_entry_t::owner == rb_method_entry_t::defined_class.
- * ext/date/date_core.c: fixed a bug [ruby-core:55295]. reported
- by Riley Lynch.
+ For example, there are classes C and D, and includes M,
-Wed Jun 5 06:44:08 2013 Eric Hodel <drbrain@segment7.net>
+ class C; include M; end
+ class D; include M; end
- * lib/rubygems: Update to RubyGems 2.0.3
+ then, two T_ICLASS objects for C's super class and D's super class
+ will be created.
- * test/rubygems: Tests for the above.
+ When C.new.foo is called, then M#foo is searched and
+ rb_callable_method_t data is used by VM to invoke M#foo.
- * NEWS: Added RubyGems 2.0.3 note.
+ rb_method_entry_t data is only one for M#foo.
+ However, rb_callable_method_entry_t data are two (and can be more).
+ It is proportional to the number of including (and prepending)
+ classes (the number of T_ICLASS which point to the module).
-Wed Jun 5 06:35:15 2013 Eric Hodel <drbrain@segment7.net>
+ Now, created rb_callable_method_entry_t are collected when
+ the original module M was modified. We can think it is a cache.
- * doc/marshal.rdoc: Add description of Marshal format.
+ We need to select what kind of method entry data is needed.
+ To operate definition, then you need to use rb_method_entry_t.
-Wed Jun 5 01:16:09 2013 Benoit Daloze <eregontp@gmail.com>
+ You can access them by the following functions.
- * array.c (Array#+): fix documentation example.
- Patch by Logan Serman. [Fixes GH-324]
+ * rb_method_entry(VALUE klass, ID id);
+ * rb_method_entry_with_refinements(VALUE klass, ID id);
+ * rb_method_entry_without_refinements(VALUE klass, ID id);
+ * rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me);
-Wed Jun 5 00:21:54 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ To invoke methods, then you need to use rb_callable_method_entry_t
+ which you can get by the following APIs corresponding to the
+ above listed functions.
- * lib/irb/lc/ja/help-message: update help messages.
- following r41028. [ruby-dev:46707] [Feature #7510]
+ * rb_callable_method_entry(VALUE klass, ID id);
+ * rb_callable_method_entry_with_refinements(VALUE klass, ID id);
+ * rb_callable_method_entry_without_refinements(VALUE klass, ID id);
+ * rb_resolve_refined_method_callable(VALUE refinements, const rb_callable_method_entry_t *me);
-Wed Jun 5 00:09:32 2013 Tanaka Akira <akr@fsij.org>
+ VM pushes rb_callable_method_entry_t, so that rb_vm_frame_method_entry()
+ returns rb_callable_method_entry_t.
+ You can check a super class of current method by
+ rb_callable_method_entry_t::defined_class.
- * marshal.c (r_object0): Generalize a round up expression.
- Use BDIGIT instead of int.
+ * method.h: renamed from rb_method_entry_t::klass to
+ rb_method_entry_t::owner.
-Tue Jun 4 23:44:02 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * internal.h: add rb_classext_struct::callable_m_tbl to cache
+ rb_callable_method_entry_t data.
- * object.c (rb_Hash): fix docs. patched by Stefan Sch"ussler.
- [ruby-core:55299] [Bug #8487]
+ We need to consider about this field again because it is only
+ active for T_ICLASS.
-Tue Jun 4 23:16:49 2013 Benoit Daloze <eregontp@gmail.com>
+ * class.c (method_entry_i): ditto.
- * lib/irb/completion.rb: Use %w literal construction for long lists.
- Patch by Dave Goodchild. [Fixes GH-299]
+ * class.c (rb_define_attr): rb_method_entry() does not takes
+ defined_class_ptr.
-Tue Jun 4 23:08:42 2013 Benoit Daloze <eregontp@gmail.com>
+ * gc.c (mark_method_entry): mark RCLASS_CALLABLE_M_TBL() for T_ICLASS.
- * ext/objspace/objspace.c: improve wording and remove duplicated comment.
- Based on a patch by Dave Goodchild. [Fixes GH-299]
+ * cont.c (fiber_init): rb_control_frame_t::klass is removed.
-Tue Jun 4 18:41:47 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c: fix `struct METHOD' data structure because
+ rb_callable_method_t has all information.
- * bignum.c (bitlength_bdigit): Fix an off-by-one error.
+ * vm_core.h: remove several fields.
+ * rb_control_frame_t::klass.
+ * rb_block_t::klass.
-Tue Jun 4 15:30:00 2013 Kenta Murata <mrkn@cookpad.com>
+ And catch up changes.
- * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the number
- of figures. Patch by Vipul A M <vipulnsward@gmail.com>.
- https://github.com/ruby/ruby/pull/323 fix GH-323
+ * eval.c: catch up changes.
- * test/bigdecimal/test_bigdecimal_util.rb: fix for the above change.
+ * gc.c: ditto.
-Tue Jun 4 00:44:27 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * insns.def: ditto.
- * test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
- EEXIST for Linux. (suggested by nurse)
+ * vm.c: ditto.
-Mon Jun 3 23:58:19 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * vm_args.c: ditto.
- * lib/fileutils.rb (FileUtils.rmdir): use remove_tailing_slash.
- * test/fileutils/test_fileutils.rb: test for above.
+ * vm_backtrace.c: ditto.
-Mon Jun 3 23:47:55 2013 Tanaka Akira <akr@fsij.org>
+ * vm_dump.c: ditto.
- * bignum.c (bitlength_bdigit): New function.
- (rb_big_pow): Use bitlength_bdigit instead of ffs.
+ * vm_eval.c: ditto.
-Mon Jun 3 23:11:19 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * vm_insnhelper.c: ditto.
- * lib/fileutils.rb: fix behavior when mkdir/mkdir_p accepted "/".
- * test/fileutils/test_fileutils.rb: add test for above change.
- Patched by Mitsunori Komatsu. [GH-319]
+ * vm_method.c: ditto.
-Mon Jun 3 19:02:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 3 14:30:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (is_hfs): use the file descriptor instead of a path.
+ * win32/file.c: some mingw compilers need a tweek for the
+ declarations of _wfreopen_s. [Bug #11320]
-Mon Jun 3 07:15:17 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jul 3 12:25:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: removes AC_CHECK_FUNCS(readdir_r). readdir_r()
- is only used from dir.c and it doesn't need readdir_r().
- * configure.in (SIZEOF_STRUCT_DIRENT_TOO_SMALL): removed. It is
- only used for readdir_r.
- * dir.c: removes NAME_MAX_FOR_STRUCT_DIRENT. It is not right way
- to detect maximum length of path len. POSIX require to use
- fpathconf(). IOW, it might have lead to make a vulnerability
- using stack smashing. Moreover, readdir() works enough for our
- usage.
- * dir.c (READDIR): removes an implementation which uses
- readdir_r() and parenthesize in a macro body correctly.
- * dir.c (dir_read): removes IF_HAVE_READDIR_R(DEFINE_STRUCT_DIRENT
- entry), it is used only for readdir_r().
- * dir.c (dir_each): ditto.
- * dir.c (glob_helper): ditto.
+ * transcode.c (rb_econv_set_replacement): target encoding name can
+ be empty now. [ruby-core:69841] [Bug #11324]
- * dir.c (READDIR): removes entry and dp argument.
- * dir.c (dir_read): adjust for the above change.
- * dir.c (dir_each): ditto.
- * dir.c (glob_helper): ditto.
+Fri Jul 3 07:21:06 2015 Eric Wong <e@80x24.org>
-Mon Jun 3 03:40:29 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * benchmark/bm_io_nonblock_noex.rb: new benchmark
+ * ext/openssl/ossl_ssl.c (no_exception_p): new function
+ (ossl_start_ssl): adjust for no_exception_p
+ (ossl_ssl_connect): adjust ossl_start_ssl call
+ (ossl_ssl_connect_nonblock): ditto
+ (ossl_ssl_accept): ditto
+ (ossl_ssl_accept_nonblock): ditto
+ (ossl_ssl_read_internal): adjust for no_exception_p
+ (ossl_ssl_write_internal): ditto
+ (ossl_ssl_write): adjust ossl_write_internal call
+ (ossl_ssl_write_nonblock): ditto
+ * ext/stringio/stringio.c (strio_read_nonblock):
+ delay exception check
+ * io.c (no_exception_p): new function
+ (io_getpartial): call no_exception_p
+ (io_readpartial): adjust for io_getpartial
+ (get_kwargs_exception): remove
+ (io_read_nonblock): adjust for io_getpartial,
+ check no_exception_p on EOF
+ (io_write_nonblock): call no_exception_p
+ (rb_io_write_nonblock): do not check `exception: false'
+ (argf_getpartial): adjust for io_getpartial
+ [ruby-core:69778] [Feature #11318]
- * vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019.
- The code is not useless.
+Fri Jul 3 07:13:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 3 01:25:25 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * dir.c (replace_real_basename): Win32 API does not set errno, get
+ the last error by GetLastError() and map to errno. [Bug #10015]
- * test/socket/test_sockopt.rb: change test name. follow r41037.
+Thu Jul 2 21:32:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 3 01:08:43 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * dir.c (replace_real_basename): show warnings at errors.
+ [Bug #10015]
- * test/rinda/test_rinda.rb: rename functions introduced in r41009.
+Thu Jul 2 18:39:20 2015 Koichi Sasada <ko1@atdot.net>
-Sun Jun 2 23:33:42 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * gc.c: remove `#define RGENGC_OBJ_INFO 1' line introduced to
+ debug Bug #11244.
- * enc/trans/japanese_euc.trans, test/ruby/test_transcode.rb,
- tool/transcode-tblgen.rb: change EUC-JP-2004 to EUC-JIS-2004.
- This is follow up to changes in r41024.
+Thu Jul 2 18:34:26 2015 Koichi Sasada <ko1@atdot.net>
-Sun Jun 2 22:44:42 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * gc.c (rb_raw_obj_info): separated from rb_obj_info().
+ Fill internal object information into passed buffer.
- * ext/socket/option.c: rename functions introduced in r41009
- s/ip/ipv4/g because they are ipv4 functions.
- (there's a policy that the name "ip" is for methods which supports
- both ipv4 and ipv6)
+ * gc.h: declare rb_raw_obj_info().
-Sun Jun 2 16:15:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 2 16:15:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dln_find.c (dln_find_exe, dln_find_file): remove deprecated
- non-reentrant functions.
+ * dir.c (replace_real_basename): update path type by the target
+ attributes if possible, to improve the performance. [Bug #10015]
-Sun Jun 2 15:04:35 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu Jul 2 14:45:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/cgi/util.rb, lib/erb.rb: Use String#b [Feature #8394] by znz
+ * st.c: get rid of VC++'s warnings of C4700 (uninitialized local
+ variable used). I think that these are wrong, but should shut them
+ up.
-Sun Jun 2 14:10:21 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu Jul 2 14:15:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/irb/lc/help-message: Apply english updates for irb --help #7510
+ * lib/rubygems.rb (Gem.load_path_insert_index): search
+ @gem_prelude_index first.
-Sun Jun 2 12:03:58 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/rubygems/test_case.rb (Gem::TestCase#setup): keep already
+ expanded paths to preserve instance variables.
- * range.c: Fix rdoc on Range#bsearch [Bug #8242] [ruby-core:54143]
+Thu Jul 2 14:12:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 2 02:08:37 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * ruby.c (process_options): also copy initial load path marks at
+ setting load paths encoding.
- * enc/euc_jp.c: fix typo: the name of EUC-JIS-2004.
+Thu Jul 2 12:26:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 1 23:17:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * test/rubygems/test_gem_server.rb (process_based_port): use
+ dynamically chosen port numbers to get rid of conflicts.
- * vm_eval.c (rb_mod_module_eval): mention in docs that arguments passed
- to the method are passed to the block
+Thu Jul 2 11:58:59 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Jun 1 17:58:13 2013 Akinori MUSHA <knu@iDaemons.org>
+ * test/rubygems/test_gem_specification.rb: skip tests which the
+ platform does not permit the filename of its test file.
- * lib/set.rb (Set#freeze, taint, untaint): Save a "self" by
- utilizing super returning self, and add tests while at it.
+Thu Jul 2 11:36:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 1 17:24:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/rubygems/test_gem_resolver_git_specification.rb: require
+ rubygems/installer.rb before Gem::TestCase#setup runs, otherwise
+ as Gem::TestCase#teardown restores $LOADED_FEATURES to the state
+ at that time, the requiring the file in GitSpecification#install
+ method causes a lot of constant redefinitions.
- * compile.c (iseq_set_arguments): not a simple single argument if any
- keyword arguments exist. [ruby-core:55203] [Bug #8463]
+Thu Jul 2 10:43:36 2015 Eric Wong <e@80x24.org>
- * vm_insnhelper.c (vm_yield_setup_block_args): split single parameter
- if any keyword arguments exist, and then extract keyword arguments.
- [ruby-core:55203] [Bug #8463]
+ * ext/socket/rubysocket.h: flags for common socket families
+ (rsock_getfamily): update signature
+ * include/ruby/io.h: comment socket FMODE flags
+ * ext/socket/init.c (rsock_getfamily): memoize family
+ * ext/socket/basicsocket.c: adjust rsock_getfamily calls
+ * ext/socket/ancdata.c: ditto
+ [ruby-core:69713] [Feature #11298]
-Sat Jun 1 11:16:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 2 10:30:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * error.c (rb_exc_new_cstr): rename from rb_exc_new2.
+ * lib/rubygems/resolver.rb: fixed NameError of Gem::Util::NULL_DEVICE.
- * error.c (rb_exc_new_str): rename from rb_exc_new3.
+Thu Jul 2 09:51:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sat Jun 1 10:13:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/resolver.rb: fix error of null device reference with DOSISH
+ platform.
- * string.c (rb_str_new[2-5], rb_{tainted,usascii}_str_new2),
- (rb_str_buf_new2): remove old interfaces.
+Thu Jul 2 06:49:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sat Jun 1 08:00:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems: Update to RubyGems HEAD(c202db2).
+ this version contains many enhancements see http://git.io/vtNwF
+ * test/rubygems: ditto.
- * ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc),
- (gzreader_gets): check EOF. [ruby-core:55220] [Bug #8467]
+Wed Jul 1 23:50:34 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sat Jun 1 07:32:15 2013 Tanaka Akira <akr@fsij.org>
+ * test/net/http/test_httpresponse.rb
+ (HTTPResponseTest#test_read_body_content_encoding_deflate_uppercase):
+ fix a failure without zlib.
- * bignum.c: Use BDIGIT type for hbase.
+Wed Jul 1 10:54:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sat Jun 1 02:37:35 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk
- * ext/socket/option.c (sockopt_s_byte): constructor of the sockopt
- whose value's is byte.
+Wed Jul 1 09:30:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/option.c (sockopt_byte): getter for above.
+ * struct.c (struct_set_members): hide internal back_members
+ object, and members object does not need to be duped as it
+ should be frozen and hidden.
- * ext/socket/option.c (inspect_byte): inspect for above.
+Wed Jul 1 09:28:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of
- the sockopt whose optname is IP_MULTICAST_LOOP.
+ * struct.c (struct_member_pos): revert r51080 to fix other
+ implicit conversions but cast the return value to fix the
+ previous implicit conversion.
- * ext/socket/option.c (sockopt_ip_multicast_loop): getter for above.
+Wed Jul 1 08:47:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of
- the sockopt whose optname is IP_MULTICAST_TTL.
+ * struct.c (struct_member_pos): avoid implicit conversion loses
+ integer precision: 'long' to 'int'.
- * ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above.
+Wed Jul 1 05:57:03 2015 Eric Wong <e@80x24.org>
- * ext/socket/option.c (sockopt_inspect): use above.
+ * vm_method.c (rb_add_method_iseq): add RB_GC_GUARD
+ * class.c (clone_method): remove RB_GC_GUARD
+ * struct.c (define_aref_method): ditto
+ (define_aset_method): ditto
+ * vm.c (vm_define_method):
+ * iseq.c (rb_iseq_clone): add RB_GC_GUARD
-Sat Jun 01 01:50:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Wed Jul 1 05:43:58 2015 Eric Wong <e@80x24.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2big
- to convert a double value to a Bignum.
+ * struct.c (AREF_HASH_THRESHOLD): new macro
+ (id_back_members): new ID
+ (struct_member_pos_ideal): new function
+ (struct_member_pos_probe): ditto
+ (struct_set_members): ditto
+ (struct_member_pos): ditto
+ (rb_struct_getmember): use struct_member_pos for O(1) access
+ (rb_struct_aref_sym): ditto
+ (rb_struct_aset_sym): ditto
+ (setup_struct): call struct_set_members
+ (struct_define_without_accessor): ditto
+ (Init_Struct): initialize __members_back__
+ [ruby-core:66851] [ruby-core:69705] [ruby-core:69821]
-Sat Jun 1 00:19:50 2013 Tanaka Akira <akr@fsij.org>
+Tue Jun 30 23:12:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (calc_hbase): Make hbase the maximum power of base
- representable in BDIGIT.
+ * io.c (rb_io_reopen): FilePathValue() ensures the path
+ NUL-terminated and frozen, so it is unnecessary to make it shared.
-Fri May 31 23:56:13 2013 Tanaka Akira <akr@fsij.org>
+Tue Jun 30 23:11:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (calc_hbase): Extracted from rb_big2str0.
+ * dir.c (check_dirname): ensure path name NUL-terminated for
+ SHARABLE_MIDDLE_SUBSTRING.
-Fri May 31 23:22:24 2013 Tanaka Akira <akr@fsij.org>
+ * io.c (rb_sysopen): ditto.
- * bignum.c: Don't hard code SIZEOF_BDIGITS for log_base(hbase).
- (big2str_orig): hbase_numdigits argument added.
- (big2str_karatsuba): Ditto.
- (rb_big2str0): Calculate hbase_numdigits.
+Tue Jun 30 18:38:16 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri May 31 17:57:21 2013 Zachary Scott <zachary@zacharyscott.net>
+ * win32/file.c (rb_freopen): need to terminate by NUL.
- * process.c: Improve Process::exec documentation
+Tue Jun 30 17:28:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 31 17:26:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_reopen): freopen(3) with OS encoding path.
+ [ruby-core:69780] [Bug #11320]
- * vm_eval.c (rb_funcallv): add better names of rb_funcall2.
+ * win32/file.c (rb_freopen): wrapper of wchar version freopen(3).
+ use _wfreopen_s() if available.
- * vm_eval.c (rb_funcallv_public): ditto for rb_funcall3.
+Tue Jun 30 08:24:08 2015 Eric Wong <e@80x24.org>
-Fri May 31 17:04:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_oflags_modestr): handle O_TRUNC correctly
+ * test/ruby/test_io.rb (test_reopen_stdio): new test
+ Patch-by: cremno phobia <cremno@mail.ru>
+ [ruby-core:69779] [Bug #11319]
- * array.c (rb_ary_new_capa): add better names of rb_ary_new2.
+Tue Jun 30 02:47:02 2015 Eric Wong <e@80x24.org>
- * array.c (rb_ary_new_from_args): ditto for rb_ary_new3.
+ * include/ruby/st.h (struct st_table): hide struct list_head
+ * st.c (struct st_table_entry): adjust struct
+ (head, tail): remove shortcut macros
+ (st_head): new wrapper function
+ (st_init_table_with_size): adjust to new struct and API
+ (st_clear): ditto
+ (add_direct): ditto
+ (unpack_entries): ditto
+ (rehash): ditto
+ (st_copy): ditto
+ (remove_entry): ditto
+ (st_shift): ditto
+ (st_foreach_check): ditto
+ (st_foreach): ditto
+ (get_keys): ditto
+ (get_values): ditto
+ (st_values_check): ditto
+ (st_reverse_foreach_check): ditto (unused)
+ (st_reverse_foreach): ditto (unused)
+ [ruby-core:69726] [Misc #10278]
- * array.c (rb_ary_new_from_values): ditto for rb_ary_new4.
+Mon Jun 29 17:38:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 31 16:35:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * insns.def (defineclass): do not quote unprintable characters at
+ raising an exception.
- * configure.in (HAVE_ATTRIBUTE_FUNCTION_ALIAS): define to tell if
- alias attribute is available.
+Mon Jun 29 16:01:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Fri May 31 16:03:23 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/net/http/response.rb (inflater): CONTENT_ENCODING can be upper
+ case. [ruby-core:69670] [Bug #11285] patched by Andy Chu
- * object.c, proc.c: s/call_seq/call-seq in rdoc. [Fixes GH-322]
+Mon Jun 29 14:50:08 2015 Shugo Maeda <shugo@ruby-lang.org>
-Fri May 31 15:56:36 2013 Zachary Scott <zachary@zacharyscott.net>
+ * eval.c (add_activated_refinement): should not include the original
+ class.
- * ext/openssl/ossl_ssl.c: Add missing paren in rdoc [Fixes GH-321]
+Mon Jun 29 12:09:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri May 31 11:58:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * README.md: tweak styles. [fix GH-945][ci skip] Patch by @bryndyment
- * vm_method.c (set_visibility): extract from rb_mod_public(),
- rb_mod_protected() and rb_mod_private().
+Mon Jun 29 07:23:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 30 19:47:42 2013 Yusuke Endoh <mame@tsg.ne.jp>
+ * template/sizes.c.tmpl: extract RUBY_DEFINT to define sizes of
+ types checked by configure.in, and fix size of intptr_t in
+ universal binary.
- * vm_insnhelper.c (vm_callee_setup_keyword_arg,
- vm_callee_setup_arg_complex): consider a hash argument for keyword
- only when the number of arguments is more than the expected
- mandatory parameters. [ruby-core:53199] [ruby-trunk - Bug #8040]
+Mon Jun 29 02:10:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_keyword.rb: update a test for above.
+ * insns.def (defineclass): preserve encoding of name in error
+ messages for super class mismatch.
-Thu May 30 17:55:04 2013 Zachary Scott <zachary@zacharyscott.net>
+ * insns.def (defineclass): preserve encoding of name in error
+ messages for non-class super.
- * process.c: RDoc on Process.spawn
+ * insns.def (defineclass): preserve encoding of name in error
+ messages when already defined but type mismatch.
-Thu May 30 00:08:14 2013 Koichi Sasada <ko1@atdot.net>
+Sun Jun 28 12:07:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (gc_profile_enable): rest_sweep() to finish last GC.
- Profiling record is allocated at first of marking phase.
- Enable at lazy sweeping may cause an error (SEGV).
+ * class.c (rb_define_class_id_under): raise TypeError exception
+ same as ruby level class definition when superclass mismatch.
-Wed May 29 10:33:27 2013 Koichi Sasada <ko1@atdot.net>
+Sun Jun 14 19:02:03 2015 Benoit Daloze <eregontp@gmail.com>
- * hash.c: fix WB bug.
- (1) Hash's key also needs WB.
- (2) callback parameter *key and *value of st_update() is not a
- storage of st_table itself (only local variable). So that
- OBJ_WRITE() is not suitable, especially for `!existing'.
- OBJ_WRITTEN() is used instead of OBJ_WRITE().
+ * lib/net/ftp.rb (makeport): close the TCPServer
+ when sending the port fails.
-Tue May 28 12:31:21 2013 Koichi Sasada <ko1@atdot.net>
+ * test/net/ftp/test_ftp.rb: test for above.
- * ext/objspace/object_tracing.c: fix a bug reported at
- "[ruby-core:55182] [ruby-trunk - Bug #8456][Open] Sugfault in Ruby Head"
- Care about the case TracePoint#path #=> `nil'.
+Fri Jun 26 12:48:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/object_tracing.c: add two new methods:
- * ObjectSpace.allocation_class_path(o)
- * ObjectSpace.allocation_method_id(o)
- They are not useful for Object.new because they are always
- "Class" and :new.
- To trace more useful information, we need to maintain call-tree
- using call/return hooks, which is implemented by
- ll-prof <http://sunagae.net/wiki/doku.php?id=software:llprof>
+ * transcode.c (load_transcoder_entry): fix transcoder loading race
+ condition, by waiting in require. [ruby-dev:49106] [Bug #11277]
- * test/objspace/test_objspace.rb: add a test.
+Fri Jun 26 07:53:56 2015 Eric Wong <e@80x24.org>
-Tue May 28 11:30:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c (enum_minmax): simplify return value creation
+ * test/ruby/test_enum.rb: test behavior on empty
+ * hash.c (rb_hash_fetch_m): remove unnecessary volatile since r41597
+ (env_reject_bang): trade volatile for GC guard
+ (env_select): ditto
+ (env_select_bang): ditto
+ (env_keep_if): ditto
+ (rb_env_clear): ditto
- * ext/extmk.rb (extmake): leave makefiles untouched if the content is
- not changed, to get rid of unnecessary re-linking.
+Thu Jun 25 21:24:28 2015 Naohisa Goto <ngotogenome@gmail.com>
-Tue May 28 03:11:02 2013 Koichi Sasada <ko1@atdot.net>
+ * test/-ext-/popen_deadlock/test_popen_deadlock.rb: test [Bug #11265]
- * ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to
- hook GC invocation.
- * ObjectSpace.after_gc_start_hook=(proc)
- * ObjectSpace.after_gc_end_hook=(proc)
+ * ext/-test-/popen_deadlock/infinite_loop_dlsym.c: new ext to call
+ dlsym(3) infinitely without GVL, used in the above test.
- Note that hooks are not kicked immediately. Procs are kicked
- at postponed_job.
+ * ext/-test-/popen_deadlock/extconf.rb: extconf.rb for the above
+ ext. Currently, only enabled on Solaris (main target) and Linux
+ (as a reference platform and for debugging the ext).
- This feature is a sample of new internal event and
- rb_postponed_job API.
+Thu Jun 25 19:24:25 2015 Naohisa Goto <ngotogenome@gmail.com>
-Tue May 28 02:56:15 2013 Koichi Sasada <ko1@atdot.net>
+ * configure.in: not to use vfork on Solaris to avoid deadlock
+ occurred in vfork(2) with multi-threading and dynamic linker
+ on Solaris. [Bug #11265] [ruby-dev:49089]
- * gc.c (gc_stat): remove wrong rest_sweep().
+Thu Jun 25 18:25:41 2015 Naohisa Goto <ngotogenome@gmail.com>
-Tue May 28 02:44:23 2013 Koichi Sasada <ko1@atdot.net>
+ * test/lib/envutil.rb (Test::Unit::Assertions#assert_no_memory_leak):
+ NO_MEMORY_LEAK_ENVS is moved to Memory::NO_MEMORY_LEAK_ENVS
+ to reduce child executions during test-all on Solaris.
- * gc.c (garbage_collect_body): fix GC_ENABLE_LAZY_SWEEP condition.
+ * test/lib/memory_status.rb (Memory::NO_MEMORY_LEAK_ENVS): ditto.
- * gc.c (GC_NOTIFY): move debug print location and use stderr instead
- of stdout.
+Thu Jun 25 17:32:33 2015 Koichi Sasada <ko1@atdot.net>
-Tue May 28 02:07:21 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_method.c (rb_method_entry_create): need to call
+ method_definition_reset() if def is given.
- * vm_trace.c (rb_postponed_job_register_one): fix iteration bug.
+ Actually, `me' is a new object, so we don't need to call it.
+ It is just to make sure.
- * ext/-test-/postponed_job/postponed_job.c,
- test/-ext-/postponed_job/test_postponed_job.rb: add a test.
+ * vm_method.c (method_definition_reset): remove duplicated insertion.
-Tue May 28 00:34:23 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_method.c (rb_method_entry_clone): assign dst->def here,
+ not in method_definition_reset().
- * include/ruby/ruby.h, gc.c: add new internal event
- RUBY_INTERNAL_EVENT_GC_END. This event invokes at the end of
- after_sweep().
- Time chart with lazy sweep is:
- (1) Kick RUBY_INTERNAL_EVENT_GC_START
- (2) [gc_marks()]
- (3) [lazy_sweep()]
- (4) [... run Ruby program (mutator) with lazy_sweep() ...]
- (5) [after_sweep()]
- (6) Kick RUBY_INTERNAL_EVENT_GC_END
- (7) [... run Ruby program (mutator), and go to (1) ...]
- Time chart without lazy sweep (GC.start, etc) is:
- (1) Kick RUBY_INTERNAL_EVENT_GC_START
- (2) [gc_marks()]
- (3) [gc_sweep()]
- (4) [after_sweep()]
- (5) Kick RUBY_INTERNAL_EVENT_GC_END
- (6) [... run Ruby program (mutator), and go to (1) ...]
+Thu Jun 25 16:44:54 2015 Koichi Sasada <ko1@atdot.net>
- * ext/-test-/tracepoint/tracepoint.c,
- test/-ext-/tracepoint/test_tracepoint.rb: modify a test.
+ * vm_method.c: make a rb_method_definition_t data (def) *after* making
+ a rb_method_entry_t data (me).
-Tue May 28 00:18:57 2013 Koichi Sasada <ko1@atdot.net>
+ Normally, `me' points `def'. Some Ruby objects pointed from `def'
+ and objects are marked by `me' (mark_method_entry() in gc.c).
+ However, `def' is built before making a `me', then nobody can mark
+ objects pointed from `def' before making (and pointing from) `me'.
- * vm_trace.c (rb_postponed_job_flush): remove a wrong comment.
+ I hope this patch solve #11244.
-Mon May 27 22:09:33 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c: remove `rb_' prefix from some static functions.
- * include/ruby/ruby.h (RHASH_SIZE): Add a cast to suppress a
- warning, comparison between signed and unsigned integer
- expressions [-Wsign-compare], on ILP32.
+ * method.h (rb_method_entry_create): constify
-Mon May 27 19:25:47 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (mark_method_entry): add checking `def' and
+ `def->body.iseq.iseqptr' availability because they can be NULL.
- * include/ruby/ruby.h: rename RUBY_INTERNAL_EVENT_FREE to
- RUBY_INTERNAL_EVENT_FREEOBJ.
+Thu Jun 25 14:14:16 2015 takiy33 <takiy33@gmail.com>
- * ext/-test-/tracepoint/tracepoint.c,
- ext/objspace/object_tracing.c,
- gc.c, vm_trace.c: catch up this change.
+ * test/test_prime.rb (test_eratosthenes_works_fine_after_timeout):
+ use spaces instead of TABs in ruby codes. [Fix GH-944]
-Mon May 27 18:57:28 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 25 07:08:35 2015 Koichi Sasada <ko1@atdot.net>
- * ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.
- Read the following test to know HOWTO.
- This feature is a sample of RUBY_INTERNAL_EVENT.
+ * gc.c (obj_info, method_type_name): show method type name in a string
+ instead of a number.
- * test/objspace/test_objspace.rb: add a test.
+Thu Jun 25 06:49:25 2015 Koichi Sasada <ko1@atdot.net>
- * ext/objspace/object_tracing.c: ditto.
+ * gc.c (obj_info): show more details for T_IMEMO/imemo_ment.
- * gc.c (rb_gc_count): add. This function returns GC count.
+Thu Jun 25 06:40:46 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h: add decl. of rb_gc_count(). Same as `GC.count'.
+ * vm_method.c (rb_method_definition_reset): need a WB for
+ VM_METHOD_TYPE_ATTRSET.
-Mon May 27 17:33:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 25 03:33:21 2015 Koichi Sasada <ko1@atdot.net>
- * tool/rbinstall.rb (install_recursive): add maxdepth option.
+ * gc.c (RGENGC_OBJ_INFO, obj_info): add a macro to enable/disable
+ rich obj_info() output.
- * tool/rbinstall.rb (bin-comm): limit depth of bindir and reject empty
- files. [ruby-core:55101] [Bug #8432]
+ At the default, the value of RGENGC_OBJ_INFO is
+ (RGENGC_DEBUG | RGENGC_CHECK_MODE).
-Mon May 27 16:16:18 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (RGENGC_OBJ_INFO): force enable it to debug #11244.
- * vm_trace.c (rb_postponed_job_flush, rb_postponed_job_register): use
- ruby_xmalloc/xfree. It is safe during GC.
+ * gc.c (gc_mark_ptr): print more details with obj_info().
-Mon May 27 09:24:03 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (gc_mark_children): remove useless debug prints.
- * test/-ext-/postponed_job/test_postponed_job.rb: fix typo and class name.
+Thu Jun 25 02:40:33 2015 Eric Wong <e@80x24.org>
-Mon May 27 09:05:17 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal):
+ do not process kwargs in blocking mode
+ * test/openssl/test_ssl.rb: test sysread
- * include/ruby/ruby.h, gc.c, vm_trace.c: add internal events.
- * RUBY_INTERNAL_EVENT_NEWOBJ: object created.
- * RUBY_INTERNAL_EVENT_FREE: object freed.
- * RUBY_INTERNAL_EVENT_GC_START: GC started.
- And rename `RUBY_EVENT_SWITCH' to `RUBY_INTERNAL_EVENT_SWITCH'.
+Wed Jun 24 16:54:11 2015 Koichi Sasada <ko1@atdot.net>
- Internal events can not invoke any Ruby program because the tracing
- timing may be critical (under huge restriction).
- These events can be hooked only by C-extensions.
- We recommend to use rb_postponed_job_register() API to call Ruby
- program safely.
+ * gc.c (gc_mark_children): add additional debug code for #11244.
- This change is mostly written by Aman Gupta (tmm1).
- https://bugs.ruby-lang.org/issues/8107#note-12
- [Feature #8107]
+Wed Jun 24 16:05:42 2015 Eric Wong <e@80x24.org>
- * include/ruby/debug.h, vm_trace.c: added two new APIs.
- * rb_tracearg_event_flag() returns rb_event_flag_t of this event.
- * rb_tracearg_object() returns created/freed object.
+ * string.c (rb_str_justify): use RB_GC_GUARD
- * ext/-test-/tracepoint/extconf.rb,
- ext/-test-/tracepoint/tracepoint.c,
- test/-ext-/tracepoint/test_tracepoint.rb: add a test.
+Wed Jun 24 14:25:17 2015 Koichi Sasada <ko1@atdot.net>
-Mon May 27 08:38:21 2013 Koichi Sasada <ko1@atdot.net>
+ * gc.c (gc_mark_ptr): add a check code for #11244.
- * ext/-test-/postponed_job/postponed_job.c: fix `init' function name.
+ It should be removed later. But we can remain this check
+ because it is only a branch.
-Mon May 27 06:22:41 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jun 24 12:49:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/debug.h, vm_trace.c: add rb_postponed_job API.
- Postponed jobs are registered with this API. Registered jobs
- are invoked at `ruby-running-safe-point' as soon as possible.
- This timing is completely same as finalizer timing.
+ * string.c (rb_fstring_cstr): new function to make a fstring from
+ a string literal.
- There are two APIs:
- * rb_postponed_job_register(flags, func, data): register a
- postponed job with data. flags are reserved.
- * rb_postponed_job_register_one(flags, func, data): same as
- `rb_postponed_job_register', but only one `func' job is
- registered (skip if `func' is already registered).
+ * internal.h (rb_fstring_lit): new macro to make a fstring from a
+ string literal.
- This change is mostly written by Aman Gupta (tmm1).
- https://bugs.ruby-lang.org/issues/8107#note-15
- [Feature #8107]
+ * include/ruby/intern.h (rb_strlen_lit): new macro to get the
+ length of a string literal, borrowed from mruby/mruby@e4afd53.
- * gc.c: use postponed job API for finalizer.
+Wed Jun 24 12:21:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * common.mk: add dependency from vm_trace.c to debug.h.
+ * re.c: Update documentation for Regexp class.
+ [fix GH-937][ci skip] Patch by @davydovanton
- * ext/-test-/postponed_job/extconf.rb, postponed_job.c,
- test/-ext-/postponed_job/test_postponed_job.rb: add a test.
+Wed Jun 24 09:23:03 2015 Eric Wong <e@80x24.org>
- * thread.c: implement postponed API.
+ * variable.c (generic_ivar_set): remove FL_ABLE check
+ (gen_ivar_copy): ditto
+ [ruby-core:69715]
- * vm_core.h: ditto.
+Wed Jun 24 08:28:15 2015 Eric Wong <e@80x24.org>
-Mon May 27 02:26:02 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): reduce stack use
+ [ruby-core:69595] [Feature #11263]
- * gc.c (gc_stat): collect promote_operation_count and
- types (RGENGC_PROFILE >= 2).
+Tue Jun 23 14:32:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 27 01:40:58 2013 Koichi Sasada <ko1@atdot.net>
+ * error.c (name_err_receiver): raise ArgumentError if no receiver
+ is available on this exception object. [Feature #10881]
- * gc.c (gc_stat): collect shade_operation_count,
- remembered_sunny_object_count and remembered_shady_object_count
- for each types when RGENGC_PROFILE >= 2.
- They are informative for optimization.
+Tue Jun 23 09:48:34 2015 Eric Wong <e@80x24.org>
-Mon May 27 01:15:22 2013 Koichi Sasada <ko1@atdot.net>
+ * dir.c (check_dirname): avoid volatile, use return value
+ (dir_s_chroot, dir_s_mkdir, dir_s_rmdir): adjust callers
- * hash.c (rb_hash_tbl_raw), internal.h: added.
- Returns st_table without shading hash.
+Tue Jun 23 06:37:10 2015 Eric Wong <e@80x24.org>
- * array.c: use rb_hash_tbl_raw() for read-only purpose.
+ * struct.c (struct_ivar_get): cache member definition in a subclass
+ Thanks to Sokolov Yura aka funny_falcon <funny.falcon@gmail.com>
+ in https://bugs.ruby-lang.org/issues/10585
- * compile.c (iseq_compile_each): ditto.
+Tue Jun 23 04:58:06 2015 Eric Wong <e@80x24.org>
- * gc.c (count_objects): ditto.
+ * benchmark/bm_vm2_struct_big_href_hi.rb: new benchmark
+ * benchmark/bm_vm2_struct_big_href_lo.rb: ditto
+ * benchmark/bm_vm2_struct_big_hset.rb: ditto
+ * benchmark/bm_vm2_struct_small_href.rb: ditto
+ * benchmark/bm_vm2_struct_small_hset.rb: ditto
+ Thanks to Sokolov Yura aka funny_falcon <funny.falcon@gmail.com>
+ in https://bugs.ruby-lang.org/issues/10585
- * insns.def: ditto.
+Mon Jun 22 18:08:48 2015 Naohisa Goto <ngotogenome@gmail.com>
- * process.c: ditto.
+ * test/lib/test/unit.rb (Test::Unit::Parallel#start_watchdog): removed
+ because it has been meaningless since r36385. [Bug #11288]
- * thread.c (clear_coverage): ditto.
+ * test/lib/test/unit.rb (Test::Unit::Parallel#_run_parallel): delete
+ lines related to the removed start_watchdog method
- * vm_insnhelper.c: ditto.
+Sun Jun 21 23:52:46 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Mon May 27 00:31:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * NEWS: mention about Array#bsearch_index and Hash#fetch_values.
- * tool/make-snapshot: use ENV["AUTOCONF"] instead of directly using
- literal "autoconf".
+Sun Jun 21 23:46:27 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sun May 26 21:31:46 2013 Koichi Sasada <ko1@atdot.net>
+ * NEWS: add a reference to a ticket.
- * hash.c, include/ruby/ruby.h: support WB protected hash.
- * constify RHash::ifnone and make new macro RHASH_SET_IFNONE().
- * insert write barrier for st_update().
+Sun Jun 21 20:28:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/intern.h: declare rb_hash_set_ifnone(hash, ifnone).
+ * internal.h (roomof): extract from type_roomof, and move from
+ bignum.c.
- * marshal.c (r_object0): use RHASH_SET_IFNONE().
+Sun Jun 21 18:32:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509name.c (Init_ossl_x509name): ditto.
+ * ruby_atomic.h (ATOMIC_PTR_CAS): define by generic CAS macro, not
+ via size_t, to suppress a warning by mingw gcc.
-Sat May 25 23:22:38 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+Sun Jun 21 05:31:41 2015 Shota Fukumori <her@sorah.jp>
- * test/fiddle/test_c_struct_entry.rb,
- test/fiddle/test_c_union_entity.rb,
- test/fiddle/test_cparser.rb, test/fiddle/test_func.rb,
- test/fiddle/test_handle.rb, test/fiddle/test_import.rb,
- test/fiddle/test_pointer.rb: don't run test if the system
- don't support fiddle.
+ * ext/objspace/objspace_dump.c(dump_object): Return empty JSON object when
+ passed object is a special const, instead of SEGV.
+ Based patch by Kohei Suzuki (eagletmt). [ruby-core:69692] [Bug #11291]
-Sat May 25 21:29:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/objspace/test_objspace.rb(test_dump_special_consts): Test for above fix.
- * ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stable
- added O_CLOEXEC support to posix_openpt, so assume FreeBSD 9.2 or
- later supports it.
- http://www.freebsd.org/cgi/query-pr.cgi?pr=162374
-Sat May 25 18:46:23 2013 Yusuke Endoh <mame@tsg.ne.jp>
+Sat Jun 20 03:56:58 2015 Yusuke Endoh <mame@ruby-lang.org>
- * proc.c (rb_method_entry_min_max_arity): fix missing break in switch.
- This was introduced in r38236, which is not intentional apparently.
- This has caused no actual harm because VM_METHOD_TYPE_OPTIMIZED is
- not used except for OPTIMIZED_METHOD_TYPE_SEND, but may do in
- future. Coverity Scan found this inadequacy.
+ * enc/make_encmake.rb: the list of encoding extension libraries must
+ not include encinit.c itself. It caused "undefined reference to
+ Init_encinit".
-Sat May 25 18:08:06 2013 Yusuke Endoh <mame@tsg.ne.jp>
+Sat Jun 20 02:03:53 2015 Naohisa Goto <ngotogenome@gmail.com>
- * dir.c (bracket): fix copy-paste error. When the first and last
- characters of fnmatch range have different length, fnmatch may
- have wrongly matched a path that does not really match.
- Coverity Scan found this bug.
+ * process.c (rb_execarg_parent_start1): new macro ALWAYS_NEED_ENVP
+ to generate envp_str anytime on Solaris 10 (or earlier version
+ of Solaris) to avoid calling execv() which is async-signal unsafe
+ on Solaris 10. [Bug #11265] [ruby-dev:49089]
-Sat May 25 17:06:25 2013 Koichi Sasada <ko1@atdot.net>
+ * process.c (exec_with_sh, proc_exec_cmd): On Solaris 10,
+ because ALWAYS_NEED_ENVP is 1 and envp_str is always generated,
+ execv() in exec_with_sh() and proc_exec_cmd() are never called.
+ To guarantee this, execv() is replaced by a macro to print
+ out error message on Solaris 10.
- * gc.c (after_gc_sweep): reduce full GC timing.
+ * process.c (proc_exec_sh): Because proc_exec_sh() may be called
+ by rb_proc_exec() with envp_str = Qfalse, execl() is replaced
+ by a macro that calls execle() with "extern char **environ"
+ traditional global variable on Solaris 10.
+ TODO: This may be unsafe and should be changed in the future.
+ Although rb_proc_exec() is not used from inside current version
+ of ruby, it may be called by third-party extensions.
-Sat May 25 11:28:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 20 01:10:13 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * variable.c (set_const_visibility): return without clearing method
- cache if no arguments.
+ * NEWS: mention about $SAFE.
- * vm_method.c (set_method_visibility): ditto.
+Fri Jun 19 14:53:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 25 11:27:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (rb_mod_define_method): now requires a block direct to
+ this method call. [ruby-core:69655] [Bug #11283]
- * vm_method.c (set_method_visibility): quote unprintable method name.
+Fri Jun 19 13:54:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 25 11:24:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (rb_mod_define_method): get rid of inadvertent ID
+ creations at error.
- * eval.c (rb_frame_callee): returns the called name of the current
- frame, not the previous frame.
+Fri Jun 19 07:58:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (prev_frame_callee, prev_frame_func): rename and make static,
- as these are used by rb_f_method_name() and rb_f_callee_name() only.
+ * ext/extmk.rb: if no with-ext option is given, default to
+ enable everything. [ruby-dev:49108] [Bug #11280]
- * variable.c (set_const_visibility): use the called name.
+Fri Jun 19 06:30:07 2015 Koichi Sasada <ko1@atdot.net>
-Sat May 25 08:58:23 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bootstraptest/test_method.rb: remove a test because $SAFE=2 was
+ obsolete.
- * string.c (rb_str_quote_unprintable): check if argument is a string.
+ Please check btest, too.
-Fri May 24 19:32:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+Thu Jun 18 23:51:51 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * variable.c (set_const_visibility): use rb_frame_this_func() instead
- of rb_frame_callee() for getting the name of the called method
+ * bin/erb: $SAFE=3 is obsolete.
- * test/ruby/test_module.rb: add test for private_constant with no args
+Thu Jun 18 23:45:11 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Fri May 24 18:53:10 2013 Koichi Sasada <ko1@atdot.net>
+ * safe.c: removed needless doc related $SAFE=2
- * gc.c: do major/full GC when:
- * number of oldgen object is bigger than twice of
- number of oldgen object at last full GC.
- * number of remembered shady object is bigger than twice of
- number of remembered shady object at last full GC.
- * number of oldgen object and remembered shady object is bigger
- than half of total object space.
- (please fix my English!)
+Thu Jun 18 23:38:07 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri May 24 17:07:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+ * thread.c (rb_thread_safe_level): fix document. $SAFE=3 is obsolete.
+ [ci skip]
- * intern.h: remove dangling rb_class_init_copy declaration
- [ruby-core:55120] [Bug #8434]
+Thu Jun 18 23:25:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 24 16:31:23 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/extmk.rb: configure intersection of with-ext and not
+ without-ext, as withouts is no longer true by default if
+ with-ext option is given. [ruby-dev:49108] [Bug #11280]
- * ext/strscan/strscan.c (strscan_aref): raise error if given
- name reference is not found.
+Thu Jun 18 23:20:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri May 24 15:48:18 2013 Koichi Sasada <ko1@atdot.net>
+ * include/ruby/ruby.h: $SAFE=2 is now obsolete.
- * gc.c (after_gc_sweep, garbage_collect_body): do major GC (full GC)
- before extending heaps.
- TODO: do major GC when there are many old (promoted) objects.
+ * dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c
+ gc.c, io.c, process.c, safe.c, signal.c, win32/file.c:
+ removed code for $SAFE=2
- * gc.c (after_gc_sweep): remove TODO comments.
+ * test/erb/test_erb.rb, test/fiddle/test_handle.rb
+ test/ruby/test_env.rb: removed tests for $SAFE=2.
-Fri May 24 11:04:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 18 22:50:07 2015 Yusuke Endoh <mame@ruby-lang.org>
- * configure.in (LIBRUBY_RPATHFLAGS): do not append -L option with
- runtime library directory if cross compiling, but only -R option.
- runtime path makes no sense on the host system. [ruby-dev:47363]
- [Bug #8443]
+ * enc/make_encmake.rb: added --transes and --no-transes options.
-Fri May 24 02:57:17 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 18 18:24:12 2015 Eric Wong <e@80x24.org>
- * object.c (rb_obj_clone): should not propagate OLDGEN status.
- This propagation had caused WB miss for class.
+ * test/socket/test_unix.rb: replace sleep with select
-Thu May 23 17:35:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 18 17:59:06 2015 Koichi Sasada <ko1@atdot.net>
- * load.c (loaded_feature_path): fix invalid read by index underflow.
- the beginning of name is also a boundary as well as just after '/'.
+ * vm.c (rb_vm_control_frame_id_and_class): remove useless codes.
+ `me' knows ID and owner class.
-Thu May 23 17:21:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 18 16:58:35 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (gc_profile_dump_on): revert r40898. ok to show the record
- accumulating while lazy_sweep().
+ * method.h: constify rb_method_alias_struct::original_me and
+ rb_method_refined_struct::orig_me.
-Wed May 22 16:50:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (move_refined_method): use RB_OBJ_WRITE() for
+ me->def->body.refined.orig_me.
- * gc.c (gc_profile_dump_on): use size_t to get rid of overflow and
- show the header when next_index > 0, instead of next_index != 1.
+Thu Jun 18 14:35:28 2015 Koichi Sasada <ko1@atdot.net>
-Wed May 22 15:18:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c (count_imemo_objects): support imemo_ment.
- * win32/win32.c (setup_overlapped): check the error code in addition
- to the result of SetFilePointer() to determine if an error occurred,
- because INVALID_SET_FILE_POINTER is a valid value.
- [ruby-core:55098] [Bug #8431]
+Thu Jun 18 13:32:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (setup_overlapped, finish_overlapped): extract from
- rb_w32_read() and rb_w32_write().
+ * error.c (name_err_receiver): add NameError#receiver method.
+ [Feature #10881]
-Wed May 22 14:19:56 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 18 10:00:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position
- of `during_gc' setting.
+ * safe.c: removed needless doc related $SAFE=3
-Wed May 22 07:36:08 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 18 09:59:23 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (garbage_collect): all GC is start from garbage_collect()
- (or garbage_collect_body()). `garbage_collect()' accept additional
- two parameters `full_mark' and `immediate_sweep'.
- If `full_mark' is TRUE, then force it full gc (major gc), otherwise,
- it depends on status of object space. Now, it will be minor gc.
- If `immediate_sweep' is TRUE, then disable lazy sweep.
- To allocate free memory, `full_mark' and `immediate_sweep' should be
- TRUE. Otherwise, they should be FALSE.
+ * safe.c: rename old method name for $SAFE=3
- * gc.c (gc_prepare_free_objects): use `garbage_collect_body()'.
+Thu Jun 18 06:02:42 2015 Eric Wong <e@80x24.org>
- * gc.c (slot_sweep, before_gc_sweep, after_gc_sweep): add logging code.
+ * compile.c (get_exception_sym2type, iseq_build_from_ary_body):
+ rely on %+PRIsVALUE instead of calling rb_inspect directly
-Tue May 21 22:47:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Jun 17 20:59:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/strscan/strscan.c (strscan_aref): support named captures.
- patched by Konstantin Haase [ruby-core:54664] [Feature #8343]
+ * common.mk (ENC_MK): needs fake.rb if cross compilation.
+ [ruby-dev:49098] [Bug #11272]
-Tue May 21 21:48:44 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed Jun 17 20:23:29 2015 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_dir_m17n.rb (TestDir_M17N#test_entries_compose):
- Use #each instead of #map just for iteration.
+ * ext/rbconfig/sizeof/extconf.rb: Check __float80.
-Tue May 21 19:57:22 2013 Akinori MUSHA <knu@iDaemons.org>
+Wed Jun 17 15:15:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/digest/lib/digest.rb (Digest::Class.file): Take optional
- arguments that are passed to the constructor of the digest
- class.
+ * safe.c (safe_setter): of course, don't have to warn the limitation of
+ $SAFE=3 after it's removed.
-Tue May 21 17:21:12 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jun 17 14:29:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c: remove gc_profile_record::is_marked. always true.
+ * include/ruby/ruby.h: $SAFE=3 is now obsolete.
-Tue May 21 17:13:40 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c
+ ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code
+ for $SAFE=3
- * gc.c: fix to collect additional information for GC::Profiler.
- * major/minor GC
- * trigger reason of GC
+ * bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb
+ test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb
+ test/ruby/test_thread.rb: remove tests for $SAFE=3
- * gc.c (gc_profile_dump_on): change reporting format with
- added information.
+Wed Jun 17 12:13:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c (gc_profile_record_get): return added information by
- :GC_FLAGS => array.
+ * ChangeLog: added contributor name.
-Tue May 21 16:45:31 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jun 17 10:57:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * gc.c: GC::Profiler's sweeping time is accumulated all slot
- sweeping time. At lazy GC, GC::Profiler makes new record entry
- for each lazy_sweep(). In this change, accumulating all
- slot_sweep() time.
- And change indentation.
+ * lib/csv.rb: accept to use Range object for row selection.
+ contributed by Mitsutaka Mimura.
+ [Feature #11267][ruby-dev:49091]
-Tue May 21 16:29:09 2013 Koichi Sasada <ko1@atdot.net>
+Wed Jun 17 09:50:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (rdoc-bench): add a benchmark rule
- using RDoc. Generate all rdoc related files
- (same as `make rdoc') in temporary directory
- and remove them. Execution time, GC::Profiler
- and results of GC.stat are printed.
+ * lib/rdoc/servlet.rb (documentation_search, root_search):
+ requires json for JSON.dump and fix sporadic failures due to
+ the loading order.
- * tool/rdocbench.rb: added for `rdoc-bench'.
+Tue Jun 16 19:19:53 2015 Tanaka Akira <akr@fsij.org>
-Tue May 21 16:25:05 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/rbconfig/sizeof/extconf.rb: Check several types defined in C99
+ and x86_64 ABI.
- * gc.c (gc_profile_dump_on): `count' should be (int) because it
- can be negative number.
- And use pointer for `record' (don't copy).
+ * template/sizes.c.tmpl: Relax a pattern for types.
-Tue May 21 03:11:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 16 17:37:01 2015 Koichi Sasada <ko1@atdot.net>
- * dir.c (dir_each): compose HFS file names from
- UTF8-MAC. [ruby-core:48745] [Bug #7267]
+ * test/objspace/test_objspace.rb: relax pattern because uncollectible
+ flag and marked flag can be false at major GC.
+ [Bug #10852]
-Tue May 21 03:08:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 16 04:50:44 2015 Eric Wong <e@80x24.org>
- * test/ruby/envutil.rb (assert_separately): require envutil in the
- child process too.
+ * ext/socket/basicsocket.c (bsock_recv): document outbuf
+ * ext/socket/unixsocket.c (unix_recvfrom): ditto
+ * ext/socket/init.c (rsock_strbuf, recvfrom_locktmp): new functions
+ (rsock_s_recvfrom): support destination buffer as 3rd arg
+ (rsock_s_recvfrom_nonblock): ditto
+ * string.c (rb_str_locktmp_ensure): export for internal ext
+ * test/socket/test_nonblock.rb: test recv_nonblock
+ * test/socket/test_unix.rb: test recv
+ [ruby-core:69543] [Feature #11242]
-Tue May 21 03:07:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 16 04:38:02 2015 Eric Wong <e@80x24.org>
- * string.c (rb_str_conv_enc_opts): should infect.
+ * ext/socket/ancdata.c (bsock_sendmsg_internal,
+ bsock_recvmsg_internal):
+ support "exception: false" kwarg
+ * ext/socket/init.c (rsock_s_recvfrom_nonblock):
+ ditto
+ * ext/socket/init.c (rsock_s_recvfrom_nonblock): use rsock_opt_false_p
+ * ext/socket/socket.c (sock_connect_nonblock): ditto
+ * ext/socket/rubysocket.h (rsock_opt_false_p): new function
+ * ext/socket/basicsocket.c (bsock_recv_nonblock): update rdoc
+ * ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
+ * test/socket/test_nonblock.rb: new tests
+ [ruby-core:69542] [Feature #11229]
-Mon May 20 22:24:45 2013 Akinori MUSHA <knu@iDaemons.org>
+Mon Jun 15 14:33:02 2015 Akinori MUSHA <knu@iDaemons.org>
- * lib/set.rb (Set#delete_if, Set#keep_if): Avoid blockless call of
- proc, which is not portable to JRuby. Replace &method() with
- faster and simpler literal blocks while at it.
+ * lib/set.rb: Make Set#each and SortedSet#each generate a sized
+ enumerator. [GH-931] by kachick (Kenichi Kamiya)
-Mon May 20 22:00:31 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/test_set.rb: Import tests from Set into SortedSet. [GH-931]
+ by kachick (Kenichi Kamiya)
- * lib/e2mmap.rb: Format of E2MM documentation
+Mon Jun 15 02:26:34 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Mon May 20 21:41:15 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/net/http.rb (Net::HTTP#connect): use connect_nonblock and
+ io/wait to eliminate timeout use. fix GH-899
- * ext/extmk.rb: nodoc this file
+Sat Jun 13 07:21:18 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon May 20 20:43:32 2013 Zachary Scott <zachary@zacharyscott.net>
+ * thread.c (thread_start_func_2): don't interrupt when last thread
+ exit unless main thread is already exited. Otherwise main thread
+ could be wrongly interrupted when it uses rb_thread_call_without_gvl().
+ Patch by Takehiro Kubo. [Bug #11237][ruby-dev:49044][GH-898]
- * lib/cmath.rb: Remove duplicate RDoc heading from overview
+ * test/-ext-/gvl/test_last_thread.rb: new test for the above fix.
-Mon May 20 20:36:19 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/-test-/gvl/call_without_gvl/call_without_gvl.c: new ext for
+ the above test.
+ * ext/-test-/gvl/call_without_gvl/extconf.rb: ditto.
- * lib/securerandom.rb: Update position of overview for RDoc
+Mon Jun 15 00:14:33 2015 Tanaka Akira <akr@fsij.org>
-Mon May 20 19:33:55 2013 Benoit Daloze <eregontp@gmail.com>
+ * ext/pathname/lib/pathname.rb (descend): Blockless form supported.
+ (ascend): Ditto.
+ [ruby-core:68820] [Feature #11052] Patch by Piotr Szotkowski.
- * math.c: improve and fix documentation of sin, tan and log
+Sun Jun 14 20:09:25 2015 Tanaka Akira <akr@fsij.org>
-Mon May 20 19:31:49 2013 Benoit Daloze <eregontp@gmail.com>
+ * time.c (time_getlocaltime): [DOC] Add examples of valid utc_offset
+ formats.
+ [ruby-core:68306] [Misc #10905] Patch by Charles Korn.
- * lib/logger.rb (Logger::Application): show namespace in documentation
+Sun Jun 14 18:49:56 2015 Tanaka Akira <akr@fsij.org>
-Mon May 20 11:50:12 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/socket/raddrinfo.c (parse_numeric_port): Detect
+ port overflow.
+ (numeric_getaddrinfo): Use parse_numeric_port.
+ numeric_getaddrinfo fails if port is too big now.
+ This makes rb_getaddrinfo invokes the real getaddrinfo()
+ on such condition.
+ This change is related to [ruby-core:69355] [Bug #11179].
- * lib/pp.rb: Revert part of r40834 and nodoc PP::ObjectMixin
- [ruby-core:55068]
+Sun Jun 14 17:26:03 2015 Tanaka Akira <akr@fsij.org>
-Mon May 20 10:40:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c (enum_chunk_while): New method Enumerable#chunk_while.
+ [ruby-core:67738] [Feature #10769] proposed by Tsuyoshi Sawada.
- * lib/webrick/htmlutils.rb (WEBrick::HTMLUtils#escape): replace HTML
- meta chars even in non-ascii string. [Bug #8425] [ruby-core:55052]
+Sun Jun 14 17:20:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils#{_escape,_unescape}):
- fix %-escape encodings. [Bug #8425] [ruby-core:55052]
+ * file.c (rb_file_load_ok): try opening file without gvl not to
+ lock entire process. [Bug #11060]
- * lib/webrick/httpservlet/filehandler.rb (set_dir_list): revert r20152
- partially and fix misuse of bytesize and regexp repetition operator.
+Sun Jun 14 10:43:50 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon May 20 08:03:51 2013 Zachary Scott <zachary@zacharyscott.net>
+ * tool/runruby.rb: just remove the lines of RUBY_VERSION check and raise
+ instead of replacing the check to `true`, for getting rid of a
+ warning `possibly useless use of true in void context`.
- * lib/profiler.rb: Document Profiler__ methods
+Sun Jun 14 10:13:55 2015 Kouhei Sutou <kou@cozmixng.org>
-Mon May 20 08:02:13 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/rexml/source.rb (REXML::IOSource#scan): Fix a typo in
+ document. [fix GH-934]
+ Patch by Anton Davydov. Thanks!!!
- * lib/tempfile.rb: nodoc Tempfile#inspect
+Sun Jun 14 10:09:48 2015 Kouhei Sutou <kou@cozmixng.org>
-Mon May 20 07:48:24 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/rexml/attlistdecl.rb (REXML::AttlistDecl): Fix a typo in
+ document. [fix GH-934]
+ Patch by Anton Davydov. Thanks!!!
- * ext/stringio/stringio.c: Correct position of method rdoc
+Sun Jun 14 06:24:57 2015 Benoit Daloze <eregontp@gmail.com>
-Mon May 20 07:27:41 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/ruby/test_io.rb: add test for IO.binread fd leak.
+ See r50881.
- * math.c: RDoc formatting of Math core docs with domains and codomains
- Patch by @eLobato [Fixes GH-309]
+Sun Jun 14 05:23:51 2015 Benoit Daloze <eregontp@gmail.com>
-Mon May 20 05:58:12 2013 Zachary Scott <zachary@zacharyscott.net>
+ * io.c (rb_io_s_binread): close fd if seek offset is invalid.
- * ext/bigdecimal/bigdecimal.c: Formatting for BigMath [Fixes GH-306]
- Based on a patch by @eLobato.
- * ext/bigdecimal/lib/bigdecimal/math.rb: ditto
+Sun Jun 14 04:40:32 2015 Benoit Daloze <eregontp@gmail.com>
-Mon May 20 04:56:59 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/lib/leakchecker.rb (check): refactor.
- * lib/forwardable.rb: Forwardable examples in overview were broken
- Based on patch by @joem [Fixes GH-303] [Bug #8392]
+Sun Jun 14 04:34:14 2015 Benoit Daloze <eregontp@gmail.com>
-Mon May 20 03:35:26 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/lib/leakchecker.rb: Return false for no leaks.
+ Otherwise the GC could run for nothing.
- * lib/optparse.rb: nodoc OptionParser::Version and SPLAT_PROC
+Sun Jun 14 04:15:40 2015 Benoit Daloze <eregontp@gmail.com>
-Mon May 20 03:16:52 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/delegate.rb: [DOC] Update SimpleDelegator example. [ci skip]
- * lib/pp.rb: Document PP::ObjectMixin [Fixes GH-312]
+Sat Jun 13 20:28:14 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Sun May 19 23:52:22 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * file.c (rb_stat_ino): get inode from the interval of struct st.
- * test/webrick/test_htmlutils.rb: add test for WEBrick::HTMLUtils.
+ * win32/win32.c (stati64_set_inode): get nFileIndexHigh/Low, and set it
+ to the interval of struct st as inode.
+ [Feature #11216]
-Sun May 19 23:12:07 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * win32/win32.c (stati64_set_inode_handle): call stati64_set_inode.
- * encoding.c: document fix, change default script encoding.
- patched by @windwiny [Fixes GH-310]
+ * win32/win32.c (rb_w32_fstati64): call stati64_set_inode_handle.
-Sun May 19 17:29:07 2013 Akinori MUSHA <knu@iDaemons.org>
+ * win32/win32.c (stati64_handle): call stati64_set_inode.
- * lib/set.rb (Set#delete_if, Set#keep_if): Add comments.
+Sat Jun 13 19:44:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun May 19 11:37:36 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * ext/io/console/depend (.list.chksum): revert a part of r50859, because
+ it was not mentioned at its commit log and it caused a build error on
+ Windows ($(MAKE) is already quoted).
- * ext/fiddle/extconf.rb: ignore rc version of libffi to fix build failure.
+Sat Jun 13 17:35:11 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Sun May 19 10:38:50 2013 Akinori MUSHA <knu@iDaemons.org>
+ * vm_core.h (rb_thread_t): add th->name.
- * misc/ruby-electric.el (ruby-electric-delete-backward-char): Use
- delete-char instead of delete-backward-char, which is an
- interactive function.
+ * vm.c (th_init): initialize th->name.
-Sun May 19 03:59:29 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c (Init_Thread): add Thread.name and name=. [Feature #11251]
- * string.c (str_scrub0): added for refactoring.
+ * thread.c (rb_thread_inspect): show thread's name if set.
-Sun May 19 03:48:26 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c (rb_thread_getname): defined.
- * lib/uri/common.rb (URI.decode_www_form): scrub string if decoded
- bytes are invalid for the encoding.
+ * thread.c (rb_thread_setname): ditto.
-Sun May 19 02:46:32 2013 Akinori MUSHA <knu@iDaemons.org>
+Sat Jun 13 11:39:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/set.rb (Set#delete_if, Set#keep_if): Make Set#delete_if and
- Set#keep_if more space and time efficient by avoiding to_a.
+ * lib/tempfile.rb: Fix typo. [fix GH-933] Patch by @Zorbash
-Sun May 19 02:33:09 2013 Akinori MUSHA <knu@iDaemons.org>
+Sat Jun 13 11:38:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * misc/ruby-electric.el (ruby-electric-setup-keymap): Make
- backquotes electric as well. It was listed in
- ruby-electric-expand-delimiters-list but not activated.
+ * ext/openssl/ossl_ocsp.c: fix documentation on ocsp response cert status.
+ [fix GH-932] Patch by @chrisholmes
- * misc/ruby-electric.el (ruby-electric-delete-backward-char):
- Introduce electric DEL that deletes what the previous electric
- command has input.
+Sat Jun 13 11:35:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * misc/ruby-electric.el (ruby-electric-matching-char): Make
- electric quotes work again at the end of buffer.
+ * ext/bigdecimal/bigdecimal.gemspec: Fix require paths for released gem.
+ [fix GH-929] Patch by @voxik
+ * ext/io/console/io-console.gemspec: ditto.
-Sun May 19 01:39:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 13 00:45:08 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * configure.in (setjmp-type): check if setjmpex() is really available.
- workaround for i686-w64-mingw32 which declares it but lacks its
- definition.
+ * lib/prime.rb: Return sized enumerators.
+ Patch by Kenichi Kamiya [GH-931]
- * include/ruby/defines.h: include setjmpex.h only if also setjmpex()
- is available.
+Sat Jun 13 00:45:06 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Sat May 18 23:57:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/prime.rb: Fix with_object with no block given
- * configure.in (setjmp-type): use setjmpex() on w64-mingw32 to get rid
- of -Wclobbered warnings.
+Sat Jun 13 00:44:59 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * include/ruby/defines.h: include setjmpex.h here becase setjmp.h is
- included from win32.h via intrin.h, winnt.h, and so on.
+ * lib/prime.rb: Have with_index accept an offset parameter.
+ Based on patch by T Yamada. [#11007]
-Sat May 18 20:28:12 2013 Tanaka Akira <akr@fsij.org>
+Fri Jun 12 22:21:12 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.
+ * test/ruby/test_extlibs.rb (TestExtLibs::check_existence): fix
+ error. [Bug #11255] [ruby-dev:49079]
-Sat May 18 20:15:28 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Jun 12 21:17:46 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (str_scrub_bang): add String#scrub!. [Feature #8414]
+ * pack.c (pack_{un,}pack): new template character `j` and `J`, pointer
+ with signed and unsigned integers.
-Sat May 18 16:59:52 2013 Tanaka Akira <akr@fsij.org>
+ * NEWS: mention about this feature.
+ [Feature #11215] [ruby-dev:49015]
- * ext/socket/mkconstants.rb (INTEGER2NUM): Renamed from INTEGER2VALUE.
+Fri Jun 12 21:01:44 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat May 18 16:57:58 2013 Tanaka Akira <akr@fsij.org>
+ * file.c (File::SHARE_DELETE): new flag to be able to delete opened file
+ on Windows.
- * ext/socket/mkconstants.rb (INTEGER2VALUE): Suppress a warning:
- comparison between signed and unsigned integer expressions
+ * include/win32/win32.c (O_SHARE_DELETE): new pseudo file mode flag.
-Sat May 18 16:38:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_w32_{w,}open): support above flag. [EXPERIMENTAL]
- * compile.c (iseq_compile_each): forward anonymous and first keyword
- rest argument one. [ruby-core:55033] [Bug #8416].
+ * NEWS: mention about this feature.
+ [Feature #11218] [ruby-dev:49022]
-Sat May 18 15:49:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 12 18:21:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * vm_core.h (rb_vm_tag): move jmpbuf between tag and prev so ensure to
- be accessible.
+ * ChangeLog: added missing commit message.
-Sat May 18 11:05:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 12 18:20:37 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * enumerator.c (inspect_enumerator): use VALUE instead of mere char*
- by using rb_sprintf() and rb_id2str().
+ * sample/exyacc.rb: Fix some typos. [fix GH-927] Patch by @davydovanton
+ * sample/list.rb: ditto.
+ * sample/trick2013/kinaba/remarks.markdown: ditto.
- * enumerator.c (append_method): extract from inspect_enumerator().
+Fri Jun 12 17:34:14 2015 Wojciech Mach <wojtek@wojtekmach.pl>
-Sat May 18 09:00:32 2013 Tanaka Akira <akr@fsij.org>
+ * hash.c (rb_hash_fetch_values): add `Hash#fetch_values`.
+ [Feature #10017] [Fix GH-776]
- * ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.
+Fri Jun 12 16:28:17 2015 Radan Skoric <radan.skoric@gmail.com>
-Sat May 18 00:38:47 2013 Tanaka Akira <akr@fsij.org>
+ * array.c (rb_ary_bsearch_index): Implement Array#bsearch_index
+ method, which is similar to bsearch and returns the index or
+ nil. [Feature #10730]
- * ext/socket/mkconstants.rb: Convert integer constants bigger than int
- correctly.
+Thu Jun 11 19:11:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri May 17 22:02:15 2013 Tanaka Akira <akr@fsij.org>
+ * ext/zlib/zlib.c: Fix indentation for rdoc.
+ [Bug #11221][ruby-core:69465]
- * ext/socket/ifaddr.c: Use unsigned LONG_LONG to represent flags
- because SunOS 5.11 (OpenIndiana) defines ifa_flags as uint64_t.
+Thu Jun 11 16:23:37 2015 Koichi Sasada <ko1@atdot.net>
-Fri May 17 21:47:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * method.h (METHOD_ENTRY_BASIC_SET): fix last commit (unbalanced parens).
- * cont.c: Typo in constant MAX_MACHINE_STACK_CACHE from '..MAHINE..'
- patch by @schmurfy [Fixes GH-307]
+Thu Jun 11 15:14:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Fri May 17 19:18:24 2013 Akinori MUSHA <knu@iDaemons.org>
+ * configure.in: define SET_THREAD_NAME if it has pthread_set_name_np
+ for FreeBSD, and don't define it if both pthread_setname_np
+ and pthread_set_name_np don't exist.
- * misc/ruby-electric.el (ruby-electric-matching-char): Do not put
- a closing quote when the quote typed does not start a string, as
- in $', ?\' or ?\".
+ * thread_pthread.c (SET_THREAD_NAME): don't define if they don't exist.
-Fri May 17 18:06:15 2013 Tanaka Akira <akr@fsij.org>
+ * thread_pthread.c (native_set_thread_name): run if SET_THREAD_NAME
+ is defined.
- * configure.in: Consider error messages to find out version option of
- C compiler.
- The C compiler of Sun Studio C emits "Warning: Option -qversion
- passed to ld, if ld is invoked, ignored otherwise" and exit
- successfully.
+Thu Jun 11 15:53:31 2015 Koichi Sasada <ko1@atdot.net>
-Fri May 17 17:34:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * method.h (METHOD_ENTRY_BASIC_SET): should clear last bit.
- * gc.c (rb_gc_guarded_ptr): unoptimize on other compilers than gcc and
- msvc.
+Thu Jun 11 14:34:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri May 17 11:06:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems.rb: bump version to 2.4.7 and 2.4.8. these versions fixed
+ CVE-2015-3900.
+ * lib/rubygems/remote_fetcher.rb: ditto.
+ * test/rubygems/test_gem_remote_fetcher.rb: added testcase for CVE-2015-3900
- * eval_intern.h (TH_PUSH_TAG): ensure jmpbuf to be accessible before
- pushing tag to get rid of unaccessible tag by stack overflow.
+Thu Jun 11 14:18:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu May 16 17:15:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/rubygems.rb: bump version to 2.4.6. It's missing change at r49774.
- * vm_eval.c (rb_catch_obj): add volatile to tag to prevent crash
- experimentally.
- http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20130515T133500Z.log.html.gz
+Thu Jun 11 13:50:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 16 16:19:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (ary_ensure_room_for_push): check if array size will
+ exceed maximum size to get rid of buffer overflow.
+ [ruby-dev:49043] [Bug #11235]
- * win32/Makefile.sub (verconf.in): no longer used.
+ * array.c (ary_ensure_room_for_unshift, rb_ary_splice): ditto.
- * win32/Makefile.sub (config.status): fix typo.
+Thu Jun 11 13:17:34 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in, template/verconf.h.in (RUBY_EXEC_PREFIX): fix for
- default prefix.
+ * test/test_cmath.rb (TestCMath#test_trigonometric_functions): should
+ not compare float values (in complex values) by `==`.
-Thu May 16 13:12:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 11 08:52:01 2015 Koichi Sasada <ko1@atdot.net>
- * template/verconf.h.in: generate verconf.h from the template and
- rbconfig.rb.
+ * method.h: embed rb_method_entry_t::attr::flags (5 bits) into
+ rb_method_entry_t::flags to make one word spare space.
-Thu May 16 05:47:18 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ Add some macros to access these flags.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: fix syntax error.
- Thanks @spastorino! [ruby-core:55011]
+ * vm_method.c: use these macros.
-Thu May 16 03:05:45 2013 Koichi Sasada <ko1@atdot.net>
+ * internal.h: define IMEMO_FL_USHIFT and IMEMO_FL_USER[0-4]
+ for T_IMEMO local flags.
- * gc.c (rb_node_newnode): use newobj_of() instead of rb_newobj().
+Thu Jun 11 08:27:06 2015 Koichi Sasada <ko1@atdot.net>
-Thu May 16 02:03:39 2013 Tanaka Akira <akr@fsij.org>
+ * vm.c: use VM_ASSERT instead of assert().
- * ext/socket/depend: Add a dependency for ifaddr.o.
+ * vm_args.c: ditto.
-Thu May 16 01:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c: ditto.
- * common.mk (verconf.h): $< cannot be used in explicit rules with
- nmake.
+ * vm_method.c: ditto.
- * win32/Makefile.sub (CONFIG_H): create verconf.in instead of
- verconf.h.
+Thu Jun 11 08:16:48 2015 Koichi Sasada <ko1@atdot.net>
-Thu May 16 01:25:07 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * vm_core.h: define VM_ASSERT() for assertion
+ enabled only when (VM_CHECK_MODE > 0).
- * ext/psych/lib/psych/visitors/yaml_tree.rb: only emit warnings when
- -w is enabled.
+ * vm_insnhelper.c: move definition VM_CHECK_MODE
+ from vm_insnhelper.c to vm_core.h.
-Wed May 15 18:58:17 2013 Koichi Sasada <ko1@atdot.net>
+ * vm.c: remove <assert.h>
- * gc.c (newobj): rename to `newobj_of' and accept additional
- three parameters v1, v2, v3. newobj_of() do OBJSETUP() and
- fill values with v1, v2, v3.
+Thu Jun 11 06:46:07 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc):
- use newobj_of().
+ * vm_insnhelper.c (check_frame): check type of cref_or_me first.
-Wed May 15 17:55:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 11 04:34:39 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * configure.in (RUBY_PLATFORM): move to config.h as needed by
- version.c.
+ * test/test_cmath.rb: Add some assertions.
-Wed May 15 17:04:11 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 11 00:34:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: add an additional RGENGC_PROFILE mode (2).
- Profiling result can be check by GC.stat.
+ * template/fake.rb.in: expanded macro result may have spaces
+ between tokens. [ruby-dev:49047] [Bug #11243]
- * gc.c (type_name): separate from obj_type_name().
+Wed Jun 10 22:27:32 2015 Naohisa Goto <ngotogenome@gmail.com>
-Wed May 15 16:58:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb: revert r50804 because of build failure when specifying
+ LDFLAGS during configure, observed on Solaris with GCC 4.6.
+ [Bug #11245]
- * configure.in: save configured load path values into verconf.in.
+Wed Jun 10 21:59:51 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * common.mk (verconf.h): create from verconf.in with shvar_to_cpp.rb.
+ * README.ja.md: fix markup miss.
- * tool/shvar_to_cpp.rb: turn shell variables into C macros.
- [Bug #7959]
+Wed Jun 10 11:06:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * loadpath.c: split load path staffs from version.c.
+ * template/fake.rb.in: turn into erb template from autoconf
+ template to fake more accurately.
- * dmyloadpath.c: miniruby has no builtin load paths, so verconf.h is
- not needed.
+ * common.mk (fake.rb): needs preprocessed file now.
-Wed May 15 03:56:09 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * version.c (Init_version): add dummy expression to
+ RUBY_ENGINE_VERSION.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: adding backwards
- compatible YAMLTree.new method
+Tue Jun 9 12:31:25 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed May 15 02:22:16 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/prime.rb: Simplify and optimize EratosthenesSieve
- * ext/psych/lib/psych.rb: Adding Psych.safe_load for loading a user
- defined, restricted subset of Ruby object types.
- * ext/psych/lib/psych/class_loader.rb: A class loader for
- encapsulating the logic for which objects are allowed to be
- deserialized.
- * ext/psych/lib/psych/deprecated.rb: Changes to use the class loader
- * ext/psych/lib/psych/exception.rb: ditto
- * ext/psych/lib/psych/json/stream.rb: ditto
- * ext/psych/lib/psych/nodes/node.rb: ditto
- * ext/psych/lib/psych/scalar_scanner.rb: ditto
- * ext/psych/lib/psych/stream.rb: ditto
- * ext/psych/lib/psych/streaming.rb: ditto
- * ext/psych/lib/psych/visitors/json_tree.rb: ditto
- * ext/psych/lib/psych/visitors/to_ruby.rb: ditto
- * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
- * ext/psych/psych_to_ruby.c: ditto
- * test/psych/helper.rb: ditto
- * test/psych/test_safe_load.rb: tests for restricted subset.
- * test/psych/test_scalar_scanner.rb: ditto
- * test/psych/visitors/test_to_ruby.rb: ditto
- * test/psych/visitors/test_yaml_tree.rb: ditto
+Tue Jun 9 11:45:00 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed May 15 02:06:35 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/prime.rb: Simplify and optimize EratosthenesSieve
+ based on patch by Ajay Kumar. [Fixes GH-921]
- * test/psych/helper.rb: envutil is not available outside Ruby, so
- port the functions from envutil to the test helper.
+Mon Jun 8 05:09:58 2015 Koichi Sasada <ko1@atdot.net>
- * test/psych/test_deprecated.rb: ditto
+ * gc.c (obj_info): print method id for T_IMEMO/ment.
- * test/psych/test_encoding.rb: ditto
+Sun Jun 7 07:05:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-Wed May 15 00:42:54 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * Move test cases from test/ruby/test_complex.rb to test/test_cmath.rb
- * signal.c: need to include unistd.h for write(2).
- unistd.h is now included via ruby/defines.h, but should explicitly
- include here. (suggested by kosaki)
+Sat Jun 6 18:23:41 2015 Koichi Sasada <ko1@atdot.net>
-Tue May 14 23:43:05 2013 Tanaka Akira <akr@fsij.org>
+ * method.h: back to share rb_method_definition_t by
+ rb_method_entry_t.
- * ext/socket/.document: Add ifaddr.c.
+ r50728 changed sharing `def's to isolating `def's
+ on alias and so on. However, this change conflicts
+ future improvement plan. So I change back to sharing approach.
-Tue May 14 23:24:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * method.h: move rb_method_definition_t::flags to
+ rb_method_entry_t::attr::flags.
- * ext/socket/extconf.rb: check for if_nametoindex() for
- i686-w64-mingw32, and check for declarations of if_indextoname() and
- if_nametoindex().
+ rb_method_entry_t::attr is union with VALUE because this field
+ should have same size of VALUE. rb_method_entry_t is T_IMEMO).
- * ext/socket/ifaddr.c (ifaddr_ifindex): not-implement unless
- if_nametoindex() is available.
+ And also add the following access macros to it's fields.
- * ext/socket/rubysocket.h: declare if_indextoname() and
- if_nametoindex() if available but not declared.
+ * METHOD_ENTRY_VISI(me)
+ * METHOD_ENTRY_BASIC(me)
+ * METHOD_ENTRY_SAFE(me)
-Tue May 14 19:58:17 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * vm_method.c (rb_method_definition_addref): added instead of
+ rb_method_definition_clone().
- * ext/dl/lib/dl/func.rb (DL::Function#call): check tainted when
- $SAFE > 0.
- * ext/fiddle/function.c (function_call): check tainted when $SAFE > 0.
- * test/fiddle/test_func.rb (module Fiddle): add test for above.
+ Do not create new definition, but increment alias_count.
+ * class.c (clone_method): catch up this fix.
-Tue May 14 14:51:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (method_entry_i): ditto.
- * include/ruby/win32.h (INTPTR_MAX, INTPTR_MIN, UINTPTR_MAX): split
- from intptr_t and uintptr_t, since VC9 defines the latter only in
- crtdefs.h.
+ * proc.c (mnew_internal): ditto.
-Tue May 14 12:21:28 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * proc.c (mnew_missing): ditto.
- * win32/win32.c (NET_LUID): mingw may have NET_LUID and not defined
- _IFDEF_.
+ * vm_eval.c: ditto.
-Tue May 14 03:33:17 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_insnhelper.c: ditto.
- * string.c (rb_str_new_frozen): remove debug print.
+ * vm_method.c: ditto.
-Tue May 14 03:22:51 2013 Koichi Sasada <ko1@atdot.net>
+Sat Jun 6 15:59:38 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/ruby.h: enable to generate write barrier protected
- arrays (T_ARRAY).
+ * class.c: ins_methods_push() needs rb_method_visibility_t type on
+ 2nd arg.
-Tue May 14 03:21:42 2013 Koichi Sasada <ko1@atdot.net>
+Sat Jun 6 15:05:47 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/ruby.h: enable to generate write barrier protected
- strings (T_STRING).
+ * class.c (ins_methods_push): Change type and name of parameters
+ to make more clear.
-Tue May 14 03:19:59 2013 Koichi Sasada <ko1@atdot.net>
+Sat Jun 6 08:52:13 2015 Eric Wong <e@80x24.org>
- * include/ruby/ruby.h: enable to generate write barrier protected
- objects (T_OBJECT).
+ * test/socket/test_nonblock.rb: try to avoid EMSGSIZE
+ [ruby-core:69466]
-Tue May 14 03:17:15 2013 Koichi Sasada <ko1@atdot.net>
+Sat Jun 6 07:58:30 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/ruby.h: enable to generate write barrier protected
- objects for numeric types (Float, Complex, Rational, Bignum).
+ * gc.c: remove struct mark_tbl_arg and pass objspace directly
+ to avoid indirect access overhead.
-Tue May 14 03:10:59 2013 Koichi Sasada <ko1@atdot.net>
+Sat Jun 6 07:08:45 2015 Eric Wong <e@80x24.org>
- * include/ruby/ruby.h: enable RGENGC (USE_RGENGC)
- but no type creates write protected (sunny) objects
- (RGENGC_WB_PROTECTED_* == 0).
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignment
-Tue May 14 02:47:30 2013 Koichi Sasada <ko1@atdot.net>
+Sat Jun 6 01:00:06 2015 Naohisa Goto <ngotogenome@gmail.com>
- * gc.c: support RGENGC. [ruby-trunk - Feature #8339]
- See this ticket about RGENGC.
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): all arguments are
+ parsed even on systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL
+ to prevent SEGV caused by passing Qnil to RARRAY_LENINT and
+ to preserve behavior before r50776.
+ [Bug #11224] [ruby-core:69468] [Bug #11225] [ruby-core:69469]
- * gc.c: Add several flags:
- * RGENGC_DEBUG: if >0, then prints debug information.
- * RGENGC_CHECK_MODE: if >0, add assertions.
- * RGENGC_PROFILE: if >0, add profiling features.
- check GC.stat and GC::Profiler.
+Fri Jun 5 22:37:42 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0).
+ * class.c (ins_methods_push): change 3rd parameter's type
+ from long to rb_method_visibility_t.
- * array.c: add write barriers for T_ARRAY and generate sunny objects.
+ * class.c (ins_methods_i): catch up this fix.
- * include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if
- you want to access raw pointers. If you modify the contents which
- pointer pointed, then you need to care write barrier.
+ * class.c (method_entry_i): cast to st_data_t instead of `long'.
- * bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects.
+Fri Jun 5 20:37:10 2015 Koichi Sasada <ko1@atdot.net>
- * complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX
- and generate sunny objects.
+ * internal.h: move definition of rb_cref_t to method.h.
- * rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write
- barriers for T_RATIONAL and generate sunny objects.
+ * eval_intern.h: move definition of rb_scope_visibility_t
+ to method.h.
- * internal.h: add write barriers for RBasic::klass.
+ * method.h: change rb_cref_t::scope_visi from VALUE to
+ rb_scope_visibility_t.
+ [Bug #11219]
- * numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects.
+ * vm.c (vm_cref_new): accept rb_method_visibility_t directly.
- * object.c (rb_class_allocate_instance), range.c:
- generate sunny T_OBJECT objects.
+ * vm_insnhelper.c (rb_vm_rewrite_cref): don't use 0,
+ but METHOD_VISI_UNDEF.
- * string.c: add write barriers for T_STRING and generate sunny objects.
+ * vm_method.c (rb_scope_visibility_set): don't need to use cast.
- * variable.c: add write barriers for ivars.
+ * vm_method.c (rb_scope_module_func_set): ditto.
- * vm_insnhelper.c (vm_setivar): ditto.
+Fri Jun 5 17:27:30 2015 Eric Wong <e@80x24.org>
- * include/ruby/ruby.h, debug.c: use two flags
- FL_WB_PROTECTED and FL_OLDGEN.
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): avoid msg_control
+ ptr if msg_controllen is zero to fix portability problems.
- * node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED):
- move flag bits.
+Fri Jun 5 09:17:45 2015 Eric Wong <e@80x24.org>
-Tue May 14 01:54:48 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): fix build error
+ from r50776
- * gc.c: remove rb_objspace_t::marked_num.
- We can use `objspace_live_num()' instead of removed `marked_num'
- if it is after `after_gc_sweep()' function call.
+Fri Jun 5 07:05:58 2015 Eric Wong <e@80x24.org>
- * gc.c (after_gc_sweep): use objspace_live_num() instead of removed
- rb_objspace_t::marked_num.
+ * io.c (sym_wait_readable, sym_wait_writable): declare
+ (io_getpartial): use sym_wait_readable
+ (io_write_nonblock): use sym_wait_writable
+ (Init_IO): initialize sym_wait_*able
- * gc.c (gc_mark_ptr, gc_marks): remove rb_objspace_t::marked_num code.
+Fri Jun 5 06:43:00 2015 Eric Wong <e@80x24.org>
- * gc.c (gc_prepare_free_objects): do not call set_heaps_increment()
- with checking objspace->heap.marked_num. At this point, we only
- need to check availability of free-cell.
+ * doc/extension.rdoc: note rb_get_kwargs changes keywords_hash
+ [ruby-core:68507]
- * gc.c (lazy_sweep): call after_gc_sweep() if there are no sweep_able entry.
+Fri Jun 5 05:50:29 2015 Eric Wong <e@80x24.org>
- * gc.c (rest_sweep, gc_prepare_free_objects): remove after_gc_sweep() call.
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): use rb_scan_args
+ [ruby-core:69439] [Feature #11207]
-Tue May 14 01:50:41 2013 Koichi Sasada <ko1@atdot.net>
+Fri Jun 5 02:20:06 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c: disable GC_PROFILE_MORE_DETAIL (fix last commit).
+ * test/lib/envutil.rb (assert_no_memory_leak): change default value
+ of limit from 1.5 to 2.0. It is ad-hoc fix to solve test failure
+ in travis-ci.
- * gc.c (gc_prof_set_malloc_info): fix "objspace->heap.live_num" to
- "objspace_live_num(objspace)". There is no such member variable.
+Fri Jun 5 01:17:21 2015 Koichi Sasada <ko1@atdot.net>
-Tue May 14 01:25:55 2013 Koichi Sasada <ko1@atdot.net>
+ * vm_insnhelper.c (vm_defined): no need to use cast.
- * gc.c: refactoring GC::Profiler.
+Fri Jun 5 01:14:02 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (gc_prof_sweep_timer_start/stop): removed because
- they doesn't support lazy sweep.
+ * vm_insnhelper.c (vm_defined): show additional messages on rb_bug().
- * gc.c (gc_prof_sweep_slot_timer_start/stop): added.
- redefine `sweeping time' to accumulated time of all of
- slot_sweep().
+Fri Jun 5 01:06:02 2015 Koichi Sasada <ko1@atdot.net>
- * gc.c (rb_objspace_t::profile::count): renamed to
- rb_objspace_t::profile::next_index. `counter' seems ambiguous.
- increment it when next record is acquired.
+ * vm_method.c (rb_add_method_iseq): use intermediate struct to
+ avoid initializing struct with variables.
+ [Bug #11217]
-Tue May 14 00:48:55 2013 Koichi Sasada <ko1@atdot.net>
+ * method.h: add a comment about it.
- * include/ruby/ruby.h: constify RRational::(num,den) and
- RComplex::(real,imag).
- Add macro to set these values:
- * RRATIONAL_SET_NUM()
- * RRATIONAL_SET_DEN()
- * RCOMPLEX_SET_REAL()
- * RCOMPLEX_SET_IMAG()
- This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
+Fri Jun 5 00:55:21 2015 Koichi Sasada <ko1@atdot.net>
- TODO: API design. RRATIONAL_SET(rat,num,den) is enough?
- TODO: Setting constify variable with cast has same issue of r40691.
+ * method.h: constify rb_method_refined_t::orig_me.
- * complex.c, rational.c: use above macros.
+ Also constify the following functions.
-Mon May 13 21:49:17 2013 Tanaka Akira <akr@fsij.org>
+ * rb_resolve_refined_method()
+ * rb_method_entry_with_refinements()
+ * rb_method_entry_without_refinements()
+ * rb_method_entry_copy()'s parameter.
- * ext/socket/extconf.rb: Check socketpair again.
- It is required on Unix.
+ * class.c: catch up this fix.
-Mon May 13 21:20:32 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_insnhelper.c: ditto.
- * win32/win32.c (getipaddrs): use alternative interface name if
- available, because if_nametoindex() requires them.
+ * vm_method.c: ditto.
-Mon May 13 20:23:24 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jun 4 12:47:54 SGT 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * win32/win32.c, include/ruby/win32.h (getipaddrs): [experimental]
- emulate getipaddrs(3) on Unix.
+ * array.c: Revert r50763. because "reentered" is not typo.
- * win32/Makefile.sub, configure.in (LIBS): need iphlpapi.lib for above
- function.
+Thu Jun 4 11:12:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * include/ruby/win32.h (socketpair): rb_w32_socketpair() doesn't
- substitute for any function, so use non-prefixed name.
+ * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovanton
+ [fix GH-923]
+ * include/ruby/st.h: ditto.
+ * include/ruby/util.h: ditto.
- * ext/socket/extconf.rb (socketpair); follow above change.
+Thu Jun 4 10:54:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon May 13 20:11:06 2013 Koichi Sasada <ko1@atdot.net>
+ * array.c: fix a typo. Patch by @manish-shrivastava
+ [fix GH-922]
- * iseq.c (prepare_iseq_build): remove additional line break.
+Thu Jun 4 09:52:02 2015 Eric Wong <e@80x24.org>
-Mon May 13 19:29:54 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/lib/openssl/ssl.rb: use io/nonblock instead of fcntl
+ [ruby-core:69382] [Feature #11190]
- * include/ruby/ruby.h: constify RBasic::klass and add
- RBASIC_CLASS(obj) macro which returns a class of `obj'.
- This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
+Thu Jun 4 07:22:45 2015 Koichi Sasada <ko1@atdot.net>
- * object.c: add new function rb_obj_reveal().
- This function reveal internal (hidden) object by rb_obj_hide().
- Note that do not change class before and after hiding.
- Only permitted example is:
- klass = RBASIC_CLASS(obj);
- rb_obj_hide(obj);
- ....
- rb_obj_reveal(obj, klass);
+ * method.h: introduce rb_method_refined_t for refined method entry.
- TODO: API design. rb_obj_reveal() should be replaced with others.
+ * class.c (move_refined_method): catch up this fix.
- TODO: modify constified variables using cast may be harmful for
- compiler's analysis and optimization.
- Any idea to prohibit inserting RBasic::klass directly?
- If rename RBasic::klass and force to use RBASIC_CLASS(obj),
- then all codes such as `RBASIC(obj)->klass' will be
- compilation error. Is it acceptable? (We have similar
- experience at Ruby 1.9,
- for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
+ * gc.c (mark_method_entry): ditto.
- * internal.h: add some macros.
- * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
- object.
- * RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
- * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
- without write barrier (planned).
- * RCLASS_SET_SUPER(a, b) set super class of a.
+ * vm_eval.c (vm_call0_body): ditto.
- * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
- file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
- parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
- string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
- Use above macros and functions to access RBasic::klass.
+ * vm_insnhelper.c (vm_call_method): ditto.
- * ext/coverage/coverage.c, ext/readline/readline.c,
- ext/socket/ancdata.c, ext/socket/init.c,
- * ext/zlib/zlib.c: ditto.
+ * vm_method.c: ditto.
-Mon May 13 18:44:14 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 4 07:12:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * *.c, parse.y, insns.def: use RARRAY_AREF/ASET macro
- instead of using RARRAY_PTR().
+ * dir.c (dirent_match): match short names only when FNM_SHORTNAME
+ flag is given, for the backward compatibility, and the new
+ behavior is often dangerous. [ruby-core:69435] [Bug #11206]
-Mon May 13 16:53:53 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 4 05:44:01 2015 Eric Wong <e@80x24.org>
- * include/ruby/ruby.h: add new utility macros to access
- Array's element.
- * RARRAY_AREF(a, i) returns i-th element of an array `a'
- * RARRAY_ASET(a, i, v) set i-th element of `a' to `v'
- This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
+ * variable.c (special_generic_ivar): remove flag
+ (givar_i, rb_mark_generic_ivar_tbl): remove functions
+ (rb_free_generic_ivar, rb_ivar_lookup, rb_ivar_delete,
+ generic_ivar_set, rb_ivar_set, rb_ivar_defined,
+ rb_copy_generic_ivar, rb_ivar_foreach, rb_ivar_count,
+ rb_obj_remove_instance_variable):
+ adjust for lack of ivar support in special constants
+ * test/ruby/test_variable.rb: test ivars for special consts
+ * internal.h: remove rb_mark_generic_ivar_tbl decl
+ * gc.c (gc_mark_roots): remove rb_mark_generic_ivar_tbl call
+ [ruby-core:69441] [Feature #11208]
-Mon May 13 15:31:10 2013 Koichi Sasada <ko1@atdot.net>
+Thu Jun 4 05:13:34 2015 Koichi Sasada <ko1@atdot.net>
- * object.c (rb_obj_setup): added.
+ * vm_insnhelper.c (def_iseq_ptr): `iseqval' is not available any more.
- * include/ruby/ruby.h (OBJSETUP): use rb_obj_setup() instead of
- a macro.
+Thu Jun 4 04:50:12 2015 Koichi Sasada <ko1@atdot.net>
-Mon May 13 15:24:16 2013 Koichi Sasada <ko1@atdot.net>
+ * class.c (method_entry_i): mtbl should not have `me' as NULL.
- * gc.c (rb_data_object_alloc): check klass only if klass is not 0.
- klass==0 means internal object.
+Thu Jun 4 04:28:45 2015 Koichi Sasada <ko1@atdot.net>
-Mon May 13 14:57:28 2013 Koichi Sasada <ko1@atdot.net>
+ * class.c (clone_method): do not use me->klass, but use explicitly
+ passed argument.
- * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc):
- use NEWOBJ_OF() instead of NEWOBJ().
+Thu Jun 4 04:10:43 2015 Koichi Sasada <ko1@atdot.net>
-Mon May 13 14:51:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (rb_vm_rewrite_cref_stack): rename to rb_vm_rewrite_cref().
- * proc.c (rb_obj_singleton_method): new method Kernel#singleton_method
- which returns a Method object of the singleton method.
- non-singleton method causes NameError, but not aliased or zsuper
- method, right now.
- [ruby-core:54914] [Feature #8391]
+ * class.c (clone_method): use renamed name.
- * vm_method.c (rb_method_entry_at): return the method entry for id at
- klass, without ancestors.
+ * vm_insnhelper.c (rb_vm_rewrite_cref): do not use `node' in variable
+ names.
- * class.c (rb_singleton_class_get): get the singleton class if exists,
- or nil.
+Wed Jun 3 23:03:50 2015 Koichi Sasada <ko1@atdot.net>
-Mon May 13 10:20:59 2013 Yuki Yugui Sonoda <yugui@google.com>
+ * vm_method.c: rename `rb_frame_...' to `rb_scope_...'.
- * ext/openssl/ossl_ssl.c: Disabled OpenSSL::SSL::SSLSocket if
- defined(OPENSSL_NO_SOCK).
+ * eval_intern.h: move decl. of rb_scope_visibility_set() to method.h.
- This fixes a linkage error on platforms which do not have socket.
- OpenSSL itself is still useful as a set of cryptographic functions
- even on such platforms.
+ * load.c: catch up this fix.
-Mon May 13 10:30:04 2013 Zachary Scott <zachary@zacharyscott.net>
+Wed Jun 3 21:14:20 2015 Tanaka Akira <akr@fsij.org>
- * hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]
+ * ext/rbconfig/sizeof/extconf.rb: Check C99 standard integer types.
-Mon May 13 10:04:22 2013 Zachary Scott <zachary@zacharyscott.net>
+Wed Jun 3 21:00:47 2015 Tanaka Akira <akr@fsij.org>
- * random.c: Document Random::DEFAULT by @eLobato [Fixes GH-304]
+ * configure.in: Don't check __int128.
-Sun May 12 21:12:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/rbconfig/sizeof/extconf.rb: Check __int128.
- * include/ruby/ruby.h (OFFT2NUM): RUBY_REPLACE_TYPE also defines macro
- to convert int type to VALUE if found.
+ * ext/rbconfig/sizeof/depend: sizes.c depends on
+ ext/rbconfig/sizeof/extconf.rb.
-Wed May 8 13:46:52 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * template/sizes.c.tmpl: Detect check_sizeof.
- * include/ruby/intern.h (rb_iv_set, rb_iv_get): removed. Because
- ruby.h has a declaration for that.
+Wed Jun 3 20:07:07 2015 Koichi Sasada <ko1@atdot.net>
-Wed May 8 13:49:06 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * class.c (clone_method): remove redundant check for me->def != NULL.
+ Now, all `me` have `me->def`.
- * include/ruby/intern.h (rb_uint2big, rb_int2big, rb_uint2inum)
- (rb_int2inum, rb_ll2inum, rb_ull2inum): removed because ruby.h
- has a declaration for these.
+ * proc.c (rb_method_entry_location): ditto.
-Sun May 12 17:52:23 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm.c (rb_vm_check_redefinition_opt_method): ditto.
- * configure.in: removes 'ac_cv_func_fseeko=yes' form MinGW
- specific definitions.
+ * vm.c (add_opt_method): ditto.
-Sun May 12 17:25:46 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_eval.c (vm_call0_body): ditto.
- * file.c (rb_file_s_truncate): use correct type. chsize takes
- a long.
+Wed Jun 3 19:24:12 2015 Koichi Sasada <ko1@atdot.net>
-Sun May 12 17:18:46 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_core.h: rename enum missing_reason to enum method_missing_reason.
- * process.c: move '#define HAVE_SPAWNV 1' to win32/Makefile.sub.
- * win32/Makefile.sub: see above.
+ * vm_core.h: use enum method_missing_reason for
+ rb_thread_t::method_missing_reason.
-Sun May 12 17:13:32 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_eval.c: catch up this fix.
- * configure.in: removes AC_CHECK_FUNCS(setitimer) because it's
- unused.
+ * vm_insnhelper.c: ditto.
-Sun May 12 17:08:16 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jun 3 16:17:21 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * configure.in: removes AC_CHECK_FUNCS(pause) because it's unused.
+ * vm.c: eagerly allocate `loading_table`. This eliminates the need to
+ do NULL checks when looking up the `loading_table` hash.
+ https://github.com/ruby/ruby/pull/918
-Sun May 12 17:05:18 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * load.c: remove various NULL checks
- * signal.c (rb_f_kill): fixes typo. s/HAS_KILLPG/HAVE_KILLPG/.
+Wed Jun 3 11:47:15 2015 Koichi Sasada <ko1@atdot.net>
-Sun May 12 17:03:27 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * method.h: change fields order to gather frequent access fields.
- * configure.in: abort if gettimeofday doesn't exist.
+ * vm_insnhelper.c (vm_call_method): add LIKELY().
-Sun May 12 16:31:27 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jun 03 10:35:45 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: adds RUBY_REPLACE_TYPE(off_t) for creating
- NUM2OFFT.
- * file.c (rb_file_truncate): use correct type. chsize() take
- a long.
- * include/ruby/ruby.h (NUM2OFFT): use a definition created by
- a configure script by default.
+ * method.h: split rb_method_definition_t::flag to several flags.
-Sun May 12 16:03:41 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ `flag' contains several categories of attributes and it makes us
+ confusion (at least, I had confused).
- * configure.in: removes AC_CHECK_FUNC(fseeko, fseeko64, ftello,
- ftello64). They are not used from anywhere.
+ * rb_method_visibility_t (flags::visi)
+ * NOEX_UNDEF -> METHOD_VISI_UNDEF = 0
+ * NOEX_PUBLIC -> METHOD_VISI_PUBLIC = 1
+ * NOEX_PRIVATE -> METHOD_VISI_PRIVATE = 2
+ * NOEX_PROTECTED -> METHOD_VISI_PROTECTED = 3
+ * NOEX_SAFE(flag) -> safe (flags::safe, 3 bits)
+ * NOEX_BASIC -> basic (flags::basic, 1 bit)
+ * NOEX_MODFUNC -> rb_scope_visibility_t in CREF
+ * NOEX_SUPER -> MISSING_SUPER (enum missing_reason)
+ * NOEX_VCALL -> MISSING_VCALL (enum missing_reason)
+ * NOEX_RESPONDS -> BOUND_RESPONDS (macro)
- * win32/win32.c (fseeko): removes.
- * win32/win32.c (rb_w32_ftello): removes.
- * include/ruby/win32.h: removes declarations of rb_w32_ftello and
- rb_w32_fseeko.
- * win32/Makefile.sub: removes '#define HAVE_FTELLO 1'.
+ Now, NOEX_NOREDEF is not supported (I'm not sure it is needed).
-Sun May 12 15:51:47 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ Background:
+ I did not know what "NOEX" stands for.
+ I asked Matz (who made this name) and his answer was "Nothing".
+ "At first, it meant NO EXport (private), but the original
+ meaning was gone."
+ This is why I remove the mysterious word "NOEX" from MRI.
- * configure.in: remove AC_CHECK_FUNC(close). It is not used from
- anywhere.
+ * vm_core.h: introduce `enum missing_reason' to represent
+ method_missing (NoMethodError) reason.
-Sun May 12 15:50:45 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * eval_intern.h: introduce rb_scope_visibility_t to represent
+ scope visibility.
+ It has 3 method visibilities (public/private/protected)
+ and `module_function`.
- * configure.in: adds comments for setjmp check.
+Wed Jun 3 08:06:30 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun May 12 15:38:09 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * gem/bundled_gems: updated to test-unit 3.1.1 and minitest 5.7.0.
- * configure.in: move clock_gettime() check into regular place.
+Wed Jun 3 04:48:05 2015 Koichi Sasada <ko1@atdot.net>
-Wed May 8 13:45:53 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_insnhelper.c (vm_defined): check respond_to_missing?
+ at defined?(func()).
+ [Bug #11212]
- * configure.in: add getenv() declaration check.
- * dln_find.c: add HAVE_DECL_GETENV test.
+ * test/ruby/test_defined.rb: add a test for this fix.
-Sun May 12 15:33:18 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jun 3 04:34:39 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: sorts AC_CHECK_FUNCS()s as alphabetical order.
+ * vm_insnhelper.c (vm_defined): skip respond_to_missing? when
+ a method is available.
+ [Bug #11211]
-Wed May 8 13:41:57 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_defined.rb: add a test for this fix.
- * bignum.c: remove redundant decl for big_lshift() big_rshift().
+Wed Jun 3 04:14:13 2015 Koichi Sasada <ko1@atdot.net>
-Sun May 12 16:06:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * insns.def (defined), vm_insnhelper.c (vm_defined):
+ move instruction body to the vm_defined() function.
- * ext/socket/rubysocket.h (rsock_inspect_sockaddr): as r40646
- check HAVE_TYPE_STRUCT_SOCKADDR_DL.
+Wed Jun 3 02:29:25 2015 Benoit Daloze <eregontp@gmail.com>
-Sat May 11 23:01:58 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_module.rb: Do not assume class variable order.
+ Patch by @enebo.
- * ext/socket/rubysocket.h (HAVE_TYPE_STRUCT_SOCKADDR_DL):
- MSVC has struct sockaddr_dl, but its content is broken.
- http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130511T103938Z.log.html.gz
+Wed Jun 3 01:10:38 2015 Yusuke Endoh <mame@tsg.ne.jp>
-Sat May 11 22:07:42 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c (rb_method_definition_set): remove a double assignment.
+ Coverity Scan found this bug.
- * test/rinda/test_rinda.rb: Socket.getifaddrs may returns an interface
- which #addr method returns nil for venet0 in OpenVZ.
+Wed Jun 3 00:04:51 2015 Koichi Sasada <ko1@atdot.net>
-Sat May 11 21:56:34 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c (rb_alias): rename parameter names.
- * ext/socket/raddrinfo.c (rsock_inspect_sockaddr): Add casts to
- suppress warnings.
+Tue Jun 2 23:27:18 2015 Koichi Sasada <ko1@atdot.net>
-Sat May 11 17:28:51 2013 Tanaka Akira <akr@fsij.org>
+ * method.h: remove rb_method_iseq_t::iseqval.
+ While making a r50728, iseqval is needed (to mark correctly),
+ but now just iseqptr is enough.
- * ext/socket: New method, Socket.getifaddrs, implemented.
- [ruby-core:54777] [Feature #8368]
+ * class.c: catch up this fix.
-Sat May 11 00:47:22 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c: ditto.
- * gc.h (SET_MACHINE_STACK_END): Add !defined(_ILP32) to a defining
- condition to avoid compilation error on x32.
- https://sites.google.com/site/x32abi/
+ * proc.c: ditto.
-Fri May 10 23:56:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c: ditto.
- * parse.y (parser_peek_variable_name): treat invalid global, class,
- and instance variable names as mere strings rather than errors.
- [ruby-core:54885] [Bug #8375]
+Tue Jun 2 21:29:28 2015 Koichi Sasada <ko1@atdot.net>
-Fri May 10 20:22:40 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c (proc_curry): remove a debug line.
- * configure.in: Move library checks into "Checks for libraries." part.
+Tue Jun 2 12:43:46 2015 Koichi Sasada <ko1@atdot.net>
-Fri May 10 19:32:01 2013 Tanaka Akira <akr@fsij.org>
+ * method.h: make rb_method_entry_t a VALUE.
+ Motivation and new data structure are described in [Bug #11203].
- * configure.in: Reformat arguments of AC_CHECK_HEADERS and
- AC_CHECK_FUNCS to track modifications easily.
+ This patch also solve the following issues.
-Fri May 10 12:01:36 2013 Tanaka Akira <akr@fsij.org>
+ * [Bug #11200] Memory leak of method entries
+ * [Bug #11046] __callee__ returns incorrect method name in orphan
+ proc
- * configure.in: Don't link librt if clock_gettime is available in
- the main C library.
- glibc 2.17 moves clock_* from librt to the main C library.
- http://sourceware.org/ml/libc-announce/2012/msg00001.html
+ * test/ruby/test_method.rb: add a test for [Bug #11046].
-Thu May 9 22:00:35 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h: remove rb_control_frame_t::me. me is located at value
+ stack.
- * ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should
- not be negative.
+ * vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes
+ because method entries are simple VALUEs.
-Thu May 9 21:09:57 2013 Tanaka Akira <akr@fsij.org>
+ * method.h: Now, all method entries has own independent method
+ definitions. Strictly speaking, this change is not essential,
+ but for future changes.
- * file.c, ext/etc/etc.c, ext/socket/unixsocket.c,
- ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use
- HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER.
+ * rb_method_entry_t::flag is move to rb_method_definition_t::flag.
+ * rb_method_definition_t::alias_count is now
+ rb_method_definition_t::alias_count_ptr, a pointer to the counter.
-Thu May 9 20:43:41 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to
+ search the current method entry from value stack.
- * ext/socket/ancdata.c (bsock_sendmsg_internal): Always set
- controls_num to raise NotImplementedError appropriately.
- (bsock_recvmsg_internal): Raise NotImplementedError if
- :scm_rights=>true is given on platforms which don't have
- 4.4BSD style control message.
+ * vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable
+ assertions.
-Thu May 9 12:06:07 2013 Tanaka Akira <akr@fsij.org>
+Tue Jun 2 10:46:36 2015 Eric Wong <e@80x24.org>
- * ext/socket/rubysocket.h, ext/socket/unixsocket.c,
- ext/socket/ancdata.c: Use HAVE_STRUCT_MSGHDR_MSG_CONTROL instead
- of HAVE_ST_MSG_CONTROL.
+ * test/socket/test_nonblock.rb: new test for sendmsg_nonblock
-Thu May 9 11:30:02 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue Jun 2 09:04:14 2015 Eric Wong <e@80x24.org>
- * string.c: Add call-seq alias for String#=== [Bug #8381]
+ * lib/benchmark.rb: just use Process::CLOCK_MONOTONIC
+ [ruby-core:69390]
-Thu May 9 11:14:18 2013 Zachary Scott <zachary@zacharyscott.net>
+Mon Jun 1 22:01:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * doc/contributing.rdoc: Add guide for contributing to CRuby
+ * lib/mkmf.rb (pkg_config): split --libs if --libs-only-l option
+ is not available. patch in [ruby-core:69428] by Hans Mackowiak.
+ [ruby-core:69421] [Bug #11201]
-Thu May 9 04:55:49 2013 Tanaka Akira <akr@fsij.org>
+Mon Jun 1 21:18:24 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: Check socket library again. shutdown() is used in
- io.c.
+ * gc.c (gc_mark_children): remove a garbage character
+ introduced at the last commit.
-Thu May 9 01:52:31 2013 Tanaka Akira <akr@fsij.org>
+Mon Jun 1 19:24:42 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: Don't check socketpair. socketpair is not used in
- ruby command itself.
+ * vm_method.c (rb_method_entry_make): do not show warning message
+ when method_entry is an alias.
-Thu May 9 01:05:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 1 15:47:16 2015 Koichi Sasada <ko1@atdot.net>
- * class.c (rb_mod_included_modules): should not include non-modules.
- [ruby-core:53158] [Bug #8025]
+ * internal.h: move class related definitions.
-Wed May 8 22:46:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 1 15:43:03 2015 Koichi Sasada <ko1@atdot.net>
- * class.c (rb_mod_included_modules): should not include the original
- module itself. [ruby-core:53158] [Bug #8025]
+ * class.c: remove needless include pragma for method.h.
-Wed May 8 17:43:55 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * struct.c: ditto.
- * io.c (rb_io_ext_int_to_encs): ignore internal encoding if external
- encoding is ASCII-8BIT. [Bug #8342]
+ * vm_method.c: ditto.
-Wed May 8 13:49:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 1 05:42:00 2015 Koichi Sasada <ko1@atdot.net>
- * ext/json/generator/generator.c (isArrayOrObject): cast char to
- unsigned char. [Bug #8378]
+ * eval_intern.h, vm_method.c: move macros to functions.
+ * SCOPE_TEST(f) -> rb_frame_visibility_test(flag).
+ * SCOPE_CHECK(f) -> rb_frame_visibility_check(flag).
+ * SCOPE_SET(f) -> rb_frame_visibility_set(flag).
-Wed May 8 13:46:10 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * load.c (load_ext): use it.
- * ext/json/generator/depend: fix dependencies [Bug #8379]
+Mon Jun 1 04:47:37 2015 Zachary Scott <e@zzak.io>
- * ext/json/parser/depend: ditto.
+ * ext/date/date_core.c: [DOC] Add comparison of Time and DateTime
+ Patch provided by @pixeltrix
-Wed May 8 13:07:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 1 04:22:09 2015 Koichi Sasada <ko1@atdot.net>
- * parse.y (parser_yylex): fail if $, @, @@ are not followed by a valid
- name character. [ruby-core:54846] [Bug #8375].
+ * vm_core.h (VM_FRAME_MAGIC_DUMMY): introduce new frame type to
+ recognize dummy frame.
-Wed May 8 13:06:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (th_init): use new frame type.
- * include/ruby/ruby.h (ISGRAPH): add missing macro.
+ * vm_args.c (raise_argument_error): ditto.
-Wed May 8 06:42:56 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 1 04:15:42 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/socket.c (socket_s_ip_address_list): fix wrongly filled
- sin6_scope_id on KAME introduced by r40593 for OpenIndiana.
- KAME uses fe80:<scope_id>::<interface id> for link-local address
- internally.
- Setting sin6_scope_id causes it leaked.
- see also comments of sockaddr_obj().
+ * class.c (rb_class_has_methods): added to reduce dependency
+ to internal class data structure.
-Tue May 7 22:12:34 2013 Tanaka Akira <akr@fsij.org>
+ * internal.h: ditto.
- * ext/readline/readline.c (insert_ignore_escape): Add a cast to
- unsigned char * before dereference.
- This suppress a warning on Cygwin.
+ * hash.c (has_extra_methods): use added function.
-Tue May 7 12:15:24 2013 Tanaka Akira <akr@fsij.org>
+Mon Jun 1 04:11:48 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/ancdata.c (bsock_recvmsg_internal): Add a cast to
- suppress warning.
- Bionic defines socklen_t as int.
- Bionic defines msg_controllen as unsigned int (__kernel_size_t)
- instead of socklen_t as POSIX.
+ * gc.c , gc.h (rb_obj_info): export obj_info(VALUE) for debugging.
-Tue May 7 12:12:42 2013 Tanaka Akira <akr@fsij.org>
+Mon Jun 1 03:52:55 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/ancdata.c (ancillary_inspect): Don't call
- anc_inspect_ipv6_pktinfo if !HAVE_TYPE_STRUCT_IN6_PKTINFO.
- anc_inspect_ipv6_pktinfo is not defined in the case.
+ * test/ruby/test_gc.rb: increase timeout seconds for GC stressful
+ debugging.
-Tue May 7 12:10:52 2013 Tanaka Akira <akr@fsij.org>
+Sun May 31 04:18:06 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/socket.c (socket_s_ip_address_list): Cast EXTRA_SPACE as
- int. This suppress a warning.
+ * method.h: fix typo of comments.
-Tue May 7 12:09:29 2013 Tanaka Akira <akr@fsij.org>
+Sun May 31 03:36:42 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/extconf.rb: Set close_fds false for Cygwin.
- Cygwin doesn't support fd passing.
- This enables socket extension library cross-compilable by default.
+ * method.h: add VM_METHOD_TYPE_ALIAS rb_method_definition_t::type
+ to fix [Bug #11173].
-Tue May 7 12:07:35 2013 Tanaka Akira <akr@fsij.org>
+ Now, inter class/method alias creates new method entry
+ VM_METHOD_TYPE_ALIAS, which has an original method entry.
- * pack.c (swap32): Don't redefine it if it is already defined.
- Bionic defines it.
- (swap64): Ditto.
+ * vm_insnhelper.c (find_defined_class_by_owner): added.
+ Search corresponding defined_class from owner class/module.
-Mon May 6 20:50:37 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c (rb_method_entry_get_without_cache): return me->klass
+ directly for defined_class.
- * ext/socket/socket.c (socket_s_ip_address_list): Fill sin6_scope_id
- if getifaddrs() returns an IPv6 link local address which
- sin6_scope_id is zero, such as on OpenIndiana SunOS 5.11.
+ Now, no need to check me->klass any more.
-Sun May 5 18:56:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (method_entry_set0): separated from method_entry_set().
- * insns.def (defined): use vm_search_superclass() like as normal super
- call. based on a patch <https://gist.github.com/wanabe/5520026> by
- wanabe.
+ * vm_method.c (rb_alias): make method entry has VM_METHOD_TYPE_ALIAS.
- * vm_insnhelper.c (vm_search_superclass): return error but not raise
- exceptions.
+ * vm_method.c (release_method_definition): support VM_METHOD_TYPE_ALIAS.
- * vm_insnhelper.c (vm_search_super_method): check the result of
- vm_search_superclass and raise exceptions on error.
+ * vm_method.c (rb_hash_method_definition): ditto.
-Sun May 5 16:29:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (rb_method_definition_eq): ditto.
- * insns.def (defined): get method entry from the method top level
- frame, not block frame. [ruby-core:54769] [Bug #8367]
+ * vm_method.c (release_method_definition): ditto.
-Sun May 5 13:28:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): ditto.
- * template/ruby.pc.in (Cflags): use rubyarchhdrdir for multiarch.
- [Bug #7874]
+ * vm_insnhelper.c (vm_method_cfunc_entry): ditto.
-Sat May 4 07:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * vm_eval.c (vm_call0_body): ditto.
- * doc/security.rdoc: Add note about reporting security vulns
+ * gc.c (mark_method_entry): ditto.
-Sat May 4 04:13:27 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * proc.c (method_def_iseq): ditto.
- * include/ruby/defines.h (RUBY_ATTR_ALLOC_SIZE): New for
- attribute((alloc_size(params))).
+ * proc.c (method_cref): ditto.
- * include/ruby/defines.h (xmalloc, xmalloc2, xcalloc)
- (xrealloc, xrealloc2): Annotated by RUBY_ATTR_ALLOC_SIZE.
- * include/ruby/ruby.h (rb_alloc_tmp_buffer): ditto.
+ * proc.c (rb_method_entry_min_max_arity): ditto.
-Fri May 3 19:32:13 2013 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+ * test/ruby/test_alias.rb: add tests.
- * lib/cgi/util.rb: All class methods modulized.
- We can use these methods like a function when "include CGI::Util".
- [Feature #8354]
+ * test/ruby/test_module.rb: fix a test to catch up current behavior.
-Fri May 3 14:09:45 2013 Tanaka Akira <akr@fsij.org>
+Sun May 31 03:34:25 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/extconf.rb: Make default_ipv6 true for Cygwin.
- Cygwin supports IPv6 since Cygwin 1.7.1 (2009-12).
- http://cygwin.com/ml/cygwin-announce/2009-12/msg00027.html
+ * vm_method.c (rb_unlink_method_entry): make it static.
-Fri May 3 13:35:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 31 03:26:58 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/{getaddrinfo,getnameinfo}.c: define socklen_t if not
- defined, e.g., older VC.
+ * method.h, vm_method.c (rb_free_method_entry): constify a parameter.
-Fri May 3 13:29:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h: remove useless declaration about rb_unlink_method_entry().
- * include/ruby/win32.h (INTPTR_MAX, INTPTR_MIN, UINTPTR_MAX): also
- should be defined when defining intptr_t and uintptr_t.
- bigdecimal.c requires the former two now.
+Sat May 30 18:05:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri May 3 13:22:12 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/tempfile.rb (Remover#call): fixed wrong condition. introduced at
+ r50682.
- * win32/win32.c (poll_child_status): fix build error on older mingw.
+Sat May 30 16:12:35 2015 Eric Wong <e@80x24.org>
-Fri May 3 00:15:58 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
+ [ruby-core:69419] [Feature #11198]
- * common.mk: remove timestamps in distclean-ext realclean-ext.
+Sat May 30 15:59:10 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu May 2 23:23:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/tempfile.rb (Tempfile#initialize): initialize @unlinked to fix
+ test failures introduced at r50682. I hope that check the results of
+ tests before committing, at least the tests about the changed feature.
- * object.c (rb_obj_is_kind_of): skip prepending modules.
- [ruby-core:54742] [Bug #8357]
+Sat May 30 11:02:55 2015 Martin Englund <martin@englund.nu>
- * object.c (rb_class_inherited_p): ditto.
- [ruby-core:54736] [Bug #8357]
+ * doc/dtrace_probes.rdoc: change lingering dtrace probe documentation
+ from function- to method-
-Thu May 2 22:11:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 30 10:26:09 2015 Masaki Matsushita <glass.saga@gmail.com>
- * bin/irb: remove dead code from sample/irb.rb.
+ * lib/tempfile.rb: refactoring.
+ * use warn instead of STDERR.print
+ * remove @tmpname and use @tmpfile.path
+ * introduce @unlinked flag
+ * Remover takes only @tmpfile
+ * mode will be modified just before file reopen
-Thu May 2 17:32:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 30 09:02:51 2015 Eric Wong <e@80x24.org>
- * marshal.c (copy_ivar_i): get rid of overwriting already copied
- instance variables. c.f. [Bug #8276]
+ * include/ruby/intern.h (rb_generic_ivar_table): deprecate
+ * internal.h (rb_attr_delete): declare
+ * marshal.c (has_ivars): use rb_ivar_foreach
+ (w_ivar): ditto
+ (w_object): update for new interface
+ * time.c (time_mload): use rb_attr_delete
+ * variable.c (generic_ivar_delete): implement
+ (rb_ivar_delete): ditto
+ (rb_attr_delete): ditto
+ [ruby-core:69323] [Feature #11170]
-Thu May 2 16:55:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 30 09:14:28 2015 Scott Francis <scott.francis@shopify.com>
- * thread.c (id_locals): use cached ID.
+ * cont.c (cont_free): check if ruby_current_thread is still valid.
+ [Fix GH-914]
- * vm.c (ruby_thread_init): ditto.
+Sat May 30 08:36:04 2015 Eric Wong <e@80x24.org>
- * defs/id.def: add more predefined IDs used in core.
+ * variable.c (static int special_generic_ivar): move
+ (rb_generic_ivar_table): rewrite for compatibility
+ (gen_ivtbl_bytes): new function
+ (generic_ivar_get): update to use ivar index
+ (generic_ivar_update): ditto
+ (generic_ivar_set): ditto
+ (generic_ivar_defined): ditto
+ (generic_ivar_remove): ditto
+ (rb_mark_generic_ivar): ditto
+ (givar_i): ditto
+ (rb_free_generic_ivar): ditto
+ (rb_mark_generic_ivar_tbl): ditto
+ (rb_generic_ivar_memsize): ditto
+ (rb_copy_generic_ivar): ditto
+ (rb_ivar_set): ditto
+ (rb_ivar_foreach): ditto
+ (rb_ivar_count): ditto
+ (givar_mark_i): remove
+ (gen_ivtbl_mark): new function
+ (gen_ivar_each): ditto
+ (iv_index_tbl_extend): update for struct ivar_update
+ (iv_index_tbl_newsize): ditto
+ [ruby-core:69323] [Feature #11170]
-Thu May 2 13:42:42 2013 Ryan Davis <ryand-ruby@zenspider.com>
+Sat May 30 08:10:46 2015 Eric Wong <e@80x24.org>
- * lib/minitest/*: Imported minitest 4.7.4 (r8483)
- * test/minitest/*: ditto
+ * variable.c (iv_index_tbl_make): extract from rb_ivar_set
+ (iv_index_tbl_extend): ditto
+ (iv_index_tbl_newsize): ditto
+ (rb_ivar_set): use extracted functions
+ [ruby-core:69323] (Part 1)
-Thu May 2 11:32:22 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri May 29 17:39:14 2015 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (poll_child_status): [experimental] set the cause of
- a child's death to status if its exitcode seems to be an error.
+ * tool/make_hgraph.rb: added.
- * test/ruby/test_process.rb (TestProcess#test_no_curdir): maybe now
- we can test it.
+Fri May 29 14:39:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_thread.rb (TestThread#test_thread_timer_and_interrupt):
- ditto.
-
-Thu May 2 11:24:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * compile.c (iseq_compile_each): out of range NTH_REF is always
+ nil.
- * lib/yaml.rb: nodoc EngineManager, add History doc #8344
+ * parse.y (parse_numvar): check overflow of NTH_REF and range.
+ [ruby-core:69393] [Bug #11192]
-Wed May 1 21:11:17 2013 Tanaka Akira <akr@fsij.org>
+ * util.c (ruby_scan_digits): make public and add length parameter.
- * time.c (localtime_with_gmtoff_zone): musl libc may return NULL for
- tm_zone.
+Fri May 29 11:18:58 2015 Eric Wong <e@80x24.org>
-Wed May 1 18:59:36 2013 Benoit Daloze <eregontp@gmail.com>
+ * ext/socket/ancdata.c (bsock_sendmsg_internal,
+ bsock_recvmsg_internal):
+ avoid redundant fcntl on Linux
+ [ruby-core:69154] [Feature #11145]
+ * ext/socket/init.c (rsock_s_recvfrom_nonblock): ditto
+ * ext/socket/rubysocket.h (MSG_DONTWAIT_RELIABLE): new macro
- * enum.c (Enumerable#chunk): fix grammar of error message
- for symbols beginning with an underscore [Bug #8351]
+Fri May 29 10:30:34 2015 Eric Wong <e@80x24.org>
-Wed May 1 16:47:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/resolv.rb (request): use monotonic clock
+ * lib/net/http.rb (begin_transport, end_transport): ditto
+ [ruby-core:69384] [Feature #11124]
- * ext/curses/extconf.rb (curses_version): try once for each tests, a
- function or a variable. fallback to variable for old SVR4.
+Fri May 29 04:37:38 2015 Koichi Sasada <ko1@atdot.net>
-Wed May 1 16:17:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c: add two methods to debug internals.
- * ext/extmk.rb (extmake): extensions not to be installed should not
- make static libraries, but make dynamic libraries always.
+ * ObjectSpace.internal_class_of: return RBASIC_CLASS(obj).
+ * ObjectSpace.internal_super_of: return RCLASS_SUPER(cls).
-Wed May 1 12:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * NEWS: add information about both methods.
- * lib/rake/version.rb: Fix RDoc warning with :include: [Bug #8347]
+ * test/objspace/test_objspace.rb: add tests for both methods.
-Wed May 1 11:40:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 28 06:55:53 2015 Anton Davydov <antondavydov.o@gmail.com>
- * defs/id.def (predefined): add "idProc".
+ * ext/tk/sample/figmemo_sample.rb (open_file),
+ ext/tk/sample/tktextio.rb (TkTextIO): fix typo in messages.
+ [Fix GH-916]
- * eval.c (frame_func_id): use predefined IDs.
+Wed May 27 09:50:51 2015 Eric Wong <e@80x24.org>
- * proc.c (mnew, mproc, mlambda): use predefined IDs.
+ * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
+ ossl_asn1_decode_all): use RB_GC_GUARD instead of volatile
+ [ruby-core:69371] [Bug #11185]
- * vm.c (rb_vm_control_frame_id_and_class): ditto.
+Wed May 27 09:27:30 2015 Eric Wong <e@80x24.org>
- * vm.c (Init_VM): ditto.
+ * lib/drb/drb.rb (set_sockopt): remove redundant fcntl call
+ * lib/drb/unix.rb (set_sockopt): ditto
+ [ruby-core:69128] [Feature #11137]
-Tue Apr 30 23:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue May 26 22:10:43 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/benchmark.rb: Update Benchmark results on newer CPU
+ * vm_method.c (rb_alias): should resolve refined methods.
+ [ruby-core:69360] [Bug #11182]
-Tue Apr 30 12:31:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 26 21:35:13 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * proc.c (mproc, mlambda): use frozen core methods instead of plain
- global methods, so that methods cannot be overridden.
- [ruby-core:54687] [Bug #8345]
+ * include/ruby/defines.h (RUBY_ATTR_ALLOC_SIZE): fix condition.
- * vm.c (Init_VM): define proc and lambda on the frozen core object.
+Mon May 25 22:35:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * include/ruby/intern.h (rb_block_lambda): add declaration instead of
- deprecated rb_f_lambda.
+ * tool/redmine-backporter.rb (rel): after the relations is changed,
+ @changesets is no longer right.
-Mon Apr 29 17:02:30 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Mon May 25 11:27:14 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/nkf/nkf-utf8/nkf.h: Bionic libc doesn't have locale.
- [Feature #8338]
+ * win32/win32.c (setup_overlapped): seek to the file end only when
+ writing (mode:a), not reading (mode:a+, read).
+Mon May 25 00:27:37 2015 Benoit Daloze <eregontp@gmail.com>
-Mon Apr 29 06:58:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (Numeric#negative?): [DOC] Fix call-seq.
+ Patch by @yui-knk. [Fixes GH-908]
- * ext/openssl/ossl_bn.c (ossl_bn_initialize): no need of alloca for
- small fixed size array.
+Sun May 24 01:35:22 2015 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_bn.c (ossl_bn_initialize): check overflow first,
- and use alloca for small size input.
+ * debug.c (ruby_debug_print_id): use rb_id2name() for fprintf().
-Mon Apr 29 00:40:13 2013 Benoit Daloze <eregontp@gmail.com>
+Sat May 23 18:38:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/yaml.rb: Clarify documentation about YAML being always Psych.
- Give a tip about using Syck. See #8344.
+ * man/*.1: updated dates in man pages.
+ [ruby-dev:48988] [Bug #11171]
-Sun Apr 28 23:34:01 2013 Benoit Daloze <eregontp@gmail.com>
+Sat May 23 03:10:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/yaml.rb: Use another trick to define the YAML module.
- https://twitter.com/n0kada/status/328342207511801856
+ * win32/win32.c (rb_w32_write_console): should return the count of
+ actually eaten characters, include escape sequences.
-Sun Apr 28 23:19:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Fri May 22 22:36:14 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * lib/pp.rb: Update PP module overview by @geopet
+ * lib/prime.rb: Remove obsolete Prime.new
+ patch by Ajay Kumar. [Fixes GH-891]
-Sun Apr 28 22:04:37 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Fri May 22 21:13:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_bn.c (ossl_bn_initialize): fix buffer overflow on
- x64 Windows and memory leak when initializing with integer.
- [ruby-core:54615] [Bug #8337]
+ * include/ruby/intern.h (rb_sym_count): move `rb_sym_all_symbols`
+ to a symbol.c specific section. a part of patch by Lourens
+ Naude.
-Sun Apr 28 12:38:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 22 20:56:33 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * README.EXT: correct method name to be used. [Bug #7982]
+ * complex.c (f_complex_polar): simple bug reproduced only when y is
+ a float but x is not a float.
- * README.EXT.ja: add notes too.
+Fri May 22 19:42:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Apr 28 10:35:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * process.c (rb_spawn_process): do not discard global escape
+ status. [ruby-core:69304] [Bug #11166]
- * object.c: With feedback from Steve Klabnik, reverted a change to
- #untrusted? and #tainted?. Also adjusted grammar for $SAFE levels
+ * process.c (rb_execarg_spawn): extract the start procedure in a
+ parent process with ensuring the end procedure.
-Sun Apr 28 10:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Fri May 22 16:48:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/yaml.rb: Disable setting YAML const twice [ruby-core:54642]
+ * NEWS: added news for net-telnet and rake
-Sun Apr 28 09:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu May 21 20:27:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * object.c: Documentation for taint and trust [Bug #8162]
+ * configure.in (RUBY_DTRACE_POSTPROCESS): cmp -b is GNU extension.
+ darwin uses GNU cmp, and FreeBSD and Solaris are not.
+ Note that accidentally equals to expected result.
-Sun Apr 28 09:40:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu May 21 18:00:19 2015 Koichi Sasada <ko1@atdot.net>
- * README.EXT: Copy note from r40505 for rb_sprintf() [Bug #7982]
+ * iseq.c: constify.
-Sun Apr 28 08:28:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * iseq.h: ditto.
- * ext/curses/curses.c: Update Curses::Window example for nicer output
- Patch by Michal Suchanek [Bug #8121] [ruby-core:53520]
+ * method.h: ditto.
-Sun Apr 28 08:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * proc.c: ditto.
- * README.EXT: Update note from r40504, by Jeremy Evans [Bug #7982]
+ * vm_method.c: ditto.
-Sun Apr 28 08:02:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu May 21 17:44:53 2015 Koichi Sasada <ko1@atdot.net>
- * README.EXT: Add note to warn use of %i in Exceptions [Bug #7982]
+ * proc.c: fix issues caused by binding created from Method#to_proc.
+ [Bug #11163]
-Sun Apr 28 02:41:05 2013 Tanaka Akira <akr@fsij.org>
+ * vm.c (vm_cref_new_toplevel): export as rb_vm_cref_new_toplevel().
- * configure.in: Fix a typo. Should check endgrent() instead of
- endgrnam().
+ * test/ruby/test_method.rb: add some assertions.
-Sun Apr 28 00:35:45 2013 Tanaka Akira <akr@fsij.org>
+Thu May 21 17:29:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * process.c (obj2gid): Don't call endgrent() if not exist.
- Bionic (Android's libc) don't have endgrent().
+ * lib/matrix.rb: added documentation for Matrix#empty and Matrix#/
+ [Feature #10070][ruby-dev:48433] Patch by @gogotanaka
- * configure.in: Check endgrnam function.
+Thu May 21 17:02:43 2015 Koichi Sasada <ko1@atdot.net>
-Sat Apr 27 23:53:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+ * proc.c: rename functions.
+ * method_get_def() -> method_def()
+ * method_get_iseq() -> method_def_iseq()
+ * method_get_cref() -> method_cref()
- * lib/yaml.rb: add security warning to YAML documentation
+Thu May 21 16:52:44 2015 Koichi Sasada <ko1@atdot.net>
-Sat Apr 27 23:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * proc.c (rb_method_get_iseq): rename to rb_method_iseq.
- * lib/yaml.rb: Documentation for YAML module [Bug #8213]
+ * iseq.c: catch up this fix.
-Sat Apr 27 20:19:21 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.h: commit ditto.
- * thread_pthread.c (ruby_init_stack): Add STACK_GROW_DIR_DETECTION.
- This fixes a compilation failure while cross-compiling for Tensilica
- Xtensa Processor.
+Thu May 21 15:41:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sat Apr 27 19:32:44 2013 Benoit Daloze <eregontp@gmail.com>
+ * lib/net/telnet.rb: gemify net-telnet.
+ [Feature #11083]
+ * gems/bundled_gems: added net-telnet to bundled gems.
- * thread.c: fix typos and documentation
+Thu May 21 15:37:32 2015 Zachary Scott <e@zzak.io>
-Sat Apr 27 19:04:55 2013 Tanaka Akira <akr@fsij.org>
+ * vm_method.c: Remove private attribute warning [Bug #10967]
+ Patch by @spastorino [Fixes GH-849]
+ https://github.com/ruby/ruby/pull/849
- * sparc.c: Use __asm__ instead of asm for gcc.
- gcc doesn't provide asm keyword if -ansi option is given.
- http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
+ * test/ruby/test_module.rb: Update test for changes
-Sat Apr 27 17:22:50 2013 Tanaka Akira <akr@fsij.org>
+Thu May 21 10:59:43 2015 Koichi Sasada <ko1@atdot.net>
- * ext/socket/extconf.rb: Redundant test removed.
+ * proc.c (method_proc): rename to method_to_proc.
-Sat Apr 27 16:00:10 2013 Tanaka Akira <akr@fsij.org>
+Thu May 21 10:51:54 2015 Jake Worth <jakeworth82@gmail.com>
- * ext/socket/extconf.rb (test_recvmsg_with_msg_peek_creates_fds):
- Extracted.
+ * io.c (rb_f_select): [DOC] Fixes for grammar and style.
+ [Fix GH-906]
-Sat Apr 27 15:50:40 2013 Tanaka Akira <akr@fsij.org>
+Thu May 21 08:25:19 2015 Eric Wong <e@80x24.org>
- * internal.h (SIGNED_INTEGER_TYPE_P): New macro.
- (SIGNED_INTEGER_MAX): Ditto.
- (SIGNED_INTEGER_MIN): Ditto.
- (UNSIGNED_INTEGER_MAX): Ditto.
- (TIMET_MAX): Use SIGNED_INTEGER_MAX and UNSIGNED_INTEGER_MAX.
- (TIMET_MIN): Use SIGNED_INTEGER_MIN.
+ * variable.c (Init_var_tables): init generic_iv_tbl
+ (rb_generic_ivar_table, generic_ivar_get, generic_ivar_set,
+ generic_ivar_defined, generic_ivar_remove,
+ rb_mark_generic_ivar, givar_i, rb_mark_generic_ivar_tbl,
+ rb_free_generic_ivar, rb_copy_generic_ivar, rb_ivar_foreach,
+ rb_ivar_count): remove checks for uninitialize generic_iv_tbl
+ [ruby-core:69155] [Feature #11146]
- * thread.c (TIMEVAL_SEC_MAX): Use SIGNED_INTEGER_MAX.
- (TIMEVAL_SEC_MIN): Use SIGNED_INTEGER_MIN.
+Thu May 21 04:11:03 2015 Koichi Sasada <ko1@atdot.net>
-Sat Apr 27 10:52:52 2013 Tanaka Akira <akr@fsij.org>
+ * iseq.c (exception_type2symbol): show correct bug message.
- * thread.c (TIMEVAL_SEC_MAX, TIMEVAL_SEC_MIN): Consider environments,
- sizeof(time_t) is smaller than sizeof(tv_sec), such as
- OpenBSD 5.2 (amd64).
+Wed May 20 23:19:05 2015 Yusuke Endoh <mame@ruby-lang.org>
-Fri Apr 26 23:34:59 2013 Kouhei Sutou <kou@cozmixng.org>
+ * lib/base64.rb: Fix rdoc-formatting for padding argument.
+ [fix GH-905][ci skip] Patch by @davydovanton
- * lib/rexml/text.rb (REXML::Text.normalize): Fix a bug that all
- entity filters are ignored. [ruby-dev:47278] [Bug #8302]
- Patch by Ippei Obayashi. Thanks!!!
- * test/rexml/test_entity.rb (EntityTester#test_entity_filter): Add
- a test of the above change.
+Wed May 20 13:16:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 26 22:53:55 2013 Kouhei Sutou <kou@cozmixng.org>
+ * configure.in (DEPRECATED_BY): deprecate warning with preferable
+ alternative.
- * lib/rexml/element.rb (REXML::Attributes#to_a): Support
- namespaced attributes. [ruby-dev:47277] [Bug #8301]
- Patch by Ippei Obayashi. Thanks!!!
- * test/rexml/test_attributes.rb
- (AttributesTester#test_to_a_with_namespaces): Add a test of the
- above change.
+ * configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in
+ the macro.
-Fri Apr 26 21:48:29 2013 Kouhei Sutou <kou@cozmixng.org>
+Wed May 20 11:23:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss/atom.rb (RSS::Atom::Entry): Fix indent of document comment.
+ * vm_dump.c (rb_print_backtrace): return value of libexec's backtrace
+ is size_t, so simply cast as int.
-Fri Apr 26 21:21:17 2013 Kouhei Sutou <kou@cozmixng.org>
+Tue May 19 18:54:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/maker.rb (RSS::Maker): Fix indent of document comment.
+ * iseq.c (rb_iseq_compile_with_option): check source type, must be
+ an IO or a String. [ruby-core:69219] [Bug #11159]
-Fri Apr 26 18:41:04 2013 Tanaka Akira <akr@fsij.org>
+Tue May 19 17:15:03 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/socket/extconf.rb: Use a block of enable_config() for
- --{enable,disable}-close-fds-by-recvmsg-with-peek configure option
+ * lib/benchmark.rb: Update Benchmark documentation and formatting.
+ [fix GH-903][ci skip] Patch by @davydovanton
-Fri Apr 26 18:08:08 2013 Tanaka Akira <akr@fsij.org>
+Tue May 19 13:10:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (dir_set_pos): Fix a compilation error when seekdir() is not
- exist.
+ * numeric.c (num_positive_p): should false on Bignum 0.
+ http://twitter.com/rafaelfranca/status/600509783427391488
+ [ruby-core:69173] [Feature #11151]
-Fri Apr 26 17:41:17 2013 Tanaka Akira <akr@fsij.org>
+Tue May 19 11:22:28 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * thread_pthread.c (ruby_init_stack): Add STACK_GROW_DIR_DETECTION.
- This fixes a compilation failure while cross-compiling for ARM.
+ * lib/uri/rfc2396_parser.rb (initialize_pattern):
+ URI::Generic.build should accept port as a string.
+ pattern[:PORT] is not defined for long.
+ by Dave Slutzkin <daveslutzkin@fastmail.fm>
+ https://github.com/ruby/ruby/pull/804 fix GH-804
-Fri Apr 26 14:35:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue May 19 11:18:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/atom.rb: Documentation for RSS::Atom based on a patch by
- Michael Denomy
- * lib/rss/maker.rb: Documentation for RSS::Maker also by @mdenomy
+ * include/ruby/ruby.h (rb_data_typed_object_alloc),
+ (rb_data_object_alloc): add old names for source level backward
+ compatibilities.
-Fri Apr 26 12:41:22 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc): add
+ aliases for binary level backward compatibilities.
- * ext/curses/extconf.rb: Test linkability of curses_version at first.
+Tue May 19 09:54:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/extconf.rb: Test the behavior of fd passing with MSG_PEEK
- only if recvmsg(), msg_control member, AF_UNIX and SCM_RIGHTS are
- available.
+ * include/ruby/ruby.h (Data_Make_Struct0): needs function pointer
+ casts to fix function overloading in C++.
-Fri Apr 26 00:07:52 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Tue May 19 09:43:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rinda/ring.rb (Rinda::RingServer#initialize): accept array
- arguments of address to specify multicast interface.
+ * include/ruby/ruby.h (Data_Make_Struct0, TypedData_Make_Struct0):
+ explicit cast from void* is necessary as implicit cast is
+ disallowed in C++.
- * lib/rinda/ring.rb (Rinda::RingServer#make_socket): add optional
- arguments for multicast interface.
+Mon May 18 15:31:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rinda/test_rinda.rb
- (TestRingFinger#test_ring_server_ipv4_multicast,
- TestRingFinger#test_ring_server_ipv6_multicast): add tests for
- above change.
+ * include/ruby/intern.h (rb_f_notimplement): should not respond to
+ not-implemented methods. as the address inside a DLL and the
+ imported address are different on Windows, use an exported
+ variable to share the same address.
- * test/rinda/test_rinda.rb
- (TestRingServer#test_make_socket_ipv4_multicast,
- TestRingServer#test_make_socket_ipv6_multicast): change bound
- interface address because multicast address is not allowed on Linux
- or Windows.
- [ruby-core:53692] [Bug #8159]
+Mon May 18 13:55:01 2015 Shugo Maeda <shugo@ruby-lang.org>
-Thu Apr 25 23:45:02 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ * lib/monitor.rb (mon_try_enter, mon_enter): should reset @mon_count
+ just in case the previous owner thread dies without mon_exit.
+ [fix GH-874] Patch by @chrisberkhout
- * lib/rinda/ring.rb (Rinda::RingServer#initialize): add a socket
- to @sockets in make_socket() to close sockets on shutdown even if
- make_socket() is called after initialize.
+Sun May 17 17:21:29 2015 Eric Wong <e@80x24.org>
- * lib/rinda/ring.rb (Rinda::RingServer#make_socket): ditto.
+ * lib/webrick/utils.rb (set_non_blocking): use IO#nonblock=
+ * (set_close_on_exec): use IO#close_on_exec=
+ [Feature #11136]
-Thu Apr 25 23:39:42 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Sun May 17 15:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rinda/test_rinda.rb (TupleSpaceProxyTest#test_take_bug_8215):
- use KILL on Windows since TERM doen't work and ruby process remains
- after test-all on Windows.
+ * numeric.c (num_positive_p, num_negative_p): add methods
+ Numeric#positive? and Numeric#negative?.
+ [ruby-core:69173] [Feature #11151]
-Thu Apr 25 23:16:28 2013 Tanaka Akira <akr@fsij.org>
+ * numeric.c (flo_positive_p, flo_negative_p): specialized
+ functions for Float.
- * ext/curses/extconf.rb: Implement
- --with-curses-version={function,variable} configure option for
- cross-compiling.
+ * complex.c (Init_Complex): Complex do not have positive? and
+ negative? methods
-Thu Apr 25 18:15:46 2013 Tanaka Akira <akr@fsij.org>
+Sun May 17 14:57:42 2015 Eric Wong <e@80x24.org>
- * ext/socket/extconf.rb: Don't use WIDE getaddrinfo by default.
+ * lib/webrick/server.rb (accept_client): avoid redundant fcntl call
+ [Feature #11137]
-Thu Apr 25 17:56:39 2013 Tanaka Akira <akr@fsij.org>
+Sun May 17 12:13:33 2015 Eric Wong <e@80x24.org>
- * ext/socket/extconf.rb: Remove obsolete options: ---with-ipv6-lib and
- --with-ipv6-libdir.
+ * ext/socket/init.c (cloexec_accept): support nonblock flag and
+ use SOCK_NONBLOCK if possible
+ * ext/socket/init.c (rsock_s_accept_nonblock):
+ update cloexec_accept call
+ * ext/socket/init.c (accept_blocking): ditto for blocking
+ * test/socket/test_nonblock.rb: check nonblock? on accepted socket
+ [Feature #11138]
-Thu Apr 25 17:43:49 2013 Tanaka Akira <akr@fsij.org>
+Sun May 17 03:58:59 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * ext/socket/extconf.rb: Implement
- --{enable,disable}-close-fds-by-recvmsg-with-peek configure option
- for cross-compiling.
- Make --{enable,disable}-wide-getaddrinfo configure option
- cross-compiling friendly.
+ * load.c (loaded_feature_path): stop returning false negatives for
+ filenames which are trailing substrings of file extensions. For
+ example, 'b', which a trailing substring of ".rb" should not return
+ false. [Bug #11155][ruby-core:69206]
-Thu Apr 25 16:11:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_autoload.rb: test for fix
- * io.c (rb_io_ext_int_to_encs, parse_mode_enc): bom-prefixed name is
- not a real encoding name, just a fallback. so the proper conversion
- should take place even if if the internal encoding is equal to the
- bom-prefixed name, unless actual encoding is equal to the internal
- encoding. [ruby-core:54563] [Bug #8323]
+Sat May 16 21:41:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * io.c (io_set_encoding_by_bom): reset extenal encoding if no BOM
- found. [ruby-core:54569]
+ * string.c: added documentation for character sequence \' with String#sub
+ [Bug #11132][ruby-core:69121][fix GH-900][ci skip] Patch by @shishir127
-Thu Apr 25 14:35:01 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat May 16 21:38:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/openssl/ossl_bn.c (ossl_bn_initialize): allow Fixnum and Bignum.
- [ruby-core:53986] [Feature #8217]
+ * enum.c: fix a sample code. Patch by @eagletmt
+ [fix GH-901][ci skip]
-Thu Apr 25 14:26:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat May 16 21:17:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.
- It gets encoding argument to specify the character encoding.
- It now allows loose percent encoded strings, but denies ;-separator.
- [ruby-core:53475] [Bug #8103]
+ * gc.c (rb_data_object_wrap, rb_data_typed_object_wrap): rename
+ alloc as wrap. these functions do not allocate data pointers
+ but just wrap the given pointers.
- * lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.
- It gets encoding argument to convert before percent encode.
- Now UTF-16 strings aren't converted to UTF-8 before percent encode
- by default.
+Sat May 16 19:59:24 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Apr 25 14:26:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+ * win32/win32.c (rb_w32_accept): simplified.
- * benchmark/bm_hash_shift.rb: add benchmark for Hash#shift
+Fri May 15 18:28:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_hash_shift): use st_shift if hash is not being iterated to
- delete element without iterating the whole hash.
+ * array.c (rb_ary_assoc, rb_ary_rassoc): [DOC] the result when key
+ was found is the existing element, not a new array. reported by
+ Giau Nguyen <giaunv AT nustechnology.com>.
- * hash.c (shift_i): remove function
+Fri May 15 08:24:28 2015 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * include/ruby/st.h (st_shift): add st_shift function
+ * lib/cgi/cookie.rb: Implement HttpOnly flag for cookies.
+ [fix GH-887] Patch by @martinpovolny
- * st.c (st_shift): ditto
+Fri May 15 06:54:19 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- [Bug #8312] [ruby-core:54524] Patch by funny-falcon
+ * variable.c: Change autoload to call `require` through Ruby rather
+ than directly calling `rb_require_safe`. This allows things like
+ RubyGems to intercept file loading done though `autoload`.
+ [Feature #11140]
-Thu Apr 25 12:03:38 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_autoload.rb: Test for change.
- * ext/socket/extconf.rb: Extract C programs as toplevel constants.
+Wed Apr 8 19:18:02 2015 Shota Fukumori (sora_h) <her@sorah.jp>
-Thu Apr 25 02:23:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c (enum_grep_v, grep_i, grep_iter_i, Init_enum):
+ Implement Enumerable#grep_v. [Feature #11049]
- * configure.in (RUBY_RM_RECURSIVE): this hack is needed by only
- autoconf 2.69 or earlier on darwin.
+Thu May 14 15:54:13 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Thu Apr 25 01:22:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/pathname/lib/pathname.rb: Remove condition of RUBY_VERSION <= 1.9.
+ [Feature #11082]
- * lib/tracer.rb (get_line): simply read by File.readlines.
+Wed May 13 17:10:37 2015 Masaki Matsushita <glass.saga@gmail.com>
- * lib/debug.rb (script_lines): get source lines from SCRIPT_LINES__ or
- read from the file.
+ * enum.c (enum_to_a): revert r50457.
+ it requires recursion check.
+ then, it doesn't make performance improvement.
+ [Bug #11130] [Feature #9118]
- * lib/debug.rb (display_list): use script_lines instead of recursion.
- [Bug #8318]
+Wed May 13 11:13:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/debug.rb (line_at): use script_lines same as display_list.
+ * parse.y (parse_gvar): separate message for gvar without
+ non-space characters from message for invalid identifiers.
- * lib/debug.rb (display_list): Fix debug listing when called from the
- same file it has been required. patch by Dario Bertini <berdario AT
- gmail.com> [Bug #8318] [fix GH-280]
+Tue May 12 22:18:27 2015 Masaki Matsushita <glass.saga@gmail.com>
-Wed Apr 24 21:51:13 2013 Tanaka Akira <akr@fsij.org>
+ * enum.c (enum_to_a): fix incompatibility introduced in r50457.
+ [Bug #11130]
- * configure.in: Check mblen().
- mblen() is optional in uClibc.
+ * test/ruby/test_enum.rb: test for above.
- * eval_intern.h (CharNext): Don't use mblen() is not available.
+Tue May 12 17:08:03 2015 Koichi Sasada <ko1@atdot.net>
-Wed Apr 24 15:55:06 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * method.h: remove unused declaration.
- * io.c (rb_fd_fix_cloexec): use rb_update_max_fd().
+Mon May 11 10:58:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Wed Apr 24 14:08:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * gems/bundled_gems: Update minitest-5.6.1 and power_assert-0.2.3.
- * numeric.c: Fix wiki link on Float imprecision in overview, patched
- by Makoto Kishimoto [Bug #8304] [ruby-dev:47280]
+Mon May 11 00:20:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 24 14:03:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h (Data_Make_Struct, TypedData_Make_Struct):
+ allocate wrapper data object before allocating DATA_PTR to get
+ rid of possible memory leak when the former failed.
- * parse.y (parser_yylex): disallow $- without following identifier
- character. [ruby-talk:406969]
+Sun May 10 21:32:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (is_special_global_name): mere $- is not a valid global
- variable name.
+ * gc.c (gc_mark_children): call dmark function for non-NULL
+ pointers only, so that DATA_PTR can be NULL safely now.
-Wed Apr 24 13:54:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Sun May 10 16:23:58 2015 Kazuki Tsujimoto <kazuki@callcc.net>
- * string.c: Document String#setbyte return value by @gjmurakami-10gen
- [Fixes GH-294]
+ * proc.c (proc_binding): fix segmentation fault on marking phase.
+ envptr of newenvval should not be NULL.
-Wed Apr 24 13:45:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ You can reproduce by
+ make test-all TESTS='--gc-stress -n test_to_proc_binding ruby/test_method.rb'
- * class.c: Example of Object#methods by @windwiny [Fixes GH-293]
- * ruby.c: Document return values of Kernel #sub, #gsub, and #chop
+Sun May 10 12:41:18 2015 Masaki Matsushita <glass.saga@gmail.com>
-Wed Apr 24 12:54:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/zlib/zlib.c (rb_gzreader_external_encoding):
+ define GzipReader#external_encoding.
+ [Bug #10900]
- * ext/socket/lib/socket.rb: Doc typos by @vipulnsward [Fixes GH-292]
+ * test/zlib/test_zlib.rb: test for above.
+Sun May 10 11:57:48 2015 Masaki Matsushita <glass.saga@gmail.com>
-Wed Apr 24 12:54:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/win32ole/win32ole_variant.c: fix typo "indicies".
+ the patch is from davydovanton <antondavydov.o at gmail.com>.
+ [fix GH-892]
- * ext/socket/lib/socket.rb: Doc typos by @vipulnsward [Fixes GH-292]
+ * lib/rubygems/indexer.rb: ditto.
-Wed Apr 24 12:27:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/rubygems/test_gem_indexer.rb: ditto.
- * array.c: Fix documentation for Array#index and #replace aliases
- Based on a patch by @phiggins [Fixes GH-282]
+Sun May 10 11:44:37 2015 Masaki Matsushita <glass.saga@gmail.com>
-Tue Apr 23 21:14:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * string.c (rb_str_crypt): Raise ArgumentError when
+ string passed to String#crypt contains null.
+ the patch is from jrusnack <jrusnack at redhat.com>.
+ [Bug #10988] [fix GH-853]
- * string.c (rb_str_inspect): refix r40413, on Ruby 1.9 usual character
- escape uses hex/Unicode escapes, so fix to use Unicode escape on
- Unicode strings and hex on others. [ruby-core:54458] [Bug #8290]
+ * test/ruby/test_string.rb: test for above.
-Tue Apr 23 20:10:02 2013 Tanaka Akira <akr@fsij.org>
+Sun May 10 11:23:03 2015 Masaki Matsushita <glass.saga@gmail.com>
- * missing/isnan.c (isnan): Don't define if isnan() macro is defined.
- This fixes a compilation failure on uClibc based Gentoo system.
+ * enum.c (enum_to_a): Use size to set array capa when possible.
+ the patch is from HonoreDB <aweiner at mdsol.com>.
+ [fix GH-444]
-Tue Apr 23 17:40:40 2013 Martin Duerst <duerst@it.aoyama.ac.jp>
+Sat May 9 06:48:36 2015 Eric Wong <e@80x24.org>
- * lib/rexml/document.rb, lib/rexml/element.rb,
- lib/rexml/formatters/pretty.rb: remove opinionated
- language in documentation. [Bug #8309],
- reported by Charles Beckmann
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
+ [Bug #11123]
-Tue Apr 23 14:04:44 2013 Shugo Maeda <shugo@ruby-lang.org>
+Fri May 8 22:57:24 2015 takiy33 <takiy33@gmail.com>
- * lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
- response correctly. [ruby-core:54365] [Bug #8281]
+ * test/matrix/test_matrix.rb (test_determinant): refactor test on
+ Matrix#determinant, by merging with test_det for an alias method
+ det. [Fix GH-897]
-Tue Apr 23 11:58:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 8 15:43:11 2015 Shugo Maeda <shugo@ruby-lang.org>
- * string.c (rb_str_scrub): fix for UTF-32. strlen() on strings
- contain NUL returns wrong result, use sizeof operator instead.
- [ruby-dev:45975] [Feature #6752]
+ * lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
+ is omitted. [ruby-core:69093] [Bug #11128]
-Tue Apr 23 10:26:50 2013 Akinori MUSHA <knu@iDaemons.org>
+Fri May 8 15:05:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/ruby/test_module.rb
- (TestModule#test_const_get_invalid_name)
- (test_const_defined_invalid_name): Fix expected values.
+ * doc/syntax/control_expressions.rdoc: fix a missing "a"
+ [fix GH-888][ci skip] Patch by @riffraff
-Tue Apr 23 09:51:26 2013 Akinori MUSHA <knu@iDaemons.org>
+Fri May 8 12:11:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_inspect): NUL should not be represented as "\0"
- when octal digits may follow. [ruby-core:54458] [Bug #8290]
+ * vm_eval.c (rb_method_call_status): resolve refined method entry
+ to check if undefined. [ruby-core:69064] [Bug #11117]
-Mon Apr 22 22:54:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+Thu May 7 22:22:59 2015 Sho Hashimoto <sho-h@ruby-lang.org>
- * insns.def (opt_mod): Use % operator if both operands are positive for
- a significant performance improvement. Thanks to @samsaffron.
+ * proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]
-Mon Apr 22 17:09:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 7 11:32:57 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * marshal.c (r_object0): copy all instance variables not only generic
- ivars, before calling post proc. [ruby-core:51163] [Bug #7627]
+ * Makefile.in (rbconfig.rb): add rule to make.
-Mon Apr 22 10:25:21 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu May 7 05:14:39 2015 Eric Wong <e@80x24.org>
- * util.c (ruby_hdtoa): revert r29729.
- If you want ruby to behave as before on x86, specify to use SSE like
- -msse2 -mfpmath=sse for gcc.
+ * ext/socket/lib/socket.rb (connect_nonblock): use IO#wait_writable
+ * lib/drb/drb.rb (DRB::DRbTCPSocket#alive?): use IO#wait_readable
+ * lib/webrick/httpserver.rb (run): ditto
+ * lib/resolv.rb (request): ditto for single socket case
+ [ruby-core:68943] [Feature #11081]
-Sun Apr 21 23:19:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+Wed May 6 22:49:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: Revert using sigsetjmp by default due to performance
- problems on some systems (eg. older Linux)
+ * vm_eval.c (rb_method_call_status): undefined refined method is
+ not callable unless using. [ruby-core:69064] [Bug #11117]
-Sun Apr 21 21:35:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+Sun May 3 22:40:06 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * configure.in: Use sigsetjmp by default so jumping out of signal
- handlers properly restores the signal mask and SS_ONSTACK flag.
- [ruby-core:54175] [Bug #8254]
+ * ext/-test-/file/fs.c: need to include sys/statvfs.h
+ to use statvfs().
- * configure.in: Manually check for presence of sigsetjmp. It is not a
- function on some systems, so AC_CHECK_FUNCS cannot be used.
+ * ext/-test-/file/extconf.rb: check the existence of
+ sys/statvfs.h
-Sun Apr 21 08:00:55 2013 Tanaka Akira <akr@fsij.org>
+Sun May 3 21:59:48 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/csv/test_features.rb, test/logger/test_logger.rb
- test/mkmf/test_have_macro.rb, test/net/http/test_http.rb,
- test/openssl/test_config.rb, test/psych/test_encoding.rb,
- test/psych/test_exception.rb, test/psych/test_psych.rb,
- test/psych/test_tainted.rb, test/readline/test_readline.rb,
- test/rexml/test_contrib.rb, test/ruby/test_autoload.rb,
- test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb,
- test/ruby/test_file.rb, test/ruby/test_io.rb,
- test/ruby/test_marshal.rb, test/ruby/test_process.rb,
- test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb,
- test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb,
- test/zlib/test_zlib.rb: Use Tempfile.create.
+ * lib/yaml.rb: fix typo. [ci skip][fix GH-890]
+ Patch by @miketheman
-Sun Apr 21 00:15:36 2013 Tanaka Akira <akr@fsij.org>
+Sun May 3 10:02:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/tempfile.rb (Tempfile.create): Close when the block exits.
+ * range.c (linear_object_p, range_include): test if covered for
+ linear objects. [ruby-core:69052] [Bug #11113]
-Sat Apr 20 23:38:14 2013 Tanaka Akira <akr@fsij.org>
+Fri May 1 13:30:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httpauth/htpasswd.rb: Use Tempfile.create to avoid
- unintentional unlink() by the finalizer.
- lib/webrick/httpauth/htdigest.rb: Ditto.
+ * dln.c (dln_load): check if a different libruby is loaded by the
+ extension library, and then bail out to get rid of very
+ frequently reported stale bug reports.
-Sat Apr 20 22:47:48 2013 Tanaka Akira <akr@fsij.org>
+Thu Apr 30 19:51:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/tempfile.rb (Tempfile.create): New method.
- The method name is proposed by Shugo Maeda. [ruby-dev:47220]
- [ruby-core:41478] [Feature #5707]
+ * compile.c (iseq_compile_each): revert r46873 and r46875, not to
+ allow to execute private readers by pretending op assign.
+ [ruby-core:68984] [Bug #11096]
-Sat Apr 20 14:22:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 30 17:02:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * marshal.c (w_object): dump no ivars to the original by marshal_dump.
- [ruby-core:54334] [Bug #8276]
+ * rational.c: Added documentation for rational literal.
+ [Bug #11075][fix GH-885][ci skip] Patch by @shishir127
- * marshal.c (r_object0): copy all ivars of marshal_dump data to the
- result object instead. [ruby-core:51163] [Bug #7627]
+Thu Apr 30 16:39:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Apr 20 02:33:27 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/socket/ipsocket.c (init_inetsock_internal): preserve errno
+ before other library calls and use rb_syserr_fail.
+ [ruby-core:68531] [Bug #10975]
- * string.c (str_scrub): add ruby method String#scrub which verify and
- fix invalid byte sequence. [ruby-dev:45975] [Feature #6752]
+Thu Apr 30 16:22:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (str_compat_and_valid): check given string is compatible
- and valid with given encoding.
+ * parse.y (lambda): push and reset cmdarg_stack in lambda body.
+ [ruby-core:69017] [Bug #11107]
- * transcode.c (str_transcode0): If invalid: :replace is specified for
- String#encode, replace invalid byte sequence even if the destination
- encoding equals to the source encoding.
+Sun Apr 26 07:36:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 19 21:55:40 2013 Kouhei Sutou <kou@cozmixng.org>
+ * enc/utf_8.c (code_to_mbclen, code_to_mbc): reject values larger
+ than UTF-8 max codepoints. [Feature #11094]
- * README.EXT.ja (Data_Wrap_Struct): Remove a description about
- orphan argument. Oh, I renamed the argument name without
- changing description at r36180... Sorry....
- Patch by Makoto Kishimoto. Thanks!!! [ruby-dev:47269] [Bug #8292]
- * README.EXT.ja (Data_Make_Struct): Add a sample code that describes
- how it works.
- Patch by Makoto Kishimoto. Thanks!!! [ruby-dev:47269] [Bug #8292]
+Sat Apr 25 14:26:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 19 17:54:57 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * string.c (str_buf_cat): expand later so that the buffer can be
+ larger for further use. [Bug #11080] [Bug #11095]
- * lib/net/imap.rb (body_type_msg): should accept
- message/delivery-status with extra data.
- [ruby-core:53741] [Bug #8167]
+Fri Apr 24 23:48:45 2015 Akinori MUSHA <knu@iDaemons.org>
- * test/net/imap/test_imap_response_parser.rb: related test.
+ * misc/ruby-electric.el: Import version 2.2.3 from
+ https://github.com/knu/ruby-electric.el.
-Fri Apr 19 13:03:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 24 10:40:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * marshal.c (w_object): do not dump encoding which is dumped with
- marshal_dump data. [ruby-core:54334] [Bug #8276]
+ * win32/win32.c (rb_w32_{getc,putc}): removed. they are needed for old
+ ruby (before 1.8), but not now.
-Fri Apr 19 11:36:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 24 08:40:13 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (stack_protector): control use of -fstack-protector.
+ * win32/win32.c: remove bcc related code.
- * configure.in (debugflags): let -fstack-protector precede and disable
- debugflags, because they can't work together on SmartOS. [Bug #8268]
+ * include/ruby/win32.h: ditto.
-Fri Apr 19 07:43:52 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Apr 24 08:21:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * test/openssl/test_cipher.rb: Correct a typo
- by jgls <joerg@joergleis.com>
- https://github.com/ruby/ruby/pull/291 fix GH-291
+ * win32/win32.c (rb_acrt_lowio_lock_fh): wrap _pioinfo(i)->lock.
-Thu Apr 18 16:58:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_acrt_lowio_unlock_fh): ditto.
- * vm_method.c (rb_mod_public_method): fix visibility on anonymous
- module. set visibility of singleton method, not method in base
- class. [ruby-core:54404] [Bug #8284]
+Fri Apr 24 06:47:19 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Apr 18 16:20:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (_filbuf): msvc14 doesn't have it, use _fgetc_nolock.
- * dir.c (glob_helper): should skip dot directories only for recursion,
- but should not if matching to the given pattern. [ruby-core:54387]
- [Bug #8283]
+ * win32/win32.c (_flsbuf): msvc14 doesn't have it, use _fputc_nolock.
-Thu Apr 18 16:20:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (vcruntime_file): define vcruntime_file on msvc14
+ because it doesn't export FILE's internal structure.
- * pack.c (pack_unpack): increase buffer size to fix buffer overflow,
- and fix garbage just after unpacking without missing paddings.
- [Bug #8286]
+ * win32/win32.c (FILE_COUNT): added to abstract FILE->_cnt.
-Thu Apr 18 13:35:54 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/win32.c (FILE_READPTR): added to abstract FILE->_ptr.
- * pack.c (pack_unpack): output characters even if the input doesn't
- have paddings. [Bug #8286]
+ * win32/win32.c (FILE_FILENO): added to abstract FILE->_file.
-Thu Apr 18 08:20:48 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/win32.c (init_stdhandle): use FILE_FILENO.
- * common.mk (clean-ext): remove timestamps.
+ * win32/win32.c (rb_w32_getc): use FILE_COUNT and FILE_READPTR.
-Wed Apr 17 22:07:50 2013 Tanaka Akira <akr@fsij.org>
+ * win32/win32.c (rb_w32_putc): ditto.
- * ext/socket/rubysocket.h (SOCKLEN_MAX): Expression simplified.
+Fri Apr 24 06:37:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Apr 17 20:09:19 2013 Aman Gupta <ruby@tmm1.net>
+ * win32/win32.c (dupfd): use _set_osfhnd.
- * compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object().
+ * win32/win32.c (rb_w32_wopen): use _set_osflags.
- * insns.def (setinlinecache): Ditto.
+Thu Apr 24 05:38:01 2015 Koichi Sasada <ko1@atdot.net>
- * iseq.c (rb_iseq_add_mark_object): New function to allocate
- iseq->mark_ary on demand. [Bug #8142]
+ * gc.c (gc_mark_roots): fox to work PRINT_ROOT_TICKS.
- * iseq.h (rb_iseq_add_mark_object): Ditto.
+Fri Apr 24 04:49:05 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed.
+ * win32/Makefile.sub: MSVC14 have struct timespec.
- * iseq.c (rb_iseq_build_for_ruby2cext): Ditto.
+ * win32/rtname.cmd: support vcruntime140.dll.
-Wed Apr 17 20:00:18 2013 Tanaka Akira <akr@fsij.org>
+ * time.c (localtime_with_gmtoff_zone): MSVC14 doesn't have tzname and
+ daylight but have _tzname and _daylight.
- * ext/socket/rubysocket.h (SOCKLEN_MAX): Defined.
+Thu Apr 23 11:35:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/raddrinfo.c (ext/socket/raddrinfo.c): Reject too long
- Linux abstract socket name.
+ * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow
+ symbols to just instance_eval/exec, except for definition of
+ singletons. [ruby-core:68961] [Bug #11086]
-Wed Apr 17 19:45:27 2013 Aman Gupta <tmm1@ruby-lang.org>
+Thu Apr 23 10:01:36 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * iseq.c (iseq_location_setup): re-use existing string when iseq has
- the same path and absolute_path. [Bug #8149]
+ * lib/delegate.rb: fix a typo.
+ [fix GH-881][ci skip] Patch by @Zorbash
-Wed Apr 17 11:38:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Apr 22 18:36:50 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
- UNASSIGNED is not a valid message.
+ * lib/net/imap.rb (move, uid_move): support the MOVE command defined
+ in RFC6851. Patch by ojab ojab.
+ [ruby-core:68960] [Feature #11077]
-Wed Apr 17 10:58:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 22 12:42:12 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * thread.c (sleep_timeval): get rid of overflow on Windows where
- timeval.tv_sec is not time_t but mere long.
+ * test/ruby/test_object.rb: add tests for Kernel#String and Kernel#Array.
+ [fix GH-879][fix GH-880] Patch by @yui-knk
-Tue Apr 16 23:07:12 2013 Tanaka Akira <akr@fsij.org>
+Tue Apr 21 20:46:02 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/socket/unixsocket.c (unix_send_io): Suppress a warning by clang.
- (unix_recv_io): Ditto.
+ * test/ruby/test_object.rb: renamed tests to explicitly class name.
+ [fix GH-877] Patch by @yui-knk
-Tue Apr 16 12:27:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue Apr 21 05:31:00 2015 Eric Wong <e@80x24.org>
- * ext/sdbm/init.c: Fix comment indentation, by windwiny [Fixes GH-277]
+ * ext/socket/lib/socket.rb (connect_internal): avoid common exceptions
+ from connect_nonblock. [ruby-core:68909]
-Tue Apr 16 12:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Mon Apr 20 23:46:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/option.c: Document synonymous methods, by windwiny [GH-277]
- * ext/stringio/stringio.c: ditto
- * ext/io/wait/wait.c: ditto
- * ext/gdbm/gdbm.c: ditto
- * ext/dl/cfunc.c: ditto
- * ext/zlib/zlib.c: ditto
- * ext/win32ole/win32ole.c: ditto
- * ext/dbm/dbm.c: ditto
- * ext/json/generator/generator.c: ditto
- * ext/date/date_core.c: ditto
+ * win32/win32.c (rb_w32_wreadlink): follow the official format of
+ REPARSE_DATA_BUFFER structure.
-Tue Apr 16 11:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Mon Apr 20 20:23:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/*: Document synonymous methods, by windwiny [GH-277]
+ * common.mk ($(arch)-fake.rb): revert r50354 because bsdmake seems not
+ to handle such substitution.
-Mon Apr 15 22:21:42 2013 Tanaka Akira <akr@fsij.org>
+ * tool/expand-config.rb: convert path separators here.
- * ext/fiddle/depend: New file.
+Mon Apr 20 16:52:20 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Apr 15 22:01:02 2013 Akinori MUSHA <knu@iDaemons.org>
+ * tool/fake.rb: don't fake libdir. use libdirname instead.
- * misc/ruby-electric.el (ruby-electric-insert): Check
- ruby-electric-is-last-command-char-expandable-punct-p here.
+Mon Apr 20 16:49:52 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * misc/ruby-electric.el (ruby-electric-closing-char): New
- interactive function bound to closing characters. Typing one of
- those closing characters right after the matching counterpart
- cancels the effect of automatic closing. For example, typing
- "{" followed by "}" simply makes "{}" instead of "{ } }".
+ * lib/mkmf.rb (MakeMakefile#configuration): DESTDIR should never affect
+ top_srcdir and builddir.
-Mon Apr 15 12:54:42 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+Mon Apr 20 16:18:17 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_ssl.c: Correct shutdown behavior w.r.t GC.
+ * common.mk ($(arch)-fake.rb): fix the path separator up for Windows.
- * test/openssl/test_ssl.rb: Add tests to verify correct behavior.
+Mon Apr 20 15:02:47 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- [Bug #8240] Patch provided by Shugo Maeda. Thanks!
+ * win32/win32.c (rb_w32_wreadlink): fixed a bug that a junction misses
+ its drive letter.
-Mon Apr 15 10:23:39 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Apr 20 12:54:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/coverage/depend: fix id.h place as r40283.
+ * ext/openssl/*: use license instead of licence.
+ [fix GH-876][ci skip] Patch by @davydovanton
+ * lib/net/https.rb: ditto.
- * ext/coverage/extconf.rb: add topdir and topsrcdir to VPATH.
+Mon Apr 20 12:42:40 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Sun Apr 14 19:46:14 2013 Tanaka Akira <akr@fsij.org>
+ * benchmark/bm_so_meteor_contest.rb: fix a typo.
+ [fix GH-876][ci skip] Patch by @davydovanton
+ * tool/bisect.sh: ditto.
+ * tool/update-deps: ditto.
- * ext/-test-/debug/depend: New file.
+Mon Apr 20 11:10:46 2015 Eric Wong <e@80x24.org>
- * ext/-test-/exception/depend: Ditto.
+ * ext/socket/socket.c (sock_connect_nonblock): do not raise EISCONN
+ [ruby-core:68926] [Feature #11072]
+ * test/socket/test_nonblock.rb: check non-EISCONN on 2nd connect
- * ext/-test-/printf/depend: Ditto.
+Sun Apr 19 12:19:17 2015 Chad Brewbaker <crb002@gmail.com>
- * ext/-test-/string/depend: Ditto.
+ * ext/{etc,openssl,tk}: Adding parens and comparisons around
+ assignments to get rid of Wparentheses warnings. [Fix GH-875]
- * ext/coverage/depend: Ditto.
+Sun Apr 19 10:42:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/io/console/depend: Ditto.
+ * hash.c (get_env_cstr): environment variables must be ASCII
+ compatible, as dummy encodings and wide char encodings are
+ unsupported now.
- * ext/io/nonblock/depend: Ditto.
+Sat Apr 18 15:18:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/io/wait/depend: Ditto.
+ * ext/json/parser/parser.rl: raise with messages in UTF-8
+ encoding. [ruby-core:67386] [Bug #10705]
- * ext/openssl/depend: Ditto.
+Fri Apr 17 11:58:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pathname/depend: Ditto.
+ * string.c (STR_SET_EMBED): clear NOFREE flag at embedding as
+ embedded strings no longer refer static strings.
+ [ruby-core:68436] [Bug #10942]
- * ext/psych/depend: Ditto.
+Thu Apr 16 05:15:50 2015 Eric Wong <e@80x24.org>
- * ext/zlib/depend: Ditto.
+ * NEWS: note IO#wait_readable change in r50263
-Sun Apr 14 02:46:50 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Apr 16 05:09:36 2015 Eric Wong <e@80x24.org>
- * lib/mkmf.rb (MakeMakefile#create_makefile): remove {$(VPATH)} other
- than nmake.
+ * lib/net/protocol.rb (rbuf_fill): use IO#wait_*able
+ * lib/net/http/generic_request.rb (wait_for_continue): ditto
+ [ruby-core:68891] [Feature #11056]
- * ext/ripper/depend: use VPATH expecting removed by above.
+Wed Apr 15 18:43:43 2015 Koichi Sasada <ko1@atdot.net>
-Sat Apr 13 23:06:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c (rb_tracepoint_new): fix documentation.
+ Commented by @emilsoman.
- * lib/mkmf.rb (timestamp_file): gather timestamp files in one
- directory from each extension directories.
+Wed Apr 15 17:36:51 2015 Koichi Sasada <ko1@atdot.net>
-Sat Apr 13 21:09:02 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_trace.c (rb_tracepoint_new): Add documentation for
+ rb_tracepoint_new C level API [ci skip]
+ Provided by @emilsoman. [fix GH-869]
- * lib/mkmf.rb (MakeMakefile#create_makefile): output new macro
- disthdrdir to specify the path of id.h, parse.h and etc.
+Wed Apr 15 10:37:40 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ext/ripper/depend: use above macro.
+ * doc/contributors.rdoc: fix a typo. Patch by @davydovanton
+ [fix GH-872][ci skip]
+ * doc/syntax/methods.rdoc: ditto.
+ * ext/digest/sha2/sha2.c: ditto.
+ * ext/socket/ipsocket.c: ditto.
+ * ext/tk/*: ditto.
-Sat Apr 13 20:28:08 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Apr 15 07:51:23 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
- * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.
- [bug] fix problem with optimization of \z (Issue #16) [Bug #8210]
+ * doc/extension.ja.rdoc: Added description of TypedData_XXX.
+ Deprecated the old DATA_XXX.
+ Reviewed by ko1 and nobu.
+ Fixes [ruby-dev:40881] #3064
-Sat Apr 13 18:56:15 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * doc/extension.rdoc: ditto.
- * ext/ripper/depend: parse.h and id.h may be created on topdir.
+Wed Apr 15 07:34:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Apr 13 12:08:16 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * thread_pthread.c (reserve_stack): keep sp safe zone to get rid
+ of crash by -fstack-check. [ruby-core:68740] [Bug #11030]
- * lib/matrix.rb: Add Vector#cross_product, patch by Luis Ezcurdia
- [fix GH-276] [rubyspec:81eec89a124]
+Tue Apr 14 16:03:49 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Apr 13 10:20:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/merger.rb (versionup): should also increment revision when
+ changing teeny.
- * struct.c (rb_struct_define_without_accessor, rb_struct_define),
- (rb_struct_s_def): hide member names array.
+Tue Apr 14 11:24:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * struct.c (anonymous_struct, new_struct, setup_struct): split
- make_struct() for each purpose.
+ * ext/-test-/printf/printf.c (uint_to_str): renamed to get rid of
+ conflict on cygwin. [ruby-core:68877] [Bug #11065]
-Sat Apr 13 09:34:31 2013 Tanaka Akira <akr@fsij.org>
+Tue Apr 14 08:59:04 2015 Zachary Scott <e@zzak.io>
- * lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,
- ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile.
+ * gc.c: [DOC] Improve documentation for ObjectSpace.count_objects
+ with regards to `:TOTAL` key, with patch by @schneems [Fixes GH-871]
+ https://github.com/ruby/ruby/pull/871 [Bug #11067]
- * ext/-test-/old_thread_select/depend: Update dependencies.
+Mon Apr 13 22:44:07 2015 Tanaka Akira <akr@fsij.org>
- * ext/-test-/wait_for_single_fd/depend: Ditto.
+ * test/lib/envutil.rb (File.mkfifo): Defined using mkfifo command.
- * ext/bigdecimal/depend: Ditto.
+ * test/ruby/test_io.rb: Use File.mkfifo.
- * ext/curses/depend: Ditto.
+ * test/ruby/test_file_exhaustive.rb: Ditto.
- * ext/digest/bubblebabble/depend: Ditto.
+ * test/ruby/test_process.rb: Ditto.
- * ext/digest/depend: Ditto.
+Mon Apr 13 21:20:20 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/digest/md5/depend: Ditto.
+ * ext/openssl/lib/openssl/ssl.rb: stricter hostname verification
+ following RFC 6125. with the patch provided by Tony Arcieri and
+ Hiroshi Nakamura [ruby-core:61545] [Bug #9644]
+ * test/openssl/test_ssl.rb: add tests for above.
- * ext/digest/rmd160/depend: Ditto.
+Sun Apr 12 18:40:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/digest/sha1/depend: Ditto.
+ * ext/json/json.gemspec: bump version to 1.8.2.
+ * ext/json/lib/json/version.rb: ditto.
- * ext/digest/sha2/depend: Ditto.
+Sun Apr 12 18:12:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/dl/callback/depend: Ditto.
+ * ext/json/json.gemspec, lib/rdoc/rdoc.gemspec: added gemspec directly.
+ * defs/default_gems, tool/rbinstall.rb: removed default_gems definition.
+ it make simple installation for default gems.
- * ext/dl/depend: Ditto.
+Sun Apr 12 17:35:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/etc/depend: Ditto.
+ * ext/json/*, test/json/*: Reverted r50231. Because it's not
+ working with cross-compile environment.
- * ext/nkf/depend: Ditto.
+Sun Apr 12 15:34:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/depend: Ditto.
+ * parse.y (arg): fix segfault by null caused by syntax error.
+ [ruby-core:68851] [Bug #10957]
- * ext/pty/depend: Ditto.
+Sun Apr 12 15:11:16 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/readline/depend: Ditto.
+ * lib/rubygems/test_case.rb: use explicitly exception class and reverted
+ to require JSON library for rubygems tests with Ruby 2.2.0 or earlier.
- * ext/ripper/depend: Ditto.
+Sun Apr 12 15:10:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/sdbm/depend: Ditto.
+ * ext/io/wait/wait.c (io_wait_readable): simply returns that IO is
+ readable without blocking, but no longer returns EOF.
- * ext/socket/depend: Ditto.
+ * ext/io/wait/wait.c (io_ready_p, io_wait_readable): try polling
+ first and check FIONREAD optionally to see if EOF.
+ [ruby-core:36805] [Feature #4849]
- * ext/stringio/depend: Ditto.
+Sun Apr 12 14:53:23 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/strscan/depend: Ditto.
+ * lib/rubygems/test_case.rb: fixed json load error for rubygems tests.
- * ext/syslog/depend: Ditto.
+Sun Apr 12 14:13:28 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/-test-/num2int/depend: Removed.
+ * gc.c: Document require name for ObjectSpace methods.
+ [ci skip][fix GH-860] Patch by @schneems
- * ext/dbm/depend: Ditto.
+Sun Apr 12 13:54:05 2015 Tanaka Akira <akr@fsij.org>
- * ext/fcntl/depend: Ditto.
+ * test/ruby/test_io.rb: New test that open(fifo) doesn't block other
+ threads.
- * ext/gdbm/depend: Ditto.
+Sun Apr 12 13:52:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/racc/cparse/depend: Ditto.
+ * ext/coverage/coverage.c: Remove extension from require argument.
+ [ci skip][fix GH-870] Patch by @yui-knk
-Sat Apr 13 00:15:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Apr 12 10:29:14 2015 Eric Wong <e@80x24.org>
- * ext/etc/etc.c (Init_etc): move Passwd and Group under Etc namespace
- as primary names.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock):
+ support `exception: false'
+ * (get_no_exception): move function location
+ * ext/socket/socket.c (sock_connect_nonblock):
+ support `exception: false'
+ * test/openssl/test_pair.rb (test_connect_accept_nonblock_no_exception):
+ test `exception: false' on connect,
+ rename from `test_accept_nonblock_no_exception'
+ * test/socket/test_nonblock.rb (test_connect_nonblock_no_exception):
+ new test
-Fri Apr 12 21:06:55 2013 Tanaka Akira <akr@fsij.org>
+Sun Apr 12 09:57:16 2015 Tanaka Akira <akr@fsij.org>
- * common.mk: pack.o depends on internal.h.
+ * test/ruby/test_file_exhaustive.rb: Test a block device on GNU/Linux.
-Fri Apr 12 20:59:24 2013 Tanaka Akira <akr@fsij.org>
+Sun Apr 12 09:24:03 2015 Tanaka Akira <akr@fsij.org>
- * bignum.c (ones): Use __builtin_popcountl if available.
+ * test/ruby/test_file_exhaustive.rb: Test a file not owned.
- * internal.h (GCC_VERSION_SINCE): Macro moved from pack.c.
+Sun Apr 12 09:05:44 2015 Tanaka Akira <akr@fsij.org>
- * pack.c: Include internal.h for GCC_VERSION_SINCE.
+ * ext/fiddle/depend: Fix "Wrong mix of special targets" error with
+ OpenBSD make.
-Fri Apr 12 18:29:42 2013 Tanaka Akira <akr@fsij.org>
+Sun Apr 12 09:04:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * common.mk: version.o depends on $(srcdir)/include/ruby/version.h
- instead of {$(VPATH)}version.h to avoid confusion by VPATH between
- top level version.h and include/ruby/version.h for build in-place.
- [ruby-dev:47249] [Bug #8256]
+ * test/ruby/test_file_exhaustive.rb: Windows doesn't support Unix file
+ modes.
-Fri Apr 12 15:21:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Apr 12 08:56:44 2015 Tanaka Akira <akr@fsij.org>
- * vm_insnhelper.c (vm_callee_setup_keyword_arg): non-symbol key is not
- a keyword argument, keep it as a positional argument.
+ * ext/-test-/file/fs.c: OpenBSD needs sys/param.h before sys/mount.h.
-Fri Apr 12 11:58:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Sun Apr 12 08:52:01 2015 Tanaka Akira <akr@fsij.org>
- * array.c: Document synonymous methods, by windwiny [GH-277]
- * bignum.c: ditto
- * complex.c: ditto
- * dir.c: ditto
- * encoding.c: ditto
- * enumerator.c: ditto
- * numeric.c: ditto
- * proc.c: ditto
- * re.c: ditto
- * string.c: ditto
+ * test/ruby/test_file_exhaustive.rb: Test suid, sgid and sticky file.
-Thu Apr 11 23:41:46 2013 Tanaka Akira <akr@fsij.org>
+Sat Apr 11 23:48:30 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * common.mk: Add dependencies for include/ruby.h
+ * template/fake.rb.in: Don't assign baseruby, Because it's affect to
+ Makefile of native gem like json on bundled gems.
- * tool/update-deps: Use "make -p all miniruby ruby golf" to extract
- dependencies in makefiles.
+Sat Apr 11 23:33:22 2015 Tanaka Akira <akr@fsij.org>
-Thu Apr 11 23:21:17 2013 Tanaka Akira <akr@fsij.org>
+ * file.c (rb_f_test): Consider nsec for "=", "<" and ">" for "test"
+ method.
- * tool/update-deps: Use "make -p all golf" to extract dependencies in
- makefiles.
+Sat Apr 11 23:26:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Apr 11 21:02:19 2013 Tanaka Akira <akr@fsij.org>
+ * tool/rbinstall.rb: support destdir for native extension gem.
- * common.mk: Dependency updated.
+Sat Apr 11 21:02:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * tool/update-deps: Rewritten.
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_socket_p): r50226 accidentally missed
+ the guard for non-unix environments.
-Thu Apr 11 19:59:48 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Apr 11 20:14:21 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * common.mk: partially revert r40183, which breaks building on
- other than source directory. (its commit log also says the same
- thing, but such failure is not reproducible on my environment
- and the commit breaks build on my environment)
+ * ext/json/*, test/json/*, defs/default_gems: Gemify JSON library.
+ [fix GH-867][Feature #11057]
+ * test/ruby/test_extlibs.rb: removed json gem from existence extensions.
+ * gems/bundled_gems: added json gem into bundled gem.
+ * lib/rdoc/rubygems_hook.rb: ignored no json environment.
+ * lib/rubygems/test_case.rb, test/rubygems/*: ditto.
+ * lib/rdoc/test_case.rb, test/rdoc/*: ditto.
-Thu Apr 11 16:10:01 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Apr 11 15:56:58 2015 Tanaka Akira <akr@fsij.org>
- * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 on
- Mac OS X and Linux [Bug #3371]
+ * test/ruby/test_file_exhaustive.rb: Create sample files lazily.
-Thu Apr 11 13:19:22 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Apr 11 14:03:47 2015 Tanaka Akira <akr@fsij.org>
- * test/drb/drbtest.rb (Drb{Core,Ary}#teardown): retry Process.kill
- if it fails with Errno::EPERM on Windows (workaround).
- [ruby-dev:47245] [Bug #8251]
+ * test/ruby/test_file_exhaustive.rb: Test character device using
+ /dev/null.
-Thu Apr 11 11:11:38 2013 Akinori MUSHA <knu@iDaemons.org>
+Sat Apr 11 10:59:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c: Fix a typo.
+ * lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags):
+ utility methods to append compiler options.
-Thu Apr 11 10:39:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Apr 11 08:22:24 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): add missing case:
- RUBY_LIBFFI_MODVERSION is not defined (usually on Windows).
+ * lib/rdoc/text.rb: removed duplicated code.
-Thu Apr 11 09:27:04 2013 Konstantin Haase <me@rkh.im>
+Sat Apr 11 04:46:42 2015 Eric Wong <e@80x24.org>
- * dir.c (file_s_fnmatch): Document File::FNM_EXTGLOB flag.
+ * lib/net/protocol.rb (rbuf_fill): avoid exception with read_nonblock
+ [ruby-core:68787] [Feature #11044]
-Thu Apr 11 09:17:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Fri Apr 10 23:57:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * README: Fix typo by Benjamin Winkler [Fixes GH-281]
+ * dir.c (need_normalization): use getattrlist() if fgetattrlist()
+ is unavailable, on OSX 10.5. [ruby-core:68829] [Bug #11054]
-Thu Apr 11 06:15:51 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Apr 10 22:29:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * regint.h: fix typo: _M_AMD86 -> _M_AMD64.
+ * lib/mkmf.rb (try_compile): pass the given werror flag to try_do
+ to check if stderr is empty.
- * siphash.c: ditto.
+ * lib/mkmf.rb (try_cflags, try_ldflags): default werror to true.
- * st.c: ditto.
+ * win32/Makefile.sub (WERRORFLAG): remove useless option. VC does
+ not make warnings of unknown command option an error.
-Thu Apr 11 06:09:57 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Apr 10 19:34:24 2015 Tanaka Akira <akr@fsij.org>
- * ext/fiddle/extconf.rb: define RUBY_LIBFFI_MODVERSION macro.
+ * test/ruby/test_file_exhaustive.rb: Test socket.
- * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 or 1
- with platform and libffi's version. [Bug #3371]
+Fri Apr 10 19:38:46 2015 Koichi Sasada <ko1@atdot.net>
-Thu Apr 11 05:30:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/objspace/test_objspace.rb: remove debug prints.
- * lib/mkmf.rb (pkg_config): Add optional argument "option".
- If it is given, it returns the result of
- `pkg-config --<option> <pkgname>`.
+Fri Apr 10 19:35:51 2015 Koichi Sasada <ko1@atdot.net>
-Thu Apr 11 03:33:05 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/objspace/objspace.c: add ObjectSpace.count_imemo_objects method
+ to count imemo objects for each type.
- * ext/fiddle/closure.c (initialize): check mprotect's return value.
- If mprotect is failed because of PaX or something, its function call
- will cause SEGV.
- http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130401T210301Z.diff.html.gz
+ * test/objspace/test_objspace.rb: add a test.
-Wed Apr 10 17:39:13 2013 Tanaka Akira <akr@fsij.org>
+ * NEWS: describe about this addition.
- * ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable
- even when overflow.
+Fri Apr 10 19:34:24 2015 Tanaka Akira <akr@fsij.org>
-Wed Apr 10 12:32:37 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_file_exhaustive.rb: Test anonymous pipe.
- * bignum.c (rb_ll2big): Don't overflow on signed integer negation.
+Fri Apr 10 19:31:56 2015 Tanaka Akira <akr@fsij.org>
- * ext/bigdecimal/bigdecimal.c (MUL_OVERFLOW_SIGNED_VALUE_P): New
- macro.
- (AddExponent): Don't overflow on signed integer multiplication.
- (VpCtoV): Don't overflow on signed integer arithmetic.
- (VpCtoV): Don't overflow on signed integer arithmetic.
+ * test/ruby/test_file_exhaustive.rb: Test named pipe.
-Wed Apr 10 06:32:12 2013 Tanaka Akira <akr@fsij.org>
+Fri Apr 10 19:10:34 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h (MUL_OVERFLOW_INT_P): New macro.
+ * ext/objspace/objspace.c (setup_hash): unify common routine.
- * sprintf.c (GETNUM): Don't overflow on signed integer multiplication.
+Fri Apr 10 18:29:49 2015 Tanaka Akira <akr@fsij.org>
-Tue Apr 9 20:38:20 2013 Tanaka Akira <akr@fsij.org>
+ * process.c (rb_execarg_parent_start1): Handle EINTR.
- * internal.h (MUL_OVERFLOW_SIGNED_INTEGER_P): New macro.
- (MUL_OVERFLOW_FIXNUM_P): Ditto.
- (MUL_OVERFLOW_LONG_P): Ditto.
+Fri Apr 10 17:27:58 2015 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_product): Don't overflow on signed integer
- multiplication.
+ * vm.c (vm_exec): check other events when RETURN is thrown.
+ [Bug #10724]
- * numeric.c (fix_mul): Ditto.
- (int_pow): Ditto.
+ * test/ruby/test_settracefunc.rb: add a test.
- * rational.c (f_imul): Ditto.
+Fri Apr 10 11:44:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * insns.def (opt_mult): Ditto.
+ * ext/date/extconf.rb: check warnings.
- * thread.c (sleep_timeval): Don't overflow on signed integer addition.
+ * lib/mkmf.rb (try_cflags): pass options to try_compile.
- * bignum.c (rb_int2big): Don't overflow on signed integer negation.
- (rb_big2ulong): Ditto.
- (rb_big2long): Ditto.
- (rb_big2ull): Ditto.
- (rb_big2ll): Ditto.
+ * win32/Makefile.sub (WERRORFLAG): make unknown command line
+ options an error.
-Tue Apr 9 19:45:44 2013 Tanaka Akira <akr@fsij.org>
+Fri Apr 10 08:00:17 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/open-uri.rb: Support multiple fields with same field
- name (like Set-Cookie).
- (OpenURI::Meta#metas): New accessor to obtain fields as a Hash from
- field name (string) to field values (array of strings).
- [ruby-core:37734] [Bug #4964] reported by ren li.
+ * test/ruby/test_process.rb: unfortunately, windows is not POSIX...
+ cygwin has mkfifo command, but it does not affect system-wide.
-Tue Apr 9 15:26:12 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 10 02:18:53 2015 Tanaka Akira <akr@fsij.org>
- * compile.c (iseq_compile_each): append keyword hash to argument array
- to splat if needed. [ruby-core:54094] [Bug #8236]
+ * test/ruby/test_process.rb: Use mkfifo command instead of mknod
+ command to create a named pipe. mkfifo command is defined by POSIX.
-Tue Apr 9 10:02:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 10 01:29:05 2015 Tanaka Akira <akr@fsij.org>
- * lib/mkmf.rb (timestamp_file): gather timestamp files in one
- directory from each extension directories, with considering
- target_prefix.
+ * process.c: Release GVL when opening a file in spawn() to avoid whole
+ process blocking when opening a named pipe.
+ (open_func): New function.
+ (rb_execarg_parent_start1): Extracted from rb_execarg_parent_start and
+ use rb_thread_call_without_gvl2 to release GVL when opening a file.
+ (rb_execarg_parent_start): Invoke rb_execarg_parent_start1 via
+ rb_protect and invoke rb_execarg_parent_end when error.
-Tue Apr 9 04:57:59 JST 2013 Charles Oliver Nutter <headius@headius.com>
+Thu Apr 9 22:19:19 2015 Tanaka Akira <akr@fsij.org>
- * error.c: Capture EAGAIN, EWOULDBLOCK, EINPROGRESS exceptions and
- export them for use in WaitReadable/Writable exceptions.
- * io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that
- include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail
- for nonblocking failures using those exceptions. Use that
- function in io_getpartial and io_write_nonblock instead of
- rb_mod_sys_fail
- * ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include
- WaitReadable and WaitWritable. Use those classes for
- write_would_block and read_would_block instead of rb_mod_sys_fail.
- * ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of
- rb_mod_sys_fail in bsock_sendmsg_internal and
- bsock_recvmsg_internal.
- * ext/socket/init.c: Use rb_readwrite_sys_fail instead of
- rb_mod_sys_fail in rsock_s_recvfrom_nonblock and
- rsock_s_connect_nonblock.
- * ext/socket/socket.c: Use rb_readwrite_sys_fail instead of
- rb_mod_sys_fail in sock_connect_nonblock.
- * include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead
- of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and
- RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail.
+ * process.c (redirect_open): Removed.
-Tue Apr 9 02:44:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 9 21:38:20 2015 Tanaka Akira <akr@fsij.org>
- * ext/socket/extconf.rb: $defs needs -D or -U. nothing is added
- otherwize.
+ * internal.h (rb_execarg_parent_end): Declared.
- * ext/socket/extconf.rb: check struct in_addr6, which is defined in
- VC6 instead of in6_addr.
+ * process.c: "spawn" opens files in the parent process.
+ (check_exec_redirect): Add an placeholder for fd in parameters
+ for fd_open.
+ (check_exec_fds_1): Delete fd_open condition.
+ (check_exec_fds): Don't call check_exec_fds_1 with fd_open.
+ (rb_execarg_parent_start): Open files specified as "spawn" options
+ and add "dup2" options.
+ (rb_execarg_parent_end): New function to close opened fds.
+ (run_exec_open): Removed.
+ (rb_execarg_run_options): Don't call run_exec_open.
+ (rb_spawn_internal): Call rb_execarg_parent_end.
- * ext/socket/option.c (optname_to_sym): fix macro name.
+ * io.c (pipe_open): Call rb_execarg_parent_end.
- * ext/socket/constants.c (rsock_cmsg_type_arg): fix macro name.
+ * ext/pty/pty.c (establishShell): Call rb_execarg_parent_end.
-Mon Apr 8 23:57:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 9 20:52:31 2015 Tanaka Akira <akr@fsij.org>
- * object.c (id_for_setter): extract common code from const, class
- variable, instance variable setters.
+ * internal.h (rb_execarg_parent_start): Renamed from rb_execarg_fixup.
-Mon Apr 8 23:55:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c: Follows the above change.
- * ext/depend (ENCOBJS, TRANSOBJS): use explicit path to ruby.h for
- nmake.
+ * io.c: Ditto.
- * ext/depend (ENCOBJS, TRANSOBJS): fix header dependency, VPATH has
- $(srcdir)/include/ruby but not $(srcdir)/include, so cannot find out
- ruby/ruby.h. use ruby.h instead and ../ruby for include/ruby.h.
+ * ext/pty/pty.c: Ditto.
-Mon Apr 8 20:30:37 2013 Yuki Yugui Sonoda <yugui@google.com>
+Thu Apr 9 20:35:12 2015 Tanaka Akira <akr@fsij.org>
- * ext/depend (ENCOBJS, TRANSOBJS): Add missing dependencies.
+ * process.c (fd_clear_cloexec): Extracted from run_exec_dup2.
-Mon Apr 8 17:19:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 9 09:26:47 2015 Eric Wong <e@80x24.org>
- * ext/win32ole/win32ole.c (fole_missing): should check actual argument
- count before accessing.
+ * ccan/list/list.h: sync with ccan upstream
+ [ccan commit c2fbfe5282ba264f3485586e7efa8a5967f2d386]
-Mon Apr 8 16:03:55 2013 Yuki Yugui Sonoda <yugui@google.com>
+Thu Apr 9 08:24:03 2015 Masahiro Tomita <tommy@tmtm.org>
- Fixes a build failure of ext/ripper/ripper.c on building out of place.
- * common.mk (id.h, id.c): Always generated in $(srcdir).
- (ext/ripper/ripper.c): Passes $(PATH_SEPARATOR) too to the sub make.
+ * ext/socket/raddrinfo.c (addrinfo_mload): fix memory leak of
+ addrinfo. [ruby-dev:48923] [Bug #11051]
-Mon Apr 8 12:05:02 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Apr 8 17:45:02 2015 Shannon Skipper <shannonskipper@gmail.com>
- * object.c (rb_obj_ivar_set): call to_str for string only once.
- to_str was called from rb_is_const_name and rb_to_id before.
+ * version.c (Init_version): the version of the engine or
+ interpreter. [Fix GH-858]
- * object.c (rb_mod_const_set): ditto.
+Wed Apr 8 16:15:30 2015 Kenta Murata <mrkn@cookpad.com>
- * object.c (rb_mod_cvar_set): ditto.
+ * bigdecimal: conform to ruby's license. [ruby-core:68466] [Bug #10952]
-Sun Apr 7 13:56:16 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Wed Apr 8 14:57:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
- RUBY_PLATFORM should escape as Regexp,
- because RUBY_PLATFORM may contain '.'.
+ * win32/win32.c (rb_w32_wreadlink): should treat junctions like as
+ symlinks.
-Sun Apr 7 10:44:01 2013 Tanaka Akira <akr@fsij.org>
+Wed Apr 8 14:03:47 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/defines.h: Simplify the logic to include sys/select.h.
- This fixes a compilation error on Haiku (gcc2 and gcc4).
+ * test/ruby/test_symbol.rb: fix syntax error.
- * configure.in: Use shared linker as $(CC) for Haiku.
- This fixes a build error on Haiku (gcc2).
+Wed Apr 8 13:01:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Apr 7 10:41:30 2013 Tanaka Akira <akr@fsij.org>
+ * hash.c (rb_any_hash): Symbols are compared by the identities
+ always. [ruby-core:68767] [Bug #11035]
- * lib/resolv.rb (MDNSOneShot#sender): Delete an unused variable.
+Tue Apr 7 10:22:51 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Apr 7 03:24:36 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * internal.h: fix typo. Patch by @sferik [fix GH-865]
- * addr2line.c: use more generic type:
- * u_char -> unsigned char
- * u_short -> unsigned short
- * u_int -> unsigned int
- * u_long -> unsigned long
- * quad_t -> int64_t
- * u_quad_t -> uint64_t
+Mon Apr 6 22:52:35 2015 Tanaka Akira <akr@fsij.org>
- * addr2line.c (imax): inline is defined by configure.
+ * enum.c: Enumerable#chunk and Enumerable#slice_before no longer takes
+ the initial_state argument. [Feature #10958]
-Sun Apr 7 01:40:39 2013 Akinori MUSHA <knu@iDaemons.org>
+Mon Apr 6 16:09:58 2015 Koichi Sasada <ko1@atdot.net>
- * misc/ruby-electric.el (ruby-electric-hash): New electric
- function that expands a hash sign inside a string or regexp to
- "#{}".
+ * vm_args.c: protect value stack from calling other methods
+ during complex parameter setting process (splat, kw, and so on).
+ [Bug #11027]
- * misc/ruby-electric.el (ruby-electric-curlies): Do not insert
- spaces inside when the curly brace is a delimiter of %r, %w,
- etc.
+ * vm_core.h: remove rb_thread_t::mark_stack_len.
+ With this modification, we don't need to use th->mark_stack_len.
- * misc/ruby-electric.el (ruby-electric-curlies): Insert another
- space before a closing curly brace when
- ruby-electric-newline-before-closing-bracket is nil.
+ * test/ruby/test_keyword.rb: add a test.
-Sun Apr 7 01:01:26 2013 Tanaka Akira <akr@fsij.org>
+ * cont.c (cont_capture): catch up this fix.
- * strftime.c (rb_strftime_with_timespec): Test yday range.
- [ruby-core:44088] [Bug #6247] reported by Ruby Submit.
+ * vm.c (rb_thread_mark): ditto.
-Sat Apr 6 23:46:54 2013 Naohisa Goto <ngotogenome@gmail.com>
+Mon Apr 6 11:26:42 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (AC_CHECK_HEADERS): atomic.h for Solaris atomic_ops.
+ * tool/downloader.rb (http_options): prevent content auto decoding
+ because this is a downloader.
- * ruby_atomic.h: Skip using Solaris10 atomic_ops on Solaris 9 or
- earlier if atomic.h is not available. [ruby-dev:47229] [Bug #8228]
+Sun Apr 5 09:55:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Apr 6 23:40:40 2013 Tanaka Akira <akr@fsij.org>
+ * doc/contributing.rdoc: update Maintainers list.
- * lib/resolv.rb: Support LOC resources.
- [ruby-core:23361] [Feature #1436] by JB Smith.
+Sun Apr 5 09:11:00 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Apr 6 23:38:09 2013 Naohisa Goto <ngotogenome@gmail.com>
+ * tool/rbinstall.rb: fix bin script permission of bundled gems.
- * addr2line.c: quad_t and u_quad_t is not available on Solaris.
- __inline is not available with old compilers on Solaris.
- [ruby-dev:47229] [Bug #8227]
+Sun Apr 5 08:46:08 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Apr 6 23:31:38 2013 Tanaka Akira <akr@fsij.org>
+ * tool/rbinstall.rb: support --program-suffix option.
- * lib/resolv.rb: Add one-shot multicast DNS support.
- [ruby-core:53387] [Feature #8089] by Eric Hodel.
+Sat Apr 4 21:31:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Apr 6 22:12:01 2013 Tanaka Akira <akr@fsij.org>
+ * lib/rake/*: Gemify rake [fix GH-862][Feature #11025]
+ * test/rake/*: ditto.
+ * tool/rbinstall.rb: ditto.
- * lib/resolv.rb (Resolv::DNS.fetch_resource): New method to obtain
- full result.
- [ruby-dev:43587] [Feature #4788] proposed by Makoto Kishimoto.
+Sat Apr 4 11:30:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Apr 6 20:17:51 2013 Tanaka Akira <akr@fsij.org>
+ * string.c (rb_str_setbyte): check the argument first not to
+ discard shared string and code range unnecessarily until
+ actually changing the contents. pointed out by headius.
- * ext/socket/socket.c (rsock_sys_fail_raddrinfo): Renamed from
- rsock_sys_fail_addrinfo.
- (rsock_sys_fail_raddrinfo_or_sockaddr): Renamed from
- rsock_sys_fail_addrinfo_or_sockaddr.
+Sat Apr 4 08:16:43 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/socket/rubysocket.h: Follow the above change.
+ * lib/net/http.rb (edit_path): use path which is absolute ftp url
+ on using ftp_proxy.
-Sat Apr 6 19:24:59 2013 Tanaka Akira <akr@fsij.org>
+Fri Apr 3 11:43:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (rsock_sys_fail_sockaddr): Takes struct sockaddr
- and socklen_t instead of String object.
- (rsock_sys_fail_addrinfo_or_sockaddr): Follow the above change.
+ * vm_eval.c (vm_call0_cfunc): update invoker arguments.
- * ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow the above
- change.
+ * vm_insnhelper.c (vm_call_cfunc_latter): ditto.
-Sat Apr 6 14:28:23 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (rb_vm_call_cfunc_push_frame): ditto, and prefix
+ with rb_.
- * ext/socket/rubysocket.h (SockAddrStringValueWithAddrinfo): New macro.
- (rsock_sockaddr_string_value_with_addrinfo): New declaration.
- (rsock_addrinfo_inspect_sockaddr): Ditto.
- (rsock_sys_fail_addrinfo): Ditto.
- (rsock_sys_fail_sockaddr_or_addrinfo): Ditto.
+Thu Apr 2 16:26:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/raddrinfo.c (rsock_addrinfo_inspect_sockaddr): Renamed
- from addrinfo_inspect_sockaddr and exported.
- (rsock_sockaddr_string_value_with_addrinfo): New function to obtain
- string and possibly addrinfo object.
+ * common.mk, tool/mkconfig.rb: check the running ruby version in
+ rbconfig.rb with the program version, as RUBY_VERSION has never
+ been affected by --with-ruby-version option.
+ [ruby-core:68639] [Bug #11002]
- * ext/socket/socket.c (rsock_sys_fail_sockaddr): Don't use
- rsock_sys_fail_host_port which is IP dependent. Invoke
- rsock_sys_fail_addrinfo.
- (rsock_sys_fail_addrinfo): New function using
- rsock_addrinfo_inspect_sockaddr.
- (rsock_sys_fail_addrinfo_or_sockaddr): New function.
- (sock_connect): Use SockAddrStringValueWithAddrinfo and
- rsock_sys_fail_addrinfo_or_sockaddr.
- (sock_connect_nonblock): Ditto.
- (sock_bind): Ditto.
+ * configure.in (LIBRUBY_DLDFLAGS): compatibility_version must be
+ valid version numbers, not an arbitrary string.
-Sat Apr 6 13:34:20 2013 Tanaka Akira <akr@fsij.org>
+Wed Apr 1 11:09:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (rsock_sys_fail_sockaddr): Delete 2nd argument.
+ * dir.c (push_glob): remove indirect links of arguments for
+ trampoline.
- * ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow above
- change.
+Wed Apr 1 09:59:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Apr 6 13:13:39 2013 Tanaka Akira <akr@fsij.org>
+ * lib/fileutils.rb (FileUtils#mv): show the exact target path in
+ the error message instead of the destination parent directory
+ name. patched by Joao Britto <jabcalves AT gmail.com> at
+ [ruby-core:68706]. [Bug #11021]
- * ext/socket/socket.c (rsock_sys_fail_path): Use rb_str_inspect only
- for String to avoid SEGV.
+Tue Mar 31 15:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Apr 6 12:40:16 2013 Tanaka Akira <akr@fsij.org>
+ * doc/ChangeLog-0.06_to_0.52: added archived Changelog.
+ [ruby-list:50105]
+ * doc/ChangeLog-0.50_to_0.60: ditto.
+ * doc/ChangeLog-0.60_to_1.1: ditto.
- * ext/socket/rubysocket.h (rsock_sys_fail_host_port): Wrap by NORETURN.
- (rsock_sys_fail_path): Ditto.
- (rsock_sys_fail_sockaddr): Ditto.
+Mon Mar 30 22:02:55 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sat Apr 6 11:49:35 2013 Tanaka Akira <akr@fsij.org>
+ * README.EXT.ja: add redirect [ruby-core:68631]
- * ext/socket/socket.c (rsock_sys_fail_path): Use rb_str_inspect if the
- path contains a NUL.
+Mon Mar 30 14:42:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Apr 6 11:39:19 2013 Tanaka Akira <akr@fsij.org>
+ * win32/win32.c (fileattr_to_unixmode, winnt_lstat): deal with
+ symbolic link than directory, and set executable bits.
- * ext/socket: Improve socket exception message to show socket address.
- [ruby-core:45617] [Feature #6583] proposed Eric Hodel.
+Mon Mar 30 11:27:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/rubysocket.h (rsock_sys_fail_host_port): Declared.
- (rsock_sys_fail_path): Ditto.
- (rsock_sys_fail_sockaddr): Ditto.
+ * io.c (copy_stream_body): use the arguments without conversion if
+ having read, readpartial, and write methods, than conversion by
+ to_path method. [ruby-core:68676] [Bug #11015]
- * ext/socket/udpsocket.c (udp_connect): Use rsock_sys_fail_host_port.
- (udp_bind): Ditto.
- (udp_send): Ditto.
+Sun Mar 29 21:08:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/init.c (rsock_init_sock): Specify a string for rb_sys_fail
- argument.
- (make_fd_nonblock): Ditto.
- (rsock_s_accept): Ditto.
+ * gc.c (objspace_allrefs_destruct_i): fix a typo.
+ [Bug #11013]
- * ext/socket/ipsocket.c (init_inetsock_internal): Use
- rsock_sys_fail_host_port.
+Sun Mar 29 11:51:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (rsock_sys_fail_host_port): Defined.
- (rsock_sys_fail_path): Ditto.
- (rsock_sys_fail_sockaddr): Ditto.
- (setup_domain_and_type): Use rsock_sys_fail_sockaddr.
- (sock_connect_nonblock): Ditto.
- (sock_bind): Ditto.
- (sock_gethostname): Specify a string for rb_sys_fail argument.
- (socket_s_ip_address_list): Ditto.
+ * proc.c (proc_binding): replicate env from method object, and
+ allocate the local variable area for the iseq local table.
+ [ruby-core:68673] [Bug #11012]
- * ext/socket/basicsocket.c (bsock_shutdown): Specify a string for
- rb_sys_fail argument.
- (bsock_setsockopt): Use rsock_sys_fail_path.
- (bsock_getsockopt): Ditto.
- (bsock_getpeereid): Refine the argument for rb_sys_fail.
+Sat Mar 28 09:19:41 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/socket/unixsocket.c (rsock_init_unixsock): Use
- rsock_sys_fail_path.
- (unix_path): Ditto.
- (unix_send_io): Ditto.
- (unix_recv_io): Ditto.
- (unix_addr): Ditto.
- (unix_peeraddr): Ditto.
+ * ext/date/extconf.rb: try_cflags("-std=iso9899:1999") [Bug #10906]
+ ruby itself (including numeric.c) is built with strict compile
+ options including -std=iso9899:1999, but ext/date is not.
+ By the way -std=iso9899:1999 is not only a warning option but also
+ changes behavior like MACRO definitions for example INFINITY.
+ gcc on Solaris affect this.
-Sat Apr 6 11:23:18 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Fri Mar 27 16:34:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
- fix load path for encoding to run the test as stand-alone.
+ * common.mk: revert using BOOTSTRAPRUBY for enc.mk, as
+ enc/depend uses CONFIG. [ruby-core:68647] [Bug #11004]
-Sat Apr 6 09:54:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 26 10:05:13 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * pack.c (NATINT_LEN): fix definition order, must be after
- NATINT_PACK.
+ * test/test_observer.rb: add tests for Observable module.
+ [fix GH-859] Patch by @brightbits
-Sat Apr 6 03:11:07 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+Thu Mar 26 06:35:10 2015 Eric Wong <e@80x24.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: fix symbol keys in coder
- emission. Thanks @tjwallace
- * test/psych/test_coder.rb: test for change
+ * README.EXT: add redirect [ruby-core:68631]
-Sat Apr 6 02:54:08 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+Wed Mar 25 16:46:49 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/psych/lib/psych/exception.rb: there should be only one exception
- base class. Fixes tenderlove/psych #125
- * ext/psych/lib/psych.rb: require the correct exception class
- * ext/psych/lib/psych/syntax_error.rb: ditto
- * ext/psych/lib/psych/visitors/to_ruby.rb: ditto
+ * ext/socket/extconf.rb: Solaris 11 has struct tcp_info.tcpi_ca_state,
+ but it is a dummy.
-Sat Apr 6 02:30:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/option.c: Solaris 11 doesn't have u_intN_t.
- * parse.y (new_defined): remove all extra parentheses, and return
- "nil" for defined? with empty expression.
- [ruby-core:54024] [Bug #8224]
+ * ext/socket/option.c: Solaris 11 needs inspect_tcpi_msec.
-Sat Apr 6 02:06:04 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/socket/raddrinfo.c: Solaris 11 has AF_PACKET but doesn't have
+ related macros.
- * ext/psych/lib/psych/visitors/to_ruby.rb: correctly register
- self-referential strings. Fixes tenderlove/psych #135
+Wed Mar 25 17:03:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/psych/test_string.rb: appropriate test.
+ * ext/-test-/file/fs.c (get_fsname): try magic number only if
+ f_type is included. [ruby-dev:48913] [Bug #11000]
-Sat Apr 6 01:21:56 2013 Tanaka Akira <akr@fsij.org>
+Wed Mar 25 11:20:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/init.c (cloexec_accept): Fix a compile error on
- Debian GNU/kFreeBSD. Consider HAVE_ACCEPT4 is defined
- but SOCK_CLOEXEC is not defined.
+ * benchmark/bm_hash_aref_flo.rb: make more realistic data.
+ [ruby-core:68632] [[Bug #10999]
-Sat Apr 6 00:19:30 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Wed Mar 25 10:39:06 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * load.c (features_index_add): use rb_str_subseq() to specify C string
- position properly to fix require non ascii path.
- [ruby-core:53733] [Bug #8165]
+ * .document: removed needless entries.
- * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
- a test for the above.
+Wed Mar 25 08:07:28 2015 Eric Wong <e@80x24.org>
-Fri Apr 5 20:41:49 2013 Tanaka Akira <akr@fsij.org>
+ * doc/extension.rdoc: fix spelling of filename
+ * doc/extension.ja.rdoc: ditto.
- * include/ruby/defines.h (HAVE_TRUE_LONG_LONG): Defined to distinguish
- availability of long long and availability of 64bit integer type.
+Tue Mar 25 06:55:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * pack.c: Use HAVE_TRUE_LONG_LONG to distinguish q! and Q! support.
+ * complex.c (k_inexact_p, k_exact_zero_p): use k_exact_zero_p macro
+ to remove k_inexact_p macro.
-Fri Apr 5 20:19:42 2013 Tanaka Akira <akr@fsij.org>
+ * complex.c (k_exact_one_p): remove unused macro k_exact_one_p.
- * addr2line.c: Include ruby/missing.h to fix compile error on Debian.
+Tue Mar 24 22:23:33 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Apr 5 19:39:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/extension.rdoc: move from toplevel document and added extname.
+ * doc/extension.ja.rdoc: ditto.
- * compile.c (iseq_compile_each): fix of defined? with empty
- expression. [ruby-core:53999] [Bug #8220]
+Tue Mar 24 22:06:58 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Apr 5 13:22:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/standard_library.rdoc: strip.
- * ext/curses/curses.c (Init_curses): fix implementation function,
- crmode should be same as cbreak. [ruby-core:54013] [Bug #8222]
+Tue Mar 24 22:06:27 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Apr 5 12:06:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * doc/standard_library.rdoc: move Thread to Extensions.
- * ext/curses/hello.rb: Typo in Curses example by Drew Blas
- [Fixes GH-273]
+Tue Mar 24 21:59:10 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Apr 4 23:45:13 2013 Tanaka Akira <akr@fsij.org>
+ * doc/contributing.rdoc: update Maintainers list.
- * lib/resolv.rb (bind_random_port): Rescue EACCES for SunOS.
- bind() on SunOS for port 2049 (nfs) and 4045 (lockd) causes
- EACCES with unprivileged process. cf. PRIV_SYS_NFS in privileges(5)
- [ruby-core:48064] [Bug #7183] reported by Frank Meier.
+Tue Mar 24 19:10:24 2015 Koichi Sasada <ko1@atdot.net>
-Thu Apr 4 23:24:45 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (gc_writebarrier_generational): fix messages for rb_bug().
+ Remove `rb_' prefix.
- * ext/socket/extconf.rb: Remove condition for bcc.
+ * gc.c (gc_writebarrier_incremental): ditto.
-Thu Apr 4 22:53:23 2013 Tanaka Akira <akr@fsij.org>
+Tue Mar 24 17:34:01 2015 Shugo Maeda <shugo@ruby-lang.org>
- * include/ruby/ruby.h (FIX2LONG): Parenthesize the macro body.
+ * README.ja.md: should be chunibyo.
-Thu Apr 4 22:32:32 2013 Tanaka Akira <akr@fsij.org>
+Tue Mar 24 17:30:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (time_strftime): Describe %L and %N truncates digits under
- the specified length.
- [ruby-core:52130] [Bug #7829]
+ * ext/-test-/file/fs.c (get_fsname): return filesystem name by
+ statfs/statvfs. [ruby-core:68624] [Bug #10998]
-Thu Apr 4 22:08:46 2013 Tanaka Akira <akr@fsij.org>
+Tue Mar 24 16:46:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * object.c (rb_mod_cvar_set): Reverted "avoid inadvertent
- symbol creation" to avoid SEGV by
- Class.new.class_variable_set(1, 2).
+ * tool/redmine-backporter.rb: now doesn't required spaces just after
+ `!`.
-Thu Apr 4 20:07:19 2013 Tanaka Akira <akr@fsij.org>
+Mon Mar 23 23:18:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pathname/pathname.c (path_write): New method.
- (path_binwrite): Ditto.
- [ruby-core:49468] [Feature #7378]
+ * dir.c (dir_close): don't raise on double close for consistent to
+ IO#close. [Feature #10950]
-Thu Apr 4 16:51:29 2013 Yuki Yugui Sonoda <yugui@google.com>
+Mon Mar 23 21:22:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread_pthread.c: Fixes wrong scopes of #if USE_SLEEPY_TIMER_THREAD
- .. #endif sections. This fixes a build error on NativeClient.
+ * win32/file.c (rb_readlink): move from file.c for better buffer
+ allocation and the result encoding.
-Wed Apr 3 17:25:31 2013 Yuki Yugui Sonoda <yugui@google.com>
+ * win32/win32.c (wreadlink, rb_w32_ureadlink): implement readlink().
- * thread_pthread.c (ruby_init_stack): Avoid using uninitialized value.
- stackaddr and size are not set if get_stack() fails.
+Mon Mar 23 14:40:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 4 16:55:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (winnt_stat): stat with following symbolic links.
- * struct.c (make_struct): avoid inadvertent symbol creation.
- (rb_struct_aref): ditto.
- (rb_struct_aset): ditto.
+ * win32/win32.c (winnt_lstat): rename old winnt_stat, which does
+ not follow symbolic links.
-Thu Apr 4 16:54:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 23 01:44:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (rb_mod_const_set): avoid inadvertent symbol creation.
- (rb_obj_ivar_set): ditto.
- (rb_mod_cvar_set): ditto.
+ * marshal.c (r_symreal): register symbol names as strings first so
+ that r_symlink always returns valid names.
+ [ruby-core:68587] [Bug #10991]
-Thu Apr 4 15:46:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * marshal.c (r_ivar, r_object0): now need to intern symbol names.
- * enum.c (enum_inject): avoid inadvertent symbol creation.
+ * marshal.c (r_object0): compare with symbol names.
-Thu Apr 4 14:37:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Mar 22 22:07:40 2015 Kouhei Sutou <kou@cozmixng.org>
- * thread.c (rb_thread_aref): avoid inadvertent symbol creation.
- (rb_thread_variable_get): ditto.
- (rb_thread_key_p): ditto.
- (rb_thread_variable_p): ditto.
+ * doc/etc.rd.ja: Fix wrong coding for Emacs.
-Thu Apr 4 11:33:57 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Mar 22 09:53:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_bn.c (ossl_bn_to_i): Use bn2hex to speed up.
- In general, binary to/from decimal needs extra cost.
+ * tool/make-snapshot (package): add default CONFIGURE name to
+ follow r50039.
-Thu Apr 4 07:24:18 2013 Tanaka Akira <akr@fsij.org>
+ * tool/make-snapshot (package): substitute configuration variables
+ in Makefile.in instead of passing by the command line, and make
+ temporary Makefile instead of a pipe.
- * ext/socket/extconf.rb: Specify arguments to test functions.
+Sun Mar 22 08:09:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 4 03:25:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * common.mk (ext/ripper/ripper.c, ext/rbconfig/sizeof/sizes.c):
+ strip autogenerated dependencies which have invalid syntax in
+ other than nmake.
- * ext/openssl/ossl_bn.c (ossl_bn_initialize): fix can't create from bn.
+Sat Mar 21 15:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 3 22:09:25 2013 Tanaka Akira <akr@fsij.org>
+ * ext/io/console/console.c (console_set_winsize): use handle for
+ writing. GetConsoleScreenBufferInfo seems failing on a handle
+ for reading.
- * ext/socket/extconf.rb: Test functions and libraries after headers.
+ * io.c: [DOC] update the example of IO#winsize to use $stdout
+ instead of $stdin, which does not work on Windows. a patch by
+ Jan Lelis <mail AT janlelis.de> at [ruby-core:68574].
+ [Bug #10986]
-Wed Apr 3 21:23:29 2013 Tanaka Akira <akr@fsij.org>
+Fri Mar 20 18:41:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_seek_m): Accept :CUR, :END, :SET as "whence" argument.
- (interpret_seek_whence): New function.
- [ruby-dev:45818] [Feature #6643]
+ * proc.c (respond_to_missing_p): check if the receiver responds to
+ the given method by respond_to_missing?.
-Wed Apr 3 20:52:49 2013 Tanaka Akira <akr@fsij.org>
+ * proc.c (mnew_missing): create Method object for method_missing.
+ [ruby-core:68564] [Bug #10985]
- * process.c: Describe the behavior which Ruby invokes a commandline
- directly without shell if the commandline is simple enough.
- [ruby-core:50459] [Bug #7489]
+Fri Mar 20 17:43:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Apr 3 20:27:37 2013 Tanaka Akira <akr@fsij.org>
+ * .travis.yml: enabled email notification.
- * ext/extmk.rb (extmake): Invoke Logging::log_close in a ensure
- clause.
+Fri Mar 20 17:39:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Apr 3 18:53:58 2013 Tanaka Akira <akr@fsij.org>
+ * .travis.yml: removed Ruby 1.9.3 build on Travis CI
- * ext/extmk.rb (extmake): Use Logging.open to switch stdout and
- stderr. Delay Logging::log_close until the failure message is
- written. Write the failure message only if log file is opened.
+Fri Mar 20 12:38:36 2015 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb (Logging.log_opened?): New method.
+ * gc.c (obj_info): obj_info() can receive internal objects.
- [ruby-dev:47215] [Bug #8209]
+ * gc.c (check_rvalue_consistency): obj_info() returns const char *.
-Wed Apr 3 17:11:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 20 12:14:37 2015 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (constat_apply): pass through unknown sequence which
- starts with ESC but is not followed by a bracket. [ruby-core:53879]
- [Bug #8201]
+ * gc.c (obj_info): show class name and T_DATA type_name.
-Wed Apr 3 16:35:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 19 22:12:46 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (rb_big_eq): hide intermediate Bignums not just freeing
- memory. [ruby-core:53893] [Bug #8204]
+ * gc.c (rb_copy_wb_protected_attribute): `dest' can be WB unprotected.
- * object.c (rb_obj_hide): hide an object by clearing klass.
+Thu Mar 19 21:25:25 2015 Koichi Sasada <ko1@atdot.net>
- * bignum.c (rb_big_eq): test as Fixnum if possible and get rid of zero
- length Bignum. [ruby-core:53893] [Bug #8204]
+ * gc.c (rb_copy_wb_protected_attribute): demote `dest' object.
-Tue Apr 2 23:56:03 2013 Tanaka Akira <akr@fsij.org>
+Thu Mar 19 16:18:00 2015 Koichi Sasada <ko1@atdot.net>
- * lib/securerandom.rb (SecureRandom.random_bytes): Use
- OpenSSL::Random.random_add instead of OpenSSL::Random.seed and
- specify 0.0 as the entropy.
- [ruby-core:47308] [Bug #6928]
+ * gc.c, internal.h: export rb_gc_verify_internal_consistency().
-Tue Apr 2 20:24:52 2013 Tanaka Akira <akr@fsij.org>
+Thu Mar 19 16:15:24 2015 Koichi Sasada <ko1@atdot.net>
- * pack.c: Support Q! and q! for long long.
- (natstr): Moved to toplevel. Add q and Q if there is long long type.
- (endstr): Moved to toplevel.
- (NATINT_PACK): Consider long long.
- (NATINT_LEN_Q): New macro.
- (pack_pack): Support Q! and q!.
- (pack_unpack): Ditto.
- [ruby-dev:43970] [Feature #3946]
+ * gc.c (obj_info): show allocation site if GC_DEBUG is not 0.
-Tue Apr 2 19:24:26 2013 Tanaka Akira <akr@fsij.org>
+Thu Mar 19 16:12:01 2015 Koichi Sasada <ko1@atdot.net>
- * ext/-test-/num2int/num2int.c: Define utility methods
- as module methods of Num2int.
+ * gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.
+ * skip on incremental marking because not sure what happen :p
+ * rb_gc_writebarrier_remember() is enough to mark children.
- * test/-ext-/num2int/test_num2int.rb: Follow the above change.
+Thu Mar 19 16:08:42 2015 Koichi Sasada <ko1@atdot.net>
-Tue Apr 2 18:49:01 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (rb_copy_wb_protected_attribute): need demote for old objects.
- * lib/securerandom.rb: Don't use Array#to_s.
- [ruby-core:52058] [Bug #7811] fixed by zzak (Zachary Scott).
+Thu Mar 19 10:31:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 2 17:38:20 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * random.c (fill_random_bytes): release the handle in the static
+ variable, not a local variable.
- * re.c (rb_reg_to_s): suppress duplicated charclass warning.
- Regexp#to_s suppress extra its whole regexp options by calling
- onig_new with its source, but it doesn't call rb_reg_preprocess.
- Therefore its Unicode escapes (\u{XXXX}) are given as is,
- and it may cause duplicated charclass warning for example
- "[\u{33}]" (3 is duplicated) or "[\u{a}\u{b}]" (u is duplicated).
- [ruby-core:53649] [Bug #8151]
+Thu Mar 19 06:30:35 2015 Koichi Sasada <ko1@atdot.net>
-Tue Apr 2 16:00:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because
+ rb_obj_alloc() can return old object in debug.
- * vm_dump.c (rb_print_backtrace): separate to ease showing C backtrace.
+Thu Mar 19 06:29:28 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h (rb_print_backtrace): ditto.
+ * test/objspace/test_objspace.rb: flag name was changed
+ (long_lived -> uncollectible).
-Tue Apr 2 15:22:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Mar 19 05:30:13 2015 Koichi Sasada <ko1@atdot.net>
- * test/ruby/envutil.rb (assert_separately): stop_auto_run of
- Test::Unit::Runner to prevent auto runner use ARGV.
+ * iseq.c (iseq_mark): skip some marking if iseq->orig is available.
- * test/ruby/envutil.rb (assert_separately): add $: to separate process.
+ * iseq.c (rb_iseq_clone): need WB for iseq1->klass = iseq0->klass
+ (done in MEMCPY).
- * test/ruby/envutil.rb (assert_separately): fail if stderr is not
- empty and ignore_stderr is false.
+Thu Mar 19 04:55:53 2015 Koichi Sasada <ko1@atdot.net>
-Tue Apr 2 06:46:59 2013 Tanaka Akira <akr@fsij.org>
+ * internal.h (IMEMO_DEBUG): added.
- * ext/-test-/num2int/num2int.c: Rename utility methods
- to global functions to ease manual experiments.
+ * internal.h: remove unused FL_IMEMO_MARK_V[0-3].
- * test/-ext-/num2int/test_num2int.rb: Follow the above change.
+ * gc.c (rb_imemo_new_debug): added.
-Mon Apr 1 22:26:17 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (obj_info): show imemo type name.
- * ext/zlib/zlib.c (rb_gzfile_set_mtime): Use NUM2UINT.
- The old logic doesn't work well on LP64 platforms as:
- .. -2**63-1 => error,
- -2**63 .. -2**62-1 => success,
- -2**62 .. -2**31-1 => error,
- -2**31 .. 2**31-1 => success,
- 2**31 .. 2**62-1 => error,
- 2**62 .. 2**64-1 => success,
- 2**64 .. => error.
+Thu Mar 19 04:52:26 2015 Koichi Sasada <ko1@atdot.net>
-Mon Apr 1 22:08:02 2013 Benoit Daloze <eregontp@gmail.com>
+ * gc.c (RGENGC_OLD_NEWOBJ_CHECK): add check mechanism.
- * ext/zlib/zlib.c (Zlib::Inflate.new):
- Fix documentation syntax and naming errors.
- Based on patch by Robin Dupret. Fix GH-271.
+ If RGENGC_OLD_NEWOBJ_CHECK > 0, then create old objects
+ (not new objects) periodically.
-Mon Apr 1 21:22:31 2013 Tanaka Akira <akr@fsij.org>
+ Create one old objects per RGENGC_OLD_NEWOBJ_CHECK objects are
+ created.
- * test/-ext-/num2int/test_num2int.rb: Test small bignums.
+Thu Mar 19 04:46:36 2015 Koichi Sasada <ko1@atdot.net>
-Mon Apr 1 21:10:56 2013 Tanaka Akira <akr@fsij.org>
+ * enum.c (enum_sort_by): add WBs.
- * numeric.c (rb_num2ulong_internal): Don't cast a negative double value
- into unsigned long, which is undefined behavior.
- (rb_num2ull): Don't cast a value bigger than LLONG_MAX into
- long long, which is undefined behavior.
+Thu Mar 19 03:37:52 2015 Koichi Sasada <ko1@atdot.net>
-Mon Apr 1 20:57:57 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (check_rvalue_consistency): refactoring.
+ * not inline on RGENGC_CHECK_MODE > 0.
+ * check SPECIAL_CONST_P(obj) first.
+ * add a check that remembered_bit is only TRUE when old (age == 3).
- * ext/-test-/num2int/num2int.c: Return string for result, instead of
- printing.
+ * gc.c (RVALUE_DEMOTE): should clear RVALUE_REMEMBERED bit.
- * test/-ext-/num2int/test_num2int.rb: updated to follow above change.
+ remembered_bit should be TRUE only for old (age == 3) objects.
-Mon Apr 1 20:08:07 2013 Tanaka Akira <akr@fsij.org>
+ Actually there are no effect because demoted objects will be
+ uncollectible WB unprotected objects (marked at the beginning of
+ every minor GC).
- * numeric.c (rb_num2long): Don't use SIGNED_VALUE uselessly.
- (check_int): Ditto.
- (check_short): Ditto.
- (rb_num2fix): Ditto.
- (rb_num2ulong_internal): Add a cast.
+Thu Mar 19 02:52:48 2015 Koichi Sasada <ko1@atdot.net>
-Mon Apr 1 18:41:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c: rename terminologies.
+ * long_lived -> uncollectible:
+ because this bitmap does not mean "long lived objects in past",
+ but means "prohibit collection these objects until next major GC".
- * configure.in: skip autoconf 2.64 and 2.66, 2.67 seems short-lived
- but stick on it for Debian Squeeze.
+ Uncollectible objects consist of two types objects, one is old
+ objects (WB protected objects which age == 3) and another is
+ uncollectible WB unprotected objects which are referred from old
+ objects
-Mon Apr 1 14:22:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * remembered_wb_unprotected_objects ->
+ uncollectible_wb_unprotected_objects:
+ because uncollectible objects does not mean remembered objects.
- * configure.in: check clang version by predefined macro values.
- [Bug #8192]
+Wed Mar 18 17:21:12 2015 Koichi Sasada <ko1@atdot.net>
-Mon Apr 1 12:05:15 2013 Tanaka Akira <akr@fsij.org>
+ * gc.c (gc_writebarrier_generational): add an alternative write
+ barrier (WB) implementation.
+ When finding reference from [Old obj] to [New obj] by WB, current
+ implementation marks [Old obj] as remembered old objects and marks
+ children of [Old obj] at the beginning of marking.
- * numeric.c (check_uint): Take the 1st argument as unsigned long,
- instead of VALUE. Refine the validity test conditions.
- (check_ushort): Ditto.
+ Added (but disabled) code changes current behaviour. This fix promote
+ [New obj] to old and marks as a remembered old object. We can assume
+ "new objects referred from old objects are maybe long-lived old
+ objects".
-Mon Apr 1 07:15:03 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ Disadvantage of added algorithm is we may promote unwilling
+ short-lived objects. For example, consider many new objects push and
+ pop to an old stack object. All of new objects (short-lived objects)
+ promote to old objects unexpectedly.
- * configure.in: use quadrigraph to put '[' or ']'. [Bug #8192]
+ To compare these behaviour, I add this new code (but disabled it).
-Mon Apr 1 04:16:41 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Mar 18 17:14:39 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: kick old clang. [ruby-dev:47204] [Bug #8192]
+ * gc.c (RVALUE_PROMOTE_RAW): rename to RVALUE_OLD_LONG_LIVED_SET()
+ to make clear.
-Mon Apr 1 01:12:46 2013 Tanaka Akira <akr@fsij.org>
+Wed Mar 18 17:10:01 2015 Koichi Sasada <ko1@atdot.net>
- * include/ruby/ruby.h (FIX2ULONG): Make it consistent with NUM2ULONG.
+ * gc.c (check_rvalue_consistency): do not need to check is_sweeping().
- * ext/-test-/num2int/num2int.c: Add utility methods for FIX2XXX tests.
+Wed Mar 18 14:13:22 2015 Koichi Sasada <ko1@atdot.net>
- * test/-ext-/num2int/test_num2int.rb: Add tests for FIX2XXX.
+ * benchmark/bm_vm1_gc_wb_ary.rb: run GC to finish "marking" phase.
-Sun Mar 31 17:17:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * benchmark/bm_vm1_gc_wb_obj.rb: ditto.
- * proc.c (rb_mod_define_method): consider visibility in define_method.
- patch by mashiro <mail AT mashiro.org>. fix GH-268.
+ * benchmark/bm_vm1_gc_wb_ary_promoted.rb: add parameter
+ full_mark: false to invoke only minor GC.
-Sun Mar 31 15:40:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * benchmark/bm_vm1_gc_wb_obj_promoted.rb: ditto.
- * win32/configure.bat: try to fix option arguments split by commas and
- equals here. this batch file no longer run with old command.com.
+Wed Mar 18 12:07:36 2015 Koichi Sasada <ko1@atdot.net>
- * tool/mkconfig.rb: no hacks for cmd.exe.
+ * string.c: add a comment about RSTRING_FSTR.
-Sun Mar 31 13:47:04 2013 Tanaka Akira <akr@fsij.org>
+Wed Mar 18 12:01:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (rb_num2ulong_internal): New function similar to
- rb_num2ulong but integer wrap around flag is also returned.
- (rb_num2ulong): Use rb_num2ulong_internal.
- (rb_num2uint): Use rb_num2ulong_internal and the wrap around flag is
- used instead of negative_int_p(val).
- (rb_num2ushort): ditto.
+ * hash.c (rb_any_hash): use same hash values with Float#hash so
+ that -0.0 and +0.0 will be identical.
+ [ruby-core:68541] [Bug #10979]
-Sun Mar 31 06:27:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 18 05:34:32 2015 Koichi Sasada <ko1@atdot.net>
- * class.c (HAVE_METACLASS_P): should check FL_SINGLETON flag before get
- instance variable to get rid of wrong warning about __attached__.
- [ruby-core:53839] [Bug #8188]
+ * string.c: introduce STR_FAKESTR to show string is FAKESTR or not.
-Sat Mar 30 14:11:28 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * string.c (STR_SET_SHARED): ignore FAKESTR because only Ruby objects
+ can use write barrier.
- * bcc32: removed. agreed at
- http://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130223Japan
+Tue Mar 17 18:59:16 2015 Koichi Sasada <ko1@atdot.net>
-Sat Mar 30 03:58:00 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/ruby.h: use rb_gc_writebrrier() simply.
+ For incremental GC, we need to get a pointer to the objspace.
+ We can share this pointer for the following WB process.
+ And considering icache hit ratio, process in the GC.
- * win32/file.c (code_page): use cp1252 instead of cp20127 as US-ASCII.
- fix [ruby-core:53079] [Bug #7996]
- reported and patched by mmeltner (Michael Meltner).
+ * gc.c (rb_gc_writebarrier): added.
-Sat Mar 30 03:49:21 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (gc_writebarrier_generational, gc_writebarrier_incremental):
+ make them NOINLINE because inlining them into rb_gc_writebarrier()
+ makes a prologue code of rb_gc_writebarrier() longer (storing callee
+ save registers).
- * win32/win32.c (wrename): use MoveFileExW instead of MoveFileW,
- because the latter fails on cross device file move of some
- environments.
- fix [ruby-core:53492] [Bug #8109]
- reported by mitchellh (Mitchell Hashimoto).
+ This patch improve the performance of WB on micro-benchmarks.
-Fri Mar 29 22:09:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ name ruby 2.1 trunk modified
+ vm1_gc_wb_ary* 0.511 0.632 0.532
+ vm1_gc_wb_ary_promoted* 0.578 0.701 0.674
+ vm1_gc_wb_obj* 0.419 0.575 0.492
+ vm1_gc_wb_obj_promoted* 0.537 0.664 0.618
+ (sec)
- * thread.c (rb_mutex_synchronize_m): yield no block params. patch by
- splattael (Peter Suschlik) in [ruby-core:53773] [Bug #8097].
- fix GH-266.
+Tue Mar 17 18:51:43 2015 Koichi Sasada <ko1@atdot.net>
-Fri Mar 29 16:51:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * benchmark/bm_vm1_gc_wb_ary(_promoted).rb: separate fastpath and
+ slowpath for WB.
- * io.c (argf_next_argv): set init flag if succeeded to forward, after
- skipping.
+ Before this change bm_vm1_gc_wb_ary.rb tried to check the performance
+ for WB slowpath (making a reference from oldobj to newobj). However,
+ from Ruby 2.2, 3 GCs are needed to promote new objects because
+ only 3 age objects are promoted objects.
- * io.c (argf_block_call_i, argf_block_call): no more forwarding if
- forwarded after skipping. [ruby-list:49185]
+ To compare fastpath and slowpath, introduce new "promoted" version
+ benchmark.
- * io.c (argf_close): deal with init flag.
+ bm_vm1_gc_wb_ary.rb is for fastpath and
+ bm_vm1_gc_wb_ary_promoted.rb is for slowpath.
- * io.c (argf_block_call_i, argf_block_call): forward next file if
- skipped while iteration, to get rid of IOError. [ruby-list:49185]
+ * benchmark/bm_vm1_gc_wb_obj(_promoted).rb: ditto.
-Fri Mar 29 11:09:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 17 17:23:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (configuration): not include all CFLAGS in CXXFLAGS, to
- use different set than C for C++. [ruby-core:45273] [Bug #6504]
+ * dir.c (glob_helper): distinguish not-yet-stated and DT_UNKNOWN
+ by readdir, and traverse recursively for the former. Linux
+ readdir returns DT_UNKNOWN on some filesystems, e.g., smbfs,
+ iso9660.
-Fri Mar 29 10:24:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 16 17:43:21 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * include/ruby/io.h: undef POSIX compliant names on AIX, which are no
- longer needed. patch suggested by edelsohn (David Edelsohn) in
- [ruby-core:53815]. [Bug #8174]
+ * lib/webrick/server.rb: Fix regression bug in WEBrick's
+ :DoNotReverseLookup config option implementation.
+ [fix GH-731] Patch by @vais
+ * test/webrick/test_do_not_reverse_lookup.rb: ditto.
-Fri Mar 29 06:39:42 2013 Tanaka Akira <akr@fsij.org>
+Sat Mar 14 20:05:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * numeric.c (rb_num2ull): Cast double to unsigned LONG_LONG via
- LONG_LONG instead of double to unsigned LONG_LONG directly.
- This is a challenge to fix a test_num2ull(TestNum2int)
- failure (NUM2ULL(-1.0) should be "18446744073709551615" but was "0")
- on Mac OS X with 32bit clang.
- http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-trunk-m32-o0/log/20130328T191100Z.diff.html.gz
+ * math.c (math_gamma): optimization for passed small integer.
-Fri Mar 29 00:54:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Mar 14 18:07:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be
- preserved. [ruby-core:53745] [Bug #8169]
+ * enum.c: [DOC] Fixes Enumerable#member? documentation
+ [fix GH-756][ci skip] Patch by @shamanime
-Thu Mar 28 23:11:25 2013 Tanaka Akira <akr@fsij.org>
+Sat Mar 14 12:23:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/resolv.rb: Test Windows platform by detecting LoadError when
- require 'win32/resolv' suggested by Nobuyoshi Nakada [ruby-core:53389].
- [ruby-core:53388] [Feature #8090] Reported by Charles Nutter.
+ * dir.c (glob_helper): use d_type to reduce lstat system calls.
-Thu Mar 28 23:10:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/dir.h (struct direct): add d_type instead of d_isdir and
+ d_isrep. SYMLINKD is unreliable, since the target can be
+ replaced after a link was created.
- * include/ruby/io.h: rename SVR3,4 member names as POSIX compliant,
- to get rid of conflict on AIX. [ruby-core:53765] [Bug #8174]
+ * win32/win32.c (readdir_internal): set d_type.
-Thu Mar 28 18:22:21 2013 Tanaka Akira <akr@fsij.org>
+Sat Mar 14 02:14:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/-ext-/num2int/test_num2int.rb: extract
- assert_num2i_success_internal and assert_num2i_error_internal and
- provide assertion messages as "NUM2XXX(NNN)".
+ * parse.y (primary): empty parentheses at cmdarg can be null.
+ [ruby-core:68477] [Bug #10957]
-Thu Mar 28 07:05:25 2013 Tanaka Akira <akr@fsij.org>
+Fri Mar 13 15:04:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/intern.h: Delete redundant inclusions caused by
- AC_INCLUDES_DEFAULT in defines.h.
+ * ext/stringio/stringio.c (strio_close): don't raise on double
+ close for consistent to IO#close.
- * include/ruby/defines.h: Ditto.
+Fri Mar 13 15:03:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h: Ditto.
+ * io.c (rb_io_close_read, rb_io_close_write): don't raise after
+ close same as IO#close.
- * include/ruby/st.h: Ditto.
+Fri Mar 13 12:29:07 2015 Tanaka Akira <akr@fsij.org>
-Thu Mar 28 06:51:31 2013 Tanaka Akira <akr@fsij.org>
+ * test/readline/test_readline.rb: Restore environment variables:
+ COLUMNS LINES
- * include/ruby/defines.h: Fix a compilation error on NetBSD,
- "type of formal parameter 1 is incomplete" for the rb_thread_wait_for
- invocation in rb_file_flock, by including header files as
- AC_INCLUDES_DEFAULT of autoconf.
+Fri Mar 13 11:37:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 27 22:09:14 2013 Tanaka Akira <akr@fsij.org>
+ * ext/fiddle/extconf.rb: needs --enable-shared when linked to
+ libruby or fiddle.so. since --with-static-linked-ext does no
+ longer link extensions to ruby program with --enable-shared, the
+ only combination needs --enable-static is --disable-shared and
+ --with-static-linked-ext. [ruby-dev:48901] [Bug #10960]
- * numeric.c (LONG_MIN_MINUS_ONE_IS_LESS_THAN): New macro.
- (LLONG_MIN_MINUS_ONE_IS_LESS_THAN): Ditto.
- (rb_num2long): Use LONG_MIN_MINUS_ONE_IS_LESS_THAN.
- (rb_num2ulong): Ditto.
- (rb_num2ll): Use LLONG_MIN_MINUS_ONE_IS_LESS_THAN.
- (rb_num2ull): Ditto.
+Fri Mar 13 07:02:20 2015 Eric Wong <e@80x24.org>
- * test/-ext-/num2int/test_num2int.rb (assert_num2i_success): Test the
- value converted into a Float if Float can represent the value
- exactly.
- (assert_num2i_error): Ditto.
+ * ext/socket/init.c (rsock_s_accept_nonblock): use rb_hash_lookup2
+ * ext/openssl/ossl_ssl.c (get_no_exception): new function
+ (ossl_ssl_accept_nonblock): use get_no_exception
+ (ossl_ssl_read_internal): ditto
+ (ossl_ssl_write_nonblock): ditto
+ [ruby-core:68511]
-Wed Mar 27 20:59:47 2013 Tanaka Akira <akr@fsij.org>
+Fri Mar 13 07:01:38 2015 Eric Wong <e@80x24.org>
- * test/-ext-/num2int/test_num2int.rb (assert_num2i_success): New
- utility method.
- (assert_num2i_error): Ditto.
+ * ext/openssl/ossl_ssl.c: predefine wait_*able symbols
-Wed Mar 27 20:37:59 2013 Tanaka Akira <akr@fsij.org>
+Thu Mar 12 22:59:53 2015 Tanaka Akira <akr@fsij.org>
- * time.c (num_exact): Use to_r method only if to_int method is
- available.
- [ruby-core:53764] [Bug #8173] Reported by Hiro Asari.
+ * test/lib/leakchecker.rb: Check environment variables.
-Wed Mar 27 12:07:40 2013 Tanaka Akira <akr@fsij.org>
+Thu Mar 12 05:54:27 2015 Eric Wong <e@80x24.org>
- * test/-ext-/num2int/test_num2int.rb (test_num2ll): test LLONG_MIN,
- not LONG_MIN.
+ * ext/socket/init.c (rsock_s_accept_nonblock):
+ support exception: false
+ [ruby-core:66385] [Feature #10532]
+ * ext/socket/init.c (rsock_init_socket_init): define new symbols
+ * ext/socket/rubysocket.h: adjust prototype
+ * ext/socket/socket.c (sock_accept_nonblock): support exception: false
+ * ext/openssl/ossl_ssl.c (ossl_ssl_accept_nonblock): ditto
+ * ext/socket/socket.c (Init_socket): adjust accept_nonblock definition
+ * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
+ * ext/socket/tcpserver.c (rsock_init_tcpserver): ditto
+ * ext/socket/unixserver.c (rsock_init_unixserver): ditto
+ * ext/socket/tcpserver.c (tcp_accept_nonblock): adjust
+ rsock_s_accept_nonblock call
+ * ext/socket/unixserver.c (unix_accept_nonblock): ditto
+ * ext/openssl/ossl_ssl.c (ossl_start_ssl): support no_exception
+ * ext/openssl/ossl_ssl.c (ossl_ssl_connect): adjust ossl_start_ssl call
+ * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock): ditto
+ * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto
+ * test/socket/test_nonblock.rb (test_accept_nonblock): test for
+ "exception :false"
+ * test/socket/test_tcp.rb (test_accept_nonblock): new test
+ * test/socket/test_unix.rb (test_accept_nonblock): ditto
+ * test/openssl/test_pair.rb (test_accept_nonblock_no_exception): ditto
-Wed Mar 27 12:02:45 2013 Tanaka Akira <akr@fsij.org>
+Thu Mar 12 10:53:06 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h (TIMET_MAX_PLUS_ONE): definition simplified.
+ * internal.h, node.h: move a definition of `struct rb_global_entry'
+ and related functions from node.h to internal.h.
-Wed Mar 27 06:39:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * variable.c: remove unused include pragma.
- * lib/mkmf.rb (MAIN_DOES_NOTHING): force to refer symbols for tests
- to be preserved. [ruby-core:53745] [Bug #8169]
+ * common.mk: remove unused dependency.
-Wed Mar 27 05:15:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 12 10:32:39 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in (RUBY_REPLACE_TYPE): define SIGNEDNESS_OF_type same as
- check_signedness of mkmf.rb.
+ * common.mk: remove unused dependency.
- * internal.h (TIMET_MAX, TIMET_MIN, TIMET_MAX_PLUS_ONE): use
- SIGNEDNESS_OF_TIME_T.
+Thu Mar 12 08:20:14 2015 Koichi Sasada <ko1@atdot.net>
-Wed Mar 27 00:28:45 2013 Tanaka Akira <akr@fsij.org>
+ * load.c: removed unused header file "node.h".
- * internal.h (TIMET_MAX_PLUS_ONE): Defined.
+ * method.h: ditto.
- * thread.c (double2timeval): Saturate out-of-range values.
+ * symbol.c: ditto.
-Tue Mar 26 23:41:18 2013 Tanaka Akira <akr@fsij.org>
+Thu Mar 12 08:14:48 2015 Koichi Sasada <ko1@atdot.net>
- * internal.h: Define TIMET_MAX and TIMET_MIN here.
+ * gc.c: RGENGC_CHECK_MODE should be 0.
- * time.c: Remove TIMET_MAX and TIMET_MIN definitions.
+Thu Mar 12 07:44:17 2015 Koichi Sasada <ko1@atdot.net>
- * thread.c: Ditto.
+ * internal.h: use T_IMEMO to represent `struct MEMO' value.
+ memo->v1 and memo->v2 is WB protected values.
+ So use MEMO_V1/V2_SET() macros to set these values.
+ memo->u3 is ambiguous (sometimes a VALUE, sometimes an integer
+ value), so use gc_mark_maybe() in gc.c to mark it.
- * thread_pthread.c: Remove TIMET_MAX definition.
+ Rename NEW_MEMO() to MEMO_NEW().
- * thread_win32.c: Ditto.
+ Move MEMO_FOR and NEW_MEMO_FOR macros from node.h.
-Tue Mar 26 22:31:10 2013 Tanaka Akira <akr@fsij.org>
+ Export a rb_imemo_new() function for ext/ripper.
- * ext/socket/socket.c (sockaddr_len): return the shortest length for
- unknown socket address.
+ * node.h: remove NODE_MEMO.
-Tue Mar 26 22:14:46 2013 Tanaka Akira <akr@fsij.org>
+ * enum.c: catch up these change.
- * thread.c (double2timeval): convert the infinity to TIME_MAX to avoid
- SEGV by Thread.new {}.join(Float::INFINITY) on
- Debian GNU/Linux (amd64).
+ * enumerator.c: ditto.
-Mon Mar 25 07:09:20 2013 Eric Hodel <drbrain@segment7.net>
+ * load.c: ditto.
- * lib/rinda/tuplespace.rb: Only return tuple entry once on move,
- either through port or regular return, not both. This results in a
- 120% speedup when combined with #8125. Patch by Joel VanderWerf.
- [ruby-trunk - Feature #8119]
+ * ext/objspace/objspace.c (count_nodes): ditto.
-Mon Mar 25 06:59:01 2013 Eric Hodel <drbrain@segment7.net>
+ * gc.c (gc_mark_children): mark imemo_memo type.
- * test/rinda/test_rinda.rb: Skip IPv6 tests if no IPv6 addresses
- exist. Skip fork-dependent test if fork is not available.
- [ruby-trunk - Bug #8159]
+ * parse.y (new_args_gen): use T_IMEMO.
+ (I'm not sure it is working correctly...)
-Sun Mar 24 10:38:24 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Mar 11 22:36:34 2015 Koichi Sasada <ko1@atdot.net>
- * addr2line.c (putce): suppress unused return value warning.
+ * eval.c (frame_called_id): it should use vm_ifunc type.
-Mon Mar 25 02:01:03 2013 Narihiro Nakamura <authornari@gmail.com>
+ * eval.c (frame_func_id): ditto.
- * proc.c (bm_free): need to clean up the mark flag of a free and
- unlinked method entry. [Bug #8100] [ruby-core:53439]
+Wed Mar 11 22:27:05 2015 Koichi Sasada <ko1@atdot.net>
-Sun Mar 24 22:13:51 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * node.h: remove NODE_IFUNC, NEW_IFUNC.
- * string.c (rb_str_rpartition): revert r39903, and convert byte offset
- to char offset; the return value of rb_reg_search is byte offset,
- but other than it of rb_str_rpartition expects char offset.
- [Bug #8138] [ruby-dev:47183]
+ * internal.h: use T_IMEMO for IFUNC.
-Sun Mar 24 18:29:46 2013 Akinori MUSHA <knu@iDaemons.org>
+ rename `struct IFUNC' to `struct vm_ifunc' and move the definition
+ from vm_insnhelper.h. Add imemo_ifunc.
- * string.c (rb_str_rpartition): Fix String#rpartition(/re/)
- against a multibyte string. [Bug #8138] [ruby-dev:47183]
+ * gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object.
-Sun Mar 24 13:42:24 2013 Narihiro Nakamura <authornari@gmail.com>
+ * compile.c: catch up these changes.
- * gc.c (GC_ENABLE_LAZY_SWEEP): new macro to switch lazy sweeping
- for debugging. [Feature #8024] [ruby-dev:47135]
+ * proc.c: ditto.
-Sun Mar 24 12:55:47 2013 Narihiro Nakamura <authornari@gmail.com>
+ * vm_core.h (RUBY_VM_IFUNC_P): ditto.
- * gc.c: We have no chance to expand the heap when lazy sweeping is
- restricted. So collecting is often invoked if there is not
- enough free space in the heap. Try to expand heap when this is
- the case.
+ * vm_eval.c (rb_iterate): ditto.
-Sun Mar 24 11:03:31 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c: ditto.
- * test/ruby/test_require.rb: Remove temporally files in the tests.
+ * ext/objspace/objspace.c: ditto.
- * test/ruby/test_rubyoptions.rb: Ditto.
+Wed Mar 11 21:53:43 2015 Koichi Sasada <ko1@atdot.net>
- * test/logger/test_logger.rb: Ditto.
+ * internal.h, eval_intern.h: move CREF accessors.
- * test/psych/test_psych.rb: Ditto.
+ List IMEMO supported types in internal.h.
- * test/readline/test_readline.rb: Ditto.
+Wed Mar 11 21:45:36 2015 Koichi Sasada <ko1@atdot.net>
- * test/syslog/test_syslog_logger.rb: Ditto.
+ * vm_insnhelper.h: use T_IMEMO to create THROW_DATA.
- * test/webrick/test_httpauth.rb: Ditto.
+ Add THROW_DATA_NEW().
- * test/zlib/test_zlib.rb: Ditto.
+ * internal.h: move definition of `struct THROW_DATA'
+ from vm_insnhelper.h to internal.h.
-Sun Mar 24 05:36:29 2013 Eric Hodel <drbrain@segment7.net>
+ Rename `THROW_DATA' to `vm_throw_data'.
- * lib/rinda/ring.rb: Added documentation for multicast support.
+ * eval_intern.h (THROW_DATA_P): move to internal.h.
+ THROW_DATA is no longer T_NODE, so check T_IMEMO.
- * NEWS: Point to above documentation.
+ * gc.c (gc_mark_children): mark THROW_DATA.
-Sun Mar 24 05:32:39 2013 Eric Hodel <drbrain@segment7.net>
+ * vm.c: catch up these changes.
- * test/rinda/test_rinda.rb: Restore tests commented out while fixing
- test slowdown bug before r39895.
+ * vm_eval.c: ditto.
-Sun Mar 24 05:03:36 2013 Eric Hodel <drbrain@segment7.net>
+ * vm_insnhelper.c: ditto.
- * lib/rinda/ring.rb: Add multicast support to Rinda::RingFinger and
- Rinda::RingServer. [ruby-trunk - Bug #8073]
- * test/rinda/test_rinda.rb: Test for the above.
+Wed Mar 11 21:21:56 2015 Koichi Sasada <ko1@atdot.net>
- * NEWS: Update with Rinda multicast support
+ * vm_insnhelper.c: use T_IMEMO to create SVAR.
-Sun Mar 24 04:13:27 2013 Eric Hodel <drbrain@segment7.net>
+ * internal.h, vm_insnhelper.h: move definition `struct SVAR'
+ from vm_insnhelper.h to internal.h. And rename it to struct vm_svar.
- * test/rinda/test_rinda.rb: Fixed test failures in r39890 and r39891
- due to stopping DRb service.
+ new imemo_type imemo_svar is added.
-Sun Mar 24 03:34:02 2013 Eric Hodel <drbrain@segment7.net>
+ * gc.c (gc_mark_children): mark imemo_svar.
- * lib/rinda/rinda.rb: Fixed loss of tuple when remote is alive but the
- call stack was unwound. Patch by Joel VanderWerf.
- [ruby-trunk - Bug #8125]
- * test/rinda/test_rinda.rb: Test for the above.
+ * node.c (rb_gc_mark_node): remove useless marking.
-Sun Mar 24 02:14:53 2013 Tanaka Akira <akr@fsij.org>
+Wed Mar 11 19:35:46 2015 Koichi Sasada <ko1@atdot.net>
- * test/mkmf/test_have_macro.rb: remove temporally files in the tests.
+ * include/ruby/ruby.h: introduce new type T_IMEMO.
+ T_IMEMO is Internal Memo type, internal use only.
+ T_IMEMO has same purpose of NODE_MEMO.
-Sat Mar 23 23:50:04 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ To insert T_IMEMO, type numbers are modified a little.
- * addr2line.c (kprintf): added from FreeBSD libstand's printf.
- this is consided as async signal safe function.
+ * internal.h: define struct RIMemo. Each RIMemo objects
+ has imemo_type. We can observe it by the imemo_type() function.
- * addr2line.c (rb_dump_backtrace_with_lines): use kfprintf.
- [Bug #8144] [ruby-core:53632]
+ * gc.c (rb_imemo_new): added.
-Sat Mar 23 23:28:00 2013 Kenta Murata <mrkn@mrkn.jp>
+ * node.h: remove NODE_CREF and NEW_CREF().
- * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Use Qnil and NIL_P
- instead of (VALUE)0 as a return value.
+ * node.c (rb_gc_mark_node): ditto.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_div): ditto.
+ * vm.c (vm_cref_new): use rb_imem_new().
- * ext/bigdecimal/bigdecimal.c (BigDecimal_divremain): ditto.
+ * vm_eval.c: ditto.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_remainder): ditto.
+ * vm_insnhelper.c: use RIMemo objects for CREF.
-Sat Mar 23 17:39:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c: support T_IMEMO.
- * vm_eval.c (check_funcall_respond_to): preserve passed_block, which
- is modified in vm_call0_body() via vm_call0(), and caused a bug of
- rb_check_funcall() by false negative result of rb_block_given_p().
- re-fix [ruby-core:53650] [Bug #8153].
- [ruby-core:53653] [Bug #8154]
+Wed Mar 11 17:03:20 2015 Koichi Sasada <ko1@atdot.net>
-Fri Mar 22 17:48:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c: fix memory leak by prepend method.
- * lib/forwardable.rb (Forwardable::FILE_REGEXP): create regexp object
- outside sources for eval, to reduce allocations in def_delegators
- wrappers. //o option does not make each regexps shared. patch by
- tmm1 (Aman Gupta) in [ruby-core:53620] [Bug #8143].
+ It is easy to reproduce with such script:
-Fri Mar 22 17:38:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ module M; def bar; end; end
+ loop{
+ Class.new do
+ def foo; end
+ prepend M
+ end
+ }
- * load.c (rb_feature_p), vm_core.h (rb_vm_struct): turn
- loaded_features_index into st_table. patches by tmm1 (Aman Gupta)
- in [ruby-core:53251] and [ruby-core:53274] [Bug #8048]
+ * gc.c (obj_free): free T_ICLASS::m_tbl if it is created by prepend.
+ To recognize it, check RICLASS_IS_ORIGIN flag.
-Fri Mar 22 10:29:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_mark_children): T_ICLASS objects only need to mark
+ T_ICLASS::m_tbl if RICLASS_IS_ORIGIN is set.
- * ext/bigdecimal/bigdecimal.c: Fix style.
+ * gc.c (obj_memsize_of): count T_ICLASS if RICLASS_IS_ORIGIN is set.
-Fri Mar 22 05:30:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (RCLASS_SET_ORIGIN): add to set RCLASS_SET_ORIGIN.
- * parse.y (ambiguous_operator): refine warning message, since this
- warning is shown after literal too.
+ TODO: The word `origin' seems not good name. We need to invent
+ another good name.
-Fri Mar 22 04:51:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c: use RCLASS_SET_ORIGIN().
- * vm_insnhelper.c (vm_callee_setup_keyword_arg): should check required
- keyword arguments even if rest hash is defined. [ruby-core:53608]
- [Bug #8139]
+ * class.c (class_alloc): zero clear rb_classext_t.
-Fri Mar 22 01:00:17 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Wed Mar 11 13:28:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (rb_execarg_addopt, run_exec_pgroup): use rb_pid_t
- instead of pid_t.
+ * configure.in: check also procstat_getvmmap, which is not
+ available on FreeBSD 9. [ruby-core:68468] [Bug #10954]
- * ext/pty/pty.c (raise_from_check, pty_check): ditto.
+ * vm_dump.c (procstat_vm): use kinfo_getvmmap instead if
+ procstat_getvmmap is not available.
-Fri Mar 22 00:04:15 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Mar 11 09:15:21 2015 Koichi Sasada <ko1@atdot.net>
- * addr2line.c (rb_dump_backtrace_with_lines): output line at once.
+ * internal.h: define struct MEMO.
-Thu Mar 21 23:17:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c: use MEMO.
- * thread.c (ruby_kill): get rid of deadlock on signal 0.
- [ruby-dev:47182] [Bug #8137]
+ * enumerator.c: ditto.
-Thu Mar 21 22:39:46 2013 Naohisa Goto <ngotogenome@gmail.com>
+ * load.c: ditto.
- * marshal.c (marshal_dump, marshal_load): workaround for segv on
- Intel Solaris compiled with Oracle SolarisStudio 12.3.
- Partly revert r38174. [ruby-core:52042] [Bug #7805]
+ * node.h: return (struct MEMO *) pointer.
-Thu Mar 21 16:48:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 11 06:26:21 2015 Koichi Sasada <ko1@atdot.net>
- * parse.y (simple_re_meta): escape all closing characters, not only
- round parenthesis. [ruby-core:53578] [Bug #8133]
+ * vm_insnhelper.h (THROW_DATA_STATE): return int, not VALUE.
-Thu Mar 21 13:50:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.h (THROW_DATA_STATE_SET): accept int value.
- * vm_core.h (UNINITIALIZED_VAR): suppress warnings by clang 4.2.
- [ruby-core:51742] [Bug #7756]
+Wed Mar 11 05:06:46 2015 Koichi Sasada <ko1@atdot.net>
-Thu Mar 21 07:34:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * vm_eval.c (rb_catch_protect): use THROW_DATA_VAL().
- * ext/date/date_core.c: Typo in Date::MONTHNAMES by Matt Gauger
- [GH fixes #261]
+Wed Mar 11 04:56:04 2015 Koichi Sasada <ko1@atdot.net>
-Wed Mar 20 22:53:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.h: define struct IFUNC.
- * lib/mkmf.rb (find_library): fix to format message.
- [ruby-core:53568] [Bug #8130]
+ * vm_eval.c (rb_iterate): use it.
-Wed Mar 20 22:52:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_yield_with_cfunc): ditto.
- * lib/mkmf.rb (install_dirs, with_destdir): prefix with DESTDIR
- directories to install only unless bundled extension libraries.
- [ruby-core:53502] [Bug #8115]
+Wed Mar 11 03:52:12 2015 Koichi Sasada <ko1@atdot.net>
-Wed Mar 20 17:47:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * eval_intern.h (THROW_DATA_P): use RB_TYPE_P() instead of
+ BUILTIN_TYPE().
- * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup):
- allow using different root for source and build directories.
- this may fixes a minor problem of r39834.
+ * thread.c (thread_join): use THROW_DATA_P().
-Wed Mar 20 16:40:48 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+Wed Mar 11 03:48:01 2015 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_signal.rb (test_hup_me): skip if HUP isn't supported.
- On Windows this test causes ArgumentError.
+ * proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not.
-Wed Mar 20 16:24:12 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ * vm.c: ditto.
- * test/rubygems/test_gem_installer.rb (test_install_extension_flat):
- use ruby in build directory in case ruby is not installed.
- [ruby-core:53265] [Bug #8058]
+ * vm_dump.c: ditto.
-Wed Mar 20 15:22:07 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_insnhelper.c: ditto.
- * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): use
- relative path to get rid of "too long commandline" error.
+ * vm_core.h (RUBY_VM_IFUNC_P): use RB_TYPE_P() instead of
+ BUILTIN_TYPE().
-Wed Mar 20 04:27:42 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+Wed Mar 11 03:21:37 2015 Koichi Sasada <ko1@atdot.net>
- * test/rinda/test_rinda.rb: remove unused variables.
- patched by Vipul A M <vipulnsward@gmail.com>
+ * vm_insnhelper.h: define struct THROW_DATA to represent
+ throwing data. Also define accessor functions.
-Wed Mar 20 04:15:32 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * eval_intern.h: move related changes into vm_insnhelper.h.
+ Now these MACROs (functions) are only used in vm*.c.
- * ext/bigdecimal/bigdecimal.c: fixed typo.
- patched by Vipul A M <vipulnsward@gmail.com>
+ There is only THROW_DATA_P(err) to check this data type or not.
-Sat Mar 16 03:40:49 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm.c: catch up these changes.
- * test/ruby/test_signal.rb (test_hup_me): added a few comments.
+ * vm_eval.c: ditto.
-Sat Mar 16 03:39:38 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_insnhelper.c: ditto.
- * thread.c (ruby_kill): added a few comments.
+Wed Mar 11 00:57:00 2015 Rei Odaira <Rei.Odaira@gmail.com>
-Sat Mar 16 03:36:56 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/rubygems/test_gem_security_trust_dir.rb: The return value of
+ File::Stat#mode is OS dependent. In AIX, 0200000 is set.
- * thread.c (ruby_kill): release GVL while waiting signal delivered.
+Tue Mar 10 20:03:41 2015 Tanaka Akira <akr@fsij.org>
-Tue Mar 19 19:50:48 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/webrick/server.rb: Invoke setup_shutdown_pipe in start method
+ instead of listen method.
+ [ruby-core:68476] [Bug #10956] Reported by Shintaro Kojima.
- * ruby_kill (internal.h, thread.c): use rb_pid_t instead of pid_t.
- this fixes the build failure of mswin introduced at r39819.
+Tue Mar 10 17:27:27 2015 Koichi Sasada <ko1@atdot.net>
-Tue Mar 19 17:09:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (thread_join): Fixnum (except TAG_FATAL) and
+ NODE should not be reached here.
- * string.c (rb_str_conv_enc_opts): convert with one converter, instead
- of re-creating converters for each buffer expansion.
+Mon Mar 9 21:42:10 2015 Koichi Sasada <ko1@atdot.net>
-Tue Mar 19 17:06:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (ep_cref): rename to lep_cref() because it should be
+ local ep.
- * dir.c (glob_helper): compose HFS file names from UTF8-MAC.
- [ruby-core:48745] [Bug #7267]
+Mon Mar 9 16:34:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Mar 16 01:44:29 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/stringio/stringio.c (strio_close): don't raise on double
+ close for consistent to IO#close.
- * internal.h: added a declaration of ruby_kill().
- * thread.c (ruby_kill): helper function of kill().
+Mon Mar 09 06:44:48 2015 Koichi Sasada <ko1@atdot.net>
- * signal.c (rb_f_kill): use ruby_kill() instead of kill().
- * signal.c (rb_f_kill): call rb_thread_execute_interrupts()
- to ensure that make SignalException if sent a signal
- to myself. [Bug #7951] [ruby-core:52864]
+ * vm_insnhelper.h: define struct SVAR for SVAR.
+ This data type is also same layout of NODE (NODE_IF).
- * vm_core.h (typedef struct rb_thread_struct): added
- th->interrupt_cond.
- * thread.c (rb_threadptr_interrupt_common): added to
- initialization of th->interrupt_cond.
- * thread.c (thread_create_core): ditto.
+ * vm_insnhelper.c: catch up this change.
- * test/ruby/test_signal.rb (TestSignal#test_hup_me): test for
- the above.
+Mon Mar 9 06:43:21 2015 Koichi Sasada <ko1@atdot.net>
-Sat Mar 16 00:42:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_insnhelper.c (lep_svar_set): add WBs.
- * io.c (linux_iocparm_len): enable only exist _IOC_SIZE().
- Because musl libc doesn't have it. [Bug #8051] [ruby-core:53229]
+Mon Mar 9 06:19:06 2015 Koichi Sasada <ko1@atdot.net>
-Tue Mar 19 10:05:04 2013 Shota Fukumori <her@sorah.jp>
+ * internal.h: define rb_cref_t and change to use it.
- * ext/objspace/objspace.c: Fix typo in doc. Patch by Sho Hashimoto.
- [Bug #8116] [ruby-dev:47177]
+ rb_cref_t is data type of CREF. Now, the body is still NODE.
+ It is easy to understand what is CREF and what is pure NODE.
-Tue Mar 19 02:13:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Mon Mar 9 06:00:37 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: set ac_cv_prog_cxx if CXX is supplied.
+ * vm_insnhelper.h (COPY_CREF_OMOD): fix translation miss.
-Tue Mar 19 01:18:00 2013 Kenta Murata <mrkn@mrkn.jp>
+Mon Mar 9 04:47:58 2015 Koichi Sasada <ko1@atdot.net>
- * configure.in: Fix c++ compiler auto-selection not only for
- Darwin 11.x, but also the other versions of Darwin.
+ * internal.h: define CREF accessor macros.
+ * CREF_CLASS(cref)
+ * CREF_NEXT(cref)
+ * CREF_VISI(cref)
+ * CREF_VISI_SET(cref, v)
+ * CREF_REFINEMENTS(cref)
+ * CREF_PUSHED_BY_EVAL(cref)
+ * CREF_PUSHED_BY_EVAL_SET(cref)
+ * CREF_OMOD_SHARED(cref)
+ * CREF_OMOD_SHARED_SET(cref)
+ * CREF_OMOD_SHARED_UNSET(cref)
-Tue Mar 19 00:26:22 2013 Narihiro Nakamura <authornari@gmail.com>
+ This is process to change CREF data type from NODE.
- * gc.c: Improve accuracy of objspace_live_num() and
- allocated/freed counters. patched by tmm1(Aman Gupta).
- [Bug #8092] [ruby-core:53392]
+Sun Mar 8 22:50:57 2015 Tanaka Akira <akr@fsij.org>
-Mon Mar 18 21:42:48 2013 Narihiro Nakamura <authornari@gmail.com>
+ * ext/zlib/zlib.c (rb_gzfile_close): Don't raise on double
+ close for consistent to IO#close.
- * gc.c: Avoid unnecessary heap growth. patched by tmm1(Aman Gupta).
- [Bug #8093] [ruby-core:53393]
+Sun Mar 8 16:57:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 18 17:58:36 2013 Narihiro Nakamura <authornari@gmail.com>
+ * dir.c (glob_helper): match patterns against legacy short names
+ too, not only ordinary names. [ruby-core:67954] [Bug #10819]
- * gc.c: Fix unlimited memory growth with large values of
- RUBY_FREE_MIN. patched by tmm1(Aman Gupta).
- [Bug #8095] [ruby-core:53405]
+ * win32/dir.h (struct direct): add short name members.
-Mon Mar 18 14:46:19 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * win32/win32.c (opendir_internal, readdir_internal): ditto.
- * test/win32ole/test_err_in_callback.rb
- (TestErrInCallBack#test_err_in_callback): shouldn't create a file in
- the top of build directory.
+Sat Mar 7 09:36:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Mar 18 13:29:52 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * array.c: document that first element is kept when using
+ Array#uniq and #uniq! [fix GH-845][ci skip]
+ Patch by @riffraff
- * vm_dump.c (backtrace): on darwin use custom backtrace() to trace
- beyond _sigtramp. darwin's backtrace can't trace beyond signal
- trampoline with sigaltstack.
+Sat Mar 7 09:28:02 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * configure.in: check execinfo.h on darwin.
+ * thread.c: Mutex#owned? is no longer experimental since 2.1.0
+ [fix GH-839][ci skip] Patch by @takiy33
-Mon Mar 18 11:03:23 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Mar 7 09:18:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * vm_exec.h (END_INSN): revert r39517 because the segv seems fixed by
- r39806.
+ * tool/merger.rb: Added documentation to version method.
+ [fix GH-847][ci skip] Patch by @magikid
-Mon Mar 18 10:41:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Mar 6 22:50:36 2015 Koichi Sasada <ko1@atdot.net>
- * vm_exec.c: Correct predefined macro name. This typo is introduced by
- r36534 and should be backported to ruby_2_0_0.
+ * class.c (rb_prepend_module): need a WB for klass -> origin.
-Mon Mar 18 03:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Fri Mar 6 20:18:38 2015 Koichi Sasada <ko1@atdot.net>
- * array.c: Typo in Array#delete by Timo Sand [GH fixes #258]
+ * fix namespace issue on singleton class expressions. [Bug #10943]
-Mon Mar 18 01:14:56 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_core.h, method.h: remove rb_iseq_t::cref_stack. CREF is stored
+ to rb_method_definition_t::body.iseq_body.cref.
- * io.c (io_fillbuf): show fd number on failure to debug.
- http://c5632.rubyci.org/~chkbuild/ruby-trunk/log/20130316T050302Z.diff.html.gz
+ * vm_insnhelper.c: modify SVAR usage.
+ When calling ISEQ type method, push CREF information onto method
+ frame, SVAR located place. Before this fix, SVAR is simply nil.
+ After this patch, CREF (or NULL == Qfalse for not iseq methods)
+ is stored at the method invocation.
-Sun Mar 17 02:38:21 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ When SVAR is required, then put NODE_IF onto SVAR location,
+ and NDOE_IF::nd_reserved points CREF itself.
- * ext/date/date_core.c: include sys/time.h for avoiding implicit
- declaration of gettimeofday().
+ * vm.c (vm_cref_new, vm_cref_dump, vm_cref_new_toplevel): added.
-Sun Mar 17 00:55:31 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_insnhelper.c (vm_push_frame): accept CREF.
- * include/ruby/missing.h: removed __linux__. it's unnecessary.
+ * method.h, vm_method.c (rb_add_method_iseq): added. This function
+ accepts iseq and CREF.
-Fri Mar 15 14:57:16 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * class.c (clone_method): use rb_add_method_iseq().
- * thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug.
- [Bug #8080] [ruby-core:53349]
- * test/ruby/test_io.rb (TestIO#test_io_select_with_many_files):
- test for the above.
+ * gc.c (mark_method_entry): mark method_entry::body.iseq_body.cref.
-Wed Mar 13 15:16:35 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * iseq.c: remove CREF related codes.
- * include/ruby/missing.h (__syscall): moved to...
- * io.c: here. because __syscall() is only used from io.c.
+ * insns.def (getinlinecache/setinlinecache): CREF should be cache key
+ because a different CREF has a different namespace.
- * include/ruby/missing.h: move "#include <sys/type.h>" to ....
- * include/ruby/intern.h: here. because it was introduced for
- fixing NFDBITS issue. [ruby-core:05179].
+ * node.c (rb_gc_mark_node): mark NODE_IF::nd_reserved for SVAR.
-Wed Mar 13 14:38:53 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * proc.c: catch up changes.
- * include/ruby/missing.h (struct timespec): include <sys/time.h>
+ * struct.c: ditto.
-Wed Mar 13 13:54:45 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * insns.def: ditto.
- * configure.in: check struct timeval exist or not.
- * include/ruby/missing.h (struct timeval): check HAVE_STRUCT_TIMEVAL
- properly. and don't include sys/time.h if struct timeval exist.
+ * vm_args.c (raise_argument_error): ditto.
- * file.c: include sys/time.h explicitly.
- * random.c: ditto.
- * thread_pthread.c: ditto.
- * time.c: ditto.
- * ext/date/date_strftime.c: ditto.
+ * vm_eval.c: ditto.
-Fri Mar 15 14:45:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_class.rb: add a test.
- * configure.in (_FORTIFY_SOURCE): added a few comments.
+Fri Mar 6 18:19:13 2015 Koichi Sasada <ko1@atdot.net>
-Fri Mar 15 14:17:55 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/webrick/test_filehandler.rb: on vboxsf (on VirtualBox
+ on Windows 7), file name and permissions are strange (can access
+ by short file name and so on).
- * thread_pthread.c (numberof): renamed from ARRAY_SIZE() because
- other all files use numberof().
+ Simply skip on such tests on such FS. To detect strange FS, this
+ patch use a part of code `File.executable?(__FILE__)`.
+ Please correct them if there are better ways.
-Say Mar 15 01:33:00 2013 Charles Oliver Nutter <headius@headius.com>
+Fri Mar 6 17:31:29 2015 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_lazy_enumerator.rb (TestLazyEnumerator#test_drop_while):
- Modify while condition to show dropping remains off after first false
- value. This change was made in 39711.
+ * test/ruby/test_beginendblock.rb: do not change directory.
-Fri Mar 15 23:06:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Run system command in the directory mounted by vboxsf on Windows 7
+ and get warning like that "warning: Insecure world writable dir...".
- * time.c (GetTimeval): check if already initialized instance.
+Fri Mar 6 10:31:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (GetNewTimeval): check if newly created instance.
+ * vm_eval.c (vm_call_super): search next super class from the
+ original class, to get rid of infinite recursion with
+ prepending. a patch by Seiei Higa <hanachin AT gmail.com> at
+ [ruby-core:68434]. [ruby-core:68093] [Bug #10847]
- * time.c (time_init_0, time_init_1, time_init_copy, time_mload): must
- be newly created instance. [ruby-core:53436] [Bug #8099]
+Fri Mar 6 08:45:26 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Fri Mar 15 14:51:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/matrix.rb: Add Vector#round. Patch by Jordan Stephens.
+ [Fixes GH-802]
- * file.c (rb_sys_fail_path_with_func): share same function, and path
- may be nil.
+Fri Mar 6 07:33:03 2015 Koichi Sasada <ko1@atdot.net>
-Fri Mar 15 08:24:51 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * gc.c (obj_info): show node name too.
- * io.c (rb_sys_fail_path): define & use rb_sys_fail_path0 like r39752
+Fri Mar 6 07:00:44 2015 Koichi Sasada <ko1@atdot.net>
-Fri Mar 15 04:08:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * internal.h: remove struct method_table_wrapper.
+ struct method_table_wrapper was introduced to avoid duplicate marking
+ for method tables.
- * proc.c: Typo in Proc.arity found by Jack Nagel [Bug #8094]
+ For example, `module M1; def foo; end; end` make one method table
+ (mtbl) contains a method `foo`. M1 (T_MODULE) points mtbl.
+ Classes C1 and C2 includes M1, then two T_ICLASS objects are created
+ and they points mtbl too. In this case, three objects (one T_MODULE
+ and two T_ICLASS objects) points same mtbl. On marking phase, these
+ three objects mark same mtbl. To avoid such duplication, struct
+ method_table_wrapper was introduced.
-Thu Mar 14 16:59:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ However, created two T_ICLASS objects have same or shorter lifetime
+ than M1 (T_MODULE) object. So that we only need to mark mtbl from M1,
+ not from T_ICLASS objects. This patch tries marking only from M1.
+ In other words, original module (M1) has responsibility to mark mtbl.
+ Because of no duplicate marking, we don't need method_table_wrapper
+ any more.
- * configure.in (rb_cv_function_name_string): macro for function name
- string predefined identifier, __func__ in C99, or __FUNCTION__ in
- gcc.
+ Note that one `Module#prepend` call creates two T_ICLASS objects.
+ One for referring to a prepending Module object, same as
+ `Module#include`. We don't need to care this T_ICLASS.
+ One for moving original mtbl from a prepending class. We need to
+ mark such mtbl from this T_ICLASS object. To mark the mtbl,
+ we need to use `RCLASS_ORIGIN(klass)` on marking from a prepended
+ class `klass`.
- * file.c (rb_sys_fail_path): use RUBY_FUNCTION_NAME_STRING.
+ * class.c: ditto.
-Thu Mar 14 14:12:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * eval.c (rb_using_refinement): ditto.
- * file.c (rb_sys_fail_path): use rb_sys_fail_path0 only on GCC.
- __func__ is C99 feature.
+ * gc.c: ditto.
-Thu Mar 14 12:59:59 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * include/ruby/ruby.h: define m_tbl directly. The definition of
+ struct RClass should be moved to (srcdir)/internal.h.
- * file.c (rb_sys_fail_path0): add to append the name of called function
- to ease debugging for example blow umask_spec failure.
- http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20130309T010202Z.diff.html.gz
+ * method.h: remove decl of rb_free_m_tbl_wrapper().
- * file.c (rb_sys_fail_path): use rb_sys_fail_path0.
+ * object.c: use RCLASS_M_TBL() directly.
-Thu Mar 14 12:53:15 2013 Luis Lavena <luislavena@gmail.com>
+Fri Mar 6 02:50:12 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/file.c (get_user_from_path): add internal function that retrieves
- username from supplied path (refactored).
- * win32/file.c (rb_file_expand_path_internal): refactor expansion of user
- home to use get_user_from_path and cover dir_string corner cases.
- [ruby-core:53168] [Bug #8034]
+ * dir.c (replace_real_basename): need to check the return value of
+ GLOB_REALLOC().
-Thu Mar 14 11:53:01 2013 Narihiro Nakamura <authornari@gmail.com>
+Fri Mar 6 02:26:03 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * NEWS: describe RUBY_HEAP_SLOTS_GROWTH_FACTOR.
+ * dir.c (replace_real_basename): shouldn't create Ruby object before
+ the object system is loaded.
+ [ruby-core:68430] [Bug #10941]
-Thu Mar 14 10:01:12 2013 Eric Hodel <drbrain@segment7.net>
+Wed Mar 5 16:58:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * doc/globals.rdoc: $? is thread-local
+ * hash.c: [DOC] #delete method actually returns nil, if the key
+ is not found. [fix GH-844][ci skip] Patch by @ivdma
-Wed Mar 13 23:25:59 2013 Narihiro Nakamura <authornari@gmail.com>
+Wed Mar 5 12:22:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * gc.c: allow to tune growth of heap by environment variable
- RUBY_HEAP_SLOTS_GROWTH_FACTOR. patched by tmm1(Aman Gupta).
- [Feature #8015] [ruby-core:53131]
+ * math.c: refactoring: remove unnecessary variable d0 to unify code
+ appearance.
-Wed Mar 13 19:43:46 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Thu Mar 5 11:50:54 2015 Shugo Maeda <shugo@ruby-lang.org>
- * doc/irb/irb.rd.ja: fix typo
+ * vm_eval.c (eval_string_with_cref): A binding should keep
+ refinements activation information and the refinements should be
+ activated in subsequent eval calls with the binding.
+ [ruby-core:67945] [Bug #10818]
- * ext/tk/MANUAL_tcltklib.eng: fix typos
+Thu Mar 5 11:16:55 2015 Shugo Maeda <shugo@ruby-lang.org>
- * ext/tk/sample/tktextframe.rb (Tk#component_delegates): fix typo
+ * test/ruby/test_refinement.rb: There is no need anymore to suppress
+ warnings.
-Wed Mar 13 15:13:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 5 08:31:02 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * class.c (rb_obj_singleton_methods): collect methods from the origin
- class. [ruby-core:53207] [Bug #8044]
+ * random.c (random_raw_seed): Avoid calling fill_random_bytes()
+ if the requested size is 0. AIX returns -1 for 0-byte read from
+ /dev/urandom, while other UNIX returns 0. With this change,
+ Random.raw_seed(0) consistently returns "" in any UNIX.
-Wed Mar 13 14:51:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 4 12:43:32 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * vm_method.c (rb_export_method): directly override the flag of method
- defined in prepending class too, not adding zsuper entry.
- [ruby-core:53106] [Bug #8005]
+ * test/ruby/test_math.rb (assert_float_and_int): Refactor test cases
+ by introducing assert_float_and_int. [misc #10810]
-Wed Mar 13 13:06:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 4 11:52:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (rm, shvar_to_cpp, unexpand_shvar): local is not
- available on old shells.
+ * symbol.c (Init_sym): make dsym_fstrs a hash compared by identity
+ as the keys are unique fstrings, to get rid of running hash and
+ compare methods and causing new object allocation during garbage
+ collection phase. [ruby-dev:48891] [Bug #10933]
- * configure.in (shvar_to_cpp): escape quotes for old shells.
- [Bug #7959] [Bug #8071]
+Wed Mar 4 10:16:57 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Mar 13 11:11:07 2013 Shugo Maeda <shugo@ruby-lang.org>
+ * enum.c: Fix typo in slice_after's exception message.
+ [fix GH-842][ci skip] Patch by @jsyeo
- * object.c (Init_Object): remove Module#used, which has been
- introduced in Ruby 2.0 by mistake. [Bug #7916] [ruby-core:52719]
+Wed Mar 4 10:15:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Mar 13 05:49:29 2013 Eric Hodel <drbrain@segment7.net>
+ * doc/syntax/methods.rdoc: add some missing spaces and
+ fix a grammatical error in method docs.
+ [fix GH-843][ci skip] Patch by @nikolas
- * lib/irb.rb: Fix typo
+Wed Mar 4 02:13:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 12 22:20:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/redmine-backporter.rb (backport_command_string): pick up only
+ when the revision exists in trunk.
- * compile.c (iseq_set_arguments, iseq_compile_each): support required
- keyword arguments. [ruby-core:51454] [Feature #7701]
+Wed Mar 4 00:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.c (rb_iseq_parameters): ditto.
+ * thread.c (rb_thread_io_blocking_region): assigned variables
+ inside EXEC_TAG() should be volatile.
- * parse.y (f_kw, f_block_kw): ditto. this syntax is still
- experimental, the notation may change.
+ * thread.c (rb_thread_s_handle_interrupt): ditto.
- * vm_core.h (rb_iseq_struct): ditto.
+ * thread.c (exec_recursive): ditto.
- * vm_insnhelper.c (vm_callee_setup_keyword_arg): ditto.
+Wed Mar 4 00:29:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 12 17:02:53 2013 TAKANO Mitsuhiro <tak@no32.tk>
+ * tool/redmine-backporter.rb: now can specify shorten form of commands.
- * date_core.c: clearly specify operator precedence.
+Tue Mar 3 23:41:42 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 12 17:00:45 2013 TAKANO Mitsuhiro <tak@no32.tk>
+ * tool/redmine-backporter.rb (Readline.readline): drop untreated control
+ characters.
- * insns.def: fix condition.
+Tue Mar 3 22:25:24 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 12 16:48:19 2013 TAKANO Mitsuhiro <tak@no32.tk>
+ * test/lib/envutil.rb (EnvUtil.invoke_ruby): need to rescue because
+ Signal.signame may raise exception.
- * rational.c: fix dangling if, else-if and else.
+Tue Mar 3 16:57:39 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 12 06:27:59 2013 Eric Hodel <drbrain@segment7.net>
+ * tool/redmine-backporter.rb: use 'b' instead of 's' for showing
+ Backport options for merger.rb.
- * lib/rubygems/commands/setup_command.rb: Don't delete non-rubygems
- files when installing RubyGems.
- * test/rubygems/test_gem_commands_setup_command.rb: Test for the
- above.
+Tue Mar 3 16:55:23 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rubygems/ext/ext_conf_builder.rb: Use full path to siteconf.rb
- in case the extconf.rb changes directories (like memcached does).
+ * tool/redmine-backporter.rb: show selected ticket number at prompt.
- * lib/rubygems/package.rb: Remove double slash from path.
- * test/rubygems/test_gem_package.rb: Test for the above.
- * test/rubygems/test_gem_package_old.rb: ditto.
+Tue Mar 3 14:47:30 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * lib/rubygems/source.rb: Revert automatic HTTPS upgrade
- * lib/rubygems/spec_fetcher.rb: ditto.
- * test/rubygems/test_gem_remote_fetcher.rb: ditto.
- * test/rubygems/test_gem_source.rb: ditto.
- * test/rubygems/test_gem_spec_fetcher.rb: ditto.
+ * math.c (num2dbl_with_to_f): direct casting from Rational to double.
+ [Feature #10909]
-Tue Mar 12 02:25:19 2013 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_math.rb: add tests for the above change.
- * lib/net/smtp.rb: Added Net::SMTP#rset method to implement the SMTP
- RSET command. [ruby-trunk - Feature #5373]
- * NEWS: ditto.
- * test/net/smtp/test_smtp.rb: Test for the above.
+Tue Mar 3 07:52:20 2015 Rei Odaira <Rei.Odaira@gmail.com>
-Mon Mar 11 22:44:57 2013 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_symbol.rb: avoid a false positive in AIX.
- * lib/resolv-replace.rb (TCPSocket#initialize): resolve the 3rd
- argument only if non-nil value is given.
- [ruby-dev:47150] [ruby-trunk - Bug #8054] reported and analyzed by
- mrkn.
+Tue Mar 3 00:59:39 2015 Naohisa Goto <ngotogenome@gmail.com>
-Mon Mar 11 19:22:54 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in: set PRELOADENV in Solaris to avoid "wrong ELF class"
+ error. [Bug #10926] [ruby-dev:48888]
+ * configure.in: set LIBPATHENV for 32-bit compile in Solaris
+ in addition to 64-bit.
- * test/mkmf/base.rb: class name conflict.
+Mon Mar 2 15:36:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 11 18:45:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in: do not check _setjmp unless _longjmp is available,
+ so that configure results will not be changed by cache.
- * enumerator.c (enumerator_with_index): try to convert given offset to
- integer. fix bug introduced in r39594.
+Mon Mar 2 14:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 11 17:27:57 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from
+ cached variable only if the target type is not available.
- * test/ruby/envutil.rb (EnvUtil.with_default_external): add for
- changing Encoding.default_external without warnings.
+Mon Mar 2 13:04:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/envutil.rb (EnvUtil.with_default_internal): ditto.
+ * signal.c (sig_signame): return nil if the argument is a valid
+ signal number.
- * test/ruby/test_io_m17n.rb: use above with_default_external.
+Mon Mar 2 12:05:04 2015 Naohisa Goto <ngotogenome@gmail.com>
-Mon Mar 11 16:57:00 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/net/ftp/test_ftp.rb (create_ftp_server): set SO_OOBINLINE
+ for receiving OOB data which is sent with MSG_OOB flag in
+ portable way. [Bug #10915] [ruby-dev:48885]
+ * test/net/ftp/test_ftp.rb (test_abort, test_status): use gets
+ for receiving OOB data in portable way.
- * io.c (extract_binmode): raise error even if binmode and textmode
- don't conflict. [Bug #5918] [ruby-core:42199]
+Mon Mar 2 11:43:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 11 12:25:12 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from
+ cached variable.
- * Merge Onigmo d4bad41e16e3eccd97ccce6f1f96712e557c4518.
- fix lookbehind assertion fails with /m mode enabled. [Bug #8023]
- fix \Z matches where it shouldn't. [Bug #8001]
+Mon Mar 2 06:01:41 2015 Eric Wong <e@80x24.org>
-Mon Mar 11 11:53:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/io/wait/wait.c (io_nread): wrap return value with INT2FIX
+ Thanks to Yura Sokolov <funny.falcon@gmail.com>
+ [ruby-core:68369] [Bug#10923]
+ * test/io/wait/test_io_wait.rb (test_nread_buffered):
+ fix broken test
- * lib/mkmf.rb (MakeMakefile#dir_config, MakeMakefile#_libdir_basename):
- defer use of instance variable until needed. [Bug #8074]
+Sun Mar 1 20:21:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 7 10:42:28 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * configure.in (RUBY_REPLACE_TYPE): restore convertible type from
+ cached variable, so that configured results will be stable.
- * lib/thread.rb (Queue#clear): return self.
- Patch by Cubing Cube. Thank you! [Bug #7947] [ruby-dev:47098]
- * lib/thread.rb (Queue#push): ditto.
- * lib/thread.rb (SizedQueue#push): ditto.
- * test/thread/test_queue.rb: add tests for the above.
+Sun Mar 1 18:10:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 7 10:40:49 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * configure.in (rb_cv_broken_memmem): check before adding the
+ result HAVE_MEMMEM macro to confdefs.h, so that configured
+ results will be stable.
- * tool/change_maker.rb (#diff2index): check Encoding::BINARY.
- BASERUBY may still be 1.8.x.
+Sun Mar 1 11:17:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 7 08:47:42 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * gc.c (id2ref): prohibit from accessing internal objects.
+ [ruby-core:68348] [Bug #10918]
- * NEWS (Mutex#owned?): no longer experimental.
+Sun Mar 1 09:06:11 2015 Tanaka Akira <akr@fsij.org>
-Sun Mar 10 23:38:15 2013 Luis Lavena <luislavena@gmail.com>
+ * lib/time.rb (strptime): Support %s.%N.
+ [ruby-core:68301] [Bug #10904] Patch by Sadayuki Furuhashi.
- * win32/file.c (rb_file_expand_path_internal): Expand home directory when
- used as second parameter (dir_string). [ruby-core:53168] [Bug #8034]
- * test/ruby/test_file_exhaustive.rb: add test to verify.
+Sat Feb 28 17:18:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 10 23:27:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c (enum_each_slice, enum_each_cons): limit elements size by
+ the enumerator size. suggested by Hans Mackowiak <hanmac AT
+ gmx.de> at [ruby-core:68335]
- * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
- it is impossible to predict which file will be installed to where,
- by the arguments, so use intermediate destination directory always.
- [Bug #7698]
+Sat Feb 28 15:44:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 10 17:00:22 2013 Tadayoshi Funaba <tadf@dotrb.org>
+ * vm_dump.c (rb_vm_bugreport): get rid of making new strings
+ inside signal context.
- * complex.c: edited rdoc.
- * rational.c: ditto.
+ * variable.c (rb_tmp_class_path): defer making temporary class
+ path string.
-Sun Mar 10 15:02:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * variable.c (rb_search_class_path): search class path or return
+ Qnil or Qfalse if unnamed, not creating a temporary path.
- * process.c (setup_communication_pipe): remove unused function.
- it was unintentionally added r39683.
+Sat Feb 28 15:02:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 6 00:30:40 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * variable.c (rb_tmp_class_path): preserve name encoding of an
+ anonymous instance of module/class subclass.
- * tool/gen_ruby_tapset.rb: add tapset generator.
+Sat Feb 28 08:24:30 2015 Rei Odaira <Rei.Odaira@gmail.com>
-Wed Mar 6 03:27:43 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/pty/pty.c: AIX supports autopush.
+ Patch by Perry Smith [ruby-core:58539] [Bug #9144]
- * probes.d (symbol-create): change argument name `string' to
- `str'. `string' is a keyword for systemtap.
+Fri Feb 27 22:00:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Mar 5 22:23:01 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/rubygems: Update to RubyGems 2.4.6 and HEAD(800f2e6).
+ Fixed #1159, #1171, #1173 on rubygems/rubygems
+ * test/rubygems: ditto.
- * probes.d: added argument name
+Fri Feb 27 20:55:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Mar 7 01:17:00 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/rake: Update to rake (9237e74), typo fix and remove needless
+ private syntax.
+ * test/rake: ditto.
- * test/thread/test_queue.rb (TestQueue#test_thr_kill): reduce
- iterations from 2000 to 250. When running on uniprocessor
- systems, every th.kill needs TIME_QUANTUM_USEC time (i.e.
- 100msec on posix systems). Because, "r.read 1" is 3 steps
- operations that 1) release GVL 2) read 3) acquire gvl and
- (1) invoke context switch to main thread. and then, main
- thread's th.kill resume (1), but not (2). Thus read interrupt
- need TIME_QUANTUM_USEC. Then maximum iteration is 30sec/100msec
- = 300.
+Fri Feb 27 17:06:44 2015 Koichi Sasada <ko1@atdot.net>
-Thu Mar 7 00:14:51 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_core.h: define vm_svar_index.
- * io.c (rb_update_max_fd): use ATOMIC_CAS because this function
- is used from timer thread too.
+ * vm_insnhelper.c, vm.c, compile.c: use vm_svar_index names.
-Wed Mar 6 23:30:21 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * iseq.h: remove DEFAULT_SPECIAL_VAR_COUNT.
+ use VM_SVAR_FLIPFLOP_START instead.
- * thread_pthread.c (ARRAY_SIZE): new.
- * thread_pthread.c (gvl_acquire_common): use low priority
- notification for avoiding timer thread interval confusion.
- If we use timer_thread_pipe[1], every gvl_yield() request
- one more gvl_yield(). It lead to thread starvation.
- [Bug #7999] [ruby-core:53095]
- * thread_pthread.c (rb_reserved_fd_p): adds timer_thread_pipe_low
- to reserved fds.
+Fri Feb 27 13:57:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 6 22:36:19 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * io.c (setup_narg): wipe away expanded part of buffer to get rid
+ of revealing uncleaned data. reported by Dongkwan Kim <dkay AT
+ kaist.ac.kr>.
- * thread_pthread.c (rb_thread_wakeup_timer_thread_fd): add fd
- argument and remove hardcoded dependency of timer_thread_pipe[1].
- * thread_pthread.c (consume_communication_pipe): add fd argument.
- * thread_pthread.c (close_communication_pipe): ditto.
+Wed Feb 25 22:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * thread_pthread.c (timer_thread_sleep): adjust the above changes.
+ * spec/default.mspec: use default configuration file name.
+ https://github.com/ruby/rubyspec/commit/cc69f337b06362e5607ffa3e3ad40ef7494960cf
- * thread_pthread.c (setup_communication_pipe_internal): factor
- out pipe initialize logic.
+Wed Feb 25 22:21:56 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Mar 6 22:56:14 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * spec/default.mspec: remove specific version number.
+ https://github.com/ruby/rubyspec/commit/7a909e925c1baa9c700bd44af9241aef6e596714
- * thread_pthread.c (ubf_select): add to small comments why we
- need to call rb_thread_wakeup_timer_thread().
+Wed Feb 25 22:04:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Mar 6 21:42:24 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/win32/Win32API.rb (initialize): accept both a string and an array
+ for the arguments of the imported function.
+ reported by Aaron Stone [ruby-core:68208] [Bug #10876] [Fixes GH-835]
- * thread_pthread.c (rb_thread_create_timer_thread): factor out
- creating communication pipe logic into separate function.
- * thread_pthread.c (setup_communication_pipe): new helper function.
- * thread_pthread.c (set_nonblock): moves a definition before
- setup_communication_pipe.
+Wed Feb 25 18:12:11 2015 Eric Wong <e@80x24.org>
-Sun Mar 3 02:42:29 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * signal.c (sighandler): preserve errno
+ Patch by Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
+ [ruby-core:68172] [Bug #10866]
- * thread_pthread.c (consume_communication_pipe): retry when
- read returned CCP_READ_BUFF_SIZE.
+Wed Feb 25 15:59:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 6 21:31:35 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * dir.c (push_pattern, push_glob): make globbed file names same
+ encoding to the given pattern.
- * thread_pthread.c (timer_thread_sleep): use poll() instead of
- select(). select doesn't work if timer_thread_pipe[0] is
- greater than FD_SETSIZE.
- * thread_pthread.c (USE_SLEEPY_TIMER_THREAD): add a dependency
- against poll.
+Wed Feb 25 15:27:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Mar 6 21:00:23 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * tool/merger.rb: support 2.1+ versioning scheme.
- * thread_pthread.c (USE_SLEEPY_TIMER_THREAD): use more accurate
- ifdef conditions.
+Tue Feb 25 08:49:12 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-Sun Mar 3 02:30:36 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/cmath.rb (log): raise ArgumentError when more than 2 arguments
+ are passed. [ruby-core:66143] [Bug #10487]
- * thread_pthread.c (set_nonblock): new helper function for set
- O_NONBLOCK.
- * thread_pthread.c (rb_thread_create_timer_thread): set O_NONBLOCK
- to timer_thread_pipe[0] too.
+Tue Feb 25 02:15:17 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-Sun Mar 10 09:12:51 2013 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/ruby/test_math.rb: Use assert_infinity instead of assert_equal(1.0/0, ...).
- * complex.c: described syntax of string form.
- * rational.c: ditto.
+ * test/ruby/test_math.rb: Add tests for overriding Integer#to_f.
+ [ruby-core:67919] [Misc #10809]
-Sat Mar 9 11:58:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 24 22:58:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * marshal.c (w_extended): check for prepended object.
- [ruby-core:53206] [Bug #8043]
+ * complex.c (nucomp_mul): calculate as rotation in complex plane
+ if matrix calculation resulted in NaN.
-Sat Mar 9 08:36:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 24 21:45:39 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * load.c (features_index_add_single, rb_feature_p): store single index
- as Fixnum to reduce the number of arrays for the indexes. based on
- the patch by tmm1 (Aman Gupta) in [ruby-core:53216] [Bug #8048].
+ * test/ruby/test_math.rb(test_cbrt): Add an assertion for Math.cbrt(1.0/0)
+ and move #test_cbrt to more proper place.
-Sat Mar 9 00:25:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 24 19:09:25 2015 Koichi Sasada <ko1@atdot.net>
- * marshal.c (r_object0): load prepended objects. treat the class of
- extended object in the included modules as prepended singleton
- class. [ruby-core:53202] [Bug #8041]
+ * vm_insnhelper.c (lep_svar_place, lep_svar_get): do not create
+ additional T_NODE object (svars holder) when only getting
+ svars.
-Fri Mar 8 19:44:00 2013 Akinori MUSHA <knu@iDaemons.org>
+Tue Feb 24 11:49:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * man/rake.1, man/ruby.1: Use the Pa macro to make URLs stand out.
+ * time.c (time_zone_name): should be US-ASCII only if all 7-bits,
+ otherwise locale encoding. [ruby-core:68230] [Bug #10887]
-Fri Mar 8 13:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue Feb 24 09:47:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pathname/pathname.c (path_f_pathname): rdoc for Pathname()
+ * string.c (chompped_length): enable smart chomp for all non-dummy
+ encoding strings, not only default_rs.
+ [ruby-core:68258] [Bug #10893]
-Fri Mar 8 12:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Mon Feb 23 23:19:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * man/rake.1: Document ENVIRONMENT variables on RAKE(1) manpage
+ * tool/vcs.rb (IO.popen): support :chdir option.
-Fri Mar 8 10:44:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead
+ of -C option which is not supported by older git.
+ [ruby-dev:48880] [Bug #10890]
- * lib/webrick/httpproxy.rb: Fix typos in HTTPProxyServer [Bug #8013]
- Patch by Nobuhiro IMAI [ruby-core:53127]
+Mon Feb 23 15:26:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Mar 8 03:16:15 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * string.c (rb_str_split_m): raise ArgumentError at broken string
+ not RegexpError, as Regexp is not involved in.
+ [ruby-core:68229] [Bug #10886]
- * class.c (rb_mod_ancestors): Include singleton_class in ancestors
- list [Feature #8035]
+Mon Feb 23 07:25:29 2015 Benoit Daloze <eregontp@gmail.com>
- * test/ruby/test_module.rb (class): test for above
+ * time.c: Zone encoding should be US-ASCII if all 7-bits. Fix r46907.
- * test/ruby/marshaltestlib.rb (module): adapt test
+ * test/ruby/test_time.rb, test/ruby/test_time_tz.rb: Update tests.
- * NEWS: list change
+Sun Feb 22 18:33:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Mar 7 14:21:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk: use ruby organization for rubyspec.
- * compile.c (iseq_compile_each): pass keyword arguments to zsuper,
- with current values. [ruby-core:53114] [Bug #8008]
+Sun Feb 22 15:56:06 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Mar 7 12:53:47 2013 Eric Hodel <drbrain@segment7.net>
+ * vm_insnhelper.c (rb_vm_rewrite_cref_stack): copy nd_refinements
+ of original crefs. It fixes segmentation fault when calling
+ refined method in duplicate module. [ruby-dev:48878] [Bug #10885]
- * lib/rubygems/commands/setup_command.rb: Install .pem files.
- * test/rubygems/test_gem_commands_setup_command.rb: Test for the
- above.
+ * vm_core.h, class.c: change accordingly.
- * lib/rubygems/spec_fetcher.rb: Test HTTPS upgrade with URI::HTTPS,
- not URI::HTTP. Fixes bug in automatic HTTPS upgrade.
- * test/rubygems/test_gem_spec_fetcher.rb: Test for the above.
+ * test/ruby/test_refinement.rb: add a test for above.
- * lib/rubygems.rb: Version 2.0.2
+Sun Feb 22 10:43:37 2015 Koichi Sasada <ko1@atdot.net>
- * lib/rubygems/test_utilities.rb: Ensure scheme and uri class match.
+ * gc.c (rb_objspace_call_finalizer): control GC execution during
+ force firnalizations at the end of interpreter process.
+ [Bug #10768]
-Thu Mar 7 10:39:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ 1) Prohibit incremental GC while running Ruby-level finalizers
+ to avoid any danger.
+ 2) Prohibit GC while invoking T_DATA/T_FILE data structure
+ because these operations break object relations consistency.
- * tool/rbinstall.rb (gem): Gem.ensure_gem_subdirectories now has mode
- option since r39607. refix of r38870.
+ This patch can introduce another memory consuming issue because
+ Ruby-level finalizers can run after (2), GC is disabled.
+ However, basically object consistency was broken at (2) as I
+ described above. So that running Ruby-level finalizers contains
+ danger originally. Because of this point, I need to suggest to
+ remove these 3 lines (invoking remaining finalizers). And add a
+ rule to add that finalizers should not add new finalizers, or
+ say there is no guarantee to invoke finalizers that added by
+ another finalizer.
-Wed Mar 6 13:14:28 2013 Eric Hodel <drbrain@segment7.net>
+Sun Feb 22 04:07:05 2015 Zachary Scott <e@zzak.io>
- * test/rubygems/test_gem_spec_fetcher.rb: Removed unused variable.
+ * ext/openssl/ossl_asn1.c: [DOC] RDoc formatting fixes for
+ ASN1::ObjectId with patch from @vbatts [Fixes GH-834]
-Wed Mar 6 08:10:15 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/openssl/ossl_bn.c: ditto.
- * test/rubygems/test_require.rb: Fix tests when 'a.rb' exists.
- [ruby-trunk - Bug #7749]
+Sat Feb 21 19:51:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 6 08:00:59 2013 Eric Hodel <drbrain@segment7.net>
+ * re.c (match_aref): RMatch::regexp is Qnil after matching by a
+ string since r45451. [ruby-core:68209] [Bug #10877]
- * lib/rubygems.rb: Allow specification of directory permissions.
- [ruby-trunk - Bug #7713]
- * test/rubygems/test_gem.rb: Test for the above.
+Sat Feb 21 16:18:42 2015 Stefan Schuler <mail@stefanschuessler.de>
-Wed Mar 6 07:40:21 2013 Eric Hodel <drbrain@segment7.net>
+ * compar.c (Init_Comparable): [DOC] Replace camelcase variable name.
+ [Fix GH-833]
- * lib/rubygems/commands/query_command.rb: Only fetch remote specs when
- showing details. [ruby-trunk - Bug #8019] RubyGems bug #487
- * lib/rubygems/remote_fetcher.rb: ditto.
- * lib/rubygems/security/policy.rb: ditto.
- * test/rubygems/test_gem_commands_query_command.rb: Test for the
- above.
+Fri Feb 20 17:27:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/security.rb: Make OpenSSL optional for RubyGems.
- * lib/rubygems/commands/cert_command.rb: ditto.
+ * file.c (rb_file_identical_p): fix handle leak, ensure to close
+ the handle of the first argument.
- * lib/rubygems/config_file.rb: Display file with YAML error, not
- ~/.gemrc
+Fri Feb 20 17:19:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/remote_fetcher.rb: Only create gem subdirectories when
- installing gems.
- * lib/rubygems/dependency_resolver.rb: ditto.
- * lib/rubygems/test_utilities.rb: ditto.
- * test/rubygems/test_gem_commands_fetch_command.rb: Test for the
- above.
+ * win32/win32.c (different_device_p): compare by volume serial
+ numbers, not by path names. [ruby-core:68162] [Bug #10865]
- * lib/rubygems/spec_fetcher.rb: Only try to upgrade
- http://rubygems.org to HTTPS
- * test/rubygems/test_gem_spec_fetcher.rb: Test for the above.
+Thu Feb 19 01:58:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems.rb: Update win_platform? check for JRuby compatibility.
+ * win32/file.c (rb_file_expand_path_internal): neither the drive
+ of base directory nor the current drive are involved in the
+ result if different than the drive of path.
+ [ruby-core:68130] [Bug #10858]
- * test/rubygems/test_gem_installer.rb: Update for Ruby 1.9.2
- compatibility
+Wed Feb 18 10:48:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 6 01:19:28 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * win32/win32.c (wrename): return EXDEV if moving a directory to
+ another drive, since MoveFileExW does not set proper error code.
+ [ruby-core:68162] [Bug #10865]
- * enumerator.c (enumerator_with_index, lazy_take): use INT2FIX(0)
- instead of INT2NUM(0).
+Wed Feb 18 03:13:52 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): ditto.
+ * ext/psych/lib/psych.rb: bump psych version.
+ * ext/psych/psych.gemspec: ditto
+ * ext/psych/yaml/scanner.c: add latest libyaml change.
+ * test/psych/helper.rb: support newer minitest
+ * test/psych/test_to_yaml_properties.rb: ditto
- * ext/fiddle/function.c (function_call): ditto.
+Tue Feb 17 11:47:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): ditto.
+ * lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements
+ returned by Kernel#instance_variables are Symbols now.
+ [ruby-core:68128] [Bug #10857]
- * process.c (proc_getsid): ditto.
+Tue Feb 17 10:59:10 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * transcode.c (econv_finish): ditto.
+ * doc/syntax/calling_methods.rdoc: Fix documentation for "calling_methods"
+ Patch by @sos4nt [fix GH-830][ci skip]
-Tue Mar 5 21:36:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 17 10:53:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c (rb_prepend_module): check redefinition of built-in optimized
- methods. [ruby-dev:47124] [Bug #7983]
+ * win32/file.c (rb_file_expand_path_internal): do not make invalid
+ (or ADS) path if the path has a drive letter, the result also
+ should have be under it. [ruby-core:68130] [Bug #10858]
- * vm.c (rb_vm_check_redefinition_by_prepend): ditto.
+Tue Feb 17 10:47:20 2015 Iain Beeston <iain.beeston@gmail.com>
-Tue Mar 5 20:29:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c: Added docs to explain that #include? and #member? do not
+ check member equality
+ * lib/set.rb: ditto
- * proc.c (mnew): revert r39224. [ruby-core:53038] [Bug #7988]
+Mon Feb 16 20:58:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Mar 5 20:23:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (compile_massign): optimization for special case,
+ assignments by aset or attrset.
+ http://kokizzu.blogspot.jp/2015/02/c-java-hhvm-ruby-nodejsrhinojscspidermo.html
+ http://www.atdot.net/~ko1/diary/201502.html#d16
- * include/ruby/intern.h (rb_check_arity): make a static inline
- function so it can be used as an expression and argc would be
- evaluated only once.
+Sun Feb 15 10:41:23 2015 Sho Hashimoto <sho-h@ruby-lang.org>
-Tue Mar 5 12:30:55 2013 Eric Hodel <drbrain@segment7.net>
+ * doc/standard_library.rdoc: [DOC] delete removed libraries.
+ [misc #10843] [ci skip]
- * lib/rubygems.rb: Bump version to 2.0.1 for upcoming bugfix release
+Sat Feb 14 12:20:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/ext/ext_conf_builder.rb: Restore ruby 1.8 compatibility
- for [Bug #7698]
- * test/rubygems/test_gem_installer.rb: Ditto.
+ * random.c (rand_random_number): add a method to return a random
+ number like SecureRandom to Random::Formatter.
- * lib/rubygems/package.rb: Restore ruby 1.8 compatibility.
+ * lib/securerandom.rb (random_bytes): move to Random::Formatter,
+ the base method of the module.
- * test/rubygems/test_gem_dependency_installer.rb: Fix warnings
+Sat Feb 14 12:01:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Mar 5 12:24:23 2013 Eric Hodel <drbrain@segment7.net>
+ * random.c (random_raw_seed): extract platform dependent random
+ seed initialization function as a new method Random.raw_seed.
- * enumerator.c (enumerator_with_index): Restore handling of a nil memo
- from r39594.
+ * lib/securerandom.rb (SecureRandom): use Random.raw_seed.
-Tue Mar 5 10:40:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 14 00:49:37 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/objspace/objspace.c (count_nodes): count also newly added nodes,
- and fix key for unknown node. patch by tmm1 (Aman Gupta) in
- [ruby-core:53130] [Bug #8014]
+ * ext/coverage/coverage.c: Add Coverage.peek_result. Allows you to
+ capture coverage information without stopping the coverage tool.
+ [ruby-core:67940] [Feature #10816]
-Tue Mar 5 10:20:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/coverage/test_coverage.rb: test for change.
- * enumerator.c (enumerator_with_index_i): allow Bignum as offset, to
- get rid of conversion exception and integer overflow.
- [ruby-dev:47131] [Bug #8010]
+Fri Feb 13 21:52:05 2015 Yusuke Endoh <mame@tsg.ne.jp>
- * numeric.c (rb_int_succ, rb_int_pred): shortcut optimization for
- Bignum.
+ * string.c (str_discard): does not free for STR_NOFREE string.
+ [Bug #10853][ruby-core:68110]
-Tue Mar 5 10:02:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bootstraptest/test_string.rb: test for above.
- * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
- clear DESTDIR so RUBYARCHDIR and RUBYLIBDIR are not be overridden.
- [Bug #7698]
+Fri Feb 13 21:16:00 2015 Yusuke Endoh <mame@tsg.ne.jp>
-Mon Mar 4 15:33:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/base64.rb: make urlsafe mode user-friendly.
- * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
- fix for unusual cases again. install to a temporary directory once
- and move installed files to the destination directory, if it is same
- as the current directory. [Bug #7698]
+ * lib/base64.rb (Base64.urlsafe_encode64): a new option "padding" to
+ suppress the padding character ("=").
-Mon Mar 4 14:13:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/base64.rb (Base64.urlsafe_decode64): now it accepts not only
+ correctly-padded input but also unpadded input.
+ [Feature #10740][ruby-core:67570]
- * Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments
- must appear after object files with newer versions of gcc. patch by
- tmm1 (Aman Gupta) in [ruby-core:53121] [Bug #8009]
+ * test/base64/test_base64.rb: Test for above
-Mon Mar 4 10:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Fri Feb 13 14:19:06 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * encoding.c: Typo in Encoding overview by Tom Wardrop [GH fixes #255]
+ * ext/json: merge upstream from flori/json
+ change usage of TypedData. [Feature #10739][ruby-core:67564]
-Sun Mar 3 12:35:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 12 18:34:01 2015 multisnow <infinity.blick.winkel@gmail.com>
- * lib/mkmf.rb (MakeMakefile#libpath_env): set runtime library path for
- the case rpath is disabled.
+ * ext/openssl/extconf.rb: check RAND_edg to support libressl.
-Sun Mar 3 12:17:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_rand.c (ossl_rand_egd): define only if RAND_edg
+ is available. [Fix GH-829]
- * lib/rubygems/ext/ext_conf_builder.rb
- (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
- circular dependencies in install-so too. [ruby-core:52882]
- [Bug #7698]
+Thu Feb 12 10:46:14 2015 Eric Hodel <drbrain@segment7.net>
-Sun Mar 3 07:33:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * proc.c (proc_call): Improve Proc#call documentation. Patch by
+ Hsing-Hui Hsu. [fix GH-761]
- * ext/socket/tcpserver.c: Grammar for TCPServer.new from r39554
+Thu Feb 12 04:33:02 2015 Benoit Daloze <eregontp@gmail.com>
-Sun Mar 3 01:17:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compar.c (cmp_equal): no more error hiding for Comparable#==.
+ It now behaves as other Comparable methods. See #7688.
- * lib/rubygems/ext/ext_conf_builder.rb
- (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
- circular dependencies for old style gems which locate extconf.rb on
- the toplevel. [ruby-core:53059] [ruby-trunk - Bug #7698]
+ * test/ruby/test_comparable.rb: update related test.
- * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
- use RUBYOPT instead of -r option, and revert some tests. [Bug #7698]
+Thu Feb 12 03:28:05 2015 Eric Wong <e@80x24.org>
- * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
- revert use of temporary directory for build, to work some buggy
- extconf.rb which cannot build outside the source directory.
- [ruby-core:53056] [Bug #7698]
+ * lib/set.rb (initialize): internal hash defaults to false
-Sun Mar 3 00:04:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/set.rb (include?): use Hash#[] for optimized dispatch.
+ Patch by Ismael Abreu <ismaelga@gmail.com>
+ [ruby-core:67664] [Misc #10754]
- * enc/depend (CPPFLAGS), lib/mkmf.rb (MakeMakefile#create_makefile):
- define RUBY_EXPORT for static-linked-ext mswin. [Bug #7960]
+Wed Feb 11 11:09:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Mar 2 22:49:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/digest/digest_conf.rb (digest_conf): check for CommonDigest.
- * win32/Makefile.sub (ENCOBJS, EXTOBJS, config.h): definitions for
- static-linked-ext. [Bug #7960]
+ * ext/digest/*/*cc.h: for Apple CommonCrypto/CommonDigest.h.
-Sat Mar 2 17:34:19 2013 Tanaka Akira <akr@fsij.org>
+ * ext/digest/digest.h (DEFINE_FINISH_FUNC_FROM_FINAL): macro for
+ finish functions, by inverting arguments order.
- * lib/webrick/utils.rb: use Socket.tcp_server_sockets to create server
- sockets.
- fix [Bug #7100] https://bugs.ruby-lang.org/issues/7100
- reported by sho-h (Sho Hashimoto).
+ * ext/digest/digest_conf.rb (digest_conf): extract common
+ configurations.
-Sat Mar 2 02:45:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Wed Feb 11 11:01:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c: typo in comment patch by Nami-Doc [Github fixes #253]
+ * ext/json/generator/generator.c (generate_json): get rid of
+ unnecessary recursive calls which can cause infinite recursion.
+ T_STRING may not have rb_cString.
-Sat Mar 2 01:33:17 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Feb 11 07:53:35 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * Merge Onigmo 0fe387da2fee089254f6b04990541c731a26757f
- v5.13.3 [Bug#7972] [Bug#7974]
+ * test/win32ole/test_word.rb: use skip method to skip test.
-Fri Mar 1 11:09:06 2013 Eric Hodel <drbrain@segment7.net>
+Tue Feb 10 11:38:28 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb: Revert r34669 which altered the way
- metaprogramming in FileUtils occurred. [ruby-trunk - Bug #7958]
+ * vm_insnhelper.c (vm_call_method): stop method search when a method
+ is not found in a refinement, to support undef in refinements.
+ [ruby-core:66741] [Bug #10578]
- * test/fileutils/visibility_tests.rb: Refactored tests of FileUtils
- options modules to expose bug found in #7958
- * test/fileutils/test_dryrun.rb: ditto.
- * test/fileutils/test_nowrite.rb: ditto.
- * test/fileutils/test_verbose.rb: ditto.
+Tue Feb 10 11:19:11 2015 Shugo Maeda <shugo@ruby-lang.org>
-Fri Mar 1 09:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/net/ftp.rb (chdir, delete, gettextfile, mdtm, mkdir, nlst,
+ putbinaryfile, puttextfile, rename, rmdir, size): support
+ Pathname. Patch by Joe Rafaniello. [fix GH-828]
- * lib/psych.rb: specify in rdoc what object is returned in parser
- By Adam Stankiewicz [Github tenderlove/psych#133]
+Mon Feb 9 16:36:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Mar 1 07:21:41 2013 Eric Hodel <drbrain@segment7.net>
+ * tool/make-snapshot (package): get rid of loading unbundled and
+ unexpected libraries. [ruby-core:67977] [Bug #10822]
- * lib/rubygems/ext/builder.rb: Fix incompatibilities when installing
- extensions. Patch by Nobu.
- [ruby-trunk - Bug #7698] [ruby-trunk - Bug #7971]
- * lib/rubygems/ext/ext_conf_builder.rb: ditto.
- * lib/rubygems/installer.rb: ditto.
- * test/rubygems/test_gem_ext_ext_conf_builder.rb: Test for the above.
- * test/rubygems/test_gem_installer.rb: ditto.
+Sun Feb 8 20:09:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rubygems/commands/sources_command.rb: Prefer HTTPS over HTTP.
- * lib/rubygems/defaults.rb: ditto
- * lib/rubygems/dependency_resolver.rb: Ditto.
- * lib/rubygems/source.rb: ditto.
- * lib/rubygems/spec_fetcher.rb: ditto.
- * lib/rubygems/specification.rb: ditto.
- * lib/rubygems/test_utilities.rb: ditto.
- * test/rubygems/test_gem.rb: Test for the above.
- * test/rubygems/test_gem_commands_sources_command.rb: ditto.
- * test/rubygems/test_gem_dependency_resolver_api_set.rb: ditto.
- * test/rubygems/test_gem_remote_fetcher.rb: ditto.
- * test/rubygems/test_gem_source.rb: ditto.
- * test/rubygems/test_gem_spec_fetcher.rb: ditto.
+ * lib/net/http/header.rb: pass header names as symbols.
+ Patch by @DamirSvrtan [fix GH-805]
+ * test/net/http/test_httpheader.rb: added test.
-Fri Mar 1 03:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Sun Feb 8 13:04:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych.rb: rdoc for Psych overview by Adam Stankiewicz
- [Github tenderlove/psych#134]
+ * ext/socket/getaddrinfo.c (get_addr): reject too long hostname to
+ get rid of GHOST vulnerability on very old platforms.
-Thu Feb 28 22:57:48 2013 Koichi Sasada <ko1@atdot.net>
+ * ext/socket/raddrinfo.c (make_hostent_internal): ditto, paranoic
+ check for the canonical name.
- * compile.c (iseq_compile_each): remove redundant trace(line)
- instruction. for example, at the following script
- def m()
- p:xyzzy
- 1
- 2
- end
- compiler ignores `1' because there is no effect. However,
- `trace(line)' instruction remains in bytecode.
- This modification removes such redundant trace(line) instruction.
+Sun Feb 8 12:48:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_iseq.rb: add a test.
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::API): use wide
+ versions of RegDeleteValue and RegDeleteKey.
+ [ruby-core:67958] [Bug #10820]
-Thu Feb 28 22:23:27 2013 Tanaka Akira <akr@fsij.org>
+Sat Feb 7 22:13:08 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/socket/raddrinfo.c (inspect_sockaddr): don't show that Unix
- domain socket filename is bigger than sizeof(sun_path).
- This limit is not rigid on some platforms such as Darwin and SunOS.
+ * test/win32ole/test_win32ole_record.rb: remove test using .NET
+ Framework 3.5 because it is not included in Windows 8/8.1.
-Thu Feb 28 21:33:01 2013 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Feb 7 19:25:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in(AC_DISABLE_OPTION_CHECKING): avoid warning "WARNING:
- Unrecognized options: --with-PACKAGE".
+ * dir.c (has_magic): always get long path name on Windows even if
+ no tilde is there. [ruby-core:68011] [Bug #10819]
-Thu Feb 28 20:22:04 2013 Koichi Sasada <ko1@atdot.net>
+ * dir.c (replace_real_basename): FindFirstFile ignore redirection
+ character, check if exists before call it. cf. [Bug #8597]
- * iseq.c (iseq_data_to_ary): fix condition.
- r34303 introduces a bug to avoid all line information from
- a result of ISeq#to_a. This is a regression problem from 2.0.0p0.
+Sat Feb 7 13:30:11 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * test/ruby/test_iseq.rb: add a test of lines after ISeq#to_a.
+ * test/win32ole/test_win32ole_record.rb
+ (test_ole_instance_variable_get): correct VT_RECORD type and
+ instance variables.
-Thu Feb 28 08:20:33 2013 Eric Hodel <drbrain@segment7.net>
+Fri Feb 6 17:47:05 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/rubygems/available_set.rb: Undent for style
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: register nodes when
+ dumping objects with custom coders. [ruby-core:66215] [Bug #10496]
- * lib/rubygems/dependency_installer.rb: Pick latest prerelease gem to
- install. Fixes RubyGems bug #468.
- * test/rubygems/test_gem_dependency_installer.rb: Test for the above.
+ * test/psych/test_coder.rb: test for fix
- * lib/rubygems/dependency_installer.rb: Don't display "Done installing
- documentation" if documentation will not be installed.
- * lib/rubygems/rdoc.rb: ditto
+Fri Feb 6 16:58:31 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/rubygems/dependency_list.rb: Use Array#concat for Ruby 1.x
- performance.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regular
+ expressions with newlines. tenderlove/psych#222
- * lib/rubygems/installer.rb: Use formatted program name when comparing
- executables. RubyGems pull request #471
- * test/rubygems/test_gem_installer.rb: Test for the above.
+ * test/psych/test_yaml.rb: test for change.
- * lib/rubygems/package.rb: Use more explicit feature check to work
- around JRuby bug #552
+Fri Feb 6 10:31:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/ssl_certs/GeoTrust_Global_CA.pem: Added GeoTrust root
- certificate.
+ * vm_core.h (rb_call_info_kw_arg_struct): make keywords a symbols
+ list to get rid of inadvertent creation by variable keyword
+ arguments. [ruby-core:68031] [Bug #10831]
- * test/rubygems/test_gem_source_list.rb: Use "example" instead of real
- hostname
+Thu Feb 5 22:42:34 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Feb 28 05:57:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * lib/rubygems: Update to RubyGems HEAD(5c3b6f3).
+ Fixed #1156, #1142, #1115, #1142, #1139 on rubygems/rubygems
+ * test/rubygems: ditto.
- * thread.c: rdoc formatting for Thread, ThreadGroup, and ThreadError
+Thu Feb 5 13:41:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 28 02:42:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * vm_eval.c (send_internal), vm_insnhelper.c (vm_call_opt_send):
+ convert String method name into a Symbol, as method_missing
+ method expects its first argument to be a Symbol. [Bug #10828]
- * vm.c: Typo in overview for example of Thread#status returning false
- Reported by Lee Jarvis
+ * vm_insnhelper.c (ci_missing_reason): return the reason of method
+ missing in call info.
-Wed Feb 27 22:54:27 2013 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_call_opt_send): re-apply r49500 with the
+ proper missing reason. [Bug #10828]
- * ext/socket/rubysocket.h (union_sockaddr): make it longer for SunOS
- and Darwin.
+Thu Feb 5 10:31:46 2015 Shugo Maeda <shugo@ruby-lang.org>
-Wed Feb 27 21:14:34 2013 Kouhei Sutou <kou@cozmixng.org>
+ * class.c (rb_obj_singleton_methods): should use RTEST() to convert
+ VALUE to int.
- * lib/rexml/security.rb (REXML::Security): create.
- * lib/rexml/rexml.rb: move entity_expansion_limit and
- entity_expansion_text_limit accessors to ...
- * lib/rexml/security.rb: ... here.
- * lib/rexml/document.rb: use REXML::Security.
- * lib/rexml/text.rb: use REXML::Security.
- * test/rexml/test_document.rb: use REXML::Security.
+Thu Feb 5 03:59:33 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed Feb 27 19:53:32 2013 Benoit Daloze <eregontp@gmail.com>
+ * vm_insnhelper.c: Fix symbol leak with +send+ [Bug #10828]
- * vm.c (Thread): fix typos in overview
+Wed Feb 4 20:26:54 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Wed Feb 27 13:21:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/win32ole/win32ole.c (Init_win32ole): should not use atexit to
+ free allocated hash table to avoid error on Cygwin.
- * vm.c (Thread): Typo in overview, swap setting and getting
+Wed Feb 4 15:34:25 2015 Shugo Maeda <shugo@ruby-lang.org>
-Wed Feb 27 13:02:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * class.c (method_entry_i, class_instance_method_list,
+ rb_obj_singleton_methods): should not include methods of
+ superclasses if recur is false. [ruby-dev:48854] [Bug #10826]
- * vm.c (Thread): Documentation overview of Thread class
+Wed Feb 4 16:32:40 2015 Matt Hoyle <matt@deployable.co>
-Wed Feb 27 12:57:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/bigdecimal/bigdecimal.c (VpSetPTR): fix a typo, 'expoennt'
+ to 'exponent'. [ruby-core:67980] [Bug #10823] [Fix GH-825]
- * thread.c (rb_thread_wakeup): rdoc formatting
+Wed Feb 4 15:55:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 27 12:53:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/sdbm/_sdbm.c: include ruby/ruby.h for PRIdPTRDIFF when a
+ macro `DEBUG` is defined. based on the patch by Owen Rodley in
+ [ruby-core:67987]. [Bug #10825]
- * thread.c (rb_thread_group): rdoc formatting
+Wed Feb 4 11:12:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 27 12:33:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * Makefile.in (probes.stamp): rebuild dtrace dependent objects
+ only when `dtrace -G` modifies its input files.
- * lib/ostruct.rb: Typo in OpenStruct overview [Github Fixes #251]
- Patch by Chun-wei Kuo
+Tue Feb 3 19:27:16 2015 Naohisa Goto <ngotogenome@gmail.com>
-Wed Feb 27 12:13:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * common.mk (ruby-glommed.o): dependency on $(OBJ) should be written
+ in common.mk (in which OBJ is defined) because of Makefile include
+ and parse order. This partly reverts r49419.
+ [ruby-dev:48849] [Bug #10808]
- * vm_exec.h (END_INSN): llvm-gcc may optimize out reg_cfp and cause
- Stack/cfp consistency error when the instruction doesn't use reg_cfp.
- Usually instructions use PUSH() but for example trace doesn't.
- This hack cause speed down but you shouldn't use llvm-gcc, use clang.
- [Bug #7938]
+ * Makefile.in (ruby-glommed.o): ditto.
-Wed Feb 27 10:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * Makefile.in (ruby-glommed.o): remove excess $(DTRACE_OBJ) because
+ it is included in $(OBJS) since r49451.
- * thread.c (thread_raise_m): rdoc formatting
+ * Makefile.in (probes.o): should depend on $(DTRACE_DEPENDENT_OBJS)
-Tue Feb 26 23:32:44 2013 Kouhei Sutou <kou@cozmixng.org>
+Tue Feb 3 17:15:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rexml/document.rb: move entity_expansion_limit accessor to ...
- * lib/rexml/rexml.rb: ... here for consistency.
- * lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
- deprecated.
- * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
- deprecated.
+ * lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of
+ interference by modifying global variables in have_devel? method.
+ [ruby-core:67962] [Bug #10821]
-Tue Feb 26 23:26:13 2013 Kouhei Sutou <kou@cozmixng.org>
+Tue Feb 3 15:23:58 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...
- * lib/rexml/rexml.rb: ... here to make rexml/text independent from
- REXML::Document. It causes circular require.
- * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
- deprecated.
- * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
- deprecated.
- * lib/rexml/text.rb: add missing require "rexml/rexml" for
- REXML.entity_expansion_text_limit.
- Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]
+ * vm_method.c (remove_method): When remove refined
+ method, raise a NameError if the method is not
+ defined in refined class.
-Tue Feb 26 15:12:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ But if the method is defined in refined class,
+ it should keep refined method and remove original
+ method.
- * tool/mkconfig.rb: reconstruct comma separated list values. a
- command line to Windows batch file is split not only by spaces
- and equal signs but also by commas and semicolons.
+ Patch by Seiei Higa. [ruby-core:67722] [Bug #10765]
-Tue Feb 26 15:04:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 3 14:04:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (unexpand_shvar): get rid of non-portable shell
- behavior on OpenBSD, so no extra quotes. [Bug #7959]
+ * dir.c (glob_helper): obtain real name with FindFirstFile API
+ instead of matching all entries, on Windows.
+ [ruby-core:67954] [Bug #10819]
-Tue Feb 26 10:24:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 3 12:26:35 2015 Katsuhiko Nishimra <ktns.87@gmail.com>
- * parse.y (IS_LABEL_POSSIBLE): allow labels for keyword arguments just
- after method definition without a parenthesis. [ruby-core:52820]
- [Bug #7942]
+ * lib/mkmf.rb (configuration): set the default cxxflags, which is
+ referred from the default CXXFLAGS, for extension libraries.
+ [Fix GH-823]
-Tue Feb 26 04:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue Feb 3 05:52:00 2015 Aman Gupta <ruby@tmm1.net>
- * error.c: clarify reason for sleep in SignalException example
+ * gc.c (rb_objspace_free): cause rb_bug if lazy sweep is in progress
+ during rb_objspace_free. Adds extra protection for r46340.
+ Patch by Vicent Marti. [Bug #10768] [ruby-core:67734]
+ * gc.c (rb_objspace_call_finalizer): Ensure GC is completed after
+ finalizers have run. We already call gc_rest() before invoking
+ finalizers, but finalizer can allocate new objects and start new GC
+ cycle, so we call gc_rest() again after finalizers are complete.
-Tue Feb 26 03:47:00 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Feb 2 10:51:34 2015 Ari Pollak <ajp@aripollak.com>
- * error.c: clarify a document of SignalException. Process.kill()
- doesn't have any guarantee when signal will be delivered.
- [Bug #7951] [ruby-core:52864]
+ * doc/security.rdoc (Symbols): update about Symbol GC. Symbols
+ explicitly converted from Strings now can be collected, but
+ reflection/metaprogramming still can cause memory flooding.
+ [Fix GH-725]
-Mon Feb 25 23:51:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 1 13:46:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/version.h: bump RUBY_API_VERSION same as RUBY_VERSION.
+ * tool/rbinstall.rb (bin-comm): drop batch file installation.
+ Windows 95 support has not been supported already.
+ [Feature #10806]
-Mon Feb 25 21:03:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jan 31 12:06:23 2015 Scott Francis <scott.francis@shopify.com>
- * string.c (str_byte_substr): don't set coderange if it's not known.
- [Bug #7954] [ruby-dev:47108]
+ * thread_pthread.c (reserve_stack): fix intermittent SIGBUS on
+ Linux, by reserving the stack virtual address space at process
+ start up so that it will not clash with the heap space.
+ [Fix GH-822]
-Mon Feb 25 16:47:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 30 17:28:29 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * common.mk (realclean-local): miniprelude.c is made by srcs, so it
- should not removed by distclean but by realclean. [Bug #6807]
+ * math.c (num2dbl_with_to_f): make faster when Bignum passed by
+ direct conversion using rb_big2dbl(). [Feature #10800]
-Mon Feb 25 16:30:30 2013 Eric Hodel <drbrain@segment7.net>
+Thu Jan 29 23:30:00 2015 Kenta Murata <mrkn@mrkn.jp>
- * lib/rubygems/config_file.rb: Lazily load .gem/credentials to only
- check permissions when necessary. RubyGems bug #465
- * test/rubygems/test_gem_config_file.rb: Test for the above.
+ * ext/bigdecimal/bigdecimal.c (rb_rational_num): add fallback function
+ for rubies lower than 2.2.0.
- * test/rubygems/test_gem_commands_push_command.rb: Remove duplicated
- test.
+ * ext/bigdecimal/bigdecimal.c (rb_rational_den): ditto.
-Mon Feb 25 15:47:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/extconf.rb: check the existences of struct RRational,
+ rb_rational_num, and rb_rational_den.
- * enc/depend (ARFLAGS): VisualC++ linker does not allow spaces between
- output option and the output file name. [Bug #7950]
+ * ext/bigdecimal/bigdecimal.bundle: bump version.
- * enc/depend (RANLIB): set default command to do nothing, or make the
- entire line a label on Windows.
+Thu Jan 29 20:28:25 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Feb 25 14:41:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/make-snapshot: removed md5 digest with package information
- * lib/mkmf.rb (MakeMakefile#init_mkmf): default libdirname to libdir.
+Thu Jan 29 10:41:52 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
- * tool/rbinstall.rb: ditto.
+ * math.c (Get_Double): direct casting from Fixnum to double.
+ [Feature #10785]
-Mon Feb 25 13:12:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 29 02:34:27 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * configure.in (setup): find Setup file from target_os 1. by
- suffix (e.g. Setup.nacl, Setup.atheos), 2. by "platform"
- option (e.g. Setup.nt, Setup.emx), and 3. default Setup. And
- Setup.dj had been removed.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fix parsing hashes with
+ instance variables when it is referenced multiple times.
+ * ext/psych/lib/psych.rb: bump version
+ * ext/psych/psych.gemspec: bump version
+ * test/psych/test_hash.rb: test for fix
-Mon Feb 25 12:48:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu Jan 29 02:06:09 2015 Eric Wong <e@80x24.org>
- * thread.c: Document Thread::new, clean up ::fork and mention calling
- super if subclassing Thread
+ * thread.c (struct join_arg): restructure and make smaller
+ (thread_join_sleep): avoid timeofday() call if forever
+ (thread_join): pass join_arg.delay directly
+ (rb_thread_inspect_msg): remove, inline into rb_thread_inspect
+ (rb_thread_inspect): reduce branching and string creation
+ * thread_pthread.c (native_set_thread_name): create string directly
+ to avoid reparsing. [Misc #10723]
-Mon Feb 25 12:38:50 2013 Tanaka Akira <akr@fsij.org>
+Wed Jan 28 21:32:24 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/extconf.rb: don't test ss_family and ss_len member of
- struct sockaddr_storage. They are not used now except SunOS
- specific code.
+ * thread.c: Improve documentation for Thread#value
+ [Bug #10694][ruby-core:67324][ci skip]
-Mon Feb 25 11:03:38 2013 Akinori MUSHA <knu@iDaemons.org>
+Tue Jan 27 16:04:19 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (unexpand_shvar): Use the numeric comparison
- operator instead of '==' which is a ksh extension. [Bug #7941]
+ * tool/redmine-backporter.rb: added `!` command.
-Mon Feb 25 02:37:56 2013 Tanaka Akira <akr@fsij.org>
+Tue Jan 27 15:58:23 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket: define and use union_sockaddr instead of struct
- sockaddr_storage for less casts.
+ * tool/redmine-backporter.rb: added history feature for platforms which
+ lack readline.
- * ext/socket/rubysocket.h (union_sockaddr): defined.
+Mon Jan 26 22:09:35 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/socket.c (sock_accept): use union_sockaddr.
- (sock_accept_nonblock): ditto.
- (sock_sysaccept): ditto.
- (sock_s_getnameinfo): ditto.
+ * .gitignore: ignored temporary file with git.
- * ext/socket/basicsocket.c (bsock_getsockname): ditto.
- (bsock_getpeername): ditto.
- (bsock_local_address): ditto.
- (bsock_remote_address): ditto.
+Mon Jan 26 18:06:03 2015 Akinori MUSHA <knu@iDaemons.org>
- * ext/socket/ancdata.c (bsock_recvmsg_internal): ditto.
+ * misc/ruby-electric.el: Import version 2.2.2 from
+ https://github.com/knu/ruby-electric.el.
- * ext/socket/init.c (recvfrom_arg): ditto.
- (recvfrom_blocking): ditto.
- (rsock_s_recvfrom): ditto.
- (rsock_s_recvfrom_nonblock): ditto.
- (rsock_getfamily): ditto.
+Mon Jan 26 11:37:49 2015 Dave Stevens <dave@crowdlab.com>
- * ext/socket/raddrinfo.c (rb_addrinfo_t): ditto.
- (ai_get_afamily): ditto.
- (inspect_sockaddr): ditto.
- (addrinfo_mdump): ditto.
- (addrinfo_mload): ditto.
- (addrinfo_getnameinfo): ditto.
- (addrinfo_ip_port): ditto.
- (extract_in_addr): ditto.
- (addrinfo_ipv6_to_ipv4): ditto.
- (addrinfo_unix_path): ditto.
+ * string.c (str_make_independent_expand): terminate String when
+ moved from heap to embedded. [Fix GH-821].
- * ext/socket/tcpserver.c (tcp_accept): ditto.
- (tcp_accept_nonblock): ditto.
- (tcp_sysaccept): ditto.
+Sun Jan 25 12:04:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/ipsocket.c (ip_addr): ditto.
- (ip_peeraddr): ditto.
- (ip_s_getaddress): ditto.
+ * array.c (flatten): no need to call to_ary method on elements
+ beyond the given level. [ruby-core:67637] [Bug #10748]
-Sun Feb 24 21:15:05 2013 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Jan 25 00:42:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/date/date_core.c: [ruby-core:52303]
+ * ext/fiddle/win32/libffi.mk.tmpl: assemble without directory prefix.
+ workaround of a bug of VC12 ml, by unak at [ruby-core:67792].
+ [ruby-core:67789] [Bug #10780]
-Sun Feb 24 15:33:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 24 19:56:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * random.c (rb_random_ulong_limited): limit is inclusive, but generic
- rand method should return a number less than it, so increase for the
- difference. [ruby-core:52779] [Bug #7935]
+ * dln_find.c (dln_find_1): search regular files only. based on
+ the patch by Alex Coomans in [ruby-core:67766]. [Bug #10776]
-Sun Feb 24 15:32:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 23 23:57:05 2015 Misumi Rize <r@ayase-e.li>
- * random.c (rb_random_ulong_limited): limit is inclusive, but generic
- rand method should return a number less than it, so increase for the
- difference. [ruby-core:52779] [Bug #7935]
+ * vm_insnhelper.c (vm_throw_start): search the target to break
+ from a block with nested rescue, from the nested blocks.
+ [ruby-core:67765] [Bug #10775] [Fix GH-820]
-Sun Feb 24 15:14:43 2013 Eric Hodel <drbrain@segment7.net>
+Fri Jan 23 20:00:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb: Removed duplicate Accept-Encoding in Net::HTTP#get.
- [ruby-trunk - Bug #7924]
- * test/net/http/test_http.rb: Test for the above.
+ * marshal.c (w_object, marshal_dump): use identity tables for
+ arbitrary VALUE keys, because of performance of FLONUM.
+ [Bug #10761]
-Wed Feb 20 14:28:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * marshal.c (obj_alloc_by_klass, marshal_load): ditto.
- * thread.c: Document ThreadGroup::Default
+Fri Jan 23 17:12:33 2015 Eric Wong <e@80x24.org>
-Wed Feb 20 14:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * benchmark/bm_marshal_dump_flo.rb: new benchmark for [Bug #10761]
- * thread.c: Grammar for #backtrace_locations and ::handle_interrupt
+Thu Jan 22 18:03:19 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Feb 24 13:35:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/redmine-backporter.rb (find_svn_log): use double quotes instead
+ of single quotes because cmd.exe doesn't handle them.
- * vm_insnhelper.c (vm_call_method): block level control frame does not
- have method entry, so obtain the method entry from method top-level
- control frame to be compared with refined method entry.
- [ruby-core:52750] [Bug #7925]
+ * tool/redmine-backporter.rb (done): the 2nd element of matched data
+ is the offset of the end of matched string, not length.
-Wed Feb 20 13:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu Jan 22 16:45:24 2015 Eric Wong <e@80x24.org>
- * object.c: Document methods receiving string and convert to symbol
- Patch by Stefan Rusterholz
- * vm_eval.c: ditto
- * vm_method.c: ditto
+ * st.c (st_numhash): mix float value for flonum
+ * hash.c (rb_any_hash): ditto
+ * benchmark/bm_hash_aref_flo.rb: new benchmark
+ * benchmark/bm_hash_ident_flo.rb: ditto
+ [Bug #10761]
-Wed Feb 20 07:20:56 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jan 21 22:33:51 2015 Akinori MUSHA <knu@iDaemons.org>
- * signal.c (sigsegv): suppress unused result warning. Because
- write(2) is marked __warn_unused_result__ on Linux glibc.
+ * misc/ruby-electric.el: Import version 2.2.1 from
+ https://github.com/knu/ruby-electric.el. Improve compatibility
+ with and optimize for Emacs 24.4.
-Sun Feb 24 07:50:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 21 09:40:52 2015 Zachary Scott <e@zzak.io>
- * compile.c (iseq_set_arguments): no keyword check if any keyword rest
- argument exists, even unnamed. [ruby-core:52744] [Bug #7922]
+ * file.c: Document other cases of missing birthtime on OS with patch
+ provided by @sho-h similar to GH-817. [ci skip] [DOC]
-Sat Feb 23 16:51:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Wed Jan 21 09:09:19 2015 Tanaka Akira <akr@fsij.org>
- * thread.c: Documentation for Thread#backtrace_locations
+ * NEWS: References to tickets added.
+ [ruby-core:67701] [Bug #10760] Suggested by Zachary Scott.
-Sat Feb 23 16:05:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue Jan 20 22:59:54 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * vm.c: Typo in ObjectSpace::WeakMap overview
+ * tool/vcs.rb: fix the exception given remote-url of svn.
-Sat Feb 23 16:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Tue Jan 20 12:58:33 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread.c: Improved rdoc for ::handle_interrupt, ::pending_interrupt?
- and #pending_interrupt?
+ * tool/redmine-backporter.rb: now can change the page of `ls`.
-Sat Feb 23 12:26:43 2013 Akinori MUSHA <knu@iDaemons.org>
+Tue Jan 20 12:28:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * misc/ruby-electric.el (ruby-electric-curlies)
- (ruby-electric-matching-char, ruby-electric-bar): Avoid electric
- insertion when there is a prefix argument.
+ * tool/redmine-backporter.rb (readline): fallback to normal gets on
+ Windows because IO.console.getch is not always do as expected.
- * misc/ruby-electric.el (ruby-electric-insert)
- (ruby-electric-cua-replace-region-p)
- (ruby-electric-cua-replace-region): Avoid electric insertion and
- fall back when cua-mode is enabled and a region is active.
+Tue Jan 20 11:31:07 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Feb 23 12:35:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * tool/redmine-backporter.rb: update usage.
- * array.c: Document #<=> return values and formatting
- * bignum.c: ditto
- * file.c: ditto
- * object.c: ditto
- * numeric.c: ditto
- * rational.c: ditto
- * string.c: ditto
- * time.c: ditto
+Tue Jan 20 11:23:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Feb 23 10:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * tool/redmine-backporter.rb (mygets): to support Backspace
+ implement gets by itself.
- * array.c (rb_ary_diff, rb_ary_and, rb_ary_or): Document return order
- [RubySpec #7803]
+Tue Jan 20 02:54:11 2015 Zachary Scott <e@zzak.io>
-Sat Feb 23 10:17:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * file.c: NotImplementedError is raised if birthtime is unavailable.
+ Patch by @y-yagi san and [Fixes GH-817] [ci skip] [DOC]
- * object.c (rb_obj_comp): Documenting Object#<=> return values
- Patch by Stefan Rusterholz
+ * ext/pathname/pathname.c: ditto.
-Sat Feb 23 09:48:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 19 22:08:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (file_s_fnmatch, fnmatch_brace): encoding-incompatible pattern
- and string do not match, instead of exception. [ruby-dev:47069]
- [Bug #7911]
+ * class.c (include_modules_at): allow to prepend each module up to
+ once for each classe. [EXPERIMENTAL]
-Sat Feb 23 08:57:46 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Sun Jan 18 18:32:20 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * doc/NEWS-*: Update NEWS from their respective branches
+ * math.c (math_atan2): revive documentation before r49220.
+ http://d.hatena.ne.jp/nagachika/20150112/ruby_trunk_changes_49213_49226
-Sat Feb 23 08:14:43 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Sun Jan 18 15:57:32 2015 Seiei Higa <hanachin@gmail.com>
- * NEWS: many additions for Ruby 2.0.0
+ * vm_method.c (check_definition): Module#public_method_defined?,
+ Module#private_method_defined?, Module#protected_method_defined?
+ should not use refinements. [ruby-core:67656] [Bug #10753]
- * object.c: Add doc for Module.prepended
+Sun Jan 18 15:50:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Feb 23 07:52:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c (rb_vm_bugreport): check by configured result instead
+ of system name for old FreeBSD. based on a patch by Steve Wills
+ at [ruby-core:67655]. [Bug #10752]
- * template/ruby.pc.in: reorder library flags which may refer library
- names. [Bug #7913]
+Sun Jan 18 12:56:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 22 23:46:20 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * Makefile.in (VPATH, NEWLINE_C), common.mk (common-srcs): make
+ and use newline.c under enc/trans directory, not toplevel. no
+ longer search enc directory implicitly.
- * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
- fix a typo in comment in r39384.
+ * configure.in, enc/Makefile.in (BUILTIN_ENCS, BUILTIN_TRANSES):
+ prefix respective directory names to builtin encodings and
+ transcoder source names.
-Fri Feb 22 18:31:46 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+Sun Jan 18 11:49:46 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
- new attribute to read/write entity expansion text limit. the default
- limit is 10Kb.
+ * ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
+ variable is passed by reference. [ruby-dev:48803] [Bug #10697]
- * lib/rexml/text.rb (REXML::Text.unnormalize): check above attribute.
+Sat Jan 17 23:59:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 22 17:36:23 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String):
+ anchors like `\Z` are not valid inside character class. use
+ negative-lookahead instead.
+ Fixes: https://github.com/tenderlove/psych/issues/221
- * test/test_rbconfig.rb (TestRbConfig): fix r39372.
- It must see RbConfig::CONFIG instead of CONFIG.
+Sat Jan 17 23:42:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 22 14:55:41 2013 Naohisa Goto <ngotogenome@gmail.com>
+ * configure.in: get rid of pattern substitution, which is not
+ supported by ash, and ash on NetBSD parses whole source first
+ and fails to start. [ruby-dev:48823] [Bug #10750]
- * signal.c (ruby_abort): fix typo in r39354 [Bug #5014]
+Fri Jan 16 18:42:58 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Feb 22 12:46:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/redmine-backporter.rb: support adding related revisions
+ to issues.
- * random.c (rb_random_ulong_limited): fix error message for negative
- value. [ruby-dev:47061] [Bug #7903]
+Fri Jan 16 17:20:33 2015 Koichi Sasada <ko1@atdot.net>
-Fri Feb 22 11:36:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ vm.c, vm_core.h: constify VM_CF_LEP, VM_CF_PREV_EP, VM_CF_BLOCK_PTR
+ and rb_vm_control_frame_block_ptr.
- * test/test_rbconfig.rb (TestRbConfig): skip user defined values by
- configuration options. [Bug #7902]
+Fri Jan 16 15:41:21 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Feb 22 11:33:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych.rb: bump version
- * lib/mkmf.rb (MakeMakefile#init_mkmf): adjust default library path
- for multiarch. [Bug #7874]
+ * ext/psych/psych.gemspec: ditto
-Fri Feb 22 11:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Fri Jan 16 15:37:49 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * enum.c (Enumerable#chunk: Improved examples, grammar, and formatting
- Patch by Dan Bernier and Rich Bruchal of newhaven.rb
- [Github documenting-ruby/ruby#8]
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: only dump hash
+ subclasses. Thanks Joe Eli McIlvain <joe.eli.mac@gmail.com>
-Fri Feb 22 11:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * test/psych/test_hash.rb: test for change
- * numeric.c: Examples and formatting for Numeric and Float
- Based on a patch by Zach Morek and Oren K of newhaven.rb
- [Github documenting-ruby/ruby#5]
+Fri Jan 16 15:35:21 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Feb 22 07:04:41 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/psych/lib/psych.rb: bump version
- * lib/rubygems/installer.rb (build_extensions): Create extension
- install destination before building extension. Patch by Kenta Murata.
- [ruby-trunk - Bug #7897]
- * test/rubygems/test_gem_installer.rb: Test for the above.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: fix line width wrapping
+ for long strings. Thanks Jakub Jirutka <jakub@jirutka.cz>
-Fri Feb 22 06:30:57 2013 Eric Hodel <drbrain@segment7.net>
+ * test/psych/test_string.rb: test for change
- * doc/globals.rdoc: Document what setting $DEBUG does.
+Fri Jan 16 11:44:44 2015 Kazuki Tsujimoto <kazuki@callcc.net>
- * doc/globals.rdoc: Added pointer to $-d for full documentation.
+ * eval_intern.h, vm.c, vm_eval.c, vm_insnhelper.c:
+ change throw mechanism (not save target ep, but save target cfp).
+ It fixes `unexpected break' bug that occurs when
+ TracePoint#binding is called.
+ [ruby-dev:48797] [Bug #10689]
-Fri Feb 22 06:27:07 2013 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_settracefunc.rb: add a test.
- * doc/globals.rdoc: Document what setting $VERBOSE does. [Bug #7899]
+Thu Jan 15 23:55:15 2015 Tanaka Akira <akr@fsij.org>
- * doc/globals.rdoc: Added pointer to $-w and $-v for full
- documentation.
+ * io.c (rb_io_close_m): Don't raise when the IO object is closed.
+ [ruby-core:67444] [Feature #10718]
-Fri Feb 22 02:33:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu Jan 15 21:34:57 2015 Seiei Higa <hanachin@gmail.com>
- * lib/abbrev.rb: Add words parameter to Abbrev::abbrev
- Patch by Devin Weaver [Github documenting-ruby/ruby#7]
+ * proc.c (rb_obj_singleton_method): Kernel#singleton_method should
+ not use refinements, as well as Kernel#method.
+ [ruby-core:67603] [Bug #10744]
-Thu Feb 21 17:28:14 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jan 15 10:45:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/merger.rb: add interaction when only ChangeLog is modified.
+ * array.c (rb_ary_select_bang, ary_reject_bang): linear
+ performance. [ruby-core:67418] [Feature #10714]
-Thu Feb 21 16:34:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 14 18:06:06 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * signal.c (check_stack_overflow): extract duplicated code and get rid
- of declaration-after-statement. [Bug #5014]
+ * lib/uri/mailto.rb: raising URI::InvalidComponentError instead
+ of failing with undefined method `split' for nil:NilClass for
+ mailto: URIs without opaque part. [Bug #10738]
+ * test/uri/testuri.rb: Test for above
-Thu Feb 21 14:14:13 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jan 14 16:45:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * signal.c (sigsegv): avoid to use async signal unsafe functions
- when nested sigsegv is happen.
- [Bug #5014] [ruby-dev:44082]
+ * tool/downloader.rb (RubyGems.download): verify downloaded gem
+ packages. LowSecurity to allow untrusted certificates now.
-Thu Feb 21 13:47:59 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jan 14 15:43:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_group_member): added an error check. SUS says,
- getgroups(small_value) may return EINVAL.
+ * ext/readline/readline.c (readline_s_refresh_line): initialize
+ before rl_refresh_line(), as some function make the internal
+ state non-clean but rl_refresh_line() does not re-initialize it.
+ [ruby-core:43957] [Bug #6232]
-Thu Feb 21 13:37:07 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jan 13 21:59:24 2015 Michal Papis <mpapis@gmail.com>
- * process.c (RB_MAX_GROUPS): moved to
- * internal.h (RB_MAX_GROUPS): here.
+ * tool/rbinstall.rb (gem): fix changing permissions of installed
+ bundled gems. [Fix GH-812]
- * file.c (rb_group_member): use RB_MAX_GROUPS instead of
- RUBY_GROUP_MAX. They are the same.
+Tue Jan 13 21:57:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 21 13:15:40 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * common.mk (distclean-local): remove autom4te.cache generated by
+ autoconf.
- * file.c (access_internal): removed.
- * file.c (rb_file_readable_real): use access() instead of
- access_internal().
- * file.c (rb_file_writable_real): ditto.
- * file.c (rb_file_executable_real): ditto.
+ * common.mk (realclean-local): remove id sources and dummy header
+ for dtrace. [ruby-core:67562] [Bug #10737]
-Thu Feb 21 13:04:59 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jan 13 21:08:22 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * file.c (eaccess): use access() when not using setuid nor setgid.
- This is minor optimization.
+ * ext/json, test/json: merge JSON HEAD(259dee6)
+ separate implementation of Typed_Data macro.
+ https://github.com/flori/json/compare/v1.8.1...v1.8.2
-Thu Feb 21 12:56:19 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jan 13 14:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_group_member): get rid of NGROUPS dependency.
- [Bug #7886] [ruby-core:52537]
+ * test/net/http/test_http.rb: get rid of accessing DNS actually
+ for some servers returning wrong results.
+ [ruby-core:67454] [Bug #10721]
-Thu Feb 21 12:45:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 12 23:21:57 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * ruby.c (ruby_init_loadpath_safe): try two levels upper for stripping
- libdir name. [Bug #7874]
+ * gems/bundled_gems: update test-unit to 3.0.9.
- * configure.in (libdir_basename): expand with multiarch in configure,
- not to defer the expansion till ruby.pc.in and mkmf.rb. [Bug #7874]
+Mon Jan 12 18:35:44 2015 Eric Wong <e@80x24.org>
- * configure.in (libdir_basename): also -rpath and -install_name flags
- are affected when libruby directory changes. [Bug #7874]
+ * numeric.c (bit_coerce): use original value for error message
+ [ruby-core:67405] [Bug #10711]
+ * test/ruby/test_numeric.rb (test_coerce): check error message
-Wed Feb 20 19:27:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 12 18:01:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h (HAVE_RB_SCAN_ARGS_OPTIONAL_HASH): for
- rb_scan_args() optional hash feature. [Bug #7861]
+ * lib/rdoc/text.rb (expand_tabs): get rid of infinite loop with
+ CR. should check if substitution occurred too.
+ [ruby-dev:48813] [Bug #10732]
-Wed Feb 20 18:02:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 12 16:45:46 2015 Seiei Higa <hanachin@gmail.com>
- * configure.in (target_os): do not strip -gnu suffix on Linux if
- --target is given explicitly. [Bug #7874]
+ * vm_method.c (rb_alias): raise a NameError when creating alias to
+ a refined method if the original method of the refined method is
+ not defined. [ruby-core:67523] [Bug #10731]
- * configure.in (libdirname): adjust library path name which libruby
- files will be installed. [Bug #7874]
+Mon Jan 12 13:53:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * tool/rbinstall.rb (libdir): ditto.
+ * math.c (math_atan2): improve documentation.
+ [Feature #10323][ruby-core:65400][ci skip]
-Wed Feb 20 13:37:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Mon Jan 12 13:50:49 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/pty/pty.c: Documentation for the PTY module
+ * ext/bigdecimal/bigdecimal.c: fixes documentation like labeled lists,
+ code examples etc. [ruby-core:66730][Bug #10576][ci skip]
-Wed Feb 20 12:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Mon Jan 12 13:36:44 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * object.c: Document Data class [Bug #7890] [ruby-core:52549]
- Patch by Matthew Mongeau
+ * lib/optparse.rb: improvements for OptionParser documentation.
+ [misc #10608][ruby-core:66901][ci skip]
-Wed Feb 20 11:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Mon Jan 12 13:33:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/mutex_m.rb: Add rdoc for Mutex_m module
+ * array.c (rb_ary_each): documented return value.
+ [misc #10469][ruby-core:66063]
-Wed Feb 20 09:34:43 2013 Eric Hodel <drbrain@segment7.net>
+Sun Jan 11 15:11:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/commands/update_command.rb: Create the installer after
- options are processed. [ruby-trunk - Bug #7779]
- * test/rubygems/test_gem_commands_update_command.rb: Test for the
- above.
+ * test/webrick/test_utils.rb (test_create_listeners): use
+ dynamically chosen port number, not hardcoded port number.
+ [ruby-core:67508]
-Wed Feb 20 07:51:19 2013 Eric Hodel <drbrain@segment7.net>
+Sat Jan 10 12:57:12 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rubygems/installer.rb: Use gsub instead of gsub! to avoid
- altering @bin_dir. Fixes tests on windows. [ruby-trunk - Bug #7885]
+ * ext/zlib/zlib.c: fix document of method signatures.
+ [Bug #10668][ruby-core:67186][ci skip]
-Tue Feb 19 20:50:00 2013 Kenta MURATA <mrkn@mrkn.jp>
+Sat Jan 10 12:32:44 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.gemspec: bump to 1.2.0.
- [ruby-core:51777] [Bug #7761]
+ * eval_error.c (error_print): pos and len parameters of rb_str_substr()
+ are counted by characters, not bytes. use rb_str_subseq() instead.
+ [Bug #10727] [ruby-core:67473]
-Tue Feb 19 13:07:25 2013 Akinori MUSHA <knu@iDaemons.org>
+Sat Jan 10 10:58:55 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/syslog/syslog.c (Init_syslog): Define inspect as a singleton
- method and remove it as an instance method. [Bug #6502]
+ * complex.c: removed commented-out code.
-Tue Feb 19 12:30:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Sat Jan 10 10:57:19 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * object.c: rdoc formatting for Kernel#Array()
- * array.c: Add rdoc for Array() method to Creating Arrays section
+ * rational.c: removed commented-out code.
+ [Feature #10376][ruby-core:65643]
-Tue Feb 19 10:35:52 2013 Eric Hodel <drbrain@segment7.net>
+Sat Jan 10 10:12:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl.c (class OpenSSL): Use only inner parenthesis in
- create_extension examples.
+ * array.c (rb_ary_select_bang): keep the array consistent by
+ removing unselected values soon. [ruby-dev:48805] [Bug #10722]
-Tue Feb 19 10:27:12 2013 Eric Hodel <drbrain@segment7.net>
+Fri Jan 9 23:20:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/openssl/ossl.c (class OpenSSL): Fixed ExtensionFactory example.
- Patch by Richard Bradley. [ruby-trunk - Bug #7551]
+ * lib/rubygems: Update to RubyGems HEAD(e53c54a).
+ * test/rubygems: ditto.
-Tue Feb 19 08:32:11 2013 Koichi Sasada <ko1@atdot.net>
+Fri Jan 9 11:13:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_eval.c (vm_call0_body): check interrupts after method dispatch
- from C methods. [Bug #7878]
+ * parse.y (assocs, assoc): eliminate splatting empty literal
+ hashes. [ruby-core:67446] [Bug #10719]
-Tue Feb 19 08:14:40 2013 Eric Hodel <drbrain@segment7.net>
+ * compile.c (compile_array_): support splatted hash in hash type.
- * lib/rubygems/installer.rb: Fixed placement of executables with
- --user-install. [ruby-trunk - Bug #7779]
- * test/rubygems/test_gem_installer.rb: Test for above.
+Fri Jan 9 10:57:09 2015 Vit Ondruch <vondruch@redhat.com>
-Tue Feb 19 06:04:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in (RUBY_SETJMP_TYPE): Remove superfluous semicolon
+ which causes a syntax error with autoconf 2.63.
+ [ruby-core:67429] [Bug #10716]
- * vm_dump: FreeBSD ports' libexecinfo's backtrace(3) can't trace
- beyond signal trampoline, and as described in r38342 it can't
- trace on -O because it see stack frame pointers.
- libunwind unw_backtrace see dwarf information in the binary
- and it works with -O (without frame pointers).
+Fri Jan 9 07:23:32 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * configure.in: remove r38342's hack and check libunwind.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: correctly quote non-ascii
+ letters. Thanks @jirutka for the patch.
-Tue Feb 19 04:26:29 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/psych/test_string.rb: test for change
- * configure.in: check whether backtrace(3) works well or not.
+Fri Jan 9 07:13:55 2015 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm_dump.c: set HAVE_BACKTRACE 0 if BROKEN_BACKTRACE.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: call `allocate` on hash
+ subclasses. Fixes github.com/tenderlove/psych/issues/196
-Mon Feb 18 16:30:18 2013 Akinori MUSHA <knu@iDaemons.org>
+ * test/psych/test_hash.rb: test for change
- * lib/ipaddr.rb (IPAddr#in6_addr): Fix a typo with the closing
- parenthesis.
+Fri Jan 9 06:58:43 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Feb 18 12:32:24 2013 Akinori MUSHA <knu@iDaemons.org>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: revive hashes with ivars
- * lib/ipaddr.rb (IPAddr#in6_addr): Fix the parser so that it can
- recognize IPv6 addresses with only one edge 16-bit piece
- compressed, like [::2:3:4:5:6:7:8] or [1:2:3:4:5:6:7::].
- [Bug #7477]
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dump hashes with ivars.
+ Fixes github.com/psych/issues/43
-Mon Feb 18 10:09:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/psych/test_hash.rb: test for change
- * configure.in (unexpand_shvar): regularize a shell variable by
- unexpanding shell variables in it.
+Thu Jan 8 17:05:00 2015 Seiei Higa <hanachin@gmail.com>
-Sun Feb 17 20:55:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (rb_method_entry): if no super class, no original
+ method entry. [ruby-core:67389] [Bug #10707]
- * compar.c (rb_invcmp): compare by inversed comparison, with preventing
- from infinite recursion. [ruby-core:52305] [Bug #7870]
+Thu Jan 8 16:31:43 2015 Seiei Higa <hanachin@gmail.com>
- * string.c (rb_str_cmp_m), time.c (time_cmp): get rid of infinite
- recursion.
+ * vm_method.c (rb_export_method): bail out if the original method
+ is undefined when the method is refined.
+ [ruby-core:67387] [Bug #10706]
-Sun Feb 17 17:23:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 8 12:53:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb: remove extra topdir in VPATH, which was in
- win32/Makefile.sub for some reason and moved from there.
- [ruby-dev:46998] [Bug #7864]
+ * dir.c (glob_helper): match in case-folding only if the directory
+ resides on a case-insensitive file system, on OSX.
+ [ruby-core:67364] [Bug #10700]
-Sun Feb 17 01:19:00 2013 Zachary Scott <zachary@zacharyscott.net>
+Thu Jan 8 11:39:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/psych/lib/psych/y.rb: Document Kernel#y by Adam Stankiewicz
- [Github tenderlove/psych#127]
+ * .travis.yml: Remove redundant configuration option.
+ [fix GH-809] Patch by @gxworld
-Sun Feb 17 00:52:14 2013 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jan 8 07:17:14 2015 Eric Wong <e@80x24.org>
- * tool/mkconfig.rb: remove prefix from rubyarchdir.
- r39267 expands variables, it changes expansion timing,
- breaks RbConfig::CONFIG["includedir"] and building
- extension libraries with installed ruby.
+ * lib/resolv.rb: consider ENETUNREACH as ResolvTimeout
+ [ruby-core:67411] [Bug #10712]
-Sat Feb 16 20:51:17 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+Thu Jan 8 00:13:52 2015 Tanaka Akira <akr@fsij.org>
- * vm.c (ENV_IN_HEAP_P): fix off-by-one error.
+ * lib/open3.rb: Open3 properly passes non-keyword hash args to spawn.
+ Fixed by Josh Cheek. [Fix GH-808]
+ Related to [ruby-core:67347] [Bug #10699]
-Sat Feb 16 20:47:16 2013 Akinori MUSHA <knu@iDaemons.org>
+Wed Jan 7 19:19:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (LIBRUBY_DLDFLAGS): Fix a bug where --with-opt-dir
- options given were not reflected to LIBRUBY_DLDFLAGS on many
- platforms including Linux and other GNU-based systems, NetBSD,
- AIX and BeOS.
+ * dir.c (dir_initialize): workaround of opendir failure at symlink
+ directories on Windows via CIFS.
-Sat Feb 16 20:43:20 2013 Tanaka Akira <akr@fsij.org>
+Wed Jan 7 18:52:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/ancdata.c (rsock_recvmsg): ignore truncated part of
- socket address returned from recvmsg().
+ * dir.c (need_normalization): not only HFS+, CIFS (SMB) is also
+ decomposed. [Bug #10704]
- * ext/socket/init.c (recvfrom_blocking): ignore truncated part of
- socket address returned from recvfrom().
- (rsock_s_recvfrom_nonblock): ditto.
+ * dir.c (NORMALIZE_UTF8PATH): Unicode decomposition seems to
+ perform in an upper layer than file systems on OSX, as all path
+ names are always decomposed regardless of file system types.
-Sat Feb 16 20:05:26 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+Tue Jan 6 21:41:04 2015 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_thread.rb: fixed typo
- patched by Hiroki Matsue via https://github.com/ruby/ruby/pull/248
+ * time.c (timelocalw): Set tm_isdst field -1 if vtm->isdst is
+ VTM_ISDST_INITVAL. This bug is introduced at packing struct
+ vtm (r45155).
+ [ruby-core:67345] [Bug #10698] Reported by Boris Ruf.
-Sat Feb 16 16:08:35 2013 Koichi Sasada <ko1@atdot.net>
+Tue Jan 6 03:10:54 2015 Koichi Sasada <ko1@atdot.net>
- * vm.c (rb_thread_mark): mark a working Proc of bmethod
- (a method defined by define_method) even if the method was removed.
- We could not trace working Proc object which represents the body
- of bmethod if the method was removed (alias/undef/overridden).
- Simply, it was mark miss.
- This patch by Kazuki Tsujimoto. [Bug #7825]
+ * test/fiddle/test_handle.rb: fix syntax.
- NOTE: We can brush up this marking because we do not need to mark
- `me' on each living control frame. We need to mark `me's
- only if `me' was free'ed. This is future work after Ruby 2.0.0.
+Tue Jan 6 00:16:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_method.rb: add a test.
+ * test/fiddle/test_handle.rb (test_NEXT): use -test-/dln/empty
+ which is always a shared object and is not used by others.
+ [ruby-dev:48629] [Bug #10384]
-Sat Feb 16 15:45:56 2013 Koichi Sasada <ko1@atdot.net>
+Mon Jan 5 14:58:01 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * proc.c (rb_binding_new_with_cfp): create binding object even if
- the frame is IFUNC. But return a ruby-level binding to keep
- compatibility.
- This patch fix degradation introduced from r39067.
- [Bug #7774] [ruby-dev:46960]
+ * test/ruby/test_io.rb: added timeout for AIX environment.
+ [ruby-core:62983][Bug #9917]
- * test/ruby/test_settracefunc.rb: add a test.
+Sun Jan 4 22:33:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Feb 16 13:40:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/lib/test/unit.rb (ExcludesOption): add "excludes" support
+ to test suite, for alternative implementations and platforms.
+ [Feature #10682]
- * configure.in (shvar_to_cpp): do not substitute exec_prefix itself
- with RUBY_EXEC_PREFIX, which cause recursive definition.
- [ruby-core:52296] [Bug #7860]
+Sun Jan 4 22:32:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Feb 16 13:13:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/lib/test/unit.rb (Test::Unit): reorder modules and merge
+ each modules.
- * ext/io/console/io-console.gemspec: bump to 0.4.2. now explicitly
- requires ruby 1.9.3 or later. [Bug #7847]
+ * test/lib/test/unit.rb (Test::Unit): split the large class into
+ each modules.
- * ext/io/console/console.c (console_dev): compatibility with ruby 1.8.
+Sun Jan 4 21:32:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/io/console/console.c (rawmode_opt, console_dev): compatibility
- with ruby 1.9. [ruby-core:52220] [Bug #7847]
+ * parse.y (f_label): return tLABEL value as it is.
+ [ruby-core:67315] [Bug #10693]
-Sat Feb 16 12:45:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jan 4 14:02:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: unexpand arch sitearch and exec_prefix values, so
- directly specified bindir, libdir, rubyprefix, etc can be properly
- substituted. [ruby-core:52296] [Bug #7860]
+ * test/lib/test/unit/parallel.rb (run): expand the file name to be
+ loaded, so that relative paths work in parallel mode.
-Sat Feb 16 12:15:20 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+Sun Jan 4 13:36:56 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * parse.y: add dtrace probe for symbol create.
+ * test/test_tempfile.rb: use assert_file for more descriptive message.
+ following r49131.
- * probes.d: ditto
+Sun Jan 4 13:05:09 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Feb 16 09:27:37 2013 Tanaka Akira <akr@fsij.org>
+ * string.c: improve docs for String#<=>. [ruby-core:65399][Feature #10322]
+ Patch by gogo tanaka.
- * ext/socket/extconf.rb: don't test sys/feature_tests.h which is not
- used now.
- It was included in r7901 as "bug of gcc 3.0 on Solaris 8 ?".
+Sun Jan 4 12:42:24 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Feb 16 09:24:37 2013 Tanaka Akira <akr@fsij.org>
+ * array.c: improve docs for Array#reject. [ruby-core:65324][misc #10307]
+ Patched by Nebu Pookins.
- * ext/socket/extconf.rb: reorder header tests to consider inclusion
- order in rubysocket.h.
+Sun Jan 4 12:24:11 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Feb 16 08:42:58 2013 Tanaka Akira <akr@fsij.org>
+ * string.c: improve docs for String#strip and variations.
+ [ruby-core:66081][Bug #10476]
- * configure.in, ext/socket/extconf.rb: test netinet/in_systm.h in
- ext/socket/extconf.rb instead of configure.in.
+Sun Jan 4 09:21:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- Originally, netinet/in_systm.h is included for NextStep, OpenStep,
- and Rhapsody. [ruby-core:1596]
+ * lib/drb/drb.rb: removed unused argument. Patch by @vipulnsward
+ [fix GH-515]
-Sat Feb 16 07:55:40 2013 Tanaka Akira <akr@fsij.org>
+Sun Jan 4 09:18:31 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * configure.in: don't test xti.h here.
+ * lib/tempfile.rb: provide default basename parameter.
+ [fix GH-523] Patch by @dissolved
+ * test/test_tempfile.rb: ditto.
- * ext/socket/extconf.rb: test xti.h here.
+Sun Jan 4 00:43:41 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- Originally, xti.h is included for IRIX [ruby-core:14447].
+ * README.ja.md: add guidance of mailing list and bugs.r-l.o.
-Sat Feb 16 07:16:49 2013 Tanaka Akira <akr@fsij.org>
+Sat Jan 3 23:56:28 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/socket/extconf.rb: test struct sockaddr_un and its member,
- sun_len.
+ * hash.c: fix docs for Hash#invert. [ruby-core:66917] [Bug #10612]
- * ext/socket/sockport.h (INIT_SOCKADDR_UN): new macro defined.
+Sat Jan 3 19:52:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (sock_s_pack_sockaddr_un): use INIT_SOCKADDR_UN.
+ * include/ruby/intern.h (rb_str_new_literal): define on all
+ platforms, not only gcc.
- * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
+Sat Jan 3 18:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/raddrinfo.c (init_unix_addrinfo): ditto.
- (addrinfo_mload): ditto.
+ * ext/fiddle/lib/fiddle/cparser.rb (parse_ctype): limit split word
+ number as the rest are not used.
-Sat Feb 16 07:05:59 2013 Tanaka Akira <akr@fsij.org>
+Sat Jan 3 18:19:50 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/sockport.h (INIT_SOCKADDR_IN): don't need family
- argument. it is always AF_INET.
+ * ext/fiddle/lib/fiddle/cparser.rb: r49110 broke Fiddle::Import with
+ type_alias.
+ * test/fiddle/test_cparser.rb: added type_alias test for parse_ctype
+ and parse_struct_signature.
- * ext/socket/raddrinfo.c (make_inetaddr): follow INIT_SOCKADDR_IN
- change.
- (addrinfo_ipv6_to_ipv4): ditto.
+Sat Jan 3 11:50:16 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Feb 16 04:21:07 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/ossl.h: avoid to build failure of Windows environment.
+ * ext/openssl/ossl_ssl_session.c: ditto.
- * ext/socket/extconf.rb: workaround for mswin/mingw build problem.
- sendmsg emulation in win32/win32.c is not enough.
+Sat Jan 3 11:27:46 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Feb 16 00:19:20 2013 Tanaka Akira <akr@fsij.org>
+ * array.c: Improve performance of Array#shift. use shared instead of
+ MEMMOVE if with arguments. Patch by @ksss [fix GH-537]
+ * test/ruby/test_array.rb: ditto.
+ * benchmark/bm_array_shift.rb: Added benchmark of GH-537 issue.
- * ext/socket/extconf.rb: use all all tested available headers for
- have_func.
+Sat Jan 3 10:38:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Feb 15 22:21:37 2013 Akinori MUSHA <knu@iDaemons.org>
+ * lib/net/http.rb: More descriptive error message when net/http fails
+ to connect to a server. Patch by @xaviershay [fix GH-700]
+ * test/net/http/test_http.rb: ditto.
- * configure.in: Fix a bug introduced in r38342 that the cflagspat
- substitution is messed up by the way CFLAGS and optflags are
- modified, which affected FreeBSD and NetBSD/amd64 when
- configured to use libexecinfo. This bug resulted in CFLAGS and
- CXXFLAGS in RbConfig::CONFIG having warnflags expanded in them,
- forcing third-party C/C++ extensions to follow what warnflags
- demands, like ANSI/ISO-C90 conformance. ref [Bug #7101]
+Sat Jan 3 10:14:51 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Feb 15 20:29:11 2013 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl.h: Make `SSL_SESSION_cmp` use `CRYPTO_memcmp`
+ [fix GH-591] Patch by @PiPeep
+ * ext/openssl/ossl_ssl_session.c: ditto.
- * ext/socket/sockport.h (SET_SIN_LEN): defined for strict-aliasing
- rule.
- (INIT_SOCKADDR_IN): ditto.
+Sat Jan 3 09:54:32 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/raddrinfo.c (make_inetaddr): use INIT_SOCKADDR_IN.
- (addrinfo_ipv6_to_ipv4): ditto.
+ * ext/fiddle/lib/fiddle/cparser.rb: Support for Fiddle::CParser
+ to handle rich signatures including parameter names and function
+ pointer types. Patch by @theryan [fix GH-590]
+ * test/fiddle/test_cparser.rb: ditto.
-Fri Feb 15 18:24:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 3 09:01:43 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/mkmf.rb (MakeMakefile#try_run): bail out explicitly if cross
- compiling, because it cannot work of course.
+ * NEWS: added compatibility entry of r49101.
-Fri Feb 15 12:34:58 2013 Tanaka Akira <akr@fsij.org>
+Fri Jan 2 21:06:59 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/extconf.rb: test struct sockaddr_storage directly.
+ * lib/net/http.rb (Net::HTTP#send_request): there is no response body
+ with HEAD request. Patch by @rodrigosaito [fix GH-520]
- * ext/socket/rubysocket.h: use HAVE_TYPE_STRUCT_SOCKADDR_STORAGE.
+Fri Jan 2 21:04:36 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Feb 15 12:26:13 2013 Tanaka Akira <akr@fsij.org>
+ * test/net/http/test_http.rb (_test_send_request__HEAD): Added
+ failing test for send_request with HEAD method.
- * ext/socket/getaddrinfo.c (GET_AI): don't cast 1st argument for
- INIT_SOCKADDR.
+Fri Jan 2 18:41:20 2015 Tanaka Akira <akr@fsij.org>
-Fri Feb 15 08:12:11 2013 Tanaka Akira <akr@fsij.org>
+ * eval.c (ruby_init): Print ruby_setup() error only in debug mode.
+ Unsuppressable error message is not a good idea.
+ Note that the message is printed sometimes with following
+ code (highly timing dependent, though):
+ pid = spawn("ruby -e ''"); Process.kill(:TERM, pid)
- * ext/socket/sockport.h (SET_SS_LEN): removed.
- (SET_SIN_LEN): removed.
- (INIT_SOCKADDR): new macro.
+Fri Jan 2 16:18:44 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/ancdata.c (extract_ipv6_pktinfo): use INIT_SOCKADDR.
+ * test/ruby/test_module.rb: Refactor invalid testcase.
+ [fix GH-472][ruby-core:59035][Bug #9240]
- * ext/socket/raddrinfo.c (make_inetaddr): use INIT_SOCKADDR.
- (addrinfo_ipv6_to_ipv4): ditto.
+Fri Jan 2 15:53:00 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/getaddrinfo.c (GET_AI): use INIT_SOCKADDR.
+ * lib/webrick/utils.rb: removed unused argument variable.
+ [fix GH-356] Patch by @vipulnsward
+ * lib/webrick/server.rb: ditto.
+ * lib/webrick/ssl.rb: ditto.
+ * test/webrick/test_utils.rb: added test for WEBrick::Utils#create_listeners.
-Fri Feb 15 07:49:27 2013 Eric Hodel <drbrain@segment7.net>
+Fri Jan 2 15:35:53 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rdoc.rb: Update to release version of 4.0.0
+ * lib/securerandom.rb: improve syntax and grammar of documentation.
+ [fix GH-796][ci skip] Patch by @Erol
- * lib/rubygems.rb: Update to release version of 2.0.0
+Fri Jan 2 15:10:01 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Feb 15 07:07:27 2013 Tanaka Akira <akr@fsij.org>
+ * test/openssl/test_ssl_session.rb (OpenSSL#test_ctx_client_session_cb):
+ fix test failure with OpenSSL disabled SSLv3 protocol.
+ [ruby-core:63772] [Bug #10046]
- * ext/socket/sockport.h (SA_LEN): removed because unused now.
- (SS_LEN): ditto.
- (SIN_LEN): ditto.
+Fri Jan 2 09:08:31 2015 Tanaka Akira <akr@fsij.org>
-Thu Feb 14 10:45:31 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/resolv.rb (Resolv::DNS::Label::Str#==): Check class equality.
+ (Resolv::DNS::Name#initialize): Normalize labels as
+ Resolv::DNS::Label::Str objects.
- * test/ruby/test_process.rb (test_setsid): Added a workaround for
- MacOS X. Patch by nagachika. [Bug #7826] [ruby-core:52126]
+Thu Jan 1 21:41:49 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Feb 15 00:15:31 2013 Tanaka Akira <akr@fsij.org>
+ * doc/regexp.rdoc: fix regexp docs for whitespace character.
+ [ruby-dev:48765] [Bug #10624]
- * ext/socket/sockport.h (VALIDATE_SOCKLEN): new macro to validate
- sa_len member of 4.4BSD socket address.
+Thu Jan 1 17:50:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/getnameinfo.c (getnameinfo): use VALIDATE_SOCKLEN,
- instead of SA_LEN.
+ * test/ruby/test_rubyoptions.rb: try locale encoding name.
+ [ruby-core:67109] [Bug #10643]
- * ext/socket/socket.c (sock_s_getnameinfo): use VALIDATE_SOCKLEN
- instead of SS_LEN.
+Thu Jan 1 11:07:12 2015 Eric Wong <e@80x24.org>
-Thu Feb 14 22:25:54 2013 Tanaka Akira <akr@fsij.org>
+ * symbol.c (rb_gc_free_dsymbol): delete from global fstr hash
+ * test/ruby/test_symbol.rb (test_symbol_fstr_leak): test for bug
+ [ruby-core:67268] [Bug #10686]
- * ext/socket/socket.c (sockaddr_len): extracted from sockaddr_obj.
- (sockaddr_obj): add an argument to length of socket address.
- (socket_s_ip_address_list): call sockaddr_obj with actual socket
- address length if given, use sockaddr_len otherwise.
+Thu Jan 1 09:14:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 14 20:11:23 2013 Tanaka Akira <akr@fsij.org>
+ * vm_args.c (keyword_hash_p): fix non-symbol keys hash.
+ rb_extract_keywords() returns 0 not Qnil when no symbol keys is
+ included. [ruby-core:67264] [Bug #10685]
- * ext/socket: always operate length of socket address companion with
- socket address.
+Wed Dec 31 17:48:43 2014 Tanaka Akira <akr@fsij.org>
- * ext/socket/rubysocket.h (rsock_make_ipaddr): add an argument for
- socket address length.
- (rsock_ipaddr): ditto.
+ * lib/resolv.rb (Resolv::DNS::Label::Str#initialize): Set encoding
+ ASCII-8BIT before downcase. case insensitivity of DNS labels doesn't
+ apply non-ASCII characters. [RFC 4343]
- * ext/socket/ipsocket.c (ip_addr): pass length to rsock_ipaddr.
- (ip_peeraddr): ditto.
- (ip_s_getaddress): pass length to rsock_make_ipaddr.
+Wed Dec 31 16:48:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (make_addrinfo): pass length to rsock_ipaddr.
- (sock_s_getnameinfo): pass actual address length to rb_getnameinfo.
- (sock_s_unpack_sockaddr_in): pass length to rsock_make_ipaddr.
+ * parse.y (gettable_gen): disable warnings of possible reference
+ to a local variable defined in a past scope.
+ [ruby-core:67162] [Bug #10661]
- * ext/socket/init.c (rsock_s_recvfrom): pass length to rsock_ipaddr.
- (rsock_s_recvfrom_nonblock): ditto.
+Wed Dec 31 13:43:48 2014 Tanaka Akira <akr@fsij.org>
- * ext/socket/tcpsocket.c (tcp_sockaddr): pass length to
- rsock_make_ipaddr.
+ * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str
+ objects. Label#Str#== is case-insensitive.
- * ext/socket/raddrinfo.c (make_ipaddr0): add an argument for socket
- address length. pass the length to rb_getnameinfo.
- (rsock_ipaddr): ditto.
- (rsock_make_ipaddr): add an argument for socket address length.
- pass the length to make_ipaddr0.
- (make_inetaddr): pass length to make_ipaddr0.
- a local variable renamed.
- (host_str): a local variable renamed.
- (port_str): ditto.
+Tue Dec 30 16:16:12 2014 Ben Miller <bmiller@rackspace.com>
-Thu Feb 14 14:31:43 2013 Eric Hodel <drbrain@segment7.net>
+ * lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the
+ comparison should be case-insensitive as well.
+ [ruby-core:66498] [Bug #10550]
- * lib/net/http.rb: Removed OpenSSL dependency from Net::HTTP.
+Tue Dec 30 16:03:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/net/http/test_http.rb: Remove Zlib dependency from tests.
- * test/net/http/test_http_request.rb: ditto.
+ * lib/resolv.rb (Resolv::DNS::Name): names with different dots
+ should be different.
-Thu Feb 14 11:08:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 30 13:16:56 2014 Martin Duerst <bernhard+git@lsmod.de>
- * class.c (include_modules_at): detect cyclic prepend with original
- method table. [ruby-core:52205] [Bug #7841]
+ * lib/uri/common.rb: Initialize HTML5ASCIIINCOMPAT to empty Array
+ to avoid error during bootstrap when encodings are not yet defined.
+ [Bug #10678]
-Thu Feb 14 10:30:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 30 09:29:26 2014 Bernhard M. Wiedemann <bernhard+git@lsmod.de>
- * vm_method.c: call method_removed hook on called class, not on
- prepending iclass. [ruby-core:52207] [Bug #7843]
+ * ext/dbm/dbm.c (Init_dbm): [DOC] as UNIX permissions are octal
+ numbers, needs to be prefixed by 0. [Fix GH-800]
-Thu Feb 14 10:05:57 2013 Eric Hodel <drbrain@segment7.net>
+Tue Dec 30 08:57:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/net/http: Do not handle Content-Encoding when the user sets
- Accept-Encoding. This allows users to handle Content-Encoding for
- themselves. This restores backwards-compatibility with Ruby 1.x.
- [ruby-trunk - Bug #7831]
- * lib/net/http/generic_request.rb: ditto.
- * lib/net/http/response.rb: ditto
- * test/net/http/test_http.rb: Test for the above.
- * test/net/http/test_http_request.rb: ditto.
- * test/net/http/test_httpresponse.rb: ditto.
+ * lib/unicode_normalize.rb: typo fix. [ci skip]
+ [ruby-dev:48794][misc #10675]
-Thu Feb 14 08:18:47 2013 Tanaka Akira <akr@fsij.org>
+Mon Dec 29 19:38:01 2014 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/socket/extconf.rb: don't define HAVE_SA_LEN and HAVE_SA_LEN.
- use HAVE_STRUCT_SOCKADDR_SA_LEN and HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
- instead.
+ * version.h (RUBY_VERSION): 2.3.0 development has started.
-Wed Feb 13 20:59:48 2013 Tanaka Akira <akr@fsij.org>
+Mon Dec 29 18:58:46 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/extconf.rb: don't define socklen_t here, just test.
+ * re.c (unescape_nonascii): append escape sequence as-is not
+ unescaped character, to get rid of unexpected meta-character.
+ [ruby-core:67193] [Bug #10670]
- * ext/socket/rubysocket.h: define socklen_t if not available.
+Mon Dec 29 14:27:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 13 18:37:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/syntax/literals.rdoc (Symbols): now Symbols created by
+ interpolation can be garbage collected. patch by Yihang Ho in
+ [ruby-core:67194]. [Bug #10671]
- * proc.c (mnew): skip prepending modules and return the method bound
- on the given class. [ruby-core:52160] [Bug #7836]
+Mon Dec 29 11:18:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 13 18:11:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_variable_get): fix dynamic symbol keys.
+ rb_check_id() returns non-zero only for static symbols, whereas
+ thread local variable keys can be dynamic symbols.
+ [ruby-core:67185] [Bug #10667]
- * proc.c (method_original_name): new methods Method#original_name and
- UnboundMethod#original_name. [ruby-core:52048] [Bug #7806]
- [EXPERIMENTAL]
+Mon Dec 29 10:37:27 2014 Thiago Lewin <thiago_lewin@yahoo.com.br>
- * proc.c (method_inspect): show the given name primarily, and
- original_id if aliased. [ruby-core:52048] [Bug #7806]
+ * io.c (rb_f_select): [DOC] workaround for YARD doc. [Fix GH-799]
-Wed Feb 13 17:56:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (proc_detach): [DOC] fix missing closing parenthesis.
+ [Fix GH-799]
- * configure.in (warnflags): disable -Werror by default unless
- development. [ruby-core:52131] [Bug #7830]
+Mon Dec 29 07:27:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Feb 13 06:05:52 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/json, test/json: merge JSON HEAD(17fe8e7)
+ https://github.com/flori/json/compare/v1.8.1...17fe8e7
- * lib/rubygems.rb: Return BINARY strings from Gem.gzip and Gem.gunzip.
- Fixes intermittent test failures. RubyGems issue #450 by Jeremey
- Kemper.
- * test/rubygems/test_gem.rb: Test for the above.
+Sun Dec 28 23:49:37 2014 Michal Papis <mpapis@gmail.com>
-Wed Feb 13 05:49:21 2013 Tanaka Akira <akr@fsij.org>
+ * rbinstall.rb: fix target location for installing bundled gems.
+ install to the prepared directory instead of default Gem.dir,
+ not to be affected GEM_HOME environment variable. [Fix GH-798]
- * ext/socket/extconf.rb: test functions just after struct members.
+Sun Dec 28 18:19:28 2014 Eric Wong <e@80x24.org>
-Tue Feb 12 12:02:35 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/-ext-/iseq_load/test_iseq_load.rb
+ (test_next_in_block_in_block): test using ISeq#eval
+ (test_break_ensure): ditto
+ [ruby-core:66988]
- * ext/json: merge JSON 1.7.7.
- This includes security fix. [CVE-2013-0269]
- https://github.com/flori/json/commit/d0a62f3ced7560daba2ad546d83f0479a5ae2cf2
- https://groups.google.com/d/topic/rubyonrails-security/4_YvCpLzL58/discussion
+Sun Dec 28 16:25:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 11 23:08:48 2013 Tanaka Akira <akr@fsij.org>
+ * cygwin/GNUmakefile.in (EXTOBJS): override to add resource files
+ always. [ruby-core:67153] [Bug #10657]
- * configure.in: enable rb_cv_page_size_log test for MirOS BSD.
+Sun Dec 28 13:54:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 11 20:06:38 2013 Tanaka Akira <akr@fsij.org>
+ * parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and
+ keywords bits arguments should be unique. since internal IDs
+ depend on the local variable index in the current scope, new ID
+ should be made before popping those vtables.
+ [ruby-core:67157] [Bug #10659]
- * configure.in: use -pthread on mirbsd*.
+Sat Dec 27 20:12:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 11 16:07:09 2013 Tanaka Akira <akr@fsij.org>
+ * ext/json/generator/generator.c (JSON_Generator_State_type): add
+ #ifdef for backward compatibility.
- * configure.in: add SOLIBS and LIBRUBY_SO definition for mirbsd*.
+ * ext/json/parser/parser.rl (JSON_Parser_type): ditto.
-Mon Feb 11 13:17:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/json/generator/generator.h (ZALLOC): add fallback definition.
- * configure.in (rubysitearchprefix): sitearchdir and vendorarchdir
- should use sitearch, not arch. [ruby-dev:46964] [Bug #7823]
+ * ext/json/parser/parser.h (ZALLOC): ditto.
- * win32/Makefile.sub (config.status): site and vendor directories
- should use sitearch, not arch. [ruby-dev:46964] [Bug #7823]
+Sat Dec 27 16:54:05 2014 Tanaka Akira <akr@fsij.org>
-Mon Feb 11 12:31:25 2013 Tanaka Akira <akr@fsij.org>
+ * process.c: Unused code removed.
+ It seems waitpid() is universally available on POSIX platforms.
- * configure.in: move OS specific header/function knowledge before
- automatic header tests.
+Sat Dec 27 15:08:27 2014 Eric Wong <e@80x24.org>
-Mon Feb 11 11:04:29 2013 Tanaka Akira <akr@fsij.org>
+ * vm_core.h (rb_vm_living_threads_insert): preserve order
+ [Bug #10660] [ruby-core:67154] [ruby-core:67159]
- * configure.in: move the test for -march=i486 just after
- RUBY_UNIVERSAL_ARCH/RUBY_DEFAULT_ARCH.
+Sat Dec 27 13:08:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Feb 10 23:42:26 2013 Tanaka Akira <akr@fsij.org>
+ * ext/socket/socket.c: improved document for YARD doc.
+ [fix GH-795][ci skip] Patch by @tlewin
- * ext/socket/extconf.rb: test structure members just after types test.
+Sat Dec 27 10:11:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Feb 10 20:58:17 2013 Tanaka Akira <akr@fsij.org>
+ * ext/tk/lib/tkextlib/tcllib/plotchart.rb: fix to invoke correct function
+ of tcllib. Patch by @zalt50 [fix GH-787]
- * ext/socket/extconf.rb: test types just after headers test.
+Sat Dec 27 10:03:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Feb 10 16:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * tool/make-snapshot: show sha1 digest when making packages.
+ it's request from https://github.com/ruby/www.ruby-lang.org/issues/921
+ [fix GH-794]
- * lib/rake/doc/MIT-LICENSE: Add license file from upstream
- * lib/rake/doc/README.rdoc: Link to license file from Rake README
- * lib/rake/version.rb: Include README rdoc for Rake module overview
+Fri Dec 26 15:32:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 10 15:26:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/tk/tcltklib.c (ip_invoke_core): remove probably duplicate
+ dead code.
- * lib/rake/doc/*: Sync Rake rdoc files from upstream
+Fri Dec 26 15:28:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 10 15:50:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/tk/tcltklib.c (ip_ruby_cmd_receiver_const_get): simply use
+ rb_path2class() to get a class/module from its name.
- * vm_exec.h (DISPATCH_ARCH_DEPEND_WAY): use __asm__ __volatile__
- instead of asm volatile.
+Fri Dec 26 15:20:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 10 15:50:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * marshal.c (w_long): append at once by w_nbyte() instead of
+ appending byte by byte.
- * gc.h (SET_MACHINE_STACK_END): use __volatile__ instead of volatile.
+Fri Dec 26 15:13:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 10 14:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/json/parser/parser.rl (unescape_unicode): check if valid
+ before bit-or assignments.
+ reported by Denis Denisov <denji0k AT gmail.com>.
- * doc/rake/, lib/rake/doc/: Move Rake rdoc files to lib/rake
+ * ext/nkf/nkf-utf8/nkf.c (nkf_iconv_t): fix a missing semicolon.
+ reported by Denis Denisov <denji0k AT gmail.com>.
-Sun Feb 10 12:10:25 2013 Tanaka Akira <akr@fsij.org>
+ * process.c (rb_spawn_process): get rid of usage of uninitialized
+ variable.
+ reported by Denis Denisov <denji0k AT gmail.com>.
- * ext/socket/extconf.rb: test headers at first.
+ * regexec.c (match_at): ditto.
-Sun Feb 10 12:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * ext/win32ole/win32ole.c (ole_wc2mb_alloc, ole_vstr2wc, ole_mb2wc):
+ ditto.
- * doc/rake/*: Removed stale Rake static files
+ * dir.c (ruby_glob0): no need to check never-NULL pointer.
+ reported by Denis Denisov <denji0k AT gmail.com>.
-Sun Feb 10 09:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * win32/file.c (rb_file_expand_path_internal): ditto.
- * lib/pp.rb, lib/prettyprint.rb: Documentation for PP and PrettyPrint
- Based on a patch by Vincent Batts [ruby-core:51253] [Bug #7656]
+ * win32/file.c (code_page_i): handle realloc failure.
+ reported by Denis Denisov <denji0k AT gmail.com>.
-Sat Feb 9 21:11:21 2013 Tanaka Akira <akr@fsij.org>
+ * win32/stub.c (stub_sysinit): ditto.
- * configure.in: move header files check to the beginning of
- "header and library section".
- test rlim_t with sys/types.h and sys/time.h for MirOS BSD.
- sys/types.h and sys/time.h is guarded by #ifdef and the above
- move is required for this change.
+ * fix printf format conversion specifiers.
+ reported by Denis Denisov <denji0k AT gmail.com>.
-Sat Feb 9 17:45:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 26 01:41:40 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in, version.c: prevent duplicated load paths by empty
- version string, it does not work right now.
+ * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable.
+ [Bug #10647] [ruby-dev:48787]
-Sat Feb 9 17:38:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 26 01:24:42 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in: fix arch parameters in help message. [Bug #7804]
+ * tool/downloader.rb: support old versions of ruby.
-Sat Feb 9 13:13:00 2013 Zachary Scott <zachary@zacharyscott.net>
+ * tool/downloader.rb: now can download gems by http if openssl is not
+ available (this may be danger!)
- * vm_trace.c: Note about TracePoint events set, and comment on
- Kernel#set_trace_func to prefer new TracePoint API
+Fri Dec 26 00:13:48 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Feb 9 10:07:47 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+ * test/ruby/test_extlibs.rb: check existence of extension libraries
+ which not depend on outer libraries. (experimental)
- * BSDL: update copyright notice for 2013.
+Thu Dec 25 21:58:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Feb 9 09:24:38 2013 Eric Hodel <drbrain@segment7.net>
+ * ext/fiddle/extconf.rb: make PIC objects if it will be linked as
+ a shared object eventually. [ruby-core:67128]
- * lib/rubygems/package/old.rb: Fix behavior only on ruby 1.8.
+Thu Dec 25 19:01:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rubygems/package.rb: Include checksums.yaml.gz signatures for
- verification.
- * test/rubygems/test_gem_package.rb: Test for the above.
+ * ext/fiddle/win32/libffi-3.2.1-mswin.patch: support mswin32.
-Sat Feb 9 01:23:24 2013 Tanaka Akira <akr@fsij.org>
+Thu Dec 25 17:30:40 2014 Naohisa Goto <ngotogenome@gmail.com>
- * test/fiddle/helper.rb: specify libc and libm locations for MirOS BSD.
+ * gc.c (wmap_final_func): fix memory size shortage when realloc wmap.
+ Fix SEGV during finalize of WeakRef on Solaris (though the SEGV
+ could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646]
- * test/dl/test_base.rb: ditto.
+Thu Dec 25 17:27:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 8 23:25:33 2013 Tanaka Akira <akr@fsij.org>
+ * configure.in (NET_LUID): include winsock2.h instead of windows.h.
+ patch by Jon Forums in [ruby-core:67125]. [Bug #10640]
- * configure.in: change CFLAGS temporally to test
- ARCH_FLAG="-march=i486".
+Thu Dec 25 16:14:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 8 21:19:41 2013 Tanaka Akira <akr@fsij.org>
+ * ext/io/console/console.c (console_dev): send the given arguments
+ to the opened console. as a special case, do nothing if :close
+ is given.
- * configure.in: don't define ARCH_FLAG="-march=i486" if it causes
- compilation problem.
+ * test/lib/leakchecker.rb (LeakChecker#check_fd_leak): close if
+ console.
+For the changes before 2.2.0, see doc/ChangeLog-2.2.0
+For the changes before 2.1.0, see doc/ChangeLog-2.1.0
For the changes before 2.0.0, see doc/ChangeLog-2.0.0
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/KNOWNBUGS.rb b/KNOWNBUGS.rb
index b97a08d928..35a8e75876 100644
--- a/KNOWNBUGS.rb
+++ b/KNOWNBUGS.rb
@@ -1,5 +1,7 @@
#
-# This test file concludes tests which point out known bugs.
+# IMPORTANT: Always keep the first 7 lines (comments),
+# even if this file is otherwise empty.
+#
+# This test file includes tests which point out known bugs.
# So all tests will cause failure.
#
-
diff --git a/LEGAL b/LEGAL
index 65706459cd..2607f0082a 100644
--- a/LEGAL
+++ b/LEGAL
@@ -5,6 +5,37 @@ All the files in this distribution are covered under either the Ruby's
license (see the file COPYING) or public-domain except some files
mentioned below.
+ccan/build_assert/build_assert.h
+ccan/check_type/check_type.h
+ccan/container_of/container_of.h
+ccan/str/str.h
+
+ These files are licensed under the CC0.
+
+ http://creativecommons.org/choose/zero/
+
+ccan/list/list.h
+
+ This file is licensed under the MIT License.
+
+ 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.
+
include/ruby/oniguruma.h:
regcomp.c:
regenc.[ch]:
@@ -56,7 +87,7 @@ http://www.geocities.jp/kosako3/oniguruma/
http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/
http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
- When this software is partly used or it is distributed with Ruby,
+ When this software is partly used or it is distributed with Ruby,
this of Ruby follows the license of Ruby.
configure:
@@ -98,7 +129,7 @@ tool/config.sub:
parse.c:
- This file is licensed under the GPL, but is incorporated into Ruby and
+ This file is licensed under the GPL, but is incorporated into Ruby and
redistributed under the terms of the Ruby license, as permitted by the
exception to the GPL below.
@@ -193,11 +224,11 @@ random.c
This is a faster version by taking Shawn Cokus's optimization,
Matthe Bellew's simplification, Isaku Wada's real version.
- Before using, initialize the state by using init_genrand(seed)
+ Before using, initialize the state by using init_genrand(seed)
or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
+ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -210,8 +241,8 @@ random.c
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
+ 3. The names of its contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -231,6 +262,36 @@ random.c
http://www.math.keio.ac.jp/matumoto/emt.html
email: matumoto@math.keio.ac.jp
+vm_dump.c:procstat_vm
+
+ This file is under the new-style BSD license.
+
+ Copyright (c) 2007 Robert N. M. Watson
+ 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.
+
+ $FreeBSD: head/usr.bin/procstat/procstat_vm.c 261780 2014-02-11 21:57:37Z jhb $
+
vsnprintf.c:
This file is under the old-style BSD license. Note that the
@@ -364,30 +425,30 @@ missing/strlcpy.c
These files are under the new-style BSD license.
- Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- All rights reserved.
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ 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.
- 3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED ``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 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.
+ 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.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED ``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 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.
missing/langinfo.c
@@ -476,7 +537,7 @@ ext/nkf/nkf-utf8/utf8tbl.c:
copyrighted semi-public-domain software.
Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA)
- Everyone is permitted to do anything on this program
+ Everyone is permitted to do anything on this program
including copying, modifying, improving,
as long as you don't try to pretend that you wrote it.
i.e., the above copyright notice has to appear in all copies.
@@ -527,7 +588,7 @@ ext/win32ole/win32ole.c:
Other modifications Copyright (c) 1997, 1998 by Gurusamy Sarathy
<gsar@umich.edu> and Jan Dubois <jan.dubois@ibm.net>
-
+
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 Perl distribution.
diff --git a/Makefile.in b/Makefile.in
index d3313bea2e..ff475091ab 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
SHELL = /bin/sh
NULLCMD = @NULLCMD@
n=$(NULLCMD)
-ECHO1 = $(V:1=@$n)
+ECHO1 = $(V:1=$n)
RUNCMD = $(SHELL)
CDPATH = .
CHDIR = @CHDIR@
@@ -22,9 +22,11 @@ LD = @LD@
YACC = bison
PURIFY =
AUTOCONF = autoconf
+CONFIGURE = @CONFIGURE@
@SET_MAKE@
MKFILES = @MAKEFILES@
BASERUBY = @BASERUBY@
+HAVE_BASERUBY = @HAVE_BASERUBY@
TEST_RUNNABLE = @TEST_RUNNABLE@
CROSS_COMPILING = @CROSS_COMPILING@
DOXYGEN = @DOXYGEN@
@@ -50,14 +52,15 @@ DOCTARGETS = @RDOCTARGET@ @CAPITARGET@
EXTOUT = @EXTOUT@
arch_hdrdir = $(EXTOUT)/include/$(arch)
-VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
+VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/missing
empty =
CC_VERSION = @CC_VERSION@
OUTFLAG = @OUTFLAG@$(empty)
COUTFLAG = @COUTFLAG@$(empty)
ARCH_FLAG = @ARCH_FLAG@
-CFLAGS = @CFLAGS@ $(ARCH_FLAG)
+CFLAGS_NO_ARCH = @CFLAGS@
+CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG)
cflags = @cflags@
optflags = @optflags@
debugflags = @debugflags@
@@ -89,7 +92,6 @@ 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)
@@ -112,8 +114,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
XRUBY_LIBDIR = @XRUBY_LIBDIR@
XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
-
-DEFAULT_PRELUDES = $(GEM_PRELUDE)
+BOOTSTRAPRUBY = @BOOTSTRAPRUBY@
#### End of system configuration section. ####
@@ -131,12 +132,26 @@ LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
LIBRUBY_RELATIVE = @LIBRUBY_RELATIVE@
LIBRUBY_A_OBJS = @LIBRUBY_A_OBJS@
+DTRACE_REBUILD_OBJS = $(DTRACE_REBUILD:yes=$(DTRACE_DEPENDENT_OBJS))
+
+DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
+ eval.$(OBJEXT) \
+ gc.$(OBJEXT) \
+ hash.$(OBJEXT) \
+ load.$(OBJEXT) \
+ object.$(OBJEXT) \
+ parse.$(OBJEXT) \
+ string.$(OBJEXT) \
+ symbol.$(OBJEXT) \
+ vm.$(OBJEXT)
+
THREAD_MODEL = @THREAD_MODEL@
PREP = @PREP@
ARCHFILE = @ARCHFILE@
SETUP =
EXTSTATIC = @EXTSTATIC@
+ENCSTATIC = @ENCSTATIC@
SET_LC_MESSAGES = env LC_MESSAGES=C
MAKEDIRS = @MKDIR_P@
@@ -160,8 +175,9 @@ VCS = @VCS@
VCSUP = @VCSUP@
DTRACE = @DTRACE@
DTRACE_EXT = @DTRACE_EXT@
-DTRACE_OBJ = @DTRACE_OBJ@
-DTRACE_GLOMMED_OBJ = @DTRACE_GLOMMED_OBJ@
+DTRACE_OBJ = @DTRACE_OBJ@
+DTRACE_REBUILD= @DTRACE_REBUILD@
+DTRACE_GLOMMED_OBJ = $(DTRACE_REBUILD:yes=ruby-glommed.$(OBJEXT))
OBJEXT = @OBJEXT@
ASMEXT = S
@@ -171,10 +187,9 @@ SYMBOL_PREFIX = @SYMBOL_PREFIX@
INSTALLED_LIST= .installed.list
-MKMAIN_CMD = mkmain.sh
-
-NEWLINE_C = newline.c
+NEWLINE_C = enc/trans/newline.c
MINIPRELUDE_C = miniprelude.c
+PRELUDE_C = prelude.c
RBCONFIG = .rbconfig.time
SRC_FILE = $<
@@ -187,6 +202,8 @@ MESSAGE_END = ; do echo "$$line"; done
ECHO_BEGIN = @sep=''; for word in
ECHO_END = ; do echo @ECHO_N@ "$$sep'$$word'@ECHO_C@"; sep=' '; done; echo
+DESTDIR = @DESTDIR@
+
configure_args = @configure_args@
#### End of variables
@@ -194,15 +211,13 @@ configure_args = @configure_args@
all:
-.DEFAULT: all
-
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
miniruby$(EXEEXT):
@-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(DTRACE_OBJ) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@$(RM) $@
@@ -216,7 +231,7 @@ $(PROGRAM):
$(LIBRUBY_A):
@$(RM) $@
$(ECHO) linking static-library $@
- $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(DMYEXT)
+ $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(INITOBJS)
@-$(RANLIB) $@ 2> /dev/null || true
$(ECHO) verifying static-library $@
@$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT)
@@ -225,20 +240,28 @@ $(LIBRUBY_A):
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
- $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(DTRACE_OBJ) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
- -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
+ -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
+ -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
$(Q) $(POSTLINK)
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link rescue nil; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
-$(arch)-fake.rb: config.status $(srcdir)/template/fake.rb.in
- @./config.status --file=$@:$(srcdir)/template/fake.rb.in
- @chmod +x $@
ruby_pc = @ruby_pc@
$(ruby_pc):
@./config.status --file=$@:$(srcdir)/template/ruby.pc.in
+ruby-runner.c: template/ruby-runner.c.in
+ @./config.status --file=$@:$(srcdir)/template/$(@F).in
+
+ruby-runner$(EXEEXT): ruby-runner.c
+ $(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(RUBY_INSTALL_NAME) $(LDFLAGS) $(LIBS) $(OUTFLAG)$@ ruby-runner.c
+
+$(RBCONFIG): $(PREP)
+
+rbconfig.rb: $(RBCONFIG)
+
install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
$(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
$(ECHO) installing cross-compiling stuff
@@ -258,7 +281,7 @@ install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/confi
Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
-$(MKFILES): config.status
+$(MKFILES): config.status $(srcdir)/version.h
@[ -f $@ ] && mv $@ $@.old
MAKE=$(MAKE) $(SHELL) ./config.status $@
@cmp $@ $@.old > /dev/null 2>&1 && echo $@ unchanged && exit 0; \
@@ -274,18 +297,18 @@ uncommon.mk: $(srcdir)/common.mk
sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
.PHONY: reconfig
-reconfig-args = $(srcdir)/configure $(configure_args)
+reconfig-args = $(srcdir)/$(CONFIGURE) $(configure_args)
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-0 = test -t 1 && { CONFIGURE_TTY=yes; export CONFIGURE_TTY; }; exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3 3>&- 4>&-`
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))
-$(srcdir)/configure: $(srcdir)/configure.in
- $(CHDIR) $(srcdir) && exec $(AUTOCONF)
+$(srcdir)/$(CONFIGURE): $(srcdir)/configure.in $(srcdir)/aclocal.m4
+ $(CHDIR) $(srcdir) && exec $(AUTOCONF) -o $(@F)
incs: id.h
all-incs: probes.h
@@ -304,7 +327,9 @@ lex.c: defs/keywords
$(CP) $(srcdir)/lex.c.blt $@; \
else \
[ $(Q) ] && echo generating $@ || set -x; \
- gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
+ gperf -C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? \
+ | sed 's/(long)&((\(struct stringpool_t\) *\*)0)->\(stringpool_[a-z0-9]*\)/offsetof(\1, \2)/g' \
+ > $@.tmp && \
$(MV) $@.tmp $@ && \
$(CP) $? $(srcdir)/defs/lex.c.src && \
$(CP) $@ $(srcdir)/lex.c.blt; \
@@ -329,6 +354,22 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
$(CP) $@ $(?:.kwd=.h.blt); \
fi
+JIS_PROPS_OPTIONS = -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property
+
+enc/jis/props.h: enc/jis/props.kwd
+ $(MAKEDIRS) $(@D)
+ @set +e; \
+ if cmp -s $(?:.kwd=.src) $?; then \
+ set -x; \
+ $(CP) $(?:.kwd=.h.blt) $@; \
+ else \
+ set -x; \
+ gperf $(JIS_PROPS_OPTIONS) $? | \
+ sed 's/(int)(long)&((\([a-zA-Z_0-9 ]*[a-zA-Z_0-9]\) *\*)0)->\([a-zA-Z0-9_]*\),/(char)offsetof(\1, \2),/g' > $@ && \
+ $(CP) $? $(?:.kwd=.src) && \
+ $(CP) $@ $(?:.kwd=.h.blt); \
+ fi
+
.c.@OBJEXT@:
@$(ECHO) compiling $<
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
@@ -348,32 +389,31 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
.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) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/RUBY_PROBES_H/' -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
+probes.stamp: $(DTRACE_REBUILD_OBJS)
+ $(Q) if test -f $@ -o -f probes.$(OBJEXT); then \
+ $(RM) $(DTRACE_REBUILD_OBJS) $@; \
+ $(ECHO0) "rebuilding objects which were modified by \"dtrace -G\""; \
+ $(MAKE) $(DTRACE_REBUILD_OBJS); \
+ fi
+ $(Q) touch $@
+
+probes.@OBJEXT@: $(srcdir)/probes.d $(DTRACE_REBUILD:yes=probes.stamp)
@$(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)
+ $(Q) $(RM) $@
+ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_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)
+ $(Q) $(LD) -r -o $@ $(OBJS)
clean-local::
$(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
@@ -390,7 +430,7 @@ clean-ext distclean-ext realclean-ext::
@cd ext 2>/dev/null || exit 0; set dummy `echo "${EXTS}" | tr , ' '`; shift; \
test "$$#" = 0 && set .; \
set dummy `\
- find "$$@" -name Makefile -print | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \
+ find "$$@" -name Makefile -print | sed 's:^\./::;s:/Makefile$$::' | sort; \
`; shift; \
cd ..; \
for dir do \
@@ -408,24 +448,12 @@ distclean-ext realclean-ext::
-$(Q)$(RMDIR) ext 2> /dev/null || true
clean-extout:
- -$(Q)$(RMDIRS) $(EXTOUT) 2> /dev/null || true
clean-enc distclean-enc realclean-enc:
@test -f "$(ENC_MK)" || exit 0; \
echo $(@:-enc=ing) encodings; \
exec $(MAKE) -f $(ENC_MK) $(MFLAGS) $(@:-enc=)
-clean-rdoc distclean-rdoc realclean-rdoc:
- @echo $(@:-rdoc=ing) rdoc
- $(Q)$(RMALL) $(RDOCOUT)
-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
@@ -435,36 +463,80 @@ enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
up::
@$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
-up::
- -$(Q)$(MAKE) $(MFLAGS) after-update
-
-after-update:: update-config_files
+after-update:: update-config_files common-srcs
update-mspec:
@$(CHDIR) $(srcdir); \
if [ -d spec/mspec ]; then \
- cd spec/mspec; \
echo updating mspec ...; \
+ $(Q1:0=:) set -x; \
+ cd spec/mspec && \
exec git pull; \
else \
echo retrieving mspec ...; \
+ $(Q1:0=:) set -x; \
exec git clone $(MSPEC_GIT_URL) spec/mspec; \
fi
update-rubyspec: update-mspec
@$(CHDIR) $(srcdir); \
if [ -d spec/rubyspec ]; then \
- cd spec/rubyspec; \
echo updating rubyspec ...; \
+ $(Q1:0=:) set -x; \
+ cd spec/rubyspec && \
exec git pull; \
else \
echo retrieving rubyspec ...; \
+ $(Q1:0=:) set -x; \
exec git clone $(RUBYSPEC_GIT_URL) spec/rubyspec; \
fi
test-rubyspec-precheck:
@if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
+update-doclie:
+ @$(CHDIR) $(srcdir); \
+ if [ -d coverage/doclie ]; then \
+ echo updating doclie ...; \
+ $(Q1:0=:) set -x; \
+ cd coverage/doclie && \
+ git fetch && \
+ exec git checkout $(DOCLIE_GIT_REF); \
+ else \
+ echo retrieving doclie ...; \
+ $(Q1:0=:) set -x; \
+ exec git clone --branch $(DOCLIE_GIT_REF) $(DOCLIE_GIT_URL) coverage/doclie; \
+ fi
+
+update-simplecov-html:
+ @$(CHDIR) $(srcdir); \
+ if [ -d coverage/simplecov-html ]; then \
+ echo updating simplecov-html ...; \
+ $(Q1:0=:) set -x; \
+ cd coverage/simplecov-html && \
+ git fetch && \
+ exec git checkout $(SIMPLECOV_HTML_GIT_REF); \
+ else \
+ echo retrieving simplecov-html ...; \
+ exec git clone --branch $(SIMPLECOV_HTML_GIT_REF) $(SIMPLECOV_HTML_GIT_URL) coverage/simplecov-html; \
+ fi
+
+update-simplecov:
+ @$(CHDIR) $(srcdir); \
+ if [ -d coverage/simplecov ]; then \
+ echo updating simplecov ...; \
+ $(Q1:0=:) set -x; \
+ cd coverage/simplecov && \
+ git fetch && \
+ exec git checkout $(SIMPLECOV_GIT_REF); \
+ else \
+ echo retrieving simplecov ...; \
+ $(Q1:0=:) set -x; \
+ exec git clone --branch $(SIMPLECOV_GIT_REF) $(SIMPLECOV_GIT_URL) coverage/simplecov; \
+ fi
+
+update-coverage: update-simplecov update-simplecov-html update-doclie
+
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
vmtc.inc vm.inc
@@ -474,6 +546,8 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \
$(ECHO) generating $@
$(Q) $(BASERUBY) -Ku $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
+verconf.h: $(RBCONFIG)
+
loadpath: verconf.h
@$(CPP) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/loadpath.c | \
sed -e '1,/^const char ruby_initial_load_paths/d;/;/,$$d' \
diff --git a/NEWS b/NEWS
index 59251a40cf..be722bc9de 100644
--- a/NEWS
+++ b/NEWS
@@ -1,373 +1,404 @@
# -*- rdoc -*-
-= NEWS for Ruby 2.1.0
+= NEWS for Ruby 2.3.0
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.
+with all sufficient information, see the ChangeLog file or Redmine
+(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>)
-== Changes since the 2.0.0 release
+== Changes since the 2.2.0 release
=== Language changes
-* Now the default values of keyword arguments can be omitted. Those
- "required keyword arguments" need giving explicitly at the call time.
+* frozen-string-literal pragma:
-* Added suffixes for integer and float literals: 'r', 'i', and 'ri'.
- * "42r" and "3.14r" are evaluated as Rational(42, 1) and 3.14.rationalize,
- respectively. But exponential form with 'r' suffix like "6.022e+23r" is
- not accepted because it is misleading.
- * "42i" and "3.14i" are evaluated as Complex(0, 42) and Complex(0, 3.14),
- respectively.
- * "42ri" and "3.14ri" are evaluated as Complex(0, 42r) and Complex(0, 3.14r),
- respectively.
+ * new pragma, frozen-string-literal has been experimentally introduced.
+ [Feature #8976]
+ * besides, --enable/--disable=frozen-string-literal options also have
+ been introduced. [Feature #8976]
+ * command line options --debug or --debug=frozen-string-literal enable
+ additional debugging mode which shows created location with at frozen
+ object error (RuntimeError).
+ [Feature #11725]
-* def-expr now returns the symbol of its name instead of nil.
+* safe navigation operator:
+
+ * new method call syntax, `object&.foo', method #foo is called on
+ `object' if it is not nil.
+ this is similar to `try!' in Active Support, except:
+ * method name is syntactically required
+ obj.try! {} # valid
+ obj&. {} # syntax error
+ * arguments are evaluated only if a call is made:
+ obj.try!(:foo, bar()) # bar() is always evaluated
+ obj&.foo(bar()) # bar() is conditionally evaluated
+ * attribute assignment is valid
+ obj&.attr += 1
+ [Feature #11537]
+
+* the did_you_mean gem:
+
+ * When a NameError or NoMethodError occurs because of a typo in the name,
+ the did_you_mean gem automatically suggests other names similar to the
+ method name.
+
+ "Yuki".starts_with?("Y")
+ # => NoMethodError: undefined method `starts_with?' for "Yuki":String
+ # Did you mean? start_with?
+
+* indented here document:
+
+ * new string literal, here document starts with `<<~`.
+ refer doc/syntax/literals.rdoc for more details.
+ [Feature #9098]
=== Core classes updates (outstanding ones only)
+* ARGF
+
+ * ARGF.read_nonblock supports `exception: false' like IO#read_nonblock.
+ [Feature #11358]
+
* Array
- * New methods
- * Array#to_h converts an array of key-value pairs into a Hash.
-* Binding
- * New methods
- * Binding#local_variable_get(symbol)
- * Binding#local_variable_set(symbol, obj)
- * Binding#local_variable_defined?(symbol)
+ * Array#bsearch_index [Feature #10730]
+ * Array#dig [Feature #11643]
+
+* Comparable
+
+ * Comparable#== no longer rescues exceptions [Feature #7688]
+
+* Encoding
+
+ * new Encoding::IBM037 (alias ebcdic-cp-us; dummy)
* Enumerable
- * New methods
- * Enumerable#to_h converts a list of key-value pairs into a Hash.
-
-* Exception
- * New methods
- * Exception#cause provides the previous exception which has been caught
- at where raising the new exception.
-
-* GC
- * improvements:
- * introduced the generational GC a.k.a RGenGC.
- * added environment variables:
- * RUBY_GC_HEAP_INIT_SLOTS
- * RUBY_GC_HEAP_FREE_SLOTS
- * RUBY_GC_HEAP_GROWTH_FACTOR
- * RUBY_GC_HEAP_GROWTH_MAX_SLOTS
- * RUBY_GC_MALLOC_LIMIT_MAX
- * RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR
- * RUBY_GC_OLDMALLOC_LIMIT
- * RUBY_GC_OLDMALLOC_LIMIT_MAX
- * RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR
- * obsoleted environment variables:
- * RUBY_FREE_MIN (Use RUBY_GC_HEAP_FREE_SLOTS instead)
- * RUBY_HEAP_MIN_SLOTS (Use RUBY_GC_HEAP_INIT_SLOTS instead)
-
-* Integer
- * New methods
- * Fixnum#bit_length
- * Bignum#bit_length
- * Bignum performance improvement
- * Use GMP if available.
- GMP is used only for several operations:
- multiplication, division, radix conversion, GCD
+
+ * Enumerable#grep_v is added as inverse version of Enumerable#grep.
+ [Feature #11049]
+ * Enumerable#chunk_while [Feature #10769]
+
+* Enumerator::Lazy
+
+ * Enumerator::Lazy#grep_v [Feature #11773]
+
+* File
+
+ * File.mkfifo [Feature #11536]
+ * Add File::TMPFILE corresponding to O_TMPFILE
+
+* Hash
+
+ * Hash#fetch_values [Feature #10017]
+ * Hash#dig [Feature #11643]
+ * Hash#<=, Hash#<, Hash#>=, Hash#> [Feature #10984]
+ * Hash#to_proc [Feature #11653]
* IO
- * extended methods:
- * IO#seek supports SEEK_DATA and SEEK_HOLE as whence.
- * IO#seek accepts symbols (:CUR, :END, :SET, :DATA, :HOLE) for 2nd argument.
- * IO#read_nonblock accepts optional `exception: false` to return symbols
- * IO#write_nonblock accepts optional `exception: false` to return symbols
+
+ * new mode flag File::SHARE_DELETE is available.
+ this flag means to permit deleting opened file on Windows, but currently
+ this affect only files opened as binary. [Feature #11218]
+
+ * new option parameter `flags' is added.
+ this parameter is bitwise-ORed to oflags generated by normal mode argument.
+ [Feature #11253]
+
+ * IO#advise no longer raises Errno::ENOSYS in cases where it was
+ detected at build time but not available at runtime. [Feature #11806]
* Kernel
- * New methods:
- * Kernel#singleton_method
+
+ * Kernel#loop, when stopped by a StopIteration exception, returns
+ what the enumerator has returned instead of nil. [Feature #11498]
* Module
- * New methods:
- * Module#using, which activates refinements of the specified module only
- in the current class or module definition.
- * Module#singleton_class? returns true if the receiver is a singleton class
- or false if it is an ordinary class or module.
- * extended methods:
- * Module#refine is no longer experimental.
- * Module#include and Module#prepend are now public methods.
-
-* Mutex
- * misc
- * Mutex#owned? is no longer experimental.
+ * Module#deprecate_constant [Feature #11398]
+
+* NameError
+ * NameError#receiver is added to take the receiver object. [Feature #10881]
* Numeric
- * extended methods:
- * Numeric#step allows the limit argument to be omitted, in which
- case an infinite sequence of numbers is generated. Keyword
- arguments `to` and `by` are introduced for ease of use.
-
-* Process
- * New methods:
- * alternative methods to $0/$0=:
- * Process.argv0() returns the original value of $0.
- * Process.setproctitle() sets the process title without affecting $0.
- * Process.clock_gettime
- * Process.clock_getres
+
+ * Numeric#positive? and Numeric#negative? are added, which return
+ true when the receiver is positive and negative respectively.
+ [Feature #11151]
+
+* Proc
+
+ * Proc#call (and also #[], #===, #yield) are optimized.
+ Backtrace doesn't show each method (show block lines directly).
+ TracePoint also ignores these calls. [Feature #11569]
+
+* Queue (Thread::Queue)
+
+ * Queue#close is added to notice a termination. [Feature #10600]
+
+* Regexp/String: Updated Unicode version from 7.0.0 to 8.0.0
+
+* RubyVM::InstructionSequence
+ * add the following methods as a primitive tool of iseq loader.
+ See sample/iseq_loader.rb for usage.
+ Note that loader does not have verifier so it is easy to cause
+ critical problem by loading modified/broken binary data.
+ See [Feature #11788] for more details. (experimental feature)
+ * RubyVM::InstructionSequence#to_binary(extra_data = nil)
+ * RubyVM::InstructionSequence.load_from_binary(binary)
+ * RubyVM::InstructionSequence.load_from_binary_extra_data(binary)
* String
- * New methods:
- * String#scrub and String#scrub! verify and fix invalid byte sequence.
- If you want to use this function with older Ruby,
- consider to use string-scrub.gem.
-* Symbol
- * All symbols are now frozen.
+ * String#+@ and String#-@ are added to get mutable/frozen strings.
+ [Feature #11782]
-* pack/unpack (Array/String)
- * Q! and q! directives for long long type if platform has the type.
+ * String.new now accepts new option parameter `encoding'.
+ [Feature #11785]
-* toplevel
- * extended methods:
- * main.using is no longer experimental. The method activates refinements
- in the ancestors of the argument module to support refinement
- inheritance by Module#include.
+* Struct
+ * Struct#dig [Feature #11688]
+
+* Thread
+ * Thread#name, Thread#name= are added to handle thread names [Feature #11251]
=== Core classes compatibility issues (excluding feature bug fixes)
-* Hash
- * incompatible changes:
- * Hash#reject will return plain Hash object in the future versions, that
- is the original object's subclass, instance variables, default value,
- and taintedness will be no longer copied, so now warnings are emitted
- when called with such Hash.
+* Array
+ * Array#select!, Array#keep_if, Array#reject!, and Array#delete_if
+ no longer changes the receiver array instantly every time the
+ block is called. [Feature #10714]
-* IO
- * incompatible changes:
- * open ignore internal encoding if external encoding is ASCII-8BIT.
+ * Array#flatten and Array#flatten! no longer try to call #to_ary
+ method on elements beyond the given level. [Bug #10748]
-* Kernel#eval, Kernel#instance_eval, and Module#module_eval.
- * Copies the scope information of the original environment, which means
- that private, protected, public, and module_function without arguments
- do not affect the environment outside the eval string.
- For example, `class Foo; eval "private"; def foo; end; end' doesn't make
- Foo#foo private.
+ * Array#inspect doesn't raise error even if its content returns
+ a string which is not compatible with Encoding.default_external
+ as inspected result. [Feature #11801]
-* Kernel#untrusted?, untrust, and trust
- * These methods are deprecated and their behavior is same as tainted?,
- taint, and untaint, respectively. If $VERBOSE is true, they show warnings.
+* Enumerable
+ * Enumerable#chunk and Enumerable#slice_before no longer takes the
+ initial_state argument. [Feature #10958]
+ Use a local variable instead to maintain a state.
-* Module#ancestors
- * The ancestors of a singleton class now include singleton classes,
- in particular itself.
+* File::Stat
+ * On Windows File::Stat#ino always returned 0, but now returns
+ BY_HANDLE_FILE_INFORMATION.nFileIndexHigh/Low. [Feature #11216]
-* Module#define_method and Object#define_singleton_method
- * Now they return the symbols of the defined methods, not the methods/procs
- themselves.
+* Hash
+ * Hash#inspect doesn't raise error even if its content returns
+ a string which is not compatible with Encoding.default_external
+ as inspected result. [Feature #11801]
-* Numeric#quo
- * Raises TypeError instead of ArgumentError if the receiver doesn't have
- to_r method.
+* IO
+ * IO#close doesn't raise when the IO object is closed. [Feature #10718]
+ * IO#each_codepoint raises an exception at incomplete character
+ before EOF when conversion takes place. [Bug #11444]
-* Proc
- * Returning from lambda proc now always exits from the Proc, not from the
- method where the lambda is created. Returning from non-lambda proc exits
- from the method, same as the former behavior.
+* Module
+ * Module#define_method and Object.define_singleton_method now
+ require method body, Proc, Method, or a block, and raise
+ ArgumentError if no block is given directly. [Bug #11283]
+
+* pack/unpack (Array/String)
+ * j and J directives for pointer width integer type. [Feature #11215]
-String
- * If invalid: :replace is specified for String#encode, replace
- invalid byte sequence even if the destination encoding equals to
- the source encoding.
=== Stdlib updates (outstanding ones only)
-* CGI::Util
- * All class methods modulized.
-
-* Digest
- * extended methods:
- * Digest::Class.file takes optional arguments for its constructor
-
-* Matrix
- * Added Vector#cross_product.
-
-* Net::SMTP
- * Added Net::SMTP#rset to implement the RSET command
-
-* objspace
- * new method:
- * ObjectSpace.trace_object_allocations
- * ObjectSpace.trace_object_allocations_start
- * ObjectSpace.trace_object_allocations_stop
- * ObjectSpace.trace_object_allocations_clear
- * ObjectSpace.allocation_sourcefile
- * ObjectSpace.allocation_sourceline
- * ObjectSpace.allocation_class_path
- * ObjectSpace.allocation_method_id
- * ObjectSpace.allocation_generation
- * ObjectSpace.reachable_objects_from_root
- * ObjectSpace.dump
- * ObjectSpace.dump_all
-
-* OpenSSL::BN
- * extended methods:
- * OpenSSL::BN.new allows Fixnum/Bignum argument.
-
-* open-uri
- * Support multiple fields with same field name (like Set-Cookie).
+* Logger
-* Pathname
- * New methods:
- * Pathname#write
- * Pathname#binwrite
+ * Logger#level= now supports symbol and string levels such as :debug, :info,
+ :warn, :error, :fatal (case insensitive) [Feature #11695]
+ * Logger#reopen is added to reopen a log device. [Feature #11696]
-* rake
- * Updated to 10.1.0. Major changes include removal of the class namespace,
- Rake::DSL to hold the rake DSL methods and removal of support for legacy
- rake features.
+* io/wait
+ * IO#wait_readable no longer checks FIONREAD, it may be used for
+ non-bytestream IO such as listen sockets.
- For a complete list of changes since rake 0.9.6 see:
+* Net::FTP
+ * Net::FTP#mlst is added.
+ * Net::FTP#mlsd is added.
- http://rake.rubyforge.org/doc/release_notes/rake-10_1_0_rdoc.html
+* nkf
+ * Merge nkf 2.1.4.
- http://rake.rubyforge.org/doc/release_notes/rake-10_0_3_rdoc.html
+* ObjectSpace (objspace)
+ * ObjectSpace.count_symbols is added.
+ * ObjectSpace.count_imemo_objects is added.
+ * ObjectSpace.internal_class_of is added.
+ * ObjectSpace.internal_super_of is added.
-* RbConfig
- * New constants:
- * RbConfig::SIZEOF is added to provide the size of C types.
+* OpenSSL
+ * OpenSSL::SSL::SSLSocket#accept_nonblock and
+ OpenSSL::SSL::SSLSocket#connect_nonblock supports `exception: false`.
+ [Feature #10532]
-* RDoc
- * Updated to 4.1.0. Major enhancements include a modified default template
- * and accessibility enhancements.
+* Pathname
+ * Pathname#descend and Pathname#ascend supported blockless form.
+ [Feature #11052]
- For a list of minor enhancements and bug fixes see:
- https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc
+* Socket
+ * Socket#connect_nonblock, Socket#accept_nonblock,
+ TCPServer#accept_nonblock, UNIXServer#accept_nonblock,
+ BasicSocket#recv_nonblock, BasicSocket#recvmsg_nonblock,
+ BasicSocket#sendmsg_nonblock all support `exception: false` to return
+ :wait_readable or :wait_writable symbols instead of raising
+ IO::WaitReadable or IO::WaitWritable exceptions
+ [Feature #10532] [Feature #11229]
+ * BasicSocket#recv and BasicSocket#recv_nonblock allow an output
+ String buffer argument like IO#read and IO#read_nonblock to reduce
+ GC overhead [Feature #11242]
+
+* StringIO
+ * In read-only mode, StringIO#set_encoding no longer sets the encoding
+ of its buffer string. Setting the encoding of the string directly
+ without StringIO#set_encoding may cause unpredictable behavior now.
+ [Bug #11827]
+
+* timeout
+ * Object#timeout is now warned as deprecated when called.
-* Resolv
- * New methods:
- * Resolv::DNS.fetch_resource
- * One-shot multicast DNS support
- * Support LOC resources
+=== Stdlib compatibility issues (excluding feature bug fixes)
-* REXML::Parsers::SAX2Parser
- * Fixes wrong number of arguments of entitydecl event. Document of the event
- says "an array of the entity declaration" but implementation passes two
- or more arguments. It is an implementation bug but it breaks backword
- compatibility.
+* ext/coverage/coverage.c
+ * Coverage.peek_result: new method to allow coverage to be captured without
+ stopping the coverage tool. [Feature #10816]
-* REXML::Parsers::StreamParser
- * Supports "entity" event.
+* Fiddle
+ * Fiddle::Function#call releases the GVL. [Feature #11607]
-* REXML::Text
- * REXML::Text#<< supports method chain like 'text << "XXX" << "YYY"'.
- * REXML::Text#<< supports not "raw" mode.
+* io-console
+ * Update to io-console 0.4.5, and change the license to BSD 2-clause
+ "Simplified" License.
-* Rinda::RingServer, Rinda::RingFinger
- * Rinda now supports multicast sockets. See Rinda::RingServer and
- Rinda::RingFinger for details.
+* lib/base64.rb
+ * Base64.urlsafe_encode64: added a "padding" option to suppress
+ the padding character ("="). [Feature #10740]
+ * Base64.urlsafe_decode64: now it accepts not only correctly-padded
+ input but also unpadded input. [Feature #10740]
-* RubyGems
- * Updated to 2.2.0. Notable new features include:
+* lib/drb/drb.rb
+ * removed unused argument. https://github.com/ruby/ruby/pull/515
- * Gemfile or gem.deps.rb support including Gem.file.lock (experimental)
- * Improved, iterative resolver (compared to RubyGems 2.1 and earlier)
- * Support for a sharing a GEM_HOME across ruby platforms and versions
+* lib/matrix.rb
+ * Add Vector#round. https://github.com/ruby/ruby/pull/802
- For a complete list of enhancements and bug fixes see:
- https://github.com/rubygems/rubygems/tree/master/History.txt
+* lib/webrick/utils.rb
+ * removed unused argument. https://github.com/ruby/ruby/pull/356
-* Set
- * New methods:
- * Set#intersect?
- * Set#disjoint?
+* Net::FTP
+ * Connections are in passive mode per default now. The default mode can
+ be changed by Net::FTP.default_passive=. [Feature #11612]
-* Socket
- * New methods:
- * Socket.getifaddrs
-
-* StringScanner
- * extended methods:
- * StringScanner#[] supports named captures.
-
-* Syslog::Logger
- * Added facility.
-
-* Tempfile
- * New methods:
- * Tempfile.create
-
-* Timeout
- * The exception to terminate the given block can no longer be rescued
- inside the block, by default, unless the exception class is given
- explicitly.
-
-* TSort
- * New methods:
- * TSort.tsort
- * TSort.tsort_each
- * TSort.strongly_connected_components
- * TSort.each_strongly_connected_component
- * TSort.each_strongly_connected_component_from
-
-* WEBrick
- * The body of a response may now be a StringIO or other IO-like that responds
- to #readpartial and #read.
-
-* XMLRPC::Client
- * New methods:
- * XMLRPC::Client#http. It returns Net::HTTP for the client. Normally,
- it is not needed. It is useful when you want to change minor HTTP client
- options. You can change major HTTP client options by XMLRPC::Client
- methods. You should use XMLRPC::Client methods for changing major
- HTTP client options instead of XMLRPC::Client#http.
+* Net::HTTP
+ * default value of Net::HTTP#open_timeout is now 60 (was nil).
-=== Stdlib compatibility issues (excluding feature bug fixes)
+* Net::Telnet
+ * Net::Telnet is extracted to net-telnet gem. It's unmaintain code.
+ [Feature #11083]
+
+* Psych
+ * Updated to Psych 2.0.17
+
+* Rake
+ * Rake is removed from stdlib. [Feature #11025]
+
+* RDoc
+ * Updated to RDoc 4.2.1. For full release notes see:
-* Set
- * incompatible changes:
- * Set#to_set now returns self instead of generating a copy.
+ https://github.com/rdoc/rdoc/blob/master/History.rdoc#421--2015-12-22
-* URI
- * incompatible changes:
- * URI.decode_www_form follows current WHATWG URL Standard.
- It gets encoding argument to specify the character encoding.
- It now allows loose percent encoded strings, but denies ;-separator.
- * URI.encode_www_form follows current WHATWG URL Standard.
- It gets encoding argument to convert before percent encode.
- UTF-16 strings aren't converted to UTF-8 before percent encode by default.
+* RubyGems
+ * Updated to RubyGems 2.5.1. For full release notes see:
-* curses
- * Removed.
- curses is now available as a gem.
- See https://rubygems.org/gems/curses for details.
+ http://docs.seattlerb.org/rubygems/History_txt.html#label-2.5.0+-2F+2015-11-03
+ and
+ http://docs.seattlerb.org/rubygems/History_txt.html#label-2.5.1+-2F+2015-12-10
=== Built-in global variables compatibility issues
* $SAFE
- * $SAFE=4 is obsolete. If $SAFE is set to 4 or larger, an ArgumentError
- is raised.
+ * $SAFE=2 and $SAFE=3 are obsolete. If $SAFE is set to 2 or larger,
+ an ArgumentError is raised. [Feature #5455]
=== C API updates
-* rb_gc_set_params() is deprecated. This is only used in Ruby internal.
+* rb_define_class_id_under() now raises a TypeError exception when the
+ class is already defined but its superclass does not match the given
+ superclass, as well as definitions in ruby level.
+
+* rb_timespec_now() is added to fetch current datetime as struct timespec.
+ [Feature #11558]
+
+* rb_time_timespec_new() is added to create a time object with epoch,
+ nanosecond, and UTC/localtime/time offset arguments. [Feature #11558]
+
+* rb_autoload() deprecated, use rb_funcall() instead. [Feature #11664]
+
+* rb_compile_error_with_enc(), rb_compile_error(), and rb_compile_bug()
+ deprecated. these functions are exposed but only for internal use.
+ external libraries should not use them.
+
+=== Supported platform changes
+
+* OS/2 is no longer supported
+
+* BeOS is no longer supported
+
+* Borland-C is no longer supported
+
+* Haiku now stable and best effort
+
+=== Implementation improvements
+
+* Optimize Proc#call to eliminate method frame construction.
+ [Feature #11569]
+
+* Reconsidering method entry data structure.
+ [Bug #11278]
+
+* Introducing new table data structure for ID keys tables used by
+ method table and so on. New table structure is simple and fast
+ than st_table. [Feature #11420]
+
+* Machine code level tuning for object allocation and method calling
+ code. r52099, r52254
+
+* RubyVM::InstructionSequence is extended for future improvement.
+ [Feature #11788]
+
+* Case dispatch is now optimized for all special constant literals
+ including nil, true, and false. Previously, only literal strings,
+ symbols, integers and floats compiled to optimized case dispatch.
+ [Feature #11769]
+
+* Instance variables on non-pure Ruby classes (T_DATA, T_FILE,
+ etc..) is less expensive to store than before. [Feature #11170]
+
+* All accesses to members of big Struct objects are performed in
+ constant-time. Previously, Struct elements beyond the first 10
+ 10 elements used a linear scan. [Feature #10585]
-* rb_gc_count() added. This returns the number of times GC occurred.
+* The Set class got several speed up.
+ [Misc #10754], [r52591]
-* rb_gc_stat() added. This allows access to specific GC.stat() values from C
- without any allocation overhead.
+* Socket and I/O-related improvements
-* rb_gc_latest_gc_info() added. This allows access to GC.latest_gc_info().
+ * Calling overhead of most of new keyword-using I/O methods in
+ [Feature #11229] is reduced by avoiding the inefficient C API
+ to parse keywords. [Feature #11339]
-* rb_postponed_job_register() added. Takes a function callback which is invoked
- when the VM is in a consistent state, i.e. to perform work from a C signal
- handler.
+ * The standard library is updated to use the improved
+ exception-free non-blocking I/O from [Feature #11229].
+ This has the additional benefit of quieter $DEBUG output in
+ addition to reducing expensive exceptions. [Feature #11044]
-* rb_profile_frames() added. Provides low-cost access to the current ruby stack
- for callstack profiling.
+ * (Linux-only) waiting on a single FD anywhere in the stdlib no longer
+ uses select(2), making it immune to slowdowns with high-numbered FDs.
+ [Feature #11081] [Feature #11377]
-* rb_tracepoint_new() supports new internal events accessible only from C:
- * RUBY_INTERNAL_EVENT_NEWOBJ
- * RUBY_INTERNAL_EVENT_FREEOBJ
- * RUBY_INTERNAL_EVENT_GC_START
- * RUBY_INTERNAL_EVENT_GC_END_MARK
- * RUBY_INTERNAL_EVENT_GC_END_SWEEP
- * Note that you *can not* specify "internal events" with normal events
- (such as RUBY_EVENT_CALL, RUBY_EVENT_RETURN) simultaneously.
+* CGI.escapeHTML is optimized with C extention.
+ https://github.com/ruby/ruby/pull/1164
diff --git a/README b/README
deleted file mode 100644
index 3ffe3553a8..0000000000
--- a/README
+++ /dev/null
@@ -1,166 +0,0 @@
-= What's Ruby
-
-Ruby is the interpreted scripting language for quick and
-easy object-oriented programming. It has many features to
-process text files and to do system management tasks (as in
-Perl). It is simple, straight-forward, and extensible.
-
-
-== 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
- as well as Windows, Mac OS X, BeOS etc.)
- cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
-
-
-== How to get Ruby
-
-For a complete list of ways to install Ruby, including using third party
-tools like rvm, see:
-
-http://www.ruby-lang.org/en/downloads/
-
-The Ruby distribution files can be found in the following FTP site:
-
-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 the 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 the following command:
-
- $ git ls-remote git://github.com/ruby/ruby.git
-
-== Ruby home-page
-
-The URL of the Ruby home-page is:
-
-http://www.ruby-lang.org/
-
-
-== Mailing list
-
-There is a mailing list to talk about Ruby.
-To subscribe this list, please send the following phrase
-
- subscribe YourFirstName YourFamilyName
-e.g.
- subscribe Joseph Smith
-
-in the mail body (not subject) to the address <mailto:ruby-talk-ctl@ruby-lang.org>.
-
-
-== How to compile and install
-
-This is what you need to do to compile and install Ruby:
-
-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.
-
- Some C compiler flags may be added by default depending on your
- 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.
-
-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 "<tt>#option nodynamic</tt>" in
- +ext/Setup+.
-
- Usually this step will not be needed.
-
-5. Run +make+.
-
-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 '<tt>make install</tt>'
-
- This command will create following directories and install files
- onto them.
-
- * <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.
-
-If you fail to compile ruby, please send the detailed error report with
-the error log and machine/OS type, to help others.
-
-Some extension libraries may not get compiled because of lack of
-necessary external libraries and/or headers, then you will need to run
-'<tt>make distclean-ext</tt>' to remove old configuration after
-installing them in such case.
-
-== Copying
-
-See the file +COPYING+.
-
-== Feedback
-
-Questions about the Ruby language can be asked on the Ruby-Talk mailing list
-(http://www.ruby-lang.org/en/community/mailing-lists) or on websites like
-(http://stackoverflow.com).
-
-Bug reports should be filed at http://bugs.ruby-lang.org
-
-== The Author
-
-Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.
-
-<mailto:matz@ruby-lang.org>
-
---
-Local variables:
-mode: rdoc
-end:
diff --git a/README.EXT b/README.EXT
index b7a1728110..48b8d964c4 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1,1499 +1 @@
-# README.EXT - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
-
-This document explains how to make extension libraries for Ruby.
-
-= Basic Knowledge
-
-In C, variables have types and data do not have types. In contrast,
-Ruby variables do not have a static type, and data themselves have
-types, so data will need to be converted between the languages.
-
-Data in Ruby are represented by the C type `VALUE'. Each VALUE data
-has its data-type.
-
-To retrieve C data from a VALUE, you need to:
-
-1. Identify the VALUE's data type
-2. Convert the VALUE into C data
-
-Converting to the wrong data type may cause serious problems.
-
-== Data-Types
-
-The Ruby interpreter has the following data types:
-
-T_NIL :: nil
-T_OBJECT :: ordinary object
-T_CLASS :: class
-T_MODULE :: module
-T_FLOAT :: floating point number
-T_STRING :: string
-T_REGEXP :: regular expression
-T_ARRAY :: array
-T_HASH :: associative array
-T_STRUCT :: (Ruby) structure
-T_BIGNUM :: multi precision integer
-T_FIXNUM :: Fixnum(31bit or 63bit integer)
-T_COMPLEX :: complex number
-T_RATIONAL :: rational number
-T_FILE :: IO
-T_TRUE :: true
-T_FALSE :: false
-T_DATA :: data
-T_SYMBOL :: symbol
-
-In addition, there are several other types used internally:
-
-T_ICLASS :: included module
-T_MATCH :: MatchData object
-T_UNDEF :: undefined
-T_NODE :: syntax tree node
-T_ZOMBIE :: object awaiting finalization
-
-Most of the types are represented by C structures.
-
-== Check Data Type of the VALUE
-
-The macro TYPE() defined in ruby.h shows the data type of the VALUE.
-TYPE() returns the constant number T_XXXX described above. To handle
-data types, your code will look something like this:
-
- switch (TYPE(obj)) {
- case T_FIXNUM:
- /* process Fixnum */
- break;
- case T_STRING:
- /* process String */
- break;
- case T_ARRAY:
- /* process Array */
- break;
- default:
- /* raise exception */
- rb_raise(rb_eTypeError, "not valid value");
- break;
- }
-
-There is the data-type check function
-
- void Check_Type(VALUE value, int type)
-
-which raises an exception if the VALUE does not have the type
-specified.
-
-There are also faster check macros for fixnums and nil.
-
- FIXNUM_P(obj)
- NIL_P(obj)
-
-== Convert VALUE into C Data
-
-The data for type T_NIL, T_FALSE, T_TRUE are nil, false, true
-respectively. They are singletons for the data type.
-The equivalent C constants are: Qnil, Qfalse, Qtrue.
-Note that Qfalse is false in C also (i.e. 0), but not Qnil.
-
-The T_FIXNUM data is a 31bit or 63bit length fixed integer.
-This size is depend on the size of long: if long is 32bit then
-T_FIXNUM is 31bit, if long is 64bit then T_FIXNUM is 63bit.
-T_FIXNUM can be converted to a C integer by using the
-FIX2INT() macro or FIX2LONG(). Though you have to check that the
-data is really FIXNUM before using them, they are faster. FIX2LONG()
-never raises exceptions, but FIX2INT() raises RangeError if the
-result is bigger or smaller than the size of int.
-There are also NUM2INT() and NUM2LONG() which converts any Ruby
-numbers into C integers. These macros includes a type check,
-so an exception will be raised if the conversion failed. NUM2DBL()
-can be used to retrieve the double float value in the same way.
-
-You can use the macros
-StringValue() and StringValuePtr() to get a char* from a VALUE.
-StringValue(var) replaces var's value with the result of "var.to_str()".
-StringValuePtr(var) does same replacement and returns char*
-representation of var. These macros will skip the replacement if var
-is a String. Notice that the macros take only the lvalue as their
-argument, to change the value of var in place.
-
-You can also use the macro named StringValueCStr(). This is just
-like StringValuePtr(), but always add nul character at the end of
-the result. If the result contains nul character, this macro causes
-the ArgumentError exception.
-StringValuePtr() doesn't guarantee the existence of a nul at the end
-of the result, and the result may contain nul.
-
-Other data types have corresponding C structures, e.g. struct RArray
-for T_ARRAY etc. The VALUE of the type which has the corresponding
-structure can be cast to retrieve the pointer to the struct. The
-casting macro will be of the form RXXXX for each data type; for
-instance, RARRAY(obj). See "ruby.h". However, we do not recommend
-to access RXXXX data directly because these data structure is complex.
-Use corresponding rb_xxx() functions to access internal struct.
-For example, to access an entry of array, use rb_ary_entry(ary, offset)
-and rb_ary_store(ary, offset, obj).
-
-There are some accessing macros for structure members, for example
-`RSTRING_LEN(str)' to get the size of the Ruby String object. The
-allocated region can be accessed by `RSTRING_PTR(str)'.
-
-Notice: Do not change the value of the structure directly, unless you
-are responsible for the result. This ends up being the cause of
-interesting bugs.
-
-== Convert C Data into VALUE
-
-To convert C data to Ruby values:
-
-FIXNUM ::
-
- left shift 1 bit, and turn on LSB.
-
-Other pointer values::
-
- cast to VALUE.
-
-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
-structures are defined in <ruby.h>.
-
-To convert C numbers to Ruby values, use these macros.
-
-INT2FIX() :: for integers within 31bits.
-INT2NUM() :: for arbitrary sized integer.
-
-INT2NUM() converts an integer into a Bignum if it is out of the FIXNUM
-range, but is a bit slower.
-
-== Manipulating Ruby Data
-
-As I already mentioned, it is not recommended to modify an object's
-internal structure. To manipulate objects, use the functions supplied
-by the Ruby interpreter. Some (not all) of the useful functions are
-listed below:
-
-=== String Functions
-
-rb_str_new(const char *ptr, long len) ::
-
- Creates a new Ruby string.
-
-rb_str_new2(const char *ptr) ::
-rb_str_new_cstr(const char *ptr) ::
-
- Creates a new Ruby string from a C string. This is equivalent to
- rb_str_new(ptr, strlen(ptr)).
-
-rb_tainted_str_new(const char *ptr, long len) ::
-
- Creates a new tainted Ruby string. Strings from external data
- sources should be tainted.
-
-rb_tainted_str_new2(const char *ptr) ::
-rb_tainted_str_new_cstr(const char *ptr) ::
-
- Creates a new tainted Ruby string from a C string.
-
-rb_sprintf(const char *format, ...) ::
-rb_vsprintf(const char *format, va_list ap) ::
-
- Creates a new Ruby string with printf(3) format.
-
- Note: In the format string, %i is used for Object#to_s (or Object#inspect if
- '+' flag is set) output (and related argument must be a VALUE). For integers
- in format strings, use %d.
-
-rb_str_cat(VALUE str, const char *ptr, long len) ::
-
- Appends len bytes of data from ptr to the Ruby string.
-
-rb_str_cat2(VALUE str, const char* ptr) ::
-
- Appends C string ptr to Ruby string str. This function is
- equivalent to 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) ::
-
- Appends C string format and successive arguments to Ruby string
- str according to a printf-like format. These functions are
- equivalent to rb_str_cat2(str, rb_sprintf(format, ...)) and
- rb_str_cat2(str, rb_vsprintf(format, ap)), respectively.
-
-rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) ::
-rb_enc_str_new_cstr(const char *ptr, 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) ::
-
- Creates a new Ruby string with encoding US-ASCII.
-
-rb_str_resize(VALUE str, long len) ::
-
- Resizes Ruby string to len bytes. If str is not modifiable, this
- function raises an exception. The length of str must be set in
- advance. If len is less than the old length the content beyond
- len bytes is discarded, else if len is greater than the old length
- the content beyond the old length bytes will not be preserved but
- will be garbage. Note that RSTRING_PTR(str) may change by calling
- this function.
-
-rb_str_set_len(VALUE str, long len) ::
-
- Sets the length of Ruby string. If str is not modifiable, this
- function raises an exception. This function preserves the content
- upto len bytes, regardless RSTRING_LEN(str). len must not exceed
- the capacity of str.
-
-=== Array Functions
-
-rb_ary_new() ::
-
- Creates an array with no elements.
-
-rb_ary_new2(long len) ::
-rb_ary_new_capa(long len) ::
-
- Creates an array with no elements, allocating internal buffer
- for len elements.
-
-rb_ary_new3(long n, ...) ::
-rb_ary_new_from_args(long n, ...) ::
-
- Creates an n-element array from the arguments.
-
-rb_ary_new4(long n, VALUE *elts) ::
-rb_ary_new_from_values(long n, VALUE *elts) ::
-
- Creates an n-element array from a C array.
-
-rb_ary_to_ary(VALUE obj) ::
-
- Converts the object into an array.
- Equivalent to Object#to_ary.
-
-There are many functions to operate an array. They may dump core if other
-types are given.
-
-rb_ary_aref(argc, VALUE *argv, VALUE ary) ::
-
- Equivalent to Array#[].
-
-rb_ary_entry(VALUE ary, long offset) ::
-
- ary[offset]
-
-rb_ary_store(VALUE ary, long offset, VALUE obj) ::
-
- ary[offset] = obj
-
-rb_ary_subseq(VALUE ary, long beg, long len) ::
-
- ary[beg, len]
-
-rb_ary_push(VALUE ary, VALUE val) ::
-rb_ary_pop(VALUE ary) ::
-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.
-
-= Extending Ruby with C
-
-== Adding New Features to Ruby
-
-You can add new features (classes, methods, etc.) to the Ruby
-interpreter. Ruby provides APIs for defining the following things:
-
-* Classes, Modules
-* Methods, Singleton Methods
-* Constants
-
-=== Class and Module Definition
-
-To define a class or module, use the functions below:
-
- VALUE rb_define_class(const char *name, VALUE super)
- VALUE rb_define_module(const char *name)
-
-These functions return the newly created class or module. You may
-want to save this reference into a variable to use later.
-
-To define nested classes or modules, use the functions below:
-
- VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
- VALUE rb_define_module_under(VALUE outer, const char *name)
-
-=== Method and Singleton Method Definition
-
-To define methods or singleton methods, use these functions:
-
- void rb_define_method(VALUE klass, const char *name,
- VALUE (*func)(), int argc)
-
- 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.
-
-If argc is -1, the function will be called as:
-
- VALUE func(int argc, VALUE *argv, VALUE obj)
-
-where argc is the actual number of arguments, argv is the C array of
-the arguments, and obj is the receiver.
-
-If argc is -2, the arguments are passed in a Ruby array. The function
-will be called like:
-
- VALUE func(VALUE obj, VALUE args)
-
-where obj is the receiver, and args is the Ruby array containing
-actual arguments.
-
-There are some more functions to define methods. One takes an ID
-as the name of method to be defined. See also ID or Symbol below.
-
- 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,
- VALUE (*func)(), int argc)
- void rb_define_protected_method(VALUE klass, const char *name,
- VALUE (*func)(), int argc)
-
-At last, rb_define_module_function defines a module functions,
-which are private AND singleton methods of the module.
-For example, sqrt is the module function defined in Math module.
-It can be called in the following way:
-
- Math.sqrt(4)
-
-or
-
- include Math
- sqrt(4)
-
-To define module functions, use:
-
- void rb_define_module_function(VALUE module, const char *name,
- VALUE (*func)(), int argc)
-
-In addition, function-like methods, which are private methods defined
-in the Kernel module, can be defined using:
-
- void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
-
-To define an alias for the method,
-
- void rb_define_alias(VALUE module, const char* new, const char* old);
-
-To define a reader/writer for an attribute,
-
- void rb_define_attr(VALUE klass, const char *name, int read, int write)
-
-To define and undefine the `allocate' class method,
-
- void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
- void rb_undef_alloc_func(VALUE klass);
-
-func has to take the klass as the argument and return a newly
-allocated instance. This instance should be as empty as possible,
-without any expensive (including external) resources.
-
-=== Constant Definition
-
-We have 2 functions to define constants:
-
- void rb_define_const(VALUE klass, const char *name, VALUE val)
- void rb_define_global_const(const char *name, VALUE val)
-
-The former is to define a constant under specified class/module. The
-latter is to define a global constant.
-
-== Use Ruby Features from C
-
-There are several ways to invoke Ruby's features from C code.
-
-=== Evaluate Ruby Programs in a String
-
-The easiest way to use Ruby's functionality from a C program is to
-evaluate the string as Ruby program. This function will do the job:
-
- VALUE rb_eval_string(const char *str)
-
-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
-function:
-
- VALUE rb_eval_string_protect(const char *str, int *state)
-
-It returns nil when an error occur. Moreover, *state is zero if str was
-successfully evaluated, or nonzero otherwise.
-
-=== ID or Symbol
-
-You can invoke methods directly, without parsing the string. First I
-need to explain about ID. ID is the integer number to represent
-Ruby's identifiers such as variable names. The Ruby data type
-corresponding to ID is Symbol. It can be accessed from Ruby in the
-form:
-
- :Identifier
-
-or
-
- :"any kind of string"
-
-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
-
- VALUE ID2SYM(ID id)
-
-and to convert Ruby Symbol object to ID, use
-
- ID SYM2ID(VALUE symbol)
-
-=== Invoke Ruby Method from C
-
-To invoke methods directly, you can use the function below
-
- VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
-
-This function invokes a method on the recv, with the method name
-specified by the symbol mid.
-
-=== Accessing the Variables and Constants
-
-You can access class variables and instance variables using access
-functions. Also, global variables can be shared between both
-environments. There's no way to access Ruby's local variables.
-
-The functions to access/modify instance variables are below:
-
- VALUE rb_ivar_get(VALUE obj, ID id)
- VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
-
-id must be the symbol, which can be retrieved by rb_intern().
-
-To access the constants of the class/module:
-
- VALUE rb_const_get(VALUE obj, ID id)
-
-See also Constant Definition above.
-
-= Information Sharing Between Ruby and C
-
-=== Ruby Constants That C Can Be Accessed From C
-
-As stated in section 1.3,
-the following Ruby constants can be referred from C.
-
- Qtrue
- Qfalse
-
-Boolean values. Qfalse is false in C also (i.e. 0).
-
- Qnil
-
-Ruby nil in C scope.
-
-== Global Variables Shared Between C and Ruby
-
-Information can be shared between the two environments using shared global
-variables. To define them, you can use functions listed below:
-
- void rb_define_variable(const char *name, VALUE *var)
-
-This function defines the variable which is shared by both environments.
-The value of the global variable pointed to by `var' can be accessed
-through Ruby's global variable named `name'.
-
-You can define read-only (from Ruby, of course) variables using the
-function below.
-
- void rb_define_readonly_variable(const char *name, VALUE *var)
-
-You can defined hooked variables. The accessor functions (getter and
-setter) are called on access to the hooked variables.
-
- void rb_define_hooked_variable(const char *name, VALUE *var,
- VALUE (*getter)(), void (*setter)())
-
-If you need to supply either setter or getter, just supply 0 for the
-hook you don't need. If both hooks are 0, rb_define_hooked_variable()
-works just like rb_define_variable().
-
-The prototypes of the getter and setter functions are as follows:
-
- VALUE (*getter)(ID id, VALUE *var);
- void (*setter)(VALUE val, ID id, VALUE *var);
-
-
-Also you can define a Ruby global variable without a corresponding C
-variable. The value of the variable will be set/get only by hooks.
-
- void rb_define_virtual_variable(const char *name,
- VALUE (*getter)(), void (*setter)())
-
-The prototypes of the getter and setter functions are as follows:
-
- VALUE (*getter)(ID id);
- void (*setter)(VALUE val, ID id);
-
-
-== Encapsulate C Data into a Ruby Object
-
-To wrap and objectify a C pointer as a Ruby object (so called
-DATA), use Data_Wrap_Struct().
-
- 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
-to mark Ruby objects pointed by this data. The free argument is the
-function to free the pointer allocation. If this is -1, the pointer
-will be just freed. The functions mark and free will be called from
-garbage collector.
-
-These mark / free functions are invoked during GC execution. No
-object allocations are allowed during it, so do not allocate ruby
-objects inside them.
-
-You can allocate and wrap the structure in one step.
-
- Data_Make_Struct(klass, type, mark, free, sval)
-
-This macro returns an allocated Data object, wrapping the pointer to
-the structure, which is also allocated. This macro works like:
-
- (sval = ALLOC(type), Data_Wrap_Struct(klass, mark, free, sval))
-
-Arguments klass, mark, and free work like their counterparts in
-Data_Wrap_Struct(). A pointer to the allocated structure will be
-assigned to sval, which should be a pointer of the type specified.
-
-To retrieve the C pointer from the Data object, use the macro
-Data_Get_Struct().
-
- Data_Get_Struct(obj, type, sval)
-
-A pointer to the structure will be assigned to the variable sval.
-
-See the example below for details.
-
-= Example - Creating dbm Extension
-
-OK, here's the example of making an extension library. This is the
-extension to access DBMs. The full source is included in the ext/
-directory in the Ruby's source tree.
-
-== Make the Directory
-
- % mkdir ext/dbm
-
-Make a directory for the extension library under ext directory.
-
-== Design the Library
-
-You need to design the library features, before making it.
-
-== Write the C Code
-
-You need to write C code for your extension library. If your library
-has only one source file, choosing ``LIBRARY.c'' as a file name is
-preferred. On the other hand, in case your library has multiple source
-files, avoid choosing ``LIBRARY.c'' for a file name. It may conflict
-with an intermediate file ``LIBRARY.o'' on some platforms.
-Note that some functions in mkmf library described below generate
-a file ``conftest.c'' for checking with compilation. You shouldn't
-choose ``conftest.c'' as a name of a source file.
-
-Ruby will execute the initializing function named ``Init_LIBRARY'' in
-the library. For example, ``Init_dbm()'' will be executed when loading
-the library.
-
-Here's the example of an initializing function.
-
- void
- Init_dbm(void)
- {
- /* define DBM class */
- cDBM = rb_define_class("DBM", rb_cObject);
- /* DBM includes Enumerate module */
- rb_include_module(cDBM, rb_mEnumerable);
-
- /* DBM has class method open(): arguments are received as C array */
- rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
-
- /* DBM instance method close(): no args */
- rb_define_method(cDBM, "close", fdbm_close, 0);
- /* DBM instance method []: 1 argument */
- rb_define_method(cDBM, "[]", fdbm_fetch, 1);
-
- /* ... */
-
- /* ID for a instance variable to store DBM data */
- id_dbm = rb_intern("dbm");
- }
-
-The dbm extension wraps the dbm struct in the C environment using
-Data_Make_Struct.
-
- struct dbmdata {
- int di_size;
- DBM *di_dbm;
- };
-
- obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
-
-This code wraps the dbmdata structure into a Ruby object. We avoid
-wrapping DBM* directly, because we want to cache size information.
-
-To retrieve the dbmdata structure from a Ruby object, we define the
-following macro:
-
- #define GetDBM(obj, dbmp) {\
- Data_Get_Struct(obj, struct dbmdata, dbmp);\
- if (dbmp->di_dbm == 0) closed_dbm();\
- }
-
-This sort of complicated macro does the retrieving and close checking for
-the DBM.
-
-There are three kinds of way to receive method arguments. First,
-methods with a fixed number of arguments receive arguments like this:
-
- static VALUE
- fdbm_delete(VALUE obj, VALUE keystr)
- {
- /* ... */
- }
-
-The first argument of the C function is the self, the rest are the
-arguments to the method.
-
-Second, methods with an arbitrary number of arguments receive
-arguments like this:
-
- static VALUE
- fdbm_s_open(int argc, VALUE *argv, VALUE klass)
- {
- /* ... */
- if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
- mode = 0666; /* default value */
- }
- /* ... */
- }
-
-The first argument is the number of method arguments, the second
-argument is the C array of the method arguments, and the third
-argument is the receiver of the method.
-
-You can use the function rb_scan_args() to check and retrieve the
-arguments. The third argument is a string that specifies how to
-capture method arguments and assign them to the following VALUE
-references.
-
-
-The following is an example of a method that takes arguments by Ruby's
-array:
-
- static VALUE
- thread_initialize(VALUE thread, VALUE args)
- {
- /* ... */
- }
-
-The first argument is the receiver, the second one is the Ruby array
-which contains the arguments to the method.
-
-*Notice*: GC should know about global variables which refer to Ruby's objects,
-but are not exported to the Ruby world. You need to protect them by
-
- void rb_global_variable(VALUE *var)
-
-== Prepare extconf.rb
-
-If the file named extconf.rb exists, it will be executed to generate
-Makefile.
-
-extconf.rb is the file for checking compilation conditions etc. You
-need to put
-
- require 'mkmf'
-
-at the top of the file. You can use the functions below to check
-various conditions.
-
- 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 executable 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.
-
- $CFLAGS: included in CFLAGS make variable (such as -O)
- $CPPFLAGS: included in CPPFLAGS make variable (such as -I, -D)
- $LDFLAGS: included in LDFLAGS make variable (such as -L)
- $objs: list of object file names
-
-Normally, the object files list is automatically generated by searching
-source files, but you must define them explicitly if any sources will
-be generated while building.
-
-If a compilation condition is not fulfilled, you should not call
-``create_makefile''. The Makefile will not be generated, compilation will
-not be done.
-
-== Prepare Depend (Optional)
-
-If the file named depend exists, Makefile will include that file to
-check dependencies. You can make this file by invoking
-
- % gcc -MM *.c > depend
-
-It's harmless. Prepare it.
-
-== Generate Makefile
-
-Try generating the Makefile by:
-
- ruby extconf.rb
-
-If the library should be installed under vendor_ruby directory
-instead of site_ruby directory, use --vendor option as follows.
-
- ruby extconf.rb --vendor
-
-You don't need this step if you put the extension library under the ext
-directory of the ruby source tree. In that case, compilation of the
-interpreter will do this step for you.
-
-== Run make
-
-Type
-
- make
-
-to compile your extension. You don't need this step either if you have
-put the extension library under the ext directory of the ruby source tree.
-
-== Debug
-
-You may need to rb_debug the extension. Extensions can be linked
-statically by adding the directory name in the ext/Setup file so that
-you can inspect the extension with the debugger.
-
-== Done! Now You Have the Extension Library
-
-You can do anything you want with your library. The author of Ruby
-will not claim any restrictions on your code depending on the Ruby API.
-Feel free to use, modify, distribute or sell your program.
-
-= Appendix A. Ruby Source Files Overview
-
-== Ruby Language Core
-
-class.c :: classes and modules
-error.c :: exception classes and exception mechanism
-gc.c :: memory management
-load.c :: library loading
-object.c :: objects
-variable.c :: variables and constants
-
-== Ruby Syntax Parser
-
-parse.y :: grammar definition
-parse.c :: automatically generated from parse.y
-keywords :: reserved keywords
-lex.c :: automatically generated from keywords
-
-== Ruby Evaluator (a.k.a. YARV)
-
- compile.c
- eval.c
- eval_error.c
- eval_jump.c
- eval_safe.c
- insns.def : definition of VM instructions
- iseq.c : implementation of VM::ISeq
- thread.c : thread management and context switching
- thread_win32.c : thread implementation
- thread_pthread.c : ditto
- vm.c
- vm_dump.c
- vm_eval.c
- vm_exec.c
- vm_insnhelper.c
- vm_method.c
-
- opt_insns_unif.def : instruction unification
- opt_operand.def : definitions for optimization
-
- -> insn*.inc : automatically generated
- -> opt*.inc : automatically generated
- -> vm.inc : automatically generated
-
-== Regular Expression Engine (Oniguruma)
-
- regex.c
- regcomp.c
- regenc.c
- regerror.c
- regexec.c
- regparse.c
- regsyntax.c
-
-== Utility Functions
-
-debug.c :: debug symbols for C debugger
-dln.c :: dynamic loading
-st.c :: general purpose hash table
-strftime.c :: formatting times
-util.c :: misc utilities
-
-== Ruby Interpreter Implementation
-
- dmyext.c
- dmydln.c
- dmyencoding.c
- id.c
- inits.c
- main.c
- ruby.c
- version.c
-
- gem_prelude.rb
- prelude.rb
-
-== Class Library
-
-array.c :: Array
-bignum.c :: Bignum
-compar.c :: Comparable
-complex.c :: Complex
-cont.c :: Fiber, Continuation
-dir.c :: Dir
-enum.c :: Enumerable
-enumerator.c :: Enumerator
-file.c :: File
-hash.c :: Hash
-io.c :: IO
-marshal.c :: Marshal
-math.c :: Math
-numeric.c :: Numeric, Integer, Fixnum, Float
-pack.c :: Array#pack, String#unpack
-proc.c :: Binding, Proc
-process.c :: Process
-random.c :: random number
-range.c :: Range
-rational.c :: Rational
-re.c :: Regexp, MatchData
-signal.c :: Signal
-sprintf.c :: String#sprintf
-string.c :: String
-struct.c :: Struct
-time.c :: Time
-
-defs/known_errors.def :: Errno::* exception classes
--> known_errors.inc :: automatically generated
-
-== Multilingualization
-
-encoding.c :: Encoding
-transcode.c :: Encoding::Converter
-enc/*.c :: encoding classes
-enc/trans/* :: codepoint mapping tables
-
-== goruby Interpreter Implementation
-
- goruby.c
- golf_prelude.rb : goruby specific libraries.
- -> golf_prelude.c : automatically generated
-
-
-= Appendix B. Ruby Extension API Reference
-
-== Types
-
-VALUE ::
-
- The type for the Ruby object. Actual structures are defined in ruby.h,
- such as struct RString, etc. To refer the values in structures, use
- casting macros like RSTRING(obj).
-
-== Variables and Constants
-
-Qnil::
- nil object
-
-Qtrue::
- true object (default true value)
-
-Qfalse::
- false object
-
-== C Pointer Wrapping
-
-Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
-
- Wrap a C pointer into a Ruby object. If object has references to other
- Ruby objects, they should be marked by using the mark function during
- the GC process. Otherwise, mark should be 0. When this object is no
- longer referred by anywhere, the pointer will be discarded by free
- function.
-
-Data_Make_Struct(klass, type, mark, free, sval) ::
-
- This macro allocates memory using malloc(), assigns it to the variable
- 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.
-
-== Checking Data Types
-
-TYPE(value) ::
-
- Internal type (T_NIL, T_FIXNUM, etc.)
-
-FIXNUM_P(value) ::
-
- Is +value+ a Fixnum?
-
-NIL_P(value) ::
-
- Is +value+ nil?
-
-void Check_Type(VALUE value, int type) ::
-
- Ensures +value+ is of the given internal +type+ or raises a TypeError
-
-SaveStringValue(value) ::
-
- Checks that +value+ is a String and is not tainted
-
-== Data Type Conversion
-
-FIX2INT(value), INT2FIX(i) ::
-
- Fixnum <-> integer
-
-FIX2LONG(value), LONG2FIX(l) ::
-
- Fixnum <-> long
-
-NUM2INT(value), INT2NUM(i) ::
-
- Numeric <-> integer
-
-NUM2UINT(value), UINT2NUM(ui) ::
-
- Numeric <-> unsigned integer
-
-NUM2LONG(value), LONG2NUM(l) ::
-
- Numeric <-> long
-
-NUM2ULONG(value), ULONG2NUM(ul) ::
-
- Numeric <-> unsigned long
-
-NUM2LL(value), LL2NUM(ll) ::
-
- Numeric <-> long long
-
-NUM2ULL(value), ULL2NUM(ull) ::
-
- Numeric <-> unsigned long long
-
-NUM2OFFT(value), OFFT2NUM(off) ::
-
- Numeric <-> off_t
-
-NUM2SIZET(value), SIZET2NUM(size) ::
-
- Numeric <-> size_t
-
-NUM2SSIZET(value), SSIZET2NUM(ssize) ::
-
- Numeric <-> ssize_t
-
-rb_integer_pack(value, words, numwords, wordsize, nails, flags), rb_integer_unpack(words, numwords, wordsize, nails, flags) ::
-
- Numeric <-> Arbitrary size integer buffer
-
-NUM2DBL(value) ::
-
- Numeric -> double
-
-rb_float_new(f) ::
-
- double -> Float
-
-StringValue(value) ::
-
- Object with #to_str -> String
-
-StringValuePtr(value) ::
-
- Object with #to_str -> pointer to String data
-
-StringValueCStr(value) ::
-
- Object with #to_str -> pointer to String data without NULL bytes
-
-rb_str_new2(s) ::
-
- char * -> String
-
-== Defining Class and Module
-
-VALUE rb_define_class(const char *name, VALUE super) ::
-
- Defines a new Ruby class as a subclass of super.
-
-VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
-
- Creates a new Ruby class as a subclass of super, under the module's
- namespace.
-
-VALUE rb_define_module(const char *name) ::
-
- Defines a new Ruby module.
-
-VALUE rb_define_module_under(VALUE module, const char *name) ::
-
- Defines a new Ruby module under the module's namespace.
-
-void rb_include_module(VALUE klass, VALUE module) ::
-
- Includes module into class. If class already includes it, just ignored.
-
-void rb_extend_object(VALUE object, VALUE module) ::
-
- Extend the object with the module's attributes.
-
-== Defining Global Variables
-
-void rb_define_variable(const char *name, VALUE *var) ::
-
- Defines a global variable which is shared between C and Ruby. If name
- contains a character which is not allowed to be part of the symbol,
- it can't be seen from Ruby programs.
-
-void rb_define_readonly_variable(const char *name, VALUE *var) ::
-
- Defines a read-only global variable. Works just like
- rb_define_variable(), except the defined variable is read-only.
-
-void rb_define_virtual_variable(const char *name, VALUE (*getter)(), VALUE (*setter)()) ::
-
- Defines a virtual variable, whose behavior is defined by a pair of C
- functions. The getter function is called when the variable is
- referenced. The setter function is called when the variable is set to a
- value. The prototype for getter/setter functions are:
-
- VALUE getter(ID id)
- void setter(VALUE val, ID id)
-
- 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.
- The getter is called as
-
- VALUE getter(ID id, VALUE *var)
-
- returning a new value. The setter is called as
-
- void setter(VALUE val, ID id, VALUE *var)
-
- GC requires C global variables which hold Ruby values to be marked.
-
-void rb_global_variable(VALUE *var)
-
- Tells GC to protect these variables.
-
-== Constant Definition
-
-void rb_define_const(VALUE klass, const char *name, VALUE val) ::
-
- Defines a new constant under the class/module.
-
-void rb_define_global_const(const char *name, VALUE val) ::
-
- Defines a global constant. This is just the same as
-
- rb_define_const(cKernal, name, val)
-
-== Method Definition
-
-rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-
- Defines a method for the class. func is the function pointer. argc
- is the number of arguments. if argc is -1, the function will receive
- 3 arguments: argc, argv, and self. if argc is -2, the function will
- receive 2 arguments, self and args, where args is a Ruby array of
- the method arguments.
-
-rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-
- Defines a private method for the class. Arguments are same as
- rb_define_method().
-
-rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-
- Defines a singleton method. Arguments are same as rb_define_method().
-
-rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
-
- Retrieve argument from argc and argv to given VALUE references
- according to the format string. The format can be described in ABNF
- as follows:
-
- scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
-
- param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
- pre-opt-post-arg-spec
- pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
- post-arg-spec := sym-for-variable-length-args
- [num-of-trailing-mandatory-args]
- pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
- num-of-trailing-mandatory-args
- option-hash-arg-spec := sym-for-option-hash-arg
- block-arg-spec := sym-for-block-arg
-
- num-of-leading-mandatory-args := DIGIT ; The number of leading
- ; mandatory arguments
- num-of-optional-args := DIGIT ; The number of optional
- ; arguments
- sym-for-variable-length-args := "*" ; Indicates that variable
- ; length arguments are
- ; captured as a ruby array
- num-of-trailing-mandatory-args := DIGIT ; The number of trailing
- ; mandatory arguments
- sym-for-option-hash-arg := ":" ; Indicates that an option
- ; hash is captured if the last
- ; argument is a hash or can be
- ; converted to a hash with
- ; #to_hash. When the last
- ; argument is nil, it is
- ; captured if it is not
- ; ambiguous to take it as
- ; empty option hash; i.e. '*'
- ; is not specified and
- ; arguments are given more
- ; than sufficient.
- sym-for-block-arg := "&" ; Indicates that an iterator
- ; block should be captured if
- ; given
-
- For example, "12" means that the method requires at least one
- argument, and at most receives three (1+2) arguments. So, the format
- string must be followed by three variable references, which are to be
- assigned to captured arguments. For omitted arguments, variables are
- set to Qnil. NULL can be put in place of a variable reference, which
- means the corresponding captured argument(s) should be just dropped.
-
- The number of given arguments, excluding an option hash or iterator
- block, is returned.
-
-== Invoking Ruby method
-
-VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
-
- Invokes a method. To retrieve mid from a method name, use rb_intern().
- Able to call even private/protected methods.
-
-VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
-VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
-
- Invokes a method, passing arguments as an array of values.
- Able to call even private/protected methods.
-
-VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
-
- Invokes a method, passing arguments as an array of values.
- Able to call only public methods.
-
-VALUE rb_eval_string(const char *str) ::
-
- Compiles and executes the string as a Ruby program.
-
-ID rb_intern(const char *name) ::
-
- Returns ID corresponding to the name.
-
-char *rb_id2name(ID id) ::
-
- Returns the name corresponding ID.
-
-char *rb_class2name(VALUE klass) ::
-
- Returns the name of the class.
-
-int rb_respond_to(VALUE object, ID id) ::
-
- Returns true if the object responds to the message specified by id.
-
-== Instance Variables
-
-VALUE rb_iv_get(VALUE obj, const char *name) ::
-
- Retrieve the value of the instance variable. If the name is not
- prefixed by `@', that variable shall be inaccessible from Ruby.
-
-VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
-
- Sets the value of the instance variable.
-
-== Control Structure
-
-VALUE rb_block_call(VALUE recv, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
-
- Calls a method on the recv, with the method name specified by the
- symbol mid, with argc arguments in argv, supplying func as the
- block. When func is called as the block, it will receive the value
- from yield as the first argument, and data2 as the second argument.
- When yielded with multiple values (in C, rb_yield_values(),
- rb_yield_values2() and rb_yield_splat()), data2 is packed as an Array,
- whereas yielded values can be gotten via argc/argv of the third/fourth
- arguments.
-
-[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) ::
-
- 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.
-
-VALUE rb_yield(VALUE val) ::
-
- Evaluates the block with value val.
-
-VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
-
- Calls the function func1, with arg1 as the argument. If an exception
- occurs during func1, it calls func2 with arg2 as the argument. The
- return value of rb_rescue() is the return value from func1 if no
- exception occurs, from func2 otherwise.
-
-VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
-
- Calls the function func1 with arg1 as the argument, then calls func2
- with arg2 if execution terminated. The return value from
- rb_ensure() is that of func1 when no exception occurred.
-
-VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
-
- Calls the function func with arg as the argument. If no exception
- occurred 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) ::
-
- 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, ...) ::
-
- Prints a warning message according to a printf-like format.
-
-void rb_warning(const char *fmt, ...) ::
-
- Prints a warning message according to a printf-like format, if
- $VERBOSE is true.
-
-void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
-
- Raises RuntimeError. The fmt is a format string just like printf().
-
-void rb_raise(VALUE exception, const char *fmt, ...) ::
-
- Raises a class exception. The fmt is a format string just like printf().
-
-void rb_fatal(const char *fmt, ...) ::
-
- Raises a fatal error, terminates the interpreter. No exception handling
- will be done for fatal errors, but ensure blocks will be executed.
-
-void rb_bug(const char *fmt, ...) ::
-
- Terminates the interpreter immediately. This function should be
- called under the situation caused by the bug in the interpreter. No
- exception handling nor ensure execution will be done.
-
-Note: In the format string, %i is used for Object#to_s (or Object#inspect if
-'+' flag is set) output (and related argument must be a VALUE). For integers
-in format strings, use %d.
-
-== Initialize and Start the Interpreter
-
-The embedding API functions are below (not needed for extension libraries):
-
-void ruby_init() ::
-
- Initializes the interpreter.
-
-void ruby_options(int argc, char **argv) ::
-
- Process command line arguments for the interpreter.
-
-void ruby_run() ::
-
- Starts execution of the interpreter.
-
-void ruby_script(char *name) ::
-
- Specifies the name of the script ($0).
-
-== Hooks for the Interpreter Events
-
- void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
- VALUE data)
-
-Adds a hook function for the specified interpreter events.
-events should be OR'ed value of:
-
- RUBY_EVENT_LINE
- RUBY_EVENT_CLASS
- RUBY_EVENT_END
- RUBY_EVENT_CALL
- RUBY_EVENT_RETURN
- RUBY_EVENT_C_CALL
- RUBY_EVENT_C_RETURN
- RUBY_EVENT_RAISE
- RUBY_EVENT_ALL
-
-The definition of rb_event_hook_func_t is below:
-
- typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
- VALUE self, ID id, VALUE klass)
-
-The third argument `data' to rb_add_event_hook() is passed to the hook
-function as the second argument, which was the pointer to the current
-NODE in 1.8. See RB_EVENT_HOOKS_HAVE_CALLBACK_DATA below.
-
- int rb_remove_event_hook(rb_event_hook_func_t func)
-
-Removes the specified hook function.
-
-== Macros for Compatibility
-
-Some macros to check API compatibilities are available by default.
-
-NORETURN_STYLE_NEW ::
-
- Means that NORETURN macro is functional style instead of prefix.
-
-HAVE_RB_DEFINE_ALLOC_FUNC ::
-
- Means that function rb_define_alloc_func() is provided, that means the
- allocation framework is used. This is same as the result of
- have_func("rb_define_alloc_func", "ruby.h").
-
-HAVE_RB_REG_NEW_STR ::
-
- Means that function rb_reg_new_str() is provided, that creates Regexp
- object from String object. This is same as the result of
- have_func("rb_reg_new_str", "ruby.h").
-
-HAVE_RB_IO_T ::
-
- Means that type rb_io_t is provided.
-
-USE_SYMBOL_AS_METHOD_NAME ::
-
- Means that Symbols will be returned as method names, e.g.,
- Module#methods, #singleton_methods and so on.
-
-HAVE_RUBY_*_H ::
-
- Defined in ruby.h and means corresponding header is available. For
- instance, when HAVE_RUBY_ST_H is defined you should use ruby/st.h not
- mere st.h.
-
-RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
-
- Means that rb_add_event_hook() takes the third argument `data', to be
- passed to the given event hook function.
-
-= Appendix C. Functions available for use in extconf.rb
-
-See documentation for {mkmf}[rdoc-ref:MakeMakefile].
-
-/*
- * Local variables:
- * fill-column: 70
- * end:
- */
+Moved to doc/extension.rdoc
diff --git a/README.EXT.ja b/README.EXT.ja
index 9bba51a0d0..f884ecbb0e 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1,1634 +1 @@
-# README.EXT.ja - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
-
-Rubyã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã®ä½œã‚Šæ–¹ã‚’説明ã—ã¾ã™ï¼Ž
-
-= 基礎知識
-
-Cã®å¤‰æ•°ã«ã¯åž‹ãŒã‚り,データã«ã¯åž‹ãŒã‚りã¾ã›ã‚“.ã§ã™ã‹ã‚‰ï¼ŒãŸ
-ã¨ãˆã°ãƒã‚¤ãƒ³ã‚¿ã‚’intã®å¤‰æ•°ã«ä»£å…¥ã™ã‚‹ã¨ï¼Œãã®å€¤ã¯æ•´æ•°ã¨ã—ã¦å–
-り扱ã‚れã¾ã™ï¼Žé€†ã«Rubyã®å¤‰æ•°ã«ã¯åž‹ãŒãªã,データã«åž‹ãŒã‚りã¾
-ã™ï¼Žã“ã®é•ã„ã®ãŸã‚,Cã¨Rubyã¯ç›¸äº’ã«å¤‰æ›ã—ãªã‘れã°ï¼ŒãŠäº’ã„ã®
-データをアクセスã§ãã¾ã›ã‚“.
-
-Rubyã®ãƒ‡ãƒ¼ã‚¿ã¯VALUEã¨ã„ã†Cã®åž‹ã§è¡¨ç¾ã•れã¾ã™ï¼ŽVALUEåž‹ã®ãƒ‡ãƒ¼
-ã‚¿ã¯ãã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を自分ã§çŸ¥ã£ã¦ã„ã¾ã™ï¼Žã“ã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã¨
-ã„ã†ã®ã¯ãƒ‡ãƒ¼ã‚¿(オブジェクト)ã®å®Ÿéš›ã®æ§‹é€ ã‚’æ„味ã—ã¦ã„ã¦ï¼ŒRuby
-ã®ã‚¯ãƒ©ã‚¹ã¨ã¯ã¾ãŸé•ã£ãŸã‚‚ã®ã§ã™ï¼Ž
-
-VALUEã‹ã‚‰Cã«ã¨ã£ã¦æ„味ã®ã‚るデータをå–り出ã™ãŸã‚ã«ã¯
-
-1. VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を知る
-2. VALUEã‚’Cã®ãƒ‡ãƒ¼ã‚¿ã«å¤‰æ›ã™ã‚‹
-
-ã®ä¸¡æ–¹ãŒå¿…è¦ã§ã™ï¼Ž(1)を忘れるã¨é–“é•ã£ãŸãƒ‡ãƒ¼ã‚¿ã®å¤‰æ›ãŒè¡Œã‚れ
-ã¦ï¼Œæœ€æ‚ªãƒ—ログラムãŒcore dumpã—ã¾ã™ï¼Ž
-
-== データタイプ
-
-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_ICLASS
- T_MATCH
- T_UNDEF
- T_NODE
- T_ZOMBIE
-
-ã»ã¨ã‚“ã©ã®ã‚¿ã‚¤ãƒ—ã¯Cã®æ§‹é€ ä½“ã§å®Ÿè£…ã•れã¦ã„ã¾ã™ï¼Ž
-
-== VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹
-
-ruby.hã§ã¯TYPE()ã¨ã„ã†ãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„ã¦ï¼ŒVALUEã®ãƒ‡ãƒ¼ã‚¿
-タイプを知るã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼ŽTYPE()マクロã¯ä¸Šã§ç´¹ä»‹ã—ãŸT_XXXX
-ã®å½¢å¼ã®å®šæ•°ã‚’è¿”ã—ã¾ã™ï¼ŽVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã«å¿œã˜ã¦å‡¦ç†ã™ã‚‹
-å ´åˆã«ã¯ï¼ŒTYPE()ã®å€¤ã§åˆ†å²ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
-
- switch (TYPE(obj)) {
- case T_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)
-
-ã“ã®é–¢æ•°ã¯valueãŒtypeã§ç„¡ã‘れã°ï¼Œä¾‹å¤–を発生ã•ã›ã¾ã™ï¼Žå¼•æ•°ã¨
-ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ãŒæ­£ã—ã„ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™
-ã‚‹ãŸã‚ã«ã¯ï¼Œã“ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-
-FIXNUMã¨NILã«é–¢ã—ã¦ã¯ã‚ˆã‚Šé«˜é€Ÿãªåˆ¤åˆ¥ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„ã¾ã™ï¼Ž
-
- FIXNUM_P(obj)
- NIL_P(obj)
-
-== 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()).ãŸ
-ã ã—ã€æ§‹é€ ä½“ã¸ã®ç›´æŽ¥ã®ã‚¢ã‚¯ã‚»ã‚¹ã¯ã§ãã‚‹ã ã‘é¿ã‘,対応ã™ã‚‹
-rb_xxxx() ã¨ã„ã£ãŸé–¢æ•°ã‚’使ã†ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.例ãˆã°ï¼Œé…列ã®
-è¦ç´ ã¸ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹å ´åˆã¯ï¼Œrb_ary_entry(ary, offset),
-rb_ary_store(ary, offset, obj) を利用ã™ã‚‹ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.
-
-構造体ã‹ã‚‰ãƒ‡ãƒ¼ã‚¿ã‚’å–り出ã™ãƒžã‚¯ãƒ­ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Žæ–‡å­—列
-strã®é•·ã•ã‚’å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_LEN(str)ã€ã¨ã—,文字列strã‚’
-char*ã¨ã—ã¦å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_PTR(str)ã€ã¨ã—ã¾ã™ï¼Ž
-
-Rubyã®æ§‹é€ ä½“を直接アクセスã™ã‚‹æ™‚ã«æ°—ã‚’ã¤ã‘ãªã‘れã°ãªã‚‰ãªã„ã“
-ã¨ã¯ï¼Œé…åˆ—ã‚„æ–‡å­—åˆ—ã®æ§‹é€ ä½“ã®ä¸­èº«ã¯å‚ç…§ã™ã‚‹ã ã‘ã§ï¼Œç›´æŽ¥å¤‰æ›´ã—
-ãªã„ã“ã¨ã§ã™ï¼Žç›´æŽ¥å¤‰æ›´ã—ãŸå ´åˆï¼Œã‚ªãƒ–ジェクトã®å†…å®¹ã®æ•´åˆæ€§ãŒ
-ã¨ã‚Œãªããªã£ã¦ï¼Œæ€ã‚ã¬ãƒã‚°ã®åŽŸå› ã«ãªã‚Šã¾ã™ï¼Ž
-
-== 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ã«å¤‰æ›
-ã—ã¦ãれã¾ã™(ãŒï¼Œå°‘ã—é…ã„).
-
-== Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹
-
-先程も述ã¹ãŸé€šã‚Šï¼ŒRubyã®æ§‹é€ ä½“をアクセスã™ã‚‹æ™‚ã«å†…å®¹ã®æ›´æ–°ã‚’
-行ã†ã“ã¨ã¯å‹§ã‚られã¾ã›ã‚“.ã§ï¼ŒRubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹æ™‚ã«ã¯
-RubyãŒç”¨æ„ã—ã¦ã„る関数を用ã„ã¦ãã ã•ã„.
-
-ã“ã“ã§ã¯ã‚‚ã£ã¨ã‚‚使ã‚れるã§ã‚ã‚ã†æ–‡å­—列ã¨é…列ã®ç”Ÿæˆ/æ“作を行
-ã†é–¢æ•°ã‚’ã‚ã’ã¾ã™(全部ã§ã¯ãªã„ã§ã™).
-
-=== 文字列ã«å¯¾ã™ã‚‹é–¢æ•°
-
-rb_str_new(const char *ptr, long len) ::
-
- æ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
-
-rb_str_new2(const char *ptr)
-rb_str_new_cstr(const char *ptr)
-
- Cã®æ–‡å­—列ã‹ã‚‰Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯
- rb_str_new(ptr, strlen(ptr))ã¨åŒç­‰ã§ã‚る.
-
-rb_tainted_str_new(const char *ptr, long len)
-
- 汚染マークãŒä»˜åŠ ã•ã‚ŒãŸæ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žå¤–部
- ã‹ã‚‰ã®ãƒ‡ãƒ¼ã‚¿ã«åŸºã¥ã文字列ã«ã¯æ±šæŸ“マークãŒä»˜åŠ ã•れるã¹ã
- ã§ã‚る.
-
-rb_tainted_str_new2(const char *ptr)
-rb_tainted_str_new_cstr(const char *ptr)
-
- Cã®æ–‡å­—列ã‹ã‚‰æ±šæŸ“マークãŒä»˜åŠ ã•れãŸRubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
-
-rb_sprintf(const char *format, ...)
-rb_vsprintf(const char *format, va_list ap)
-
- Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
- æ•´å½¢ã—,Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
-
- 注æ„: %iã¯Object#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã¨ãã¯Object#inspect)ã‚’
- 使ã£ãŸVALUEã®å‡ºåŠ›ã«ä½¿ç”¨ã•れã¦ã„ã‚‹ãŸã‚,整数ã«ã¯%dを使用ã™ã‚‹ã“ã¨ï¼Ž
-
-rb_str_cat(VALUE str, const char *ptr, long len)
-
- Rubyã®æ–‡å­—列strã«lenãƒã‚¤ãƒˆã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Ž
-
-rb_str_cat2(VALUE str, const char* 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)) ã¨åŒç­‰ã§ã‚る.
-
-rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
-rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc)
-
- 指定ã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
-
-rb_usascii_str_new(const char *ptr, long len)
-rb_usascii_str_new_cstr(const char *ptr)
-
- エンコーディングãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
-
-rb_str_resize(VALUE str, long len)
-
- Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«å¤‰æ›´ã™ã‚‹ï¼Žstrã®é•·ã•ã¯å‰
- 以ã¦ã‚»ãƒƒãƒˆã•れã¦ã„ãªã‘れã°ãªã‚‰ãªã„.lenãŒå…ƒã®é•·ã•よりも短
- ã„æ™‚ã¯ï¼Œlenãƒã‚¤ãƒˆã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…å®¹ã¯æ¨ã¦ã‚‰ã‚Œã‚‹ï¼ŽlenãŒå…ƒ
- ã®é•·ã•ã‚ˆã‚Šã‚‚é•·ã„æ™‚ã¯ï¼Œå…ƒã®é•·ã•ã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…容ã¯ä¿å­˜ã•
- れãªã„ã§ã‚´ãƒŸã«ãªã‚‹ã ã‚ã†ï¼Žã“ã®é–¢æ•°ã®å‘¼ã³å‡ºã—ã«ã‚ˆã£ã¦
- RSTRING_PTR(str)ãŒå¤‰æ›´ã•れるã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„.
-
-rb_str_set_len(VALUE str, long len)
-
- Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼ŽstrãŒå¤‰æ›´å¯
- 能ã§ãªã‘れã°ä¾‹å¤–ãŒç™ºç”Ÿã™ã‚‹ï¼ŽRSTRING_LEN(str)ã¨ã¯ç„¡é–¢ä¿‚ã«ï¼Œ
- lenãƒã‚¤ãƒˆã¾ã§ã®å†…容ã¯ä¿å­˜ã•れる.lenã¯strã®å®¹é‡ã‚’è¶Šãˆã¦ã„
- ã¦ã¯ãªã‚‰ãªã„.
-
-
-== é…列ã«å¯¾ã™ã‚‹é–¢æ•°
-
-rb_ary_new()
-
- è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Ž
-
-rb_ary_new2(long len)
-rb_ary_new_capa(long len)
-
- è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Žlenè¦ç´ åˆ†ã®é ˜åŸŸã‚’ã‚らã‹ã˜ã‚割り
- 当ã¦ã¦ãŠã.
-
-rb_ary_new3(long n, ...)
-rb_ary_new_from_args(long n, ...)
-
- å¼•æ•°ã§æŒ‡å®šã—ãŸnè¦ç´ ã‚’å«ã‚€é…列を生æˆã™ã‚‹ï¼Ž
-
-rb_ary_new4(long n, VALUE *elts)
-rb_ary_new_from_values(long n, VALUE *elts)
-
- é…列ã§ä¸ŽãˆãŸnè¦ç´ ã®é…列を生æˆã™ã‚‹ï¼Ž
-
-rb_ary_to_ary(VALUE obj)
-
- オブジェクトをé…列ã«å¤‰æ›ã™ã‚‹.
- Object#to_aryã¨åŒç­‰ã§ã‚ã‚‹.
-
-ä»–ã«ã‚‚é…列をæ“作ã™ã‚‹é–¢æ•°ãŒå¤šæ•°ã‚ã‚‹. ã“れらã¯
-引数aryã«é…列を渡ã•ãªã‘れã°ãªã‚‰ãªã„. ã•ã‚‚ãªã„ã¨
-コアをåã.
-
-rb_ary_aref(argc, VALUE *argv, VALUE ary)
-
- Array#[]ã¨åŒç­‰.
-
-rb_ary_entry(VALUE ary, long offset)
-
- ary[offset]
-
-rb_ary_store(VALUE ary, long offset, VALUE obj) ::
-
- ary[offset] = obj
-
-rb_ary_subseq(VALUE ary, long beg, long len)
-
- ary[beg, len]
-
-rb_ary_push(VALUE ary, VALUE val)
-rb_ary_pop(VALUE ary)
-rb_ary_shift(VALUE ary)
-rb_ary_unshift(VALUE ary, VALUE val)
-
-rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
-
- é…列aryã«ptrã‹ã‚‰len個ã®ã‚ªãƒ–ジェクトを追加ã™ã‚‹ï¼Ž
-
-= Rubyã®æ©Ÿèƒ½ã‚’使ã†
-
-原ç†çš„ã«Rubyã§æ›¸ã‘ã‚‹ã“ã¨ã¯Cã§ã‚‚書ã‘ã¾ã™ï¼ŽRubyãã®ã‚‚ã®ãŒCã§è¨˜
-è¿°ã•れã¦ã„ã‚‹ã‚“ã§ã™ã‹ã‚‰ï¼Œå½“ç„¶ã¨ã„ãˆã°å½“ç„¶ãªã‚“ã§ã™ã‘ã©ï¼Žã“ã“ã§
-ã¯Rubyã®æ‹¡å¼µã«ä½¿ã†ã“ã¨ãŒå¤šã„ã ã‚ã†ã¨äºˆæ¸¬ã•れる機能を中心ã«ç´¹
-介ã—ã¾ã™ï¼Ž
-
-== Rubyã«æ©Ÿèƒ½ã‚’追加ã™ã‚‹
-
-Rubyã§æä¾›ã•れã¦ã„る関数を使ãˆã°Rubyã‚¤ãƒ³ã‚¿ãƒ—ãƒªã‚¿ã«æ–°ã—ã„æ©Ÿèƒ½
-を追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼ŽRubyã§ã¯ä»¥ä¸‹ã®æ©Ÿèƒ½ã‚’追加ã™ã‚‹é–¢æ•°ãŒ
-æä¾›ã•れã¦ã„ã¾ã™ï¼Ž
-
-* クラス,モジュール
-* メソッド,特異メソッドãªã©
-* 定数
-
-ã§ã¯é †ã«ç´¹ä»‹ã—ã¾ã™ï¼Ž
-
-=== クラス/モジュール定義
-
-クラスやモジュールを定義ã™ã‚‹ãŸã‚ã«ã¯ï¼Œä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-
- 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)
-
-=== メソッド/特異メソッド定義
-
-メソッドや特異メソッドを定義ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-
- void rb_define_method(VALUE klass, const char *name,
- VALUE (*func)(), int argc)
-
- void rb_define_singleton_method(VALUE object, const char *name,
- VALUE (*func)(), int argc)
-
-
-念ã®ãŸã‚説明ã™ã‚‹ã¨ã€Œç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã€ã¨ã¯ï¼Œãã®ç‰¹å®šã®ã‚ªãƒ–ジェク
-トã«å¯¾ã—ã¦ã ã‘有効ãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã™ï¼ŽRubyã§ã¯ã‚ˆãSmalltalkã«ãŠ
-ã‘るクラスメソッドã¨ã—ã¦ï¼Œã‚¯ãƒ©ã‚¹ã«å¯¾ã™ã‚‹ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ãŒä½¿ã‚れ
-ã¾ã™ï¼Ž
-
-ã“れらã®é–¢æ•°ã® argcã¨ã„ã†å¼•æ•°ã¯Cã®é–¢æ•°ã¸æ¸¡ã•ã‚Œã‚‹å¼•æ•°ã®æ•°(ã¨
-å½¢å¼)を決ã‚ã¾ã™ï¼ŽargcãŒ0ä»¥ä¸Šã®æ™‚ã¯é–¢æ•°ã«å¼•ãæ¸¡ã™å¼•æ•°ã®æ•°ã‚’æ„
-味ã—ã¾ã™ï¼Ž16個以上ã®å¼•æ•°ã¯ä½¿ãˆã¾ã›ã‚“(ãŒï¼Œè¦ã‚Šã¾ã›ã‚“よã­ï¼Œã
-ã‚“ãªã«).実際ã®é–¢æ•°ã«ã¯å…ˆé ­ã®å¼•æ•°ã¨ã—ã¦selfãŒä¸Žãˆã‚‰ã‚Œã¾ã™ã®
-ã§ï¼ŒæŒ‡å®šã—ãŸæ•°ã‚ˆã‚Š1多ã„引数をæŒã¤ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
-
-argcãŒè² ã®æ™‚ã¯å¼•æ•°ã®æ•°ã§ã¯ãªã,形å¼ã‚’指定ã—ãŸã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
-argcãŒ-1ã®æ™‚ã¯å¼•æ•°ã‚’é…列ã«å…¥ã‚Œã¦æ¸¡ã•れã¾ã™ï¼ŽargcãŒ-2ã®æ™‚ã¯å¼•
-æ•°ã¯Rubyã®é…列ã¨ã—ã¦æ¸¡ã•れã¾ã™ï¼Ž
-
-メソッドを定義ã™ã‚‹é–¢æ•°ã¯ã¾ã ã„ãã¤ã‹ã‚りã¾ã™. ã²ã¨ã¤ã¯ãƒ¡ã‚½ãƒƒãƒ‰
-åã¨ã—ã¦IDã‚’å–りã¾ã™. IDã«ã¤ã„ã¦ã¯2.2.2ã‚’å‚ç…§.
-
- void rb_define_method_id(VALUE klass, ID name,
- VALUE (*func)(ANYARGS), int argc)
-
-private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã‚’定義ã™ã‚‹ãµãŸã¤ã®é–¢æ•°ãŒã‚りã¾ã™.
-
- void rb_define_private_method(VALUE klass, const char *name,
- VALUE (*func)(), int argc)
- void rb_define_protected_method(VALUE klass, const char *name,
- VALUE (*func)(), int argc)
-
-privateメソッドã¨ã¯é–¢æ•°å½¢å¼ã§ã—ã‹å‘¼ã³å‡ºã™ã“ã¨ã®å‡ºæ¥ãªã„メソッ
-ドã§ã™ï¼Ž
-
-最後ã«ï¼Œ rb_define_module関数ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã—ã¾ã™ï¼Ž
-モジュール関数ã¨ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚Šï¼ŒåŒæ™‚ã«
-privateメソッドã§ã‚‚ã‚ã‚‹ã‚‚ã®ã§ã™ï¼Žä¾‹ã‚’ã‚ã’ã‚‹ã¨Mathモジュール
-ã®sqrt()ãªã©ãŒã‚ã’られã¾ã™ï¼Žã“ã®ãƒ¡ã‚½ãƒƒãƒ‰ã¯
-
- Math.sqrt(4)
-
-ã¨ã„ã†å½¢å¼ã§ã‚‚
-
- include Math
- sqrt(4)
-
-ã¨ã„ã†å½¢å¼ã§ã‚‚使ãˆã¾ã™ï¼Žãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®
-通りã§ã™ï¼Ž
-
- void rb_define_module_function(VALUE module, const char *name,
- VALUE (*func)(), int argc)
-
-関数的メソッド(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を定義ã—ãŸã‚Šå‰Šé™¤ã—ãŸã‚Šã™ã‚‹ãŸã‚ã®é–¢æ•°ã¯
-以下ã®é€šã‚Šã§ã™ï¼Ž
-
- void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
- void rb_undef_alloc_func(VALUE klass);
-
-funcã¯ã‚¯ãƒ©ã‚¹ã‚’引数ã¨ã—ã¦å—ã‘å–ã£ã¦ï¼Œæ–°ã—ã割り当ã¦ã‚‰ã‚ŒãŸã‚¤ãƒ³
-スタンスを返ã•ãªãã¦ã¯ãªã‚Šã¾ã›ã‚“.ã“ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã¯ï¼Œå¤–部リ
-ソースãªã©ã‚’å«ã¾ãªã„,ã§ãã‚‹ã ã‘「空ã€ã®ã¾ã¾ã«ã—ã¦ãŠã„ãŸã»ã†
-ãŒã‚ˆã„ã§ã—ょã†ï¼Ž
-
-=== 定数定義
-
-拡張ライブラリãŒå¿…è¦ãªå®šæ•°ã¯ã‚らã‹ã˜ã‚定義ã—ã¦ãŠã„ãŸæ–¹ãŒè‰¯ã„
-ã§ã—ょã†ï¼Žå®šæ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯äºŒã¤ã‚りã¾ã™ï¼Ž
-
- void rb_define_const(VALUE klass, const char *name, VALUE val)
- void rb_define_global_const(const char *name, VALUE val)
-
-å‰è€…ã¯ç‰¹å®šã®ã‚¯ãƒ©ã‚¹/モジュールã«å±žã™ã‚‹å®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ï¼Œå¾Œ
-者ã¯ã‚°ãƒ­ãƒ¼ãƒãƒ«ãªå®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ã§ã™ï¼Ž
-
-== Rubyã®æ©Ÿèƒ½ã‚’Cã‹ã‚‰å‘¼ã³å‡ºã™
-
-æ—¢ã«ã€Ž1.5 Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹ã€ã§ä¸€éƒ¨ç´¹ä»‹ã—ãŸã‚ˆã†ãªé–¢æ•°ã‚’
-使ãˆã°ï¼ŒRubyã®æ©Ÿèƒ½ã‚’実ç¾ã—ã¦ã„る関数を直接呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥
-ã¾ã™ï¼Ž
-
-# ã“ã®ã‚ˆã†ãªé–¢æ•°ã®ä¸€è¦§è¡¨ã¯ã„ã¾ã®ã¨ã“ã‚ã‚りã¾ã›ã‚“.ソースを見
-# ã‚‹ã—ã‹ãªã„ã§ã™ã­ï¼Ž
-
-ãれ以外ã«ã‚‚Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™æ–¹æ³•ã¯ã„ãã¤ã‹ã‚りã¾ã™ï¼Ž
-
-=== Rubyã®ãƒ—ログラムをevalã™ã‚‹
-
-Cã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™ã‚‚ã£ã¨ã‚‚ç°¡å˜ãªæ–¹æ³•ã¨ã—ã¦ï¼Œæ–‡å­—列ã§
-与ãˆã‚‰ã‚ŒãŸRubyã®ãƒ—ログラムを評価ã™ã‚‹ä»¥ä¸‹ã®é–¢æ•°ãŒã‚りã¾ã™ï¼Ž
-
- VALUE rb_eval_string(const char *str)
-
-ã“ã®è©•価ã¯ç¾åœ¨ã®ç’°å¢ƒã§è¡Œã‚れã¾ã™ï¼Žã¤ã¾ã‚Šï¼Œç¾åœ¨ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°
-ãªã©ã‚’å—ã‘ç¶™ãŽã¾ã™ï¼Ž
-
-評価ã¯ä¾‹å¤–を発生ã™ã‚‹ã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„ã—ã¾ã—ょã†. より安全
-ãªé–¢æ•°ã‚‚ã‚りã¾ã™.
-
- VALUE rb_eval_string_protect(const char *str, int *state)
-
-ã“ã®é–¢æ•°ã¯ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã™ã‚‹ã¨nilã‚’è¿”ã—ã¾ã™ï¼Žãã—ã¦ï¼ŒæˆåŠŸæ™‚ã«ã¯
-*stateã¯ã‚¼ãƒ­ã«ï¼Œã•ã‚‚ãªãã°éžã‚¼ãƒ­ã«ãªã‚Šã¾ã™ï¼Ž
-
-=== IDã¾ãŸã¯ã‚·ãƒ³ãƒœãƒ«
-
-Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã“ã¨ã‚‚ã§ãã¾
-ã™ï¼Žãã®å‰ã«ï¼ŒRubyインタプリタ内ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚„変数åを指定ã™ã‚‹
-時ã«ä½¿ã‚れã¦ã„ã‚‹IDã«ã¤ã„ã¦èª¬æ˜Žã—ã¦ãŠãã¾ã—ょã†ï¼Ž
-
-IDã¨ã¯å¤‰æ•°å,メソッドåã‚’è¡¨ã™æ•´æ•°ã§ã™ï¼ŽRubyã®ä¸­ã§ã¯
-
- :識別å­
-
-ã¾ãŸã¯
-
- :"ä»»æ„ã®æ–‡å­—列"
-
-ã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã™ï¼ŽCã‹ã‚‰ã“ã®æ•´æ•°ã‚’å¾—ã‚‹ãŸã‚ã«ã¯é–¢æ•°
-
- rb_intern(const char *name)
- rb_intern_str(VALUE name)
-
-を使ã„ã¾ã™ï¼Ž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ã®æ–‡å­—列を使ã„ã¾ã™ï¼Ž
-
-=== Cã‹ã‚‰Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™
-
-Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ãŸã‚ã«ã¯ä»¥ä¸‹
-ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-
- VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
-
-ã“ã®é–¢æ•°ã¯ã‚ªãƒ–ジェクトrecvã®midã§æŒ‡å®šã•れるメソッドを呼ã³å‡º
-ã—ã¾ã™ï¼Žãã®ä»–ã«å¼•æ•°ã®æŒ‡å®šã®ä»•æ–¹ãŒé•ã†ä»¥ä¸‹ã®é–¢æ•°ã‚‚ã‚りã¾ã™ï¼Ž
-
- VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
- VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv)
- VALUE rb_apply(VALUE recv, ID mid, VALUE args)
-
-applyã«ã¯å¼•æ•°ã¨ã—ã¦Rubyã®é…列を与ãˆã¾ã™ï¼Ž
-
-=== 変数/定数をå‚ç…§/æ›´æ–°ã™ã‚‹
-
-Cã‹ã‚‰é–¢æ•°ã‚’使ã£ã¦å‚照・更新ã§ãã‚‹ã®ã¯ï¼Œå®šæ•°ï¼Œã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰
-æ•°ã§ã™ï¼Žå¤§åŸŸå¤‰æ•°ã¯ä¸€éƒ¨ã®ã‚‚ã®ã¯Cã®å¤§åŸŸå¤‰æ•°ã¨ã—ã¦ã‚¢ã‚¯ã‚»ã‚¹ã§ã
-ã¾ã™ï¼Žãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã‚’å‚ç…§ã™ã‚‹æ–¹æ³•ã¯å…¬é–‹ã—ã¦ã„ã¾ã›ã‚“.
-
-オブジェクトã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’å‚照・更新ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®é€š
-りã§ã™ï¼Ž
-
- VALUE rb_ivar_get(VALUE obj, ID id)
- VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
-
-idã¯rb_intern()ã§å¾—られるもã®ã‚’使ã£ã¦ãã ã•ã„.
-
-定数をå‚ç…§ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦ãã ã•ã„.
-
- VALUE rb_const_get(VALUE obj, ID id)
-
-定数を新ã—ã定義ã™ã‚‹ãŸã‚ã«ã¯ã€Ž2.1.3 定数定義ã€ã§ç´¹ä»‹ã•
-れã¦ã„る関数を使ã£ã¦ãã ã•ã„.
-
-= Rubyã¨Cã¨ã®æƒ…報共有
-
-C言語ã¨Rubyã®é–“ã§æƒ…報を共有ã™ã‚‹æ–¹æ³•ã«ã¤ã„ã¦è§£èª¬ã—ã¾ã™ï¼Ž
-
-== Cã‹ã‚‰å‚ç…§ã§ãã‚‹Rubyã®å®šæ•°
-
-以下ã®Rubyã®å®šæ•°ã¯Cã®ãƒ¬ãƒ™ãƒ«ã‹ã‚‰å‚ç…§ã§ãã¾ã™ï¼Ž
-
- Qtrue
- Qfalse
-
-真å½å€¤ï¼ŽQfalseã¯C言語ã§ã‚‚å½ã¨ã¿ãªã•れã¾ã™(ã¤ã¾ã‚Š0).
-
- Qnil
-
-C言語ã‹ã‚‰è¦‹ãŸã€Œnilã€ï¼Ž
-
-== Cã¨Rubyã§å…±æœ‰ã•れる大域変数
-
-Cã¨Rubyã§å¤§åŸŸå¤‰æ•°ã‚’使ã£ã¦æƒ…報を共有ã§ãã¾ã™ï¼Žå…±æœ‰ã§ãる大域
-変数ã«ã¯ã„ãã¤ã‹ã®ç¨®é¡žãŒã‚りã¾ã™ï¼Žãã®ãªã‹ã§ã‚‚ã£ã¨ã‚‚良ã使ã‚
-ã‚Œã‚‹ã¨æ€ã‚れるã®ã¯rb_define_variable()ã§ã™ï¼Ž
-
- void rb_define_variable(const char *name, VALUE *var)
-
-ã“ã®é–¢æ•°ã¯Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹å¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾ã™ï¼Žå¤‰æ•°åãŒ
-`$'ã§å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®å€¤ã‚’変
-æ›´ã™ã‚‹ã¨è‡ªå‹•çš„ã«Rubyã®å¯¾å¿œã™ã‚‹å¤‰æ•°ã®å€¤ã‚‚変ã‚りã¾ã™ï¼Ž
-
-ã¾ãŸRubyå´ã‹ã‚‰ã¯æ›´æ–°ã§ããªã„変数もã‚りã¾ã™ï¼Žã“ã®read onlyã®
-変数ã¯ä»¥ä¸‹ã®é–¢æ•°ã§å®šç¾©ã—ã¾ã™ï¼Ž
-
- void rb_define_readonly_variable(const char *name, VALUE *var)
-
-ã“れら変数ã®ä»–ã«hookã‚’ã¤ã‘ãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã§ãã¾ã™ï¼Žhook付ã
-ã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’用ã„ã¦å®šç¾©ã—ã¾ã™ï¼Žhook付ã大域変数ã®
-値ã®å‚照や設定ã¯hookã§è¡Œã†å¿…è¦ãŒã‚りã¾ã™ï¼Ž
-
- void rb_define_hooked_variable(const char *name, VALUE *var,
- VALUE (*getter)(), void (*setter)())
-
-ã“ã®é–¢æ•°ã¯Cã®é–¢æ•°ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾
-ã™ï¼Žå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯é–¢æ•°getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•れ
-ãŸæ™‚ã«ã¯é–¢æ•°setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žhookを指定ã—ãªã„å ´åˆã¯getterã‚„
-setterã«0を指定ã—ã¾ã™ï¼Ž
-# getterã‚‚setterã‚‚0ãªã‚‰ã°rb_define_variable()ã¨åŒã˜ã«ãªã‚‹ï¼Ž
-
-getterã¨setterã®ä»•æ§˜ã¯æ¬¡ã®é€šã‚Šã§ã™ï¼Ž
-
- VALUE (*getter)(ID id, VALUE *var);
- void (*setter)(VALUE val, ID id, VALUE *var);
-
-
-ãれã‹ã‚‰ï¼Œå¯¾å¿œã™ã‚‹Cã®å¤‰æ•°ã‚’æŒãŸãªã„Rubyã®å¤§åŸŸå¤‰æ•°ã‚’定義ã™ã‚‹
-ã“ã¨ã‚‚ã§ãã¾ã™. ãã®å¤‰æ•°ã®å€¤ã¯ãƒ•ック関数ã®ã¿ã«ã‚ˆã£ã¦å–得・設定
-ã•れã¾ã™.
-
- void rb_define_virtual_variable(const char *name,
- VALUE (*getter)(), void (*setter)())
-
-ã“ã®é–¢æ•°ã«ã‚ˆã£ã¦å®šç¾©ã•れãŸRubyã®å¤§åŸŸå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯
-getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œã¾ã™ï¼Ž
-
-getterã¨setterã®ä»•様ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
-
- (*getter)(ID id);
- (*setter)(VALUE val, ID id);
-
-== Cã®ãƒ‡ãƒ¼ã‚¿ã‚’Rubyオブジェクトã«ã™ã‚‹
-
-Cã®ä¸–界ã§å®šç¾©ã•れãŸãƒ‡ãƒ¼ã‚¿(構造体)ã‚’Rubyã®ã‚ªãƒ–ジェクトã¨ã—ã¦
-å–り扱ã„ãŸã„å ´åˆãŒã‚りãˆã¾ã™ï¼Žã“ã®ã‚ˆã†ãªå ´åˆã«ã¯ï¼ŒDataã¨ã„ã†
-Rubyオブジェクトã«Cã®æ§‹é€ ä½“(ã¸ã®ãƒã‚¤ãƒ³ã‚¿)ã‚’ãã‚‹ã‚€ã“ã¨ã§Ruby
-オブジェクトã¨ã—ã¦å–り扱ãˆã‚‹ã‚ˆã†ã«ãªã‚Šã¾ã™ï¼Ž
-
-Dataオブジェクトを生æˆã—ã¦æ§‹é€ ä½“ã‚’Rubyオブジェクトã«ã‚«ãƒ—セル
-化ã™ã‚‹ãŸã‚ã«ã¯ï¼Œä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’使ã„ã¾ã™ï¼Ž
-
- Data_Wrap_Struct(klass, mark, free, sval)
-
-ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸDataオブジェクトã§ã™ï¼Ž
-
-klassã¯ã“ã®Dataオブジェクトã®ã‚¯ãƒ©ã‚¹ã§ã™ï¼Žmarkã¯ã“ã®æ§‹é€ ä½“ãŒ
-Rubyã®ã‚ªãƒ–ジェクトã¸ã®å‚ç…§ãŒã‚る時ã«ä½¿ã†é–¢æ•°ã§ã™ï¼Žãã®ã‚ˆã†ãª
-å‚ç…§ã‚’å«ã¾ãªã„時ã«ã¯0を指定ã—ã¾ã™ï¼Ž
-
-# ãã®ã‚ˆã†ãªå‚ç…§ã¯å‹§ã‚られã¾ã›ã‚“.
-
-freeã¯ã“ã®æ§‹é€ ä½“ãŒã‚‚ã†ä¸è¦ã«ãªã£ãŸæ™‚ã«å‘¼ã°ã‚Œã‚‹é–¢æ•°ã§ã™ï¼Žã“ã®
-関数ãŒã‚¬ãƒ¼ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚¿ã‹ã‚‰å‘¼ã°ã‚Œã¾ã™ï¼Žã“れãŒ-1ã®å ´åˆã¯ï¼Œå˜
-ç´”ã«é–‹æ”¾ã•れã¾ã™ï¼Ž
-
-markãŠã‚ˆã³free関数ã¯GC実行中ã«å‘¼ã³å‡ºã•れã¾ã™.
-ãªãŠ, GC実行中ã¯Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã¯ç¦æ­¢ã•れã¾
-ã™. よã£ã¦, markãŠã‚ˆã³free関数ã§Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·
-ョンã¯è¡Œã‚ãªã„ã§ãã ã•ã„.
-
-Cã®æ§‹é€ ä½“ã®å‰²å½“ã¨Dataオブジェクトã®ç”Ÿæˆã‚’åŒæ™‚ã«è¡Œã†ãƒžã‚¯ãƒ­ã¨
-ã—ã¦ä»¥ä¸‹ã®ã‚‚ã®ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Ž
-
- Data_Make_Struct(klass, type, mark, free, sval)
-
-ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸDataオブジェクトã§ã™ï¼Žã“ã®ãƒžã‚¯
-ロã¯ä»¥ä¸‹ã®å¼ã®ã‚ˆã†ã«åƒãã¾ã™:
-
- (sval = ALLOC(type), Data_Wrap_Struct(klass, mark, free, sval))
-
-klass, mark, freeã¯Data_Wrap_Structã¨åŒã˜åƒãã‚’ã—ã¾ã™ï¼Žtype
-ã¯å‰²ã‚Šå½“ã¦ã‚‹C構造体ã®åž‹ã§ã™ï¼Žå‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸæ§‹é€ ä½“ã¯å¤‰æ•°sval
-ã«ä»£å…¥ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®åž‹ã¯ (type*) ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
-
-Dataオブジェクトã‹ã‚‰ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã™ã®ã¯ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’用ã„
-ã¾ã™ï¼Ž
-
- Data_Get_Struct(obj, type, sval)
-
-Cã®æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã¯å¤‰æ•°svalã«ä»£å…¥ã•れã¾ã™ï¼Ž
-
-ã“れらã®Dataã®ä½¿ã„æ–¹ã¯ã¡ã‚‡ã£ã¨åˆ†ã‹ã‚Šã«ãã„ã®ã§ï¼Œå¾Œã§èª¬æ˜Žã™ã‚‹
-例題をå‚ç…§ã—ã¦ãã ã•ã„.
-
-= 例題 - dbmパッケージを作る
-
-ã“ã“ã¾ã§ã®èª¬æ˜Žã§ã¨ã‚Šã‚ãˆãšæ‹¡å¼µãƒ©ã‚¤ãƒ–ãƒ©ãƒªã¯ä½œã‚Œã‚‹ã¯ãšã§ã™ï¼Ž
-Rubyã®extディレクトリã«ã™ã§ã«å«ã¾ã‚Œã¦ã„ã‚‹dbmライブラリを例ã«
-ã—ã¦æ®µéšŽçš„ã«èª¬æ˜Žã—ã¾ã™ï¼Ž
-
-== ディレクトリを作る
-
- % mkdir ext/dbm
-
-Ruby 1.1ã‹ã‚‰ã¯ä»»æ„ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ãƒ©ã‚¤ãƒ–ラリを作
-ã‚‹ã“ã¨ãŒã§ãるよã†ã«ãªã‚Šã¾ã—ãŸï¼ŽRubyã«é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹å ´åˆã«
-ã¯Rubyを展開ã—ãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ï¼Œextディレクトリã®ä¸­ã«æ‹¡å¼µ
-ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’作る必è¦ãŒã‚りã¾ã™ï¼Žåå‰ã¯é©å½“ã«
-é¸ã‚“ã§æ§‹ã„ã¾ã›ã‚“.
-
-== 設計ã™ã‚‹
-
-ã¾ã‚,当然ãªã‚“ã§ã™ã‘ã©ï¼Œã©ã†ã„ã†æ©Ÿèƒ½ã‚’実ç¾ã™ã‚‹ã‹ã©ã†ã‹ã¾ãšè¨­
-計ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Žã©ã‚“ãªã‚¯ãƒ©ã‚¹ã‚’ã¤ãã‚‹ã‹ï¼Œãã®ã‚¯ãƒ©ã‚¹ã«ã¯
-ã©ã‚“ãªãƒ¡ã‚½ãƒƒãƒ‰ãŒã‚ã‚‹ã‹ï¼Œã‚¯ãƒ©ã‚¹ãŒæä¾›ã™ã‚‹å®šæ•°ãªã©ã«ã¤ã„ã¦è¨­è¨ˆ
-ã—ã¾ã™ï¼Ž
-
-== Cコードを書ã
-
-拡張ライブラリ本体ã¨ãªã‚‹C言語ã®ã‚½ãƒ¼ã‚¹ã‚’書ãã¾ã™ï¼ŽC言語ã®ã‚½ãƒ¼
-スãŒã²ã¨ã¤ã®æ™‚ã«ã¯ã€Œãƒ©ã‚¤ãƒ–ラリå.cã€ã‚’é¸ã¶ã¨è‰¯ã„ã§ã—ょã†ï¼ŽC
-言語ã®ã‚½ãƒ¼ã‚¹ãŒè¤‡æ•°ã®å ´åˆã«ã¯é€†ã«ã€Œãƒ©ã‚¤ãƒ–ラリå.cã€ã¨ã„ã†ãƒ•ã‚¡
-イルåã¯é¿ã‘ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Žã‚ªãƒ–ジェクトファイルã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼
-ãƒ«ç”Ÿæˆæ™‚ã«ä¸­é–“çš„ã«ç”Ÿæˆã•れる「ライブラリå.oã€ã¨ã„ã†ãƒ•ァイル
-ã¨ãŒè¡çªã™ã‚‹ã‹ã‚‰ã§ã™ï¼Žã¾ãŸï¼Œå¾Œè¿°ã™ã‚‹ mkmf ライブラリã®ã„ãã¤
-ã‹ã®é–¢æ•°ãŒã‚³ãƒ³ãƒ‘イルをè¦ã™ã‚‹ãƒ†ã‚¹ãƒˆã®ãŸã‚ã«ã€Œconftest.cã€ã¨ã„
-ã†ãƒ•ァイルåを使用ã™ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„.ソースファイル
-åã¨ã—ã¦ã€Œconftest.cã€ã‚’使用ã—ã¦ã¯ãªã‚Šã¾ã›ã‚“.
-
-Rubyã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリをロードã™ã‚‹æ™‚ã«ã€ŒInit_ライブラリåã€ã¨
-ã„ã†é–¢æ•°ã‚’自動的ã«å®Ÿè¡Œã—ã¾ã™ï¼Ždbmライブラリã®å ´åˆã€ŒInit_dbmã€
-ã§ã™ï¼Žã“ã®é–¢æ•°ã®ä¸­ã§ã‚¯ãƒ©ã‚¹ï¼Œãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ï¼Œãƒ¡ã‚½ãƒƒãƒ‰ï¼Œå®šæ•°ãªã©ã®
-定義を行ã„ã¾ã™ï¼Ždbm.cã‹ã‚‰ä¸€éƒ¨å¼•用ã—ã¾ã™ï¼Ž
-
- void
- Init_dbm(void)
- {
- /* DBMクラスを定義ã™ã‚‹ */
- cDBM = rb_define_class("DBM", rb_cObject);
- /* DBMã¯Enumerateモジュールをインクルードã™ã‚‹ */
- rb_include_module(cDBM, rb_mEnumerable);
-
- /* DBMクラスã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰open(): 引数ã¯Cã®é…列ã§å—ã‘ã‚‹ */
- rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
-
- /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰close(): 引数ã¯ãªã— */
- rb_define_method(cDBM, "close", fdbm_close, 0);
- /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰[]: 引数ã¯1個 */
- rb_define_method(cDBM, "[]", fdbm_fetch, 1);
-
- /* ... */
-
- /* DBMデータを格ç´ã™ã‚‹ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°åã®ãŸã‚ã®ID */
- id_dbm = rb_intern("dbm");
- }
-
-DBMライブラリã¯dbmã®ãƒ‡ãƒ¼ã‚¿ã¨å¯¾å¿œã™ã‚‹ã‚ªãƒ–ジェクトã«ãªã‚‹ã¯ãšã§
-ã™ã‹ã‚‰ï¼ŒCã®ä¸–界ã®dbmã‚’Rubyã®ä¸–界ã«å–り込む必è¦ãŒã‚りã¾ã™ï¼Ž
-
-dbm.cã§ã¯Data_Make_Structを以下ã®ã‚ˆã†ã«ä½¿ã£ã¦ã„ã¾ã™ï¼Ž
-
- struct dbmdata {
- int di_size;
- DBM *di_dbm;
- };
-
-
- obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
-
-ã“ã“ã§ã¯dbmstruct構造体ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã‚’Dataã«ã‚«ãƒ—セル化ã—ã¦ã„
-ã¾ã™ï¼ŽDBM*を直接カプセル化ã—ãªã„ã®ã¯close()ã—ãŸæ™‚ã®å‡¦ç†ã‚’考
-ãˆã¦ã®ã“ã¨ã§ã™ï¼Ž
-
-Dataオブジェクトã‹ã‚‰dbmstruct構造体ã®ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã™ãŸã‚
-ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’使ã£ã¦ã„ã¾ã™ï¼Ž
-
- #define GetDBM(obj, dbmp) {\
- Data_Get_Struct(obj, struct dbmdata, dbmp);\
- if (dbmp->di_dbm == 0) closed_dbm();\
- }
-
-ã¡ã‚‡ã£ã¨è¤‡é›‘ãªãƒžã‚¯ãƒ­ã§ã™ãŒï¼Œè¦ã™ã‚‹ã«dbmdata構造体ã®ãƒã‚¤ãƒ³ã‚¿
-ã®å–り出ã—ã¨ï¼Œcloseã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ã®ãƒã‚§ãƒƒã‚¯ã‚’ã¾ã¨ã‚ã¦ã„
-ã‚‹ã ã‘ã§ã™ï¼Ž
-
-DBMクラスã«ã¯ãŸãã•んメソッドãŒã‚りã¾ã™ãŒï¼Œåˆ†é¡žã™ã‚‹ã¨3種類ã®
-引数ã®å—ã‘æ–¹ãŒã‚りã¾ã™ï¼Žã²ã¨ã¤ã¯å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚‚ã®ã§ï¼Œä¾‹ã¨
-ã—ã¦ã¯deleteメソッドãŒã‚りã¾ã™ï¼Ždeleteメソッドを実装ã—ã¦ã„ã‚‹
-fdbm_delete()ã¯ã“ã®ã‚ˆã†ã«ãªã£ã¦ã„ã¾ã™ï¼Ž
-
- static VALUE
- fdbm_delete(VALUE obj, VALUE keystr)
- {
- /* ... */
- }
-
-å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚¿ã‚¤ãƒ—ã¯ç¬¬1引数ãŒself,第2引数以é™ãŒãƒ¡ã‚½ãƒƒãƒ‰
-ã®å¼•æ•°ã¨ãªã‚Šã¾ã™ï¼Ž
-
-å¼•æ•°ã®æ•°ãŒä¸å®šã®ã‚‚ã®ã¯Cã®é…列ã§å—ã‘ã‚‹ã‚‚ã®ã¨Rubyã®é…列ã§å—ã‘
-ã‚‹ã‚‚ã®ã¨ãŒã‚りã¾ã™ï¼Ždbmライブラリã®ä¸­ã§ï¼ŒCã®é…列ã§å—ã‘ã‚‹ã‚‚ã®
-ã¯DBMã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚‹open()ã§ã™ï¼Žã“れを実装ã—ã¦ã„ã‚‹é–¢
-æ•°fdbm_s_open()ã¯ã“ã†ãªã£ã¦ã„ã¾ã™ï¼Ž
-
- static VALUE
- fdbm_s_open(int argc, VALUE *argv, VALUE klass)
- {
- /* ... */
-
- if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
- mode = 0666; /* default value */
- }
-
- /* ... */
- }
-
-ã“ã®ã‚¿ã‚¤ãƒ—ã®é–¢æ•°ã¯ç¬¬1引数ãŒä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ï¼Œç¬¬2引数ãŒä¸Žãˆ
-られãŸå¼•æ•°ã®å…¥ã£ã¦ã„ã‚‹é…列ã«ãªã‚Šã¾ã™ï¼Žselfã¯ç¬¬3引数ã¨ã—ã¦ä¸Ž
-ãˆã‚‰ã‚Œã¾ã™ï¼Ž
-
-ã“ã®é…列ã§ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã‚’è§£æžã™ã‚‹ãŸã‚ã®é–¢æ•°ãŒopen()ã§ã‚‚使ã‚
-れã¦ã„ã‚‹rb_scan_args()ã§ã™ï¼Žç¬¬3å¼•æ•°ã«æŒ‡å®šã—ãŸãƒ•ォーマットã«å¾“
-ã„,第4変数以é™ã«æŒ‡å®šã—ãŸVALUEã¸ã®å‚ç…§ã«å€¤ã‚’代入ã—ã¦ãれã¾
-ã™ï¼Ž
-
-
-引数をRubyã®é…列ã¨ã—ã¦å—ã‘å–るメソッドã®ä¾‹ã«ã¯
-Thread#initializeãŒã‚りã¾ã™ï¼Žå®Ÿè£…ã¯ã“ã†ã§ã™ï¼Ž
-
- static VALUE
- thread_initialize(VALUE thread, VALUE args)
- {
- /* ... */
- }
-
-第1引数ã¯self,第2引数ã¯Rubyã®é…列ã§ã™ï¼Ž
-
-*注æ„事項*
-
-Rubyã¨å…±æœ‰ã¯ã—ãªã„ãŒRubyã®ã‚ªãƒ–ジェクトを格ç´ã™ã‚‹å¯èƒ½æ€§ã®ã‚ã‚‹
-Cã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦Rubyインタプリタã«å¤‰æ•°ã®å­˜åœ¨
-ã‚’æ•™ãˆã¦ã‚ã’ã¦ãã ã•ã„.ã§ãªã„ã¨GCã§ãƒˆãƒ©ãƒ–ルを起ã“ã—ã¾ã™ï¼Ž
-
- void rb_global_variable(VALUE *var)
-
-== extconf.rbを用æ„ã™ã‚‹
-
-Makefileを作る場åˆã®é››åž‹ã«ãªã‚‹extconf.rbã¨ã„ã†ãƒ•ァイルを作り
-ã¾ã™ï¼Žextconf.rbã¯ãƒ©ã‚¤ãƒ–ラリã®ã‚³ãƒ³ãƒ‘イルã«å¿…è¦ãªæ¡ä»¶ã®ãƒã‚§ãƒƒ
-クãªã©ã‚’行ã†ã“ã¨ãŒç›®çš„ã§ã™ï¼Žã¾ãšï¼Œ
-
- require 'mkmf'
-
-ã‚’extconf.rbã®å…ˆé ­ã«ç½®ãã¾ã™ï¼Žextconf.rbã®ä¸­ã§ã¯ä»¥ä¸‹ã®Rubyé–¢
-数を使ã†ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Ž
-
- 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: リンクã•れるオブジェクトファイルåã®ãƒªã‚¹ãƒˆ
-
-オブジェクトファイルã®ãƒªã‚¹ãƒˆã¯ï¼Œé€šå¸¸ã¯ã‚½ãƒ¼ã‚¹ãƒ•ァイルを検索ã—
-ã¦è‡ªå‹•çš„ã«ç”Ÿæˆã•れã¾ã™ãŒï¼Œmakeã®é€”中ã§ã‚½ãƒ¼ã‚¹ã‚’生æˆã™ã‚‹ã‚ˆã†ãª
-å ´åˆã¯æ˜Žç¤ºçš„ã«æŒ‡å®šã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
-
-ライブラリをコンパイルã™ã‚‹æ¡ä»¶ãŒæƒã‚ãšï¼Œãã®ãƒ©ã‚¤ãƒ–ラリをコン
-パイルã—ãªã„時ã«ã¯create_makefileを呼ã°ãªã‘れã°Makefileã¯ç”Ÿ
-æˆã•れãšï¼Œã‚³ãƒ³ãƒ‘イルも行ã‚れã¾ã›ã‚“.
-
-== dependを用æ„ã™ã‚‹
-
-ã‚‚ã—,ディレクトリã«dependã¨ã„ã†ãƒ•ァイルãŒå­˜åœ¨ã™ã‚Œã°ï¼Œ
-MakefileãŒä¾å­˜é–¢ä¿‚ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¦ãれã¾ã™ï¼Ž
-
- % gcc -MM *.c > depend
-
-ãªã©ã§ä½œã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã‚ã£ã¦æã¯ç„¡ã„ã§ã—ょã†ï¼Ž
-
-== Makefileを生æˆã™ã‚‹
-
-Makefileを実際ã«ç”Ÿæˆã™ã‚‹ãŸã‚ã«ã¯
-
- ruby extconf.rb
-
-ã¨ã—ã¾ã™ï¼Žextconf.rbã« require 'mkmf' ã®è¡ŒãŒãªã„å ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼
-ã«ãªã‚Šã¾ã™ã®ã§ï¼Œå¼•数を追加ã—ã¦
-
- ruby -r mkmf extconf.rb
-
-ã¨ã—ã¦ãã ã•ã„.
-
-site_ruby ディレクトリã§ãªã,
-vendor_ruby ディレクトリã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã™ã‚‹å ´åˆã«ã¯
-以下ã®ã‚ˆã†ã« --vendor オプションを加ãˆã¦ãã ã•ã„.
-
- ruby extconf.rb --vendor
-
-ディレクトリをext以下ã«ç”¨æ„ã—ãŸå ´åˆã«ã¯Ruby全体ã®makeã®æ™‚ã«
-自動的ã«MakefileãŒç”Ÿæˆã•れã¾ã™ã®ã§ï¼Œã“ã®ã‚¹ãƒ†ãƒƒãƒ—ã¯ä¸è¦ã§ã™ï¼Ž
-
-== makeã™ã‚‹
-
-動的リンクライブラリを生æˆã™ã‚‹å ´åˆã«ã¯ãã®å ´ã§makeã—ã¦ãã ã•
-ã„.必è¦ã§ã‚れ㰠make install ã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¾ã™ï¼Ž
-
-ext以下ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’用æ„ã—ãŸå ´åˆã¯ï¼ŒRubyã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§
-makeを実行ã™ã‚‹ã¨Makefileを生æˆã‹ã‚‰make,必è¦ã«ã‚ˆã£ã¦ã¯ãã®ãƒ¢
-ジュールã®Rubyã¸ã®ãƒªãƒ³ã‚¯ã¾ã§è‡ªå‹•çš„ã«å®Ÿè¡Œã—ã¦ãれã¾ã™ï¼Ž
-extconf.rbã‚’æ›¸ãæ›ãˆã‚‹ãªã©ã—ã¦Makefileã®å†ç”ŸæˆãŒå¿…è¦ãªæ™‚ã¯ã¾
-ãŸRubyディレクトリã§makeã—ã¦ãã ã•ã„.
-
-拡張ライブラリã¯make installã§Rubyライブラリã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®
-下ã«ã‚³ãƒ”ーã•れã¾ã™ï¼Žã‚‚ã—æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨å”調ã—ã¦ä½¿ã†Rubyã§è¨˜
-è¿°ã•れãŸãƒ—ログラムãŒã‚り,Rubyライブラリã«ç½®ããŸã„å ´åˆã«ã¯ï¼Œ
-拡張ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ã« lib ã¨ã„ã†ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª
-を作り,ãã“ã« æ‹¡å¼µå­ .rb ã®ãƒ•ァイルを置ã„ã¦ãŠã‘ã°åŒæ™‚ã«ã‚¤ãƒ³
-ストールã•れã¾ã™ï¼Ž
-
-== デãƒãƒƒã‚°
-
-ã¾ã‚,デãƒãƒƒã‚°ã—ãªã„ã¨å‹•ã‹ãªã„ã§ã—ょã†ã­ï¼Žext/Setupã«ãƒ‡ã‚£ãƒ¬
-クトリåを書ãã¨é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹ã®ã§ãƒ‡ãƒãƒƒã‚¬ãŒä½¿ãˆã‚‹ã‚ˆã†ã«ãª
-りã¾ã™ï¼Žãã®åˆ†ã‚³ãƒ³ãƒ‘イルãŒé…ããªã‚Šã¾ã™ã‘ã©ï¼Ž
-
-== ã§ãã‚ãŒã‚Š
-
-後ã¯ã“ã£ãり使ã†ãªã‚Šï¼Œåºƒã公開ã™ã‚‹ãªã‚Šï¼Œå£²ã‚‹ãªã‚Šï¼Œã”自由ã«ãŠ
-使ã„ãã ã•ã„.Rubyã®ä½œè€…ã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«é–¢ã—ã¦ä¸€åˆ‡ã®æ¨©åˆ©ã‚’
-主張ã—ã¾ã›ã‚“.
-
-= Appendix A. Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®åˆ†é¡ž
-
-Rubyã®ã‚½ãƒ¼ã‚¹ã¯ã„ãã¤ã‹ã«åˆ†é¡žã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã“ã®ã†ã¡ã‚¯ãƒ©
-スライブラリã®éƒ¨åˆ†ã¯åŸºæœ¬çš„ã«æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨åŒã˜ä½œã‚Šæ–¹ã«ãªã£
-ã¦ã„ã¾ã™ï¼Žã“れらã®ã‚½ãƒ¼ã‚¹ã¯ä»Šã¾ã§ã®èª¬æ˜Žã§ã»ã¨ã‚“ã©ç†è§£ã§ãã‚‹ã¨
-æ€ã„ã¾ã™ï¼Ž
-
-== Ruby言語ã®ã‚³ã‚¢
-
-class.c :: クラスã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«
-error.c :: 例外クラスã¨ä¾‹å¤–機構
-gc.c :: 記憶領域管ç†
-load.c :: ライブラリã®ãƒ­ãƒ¼ãƒ‰
-object.c :: オブジェクト
-variable.c :: 変数ã¨å®šæ•°
-
-== Rubyã®æ§‹æ–‡è§£æžå™¨
-
- parse.y : å­—å¥è§£æžå™¨ã¨æ§‹æ–‡å®šç¾©
- -> parse.c : 自動生æˆ
- keywords : 予約語
- -> lex.c : 自動生æˆ
-
-== 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 : åŒä¸Š
- vm.c
- vm_dump.c
- vm_eval.c
- vm_exec.c
- vm_insnhelper.c
- vm_method.c
-
- opt_insns_unif.def : 命令èžåˆ
- opt_operand.def : 最é©åŒ–ã®ãŸã‚ã®å®šç¾©
-
- -> insn*.inc : 自動生æˆ
- -> opt*.inc : 自動生æˆ
- -> vm.inc : 自動生æˆ
-
-== æ­£è¦è¡¨ç¾ã‚¨ãƒ³ã‚¸ãƒ³ (鬼車)
-
- regex.c
- regcomp.c
- regenc.c
- regerror.c
- regexec.c
- regparse.c
- regsyntax.c
-
-== ユーティリティ関数
-
-debug.c :: Cデãƒãƒƒã‚¬ç”¨ã®ãƒ‡ãƒãƒƒã‚°ã‚·ãƒ³ãƒœãƒ«
-dln.c :: 動的ローディング
-st.c :: 汎用ãƒãƒƒã‚·ãƒ¥è¡¨
-strftime.c :: 時刻整形
-util.c :: ãã®ä»–ã®ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£
-
-== Rubyコマンドã®å®Ÿè£…
-
- dmyext.c
- dmydln.c
- dmyencoding.c
- id.c
- inits.c
- main.c
- ruby.c
- version.c
-
- gem_prelude.rb
- prelude.rb
-
-== クラスライブラリ
-
-array.c :: Array
-bignum.c :: Bignum
-compar.c :: Comparable
-complex.c :: Complex
-cont.c :: Fiber, Continuation
-dir.c :: Dir
-enum.c :: Enumerable
-enumerator.c :: Enumerator
-file.c :: File
-hash.c :: Hash
-io.c :: IO
-marshal.c :: Marshal
-math.c :: Math
-numeric.c :: Numeric, Integer, Fixnum, Float
-pack.c :: Array#pack, String#unpack
-proc.c :: Binding, Proc
-process.c :: Process
-random.c :: 乱数
-range.c :: Range
-rational.c :: Rational
-re.c :: Regexp, MatchData
-signal.c :: Signal
-sprintf.c :: String#sprintf
-string.c :: String
-struct.c :: Struct
-time.c :: Time
-defs/known_errors.def :: 例外クラス Errno::*
--> known_errors.inc :: 自動生æˆ
-
-== 多言語化
-
-encoding.c :: Encoding
-transcode.c :: Encoding::Converter
-enc/*.c :: エンコーディングクラス群
-enc/trans/* :: コードãƒã‚¤ãƒ³ãƒˆå¯¾å¿œè¡¨
-
-== gorubyコマンドã®å®Ÿè£…
-
- goruby.c
- golf_prelude.rb : goruby固有ã®ãƒ©ã‚¤ãƒ–ラリ
- -> golf_prelude.c : 自動生æˆ
-
-= Appendix B. 拡張用関数リファレンス
-
-C言語ã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’利用ã™ã‚‹APIã¯ä»¥ä¸‹ã®é€šã‚Šã§ã‚る.
-
-== åž‹
-
-VALUE ::
-
- Rubyオブジェクトを表ç¾ã™ã‚‹åž‹ï¼Žå¿…è¦ã«å¿œã˜ã¦ã‚­ãƒ£ã‚¹ãƒˆã—ã¦ç”¨ã„る.
- 組ã¿è¾¼ã¿åž‹ã‚’表ç¾ã™ã‚‹Cã®åž‹ã¯ruby.hã«è¨˜è¿°ã—ã¦ã‚ã‚‹Rã§å§‹ã¾ã‚‹æ§‹é€ 
- 体ã§ã‚る.VALUE型をã“れらã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ãŸã‚ã«Rã§å§‹ã¾ã‚‹æ§‹é€ ä½“
- åã‚’å…¨ã¦å¤§æ–‡å­—ã«ã—ãŸåå‰ã®ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„る.
-
-== 変数・定数
-
-Qnil ::
-
- 定数: nilオブジェクト
-
-Qtrue ::
-
- 定数: trueオブジェクト(真ã®ãƒ‡ãƒ•ォルト値)
-
-Qfalse ::
-
- 定数: falseオブジェクト
-
-== Cデータã®ã‚«ãƒ—セル化
-
-Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
-
- Cã®ä»»æ„ã®ãƒã‚¤ãƒ³ã‚¿ã‚’カプセル化ã—ãŸRubyオブジェクトを返ã™ï¼Žã“
- ã®ãƒã‚¤ãƒ³ã‚¿ãŒRubyã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã•れãªããªã£ãŸæ™‚,freeã§æŒ‡å®šã—ãŸ
- 関数ãŒå‘¼ã°ã‚Œã‚‹ï¼Žã¾ãŸï¼Œã“ã®ãƒã‚¤ãƒ³ã‚¿ã®æŒ‡ã™ãƒ‡ãƒ¼ã‚¿ãŒä»–ã®Rubyオブ
- ジェクトを指ã—ã¦ã„ã‚‹å ´åˆï¼Œmarkã«æŒ‡å®šã™ã‚‹é–¢æ•°ã§ãƒžãƒ¼ã‚¯ã™ã‚‹å¿…è¦
- ãŒã‚る.
-
-Data_Make_Struct(klass, type, mark, free, sval) ::
-
- typeåž‹ã®ãƒ¡ãƒ¢ãƒªã‚’mallocã—,変数svalã«ä»£å…¥ã—ãŸå¾Œï¼Œãれをカプセ
- ル化ã—ãŸãƒ‡ãƒ¼ã‚¿ã‚’è¿”ã™ãƒžã‚¯ãƒ­ï¼Ž
-
-Data_Get_Struct(data, type, sval) ::
-
- dataã‹ã‚‰typeåž‹ã®ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã—変数svalã«ä»£å…¥ã™ã‚‹ãƒžã‚¯ãƒ­ï¼Ž
-
-== åž‹ãƒã‚§ãƒƒã‚¯
-
- TYPE(value)
- FIXNUM_P(value)
- NIL_P(value)
- void Check_Type(VALUE value, int type)
- SafeStringValue(value)
-
-== 型変æ›
-
- FIX2INT(value), INT2FIX(i)
- FIX2LONG(value), LONG2FIX(l)
- NUM2INT(value), INT2NUM(i)
- NUM2UINT(value), UINT2NUM(ui)
- NUM2LONG(value), LONG2NUM(l)
- NUM2ULONG(value), ULONG2NUM(ul)
- NUM2LL(value), LL2NUM(ll)
- NUM2ULL(value), ULL2NUM(ull)
- NUM2OFFT(value), OFFT2NUM(off)
- NUM2SIZET(value), SIZET2NUM(size)
- NUM2SSIZET(value), SSIZET2NUM(ssize)
- rb_integer_pack(value, words, numwords, wordsize, nails, flags), rb_integer_unpack(words, numwords, wordsize, nails, flags)
- NUM2DBL(value)
- rb_float_new(f)
- StringValue(value)
- StringValuePtr(value)
- StringValueCStr(value)
- rb_str_new2(s)
-
-== クラス/モジュール定義
-
-VALUE rb_define_class(const char *name, VALUE super) ::
-
- superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã™ã‚‹ï¼Ž
-
-VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
-
- superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã—,moduleã®
- 定数ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
-
-VALUE rb_define_module(const char *name) ::
-
- æ–°ã—ã„Rubyモジュールを定義ã™ã‚‹ï¼Ž
-
-VALUE rb_define_module_under(VALUE module, const char *name) ::
-
- æ–°ã—ã„Rubyモジュールを定義ã—,moduleã®å®šæ•°ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
-
-void rb_include_module(VALUE klass, VALUE module) ::
-
- モジュールをインクルードã™ã‚‹ï¼ŽclassãŒã™ã§ã«moduleをインク
- ルードã—ã¦ã„る時ã«ã¯ä½•ã‚‚ã—ãªã„(多é‡ã‚¤ãƒ³ã‚¯ãƒ«ãƒ¼ãƒ‰ã®ç¦æ­¢).
-
-void rb_extend_object(VALUE object, VALUE module) ::
-
- オブジェクトをモジュール(ã§å®šç¾©ã•れã¦ã„るメソッド)ã§æ‹¡å¼µã™ã‚‹ï¼Ž
-
-== 大域変数定義
-
-void rb_define_variable(const char *name, VALUE *var) ::
-
- Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°åãŒ`$'ã§
- å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れる.nameã¨ã—ã¦Rubyã®è­˜åˆ¥å­
- ã¨ã—ã¦è¨±ã•れãªã„文字(例ãˆã°` ')ã‚’å«ã‚€å ´åˆã«ã¯Rubyプログラ
- ムã‹ã‚‰ã¯è¦‹ãˆãªããªã‚‹ï¼Ž
-
-void rb_define_readonly_variable(const char *name, VALUE *var) ::
-
- Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹read onlyã®ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Ž
- read onlyã§ã‚ã‚‹ã“ã¨ä»¥å¤–ã¯rb_define_variable()ã¨åŒã˜ï¼Ž
-
-void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
-
- 関数ã«ã‚ˆã£ã¦å®Ÿç¾ã•れるRuby変数を定義ã™ã‚‹ï¼Žå¤‰æ•°ãŒå‚ç…§ã•れãŸ
- 時ã«ã¯getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œ
- る.
-
-void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
-
- 関数ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°
- ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯getterãŒï¼Œé–¢æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯
- setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žgetterã‚„setterã«0を指定ã—ãŸæ™‚ã«ã¯hookã‚’
- 指定ã—ãªã„ã®ã¨åŒã˜äº‹ã«ãªã‚‹ï¼Ž
-
-void rb_global_variable(VALUE *var)
-
- 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) ::
-
- メソッドを定義ã™ã‚‹ï¼Ž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()ã¨åŒã˜ï¼Ž
-
-rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-
- 特異メソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
-
-rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
-
- argc, argvå½¢å¼ã§ä¸Žãˆã‚‰ã‚ŒãŸæŒ‡å®šã•れãŸãƒ•ォーマットã«å¾“ã£ã¦å¼•
- 数を分解ã—,続ãVALUEã¸ã®å‚ç…§ã«ã‚»ãƒƒãƒˆã—ã¾ã™ï¼Žã“ã®ãƒ•ォーマッ
- トã¯ï¼ŒABNFã§è¨˜è¿°ã™ã‚‹ã¨ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
-
- scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
-
- param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
- pre-opt-post-arg-spec
- pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
- post-arg-spec := sym-for-variable-length-args
- [num-of-trailing-mandatory-args]
- pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
- num-of-trailing-mandatory-args
- 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 := "&" ; イテレータブロックをå–å¾—ã™ã‚‹ãŸã‚ã®
- ; 指定
-
- フォーマットãŒ"12"ã®å ´åˆï¼Œå¼•æ•°ã¯æœ€ä½Ž1ã¤ã§ï¼Œ3ã¤(1+2)ã¾ã§è¨±ã•
- れるã¨ã„ã†æ„味ã«ãªã‚Šã¾ã™ï¼Žå¾“ã£ã¦ï¼Œãƒ•ォーマット文字列ã«ç¶šã„
- ã¦3ã¤ã®VALUEã¸ã®å‚ç…§ã‚’ç½®ãå¿…è¦ãŒã‚りã¾ã™ï¼Žãれらã«ã¯å–å¾—ã—ãŸ
- 変数ãŒã‚»ãƒƒãƒˆã•れã¾ã™ï¼Žå¤‰æ•°ã¸ã®å‚ç…§ã®ä»£ã‚りã«NULLを指定ã™ã‚‹
- ã“ã¨ã‚‚ã§ã,ãã®å ´åˆã¯å–å¾—ã—ãŸå¼•æ•°ã®å€¤ã¯æ¨ã¦ã‚‰ã‚Œã¾ã™ï¼ŽãªãŠï¼Œ
- çœç•¥å¯èƒ½å¼•æ•°ãŒçœç•¥ã•ã‚ŒãŸæ™‚ã®å¤‰æ•°ã®å€¤ã¯nil(C言語ã®ãƒ¬ãƒ™ãƒ«ã§ã¯
- Qnil)ã«ãªã‚Šã¾ã™ï¼Ž
-
- 返り値ã¯ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ã§ã™ï¼Žã‚ªãƒ—ションãƒãƒƒã‚·ãƒ¥ãŠã‚ˆã³ã‚¤
- ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯ã¯æ•°ãˆã¾ã›ã‚“.
-
-== Rubyメソッド呼ã³å‡ºã—
-
-VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
-
- メソッド呼ã³å‡ºã—.文字列ã‹ã‚‰midã‚’å¾—ã‚‹ãŸã‚ã«ã¯rb_intern()ã‚’
- 使ã†ï¼Ž
- private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
-
-VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
-VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
-
- メソッド呼ã³å‡ºã—.引数をargc, argvå½¢å¼ã§æ¸¡ã™ï¼Ž
- private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
-
-VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
-
- メソッド呼ã³å‡ºã—.
- publicãªãƒ¡ã‚½ãƒƒãƒ‰ã—ã‹å‘¼ã¹ãªã„.
-
-VALUE rb_eval_string(const char *str)
-
- 文字列をRubyスクリプトã¨ã—ã¦ã‚³ãƒ³ãƒ‘イル・実行ã™ã‚‹ï¼Ž
-
-ID rb_intern(const char *name) ::
-
- 文字列ã«å¯¾å¿œã™ã‚‹IDã‚’è¿”ã™ï¼Ž
-
-char *rb_id2name(ID id) ::
-
- IDã«å¯¾å¿œã™ã‚‹æ–‡å­—列を返ã™(デãƒãƒƒã‚°ç”¨).
-
-char *rb_class2name(VALUE klass) ::
-
- クラスã®åå‰ã‚’è¿”ã™(デãƒãƒƒã‚°ç”¨).クラスãŒåå‰ã‚’æŒãŸãªã„時ã«
- ã¯, 祖先をé¡ã£ã¦åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹ã®åå‰ã‚’è¿”ã™ï¼Ž
-
-int rb_respond_to(VALUE obj, ID id) ::
-
- objãŒidã§ç¤ºã•れるメソッドをæŒã¤ã‹ã©ã†ã‹ã‚’è¿”ã™ï¼Ž
-
-== インスタンス変数
-
-VALUE rb_iv_get(VALUE obj, const char *name) ::
-
- objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã®å€¤ã‚’得る.`@'ã§å§‹ã¾ã‚‰ãªã„インスタン
- ス変数㯠Rubyプログラムã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã„「隠れãŸã€ã‚¤ãƒ³
- スタンス変数ã«ãªã‚‹ï¼Žå®šæ•°ã¯å¤§æ–‡å­—ã®åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹(ã¾ãŸã¯
- モジュール)ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã¨ã—ã¦å®Ÿè£…ã•れã¦ã„る.
-
-VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
-
- objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’valã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼Ž
-
-== 制御構造
-
-VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
-
- 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引数ã«ã‚¤ãƒ†ãƒ¬ãƒ¼
- ã‚¿ã‹ã‚‰ä¸Žãˆã‚‰ã‚ŒãŸå€¤, 第2引数ã«arg2ãŒæ¸¡ã•れる.
-
- 1.9ã§rb_iterateを使ã†å ´åˆã¯, func1ã®ä¸­ã§Rubyレベルã®ãƒ¡ã‚½ãƒƒãƒ‰
- を呼ã³å‡ºã•ãªã‘れã°ãªã‚‰ãªã„.
- 1.9ã§obsoleteã¨ãªã£ãŸ. 代ã‚りã«rb_block_callãŒç”¨æ„ã•れãŸ.
-
-VALUE rb_yield(VALUE val) ::
-
- valを値ã¨ã—ã¦ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ロックを呼ã³å‡ºã™ï¼Ž
-
-VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
-
- 関数func1ã‚’arg1を引数ã«å‘¼ã³å‡ºã™ï¼Žfunc1ã®å®Ÿè¡Œä¸­ã«ä¾‹å¤–ãŒç™ºç”Ÿ
- ã—ãŸæ™‚ã«ã¯ func2ã‚’arg2を引数ã¨ã—ã¦å‘¼ã¶ï¼Žæˆ»ã‚Šå€¤ã¯ä¾‹å¤–ãŒç™ºç”Ÿ
- ã—ãªã‹ã£ãŸæ™‚ã¯func1ã®æˆ»ã‚Šå€¤, 例外ãŒç™ºç”Ÿã—ãŸæ™‚ã«ã¯func2ã®æˆ»
- り値ã§ã‚る.
-
-VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
-
- 関数func1ã‚’arg1を引数ã¨ã—ã¦å®Ÿè¡Œã—, 実行終了後(ãŸã¨ãˆä¾‹å¤–ãŒ
- 発生ã—ã¦ã‚‚) func2ã‚’arg2を引数ã¨ã—ã¦å®Ÿè¡Œã™ã‚‹ï¼Žæˆ»ã‚Šå€¤ã¯func1
- ã®æˆ»ã‚Šå€¤ã§ã‚ã‚‹(例外ãŒç™ºç”Ÿã—ãŸæ™‚ã¯æˆ»ã‚‰ãªã„).
-
-VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
-
- 関数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ã¯ãれらã®é–¢æ•°ã‹ã‚‰è¿”ã•れãŸå€¤ã§ãªã‘れã°ãªã‚‰ãªã„.
- ã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
-
-void rb_iter_break() ::
-
- ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックを終了ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡º
- ã—å…ƒã«æˆ»ã‚‰ãªã„.
-
-void rb_iter_break_value(VALUE value) ::
-
- ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックをvalueã§çµ‚了ã™ã‚‹ï¼Žãƒ–ロックã¯å¼•æ•°ã§
- 与ãˆã‚‰ã‚ŒãŸvalueã‚’è¿”ã™ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
-
-== 例外・エラー
-
-void rb_warning(const char *fmt, ...) ::
-
- rb_verboseæ™‚ã«æ¨™æº–エラー出力ã«è­¦å‘Šæƒ…報を表示ã™ã‚‹ï¼Žå¼•æ•°ã¯
- printf()ã¨åŒã˜ï¼Ž
-
-void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
-
- RuntimeError例外を発生ã•ã›ã‚‹ï¼Žå¼•æ•°ã¯printf()ã¨åŒã˜ï¼Ž
-
-void rb_raise(VALUE exception, const char *fmt, ...) ::
-
- exceptionã§æŒ‡å®šã—ãŸä¾‹å¤–を発生ã•ã›ã‚‹ï¼Žfmt以下ã®å¼•æ•°ã¯
- printf()ã¨åŒã˜ï¼Ž
-
-void rb_fatal(const char *fmt, ...) ::
-
- 致命的例外を発生ã•ã›ã‚‹ï¼Žé€šå¸¸ã®ä¾‹å¤–処ç†ã¯è¡Œãªã‚れãš, インター
- プリタãŒçµ‚了ã™ã‚‹(ãŸã ã—ensureã§æŒ‡å®šã•れãŸã‚³ãƒ¼ãƒ‰ã¯çµ‚了å‰ã«
- 実行ã•れる).
-
-void rb_bug(const char *fmt, ...) ::
-
- インタープリタãªã©ãƒ—ログラムã®ãƒã‚°ã§ã—ã‹ç™ºç”Ÿã™ã‚‹ã¯ãšã®ãªã„
- 状æ³ã®æ™‚呼ã¶ï¼Žã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã¯ã‚³ã‚¢ãƒ€ãƒ³ãƒ—ã—ç›´ã¡ã«çµ‚了ã™ã‚‹ï¼Ž
- 例外処ç†ã¯ä¸€åˆ‡è¡Œãªã‚れãªã„.
-
-注æ„: %iã¯Object#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã¨ãã¯Object#inspect)ã‚’
-使ã£ãŸVALUEã®å‡ºåŠ›ã«ä½¿ç”¨ã•れã¦ã„ã‚‹ãŸã‚,整数ã«ã¯%dを使用ã™ã‚‹ã“ã¨ï¼Ž
-
-== Rubyã®åˆæœŸåŒ–・実行
-
-Rubyをアプリケーションã«åŸ‹ã‚込む場åˆã«ã¯ä»¥ä¸‹ã®ã‚¤ãƒ³ã‚¿ãƒ•ェース
-を使ã†ï¼Žé€šå¸¸ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¯å¿…è¦ãªã„.
-
-void ruby_init() ::
-
- Rubyインタプリタã®åˆæœŸåŒ–を行ãªã†ï¼Ž
-
-void ruby_options(int argc, char **argv) ::
-
- Rubyインタプリタã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³å¼•æ•°ã®å‡¦ç†ã‚’行ãªã†ï¼Ž
-
-void ruby_run() ::
-
- Rubyインタプリタを実行ã™ã‚‹ï¼Ž
-
-void ruby_script(char *name) ::
-
- Rubyã®ã‚¹ã‚¯ãƒªãƒ—トå($0)を設定ã™ã‚‹ï¼Ž
-
-== インタプリタã®ã‚¤ãƒ™ãƒ³ãƒˆã®ãƒ•ック
-
- void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
- VALUE data)
-
-指定ã•れãŸã‚¤ãƒ³ã‚¿ãƒ—リタã®ã‚¤ãƒ™ãƒ³ãƒˆã«å¯¾ã™ã‚‹ãƒ•ック関数を追加ã—ã¾ã™ï¼Ž
-eventsã¯ä»¥ä¸‹ã®å€¤ã®orã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“:
-
- RUBY_EVENT_LINE
- RUBY_EVENT_CLASS
- RUBY_EVENT_END
- RUBY_EVENT_CALL
- RUBY_EVENT_RETURN
- RUBY_EVENT_C_CALL
- RUBY_EVENT_C_RETURN
- RUBY_EVENT_RAISE
- RUBY_EVENT_ALL
-
-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 ã‚‚å‚ç…§ã—ã¦ãã ã•ã„.
-
- int rb_remove_event_hook(rb_event_hook_func_t func)
-
-指定ã•れãŸãƒ•ック関数を削除ã—ã¾ã™ï¼Ž
-
-== äº’æ›æ€§ã®ãŸã‚ã®ãƒžã‚¯ãƒ­
-
-APIã®äº’æ›æ€§ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ãŸã‚ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ãŒãƒ‡ãƒ•ォルトã§å®šç¾©ã•れã¦ã„ã¾ã™ï¼Ž
-
-NORETURN_STYLE_NEW ::
-
- NORETURN マクロãŒé–¢æ•°åž‹ãƒžã‚¯ãƒ­ã¨ã—ã¦å®šç¾©ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-
-HAVE_RB_DEFINE_ALLOC_FUNC ::
-
- 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() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
- have_func("rb_reg_new_str", "ruby.h").
- ã®çµæžœã¨åŒã˜ï¼Ž
-
-HAVE_RB_IO_T ::
-
- rb_io_t åž‹ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-
-USE_SYMBOL_AS_METHOD_NAME ::
-
- メソッドåã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼ŒModule#methods, #singleton_methods
- ãªã©ãŒSymbolã‚’è¿”ã™ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-
-HAVE_RUBY_*_H ::
-
- ruby.h ã§å®šç¾©ã•れã¦ã„る.対応ã™ã‚‹ãƒ˜ãƒƒãƒ€ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨
- ã‚’æ„味ã™ã‚‹ï¼ŽãŸã¨ãˆã°ï¼ŒHAVE_RUBY_ST_H ãŒå®šç¾©ã•れã¦ã„ã‚‹å ´åˆã¯
- å˜ãªã‚‹ st.h ã§ã¯ãªã ruby/st.h を使用ã™ã‚‹ï¼Ž
-
-RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
-
- rb_add_event_hook() ãŒãƒ•ãƒƒã‚¯é–¢æ•°ã«æ¸¡ã™ data を第3引数ã¨ã—ã¦
- å—ã‘å–ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-
-= Appendix C. extconf.rbã§ä½¿ãˆã‚‹é–¢æ•°ãŸã¡
-
-extconf.rbã®ä¸­ã§ã¯åˆ©ç”¨å¯èƒ½ãªã‚³ãƒ³ãƒ‘イルæ¡ä»¶ãƒã‚§ãƒƒã‚¯ã®é–¢æ•°ã¯ä»¥
-下ã®é€šã‚Šã§ã‚る.
-
-have_macro(macro, headers) ::
-
- ヘッダファイルheaderをインクルードã—ã¦ãƒžã‚¯ãƒ­macroãŒå®šç¾©ã•
- れã¦ã„ã‚‹ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„る時true
- ã‚’è¿”ã™ï¼Ž
-
-have_library(lib, func) ::
-
- 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Ž
- ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«è¿½åŠ ã—,trueã‚’è¿”ã™ï¼Ž
-
-find_library(lib, func, path...) ::
-
- 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ -Lpath を追加
- ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«
- 追加ã—,trueã‚’è¿”ã™ï¼Ž
-
-have_func(func, header) ::
-
- ヘッダファイルheaderをインクルードã—ã¦é–¢æ•°funcã®å­˜åœ¨ã‚’ãƒã‚§
- ックã™ã‚‹ï¼ŽfuncãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§
- ã‚る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠ
- ã事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
- `HAVE_{FUNC}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
-
-have_var(var, header) ::
-
- ヘッダファイルheaderをインクルードã—ã¦å¤‰æ•°varã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒ
- クã™ã‚‹ï¼ŽvarãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§ã‚
- る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠã
- 事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
- `HAVE_{VAR}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
-
-have_header(header) ::
-
- ヘッダファイルã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ
- プリプロセッサマクロ `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
- (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
-
-find_header(header, path...) ::
-
- ヘッダファイルheaderã®å­˜åœ¨ã‚’ -Ipath を追加ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯
- ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
- `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
- (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
-
-have_struct_member(type, member[, header[, opt]]) ::
-
- ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå®šç¾©ã•れ,
- ãªãŠã‹ã¤ãƒ¡ãƒ³ãƒmemberãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«
- æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ `HAVE_{TYPE}_{MEMBER}` ã‚’
- 定義ã—,trueã‚’è¿”ã™ï¼Ž
-
-have_type(type, header, opt) ::
-
- ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’
- ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
- `HAVE_TYPE_{TYPE}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
-
-check_sizeof(type, header) ::
-
- ヘッダファイルheaderをインクルードã—ã¦åž‹typeã®charå˜ä½ã‚µã‚¤
- ズを調ã¹ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
- `SIZEOF_{TYPE}` を定義ã—,ãã®ã‚µã‚¤ã‚ºã‚’è¿”ã™ï¼Žå®šç¾©ã•れã¦ã„ãª
- ã„ã¨ãã¯nilã‚’è¿”ã™ï¼Ž
-
-create_makefile(target[, target_prefix]) ::
-
- 拡張ライブラリ用ã®Makefileを生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã‚’呼ã°ãªã‘れ
- ã°ãã®ãƒ©ã‚¤ãƒ–ラリã¯ã‚³ãƒ³ãƒ‘イルã•れãªã„.targetã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«å
- を表ã™ï¼Ž
-
-find_executable(command, path) ::
-
- コマンドcommandã‚’File::PATH_SEPARATORã§åŒºåˆ‡ã‚‰ã‚ŒãŸãƒ‘スåã®
- リストpathã‹ã‚‰æŽ¢ã™ï¼ŽpathãŒnilã¾ãŸã¯çœç•¥ã•れãŸå ´åˆã¯ï¼Œç’°å¢ƒ
- 変数PATHã®å€¤ã‚’使用ã™ã‚‹ï¼Žå®Ÿè¡Œå¯èƒ½ãªã‚³ãƒžãƒ³ãƒ‰ãŒè¦‹ã¤ã‹ã£ãŸå ´åˆ
- ã¯ãƒ‘スをå«ã‚€ãƒ•ァイルå,見ã¤ã‹ã‚‰ãªã‹ã£ãŸå ´åˆã¯nilã‚’è¿”ã™ï¼Ž
-
-with_config(withval[, default=nil]) ::
-
- コマンドライン上ã®--with-<withval>ã§æŒ‡å®šã•れãŸã‚ªãƒ—ション値
- を得る.
-
-enable_config(config, *defaults) ::
-disable_config(config, *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>-include=/path/include --with-<target>-lib=/path/lib
- ã¨ç­‰ä¾¡ã§ã‚る.追加ã•れ㟠include ディレクトリ㨠lib ディレ
- クトリã®é…列を返ã™ï¼Ž ([include_dir, lib_dir])
-
-pkg_config(pkg, option=nil) ::
-
- pkg-configコマンドã‹ã‚‰ãƒ‘ッケージpkgã®æƒ…報を [cflags, ldflags, libs]
- ã®é…列ã¨ã—ã¦å¾—る.$CFLAGS, $LDFLAGS, $libs ã«ã¯ãれãžã‚Œã®å€¤ãŒ
- 追加ã•れる.
-
- pkg-configã®å®Ÿéš›ã®ã‚³ãƒžãƒ³ãƒ‰ã¯ï¼Œä»¥ä¸‹ã®é †ã§è©¦ã•れる.
-
- 1. コマンドラインã§--with-{pkg}-config={command}オプションãŒ
- 指定ã•れãŸå ´åˆ: {command} {option}
- 2. {pkg}-config {option}
- 3. pkg-config {option} {pkg}
-
- optionãŒæŒ‡å®šã•れãŸå ´åˆã¯ã€ä¸Šè¨˜ã®é…列ã®ä»£ã‚りã«ãã®ã‚ªãƒ—ションを
- 指定ã—ã¦å¾—られãŸå‡ºåŠ›ã‚’stripã—ãŸã‚‚ã®ã‚’è¿”ã™ï¼Ž
-
-/*
- * Local variables:
- * fill-column: 60
- * end:
- */
+doc/extension.ja.rdocã«ç§»å‹•ã—ã¾ã—ãŸ
diff --git a/README.ja b/README.ja
deleted file mode 100644
index 9ab2f3ca0e..0000000000
--- a/README.ja
+++ /dev/null
@@ -1,192 +0,0 @@
-= Rubyã¨ã¯
-
-Rubyã¯ã‚·ãƒ³ãƒ—ルã‹ã¤å¼·åŠ›ãªã‚ªãƒ–ジェクト指å‘スクリプト言語ã§ã™ï¼Ž
-Rubyã¯æœ€åˆã‹ã‚‰ç´”粋ãªã‚ªãƒ–ジェクト指å‘言語ã¨ã—ã¦è¨­è¨ˆã•れã¦ã„ã¾
-ã™ã‹ã‚‰ï¼Œã‚ªãƒ–ジェクト指å‘プログラミングを手軽ã«è¡Œã†äº‹ãŒå‡ºæ¥ã¾
-ã™ï¼Žã‚‚ã¡ã‚ã‚“é€šå¸¸ã®æ‰‹ç¶šãåž‹ã®ãƒ—ログラミングもå¯èƒ½ã§ã™ï¼Ž
-
-Rubyã¯ãƒ†ã‚­ã‚¹ãƒˆå‡¦ç†é–¢ä¿‚ã®èƒ½åŠ›ãªã©ã«å„ªã‚Œï¼ŒPerlã¨åŒã˜ãらã„強力
-ã§ã™ï¼Žã•らã«ã‚·ãƒ³ãƒ—ãƒ«ãªæ–‡æ³•ã¨ï¼Œä¾‹å¤–処ç†ã‚„イテレータãªã©ã®æ©Ÿæ§‹
-ã«ã‚ˆã£ã¦ï¼Œã‚ˆã‚Šåˆ†ã‹ã‚Šã‚„ã™ã„プログラミングãŒå‡ºæ¥ã¾ã™ï¼Ž
-
-
-== Rubyã®ç‰¹é•·
-
-* ã‚·ãƒ³ãƒ—ãƒ«ãªæ–‡æ³•
-* 普通ã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(クラス,メソッドコールãªã©)
-* 特殊ãªã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(Mixin, 特異メソッドãªã©)
-* 演算å­ã‚ªãƒ¼ãƒãƒ¼ãƒ­ãƒ¼ãƒ‰
-* ä¾‹å¤–å‡¦ç†æ©Ÿèƒ½
-* イテレータã¨ã‚¯ãƒ­ãƒ¼ã‚¸ãƒ£
-* ガーベージコレクタ
-* ダイナミックローディング (アーキテクãƒãƒ£ã«ã‚ˆã‚‹)
-* ç§»æ¤æ€§ãŒé«˜ã„.多ãã®Unix-like/POSIX互æ›ãƒ—ラットフォーム上ã§
- å‹•ãã ã‘ã§ãªã,Windows, Mac OS X,BeOSãªã©ã®ä¸Šã§ã‚‚å‹•ã
- cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
-
-== 入手法
-
-=== FTPã§
-
-以下ã®å ´æ‰€ã«ãŠã„ã¦ã‚りã¾ã™ï¼Ž
-
-ftp://ftp.ruby-lang.org/pub/ruby/
-
-=== 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ã«å…¬é–‹ã—ã¦ã„ã¾ã™ï¼Ž
-以下ã®ã‚³ãƒžãƒ³ãƒ‰ã§ãƒªãƒã‚¸ãƒˆãƒªã‚’å–å¾—ã§ãã¾ã™ï¼Ž
-
- $ git clone git://github.com/ruby/ruby.git
-
-== ホームページ
-
-Rubyã®ãƒ›ãƒ¼ãƒ ãƒšãƒ¼ã‚¸ã®URLã¯
-
-http://www.ruby-lang.org/
-
-ã§ã™ï¼Ž
-
-
-== メーリングリスト
-
-Rubyã®ãƒ¡ãƒ¼ãƒªãƒ³ã‚°ãƒªã‚¹ãƒˆãŒã‚りã¾ã™ã€‚å‚åŠ å¸Œæœ›ã®æ–¹ã¯
-
-mailto:ruby-list-ctl@ruby-lang.org
-
-ã¾ã§æœ¬æ–‡ã«
-
- subscribe YourFirstName YourFamilyName
-
-ã¨æ›¸ã„ã¦é€ã£ã¦ä¸‹ã•ã„。
-
-Ruby開発者å‘ã‘メーリングリストもã‚りã¾ã™ã€‚ã“ã¡ã‚‰ã§ã¯rubyã®ãƒ
-ã‚°ã€å°†æ¥ã®ä»•様拡張ãªã©å®Ÿè£…上ã®å•題ã«ã¤ã„ã¦è­°è«–ã•れã¦ã„ã¾ã™ã€‚
-å‚åŠ å¸Œæœ›ã®æ–¹ã¯
-
-mailto:ruby-dev-ctl@ruby-lang.org
-
-ã¾ã§ruby-listã¨åŒæ§˜ã®æ–¹æ³•ã§ãƒ¡ãƒ¼ãƒ«ã—ã¦ãã ã•ã„。
-
-Ruby拡張モジュールã«ã¤ã„ã¦è©±ã—åˆã†ruby-extメーリングリストã¨
-数学関係ã®è©±é¡Œã«ã¤ã„ã¦è©±ã—åˆã†ruby-mathメーリングリストã¨
-英語ã§è©±ã—åˆã†ruby-talkメーリングリストもã‚りã¾ã™ã€‚å‚加方法
-ã¯ã©ã‚Œã‚‚åŒã˜ã§ã™ã€‚
-
-
-== コンパイル・インストール
-
-ä»¥ä¸‹ã®æ‰‹é †ã§è¡Œã£ã¦ãã ã•ã„.
-
-1. ã‚‚ã— +configure+ ファイルãŒè¦‹ã¤ã‹ã‚‰ãªã„ã€ã‚‚ã—ãã¯
- +configure.in+ よりå¤ã„よã†ãªã‚‰ã€ +autoconf+ を実行ã—ã¦
- æ–°ã—ã +configure+ を生æˆã™ã‚‹
-
-2. +configure+ を実行ã—㦠+Makefile+ ãªã©ã‚’生æˆã™ã‚‹
-
- 環境ã«ã‚ˆã£ã¦ã¯ãƒ‡ãƒ•ォルトã®Cコンパイラ用オプションãŒä»˜ã
- ã¾ã™ï¼Ž +configure+ オプション㧠<tt>optflags=..</tt> <tt>warnflags=..</tt> ç­‰
- ã§ä¸Šæ›¸ãã§ãã¾ã™ï¼Ž
-
-3. (å¿…è¦ãªã‚‰ã°)+defines.h+ を編集ã™ã‚‹
-
- 多分,必è¦ç„¡ã„ã¨æ€ã„ã¾ã™ï¼Ž
-
-4. (å¿…è¦ãªã‚‰ã°)+ext/Setup+ ã«é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’
- 指定ã™ã‚‹
-
- +ext/Setup+ ã«è¨˜è¿°ã—ãŸãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯é™çš„ã«ãƒªãƒ³ã‚¯ã•れã¾ã™ï¼Ž
-
- ダイナミックローディングをサãƒãƒ¼ãƒˆã—ã¦ã„ãªã„アーキテク
- ãƒãƒ£ã§ã¯ +Setup+ ã®1行目ã®ã€Œ<tt>option nodynamic</tt>ã€ã¨ã„ã†è¡Œã®ã‚³
- メントを外ã™å¿…è¦ãŒã‚りã¾ã™ï¼Žã¾ãŸï¼Œã“ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã§
- 拡張モジュールを利用ã™ã‚‹ãŸã‚ã«ã¯ï¼Œã‚らã‹ã˜ã‚é™çš„ã«ãƒªãƒ³
- クã—ã¦ãŠãå¿…è¦ãŒã‚りã¾ã™ï¼Ž
-
-5. +make+ を実行ã—ã¦ã‚³ãƒ³ãƒ‘イルã™ã‚‹
-
-6. <tt>make check</tt>ã§ãƒ†ã‚¹ãƒˆã‚’行ã†ï¼Ž
-
- 「<tt>check succeeded</tt>ã€ã¨è¡¨ç¤ºã•ã‚Œã‚Œã°æˆåŠŸã§ã™ï¼ŽãŸã ã—テスト
- ã«æˆåŠŸã—ã¦ã‚‚完璧ã ã¨ä¿è¨¼ã•れã¦ã„る訳ã§ã¯ã‚りã¾ã›ã‚“.
-
-7. <tt>make install</tt>
-
- 以下ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’作ã£ã¦ï¼Œãã“ã«ãƒ•ァイルをインストー
- ルã—ã¾ã™ï¼Ž
-
- * <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>
-
- Rubyã®APIãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒ'_x.y.z_'ã§ã‚れã°ï¼Œ<tt>${MAJOR}</tt>ã¯
- '_x_'ã§ï¼Œ<tt>${MINOR}</tt>ã¯'_y_',<tt>${TEENY}</tt>ã¯'_z_'ã§ã™ï¼Ž
-
- <b>注æ„</b>: APIãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® +teeny+ ã¯ï¼ŒRubyプログラムã®ãƒãƒ¼ã‚¸ãƒ§
- ンã¨ã¯ç•°ãªã‚‹ã“ã¨ãŒã‚りã¾ã™ï¼Ž
-
- +root+ ã§ä½œæ¥­ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã‚‚ã—れã¾ã›ã‚“.
-
-ã‚‚ã—,コンパイル時ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸå ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼ã®ãƒ­ã‚°ã¨ãƒž
-シン,OSã®ç¨®é¡žã‚’å«ã‚€ã§ãã‚‹ã ã‘詳ã—ã„レãƒãƒ¼ãƒˆã‚’作者ã«é€ã£ã¦ã
-ã ã•ã‚‹ã¨ä»–ã®æ–¹ã®ãŸã‚ã«ã‚‚ãªã‚Šã¾ã™ï¼Ž
-
-
-== ç§»æ¤
-
-UNIXã§ã‚れ㰠+configure+ ãŒã»ã¨ã‚“ã©ã®å·®ç•°ã‚’å¸åŽã—ã¦ãれるã¯ãšã§
-ã™ãŒï¼Œæ€ã‚ã¬è¦‹è½ã¨ã—ãŒã‚ã£ãŸå ´åˆ(ã‚ã‚‹ã«é•ã„ãªã„),作者ã«ãã®
-ã“ã¨ã‚’レãƒãƒ¼ãƒˆã™ã‚Œã°ï¼Œè§£æ±ºã§ãã‚‹ã‹ã‚‚知れã¾ã›ã‚“.
-
-アーキテクãƒãƒ£ã«ã‚‚ã£ã¨ã‚‚ä¾å­˜ã™ã‚‹ã®ã¯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ã§ã¯ï¼Œãƒ¬ã‚¸ã‚¹ã‚¿ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’スタッ
-クã«ãƒ•ラッシュã™ã‚‹ã‚¢ã‚»ãƒ³ãƒ–ラコードを追加ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã‚‚知
-れã¾ã›ã‚“.
-
-
-== é…布æ¡ä»¶
-
-+COPYING.ja+ ファイルをå‚ç…§ã—ã¦ãã ã•ã„。
-
-
-== 著者
-
-コメント,ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆãã®ä»–㯠mailto:matz@ruby-lang.org ã¾ã§ï¼Ž
--------------------------------------------------------
-created at: Thu Aug 3 11:57:36 JST 1995
---
-Local variables:
-mode: rdoc
-end:
diff --git a/README.ja.md b/README.ja.md
new file mode 100644
index 0000000000..eee54a9171
--- /dev/null
+++ b/README.ja.md
@@ -0,0 +1,171 @@
+# Rubyã¨ã¯
+
+Rubyã¯ã‚·ãƒ³ãƒ—ルã‹ã¤å¼·åŠ›ãªã‚ªãƒ–ジェクト指å‘スクリプト言語ã§ã™ï¼Ž Rubyã¯ç´”粋ãªã‚ªãƒ–ジェクト指å‘言語ã¨ã—ã¦è¨­è¨ˆã•れã¦ã„ã‚‹ã®ã§ï¼Œ
+オブジェクト指å‘プログラミングを手軽ã«è¡Œã†äº‹ãŒå‡ºæ¥ã¾ã™ï¼Žã‚‚ã¡ã‚ã‚“æ™®é€šã®æ‰‹ç¶šãåž‹ã®ãƒ—ログラミングもå¯èƒ½ã§ã™ï¼Ž
+
+Rubyã¯ãƒ†ã‚­ã‚¹ãƒˆå‡¦ç†é–¢ä¿‚ã®èƒ½åŠ›ãªã©ã«å„ªã‚Œï¼ŒPerlã¨åŒã˜ãらã„強力ã§ã™ï¼Žã•らã«ã‚·ãƒ³ãƒ—ãƒ«ãªæ–‡æ³•ã¨ï¼Œ
+例外処ç†ã‚„イテレータãªã©ã®æ©Ÿæ§‹ã«ã‚ˆã£ã¦ï¼Œã‚ˆã‚Šåˆ†ã‹ã‚Šã‚„ã™ã„プログラミングãŒå‡ºæ¥ã¾ã™ï¼Ž
+
+## Rubyã®ç‰¹é•·
+
+* ã‚·ãƒ³ãƒ—ãƒ«ãªæ–‡æ³•
+* 普通ã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(クラス,メソッドコールãªã©)
+* 特殊ãªã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(Mixin, 特異メソッドãªã©)
+* 演算å­ã‚ªãƒ¼ãƒãƒ¼ãƒ­ãƒ¼ãƒ‰
+* ä¾‹å¤–å‡¦ç†æ©Ÿèƒ½
+* イテレータã¨ã‚¯ãƒ­ãƒ¼ã‚¸ãƒ£
+* ガーベージコレクタ
+* ダイナミックローディング (アーキテクãƒãƒ£ã«ã‚ˆã‚‹)
+* ç§»æ¤æ€§ãŒé«˜ã„.多ãã®Unix-like/POSIX互æ›ãƒ—ラットフォーム上ã§å‹•ãã ã‘ã§ãªã,Windows, Mac OS
+ X,BeOSãªã©ã®ä¸Šã§ã‚‚å‹•ã cf.
+ http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
+
+
+## 入手法
+
+### FTPã§
+
+以下ã®å ´æ‰€ã«ãŠã„ã¦ã‚りã¾ã™ï¼Ž
+
+ftp://ftp.ruby-lang.org/pub/ruby/
+
+### 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ã«å…¬é–‹ã—ã¦ã„ã¾ã™ï¼Ž 以下ã®ã‚³ãƒžãƒ³ãƒ‰ã§ãƒªãƒã‚¸ãƒˆãƒªã‚’å–å¾—ã§ãã¾ã™ï¼Ž
+
+ $ git clone git://github.com/ruby/ruby.git
+
+## ホームページ
+
+Rubyã®ãƒ›ãƒ¼ãƒ ãƒšãƒ¼ã‚¸ã®URLã¯
+
+http://www.ruby-lang.org/
+
+ã§ã™ï¼Ž
+
+## メーリングリスト
+
+Rubyã®ãƒ¡ãƒ¼ãƒªãƒ³ã‚°ãƒªã‚¹ãƒˆãŒã‚りã¾ã™ï¼Žå‚åŠ å¸Œæœ›ã®æ–¹ã¯
+
+mailto:ruby-list-request@ruby-lang.org
+
+ã¾ã§æœ¬æ–‡ã«
+
+ subscribe
+
+ã¨æ›¸ã„ã¦é€ã£ã¦ä¸‹ã•ã„.
+
+Ruby開発者å‘ã‘メーリングリストもã‚りã¾ã™ï¼Žã“ã¡ã‚‰ã§ã¯rubyã®ãƒã‚°ï¼Œå°†æ¥ã®ä»•様拡張ãªã©å®Ÿè£…上ã®å•題ã«ã¤ã„ã¦è­°è«–ã•れã¦ã„ã¾ã™ï¼Ž å‚åŠ å¸Œæœ›ã®æ–¹ã¯
+
+mailto:ruby-dev-request@ruby-lang.org
+
+ã¾ã§ruby-listã¨åŒæ§˜ã®æ–¹æ³•ã§ãƒ¡ãƒ¼ãƒ«ã—ã¦ãã ã•ã„.
+
+Ruby拡張モジュールã«ã¤ã„ã¦è©±ã—åˆã†ruby-extãƒ¡ãƒ¼ãƒªãƒ³ã‚°ãƒªã‚¹ãƒˆã¨æ•°å­¦é–¢ä¿‚ã®è©±é¡Œã«ã¤ã„ã¦è©±ã—åˆã†ruby-mathメーリングリストã¨
+英語ã§rubyã«ã¤ã„ã¦è©±ã—åˆã†ruby-talkメーリングリストもã‚りã¾ã™ï¼Žå‚加方法ã¯ã©ã‚Œã‚‚åŒã˜ã§ã™ï¼Ž
+
+## コンパイル・インストール
+
+ä»¥ä¸‹ã®æ‰‹é †ã§è¡Œã£ã¦ãã ã•ã„.
+
+1. ã‚‚ã— `configure` ファイルãŒè¦‹ã¤ã‹ã‚‰ãªã„,もã—ã㯠`configure.in` よりå¤ã„よã†ãªã‚‰ï¼Œ `autoconf` を実行ã—ã¦
+ æ–°ã—ã `configure` を生æˆã™ã‚‹
+
+2. `configure` を実行ã—㦠`Makefile` ãªã©ã‚’生æˆã™ã‚‹
+
+ 環境ã«ã‚ˆã£ã¦ã¯ãƒ‡ãƒ•ォルトã®Cコンパイラ用オプションãŒä»˜ãã¾ã™ï¼Ž `configure` オプション㧠`optflags=..`
+ `warnflags=..` ç­‰ã§ä¸Šæ›¸ãã§ãã¾ã™ï¼Ž
+
+3. (å¿…è¦ãªã‚‰ã°)`defines.h` を編集ã™ã‚‹
+
+ 多分,必è¦ç„¡ã„ã¨æ€ã„ã¾ã™ï¼Ž
+
+4. (å¿…è¦ãªã‚‰ã°)`ext/Setup` ã«é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’指定ã™ã‚‹
+
+ `ext/Setup` ã«è¨˜è¿°ã—ãŸãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯é™çš„ã«ãƒªãƒ³ã‚¯ã•れã¾ã™ï¼Ž
+
+ ダイナミックローディングをサãƒãƒ¼ãƒˆã—ã¦ã„ãªã„アーキテクãƒãƒ£ã§ã¯ `Setup` ã®1行目ã®ã€Œ`option nodynamic`ã€ã¨ã„ã†è¡Œã®ã‚³
+ メントを外ã™å¿…è¦ãŒã‚りã¾ã™ï¼Žã¾ãŸï¼Œã“ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã§æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’利用ã™ã‚‹ãŸã‚ã«ã¯ï¼Œã‚らã‹ã˜ã‚é™çš„ã«ãƒªãƒ³ã‚¯ã‚’ã—ã¦ãŠãå¿…è¦ãŒã‚りã¾ã™ï¼Ž
+
+5. `make` を実行ã—ã¦ã‚³ãƒ³ãƒ‘イルã™ã‚‹
+
+6. `make check`ã§ãƒ†ã‚¹ãƒˆã‚’行ã†ï¼Ž
+
+ 「`check succeeded`ã€ã¨è¡¨ç¤ºã•ã‚Œã‚Œã°æˆåŠŸã§ã™ï¼ŽãŸã ã—ãƒ†ã‚¹ãƒˆã«æˆåŠŸã—ã¦ã‚‚完璧ã ã¨ä¿è¨¼ã•れã¦ã„る訳ã§ã¯ã‚りã¾ã›ã‚“.
+
+7. `make install`
+
+ 以下ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’作ã£ã¦ï¼Œãã“ã«ãƒ•ァイルをインストー ルã—ã¾ã™ï¼Ž
+
+ * `${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`
+
+
+ Rubyã®APIãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒ'*x.y.z*'ã§ã‚れã°ï¼Œ`${MAJOR}`ã¯
+ '*x*'ã§ï¼Œ`${MINOR}`ã¯'*y*',`${TEENY}`ã¯'*z*'ã§ã™ï¼Ž
+
+ **注æ„**: APIãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® `teeny` ã¯ï¼ŒRubyプログラムã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã¨ã¯ç•°ãªã‚‹ã“ã¨ãŒã‚りã¾ã™ï¼Ž
+
+ `root` ã§ä½œæ¥­ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã‚‚ã—れã¾ã›ã‚“.
+
+
+ã‚‚ã—,コンパイル時ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸå ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼ã®ãƒ­ã‚°ã¨ãƒžã‚·ãƒ³ï¼ŒOSã®ç¨®é¡žã‚’å«ã‚€ã§ãã‚‹ã ã‘詳ã—ã„レãƒãƒ¼ãƒˆã‚’作者ã«é€ã£ã¦ä¸‹ã•ã‚‹ã¨ä»–ã®æ–¹ã®ãŸã‚ã«ã‚‚ãªã‚Šã¾ã™ï¼Ž
+
+## ç§»æ¤
+
+UNIXã§ã‚れ㰠`configure` ãŒã»ã¨ã‚“ã©ã®å·®ç•°ã‚’å¸åŽã—ã¦ãれるã¯ãšã§ã™ãŒï¼Œæ€ã‚ã¬è¦‹è½ã¨ã—ãŒã‚ã£ãŸå ´åˆ(ã‚る事ãŒå¤šã„),作者ã«ãã®
+ã“ã¨ã‚’報告ã™ã‚Œã°ï¼Œè§£æ±ºã§ãã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ï¼Ž
+
+アーキテクãƒãƒ£ã«ã‚‚ã£ã¨ã‚‚ä¾å­˜ã™ã‚‹ã®ã¯GC部ã§ã™ï¼ŽRubyã®GCã¯å¯¾è±¡
+ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ãŒ`setjmp()`ã¾ãŸã¯`getcontext()`ã«ã‚ˆã£ã¦å…¨ã¦ã®ãƒ¬ã‚¸ã‚¹ã‚¿ã‚’ `jmp_buf` ã‚„ `ucontext_t`
+ã«æ ¼ç´ã™ã‚‹ã“ã¨ã¨ï¼Œ `jmp_buf` ã‚„ `ucontext_t` ã¨ã‚¹ã‚¿ãƒƒã‚¯ãŒ32bitアラインメントã•れã¦ã„ã‚‹ã“ã¨ã‚’仮定
+ã—ã¦ã„ã¾ã™ï¼Žç‰¹ã«å‰è€…ãŒæˆç«‹ã—ãªã„å ´åˆã®å¯¾å¿œã¯éžå¸¸ã«å›°é›£ã§ã—ょã†ï¼Ž 後者ã®è§£æ±ºã¯æ¯”較的簡å˜ã§ï¼Œ `gc.c` ã§ã‚¹ã‚¿ãƒƒã‚¯ã‚’マークã—ã¦ã„ã‚‹
+部分ã«ã‚¢ãƒ©ã‚¤ãƒ³ãƒ¡ãƒ³ãƒˆã®ãƒã‚¤ãƒˆæ•°ã ã‘ãšã‚‰ã—ã¦ãƒžãƒ¼ã‚¯ã™ã‚‹ã‚³ãƒ¼ãƒ‰ã‚’追加ã™ã‚‹ã ã‘ã§æ¸ˆã¿ã¾ã™ï¼Ž`defined(__mc68000__)`ã§æ‹¬ã‚‰ã‚Œã¦ã„
+る部分をå‚考ã«ã—ã¦ãã ã•ã„.
+
+レジスタウィンドウをæŒã¤CPUã§ã¯ï¼Œãƒ¬ã‚¸ã‚¹ã‚¿ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’スタックã«ãƒ•ラッシュã™ã‚‹ã‚¢ã‚»ãƒ³ãƒ–ラコードを追加ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã‚‚ã—れã¾ã›ã‚“.
+
+## é…布æ¡ä»¶
+
+`COPYING.ja` ファイルをå‚ç…§ã—ã¦ãã ã•ã„.
+
+## フィードãƒãƒƒã‚¯
+
+Rubyã«é–¢ã™ã‚‹è³ªå•㯠Ruby-Talk(英語)や Ruby-List(日本語) (https://www.ruby-lang.org/ja/community/mailing-lists) や,
+stackoverflow (http://ja.stackoverflow.com/) ãªã©ã®Webã‚µã‚¤ãƒˆã«æŠ•ç¨¿ã—ã¦ãã ã•ã„.
+
+ãƒã‚°å ±å‘Šã¯ http://bugs.ruby-lang.org ã§å—ã‘付ã‘ã¦ã„ã¾ã™ï¼Ž
+
+
+## 著者
+
+Rubyã®ã‚ªãƒªã‚¸ãƒŠãƒ«ç‰ˆã¯ï¼Œ1995å¹´ã«ã¾ã¤ã‚‚ã¨ã‚†ãã²ã‚æ°ã«ã‚ˆã£ã¦è¨­è¨ˆãƒ»é–‹ç™ºã•れã¾ã—ãŸï¼Ž
+
+<mailto:matz@ruby-lang.org>
+
+---
+created at: Thu Aug 3 11:57:36 JST 1995
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..14fb7aa213
--- /dev/null
+++ b/README.md
@@ -0,0 +1,164 @@
+# What's Ruby
+
+Ruby is the interpreted scripting language for quick and easy object-oriented
+programming. It has many features to process text files and to do system
+management tasks (as in Perl). It is simple, straight-forward, and
+extensible.
+
+## Features of Ruby
+
+* Simple Syntax
+* **Normal** Object-oriented Features (e.g. class, method calls)
+* **Advanced** Object-oriented Features (e.g. Mix-in, Singleton-method)
+* Operator Overloading
+* Exception Handling
+* Iterators and Closures
+* Garbage Collection
+* Dynamic Loading of Object Files (on some architectures)
+* Highly Portable (works on many Unix-like/POSIX compatible platforms as
+ well as Windows, Mac OS X, BeOS, etc.) cf.
+ http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
+
+
+## How to get Ruby
+
+For a complete list of ways to install Ruby, including using third-party tools
+like rvm, see:
+
+http://www.ruby-lang.org/en/downloads/
+
+The Ruby distribution files can be found on the following FTP site:
+
+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 the following command:
+
+ $ git clone git://github.com/ruby/ruby.git
+
+There are some other branches under development. Try the following command
+to see the list of branches:
+
+ $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+
+Or if you are using git then use the following command:
+
+ $ git ls-remote git://github.com/ruby/ruby.git
+
+## Ruby home page
+
+The URL of the Ruby home page is:
+
+http://www.ruby-lang.org/
+
+## Mailing list
+
+There is a mailing list to talk about Ruby. To subscribe this list, please
+send the following phrase:
+
+ subscribe
+
+in the mail body (not subject) to the address
+<mailto:ruby-talk-request@ruby-lang.org>.
+
+## How to compile and install
+
+This is what you need to do to compile and install Ruby:
+
+1. If you want to use Microsoft Visual C++ to compile ruby, read
+ win32/README.win32 instead of this document.
+
+2. If `./configure` does not exist or is older than configure.in, run
+ `autoconf` to (re)generate configure.
+
+3. 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.
+
+4. Edit `defines.h` if you need. Usually this step will not be needed.
+
+5. Remove comment mark(`#`) 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 do not allow dynamic loading), remove comment mark
+ from the line "`#option nodynamic`" in `ext/Setup`.
+
+ Usually this step will not be needed.
+
+6. Run `make`.
+
+7. Optionally, run '`make check`' to check whether the compiled Ruby
+ interpreter works well. If you see the message "`check succeeded`", your
+ ruby works as it should (hopefully).
+
+8. Run '`make install`'
+
+ 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 Ruby's
+ program version
+
+ You may have to be a super user to install ruby.
+
+
+If you fail to compile ruby, please send the detailed error report with the
+error log and machine/OS type, to help others.
+
+Some extension libraries may not get compiled because of lack of necessary
+external libraries and/or headers, then you will need to run '`make distclean-ext`'
+to remove old configuration after installing them in such case.
+
+## Copying
+
+See the file `COPYING`.
+
+## Feedback
+
+Questions about the Ruby language can be asked on the Ruby-Talk mailing list
+(http://www.ruby-lang.org/en/community/mailing-lists) or on websites like
+(http://stackoverflow.com).
+
+Bug reports should be filed at http://bugs.ruby-lang.org. Read [HowToReport] for more information.
+
+[HowToReport]: https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport
+
+##Contributing
+
+See the file `CONTRIBUTING.md`
+
+
+## The Author
+
+Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in
+1995.
+
+<mailto:matz@ruby-lang.org>
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000000..30fccd52fe
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,46 @@
+# -*- autoconf -*-
+
+AC_DEFUN([_COLORIZE_RESULT_PREPARE], [
+ msg_checking= msg_result_yes= msg_result_no= msg_result_other= msg_reset=
+ AS_IF([test "x${CONFIGURE_TTY}" = xyes -o -t 1], [
+ msg_begin="`tput smso 2>/dev/null`"
+ AS_CASE(["$msg_begin"], ['@<:@'*m],
+ [msg_begin="`echo "$msg_begin" | sed ['s/[0-9]*m$//']`"
+ msg_checking="${msg_begin}33m"
+ AS_IF([test ${TEST_COLORS:+set}], [
+ msg_result_yes=[`expr ":$TEST_COLORS:" : ".*:pass=\([^:]*\):"`]
+ msg_result_no=[`expr ":$TEST_COLORS:" : ".*:fail=\([^:]*\):"`]
+ msg_result_other=[`expr ":$TEST_COLORS:" : ".*:skip=\([^:]*\):"`]
+ ])
+ msg_result_yes="${msg_begin}${msg_result_yes:-32;1}m"
+ msg_result_no="${msg_begin}${msg_result_no:-31;1}m"
+ msg_result_other="${msg_begin}${msg_result_other:-33;1}m"
+ msg_reset="${msg_begin}m"
+ ])
+ AS_UNSET(msg_begin)
+ ])
+ AS_REQUIRE_SHELL_FN([colorize_result],
+ [AS_FUNCTION_DESCRIBE([colorize_result], [MSG], [Colorize result])],
+ [AS_CASE(["$[]1"],
+ [yes], [AS_ECHO(["${msg_result_yes}$[]1${msg_reset}]")],
+ [no], [AS_ECHO(["${msg_result_no}$[]1${msg_reset}]")],
+ [AS_ECHO(["${msg_result_other}$[]1${msg_reset}]")])])
+])
+
+AC_DEFUN([COLORIZE_RESULT], [AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
+ AS_LITERAL_IF([$1],
+ [m4_case([$1],
+ [yes], [AS_ECHO(["${msg_result_yes}$1${msg_reset}"])],
+ [no], [AS_ECHO(["${msg_result_no}$1${msg_reset}"])],
+ [AS_ECHO(["${msg_result_other}$1${msg_reset}"])])],
+ [colorize_result "$1"]) dnl
+])
+
+AC_DEFUN([AC_CHECKING],[dnl
+AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
+AS_MESSAGE([checking ${msg_checking}$1${msg_reset}...])])
+
+AC_DEFUN([AC_MSG_RESULT], [dnl
+{ _AS_ECHO_LOG([result: $1])
+COLORIZE_RESULT([$1]); dnl
+}])
diff --git a/addr2line.c b/addr2line.c
index f936694724..c8faf48d62 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -55,11 +55,8 @@ void *alloca();
# endif /* HAVE_ALLOCA_H */
#endif /* __GNUC__ */
-#ifdef HAVE_DL_ITERATE_PHDR
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-# endif
-# include <link.h>
+#ifdef HAVE_DLADDR
+# include <dlfcn.h>
#endif
#define DW_LNS_copy 0x01
@@ -88,6 +85,13 @@ void *alloca();
# define ElfW(x) Elf32##_##x
# endif
#endif
+#ifndef ELF_ST_TYPE
+# if SIZEOF_VOIDP == 8
+# define ELF_ST_TYPE ELF64_ST_TYPE
+# else
+# define ELF_ST_TYPE ELF32_ST_TYPE
+# endif
+#endif
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
@@ -97,13 +101,22 @@ int kprintf(const char *fmt, ...);
typedef struct {
const char *dirname;
const char *filename;
+ const char *path; /* object path */
int line;
+ uintptr_t base_addr;
+ uintptr_t saddr;
+ const char *sname; /* function name */
+} line_info_t;
+typedef struct obj_info obj_info_t;
+struct obj_info {
+ const char *path; /* object path */
int fd;
void *mapped;
size_t mapped_size;
- unsigned long base_addr;
-} line_info_t;
+ uintptr_t base_addr;
+ obj_info_t *next;
+};
/* Avoid consuming stack as this module may be used from signal handler */
static char binary_filename[PATH_MAX];
@@ -196,34 +209,15 @@ fill_filename(int file, char *include_directories, char *filenames,
}
}
-static int
-get_path_from_symbol(const char *symbol, const char **p, size_t *len)
-{
- if (symbol[0] == '0') {
- /* libexecinfo */
- *p = strchr(symbol, '/');
- if (*p == NULL) return 0;
- *len = strlen(*p);
- }
- else {
- /* glibc */
- const char *q;
- *p = symbol;
- q = strchr(symbol, '(');
- if (q == NULL) return 0;
- *len = q - symbol;
- }
- return 1;
-}
-
static void
-fill_line(int num_traces, void **traces,
- unsigned long addr, int file, int line,
- char *include_directories, char *filenames, line_info_t *lines)
+fill_line(int num_traces, void **traces, uintptr_t addr, int file, int line,
+ char *include_directories, char *filenames,
+ obj_info_t *obj, line_info_t *lines, int offset)
{
int i;
- for (i = 0; i < num_traces; i++) {
- unsigned long a = (unsigned long)traces[i] - lines[i].base_addr;
+ addr += obj->base_addr;
+ for (i = offset; i < num_traces; i++) {
+ uintptr_t a = (uintptr_t)traces[i];
/* We assume one line code doesn't result >100 bytes of native code.
We may want more reliable way eventually... */
if (addr < a && a < addr + 100) {
@@ -234,8 +228,8 @@ fill_line(int num_traces, void **traces,
}
static void
-parse_debug_line_cu(int num_traces, void **traces,
- char **debug_line, line_info_t *lines)
+parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
+ obj_info_t *obj, line_info_t *lines, int offset)
{
char *p, *cu_end, *cu_start, *include_directories, *filenames;
unsigned long unit_length;
@@ -281,7 +275,7 @@ parse_debug_line_cu(int num_traces, void **traces,
is_stmt = default_is_stmt = *(unsigned char *)p;
p++;
- line_base = *(char *)p;
+ line_base = *(signed char *)p;
p++;
line_range = *(unsigned char *)p;
@@ -309,7 +303,8 @@ parse_debug_line_cu(int num_traces, void **traces,
#define FILL_LINE() \
do { \
fill_line(num_traces, traces, addr, file, line, \
- include_directories, filenames, lines); \
+ include_directories, filenames, \
+ obj, lines, offset); \
/*basic_block = prologue_end = epilogue_begin = 0;*/ \
} while (0)
@@ -408,11 +403,12 @@ parse_debug_line_cu(int num_traces, void **traces,
static void
parse_debug_line(int num_traces, void **traces,
- char *debug_line, unsigned long size, line_info_t *lines)
+ char *debug_line, unsigned long size,
+ obj_info_t *obj, line_info_t *lines, int offset)
{
char *debug_line_end = debug_line + size;
while (debug_line < debug_line_end) {
- parse_debug_line_cu(num_traces, traces, &debug_line, lines);
+ parse_debug_line_cu(num_traces, traces, &debug_line, obj, lines, offset);
}
if (debug_line != debug_line_end) {
kprintf("Unexpected size of .debug_line in %s\n",
@@ -421,19 +417,27 @@ parse_debug_line(int num_traces, void **traces,
}
/* read file and fill lines */
+static uintptr_t
+fill_lines(int num_traces, void **traces, int check_debuglink,
+ obj_info_t **objp, line_info_t *lines, int offset);
+
static void
-fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
- line_info_t *current_line, line_info_t *lines);
+append_obj(obj_info_t **objp) {
+ obj_info_t *newobj = calloc(1, sizeof(obj_info_t));
+ if (*objp) (*objp)->next = newobj;
+ *objp = newobj;
+}
static void
-follow_debuglink(char *debuglink, int num_traces, void **traces, char **syms,
- line_info_t *current_line, line_info_t *lines)
+follow_debuglink(char *debuglink, int num_traces, void **traces,
+ obj_info_t **objp, line_info_t *lines, int offset)
{
/* Ideally we should check 4 paths to follow gnu_debuglink,
but we handle only one case for now as this format is used
by some linux distributions. See GDB's info for detail. */
static const char global_debug_dir[] = "/usr/lib/debug";
char *p, *subdir;
+ obj_info_t *o1 = *objp, *o2;
p = strrchr(binary_filename, '/');
if (!p) {
@@ -444,22 +448,22 @@ follow_debuglink(char *debuglink, int num_traces, void **traces, char **syms,
subdir = (char *)alloca(strlen(binary_filename) + 1);
strcpy(subdir, binary_filename);
strcpy(binary_filename, global_debug_dir);
- strncat(binary_filename, subdir,
- PATH_MAX - strlen(binary_filename) - 1);
- strncat(binary_filename, debuglink,
- PATH_MAX - strlen(binary_filename) - 1);
-
- munmap(current_line->mapped, current_line->mapped_size);
- close(current_line->fd);
- fill_lines(num_traces, traces, syms, 0, current_line, lines);
+ strlcat(binary_filename, subdir, PATH_MAX);
+ strlcat(binary_filename, debuglink, PATH_MAX);
+
+ append_obj(objp);
+ o2 = *objp;
+ o2->base_addr = o1->base_addr;
+ o2->path = o1->path;
+ fill_lines(num_traces, traces, 0, objp, lines, offset);
}
/* read file and fill lines */
-static void
-fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
- line_info_t *current_line, line_info_t *lines)
+static uintptr_t
+fill_lines(int num_traces, void **traces, int check_debuglink,
+ obj_info_t **objp, line_info_t *lines, int offset)
{
- int i;
+ int i, j;
char *shstr;
char *section_name;
ElfW(Ehdr) *ehdr;
@@ -468,23 +472,27 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
int fd;
off_t filesize;
char *file;
+ ElfW(Shdr) *symtab_shdr = NULL, *strtab_shdr = NULL;
+ ElfW(Shdr) *dynsym_shdr = NULL, *dynstr_shdr = NULL;
+ obj_info_t *obj = *objp;
+ uintptr_t dladdr_fbase = 0;
fd = open(binary_filename, O_RDONLY);
if (fd < 0) {
- return;
+ goto fail;
}
filesize = lseek(fd, 0, SEEK_END);
if (filesize < 0) {
int e = errno;
close(fd);
kprintf("lseek: %s\n", strerror(e));
- return;
+ goto fail;
}
#if SIZEOF_OFF_T > SIZEOF_SIZE_T
if (filesize > (off_t)SIZE_MAX) {
close(fd);
kprintf("Too large file %s\n", binary_filename);
- return;
+ goto fail;
}
#endif
lseek(fd, 0, SEEK_SET);
@@ -494,7 +502,7 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
int e = errno;
close(fd);
kprintf("mmap: %s\n", strerror(e));
- return;
+ goto fail;
}
ehdr = (ElfW(Ehdr) *)file;
@@ -504,21 +512,12 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
* it match non-elf file.
*/
close(fd);
- return;
+ goto fail;
}
- current_line->fd = fd;
- current_line->mapped = file;
- current_line->mapped_size = (size_t)filesize;
-
- for (i = 0; i < num_traces; i++) {
- const char *path;
- size_t len;
- if (get_path_from_symbol(syms[i], &path, &len) &&
- !strncmp(path, binary_filename, len)) {
- lines[i].line = -1;
- }
- }
+ obj->fd = fd;
+ obj->mapped = file;
+ obj->mapped_size = (size_t)filesize;
shdr = (ElfW(Shdr) *)(file + ehdr->e_shoff);
@@ -527,11 +526,88 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
for (i = 0; i < ehdr->e_shnum; i++) {
section_name = shstr + shdr[i].sh_name;
- if (!strcmp(section_name, ".debug_line")) {
- debug_line_shdr = shdr + i;
+ switch (shdr[i].sh_type) {
+ case SHT_STRTAB:
+ if (!strcmp(section_name, ".strtab")) {
+ strtab_shdr = shdr + i;
+ }
+ else if (!strcmp(section_name, ".dynstr")) {
+ dynstr_shdr = shdr + i;
+ }
+ break;
+ case SHT_SYMTAB:
+ /* if (!strcmp(section_name, ".symtab")) */
+ symtab_shdr = shdr + i;
+ break;
+ case SHT_DYNSYM:
+ /* if (!strcmp(section_name, ".dynsym")) */
+ dynsym_shdr = shdr + i;
break;
- } else if (!strcmp(section_name, ".gnu_debuglink")) {
- gnu_debuglink_shdr = shdr + i;
+ case SHT_PROGBITS:
+ if (!strcmp(section_name, ".debug_line")) {
+ debug_line_shdr = shdr + i;
+ }
+ else if (!strcmp(section_name, ".gnu_debuglink")) {
+ gnu_debuglink_shdr = shdr + i;
+ }
+ break;
+ }
+ }
+
+ if (offset == -1) {
+ /* main executable */
+ offset = 0;
+ if (dynsym_shdr && dynstr_shdr) {
+ char *strtab = file + dynstr_shdr->sh_offset;
+ ElfW(Sym) *symtab = (ElfW(Sym) *)(file + dynsym_shdr->sh_offset);
+ int symtab_count = (int)(dynsym_shdr->sh_size / sizeof(ElfW(Sym)));
+ for (j = 0; j < symtab_count; j++) {
+ ElfW(Sym) *sym = &symtab[j];
+ Dl_info info;
+ void *h, *s;
+ if (ELF_ST_TYPE(sym->st_info) != STT_FUNC || sym->st_size <= 0) continue;
+ h = dlopen(NULL, RTLD_NOW|RTLD_LOCAL);
+ if (!h) continue;
+ s = dlsym(h, strtab + sym->st_name);
+ if (!s) continue;
+ if (dladdr(s, &info)) {
+ dladdr_fbase = (uintptr_t)info.dli_fbase;
+ break;
+ }
+ }
+ if (ehdr->e_type == ET_EXEC) {
+ obj->base_addr = 0;
+ }
+ else {
+ /* PIE (position-independent executable) */
+ obj->base_addr = dladdr_fbase;
+ }
+ }
+ }
+
+ if (!symtab_shdr) {
+ symtab_shdr = dynsym_shdr;
+ strtab_shdr = dynstr_shdr;
+ }
+
+ if (symtab_shdr && strtab_shdr) {
+ char *strtab = file + strtab_shdr->sh_offset;
+ ElfW(Sym) *symtab = (ElfW(Sym) *)(file + symtab_shdr->sh_offset);
+ int symtab_count = (int)(symtab_shdr->sh_size / sizeof(ElfW(Sym)));
+ for (j = 0; j < symtab_count; j++) {
+ ElfW(Sym) *sym = &symtab[j];
+ uintptr_t saddr = (uintptr_t)sym->st_value + obj->base_addr;
+ if (ELF_ST_TYPE(sym->st_info) != STT_FUNC || sym->st_size <= 0) continue;
+ for (i = offset; i < num_traces; i++) {
+ uintptr_t d = (uintptr_t)traces[i] - saddr;
+ if (lines[i].line > 0 || d <= 0 || d > (uintptr_t)sym->st_size)
+ continue;
+ /* fill symbol name and addr from .symtab */
+ lines[i].sname = strtab + sym->st_name;
+ lines[i].saddr = saddr;
+ lines[i].path = obj->path;
+ lines[i].base_addr = obj->base_addr;
+ }
}
}
@@ -540,111 +616,161 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
let's check .gnu_debuglink section instead. */
if (gnu_debuglink_shdr && check_debuglink) {
follow_debuglink(file + gnu_debuglink_shdr->sh_offset,
- num_traces, traces, syms,
- current_line, lines);
+ num_traces, traces,
+ objp, lines, offset);
}
- return;
+ goto finish;
}
parse_debug_line(num_traces, traces,
file + debug_line_shdr->sh_offset,
debug_line_shdr->sh_size,
- lines);
+ obj, lines, offset);
+finish:
+ return dladdr_fbase;
+fail:
+ return (uintptr_t)-1;
}
-#ifdef HAVE_DL_ITERATE_PHDR
-
-typedef struct {
- int num_traces;
- char **syms;
- line_info_t *lines;
-} fill_base_addr_state_t;
-
-static int
-fill_base_addr(struct dl_phdr_info *info, size_t size, void *data)
+#define HAVE_MAIN_EXE_PATH
+#if defined(__FreeBSD__)
+# include <sys/sysctl.h>
+#endif
+/* ssize_t main_exe_path(void)
+ *
+ * store the path of the main executable to `binary_filename`,
+ * and returns strlen(binary_filename).
+ * it is NUL terminated.
+ */
+#if defined(__linux__)
+ssize_t
+main_exe_path(void)
{
- int i;
- fill_base_addr_state_t *st = (fill_base_addr_state_t *)data;
- for (i = 0; i < st->num_traces; i++) {
- const char *path;
- size_t len;
- size_t name_len = strlen(info->dlpi_name);
-
- if (get_path_from_symbol(st->syms[i], &path, &len) &&
- (len == name_len || (len > name_len && path[len-name_len-1] == '/')) &&
- !strncmp(path+len-name_len, info->dlpi_name, name_len)) {
- st->lines[i].base_addr = info->dlpi_addr;
- }
+# define PROC_SELF_EXE "/proc/self/exe"
+ ssize_t len = readlink(PROC_SELF_EXE, binary_filename, PATH_MAX);
+ binary_filename[len] = 0;
+ return len;
+}
+#elif defined(__FreeBSD__)
+ssize_t
+main_exe_path(void)
+{
+ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+ size_t len = PATH_MAX;
+ int err = sysctl(mib, 4, binary_filename, &len, NULL, 0);
+ if (err) {
+ kprintf("Can't get the path of ruby");
+ return -1;
}
- return 0;
+ len--; /* sysctl sets strlen+1 */
+ return len;
}
-
-#endif /* HAVE_DL_ITERATE_PHDR */
+#else
+#undef HAVE_MAIN_EXE_PATH
+#endif
void
-rb_dump_backtrace_with_lines(int num_traces, void **trace, char **syms)
+rb_dump_backtrace_with_lines(int num_traces, void **traces)
{
int i;
/* async-signal unsafe */
- line_info_t *lines = (line_info_t *)calloc(num_traces,
- sizeof(line_info_t));
-
- /* Note that line info of shared objects might not be shown
- if we don't have dl_iterate_phdr */
-#ifdef HAVE_DL_ITERATE_PHDR
- fill_base_addr_state_t fill_base_addr_state;
-
- fill_base_addr_state.num_traces = num_traces;
- fill_base_addr_state.syms = syms;
- fill_base_addr_state.lines = lines;
- /* maybe async-signal unsafe */
- dl_iterate_phdr(fill_base_addr, &fill_base_addr_state);
-#endif /* HAVE_DL_ITERATE_PHDR */
-
- for (i = 0; i < num_traces; i++) {
- const char *path;
- size_t len;
- if (lines[i].line) {
- continue;
- }
-
- if (!get_path_from_symbol(syms[i], &path, &len)) {
- continue;
+ line_info_t *lines = (line_info_t *)calloc(num_traces, sizeof(line_info_t));
+ obj_info_t *obj = NULL;
+ /* 2 is NULL + main executable */
+ void **dladdr_fbases = (void **)calloc(num_traces+2, sizeof(void *));
+#ifdef HAVE_MAIN_EXE_PATH
+ char *main_path = NULL; /* used on printing backtrace */
+ ssize_t len;
+ if ((len = main_exe_path()) > 0) {
+ main_path = (char *)alloca(len + 1);
+ if (main_path) {
+ uintptr_t addr;
+ memcpy(main_path, binary_filename, len+1);
+ append_obj(&obj);
+ obj->path = main_path;
+ addr = fill_lines(num_traces, traces, 1, &obj, lines, -1);
+ if (addr != (uintptr_t)-1) {
+ dladdr_fbases[0] = (void *)addr;
+ }
}
-
- strncpy(binary_filename, path, len);
- binary_filename[len] = '\0';
-
- fill_lines(num_traces, trace, syms, 1, &lines[i], lines);
}
+#endif
+ /* fill source lines by reading dwarf */
for (i = 0; i < num_traces; i++) {
- line_info_t *line = &lines[i];
-
- if (line->line > 0) {
- if (line->filename) {
- if (line->dirname && line->dirname[0]) {
- kprintf("%s %s/%s:%d\n", syms[i], line->dirname, line->filename, line->line);
+ Dl_info info;
+ if (lines[i].line) continue;
+ if (dladdr(traces[i], &info)) {
+ const char *path;
+ void **p;
+
+ /* skip symbols which is in already checked objects */
+ /* if the binary is strip-ed, this may effect */
+ for (p=dladdr_fbases; *p; p++) {
+ if (*p == info.dli_fbase) {
+ lines[i].path = info.dli_fname;
+ lines[i].sname = info.dli_sname;
+ goto next_line;
}
- else {
- kprintf("%s %s:%d\n", syms[i], line->filename, line->line);
- }
- } else {
- kprintf("%s ???:%d\n", syms[i], line->line);
}
- } else {
- kprintf("%s\n", syms[i]);
+ *p = info.dli_fbase;
+
+ append_obj(&obj);
+ obj->base_addr = (uintptr_t)info.dli_fbase;
+ path = info.dli_fname;
+ obj->path = path;
+ lines[i].path = path;
+ strcpy(binary_filename, path);
+ fill_lines(num_traces, traces, 1, &obj, lines, i);
}
+next_line:
+ continue;
}
+ /* output */
for (i = 0; i < num_traces; i++) {
line_info_t *line = &lines[i];
- if (line->fd) {
- munmap(line->mapped, line->mapped_size);
- close(line->fd);
+ uintptr_t addr = (uintptr_t)traces[i];
+ uintptr_t d = addr - line->saddr;
+ if (!line->path) {
+ kprintf("[0x%lx]\n", addr);
+ }
+ else if (!line->saddr || !line->sname) {
+ kprintf("%s [0x%lx]\n", line->path, addr);
+ }
+ else if (line->line <= 0) {
+ kprintf("%s(%s+0x%lx) [0x%lx]\n", line->path, line->sname,
+ d, addr);
+ }
+ else if (!line->filename) {
+ kprintf("%s(%s+0x%lx) [0x%lx] ???:%d\n", line->path, line->sname,
+ d, addr, line->line);
+ }
+ else if (line->dirname && line->dirname[0]) {
+ kprintf("%s(%s+0x%lx) [0x%lx] %s/%s:%d\n", line->path, line->sname,
+ d, addr, line->dirname, line->filename, line->line);
+ }
+ else {
+ kprintf("%s(%s+0x%lx) [0x%lx] %s:%d\n", line->path, line->sname,
+ d, addr, line->filename, line->line);
+ }
+ /* FreeBSD's backtrace may show _start and so on */
+ if (line->sname && strcmp("main", line->sname) == 0)
+ break;
+ }
+
+ /* free */
+ while (obj) {
+ obj_info_t *o = obj;
+ obj = o->next;
+ if (o->fd) {
+ munmap(o->mapped, o->mapped_size);
+ close(o->fd);
}
+ free(o);
}
free(lines);
+ free(dladdr_fbases);
}
/* From FreeBSD's lib/libstand/printf.c */
diff --git a/addr2line.h b/addr2line.h
index 3782d89e07..d99f010934 100644
--- a/addr2line.h
+++ b/addr2line.h
@@ -14,7 +14,7 @@
#ifdef USE_ELF
void
-rb_dump_backtrace_with_lines(int num_traces, void **traces, char **syms);
+rb_dump_backtrace_with_lines(int num_traces, void **traces);
#endif /* USE_ELF */
diff --git a/array.c b/array.c
index 0241d72b5f..de81ee7fab 100644
--- a/array.c
+++ b/array.c
@@ -11,11 +11,9 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/util.h"
#include "ruby/st.h"
-#include "ruby/encoding.h"
-#include "internal.h"
#include "probes.h"
#include "id.h"
@@ -31,70 +29,6 @@ static ID id_cmp, id_div, id_power;
#define ARY_DEFAULT_SIZE 16
#define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE))
-void
-rb_mem_clear(register VALUE *mem, register long size)
-{
- while (size--) {
- *mem++ = Qnil;
- }
-}
-
-static void
-ary_mem_clear(VALUE ary, long beg, long size)
-{
- RARRAY_PTR_USE(ary, ptr, {
- rb_mem_clear(ptr + beg, size);
- });
-}
-
-static inline void
-memfill(register VALUE *mem, register long size, register VALUE val)
-{
- while (size--) {
- *mem++ = val;
- }
-}
-
-static void
-ary_memfill(VALUE ary, long beg, long size, VALUE val)
-{
- RARRAY_PTR_USE(ary, ptr, {
- memfill(ptr + beg, size, val);
- RB_OBJ_WRITTEN(ary, Qundef, val);
- });
-}
-
-static void
-ary_memcpy(VALUE ary, long beg, long argc, const VALUE *argv)
-{
-#if 1
- if (OBJ_PROMOTED(ary)) {
- if (argc > (int)(128/sizeof(VALUE)) /* is magic number (cache line size) */) {
- rb_gc_writebarrier_remember_promoted(ary);
- RARRAY_PTR_USE(ary, ptr, {
- MEMCPY(ptr+beg, argv, VALUE, argc);
- });
- }
- else {
- int i;
- RARRAY_PTR_USE(ary, ptr, {
- for (i=0; i<argc; i++) {
- RB_OBJ_WRITE(ary, &ptr[i+beg], argv[i]);
- }
- });
- }
- }
- else {
- RARRAY_PTR_USE(ary, ptr, {
- MEMCPY(ptr+beg, argv, VALUE, argc);
- });
- }
-#else
- /* giveup write barrier (traditional way) */
- MEMCPY(RARRAY_PTR(ary)+beg, argv, VALUE, argc);
-#endif
-}
-
# define ARY_SHARED_P(ary) \
(assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
FL_TEST((ary),ELTS_SHARED)!=0)
@@ -195,6 +129,74 @@ ary_memcpy(VALUE ary, long beg, long argc, const VALUE *argv)
FL_SET((ary), RARRAY_SHARED_ROOT_FLAG); \
} while (0)
+#define ARY_SET(a, i, v) RARRAY_ASET((assert(!ARY_SHARED_P(a)), (a)), (i), (v))
+
+void
+rb_mem_clear(register VALUE *mem, register long size)
+{
+ while (size--) {
+ *mem++ = Qnil;
+ }
+}
+
+static void
+ary_mem_clear(VALUE ary, long beg, long size)
+{
+ RARRAY_PTR_USE(ary, ptr, {
+ rb_mem_clear(ptr + beg, size);
+ });
+}
+
+static inline void
+memfill(register VALUE *mem, register long size, register VALUE val)
+{
+ while (size--) {
+ *mem++ = val;
+ }
+}
+
+static void
+ary_memfill(VALUE ary, long beg, long size, VALUE val)
+{
+ RARRAY_PTR_USE(ary, ptr, {
+ memfill(ptr + beg, size, val);
+ RB_OBJ_WRITTEN(ary, Qundef, val);
+ });
+}
+
+static void
+ary_memcpy0(VALUE ary, long beg, long argc, const VALUE *argv, VALUE buff_owner_ary)
+{
+#if 1
+ assert(!ARY_SHARED_P(buff_owner_ary));
+
+ if (argc > (int)(128/sizeof(VALUE)) /* is magic number (cache line size) */) {
+ rb_gc_writebarrier_remember(buff_owner_ary);
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMCPY(ptr+beg, argv, VALUE, argc);
+ });
+ }
+ else {
+ int i;
+ RARRAY_PTR_USE(ary, ptr, {
+ for (i=0; i<argc; i++) {
+ RB_OBJ_WRITE(buff_owner_ary, &ptr[i+beg], argv[i]);
+ }
+ });
+ }
+#else
+ /* giveup write barrier (traditional way) */
+ RARRAY_PTR(buff_owner_ary);
+ MEMCPY(RARRAY_PTR(ary)+beg, argv, VALUE, argc);
+#endif
+}
+
+static void
+ary_memcpy(VALUE ary, long beg, long argc, const VALUE *argv)
+{
+ ary_memcpy0(ary, beg, argc, argv, ary);
+}
+
static void
ary_resize_capa(VALUE ary, long capacity)
{
@@ -343,21 +345,28 @@ rb_ary_modify(VALUE ary)
ARY_SET_CAPA(ary, len);
ARY_SET_PTR(ary, ptr);
}
+
+ rb_gc_writebarrier_remember(ary);
}
}
-static void
+static VALUE
ary_ensure_room_for_push(VALUE ary, long add_len)
{
- long new_len = RARRAY_LEN(ary) + add_len;
+ long old_len = RARRAY_LEN(ary);
+ long new_len = old_len + add_len;
long capa;
+ if (old_len > ARY_MAX_SIZE - add_len) {
+ rb_raise(rb_eIndexError, "index %ld too big", new_len);
+ }
if (ARY_SHARED_P(ary)) {
if (new_len > RARRAY_EMBED_LEN_MAX) {
VALUE shared = ARY_SHARED(ary);
if (ARY_SHARED_OCCUPIED(shared)) {
if (RARRAY_CONST_PTR(ary) - RARRAY_CONST_PTR(shared) + new_len <= RARRAY_LEN(shared)) {
rb_ary_modify_check(ary);
+ return shared;
}
else {
/* if array is shared, then it is likely it participate in push/shift pattern */
@@ -366,8 +375,8 @@ ary_ensure_room_for_push(VALUE ary, long add_len)
if (new_len > capa - (capa >> 6)) {
ary_double_capa(ary, new_len);
}
+ return ary;
}
- return;
}
}
}
@@ -376,6 +385,8 @@ ary_ensure_room_for_push(VALUE ary, long add_len)
if (new_len > capa) {
ary_double_capa(ary, new_len);
}
+
+ return ary;
}
/*
@@ -442,10 +453,7 @@ 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());
- }
-
+ RUBY_DTRACE_CREATE_HOOK(ARRAY, 0);
return ary_alloc(klass);
}
@@ -461,21 +469,16 @@ ary_new(VALUE klass, long capa)
rb_raise(rb_eArgError, "array size too big");
}
- if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
- RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
- }
+ RUBY_DTRACE_CREATE_HOOK(ARRAY, capa);
+ ary = ary_alloc(klass);
if (capa > RARRAY_EMBED_LEN_MAX) {
ptr = ALLOC_N(VALUE, capa);
- ary = ary_alloc(klass);
FL_UNSET_EMBED(ary);
ARY_SET_PTR(ary, ptr);
ARY_SET_CAPA(ary, capa);
ARY_SET_HEAP_LEN(ary, 0);
}
- else {
- ary = ary_alloc(klass);
- }
return ary;
}
@@ -493,7 +496,7 @@ rb_ary_new(void)
}
VALUE
-rb_ary_new_from_args(long n, ...)
+(rb_ary_new_from_args)(long n, ...)
{
va_list ar;
VALUE ary;
@@ -503,7 +506,7 @@ rb_ary_new_from_args(long n, ...)
va_start(ar, n);
for (i=0; i<n; i++) {
- RARRAY_ASET(ary, i, va_arg(ar, VALUE));
+ ARY_SET(ary, i, va_arg(ar, VALUE));
}
va_end(ar);
@@ -531,6 +534,15 @@ rb_ary_tmp_new(long capa)
return ary_new(0, capa);
}
+VALUE
+rb_ary_tmp_new_fill(long capa)
+{
+ VALUE ary = ary_new(0, capa);
+ ary_memfill(ary, 0, capa, Qnil);
+ ARY_SET_LEN(ary, capa);
+ return ary;
+}
+
void
rb_ary_free(VALUE ary)
{
@@ -576,7 +588,7 @@ ary_make_shared(VALUE ary)
}
else {
long capa = ARY_CAPA(ary), len = RARRAY_LEN(ary);
- NEWOBJ_OF(shared, struct RArray, 0, T_ARRAY); /* keep shared ary as non-WB-protected */
+ NEWOBJ_OF(shared, struct RArray, 0, T_ARRAY | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0));
FL_UNSET_EMBED(shared);
ARY_SET_LEN((VALUE)shared, capa);
@@ -652,16 +664,16 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
/*
* call-seq:
- * Array.new(size=0, obj=nil)
+ * Array.new(size=0, default=nil)
* Array.new(array)
* Array.new(size) {|index| block }
*
* 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+.
+ * When a +size+ and an optional +default+ are sent, an array is created with
+ * +size+ copies of +default+. Take notice that all elements will reference the
+ * same object +default+.
*
* The second form creates a copy of the array passed as a parameter (the
* array is generated by calling to_ary on the parameter).
@@ -735,12 +747,14 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
}
len = NUM2LONG(size);
+ /* NUM2LONG() may call size.to_int, ary can be frozen, modified, etc */
if (len < 0) {
rb_raise(rb_eArgError, "negative array size");
}
if (len > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
+ /* recheck after argument conversion */
rb_ary_modify(ary);
ary_resize_capa(ary, len);
if (rb_block_given_p()) {
@@ -808,7 +822,7 @@ rb_ary_store(VALUE ary, long idx, VALUE val)
if (idx >= len) {
ARY_SET_LEN(ary, idx + 1);
}
- RARRAY_ASET(ary, idx, val);
+ ARY_SET(ary, idx, val);
}
static VALUE
@@ -852,7 +866,7 @@ enum ary_take_pos_flags
};
static VALUE
-ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
+ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
{
VALUE nv;
long n;
@@ -891,33 +905,20 @@ VALUE
rb_ary_push(VALUE ary, VALUE item)
{
long idx = RARRAY_LEN(ary);
-
- ary_ensure_room_for_push(ary, 1);
- RARRAY_ASET(ary, idx, item);
- ARY_SET_LEN(ary, idx + 1);
- return ary;
-}
-
-static VALUE
-rb_ary_push_1(VALUE ary, VALUE item)
-{
- long idx = RARRAY_LEN(ary);
-
- if (idx >= ARY_CAPA(ary)) {
- ary_double_capa(ary, idx);
- }
- RARRAY_ASET(ary, idx, item);
+ VALUE target_ary = ary_ensure_room_for_push(ary, 1);
+ RARRAY_PTR_USE(ary, ptr, {
+ RB_OBJ_WRITE(target_ary, &ptr[idx], item);
+ });
ARY_SET_LEN(ary, idx + 1);
return ary;
}
VALUE
-rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+rb_ary_cat(VALUE ary, const VALUE *argv, long len)
{
long oldlen = RARRAY_LEN(ary);
-
- ary_ensure_room_for_push(ary, len);
- ary_memcpy(ary, oldlen, len, ptr);
+ VALUE target_ary = ary_ensure_room_for_push(ary, len);
+ ary_memcpy0(ary, oldlen, len, argv, target_ary);
ARY_SET_LEN(ary, oldlen + len);
return ary;
}
@@ -1014,11 +1015,11 @@ rb_ary_shift(VALUE ary)
}
assert(!ARY_EMBED_P(ary)); /* ARY_EMBED_LEN_MAX < ARY_DEFAULT_SIZE */
- RARRAY_ASET(ary, 0, Qnil);
+ ARY_SET(ary, 0, Qnil);
ary_make_shared(ary);
}
else if (ARY_SHARED_OCCUPIED(ARY_SHARED(ary))) {
- RARRAY_ASET(ary, 0, Qnil);
+ RARRAY_PTR_USE(ary, ptr, ptr[0] = Qnil);
}
ARY_INCREASE_PTR(ary, 1); /* shift ptr */
ARY_INCREASE_LEN(ary, -1);
@@ -1064,21 +1065,28 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
n = RARRAY_LEN(result);
if (ARY_SHARED_P(ary)) {
if (ARY_SHARED_OCCUPIED(ARY_SHARED(ary))) {
+ setup_occupied_shared:
ary_mem_clear(ary, 0, n);
}
ARY_INCREASE_PTR(ary, n);
}
else {
- RARRAY_PTR_USE(ary, ptr, {
- MEMMOVE(ptr, ptr + n, VALUE, RARRAY_LEN(ary)-n);
- }); /* WB: no new reference */
+ if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMMOVE(ptr, ptr+n, VALUE, RARRAY_LEN(ary)-n);
+ }); /* WB: no new reference */
+ }
+ else {
+ ary_make_shared(ary);
+ goto setup_occupied_shared;
+ }
}
ARY_INCREASE_LEN(ary, -n);
return result;
}
-static void
+static VALUE
ary_ensure_room_for_unshift(VALUE ary, int argc)
{
long len = RARRAY_LEN(ary);
@@ -1086,6 +1094,10 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
long capa;
const VALUE *head, *sharedp;
+ if (len > ARY_MAX_SIZE - argc) {
+ rb_raise(rb_eIndexError, "index %ld too big", new_len);
+ }
+
if (ARY_SHARED_P(ary)) {
VALUE shared = ARY_SHARED(ary);
capa = RARRAY_LEN(shared);
@@ -1120,12 +1132,16 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
head = sharedp + argc + room;
}
ARY_SET_PTR(ary, head - argc);
+ assert(ARY_SHARED_OCCUPIED(ARY_SHARED(ary)));
+ return ARY_SHARED(ary);
}
else {
/* sliding items */
RARRAY_PTR_USE(ary, ptr, {
MEMMOVE(ptr + argc, ptr, VALUE, len);
});
+
+ return ary;
}
}
@@ -1145,14 +1161,15 @@ static VALUE
rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
{
long len = RARRAY_LEN(ary);
+ VALUE target_ary;
if (argc == 0) {
rb_ary_modify_check(ary);
return ary;
}
- ary_ensure_room_for_unshift(ary, argc);
- ary_memcpy(ary, 0, argc, argv);
+ target_ary = ary_ensure_room_for_unshift(ary, argc);
+ ary_memcpy0(ary, 0, argc, argv, target_ary);
ARY_SET_LEN(ary, len + argc);
return ary;
}
@@ -1239,7 +1256,7 @@ rb_ary_subseq(VALUE ary, long beg, long len)
*/
VALUE
-rb_ary_aref(int argc, VALUE *argv, VALUE ary)
+rb_ary_aref(int argc, const VALUE *argv, VALUE ary)
{
VALUE arg;
long beg, len;
@@ -1285,7 +1302,7 @@ rb_ary_aref(int argc, VALUE *argv, VALUE ary)
* a.at(-1) #=> "e"
*/
-static VALUE
+VALUE
rb_ary_at(VALUE ary, VALUE pos)
{
return rb_ary_entry(ary, NUM2LONG(pos));
@@ -1334,7 +1351,7 @@ rb_ary_first(int argc, VALUE *argv, VALUE ary)
*/
VALUE
-rb_ary_last(int argc, VALUE *argv, VALUE ary)
+rb_ary_last(int argc, const VALUE *argv, VALUE ary)
{
if (argc == 0) {
long len = RARRAY_LEN(ary);
@@ -1563,20 +1580,24 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
olen = RARRAY_LEN(ary); /* ary may be resized in rpl.to_ary too */
}
if (beg >= olen) {
+ VALUE target_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 */
+ target_ary = ary_ensure_room_for_push(ary, rlen-len); /* len is 0 or negative */
len = beg + rlen;
ary_mem_clear(ary, olen, beg - olen);
if (rlen > 0) {
- ary_memcpy(ary, beg, rlen, RARRAY_CONST_PTR(rpl));
+ ary_memcpy0(ary, beg, rlen, RARRAY_CONST_PTR(rpl), target_ary);
}
ARY_SET_LEN(ary, len);
}
else {
long alen;
+ if (olen - len > ARY_MAX_SIZE - rlen) {
+ rb_raise(rb_eIndexError, "index %ld too big", olen + rlen - len);
+ }
rb_ary_modify(ary);
alen = olen + rlen - len;
if (alen >= ARY_CAPA(ary)) {
@@ -1593,6 +1614,7 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_CONST_PTR(rpl), VALUE, rlen);
}
}
+ RB_GC_GUARD(rpl);
}
void
@@ -1728,7 +1750,9 @@ fixnum:
* 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.
+ * the last element. If a negative index is used, the given values will be
+ * inserted after that element, so using an index of +-1+ will insert the
+ * values at the end of the array.
*
* a = %w{ a b c d }
* a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
@@ -1742,8 +1766,8 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
rb_ary_modify_check(ary);
- if (argc == 1) return ary;
pos = NUM2LONG(argv[0]);
+ if (argc == 1) return ary;
if (pos == -1) {
pos = RARRAY_LEN(ary);
}
@@ -1769,9 +1793,9 @@ ary_enum_length(VALUE ary, VALUE args, VALUE eobj)
* ary.each -> Enumerator
*
* Calls the given block once for each element in +self+, passing that element
- * as a parameter.
+ * as a parameter. Returns the array itself.
*
- * An Enumerator is returned if no block is given.
+ * If no block is given, an Enumerator is returned.
*
* a = [ "a", "b", "c" ]
* a.each {|x| print x, " -- " }
@@ -1782,10 +1806,9 @@ ary_enum_length(VALUE ary, VALUE args, VALUE eobj)
*/
VALUE
-rb_ary_each(VALUE array)
+rb_ary_each(VALUE ary)
{
long i;
- volatile VALUE ary = array;
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
for (i=0; i<RARRAY_LEN(ary); i++) {
@@ -2130,8 +2153,7 @@ rb_ary_to_a(VALUE ary)
* ary.to_h -> hash
*
* Returns the result of interpreting <i>ary</i> as an array of
- * <tt>[key, value]</tt> pairs. Elements other than pairs of
- * values are ignored.
+ * <tt>[key, value]</tt> pairs.
*
* [[:foo, :bar], [1, 2]].to_h
* # => {:foo => :bar, 1 => 2}
@@ -2143,10 +2165,17 @@ rb_ary_to_h(VALUE ary)
long i;
VALUE hash = rb_hash_new();
for (i=0; i<RARRAY_LEN(ary); i++) {
- VALUE key_value_pair = rb_check_array_type(rb_ary_elt(ary, i));
- if (!NIL_P(key_value_pair) && (RARRAY_LEN(key_value_pair) == 2)) {
- rb_hash_aset(hash, RARRAY_AREF(key_value_pair, 0), RARRAY_AREF(key_value_pair, 1));
+ const VALUE elt = rb_ary_elt(ary, i);
+ const VALUE key_value_pair = rb_check_array_type(elt);
+ if (NIL_P(key_value_pair)) {
+ rb_raise(rb_eTypeError, "wrong element type %"PRIsVALUE" at %ld (expected array)",
+ rb_obj_class(elt), i);
+ }
+ if (RARRAY_LEN(key_value_pair) != 2) {
+ rb_raise(rb_eArgError, "wrong array length at %ld (expected 2, was %ld)",
+ i, RARRAY_LEN(key_value_pair));
}
+ rb_hash_aset(hash, RARRAY_AREF(key_value_pair, 0), RARRAY_AREF(key_value_pair, 1));
}
return hash;
}
@@ -2412,9 +2441,9 @@ sort_2(const void *ap, const void *bp, void *dummy)
* 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+.
+ * The block must implement a comparison between +a+ and +b+ and return
+ * an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+
+ * are equivalent, or an integer greater than 0 when +a+ follows +b+.
*
* See also Enumerable#sort_by.
*
@@ -2445,8 +2474,8 @@ rb_ary_sort_bang(VALUE ary)
if (ARY_EMBED_P(tmp)) {
if (ARY_SHARED_P(ary)) { /* ary might be destructively operated in the given block */
rb_ary_unshare(ary);
+ FL_SET_EMBED(ary);
}
- FL_SET_EMBED(ary);
ary_memcpy(ary, 0, ARY_EMBED_LEN(tmp), ARY_EMBED_PTR(tmp));
ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp));
}
@@ -2493,9 +2522,9 @@ rb_ary_sort_bang(VALUE ary)
* 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+.
+ * The block must implement a comparison between +a+ and +b+ and return
+ * an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+
+ * are equivalent, or an integer greater than 0 when +a+ follows +b+.
*
*
* See also Enumerable#sort_by.
@@ -2513,6 +2542,8 @@ rb_ary_sort(VALUE ary)
return ary;
}
+static VALUE rb_ary_bsearch_index(VALUE ary);
+
/*
* call-seq:
* ary.bsearch {|x| block } -> elem
@@ -2569,6 +2600,30 @@ rb_ary_sort(VALUE ary)
static VALUE
rb_ary_bsearch(VALUE ary)
{
+ VALUE index_result = rb_ary_bsearch_index(ary);
+
+ if (FIXNUM_P(index_result)) {
+ return rb_ary_entry(ary, FIX2LONG(index_result));
+ }
+ return index_result;
+}
+
+/*
+ * call-seq:
+ * ary.bsearch_index {|x| block } -> int or nil
+ *
+ * By using binary search, finds an index of a value from this array which
+ * meets the given condition in O(log n) where n is the size of the array.
+ *
+ * It supports two modes, depending on the nature of the block and they are
+ * exactly the same as in the case of #bsearch method with the only difference
+ * being that this method returns the index of the element instead of the
+ * element itself. For more details consult the documentation for #bsearch.
+ */
+
+static VALUE
+rb_ary_bsearch_index(VALUE ary)
+{
long low = 0, high = RARRAY_LEN(ary), mid;
int smaller = 0, satisfied = 0;
VALUE v, val;
@@ -2579,8 +2634,8 @@ rb_ary_bsearch(VALUE ary)
val = rb_ary_entry(ary, mid);
v = rb_yield(val);
if (FIXNUM_P(v)) {
- if (FIX2INT(v) == 0) return val;
- smaller = FIX2INT(v) < 0;
+ if (v == INT2FIX(0)) return INT2FIX(mid);
+ smaller = (SIGNED_VALUE)v < 0; /* Fixnum preserves its sign-bit */
}
else if (v == Qtrue) {
satisfied = 1;
@@ -2591,16 +2646,16 @@ rb_ary_bsearch(VALUE ary)
}
else if (rb_obj_is_kind_of(v, rb_cNumeric)) {
const VALUE zero = INT2FIX(0);
- switch (rb_cmpint(rb_funcallv(v, id_cmp, 1, &zero), v, INT2FIX(0))) {
- case 0: return val;
- case 1: smaller = 1; break;
- case -1: smaller = 0;
+ switch (rb_cmpint(rb_funcallv(v, id_cmp, 1, &zero), v, zero)) {
+ case 0: return INT2FIX(mid);
+ case 1: smaller = 1; break;
+ case -1: smaller = 0;
}
}
else {
- rb_raise(rb_eTypeError, "wrong argument type %s"
- " (must be numeric, true, false or nil)",
- rb_obj_classname(v));
+ rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE
+ " (must be numeric, true, false or nil)",
+ rb_obj_class(v));
}
if (smaller) {
high = mid;
@@ -2609,9 +2664,8 @@ rb_ary_bsearch(VALUE ary)
low = mid + 1;
}
}
- if (low == RARRAY_LEN(ary)) return Qnil;
if (!satisfied) return Qnil;
- return rb_ary_entry(ary, low);
+ return INT2FIX(low);
}
@@ -2662,9 +2716,9 @@ rb_ary_sort_by_bang(VALUE ary)
* If no block is given, an Enumerator is returned instead.
*
* a = [ "a", "b", "c", "d" ]
- * a.collect { |x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
- * a.map.with_index{ |x, i| x * i } #=> ["", "b", "cc", "ddd"]
- * a #=> ["a", "b", "c", "d"]
+ * a.collect { |x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
+ * a.map.with_index { |x, i| x * i } #=> ["", "b", "cc", "ddd"]
+ * a #=> ["a", "b", "c", "d"]
*/
static VALUE
@@ -2717,7 +2771,7 @@ rb_ary_collect_bang(VALUE ary)
}
VALUE
-rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VALUE, long))
+rb_get_values_at(VALUE obj, long olen, int argc, const VALUE *argv, VALUE (*func) (VALUE, long))
{
VALUE result = rb_ary_new2(argc);
long beg, len, i, j;
@@ -2801,6 +2855,50 @@ rb_ary_select(VALUE ary)
return result;
}
+struct select_bang_arg {
+ VALUE ary;
+ long len[2];
+};
+
+static VALUE
+select_bang_i(VALUE a)
+{
+ volatile struct select_bang_arg *arg = (void *)a;
+ VALUE ary = arg->ary;
+ long i1, i2;
+
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); arg->len[0] = ++i1) {
+ VALUE v = RARRAY_AREF(ary, i1);
+ if (!RTEST(rb_yield(v))) continue;
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, v);
+ }
+ arg->len[1] = ++i2;
+ }
+ return (i1 == i2) ? Qnil : ary;
+}
+
+static VALUE
+select_bang_ensure(VALUE a)
+{
+ volatile struct select_bang_arg *arg = (void *)a;
+ VALUE ary = arg->ary;
+ long len = RARRAY_LEN(ary);
+ long i1 = arg->len[0], i2 = arg->len[1];
+
+ if (i2 < len && i2 < i1) {
+ long tail = 0;
+ if (i1 < len) {
+ tail = len - i1;
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMMOVE(ptr + i2, ptr + i1, VALUE, tail);
+ });
+ }
+ ARY_SET_LEN(ary, i2 + tail);
+ }
+ return ary;
+}
+
/*
* call-seq:
* ary.select! {|item| block } -> ary or nil
@@ -2809,6 +2907,8 @@ rb_ary_select(VALUE ary)
* Invokes the given block passing in successive elements from +self+,
* deleting elements for which the block returns a +false+ value.
*
+ * The array may not be changed instantly every time the block is called.
+ *
* If changes were made, it will return +self+, otherwise it returns +nil+.
*
* See also Array#keep_if
@@ -2820,23 +2920,14 @@ rb_ary_select(VALUE ary)
static VALUE
rb_ary_select_bang(VALUE ary)
{
- long i1, i2;
+ struct select_bang_arg args;
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
rb_ary_modify(ary);
- for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
- VALUE v = RARRAY_AREF(ary, i1);
- if (!RTEST(rb_yield(v))) continue;
- if (i1 != i2) {
- rb_ary_store(ary, i2, v);
- }
- i2++;
- }
- if (i1 == i2) return Qnil;
- if (i2 < i1)
- ARY_SET_LEN(ary, i2);
- return ary;
+ args.ary = ary;
+ args.len[0] = args.len[1] = 0;
+ return rb_ensure(select_bang_i, (VALUE)&args, select_bang_ensure, (VALUE)&args);
}
/*
@@ -3072,30 +3163,39 @@ ary_reject(VALUE orig, VALUE result)
for (i = 0; i < RARRAY_LEN(orig); i++) {
VALUE v = RARRAY_AREF(orig, i);
if (!RTEST(rb_yield(v))) {
- rb_ary_push_1(result, v);
+ rb_ary_push(result, v);
}
}
return result;
}
static VALUE
-ary_reject_bang(VALUE ary)
+reject_bang_i(VALUE a)
{
- long i;
- VALUE result = Qnil;
+ volatile struct select_bang_arg *arg = (void *)a;
+ VALUE ary = arg->ary;
+ long i1, i2;
- rb_ary_modify_check(ary);
- for (i = 0; i < RARRAY_LEN(ary); ) {
- VALUE v = RARRAY_AREF(ary, i);
- if (RTEST(rb_yield(v))) {
- rb_ary_delete_at(ary, i);
- result = ary;
- }
- else {
- i++;
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); arg->len[0] = ++i1) {
+ VALUE v = RARRAY_AREF(ary, i1);
+ if (RTEST(rb_yield(v))) continue;
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, v);
}
+ arg->len[1] = ++i2;
}
- return result;
+ return (i1 == i2) ? Qnil : ary;
+}
+
+static VALUE
+ary_reject_bang(VALUE ary)
+{
+ struct select_bang_arg args;
+
+ rb_ary_modify_check(ary);
+ args.ary = ary;
+ args.len[0] = args.len[1] = 0;
+ return rb_ensure(reject_bang_i, (VALUE)&args, select_bang_ensure, (VALUE)&args);
}
/*
@@ -3103,11 +3203,10 @@ ary_reject_bang(VALUE ary)
* ary.reject! { |item| block } -> ary or nil
* ary.reject! -> Enumerator
*
- * Equivalent to Array#delete_if, deleting elements from +self+ for which the
- * block evaluates to +true+, but returns +nil+ if no changes were made.
+ * Deletes every element of +self+ for which the block evaluates to +true+,
+ * if no changes were made returns +nil+.
*
- * The array is changed instantly every time the block is called, not after
- * the iteration is over.
+ * The array may not be changed instantly every time the block is called.
*
* See also Enumerable#reject and Array#delete_if.
*
@@ -3127,7 +3226,7 @@ rb_ary_reject_bang(VALUE ary)
* ary.reject -> Enumerator
*
* Returns a new array containing the items in +self+ for which the given
- * block is not +true+.
+ * block is not +true+. The ordering of non-rejected elements is maintained.
*
* See also Array#delete_if
*
@@ -3235,8 +3334,10 @@ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
if (rb_block_given_p()) {
int arity = rb_block_arity();
- if (arity > 1 && argc+1 < 0x100) {
- VALUE *tmp = ALLOCA_N(VALUE, argc+1);
+ if (arity > 1) {
+ VALUE work, *tmp;
+
+ tmp = ALLOCV_N(VALUE, work, argc+1);
for (i=0; i<RARRAY_LEN(ary); i++) {
tmp[0] = RARRAY_AREF(ary, i);
@@ -3245,6 +3346,8 @@ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
}
rb_yield_values2(argc+1, tmp);
}
+
+ if (work) ALLOCV_END(work);
}
else {
for (i=0; i<RARRAY_LEN(ary); i++) {
@@ -3483,7 +3586,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
for (i=beg; i<end; i++) {
v = rb_yield(LONG2NUM(i));
if (i>=RARRAY_LEN(ary)) break;
- RARRAY_ASET(ary, i, v);
+ ARY_SET(ary, i, v);
}
}
else {
@@ -3505,6 +3608,13 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
* c #=> [ "a", "b", "c", "d", "e", "f" ]
* a #=> [ "a", "b", "c" ]
*
+ * Note that
+ * x += y
+ * is the same as
+ * x = x + y
+ * This means that it produces a new array. As a consequence,
+ * repeated use of <code>+=</code> on arrays can be quite inefficient.
+ *
* See also Array#concat.
*/
@@ -3617,7 +3727,7 @@ rb_ary_times(VALUE ary, VALUE times)
/*
* call-seq:
- * ary.assoc(obj) -> new_ary or nil
+ * ary.assoc(obj) -> element_ary or nil
*
* Searches through an array whose elements are also arrays comparing +obj+
* with the first element of each contained array using <code>obj.==</code>.
@@ -3652,7 +3762,7 @@ rb_ary_assoc(VALUE ary, VALUE key)
/*
* call-seq:
- * ary.rassoc(obj) -> new_ary or nil
+ * ary.rassoc(obj) -> element_ary or nil
*
* Searches through the array whose elements are also arrays.
*
@@ -3736,7 +3846,7 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
{
if (ary1 == ary2) return Qtrue;
if (!RB_TYPE_P(ary2, T_ARRAY)) {
- if (!rb_respond_to(ary2, rb_intern("to_ary"))) {
+ if (!rb_respond_to(ary2, idTo_ary)) {
return Qfalse;
}
return rb_equal(ary2, ary1);
@@ -3785,6 +3895,8 @@ rb_ary_eql(VALUE ary1, VALUE ary2)
*
* Two arrays with the same content will have the same hash code (and will
* compare using #eql?).
+ *
+ * See also Object#hash.
*/
static VALUE
@@ -3820,9 +3932,15 @@ VALUE
rb_ary_includes(VALUE ary, VALUE item)
{
long i;
+ VALUE e;
for (i=0; i<RARRAY_LEN(ary); i++) {
- if (rb_equal(RARRAY_AREF(ary, i), item)) {
+ e = RARRAY_AREF(ary, i);
+ switch (rb_equal_opt(e, item)) {
+ case Qundef:
+ if (rb_equal(e, item)) return Qtrue;
+ break;
+ case Qtrue:
return Qtrue;
}
}
@@ -3857,21 +3975,26 @@ recursive_cmp(VALUE ary1, VALUE ary2, int recur)
* Comparison --- Returns an integer (+-1+, +0+, or <code>+1</code>) if this
* array is less than, equal to, or greater than +other_ary+.
*
- * +nil+ is returned if the two values are incomparable.
- *
* 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.
+ * Arrays are compared in an "element-wise" manner; the first element of +ary+
+ * is compared with the first one of +other_ary+ using the <=> operator, then
+ * each of the second elements, etc...
+ * As soon as the result of any such comparison is non zero (i.e. the two
+ * corresponding elements are not equal), that result is returned for the
+ * whole array comparison.
*
- * If all the values are equal, then the return is based on a comparison of
+ * If all the elements are equal, then the result 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.
*
+ * +nil+ is returned if the +other_ary+ is not an array or if the comparison
+ * of two elements returned +nil+.
+ *
* [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
* [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
+ * [ 1, 2 ] <=> [ 1, :two ] #=> nil
*
*/
@@ -3899,7 +4022,9 @@ ary_add_hash(VALUE hash, VALUE ary)
for (i=0; i<RARRAY_LEN(ary); i++) {
VALUE elt = RARRAY_AREF(ary, i);
- rb_hash_aset(hash, elt, elt);
+ if (rb_hash_lookup2(hash, elt, Qundef) == Qundef) {
+ rb_hash_aset(hash, elt, elt);
+ }
}
return hash;
}
@@ -3949,6 +4074,7 @@ ary_recycle_hash(VALUE hash)
RHASH(hash)->ntbl = 0;
st_free_table(tbl);
}
+ RB_GC_GUARD(hash);
}
/*
@@ -3972,7 +4098,7 @@ static VALUE
rb_ary_diff(VALUE ary1, VALUE ary2)
{
VALUE ary3;
- volatile VALUE hash;
+ VALUE hash;
long i;
hash = ary_make_hash(to_ary(ary2));
@@ -4090,6 +4216,8 @@ push_value(st_data_t key, st_data_t val, st_data_t ary)
*
* It compares values using their #hash and #eql? methods for efficiency.
*
+ * +self+ is traversed in order, and the first occurrence is kept.
+ *
* Returns +nil+ if no changes are made (that is, no duplicates are found).
*
* a = [ "a", "a", "b", "b", "c" ]
@@ -4145,6 +4273,8 @@ rb_ary_uniq_bang(VALUE ary)
*
* It compares values using their #hash and #eql? methods for efficiency.
*
+ * +self+ is traversed in order, and the first occurrence is kept.
+ *
* a = [ "a", "a", "b", "b", "c" ]
* a.uniq # => ["a", "b", "c"]
*
@@ -4296,11 +4426,15 @@ flatten(VALUE ary, int level, int *modified)
while (1) {
while (i < RARRAY_LEN(ary)) {
elt = RARRAY_AREF(ary, i++);
+ if (level >= 0 && RARRAY_LEN(stack) / 2 >= level) {
+ rb_ary_push(result, elt);
+ continue;
+ }
tmp = rb_check_array_type(elt);
if (RBASIC(result)->klass) {
rb_raise(rb_eRuntimeError, "flatten reentered");
}
- if (NIL_P(tmp) || (level >= 0 && RARRAY_LEN(stack) / 2 >= level)) {
+ if (NIL_P(tmp)) {
rb_ary_push(result, elt);
}
else {
@@ -4329,7 +4463,7 @@ flatten(VALUE ary, int level, int *modified)
st_free_table(memo);
- RBASIC_SET_CLASS(result, rb_class_of(ary));
+ RBASIC_SET_CLASS(result, rb_obj_class(ary));
return result;
}
@@ -4427,7 +4561,13 @@ static ID id_random;
*
* Shuffles elements in +self+ in place.
*
+ * a = [ 1, 2, 3 ] #=> [1, 2, 3]
+ * a.shuffle! #=> [2, 3, 1]
+ * a #=> [2, 3, 1]
+ *
* The optional +rng+ argument will be used as the random number generator.
+ *
+ * a.shuffle!(random: Random.new(1)) #=> [1, 3, 2]
*/
static VALUE
@@ -4474,6 +4614,7 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
*
* a = [ 1, 2, 3 ] #=> [1, 2, 3]
* a.shuffle #=> [2, 3, 1]
+ * a #=> [1, 2, 3]
*
* The optional +rng+ argument will be used as the random number generator.
*
@@ -4684,8 +4825,26 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
#define tmpary_discard(a) (ary_discard(a), RBASIC_SET_CLASS_RAW(a, rb_cArray))
/*
- * Recursively compute permutations of +r+ elements of the set
- * <code>[0..n-1]</code>.
+ * Build a ruby array of the corresponding values and yield it to the
+ * associated block.
+ * Return the class of +values+ for reentry check.
+ */
+static int
+yield_indexed_values(const VALUE values, const long r, const long *const p)
+{
+ const VALUE result = rb_ary_new2(r);
+ VALUE *const result_array = RARRAY_PTR(result);
+ const VALUE *const values_array = RARRAY_CONST_PTR(values);
+ long i;
+
+ for (i = 0; i < r; i++) result_array[i] = values_array[p[i]];
+ ARY_SET_LEN(result, r);
+ rb_yield(result);
+ return !RBASIC(values)->klass;
+}
+
+/*
+ * 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.
@@ -4693,38 +4852,40 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
* n: the size of the set
* r: the number of elements in each permutation
* p: the array (of size r) that we're filling in
- * index: what index we're filling in now
* used: an array of booleans: whether a given index is already used
* values: the Ruby array that holds the actual values to permute
*/
static void
-permute0(long n, long r, long *p, long index, char *used, VALUE values)
+permute0(const long n, const long r, long *const p, char *const used, const VALUE values)
{
- long i,j;
- for (i = 0; i < n; i++) {
- if (used[i] == 0) {
+ long i = 0, index = 0;
+
+ for (;;) {
+ const char *const unused = memchr(&used[i], 0, n-i);
+ if (!unused) {
+ if (!index) break;
+ i = p[--index]; /* pop index */
+ used[i++] = 0; /* index unused */
+ }
+ else {
+ i = unused - used;
p[index] = i;
+ used[i] = 1; /* mark index used */
+ ++index;
if (index < r-1) { /* if not done yet */
- used[i] = 1; /* mark index used */
- permute0(n, r, p, index+1, /* recurse */
- used, values);
- used[i] = 0; /* index unused */
+ p[index] = i = 0;
+ continue;
}
- else {
- /* We have a complete permutation of array indexes */
- /* Build a ruby array of the corresponding values */
- /* And yield it to the associated block */
- VALUE result = rb_ary_new2(r);
- VALUE *result_array = RARRAY_PTR(result);
- const VALUE *values_array = RARRAY_PTR(values);
-
- for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
- ARY_SET_LEN(result, r);
- rb_yield(result);
- if (RBASIC(values)->klass) {
+ for (i = 0; i < n; ++i) {
+ if (used[i]) continue;
+ p[index] = i;
+ if (!yield_indexed_values(values, r, p)) {
rb_raise(rb_eRuntimeError, "permute reentered");
}
}
+ i = p[--index]; /* pop index */
+ used[i] = 0; /* index unused */
+ p[index] = ++i;
}
}
}
@@ -4819,23 +4980,42 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
}
}
else { /* this is the general case */
- volatile VALUE t0 = tmpbuf(n,sizeof(long));
- long *p = (long*)RSTRING_PTR(t0);
- volatile VALUE t1 = tmpbuf(n,sizeof(char));
- char *used = (char*)RSTRING_PTR(t1);
+ volatile VALUE t0;
+ long *p = ALLOCV_N(long, t0, r+roomof(n, sizeof(long)));
+ char *used = (char*)(p + r);
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
RBASIC_CLEAR_CLASS(ary0);
MEMZERO(used, char, n); /* initialize array */
- permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */
- tmpbuf_discard(t0);
- tmpbuf_discard(t1);
+ permute0(n, r, p, used, ary0); /* compute and yield permutations */
+ ALLOCV_END(t0);
RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
}
return ary;
}
+static void
+combinate0(const long len, const long n, long *const stack, const VALUE values)
+{
+ long lev = 0;
+
+ MEMZERO(stack+1, long, n);
+ stack[0] = -1;
+ for (;;) {
+ for (lev++; lev < n; lev++) {
+ stack[lev+1] = stack[lev]+1;
+ }
+ if (!yield_indexed_values(values, n, stack+1)) {
+ rb_raise(rb_eRuntimeError, "combination reentered");
+ }
+ do {
+ if (lev == 0) return;
+ stack[lev--]++;
+ } while (stack[lev+1]+n == len+lev+1);
+ }
+}
+
static VALUE
rb_ary_combination_size(VALUE ary, VALUE args, VALUE eobj)
{
@@ -4873,7 +5053,7 @@ rb_ary_combination_size(VALUE ary, VALUE args, VALUE eobj)
static VALUE
rb_ary_combination(VALUE ary, VALUE num)
{
- long n, i, len;
+ long i, n, len;
n = NUM2LONG(num);
RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_combination_size);
@@ -4885,42 +5065,25 @@ rb_ary_combination(VALUE ary, VALUE num)
rb_yield(rb_ary_new2(0));
}
else if (n == 1) {
- for (i = 0; i < len; i++) {
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
}
}
else {
- volatile VALUE t0 = tmpbuf(n+1, sizeof(long));
- long *stack = (long*)RSTRING_PTR(t0);
- volatile VALUE cc = tmpary(n);
- VALUE *chosen = RARRAY_PTR(cc);
- long lev = 0;
-
- MEMZERO(stack, long, n);
- stack[0] = -1;
- for (;;) {
- chosen[lev] = RARRAY_AREF(ary, stack[lev+1]);
- for (lev++; lev < n; lev++) {
- chosen[lev] = RARRAY_AREF(ary, stack[lev+1] = stack[lev]+1);
- }
- rb_yield(rb_ary_new4(n, chosen));
- if (RBASIC(t0)->klass) {
- rb_raise(rb_eRuntimeError, "combination reentered");
- }
- do {
- if (lev == 0) goto done;
- stack[lev--]++;
- } while (stack[lev+1]+n == len+lev+1);
- }
- done:
- tmpbuf_discard(t0);
- tmpary_discard(cc);
+ VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
+ volatile VALUE t0;
+ long *stack = ALLOCV_N(long, t0, n+1);
+
+ RBASIC_CLEAR_CLASS(ary0);
+ combinate0(len, n, stack, ary0);
+ ALLOCV_END(t0);
+ RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
}
return ary;
}
/*
- * Recursively compute repeated permutations of +r+ elements of the set
+ * 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
@@ -4929,33 +5092,28 @@ rb_ary_combination(VALUE ary, VALUE num)
* n: the size of the set
* r: the number of elements in each permutation
* p: the array (of size r) that we're filling in
- * index: what index we're filling in now
* values: the Ruby array that holds the actual values to permute
*/
static void
-rpermute0(long n, long r, long *p, long index, VALUE values)
+rpermute0(const long n, const long r, long *const p, const VALUE values)
{
- long i, j;
- for (i = 0; i < n; i++) {
- p[index] = i;
- if (index < r-1) { /* if not done yet */
- rpermute0(n, r, p, index+1, values); /* recurse */
+ long i = 0, index = 0;
+
+ p[index] = i;
+ for (;;) {
+ if (++index < r-1) {
+ p[index] = i = 0;
+ continue;
}
- else {
- /* We have a complete permutation of array indexes */
- /* Build a ruby array of the corresponding values */
- /* And yield it to the associated block */
- VALUE result = rb_ary_new2(r);
- VALUE *result_array = RARRAY_PTR(result);
- const VALUE *values_array = RARRAY_PTR(values);
-
- for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
- ARY_SET_LEN(result, r);
- rb_yield(result);
- if (RBASIC(values)->klass) {
+ for (i = 0; i < n; ++i) {
+ p[index] = i;
+ if (!yield_indexed_values(values, r, p)) {
rb_raise(rb_eRuntimeError, "repeated permute reentered");
}
}
+ do {
+ if (index <= 0) return;
+ } while ((i = ++p[--index]) >= n);
}
}
@@ -5018,39 +5176,38 @@ rb_ary_repeated_permutation(VALUE ary, VALUE num)
}
}
else { /* this is the general case */
- volatile VALUE t0 = tmpbuf(r, sizeof(long));
- long *p = (long*)RSTRING_PTR(t0);
+ volatile VALUE t0;
+ long *p = ALLOCV_N(long, t0, r);
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
RBASIC_CLEAR_CLASS(ary0);
- rpermute0(n, r, p, 0, ary0); /* compute and yield repeated permutations */
- tmpbuf_discard(t0);
+ rpermute0(n, r, p, ary0); /* compute and yield repeated permutations */
+ ALLOCV_END(t0);
RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
}
return ary;
}
static void
-rcombinate0(long n, long r, long *p, long index, long rest, VALUE values)
+rcombinate0(const long n, const long r, long *const p, const long rest, const VALUE values)
{
- long j;
- if (rest > 0) {
- for (; index < n; ++index) {
- p[r-rest] = index;
- rcombinate0(n, r, p, index, rest-1, values);
+ long i = 0, index = 0;
+
+ p[index] = i;
+ for (;;) {
+ if (++index < r-1) {
+ p[index] = i;
+ continue;
}
- }
- else {
- VALUE result = rb_ary_new2(r);
- VALUE *result_array = RARRAY_PTR(result);
- const VALUE *values_array = RARRAY_PTR(values);
-
- for (j = 0; j < r; ++j) result_array[j] = values_array[p[j]];
- ARY_SET_LEN(result, r);
- rb_yield(result);
- if (RBASIC(values)->klass) {
- rb_raise(rb_eRuntimeError, "repeated combination reentered");
+ for (; i < n; ++i) {
+ p[index] = i;
+ if (!yield_indexed_values(values, r, p)) {
+ rb_raise(rb_eRuntimeError, "repeated combination reentered");
+ }
}
+ do {
+ if (index <= 0) return;
+ } while ((i = ++p[--index]) >= n);
}
}
@@ -5107,7 +5264,7 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
rb_yield(rb_ary_new2(0));
}
else if (n == 1) {
- for (i = 0; i < len; i++) {
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
}
}
@@ -5115,13 +5272,13 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
/* yield nothing */
}
else {
- volatile VALUE t0 = tmpbuf(n, sizeof(long));
- long *p = (long*)RSTRING_PTR(t0);
+ volatile VALUE t0;
+ long *p = ALLOCV_N(long, t0, n);
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
RBASIC_CLEAR_CLASS(ary0);
- rcombinate0(len, n, p, 0, n, ary0); /* compute and yield repeated combinations */
- tmpbuf_discard(t0);
+ rcombinate0(len, n, p, n, ary0); /* compute and yield repeated combinations */
+ ALLOCV_END(t0);
RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
}
return ary;
@@ -5264,7 +5421,7 @@ rb_ary_take(VALUE obj, VALUE n)
/*
* call-seq:
- * ary.take_while { |arr| block } -> new_ary
+ * ary.take_while { |obj| block } -> new_ary
* ary.take_while -> Enumerator
*
* Passes elements to the block until the block returns +nil+ or +false+, then
@@ -5323,7 +5480,7 @@ rb_ary_drop(VALUE ary, VALUE n)
/*
* call-seq:
- * ary.drop_while { |arr| block } -> new_ary
+ * ary.drop_while { |obj| block } -> new_ary
* ary.drop_while -> Enumerator
*
* Drops elements up to, but not including, the first element for which the
@@ -5352,6 +5509,57 @@ rb_ary_drop_while(VALUE ary)
}
/*
+ * call-seq:
+ * ary.any? [{ |obj| block }] -> true or false
+ *
+ * See also Enumerable#any?
+ */
+
+static VALUE
+rb_ary_any_p(VALUE ary)
+{
+ long i, len = RARRAY_LEN(ary);
+ const VALUE *ptr = RARRAY_CONST_PTR(ary);
+
+ if (!len) return Qfalse;
+ if (!rb_block_given_p()) {
+ for (i = 0; i < len; ++i) if (RTEST(ptr[i])) return Qtrue;
+ }
+ else {
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
+ if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) return Qtrue;
+ }
+ }
+ return Qfalse;
+}
+
+/*
+ * call-seq:
+ * ary.dig(idx, ...) -> object
+ *
+ * Extracts the nested value specified by the sequence of <i>idx</i>
+ * objects by calling +dig+ at each step, returning +nil+ if any
+ * intermediate step is +nil+.
+ *
+ * a = [[1, [2, 3]]]
+ *
+ * a.dig(0, 1, 1) #=> 3
+ * a.dig(1, 2, 3) #=> nil
+ * a.dig(0, 0, 0) #=> NoMethodError, undefined method `dig' for 1:Fixnum
+ * [42, {foo: :bar}].dig(1, :foo) #=> :bar
+ */
+
+VALUE
+rb_ary_dig(int argc, VALUE *argv, VALUE self)
+{
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
+ self = rb_ary_at(self, *argv);
+ if (!--argc) return self;
+ ++argv;
+ return rb_obj_dig(argc, argv, self, Qnil);
+}
+
+/*
* Arrays are ordered, integer-indexed collections of any object.
*
* Array indexing starts at 0, as in C or Java. A negative index is assumed
@@ -5384,7 +5592,8 @@ rb_ary_drop_while(VALUE ary)
* This method is safe to use with mutable objects such as hashes, strings or
* other arrays:
*
- * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
+ * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
+ * Array.new(4) {|i| i.to_s } #=> ["0", "1", "2", "3"]
*
* This is also a quick way to build up multi-dimensional arrays:
*
@@ -5700,6 +5909,9 @@ Init_Array(void)
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);
+ rb_define_method(rb_cArray, "bsearch_index", rb_ary_bsearch_index, 0);
+ rb_define_method(rb_cArray, "any?", rb_ary_any_p, 0);
+ rb_define_method(rb_cArray, "dig", rb_ary_dig, -1);
id_cmp = rb_intern("<=>");
id_random = rb_intern("random");
diff --git a/benchmark/bm_app_aobench.rb b/benchmark/bm_app_aobench.rb
index 807349089f..2bd6acfaf8 100644
--- a/benchmark/bm_app_aobench.rb
+++ b/benchmark/bm_app_aobench.rb
@@ -1,7 +1,6 @@
-# AO rebder benchmark
+# AO render benchmark
# Original program (C) Syoyo Fujita in Javascript (and other languages)
-# http://lucille.atso-net.jp/blog/?p=642
-# http://lucille.atso-net.jp/blog/?p=711
+# https://code.google.com/p/aobench/
# Ruby(yarv2llvm) version by Hideki Miura
#
@@ -230,7 +229,7 @@ class Scene
w.times do |x|
rad = Vec.new(0.0, 0.0, 0.0)
- # Subsmpling
+ # Subsampling
nsubsamples.times do |v|
nsubsamples.times do |u|
diff --git a/benchmark/bm_app_lc_fizzbuzz.rb b/benchmark/bm_app_lc_fizzbuzz.rb
new file mode 100644
index 0000000000..f09574bbeb
--- /dev/null
+++ b/benchmark/bm_app_lc_fizzbuzz.rb
@@ -0,0 +1,52 @@
+#
+# FizzBuzz program using only lambda calculus
+#
+# This program is quoted from
+# "Understanding Computation" by Tom Stuart
+# http://computationbook.com/
+#
+# You can understand why this program works fine by reading this book.
+#
+
+solution = -> k { -> f { -> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> l { -> x { -> g { -> b { b }[-> p { p[-> x { -> y { x } }] }[l]][x][-> y { g[f[-> l { -> p { p[-> x { -> y { y } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][x][g]][-> l { -> p { p[-> x { -> y { x } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][y] }] } } } }][k][-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> l { -> x { -> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[l][f[x]] } }] } }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[m][n]][-> x { -> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[f[-> n { -> p { -> x { p[n[p][x]] } } }[m]][n]][m][x] }][-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]] } } }][-> p { -> x { p[x] } }][-> p { -> x { p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] } }]][-> n { -> b { b }[-> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> p { -> x { p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[x]]]]]]]]]]]]]]] } }]]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]][-> b { b }[-> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> p { -> x { p[p[p[x]]] } }]]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]][-> b { b }[-> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> n { -> l { -> x { -> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> l { -> x { -> g { -> b { b }[-> p { p[-> x { -> y { x } }] }[l]][x][-> y { g[f[-> l { -> p { p[-> x { -> y { y } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][x][g]][-> l { -> p { p[-> x { -> y { x } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][y] }] } } } }][l][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][x]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }] } }[-> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]][-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> x { f[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { -> n { -> p { -> x { p[n[p][x]] } } }[f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n]][x] }][-> p { -> x { x } }] } } }][n][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][x] }]][-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]] } }][n]]]] }]
+
+FIRST = -> l { LEFT[RIGHT[l]] }
+IF = -> b { b }
+LEFT = -> p { p[-> x { -> y { x } } ] }
+RIGHT = -> p { p[-> x { -> y { y } } ] }
+IS_EMPTY = LEFT
+REST = -> l { RIGHT[RIGHT[l]] }
+
+def to_integer(proc)
+ proc[-> n { n + 1 }][0]
+end
+
+def to_boolean(proc)
+ IF[proc][true][false]
+end
+
+def to_array(proc)
+ array = []
+
+ until to_boolean(IS_EMPTY[proc])
+ array.push(FIRST[proc])
+ proc = REST[proc]
+ end
+
+ array
+end
+
+def to_char(c)
+ '0123456789BFiuz'.slice(to_integer(c))
+end
+
+def to_string(s)
+ to_array(s).map { |c| to_char(c) }.join
+end
+
+answer = to_array(solution).map do |p|
+ to_string(p)
+end
+
+answer_ary = answer.to_a
+# puts answer_ary
diff --git a/benchmark/bm_array_shift.rb b/benchmark/bm_array_shift.rb
new file mode 100644
index 0000000000..798bb9e3f4
--- /dev/null
+++ b/benchmark/bm_array_shift.rb
@@ -0,0 +1,14 @@
+require 'benchmark'
+
+Benchmark.bm do |x|
+ [10_000,1_000_000,100_000_000].each do |n|
+ ary = Array.new(n,0)
+ GC.start
+ x.report("#{n}:shift"){ ary.shift }
+ (0..4).each do |i|
+ ary = Array.new(n,0)
+ GC.start
+ x.report("#{n}:shift(#{i})"){ ary.shift(i) }
+ end
+ end
+end
diff --git a/benchmark/bm_hash_aref_dsym.rb b/benchmark/bm_hash_aref_dsym.rb
new file mode 100644
index 0000000000..af4f8c36d4
--- /dev/null
+++ b/benchmark/bm_hash_aref_dsym.rb
@@ -0,0 +1,4 @@
+h = {}
+syms = ('a'..'z').map { |s| s.to_sym }
+syms.each { |s| h[s] = 1 }
+200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_dsym_long.rb b/benchmark/bm_hash_aref_dsym_long.rb
new file mode 100644
index 0000000000..9d7759379e
--- /dev/null
+++ b/benchmark/bm_hash_aref_dsym_long.rb
@@ -0,0 +1,21 @@
+# [ruby-core:70129] [Bug #11396]
+collection_size = 200000
+sample_size = 10000
+
+values = (1..collection_size).to_a.map do |x|
+ "THIS IS A LONGER STRING THAT IS ALSO UNIQUE #{x}"
+end
+
+symbol_hash = {}
+
+values.each do |x|
+ symbol_hash[x.to_sym] = 1
+end
+
+# use the same samples each time to minimize deviations
+rng = Random.new(0)
+symbol_sample_array = values.sample(sample_size, random: rng).map(&:to_sym)
+
+3000.times do
+ symbol_sample_array.each { |x| symbol_hash[x] }
+end
diff --git a/benchmark/bm_hash_aref_fix.rb b/benchmark/bm_hash_aref_fix.rb
new file mode 100644
index 0000000000..1346890582
--- /dev/null
+++ b/benchmark/bm_hash_aref_fix.rb
@@ -0,0 +1,4 @@
+h = {}
+nums = (1..26).to_a
+nums.each { |i| h[i] = i }
+200_000.times { nums.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_flo.rb b/benchmark/bm_hash_aref_flo.rb
new file mode 100644
index 0000000000..2217274c82
--- /dev/null
+++ b/benchmark/bm_hash_aref_flo.rb
@@ -0,0 +1,4 @@
+h = {}
+strs = [*1..10000].map! {|i| i.fdiv(10)}
+strs.each { |s| h[s] = s }
+50.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_miss.rb b/benchmark/bm_hash_aref_miss.rb
new file mode 100644
index 0000000000..b0913dd4bb
--- /dev/null
+++ b/benchmark/bm_hash_aref_miss.rb
@@ -0,0 +1,5 @@
+h = {}
+strs = ('a'..'z').to_a.map!(&:freeze)
+strs.each { |s| h[s] = s }
+strs = ('A'..'Z').to_a
+200_000.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_str.rb b/benchmark/bm_hash_aref_str.rb
new file mode 100644
index 0000000000..19439b061b
--- /dev/null
+++ b/benchmark/bm_hash_aref_str.rb
@@ -0,0 +1,4 @@
+h = {}
+strs = ('a'..'z').to_a.map!(&:freeze)
+strs.each { |s| h[s] = s }
+200_000.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_sym.rb b/benchmark/bm_hash_aref_sym.rb
new file mode 100644
index 0000000000..f75d163fe6
--- /dev/null
+++ b/benchmark/bm_hash_aref_sym.rb
@@ -0,0 +1,9 @@
+h = {}
+syms = ('a'..'z').to_a
+begin
+ syms = eval("%i[#{syms.join(' ')}]")
+rescue SyntaxError # <= 1.9.3
+ syms.map!(&:to_sym)
+end
+syms.each { |s| h[s] = s }
+200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_sym_long.rb b/benchmark/bm_hash_aref_sym_long.rb
new file mode 100644
index 0000000000..9dab8df7be
--- /dev/null
+++ b/benchmark/bm_hash_aref_sym_long.rb
@@ -0,0 +1,13 @@
+h = {}
+syms = %w[puts warn syswrite write stat bacon lettuce tomato
+some symbols in this array may already be interned others should not be
+hash browns make good breakfast but not cooked using prime numbers
+shift for division entries delete_if keys exist?
+]
+begin
+ syms = eval("%i[#{syms.join(' ')}]")
+rescue SyntaxError # <= 1.9.3
+ syms.map!(&:to_sym)
+end
+syms.each { |s| h[s] = s }
+200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_ident_flo.rb b/benchmark/bm_hash_ident_flo.rb
new file mode 100644
index 0000000000..0c7edfed3e
--- /dev/null
+++ b/benchmark/bm_hash_ident_flo.rb
@@ -0,0 +1,4 @@
+h = {}.compare_by_identity
+strs = (1..10000).to_a.map!(&:to_f)
+strs.each { |s| h[s] = s }
+50.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_ident_num.rb b/benchmark/bm_hash_ident_num.rb
new file mode 100644
index 0000000000..b226736c6f
--- /dev/null
+++ b/benchmark/bm_hash_ident_num.rb
@@ -0,0 +1,4 @@
+h = {}.compare_by_identity
+nums = (1..26).to_a
+nums.each { |n| h[n] = n }
+200_000.times { nums.each { |n| h[n] } }
diff --git a/benchmark/bm_hash_ident_obj.rb b/benchmark/bm_hash_ident_obj.rb
new file mode 100644
index 0000000000..4b3b58edec
--- /dev/null
+++ b/benchmark/bm_hash_ident_obj.rb
@@ -0,0 +1,4 @@
+h = {}.compare_by_identity
+objs = 26.times.map { Object.new }
+objs.each { |o| h[o] = o }
+200_000.times { objs.each { |o| h[o] } }
diff --git a/benchmark/bm_hash_ident_str.rb b/benchmark/bm_hash_ident_str.rb
new file mode 100644
index 0000000000..8582b38e31
--- /dev/null
+++ b/benchmark/bm_hash_ident_str.rb
@@ -0,0 +1,4 @@
+h = {}.compare_by_identity
+strs = ('a'..'z').to_a
+strs.each { |s| h[s] = s }
+200_000.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_ident_sym.rb b/benchmark/bm_hash_ident_sym.rb
new file mode 100644
index 0000000000..4c81e3d28e
--- /dev/null
+++ b/benchmark/bm_hash_ident_sym.rb
@@ -0,0 +1,4 @@
+h = {}.compare_by_identity
+syms = ('a'..'z').to_a.map(&:to_sym)
+syms.each { |s| h[s] = s }
+200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_shift_u16.rb b/benchmark/bm_hash_shift_u16.rb
new file mode 100644
index 0000000000..ec800d0342
--- /dev/null
+++ b/benchmark/bm_hash_shift_u16.rb
@@ -0,0 +1,10 @@
+h = {}
+
+(16384..65536).each do |i|
+ h[i] = nil
+end
+
+300000.times do
+ k, v = h.shift
+ h[k] = v
+end
diff --git a/benchmark/bm_hash_shift_u24.rb b/benchmark/bm_hash_shift_u24.rb
new file mode 100644
index 0000000000..de4e0fa696
--- /dev/null
+++ b/benchmark/bm_hash_shift_u24.rb
@@ -0,0 +1,10 @@
+h = {}
+
+(0xff4000..0xffffff).each do |i|
+ h[i] = nil
+end
+
+300000.times do
+ k, v = h.shift
+ h[k] = v
+end
diff --git a/benchmark/bm_hash_shift_u32.rb b/benchmark/bm_hash_shift_u32.rb
new file mode 100644
index 0000000000..656aa55583
--- /dev/null
+++ b/benchmark/bm_hash_shift_u32.rb
@@ -0,0 +1,10 @@
+h = {}
+
+(0xffff4000..0xffffffff).each do |i|
+ h[i] = nil
+end
+
+300000.times do
+ k, v = h.shift
+ h[k] = v
+end
diff --git a/benchmark/bm_hash_to_proc.rb b/benchmark/bm_hash_to_proc.rb
new file mode 100644
index 0000000000..2b675bf509
--- /dev/null
+++ b/benchmark/bm_hash_to_proc.rb
@@ -0,0 +1,9 @@
+h = {}
+
+10000.times do |i|
+ h[i] = nil
+end
+
+5000.times do |i|
+ [i].map(&h)
+end
diff --git a/benchmark/bm_io_nonblock_noex.rb b/benchmark/bm_io_nonblock_noex.rb
new file mode 100644
index 0000000000..da9357fdc6
--- /dev/null
+++ b/benchmark/bm_io_nonblock_noex.rb
@@ -0,0 +1,22 @@
+nr = 1_000_000
+i = 0
+msg = '.'
+buf = '.'
+noex = { exception: false }
+begin
+ r, w = IO.pipe
+ while i < nr
+ i += 1
+ w.write_nonblock(msg, noex)
+ r.read_nonblock(1, buf, noex)
+ end
+rescue ArgumentError # old Rubies
+ while i < nr
+ i += 1
+ w.write_nonblock(msg)
+ r.read_nonblock(1, buf)
+ end
+ensure
+ r.close
+ w.close
+end
diff --git a/benchmark/bm_io_nonblock_noex2.rb b/benchmark/bm_io_nonblock_noex2.rb
new file mode 100644
index 0000000000..56819d049b
--- /dev/null
+++ b/benchmark/bm_io_nonblock_noex2.rb
@@ -0,0 +1,21 @@
+nr = 1_000_000
+i = 0
+msg = '.'
+buf = '.'
+begin
+ r, w = IO.pipe
+ while i < nr
+ i += 1
+ w.write_nonblock(msg, exception: false)
+ r.read_nonblock(1, buf, exception: false)
+ end
+rescue ArgumentError # old Rubies
+ while i < nr
+ i += 1
+ w.write_nonblock(msg)
+ r.read_nonblock(1, buf)
+ end
+ensure
+ r.close
+ w.close
+end
diff --git a/benchmark/bm_marshal_dump_flo.rb b/benchmark/bm_marshal_dump_flo.rb
new file mode 100644
index 0000000000..9b8d0c6afb
--- /dev/null
+++ b/benchmark/bm_marshal_dump_flo.rb
@@ -0,0 +1,2 @@
+bug10761 = 10000.times.map { |x| x.to_f }
+100.times { Marshal.dump(bug10761) }
diff --git a/benchmark/bm_marshal_dump_load_geniv.rb b/benchmark/bm_marshal_dump_load_geniv.rb
new file mode 100644
index 0000000000..8252ad90fa
--- /dev/null
+++ b/benchmark/bm_marshal_dump_load_geniv.rb
@@ -0,0 +1,10 @@
+a = ''
+a.instance_eval do
+ @a = :a
+ @b = :b
+ @c = :c
+end
+100000.times do
+ a = Marshal.load(Marshal.dump(a))
+end
+#p(a.instance_eval { @a == :a && @b == :b && @c == :c })
diff --git a/benchmark/bm_marshal_dump_load_time.rb b/benchmark/bm_marshal_dump_load_time.rb
new file mode 100644
index 0000000000..e29743b791
--- /dev/null
+++ b/benchmark/bm_marshal_dump_load_time.rb
@@ -0,0 +1 @@
+100000.times { Marshal.load(Marshal.dump(Time.now)) }
diff --git a/benchmark/bm_require.rb b/benchmark/bm_require.rb
new file mode 100644
index 0000000000..b8abc88f41
--- /dev/null
+++ b/benchmark/bm_require.rb
@@ -0,0 +1,7 @@
+$:.push File.join(File.dirname(__FILE__), "bm_require.data")
+
+1.upto(10000) do |i|
+ require "c#{i}"
+end
+
+$:.pop
diff --git a/benchmark/bm_require_thread.rb b/benchmark/bm_require_thread.rb
new file mode 100644
index 0000000000..e54db6c6e5
--- /dev/null
+++ b/benchmark/bm_require_thread.rb
@@ -0,0 +1,15 @@
+$:.push File.join(File.dirname(__FILE__), "bm_require.data")
+
+i=0
+t = Thread.new do
+ while true
+ i = i+1 # dummy loop
+ end
+end
+
+1.upto(100) do |i|
+ require "c#{i}"
+end
+
+$:.pop
+t.kill
diff --git a/benchmark/bm_securerandom.rb b/benchmark/bm_securerandom.rb
new file mode 100644
index 0000000000..a082ea6d5b
--- /dev/null
+++ b/benchmark/bm_securerandom.rb
@@ -0,0 +1,5 @@
+require "securerandom"
+
+20_0000.times do
+ SecureRandom.random_number(100)
+end
diff --git a/benchmark/bm_so_meteor_contest.rb b/benchmark/bm_so_meteor_contest.rb
index 99cf6a91cc..17e9c046a8 100644
--- a/benchmark/bm_so_meteor_contest.rb
+++ b/benchmark/bm_so_meteor_contest.rb
@@ -32,7 +32,7 @@ class Rotation
@start_masks = Array.new(60)
# create the rotational masks by placing the base mask at the location and seeing if
- # 1) it overlaps the boundries and 2) it produces a prunable board. if either of these
+ # 1) it overlaps the boundaries and 2) it produces a prunable board. if either of these
# is true the piece cannot be placed
0.upto(59) do | offset |
mask = is_even(offset) ? (@even_mask << offset) : (@odd_mask << offset)
@@ -326,9 +326,9 @@ end
# The exact procedure is described in-code
def prunable( board, location, slotting = false)
collectors = []
- # loop accross the rows
+ # loop across the rows
(location / 6).to_i.upto(9) do | row_on |
- # obtain a set of regions representing the bits of the curent row.
+ # obtain a set of regions representing the bits of the current row.
regions = $regions[(board >> (row_on * 6)) & 0b11111]
converter = $converter[row_on]
@@ -370,7 +370,7 @@ def prunable( board, location, slotting = false)
end
# check the existing collectors, if any collector overlapped no bits in the region its [2] value will
- # be zero. The size of any such reaason is tested if it is not a muliple of five true is returned since
+ # be zero. The size of any such reaason is tested if it is not a multiple of five true is returned since
# the board is prunable. if it is a multiple of five it is removed.
# Collector that are still active have a new adjacent value [0] set based n the matched bits
# and have [2] cleared out for the next cycle.
@@ -382,7 +382,7 @@ def prunable( board, location, slotting = false)
collectors[collector_num] = nil
else
# if a collector matches all bits in the row then we can return unprunable early for the
- # follwing reasons:
+ # following reasons:
# 1) there can be no more unavailable bits bince we fill from the top left downward
# 2) all previous regions have been closed or joined so only this region can fail
# 3) this region must be good since there can never be only 1 region that is nuot
@@ -467,7 +467,7 @@ def find_top( rotation_skip)
end
# the normail find routine, iterates through the available pieces, checks all rotations at the current location
-# and adds any boards found. depth is acheived via recursion. the overall approach is described
+# and adds any boards found. depth is achieved via recursion. the overall approach is described
# here: http://www-128.ibm.com/developerworks/java/library/j-javaopt/
# parameters:
# start_location -- where to start looking for place for the next piece at
@@ -526,7 +526,7 @@ def save( board_string)
@boards_found += 1
# the exit motif is a time saver. Ideally the function should return, but those tests
- # take noticable time (performance).
+ # take noticeable time (performance).
if (@boards_found == @stop_count) then
print_results
exit(0)
diff --git a/benchmark/bm_vm1_gc_wb_ary.rb b/benchmark/bm_vm1_gc_wb_ary.rb
index ecfab51dbf..881528845b 100644
--- a/benchmark/bm_vm1_gc_wb_ary.rb
+++ b/benchmark/bm_vm1_gc_wb_ary.rb
@@ -1,10 +1,12 @@
-long_lived = []
-GC.start
-GC.start
+short_lived_ary = []
+
+if RUBY_VERSION >= "2.2.0"
+ GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false)
+end
i = 0
short_lived = ''
while i<30_000_000 # while loop 1
- long_lived[0] = short_lived # write barrier
+ short_lived_ary[0] = short_lived # write barrier
i+=1
end
diff --git a/benchmark/bm_vm1_gc_wb_ary_promoted.rb b/benchmark/bm_vm1_gc_wb_ary_promoted.rb
new file mode 100644
index 0000000000..3c8279c956
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_ary_promoted.rb
@@ -0,0 +1,14 @@
+long_lived = []
+
+if RUBY_VERSION > "2.2.0"
+ 3.times{ GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false) }
+elsif
+ GC.start
+end
+
+i = 0
+short_lived = ''
+while i<30_000_000 # while loop 1
+ long_lived[0] = short_lived # write barrier
+ i+=1
+end
diff --git a/benchmark/bm_vm1_gc_wb_obj.rb b/benchmark/bm_vm1_gc_wb_obj.rb
index 017eff4f94..a4067af36b 100644
--- a/benchmark/bm_vm1_gc_wb_obj.rb
+++ b/benchmark/bm_vm1_gc_wb_obj.rb
@@ -1,13 +1,15 @@
class C
attr_accessor :foo
end
-long_lived = C.new
-GC.start
-GC.start
+short_lived_obj = C.new
+
+if RUBY_VERSION >= "2.2.0"
+ GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false)
+end
i = 0
short_lived = ''
while i<30_000_000 # while loop 1
- long_lived.foo = short_lived # write barrier
+ short_lived_obj.foo = short_lived # write barrier
i+=1
end
diff --git a/benchmark/bm_vm1_gc_wb_obj_promoted.rb b/benchmark/bm_vm1_gc_wb_obj_promoted.rb
new file mode 100644
index 0000000000..eee07a0248
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_obj_promoted.rb
@@ -0,0 +1,17 @@
+class C
+ attr_accessor :foo
+end
+long_lived = C.new
+
+if RUBY_VERSION >= "2.2.0"
+ 3.times{ GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false) }
+elsif
+ GC.start
+end
+
+i = 0
+short_lived = ''
+while i<30_000_000 # while loop 1
+ long_lived.foo = short_lived # write barrier
+ i+=1
+end
diff --git a/benchmark/bm_vm2_case_lit.rb b/benchmark/bm_vm2_case_lit.rb
new file mode 100644
index 0000000000..c62b294e0e
--- /dev/null
+++ b/benchmark/bm_vm2_case_lit.rb
@@ -0,0 +1,19 @@
+i = 0
+@ret = [ "foo", true, false, :sym, 6, nil, 0.1, 0xffffffffffffffff ]
+def foo(i)
+ @ret[i % @ret.size]
+end
+
+while i<6_000_000 # while loop 2
+ case foo(i)
+ when "foo" then :foo
+ when true then true
+ when false then false
+ when :sym then :sym
+ when 6 then :fix
+ when nil then nil
+ when 0.1 then :float
+ when 0xffffffffffffffff then :big
+ end
+ i += 1
+end
diff --git a/benchmark/bm_vm2_newlambda.rb b/benchmark/bm_vm2_newlambda.rb
new file mode 100644
index 0000000000..6422c9b0d0
--- /dev/null
+++ b/benchmark/bm_vm2_newlambda.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ lambda {}
+end
diff --git a/benchmark/bm_vm2_string_literal.rb b/benchmark/bm_vm2_string_literal.rb
new file mode 100644
index 0000000000..1d73036849
--- /dev/null
+++ b/benchmark/bm_vm2_string_literal.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+end
diff --git a/benchmark/bm_vm2_struct_big_aref_hi.rb b/benchmark/bm_vm2_struct_big_aref_hi.rb
new file mode 100644
index 0000000000..22cb26b0a5
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aref_hi.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.z # x[25]
+end
diff --git a/benchmark/bm_vm2_struct_big_aref_lo.rb b/benchmark/bm_vm2_struct_big_aref_lo.rb
new file mode 100644
index 0000000000..5e61a7087e
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aref_lo.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.k # x[10]
+end
diff --git a/benchmark/bm_vm2_struct_big_aset.rb b/benchmark/bm_vm2_struct_big_aset.rb
new file mode 100644
index 0000000000..5a1c3d16f3
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aset.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.k = i # x[10] = i
+end
diff --git a/benchmark/bm_vm2_struct_big_href_hi.rb b/benchmark/bm_vm2_struct_big_href_hi.rb
new file mode 100644
index 0000000000..fff940a80a
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_href_hi.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x[:z]
+end
diff --git a/benchmark/bm_vm2_struct_big_href_lo.rb b/benchmark/bm_vm2_struct_big_href_lo.rb
new file mode 100644
index 0000000000..5e4085d59d
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_href_lo.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x[:k]
+end
diff --git a/benchmark/bm_vm2_struct_big_hset.rb b/benchmark/bm_vm2_struct_big_hset.rb
new file mode 100644
index 0000000000..9c0cee4141
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_hset.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x[:k] = i
+end
diff --git a/benchmark/bm_vm2_struct_small_aref.rb b/benchmark/bm_vm2_struct_small_aref.rb
new file mode 100644
index 0000000000..8eaa555b41
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_aref.rb
@@ -0,0 +1,7 @@
+s = Struct.new(:a, :b, :c)
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.a
+end
diff --git a/benchmark/bm_vm2_struct_small_aset.rb b/benchmark/bm_vm2_struct_small_aset.rb
new file mode 100644
index 0000000000..ecd0f95669
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_aset.rb
@@ -0,0 +1,7 @@
+s = Struct.new(:a, :b, :c)
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.a = i
+end
diff --git a/benchmark/bm_vm2_struct_small_href.rb b/benchmark/bm_vm2_struct_small_href.rb
new file mode 100644
index 0000000000..2c88fee6bf
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_href.rb
@@ -0,0 +1,7 @@
+s = Struct.new(:a, :b, :c)
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x[:a]
+end
diff --git a/benchmark/bm_vm2_struct_small_hset.rb b/benchmark/bm_vm2_struct_small_hset.rb
new file mode 100644
index 0000000000..33c36d20f1
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_hset.rb
@@ -0,0 +1,7 @@
+s = Struct.new(:a, :b, :c)
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x[:a] = 1
+end
diff --git a/benchmark/bm_vm3_gc.rb b/benchmark/bm_vm3_gc.rb
index 7db9829d44..e668026915 100755..100644
--- a/benchmark/bm_vm3_gc.rb
+++ b/benchmark/bm_vm3_gc.rb
@@ -1,4 +1,3 @@
-#! /usr/bin/ruby
5000.times do
100.times do
{"xxxx"=>"yyyy"}
diff --git a/benchmark/bm_vm_symbol_block_pass.rb b/benchmark/bm_vm_symbol_block_pass.rb
new file mode 100644
index 0000000000..1d433353e1
--- /dev/null
+++ b/benchmark/bm_vm_symbol_block_pass.rb
@@ -0,0 +1,13 @@
+class C
+ 1000.times {|i|
+ eval("def i#{i};end")
+ }
+end
+
+c = C.new
+m = C.instance_methods(false)
+5_000.times do
+ m.each do |n|
+ c.tap(&n)
+ end
+end
diff --git a/benchmark/bm_vm_thread_close.rb b/benchmark/bm_vm_thread_close.rb
new file mode 100644
index 0000000000..3e9a265ce8
--- /dev/null
+++ b/benchmark/bm_vm_thread_close.rb
@@ -0,0 +1,6 @@
+1000.times { Thread.new { sleep } }
+i = 0
+while i<100_000 # benchmark loop 3
+ i += 1
+ IO.pipe.each(&:close)
+end
diff --git a/benchmark/bm_vm_thread_pipe.rb b/benchmark/bm_vm_thread_pipe.rb
index 272d231eba..112a621905 100644
--- a/benchmark/bm_vm_thread_pipe.rb
+++ b/benchmark/bm_vm_thread_pipe.rb
@@ -1,4 +1,4 @@
-# Mesure small and plenty pipe read/write.
+# Measure small and plenty pipe read/write.
# A performance may depend on GVL implementation.
lmax = 100_000
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index 695dc41aff..defe3c30be 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -29,6 +29,25 @@ class BenchmarkDriver
end
end
+ def self.load(input, type, opt)
+ attrs = [:executables, :results]
+ case type
+ when 'yaml'
+ require 'yaml'
+ h = YAML.load(input)
+ when 'json'
+ require 'json'
+ h = JSON.load(input)
+ else
+ h = eval(input.read)
+ end
+ obj = allocate
+ obj.instance_variable_set("@execs", h[:executables] || h["executables"])
+ obj.instance_variable_set("@results", h[:results] || h["results"])
+ obj.instance_variable_set("@opt", opt)
+ obj
+ end
+
def output *args
puts(*args)
@output and @output.puts(*args)
@@ -117,6 +136,25 @@ class BenchmarkDriver
end
def show_results
+ case @opt[:format]
+ when :tsv
+ strformat = "\t%1$s"
+ numformat = "\t%1$*2$.3f"
+ minwidth = 0
+ name_width = 0
+ when :markdown
+ markdown = true
+ strformat = "|%1$-*2$s"
+ numformat = "|%1$*2$.3f"
+ when :plain
+ strformat = " %1$-*2$s"
+ numformat = " %1$*2$.3f"
+ end
+
+ name_width ||= @results.map {|v,*| v.size}.max
+ minwidth ||= 7
+ width = @execs.map{|(_, v)| [v.size, minwidth].max}
+
output
if @verbose
@@ -128,6 +166,29 @@ class BenchmarkDriver
message "Elapsed time: #{Time.now - @start_time} (sec)"
end
+ if rawdata_output = @opt[:rawdata_output]
+ h = {}
+ h[:cpuinfo] = File.read('/proc/cpuinfo') if File.exist?('/proc/cpuinfo')
+ h[:executables] = @execs
+ h[:results] = @results
+ if (type = File.extname(rawdata_output)).empty?
+ type = rawdata_output
+ rawdata_output = @output.path.sub(/\.[^.\/]+\z/, '') << '.' << rawdata_output
+ end
+ case type
+ when 'yaml'
+ require 'yaml'
+ h = YAML.dump(h)
+ when 'json'
+ require 'json'
+ h = JSON.pretty_generate(h)
+ else
+ require 'pp'
+ h = h.pretty_inspect
+ end
+ open(rawdata_output, 'w') {|f| f.puts h}
+ end
+
output '-----------------------------------------------------------'
output 'benchmark results:'
@@ -136,19 +197,24 @@ class BenchmarkDriver
end
output "Execution time (sec)"
- output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
+ output if markdown
+ output ["name".ljust(name_width), @execs.map.with_index{|(_, v), i| sprintf(strformat, v, width[i])}].join("").rstrip
+ output ["-"*name_width, width.map{|n|":".rjust(n, "-")}].join("|") if markdown
@results.each{|v, result|
rets = []
s = adjusted_results(v, result){|r|
- rets << sprintf("%.3f", r)
+ rets << sprintf(numformat, r, width[rets.size])
}
- output "#{v}#{s}\t#{rets.join("\t")}"
+ v += s if s
+ output [v.ljust(name_width), rets].join("")
}
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")}"
+ output if markdown
+ output ["name".ljust(name_width), @execs[1..-1].map.with_index{|(_, v), i| sprintf(strformat, v, width[i])}].join("").rstrip
+ output ["-"*name_width, width[1..-1].map{|n|":".rjust(n, "-")}].join("|") if markdown
@results.each{|v, result|
rets = []
first_value = nil
@@ -157,13 +223,14 @@ class BenchmarkDriver
if r == 0
rets << "Error"
else
- rets << sprintf("%.3f", first_value/r)
+ rets << sprintf(numformat, first_value/r, width[rets.size+1])
end
else
first_value = r
end
}
- output "#{v}#{s}\t#{rets.join("\t")}"
+ v += s if s
+ output [v.ljust(name_width), rets].join("")
}
end
@@ -238,11 +305,17 @@ class BenchmarkDriver
result
end
+ unless defined?(File::NULL)
+ if File.exist?('/dev/null')
+ File::NULL = '/dev/null'
+ end
+ end
+
def measure executable, file
cmd = "#{executable} #{@ruby_arg} #{file}"
m = Benchmark.measure{
- `#{cmd}`
+ system(cmd, out: File::NULL)
}
if $? != 0
@@ -259,7 +332,14 @@ if __FILE__ == $0
:execs => [],
:dir => File.dirname(__FILE__),
:repeat => 1,
- :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+ :output => nil,
+ :raw_output => nil,
+ :format => :tsv,
+ }
+ formats = {
+ :tsv => ".tsv",
+ :markdown => ".md",
+ :plain => ".txt",
}
parser = OptionParser.new{|o|
@@ -287,15 +367,34 @@ if __FILE__ == $0
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
+ o.on('--rawdata-output [FILE]', 'output rawdata'){|r|
+ opt[:rawdata_output] = r
+ }
+ o.on('--load-rawdata=FILE', 'input rawdata'){|r|
+ opt[:rawdata_input] = r
+ }
+ o.on('-f', "--format=FORMAT", "output format (#{formats.keys.join(",")})", formats.keys){|r|
+ opt[:format] = r
}
o.on('-v', '--verbose'){|v|
opt[:verbose] = v
}
+ o.on('-q', '--quiet', "Run without notify information except result table."){|q|
+ opt[:quiet] = q
+ opt[:verbose] = false
+ }
}
parser.parse!(ARGV)
- BenchmarkDriver.benchmark(opt)
+ opt[:output] ||= "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}#{formats[opt[:format]]}"
+
+ if input = opt[:rawdata_input]
+ b = open(input) {|f|
+ BenchmarkDriver.load(f, File.extname(input)[1..-1], opt)
+ }
+ b.show_results
+ else
+ BenchmarkDriver.benchmark(opt)
+ end
end
diff --git a/benchmark/prepare_require.rb b/benchmark/prepare_require.rb
new file mode 100644
index 0000000000..c4786f04ad
--- /dev/null
+++ b/benchmark/prepare_require.rb
@@ -0,0 +1,25 @@
+require "fileutils"
+
+def prepare
+ num_files = 10000
+
+ basename = File.dirname($0)
+ data_dir = File.join(basename, "bm_require.data")
+
+ # skip if all of files exists
+ if File.exist?(File.join(data_dir, "c#{num_files}.rb"))
+ return
+ end
+
+ FileUtils.mkdir_p(data_dir)
+
+ 1.upto(num_files) do |i|
+ f = File.open("#{data_dir}/c#{i}.rb", "w")
+ f.puts <<-END
+ class C#{i}
+ end
+ END
+ end
+end
+
+prepare
diff --git a/benchmark/prepare_require_thread.rb b/benchmark/prepare_require_thread.rb
new file mode 100644
index 0000000000..339ecb8b39
--- /dev/null
+++ b/benchmark/prepare_require_thread.rb
@@ -0,0 +1,2 @@
+load File.join(File.dirname(__FILE__), "prepare_require.rb")
+
diff --git a/benchmark/prepare_so_k_nucleotide.rb b/benchmark/prepare_so_k_nucleotide.rb
index f28f4460a1..d83aeb7a7e 100644
--- a/benchmark/prepare_so_k_nucleotide.rb
+++ b/benchmark/prepare_so_k_nucleotide.rb
@@ -1,2 +1,2 @@
-require File.join(File.dirname(__FILE__), 'make_fasta_output')
+require_relative 'make_fasta_output'
prepare_fasta_output(100_000)
diff --git a/benchmark/prepare_so_reverse_complement.rb b/benchmark/prepare_so_reverse_complement.rb
index 7f089109de..da3ec2df14 100644
--- a/benchmark/prepare_so_reverse_complement.rb
+++ b/benchmark/prepare_so_reverse_complement.rb
@@ -1,2 +1,2 @@
-require File.join(File.dirname(__FILE__), 'make_fasta_output')
+require_relative 'make_fasta_output'
prepare_fasta_output(2_500_000)
diff --git a/bignum.c b/bignum.c
index 6c2cda3937..38380f6c4e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -9,10 +9,9 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/thread.h"
#include "ruby/util.h"
-#include "internal.h"
#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -45,17 +44,17 @@ const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
STATIC_ASSERT(sizeof_bdigit_dbl, sizeof(BDIGIT_DBL) == SIZEOF_BDIGIT_DBL);
STATIC_ASSERT(sizeof_bdigit_dbl_signed, sizeof(BDIGIT_DBL_SIGNED) == SIZEOF_BDIGIT_DBL);
-STATIC_ASSERT(sizeof_bdigit, SIZEOF_BDIGITS <= sizeof(BDIGIT));
-STATIC_ASSERT(sizeof_bdigit_and_dbl, SIZEOF_BDIGITS*2 <= SIZEOF_BDIGIT_DBL);
+STATIC_ASSERT(sizeof_bdigit, SIZEOF_BDIGIT <= sizeof(BDIGIT));
+STATIC_ASSERT(sizeof_bdigit_and_dbl, SIZEOF_BDIGIT*2 <= SIZEOF_BDIGIT_DBL);
STATIC_ASSERT(bdigit_signedness, 0 < (BDIGIT)-1);
STATIC_ASSERT(bdigit_dbl_signedness, 0 < (BDIGIT_DBL)-1);
STATIC_ASSERT(bdigit_dbl_signed_signedness, 0 > (BDIGIT_DBL_SIGNED)-1);
-STATIC_ASSERT(rbignum_embed_len_max, RBIGNUM_EMBED_LEN_MAX <= (RBIGNUM_EMBED_LEN_MASK >> RBIGNUM_EMBED_LEN_SHIFT));
+STATIC_ASSERT(rbignum_embed_len_max, BIGNUM_EMBED_LEN_MAX <= (BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT));
-#if SIZEOF_BDIGITS < SIZEOF_LONG
-STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_LONG % SIZEOF_BDIGITS == 0);
+#if SIZEOF_BDIGIT < SIZEOF_LONG
+STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_LONG % SIZEOF_BDIGIT == 0);
#else
-STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGITS % SIZEOF_LONG == 0);
+STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGIT % SIZEOF_LONG == 0);
#endif
#ifdef WORDS_BIGENDIAN
@@ -71,8 +70,8 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGITS % SIZEOF_LONG == 0);
#define FILL_LOWBITS(d, numbits) ((d) | (LSHIFTX(((d)*0+1), (numbits))-1))
#define POW2_P(x) (((x)&((x)-1))==0)
-#define BDIGITS(x) (RBIGNUM_DIGITS(x))
-#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
+#define BDIGITS(x) (BIGNUM_DIGITS(x))
+#define BITSPERDIG (SIZEOF_BDIGIT*CHAR_BIT)
#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG)
#define BIGRAD_HALF ((BDIGIT)(BIGRAD >> 1))
#define BDIGIT_MSB(d) (((d) & BIGRAD_HALF) != 0)
@@ -82,25 +81,24 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGITS % SIZEOF_LONG == 0);
#define BDIGMAX ((BDIGIT)(BIGRAD-1))
#define BDIGIT_DBL_MAX (~(BDIGIT_DBL)0)
-#if SIZEOF_BDIGITS == 2
+#if SIZEOF_BDIGIT == 2
# define swap_bdigit(x) swap16(x)
-#elif SIZEOF_BDIGITS == 4
+#elif SIZEOF_BDIGIT == 4
# define swap_bdigit(x) swap32(x)
-#elif SIZEOF_BDIGITS == 8
+#elif SIZEOF_BDIGIT == 8
# define swap_bdigit(x) swap64(x)
#endif
-#define BIGZEROP(x) (RBIGNUM_LEN(x) == 0 || \
+#define BIGZEROP(x) (BIGNUM_LEN(x) == 0 || \
(BDIGITS(x)[0] == 0 && \
- (RBIGNUM_LEN(x) == 1 || bigzero_p(x))))
-#define BIGSIZE(x) (RBIGNUM_LEN(x) == 0 ? (size_t)0 : \
- BDIGITS(x)[RBIGNUM_LEN(x)-1] ? \
- (size_t)(RBIGNUM_LEN(x)*SIZEOF_BDIGITS - nlz(BDIGITS(x)[RBIGNUM_LEN(x)-1])/CHAR_BIT) : \
+ (BIGNUM_LEN(x) == 1 || bigzero_p(x))))
+#define BIGSIZE(x) (BIGNUM_LEN(x) == 0 ? (size_t)0 : \
+ BDIGITS(x)[BIGNUM_LEN(x)-1] ? \
+ (size_t)(BIGNUM_LEN(x)*SIZEOF_BDIGIT - nlz(BDIGITS(x)[BIGNUM_LEN(x)-1])/CHAR_BIT) : \
rb_absint_size(x, NULL))
#define BIGDIVREM_EXTRA_WORDS 1
-#define roomof(n, m) ((long)(((n)+(m)-1) / (m)))
-#define bdigit_roomof(n) roomof(n, SIZEOF_BDIGITS)
+#define bdigit_roomof(n) roomof(n, SIZEOF_BDIGIT)
#define BARY_ARGS(ary) ary, numberof(ary)
#define BARY_ADD(z, x, y) bary_add(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y))
@@ -109,8 +107,8 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGITS % SIZEOF_LONG == 0);
#define BARY_DIVMOD(q, r, x, y) bary_divmod(BARY_ARGS(q), BARY_ARGS(r), BARY_ARGS(x), BARY_ARGS(y))
#define BARY_ZERO_P(x) bary_zero_p(BARY_ARGS(x))
-#define RBIGNUM_SET_NEGATIVE_SIGN(b) RBIGNUM_SET_SIGN(b, 0)
-#define RBIGNUM_SET_POSITIVE_SIGN(b) RBIGNUM_SET_SIGN(b, 1)
+#define BIGNUM_SET_NEGATIVE_SIGN(b) BIGNUM_SET_SIGN(b, 0)
+#define BIGNUM_SET_POSITIVE_SIGN(b) BIGNUM_SET_SIGN(b, 1)
#define bignew(len,sign) bignew_1(rb_cBignum,(len),(sign))
@@ -148,21 +146,21 @@ static void bary_divmod(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BD
static VALUE bigmul0(VALUE x, VALUE y);
static void bary_mul_toom3(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn);
-static VALUE bignew_1(VALUE klass, long len, int sign);
+static VALUE bignew_1(VALUE klass, size_t len, int sign);
static inline VALUE bigtrunc(VALUE x);
static VALUE bigsq(VALUE x);
static void bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp);
static inline VALUE power_cache_get_power(int base, int power_level, size_t *numdigits_ret);
-#if SIZEOF_BDIGITS <= SIZEOF_INT
-static int nlz(BDIGIT x) { return nlz_int((unsigned int)x) - (SIZEOF_INT-SIZEOF_BDIGITS) * CHAR_BIT; }
-#elif SIZEOF_BDIGITS <= SIZEOF_LONG
-static int nlz(BDIGIT x) { return nlz_long((unsigned long)x) - (SIZEOF_LONG-SIZEOF_BDIGITS) * CHAR_BIT; }
-#elif SIZEOF_BDIGITS <= SIZEOF_LONG_LONG
-static int nlz(BDIGIT x) { return nlz_long_long((unsigned LONG_LONG)x) - (SIZEOF_LONG_LONG-SIZEOF_BDIGITS) * CHAR_BIT; }
-#elif SIZEOF_BDIGITS <= SIZEOF_INT128_T
-static int nlz(BDIGIT x) { return nlz_int128((uint128_t)x) - (SIZEOF_INT128_T-SIZEOF_BDIGITS) * CHAR_BIT; }
+#if SIZEOF_BDIGIT <= SIZEOF_INT
+static int nlz(BDIGIT x) { return nlz_int((unsigned int)x) - (SIZEOF_INT-SIZEOF_BDIGIT) * CHAR_BIT; }
+#elif SIZEOF_BDIGIT <= SIZEOF_LONG
+static int nlz(BDIGIT x) { return nlz_long((unsigned long)x) - (SIZEOF_LONG-SIZEOF_BDIGIT) * CHAR_BIT; }
+#elif SIZEOF_BDIGIT <= SIZEOF_LONG_LONG
+static int nlz(BDIGIT x) { return nlz_long_long((unsigned LONG_LONG)x) - (SIZEOF_LONG_LONG-SIZEOF_BDIGIT) * CHAR_BIT; }
+#elif SIZEOF_BDIGIT <= SIZEOF_INT128_T
+static int nlz(BDIGIT x) { return nlz_int128((uint128_t)x) - (SIZEOF_INT128_T-SIZEOF_BDIGIT) * CHAR_BIT; }
#endif
#define U16(a) ((uint16_t)(a))
@@ -174,7 +172,7 @@ static int nlz(BDIGIT x) { return nlz_int128((uint128_t)x) - (SIZEOF_INT128_T-SI
#define U128(a,b,c,d) (((uint128_t)U64(a,b) << 64) | U64(c,d))
#endif
-/* The following scirpt, maxpow.rb, generates the tables follows.
+/* The following script, maxpow.rb, generates the tables follows.
def big(n, bits)
ns = []
@@ -218,7 +216,7 @@ end
*/
-#ifdef HAVE_UINT16_T
+#if SIZEOF_BDIGIT_DBL == 2
static const int maxpow16_exp[35] = {
15, 10, 7, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
@@ -234,8 +232,7 @@ static const uint16_t maxpow16_num[35] = {
U16(0x00006978), U16(0x0000745f), U16(0x00008000), U16(0x00008c61),
U16(0x00009988), U16(0x0000a77b), U16(0x0000b640),
};
-#endif
-#ifdef HAVE_UINT32_T
+#elif SIZEOF_BDIGIT_DBL == 4
static const int maxpow32_exp[35] = {
31, 20, 15, 13, 12, 11, 10, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7,
7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
@@ -251,8 +248,7 @@ static const uint32_t maxpow32_num[35] = {
U32(0x2b73a840), U32(0x34e63b41), U32(0x40000000), U32(0x4cfa3cc1),
U32(0x5c13d840), U32(0x6d91b519), U32(0x81bf1000),
};
-#endif
-#ifdef HAVE_UINT64_T
+#elif SIZEOF_BDIGIT_DBL == 8 && defined HAVE_UINT64_T
static const int maxpow64_exp[35] = {
63, 40, 31, 27, 24, 22, 21, 20, 19, 18, 17, 17, 16, 16, 15, 15, 15,
15, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12,
@@ -278,8 +274,7 @@ static const uint64_t maxpow64_num[35] = {
U64(0x211e44f7,0xd02c1000), U64(0x2ee56725,0xf06e5c71),
U64(0x41c21cb8,0xe1000000),
};
-#endif
-#ifdef HAVE_UINT128_T
+#elif SIZEOF_BDIGIT_DBL == 16 && defined HAVE_UINT128_T
static const int maxpow128_exp[35] = {
127, 80, 63, 55, 49, 45, 42, 40, 38, 37, 35, 34, 33, 32, 31, 31, 30,
30, 29, 29, 28, 28, 27, 27, 27, 26, 26, 26, 26, 25, 25, 25, 25, 24,
@@ -665,7 +660,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
*((unsigned char *)words) = (unsigned char)(d = dp[0]);
return ((1 < de - dp || CLEAR_LOWBITS(d, 8) != 0) ? 2 : 1) * sign;
}
-#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
uint16_t u = (uint16_t)(d = dp[0]);
if (need_swap) u = swap16(u);
@@ -673,7 +668,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
return ((1 < de - dp || CLEAR_LOWBITS(d, 16) != 0) ? 2 : 1) * sign;
}
#endif
-#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
uint32_t u = (uint32_t)(d = dp[0]);
if (need_swap) u = swap32(u);
@@ -681,7 +676,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
return ((1 < de - dp || CLEAR_LOWBITS(d, 32) != 0) ? 2 : 1) * sign;
}
#endif
-#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
uint64_t u = (uint64_t)(d = dp[0]);
if (need_swap) u = swap64(u);
@@ -696,40 +691,40 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
*((unsigned char *)words) = (unsigned char)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
return (1 < de - dp || FILL_LOWBITS(d, 8) != -1) ? -2 : -1;
}
-#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
uint16_t u = (uint16_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
if (need_swap) u = swap16(u);
*((uint16_t *)words) = u;
- return (wordsize == SIZEOF_BDIGITS && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
+ return (wordsize == SIZEOF_BDIGIT && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
(1 < de - dp || FILL_LOWBITS(d, 16) != -1) ? -2 : -1;
}
#endif
-#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
uint32_t u = (uint32_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
if (need_swap) u = swap32(u);
*((uint32_t *)words) = u;
- return (wordsize == SIZEOF_BDIGITS && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
+ return (wordsize == SIZEOF_BDIGIT && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
(1 < de - dp || FILL_LOWBITS(d, 32) != -1) ? -2 : -1;
}
#endif
-#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
uint64_t u = (uint64_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
if (need_swap) u = swap64(u);
*((uint64_t *)words) = u;
- return (wordsize == SIZEOF_BDIGITS && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
+ return (wordsize == SIZEOF_BDIGIT && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
(1 < de - dp || FILL_LOWBITS(d, 64) != -1) ? -2 : -1;
}
#endif
}
}
#if !defined(WORDS_BIGENDIAN)
- if (nails == 0 && SIZEOF_BDIGITS == sizeof(BDIGIT) &&
+ if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
(flags & INTEGER_PACK_WORDORDER_MASK) == INTEGER_PACK_LSWORD_FIRST &&
(flags & INTEGER_PACK_BYTEORDER_MASK) != INTEGER_PACK_MSBYTE_FIRST) {
- size_t src_size = (de - dp) * SIZEOF_BDIGITS;
+ size_t src_size = (de - dp) * SIZEOF_BDIGIT;
size_t dst_size = numwords * wordsize;
int overflow = 0;
while (0 < src_size && ((unsigned char *)ds)[src_size-1] == 0)
@@ -757,9 +752,9 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
return sign;
}
#endif
- if (nails == 0 && SIZEOF_BDIGITS == sizeof(BDIGIT) &&
- wordsize % SIZEOF_BDIGITS == 0 && (uintptr_t)words % ALIGNOF(BDIGIT) == 0) {
- size_t bdigits_per_word = wordsize / SIZEOF_BDIGITS;
+ if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
+ wordsize % SIZEOF_BDIGIT == 0 && (uintptr_t)words % ALIGNOF(BDIGIT) == 0) {
+ size_t bdigits_per_word = wordsize / SIZEOF_BDIGIT;
size_t src_num_bdigits = de - dp;
size_t dst_num_bdigits = numwords * bdigits_per_word;
int overflow = 0;
@@ -970,7 +965,7 @@ integer_unpack_num_bdigits_small(size_t numwords, size_t wordsize, size_t nails,
static size_t
integer_unpack_num_bdigits_generic(size_t numwords, size_t wordsize, size_t nails, int *nlp_bits_ret)
{
- /* BITSPERDIG = SIZEOF_BDIGITS * CHAR_BIT */
+ /* BITSPERDIG = SIZEOF_BDIGIT * CHAR_BIT */
/* num_bits = (wordsize * CHAR_BIT - nails) * numwords */
/* num_bdigits = (num_bits + BITSPERDIG - 1) / BITSPERDIG */
@@ -1067,7 +1062,7 @@ integer_unpack_single_bdigit(BDIGIT u, size_t size, int flags, BDIGIT *dp)
int sign;
if (flags & INTEGER_PACK_2COMP) {
sign = (flags & INTEGER_PACK_NEGATIVE) ?
- ((size == SIZEOF_BDIGITS && u == 0) ? -2 : -1) :
+ ((size == SIZEOF_BDIGIT && u == 0) ? -2 : -1) :
((u >> (size * CHAR_BIT - 1)) ? -1 : 1);
if (sign < 0) {
u |= LSHIFTX(BDIGMAX, size * CHAR_BIT);
@@ -1099,19 +1094,19 @@ bary_unpack_internal(BDIGIT *bdigits, size_t num_bdigits, const void *words, siz
if (wordsize == 1) {
return integer_unpack_single_bdigit(*(uint8_t *)buf, sizeof(uint8_t), flags, dp);
}
-#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
uint16_t u = *(uint16_t *)buf;
return integer_unpack_single_bdigit(need_swap ? swap16(u) : u, sizeof(uint16_t), flags, dp);
}
#endif
-#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
uint32_t u = *(uint32_t *)buf;
return integer_unpack_single_bdigit(need_swap ? swap32(u) : u, sizeof(uint32_t), flags, dp);
}
#endif
-#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGITS
+#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
uint64_t u = *(uint64_t *)buf;
return integer_unpack_single_bdigit(need_swap ? swap64(u) : u, sizeof(uint64_t), flags, dp);
@@ -1119,11 +1114,11 @@ bary_unpack_internal(BDIGIT *bdigits, size_t num_bdigits, const void *words, siz
#endif
}
#if !defined(WORDS_BIGENDIAN)
- if (nails == 0 && SIZEOF_BDIGITS == sizeof(BDIGIT) &&
+ if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
(flags & INTEGER_PACK_WORDORDER_MASK) == INTEGER_PACK_LSWORD_FIRST &&
(flags & INTEGER_PACK_BYTEORDER_MASK) != INTEGER_PACK_MSBYTE_FIRST) {
size_t src_size = numwords * wordsize;
- size_t dst_size = num_bdigits * SIZEOF_BDIGITS;
+ size_t dst_size = num_bdigits * SIZEOF_BDIGIT;
MEMCPY(dp, words, char, src_size);
if (flags & INTEGER_PACK_2COMP) {
if (flags & INTEGER_PACK_NEGATIVE) {
@@ -1149,9 +1144,9 @@ bary_unpack_internal(BDIGIT *bdigits, size_t num_bdigits, const void *words, siz
return sign;
}
#endif
- if (nails == 0 && SIZEOF_BDIGITS == sizeof(BDIGIT) &&
- wordsize % SIZEOF_BDIGITS == 0) {
- size_t bdigits_per_word = wordsize / SIZEOF_BDIGITS;
+ if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
+ wordsize % SIZEOF_BDIGIT == 0) {
+ size_t bdigits_per_word = wordsize / SIZEOF_BDIGIT;
int mswordfirst_p = (flags & INTEGER_PACK_MSWORD_FIRST) != 0;
int msbytefirst_p = (flags & INTEGER_PACK_NATIVE_BYTE_ORDER) ? HOST_BIGENDIAN_P :
(flags & INTEGER_PACK_MSBYTE_FIRST) != 0;
@@ -1542,8 +1537,8 @@ bary_mul_normal(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIG
VALUE
rb_big_mul_normal(VALUE x, VALUE y)
{
- size_t xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
+ VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
bary_mul_normal(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn);
RB_GC_GUARD(x);
RB_GC_GUARD(y);
@@ -1611,7 +1606,7 @@ bary_sq_fast(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn)
VALUE
rb_big_sq_fast(VALUE x)
{
- size_t xn = RBIGNUM_LEN(x), zn = 2 * xn;
+ size_t xn = BIGNUM_LEN(x), zn = 2 * xn;
VALUE z = bignew(zn, 1);
bary_sq_fast(BDIGITS(z), zn, BDIGITS(x), xn);
RB_GC_GUARD(x);
@@ -1653,7 +1648,7 @@ bary_mul_balance_with_mulfunc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t
}
tds = zds + n;
MEMCPY(wds, zds + n, BDIGIT, xn);
- mulfunc(tds, tn, xds, xn, yds + n, r, wds-xn, wn-xn);
+ mulfunc(tds, tn, xds, xn, yds + n, r, wds+xn, wn-xn);
bary_add(zds + n, tn,
zds + n, tn,
wds, xn);
@@ -1670,8 +1665,8 @@ bary_mul_balance_with_mulfunc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t
VALUE
rb_big_mul_balance(VALUE x, VALUE y)
{
- size_t xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
+ VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
bary_mul_balance_with_mulfunc(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, NULL, 0, bary_mul_toom3_start);
RB_GC_GUARD(x);
RB_GC_GUARD(y);
@@ -1826,12 +1821,12 @@ bary_mul_karatsuba(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const B
}
/*
- if (SIZEOF_BDIGITS * zn <= 16) {
+ if (SIZEOF_BDIGIT * zn <= 16) {
uint128_t z, x, y;
ssize_t i;
- for (x = 0, i = xn-1; 0 <= i; i--) { x <<= SIZEOF_BDIGITS*CHAR_BIT; x |= xds[i]; }
- for (y = 0, i = yn-1; 0 <= i; i--) { y <<= SIZEOF_BDIGITS*CHAR_BIT; y |= yds[i]; }
- for (z = 0, i = zn-1; 0 <= i; i--) { z <<= SIZEOF_BDIGITS*CHAR_BIT; z |= zds[i]; }
+ for (x = 0, i = xn-1; 0 <= i; i--) { x <<= SIZEOF_BDIGIT*CHAR_BIT; x |= xds[i]; }
+ for (y = 0, i = yn-1; 0 <= i; i--) { y <<= SIZEOF_BDIGIT*CHAR_BIT; y |= yds[i]; }
+ for (z = 0, i = zn-1; 0 <= i; i--) { z <<= SIZEOF_BDIGIT*CHAR_BIT; z |= zds[i]; }
assert(z == x * y);
}
*/
@@ -1851,8 +1846,8 @@ bary_mul_karatsuba(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const B
VALUE
rb_big_mul_karatsuba(VALUE x, VALUE y)
{
- size_t xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
+ VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
if (!((xn <= yn && yn < 2) || KARATSUBA_BALANCED(xn, yn)))
rb_raise(rb_eArgError, "unexpected bignum length for karatsuba");
bary_mul_karatsuba(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, NULL, 0);
@@ -2248,8 +2243,8 @@ bary_mul_toom3(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGI
VALUE
rb_big_mul_toom3(VALUE x, VALUE y)
{
- size_t xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
+ VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
if (xn > yn || yn < 3 || !TOOM3_BALANCED(xn,yn))
rb_raise(rb_eArgError, "unexpected bignum length for toom3");
bary_mul_toom3(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, NULL, 0);
@@ -2262,7 +2257,7 @@ rb_big_mul_toom3(VALUE x, VALUE y)
static void
bary_mul_gmp(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGITS)*CHAR_BIT;
+ const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
mpz_t x, y, z;
size_t count;
@@ -2289,8 +2284,8 @@ bary_mul_gmp(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT
VALUE
rb_big_mul_gmp(VALUE x, VALUE y)
{
- size_t xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
+ VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
bary_mul_gmp(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn);
RB_GC_GUARD(x);
RB_GC_GUARD(y);
@@ -2363,7 +2358,7 @@ bary_mul_precheck(BDIGIT **zdsp, size_t *znp, const BDIGIT **xdsp, size_t *xnp,
}
else {
do {
- if (xds[0] != 0)
+ if (yds[0] != 0)
break;
yds++;
yn--;
@@ -2700,7 +2695,7 @@ bary_divmod_normal(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT
VALUE
rb_big_divrem_normal(VALUE x, VALUE y)
{
- size_t xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y), qn, rn;
+ size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), qn, rn;
BDIGIT *xds = BDIGITS(x), *yds = BDIGITS(y), *qds, *rds;
VALUE q, r;
@@ -2713,11 +2708,11 @@ rb_big_divrem_normal(VALUE x, VALUE y)
return rb_assoc_new(LONG2FIX(0), x);
qn = xn + BIGDIVREM_EXTRA_WORDS;
- q = bignew(qn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ q = bignew(qn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
qds = BDIGITS(q);
rn = yn;
- r = bignew(rn, RBIGNUM_SIGN(x));
+ r = bignew(rn, BIGNUM_SIGN(x));
rds = BDIGITS(r);
bary_divmod_normal(qds, qn, rds, rn, xds, xn, yds, yn);
@@ -2735,7 +2730,7 @@ rb_big_divrem_normal(VALUE x, VALUE y)
static void
bary_divmod_gmp(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGITS)*CHAR_BIT;
+ const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
mpz_t x, y, q, r;
size_t count;
@@ -2781,7 +2776,7 @@ bary_divmod_gmp(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xd
VALUE
rb_big_divrem_gmp(VALUE x, VALUE y)
{
- size_t xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y), qn, rn;
+ size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), qn, rn;
BDIGIT *xds = BDIGITS(x), *yds = BDIGITS(y), *qds, *rds;
VALUE q, r;
@@ -2794,11 +2789,11 @@ rb_big_divrem_gmp(VALUE x, VALUE y)
return rb_assoc_new(LONG2FIX(0), x);
qn = xn - yn + 1;
- q = bignew(qn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ q = bignew(qn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
qds = BDIGITS(q);
rn = yn;
- r = bignew(rn, RBIGNUM_SIGN(x));
+ r = bignew(rn, BIGNUM_SIGN(x));
rds = BDIGITS(r);
bary_divmod_gmp(qds, qn, rds, rn, xds, xn, yds, yn);
@@ -2878,11 +2873,11 @@ static void
dump_bignum(VALUE x)
{
long i;
- printf("%c0x0", RBIGNUM_SIGN(x) ? '+' : '-');
- for (i = RBIGNUM_LEN(x); i--; ) {
- printf("_%0*"PRIxBDIGIT, SIZEOF_BDIGITS*2, BDIGITS(x)[i]);
+ printf("%c0x0", BIGNUM_SIGN(x) ? '+' : '-');
+ for (i = BIGNUM_LEN(x); i--; ) {
+ printf("_%0*"PRIxBDIGIT, SIZEOF_BDIGIT*2, BDIGITS(x)[i]);
}
- printf(", len=%lu", RBIGNUM_LEN(x));
+ printf(", len=%"PRIuSIZE, BIGNUM_LEN(x));
puts("");
}
@@ -2899,7 +2894,7 @@ rb_big_dump(VALUE x)
static int
bigzero_p(VALUE x)
{
- return bary_zero_p(BDIGITS(x), RBIGNUM_LEN(x));
+ return bary_zero_p(BDIGITS(x), BIGNUM_LEN(x));
}
int
@@ -2922,7 +2917,7 @@ rb_cmpint(VALUE val, VALUE a, VALUE b)
}
if (RB_BIGNUM_TYPE_P(val)) {
if (BIGZEROP(val)) return 0;
- if (RBIGNUM_SIGN(val)) return 1;
+ if (BIGNUM_SIGN(val)) return 1;
return -1;
}
if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
@@ -2930,31 +2925,31 @@ rb_cmpint(VALUE val, VALUE a, VALUE b)
return 0;
}
-#define RBIGNUM_SET_LEN(b,l) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
+#define BIGNUM_SET_LEN(b,l) \
+ ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
(void)(RBASIC(b)->flags = \
- (RBASIC(b)->flags & ~RBIGNUM_EMBED_LEN_MASK) | \
- ((l) << RBIGNUM_EMBED_LEN_SHIFT)) : \
+ (RBASIC(b)->flags & ~BIGNUM_EMBED_LEN_MASK) | \
+ ((l) << BIGNUM_EMBED_LEN_SHIFT)) : \
(void)(RBIGNUM(b)->as.heap.len = (l)))
static void
-rb_big_realloc(VALUE big, long len)
+rb_big_realloc(VALUE big, size_t len)
{
BDIGIT *ds;
- if (RBASIC(big)->flags & RBIGNUM_EMBED_FLAG) {
- if (RBIGNUM_EMBED_LEN_MAX < len) {
+ if (RBASIC(big)->flags & BIGNUM_EMBED_FLAG) {
+ if (BIGNUM_EMBED_LEN_MAX < len) {
ds = ALLOC_N(BDIGIT, len);
- MEMCPY(ds, RBIGNUM(big)->as.ary, BDIGIT, RBIGNUM_EMBED_LEN_MAX);
- RBIGNUM(big)->as.heap.len = RBIGNUM_LEN(big);
+ MEMCPY(ds, RBIGNUM(big)->as.ary, BDIGIT, BIGNUM_EMBED_LEN_MAX);
+ RBIGNUM(big)->as.heap.len = BIGNUM_LEN(big);
RBIGNUM(big)->as.heap.digits = ds;
- RBASIC(big)->flags &= ~RBIGNUM_EMBED_FLAG;
+ RBASIC(big)->flags &= ~BIGNUM_EMBED_FLAG;
}
}
else {
- if (len <= RBIGNUM_EMBED_LEN_MAX) {
+ if (len <= BIGNUM_EMBED_LEN_MAX) {
ds = RBIGNUM(big)->as.heap.digits;
- RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
- RBIGNUM_SET_LEN(big, len);
+ RBASIC(big)->flags |= BIGNUM_EMBED_FLAG;
+ BIGNUM_SET_LEN(big, len);
(void)VALGRIND_MAKE_MEM_UNDEFINED((void*)RBIGNUM(big)->as.ary, sizeof(RBIGNUM(big)->as.ary));
if (ds) {
MEMCPY(RBIGNUM(big)->as.ary, ds, BDIGIT, len);
@@ -2962,7 +2957,7 @@ rb_big_realloc(VALUE big, long len)
}
}
else {
- if (RBIGNUM_LEN(big) == 0) {
+ if (BIGNUM_LEN(big) == 0) {
RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
}
else {
@@ -2973,20 +2968,20 @@ rb_big_realloc(VALUE big, long len)
}
void
-rb_big_resize(VALUE big, long len)
+rb_big_resize(VALUE big, size_t len)
{
rb_big_realloc(big, len);
- RBIGNUM_SET_LEN(big, len);
+ BIGNUM_SET_LEN(big, len);
}
static VALUE
-bignew_1(VALUE klass, long len, int sign)
+bignew_1(VALUE klass, size_t len, int sign)
{
NEWOBJ_OF(big, struct RBignum, klass, T_BIGNUM | (RGENGC_WB_PROTECTED_BIGNUM ? FL_WB_PROTECTED : 0));
- RBIGNUM_SET_SIGN(big, sign?1:0);
- if (len <= RBIGNUM_EMBED_LEN_MAX) {
- RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
- RBIGNUM_SET_LEN(big, len);
+ BIGNUM_SET_SIGN(big, sign?1:0);
+ if (len <= BIGNUM_EMBED_LEN_MAX) {
+ RBASIC(big)->flags |= BIGNUM_EMBED_FLAG;
+ BIGNUM_SET_LEN(big, len);
(void)VALGRIND_MAKE_MEM_UNDEFINED((void*)RBIGNUM(big)->as.ary, sizeof(RBIGNUM(big)->as.ary));
}
else {
@@ -2998,7 +2993,7 @@ bignew_1(VALUE klass, long len, int sign)
}
VALUE
-rb_big_new(long len, int sign)
+rb_big_new(size_t len, int sign)
{
return bignew(len, sign != 0);
}
@@ -3006,8 +3001,8 @@ rb_big_new(long len, int sign)
VALUE
rb_big_clone(VALUE x)
{
- long len = RBIGNUM_LEN(x);
- VALUE z = bignew_1(CLASS_OF(x), len, RBIGNUM_SIGN(x));
+ size_t len = BIGNUM_LEN(x);
+ VALUE z = bignew_1(CLASS_OF(x), len, BIGNUM_SIGN(x));
MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, len);
return z;
@@ -3016,15 +3011,15 @@ rb_big_clone(VALUE x)
static void
big_extend_carry(VALUE x)
{
- rb_big_resize(x, RBIGNUM_LEN(x)+1);
- BDIGITS(x)[RBIGNUM_LEN(x)-1] = 1;
+ rb_big_resize(x, BIGNUM_LEN(x)+1);
+ BDIGITS(x)[BIGNUM_LEN(x)-1] = 1;
}
/* modify a bignum by 2's complement */
static void
get2comp(VALUE x)
{
- long i = RBIGNUM_LEN(x);
+ long i = BIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
if (bary_2comp(ds, i)) {
@@ -3042,13 +3037,13 @@ static BDIGIT
abs2twocomp(VALUE *xp, long *n_ret)
{
VALUE x = *xp;
- long n = RBIGNUM_LEN(x);
+ long n = BIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
BDIGIT hibits = 0;
BARY_TRUNC(ds, n);
- if (n != 0 && RBIGNUM_NEGATIVE_P(x)) {
+ if (n != 0 && BIGNUM_NEGATIVE_P(x)) {
VALUE z = bignew_1(CLASS_OF(x), n, 0);
MEMCPY(BDIGITS(z), ds, BDIGIT, n);
bary_2comp(BDIGITS(z), n);
@@ -3062,7 +3057,7 @@ abs2twocomp(VALUE *xp, long *n_ret)
static void
twocomp2abs_bang(VALUE x, int hibits)
{
- RBIGNUM_SET_SIGN(x, !hibits);
+ BIGNUM_SET_SIGN(x, !hibits);
if (hibits) {
get2comp(x);
}
@@ -3071,12 +3066,12 @@ twocomp2abs_bang(VALUE x, int hibits)
static inline VALUE
bigtrunc(VALUE x)
{
- long len = RBIGNUM_LEN(x);
+ size_t len = BIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
if (len == 0) return x;
while (--len && !ds[len]);
- if (RBIGNUM_LEN(x) > len+1) {
+ if (BIGNUM_LEN(x) > len+1) {
rb_big_resize(x, len+1);
}
return x;
@@ -3085,9 +3080,9 @@ bigtrunc(VALUE x)
static inline VALUE
bigfixize(VALUE x)
{
- size_t n = RBIGNUM_LEN(x);
+ size_t n = BIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+#if SIZEOF_BDIGIT < SIZEOF_LONG
unsigned long u;
#else
BDIGIT u;
@@ -3097,8 +3092,8 @@ bigfixize(VALUE x)
if (n == 0) return INT2FIX(0);
-#if SIZEOF_BDIGITS < SIZEOF_LONG
- if (sizeof(long)/SIZEOF_BDIGITS < n)
+#if SIZEOF_BDIGIT < SIZEOF_LONG
+ if (sizeof(long)/SIZEOF_BDIGIT < n)
goto return_big;
else {
int i = (int)n;
@@ -3107,14 +3102,14 @@ bigfixize(VALUE x)
u = (unsigned long)(BIGUP(u) + ds[i]);
}
}
-#else /* SIZEOF_BDIGITS >= SIZEOF_LONG */
+#else /* SIZEOF_BDIGIT >= SIZEOF_LONG */
if (1 < n)
goto return_big;
else
u = ds[0];
#endif
- if (RBIGNUM_POSITIVE_P(x)) {
+ if (BIGNUM_POSITIVE_P(x)) {
if (POSFIXABLE(u)) return LONG2FIX((long)u);
}
else {
@@ -3148,7 +3143,7 @@ rb_uint2big(VALUE n)
VALUE big = bignew(bdigit_roomof(SIZEOF_VALUE), 1);
BDIGIT *digits = BDIGITS(big);
-#if SIZEOF_BDIGITS >= SIZEOF_VALUE
+#if SIZEOF_BDIGIT >= SIZEOF_VALUE
digits[0] = n;
#else
for (i = 0; i < bdigit_roomof(SIZEOF_VALUE); i++) {
@@ -3159,7 +3154,7 @@ rb_uint2big(VALUE n)
i = bdigit_roomof(SIZEOF_VALUE);
while (--i && !digits[i]) ;
- RBIGNUM_SET_LEN(big, i+1);
+ BIGNUM_SET_LEN(big, i+1);
return big;
}
@@ -3179,7 +3174,7 @@ rb_int2big(SIGNED_VALUE n)
}
big = rb_uint2big(u);
if (neg) {
- RBIGNUM_SET_SIGN(big, 0);
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
@@ -3246,7 +3241,7 @@ rb_absint_size(VALUE val, int *nlz_bits_ret)
if (v < 0) {
v = -v;
}
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
fixbuf[0] = v;
#else
{
@@ -3262,7 +3257,7 @@ rb_absint_size(VALUE val, int *nlz_bits_ret)
}
else {
dp = BDIGITS(val);
- de = dp + RBIGNUM_LEN(val);
+ de = dp + BIGNUM_LEN(val);
}
while (dp < de && de[-1] == 0)
de--;
@@ -3274,7 +3269,7 @@ rb_absint_size(VALUE val, int *nlz_bits_ret)
num_leading_zeros = nlz(de[-1]);
if (nlz_bits_ret)
*nlz_bits_ret = num_leading_zeros % CHAR_BIT;
- return (de - dp) * SIZEOF_BDIGITS - num_leading_zeros / CHAR_BIT;
+ return (de - dp) * SIZEOF_BDIGIT - num_leading_zeros / CHAR_BIT;
}
static size_t
@@ -3297,7 +3292,7 @@ absint_numwords_generic(size_t numbytes, int nlz_bits_in_msbyte, size_t word_num
static const BDIGIT char_bit[1] = { CHAR_BIT };
BDIGIT numbytes_bary[bdigit_roomof(sizeof(numbytes))];
BDIGIT val_numbits_bary[bdigit_roomof(sizeof(numbytes) + 1)];
- BDIGIT nlz_bits_in_msbyte_bary[1] = { nlz_bits_in_msbyte };
+ BDIGIT nlz_bits_in_msbyte_bary[1];
BDIGIT word_numbits_bary[bdigit_roomof(sizeof(word_numbits))];
BDIGIT div_bary[numberof(val_numbits_bary) + BIGDIVREM_EXTRA_WORDS];
BDIGIT mod_bary[numberof(word_numbits_bary)];
@@ -3307,6 +3302,8 @@ absint_numwords_generic(size_t numbytes, int nlz_bits_in_msbyte, size_t word_num
int sign;
size_t numwords;
+ nlz_bits_in_msbyte_bary[0] = nlz_bits_in_msbyte;
+
/*
* val_numbits = numbytes * CHAR_BIT - nlz_bits_in_msbyte
* div, mod = val_numbits.divmod(word_numbits)
@@ -3411,7 +3408,7 @@ rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret)
* represent val in two's complement number, without sign bit.
*
* size_t size;
- * int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : RBIGNUM_NEGATIVE_P(val);
+ * int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : BIGNUM_NEGATIVE_P(val);
* size = rb_absint_numwords(val, 1, NULL)
* if (size == (size_t)-1) ...overflow...
* if (neg && rb_absint_singlebit_p(val))
@@ -3421,7 +3418,7 @@ rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret)
* represent val in two's complement number, with sign bit.
*
* size_t size;
- * int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : RBIGNUM_NEGATIVE_P(val);
+ * int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : BIGNUM_NEGATIVE_P(val);
* int nlz_bits;
* size = rb_absint_size(val, &nlz_bits);
* if (nlz_bits == 0 && !(neg && rb_absint_singlebit_p(val)))
@@ -3442,7 +3439,7 @@ rb_absint_singlebit_p(VALUE val)
if (v < 0) {
v = -v;
}
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
fixbuf[0] = v;
#else
{
@@ -3458,7 +3455,7 @@ rb_absint_singlebit_p(VALUE val)
}
else {
dp = BDIGITS(val);
- de = dp + RBIGNUM_LEN(val);
+ de = dp + BIGNUM_LEN(val);
}
while (dp < de && de[-1] == 0)
de--;
@@ -3547,7 +3544,7 @@ rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t
else {
sign = 1;
}
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
fixbuf[0] = v;
#else
{
@@ -3562,9 +3559,9 @@ rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t
num_bdigits = numberof(fixbuf);
}
else {
- sign = RBIGNUM_POSITIVE_P(val) ? 1 : -1;
+ sign = BIGNUM_POSITIVE_P(val) ? 1 : -1;
ds = BDIGITS(val);
- num_bdigits = RBIGNUM_LEN(val);
+ num_bdigits = BIGNUM_LEN(val);
}
return bary_pack(sign, ds, num_bdigits, words, numwords, wordsize, nails, flags);
@@ -3677,33 +3674,15 @@ rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t na
}
if ((flags & INTEGER_PACK_FORCE_BIGNUM) && sign != 0 &&
- bary_zero_p(BDIGITS(val), RBIGNUM_LEN(val)))
+ bary_zero_p(BDIGITS(val), BIGNUM_LEN(val)))
sign = 0;
- RBIGNUM_SET_SIGN(val, 0 <= sign);
+ BIGNUM_SET_SIGN(val, 0 <= sign);
if (flags & INTEGER_PACK_FORCE_BIGNUM)
return bigtrunc(val);
return bignorm(val);
}
-#define QUAD_SIZE 8
-
-void
-rb_quad_pack(char *buf, VALUE val)
-{
- rb_integer_pack(val, buf, 1, QUAD_SIZE, 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER|
- INTEGER_PACK_2COMP);
-}
-
-VALUE
-rb_quad_unpack(const char *buf, int signed_p)
-{
- return rb_integer_unpack(buf, 1, QUAD_SIZE, 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER|
- (signed_p ? INTEGER_PACK_2COMP : 0));
-}
-
#define conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)])
static void
@@ -3889,11 +3868,11 @@ str2big_karatsuba(
for (unit = 2; unit < num_bdigits; unit *= 2) {
for (i = 0; i < num_bdigits; i += unit*2) {
if (2*unit <= num_bdigits - i) {
- bary_mul(vds+i, unit*2, BDIGITS(powerv), RBIGNUM_LEN(powerv), uds+i+unit, unit);
+ bary_mul(vds+i, unit*2, BDIGITS(powerv), BIGNUM_LEN(powerv), uds+i+unit, unit);
bary_add(vds+i, unit*2, vds+i, unit*2, uds+i, unit);
}
else if (unit <= num_bdigits - i) {
- bary_mul(vds+i, num_bdigits-i, BDIGITS(powerv), RBIGNUM_LEN(powerv), uds+i+unit, num_bdigits-(i+unit));
+ bary_mul(vds+i, num_bdigits-i, BDIGITS(powerv), BIGNUM_LEN(powerv), uds+i+unit, num_bdigits-(i+unit));
bary_add(vds+i, num_bdigits-i, vds+i, num_bdigits-i, uds+i, unit);
}
else {
@@ -3926,7 +3905,7 @@ str2big_gmp(
size_t num_bdigits,
int base)
{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGITS)*CHAR_BIT;
+ const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
char *buf, *p;
const char *q;
VALUE tmps;
@@ -3960,6 +3939,22 @@ str2big_gmp(
}
#endif
+/*
+ * Parse +str+ as Ruby Integer, i.e., underscores, 0d and 0b prefixes.
+ *
+ * str: pointer to the string to be parsed.
+ * should be NUL-terminated.
+ * base: base of conversion, must be 2..36, or -36..0.
+ * if +base+ > 0, the conversion is done according to the +base+
+ * and unmatched prefix is parsed as a part of the result if
+ * present.
+ * if +base+ <= 0, the conversion is done according to the
+ * prefix if present, in base <code>-base</code> if +base+ < -1,
+ * or in base 10.
+ * badcheck: if non-zero, +ArgumentError+ is raised when +str+ is not
+ * valid as an Integer. if zero, Fixnum 0 is returned in
+ * that case.
+ */
VALUE
rb_cstr_to_inum(const char *str, int base, int badcheck)
{
@@ -4054,8 +4049,10 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
if (c == '_') {
if (++us >= 2)
break;
- } else
+ }
+ else {
us = 0;
+ }
}
if (!(c = *str) || ISSPACE(c)) --str;
}
@@ -4087,7 +4084,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
}
else {
VALUE big = rb_uint2big(val);
- RBIGNUM_SET_SIGN(big, sign);
+ BIGNUM_SET_SIGN(big, sign);
return bignorm(big);
}
}
@@ -4318,7 +4315,7 @@ rb_ull2big(unsigned LONG_LONG n)
VALUE big = bignew(bdigit_roomof(SIZEOF_LONG_LONG), 1);
BDIGIT *digits = BDIGITS(big);
-#if SIZEOF_BDIGITS >= SIZEOF_LONG_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG_LONG
digits[0] = n;
#else
for (i = 0; i < bdigit_roomof(SIZEOF_LONG_LONG); i++) {
@@ -4329,7 +4326,7 @@ rb_ull2big(unsigned LONG_LONG n)
i = bdigit_roomof(SIZEOF_LONG_LONG);
while (i-- && !digits[i]) ;
- RBIGNUM_SET_LEN(big, i+1);
+ BIGNUM_SET_LEN(big, i+1);
return big;
}
@@ -4349,7 +4346,7 @@ rb_ll2big(LONG_LONG n)
}
big = rb_ull2big(u);
if (neg) {
- RBIGNUM_SET_SIGN(big, 0);
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
@@ -4397,8 +4394,8 @@ big_shift3(VALUE x, int lshift_p, size_t shift_numdigits, int shift_numbits)
}
s1 = shift_numdigits;
s2 = shift_numbits;
- xn = RBIGNUM_LEN(x);
- z = bignew(xn+s1+1, RBIGNUM_SIGN(x));
+ xn = BIGNUM_LEN(x);
+ z = bignew(xn+s1+1, BIGNUM_SIGN(x));
zds = BDIGITS(z);
BDIGITS_ZERO(zds, s1);
xds = BDIGITS(x);
@@ -4407,9 +4404,9 @@ big_shift3(VALUE x, int lshift_p, size_t shift_numdigits, int shift_numbits)
else {
long zn;
BDIGIT hibitsx;
- if (LONG_MAX < shift_numdigits || (size_t)RBIGNUM_LEN(x) <= shift_numdigits) {
- if (RBIGNUM_POSITIVE_P(x) ||
- bary_zero_p(BDIGITS(x), RBIGNUM_LEN(x)))
+ if (LONG_MAX < shift_numdigits || (size_t)BIGNUM_LEN(x) <= shift_numdigits) {
+ if (BIGNUM_POSITIVE_P(x) ||
+ bary_zero_p(BDIGITS(x), BIGNUM_LEN(x)))
return INT2FIX(0);
else
return INT2FIX(-1);
@@ -4456,7 +4453,7 @@ big_shift2(VALUE x, int lshift_p, VALUE y)
}
else {
if (1 < sign || CHAR_BIT <= lens[1])
- return RBIGNUM_POSITIVE_P(x) ? INT2FIX(0) : INT2FIX(-1);
+ return BIGNUM_POSITIVE_P(x) ? INT2FIX(0) : INT2FIX(-1);
}
shift_numbits = (int)(lens[0] & (BITSPERDIG-1));
shift_numdigits = (lens[0] >> bit_length(BITSPERDIG-1)) |
@@ -4540,61 +4537,6 @@ power_cache_get_power(int base, int power_level, size_t *numdigits_ret)
return base36_power_cache[base - 2][power_level];
}
-/*
- * deprecated. (used only from deprecated rb_big2str0)
- *
- * big2str_muraken_find_n1
- *
- * Let a natural number x is given by:
- * x = 2^0 * x_0 + 2^1 * x_1 + ... + 2^(B*n_0 - 1) * x_{B*n_0 - 1},
- * where B is BITSPERDIG (i.e. BDIGITS*CHAR_BIT) and n_0 is
- * RBIGNUM_LEN(x).
- *
- * Now, we assume n_1 = min_n \{ n | 2^(B*n_0/2) <= b_1^(n_1) \}, so
- * it is realized that 2^(B*n_0) <= {b_1}^{2*n_1}, where b_1 is a
- * given radix number. And then, we have n_1 <= (B*n_0) /
- * (2*log_2(b_1)), therefore n_1 is given by ceil((B*n_0) /
- * (2*log_2(b_1))).
- */
-static long
-big2str_find_n1(VALUE x, int base)
-{
- static const double log_2[] = {
- 1.0, 1.58496250072116, 2.0,
- 2.32192809488736, 2.58496250072116, 2.8073549220576,
- 3.0, 3.16992500144231, 3.32192809488736,
- 3.4594316186373, 3.58496250072116, 3.70043971814109,
- 3.8073549220576, 3.90689059560852, 4.0,
- 4.08746284125034, 4.16992500144231, 4.24792751344359,
- 4.32192809488736, 4.39231742277876, 4.4594316186373,
- 4.52356195605701, 4.58496250072116, 4.64385618977472,
- 4.70043971814109, 4.75488750216347, 4.8073549220576,
- 4.85798099512757, 4.90689059560852, 4.95419631038688,
- 5.0, 5.04439411935845, 5.08746284125034,
- 5.12928301694497, 5.16992500144231
- };
- long bits;
-
- if (base < 2 || 36 < base)
- rb_bug("invalid radix %d", base);
-
- if (FIXNUM_P(x)) {
- bits = (SIZEOF_LONG*CHAR_BIT - 1)/2 + 1;
- }
- else if (BIGZEROP(x)) {
- return 0;
- }
- else if (RBIGNUM_LEN(x) >= LONG_MAX/BITSPERDIG) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
- }
- else {
- bits = BITSPERDIG*RBIGNUM_LEN(x);
- }
-
- /* @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]);
-}
-
struct big2str_struct {
int negative;
int base;
@@ -4700,7 +4642,7 @@ big2str_karatsuba(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t wn,
lower_power_level = power_level-1;
b = power_cache_get_power(b2s->base, lower_power_level, &lower_numdigits);
- bn = RBIGNUM_LEN(b);
+ bn = BIGNUM_LEN(b);
bds = BDIGITS(b);
half_numdigits = lower_numdigits;
@@ -4710,7 +4652,7 @@ big2str_karatsuba(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t wn,
(xn == bn && bary_cmp(xds, xn, bds, bn) < 0))) {
lower_power_level--;
b = power_cache_get_power(b2s->base, lower_power_level, &lower_numdigits);
- bn = RBIGNUM_LEN(b);
+ bn = BIGNUM_LEN(b);
bds = BDIGITS(b);
}
@@ -4783,12 +4725,12 @@ big2str_base_poweroftwo(VALUE x, int base)
VALUE result;
char *ptr;
numwords = rb_absint_numwords(x, word_numbits, NULL);
- if (RBIGNUM_NEGATIVE_P(x)) {
+ if (BIGNUM_NEGATIVE_P(x)) {
if (LONG_MAX-1 < numwords)
rb_raise(rb_eArgError, "too big number");
result = rb_usascii_str_new(0, 1+numwords);
ptr = RSTRING_PTR(result);
- *ptr++ = RBIGNUM_POSITIVE_P(x) ? '+' : '-';
+ *ptr++ = BIGNUM_POSITIVE_P(x) ? '+' : '-';
}
else {
if (LONG_MAX < numwords)
@@ -4822,7 +4764,7 @@ big2str_generic(VALUE x, int base)
VALUE power;
xds = BDIGITS(x);
- xn = RBIGNUM_LEN(x);
+ xn = BIGNUM_LEN(x);
BARY_TRUNC(xds, xn);
if (xn == 0) {
@@ -4839,13 +4781,13 @@ big2str_generic(VALUE x, int base)
power_level = 0;
power = power_cache_get_power(base, power_level, NULL);
while (power_level < MAX_BASE36_POWER_TABLE_ENTRIES &&
- (size_t)RBIGNUM_LEN(power) <= (xn+1)/2) {
+ (size_t)BIGNUM_LEN(power) <= (xn+1)/2) {
power_level++;
power = power_cache_get_power(base, power_level, NULL);
}
assert(power_level != MAX_BASE36_POWER_TABLE_ENTRIES);
- if ((size_t)RBIGNUM_LEN(power) <= xn) {
+ if ((size_t)BIGNUM_LEN(power) <= xn) {
/*
* This increment guarantees x < power_cache_get_power(base, power_level)
* without invoking it actually.
@@ -4859,7 +4801,7 @@ big2str_generic(VALUE x, int base)
power_level++;
}
- b2s_data.negative = RBIGNUM_NEGATIVE_P(x);
+ b2s_data.negative = BIGNUM_NEGATIVE_P(x);
b2s_data.base = base;
b2s_data.hbase2 = maxpow_in_bdigit_dbl(base, &b2s_data.hbase2_numdigits);
@@ -4873,7 +4815,7 @@ big2str_generic(VALUE x, int base)
VALUE tmpw = 0;
BDIGIT *wds;
size_t wn;
- wn = power_level * BIGDIVREM_EXTRA_WORDS + RBIGNUM_LEN(power);
+ wn = power_level * BIGDIVREM_EXTRA_WORDS + BIGNUM_LEN(power);
wds = ALLOCV_N(BDIGIT, tmpw, xn + wn);
MEMCPY(wds, xds, BDIGIT, xn);
big2str_karatsuba(&b2s_data, wds, xn, wn, power_level, 0);
@@ -4896,22 +4838,22 @@ rb_big2str_generic(VALUE x, int base)
}
#ifdef USE_GMP
-VALUE
+static VALUE
big2str_gmp(VALUE x, int base)
{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGITS)*CHAR_BIT;
+ const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
mpz_t mx;
size_t size;
VALUE str;
BDIGIT *xds = BDIGITS(x);
- size_t xn = RBIGNUM_LEN(x);
+ size_t xn = BIGNUM_LEN(x);
mpz_init(mx);
mpz_import(mx, xn, -1, sizeof(BDIGIT), 0, nails, xds);
size = mpz_sizeinbase(mx, base);
- if (RBIGNUM_NEGATIVE_P(x)) {
+ if (BIGNUM_NEGATIVE_P(x)) {
mpz_neg(mx, mx);
str = rb_usascii_str_new(0, size+1);
}
@@ -4948,7 +4890,7 @@ rb_big2str1(VALUE x, int base)
bigtrunc(x);
xds = BDIGITS(x);
- xn = RBIGNUM_LEN(x);
+ xn = BIGNUM_LEN(x);
BARY_TRUNC(xds, xn);
if (xn == 0) {
@@ -4976,41 +4918,6 @@ rb_big2str1(VALUE x, int base)
return big2str_generic(x, base);
}
-/* deprecated */
-VALUE
-rb_big2str0(VALUE x, int base, int trim)
-{
- VALUE str;
- long oldlen;
- long n2;
-
- str = rb_big2str1(x, base);
-
- if (trim || FIXNUM_P(x) || BIGZEROP(x))
- return str;
-
- oldlen = RSTRING_LEN(str);
- if (oldlen && RSTRING_PTR(str)[0] != '-') {
- rb_str_resize(str, oldlen+1);
- MEMMOVE(RSTRING_PTR(str)+1, RSTRING_PTR(str), char, oldlen);
- RSTRING_PTR(str)[0] = '+';
- }
-
- n2 = big2str_find_n1(x, base);
-
- oldlen = RSTRING_LEN(str);
- if (oldlen-1 < n2) {
- long off = n2 - (oldlen-1);
- rb_str_resize(str, n2+1);
- MEMMOVE(RSTRING_PTR(str)+1+off, RSTRING_PTR(str)+1, char, oldlen-1);
- memset(RSTRING_PTR(str)+1, '0', off);
- }
-
- RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';
-
- return str;
-}
-
VALUE
rb_big2str(VALUE x, int base)
{
@@ -5049,7 +4956,7 @@ rb_big_to_s(int argc, VALUE *argv, VALUE x)
static unsigned long
big2ulong(VALUE x, const char *type)
{
- long len = RBIGNUM_LEN(x);
+ size_t len = BIGNUM_LEN(x);
unsigned long num;
BDIGIT *ds;
@@ -5059,7 +4966,7 @@ big2ulong(VALUE x, const char *type)
rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
}
ds = BDIGITS(x);
-#if SIZEOF_LONG <= SIZEOF_BDIGITS
+#if SIZEOF_LONG <= SIZEOF_BDIGIT
num = (unsigned long)ds[0];
#else
num = 0;
@@ -5071,22 +4978,12 @@ big2ulong(VALUE x, const char *type)
return num;
}
-/* deprecated */
-VALUE
-rb_big2ulong_pack(VALUE x)
-{
- unsigned long num;
- rb_integer_pack(x, &num, 1, sizeof(num), 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER|INTEGER_PACK_2COMP);
- return num;
-}
-
-VALUE
+unsigned long
rb_big2ulong(VALUE x)
{
unsigned long num = big2ulong(x, "unsigned long");
- if (RBIGNUM_POSITIVE_P(x)) {
+ if (BIGNUM_POSITIVE_P(x)) {
return num;
}
else {
@@ -5098,12 +4995,12 @@ rb_big2ulong(VALUE x)
rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
}
-SIGNED_VALUE
+long
rb_big2long(VALUE x)
{
unsigned long num = big2ulong(x, "long");
- if (RBIGNUM_POSITIVE_P(x)) {
+ if (BIGNUM_POSITIVE_P(x)) {
if (num <= LONG_MAX)
return num;
}
@@ -5121,7 +5018,7 @@ rb_big2long(VALUE x)
static unsigned LONG_LONG
big2ull(VALUE x, const char *type)
{
- long len = RBIGNUM_LEN(x);
+ size_t len = BIGNUM_LEN(x);
unsigned LONG_LONG num;
BDIGIT *ds = BDIGITS(x);
@@ -5129,7 +5026,7 @@ big2ull(VALUE x, const char *type)
return 0;
if (BIGSIZE(x) > SIZEOF_LONG_LONG)
rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
-#if SIZEOF_LONG_LONG <= SIZEOF_BDIGITS
+#if SIZEOF_LONG_LONG <= SIZEOF_BDIGIT
num = (unsigned LONG_LONG)ds[0];
#else
num = 0;
@@ -5146,7 +5043,7 @@ rb_big2ull(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "unsigned long long");
- if (RBIGNUM_POSITIVE_P(x)) {
+ if (BIGNUM_POSITIVE_P(x)) {
return num;
}
else {
@@ -5163,7 +5060,7 @@ rb_big2ll(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "long long");
- if (RBIGNUM_POSITIVE_P(x)) {
+ if (BIGNUM_POSITIVE_P(x)) {
if (num <= LLONG_MAX)
return num;
}
@@ -5220,7 +5117,7 @@ static double
big2dbl(VALUE x)
{
double d = 0.0;
- long i = (bigtrunc(x), RBIGNUM_LEN(x)), lo = 0, bits;
+ long i = (bigtrunc(x), BIGNUM_LEN(x)), lo = 0, bits;
BDIGIT *ds = BDIGITS(x), dl;
if (i) {
@@ -5262,7 +5159,7 @@ big2dbl(VALUE x)
}
}
}
- if (!RBIGNUM_SIGN(x)) d = -d;
+ if (!BIGNUM_SIGN(x)) d = -d;
return d;
}
@@ -5396,7 +5293,16 @@ rb_big_cmp(VALUE x, VALUE y)
int cmp;
if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
+ x = bignorm(x);
+ if (FIXNUM_P(x)) {
+ if (FIX2LONG(x) > FIX2LONG(y)) return INT2FIX(1);
+ if (FIX2LONG(x) < FIX2LONG(y)) return INT2FIX(-1);
+ return INT2FIX(0);
+ }
+ else {
+ if (BIGNUM_NEGATIVE_P(x)) return INT2FIX(-1);
+ return INT2FIX(1);
+ }
}
else if (RB_BIGNUM_TYPE_P(y)) {
}
@@ -5407,11 +5313,11 @@ rb_big_cmp(VALUE x, VALUE y)
return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
}
- if (RBIGNUM_SIGN(x) > RBIGNUM_SIGN(y)) return INT2FIX(1);
- if (RBIGNUM_SIGN(x) < RBIGNUM_SIGN(y)) return INT2FIX(-1);
+ if (BIGNUM_SIGN(x) > BIGNUM_SIGN(y)) return INT2FIX(1);
+ if (BIGNUM_SIGN(x) < BIGNUM_SIGN(y)) return INT2FIX(-1);
- cmp = bary_cmp(BDIGITS(x), RBIGNUM_LEN(x), BDIGITS(y), RBIGNUM_LEN(y));
- if (RBIGNUM_SIGN(x))
+ cmp = bary_cmp(BDIGITS(x), BIGNUM_LEN(x), BDIGITS(y), BIGNUM_LEN(y));
+ if (BIGNUM_SIGN(x))
return INT2FIX(cmp);
else
return INT2FIX(-cmp);
@@ -5541,9 +5447,9 @@ rb_big_eq(VALUE x, VALUE y)
else {
return rb_equal(y, x);
}
- 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;
+ if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y)) return Qfalse;
+ if (BIGNUM_LEN(x) != BIGNUM_LEN(y)) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) != 0) return Qfalse;
return Qtrue;
}
@@ -5562,9 +5468,9 @@ VALUE
rb_big_eql(VALUE x, VALUE y)
{
if (!RB_BIGNUM_TYPE_P(y)) 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;
+ if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y)) return Qfalse;
+ if (BIGNUM_LEN(x) != BIGNUM_LEN(y)) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) != 0) return Qfalse;
return Qtrue;
}
@@ -5580,7 +5486,7 @@ rb_big_uminus(VALUE x)
{
VALUE z = rb_big_clone(x);
- RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
return bignorm(z);
}
@@ -5602,22 +5508,22 @@ rb_big_neg(VALUE x)
{
VALUE z = rb_big_clone(x);
BDIGIT *ds = BDIGITS(z);
- long n = RBIGNUM_LEN(z);
+ long n = BIGNUM_LEN(z);
if (!n) return INT2FIX(-1);
- if (RBIGNUM_POSITIVE_P(z)) {
+ if (BIGNUM_POSITIVE_P(z)) {
if (bary_add_one(ds, n)) {
big_extend_carry(z);
}
- RBIGNUM_SET_NEGATIVE_SIGN(z);
+ BIGNUM_SET_NEGATIVE_SIGN(z);
}
else {
bary_neg(ds, n);
if (bary_add_one(ds, n))
return INT2FIX(-1);
bary_neg(ds, n);
- RBIGNUM_SET_POSITIVE_SIGN(z);
+ BIGNUM_SET_POSITIVE_SIGN(z);
}
return bignorm(z);
@@ -5630,8 +5536,8 @@ bigsub(VALUE x, VALUE y)
BDIGIT *xds, *yds, *zds;
long xn, yn, zn;
- xn = RBIGNUM_LEN(x);
- yn = RBIGNUM_LEN(y);
+ xn = BIGNUM_LEN(x);
+ yn = BIGNUM_LEN(y);
zn = xn < yn ? yn : xn;
z = bignew(zn, 1);
@@ -5642,7 +5548,7 @@ bigsub(VALUE x, VALUE y)
if (bary_sub(zds, zn, xds, xn, yds, yn)) {
bary_2comp(zds, zn);
- RBIGNUM_SET_NEGATIVE_SIGN(z);
+ BIGNUM_SET_NEGATIVE_SIGN(z);
}
return z;
@@ -5661,24 +5567,24 @@ bigsub_int(VALUE x, long y0)
y = y0;
xds = BDIGITS(x);
- xn = RBIGNUM_LEN(x);
+ xn = BIGNUM_LEN(x);
if (xn == 0)
return LONG2NUM(-y0);
zn = xn;
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+#if SIZEOF_BDIGIT < SIZEOF_LONG
if (zn < bdigit_roomof(SIZEOF_LONG))
zn = bdigit_roomof(SIZEOF_LONG);
#endif
- z = bignew(zn, RBIGNUM_SIGN(x));
+ z = bignew(zn, BIGNUM_SIGN(x));
zds = BDIGITS(z);
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
assert(xn == zn);
num = (BDIGIT_DBL_SIGNED)xds[0] - y;
if (xn == 1 && num < 0) {
- RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
zds[0] = (BDIGIT)-num;
RB_GC_GUARD(x);
return bignorm(z);
@@ -5715,7 +5621,7 @@ bigsub_int(VALUE x, long y0)
zds[i] = BIGLO(num);
num = BIGDN(num);
}
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+#if SIZEOF_BDIGIT < SIZEOF_LONG
for (; i < zn; i++) {
y_is_zero_z:
if (num == 0) goto num_is_zero_z;
@@ -5729,7 +5635,7 @@ bigsub_int(VALUE x, long y0)
num_is_zero_x:
zds[i] = xds[i];
}
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+#if SIZEOF_BDIGIT < SIZEOF_LONG
for (; i < zn; i++) {
num_is_zero_z:
zds[i] = 0;
@@ -5741,7 +5647,7 @@ bigsub_int(VALUE x, long y0)
assert(num == 0 || num == -1);
if (num < 0) {
get2comp(z);
- RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
}
RB_GC_GUARD(x);
return bignorm(z);
@@ -5757,22 +5663,22 @@ bigadd_int(VALUE x, long y)
long i;
xds = BDIGITS(x);
- xn = RBIGNUM_LEN(x);
+ xn = BIGNUM_LEN(x);
if (xn == 0)
return LONG2NUM(y);
zn = xn;
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+#if SIZEOF_BDIGIT < SIZEOF_LONG
if (zn < bdigit_roomof(SIZEOF_LONG))
zn = bdigit_roomof(SIZEOF_LONG);
#endif
zn++;
- z = bignew(zn, RBIGNUM_SIGN(x));
+ z = bignew(zn, BIGNUM_SIGN(x));
zds = BDIGITS(z);
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
num = (BDIGIT_DBL)xds[0] + y;
zds[0] = BIGLO(num);
num = BIGDN(num);
@@ -5834,25 +5740,25 @@ static VALUE
bigadd(VALUE x, VALUE y, int sign)
{
VALUE z;
- long len;
+ size_t len;
- sign = (sign == RBIGNUM_SIGN(y));
- if (RBIGNUM_SIGN(x) != sign) {
+ sign = (sign == BIGNUM_SIGN(y));
+ if (BIGNUM_SIGN(x) != sign) {
if (sign) return bigsub(y, x);
return bigsub(x, y);
}
- if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
- len = RBIGNUM_LEN(x) + 1;
+ if (BIGNUM_LEN(x) > BIGNUM_LEN(y)) {
+ len = BIGNUM_LEN(x) + 1;
}
else {
- len = RBIGNUM_LEN(y) + 1;
+ len = BIGNUM_LEN(y) + 1;
}
z = bignew(len, sign);
- bary_add(BDIGITS(z), RBIGNUM_LEN(z),
- BDIGITS(x), RBIGNUM_LEN(x),
- BDIGITS(y), RBIGNUM_LEN(y));
+ bary_add(BDIGITS(z), BIGNUM_LEN(z),
+ BDIGITS(x), BIGNUM_LEN(x),
+ BDIGITS(y), BIGNUM_LEN(y));
return z;
}
@@ -5871,7 +5777,7 @@ rb_big_plus(VALUE x, VALUE y)
if (FIXNUM_P(y)) {
n = FIX2LONG(y);
- if ((n > 0) != RBIGNUM_SIGN(x)) {
+ if ((n > 0) != BIGNUM_SIGN(x)) {
if (n < 0) {
n = -n;
}
@@ -5907,7 +5813,7 @@ rb_big_minus(VALUE x, VALUE y)
if (FIXNUM_P(y)) {
n = FIX2LONG(y);
- if ((n > 0) != RBIGNUM_SIGN(x)) {
+ if ((n > 0) != BIGNUM_SIGN(x)) {
if (n < 0) {
n = -n;
}
@@ -5936,7 +5842,7 @@ bigsq(VALUE x)
VALUE z;
BDIGIT *xds, *zds;
- xn = RBIGNUM_LEN(x);
+ xn = BIGNUM_LEN(x);
zn = 2 * xn;
z = bignew(zn, 1);
@@ -5970,11 +5876,11 @@ bigmul0(VALUE x, VALUE y)
if (x == y)
return bigsq(x);
- xn = RBIGNUM_LEN(x);
- yn = RBIGNUM_LEN(y);
+ xn = BIGNUM_LEN(x);
+ yn = BIGNUM_LEN(y);
zn = xn + yn;
- z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
xds = BDIGITS(x);
yds = BDIGITS(y);
@@ -6015,7 +5921,7 @@ rb_big_mul(VALUE x, VALUE y)
static VALUE
bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
{
- long xn = RBIGNUM_LEN(x), yn = RBIGNUM_LEN(y);
+ long xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y);
VALUE z;
BDIGIT *xds, *yds, *zds;
BDIGIT dd;
@@ -6039,12 +5945,12 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
}
if (yn == 1) {
dd = yds[0];
- z = bignew(xn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ z = bignew(xn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
zds = BDIGITS(z);
dd = bigdivrem_single(zds, xds, xn, dd);
if (modp) {
*modp = rb_uint2big((VALUE)dd);
- RBIGNUM_SET_SIGN(*modp, RBIGNUM_SIGN(x));
+ BIGNUM_SET_SIGN(*modp, BIGNUM_SIGN(x));
}
if (divp) *divp = z;
return Qnil;
@@ -6055,14 +5961,14 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
BDIGIT_DBL q0 = x0 / y0;
BDIGIT_DBL r0 = x0 % y0;
if (divp) {
- z = bignew(bdigit_roomof(sizeof(BDIGIT_DBL)), RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ z = bignew(bdigit_roomof(sizeof(BDIGIT_DBL)), BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
zds = BDIGITS(z);
zds[0] = BIGLO(q0);
zds[1] = BIGLO(BIGDN(q0));
*divp = z;
}
if (modp) {
- z = bignew(bdigit_roomof(sizeof(BDIGIT_DBL)), RBIGNUM_SIGN(x));
+ z = bignew(bdigit_roomof(sizeof(BDIGIT_DBL)), BIGNUM_SIGN(x));
zds = BDIGITS(z);
zds[0] = BIGLO(r0);
zds[1] = BIGLO(BIGDN(r0));
@@ -6073,7 +5979,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
if (divp) {
qn = xn + BIGDIVREM_EXTRA_WORDS;
- q = bignew(qn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ q = bignew(qn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
qds = BDIGITS(q);
}
else {
@@ -6083,7 +5989,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
if (modp) {
rn = yn;
- r = bignew(rn, RBIGNUM_SIGN(x));
+ r = bignew(rn, BIGNUM_SIGN(x));
rds = BDIGITS(r);
}
else {
@@ -6111,7 +6017,7 @@ bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
VALUE mod;
bigdivrem(x, y, divp, &mod);
- if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y) && !BIGZEROP(mod)) {
+ if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y) && !BIGZEROP(mod)) {
if (divp) *divp = bigadd(*divp, rb_int2big(1), 0);
if (modp) *modp = bigadd(mod, y, 1);
}
@@ -6268,7 +6174,7 @@ big_fdiv(VALUE x, VALUE y, long ey)
long l, ex;
bigtrunc(x);
- l = RBIGNUM_LEN(x);
+ l = BIGNUM_LEN(x);
ex = l * BITSPERDIG - nlz(BDIGITS(x)[l-1]);
ex -= 2 * DBL_BIGDIG * BITSPERDIG;
if (ex) x = big_shift(x, ex);
@@ -6290,7 +6196,7 @@ big_fdiv_int(VALUE x, VALUE y)
{
long l, ey;
bigtrunc(y);
- l = RBIGNUM_LEN(y);
+ l = BIGNUM_LEN(y);
ey = l * BITSPERDIG - nlz(BDIGITS(y)[l-1]);
ey -= DBL_BIGDIG * BITSPERDIG;
if (ey) y = big_shift(y, ey);
@@ -6357,7 +6263,7 @@ rb_big_fdiv(VALUE x, VALUE y)
*
* 123456789 ** 2 #=> 15241578750190521
* 123456789 ** 1.2 #=> 5126464716.09932
- * 123456789 ** -2 #=> 6.5610001194102e-17
+ * 123456789 ** -2 #=> (1/15241578750190521)
*/
VALUE
@@ -6370,7 +6276,7 @@ rb_big_pow(VALUE x, VALUE y)
if (y == INT2FIX(0)) return INT2FIX(1);
if (RB_FLOAT_TYPE_P(y)) {
d = RFLOAT_VALUE(y);
- if ((!RBIGNUM_SIGN(x) && !BIGZEROP(x)) && d != round(d))
+ if ((!BIGNUM_SIGN(x) && !BIGZEROP(x)) && d != round(d))
return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
}
else if (RB_BIGNUM_TYPE_P(y)) {
@@ -6427,7 +6333,7 @@ bigand_int(VALUE x, long xn, BDIGIT hibitsx, long y)
if (xn == 0) return hibitsx ? LONG2NUM(y) : 0;
hibitsy = 0 <= y ? 0 : BDIGMAX;
xds = BDIGITS(x);
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
if (!hibitsy) {
y &= xds[0];
return LONG2NUM(y);
@@ -6435,7 +6341,7 @@ bigand_int(VALUE x, long xn, BDIGIT hibitsx, long y)
#endif
zn = xn;
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+#if SIZEOF_BDIGIT < SIZEOF_LONG
if (hibitsx && zn < bdigit_roomof(SIZEOF_LONG))
zn = bdigit_roomof(SIZEOF_LONG);
#endif
@@ -6443,7 +6349,7 @@ bigand_int(VALUE x, long xn, BDIGIT hibitsx, long y)
z = bignew(zn, 0);
zds = BDIGITS(z);
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
i = 1;
zds[0] = xds[0] & BIGLO(y);
#else
@@ -6541,15 +6447,15 @@ bigor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
hibitsy = 0 <= y ? 0 : BDIGMAX;
xds = BDIGITS(x);
- zn = RBIGNUM_LEN(x);
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+ zn = BIGNUM_LEN(x);
+#if SIZEOF_BDIGIT < SIZEOF_LONG
if (zn < bdigit_roomof(SIZEOF_LONG))
zn = bdigit_roomof(SIZEOF_LONG);
#endif
z = bignew(zn, 0);
zds = BDIGITS(z);
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
i = 1;
zds[0] = xds[0] | BIGLO(y);
if (i < zn)
@@ -6664,15 +6570,15 @@ bigxor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
hibitsy = 0 <= y ? 0 : BDIGMAX;
xds = BDIGITS(x);
- zn = RBIGNUM_LEN(x);
-#if SIZEOF_BDIGITS < SIZEOF_LONG
+ zn = BIGNUM_LEN(x);
+#if SIZEOF_BDIGIT < SIZEOF_LONG
if (zn < bdigit_roomof(SIZEOF_LONG))
zn = bdigit_roomof(SIZEOF_LONG);
#endif
z = bignew(zn, 0);
zds = BDIGITS(z);
-#if SIZEOF_BDIGITS >= SIZEOF_LONG
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
i = 1;
zds[0] = xds[0] ^ BIGLO(y);
#else
@@ -6848,33 +6754,38 @@ static VALUE
rb_big_aref(VALUE x, VALUE y)
{
BDIGIT *xds;
- unsigned long shift;
- long i, s1, s2;
+ size_t shift;
+ size_t i, s1, s2;
+ long l;
BDIGIT bit;
if (RB_BIGNUM_TYPE_P(y)) {
- if (!RBIGNUM_SIGN(y))
+ if (!BIGNUM_SIGN(y))
return INT2FIX(0);
bigtrunc(y);
- if (BIGSIZE(y) > sizeof(long)) {
+ if (BIGSIZE(y) > sizeof(size_t)) {
out_of_range:
- return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
+ return BIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
}
+#if SIZEOF_SIZE_T <= SIZEOF_LONG
shift = big2ulong(y, "long");
+#else
+ shift = big2ull(y, "long long");
+#endif
}
else {
- i = NUM2LONG(y);
- if (i < 0) return INT2FIX(0);
- shift = i;
+ l = NUM2LONG(y);
+ if (l < 0) return INT2FIX(0);
+ shift = (size_t)l;
}
s1 = shift/BITSPERDIG;
s2 = shift%BITSPERDIG;
bit = (BDIGIT)1 << s2;
- if (s1 >= RBIGNUM_LEN(x)) goto out_of_range;
+ if (s1 >= BIGNUM_LEN(x)) goto out_of_range;
xds = BDIGITS(x);
- if (RBIGNUM_POSITIVE_P(x))
+ if (BIGNUM_POSITIVE_P(x))
return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0);
if (xds[s1] & (bit-1))
return (xds[s1] & bit) ? INT2FIX(0) : INT2FIX(1);
@@ -6889,14 +6800,16 @@ rb_big_aref(VALUE x, VALUE y)
* big.hash -> fixnum
*
* Compute a hash based on the value of _big_.
+ *
+ * See also Object#hash.
*/
-static VALUE
+VALUE
rb_big_hash(VALUE x)
{
st_index_t hash;
- hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*RBIGNUM_LEN(x)) ^ RBIGNUM_SIGN(x);
+ hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*BIGNUM_LEN(x)) ^ BIGNUM_SIGN(x);
return INT2FIX(hash);
}
@@ -6921,8 +6834,8 @@ rb_big_coerce(VALUE x, VALUE y)
y = rb_int2big(FIX2LONG(y));
}
else if (!RB_BIGNUM_TYPE_P(y)) {
- rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
- rb_obj_classname(y));
+ rb_raise(rb_eTypeError, "can't coerce %"PRIsVALUE" to Bignum",
+ rb_obj_class(y));
}
return rb_assoc_new(y, x);
}
@@ -6940,9 +6853,9 @@ rb_big_coerce(VALUE x, VALUE y)
static VALUE
rb_big_abs(VALUE x)
{
- if (!RBIGNUM_SIGN(x)) {
+ if (!BIGNUM_SIGN(x)) {
x = rb_big_clone(x);
- RBIGNUM_SET_SIGN(x, 1);
+ BIGNUM_SET_SIGN(x, 1);
}
return x;
}
@@ -6994,6 +6907,13 @@ rb_big_size(VALUE big)
* (2**10000).bit_length #=> 10001
* (2**10000+1).bit_length #=> 10001
*
+ * This method can be used to detect overflow in Array#pack as follows.
+ *
+ * if n.bit_length < 32
+ * [n].pack("l") # no overflow
+ * else
+ * raise "overflow"
+ * end
*/
static VALUE
@@ -7012,7 +6932,7 @@ rb_big_bit_length(VALUE big)
if (numbytes == 0)
return LONG2FIX(0);
- if (RBIGNUM_NEGATIVE_P(big) && rb_absint_singlebit_p(big)) {
+ if (BIGNUM_NEGATIVE_P(big) && rb_absint_singlebit_p(big)) {
if (nlz_bits != CHAR_BIT-1) {
nlz_bits++;
}
@@ -7047,7 +6967,7 @@ rb_big_bit_length(VALUE big)
static VALUE
rb_big_odd_p(VALUE num)
{
- if (RBIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
+ if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
return Qtrue;
}
return Qfalse;
@@ -7063,7 +6983,7 @@ rb_big_odd_p(VALUE num)
static VALUE
rb_big_even_p(VALUE num)
{
- if (RBIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
+ if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
return Qfalse;
}
return Qtrue;
@@ -7133,6 +7053,7 @@ Init_Bignum(void)
rb_define_method(rb_cBignum, "even?", rb_big_even_p, 0);
#ifdef USE_GMP
+ /* The version of loaded GMP. */
rb_define_const(rb_cBignum, "GMP_VERSION", rb_sprintf("GMP %s", gmp_version));
#endif
diff --git a/bin/erb b/bin/erb
index 6a7ea7d593..6a88c3b26a 100755
--- a/bin/erb
+++ b/bin/erb
@@ -11,7 +11,8 @@ class ERB
return nil if self.empty?
arg = self.shift
return nil if arg == '--'
- if arg =~ /^-(.)(.*)/
+ case arg
+ when /\A-(.)(.*)/
if $1 == '-'
arg, @maybe_arg = arg.split(/=/, 2)
return arg
@@ -24,6 +25,8 @@ class ERB
@maybe_arg = nil
end
"-#{$1}"
+ when /\A(\w+)=/
+ arg
else
self.unshift arg
nil
@@ -54,6 +57,7 @@ class ERB
def run(factory=ERB)
trim_mode = 0
disable_percent = false
+ variables = {}
begin
while switch = ARGV.switch
case switch
@@ -72,7 +76,7 @@ class ERB
require ARGV.req_arg
when '-S' # security level
arg = ARGV.req_arg
- raise "invalid safe_level #{arg.dump}" unless arg =~ /^[0-3]$/
+ raise "invalid safe_level #{arg.dump}" unless arg =~ /\A[0-1]\z/
safe_level = arg.to_i
when '-T' # trim mode
arg = ARGV.req_arg
@@ -80,7 +84,7 @@ class ERB
trim_mode = arg
next
end
- raise "invalid trim mode #{arg.dump}" unless arg =~ /^[0-2]$/
+ raise "invalid trim mode #{arg.dump}" unless arg =~ /\A[0-2]\z/
trim_mode = arg.to_i
when '-E', '--encoding'
arg = ARGV.req_arg
@@ -91,25 +95,29 @@ class ERB
disable_percent = true
when '--help'
raise "print this help"
- else
+ when /\A-/
raise "unknown switch #{switch.dump}"
+ else
+ var, val = *switch.split('=', 2)
+ (variables ||= {})[var] = val
end
end
rescue # usage
STDERR.puts $!.to_s
STDERR.puts File.basename($0) +
- " [switches] [inputfile]"
+ " [switches] [var=value...] [inputfile]"
STDERR.puts <<EOU
-x print ruby script
-n print ruby script with line number
-v enable verbose mode
-d set $DEBUG to true
-r library load a library
- -S safe_level set $SAFE (0..3)
+ -S safe_level set $SAFE (0..1)
-E ex[:in] set default external/internal encodings
-U set default encoding to UTF-8.
-T trim_mode specify trim_mode (0..2, -)
-P ignore lines which start with "%"
+ var=value set variable
EOU
exit 1
end
@@ -130,15 +138,23 @@ EOU
puts erb.src
end
else
- erb.run(TOPLEVEL_BINDING.taint)
+ bind = TOPLEVEL_BINDING.taint
+ if variables
+ enc = erb.encoding
+ for var, val in variables do
+ val = val.encode(enc) if val
+ bind.local_variable_set(var, val)
+ end
+ end
+ erb.run(bind)
end
end
module_function :run
def set_encoding(extern, intern = nil)
verbose, $VERBOSE = $VERBOSE, nil
- Encoding.default_external = extern unless extern.nil? || extern.empty?
- Encoding.default_internal = intern unless intern.nil? || intern.empty?
+ Encoding.default_external = extern unless extern.nil? || extern == ""
+ Encoding.default_internal = intern unless intern.nil? || intern == ""
[$stdin, $stdout, $stderr].each do |io|
io.set_encoding(extern, intern)
end
diff --git a/bin/rake b/bin/rake
deleted file mode 100755
index 4e0bbb7b7a..0000000000
--- a/bin/rake
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env ruby
-
-#--
-# Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich
-#
-# 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.
-#++
-
-begin
- require 'rubygems'
- gem 'rake'
-rescue LoadError
-end
-
-require 'rake'
-
-Rake.application.run
diff --git a/bin/testrb b/bin/testrb
deleted file mode 100755
index 23a00b439f..0000000000
--- a/bin/testrb
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require 'test/unit'
-exit Test::Unit::AutoRunner.run(true)
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 5fdfc42a63..5eb468a338 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -136,13 +136,18 @@ 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"
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
+ begin
+ File.read(File.join(__dir__, "../test/colors")).scan(/(\w+)=([^:\n]*)/) do |n, c|
+ colors[n] ||= c
+ end
+ rescue
+ end
+ @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 = ""
+ @passed = @failed = @reset = ""
end
unless quiet
puts Time.now
@@ -163,28 +168,44 @@ End
}
end
+def erase(e = true)
+ if e and @columns > 0 and !@verbose
+ "\r#{" "*@columns}\r"
+ else
+ ""
+ end
+end
+
def exec_test(pathes)
@count = 0
@error = 0
@errbuf = []
@location = nil
+ @columns = 0
+ @width = pathes.map {|path| File.basename(path).size}.max + 2
pathes.each do |path|
@basename = File.basename(path)
- $stderr.print @basename, " "
+ $stderr.printf("%s%-*s ", erase(@quiet), @width, @basename)
+ $stderr.flush
+ @columns = @width + 1
$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
+ msg = "PASS #{@count-count}"
+ @columns += msg.size - 1
+ $stderr.print "#{@progress_bs}#{@passed}#{msg}#{@reset}"
else
- $stderr.print "#{@progress_bs}#{@failed}FAIL #{@error-error}/#{@count-count}#{@reset}"
+ msg = "FAIL #{@error-error}/#{@count-count}"
+ $stderr.print "#{@progress_bs}#{@failed}#{msg}#{@reset}"
+ @columns = 0
end
end
- $stderr.puts unless @quiet and @tty
+ $stderr.puts unless @quiet and @tty and @error == error
end
+ $stderr.print(erase) if @quiet
if @error == 0
if @count == 0
$stderr.puts "No tests, no problem"
@@ -207,23 +228,28 @@ def show_progress(message = '')
elsif @tty
$stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
end
+ t = Time.now if @verbose
faildesc, errout = with_stderr {yield}
+ t = Time.now - t if @verbose
if !faildesc
if @tty
$stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
+ elsif @verbose
+ $stderr.printf(". %.3f\n", t)
else
$stderr.print '.'
end
- $stderr.puts if @verbose
else
- $stderr.print "#{@failed}F#{@reset}"
+ $stderr.print "#{@failed}F"
+ $stderr.printf(" %.3f", t) if @verbose
+ $stderr.print "#{@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]
+ $stderr.printf("%-*s%s", @width, @basename, @progress[@count % @progress.size])
end
end
rescue Interrupt
@@ -321,7 +347,7 @@ def assert_normal_exit(testsrc, *rest)
$stderr.reopen(old_stderr)
old_stderr.close
end
- if status && status.signaled?
+ if status&.signaled?
signo = status.termsig
signame = Signal.list.invert[signo]
unless ignore_signals and ignore_signals.include?(signame)
@@ -385,7 +411,7 @@ end
INDENT = 27
def adjust_indent(src)
- untabify(src).gsub(/^ {#{INDENT}}/o, '').gsub(/^/, ' ')
+ untabify(src).gsub(/^ {#{INDENT}}/o, '').gsub(/^/, ' ').sub(/\s*\z/, "\n")
end
def untabify(str)
@@ -445,7 +471,7 @@ end
def error(msg, additional_message)
msg = "#{@failed}\##{@count} #{@location}#{@reset}: #{msg} #{additional_message}"
if @tty
- $stderr.puts "#{@erase}#{msg}"
+ $stderr.puts "#{erase}#{msg}"
else
@errbuf.push msg
end
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index 6a2ccfc6da..cdc5960a59 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -597,3 +597,17 @@ assert_equal 'true', %q{
C1.new.foo{}
}
+assert_equal 'ok', %q{
+ 1.times do
+ begin
+ raise
+ rescue
+ begin
+ raise
+ rescue
+ break
+ end
+ end
+ end
+ 'ok'
+}
diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb
index 384294727f..1cd9f7ac6c 100644
--- a/bootstraptest/test_fork.rb
+++ b/bootstraptest/test_fork.rb
@@ -22,26 +22,32 @@ assert_finish 10, %q{
}, '[ruby-core:22158]'
assert_normal_exit(<<'End', '[ruby-dev:37934]')
- Thread.new { sleep 1; Thread.kill Thread.main }
- Process.setrlimit(:NPROC, 1)
+ main = Thread.current
+ Thread.new { sleep 0.01 until main.stop?; Thread.kill main }
+ Process.setrlimit(:NPROC, 1) if defined?(Process::RLIMIT_NPROC)
fork {}
End
assert_equal 'ok', %q{
begin
+ r, w = IO.pipe
if pid1 = fork
- sleep 1
+ w.close
+ r.read(1)
Process.kill("USR1", pid1)
_, s = Process.wait2(pid1)
s.success? ? :ok : :ng
else
+ r.close
if pid2 = fork
- trap("USR1") { Time.now.to_s }
+ trap("USR1") { Time.now.to_s; Process.kill("USR2", pid2) }
+ w.close
Process.wait2(pid2)
else
- sleep 2
+ w.close
+ sleep 0.2
end
- exit 0
+ exit true
end
rescue NotImplementedError
:ok
@@ -50,17 +56,17 @@ assert_equal 'ok', %q{
assert_equal '[1, 2]', %q{
a = []
- trap(:INT) { a.push(1) }
- trap(:TERM) { a.push(2) }
+ main = Thread.current
+ trap(:INT) { a.push(1).size == 2 and main.wakeup }
+ trap(:TERM) { a.push(2).size == 2 and main.wakeup }
pid = $$
begin
- fork do
- sleep 0.5
+ pid = fork do
Process.kill(:INT, pid)
Process.kill(:TERM, pid)
end
-
- sleep 1
+ Process.wait(pid)
+ 100.times {break if a.size > 1; sleep 0.001}
a.sort
rescue NotImplementedError
[1, 2]
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
index f7360f34b3..1d2b19368a 100644
--- a/bootstraptest/test_io.rb
+++ b/bootstraptest/test_io.rb
@@ -2,9 +2,8 @@ assert_finish 5, %q{
r, w = IO.pipe
t1 = Thread.new { r.sysread(1) }
t2 = Thread.new { r.sysread(1) }
- sleep 0.1
+ sleep 0.01 until t1.stop? and t2.stop?
w.write "a"
- sleep 0.1
w.write "a"
}, '[ruby-dev:31866]'
@@ -27,16 +26,16 @@ assert_finish 10, %q{
t1.join
t2.join
end
- rescue LoadError, TimeoutError, NotImplementedError
+ rescue LoadError, Timeout::Error, NotImplementedError
end
}, '[ruby-dev:32566]'
assert_finish 1, %q{
r, w = IO.pipe
Thread.new {
- w << "ab"
- sleep 0.1
- w << "ab"
+ w << "ab"
+ sleep 0.01
+ w << "ab"
}
r.gets("abab")
}
@@ -91,7 +90,8 @@ assert_normal_exit %q{
megacontent = "abc" * 12345678
#File.open("megasrc", "w") {|f| f << megacontent }
- Thread.new { sleep rand*0.2; Process.kill(:INT, $$) }
+ t0 = Thread.main
+ Thread.new { sleep 0.001 until t0.stop?; Process.kill(:INT, $$) }
r1, w1 = IO.pipe
r2, w2 = IO.pipe
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
index b95a2f2d0a..aa65bddae1 100644
--- a/bootstraptest/test_literal.rb
+++ b/bootstraptest/test_literal.rb
@@ -84,7 +84,7 @@ assert_equal '0', 're = /test/; re =~ "test"'
assert_equal '0', 'str = "test"; /test/ =~ str'
assert_equal '0', 're = /test/; str = "test"; re =~ str'
-# dynacmi regexp
+# dynamic regexp
assert_equal 'regexp', %q(/re#{'ge'}xp/.source)
assert_equal 'Regexp', %q(/re#{'ge'}xp/.class)
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index 4282bc6273..3462aa9434 100644
--- a/bootstraptest/test_method.rb
+++ b/bootstraptest/test_method.rb
@@ -3,7 +3,7 @@ assert_equal '1', 'def m() 1 end; m()'
assert_equal '1', 'def m(a) a end; m(1)'
assert_equal '[1, 2]', 'def m(a,b) [a, b] end; m(1,2)'
assert_equal '[1, 2, 3]', 'def m(a,b,c) [a, b, c] end; m(1,2,3)'
-assert_equal 'wrong number of arguments (1 for 0)', %q{
+assert_match /\Awrong number of arguments \(.*\b1\b.* 0\)\z/, %q{
def m; end
begin
m(1)
@@ -12,7 +12,7 @@ assert_equal 'wrong number of arguments (1 for 0)', %q{
end
}
-assert_equal 'wrong number of arguments (0 for 1)', %q{
+assert_match /\Awrong number of arguments \(.*\b0\b.* 1\)\z/, %q{
def m a; end
begin
m
@@ -910,34 +910,6 @@ assert_equal 'ok', %q{
}, '[ruby-core:11998]'
assert_equal 'ok', %q{
- proc{
- $SAFE = 2
- class C
- def m
- :ok
- end
- end
- }.call
- C.new.m
-}, '[ruby-core:11998]'
-
-assert_equal 'ok', %q{
- proc{
- $SAFE = 3
- class C
- def m
- :ng
- end
- end
- }.call
- begin
- C.new.m
- rescue SecurityError
- :ok
- end
-}, '[ruby-core:11998]'
-
-assert_equal 'ok', %q{
class B
def m() :fail end
end
@@ -957,8 +929,8 @@ assert_equal 'ok', %q{
assert_normal_exit %q{
begin
- Process.setrlimit(Process::RLIMIT_STACK, 4_202_496)
- # FreeBSD fails this less than 4M + 8K bytes.
+ Process.setrlimit(Process::RLIMIT_STACK, 4_206_592)
+ # FreeBSD SEGVs this less than 4M + 12K bytes.
rescue Exception
exit
end
diff --git a/bootstraptest/test_string.rb b/bootstraptest/test_string.rb
new file mode 100644
index 0000000000..849dcd45b0
--- /dev/null
+++ b/bootstraptest/test_string.rb
@@ -0,0 +1,3 @@
+assert_normal_exit %q{
+ inspect.clear
+}, '[ruby-core:68110]'
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index 80eaa6416d..a111990a1f 100644
--- a/bootstraptest/test_syntax.rb
+++ b/bootstraptest/test_syntax.rb
@@ -376,6 +376,8 @@ assert_equal %q{1}, %q{1 or 2 or 3 or 4}
assert_equal %q{1}, %q{1 or false or 3 or 4}
assert_equal %q{2}, %q{nil or 2 or 3 or 4}
assert_equal %q{2}, %q{false or 2 or 3 or 4}
+assert_equal %q{1}, %q{if true && ""; then 1; end}
+assert_equal %q{1}, %q{if nil || true; then 1; end}
assert_equal %q{false}, %q{nil or false or nil or false}
assert_equal %q{elseng}, %q{
case
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 7baa806a45..d64f44be49 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -85,7 +85,7 @@ assert_equal %q{ok}, %q{
ans = :ok
end
}
- Thread.pass
+ Thread.pass until t.stop?
t.kill
t.join
ans
@@ -241,16 +241,16 @@ assert_equal 'ok', %{
}
assert_finish 3, %{
- th = Thread.new {sleep 2}
- th.join(1)
+ th = Thread.new {sleep 0.2}
+ th.join(0.1)
th.join
}
assert_finish 3, %{
require 'timeout'
- th = Thread.new {sleep 2}
+ th = Thread.new {sleep 0.2}
begin
- Timeout.timeout(1) {th.join}
+ Timeout.timeout(0.1) {th.join}
rescue Timeout::Error
end
th.join
@@ -276,7 +276,7 @@ assert_normal_exit %q{
assert_equal 'ok', %q{
def m
t = Thread.new { while true; // =~ "" end }
- sleep 0.1
+ sleep 0.01
10.times {
if /((ab)*(ab)*)*(b)/ =~ "ab"*7
return :ng if !$4
@@ -340,8 +340,9 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
begin
m1, m2 = Mutex.new, Mutex.new
- Thread.new { m1.lock; sleep 1; m2.lock }
- m2.lock; sleep 1; m1.lock
+ f1 = f2 = false
+ Thread.new { m1.lock; f2 = true; sleep 0.001 until f1; m2.lock }
+ m2.lock; f1 = true; sleep 0.001 until f2; m1.lock
:ng
rescue Exception
:ok
@@ -350,7 +351,7 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
m = Mutex.new
- Thread.new { m.lock }; sleep 1; m.lock
+ Thread.new { m.lock }; sleep 0.1; m.lock
:ok
}
@@ -368,15 +369,15 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
m = Mutex.new
- Thread.new { m.lock; sleep 2 }
- sleep 1; m.lock
+ Thread.new { m.lock; sleep 0.2 }
+ sleep 0.1; m.lock
:ok
}
assert_equal 'ok', %q{
m = Mutex.new
- Thread.new { m.lock; sleep 2; m.unlock }
- sleep 1; m.lock
+ Thread.new { m.lock; sleep 0.2; m.unlock }
+ sleep 0.1; m.lock
:ok
}
@@ -398,19 +399,20 @@ assert_equal 'ok', %q{
assert_equal 'ok', %{
open("zzz.rb", "w") do |f|
- f.puts <<-END
+ f.puts <<-'end;' # do
begin
m = Mutex.new
- Thread.new { m.lock; sleep 1 }
- sleep 0.3
parent = Thread.current
+ th1 = Thread.new { m.lock; sleep }
+ sleep 0.01 until th1.stop?
Thread.new do
- sleep 0.3
+ sleep 0.01 until parent.stop?
begin
fork { GC.start }
rescue Exception
parent.raise $!
end
+ th1.run
end
m.lock
pid, status = Process.wait2
@@ -418,7 +420,7 @@ assert_equal 'ok', %{
rescue NotImplementedError
$result = :ok
end
- END
+ end;
end
require "./zzz.rb"
$result
@@ -448,17 +450,27 @@ assert_finish 3, %q{
assert_equal 'ok', %q{
begin
- Process.waitpid2(fork {sleep 1})[1].success? ? 'ok' : 'ng'
+ Process.waitpid2(fork {})[1].success? ? 'ok' : 'ng'
rescue NotImplementedError
'ok'
end
}
assert_equal 'foo', %q{
- f = proc {|s| /#{ sleep 1; s }/o }
- [ Thread.new { f.call("foo"); nil },
- Thread.new { sleep 0.5; f.call("bar"); nil },
- ].each {|t| t.join }
+ i = 0
+ Thread.start {sleep 1; exit!}
+ f = proc {|s, c| /#{c.call; s}/o }
+ th2 = Thread.new {
+ sleep 0.01 until i == 1
+ i = 2
+ f.call("bar", proc {sleep 2});
+ nil
+ }
+ th1 = Thread.new {
+ f.call("foo", proc {i = 1; sleep 0.01 until i == 2; sleep 0.01})
+ nil
+ }
+ [th1, th2].each {|t| t.join }
GC.start
f.call.source
}
diff --git a/ccan/build_assert/build_assert.h b/ccan/build_assert/build_assert.h
new file mode 100644
index 0000000000..a04d1d4709
--- /dev/null
+++ b/ccan/build_assert/build_assert.h
@@ -0,0 +1,40 @@
+/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
+#ifndef CCAN_BUILD_ASSERT_H
+#define CCAN_BUILD_ASSERT_H
+
+/**
+ * BUILD_ASSERT - assert a build-time dependency.
+ * @cond: the compile-time condition which must be true.
+ *
+ * Your compile will fail if the condition isn't true, or can't be evaluated
+ * by the compiler. This can only be used within a function.
+ *
+ * Example:
+ * #include <stddef.h>
+ * ...
+ * static char *foo_to_char(struct foo *foo)
+ * {
+ * // This code needs string to be at start of foo.
+ * BUILD_ASSERT(offsetof(struct foo, string) == 0);
+ * return (char *)foo;
+ * }
+ */
+#define BUILD_ASSERT(cond) \
+ do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
+
+/**
+ * BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
+ * @cond: the compile-time condition which must be true.
+ *
+ * Your compile will fail if the condition isn't true, or can't be evaluated
+ * by the compiler. This can be used in an expression: its value is "0".
+ *
+ * Example:
+ * #define foo_to_char(foo) \
+ * ((char *)(foo) \
+ * + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
+ */
+#define BUILD_ASSERT_OR_ZERO(cond) \
+ (sizeof(char [1 - 2*!(cond)]) - 1)
+
+#endif /* CCAN_BUILD_ASSERT_H */
diff --git a/ccan/check_type/check_type.h b/ccan/check_type/check_type.h
new file mode 100644
index 0000000000..1f77a535e4
--- /dev/null
+++ b/ccan/check_type/check_type.h
@@ -0,0 +1,63 @@
+/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
+#ifndef CCAN_CHECK_TYPE_H
+#define CCAN_CHECK_TYPE_H
+
+/**
+ * check_type - issue a warning or build failure if type is not correct.
+ * @expr: the expression whose type we should check (not evaluated).
+ * @type: the exact type we expect the expression to be.
+ *
+ * This macro is usually used within other macros to try to ensure that a macro
+ * argument is of the expected type. No type promotion of the expression is
+ * done: an unsigned int is not the same as an int!
+ *
+ * check_type() always evaluates to 0.
+ *
+ * If your compiler does not support typeof, then the best we can do is fail
+ * to compile if the sizes of the types are unequal (a less complete check).
+ *
+ * Example:
+ * // They should always pass a 64-bit value to _set_some_value!
+ * #define set_some_value(expr) \
+ * _set_some_value((check_type((expr), uint64_t), (expr)))
+ */
+
+/**
+ * check_types_match - issue a warning or build failure if types are not same.
+ * @expr1: the first expression (not evaluated).
+ * @expr2: the second expression (not evaluated).
+ *
+ * This macro is usually used within other macros to try to ensure that
+ * arguments are of identical types. No type promotion of the expressions is
+ * done: an unsigned int is not the same as an int!
+ *
+ * check_types_match() always evaluates to 0.
+ *
+ * If your compiler does not support typeof, then the best we can do is fail
+ * to compile if the sizes of the types are unequal (a less complete check).
+ *
+ * Example:
+ * // Do subtraction to get to enclosing type, but make sure that
+ * // pointer is of correct type for that member.
+ * #define container_of(mbr_ptr, encl_type, mbr) \
+ * (check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
+ * ((encl_type *) \
+ * ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
+ */
+#if HAVE_TYPEOF
+#define check_type(expr, type) \
+ ((typeof(expr) *)0 != (type *)0)
+
+#define check_types_match(expr1, expr2) \
+ ((typeof(expr1) *)0 != (typeof(expr2) *)0)
+#else
+#include "ccan/build_assert/build_assert.h"
+/* Without typeof, we can only test the sizes. */
+#define check_type(expr, type) \
+ BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
+
+#define check_types_match(expr1, expr2) \
+ BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
+#endif /* HAVE_TYPEOF */
+
+#endif /* CCAN_CHECK_TYPE_H */
diff --git a/ccan/container_of/container_of.h b/ccan/container_of/container_of.h
new file mode 100644
index 0000000000..ae3e1fc81f
--- /dev/null
+++ b/ccan/container_of/container_of.h
@@ -0,0 +1,142 @@
+/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
+#ifndef CCAN_CONTAINER_OF_H
+#define CCAN_CONTAINER_OF_H
+#include "ccan/check_type/check_type.h"
+
+/**
+ * container_of - get pointer to enclosing structure
+ * @member_ptr: pointer to the structure member
+ * @containing_type: the type this member is within
+ * @member: the name of this member within the structure.
+ *
+ * Given a pointer to a member of a structure, this macro does pointer
+ * subtraction to return the pointer to the enclosing type.
+ *
+ * Example:
+ * struct foo {
+ * int fielda, fieldb;
+ * // ...
+ * };
+ * struct info {
+ * int some_other_field;
+ * struct foo my_foo;
+ * };
+ *
+ * static struct info *foo_to_info(struct foo *foo)
+ * {
+ * return container_of(foo, struct info, my_foo);
+ * }
+ */
+#define container_of(member_ptr, containing_type, member) \
+ ((containing_type *) \
+ ((char *)(member_ptr) \
+ - container_off(containing_type, member)) \
+ + check_types_match(*(member_ptr), ((containing_type *)0)->member))
+
+
+/**
+ * container_of_or_null - get pointer to enclosing structure, or NULL
+ * @member_ptr: pointer to the structure member
+ * @containing_type: the type this member is within
+ * @member: the name of this member within the structure.
+ *
+ * Given a pointer to a member of a structure, this macro does pointer
+ * subtraction to return the pointer to the enclosing type, unless it
+ * is given NULL, in which case it also returns NULL.
+ *
+ * Example:
+ * struct foo {
+ * int fielda, fieldb;
+ * // ...
+ * };
+ * struct info {
+ * int some_other_field;
+ * struct foo my_foo;
+ * };
+ *
+ * static struct info *foo_to_info_allowing_null(struct foo *foo)
+ * {
+ * return container_of_or_null(foo, struct info, my_foo);
+ * }
+ */
+static inline char *container_of_or_null_(void *member_ptr, size_t offset)
+{
+ return member_ptr ? (char *)member_ptr - offset : NULL;
+}
+#define container_of_or_null(member_ptr, containing_type, member) \
+ ((containing_type *) \
+ container_of_or_null_(member_ptr, \
+ container_off(containing_type, member)) \
+ + check_types_match(*(member_ptr), ((containing_type *)0)->member))
+
+/**
+ * container_off - get offset to enclosing structure
+ * @containing_type: the type this member is within
+ * @member: the name of this member within the structure.
+ *
+ * Given a pointer to a member of a structure, this macro does
+ * typechecking and figures out the offset to the enclosing type.
+ *
+ * Example:
+ * struct foo {
+ * int fielda, fieldb;
+ * // ...
+ * };
+ * struct info {
+ * int some_other_field;
+ * struct foo my_foo;
+ * };
+ *
+ * static struct info *foo_to_info(struct foo *foo)
+ * {
+ * size_t off = container_off(struct info, my_foo);
+ * return (void *)((char *)foo - off);
+ * }
+ */
+#define container_off(containing_type, member) \
+ offsetof(containing_type, member)
+
+/**
+ * container_of_var - get pointer to enclosing structure using a variable
+ * @member_ptr: pointer to the structure member
+ * @container_var: a pointer of same type as this member's container
+ * @member: the name of this member within the structure.
+ *
+ * Given a pointer to a member of a structure, this macro does pointer
+ * subtraction to return the pointer to the enclosing type.
+ *
+ * Example:
+ * static struct info *foo_to_i(struct foo *foo)
+ * {
+ * struct info *i = container_of_var(foo, i, my_foo);
+ * return i;
+ * }
+ */
+#if HAVE_TYPEOF
+#define container_of_var(member_ptr, container_var, member) \
+ container_of(member_ptr, typeof(*container_var), member)
+#else
+#define container_of_var(member_ptr, container_var, member) \
+ ((void *)((char *)(member_ptr) - \
+ container_off_var(container_var, member)))
+#endif
+
+/**
+ * container_off_var - get offset of a field in enclosing structure
+ * @container_var: a pointer to a container structure
+ * @member: the name of a member within the structure.
+ *
+ * Given (any) pointer to a structure and a its member name, this
+ * macro does pointer subtraction to return offset of member in a
+ * structure memory layout.
+ *
+ */
+#if HAVE_TYPEOF
+#define container_off_var(var, member) \
+ container_off(typeof(*var), member)
+#else
+#define container_off_var(var, member) \
+ ((const char *)&(var)->member - (const char *)(var))
+#endif
+
+#endif /* CCAN_CONTAINER_OF_H */
diff --git a/ccan/licenses/BSD-MIT b/ccan/licenses/BSD-MIT
new file mode 100644
index 0000000000..89de354795
--- /dev/null
+++ b/ccan/licenses/BSD-MIT
@@ -0,0 +1,17 @@
+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/ccan/licenses/CC0 b/ccan/licenses/CC0
new file mode 100644
index 0000000000..feb9b118e6
--- /dev/null
+++ b/ccan/licenses/CC0
@@ -0,0 +1,28 @@
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
+
+ the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
+ moral rights retained by the original author(s) and/or performer(s);
+ publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
+ rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
+ rights protecting the extraction, dissemination, use and reuse of data in a Work;
+ database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
+ other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
+ Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
+ Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
+ Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
diff --git a/ccan/list/list.h b/ccan/list/list.h
new file mode 100644
index 0000000000..ca9f9f1f7f
--- /dev/null
+++ b/ccan/list/list.h
@@ -0,0 +1,773 @@
+/* Licensed under BSD-MIT - see ccan/licenses/BSD-MIT file for details */
+#ifndef CCAN_LIST_H
+#define CCAN_LIST_H
+#include <assert.h>
+#include "ccan/str/str.h"
+#include "ccan/container_of/container_of.h"
+#include "ccan/check_type/check_type.h"
+
+/**
+ * struct list_node - an entry in a doubly-linked list
+ * @next: next entry (self if empty)
+ * @prev: previous entry (self if empty)
+ *
+ * This is used as an entry in a linked list.
+ * Example:
+ * struct child {
+ * const char *name;
+ * // Linked list of all us children.
+ * struct list_node list;
+ * };
+ */
+struct list_node
+{
+ struct list_node *next, *prev;
+};
+
+/**
+ * struct list_head - the head of a doubly-linked list
+ * @h: the list_head (containing next and prev pointers)
+ *
+ * This is used as the head of a linked list.
+ * Example:
+ * struct parent {
+ * const char *name;
+ * struct list_head children;
+ * unsigned int num_children;
+ * };
+ */
+struct list_head
+{
+ struct list_node n;
+};
+
+#define LIST_LOC __FILE__ ":" stringify(__LINE__)
+#define list_debug(h, loc) ((void)loc, h)
+#define list_debug_node(n, loc) ((void)loc, n)
+
+/**
+ * LIST_HEAD_INIT - initializer for an empty list_head
+ * @name: the name of the list.
+ *
+ * Explicit initializer for an empty list.
+ *
+ * See also:
+ * LIST_HEAD, list_head_init()
+ *
+ * Example:
+ * static struct list_head my_list = LIST_HEAD_INIT(my_list);
+ */
+#define LIST_HEAD_INIT(name) { { &name.n, &name.n } }
+
+/**
+ * LIST_HEAD - define and initialize an empty list_head
+ * @name: the name of the list.
+ *
+ * The LIST_HEAD macro defines a list_head and initializes it to an empty
+ * list. It can be prepended by "static" to define a static list_head.
+ *
+ * See also:
+ * LIST_HEAD_INIT, list_head_init()
+ *
+ * Example:
+ * static LIST_HEAD(my_global_list);
+ */
+#define LIST_HEAD(name) \
+ struct list_head name = LIST_HEAD_INIT(name)
+
+/**
+ * list_head_init - initialize a list_head
+ * @h: the list_head to set to the empty list
+ *
+ * Example:
+ * ...
+ * struct parent *parent = malloc(sizeof(*parent));
+ *
+ * list_head_init(&parent->children);
+ * parent->num_children = 0;
+ */
+static inline void list_head_init(struct list_head *h)
+{
+ h->n.next = h->n.prev = &h->n;
+}
+
+/**
+ * list_node_init - initialize a list_node
+ * @n: the list_node to link to itself.
+ *
+ * You don't need to use this normally! But it lets you list_del(@n)
+ * safely.
+ */
+static inline void list_node_init(struct list_node *n)
+{
+ n->next = n->prev = n;
+}
+
+/**
+ * list_add_after - add an entry after an existing node in a linked list
+ * @h: the list_head to add the node to (for debugging)
+ * @p: the existing list_node to add the node after
+ * @n: the new list_node to add to the list.
+ *
+ * The existing list_node must already be a member of the list.
+ * The new list_node does not need to be initialized; it will be overwritten.
+ *
+ * Example:
+ * struct child c1, c2, c3;
+ * LIST_HEAD(h);
+ *
+ * list_add_tail(&h, &c1.list);
+ * list_add_tail(&h, &c3.list);
+ * list_add_after(&h, &c1.list, &c2.list);
+ */
+#define list_add_after(h, p, n) list_add_after_(h, p, n, LIST_LOC)
+static inline void list_add_after_(struct list_head *h,
+ struct list_node *p,
+ struct list_node *n,
+ const char *abortstr)
+{
+ n->next = p->next;
+ n->prev = p;
+ p->next->prev = n;
+ p->next = n;
+ (void)list_debug(h, abortstr);
+}
+
+/**
+ * list_add - add an entry at the start of a linked list.
+ * @h: the list_head to add the node to
+ * @n: the list_node to add to the list.
+ *
+ * The list_node does not need to be initialized; it will be overwritten.
+ * Example:
+ * struct child *child = malloc(sizeof(*child));
+ *
+ * child->name = "marvin";
+ * list_add(&parent->children, &child->list);
+ * parent->num_children++;
+ */
+#define list_add(h, n) list_add_(h, n, LIST_LOC)
+static inline void list_add_(struct list_head *h,
+ struct list_node *n,
+ const char *abortstr)
+{
+ list_add_after_(h, &h->n, n, abortstr);
+}
+
+/**
+ * list_add_before - add an entry before an existing node in a linked list
+ * @h: the list_head to add the node to (for debugging)
+ * @p: the existing list_node to add the node before
+ * @n: the new list_node to add to the list.
+ *
+ * The existing list_node must already be a member of the list.
+ * The new list_node does not need to be initialized; it will be overwritten.
+ *
+ * Example:
+ * list_head_init(&h);
+ * list_add_tail(&h, &c1.list);
+ * list_add_tail(&h, &c3.list);
+ * list_add_before(&h, &c3.list, &c2.list);
+ */
+#define list_add_before(h, p, n) list_add_before_(h, p, n, LIST_LOC)
+static inline void list_add_before_(struct list_head *h,
+ struct list_node *p,
+ struct list_node *n,
+ const char *abortstr)
+{
+ n->next = p;
+ n->prev = p->prev;
+ p->prev->next = n;
+ p->prev = n;
+ (void)list_debug(h, abortstr);
+}
+
+/**
+ * list_add_tail - add an entry at the end of a linked list.
+ * @h: the list_head to add the node to
+ * @n: the list_node to add to the list.
+ *
+ * The list_node does not need to be initialized; it will be overwritten.
+ * Example:
+ * list_add_tail(&parent->children, &child->list);
+ * parent->num_children++;
+ */
+#define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)
+static inline void list_add_tail_(struct list_head *h,
+ struct list_node *n,
+ const char *abortstr)
+{
+ list_add_before_(h, &h->n, n, abortstr);
+}
+
+/**
+ * list_empty - is a list empty?
+ * @h: the list_head
+ *
+ * If the list is empty, returns true.
+ *
+ * Example:
+ * assert(list_empty(&parent->children) == (parent->num_children == 0));
+ */
+#define list_empty(h) list_empty_(h, LIST_LOC)
+static inline int list_empty_(const struct list_head *h, const char* abortstr)
+{
+ (void)list_debug(h, abortstr);
+ return h->n.next == &h->n;
+}
+
+/**
+ * list_empty_nodebug - is a list empty (and don't perform debug checks)?
+ * @h: the list_head
+ *
+ * If the list is empty, returns true.
+ * This differs from list_empty() in that if CCAN_LIST_DEBUG is set it
+ * will NOT perform debug checks. Only use this function if you REALLY
+ * know what you're doing.
+ *
+ * Example:
+ * assert(list_empty_nodebug(&parent->children) == (parent->num_children == 0));
+ */
+#ifndef CCAN_LIST_DEBUG
+#define list_empty_nodebug(h) list_empty(h)
+#else
+static inline int list_empty_nodebug(const struct list_head *h)
+{
+ return h->n.next == &h->n;
+}
+#endif
+
+/**
+ * list_del - delete an entry from an (unknown) linked list.
+ * @n: the list_node to delete from the list.
+ *
+ * Note that this leaves @n in an undefined state; it can be added to
+ * another list, but not deleted again.
+ *
+ * See also:
+ * list_del_from(), list_del_init()
+ *
+ * Example:
+ * list_del(&child->list);
+ * parent->num_children--;
+ */
+#define list_del(n) list_del_(n, LIST_LOC)
+static inline void list_del_(struct list_node *n, const char* abortstr)
+{
+ (void)list_debug_node(n, abortstr);
+ n->next->prev = n->prev;
+ n->prev->next = n->next;
+#ifdef CCAN_LIST_DEBUG
+ /* Catch use-after-del. */
+ n->next = n->prev = NULL;
+#endif
+}
+
+/**
+ * list_del_init - delete a node, and reset it so it can be deleted again.
+ * @n: the list_node to be deleted.
+ *
+ * list_del(@n) or list_del_init() again after this will be safe,
+ * which can be useful in some cases.
+ *
+ * See also:
+ * list_del_from(), list_del()
+ *
+ * Example:
+ * list_del_init(&child->list);
+ * parent->num_children--;
+ */
+#define list_del_init(n) list_del_init_(n, LIST_LOC)
+static inline void list_del_init_(struct list_node *n, const char *abortstr)
+{
+ list_del_(n, abortstr);
+ list_node_init(n);
+}
+
+/**
+ * list_del_from - delete an entry from a known linked list.
+ * @h: the list_head the node is in.
+ * @n: the list_node to delete from the list.
+ *
+ * This explicitly indicates which list a node is expected to be in,
+ * which is better documentation and can catch more bugs.
+ *
+ * See also: list_del()
+ *
+ * Example:
+ * list_del_from(&parent->children, &child->list);
+ * parent->num_children--;
+ */
+static inline void list_del_from(struct list_head *h, struct list_node *n)
+{
+#ifdef CCAN_LIST_DEBUG
+ {
+ /* Thorough check: make sure it was in list! */
+ struct list_node *i;
+ for (i = h->n.next; i != n; i = i->next)
+ assert(i != &h->n);
+ }
+#endif /* CCAN_LIST_DEBUG */
+
+ /* Quick test that catches a surprising number of bugs. */
+ assert(!list_empty(h));
+ list_del(n);
+}
+
+/**
+ * list_swap - swap out an entry from an (unknown) linked list for a new one.
+ * @o: the list_node to replace from the list.
+ * @n: the list_node to insert in place of the old one.
+ *
+ * Note that this leaves @o in an undefined state; it can be added to
+ * another list, but not deleted/swapped again.
+ *
+ * See also:
+ * list_del()
+ *
+ * Example:
+ * struct child x1, x2;
+ * LIST_HEAD(xh);
+ *
+ * list_add(&xh, &x1.list);
+ * list_swap(&x1.list, &x2.list);
+ */
+#define list_swap(o, n) list_swap_(o, n, LIST_LOC)
+static inline void list_swap_(struct list_node *o,
+ struct list_node *n,
+ const char* abortstr)
+{
+ (void)list_debug_node(o, abortstr);
+ *n = *o;
+ n->next->prev = n;
+ n->prev->next = n;
+#ifdef CCAN_LIST_DEBUG
+ /* Catch use-after-del. */
+ o->next = o->prev = NULL;
+#endif
+}
+
+/**
+ * list_entry - convert a list_node back into the structure containing it.
+ * @n: the list_node
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * Example:
+ * // First list entry is children.next; convert back to child.
+ * child = list_entry(parent->children.n.next, struct child, list);
+ *
+ * See Also:
+ * list_top(), list_for_each()
+ */
+#define list_entry(n, type, member) container_of(n, type, member)
+
+/**
+ * list_top - get the first entry in a list
+ * @h: the list_head
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * If the list is empty, returns NULL.
+ *
+ * Example:
+ * struct child *first;
+ * first = list_top(&parent->children, struct child, list);
+ * if (!first)
+ * printf("Empty list!\n");
+ */
+#define list_top(h, type, member) \
+ ((type *)list_top_((h), list_off_(type, member)))
+
+static inline const void *list_top_(const struct list_head *h, size_t off)
+{
+ if (list_empty(h))
+ return NULL;
+ return (const char *)h->n.next - off;
+}
+
+/**
+ * list_pop - remove the first entry in a list
+ * @h: the list_head
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * If the list is empty, returns NULL.
+ *
+ * Example:
+ * struct child *one;
+ * one = list_pop(&parent->children, struct child, list);
+ * if (!one)
+ * printf("Empty list!\n");
+ */
+#define list_pop(h, type, member) \
+ ((type *)list_pop_((h), list_off_(type, member)))
+
+static inline const void *list_pop_(const struct list_head *h, size_t off)
+{
+ struct list_node *n;
+
+ if (list_empty(h))
+ return NULL;
+ n = h->n.next;
+ list_del(n);
+ return (const char *)n - off;
+}
+
+/**
+ * list_tail - get the last entry in a list
+ * @h: the list_head
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * If the list is empty, returns NULL.
+ *
+ * Example:
+ * struct child *last;
+ * last = list_tail(&parent->children, struct child, list);
+ * if (!last)
+ * printf("Empty list!\n");
+ */
+#define list_tail(h, type, member) \
+ ((type *)list_tail_((h), list_off_(type, member)))
+
+static inline const void *list_tail_(const struct list_head *h, size_t off)
+{
+ if (list_empty(h))
+ return NULL;
+ return (const char *)h->n.prev - off;
+}
+
+/**
+ * list_for_each - iterate through a list.
+ * @h: the list_head (warning: evaluated multiple times!)
+ * @i: the structure containing the list_node
+ * @member: the list_node member of the structure
+ *
+ * This is a convenient wrapper to iterate @i over the entire list. It's
+ * a for loop, so you can break and continue as normal.
+ *
+ * Example:
+ * list_for_each(&parent->children, child, list)
+ * printf("Name: %s\n", child->name);
+ */
+#define list_for_each(h, i, member) \
+ list_for_each_off(h, i, list_off_var_(i, member))
+
+/**
+ * list_for_each_rev - iterate through a list backwards.
+ * @h: the list_head
+ * @i: the structure containing the list_node
+ * @member: the list_node member of the structure
+ *
+ * This is a convenient wrapper to iterate @i over the entire list. It's
+ * a for loop, so you can break and continue as normal.
+ *
+ * Example:
+ * list_for_each_rev(&parent->children, child, list)
+ * printf("Name: %s\n", child->name);
+ */
+#define list_for_each_rev(h, i, member) \
+ list_for_each_rev_off(h, i, list_off_var_(i, member))
+
+/**
+ * list_for_each_rev_safe - iterate through a list backwards,
+ * maybe during deletion
+ * @h: the list_head
+ * @i: the structure containing the list_node
+ * @nxt: the structure containing the list_node
+ * @member: the list_node member of the structure
+ *
+ * This is a convenient wrapper to iterate @i over the entire list backwards.
+ * It's a for loop, so you can break and continue as normal. The extra
+ * variable * @nxt is used to hold the next element, so you can delete @i
+ * from the list.
+ *
+ * Example:
+ * struct child *next;
+ * list_for_each_rev_safe(&parent->children, child, next, list) {
+ * printf("Name: %s\n", child->name);
+ * }
+ */
+#define list_for_each_rev_safe(h, i, nxt, member) \
+ list_for_each_rev_safe_off(h, i, nxt, list_off_var_(i, member))
+
+/**
+ * list_for_each_safe - iterate through a list, maybe during deletion
+ * @h: the list_head
+ * @i: the structure containing the list_node
+ * @nxt: the structure containing the list_node
+ * @member: the list_node member of the structure
+ *
+ * This is a convenient wrapper to iterate @i over the entire list. It's
+ * a for loop, so you can break and continue as normal. The extra variable
+ * @nxt is used to hold the next element, so you can delete @i from the list.
+ *
+ * Example:
+ * list_for_each_safe(&parent->children, child, next, list) {
+ * list_del(&child->list);
+ * parent->num_children--;
+ * }
+ */
+#define list_for_each_safe(h, i, nxt, member) \
+ list_for_each_safe_off(h, i, nxt, list_off_var_(i, member))
+
+/**
+ * list_next - get the next entry in a list
+ * @h: the list_head
+ * @i: a pointer to an entry in the list.
+ * @member: the list_node member of the structure
+ *
+ * If @i was the last entry in the list, returns NULL.
+ *
+ * Example:
+ * struct child *second;
+ * second = list_next(&parent->children, first, list);
+ * if (!second)
+ * printf("No second child!\n");
+ */
+#define list_next(h, i, member) \
+ ((list_typeof(i))list_entry_or_null(list_debug(h, \
+ __FILE__ ":" stringify(__LINE__)), \
+ (i)->member.next, \
+ list_off_var_((i), member)))
+
+/**
+ * list_prev - get the previous entry in a list
+ * @h: the list_head
+ * @i: a pointer to an entry in the list.
+ * @member: the list_node member of the structure
+ *
+ * If @i was the first entry in the list, returns NULL.
+ *
+ * Example:
+ * first = list_prev(&parent->children, second, list);
+ * if (!first)
+ * printf("Can't go back to first child?!\n");
+ */
+#define list_prev(h, i, member) \
+ ((list_typeof(i))list_entry_or_null(list_debug(h, \
+ __FILE__ ":" stringify(__LINE__)), \
+ (i)->member.prev, \
+ list_off_var_((i), member)))
+
+/**
+ * list_append_list - empty one list onto the end of another.
+ * @to: the list to append into
+ * @from: the list to empty.
+ *
+ * This takes the entire contents of @from and moves it to the end of
+ * @to. After this @from will be empty.
+ *
+ * Example:
+ * struct list_head adopter;
+ *
+ * list_append_list(&adopter, &parent->children);
+ * assert(list_empty(&parent->children));
+ * parent->num_children = 0;
+ */
+#define list_append_list(t, f) list_append_list_(t, f, \
+ __FILE__ ":" stringify(__LINE__))
+static inline void list_append_list_(struct list_head *to,
+ struct list_head *from,
+ const char *abortstr)
+{
+ struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
+ struct list_node *to_tail = list_debug(to, abortstr)->n.prev;
+
+ /* Sew in head and entire list. */
+ to->n.prev = from_tail;
+ from_tail->next = &to->n;
+ to_tail->next = &from->n;
+ from->n.prev = to_tail;
+
+ /* Now remove head. */
+ list_del(&from->n);
+ list_head_init(from);
+}
+
+/**
+ * list_prepend_list - empty one list into the start of another.
+ * @to: the list to prepend into
+ * @from: the list to empty.
+ *
+ * This takes the entire contents of @from and moves it to the start
+ * of @to. After this @from will be empty.
+ *
+ * Example:
+ * list_prepend_list(&adopter, &parent->children);
+ * assert(list_empty(&parent->children));
+ * parent->num_children = 0;
+ */
+#define list_prepend_list(t, f) list_prepend_list_(t, f, LIST_LOC)
+static inline void list_prepend_list_(struct list_head *to,
+ struct list_head *from,
+ const char *abortstr)
+{
+ struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
+ struct list_node *to_head = list_debug(to, abortstr)->n.next;
+
+ /* Sew in head and entire list. */
+ to->n.next = &from->n;
+ from->n.prev = &to->n;
+ to_head->prev = from_tail;
+ from_tail->next = to_head;
+
+ /* Now remove head. */
+ list_del(&from->n);
+ list_head_init(from);
+}
+
+/* internal macros, do not use directly */
+#define list_for_each_off_dir_(h, i, off, dir) \
+ for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.dir, \
+ (off)); \
+ list_node_from_off_((void *)i, (off)) != &(h)->n; \
+ i = list_node_to_off_(list_node_from_off_((void *)i, (off))->dir, \
+ (off)))
+
+#define list_for_each_safe_off_dir_(h, i, nxt, off, dir) \
+ for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.dir, \
+ (off)), \
+ nxt = list_node_to_off_(list_node_from_off_(i, (off))->dir, \
+ (off)); \
+ list_node_from_off_(i, (off)) != &(h)->n; \
+ i = nxt, \
+ nxt = list_node_to_off_(list_node_from_off_(i, (off))->dir, \
+ (off)))
+
+/**
+ * list_for_each_off - iterate through a list of memory regions.
+ * @h: the list_head
+ * @i: the pointer to a memory region wich contains list node data.
+ * @off: offset(relative to @i) at which list node data resides.
+ *
+ * This is a low-level wrapper to iterate @i over the entire list, used to
+ * implement all oher, more high-level, for-each constructs. It's a for loop,
+ * so you can break and continue as normal.
+ *
+ * WARNING! Being the low-level macro that it is, this wrapper doesn't know
+ * nor care about the type of @i. The only assumtion made is that @i points
+ * to a chunk of memory that at some @offset, relative to @i, contains a
+ * properly filled `struct node_list' which in turn contains pointers to
+ * memory chunks and it's turtles all the way down. Whith all that in mind
+ * remember that given the wrong pointer/offset couple this macro will
+ * happilly churn all you memory untill SEGFAULT stops it, in other words
+ * caveat emptor.
+ *
+ * It is worth mentioning that one of legitimate use-cases for that wrapper
+ * is operation on opaque types with known offset for `struct list_node'
+ * member(preferably 0), because it allows you not to disclose the type of
+ * @i.
+ *
+ * Example:
+ * list_for_each_off(&parent->children, child,
+ * offsetof(struct child, list))
+ * printf("Name: %s\n", child->name);
+ */
+#define list_for_each_off(h, i, off) \
+ list_for_each_off_dir_((h),(i),(off),next)
+
+/**
+ * list_for_each_rev_off - iterate through a list of memory regions backwards
+ * @h: the list_head
+ * @i: the pointer to a memory region wich contains list node data.
+ * @off: offset(relative to @i) at which list node data resides.
+ *
+ * See list_for_each_off for details
+ */
+#define list_for_each_rev_off(h, i, off) \
+ list_for_each_off_dir_((h),(i),(off),prev)
+
+/**
+ * list_for_each_safe_off - iterate through a list of memory regions, maybe
+ * during deletion
+ * @h: the list_head
+ * @i: the pointer to a memory region wich contains list node data.
+ * @nxt: the structure containing the list_node
+ * @off: offset(relative to @i) at which list node data resides.
+ *
+ * For details see `list_for_each_off' and `list_for_each_safe'
+ * descriptions.
+ *
+ * Example:
+ * list_for_each_safe_off(&parent->children, child,
+ * next, offsetof(struct child, list))
+ * printf("Name: %s\n", child->name);
+ */
+#define list_for_each_safe_off(h, i, nxt, off) \
+ list_for_each_safe_off_dir_((h),(i),(nxt),(off),next)
+
+/**
+ * list_for_each_rev_safe_off - iterate backwards through a list of
+ * memory regions, maybe during deletion
+ * @h: the list_head
+ * @i: the pointer to a memory region wich contains list node data.
+ * @nxt: the structure containing the list_node
+ * @off: offset(relative to @i) at which list node data resides.
+ *
+ * For details see `list_for_each_rev_off' and `list_for_each_rev_safe'
+ * descriptions.
+ *
+ * Example:
+ * list_for_each_rev_safe_off(&parent->children, child,
+ * next, offsetof(struct child, list))
+ * printf("Name: %s\n", child->name);
+ */
+#define list_for_each_rev_safe_off(h, i, nxt, off) \
+ list_for_each_safe_off_dir_((h),(i),(nxt),(off),prev)
+
+/* Other -off variants. */
+#define list_entry_off(n, type, off) \
+ ((type *)list_node_from_off_((n), (off)))
+
+#define list_head_off(h, type, off) \
+ ((type *)list_head_off((h), (off)))
+
+#define list_tail_off(h, type, off) \
+ ((type *)list_tail_((h), (off)))
+
+#define list_add_off(h, n, off) \
+ list_add((h), list_node_from_off_((n), (off)))
+
+#define list_del_off(n, off) \
+ list_del(list_node_from_off_((n), (off)))
+
+#define list_del_from_off(h, n, off) \
+ list_del_from(h, list_node_from_off_((n), (off)))
+
+/* Offset helper functions so we only single-evaluate. */
+static inline void *list_node_to_off_(struct list_node *node, size_t off)
+{
+ return (void *)((char *)node - off);
+}
+static inline struct list_node *list_node_from_off_(void *ptr, size_t off)
+{
+ return (struct list_node *)((char *)ptr + off);
+}
+
+/* Get the offset of the member, but make sure it's a list_node. */
+#define list_off_(type, member) \
+ (container_off(type, member) + \
+ check_type(((type *)0)->member, struct list_node))
+
+#define list_off_var_(var, member) \
+ (container_off_var(var, member) + \
+ check_type(var->member, struct list_node))
+
+#if HAVE_TYPEOF
+#define list_typeof(var) typeof(var)
+#else
+#define list_typeof(var) void *
+#endif
+
+/* Returns member, or NULL if at end of list. */
+static inline void *list_entry_or_null(const struct list_head *h,
+ const struct list_node *n,
+ size_t off)
+{
+ if (n == &h->n)
+ return NULL;
+ return (char *)n - off;
+}
+#endif /* CCAN_LIST_H */
diff --git a/ccan/str/str.h b/ccan/str/str.h
new file mode 100644
index 0000000000..9a9da9cd3f
--- /dev/null
+++ b/ccan/str/str.h
@@ -0,0 +1,16 @@
+/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
+#ifndef CCAN_STR_H
+#define CCAN_STR_H
+/**
+ * stringify - Turn expression into a string literal
+ * @expr: any C expression
+ *
+ * Example:
+ * #define PRINT_COND_IF_FALSE(cond) \
+ * ((cond) || printf("%s is false!", stringify(cond)))
+ */
+#define stringify(expr) stringify_1(expr)
+/* Double-indirection required to stringify expansions */
+#define stringify_1(expr) #expr
+
+#endif /* CCAN_STR_H */
diff --git a/class.c b/class.c
index e161e25063..cb69ffe2b3 100644
--- a/class.c
+++ b/class.c
@@ -23,17 +23,13 @@
* \{
*/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/st.h"
-#include "method.h"
#include "constant.h"
#include "vm_core.h"
-#include "internal.h"
+#include "id_table.h"
#include <ctype.h>
-int rb_vm_add_root_module(ID id, VALUE module);
-
-
#define id_attached id__attached__
void
@@ -42,7 +38,7 @@ rb_class_subclass_add(VALUE super, VALUE klass)
rb_subclass_entry_t *entry, *head;
if (super && super != Qundef) {
- entry = malloc(sizeof(*entry));
+ entry = ALLOC(rb_subclass_entry_t);
entry->klass = klass;
entry->next = NULL;
@@ -62,7 +58,7 @@ rb_module_add_to_subclasses_list(VALUE module, VALUE iclass)
{
rb_subclass_entry_t *entry, *head;
- entry = malloc(sizeof(*entry));
+ entry = ALLOC(rb_subclass_entry_t);
entry->klass = iclass;
entry->next = NULL;
@@ -88,7 +84,7 @@ rb_class_remove_from_super_subclasses(VALUE klass)
if (entry->next) {
RCLASS_EXT(entry->next->klass)->parent_subclasses = RCLASS_EXT(klass)->parent_subclasses;
}
- free(entry);
+ xfree(entry);
}
RCLASS_EXT(klass)->parent_subclasses = NULL;
@@ -107,14 +103,14 @@ rb_class_remove_from_module_subclasses(VALUE klass)
RCLASS_EXT(entry->next->klass)->module_subclasses = RCLASS_EXT(klass)->module_subclasses;
}
- free(entry);
+ xfree(entry);
}
RCLASS_EXT(klass)->module_subclasses = NULL;
}
void
-rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE))
+rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE arg)
{
rb_subclass_entry_t *cur = RCLASS_EXT(klass)->subclasses;
@@ -123,20 +119,32 @@ rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE))
while (cur) {
VALUE curklass = cur->klass;
cur = cur->next;
- f(curklass);
+ f(curklass, arg);
}
}
+static void
+class_detach_subclasses(VALUE klass, VALUE arg)
+{
+ rb_class_remove_from_super_subclasses(klass);
+}
+
void
rb_class_detach_subclasses(VALUE klass)
{
- rb_class_foreach_subclass(klass, rb_class_remove_from_super_subclasses);
+ rb_class_foreach_subclass(klass, class_detach_subclasses, Qnil);
+}
+
+static void
+class_detach_module_subclasses(VALUE klass, VALUE arg)
+{
+ rb_class_remove_from_module_subclasses(klass);
}
void
rb_class_detach_module_subclasses(VALUE klass)
{
- rb_class_foreach_subclass(klass, rb_class_remove_from_module_subclasses);
+ rb_class_foreach_subclass(klass, class_detach_module_subclasses, Qnil);
}
/**
@@ -154,25 +162,31 @@ rb_class_detach_module_subclasses(VALUE klass)
static VALUE
class_alloc(VALUE flags, VALUE klass)
{
- NEWOBJ_OF(obj, struct RClass, klass, (flags & T_MASK) | (RGENGC_WB_PROTECTED_CLASS ? FL_WB_PROTECTED : 0));
- obj->ptr = ALLOC(rb_classext_t);
- RCLASS_IV_TBL(obj) = 0;
- RCLASS_CONST_TBL(obj) = 0;
- RCLASS_M_TBL_WRAPPER(obj) = 0;
- RCLASS_SET_SUPER((VALUE)obj, 0);
- RCLASS_ORIGIN(obj) = (VALUE)obj;
- RCLASS_IV_INDEX_TBL(obj) = 0;
-
- RCLASS_EXT(obj)->subclasses = NULL;
- RCLASS_EXT(obj)->parent_subclasses = NULL;
- RCLASS_EXT(obj)->module_subclasses = NULL;
+ NEWOBJ_OF(obj, struct RClass, klass, (flags & T_MASK) | FL_PROMOTED1 /* start from age == 2 */ | (RGENGC_WB_PROTECTED_CLASS ? FL_WB_PROTECTED : 0));
+ obj->ptr = ZALLOC(rb_classext_t);
+ /* ZALLOC
+ RCLASS_IV_TBL(obj) = 0;
+ RCLASS_CONST_TBL(obj) = 0;
+ RCLASS_M_TBL(obj) = 0;
+ RCLASS_IV_INDEX_TBL(obj) = 0;
+ RCLASS_SET_SUPER((VALUE)obj, 0);
+ RCLASS_EXT(obj)->subclasses = NULL;
+ RCLASS_EXT(obj)->parent_subclasses = NULL;
+ RCLASS_EXT(obj)->module_subclasses = NULL;
+ */
+ RCLASS_SET_ORIGIN((VALUE)obj, (VALUE)obj);
RCLASS_SERIAL(obj) = rb_next_class_serial();
-
RCLASS_REFINED_CLASS(obj) = Qnil;
RCLASS_EXT(obj)->allocator = 0;
+
return (VALUE)obj;
}
+static void
+RCLASS_M_TBL_INIT(VALUE c)
+{
+ RCLASS_M_TBL(c) = rb_id_table_create(0);
+}
/*!
* A utility function that wraps class_alloc.
@@ -206,8 +220,8 @@ void
rb_check_inheritable(VALUE super)
{
if (!RB_TYPE_P(super, T_CLASS)) {
- rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
- rb_obj_classname(super));
+ rb_raise(rb_eTypeError, "superclass must be a Class (%"PRIsVALUE" given)",
+ rb_obj_class(super));
}
if (RBASIC(super)->flags & FL_SINGLETON) {
rb_raise(rb_eTypeError, "can't make subclass of singleton class");
@@ -233,48 +247,29 @@ rb_class_new(VALUE super)
}
static void
-rewrite_cref_stack(NODE *node, VALUE old_klass, VALUE new_klass, NODE **new_cref_ptr)
-{
- NODE *new_node;
- while (node) {
- if (node->nd_clss == old_klass) {
- new_node = NEW_CREF(new_klass);
- RB_OBJ_WRITE(new_node, &new_node->nd_next, node->nd_next);
- *new_cref_ptr = new_node;
- return;
- }
- new_node = NEW_CREF(node->nd_clss);
- node = node->nd_next;
- *new_cref_ptr = new_node;
- new_cref_ptr = &new_node->nd_next;
- }
- *new_cref_ptr = NULL;
-}
-
-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;
- NODE *new_cref;
- newiseqval = rb_iseq_clone(me->def->body.iseq->self, klass);
- GetISeqPtr(newiseqval, iseq);
- rewrite_cref_stack(me->def->body.iseq->cref_stack, me->klass, klass, &new_cref);
- RB_OBJ_WRITE(iseq->self, &iseq->cref_stack, new_cref);
- rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
- RB_GC_GUARD(newiseqval);
+clone_method(VALUE old_klass, VALUE new_klass, ID mid, const rb_method_entry_t *me)
+{
+ if (me->def->type == VM_METHOD_TYPE_ISEQ) {
+ rb_cref_t *new_cref;
+ rb_vm_rewrite_cref(me->def->body.iseq.cref, old_klass, new_klass, &new_cref);
+ rb_add_method_iseq(new_klass, mid, me->def->body.iseq.iseqptr, new_cref, METHOD_ENTRY_VISI(me));
}
else {
- rb_method_entry_set(klass, mid, me, me->flag);
+ rb_method_entry_set(new_klass, mid, me, METHOD_ENTRY_VISI(me));
}
}
-static int
-clone_method_i(st_data_t key, st_data_t value, st_data_t data)
+struct clone_method_arg {
+ VALUE new_klass;
+ VALUE old_klass;
+};
+
+static enum rb_id_table_iterator_result
+clone_method_i(ID key, VALUE value, void *data)
{
- clone_method((VALUE)data, (ID)key, (const rb_method_entry_t *)value);
- return ST_CONTINUE;
+ const struct clone_method_arg *arg = (struct clone_method_arg *)data;
+ clone_method(arg->old_klass, arg->new_klass, key, (const rb_method_entry_t *)value);
+ return ID_TABLE_CONTINUE;
}
struct clone_const_arg {
@@ -321,19 +316,25 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
if (RB_TYPE_P(clone, T_CLASS)) {
class_init_copy_check(clone, orig);
}
- rb_obj_init_copy(clone, orig);
+ if (!OBJ_INIT_COPY(clone, orig)) return clone;
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
RBASIC_SET_CLASS(clone, rb_singleton_class_clone(orig));
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
}
RCLASS_SET_SUPER(clone, RCLASS_SUPER(orig));
RCLASS_EXT(clone)->allocator = RCLASS_EXT(orig)->allocator;
+ if (RCLASS_IV_TBL(clone)) {
+ st_free_table(RCLASS_IV_TBL(clone));
+ RCLASS_IV_TBL(clone) = 0;
+ }
+ if (RCLASS_CONST_TBL(clone)) {
+ rb_free_const_table(RCLASS_CONST_TBL(clone));
+ RCLASS_CONST_TBL(clone) = 0;
+ }
+ RCLASS_M_TBL(clone) = 0;
if (RCLASS_IV_TBL(orig)) {
st_data_t id;
- if (RCLASS_IV_TBL(clone)) {
- st_free_table(RCLASS_IV_TBL(clone));
- }
RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(orig));
CONST_ID(id, "__tmp_classpath__");
st_delete(RCLASS_IV_TBL(clone), &id, 0);
@@ -344,20 +345,18 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
}
if (RCLASS_CONST_TBL(orig)) {
struct clone_const_arg arg;
- if (RCLASS_CONST_TBL(clone)) {
- rb_free_const_table(RCLASS_CONST_TBL(clone));
- }
+
RCLASS_CONST_TBL(clone) = st_init_numtable();
arg.klass = clone;
arg.tbl = RCLASS_CONST_TBL(clone);
st_foreach(RCLASS_CONST_TBL(orig), clone_const_i, (st_data_t)&arg);
}
if (RCLASS_M_TBL(orig)) {
- if (RCLASS_M_TBL_WRAPPER(clone)) {
- rb_free_m_tbl_wrapper(RCLASS_M_TBL_WRAPPER(clone));
- }
+ struct clone_method_arg arg;
+ arg.old_klass = orig;
+ arg.new_klass = clone;
RCLASS_M_TBL_INIT(clone);
- st_foreach(RCLASS_M_TBL(orig), clone_method_i, (st_data_t)clone);
+ rb_id_table_foreach(RCLASS_M_TBL(orig), clone_method_i, &arg);
}
return clone;
@@ -372,7 +371,7 @@ rb_singleton_class_clone(VALUE obj)
VALUE
rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
{
- VALUE klass = RBASIC(obj)->klass;
+ const VALUE klass = RBASIC(obj)->klass;
if (!FL_TEST(klass, FL_SINGLETON))
return klass;
@@ -403,7 +402,12 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
rb_singleton_class_attached(clone, attach);
}
RCLASS_M_TBL_INIT(clone);
- st_foreach(RCLASS_M_TBL(klass), clone_method_i, (st_data_t)clone);
+ {
+ struct clone_method_arg arg;
+ arg.old_klass = klass;
+ arg.new_klass = clone;
+ rb_id_table_foreach(RCLASS_M_TBL(klass), clone_method_i, &arg);
+ }
rb_singleton_class_attached(RBASIC(clone)->klass, clone);
FL_SET(clone, FL_SINGLETON);
@@ -422,7 +426,7 @@ rb_singleton_class_attached(VALUE klass, VALUE obj)
if (!RCLASS_IV_TBL(klass)) {
RCLASS_IV_TBL(klass) = st_init_numtable();
}
- rb_st_insert_id_and_value(klass, RCLASS_IV_TBL(klass), id_attached, obj);
+ rb_class_ivar_set(klass, id_attached, obj);
}
}
@@ -438,6 +442,19 @@ rb_singleton_class_attached(VALUE klass, VALUE obj)
*/
#define META_CLASS_OF_CLASS_CLASS_P(k) (METACLASS_OF(k) == (k))
+static int
+rb_singleton_class_has_metaclass_p(VALUE sklass)
+{
+ return rb_attr_get(METACLASS_OF(sklass), id_attached) == sklass;
+}
+
+int
+rb_singleton_class_internal_p(VALUE sklass)
+{
+ return (RB_TYPE_P(rb_attr_get(sklass, id_attached), T_CLASS) &&
+ !rb_singleton_class_has_metaclass_p(sklass));
+}
+
/*!
* whether k has a metaclass
* @retval 1 if \a k has a metaclass
@@ -445,7 +462,7 @@ rb_singleton_class_attached(VALUE klass, VALUE obj)
*/
#define HAVE_METACLASS_P(k) \
(FL_TEST(METACLASS_OF(k), FL_SINGLETON) && \
- rb_ivar_get(METACLASS_OF(k), id_attached) == (k))
+ rb_singleton_class_has_metaclass_p(k))
/*!
* ensures \a klass belongs to its own eigenclass.
@@ -532,10 +549,11 @@ Init_class_hierarchy(void)
{
rb_cBasicObject = boot_defclass("BasicObject", 0);
rb_cObject = boot_defclass("Object", rb_cBasicObject);
+ rb_gc_register_mark_object(rb_cObject);
rb_cModule = boot_defclass("Module", rb_cObject);
rb_cClass = boot_defclass("Class", rb_cModule);
- rb_const_set(rb_cObject, rb_intern("BasicObject"), rb_cBasicObject);
+ rb_const_set(rb_cObject, rb_intern_const("BasicObject"), rb_cBasicObject);
RBASIC_SET_CLASS(rb_cClass, rb_cClass);
RBASIC_SET_CLASS(rb_cModule, rb_cClass);
RBASIC_SET_CLASS(rb_cObject, rb_cClass);
@@ -632,7 +650,8 @@ rb_define_class(const char *name, VALUE super)
if (rb_const_defined(rb_cObject, id)) {
klass = rb_const_get(rb_cObject, id);
if (!RB_TYPE_P(klass, T_CLASS)) {
- rb_raise(rb_eTypeError, "%s is not a class", name);
+ rb_raise(rb_eTypeError, "%s is not a class (%"PRIsVALUE")",
+ name, rb_obj_class(klass));
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
rb_raise(rb_eTypeError, "superclass mismatch for class %s", name);
@@ -661,7 +680,7 @@ rb_define_class(const char *name, VALUE super)
* \return the created class
* \throw TypeError if the constant name \a name is already taken but
* the constant is not a \c Class.
- * \throw NameError if the class is already defined but the class can not
+ * \throw TypeError if the class is already defined but the class can not
* be reopened because its superclass is not \a super.
* \post top-level constant named \a name refers the returned class.
*
@@ -684,7 +703,7 @@ rb_define_class_under(VALUE outer, const char *name, VALUE super)
* \return the created class
* \throw TypeError if the constant name \a name is already taken but
* the constant is not a \c Class.
- * \throw NameError if the class is already defined but the class can not
+ * \throw TypeError if the class is already defined but the class can not
* be reopened because its superclass is not \a super.
* \post top-level constant named \a name refers the returned class.
*
@@ -699,16 +718,21 @@ 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 (!RB_TYPE_P(klass, T_CLASS)) {
- rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
+ rb_raise(rb_eTypeError, "%"PRIsVALUE"::%"PRIsVALUE" is not a class"
+ " (%"PRIsVALUE")",
+ outer, rb_id2str(id), rb_obj_class(klass));
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
- rb_name_error(id, "%s is already defined", rb_id2name(id));
+ rb_raise(rb_eTypeError, "superclass mismatch for class "
+ "%"PRIsVALUE"::%"PRIsVALUE""
+ " (%"PRIsVALUE" is given but was %"PRIsVALUE")",
+ outer, rb_id2str(id), RCLASS_SUPER(klass), super);
}
return klass;
}
if (!super) {
- rb_warn("no super class for `%s::%s', Object assumed",
- rb_class2name(outer), rb_id2name(id));
+ rb_warn("no super class for `%"PRIsVALUE"::%"PRIsVALUE"', Object assumed",
+ rb_class_path(outer), rb_id2str(id));
}
klass = rb_define_class_id(id, super);
rb_set_class_path_string(klass, outer, rb_id2str(id));
@@ -747,9 +771,11 @@ 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 (RB_TYPE_P(module, T_MODULE))
- return module;
- rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
+ if (!RB_TYPE_P(module, T_MODULE)) {
+ rb_raise(rb_eTypeError, "%s is not a module (%"PRIsVALUE")",
+ name, rb_obj_class(module));
+ }
+ return module;
}
module = rb_define_module_id(id);
rb_vm_add_root_module(id, module);
@@ -771,10 +797,12 @@ rb_define_module_id_under(VALUE outer, ID id)
if (rb_const_defined_at(outer, id)) {
module = rb_const_get_at(outer, id);
- 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));
+ if (!RB_TYPE_P(module, T_MODULE)) {
+ rb_raise(rb_eTypeError, "%"PRIsVALUE"::%"PRIsVALUE" is not a module"
+ " (%"PRIsVALUE")",
+ outer, rb_id2str(id), rb_obj_class(module));
+ }
+ return module;
}
module = rb_define_module_id(id);
rb_const_set(outer, id, module);
@@ -801,8 +829,8 @@ rb_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_WRAPPER(OBJ_WB_UNPROTECT(klass)) =
- RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(RCLASS_ORIGIN(module)));
+ RCLASS_M_TBL(OBJ_WB_UNPROTECT(klass)) =
+ RCLASS_M_TBL(OBJ_WB_UNPROTECT(RCLASS_ORIGIN(module))); /* TODO: unprotected? */
RCLASS_SET_SUPER(klass, super);
if (RB_TYPE_P(module, T_ICLASS)) {
@@ -817,39 +845,44 @@ rb_include_class_new(VALUE module, VALUE super)
return (VALUE)klass;
}
-static int include_modules_at(const VALUE klass, VALUE c, VALUE module);
+static int include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super);
+
+static void
+ensure_includable(VALUE klass, VALUE module)
+{
+ rb_frozen_class_p(klass);
+ Check_Type(module, T_MODULE);
+ if (!NIL_P(rb_refinement_module_get_refined_class(module))) {
+ rb_raise(rb_eArgError, "refinement module is not allowed");
+ }
+ OBJ_INFECT(klass, module);
+}
void
rb_include_module(VALUE klass, VALUE module)
{
int changed = 0;
- rb_frozen_class_p(klass);
-
- if (!RB_TYPE_P(module, T_MODULE)) {
- Check_Type(module, T_MODULE);
- }
+ ensure_includable(klass, module);
- OBJ_INFECT(klass, module);
-
- changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module);
+ changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module, TRUE);
if (changed < 0)
rb_raise(rb_eArgError, "cyclic include detected");
}
-static int
-add_refined_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
+static enum rb_id_table_iterator_result
+add_refined_method_entry_i(ID key, VALUE value, void *data)
{
- rb_add_refined_method_entry((VALUE) data, (ID) key);
- return ST_CONTINUE;
+ rb_add_refined_method_entry((VALUE)data, key);
+ return ID_TABLE_CONTINUE;
}
static int
-include_modules_at(const VALUE klass, VALUE c, VALUE module)
+include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super)
{
VALUE p, iclass;
int method_changed = 0, constant_changed = 0;
- const st_table *const klass_m_tbl = RCLASS_M_TBL(RCLASS_ORIGIN(klass));
+ struct rb_id_table *const klass_m_tbl = RCLASS_M_TBL(RCLASS_ORIGIN(klass));
while (module) {
int superclass_seen = FALSE;
@@ -860,41 +893,38 @@ include_modules_at(const VALUE klass, VALUE c, VALUE 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)) {
- case T_ICLASS:
- if (RCLASS_M_TBL_WRAPPER(p) == RCLASS_M_TBL_WRAPPER(module)) {
+ int type = BUILTIN_TYPE(p);
+ if (type == T_ICLASS) {
+ if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
if (!superclass_seen) {
c = p; /* move insertion point */
}
goto skip;
}
- break;
- case T_CLASS:
+ }
+ else if (type == T_CLASS) {
+ if (!search_super) break;
superclass_seen = TRUE;
- break;
}
}
iclass = rb_include_class_new(module, RCLASS_SUPER(c));
c = RCLASS_SET_SUPER(c, iclass);
- if (BUILTIN_TYPE(module) == T_ICLASS) {
- rb_module_add_to_subclasses_list(RBASIC(module)->klass, iclass);
- } else {
- rb_module_add_to_subclasses_list(module, iclass);
+ {
+ VALUE m = module;
+ if (BUILTIN_TYPE(m) == T_ICLASS) m = RBASIC(m)->klass;
+ rb_module_add_to_subclasses_list(m, iclass);
}
if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) {
VALUE refined_class =
rb_refinement_module_get_refined_class(klass);
- st_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i,
- (st_data_t) refined_class);
+ rb_id_table_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i, (void *)refined_class);
FL_SET(c, RMODULE_INCLUDED_INTO_REFINEMENT);
}
- if (RMODULE_M_TBL(module) && RMODULE_M_TBL(module)->num_entries)
- method_changed = 1;
- if (RMODULE_CONST_TBL(module) && RMODULE_CONST_TBL(module)->num_entries)
- constant_changed = 1;
+ if (RMODULE_M_TBL(module) && rb_id_table_size(RMODULE_M_TBL(module))) method_changed = 1;
+ if (RMODULE_CONST_TBL(module) && RMODULE_CONST_TBL(module)->num_entries) constant_changed = 1;
skip:
module = RCLASS_SUPER(module);
}
@@ -905,59 +935,53 @@ include_modules_at(const VALUE klass, VALUE c, VALUE module)
return method_changed;
}
-static int
-move_refined_method(st_data_t key, st_data_t value, st_data_t data)
+static enum rb_id_table_iterator_result
+move_refined_method(ID key, VALUE value, void *data)
{
rb_method_entry_t *me = (rb_method_entry_t *) value;
- st_table *tbl = (st_table *) data;
+ VALUE klass = (VALUE)data;
+ struct rb_id_table *tbl = RCLASS_M_TBL(klass);
if (me->def->type == VM_METHOD_TYPE_REFINED) {
- if (me->def->body.orig_me) {
- rb_method_entry_t *orig_me = me->def->body.orig_me, *new_me;
- me->def->body.orig_me = NULL;
- new_me = ALLOC(rb_method_entry_t);
- *new_me = *me;
- st_add_direct(tbl, key, (st_data_t) new_me);
- *me = *orig_me;
- xfree(orig_me);
- return ST_CONTINUE;
+ if (me->def->body.refined.orig_me) {
+ const rb_method_entry_t *orig_me = me->def->body.refined.orig_me, *new_me;
+ RB_OBJ_WRITE(me, &me->def->body.refined.orig_me, NULL);
+ new_me = rb_method_entry_clone(me);
+ rb_id_table_insert(tbl, key, (VALUE)new_me);
+ RB_OBJ_WRITTEN(klass, Qundef, new_me);
+ rb_method_entry_copy(me, orig_me);
+ return ID_TABLE_CONTINUE;
}
else {
- st_add_direct(tbl, key, (st_data_t) me);
- return ST_DELETE;
+ rb_id_table_insert(tbl, key, (VALUE)me);
+ return ID_TABLE_DELETE;
}
}
else {
- return ST_CONTINUE;
+ return ID_TABLE_CONTINUE;
}
}
void
rb_prepend_module(VALUE klass, VALUE module)
{
- void rb_vm_check_redefinition_by_prepend(VALUE klass);
VALUE origin;
int changed = 0;
- rb_frozen_class_p(klass);
-
- Check_Type(module, T_MODULE);
-
- OBJ_INFECT(klass, module);
+ ensure_includable(klass, module);
origin = RCLASS_ORIGIN(klass);
if (origin == klass) {
origin = class_alloc(T_ICLASS, klass);
- OBJ_WB_UNPROTECT(origin); /* TODO: conservertive shading. Need more survery. */
+ OBJ_WB_UNPROTECT(origin); /* TODO: conservative shading. Need more survey. */
RCLASS_SET_SUPER(origin, RCLASS_SUPER(klass));
RCLASS_SET_SUPER(klass, origin);
- RCLASS_ORIGIN(klass) = origin;
- RCLASS_M_TBL_WRAPPER(origin) = RCLASS_M_TBL_WRAPPER(klass);
+ RCLASS_SET_ORIGIN(klass, origin);
+ RCLASS_M_TBL(origin) = RCLASS_M_TBL(klass);
RCLASS_M_TBL_INIT(klass);
- st_foreach(RCLASS_M_TBL(origin), move_refined_method,
- (st_data_t) RCLASS_M_TBL(klass));
+ rb_id_table_foreach(RCLASS_M_TBL(origin), move_refined_method, (void *)klass);
}
- changed = include_modules_at(klass, klass, module);
+ changed = include_modules_at(klass, klass, module, FALSE);
if (changed < 0)
rb_raise(rb_eArgError, "cyclic prepend detected");
if (changed) {
@@ -1036,16 +1060,18 @@ rb_mod_include_p(VALUE mod, VALUE mod2)
* call-seq:
* mod.ancestors -> array
*
- * Returns a list of modules included in <i>mod</i> (including
- * <i>mod</i> itself).
+ * Returns a list of modules included/prepended in <i>mod</i>
+ * (including <i>mod</i> itself).
*
* module Mod
* include Math
* include Comparable
+ * prepend Enumerable
* end
*
- * Mod.ancestors #=> [Mod, Comparable, Math]
- * Math.ancestors #=> [Math]
+ * Mod.ancestors #=> [Enumerable, Mod, Comparable, Math]
+ * Math.ancestors #=> [Math]
+ * Enumerable.ancestors #=> [Enumerable]
*/
VALUE
@@ -1064,83 +1090,84 @@ rb_mod_ancestors(VALUE mod)
return ary;
}
-#define VISI(x) ((x)&NOEX_MASK)
-#define VISI_CHECK(x,f) (VISI(x) == (f))
-
static int
-ins_methods_push(ID name, long type, VALUE ary, long visi)
+ins_methods_push(ID name, rb_method_visibility_t visi, VALUE ary, rb_method_visibility_t expected_visi)
{
- if (type == -1) return ST_CONTINUE;
+ if (visi == METHOD_VISI_UNDEF) return ST_CONTINUE;
- switch (visi) {
- case NOEX_PRIVATE:
- case NOEX_PROTECTED:
- case NOEX_PUBLIC:
- visi = (type == visi);
+ switch (expected_visi) {
+ case METHOD_VISI_UNDEF:
+ if (visi != METHOD_VISI_PRIVATE) rb_ary_push(ary, ID2SYM(name));
break;
- default:
- visi = (type != NOEX_PRIVATE);
+ case METHOD_VISI_PRIVATE:
+ case METHOD_VISI_PROTECTED:
+ case METHOD_VISI_PUBLIC:
+ if (visi == expected_visi) rb_ary_push(ary, ID2SYM(name));
break;
}
- if (visi) {
- rb_ary_push(ary, ID2SYM(name));
- }
return ST_CONTINUE;
}
static int
ins_methods_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (long)type, (VALUE)ary, -1); /* everything but private */
+ return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_UNDEF); /* everything but private */
}
static int
ins_methods_prot_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PROTECTED);
+ return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_PROTECTED);
}
static int
ins_methods_priv_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PRIVATE);
+ return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_PRIVATE);
}
static int
ins_methods_pub_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PUBLIC);
+ return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_PUBLIC);
}
-static int
-method_entry_i(st_data_t key, st_data_t value, st_data_t data)
+struct method_entry_arg {
+ st_table *list;
+ int recur;
+};
+
+static enum rb_id_table_iterator_result
+method_entry_i(ID key, VALUE value, void *data)
{
const rb_method_entry_t *me = (const rb_method_entry_t *)value;
- st_table *list = (st_table *)data;
- long type;
+ struct method_entry_arg *arg = (struct method_entry_arg *)data;
+ rb_method_visibility_t type;
- if (me && me->def->type == VM_METHOD_TYPE_REFINED) {
- me = rb_resolve_refined_method(Qnil, me, NULL);
- if (!me) return ST_CONTINUE;
+ if (me->def->type == VM_METHOD_TYPE_REFINED) {
+ VALUE owner = me->owner;
+ me = rb_resolve_refined_method(Qnil, me);
+ if (!me) return ID_TABLE_CONTINUE;
+ if (!arg->recur && me->owner != owner) return ID_TABLE_CONTINUE;
}
- if (!st_lookup(list, key, 0)) {
+ if (!st_lookup(arg->list, key, 0)) {
if (UNDEFINED_METHOD_ENTRY_P(me)) {
- type = -1; /* none */
+ type = METHOD_VISI_UNDEF; /* none */
}
else {
- type = VISI(me->flag);
+ type = METHOD_ENTRY_VISI(me);
}
- st_add_direct(list, key, type);
+ st_add_direct(arg->list, key, (st_data_t)type);
}
- return ST_CONTINUE;
+ return ID_TABLE_CONTINUE;
}
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))
+class_instance_method_list(int argc, const VALUE *argv, VALUE mod, int obj, int (*func) (st_data_t, st_data_t, st_data_t))
{
VALUE ary;
int recur, prepended = 0;
- st_table *list;
+ struct method_entry_arg me_arg;
if (argc == 0) {
recur = TRUE;
@@ -1156,16 +1183,17 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func
prepended = 1;
}
- list = st_init_numtable();
+ me_arg.list = st_init_numtable();
+ me_arg.recur = recur;
for (; mod; mod = RCLASS_SUPER(mod)) {
- if (RCLASS_M_TBL(mod)) st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)list);
+ if (RCLASS_M_TBL(mod)) rb_id_table_foreach(RCLASS_M_TBL(mod), method_entry_i, &me_arg);
if (BUILTIN_TYPE(mod) == T_ICLASS && !prepended) continue;
if (obj && FL_TEST(mod, FL_SINGLETON)) continue;
if (!recur) break;
}
ary = rb_ary_new();
- st_foreach(list, func, ary);
- st_free_table(list);
+ st_foreach(me_arg.list, func, ary);
+ st_free_table(me_arg.list);
return ary;
}
@@ -1176,29 +1204,29 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func
*
* Returns an array containing the names of the public and protected instance
* methods in the receiver. For a module, these are the public and protected methods;
- * for a class, they are the instance (not singleton) methods. With no
- * argument, or with an argument that is <code>false</code>, the
- * instance methods in <i>mod</i> are returned, otherwise the methods
- * in <i>mod</i> and <i>mod</i>'s superclasses are returned.
+ * for a class, they are the instance (not singleton) methods. If the optional
+ * parameter is <code>false</code>, the methods of any ancestors are not included.
*
* module A
* def method1() end
* end
* class B
+ * include A
* def method2() end
* end
* class C < B
* def method3() end
* end
*
- * A.instance_methods #=> [:method1]
- * B.instance_methods(false) #=> [:method2]
- * C.instance_methods(false) #=> [:method3]
- * C.instance_methods(true).length #=> 43
+ * A.instance_methods(false) #=> [:method1]
+ * B.instance_methods(false) #=> [:method2]
+ * B.instance_methods(true).include?(:method1) #=> true
+ * C.instance_methods(false) #=> [:method3]
+ * C.instance_methods.include?(:method2) #=> true
*/
VALUE
-rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_i);
}
@@ -1208,12 +1236,12 @@ rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
* mod.protected_instance_methods(include_super=true) -> array
*
* Returns a list of the protected instance methods defined in
- * <i>mod</i>. If the optional parameter is not <code>false</code>, the
- * methods of any ancestors are included.
+ * <i>mod</i>. If the optional parameter is <code>false</code>, the
+ * methods of any ancestors are not included.
*/
VALUE
-rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_prot_i);
}
@@ -1223,8 +1251,8 @@ rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
* mod.private_instance_methods(include_super=true) -> array
*
* Returns a list of the private instance methods defined in
- * <i>mod</i>. If the optional parameter is not <code>false</code>, the
- * methods of any ancestors are included.
+ * <i>mod</i>. If the optional parameter is <code>false</code>, the
+ * methods of any ancestors are not included.
*
* module Mod
* def method1() end
@@ -1236,7 +1264,7 @@ rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
*/
VALUE
-rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_priv_i);
}
@@ -1246,12 +1274,12 @@ rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
* mod.public_instance_methods(include_super=true) -> array
*
* Returns a list of the public instance methods defined in <i>mod</i>.
- * If the optional parameter is not <code>false</code>, the methods of
- * any ancestors are included.
+ * If the optional parameter is <code>false</code>, the methods of
+ * any ancestors are not included.
*/
VALUE
-rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_pub_i);
}
@@ -1263,8 +1291,8 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
* 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>regular</i> parameter is set to <code>false</code>,
- * Returns an array of obj's public and protected singleton methods,
+ * If the optional parameter is <code>false</code>, it
+ * returns an array of <i>obj<i>'s public and protected singleton methods,
* the array will not include methods in modules included in <i>obj</i>.
*
* class Klass
@@ -1275,7 +1303,7 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
* k.methods[0..9] #=> [:klass_method, :nil?, :===,
* # :==~, :!, :eql?
* # :hash, :<=>, :class, :singleton_class]
- * k.methods.length #=> 57
+ * k.methods.length #=> 56
*
* k.methods(false) #=> []
* def k.singleton_method; end
@@ -1287,22 +1315,13 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
*/
VALUE
-rb_obj_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_methods(int argc, const VALUE *argv, VALUE obj)
{
- retry:
- if (argc == 0) {
- return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
- }
- else {
- VALUE recur;
-
- rb_scan_args(argc, argv, "1", &recur);
- if (RTEST(recur)) {
- argc = 0;
- goto retry;
- }
+ rb_check_arity(argc, 0, 1);
+ if (argc > 0 && !RTEST(argv[0])) {
return rb_obj_singleton_methods(argc, argv, obj);
}
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
}
/*
@@ -1315,7 +1334,7 @@ rb_obj_methods(int argc, VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj)
{
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_prot_i);
}
@@ -1330,7 +1349,7 @@ rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj)
{
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_priv_i);
}
@@ -1345,7 +1364,7 @@ rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
{
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_pub_i);
}
@@ -1384,10 +1403,11 @@ rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
{
VALUE recur, ary, klass, origin;
- st_table *list, *mtbl;
+ struct method_entry_arg me_arg;
+ struct rb_id_table *mtbl;
if (argc == 0) {
recur = Qtrue;
@@ -1397,22 +1417,21 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
}
klass = CLASS_OF(obj);
origin = RCLASS_ORIGIN(klass);
- list = st_init_numtable();
+ me_arg.list = st_init_numtable();
+ me_arg.recur = RTEST(recur);
if (klass && FL_TEST(klass, FL_SINGLETON)) {
- if ((mtbl = RCLASS_M_TBL(origin)) != 0)
- st_foreach(mtbl, method_entry_i, (st_data_t)list);
+ if ((mtbl = RCLASS_M_TBL(origin)) != 0) rb_id_table_foreach(mtbl, method_entry_i, &me_arg);
klass = RCLASS_SUPER(klass);
}
if (RTEST(recur)) {
while (klass && (FL_TEST(klass, FL_SINGLETON) || RB_TYPE_P(klass, T_ICLASS))) {
- if (klass != origin && (mtbl = RCLASS_M_TBL(klass)) != 0)
- st_foreach(mtbl, method_entry_i, (st_data_t)list);
+ if (klass != origin && (mtbl = RCLASS_M_TBL(klass)) != 0) rb_id_table_foreach(mtbl, method_entry_i, &me_arg);
klass = RCLASS_SUPER(klass);
}
}
ary = rb_ary_new();
- st_foreach(list, ins_methods_i, ary);
- st_free_table(list);
+ st_foreach(me_arg.list, ins_methods_i, ary);
+ st_free_table(me_arg.list);
return ary;
}
@@ -1477,31 +1496,31 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
void
rb_define_method_id(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, mid, func, argc, NOEX_PUBLIC);
+ rb_add_method_cfunc(klass, mid, func, argc, METHOD_VISI_PUBLIC);
}
void
rb_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PUBLIC);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PUBLIC);
}
void
rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PROTECTED);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PROTECTED);
}
void
rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PRIVATE);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PRIVATE);
}
void
rb_undef_method(VALUE klass, const char *name)
{
- rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, NOEX_UNDEF);
+ rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, METHOD_VISI_UNDEF);
}
/*!
@@ -1547,7 +1566,8 @@ singleton_class_of(VALUE obj)
{
VALUE klass;
- if (FIXNUM_P(obj) || FLONUM_P(obj) || SYMBOL_P(obj)) {
+ if (FIXNUM_P(obj) || FLONUM_P(obj) || STATIC_SYM_P(obj)) {
+ no_singleton:
rb_raise(rb_eTypeError, "can't define singleton");
}
if (SPECIAL_CONST_P(obj)) {
@@ -1557,18 +1577,19 @@ singleton_class_of(VALUE 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");
+ switch (BUILTIN_TYPE(obj)) {
+ case T_FLOAT: case T_BIGNUM: case T_SYMBOL:
+ goto no_singleton;
+ case T_STRING:
+ if (FL_TEST_RAW(obj, RSTRING_FSTR)) goto no_singleton;
+ break;
}
}
- if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) &&
- rb_ivar_get(RBASIC(obj)->klass, id_attached) == obj) {
- klass = RBASIC(obj)->klass;
- }
- else {
- klass = rb_make_metaclass(obj, RBASIC(obj)->klass);
+ klass = RBASIC(obj)->klass;
+ if (!(FL_TEST(klass, FL_SINGLETON) &&
+ rb_ivar_get(klass, id_attached) == obj)) {
+ klass = rb_make_metaclass(obj, klass);
}
if (OBJ_TAINTED(obj)) {
@@ -1577,11 +1598,24 @@ singleton_class_of(VALUE obj)
else {
FL_UNSET(klass, FL_TAINT);
}
- if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass);
+ if (OBJ_FROZEN(obj)) OBJ_FREEZE_RAW(klass);
return klass;
}
+void
+rb_freeze_singleton_class(VALUE x)
+{
+ /* should not propagate to meta-meta-class, and so on */
+ if (!(RBASIC(x)->flags & FL_SINGLETON)) {
+ VALUE klass = RBASIC_CLASS(x);
+ if (klass && (klass = RCLASS_ORIGIN(klass)) != 0 &&
+ FL_TEST(klass, (FL_SINGLETON|FL_FREEZE)) == FL_SINGLETON) {
+ OBJ_FREEZE_RAW(klass);
+ }
+ }
+}
+
/*!
* Returns the singleton class of \a obj, or nil if obj is not a
* singleton object.
@@ -1711,7 +1745,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"), 0);
+ const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"));
if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
me->def->body.cfunc.func == rb_any_to_s)
return 1;
@@ -1853,11 +1887,12 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
return argc;
}
-NORETURN(static void keyword_error(const char *error, VALUE keys));
-static void
-keyword_error(const char *error, VALUE keys)
+VALUE
+rb_keyword_error_new(const char *error, VALUE keys)
{
const char *msg = "";
+ VALUE error_message;
+
if (RARRAY_LEN(keys) == 1) {
keys = RARRAY_AREF(keys, 0);
}
@@ -1865,21 +1900,33 @@ keyword_error(const char *error, VALUE keys)
keys = rb_ary_join(keys, rb_usascii_str_new2(", "));
msg = "s";
}
- rb_raise(rb_eArgError, "%s keyword%s: %"PRIsVALUE, error, msg, keys);
+
+ error_message = rb_sprintf("%s keyword%s: %"PRIsVALUE, error, msg, keys);
+
+ return rb_exc_new_str(rb_eArgError, error_message);
+}
+
+NORETURN(static void rb_keyword_error(const char *error, VALUE keys));
+static void
+rb_keyword_error(const char *error, VALUE keys)
+{
+ rb_exc_raise(rb_keyword_error_new(error, keys));
}
NORETURN(static void unknown_keyword_error(VALUE hash, const ID *table, int keywords));
static void
unknown_keyword_error(VALUE hash, const ID *table, int keywords)
{
+ st_table *tbl = rb_hash_tbl_raw(hash);
VALUE keys;
int i;
for (i = 0; i < keywords; i++) {
- rb_hash_delete(hash, ID2SYM(table[i]));
+ st_data_t key = ID2SYM(table[i]);
+ st_delete(tbl, &key, NULL);
}
- keys = rb_funcall(hash, rb_intern("keys"), 0, 0);
+ keys = rb_funcallv(hash, rb_intern("keys"), 0, 0);
if (!RB_TYPE_P(keys, T_ARRAY)) rb_raise(rb_eArgError, "unknown keyword");
- keyword_error("unknown", keys);
+ rb_keyword_error("unknown", keys);
}
static int
@@ -1905,6 +1952,9 @@ rb_extract_keywords(VALUE *orighash)
}
st_foreach(rb_hash_tbl_raw(hash), separate_symbol, (st_data_t)&parthash);
*orighash = parthash[1];
+ if (parthash[1] && RBASIC_CLASS(hash) != rb_cHash) {
+ RBASIC_SET_CLASS(parthash[1], RBASIC_CLASS(hash));
+ }
return parthash[0];
}
@@ -1921,6 +1971,8 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
st_delete(rb_hash_tbl_raw(keyword_hash), &key, (val)) : \
st_lookup(rb_hash_tbl_raw(keyword_hash), key, (val)))
+ if (NIL_P(keyword_hash)) keyword_hash = 0;
+
if (optional < 0) {
rest = 1;
optional = -1-optional;
@@ -1944,7 +1996,7 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
rb_ary_push(missing, keyword);
}
if (!NIL_P(missing)) {
- keyword_error("missing", missing);
+ rb_keyword_error("missing", missing);
}
}
j = i;
@@ -1958,7 +2010,7 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
}
}
if (!rest && keyword_hash) {
- if (RHASH_SIZE(keyword_hash) > (unsigned int)j) {
+ if (RHASH_SIZE(keyword_hash) > (unsigned int)(values ? 0 : j)) {
unknown_keyword_error(keyword_hash, table, required+optional);
}
}
@@ -1966,6 +2018,12 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
#undef extract_kwarg
}
+int
+rb_class_has_methods(VALUE c)
+{
+ return rb_id_table_size(RCLASS_M_TBL(c)) == 0 ? FALSE : TRUE;
+}
+
/*!
* \}
*/
diff --git a/common.mk b/common.mk
index 0c8b7fc54a..da4608bc61 100644
--- a/common.mk
+++ b/common.mk
@@ -8,32 +8,47 @@ dll: $(LIBRUBY_SO)
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
-ECHO = $(ECHO1:0=@echo)
+ECHO0 = $(ECHO1:0=echo)
+ECHO = @$(ECHO0)
+
+UNICODE_VERSION = 8.0.0
RUBYLIB = $(PATH_SEPARATOR)
RUBYOPT = -
RUN_OPTS = --disable-gems
-SPEC_GIT_BASE = git://github.com/nurse
+GEM_HOME =
+GEM_PATH =
+GEM_VENDOR =
+
+SPEC_GIT_BASE = git://github.com/ruby
MSPEC_GIT_URL = $(SPEC_GIT_BASE)/mspec.git
RUBYSPEC_GIT_URL = $(SPEC_GIT_BASE)/rubyspec.git
+SIMPLECOV_GIT_URL = git://github.com/colszowka/simplecov.git
+SIMPLECOV_GIT_REF = v0.10.0
+SIMPLECOV_HTML_GIT_URL = git://github.com/colszowka/simplecov-html.git
+SIMPLECOV_HTML_GIT_REF = v0.10.0
+DOCLIE_GIT_URL = git://github.com/ms-ati/docile.git
+DOCLIE_GIT_REF = v1.1.5
+
STATIC_RUBY = static-ruby
EXTCONF = extconf.rb
LIBRUBY_EXTS = ./.libruby-with-ext.time
REVISION_H = ./.revision.time
PLATFORM_D = ./$(PLATFORM_DIR)/.time
+ENC_TRANS_D = ./enc/trans/.time
RDOCOUT = $(EXTOUT)/rdoc
+HTMLOUT = $(EXTOUT)/html
CAPIOUT = doc/capi
-DMYEXT = dmyext.$(OBJEXT)
+INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT)
NORMALMAINOBJ = main.$(OBJEXT)
MAINOBJ = $(NORMALMAINOBJ)
-EXTOBJS =
-DLDOBJS = $(DMYEXT)
+DLDOBJS = $(INITOBJS)
EXTSOLIBS =
-MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) miniprelude.$(OBJEXT)
+MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT)
ENC_MK = enc.mk
COMMONOBJS = array.$(OBJEXT) \
@@ -81,6 +96,7 @@ COMMONOBJS = array.$(OBJEXT) \
strftime.$(OBJEXT) \
string.$(OBJEXT) \
struct.$(OBJEXT) \
+ symbol.$(OBJEXT) \
time.$(OBJEXT) \
transcode.$(OBJEXT) \
util.$(OBJEXT) \
@@ -95,6 +111,7 @@ COMMONOBJS = array.$(OBJEXT) \
vm_trace.$(OBJEXT) \
thread.$(OBJEXT) \
cont.$(OBJEXT) \
+ $(DTRACE_OBJ) \
$(BUILTIN_ENCOBJS) \
$(BUILTIN_TRANSOBJS) \
$(MISSING)
@@ -105,21 +122,24 @@ EXPORTOBJS = $(DLNOBJ) \
$(COMMONOBJS)
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
-ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT)
+ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
+DEFAULT_PRELUDES = $(GEM_PRELUDE)
PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES)
-GEM_PRELUDE = $(srcdir)/gem_prelude.rb
-PRELUDES = prelude.c miniprelude.c
-GOLFPRELUDES = golf_prelude.c
+GEM_PRELUDE = $(srcdir)/gem_prelude.rb
+PRELUDES = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
+GOLFPRELUDES = {$(srcdir)}golf_prelude.c
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
--extout="$(EXTOUT)" \
--mflags="$(MFLAGS)" \
--make-flags="$(MAKEFLAGS)"
EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
- --make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" --
+ --make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" \
+ --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
+ --
INSTRUBY = $(SUDO) $(RUNRUBY) -r./$(arch)-fake $(srcdir)/tool/rbinstall.rb
INSTRUBY_ARGS = $(SCRIPT_ARGS) \
--data-mode=$(INSTALL_DATA_MODE) \
@@ -133,21 +153,24 @@ PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil'
$(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
TESTSDIR = $(srcdir)/test
+TEST_EXCLUDES = --excludes-dir=$(TESTSDIR)/excludes --name=!/memory_leak/
+EXCLUDE_TESTFRAMEWORK = --exclude=/testunit/ --exclude=/minitest/
TESTWORKDIR = testwork
+TESTOPTS = $(RUBY_TESTOPTS)
TESTRUN_SCRIPT = $(srcdir)/test.rb
-BOOTSTRAPRUBY = $(BASERUBY)
+COMPILE_PRELUDE = $(srcdir)/tool/generic_erb.rb $(srcdir)/template/prelude.c.tmpl
-COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb
+SHOWFLAGS = showflags
-all: showflags main docs
+all: $(SHOWFLAGS) main docs
-main: showflags $(EXTSTATIC:static=lib)encs exts
+main: $(SHOWFLAGS) exts $(ENCSTATIC:static=lib)encs
@$(NULLCMD)
.PHONY: showflags
-exts enc trans: showflags
+exts enc trans: $(SHOWFLAGS)
showflags:
$(MESSAGE_BEGIN) \
" CC = $(CC)" \
@@ -177,16 +200,14 @@ $(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
configure-ext: $(EXTS_MK)
build-ext: $(EXTS_MK)
- $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) $(EXTSTATIC) LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
-
-$(MKMAIN_CMD): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
- $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$@ $(EXTMK_ARGS)
+ $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) libdir="$(libdir)" LIBRUBY_EXTS=$(LIBRUBY_EXTS) \
+ EXTENCS="$(ENCOBJS)" UPDATE_LIBRARIES=no $(EXTSTATIC)
prog: program wprogram
$(PREP): $(MKFILES)
-miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE) $(DTRACE_OBJ)
+miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE)
objs: $(ALLOBJS)
@@ -198,21 +219,21 @@ capi: $(CAPIOUT)/.timestamp PHONY
$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
$(Q) $(MAKEDIRS) "$(@D)"
$(ECHO) generating capi
- $(Q) $(DOXYGEN) -b
+ -$(Q) $(DOXYGEN) -b
$(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 $@
$(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ $(srcdir)/template/Doxyfile.tmpl \
- --srcdir="$(srcdir)" --miniruby="$(BASERUBY)"
+ --srcdir="$(srcdir)" --miniruby="$(MINIRUBY)"
-program: showflags $(PROGRAM)
-wprogram: showflags $(WPROGRAM)
+program: $(SHOWFLAGS) $(PROGRAM)
+wprogram: $(SHOWFLAGS) $(WPROGRAM)
mini: PHONY miniruby$(EXEEXT)
$(PROGRAM) $(WPROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
-$(LIBRUBY_A): $(OBJS) $(MAINOBJ) $(DTRACE_OBJ) $(DTRACE_GLOMMED_OBJ) $(DMYEXT) $(ARCHFILE)
+$(LIBRUBY_A): $(LIBRUBY_A_OBJS) $(MAINOBJ) $(INITOBJS) $(ARCHFILE)
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
@@ -225,7 +246,7 @@ $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
ruby.imp: $(COMMONOBJS)
$(Q)$(NM) -Pgp $(COMMONOBJS) | \
- awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
+ awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|ruby_static_id_|.*_threadptr_|\.)/{print $$1}' | \
sort -u -o $@
install: install-$(INSTALLDOC)
@@ -234,80 +255,80 @@ pkgconfig-data: $(ruby_pc)
$(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: all
+pre-install-all:: all pre-install-local pre-install-ext pre-install-doc
+do-install-all: pre-install-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: main
+do-install-nodoc: main pre-install-nodoc
$(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: $(PROGRAM)
+do-install-local: $(PROGRAM) pre-install-local
$(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: exts
+do-install-ext: exts pre-install-ext
$(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: main
+do-install-arch: main do-install-arch
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=arch
post-install-arch:: post-install-bin post-install-ext-arch
install-comm: pre-install-comm do-install-comm post-install-comm
pre-install-comm:: pre-install-lib pre-install-ext-comm pre-install-man
-do-install-comm: $(PREP)
+do-install-comm: $(PREP) pre-install-comm
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
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: $(PROGRAM)
+do-install-bin: $(PROGRAM) pre-install-bin
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
post-install-bin::
@$(NULLCMD)
install-lib: pre-install-lib do-install-lib post-install-lib
pre-install-lib:: install-prereq
-do-install-lib: $(PREP)
+do-install-lib: $(PREP) pre-install-lib
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
post-install-lib::
@$(NULLCMD)
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: exts
+do-install-ext-comm: exts pre-install-ext-comm
$(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: exts
+do-install-ext-arch: exts pre-install-ext-arch
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
post-install-ext-arch::
@$(NULLCMD)
install-man: pre-install-man do-install-man post-install-man
pre-install-man:: install-prereq
-do-install-man: $(PREP)
+do-install-man: $(PREP) pre-install-man
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man
post-install-man::
@$(NULLCMD)
install-capi: capi pre-install-capi do-install-capi post-install-capi
pre-install-capi:: install-prereq
-do-install-capi: $(PREP)
+do-install-capi: $(PREP) pre-install-capi
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=capi
post-install-capi::
@$(NULLCMD)
@@ -322,10 +343,10 @@ dont-install-all: $(PROGRAM)
post-no-install-all:: post-no-install-local post-no-install-ext post-no-install-doc
@$(NULLCMD)
-uninstall: $(INSTALLED_LIST)
+uninstall: $(INSTALLED_LIST) sudo-precheck
$(Q)$(SUDO) $(MINIRUBY) $(srcdir)/tool/rbuninstall.rb --destdir=$(DESTDIR) $(INSTALLED_LIST)
-reinstall: uninstall install
+reinstall: all uninstall install
what-where-nodoc: no-install-nodoc
no-install-nodoc: pre-no-install-nodoc dont-install-nodoc post-no-install-nodoc
@@ -404,14 +425,14 @@ post-no-install-man::
install-doc: rdoc pre-install-doc do-install-doc post-install-doc
pre-install-doc:: install-prereq
-do-install-doc: $(PROGRAM)
+do-install-doc: $(PROGRAM) pre-install-doc
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-install-doc::
@$(NULLCMD)
install-gem: pre-install-gem do-install-gem post-install-gem
pre-install-gem:: pre-install-bin pre-install-lib pre-install-man
-do-install-gem: $(PROGRAM)
+do-install-gem: $(PROGRAM) pre-install-gem
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=gem
post-install-gem::
@$(NULLCMD)
@@ -420,6 +441,10 @@ rdoc: PHONY main
@echo Generating RDoc documentation
$(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --ri --op "$(RDOCOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
+html: PHONY main
+ @echo Generating RDoc HTML files
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --op "$(HTMLOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
+
rdoc-coverage: PHONY main
@echo Generating RDoc coverage report
$(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --encoding=UTF-8 --all --quiet -C $(RDOCFLAGS) "$(srcdir)"
@@ -446,108 +471,166 @@ post-no-install-doc::
CLEAR_INSTALLED_LIST = clear-installed-list
-install-prereq: $(CLEAR_INSTALLED_LIST) yes-fake PHONY
+install-prereq: $(CLEAR_INSTALLED_LIST) yes-fake sudo-precheck 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-platform
-clean-local:: PHONY
+clean: clean-ext clean-enc clean-golf clean-rdoc clean-capi clean-extout clean-local clean-platform
+clean-local:: clean-runnable
$(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)
+ $(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) dmyenc.$(OBJEXT) $(ARCHFILE) .*.time
+ $(Q)$(RM) y.tab.c y.output encdb.h transdb.h config.log rbconfig.rb $(ruby_pc) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT)
+ $(Q)$(RM) GNUmakefile.old Makefile.old $(arch)-fake.rb bisect.sh $(ENC_TRANS_D)
+ -$(Q) $(RMDIR) enc/jis enc/trans enc 2> $(NULL) || exit 0
+clean-runnable:: PHONY
+ $(Q)$(CHDIR) bin 2>$(NULL) && $(RM) $(PROGRAM) $(WPROGRAM) $(GORUBY)$(EXEEXT) bin/*.$(DLEXT) 2>$(NULL) || exit 0
+ $(Q)$(CHDIR) lib 2>$(NULL) && $(RM) $(LIBRUBY_A) $(LIBRUBY) $(LIBRUBY_ALIASES) $(RUBY_BASE_NAME)/$(RUBY_PROGRAM_VERSION) $(RUBY_BASE_NAME)/vendor_ruby 2>$(NULL) || exit 0
+ $(Q)$(RMDIR) lib/$(RUBY_BASE_NAME) lib bin 2>$(NULL) || exit 0
clean-ext:: PHONY
clean-golf: PHONY
$(Q)$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
clean-rdoc: PHONY
+clean-html: PHONY
clean-capi: PHONY
clean-platform: PHONY
clean-extout: PHONY
-clean-docs: clean-rdoc clean-capi
+ -$(Q)$(RMDIR) $(EXTOUT)/$(arch) $(EXTOUT) 2> $(NULL) || exit 0
+clean-docs: clean-rdoc clean-html clean-capi
-distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout distclean-platform
+distclean: distclean-ext distclean-enc distclean-golf distclean-extout distclean-local distclean-platform
distclean-local:: clean-local
- $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc
+ $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc $(PRELUDES)
$(Q)$(RM) config.cache config.status config.status.lineno
$(Q)$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
+ -$(Q)$(RMALL) $(srcdir)/autom4te.cache
distclean-ext:: PHONY
distclean-golf: clean-golf
- $(Q)$(RM) $(GOLFPRELUDES)
distclean-rdoc: PHONY
+distclean-html: 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
- $(Q)$(RM) parse.c parse.h lex.c newline.c miniprelude.c revision.h
+ $(Q)$(RM) parse.c parse.h lex.c enc/trans/newline.c revision.h
+ $(Q)$(RM) id.c id.h probes.dmyh
+ $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) parse.c parse.h lex.c enc/trans/newline.c $(PRELUDES) revision.h
+ $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) id.c id.h probes.dmyh
+ $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) configure tool/config.guess tool/config.sub gems/*.gem
realclean-ext:: PHONY
realclean-golf: distclean-golf
+ $(Q)$(RM) $(GOLFPRELUDES)
realclean-capi: PHONY
realclean-extout: distclean-extout
clean-ext distclean-ext realclean-ext::
$(Q)$(RM) $(EXTS_MK)
$(Q)$(RM) $(EXTOUT)/.timestamp/.*.time
+ $(Q)$(RMDIR) $(EXTOUT)/.timestamp 2> $(NULL) || exit 0
clean-enc distclean-enc realclean-enc: PHONY
-check: main test test-all
+clean-enc: clean-enc.d
+
+clean-enc.d: PHONY
+ $(Q)$(RM) $(ENC_TRANS_D)
+ -$(Q) $(RMDIR) enc/jis enc/trans enc 2> $(NULL) || exit 0
+
+clean-rdoc distclean-rdoc realclean-rdoc:
+ @echo $(@:-rdoc=ing) rdoc
+ $(Q)$(RMALL) $(RDOCOUT)
+
+clean-html distclean-html realclean-html:
+ @echo $(@:-html=ing) HTML
+ $(Q)$(RMALL) $(HTMLOUT)
+
+clean-capi distclean-capi realclean-capi:
+ @echo $(@:-capi=ing) capi
+ $(Q)$(RMALL) $(CAPIOUT)
+
+clean-platform:
+ $(Q) $(RM) $(PLATFORM_D)
+ -$(Q) $(RMDIR) $(PLATFORM_DIR) 2> $(NULL) || exit 0
+
+check: main test test-testframework test-almost
$(ECHO) check succeeded
check-ruby: test test-ruby
fake: $(CROSS_COMPILING)-fake
yes-fake: $(arch)-fake.rb $(RBCONFIG) PHONY
-no-fake: PHONY
+no-fake -fake: PHONY
+
+# really doesn't depend on .o, just ensure newer than headers which
+# version.o depends on.
+$(arch)-fake.rb: $(srcdir)/template/fake.rb.in $(srcdir)/tool/generic_erb.rb version.$(OBJEXT) miniruby$(EXEEXT)
+ $(ECHO) generating $@
+ $(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) "$(srcdir)/version.c" | \
+ $(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ "$(srcdir)/template/fake.rb.in" \
+ i=- srcdir="$(srcdir)" BASERUBY="$(BASERUBY)"
btest: $(TEST_RUNNABLE)-btest
no-btest: PHONY
yes-btest: fake miniruby$(EXEEXT) PHONY
- $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" $(OPTS) $(TESTOPTS)
+ $(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" $(OPTS) $(TESTOPTS)
btest-ruby: $(TEST_RUNNABLE)-btest-ruby
no-btest-ruby: PHONY
yes-btest-ruby: prog PHONY
- $(Q)$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS)
+ $(Q)$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS)
test-sample: $(TEST_RUNNABLE)-test-sample
no-test-sample: PHONY
yes-test-sample: prog PHONY
- $(Q)$(RUNRUBY) $(srcdir)/tool/rubytest.rb --run-opt=$(RUN_OPTS) $(OPTS) $(TESTOPTS)
+ $(Q)$(exec) $(RUNRUBY) "$(srcdir)/tool/rubytest.rb" --run-opt=$(RUN_OPTS) $(OPTS) $(TESTOPTS)
test-knownbugs: test-knownbug
test-knownbug: $(TEST_RUNNABLE)-test-knownbug
no-test-knownbug: PHONY
yes-test-knownbug: prog PHONY
- -$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
+ -$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
+
+test-testframework: $(TEST_RUNNABLE)-test-testframework
+yes-test-testframework: prog PHONY
+ $(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
+no-test-testframework: PHONY
test: test-sample btest-ruby test-knownbug
+# $ make test-all TESTOPTS="--help" displays more detail
+# for example, make test-all TESTOPTS="-j2 -v -n test-name -- test-file-name"
test-all: $(TEST_RUNNABLE)-test-all
yes-test-all: prog PHONY
- $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) $(TESTS)
+ $(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(TESTS)
TESTS_BUILD = mkmf
no-test-all: PHONY
$(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
+test-almost: $(TEST_RUNNABLE)-test-almost
+yes-test-almost: prog PHONY
+ $(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(EXCLUDE_TESTFRAMEWORK) $(TESTS)
+no-test-almost: PHONY
+
test-ruby: $(TEST_RUNNABLE)-test-ruby
no-test-ruby: PHONY
yes-test-ruby: prog encs PHONY
- $(RUNRUBY) "$(srcdir)/test/runner.rb" -q $(TESTOPTS) -- ruby -ext-
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" $(TEST_EXCLUDES) $(TESTOPTS) -- ruby -ext-
extconf: $(PREP)
$(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h $(PREP)
- $(Q)$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
+$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h
+ $(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
+ -arch=$(arch) -version=$(RUBY_PROGRAM_VERSION) \
-install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb
test-rubyspec-precheck:
-test-rubyspec: test-rubyspec-precheck
- $(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
+test-rubyspec: test-rubyspec-precheck $(arch)-fake.rb
+ $(RUNRUBY) -r./$(arch)-fake $(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
@@ -556,7 +639,7 @@ yes-runnable: PHONY
encs: enc trans
libencs: libenc libtrans
-encs enc trans libencs libenc libtrans: showflags $(ENC_MK) $(LIBRUBY) $(PREP)
+encs enc trans libencs libenc libtrans: $(SHOWFLAGS) $(ENC_MK) $(LIBRUBY) $(PREP) PHONY
$(ECHO) making $@
$(Q) $(MAKE) -f $(ENC_MK) V="$(V)" \
RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" \
@@ -567,16 +650,16 @@ 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)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG)
+ $(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG) fake
$(ECHO) generating $@
- $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(EXTSTATIC) $@ $(ENCS)
+ $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(ENCSTATIC) $(ENCS) $@
.PRECIOUS: $(MKFILES)
.PHONY: PHONY all fake prereq incs srcs preludes help
.PHONY: test install install-nodoc install-doc dist
.PHONY: loadpath golf capi rdoc install-prereq clear-installed-list
-.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc clean-extout
+.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc clean-html clean-extout
.PHONY: distclean distclean-ext distclean-local distclean-enc distclean-golf distclean-extout
.PHONY: realclean realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
.PHONY: check test test-all btest btest-ruby test-sample test-knownbug
@@ -602,16 +685,18 @@ $(PLATFORM_D):
$(Q) $(MAKEDIRS) $(PLATFORM_DIR)
@exit > $@
+$(BUILTIN_ENCOBJS) $(BUILTIN_TRANSOBJS): $(ENC_TRANS_D)
+
+$(ENC_TRANS_D):
+ $(Q) $(MAKEDIRS) enc/trans
+ @exit > $@
+
###
+CCAN_DIR = {$(VPATH)}ccan
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
-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)}ruby_atomic.h \
- {$(VPATH)}vm_debug.h {$(VPATH)}id.h {$(VPATH)}thread_native.h
###
@@ -620,12 +705,13 @@ alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
crypt.$(OBJEXT): {$(VPATH)}crypt.c
dup2.$(OBJEXT): {$(VPATH)}dup2.c
erf.$(OBJEXT): {$(VPATH)}erf.c
+explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
finite.$(OBJEXT): {$(VPATH)}finite.c
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) $(hdrdir)/ruby.h
+setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c
strchr.$(OBJEXT): {$(VPATH)}strchr.c
strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
@@ -635,230 +721,35 @@ strstr.$(OBJEXT): {$(VPATH)}strstr.c
strtod.$(OBJEXT): {$(VPATH)}strtod.c
strtol.$(OBJEXT): {$(VPATH)}strtol.c
nt.$(OBJEXT): {$(VPATH)}nt.c
-os2.$(OBJEXT): {$(VPATH)}os2.c
-dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
ia64.$(OBJEXT): {$(VPATH)}ia64.s
$(CC) $(CFLAGS) -c $<
###
-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 $(PROBES_H_INCLUDES) {$(VPATH)}id.h {$(VPATH)}vm_opts.h
-bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- {$(VPATH)}thread.h {$(VPATH)}internal.h
-class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}constant.h {$(VPATH)}vm_opts.h
-compar.$(OBJEXT): {$(VPATH)}compar.c $(RUBY_H_INCLUDES)
-complex.$(OBJEXT): {$(VPATH)}complex.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}internal.h $(hdrdir)/ruby.h
-dir.$(OBJEXT): {$(VPATH)}dir.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- $(ENCODING_H_INCLUDES) \
- {$(VPATH)}internal.h
-dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}dln.h $(RUBY_H_INCLUDES)
-dln_find.$(OBJEXT): {$(VPATH)}dln_find.c {$(VPATH)}dln.h $(RUBY_H_INCLUDES)
-dmydln.$(OBJEXT): {$(VPATH)}dmydln.c $(RUBY_H_INCLUDES)
-dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
-encoding.$(OBJEXT): {$(VPATH)}encoding.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES) {$(VPATH)}regenc.h {$(VPATH)}util.h \
- {$(VPATH)}internal.h
-enum.$(OBJEXT): {$(VPATH)}enum.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
- {$(VPATH)}util.h {$(VPATH)}id.h {$(VPATH)}internal.h
-enumerator.$(OBJEXT): {$(VPATH)}enumerator.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}internal.h {$(VPATH)}node.h
-error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}known_errors.inc \
- $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) $(ENCODING_H_INCLUDES) \
- {$(VPATH)}internal.h {$(VPATH)}vm_opts.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)}gc.h {$(VPATH)}iseq.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES) {$(VPATH)}vm_opts.h {$(VPATH)}probes_helper.h
-load.$(OBJEXT): {$(VPATH)}load.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}dln.h {$(VPATH)}internal.h $(PROBES_H_INCLUDES) {$(VPATH)}vm_opts.h
-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)}internal.h {$(VPATH)}constant.h \
- {$(VPATH)}thread.h $(PROBES_H_INCLUDES) {$(VPATH)}vm_opts.h {$(VPATH)}debug.h
-hash.$(OBJEXT): {$(VPATH)}hash.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES) {$(VPATH)}vm_opts.h
-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 {$(VPATH)}thread.h {$(VPATH)}id.h {$(VPATH)}ruby_atomic.h
-main.$(OBJEXT): {$(VPATH)}main.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h {$(VPATH)}vm_debug.h {$(VPATH)}vm_opts.h $(hdrdir)/ruby.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)}vm_opts.h {$(VPATH)}internal.h
-numeric.$(OBJEXT): {$(VPATH)}numeric.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}id.h
-object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- {$(VPATH)}internal.h {$(VPATH)}constant.h $(ENCODING_H_INCLUDES) $(PROBES_H_INCLUDES) \
- {$(VPATH)}vm_opts.h {$(VPATH)}id.h
-pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES) {$(VPATH)}encoding.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}internal.h
-parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}id.h {$(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 $(PROBES_H_INCLUDES) {$(VPATH)}vm_opts.h
-proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
- $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}internal.h {$(VPATH)}iseq.h {$(VPATH)}vm_opts.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)}internal.h \
- {$(VPATH)}thread.h {$(VPATH)}vm_opts.h
-random.$(OBJEXT): {$(VPATH)}random.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}siphash.c {$(VPATH)}siphash.h {$(VPATH)}internal.h
-range.$(OBJEXT): {$(VPATH)}range.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}id.h
-rational.$(OBJEXT): {$(VPATH)}rational.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h $(hdrdir)/ruby.h
-re.$(OBJEXT): {$(VPATH)}re.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
- {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}util.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}internal.h
-regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}regparse.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
- $(RUBY_H_INCLUDES)
-regenc.$(OBJEXT): {$(VPATH)}regenc.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
-regerror.$(OBJEXT): {$(VPATH)}regerror.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
-regexec.$(OBJEXT): {$(VPATH)}regexec.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
-regparse.$(OBJEXT): {$(VPATH)}regparse.c {$(VPATH)}regparse.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
- $(RUBY_H_INCLUDES)
-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)}internal.h {$(VPATH)}vm_opts.h
-safe.$(OBJEXT): {$(VPATH)}safe.c $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}vm_opts.h {$(VPATH)}internal.h
-signal.$(OBJEXT): {$(VPATH)}signal.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}vm_opts.h {$(VPATH)}internal.h {$(VPATH)}ruby_atomic.h {$(VPATH)}eval_intern.h
-sprintf.$(OBJEXT): {$(VPATH)}sprintf.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
- {$(VPATH)}regex.h {$(VPATH)}vsnprintf.c $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
-st.$(OBJEXT): {$(VPATH)}st.c $(RUBY_H_INCLUDES)
-strftime.$(OBJEXT): {$(VPATH)}strftime.c $(RUBY_H_INCLUDES) \
- {$(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 $(PROBES_H_INCLUDES) {$(VPATH)}vm_opts.h {$(VPATH)}node.h {$(VPATH)}ruby_atomic.h {$(VPATH)}vm_core.h {$(VPATH)}vm_debug.h {$(VPATH)}id.h {$(VPATH)}method.h {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}thread_native.h
-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)}thread_$(THREAD_MODEL).c $(ENCODING_H_INCLUDES) \
- {$(VPATH)}internal.h {$(VPATH)}io.h {$(VPATH)}thread.h {$(VPATH)}timev.h {$(VPATH)}vm_opts.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)}internal.h {$(VPATH)}vm_opts.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 \
- {$(VPATH)}internal.h
-variable.$(OBJEXT): {$(VPATH)}variable.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}encoding.h {$(VPATH)}id.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}internal.h {$(VPATH)}constant.h
-version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \
- $(srcdir)/include/ruby/version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h
-loadpath.$(OBJEXT): {$(VPATH)}loadpath.c $(RUBY_H_INCLUDES) \
- $(srcdir)/include/ruby/version.h $(srcdir)/version.h {$(VPATH)}config.h \
- verconf.h
-localeinit.$(OBJEXT): {$(VPATH)}localeinit.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
-miniinit.$(OBJEXT): {$(VPATH)}miniinit.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES)
-
-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)}optunifs.inc {$(VPATH)}opt_sc.inc {$(VPATH)}insns.inc \
- {$(VPATH)}internal.h {$(VPATH)}vm_opts.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)}internal.h {$(VPATH)}vm_opts.h {$(VPATH)}ruby_atomic.h {$(VPATH)}eval_intern.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)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h \
- $(PROBES_H_INCLUDES) {$(VPATH)}probes_helper.h {$(VPATH)}vm_opts.h
-vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}addr2line.h \
- {$(VPATH)}internal.h {$(VPATH)}vm_opts.h
-debug.$(OBJEXT): {$(VPATH)}debug.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_intern.h \
- {$(VPATH)}util.h {$(VPATH)}vm_opts.h {$(VPATH)}internal.h
-id.$(OBJEXT): {$(VPATH)}id.c $(RUBY_H_INCLUDES) {$(VPATH)}id.h {$(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 {$(VPATH)}vm_opts.h {$(VPATH)}ruby_atomic.h {$(VPATH)}eval_intern.h
-vm_trace.$(OBJEXT): {$(VPATH)}vm_trace.c $(ENCODING_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) $(RUBY_H_INCLUDES) {$(VPATH)}debug.h \
- {$(VPATH)}internal.h {$(VPATH)}vm_opts.h {$(VPATH)}ruby_atomic.h {$(VPATH)}eval_intern.h
-miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}vm_opts.h
-prelude.$(OBJEXT): {$(VPATH)}prelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}vm_opts.h
-golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}vm_opts.h
-goruby.$(OBJEXT): {$(VPATH)}goruby.c {$(VPATH)}main.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}vm_debug.h {$(VPATH)}node.h $(hdrdir)/ruby.h
-
-sizes.$(OBJEXT): {$(VPATH)}sizes.c $(RUBY_H_INCLUDES)
-
-ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.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 $(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)}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 $(RUBY_H_INCLUDES)
-
-win32/win32.$(OBJEXT): {$(VPATH)}win32/win32.c {$(VPATH)}dln.h {$(VPATH)}dln_find.c \
- {$(VPATH)}internal.h $(RUBY_H_INCLUDES) $(PLATFORM_D)
-win32/file.$(OBJEXT): {$(VPATH)}win32/file.c $(RUBY_H_INCLUDES) $(PLATFORM_D)
+# dependencies for generated C sources.
+parse.$(OBJEXT): {$(VPATH)}parse.c
+miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
+prelude.$(OBJEXT): {$(VPATH)}prelude.c
+
+# dependencies for optional sources.
+compile.$(OBJEXT): {$(VPATH)}opt_sc.inc {$(VPATH)}optunifs.inc
+
+win32/win32.$(OBJEXT): {$(VPATH)}win32/win32.c {$(VPATH)}win32/file.h \
+ {$(VPATH)}dln.h {$(VPATH)}dln_find.c {$(VPATH)}encindex.h \
+ {$(VPATH)}internal.h {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(PLATFORM_D)
+win32/file.$(OBJEXT): {$(VPATH)}win32/file.c {$(VPATH)}win32/file.h \
+ $(RUBY_H_INCLUDES) $(PLATFORM_D)
$(NEWLINE_C): $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
+ $(Q) $(MAKEDIRS) $(@D)
$(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
+enc/trans/newline.$(OBJEXT): $(NEWLINE_C)
-verconf.h: $(srcdir)/template/verconf.h.in $(srcdir)/tool/generic_erb.rb $(RBCONFIG)
+verconf.h: $(srcdir)/template/verconf.h.tmpl $(srcdir)/tool/generic_erb.rb
$(ECHO) creating $@
- $(Q) $(MINIRUBY) "$(srcdir)/tool/generic_erb.rb" $(srcdir)/template/verconf.h.in > $@
-
-DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
- eval.$(OBJEXT) \
- gc.$(OBJEXT) \
- hash.$(OBJEXT) \
- load.$(OBJEXT) \
- object.$(OBJEXT) \
- parse.$(OBJEXT) \
- string.$(OBJEXT) \
- vm.$(OBJEXT)
+ $(Q) $(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ $(srcdir)/template/verconf.h.tmpl
-probes.$(OBJEXT): $(DTRACE_DEPENDENT_OBJS)
-ruby-glommed.$(OBJEXT): $(OBJS) $(DTRACE_OBJ)
+ruby-glommed.$(OBJEXT): $(OBJS)
$(OBJS): {$(VPATH)}config.h {$(VPATH)}missing.h
@@ -880,20 +771,31 @@ INSNS2VMOPT = --srcdir="$(srcdir)"
{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c srcs-ext srcs-enc
+common-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}enc/trans/newline.c {$(VPATH)}id.c \
+ srcs-lib srcs-ext
-EXT_SRCS = $(srcdir)/ext/ripper/ripper.c $(srcdir)/ext/json/parser/parser.c \
- $(srcdir)/ext/dl/callback/callback.c $(srcdir)/ext/rbconfig/sizeof/sizes.c
+srcs: common-srcs srcs-enc
+
+EXT_SRCS = $(srcdir)/ext/ripper/ripper.c \
+ $(srcdir)/ext/rbconfig/sizeof/sizes.c
srcs-ext: $(EXT_SRCS)
+srcs-extra: $(srcdir)/ext/json/parser/parser.c
+
+LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb
+
+srcs-lib: $(LIB_SRCS)
+
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 {$(VPATH)}id.h {$(VPATH)}probes.dmyh
+all-incs: incs {$(VPATH)}encdb.h {$(VPATH)}transdb.h
+incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}known_errors.inc \
+ {$(VPATH)}vm_call_iseq_optimized.inc $(srcdir)/revision.h \
+ $(REVISION_H) enc/unicode/name2ctype.h enc/jis/props.h \
+ {$(VPATH)}id.h {$(VPATH)}probes.dmyh
insns: $(INSNS)
@@ -925,20 +827,27 @@ known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_
$(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
+vm_call_iseq_optimized.inc: $(srcdir)/tool/mk_call_iseq_optimized.rb
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/mk_call_iseq_optimized.rb > $@
+
+$(MINIPRELUDE_C): $(COMPILE_PRELUDE)
$(ECHO) generating $@
- $(Q) $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -o $@ \
+ $(srcdir)/template/prelude.c.tmpl
-prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) \
- $(srcdir)/lib/rubygems/defaults.rb \
- $(srcdir)/lib/rubygems/core_ext/kernel_gem.rb \
- $(PRELUDE_SCRIPTS) $(PREP)
+$(PRELUDE_C): $(COMPILE_PRELUDE) \
+ {$(srcdir)}lib/rubygems/defaults.rb \
+ {$(srcdir)}lib/rubygems/core_ext/kernel_gem.rb \
+ $(PRELUDE_SCRIPTS) $(LIB_SRCS)
$(ECHO) generating $@
- $(Q) $(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
+ $(srcdir)/template/prelude.c.tmpl $(PRELUDE_SCRIPTS)
-golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude.rb $(srcdir)/golf_prelude.rb $(PREP)
+{$(VPATH)}golf_prelude.c: $(COMPILE_PRELUDE) {$(srcdir)}golf_prelude.rb
$(ECHO) generating $@
- $(Q) $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
+ $(srcdir)/template/prelude.c.tmpl golf_prelude.rb
probes.dmyh: {$(srcdir)}probes.d $(srcdir)/tool/gen_dummy_probes.rb
$(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $(srcdir)/probes.d > $@
@@ -947,6 +856,7 @@ probes.h: {$(VPATH)}probes.$(DTRACE_EXT)
prereq: incs srcs preludes PHONY
+preludes: {$(VPATH)}prelude.c
preludes: {$(VPATH)}miniprelude.c
preludes: {$(srcdir)}golf_prelude.c
@@ -959,23 +869,23 @@ $(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastr
$(srcdir)/ext/ripper/ripper.c: parse.y id.h
$(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
+ $(Q) $(CHDIR) $(@D) && \
+ sed /AUTOGENERATED/q depend | \
+ $(exec) $(MAKE) -f - $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \
+ RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl
$(ECHO) generating $@
$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)"
-$(srcdir)/ext/dl/callback/callback.c: $(srcdir)/ext/dl/callback/mkcallback.rb $(srcdir)/ext/dl/dl.h
- $(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
-
$(srcdir)/ext/rbconfig/sizeof/sizes.c: $(srcdir)/ext/rbconfig/sizeof/depend \
$(srcdir)/tool/generic_erb.rb $(srcdir)/template/sizes.c.tmpl $(srcdir)/configure.in
$(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ $(Q) $(CHDIR) $(@D) && \
+ sed /AUTOGENERATED/q depend | \
+ $(exec) $(MAKE) -f - $(MFLAGS) \
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)"
##
@@ -999,6 +909,11 @@ COMPARE_RUBY = $(BASERUBY)
ITEM =
OPTS =
+# You can pass several options through OPTS environment variable.
+# $ make benchmark OPTS="--help" displays more detail.
+# for example,
+# $ make benchmark COMPARE_RUBY="ruby-trunk" OPTS="-e ruby-2.2.2"
+# This command compares trunk and built-ruby and 2.2.2
benchmark: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
--executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
@@ -1036,38 +951,123 @@ gdb-ruby: $(PROGRAM) run.gdb PHONY
$(Q) $(RUNRUBY_COMMAND) $(RUNRUBY_DEBUGGER) -- $(TESTRUN_SCRIPT)
dist:
- $(BASERUBY) $(srcdir)/tool/make-snapshot tmp $(RELNAME)
+ $(BASERUBY) $(srcdir)/tool/make-snapshot -srcdir=$(srcdir) tmp $(RELNAME)
up::
- -$(Q)$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(REVISION_H)"
+ -$(Q)$(MAKE) $(MFLAGS) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
-update-config_files: $(srcdir)/tool/config.guess $(srcdir)/tool/config.sub
-$(srcdir)/tool/config.guess:
- $(Q) $(BASERUBY) -C $(@D) get-config_files $(@F)
-$(srcdir)/tool/config.sub:
- $(Q) $(BASERUBY) -C $(@D) get-config_files $(@F)
+up::
+ -$(Q)$(MAKE) $(MFLAGS) Q=$(Q) after-update
+
+after-update:: update-unicode update-gems extract-extlibs
+
+update-config_files: PHONY
+ $(Q) $(BASERUBY) -C "$(srcdir)/tool" \
+ ../tool/downloader.rb -e gnu \
+ config.guess config.sub
+
+update-gems: PHONY
+ $(ECHO) Downloading bundled gem files...
+ $(Q) $(BASERUBY) -C "$(srcdir)/gems" \
+ -I../tool -rdownloader -answ \
+ -e 'gem, ver = *$$F' \
+ -e 'old = Dir.glob("#{gem}-*.gem")' \
+ -e 'gem = "#{gem}-#{ver}.gem"' \
+ -e 'Downloader::RubyGems.download(gem, nil, nil) and' \
+ -e 'File.unlink(*(old-[gem]))' \
+ bundled_gems
+
+extract-gems: PHONY
+ $(ECHO) Extracting bundled gem files...
+ $(Q) $(RUNRUBY) -C "$(srcdir)/gems" \
+ -I../tool -rgem-unpack -answ \
+ -e 'gem, ver = *$$F' \
+ -e 'Gem.unpack("#{gem}-#{ver}.gem")' \
+ bundled_gems
+
+UPDATE_LIBRARIES = no
+
+### set the following environment variable or uncomment the line if
+### the Unicode data files are updated every minute.
+# ALWAYS_UPDATE_UNICODE = yes
+
+UNICODE_FILES = $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/UnicodeData.txt \
+ $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/CompositionExclusions.txt \
+ $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/NormalizationTest.txt
+
+update-unicode: $(UNICODE_FILES) PHONY
+
+UNICODE_FILES_DEPS0 = $(UPDATE_LIBRARIES:yes=download-unicode-data)
+UNICODE_FILES_DEPS = $(UNICODE_FILES_DEPS0:no=)
+$(UNICODE_FILES): $(UNICODE_FILES_DEPS)
+
+download-unicode-data: ./.unicode-$(UNICODE_VERSION).time
+./.unicode-$(UNICODE_VERSION).time: PHONY
+ $(ECHO) Downloading Unicode $(UNICODE_VERSION) data files...
+ $(Q) $(MAKEDIRS) "$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)"
+ $(Q) $(BASERUBY) -C "$(srcdir)" tool/downloader.rb \
+ -d enc/unicode/data/$(UNICODE_VERSION) \
+ -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode \
+ $(UNICODE_VERSION)/ucd/UnicodeData.txt \
+ $(UNICODE_VERSION)/ucd/CompositionExclusions.txt \
+ $(UNICODE_VERSION)/ucd/NormalizationTest.txt
+ @exit > $@
+
+$(srcdir)/$(HAVE_BASERUBY:yes=lib/unicode_normalize/tables.rb): \
+ $(UNICODE_FILES_DEPS:download-unicode-data=./.unicode-tables.time)
+
+./.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
+ $(UNICODE_FILES) $(UNICODE_FILES_DEPS) \
+ $(srcdir)/template/unicode_norm_gen.tmpl
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
+ -c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
+ -I $(srcdir) \
+ $(srcdir)/template/unicode_norm_gen.tmpl \
+ enc/unicode/data/$(UNICODE_VERSION) lib/unicode_normalize
+
+download-extlibs:
+ $(Q) $(BASERUBY) -C $(srcdir) -w tool/extlibs.rb --download ext
+
+extract-extlibs:
+ $(Q) $(BASERUBY) -C $(srcdir) -w tool/extlibs.rb --all ext
+
+clean-extlibs:
+ $(Q) $(RMALL) $(srcdir)/.downloaded-cache
+
+clean-gems:
+ $(Q) $(RM) gems/*.gem
+
+CLEAN_CACHE = clean-extlibs
info: info-program info-libruby_a info-libruby_so info-arch
-info-program:
+info-program: PHONY
@echo PROGRAM=$(PROGRAM)
-info-libruby_a:
+info-libruby_a: PHONY
@echo LIBRUBY_A=$(LIBRUBY_A)
-info-libruby_so:
+info-libruby_so: PHONY
@echo LIBRUBY_SO=$(LIBRUBY_SO)
-info-arch:
+info-arch: PHONY
@echo arch=$(arch)
change: PHONY
$(BASERUBY) -C "$(srcdir)" ./tool/change_maker.rb $(CHANGES) > change.log
-love: sudo-precheck up all test install test-all
+exam: check test-rubyspec
+
+love: sudo-precheck up all test install check
@echo love is all you need
yes-test-all: sudo-precheck
-sudo-precheck:
+sudo-precheck: PHONY
@$(SUDO) echo > $(NULL)
+update-man-date: PHONY
+ -$(Q) $(BASERUBY) -I"$(srcdir)/tool" -rvcs -i -p \
+ -e 'BEGIN{@vcs=VCS.detect(ARGV.shift)}' \
+ -e '$$_.sub!(/^(\.Dd ).*/){$$1+@vcs.modified(ARGF.path).strftime("%B %d, %Y")}' \
+ "$(srcdir)" "$(srcdir)"/man/*.1
+
help: PHONY
$(MESSAGE_BEGIN) \
" Makefile of Ruby" \
@@ -1084,11 +1084,12 @@ help: PHONY
" gdb: runs test.rb by miniruby under gdb" \
" gdb-ruby: runs test.rb by ruby under gdb" \
" check: equals make test test-all" \
+ " exam: equals make check test-rubyspec" \
" test: ruby core tests" \
- " test-all: all ruby tests [TESTS=<test files>]" \
+ " test-all: all ruby tests [TESTOPTS=-j4 TESTS=\"<test files>\"]" \
" test-rubyspec: run RubySpec test suite" \
" update-rubyspec: update local copy of RubySpec" \
- " benchmark: benchmark this ruby and COMPARE_RUBY" \
+ " benchmark: benchmark this ruby and COMPARE_RUBY." \
" gcbench: gc benchmark [GCBENCH_ITEM=<item_name>]" \
" gcbench-rdoc: gc benchmark with GCBENCH_ITEM=rdoc" \
" install: install all ruby distributions" \
@@ -1100,5 +1101,1411 @@ help: PHONY
" golf: for golfers" \
"" \
"see DeveloperHowto for more detail: " \
- " http://bugs.ruby-lang.org/wiki/ruby/DeveloperHowto" \
+ " https://bugs.ruby-lang.org/projects/ruby/wiki/DeveloperHowto" \
$(MESSAGE_END)
+
+# AUTOGENERATED DEPENDENCIES START
+addr2line.$(OBJEXT): {$(VPATH)}addr2line.c
+addr2line.$(OBJEXT): {$(VPATH)}addr2line.h
+addr2line.$(OBJEXT): {$(VPATH)}config.h
+addr2line.$(OBJEXT): {$(VPATH)}missing.h
+array.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+array.$(OBJEXT): $(top_srcdir)/include/ruby.h
+array.$(OBJEXT): {$(VPATH)}array.c
+array.$(OBJEXT): {$(VPATH)}config.h
+array.$(OBJEXT): {$(VPATH)}defines.h
+array.$(OBJEXT): {$(VPATH)}encoding.h
+array.$(OBJEXT): {$(VPATH)}id.h
+array.$(OBJEXT): {$(VPATH)}intern.h
+array.$(OBJEXT): {$(VPATH)}internal.h
+array.$(OBJEXT): {$(VPATH)}io.h
+array.$(OBJEXT): {$(VPATH)}missing.h
+array.$(OBJEXT): {$(VPATH)}oniguruma.h
+array.$(OBJEXT): {$(VPATH)}probes.h
+array.$(OBJEXT): {$(VPATH)}st.h
+array.$(OBJEXT): {$(VPATH)}subst.h
+array.$(OBJEXT): {$(VPATH)}util.h
+array.$(OBJEXT): {$(VPATH)}vm_opts.h
+bignum.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+bignum.$(OBJEXT): $(top_srcdir)/include/ruby.h
+bignum.$(OBJEXT): {$(VPATH)}bignum.c
+bignum.$(OBJEXT): {$(VPATH)}config.h
+bignum.$(OBJEXT): {$(VPATH)}defines.h
+bignum.$(OBJEXT): {$(VPATH)}encoding.h
+bignum.$(OBJEXT): {$(VPATH)}intern.h
+bignum.$(OBJEXT): {$(VPATH)}internal.h
+bignum.$(OBJEXT): {$(VPATH)}io.h
+bignum.$(OBJEXT): {$(VPATH)}missing.h
+bignum.$(OBJEXT): {$(VPATH)}oniguruma.h
+bignum.$(OBJEXT): {$(VPATH)}st.h
+bignum.$(OBJEXT): {$(VPATH)}subst.h
+bignum.$(OBJEXT): {$(VPATH)}thread.h
+bignum.$(OBJEXT): {$(VPATH)}util.h
+class.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+class.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+class.$(OBJEXT): $(CCAN_DIR)/list/list.h
+class.$(OBJEXT): $(CCAN_DIR)/str/str.h
+class.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+class.$(OBJEXT): $(top_srcdir)/include/ruby.h
+class.$(OBJEXT): {$(VPATH)}class.c
+class.$(OBJEXT): {$(VPATH)}config.h
+class.$(OBJEXT): {$(VPATH)}constant.h
+class.$(OBJEXT): {$(VPATH)}defines.h
+class.$(OBJEXT): {$(VPATH)}encoding.h
+class.$(OBJEXT): {$(VPATH)}id.h
+class.$(OBJEXT): {$(VPATH)}id_table.h
+class.$(OBJEXT): {$(VPATH)}intern.h
+class.$(OBJEXT): {$(VPATH)}internal.h
+class.$(OBJEXT): {$(VPATH)}io.h
+class.$(OBJEXT): {$(VPATH)}method.h
+class.$(OBJEXT): {$(VPATH)}missing.h
+class.$(OBJEXT): {$(VPATH)}node.h
+class.$(OBJEXT): {$(VPATH)}oniguruma.h
+class.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+class.$(OBJEXT): {$(VPATH)}st.h
+class.$(OBJEXT): {$(VPATH)}subst.h
+class.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+class.$(OBJEXT): {$(VPATH)}thread_native.h
+class.$(OBJEXT): {$(VPATH)}vm_core.h
+class.$(OBJEXT): {$(VPATH)}vm_debug.h
+class.$(OBJEXT): {$(VPATH)}vm_opts.h
+compar.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+compar.$(OBJEXT): {$(VPATH)}compar.c
+compar.$(OBJEXT): {$(VPATH)}config.h
+compar.$(OBJEXT): {$(VPATH)}defines.h
+compar.$(OBJEXT): {$(VPATH)}intern.h
+compar.$(OBJEXT): {$(VPATH)}missing.h
+compar.$(OBJEXT): {$(VPATH)}st.h
+compar.$(OBJEXT): {$(VPATH)}subst.h
+compile.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+compile.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+compile.$(OBJEXT): $(CCAN_DIR)/list/list.h
+compile.$(OBJEXT): $(CCAN_DIR)/str/str.h
+compile.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+compile.$(OBJEXT): $(top_srcdir)/include/ruby.h
+compile.$(OBJEXT): {$(VPATH)}compile.c
+compile.$(OBJEXT): {$(VPATH)}config.h
+compile.$(OBJEXT): {$(VPATH)}defines.h
+compile.$(OBJEXT): {$(VPATH)}encindex.h
+compile.$(OBJEXT): {$(VPATH)}encoding.h
+compile.$(OBJEXT): {$(VPATH)}gc.h
+compile.$(OBJEXT): {$(VPATH)}id.h
+compile.$(OBJEXT): {$(VPATH)}insns.inc
+compile.$(OBJEXT): {$(VPATH)}insns_info.inc
+compile.$(OBJEXT): {$(VPATH)}intern.h
+compile.$(OBJEXT): {$(VPATH)}internal.h
+compile.$(OBJEXT): {$(VPATH)}io.h
+compile.$(OBJEXT): {$(VPATH)}iseq.h
+compile.$(OBJEXT): {$(VPATH)}method.h
+compile.$(OBJEXT): {$(VPATH)}missing.h
+compile.$(OBJEXT): {$(VPATH)}node.h
+compile.$(OBJEXT): {$(VPATH)}oniguruma.h
+compile.$(OBJEXT): {$(VPATH)}optinsn.inc
+compile.$(OBJEXT): {$(VPATH)}re.h
+compile.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+compile.$(OBJEXT): {$(VPATH)}st.h
+compile.$(OBJEXT): {$(VPATH)}subst.h
+compile.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+compile.$(OBJEXT): {$(VPATH)}thread_native.h
+compile.$(OBJEXT): {$(VPATH)}vm_core.h
+compile.$(OBJEXT): {$(VPATH)}vm_debug.h
+compile.$(OBJEXT): {$(VPATH)}vm_opts.h
+complex.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+complex.$(OBJEXT): $(top_srcdir)/include/ruby.h
+complex.$(OBJEXT): {$(VPATH)}complex.c
+complex.$(OBJEXT): {$(VPATH)}config.h
+complex.$(OBJEXT): {$(VPATH)}defines.h
+complex.$(OBJEXT): {$(VPATH)}encoding.h
+complex.$(OBJEXT): {$(VPATH)}intern.h
+complex.$(OBJEXT): {$(VPATH)}internal.h
+complex.$(OBJEXT): {$(VPATH)}io.h
+complex.$(OBJEXT): {$(VPATH)}missing.h
+complex.$(OBJEXT): {$(VPATH)}oniguruma.h
+complex.$(OBJEXT): {$(VPATH)}st.h
+complex.$(OBJEXT): {$(VPATH)}subst.h
+cont.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+cont.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+cont.$(OBJEXT): $(CCAN_DIR)/list/list.h
+cont.$(OBJEXT): $(CCAN_DIR)/str/str.h
+cont.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+cont.$(OBJEXT): $(top_srcdir)/include/ruby.h
+cont.$(OBJEXT): {$(VPATH)}config.h
+cont.$(OBJEXT): {$(VPATH)}cont.c
+cont.$(OBJEXT): {$(VPATH)}defines.h
+cont.$(OBJEXT): {$(VPATH)}encoding.h
+cont.$(OBJEXT): {$(VPATH)}eval_intern.h
+cont.$(OBJEXT): {$(VPATH)}gc.h
+cont.$(OBJEXT): {$(VPATH)}id.h
+cont.$(OBJEXT): {$(VPATH)}intern.h
+cont.$(OBJEXT): {$(VPATH)}internal.h
+cont.$(OBJEXT): {$(VPATH)}io.h
+cont.$(OBJEXT): {$(VPATH)}method.h
+cont.$(OBJEXT): {$(VPATH)}missing.h
+cont.$(OBJEXT): {$(VPATH)}node.h
+cont.$(OBJEXT): {$(VPATH)}oniguruma.h
+cont.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+cont.$(OBJEXT): {$(VPATH)}st.h
+cont.$(OBJEXT): {$(VPATH)}subst.h
+cont.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+cont.$(OBJEXT): {$(VPATH)}thread_native.h
+cont.$(OBJEXT): {$(VPATH)}vm_core.h
+cont.$(OBJEXT): {$(VPATH)}vm_debug.h
+cont.$(OBJEXT): {$(VPATH)}vm_opts.h
+debug.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+debug.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+debug.$(OBJEXT): $(CCAN_DIR)/list/list.h
+debug.$(OBJEXT): $(CCAN_DIR)/str/str.h
+debug.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+debug.$(OBJEXT): $(top_srcdir)/include/ruby.h
+debug.$(OBJEXT): {$(VPATH)}config.h
+debug.$(OBJEXT): {$(VPATH)}debug.c
+debug.$(OBJEXT): {$(VPATH)}defines.h
+debug.$(OBJEXT): {$(VPATH)}encoding.h
+debug.$(OBJEXT): {$(VPATH)}eval_intern.h
+debug.$(OBJEXT): {$(VPATH)}id.h
+debug.$(OBJEXT): {$(VPATH)}intern.h
+debug.$(OBJEXT): {$(VPATH)}internal.h
+debug.$(OBJEXT): {$(VPATH)}io.h
+debug.$(OBJEXT): {$(VPATH)}method.h
+debug.$(OBJEXT): {$(VPATH)}missing.h
+debug.$(OBJEXT): {$(VPATH)}node.h
+debug.$(OBJEXT): {$(VPATH)}oniguruma.h
+debug.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+debug.$(OBJEXT): {$(VPATH)}st.h
+debug.$(OBJEXT): {$(VPATH)}subst.h
+debug.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+debug.$(OBJEXT): {$(VPATH)}thread_native.h
+debug.$(OBJEXT): {$(VPATH)}util.h
+debug.$(OBJEXT): {$(VPATH)}vm_core.h
+debug.$(OBJEXT): {$(VPATH)}vm_debug.h
+debug.$(OBJEXT): {$(VPATH)}vm_opts.h
+dir.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+dir.$(OBJEXT): $(top_srcdir)/include/ruby.h
+dir.$(OBJEXT): {$(VPATH)}config.h
+dir.$(OBJEXT): {$(VPATH)}defines.h
+dir.$(OBJEXT): {$(VPATH)}dir.c
+dir.$(OBJEXT): {$(VPATH)}encindex.h
+dir.$(OBJEXT): {$(VPATH)}encoding.h
+dir.$(OBJEXT): {$(VPATH)}intern.h
+dir.$(OBJEXT): {$(VPATH)}internal.h
+dir.$(OBJEXT): {$(VPATH)}io.h
+dir.$(OBJEXT): {$(VPATH)}missing.h
+dir.$(OBJEXT): {$(VPATH)}oniguruma.h
+dir.$(OBJEXT): {$(VPATH)}st.h
+dir.$(OBJEXT): {$(VPATH)}subst.h
+dir.$(OBJEXT): {$(VPATH)}util.h
+dln.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+dln.$(OBJEXT): {$(VPATH)}config.h
+dln.$(OBJEXT): {$(VPATH)}defines.h
+dln.$(OBJEXT): {$(VPATH)}dln.c
+dln.$(OBJEXT): {$(VPATH)}dln.h
+dln.$(OBJEXT): {$(VPATH)}intern.h
+dln.$(OBJEXT): {$(VPATH)}missing.h
+dln.$(OBJEXT): {$(VPATH)}st.h
+dln.$(OBJEXT): {$(VPATH)}subst.h
+dln_find.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+dln_find.$(OBJEXT): {$(VPATH)}config.h
+dln_find.$(OBJEXT): {$(VPATH)}defines.h
+dln_find.$(OBJEXT): {$(VPATH)}dln.h
+dln_find.$(OBJEXT): {$(VPATH)}dln_find.c
+dln_find.$(OBJEXT): {$(VPATH)}intern.h
+dln_find.$(OBJEXT): {$(VPATH)}missing.h
+dln_find.$(OBJEXT): {$(VPATH)}st.h
+dln_find.$(OBJEXT): {$(VPATH)}subst.h
+dmydln.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+dmydln.$(OBJEXT): {$(VPATH)}config.h
+dmydln.$(OBJEXT): {$(VPATH)}defines.h
+dmydln.$(OBJEXT): {$(VPATH)}dmydln.c
+dmydln.$(OBJEXT): {$(VPATH)}intern.h
+dmydln.$(OBJEXT): {$(VPATH)}missing.h
+dmydln.$(OBJEXT): {$(VPATH)}st.h
+dmydln.$(OBJEXT): {$(VPATH)}subst.h
+dmyenc.$(OBJEXT): {$(VPATH)}dmyenc.c
+dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
+enc/ascii.$(OBJEXT): {$(VPATH)}config.h
+enc/ascii.$(OBJEXT): {$(VPATH)}defines.h
+enc/ascii.$(OBJEXT): {$(VPATH)}enc/ascii.c
+enc/ascii.$(OBJEXT): {$(VPATH)}encindex.h
+enc/ascii.$(OBJEXT): {$(VPATH)}missing.h
+enc/ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
+enc/ascii.$(OBJEXT): {$(VPATH)}regenc.h
+enc/trans/newline.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/newline.$(OBJEXT): {$(VPATH)}config.h
+enc/trans/newline.$(OBJEXT): {$(VPATH)}defines.h
+enc/trans/newline.$(OBJEXT): {$(VPATH)}enc/trans/newline.c
+enc/trans/newline.$(OBJEXT): {$(VPATH)}intern.h
+enc/trans/newline.$(OBJEXT): {$(VPATH)}missing.h
+enc/trans/newline.$(OBJEXT): {$(VPATH)}st.h
+enc/trans/newline.$(OBJEXT): {$(VPATH)}subst.h
+enc/trans/newline.$(OBJEXT): {$(VPATH)}transcode_data.h
+enc/unicode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/unicode.$(OBJEXT): {$(VPATH)}config.h
+enc/unicode.$(OBJEXT): {$(VPATH)}defines.h
+enc/unicode.$(OBJEXT): {$(VPATH)}enc/unicode.c
+enc/unicode.$(OBJEXT): {$(VPATH)}enc/unicode/casefold.h
+enc/unicode.$(OBJEXT): {$(VPATH)}enc/unicode/name2ctype.h
+enc/unicode.$(OBJEXT): {$(VPATH)}intern.h
+enc/unicode.$(OBJEXT): {$(VPATH)}missing.h
+enc/unicode.$(OBJEXT): {$(VPATH)}oniguruma.h
+enc/unicode.$(OBJEXT): {$(VPATH)}regenc.h
+enc/unicode.$(OBJEXT): {$(VPATH)}regint.h
+enc/unicode.$(OBJEXT): {$(VPATH)}st.h
+enc/unicode.$(OBJEXT): {$(VPATH)}subst.h
+enc/us_ascii.$(OBJEXT): {$(VPATH)}config.h
+enc/us_ascii.$(OBJEXT): {$(VPATH)}defines.h
+enc/us_ascii.$(OBJEXT): {$(VPATH)}enc/us_ascii.c
+enc/us_ascii.$(OBJEXT): {$(VPATH)}encindex.h
+enc/us_ascii.$(OBJEXT): {$(VPATH)}missing.h
+enc/us_ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
+enc/us_ascii.$(OBJEXT): {$(VPATH)}regenc.h
+enc/utf_8.$(OBJEXT): {$(VPATH)}config.h
+enc/utf_8.$(OBJEXT): {$(VPATH)}defines.h
+enc/utf_8.$(OBJEXT): {$(VPATH)}enc/utf_8.c
+enc/utf_8.$(OBJEXT): {$(VPATH)}encindex.h
+enc/utf_8.$(OBJEXT): {$(VPATH)}missing.h
+enc/utf_8.$(OBJEXT): {$(VPATH)}oniguruma.h
+enc/utf_8.$(OBJEXT): {$(VPATH)}regenc.h
+encoding.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+encoding.$(OBJEXT): $(top_srcdir)/include/ruby.h
+encoding.$(OBJEXT): {$(VPATH)}config.h
+encoding.$(OBJEXT): {$(VPATH)}defines.h
+encoding.$(OBJEXT): {$(VPATH)}encindex.h
+encoding.$(OBJEXT): {$(VPATH)}encoding.c
+encoding.$(OBJEXT): {$(VPATH)}encoding.h
+encoding.$(OBJEXT): {$(VPATH)}intern.h
+encoding.$(OBJEXT): {$(VPATH)}internal.h
+encoding.$(OBJEXT): {$(VPATH)}io.h
+encoding.$(OBJEXT): {$(VPATH)}missing.h
+encoding.$(OBJEXT): {$(VPATH)}oniguruma.h
+encoding.$(OBJEXT): {$(VPATH)}regenc.h
+encoding.$(OBJEXT): {$(VPATH)}st.h
+encoding.$(OBJEXT): {$(VPATH)}subst.h
+encoding.$(OBJEXT): {$(VPATH)}util.h
+enum.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enum.$(OBJEXT): $(top_srcdir)/include/ruby.h
+enum.$(OBJEXT): {$(VPATH)}config.h
+enum.$(OBJEXT): {$(VPATH)}defines.h
+enum.$(OBJEXT): {$(VPATH)}encoding.h
+enum.$(OBJEXT): {$(VPATH)}enum.c
+enum.$(OBJEXT): {$(VPATH)}id.h
+enum.$(OBJEXT): {$(VPATH)}intern.h
+enum.$(OBJEXT): {$(VPATH)}internal.h
+enum.$(OBJEXT): {$(VPATH)}io.h
+enum.$(OBJEXT): {$(VPATH)}missing.h
+enum.$(OBJEXT): {$(VPATH)}oniguruma.h
+enum.$(OBJEXT): {$(VPATH)}st.h
+enum.$(OBJEXT): {$(VPATH)}subst.h
+enum.$(OBJEXT): {$(VPATH)}util.h
+enumerator.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enumerator.$(OBJEXT): $(top_srcdir)/include/ruby.h
+enumerator.$(OBJEXT): {$(VPATH)}config.h
+enumerator.$(OBJEXT): {$(VPATH)}defines.h
+enumerator.$(OBJEXT): {$(VPATH)}encoding.h
+enumerator.$(OBJEXT): {$(VPATH)}enumerator.c
+enumerator.$(OBJEXT): {$(VPATH)}intern.h
+enumerator.$(OBJEXT): {$(VPATH)}internal.h
+enumerator.$(OBJEXT): {$(VPATH)}io.h
+enumerator.$(OBJEXT): {$(VPATH)}missing.h
+enumerator.$(OBJEXT): {$(VPATH)}oniguruma.h
+enumerator.$(OBJEXT): {$(VPATH)}st.h
+enumerator.$(OBJEXT): {$(VPATH)}subst.h
+error.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+error.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+error.$(OBJEXT): $(CCAN_DIR)/list/list.h
+error.$(OBJEXT): $(CCAN_DIR)/str/str.h
+error.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+error.$(OBJEXT): $(top_srcdir)/include/ruby.h
+error.$(OBJEXT): {$(VPATH)}config.h
+error.$(OBJEXT): {$(VPATH)}defines.h
+error.$(OBJEXT): {$(VPATH)}encoding.h
+error.$(OBJEXT): {$(VPATH)}error.c
+error.$(OBJEXT): {$(VPATH)}id.h
+error.$(OBJEXT): {$(VPATH)}intern.h
+error.$(OBJEXT): {$(VPATH)}internal.h
+error.$(OBJEXT): {$(VPATH)}io.h
+error.$(OBJEXT): {$(VPATH)}known_errors.inc
+error.$(OBJEXT): {$(VPATH)}method.h
+error.$(OBJEXT): {$(VPATH)}missing.h
+error.$(OBJEXT): {$(VPATH)}node.h
+error.$(OBJEXT): {$(VPATH)}oniguruma.h
+error.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+error.$(OBJEXT): {$(VPATH)}st.h
+error.$(OBJEXT): {$(VPATH)}subst.h
+error.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+error.$(OBJEXT): {$(VPATH)}thread_native.h
+error.$(OBJEXT): {$(VPATH)}vm_core.h
+error.$(OBJEXT): {$(VPATH)}vm_debug.h
+error.$(OBJEXT): {$(VPATH)}vm_opts.h
+eval.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+eval.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+eval.$(OBJEXT): $(CCAN_DIR)/list/list.h
+eval.$(OBJEXT): $(CCAN_DIR)/str/str.h
+eval.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+eval.$(OBJEXT): $(top_srcdir)/include/ruby.h
+eval.$(OBJEXT): {$(VPATH)}config.h
+eval.$(OBJEXT): {$(VPATH)}defines.h
+eval.$(OBJEXT): {$(VPATH)}encoding.h
+eval.$(OBJEXT): {$(VPATH)}eval.c
+eval.$(OBJEXT): {$(VPATH)}eval_error.c
+eval.$(OBJEXT): {$(VPATH)}eval_intern.h
+eval.$(OBJEXT): {$(VPATH)}eval_jump.c
+eval.$(OBJEXT): {$(VPATH)}gc.h
+eval.$(OBJEXT): {$(VPATH)}id.h
+eval.$(OBJEXT): {$(VPATH)}intern.h
+eval.$(OBJEXT): {$(VPATH)}internal.h
+eval.$(OBJEXT): {$(VPATH)}io.h
+eval.$(OBJEXT): {$(VPATH)}iseq.h
+eval.$(OBJEXT): {$(VPATH)}method.h
+eval.$(OBJEXT): {$(VPATH)}missing.h
+eval.$(OBJEXT): {$(VPATH)}node.h
+eval.$(OBJEXT): {$(VPATH)}oniguruma.h
+eval.$(OBJEXT): {$(VPATH)}probes.h
+eval.$(OBJEXT): {$(VPATH)}probes_helper.h
+eval.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+eval.$(OBJEXT): {$(VPATH)}st.h
+eval.$(OBJEXT): {$(VPATH)}subst.h
+eval.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+eval.$(OBJEXT): {$(VPATH)}thread_native.h
+eval.$(OBJEXT): {$(VPATH)}vm.h
+eval.$(OBJEXT): {$(VPATH)}vm_core.h
+eval.$(OBJEXT): {$(VPATH)}vm_debug.h
+eval.$(OBJEXT): {$(VPATH)}vm_opts.h
+file.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+file.$(OBJEXT): $(top_srcdir)/include/ruby.h
+file.$(OBJEXT): {$(VPATH)}config.h
+file.$(OBJEXT): {$(VPATH)}defines.h
+file.$(OBJEXT): {$(VPATH)}dln.h
+file.$(OBJEXT): {$(VPATH)}encindex.h
+file.$(OBJEXT): {$(VPATH)}encoding.h
+file.$(OBJEXT): {$(VPATH)}file.c
+file.$(OBJEXT): {$(VPATH)}intern.h
+file.$(OBJEXT): {$(VPATH)}internal.h
+file.$(OBJEXT): {$(VPATH)}io.h
+file.$(OBJEXT): {$(VPATH)}missing.h
+file.$(OBJEXT): {$(VPATH)}oniguruma.h
+file.$(OBJEXT): {$(VPATH)}st.h
+file.$(OBJEXT): {$(VPATH)}subst.h
+file.$(OBJEXT): {$(VPATH)}util.h
+gc.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+gc.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+gc.$(OBJEXT): $(CCAN_DIR)/list/list.h
+gc.$(OBJEXT): $(CCAN_DIR)/str/str.h
+gc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+gc.$(OBJEXT): $(top_srcdir)/include/ruby.h
+gc.$(OBJEXT): {$(VPATH)}config.h
+gc.$(OBJEXT): {$(VPATH)}constant.h
+gc.$(OBJEXT): {$(VPATH)}debug.h
+gc.$(OBJEXT): {$(VPATH)}defines.h
+gc.$(OBJEXT): {$(VPATH)}encoding.h
+gc.$(OBJEXT): {$(VPATH)}eval_intern.h
+gc.$(OBJEXT): {$(VPATH)}gc.c
+gc.$(OBJEXT): {$(VPATH)}gc.h
+gc.$(OBJEXT): {$(VPATH)}id.h
+gc.$(OBJEXT): {$(VPATH)}id_table.h
+gc.$(OBJEXT): {$(VPATH)}intern.h
+gc.$(OBJEXT): {$(VPATH)}internal.h
+gc.$(OBJEXT): {$(VPATH)}io.h
+gc.$(OBJEXT): {$(VPATH)}method.h
+gc.$(OBJEXT): {$(VPATH)}missing.h
+gc.$(OBJEXT): {$(VPATH)}node.h
+gc.$(OBJEXT): {$(VPATH)}oniguruma.h
+gc.$(OBJEXT): {$(VPATH)}probes.h
+gc.$(OBJEXT): {$(VPATH)}re.h
+gc.$(OBJEXT): {$(VPATH)}regenc.h
+gc.$(OBJEXT): {$(VPATH)}regex.h
+gc.$(OBJEXT): {$(VPATH)}regint.h
+gc.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+gc.$(OBJEXT): {$(VPATH)}st.h
+gc.$(OBJEXT): {$(VPATH)}subst.h
+gc.$(OBJEXT): {$(VPATH)}thread.h
+gc.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+gc.$(OBJEXT): {$(VPATH)}thread_native.h
+gc.$(OBJEXT): {$(VPATH)}util.h
+gc.$(OBJEXT): {$(VPATH)}vm_core.h
+gc.$(OBJEXT): {$(VPATH)}vm_debug.h
+gc.$(OBJEXT): {$(VPATH)}vm_opts.h
+golf_prelude.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+golf_prelude.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+golf_prelude.$(OBJEXT): $(CCAN_DIR)/list/list.h
+golf_prelude.$(OBJEXT): $(CCAN_DIR)/str/str.h
+golf_prelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+golf_prelude.$(OBJEXT): $(top_srcdir)/include/ruby.h
+golf_prelude.$(OBJEXT): {$(VPATH)}config.h
+golf_prelude.$(OBJEXT): {$(VPATH)}defines.h
+golf_prelude.$(OBJEXT): {$(VPATH)}encoding.h
+golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c
+golf_prelude.$(OBJEXT): {$(VPATH)}id.h
+golf_prelude.$(OBJEXT): {$(VPATH)}intern.h
+golf_prelude.$(OBJEXT): {$(VPATH)}internal.h
+golf_prelude.$(OBJEXT): {$(VPATH)}io.h
+golf_prelude.$(OBJEXT): {$(VPATH)}method.h
+golf_prelude.$(OBJEXT): {$(VPATH)}missing.h
+golf_prelude.$(OBJEXT): {$(VPATH)}node.h
+golf_prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
+golf_prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+golf_prelude.$(OBJEXT): {$(VPATH)}st.h
+golf_prelude.$(OBJEXT): {$(VPATH)}subst.h
+golf_prelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+golf_prelude.$(OBJEXT): {$(VPATH)}thread_native.h
+golf_prelude.$(OBJEXT): {$(VPATH)}vm_core.h
+golf_prelude.$(OBJEXT): {$(VPATH)}vm_debug.h
+golf_prelude.$(OBJEXT): {$(VPATH)}vm_opts.h
+goruby.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+goruby.$(OBJEXT): $(top_srcdir)/include/ruby.h
+goruby.$(OBJEXT): {$(VPATH)}config.h
+goruby.$(OBJEXT): {$(VPATH)}defines.h
+goruby.$(OBJEXT): {$(VPATH)}goruby.c
+goruby.$(OBJEXT): {$(VPATH)}intern.h
+goruby.$(OBJEXT): {$(VPATH)}main.c
+goruby.$(OBJEXT): {$(VPATH)}missing.h
+goruby.$(OBJEXT): {$(VPATH)}node.h
+goruby.$(OBJEXT): {$(VPATH)}st.h
+goruby.$(OBJEXT): {$(VPATH)}subst.h
+goruby.$(OBJEXT): {$(VPATH)}vm_debug.h
+hash.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+hash.$(OBJEXT): $(top_srcdir)/include/ruby.h
+hash.$(OBJEXT): {$(VPATH)}config.h
+hash.$(OBJEXT): {$(VPATH)}defines.h
+hash.$(OBJEXT): {$(VPATH)}encoding.h
+hash.$(OBJEXT): {$(VPATH)}hash.c
+hash.$(OBJEXT): {$(VPATH)}id.h
+hash.$(OBJEXT): {$(VPATH)}intern.h
+hash.$(OBJEXT): {$(VPATH)}internal.h
+hash.$(OBJEXT): {$(VPATH)}io.h
+hash.$(OBJEXT): {$(VPATH)}missing.h
+hash.$(OBJEXT): {$(VPATH)}oniguruma.h
+hash.$(OBJEXT): {$(VPATH)}probes.h
+hash.$(OBJEXT): {$(VPATH)}st.h
+hash.$(OBJEXT): {$(VPATH)}subst.h
+hash.$(OBJEXT): {$(VPATH)}symbol.h
+hash.$(OBJEXT): {$(VPATH)}util.h
+hash.$(OBJEXT): {$(VPATH)}vm_opts.h
+inits.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+inits.$(OBJEXT): $(top_srcdir)/include/ruby.h
+inits.$(OBJEXT): {$(VPATH)}config.h
+inits.$(OBJEXT): {$(VPATH)}defines.h
+inits.$(OBJEXT): {$(VPATH)}encoding.h
+inits.$(OBJEXT): {$(VPATH)}inits.c
+inits.$(OBJEXT): {$(VPATH)}intern.h
+inits.$(OBJEXT): {$(VPATH)}internal.h
+inits.$(OBJEXT): {$(VPATH)}io.h
+inits.$(OBJEXT): {$(VPATH)}missing.h
+inits.$(OBJEXT): {$(VPATH)}oniguruma.h
+inits.$(OBJEXT): {$(VPATH)}st.h
+inits.$(OBJEXT): {$(VPATH)}subst.h
+io.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+io.$(OBJEXT): $(top_srcdir)/include/ruby.h
+io.$(OBJEXT): {$(VPATH)}config.h
+io.$(OBJEXT): {$(VPATH)}defines.h
+io.$(OBJEXT): {$(VPATH)}dln.h
+io.$(OBJEXT): {$(VPATH)}encindex.h
+io.$(OBJEXT): {$(VPATH)}encoding.h
+io.$(OBJEXT): {$(VPATH)}id.h
+io.$(OBJEXT): {$(VPATH)}intern.h
+io.$(OBJEXT): {$(VPATH)}internal.h
+io.$(OBJEXT): {$(VPATH)}io.c
+io.$(OBJEXT): {$(VPATH)}io.h
+io.$(OBJEXT): {$(VPATH)}missing.h
+io.$(OBJEXT): {$(VPATH)}oniguruma.h
+io.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+io.$(OBJEXT): {$(VPATH)}st.h
+io.$(OBJEXT): {$(VPATH)}subst.h
+io.$(OBJEXT): {$(VPATH)}thread.h
+io.$(OBJEXT): {$(VPATH)}util.h
+iseq.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+iseq.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+iseq.$(OBJEXT): $(CCAN_DIR)/list/list.h
+iseq.$(OBJEXT): $(CCAN_DIR)/str/str.h
+iseq.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+iseq.$(OBJEXT): $(top_srcdir)/include/ruby.h
+iseq.$(OBJEXT): {$(VPATH)}config.h
+iseq.$(OBJEXT): {$(VPATH)}defines.h
+iseq.$(OBJEXT): {$(VPATH)}encoding.h
+iseq.$(OBJEXT): {$(VPATH)}eval_intern.h
+iseq.$(OBJEXT): {$(VPATH)}gc.h
+iseq.$(OBJEXT): {$(VPATH)}id.h
+iseq.$(OBJEXT): {$(VPATH)}insns.inc
+iseq.$(OBJEXT): {$(VPATH)}insns_info.inc
+iseq.$(OBJEXT): {$(VPATH)}intern.h
+iseq.$(OBJEXT): {$(VPATH)}internal.h
+iseq.$(OBJEXT): {$(VPATH)}io.h
+iseq.$(OBJEXT): {$(VPATH)}iseq.c
+iseq.$(OBJEXT): {$(VPATH)}iseq.h
+iseq.$(OBJEXT): {$(VPATH)}method.h
+iseq.$(OBJEXT): {$(VPATH)}missing.h
+iseq.$(OBJEXT): {$(VPATH)}node.h
+iseq.$(OBJEXT): {$(VPATH)}node_name.inc
+iseq.$(OBJEXT): {$(VPATH)}oniguruma.h
+iseq.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+iseq.$(OBJEXT): {$(VPATH)}st.h
+iseq.$(OBJEXT): {$(VPATH)}subst.h
+iseq.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+iseq.$(OBJEXT): {$(VPATH)}thread_native.h
+iseq.$(OBJEXT): {$(VPATH)}util.h
+iseq.$(OBJEXT): {$(VPATH)}vm_core.h
+iseq.$(OBJEXT): {$(VPATH)}vm_debug.h
+iseq.$(OBJEXT): {$(VPATH)}vm_opts.h
+load.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+load.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+load.$(OBJEXT): $(CCAN_DIR)/list/list.h
+load.$(OBJEXT): $(CCAN_DIR)/str/str.h
+load.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+load.$(OBJEXT): $(top_srcdir)/include/ruby.h
+load.$(OBJEXT): {$(VPATH)}config.h
+load.$(OBJEXT): {$(VPATH)}defines.h
+load.$(OBJEXT): {$(VPATH)}dln.h
+load.$(OBJEXT): {$(VPATH)}encoding.h
+load.$(OBJEXT): {$(VPATH)}eval_intern.h
+load.$(OBJEXT): {$(VPATH)}id.h
+load.$(OBJEXT): {$(VPATH)}intern.h
+load.$(OBJEXT): {$(VPATH)}internal.h
+load.$(OBJEXT): {$(VPATH)}io.h
+load.$(OBJEXT): {$(VPATH)}load.c
+load.$(OBJEXT): {$(VPATH)}method.h
+load.$(OBJEXT): {$(VPATH)}missing.h
+load.$(OBJEXT): {$(VPATH)}node.h
+load.$(OBJEXT): {$(VPATH)}oniguruma.h
+load.$(OBJEXT): {$(VPATH)}probes.h
+load.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+load.$(OBJEXT): {$(VPATH)}st.h
+load.$(OBJEXT): {$(VPATH)}subst.h
+load.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+load.$(OBJEXT): {$(VPATH)}thread_native.h
+load.$(OBJEXT): {$(VPATH)}util.h
+load.$(OBJEXT): {$(VPATH)}vm_core.h
+load.$(OBJEXT): {$(VPATH)}vm_debug.h
+load.$(OBJEXT): {$(VPATH)}vm_opts.h
+loadpath.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+loadpath.$(OBJEXT): $(hdrdir)/ruby/version.h
+loadpath.$(OBJEXT): $(top_srcdir)/version.h
+loadpath.$(OBJEXT): {$(VPATH)}config.h
+loadpath.$(OBJEXT): {$(VPATH)}defines.h
+loadpath.$(OBJEXT): {$(VPATH)}intern.h
+loadpath.$(OBJEXT): {$(VPATH)}loadpath.c
+loadpath.$(OBJEXT): {$(VPATH)}missing.h
+loadpath.$(OBJEXT): {$(VPATH)}st.h
+loadpath.$(OBJEXT): {$(VPATH)}subst.h
+loadpath.$(OBJEXT): {$(VPATH)}verconf.h
+localeinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+localeinit.$(OBJEXT): $(top_srcdir)/include/ruby.h
+localeinit.$(OBJEXT): {$(VPATH)}config.h
+localeinit.$(OBJEXT): {$(VPATH)}defines.h
+localeinit.$(OBJEXT): {$(VPATH)}encindex.h
+localeinit.$(OBJEXT): {$(VPATH)}encoding.h
+localeinit.$(OBJEXT): {$(VPATH)}intern.h
+localeinit.$(OBJEXT): {$(VPATH)}internal.h
+localeinit.$(OBJEXT): {$(VPATH)}io.h
+localeinit.$(OBJEXT): {$(VPATH)}localeinit.c
+localeinit.$(OBJEXT): {$(VPATH)}missing.h
+localeinit.$(OBJEXT): {$(VPATH)}oniguruma.h
+localeinit.$(OBJEXT): {$(VPATH)}st.h
+localeinit.$(OBJEXT): {$(VPATH)}subst.h
+main.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+main.$(OBJEXT): $(top_srcdir)/include/ruby.h
+main.$(OBJEXT): {$(VPATH)}config.h
+main.$(OBJEXT): {$(VPATH)}defines.h
+main.$(OBJEXT): {$(VPATH)}intern.h
+main.$(OBJEXT): {$(VPATH)}main.c
+main.$(OBJEXT): {$(VPATH)}missing.h
+main.$(OBJEXT): {$(VPATH)}node.h
+main.$(OBJEXT): {$(VPATH)}st.h
+main.$(OBJEXT): {$(VPATH)}subst.h
+main.$(OBJEXT): {$(VPATH)}vm_debug.h
+marshal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+marshal.$(OBJEXT): $(top_srcdir)/include/ruby.h
+marshal.$(OBJEXT): {$(VPATH)}config.h
+marshal.$(OBJEXT): {$(VPATH)}defines.h
+marshal.$(OBJEXT): {$(VPATH)}encindex.h
+marshal.$(OBJEXT): {$(VPATH)}encoding.h
+marshal.$(OBJEXT): {$(VPATH)}id_table.h
+marshal.$(OBJEXT): {$(VPATH)}intern.h
+marshal.$(OBJEXT): {$(VPATH)}internal.h
+marshal.$(OBJEXT): {$(VPATH)}io.h
+marshal.$(OBJEXT): {$(VPATH)}marshal.c
+marshal.$(OBJEXT): {$(VPATH)}missing.h
+marshal.$(OBJEXT): {$(VPATH)}oniguruma.h
+marshal.$(OBJEXT): {$(VPATH)}st.h
+marshal.$(OBJEXT): {$(VPATH)}subst.h
+marshal.$(OBJEXT): {$(VPATH)}util.h
+math.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+math.$(OBJEXT): $(top_srcdir)/include/ruby.h
+math.$(OBJEXT): {$(VPATH)}config.h
+math.$(OBJEXT): {$(VPATH)}defines.h
+math.$(OBJEXT): {$(VPATH)}encoding.h
+math.$(OBJEXT): {$(VPATH)}intern.h
+math.$(OBJEXT): {$(VPATH)}internal.h
+math.$(OBJEXT): {$(VPATH)}io.h
+math.$(OBJEXT): {$(VPATH)}math.c
+math.$(OBJEXT): {$(VPATH)}missing.h
+math.$(OBJEXT): {$(VPATH)}oniguruma.h
+math.$(OBJEXT): {$(VPATH)}st.h
+math.$(OBJEXT): {$(VPATH)}subst.h
+miniinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+miniinit.$(OBJEXT): {$(VPATH)}config.h
+miniinit.$(OBJEXT): {$(VPATH)}defines.h
+miniinit.$(OBJEXT): {$(VPATH)}encoding.h
+miniinit.$(OBJEXT): {$(VPATH)}intern.h
+miniinit.$(OBJEXT): {$(VPATH)}miniinit.c
+miniinit.$(OBJEXT): {$(VPATH)}missing.h
+miniinit.$(OBJEXT): {$(VPATH)}oniguruma.h
+miniinit.$(OBJEXT): {$(VPATH)}st.h
+miniinit.$(OBJEXT): {$(VPATH)}subst.h
+miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
+node.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+node.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+node.$(OBJEXT): $(CCAN_DIR)/list/list.h
+node.$(OBJEXT): $(CCAN_DIR)/str/str.h
+node.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+node.$(OBJEXT): $(top_srcdir)/include/ruby.h
+node.$(OBJEXT): {$(VPATH)}config.h
+node.$(OBJEXT): {$(VPATH)}defines.h
+node.$(OBJEXT): {$(VPATH)}encoding.h
+node.$(OBJEXT): {$(VPATH)}id.h
+node.$(OBJEXT): {$(VPATH)}intern.h
+node.$(OBJEXT): {$(VPATH)}internal.h
+node.$(OBJEXT): {$(VPATH)}io.h
+node.$(OBJEXT): {$(VPATH)}method.h
+node.$(OBJEXT): {$(VPATH)}missing.h
+node.$(OBJEXT): {$(VPATH)}node.c
+node.$(OBJEXT): {$(VPATH)}node.h
+node.$(OBJEXT): {$(VPATH)}oniguruma.h
+node.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+node.$(OBJEXT): {$(VPATH)}st.h
+node.$(OBJEXT): {$(VPATH)}subst.h
+node.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+node.$(OBJEXT): {$(VPATH)}thread_native.h
+node.$(OBJEXT): {$(VPATH)}vm_core.h
+node.$(OBJEXT): {$(VPATH)}vm_debug.h
+node.$(OBJEXT): {$(VPATH)}vm_opts.h
+numeric.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+numeric.$(OBJEXT): $(top_srcdir)/include/ruby.h
+numeric.$(OBJEXT): {$(VPATH)}config.h
+numeric.$(OBJEXT): {$(VPATH)}defines.h
+numeric.$(OBJEXT): {$(VPATH)}encoding.h
+numeric.$(OBJEXT): {$(VPATH)}id.h
+numeric.$(OBJEXT): {$(VPATH)}intern.h
+numeric.$(OBJEXT): {$(VPATH)}internal.h
+numeric.$(OBJEXT): {$(VPATH)}io.h
+numeric.$(OBJEXT): {$(VPATH)}missing.h
+numeric.$(OBJEXT): {$(VPATH)}numeric.c
+numeric.$(OBJEXT): {$(VPATH)}oniguruma.h
+numeric.$(OBJEXT): {$(VPATH)}st.h
+numeric.$(OBJEXT): {$(VPATH)}subst.h
+numeric.$(OBJEXT): {$(VPATH)}util.h
+object.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+object.$(OBJEXT): $(top_srcdir)/include/ruby.h
+object.$(OBJEXT): {$(VPATH)}config.h
+object.$(OBJEXT): {$(VPATH)}constant.h
+object.$(OBJEXT): {$(VPATH)}defines.h
+object.$(OBJEXT): {$(VPATH)}encoding.h
+object.$(OBJEXT): {$(VPATH)}id.h
+object.$(OBJEXT): {$(VPATH)}intern.h
+object.$(OBJEXT): {$(VPATH)}internal.h
+object.$(OBJEXT): {$(VPATH)}io.h
+object.$(OBJEXT): {$(VPATH)}missing.h
+object.$(OBJEXT): {$(VPATH)}object.c
+object.$(OBJEXT): {$(VPATH)}oniguruma.h
+object.$(OBJEXT): {$(VPATH)}probes.h
+object.$(OBJEXT): {$(VPATH)}st.h
+object.$(OBJEXT): {$(VPATH)}subst.h
+object.$(OBJEXT): {$(VPATH)}util.h
+object.$(OBJEXT): {$(VPATH)}vm_opts.h
+pack.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+pack.$(OBJEXT): $(top_srcdir)/include/ruby.h
+pack.$(OBJEXT): {$(VPATH)}config.h
+pack.$(OBJEXT): {$(VPATH)}defines.h
+pack.$(OBJEXT): {$(VPATH)}encoding.h
+pack.$(OBJEXT): {$(VPATH)}intern.h
+pack.$(OBJEXT): {$(VPATH)}internal.h
+pack.$(OBJEXT): {$(VPATH)}io.h
+pack.$(OBJEXT): {$(VPATH)}missing.h
+pack.$(OBJEXT): {$(VPATH)}oniguruma.h
+pack.$(OBJEXT): {$(VPATH)}pack.c
+pack.$(OBJEXT): {$(VPATH)}st.h
+pack.$(OBJEXT): {$(VPATH)}subst.h
+parse.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+parse.$(OBJEXT): $(top_srcdir)/include/ruby.h
+parse.$(OBJEXT): {$(VPATH)}config.h
+parse.$(OBJEXT): {$(VPATH)}defines.h
+parse.$(OBJEXT): {$(VPATH)}defs/keywords
+parse.$(OBJEXT): {$(VPATH)}encoding.h
+parse.$(OBJEXT): {$(VPATH)}id.h
+parse.$(OBJEXT): {$(VPATH)}intern.h
+parse.$(OBJEXT): {$(VPATH)}internal.h
+parse.$(OBJEXT): {$(VPATH)}io.h
+parse.$(OBJEXT): {$(VPATH)}lex.c
+parse.$(OBJEXT): {$(VPATH)}missing.h
+parse.$(OBJEXT): {$(VPATH)}node.h
+parse.$(OBJEXT): {$(VPATH)}oniguruma.h
+parse.$(OBJEXT): {$(VPATH)}parse.c
+parse.$(OBJEXT): {$(VPATH)}parse.h
+parse.$(OBJEXT): {$(VPATH)}parse.y
+parse.$(OBJEXT): {$(VPATH)}probes.h
+parse.$(OBJEXT): {$(VPATH)}regenc.h
+parse.$(OBJEXT): {$(VPATH)}regex.h
+parse.$(OBJEXT): {$(VPATH)}st.h
+parse.$(OBJEXT): {$(VPATH)}subst.h
+parse.$(OBJEXT): {$(VPATH)}symbol.h
+parse.$(OBJEXT): {$(VPATH)}util.h
+parse.$(OBJEXT): {$(VPATH)}vm_opts.h
+prelude.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+prelude.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+prelude.$(OBJEXT): $(CCAN_DIR)/list/list.h
+prelude.$(OBJEXT): $(CCAN_DIR)/str/str.h
+prelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+prelude.$(OBJEXT): $(top_srcdir)/include/ruby.h
+prelude.$(OBJEXT): {$(VPATH)}config.h
+prelude.$(OBJEXT): {$(VPATH)}defines.h
+prelude.$(OBJEXT): {$(VPATH)}encoding.h
+prelude.$(OBJEXT): {$(VPATH)}id.h
+prelude.$(OBJEXT): {$(VPATH)}intern.h
+prelude.$(OBJEXT): {$(VPATH)}internal.h
+prelude.$(OBJEXT): {$(VPATH)}io.h
+prelude.$(OBJEXT): {$(VPATH)}method.h
+prelude.$(OBJEXT): {$(VPATH)}missing.h
+prelude.$(OBJEXT): {$(VPATH)}node.h
+prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
+prelude.$(OBJEXT): {$(VPATH)}prelude.c
+prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+prelude.$(OBJEXT): {$(VPATH)}st.h
+prelude.$(OBJEXT): {$(VPATH)}subst.h
+prelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+prelude.$(OBJEXT): {$(VPATH)}thread_native.h
+prelude.$(OBJEXT): {$(VPATH)}vm_core.h
+prelude.$(OBJEXT): {$(VPATH)}vm_debug.h
+prelude.$(OBJEXT): {$(VPATH)}vm_opts.h
+proc.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+proc.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+proc.$(OBJEXT): $(CCAN_DIR)/list/list.h
+proc.$(OBJEXT): $(CCAN_DIR)/str/str.h
+proc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+proc.$(OBJEXT): $(top_srcdir)/include/ruby.h
+proc.$(OBJEXT): {$(VPATH)}config.h
+proc.$(OBJEXT): {$(VPATH)}defines.h
+proc.$(OBJEXT): {$(VPATH)}encoding.h
+proc.$(OBJEXT): {$(VPATH)}eval_intern.h
+proc.$(OBJEXT): {$(VPATH)}gc.h
+proc.$(OBJEXT): {$(VPATH)}id.h
+proc.$(OBJEXT): {$(VPATH)}intern.h
+proc.$(OBJEXT): {$(VPATH)}internal.h
+proc.$(OBJEXT): {$(VPATH)}io.h
+proc.$(OBJEXT): {$(VPATH)}iseq.h
+proc.$(OBJEXT): {$(VPATH)}method.h
+proc.$(OBJEXT): {$(VPATH)}missing.h
+proc.$(OBJEXT): {$(VPATH)}node.h
+proc.$(OBJEXT): {$(VPATH)}oniguruma.h
+proc.$(OBJEXT): {$(VPATH)}proc.c
+proc.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+proc.$(OBJEXT): {$(VPATH)}st.h
+proc.$(OBJEXT): {$(VPATH)}subst.h
+proc.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+proc.$(OBJEXT): {$(VPATH)}thread_native.h
+proc.$(OBJEXT): {$(VPATH)}vm_core.h
+proc.$(OBJEXT): {$(VPATH)}vm_debug.h
+proc.$(OBJEXT): {$(VPATH)}vm_opts.h
+process.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+process.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+process.$(OBJEXT): $(CCAN_DIR)/list/list.h
+process.$(OBJEXT): $(CCAN_DIR)/str/str.h
+process.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+process.$(OBJEXT): $(top_srcdir)/include/ruby.h
+process.$(OBJEXT): {$(VPATH)}config.h
+process.$(OBJEXT): {$(VPATH)}defines.h
+process.$(OBJEXT): {$(VPATH)}dln.h
+process.$(OBJEXT): {$(VPATH)}encoding.h
+process.$(OBJEXT): {$(VPATH)}id.h
+process.$(OBJEXT): {$(VPATH)}intern.h
+process.$(OBJEXT): {$(VPATH)}internal.h
+process.$(OBJEXT): {$(VPATH)}io.h
+process.$(OBJEXT): {$(VPATH)}method.h
+process.$(OBJEXT): {$(VPATH)}missing.h
+process.$(OBJEXT): {$(VPATH)}node.h
+process.$(OBJEXT): {$(VPATH)}oniguruma.h
+process.$(OBJEXT): {$(VPATH)}process.c
+process.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+process.$(OBJEXT): {$(VPATH)}st.h
+process.$(OBJEXT): {$(VPATH)}subst.h
+process.$(OBJEXT): {$(VPATH)}thread.h
+process.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+process.$(OBJEXT): {$(VPATH)}thread_native.h
+process.$(OBJEXT): {$(VPATH)}util.h
+process.$(OBJEXT): {$(VPATH)}vm_core.h
+process.$(OBJEXT): {$(VPATH)}vm_debug.h
+process.$(OBJEXT): {$(VPATH)}vm_opts.h
+random.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+random.$(OBJEXT): $(top_srcdir)/include/ruby.h
+random.$(OBJEXT): {$(VPATH)}config.h
+random.$(OBJEXT): {$(VPATH)}defines.h
+random.$(OBJEXT): {$(VPATH)}encoding.h
+random.$(OBJEXT): {$(VPATH)}intern.h
+random.$(OBJEXT): {$(VPATH)}internal.h
+random.$(OBJEXT): {$(VPATH)}io.h
+random.$(OBJEXT): {$(VPATH)}missing.h
+random.$(OBJEXT): {$(VPATH)}oniguruma.h
+random.$(OBJEXT): {$(VPATH)}random.c
+random.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+random.$(OBJEXT): {$(VPATH)}siphash.c
+random.$(OBJEXT): {$(VPATH)}siphash.h
+random.$(OBJEXT): {$(VPATH)}st.h
+random.$(OBJEXT): {$(VPATH)}subst.h
+range.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+range.$(OBJEXT): $(top_srcdir)/include/ruby.h
+range.$(OBJEXT): {$(VPATH)}config.h
+range.$(OBJEXT): {$(VPATH)}defines.h
+range.$(OBJEXT): {$(VPATH)}encoding.h
+range.$(OBJEXT): {$(VPATH)}id.h
+range.$(OBJEXT): {$(VPATH)}intern.h
+range.$(OBJEXT): {$(VPATH)}internal.h
+range.$(OBJEXT): {$(VPATH)}io.h
+range.$(OBJEXT): {$(VPATH)}missing.h
+range.$(OBJEXT): {$(VPATH)}oniguruma.h
+range.$(OBJEXT): {$(VPATH)}range.c
+range.$(OBJEXT): {$(VPATH)}st.h
+range.$(OBJEXT): {$(VPATH)}subst.h
+rational.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+rational.$(OBJEXT): $(top_srcdir)/include/ruby.h
+rational.$(OBJEXT): {$(VPATH)}config.h
+rational.$(OBJEXT): {$(VPATH)}defines.h
+rational.$(OBJEXT): {$(VPATH)}encoding.h
+rational.$(OBJEXT): {$(VPATH)}intern.h
+rational.$(OBJEXT): {$(VPATH)}internal.h
+rational.$(OBJEXT): {$(VPATH)}io.h
+rational.$(OBJEXT): {$(VPATH)}missing.h
+rational.$(OBJEXT): {$(VPATH)}oniguruma.h
+rational.$(OBJEXT): {$(VPATH)}rational.c
+rational.$(OBJEXT): {$(VPATH)}st.h
+rational.$(OBJEXT): {$(VPATH)}subst.h
+re.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+re.$(OBJEXT): $(top_srcdir)/include/ruby.h
+re.$(OBJEXT): {$(VPATH)}config.h
+re.$(OBJEXT): {$(VPATH)}defines.h
+re.$(OBJEXT): {$(VPATH)}encindex.h
+re.$(OBJEXT): {$(VPATH)}encoding.h
+re.$(OBJEXT): {$(VPATH)}intern.h
+re.$(OBJEXT): {$(VPATH)}internal.h
+re.$(OBJEXT): {$(VPATH)}io.h
+re.$(OBJEXT): {$(VPATH)}missing.h
+re.$(OBJEXT): {$(VPATH)}oniguruma.h
+re.$(OBJEXT): {$(VPATH)}re.c
+re.$(OBJEXT): {$(VPATH)}re.h
+re.$(OBJEXT): {$(VPATH)}regenc.h
+re.$(OBJEXT): {$(VPATH)}regex.h
+re.$(OBJEXT): {$(VPATH)}regint.h
+re.$(OBJEXT): {$(VPATH)}st.h
+re.$(OBJEXT): {$(VPATH)}subst.h
+re.$(OBJEXT): {$(VPATH)}util.h
+regcomp.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+regcomp.$(OBJEXT): {$(VPATH)}config.h
+regcomp.$(OBJEXT): {$(VPATH)}defines.h
+regcomp.$(OBJEXT): {$(VPATH)}intern.h
+regcomp.$(OBJEXT): {$(VPATH)}missing.h
+regcomp.$(OBJEXT): {$(VPATH)}oniguruma.h
+regcomp.$(OBJEXT): {$(VPATH)}regcomp.c
+regcomp.$(OBJEXT): {$(VPATH)}regenc.h
+regcomp.$(OBJEXT): {$(VPATH)}regint.h
+regcomp.$(OBJEXT): {$(VPATH)}regparse.h
+regcomp.$(OBJEXT): {$(VPATH)}st.h
+regcomp.$(OBJEXT): {$(VPATH)}subst.h
+regenc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+regenc.$(OBJEXT): {$(VPATH)}config.h
+regenc.$(OBJEXT): {$(VPATH)}defines.h
+regenc.$(OBJEXT): {$(VPATH)}intern.h
+regenc.$(OBJEXT): {$(VPATH)}missing.h
+regenc.$(OBJEXT): {$(VPATH)}oniguruma.h
+regenc.$(OBJEXT): {$(VPATH)}regenc.c
+regenc.$(OBJEXT): {$(VPATH)}regenc.h
+regenc.$(OBJEXT): {$(VPATH)}regint.h
+regenc.$(OBJEXT): {$(VPATH)}st.h
+regenc.$(OBJEXT): {$(VPATH)}subst.h
+regerror.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+regerror.$(OBJEXT): {$(VPATH)}config.h
+regerror.$(OBJEXT): {$(VPATH)}defines.h
+regerror.$(OBJEXT): {$(VPATH)}intern.h
+regerror.$(OBJEXT): {$(VPATH)}missing.h
+regerror.$(OBJEXT): {$(VPATH)}oniguruma.h
+regerror.$(OBJEXT): {$(VPATH)}regenc.h
+regerror.$(OBJEXT): {$(VPATH)}regerror.c
+regerror.$(OBJEXT): {$(VPATH)}regint.h
+regerror.$(OBJEXT): {$(VPATH)}st.h
+regerror.$(OBJEXT): {$(VPATH)}subst.h
+regexec.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+regexec.$(OBJEXT): {$(VPATH)}config.h
+regexec.$(OBJEXT): {$(VPATH)}defines.h
+regexec.$(OBJEXT): {$(VPATH)}intern.h
+regexec.$(OBJEXT): {$(VPATH)}missing.h
+regexec.$(OBJEXT): {$(VPATH)}oniguruma.h
+regexec.$(OBJEXT): {$(VPATH)}regenc.h
+regexec.$(OBJEXT): {$(VPATH)}regexec.c
+regexec.$(OBJEXT): {$(VPATH)}regint.h
+regexec.$(OBJEXT): {$(VPATH)}st.h
+regexec.$(OBJEXT): {$(VPATH)}subst.h
+regparse.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+regparse.$(OBJEXT): {$(VPATH)}config.h
+regparse.$(OBJEXT): {$(VPATH)}defines.h
+regparse.$(OBJEXT): {$(VPATH)}intern.h
+regparse.$(OBJEXT): {$(VPATH)}missing.h
+regparse.$(OBJEXT): {$(VPATH)}oniguruma.h
+regparse.$(OBJEXT): {$(VPATH)}regenc.h
+regparse.$(OBJEXT): {$(VPATH)}regint.h
+regparse.$(OBJEXT): {$(VPATH)}regparse.c
+regparse.$(OBJEXT): {$(VPATH)}regparse.h
+regparse.$(OBJEXT): {$(VPATH)}st.h
+regparse.$(OBJEXT): {$(VPATH)}subst.h
+regsyntax.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+regsyntax.$(OBJEXT): {$(VPATH)}config.h
+regsyntax.$(OBJEXT): {$(VPATH)}defines.h
+regsyntax.$(OBJEXT): {$(VPATH)}intern.h
+regsyntax.$(OBJEXT): {$(VPATH)}missing.h
+regsyntax.$(OBJEXT): {$(VPATH)}oniguruma.h
+regsyntax.$(OBJEXT): {$(VPATH)}regenc.h
+regsyntax.$(OBJEXT): {$(VPATH)}regint.h
+regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c
+regsyntax.$(OBJEXT): {$(VPATH)}st.h
+regsyntax.$(OBJEXT): {$(VPATH)}subst.h
+ruby.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+ruby.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+ruby.$(OBJEXT): $(CCAN_DIR)/list/list.h
+ruby.$(OBJEXT): $(CCAN_DIR)/str/str.h
+ruby.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+ruby.$(OBJEXT): $(top_srcdir)/include/ruby.h
+ruby.$(OBJEXT): {$(VPATH)}config.h
+ruby.$(OBJEXT): {$(VPATH)}defines.h
+ruby.$(OBJEXT): {$(VPATH)}dln.h
+ruby.$(OBJEXT): {$(VPATH)}encoding.h
+ruby.$(OBJEXT): {$(VPATH)}eval_intern.h
+ruby.$(OBJEXT): {$(VPATH)}id.h
+ruby.$(OBJEXT): {$(VPATH)}intern.h
+ruby.$(OBJEXT): {$(VPATH)}internal.h
+ruby.$(OBJEXT): {$(VPATH)}io.h
+ruby.$(OBJEXT): {$(VPATH)}method.h
+ruby.$(OBJEXT): {$(VPATH)}missing.h
+ruby.$(OBJEXT): {$(VPATH)}node.h
+ruby.$(OBJEXT): {$(VPATH)}oniguruma.h
+ruby.$(OBJEXT): {$(VPATH)}ruby.c
+ruby.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+ruby.$(OBJEXT): {$(VPATH)}st.h
+ruby.$(OBJEXT): {$(VPATH)}subst.h
+ruby.$(OBJEXT): {$(VPATH)}thread.h
+ruby.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+ruby.$(OBJEXT): {$(VPATH)}thread_native.h
+ruby.$(OBJEXT): {$(VPATH)}util.h
+ruby.$(OBJEXT): {$(VPATH)}vm_core.h
+ruby.$(OBJEXT): {$(VPATH)}vm_debug.h
+ruby.$(OBJEXT): {$(VPATH)}vm_opts.h
+safe.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+safe.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+safe.$(OBJEXT): $(CCAN_DIR)/list/list.h
+safe.$(OBJEXT): $(CCAN_DIR)/str/str.h
+safe.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+safe.$(OBJEXT): $(top_srcdir)/include/ruby.h
+safe.$(OBJEXT): {$(VPATH)}config.h
+safe.$(OBJEXT): {$(VPATH)}defines.h
+safe.$(OBJEXT): {$(VPATH)}encoding.h
+safe.$(OBJEXT): {$(VPATH)}id.h
+safe.$(OBJEXT): {$(VPATH)}intern.h
+safe.$(OBJEXT): {$(VPATH)}internal.h
+safe.$(OBJEXT): {$(VPATH)}io.h
+safe.$(OBJEXT): {$(VPATH)}method.h
+safe.$(OBJEXT): {$(VPATH)}missing.h
+safe.$(OBJEXT): {$(VPATH)}node.h
+safe.$(OBJEXT): {$(VPATH)}oniguruma.h
+safe.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+safe.$(OBJEXT): {$(VPATH)}safe.c
+safe.$(OBJEXT): {$(VPATH)}st.h
+safe.$(OBJEXT): {$(VPATH)}subst.h
+safe.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+safe.$(OBJEXT): {$(VPATH)}thread_native.h
+safe.$(OBJEXT): {$(VPATH)}vm_core.h
+safe.$(OBJEXT): {$(VPATH)}vm_debug.h
+safe.$(OBJEXT): {$(VPATH)}vm_opts.h
+setproctitle.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+setproctitle.$(OBJEXT): $(top_srcdir)/include/ruby.h
+setproctitle.$(OBJEXT): {$(VPATH)}config.h
+setproctitle.$(OBJEXT): {$(VPATH)}defines.h
+setproctitle.$(OBJEXT): {$(VPATH)}intern.h
+setproctitle.$(OBJEXT): {$(VPATH)}missing.h
+setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c
+setproctitle.$(OBJEXT): {$(VPATH)}st.h
+setproctitle.$(OBJEXT): {$(VPATH)}subst.h
+setproctitle.$(OBJEXT): {$(VPATH)}util.h
+signal.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+signal.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+signal.$(OBJEXT): $(CCAN_DIR)/list/list.h
+signal.$(OBJEXT): $(CCAN_DIR)/str/str.h
+signal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+signal.$(OBJEXT): $(top_srcdir)/include/ruby.h
+signal.$(OBJEXT): {$(VPATH)}config.h
+signal.$(OBJEXT): {$(VPATH)}defines.h
+signal.$(OBJEXT): {$(VPATH)}encoding.h
+signal.$(OBJEXT): {$(VPATH)}eval_intern.h
+signal.$(OBJEXT): {$(VPATH)}id.h
+signal.$(OBJEXT): {$(VPATH)}intern.h
+signal.$(OBJEXT): {$(VPATH)}internal.h
+signal.$(OBJEXT): {$(VPATH)}io.h
+signal.$(OBJEXT): {$(VPATH)}method.h
+signal.$(OBJEXT): {$(VPATH)}missing.h
+signal.$(OBJEXT): {$(VPATH)}node.h
+signal.$(OBJEXT): {$(VPATH)}oniguruma.h
+signal.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+signal.$(OBJEXT): {$(VPATH)}signal.c
+signal.$(OBJEXT): {$(VPATH)}st.h
+signal.$(OBJEXT): {$(VPATH)}subst.h
+signal.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+signal.$(OBJEXT): {$(VPATH)}thread_native.h
+signal.$(OBJEXT): {$(VPATH)}vm_core.h
+signal.$(OBJEXT): {$(VPATH)}vm_debug.h
+signal.$(OBJEXT): {$(VPATH)}vm_opts.h
+sprintf.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+sprintf.$(OBJEXT): $(top_srcdir)/include/ruby.h
+sprintf.$(OBJEXT): {$(VPATH)}config.h
+sprintf.$(OBJEXT): {$(VPATH)}defines.h
+sprintf.$(OBJEXT): {$(VPATH)}encoding.h
+sprintf.$(OBJEXT): {$(VPATH)}id.h
+sprintf.$(OBJEXT): {$(VPATH)}intern.h
+sprintf.$(OBJEXT): {$(VPATH)}internal.h
+sprintf.$(OBJEXT): {$(VPATH)}io.h
+sprintf.$(OBJEXT): {$(VPATH)}missing.h
+sprintf.$(OBJEXT): {$(VPATH)}oniguruma.h
+sprintf.$(OBJEXT): {$(VPATH)}re.h
+sprintf.$(OBJEXT): {$(VPATH)}regex.h
+sprintf.$(OBJEXT): {$(VPATH)}sprintf.c
+sprintf.$(OBJEXT): {$(VPATH)}st.h
+sprintf.$(OBJEXT): {$(VPATH)}subst.h
+sprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
+st.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+st.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+st.$(OBJEXT): $(CCAN_DIR)/list/list.h
+st.$(OBJEXT): $(CCAN_DIR)/str/str.h
+st.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+st.$(OBJEXT): $(top_srcdir)/include/ruby.h
+st.$(OBJEXT): {$(VPATH)}config.h
+st.$(OBJEXT): {$(VPATH)}defines.h
+st.$(OBJEXT): {$(VPATH)}encoding.h
+st.$(OBJEXT): {$(VPATH)}intern.h
+st.$(OBJEXT): {$(VPATH)}internal.h
+st.$(OBJEXT): {$(VPATH)}io.h
+st.$(OBJEXT): {$(VPATH)}missing.h
+st.$(OBJEXT): {$(VPATH)}oniguruma.h
+st.$(OBJEXT): {$(VPATH)}st.c
+st.$(OBJEXT): {$(VPATH)}st.h
+st.$(OBJEXT): {$(VPATH)}subst.h
+strftime.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+strftime.$(OBJEXT): {$(VPATH)}config.h
+strftime.$(OBJEXT): {$(VPATH)}defines.h
+strftime.$(OBJEXT): {$(VPATH)}encoding.h
+strftime.$(OBJEXT): {$(VPATH)}intern.h
+strftime.$(OBJEXT): {$(VPATH)}missing.h
+strftime.$(OBJEXT): {$(VPATH)}oniguruma.h
+strftime.$(OBJEXT): {$(VPATH)}st.h
+strftime.$(OBJEXT): {$(VPATH)}strftime.c
+strftime.$(OBJEXT): {$(VPATH)}subst.h
+strftime.$(OBJEXT): {$(VPATH)}timev.h
+string.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+string.$(OBJEXT): $(top_srcdir)/include/ruby.h
+string.$(OBJEXT): {$(VPATH)}config.h
+string.$(OBJEXT): {$(VPATH)}defines.h
+string.$(OBJEXT): {$(VPATH)}encindex.h
+string.$(OBJEXT): {$(VPATH)}encoding.h
+string.$(OBJEXT): {$(VPATH)}gc.h
+string.$(OBJEXT): {$(VPATH)}id.h
+string.$(OBJEXT): {$(VPATH)}intern.h
+string.$(OBJEXT): {$(VPATH)}internal.h
+string.$(OBJEXT): {$(VPATH)}io.h
+string.$(OBJEXT): {$(VPATH)}missing.h
+string.$(OBJEXT): {$(VPATH)}oniguruma.h
+string.$(OBJEXT): {$(VPATH)}probes.h
+string.$(OBJEXT): {$(VPATH)}re.h
+string.$(OBJEXT): {$(VPATH)}regex.h
+string.$(OBJEXT): {$(VPATH)}st.h
+string.$(OBJEXT): {$(VPATH)}string.c
+string.$(OBJEXT): {$(VPATH)}subst.h
+string.$(OBJEXT): {$(VPATH)}vm_opts.h
+strlcat.$(OBJEXT): {$(VPATH)}config.h
+strlcat.$(OBJEXT): {$(VPATH)}missing.h
+strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
+strlcpy.$(OBJEXT): {$(VPATH)}config.h
+strlcpy.$(OBJEXT): {$(VPATH)}missing.h
+strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
+struct.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+struct.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+struct.$(OBJEXT): $(CCAN_DIR)/list/list.h
+struct.$(OBJEXT): $(CCAN_DIR)/str/str.h
+struct.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+struct.$(OBJEXT): $(top_srcdir)/include/ruby.h
+struct.$(OBJEXT): {$(VPATH)}config.h
+struct.$(OBJEXT): {$(VPATH)}defines.h
+struct.$(OBJEXT): {$(VPATH)}encoding.h
+struct.$(OBJEXT): {$(VPATH)}id.h
+struct.$(OBJEXT): {$(VPATH)}intern.h
+struct.$(OBJEXT): {$(VPATH)}internal.h
+struct.$(OBJEXT): {$(VPATH)}io.h
+struct.$(OBJEXT): {$(VPATH)}method.h
+struct.$(OBJEXT): {$(VPATH)}missing.h
+struct.$(OBJEXT): {$(VPATH)}node.h
+struct.$(OBJEXT): {$(VPATH)}oniguruma.h
+struct.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+struct.$(OBJEXT): {$(VPATH)}st.h
+struct.$(OBJEXT): {$(VPATH)}struct.c
+struct.$(OBJEXT): {$(VPATH)}subst.h
+struct.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+struct.$(OBJEXT): {$(VPATH)}thread_native.h
+struct.$(OBJEXT): {$(VPATH)}vm_core.h
+struct.$(OBJEXT): {$(VPATH)}vm_debug.h
+struct.$(OBJEXT): {$(VPATH)}vm_opts.h
+symbol.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+symbol.$(OBJEXT): $(top_srcdir)/include/ruby.h
+symbol.$(OBJEXT): {$(VPATH)}config.h
+symbol.$(OBJEXT): {$(VPATH)}defines.h
+symbol.$(OBJEXT): {$(VPATH)}encoding.h
+symbol.$(OBJEXT): {$(VPATH)}gc.h
+symbol.$(OBJEXT): {$(VPATH)}id.c
+symbol.$(OBJEXT): {$(VPATH)}id.h
+symbol.$(OBJEXT): {$(VPATH)}intern.h
+symbol.$(OBJEXT): {$(VPATH)}internal.h
+symbol.$(OBJEXT): {$(VPATH)}io.h
+symbol.$(OBJEXT): {$(VPATH)}missing.h
+symbol.$(OBJEXT): {$(VPATH)}oniguruma.h
+symbol.$(OBJEXT): {$(VPATH)}probes.h
+symbol.$(OBJEXT): {$(VPATH)}st.h
+symbol.$(OBJEXT): {$(VPATH)}subst.h
+symbol.$(OBJEXT): {$(VPATH)}symbol.c
+symbol.$(OBJEXT): {$(VPATH)}id_table.c
+symbol.$(OBJEXT): {$(VPATH)}id_table.h
+symbol.$(OBJEXT): {$(VPATH)}symbol.h
+symbol.$(OBJEXT): {$(VPATH)}vm_opts.h
+thread.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+thread.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+thread.$(OBJEXT): $(CCAN_DIR)/list/list.h
+thread.$(OBJEXT): $(CCAN_DIR)/str/str.h
+thread.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+thread.$(OBJEXT): $(top_srcdir)/include/ruby.h
+thread.$(OBJEXT): {$(VPATH)}config.h
+thread.$(OBJEXT): {$(VPATH)}defines.h
+thread.$(OBJEXT): {$(VPATH)}encoding.h
+thread.$(OBJEXT): {$(VPATH)}eval_intern.h
+thread.$(OBJEXT): {$(VPATH)}gc.h
+thread.$(OBJEXT): {$(VPATH)}id.h
+thread.$(OBJEXT): {$(VPATH)}intern.h
+thread.$(OBJEXT): {$(VPATH)}internal.h
+thread.$(OBJEXT): {$(VPATH)}io.h
+thread.$(OBJEXT): {$(VPATH)}method.h
+thread.$(OBJEXT): {$(VPATH)}missing.h
+thread.$(OBJEXT): {$(VPATH)}node.h
+thread.$(OBJEXT): {$(VPATH)}oniguruma.h
+thread.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+thread.$(OBJEXT): {$(VPATH)}st.h
+thread.$(OBJEXT): {$(VPATH)}subst.h
+thread.$(OBJEXT): {$(VPATH)}thread.c
+thread.$(OBJEXT): {$(VPATH)}thread.h
+thread.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).c
+thread.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+thread.$(OBJEXT): {$(VPATH)}thread_native.h
+thread.$(OBJEXT): {$(VPATH)}thread_sync.c
+thread.$(OBJEXT): {$(VPATH)}timev.h
+thread.$(OBJEXT): {$(VPATH)}vm_core.h
+thread.$(OBJEXT): {$(VPATH)}vm_debug.h
+thread.$(OBJEXT): {$(VPATH)}vm_opts.h
+time.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+time.$(OBJEXT): $(top_srcdir)/include/ruby.h
+time.$(OBJEXT): {$(VPATH)}config.h
+time.$(OBJEXT): {$(VPATH)}defines.h
+time.$(OBJEXT): {$(VPATH)}encoding.h
+time.$(OBJEXT): {$(VPATH)}intern.h
+time.$(OBJEXT): {$(VPATH)}internal.h
+time.$(OBJEXT): {$(VPATH)}io.h
+time.$(OBJEXT): {$(VPATH)}missing.h
+time.$(OBJEXT): {$(VPATH)}oniguruma.h
+time.$(OBJEXT): {$(VPATH)}st.h
+time.$(OBJEXT): {$(VPATH)}subst.h
+time.$(OBJEXT): {$(VPATH)}time.c
+time.$(OBJEXT): {$(VPATH)}timev.h
+transcode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+transcode.$(OBJEXT): $(top_srcdir)/include/ruby.h
+transcode.$(OBJEXT): {$(VPATH)}config.h
+transcode.$(OBJEXT): {$(VPATH)}defines.h
+transcode.$(OBJEXT): {$(VPATH)}encoding.h
+transcode.$(OBJEXT): {$(VPATH)}intern.h
+transcode.$(OBJEXT): {$(VPATH)}internal.h
+transcode.$(OBJEXT): {$(VPATH)}io.h
+transcode.$(OBJEXT): {$(VPATH)}missing.h
+transcode.$(OBJEXT): {$(VPATH)}oniguruma.h
+transcode.$(OBJEXT): {$(VPATH)}st.h
+transcode.$(OBJEXT): {$(VPATH)}subst.h
+transcode.$(OBJEXT): {$(VPATH)}transcode.c
+transcode.$(OBJEXT): {$(VPATH)}transcode_data.h
+util.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+util.$(OBJEXT): $(top_srcdir)/include/ruby.h
+util.$(OBJEXT): {$(VPATH)}config.h
+util.$(OBJEXT): {$(VPATH)}defines.h
+util.$(OBJEXT): {$(VPATH)}encoding.h
+util.$(OBJEXT): {$(VPATH)}intern.h
+util.$(OBJEXT): {$(VPATH)}internal.h
+util.$(OBJEXT): {$(VPATH)}io.h
+util.$(OBJEXT): {$(VPATH)}missing.h
+util.$(OBJEXT): {$(VPATH)}oniguruma.h
+util.$(OBJEXT): {$(VPATH)}st.h
+util.$(OBJEXT): {$(VPATH)}subst.h
+util.$(OBJEXT): {$(VPATH)}util.c
+util.$(OBJEXT): {$(VPATH)}util.h
+variable.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+variable.$(OBJEXT): $(top_srcdir)/include/ruby.h
+variable.$(OBJEXT): {$(VPATH)}config.h
+variable.$(OBJEXT): {$(VPATH)}constant.h
+variable.$(OBJEXT): {$(VPATH)}defines.h
+variable.$(OBJEXT): {$(VPATH)}encoding.h
+variable.$(OBJEXT): {$(VPATH)}id.h
+variable.$(OBJEXT): {$(VPATH)}intern.h
+variable.$(OBJEXT): {$(VPATH)}internal.h
+variable.$(OBJEXT): {$(VPATH)}io.h
+variable.$(OBJEXT): {$(VPATH)}missing.h
+variable.$(OBJEXT): {$(VPATH)}oniguruma.h
+variable.$(OBJEXT): {$(VPATH)}st.h
+variable.$(OBJEXT): {$(VPATH)}subst.h
+variable.$(OBJEXT): {$(VPATH)}util.h
+variable.$(OBJEXT): {$(VPATH)}variable.c
+version.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+version.$(OBJEXT): $(hdrdir)/ruby/version.h
+version.$(OBJEXT): $(top_srcdir)/revision.h
+version.$(OBJEXT): $(top_srcdir)/version.h
+version.$(OBJEXT): {$(VPATH)}config.h
+version.$(OBJEXT): {$(VPATH)}defines.h
+version.$(OBJEXT): {$(VPATH)}intern.h
+version.$(OBJEXT): {$(VPATH)}missing.h
+version.$(OBJEXT): {$(VPATH)}st.h
+version.$(OBJEXT): {$(VPATH)}subst.h
+version.$(OBJEXT): {$(VPATH)}version.c
+vm.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+vm.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+vm.$(OBJEXT): $(CCAN_DIR)/list/list.h
+vm.$(OBJEXT): $(CCAN_DIR)/str/str.h
+vm.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+vm.$(OBJEXT): $(top_srcdir)/include/ruby.h
+vm.$(OBJEXT): {$(VPATH)}config.h
+vm.$(OBJEXT): {$(VPATH)}constant.h
+vm.$(OBJEXT): {$(VPATH)}defines.h
+vm.$(OBJEXT): {$(VPATH)}encoding.h
+vm.$(OBJEXT): {$(VPATH)}eval_intern.h
+vm.$(OBJEXT): {$(VPATH)}gc.h
+vm.$(OBJEXT): {$(VPATH)}id.h
+vm.$(OBJEXT): {$(VPATH)}id_table.h
+vm.$(OBJEXT): {$(VPATH)}insns.def
+vm.$(OBJEXT): {$(VPATH)}insns.inc
+vm.$(OBJEXT): {$(VPATH)}intern.h
+vm.$(OBJEXT): {$(VPATH)}internal.h
+vm.$(OBJEXT): {$(VPATH)}io.h
+vm.$(OBJEXT): {$(VPATH)}iseq.h
+vm.$(OBJEXT): {$(VPATH)}method.h
+vm.$(OBJEXT): {$(VPATH)}missing.h
+vm.$(OBJEXT): {$(VPATH)}node.h
+vm.$(OBJEXT): {$(VPATH)}oniguruma.h
+vm.$(OBJEXT): {$(VPATH)}probes.h
+vm.$(OBJEXT): {$(VPATH)}probes_helper.h
+vm.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+vm.$(OBJEXT): {$(VPATH)}st.h
+vm.$(OBJEXT): {$(VPATH)}subst.h
+vm.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+vm.$(OBJEXT): {$(VPATH)}thread_native.h
+vm.$(OBJEXT): {$(VPATH)}vm.c
+vm.$(OBJEXT): {$(VPATH)}vm.h
+vm.$(OBJEXT): {$(VPATH)}vm.inc
+vm.$(OBJEXT): {$(VPATH)}vm_call_iseq_optimized.inc
+vm.$(OBJEXT): {$(VPATH)}vm_args.c
+vm.$(OBJEXT): {$(VPATH)}vm_core.h
+vm.$(OBJEXT): {$(VPATH)}vm_debug.h
+vm.$(OBJEXT): {$(VPATH)}vm_eval.c
+vm.$(OBJEXT): {$(VPATH)}vm_exec.c
+vm.$(OBJEXT): {$(VPATH)}vm_exec.h
+vm.$(OBJEXT): {$(VPATH)}vm_insnhelper.c
+vm.$(OBJEXT): {$(VPATH)}vm_insnhelper.h
+vm.$(OBJEXT): {$(VPATH)}vm_method.c
+vm.$(OBJEXT): {$(VPATH)}vm_opts.h
+vm.$(OBJEXT): {$(VPATH)}vmtc.inc
+vm_backtrace.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+vm_backtrace.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+vm_backtrace.$(OBJEXT): $(CCAN_DIR)/list/list.h
+vm_backtrace.$(OBJEXT): $(CCAN_DIR)/str/str.h
+vm_backtrace.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+vm_backtrace.$(OBJEXT): $(top_srcdir)/include/ruby.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}config.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}debug.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}defines.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}encoding.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}eval_intern.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}id.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}intern.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}io.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}iseq.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}method.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}missing.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}node.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}oniguruma.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}st.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}subst.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+vm_backtrace.$(OBJEXT): {$(VPATH)}thread_native.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}vm_backtrace.c
+vm_backtrace.$(OBJEXT): {$(VPATH)}vm_core.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}vm_debug.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}vm_opts.h
+vm_call.$(OBJEXT): $(top_srcdir)/include/ruby.h
+vm_call.$(OBJEXT): {$(VPATH)}vm_core.h
+vm_call.$(OBJEXT): {$(VPATH)}vm_call_iseq_optimized.inc
+vm_dump.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+vm_dump.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+vm_dump.$(OBJEXT): $(CCAN_DIR)/list/list.h
+vm_dump.$(OBJEXT): $(CCAN_DIR)/str/str.h
+vm_dump.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+vm_dump.$(OBJEXT): $(top_srcdir)/include/ruby.h
+vm_dump.$(OBJEXT): {$(VPATH)}addr2line.h
+vm_dump.$(OBJEXT): {$(VPATH)}config.h
+vm_dump.$(OBJEXT): {$(VPATH)}defines.h
+vm_dump.$(OBJEXT): {$(VPATH)}encoding.h
+vm_dump.$(OBJEXT): {$(VPATH)}id.h
+vm_dump.$(OBJEXT): {$(VPATH)}intern.h
+vm_dump.$(OBJEXT): {$(VPATH)}internal.h
+vm_dump.$(OBJEXT): {$(VPATH)}io.h
+vm_dump.$(OBJEXT): {$(VPATH)}iseq.h
+vm_dump.$(OBJEXT): {$(VPATH)}method.h
+vm_dump.$(OBJEXT): {$(VPATH)}missing.h
+vm_dump.$(OBJEXT): {$(VPATH)}node.h
+vm_dump.$(OBJEXT): {$(VPATH)}oniguruma.h
+vm_dump.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+vm_dump.$(OBJEXT): {$(VPATH)}st.h
+vm_dump.$(OBJEXT): {$(VPATH)}subst.h
+vm_dump.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+vm_dump.$(OBJEXT): {$(VPATH)}thread_native.h
+vm_dump.$(OBJEXT): {$(VPATH)}vm_core.h
+vm_dump.$(OBJEXT): {$(VPATH)}vm_debug.h
+vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c
+vm_dump.$(OBJEXT): {$(VPATH)}vm_opts.h
+vm_trace.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+vm_trace.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+vm_trace.$(OBJEXT): $(CCAN_DIR)/list/list.h
+vm_trace.$(OBJEXT): $(CCAN_DIR)/str/str.h
+vm_trace.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+vm_trace.$(OBJEXT): $(top_srcdir)/include/ruby.h
+vm_trace.$(OBJEXT): {$(VPATH)}config.h
+vm_trace.$(OBJEXT): {$(VPATH)}debug.h
+vm_trace.$(OBJEXT): {$(VPATH)}defines.h
+vm_trace.$(OBJEXT): {$(VPATH)}encoding.h
+vm_trace.$(OBJEXT): {$(VPATH)}eval_intern.h
+vm_trace.$(OBJEXT): {$(VPATH)}id.h
+vm_trace.$(OBJEXT): {$(VPATH)}intern.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal.h
+vm_trace.$(OBJEXT): {$(VPATH)}io.h
+vm_trace.$(OBJEXT): {$(VPATH)}method.h
+vm_trace.$(OBJEXT): {$(VPATH)}missing.h
+vm_trace.$(OBJEXT): {$(VPATH)}node.h
+vm_trace.$(OBJEXT): {$(VPATH)}oniguruma.h
+vm_trace.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+vm_trace.$(OBJEXT): {$(VPATH)}st.h
+vm_trace.$(OBJEXT): {$(VPATH)}subst.h
+vm_trace.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+vm_trace.$(OBJEXT): {$(VPATH)}thread_native.h
+vm_trace.$(OBJEXT): {$(VPATH)}vm_core.h
+vm_trace.$(OBJEXT): {$(VPATH)}vm_debug.h
+vm_trace.$(OBJEXT): {$(VPATH)}vm_opts.h
+vm_trace.$(OBJEXT): {$(VPATH)}vm_trace.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/compar.c b/compar.c
index 2f4db291a4..b040641651 100644
--- a/compar.c
+++ b/compar.c
@@ -18,17 +18,16 @@ static ID cmp;
void
rb_cmperr(VALUE x, VALUE y)
{
- const char *classname;
+ VALUE classname;
- if (SPECIAL_CONST_P(y)) {
- y = rb_inspect(y);
- classname = StringValuePtr(y);
+ if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
+ classname = rb_inspect(y);
}
else {
- classname = rb_obj_classname(y);
+ classname = rb_obj_class(y);
}
- rb_raise(rb_eArgError, "comparison of %s with %s failed",
- rb_obj_classname(x), classname);
+ rb_raise(rb_eArgError, "comparison of %"PRIsVALUE" with %"PRIsVALUE" failed",
+ rb_obj_class(x), classname);
}
static VALUE
@@ -54,26 +53,10 @@ rb_invcmp(VALUE x, VALUE y)
static VALUE
cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
{
- if (recursive) return Qfalse;
+ if (recursive) return Qnil;
return rb_funcallv(arg1, cmp, 1, &arg2);
}
-static VALUE
-cmp_eq(VALUE *a)
-{
- VALUE c = rb_exec_recursive_paired_outer(cmp_eq_recursive, a[0], a[1], a[1]);
-
- if (NIL_P(c)) return Qfalse;
- if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue;
- return Qfalse;
-}
-
-static VALUE
-cmp_failed(void)
-{
- return Qfalse;
-}
-
/*
* call-seq:
* obj == other -> true or false
@@ -81,20 +64,19 @@ cmp_failed(void)
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0. Also returns true if
* _obj_ and _other_ are the same object.
- *
- * Even if _obj_ <=> _other_ raised an exception, the exception
- * is ignored and returns false.
*/
static VALUE
cmp_equal(VALUE x, VALUE y)
{
- VALUE a[2];
-
+ VALUE c;
if (x == y) return Qtrue;
- a[0] = x; a[1] = y;
- return rb_rescue(cmp_eq, (VALUE)a, cmp_failed, 0);
+ c = rb_exec_recursive_paired_outer(cmp_eq_recursive, x, y, y);
+
+ if (NIL_P(c)) return Qfalse;
+ if (rb_cmpint(c, x, y) == 0) return Qtrue;
+ return Qfalse;
}
/*
@@ -203,8 +185,8 @@ cmp_between(VALUE x, VALUE min, VALUE max)
* class SizeMatters
* include Comparable
* attr :str
- * def <=>(anOther)
- * str.size <=> anOther.str.size
+ * def <=>(other)
+ * str.size <=> other.str.size
* end
* def initialize(str)
* @str = str
diff --git a/compile.c b/compile.c
index 48479338c9..0aea3acd92 100644
--- a/compile.c
+++ b/compile.c
@@ -9,8 +9,9 @@
**********************************************************************/
-#include "ruby/ruby.h"
#include "internal.h"
+#include "ruby/re.h"
+#include "encindex.h"
#include <math.h>
#define USE_INSN_STACK_INCREASE 1
@@ -18,6 +19,16 @@
#include "iseq.h"
#include "insns.inc"
#include "insns_info.inc"
+#include "gc.h"
+
+#ifdef HAVE_DLADDR
+# include <dlfcn.h>
+#endif
+
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
+
+#define ISEQ_TYPE_ONCE_GUARD ISEQ_TYPE_DEFINED_GUARD
#define FIXNUM_INC(n, i) ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
#define FIXNUM_OR(n, i) ((n)|INT2FIX(i))
@@ -38,6 +49,13 @@ typedef struct iseq_link_anchor {
LINK_ELEMENT *last;
} LINK_ANCHOR;
+typedef enum {
+ LABEL_RESCUE_NONE,
+ LABEL_RESCUE_BEG,
+ LABEL_RESCUE_END,
+ LABEL_RESCUE_TYPE_MAX
+} LABEL_RESCUE_TYPE;
+
typedef struct iseq_label_data {
LINK_ELEMENT link;
int label_no;
@@ -45,6 +63,8 @@ typedef struct iseq_label_data {
int sc_state;
int set;
int sp;
+ int refcnt;
+ unsigned int rescued: 2;
} LABEL;
typedef struct iseq_insn_data {
@@ -94,7 +114,7 @@ struct iseq_compile_data_ensure_node_stack {
#if CPDEBUG >= 0
#define compile_debug CPDEBUG
#else
-#define compile_debug iseq->compile_data->option->debug_level
+#define compile_debug ISEQ_COMPILE_DATA(iseq)->option->debug_level
#endif
#if CPDEBUG
@@ -153,6 +173,7 @@ r_value(VALUE value)
#endif
#if CPDEBUG > 1 || CPDEBUG < 0
+#define printf ruby_debug_printf
#define debugs if (compile_debug_print_indent(1)) ruby_debug_printf
#define debug_compile(msg, v) ((void)(compile_debug_print_indent(1) && fputs((msg), stderr)), (v))
#else
@@ -164,17 +185,14 @@ r_value(VALUE value)
/* create new label */
#define NEW_LABEL(l) new_label_body(iseq, (l))
-#define iseq_path(iseq) \
- (((rb_iseq_t*)DATA_PTR(iseq))->location.path)
+#define iseq_path(iseq) ((iseq)->body->location.path)
+#define iseq_absolute_path(iseq) ((iseq)->body->location.absolute_path)
-#define iseq_absolute_path(iseq) \
- (((rb_iseq_t*)DATA_PTR(iseq))->location.absolute_path)
-
-#define NEW_ISEQVAL(node, name, type, line_no) \
+#define NEW_ISEQ(node, name, type, line_no) \
new_child_iseq(iseq, (node), rb_fstring(name), 0, (type), (line_no))
-#define NEW_CHILD_ISEQVAL(node, name, type, line_no) \
- new_child_iseq(iseq, (node), rb_fstring(name), iseq->self, (type), (line_no))
+#define NEW_CHILD_ISEQ(node, name, type, line_no) \
+ new_child_iseq(iseq, (node), rb_fstring(name), iseq, (type), (line_no))
/* add instructions */
#define ADD_SEQ(seq1, seq2) \
@@ -184,13 +202,24 @@ r_value(VALUE value)
#define ADD_INSN(seq, line, insn) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
+/* insert an instruction before prev */
+#define INSERT_BEFORE_INSN(prev, line, insn) \
+ INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
+
/* 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)))
+/* insert an instruction with some operands (1, 2, 3, 5) before prev */
+#define INSERT_BEFORE_INSN1(prev, line, insn, op1) \
+ INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) \
+ new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
+
+#define LABEL_REF(label) ((label)->refcnt++)
+
/* 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_INSNL(seq, line, insn, label) (ADD_INSN1(seq, line, insn, label), LABEL_REF(label))
#define ADD_INSN2(seq, line, insn, op1, op2) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
@@ -202,31 +231,36 @@ r_value(VALUE value)
/* Specific Insn factory */
#define ADD_SEND(seq, line, id, argc) \
- ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(0))
+ ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(0), NULL)
+
+#define ADD_SEND_WITH_FLAG(seq, line, id, argc, flag) \
+ ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)(flag), NULL)
+
+#define ADD_SEND_WITH_BLOCK(seq, line, id, argc, block) \
+ ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(0), NULL)
#define ADD_CALL_RECEIVER(seq, line) \
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))
+ ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
- ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL))
+ ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
-#define ADD_SEND_R(seq, line, id, argc, block, flag) \
- ADD_ELEM((seq), (LINK_ELEMENT *) \
- new_insn_send(iseq, (line), \
- (VALUE)(id), (VALUE)(argc), (VALUE)(block), (VALUE)(flag)))
+#define ADD_SEND_R(seq, line, id, argc, block, flag, keywords) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_send(iseq, (line), (id), (VALUE)(argc), (block), (VALUE)(flag), (keywords)))
#define ADD_TRACE(seq, line, event) \
do { \
- if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
- (line) != iseq->compile_data->last_coverable_line) { \
- RARRAY_ASET(iseq->coverage, (line) - 1, INT2FIX(0)); \
- iseq->compile_data->last_coverable_line = (line); \
+ if ((event) == RUBY_EVENT_LINE && ISEQ_COVERAGE(iseq) && \
+ (line) > 0 && \
+ (line) != ISEQ_COMPILE_DATA(iseq)->last_coverable_line) { \
+ RARRAY_ASET(ISEQ_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
+ ISEQ_COMPILE_DATA(iseq)->last_coverable_line = (line); \
ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
- if (iseq->compile_data->option->trace_instruction) { \
+ if (ISEQ_COMPILE_DATA(iseq)->option->trace_instruction) { \
ADD_INSN1((seq), (line), trace, INT2FIX(event)); \
} \
} while (0)
@@ -244,11 +278,15 @@ r_value(VALUE value)
#define ADD_ADJUST_RESTORE(seq, label) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), -1))
-#define ADD_CATCH_ENTRY(type, ls, le, iseqv, lc) \
- (rb_ary_push(iseq->compile_data->catch_table_ary, \
- rb_ary_new3(5, (type), \
- (VALUE)(ls) | 1, (VALUE)(le) | 1, \
- (VALUE)(iseqv), (VALUE)(lc) | 1)))
+#define ADD_CATCH_ENTRY(type, ls, le, iseqv, lc) do { \
+ VALUE _e = rb_ary_new3(5, (type), \
+ (VALUE)(ls) | 1, (VALUE)(le) | 1, \
+ (VALUE)(iseqv), (VALUE)(lc) | 1); \
+ if (ls) LABEL_REF(ls); \
+ if (le) LABEL_REF(le); \
+ if (lc) LABEL_REF(lc); \
+ rb_ary_push(ISEQ_COMPILE_DATA(iseq)->catch_table_ary, freeze_hide_obj(_e)); \
+} while (0)
/* compile node */
#define COMPILE(anchor, desc, node) \
@@ -265,6 +303,11 @@ r_value(VALUE value)
(debug_compile("== " desc "\n", \
iseq_compile_each(iseq, (anchor), (node), (poped))))
+#define COMPILE_RECV(anchor, desc, node) \
+ (private_recv_p(node) ? \
+ (ADD_INSN(anchor, nd_line(node), putself), VM_CALL_FCALL) : \
+ (COMPILE(anchor, desc, node->nd_recv), 0))
+
#define OPERAND_AT(insn, idx) \
(((INSN*)(insn))->operands[(idx)])
@@ -272,20 +315,69 @@ r_value(VALUE value)
(((INSN*)(insn))->insn_id)
/* error */
-#define COMPILE_ERROR(strs) \
-{ \
- VALUE tmp = GET_THREAD()->errinfo; \
- if (compile_debug) rb_compile_bug strs; \
- GET_THREAD()->errinfo = iseq->compile_data->err_info; \
- rb_compile_error strs; \
- RB_OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, GET_THREAD()->errinfo); \
- GET_THREAD()->errinfo = tmp; \
- ret = 0; \
- break; \
+typedef void (*compile_error_func)(VALUE, int, const char *, ...);
+
+static void
+append_compile_error(VALUE file, int line, const char *fmt, ...)
+{
+ VALUE err_info = rb_errinfo();
+ VALUE str = rb_attr_get(err_info, idMesg);
+ va_list args;
+
+ if (RSTRING_LEN(str)) rb_str_cat2(str, "\n");
+ if (file) {
+ rb_str_concat(str, file);
+ if (line) rb_str_catf(str, ":%d", line);
+ rb_str_cat2(str, ": ");
+ }
+ va_start(args, fmt);
+ rb_str_vcatf(str, fmt, args);
+ va_end(args);
+}
+
+NOINLINE(static compile_error_func prepare_compile_error(rb_iseq_t *iseq));
+
+static compile_error_func
+prepare_compile_error(rb_iseq_t *iseq)
+{
+ VALUE err_info = ISEQ_COMPILE_DATA(iseq)->err_info;
+ if (compile_debug) return rb_compile_bug_str;
+ if (NIL_P(err_info)) {
+ err_info = rb_exc_new_cstr(rb_eSyntaxError, "");
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, err_info);
+ }
+ rb_set_errinfo(err_info);
+ return append_compile_error;
}
-#define ERROR_ARGS ruby_sourcefile, nd_line(node),
+#define COMPILE_ERROR prepare_compile_error(iseq)
+
+#define ERROR_ARGS_AT(n) ruby_sourcefile_string, nd_line(n),
+#define ERROR_ARGS ERROR_ARGS_AT(node)
+
+#define EXPECT_NODE(prefix, node, ndtype) \
+do { \
+ NODE *error_node = (node); \
+ enum node_type error_type = nd_type(error_node); \
+ if (error_type != (ndtype)) { \
+ rb_compile_bug_str(ERROR_ARGS_AT(error_node) \
+ prefix ": " #ndtype " is expected, but %s", \
+ ruby_node_name(error_type)); \
+ } \
+} while (0)
+
+#define EXPECT_NODE_NONULL(prefix, parent, ndtype) \
+do { \
+ rb_compile_bug_str(ERROR_ARGS_AT(parent) \
+ prefix ": must be " #ndtype ", but 0"); \
+} while (0)
+#define UNKNOWN_NODE(prefix, node) \
+do { \
+ NODE *error_node = (node); \
+ rb_compile_bug_str(ERROR_ARGS_AT(error_node) prefix ": unknown node (%s)", \
+ ruby_node_name(nd_type(error_node))); \
+} while (0)
#define COMPILE_OK 1
#define COMPILE_NG 0
@@ -298,7 +390,13 @@ r_value(VALUE value)
#define INIT_ANCHOR(name) \
(name##_body__.last = &name##_body__.anchor, name = &name##_body__)
-#define hide_obj(obj) do {OBJ_FREEZE(obj); RBASIC_CLEAR_CLASS(obj);} while (0)
+static inline VALUE
+freeze_hide_obj(VALUE obj)
+{
+ OBJ_FREEZE(obj);
+ RBASIC_CLEAR_CLASS(obj);
+ return obj;
+}
#include "optinsn.inc"
#if OPT_INSTRUCTIONS_UNIFICATION
@@ -315,10 +413,7 @@ r_value(VALUE value)
#endif
#if CPDEBUG
-#define gl_node_level iseq->compile_data->node_level
-#if 0
-static void debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor);
-#endif
+#define gl_node_level ISEQ_COMPILE_DATA(iseq)->node_level
#endif
static void dump_disasm_list(LINK_ELEMENT *elem);
@@ -326,7 +421,7 @@ static void dump_disasm_list(LINK_ELEMENT *elem);
static int insn_data_length(INSN *iobj);
static int calc_sp_depth(int depth, INSN *iobj);
-static INSN *new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...);
+static INSN *new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc, ...);
static LABEL *new_label_body(rb_iseq_t *iseq, long line);
static ADJUST *new_adjust_body(rb_iseq_t *iseq, LABEL *label, int line);
@@ -335,7 +430,7 @@ static int iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
static int iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
static int iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
-static int iseq_set_local_table(rb_iseq_t *iseq, ID *tbl);
+static int iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl);
static int iseq_set_exception_local_table(rb_iseq_t *iseq);
static int iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
@@ -407,11 +502,11 @@ APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *before, LINK_ELE
}
#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))
+#define APPEND_ELEM(anchor, before, elem) APPEND_ELEM(iseq, (anchor), (before), (elem))
#endif
static int
-iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
+iseq_add_mark_object(const rb_iseq_t *iseq, VALUE v)
{
if (!SPECIAL_CONST_P(v)) {
rb_iseq_add_mark_object(iseq, v);
@@ -419,13 +514,14 @@ iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
return COMPILE_OK;
}
-#define ruby_sourcefile RSTRING_PTR(iseq->location.path)
+#define ruby_sourcefile_string (iseq->body->location.path)
+#define ruby_sourcefile RSTRING_PTR(iseq->body->location.path)
static int
-iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
+iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
{
if (!SPECIAL_CONST_P(v)) {
- rb_ary_push(iseq->compile_data->mark_ary, v);
+ rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, v);
}
return COMPILE_OK;
}
@@ -437,10 +533,9 @@ validate_label(st_data_t name, st_data_t label, st_data_t arg)
LABEL *lobj = (LABEL *)label;
if (!lobj->link.next) {
do {
- int ret;
- COMPILE_ERROR((ruby_sourcefile, lobj->position,
- "%s: undefined label", rb_id2name((ID)name)));
- if (ret) break;
+ COMPILE_ERROR(ruby_sourcefile_string, lobj->position,
+ "%"PRIsVALUE": undefined label",
+ rb_id2str((ID)name));
} while (0);
}
return ST_CONTINUE;
@@ -450,18 +545,14 @@ static void
validate_labels(rb_iseq_t *iseq, st_table *labels_table)
{
st_foreach(labels_table, validate_label, (st_data_t)iseq);
- if (!NIL_P(iseq->compile_data->err_info)) {
- rb_exc_raise(iseq->compile_data->err_info);
- }
+ st_free_table(labels_table);
}
VALUE
-rb_iseq_compile_node(VALUE self, NODE *node)
+rb_iseq_compile_node(rb_iseq_t *iseq, NODE *node)
{
DECL_ANCHOR(ret);
- rb_iseq_t *iseq;
INIT_ANCHOR(ret);
- GetISeqPtr(self, iseq);
if (node == 0) {
COMPILE(ret, "nil", node);
@@ -472,14 +563,17 @@ rb_iseq_compile_node(VALUE self, NODE *node)
iseq_set_local_table(iseq, node->nd_tbl);
iseq_set_arguments(iseq, ret, node->nd_args);
- switch (iseq->type) {
+ switch (iseq->body->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);
+ LABEL *start = ISEQ_COMPILE_DATA(iseq)->start_label = NEW_LABEL(0);
+ LABEL *end = ISEQ_COMPILE_DATA(iseq)->end_label = NEW_LABEL(0);
+
+ start->rescued = LABEL_RESCUE_BEG;
+ end->rescued = LABEL_RESCUE_END;
+ ADD_TRACE(ret, FIX2INT(iseq->body->location.first_lineno), RUBY_EVENT_B_CALL);
ADD_LABEL(ret, start);
- ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_B_CALL);
COMPILE(ret, "block body", node->nd_body);
ADD_LABEL(ret, end);
ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
@@ -491,14 +585,14 @@ rb_iseq_compile_node(VALUE self, NODE *node)
}
case ISEQ_TYPE_CLASS:
{
- ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CLASS);
+ ADD_TRACE(ret, FIX2INT(iseq->body->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);
+ ADD_TRACE(ret, FIX2INT(iseq->body->location.first_lineno), RUBY_EVENT_CALL);
COMPILE(ret, "scoped node", node->nd_body);
ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
break;
@@ -509,21 +603,22 @@ rb_iseq_compile_node(VALUE self, NODE *node)
}
}
}
- else if (nd_type(node) == NODE_IFUNC) {
+ else if (RB_TYPE_P((VALUE)node, T_IMEMO)) {
+ const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
/* user callback */
- (*node->nd_cfnc)(iseq, ret, node->nd_tval);
+ (*ifunc->func)(iseq, ret, ifunc->data);
}
else {
- switch (iseq->type) {
+ switch (iseq->body->type) {
case ISEQ_TYPE_METHOD:
case ISEQ_TYPE_CLASS:
case ISEQ_TYPE_BLOCK:
case ISEQ_TYPE_EVAL:
case ISEQ_TYPE_MAIN:
case ISEQ_TYPE_TOP:
- rb_compile_error(ERROR_ARGS "compile/should not be reached: %s:%d",
- __FILE__, __LINE__);
- break;
+ COMPILE_ERROR(ERROR_ARGS "compile/should not be reached: %s:%d",
+ __FILE__, __LINE__);
+ return COMPILE_NG;
case ISEQ_TYPE_RESCUE:
iseq_set_exception_local_table(iseq);
COMPILE(ret, "rescue", node);
@@ -533,25 +628,27 @@ rb_iseq_compile_node(VALUE self, NODE *node)
COMPILE_POPED(ret, "ensure", node);
break;
case ISEQ_TYPE_DEFINED_GUARD:
- iseq_set_local_table(iseq, 0);
+ iseq_set_exception_local_table(iseq);
COMPILE(ret, "defined guard", node);
break;
default:
- rb_bug("unknown scope");
+ rb_compile_bug_str(ERROR_ARGS "unknown scope");
}
}
- if (iseq->type == ISEQ_TYPE_RESCUE || iseq->type == ISEQ_TYPE_ENSURE) {
+ if (iseq->body->type == ISEQ_TYPE_RESCUE || iseq->body->type == ISEQ_TYPE_ENSURE) {
ADD_INSN2(ret, 0, getlocal, INT2FIX(2), INT2FIX(0));
ADD_INSN1(ret, 0, throw, INT2FIX(0) /* continue throw */ );
}
else {
- ADD_INSN(ret, iseq->compile_data->last_line, leave);
+ ADD_INSN(ret, ISEQ_COMPILE_DATA(iseq)->last_line, leave);
}
#if SUPPORT_JOKE
- if (iseq->compile_data->labels_table) {
- validate_labels(iseq, iseq->compile_data->labels_table);
+ if (ISEQ_COMPILE_DATA(iseq)->labels_table) {
+ st_table *labels_table = ISEQ_COMPILE_DATA(iseq)->labels_table;
+ ISEQ_COMPILE_DATA(iseq)->labels_table = 0;
+ validate_labels(iseq, labels_table);
}
#endif
return iseq_setup(iseq, ret);
@@ -562,54 +659,150 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
{
#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
const void * const *table = rb_vm_get_insns_address_table();
- unsigned long i;
-
- iseq->iseq_encoded = ALLOC_N(VALUE, iseq->iseq_size);
- MEMCPY(iseq->iseq_encoded, iseq->iseq, VALUE, iseq->iseq_size);
+ unsigned int i;
+ VALUE *encoded = (VALUE *)iseq->body->iseq_encoded;
- for (i = 0; i < iseq->iseq_size; /* */ ) {
- int insn = (int)iseq->iseq_encoded[i];
+ for (i = 0; i < iseq->body->iseq_size; /* */ ) {
+ int insn = (int)iseq->body->iseq_encoded[i];
int len = insn_len(insn);
- iseq->iseq_encoded[i] = (VALUE)table[insn];
+ encoded[i] = (VALUE)table[insn];
i += len;
}
-#else
- iseq->iseq_encoded = iseq->iseq;
#endif
return COMPILE_OK;
}
+#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
+static int
+rb_vm_insn_addr2insn(const void *addr) /* cold path */
+{
+ int insn;
+ const void * const *table = rb_vm_get_insns_address_table();
+
+ for (insn = 0; insn < VM_INSTRUCTION_SIZE; insn++) {
+ if (table[insn] == addr) {
+ return insn;
+ }
+ }
+ rb_bug("rb_vm_insn_addr2insn: invalid insn address: %p", addr);
+}
+#endif
+
+VALUE *
+rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
+{
+ VALUE *original_code;
+
+ if (ISEQ_ORIGINAL_ISEQ(iseq)) return ISEQ_ORIGINAL_ISEQ(iseq);
+ original_code = ISEQ_ORIGINAL_ISEQ_ALLOC(iseq, iseq->body->iseq_size);
+ MEMCPY(original_code, iseq->body->iseq_encoded, VALUE, iseq->body->iseq_size);
+
+#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
+ {
+ unsigned int i;
+
+ for (i = 0; i < iseq->body->iseq_size; /* */ ) {
+ const void *addr = (const void *)original_code[i];
+ const int insn = rb_vm_insn_addr2insn(addr);
+
+ original_code[i] = insn;
+ i += insn_len(insn);
+ }
+ }
+#endif
+ return original_code;
+}
+
/*********************************************/
/* definition of data structure for compiler */
/*********************************************/
+/*
+ * On 32-bit SPARC, GCC by default generates SPARC V7 code that may require
+ * 8-byte word alignment. On the other hand, Oracle Solaris Studio seems to
+ * generate SPARCV8PLUS code with unaligned memory access instructions.
+ * That is why the STRICT_ALIGNMENT is defined only with GCC.
+ */
+#if defined(__sparc) && SIZEOF_VOIDP == 4 && defined(__GNUC__)
+ #define STRICT_ALIGNMENT
+#endif
+
+#ifdef STRICT_ALIGNMENT
+ #if defined(HAVE_TRUE_LONG_LONG) && SIZEOF_LONG_LONG > SIZEOF_VALUE
+ #define ALIGNMENT_SIZE SIZEOF_LONG_LONG
+ #else
+ #define ALIGNMENT_SIZE SIZEOF_VALUE
+ #endif
+ #define PADDING_SIZE_MAX ((size_t)((ALIGNMENT_SIZE) - 1))
+ #define ALIGNMENT_SIZE_MASK PADDING_SIZE_MAX
+ /* Note: ALIGNMENT_SIZE == (2 ** N) is expected. */
+#else
+ #define PADDING_SIZE_MAX 0
+#endif /* STRICT_ALIGNMENT */
+
+#ifdef STRICT_ALIGNMENT
+/* calculate padding size for aligned memory access */
+static size_t
+calc_padding(void *ptr, size_t size)
+{
+ size_t mis;
+ size_t padding = 0;
+
+ mis = (size_t)ptr & ALIGNMENT_SIZE_MASK;
+ if (mis > 0) {
+ padding = ALIGNMENT_SIZE - mis;
+ }
+/*
+ * On 32-bit sparc or equivalents, when a single VALUE is requested
+ * and padding == sizeof(VALUE), it is clear that no padding is needed.
+ */
+#if ALIGNMENT_SIZE > SIZEOF_VALUE
+ if (size == sizeof(VALUE) && padding == sizeof(VALUE)) {
+ padding = 0;
+ }
+#endif
+
+ return padding;
+}
+#endif /* STRICT_ALIGNMENT */
+
static void *
compile_data_alloc(rb_iseq_t *iseq, size_t size)
{
void *ptr = 0;
struct iseq_compile_data_storage *storage =
- iseq->compile_data->storage_current;
+ ISEQ_COMPILE_DATA(iseq)->storage_current;
+#ifdef STRICT_ALIGNMENT
+ size_t padding = calc_padding((void *)&storage->buff[storage->pos], size);
+#else
+ const size_t padding = 0; /* expected to be optimized by compiler */
+#endif /* STRICT_ALIGNMENT */
- if (storage->pos + size > storage->size) {
- unsigned long alloc_size = storage->size * 2;
+ if (size >= INT_MAX - padding) rb_memerror();
+ if (storage->pos + size + padding > storage->size) {
+ unsigned int alloc_size = storage->size;
- retry:
- if (alloc_size < size) {
+ while (alloc_size < size + PADDING_SIZE_MAX) {
+ if (alloc_size >= INT_MAX / 2) rb_memerror();
alloc_size *= 2;
- goto retry;
}
storage->next = (void *)ALLOC_N(char, alloc_size +
- sizeof(struct
- iseq_compile_data_storage));
- storage = iseq->compile_data->storage_current = storage->next;
+ SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
+ storage = ISEQ_COMPILE_DATA(iseq)->storage_current = storage->next;
storage->next = 0;
storage->pos = 0;
storage->size = alloc_size;
- storage->buff = (char *)(&storage->buff + 1);
+#ifdef STRICT_ALIGNMENT
+ padding = calc_padding((void *)&storage->buff[storage->pos], size);
+#endif /* STRICT_ALIGNMENT */
}
+#ifdef STRICT_ALIGNMENT
+ storage->pos += (int)padding;
+#endif /* STRICT_ALIGNMENT */
+
ptr = (void *)&storage->buff[storage->pos];
- storage->pos += size;
+ storage->pos += (int)size;
return ptr;
}
@@ -645,9 +838,8 @@ INSERT_ELEM_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
}
}
-#if 0 /* unused */
/*
- * elemX, elem1 => elemX, elem2, elem1
+ * elem1, elemX => elemX, elem2, elem1
*/
static void
INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
@@ -659,8 +851,8 @@ INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
elem2->prev->next = elem2;
}
}
-#endif
+#if 0
/*
* elemX, elem1, elemY => elemX, elem2, elemY
*/
@@ -676,6 +868,7 @@ REPLACE_ELEM(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
elem1->next->prev = elem2;
}
}
+#endif
static void
REMOVE_ELEM(LINK_ELEMENT *elem)
@@ -692,13 +885,11 @@ FIRST_ELEMENT(LINK_ANCHOR *anchor)
return anchor->anchor.next;
}
-#if 0 /* unused */
static LINK_ELEMENT *
LAST_ELEMENT(LINK_ANCHOR *anchor)
{
- return anchor->last;
+ return anchor->last;
}
-#endif
static LINK_ELEMENT *
POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
@@ -713,32 +904,6 @@ POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
#define POP_ELEMENT(anchor) POP_ELEMENT(iseq, (anchor))
#endif
-#if 0 /* unused */
-static LINK_ELEMENT *
-SHIFT_ELEMENT(LINK_ANCHOR *anchor)
-{
- LINK_ELEMENT *elem = anchor->anchor.next;
- if (elem) {
- anchor->anchor.next = elem->next;
- }
- return elem;
-}
-#endif
-
-#if 0 /* unused */
-static int
-LIST_SIZE(LINK_ANCHOR *anchor)
-{
- LINK_ELEMENT *elem = anchor->anchor.next;
- int size = 0;
- while (elem) {
- size += 1;
- elem = elem->next;
- }
- return size;
-}
-#endif
-
static int
LIST_SIZE_ZERO(LINK_ANCHOR *anchor)
{
@@ -800,65 +965,6 @@ INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
#define INSERT_LIST(anc1, anc2) INSERT_LIST(iseq, (anc1), (anc2))
#endif
-#if 0 /* unused */
-/*
- * anc1: e1, e2, e3
- * anc2: e4, e5
- *#=>
- * anc1: e4, e5
- * anc2: e1, e2, e3
- */
-static void
-SWAP_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
-{
- LINK_ANCHOR tmp = *anc2;
-
- /* it has bug */
- *anc2 = *anc1;
- *anc1 = tmp;
-
- verify_list("swap1", anc1);
- verify_list("swap2", anc2);
-}
-#if CPDEBUG < 0
-#define SWAP_LIST(anc1, anc2) SWAP_LIST(iseq, (anc1), (anc2))
-#endif
-
-static LINK_ANCHOR *
-REVERSE_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc)
-{
- LINK_ELEMENT *first, *last, *elem, *e;
- first = &anc->anchor;
- elem = first->next;
- last = anc->last;
-
- if (elem != 0) {
- anc->anchor.next = last;
- anc->last = elem;
- }
- else {
- /* null list */
- return anc;
- }
- while (elem) {
- e = elem->next;
- elem->next = elem->prev;
- elem->prev = e;
- elem = e;
- }
-
- first->next = last;
- last->prev = first;
- anc->last->next = 0;
-
- verify_list("reverse", anc);
- return anc;
-}
-#if CPDEBUG < 0
-#define REVERSE_LIST(anc) REVERSE_LIST(iseq, (anc))
-#endif
-#endif
-
#if CPDEBUG && 0
static void
debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
@@ -890,9 +996,12 @@ new_label_body(rb_iseq_t *iseq, long line)
labelobj->link.type = ISEQ_ELEMENT_LABEL;
labelobj->link.next = 0;
- labelobj->label_no = iseq->compile_data->label_no++;
+ labelobj->label_no = ISEQ_COMPILE_DATA(iseq)->label_no++;
labelobj->sc_state = 0;
labelobj->sp = -1;
+ labelobj->refcnt = 0;
+ labelobj->set = 0;
+ labelobj->rescued = LABEL_RESCUE_NONE;
return labelobj;
}
@@ -925,7 +1034,7 @@ new_insn_core(rb_iseq_t *iseq, int line_no,
}
static INSN *
-new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...)
+new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc, ...)
{
VALUE *operands = 0;
va_list argv;
@@ -942,61 +1051,65 @@ 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)
+static struct rb_call_info *
+new_callinfo(rb_iseq_t *iseq, ID mid, int argc, unsigned int flag, struct rb_call_info_kw_arg *kw_arg, int has_blockiseq)
{
- rb_call_info_t *ci = (rb_call_info_t *)compile_data_alloc(iseq, sizeof(rb_call_info_t));
+ size_t size = kw_arg != NULL ? sizeof(struct rb_call_info_with_kwarg) : sizeof(struct rb_call_info);
+ struct rb_call_info *ci = (struct rb_call_info *)compile_data_alloc(iseq, size);
+ struct rb_call_info_with_kwarg *ci_kw = (struct rb_call_info_with_kwarg *)ci;
+
ci->mid = mid;
ci->flag = flag;
ci->orig_argc = argc;
- ci->argc = argc;
- if (block) {
- GetISeqPtr(block, ci->blockiseq);
+ if (kw_arg) {
+ ci->flag |= VM_CALL_KWARG;
+ ci_kw->kw_arg = kw_arg;
+ ci->orig_argc += kw_arg->keyword_len;
+ iseq->body->ci_kw_size++;
}
else {
- ci->blockiseq = 0;
- if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG))) {
- ci->flag |= VM_CALL_ARGS_SKIP_SETUP;
- }
+ iseq->body->ci_size++;
}
- ci->method_state = 0;
- ci->class_serial = 0;
- ci->blockptr = 0;
- ci->recv = Qundef;
- ci->call = 0; /* TODO: should set default function? */
-
- ci->aux.index = iseq->callinfo_size++;
+ if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG)) &&
+ kw_arg == NULL && !has_blockiseq) {
+ ci->flag |= VM_CALL_ARGS_SIMPLE;
+ }
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, ID id, VALUE argc, const rb_iseq_t *blockiseq, VALUE flag, struct rb_call_info_kw_arg *keywords)
{
- 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);
+ VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 3);
+ operands[0] = (VALUE)new_callinfo(iseq, id, FIX2INT(argc), FIX2INT(flag), keywords, blockiseq != NULL);
+ operands[1] = Qfalse; /* cache */
+ operands[2] = (VALUE)blockiseq;
+ return new_insn_core(iseq, line_no, BIN(send), 3, operands);
}
-static VALUE
+static rb_iseq_t *
new_child_iseq(rb_iseq_t *iseq, NODE *node,
- VALUE name, VALUE parent, enum iseq_type type, int line_no)
+ VALUE name, const rb_iseq_t *parent, enum iseq_type type, int line_no)
{
- VALUE ret;
+ rb_iseq_t *ret_iseq;
debugs("[new_child_iseq]> ---------------------------------------\n");
- 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);
+ ret_iseq = rb_iseq_new_with_opt(node, name,
+ iseq_path(iseq), iseq_absolute_path(iseq),
+ INT2FIX(line_no), parent, type, ISEQ_COMPILE_DATA(iseq)->option);
debugs("[new_child_iseq]< ---------------------------------------\n");
- iseq_add_mark_object(iseq, ret);
- return ret;
+ iseq_add_mark_object(iseq, (VALUE)ret_iseq);
+ return ret_iseq;
}
static int
iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
+ if (RTEST(ISEQ_COMPILE_DATA(iseq)->err_info))
+ return COMPILE_NG;
+
/* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
if (compile_debug > 5)
@@ -1008,14 +1121,14 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
- if (iseq->compile_data->option->instructions_unification) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->instructions_unification) {
debugs("[compile step 3.2 (iseq_insns_unification)]\n");
iseq_insns_unification(iseq, anchor);
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
}
- if (iseq->compile_data->option->stack_caching) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->stack_caching) {
debugs("[compile step 3.3 (iseq_set_sequence_stackcaching)]\n");
iseq_set_sequence_stackcaching(iseq, anchor);
if (compile_debug > 5)
@@ -1023,70 +1136,73 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
}
debugs("[compile step 4.1 (iseq_set_sequence)]\n");
- iseq_set_sequence(iseq, anchor);
+ if (!iseq_set_sequence(iseq, anchor)) return COMPILE_NG;
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
debugs("[compile step 4.2 (iseq_set_exception_table)]\n");
- iseq_set_exception_table(iseq);
+ if (!iseq_set_exception_table(iseq)) return COMPILE_NG;
debugs("[compile step 4.3 (set_optargs_table)] \n");
- iseq_set_optargs_table(iseq);
+ if (!iseq_set_optargs_table(iseq)) return COMPILE_NG;
debugs("[compile step 5 (iseq_translate_threaded_code)] \n");
- rb_iseq_translate_threaded_code(iseq);
+ if (!rb_iseq_translate_threaded_code(iseq)) return COMPILE_NG;
if (compile_debug > 1) {
- VALUE str = rb_iseq_disasm(iseq->self);
+ VALUE str = rb_iseq_disasm(iseq);
printf("%s\n", StringValueCStr(str));
- fflush(stdout);
}
debugs("[compile step: finish]\n");
- return 0;
+ return COMPILE_OK;
}
static int
iseq_set_exception_local_table(rb_iseq_t *iseq)
{
+ /* TODO: every id table is same -> share it.
+ * Current problem is iseq_free().
+ */
ID id_dollar_bang;
+ ID *ids = (ID *)ALLOC_N(ID, 1);
CONST_ID(id_dollar_bang, "#$!");
- iseq->local_table = (ID *)ALLOC_N(ID, 1);
- iseq->local_table_size = 1;
- iseq->local_size = iseq->local_table_size + 1;
- iseq->local_table[0] = id_dollar_bang;
+ iseq->body->local_table_size = 1;
+ iseq->body->local_size = iseq->body->local_table_size + 1;
+ ids[0] = id_dollar_bang;
+ iseq->body->local_table = ids;
return COMPILE_OK;
}
static int
-get_lvar_level(rb_iseq_t *iseq)
+get_lvar_level(const rb_iseq_t *iseq)
{
int lev = 0;
- while (iseq != iseq->local_iseq) {
+ while (iseq != iseq->body->local_iseq) {
lev++;
- iseq = iseq->parent_iseq;
+ iseq = iseq->body->parent_iseq;
}
return lev;
}
static int
-get_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
+get_dyna_var_idx_at_raw(const rb_iseq_t *iseq, ID id)
{
- int i;
+ unsigned int i;
- for (i = 0; i < iseq->local_table_size; i++) {
- if (iseq->local_table[i] == id) {
- return i;
+ for (i = 0; i < iseq->body->local_table_size; i++) {
+ if (iseq->body->local_table[i] == id) {
+ return (int)i;
}
}
return -1;
}
static int
-get_local_var_idx(rb_iseq_t *iseq, ID id)
+get_local_var_idx(const rb_iseq_t *iseq, ID id)
{
- int idx = get_dyna_var_idx_at_raw(iseq->local_iseq, id);
+ int idx = get_dyna_var_idx_at_raw(iseq->body->local_iseq, id);
if (idx < 0) {
rb_bug("get_local_var_idx: %d", idx);
@@ -1096,7 +1212,7 @@ get_local_var_idx(rb_iseq_t *iseq, ID id)
}
static int
-get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
+get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls)
{
int lv = 0, idx = -1;
@@ -1105,7 +1221,7 @@ get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
if (idx >= 0) {
break;
}
- iseq = iseq->parent_iseq;
+ iseq = iseq->body->parent_iseq;
lv++;
}
@@ -1114,10 +1230,117 @@ get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
}
*level = lv;
- *ls = iseq->local_size;
+ *ls = iseq->body->local_size;
return idx;
}
+static void
+iseq_calc_param_size(rb_iseq_t *iseq)
+{
+ if (iseq->body->param.flags.has_opt ||
+ iseq->body->param.flags.has_post ||
+ iseq->body->param.flags.has_rest ||
+ iseq->body->param.flags.has_block ||
+ iseq->body->param.flags.has_kw ||
+ iseq->body->param.flags.has_kwrest) {
+
+ if (iseq->body->param.flags.has_block) {
+ iseq->body->param.size = iseq->body->param.block_start + 1;
+ }
+ else if (iseq->body->param.flags.has_kwrest) {
+ iseq->body->param.size = iseq->body->param.keyword->rest_start + 1;
+ }
+ else if (iseq->body->param.flags.has_kw) {
+ iseq->body->param.size = iseq->body->param.keyword->bits_start + 1;
+ }
+ else if (iseq->body->param.flags.has_post) {
+ iseq->body->param.size = iseq->body->param.post_start + iseq->body->param.post_num;
+ }
+ else if (iseq->body->param.flags.has_rest) {
+ iseq->body->param.size = iseq->body->param.rest_start + 1;
+ }
+ else if (iseq->body->param.flags.has_opt) {
+ iseq->body->param.size = iseq->body->param.lead_num + iseq->body->param.opt_num;
+ }
+ else {
+ rb_bug("unreachable");
+ }
+ }
+ else {
+ iseq->body->param.size = iseq->body->param.lead_num;
+ }
+}
+
+static void
+iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *optargs, const struct rb_args_info *args)
+{
+ NODE *node = args->kw_args;
+ struct rb_iseq_param_keyword *keyword;
+ const VALUE default_values = rb_ary_tmp_new(1);
+ const VALUE complex_mark = rb_str_tmp_new(0);
+ int kw = 0, rkw = 0, di = 0, i;
+
+ iseq->body->param.flags.has_kw = TRUE;
+ iseq->body->param.keyword = keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
+ keyword->bits_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+
+ while (node) {
+ NODE *val_node = node->nd_body->nd_value;
+ VALUE dv;
+
+ if (val_node == (NODE *)-1) {
+ ++rkw;
+ }
+ else {
+ switch (nd_type(val_node)) {
+ case NODE_LIT:
+ dv = val_node->nd_lit;
+ iseq_add_mark_object(iseq, dv);
+ break;
+ case NODE_NIL:
+ dv = Qnil;
+ break;
+ case NODE_TRUE:
+ dv = Qtrue;
+ break;
+ case NODE_FALSE:
+ dv = Qfalse;
+ break;
+ default:
+ COMPILE_POPED(optargs, "kwarg", node); /* nd_type(node) == NODE_KW_ARG */
+ dv = complex_mark;
+ }
+
+ keyword->num = ++di;
+ rb_ary_push(default_values, dv);
+ }
+
+ kw++;
+ node = node->nd_next;
+ }
+
+ keyword->num = kw;
+
+ if (args->kw_rest_arg->nd_cflag != 0) {
+ keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag);
+ iseq->body->param.flags.has_kwrest = TRUE;
+ }
+ keyword->required_num = rkw;
+ keyword->table = &iseq->body->local_table[keyword->bits_start - keyword->num];
+
+ {
+ VALUE *dvs = ALLOC_N(VALUE, RARRAY_LEN(default_values));
+
+ for (i = 0; i < RARRAY_LEN(default_values); i++) {
+ VALUE dv = RARRAY_AREF(default_values, i);
+ if (dv == complex_mark) dv = Qundef;
+ dvs[i] = dv;
+ }
+
+ keyword->default_values = dvs;
+ }
+}
+
static int
iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
{
@@ -1129,14 +1352,11 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
int last_comma = 0;
ID block_id = 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)));
- }
-
+ EXPECT_NODE("iseq_set_arguments", node_args, NODE_ARGS);
- iseq->argc = (int)args->pre_args_num;
- debugs(" - argc: %d\n", iseq->argc);
+ iseq->body->param.lead_num = (int)args->pre_args_num;
+ if (iseq->body->param.lead_num > 0) iseq->body->param.flags.has_lead = TRUE;
+ debugs(" - argc: %d\n", iseq->body->param.lead_num);
rest_id = args->rest_arg;
if (rest_id == 1) {
@@ -1146,14 +1366,16 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
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;
+ iseq->body->param.post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
+ iseq->body->param.post_num = args->post_args_num;
+ iseq->body->param.flags.has_post = TRUE;
}
if (args->opt_args) {
NODE *node = args->opt_args;
LABEL *label;
VALUE labels = rb_ary_tmp_new(1);
+ VALUE *opt_table;
int i = 0, j;
while (node) {
@@ -1169,60 +1391,28 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
label = NEW_LABEL(nd_line(node_args));
rb_ary_push(labels, (VALUE)label | 1);
ADD_LABEL(optargs, label);
- i += 1;
- iseq->arg_opts = i;
- iseq->arg_opt_table = ALLOC_N(VALUE, i);
- MEMCPY(iseq->arg_opt_table, RARRAY_CONST_PTR(labels), VALUE, i);
- for (j = 0; j < i; j++) {
- iseq->arg_opt_table[j] &= ~1;
+ opt_table = ALLOC_N(VALUE, i+1);
+
+ MEMCPY(opt_table, RARRAY_CONST_PTR(labels), VALUE, i+1);
+ for (j = 0; j < i+1; j++) {
+ opt_table[j] &= ~1;
}
rb_ary_clear(labels);
- }
- else {
- iseq->arg_opts = 0;
+
+ iseq->body->param.flags.has_opt = TRUE;
+ iseq->body->param.opt_num = i;
+ iseq->body->param.opt_table = opt_table;
}
if (args->kw_args) {
- NODE *node = args->kw_args;
- VALUE keywords = rb_ary_tmp_new(1);
- VALUE required = 0;
- int i = 0, j, r = 0;
-
- 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) {
- VALUE list = keywords;
- if (node->nd_body->nd_value == (NODE *)-1) {
- ++r;
- if (!required) required = rb_ary_tmp_new(1);
- list = required;
- }
- rb_ary_push(list, INT2FIX(node->nd_body->nd_vid));
- COMPILE_POPED(optargs, "kwarg", node); /* nd_type(node) == NODE_KW_ARG */
- node = node->nd_next;
- i += 1;
- }
- iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
- iseq->arg_keywords = i;
- iseq->arg_keyword_required = r;
- iseq->arg_keyword_table = ALLOC_N(ID, i);
- if (r) {
- rb_ary_concat(required, keywords);
- keywords = required;
- }
- for (j = 0; j < i; j++) {
- iseq->arg_keyword_table[j] = FIX2INT(RARRAY_AREF(keywords, j));
- }
- ADD_INSN(optargs, nd_line(args->kw_args), pop);
+ iseq_set_arguments_keywords(iseq, optargs, args);
}
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);
- ADD_INSN(optargs, nd_line(args->kw_rest_arg), pop);
- }
- else {
- iseq->arg_keyword = -1;
+ struct rb_iseq_param_keyword *keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
+ keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ iseq->body->param.keyword = keyword;
+ iseq->body->param.flags.has_kwrest = TRUE;
}
if (args->pre_init) { /* m_init */
@@ -1233,70 +1423,42 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
}
if (rest_id) {
- iseq->arg_rest = get_dyna_var_idx_at_raw(iseq, rest_id);
+ iseq->body->param.rest_start = get_dyna_var_idx_at_raw(iseq, rest_id);
+ iseq->body->param.flags.has_rest = TRUE;
+ assert(iseq->body->param.rest_start != -1);
- if (iseq->arg_rest == -1) {
- rb_bug("arg_rest: -1");
- }
-
- if (iseq->arg_post_start == 0) {
- iseq->arg_post_start = iseq->arg_rest + 1;
+ if (iseq->body->param.post_start == 0) { /* TODO: why that? */
+ iseq->body->param.post_start = iseq->body->param.rest_start + 1;
}
}
if (block_id) {
- iseq->arg_block = get_dyna_var_idx_at_raw(iseq, block_id);
+ iseq->body->param.block_start = get_dyna_var_idx_at_raw(iseq, block_id);
+ iseq->body->param.flags.has_block = TRUE;
}
- if (iseq->arg_opts != 0 || iseq->arg_post_len != 0 ||
- iseq->arg_rest != -1 || iseq->arg_block != -1 ||
- iseq->arg_keyword != -1) {
- iseq->arg_simple = 0;
+ iseq_calc_param_size(iseq);
- /* set arg_size: size of arguments */
- 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) {
- iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
- }
- else if (iseq->arg_rest != -1) {
- iseq->arg_size = iseq->arg_rest + 1;
- }
- else if (iseq->arg_opts) {
- iseq->arg_size = iseq->argc + iseq->arg_opts - 1;
- }
- else {
- iseq->arg_size = iseq->argc;
- }
- }
- else {
- iseq->arg_simple = 1;
- iseq->arg_size = iseq->argc;
- }
+ if (iseq->body->type == ISEQ_TYPE_BLOCK) {
+ if (iseq->body->param.flags.has_opt == FALSE &&
+ iseq->body->param.flags.has_post == FALSE &&
+ iseq->body->param.flags.has_rest == FALSE &&
+ iseq->body->param.flags.has_kw == FALSE &&
+ iseq->body->param.flags.has_kwrest == FALSE) {
- if (iseq->type == ISEQ_TYPE_BLOCK) {
- if (iseq->arg_opts == 0 && iseq->arg_post_len == 0 &&
- iseq->arg_rest == -1 && iseq->arg_keyword == -1) {
- if (iseq->argc == 1 && last_comma == 0) {
+ if (iseq->body->param.lead_num == 1 && last_comma == 0) {
/* {|a|} */
- iseq->arg_simple |= 0x02;
+ iseq->body->param.flags.ambiguous_param0 = TRUE;
}
}
}
}
- else {
- iseq->arg_simple = 1;
- }
return COMPILE_OK;
}
static int
-iseq_set_local_table(rb_iseq_t *iseq, ID *tbl)
+iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
{
int size;
@@ -1309,12 +1471,13 @@ iseq_set_local_table(rb_iseq_t *iseq, ID *tbl)
}
if (size > 0) {
- iseq->local_table = (ID *)ALLOC_N(ID, size);
- MEMCPY(iseq->local_table, tbl, ID, size);
+ ID *ids = (ID *)ALLOC_N(ID, size);
+ MEMCPY(ids, tbl, ID, size);
+ iseq->body->local_table = ids;
}
- iseq->local_size = iseq->local_table_size = size;
- iseq->local_size += 1;
+ iseq->body->local_size = iseq->body->local_table_size = size;
+ iseq->body->local_size += 1;
/*
if (lfp == dfp ) { // top, class, method
dfp[-1]: svar
@@ -1323,7 +1486,7 @@ iseq_set_local_table(rb_iseq_t *iseq, ID *tbl)
}
*/
- debugs("iseq_set_local_table: %d, %d\n", iseq->local_size, iseq->local_table_size);
+ debugs("iseq_set_local_table: %d, %d\n", iseq->body->local_size, iseq->body->local_table_size);
return COMPILE_OK;
}
@@ -1380,32 +1543,30 @@ cdhash_set_label_i(VALUE key, VALUE val, void *ptr)
static int
iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
- LABEL *lobj;
- INSN *iobj;
struct iseq_line_info_entry *line_info_table;
unsigned int last_line = 0;
LINK_ELEMENT *list;
VALUE *generated_iseq;
- int k, pos, sp, stack_max = 0, line = 0;
+ int insn_num, code_index, line_info_index, sp, stack_max = 0, line = 0;
- /* set label position */
+ /* fix label position */
list = FIRST_ELEMENT(anchor);
- k = pos = 0;
+ insn_num = code_index = 0;
while (list) {
switch (list->type) {
case ISEQ_ELEMENT_INSN:
{
- iobj = (INSN *)list;
+ INSN *iobj = (INSN *)list;
line = iobj->line_no;
- pos += insn_data_length(iobj);
- k++;
+ code_index += insn_data_length(iobj);
+ insn_num++;
break;
}
case ISEQ_ELEMENT_LABEL:
{
- lobj = (LABEL *)list;
- lobj->position = pos;
+ LABEL *lobj = (LABEL *)list;
+ lobj->position = code_index;
lobj->set = TRUE;
break;
}
@@ -1418,31 +1579,32 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
ADJUST *adjust = (ADJUST *)list;
if (adjust->line_no != -1) {
- pos += 2 /* insn + 1 operand */;
- k++;
+ code_index += 2 /* insn + 1 operand */;
+ insn_num++;
}
break;
}
default:
dump_disasm_list(FIRST_ELEMENT(anchor));
dump_disasm_list(list);
- rb_compile_error(RSTRING_PTR(iseq->location.path), line,
- "error: set_sequence");
- break;
+ COMPILE_ERROR(ruby_sourcefile_string, line, "error: set_sequence");
+ return COMPILE_NG;
}
list = list->next;
}
/* make instruction sequence */
- generated_iseq = ALLOC_N(VALUE, pos);
- line_info_table = ALLOC_N(struct iseq_line_info_entry, k);
- iseq->is_entries = ALLOC_N(union iseq_inline_storage_entry, iseq->is_size);
- MEMZERO(iseq->is_entries, union iseq_inline_storage_entry, iseq->is_size);
- iseq->callinfo_entries = ALLOC_N(rb_call_info_t, iseq->callinfo_size);
- /* MEMZERO(iseq->callinfo_entries, rb_call_info_t, iseq->callinfo_size); */
+ generated_iseq = ALLOC_N(VALUE, code_index);
+ line_info_table = ALLOC_N(struct iseq_line_info_entry, insn_num);
+ iseq->body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, iseq->body->is_size);
+ iseq->body->ci_entries = (struct rb_call_info *)ruby_xmalloc(sizeof(struct rb_call_info) * iseq->body->ci_size +
+ sizeof(struct rb_call_info_with_kwarg) * iseq->body->ci_kw_size);
+ iseq->body->cc_entries = ZALLOC_N(struct rb_call_cache, iseq->body->ci_size + iseq->body->ci_kw_size);
+
+ ISEQ_COMPILE_DATA(iseq)->ci_index = ISEQ_COMPILE_DATA(iseq)->ci_kw_index = 0;
list = FIRST_ELEMENT(anchor);
- k = pos = sp = 0;
+ line_info_index = code_index = sp = 0;
while (list) {
switch (list->type) {
@@ -1451,8 +1613,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
int j, len, insn;
const char *types;
VALUE *operands;
-
- iobj = (INSN *)list;
+ INSN *iobj = (INSN *)list;
/* update sp */
sp = calc_sp_depth(sp, iobj);
@@ -1463,7 +1624,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
/* fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp); */
operands = iobj->operands;
insn = iobj->insn_id;
- generated_iseq[pos] = insn;
+ generated_iseq[code_index] = insn;
types = insn_op_types(insn);
len = insn_len(insn);
@@ -1471,12 +1632,12 @@ 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->location.path), iobj->line_no,
- "operand size miss! (%d for %d)",
- iobj->operand_size, len - 1);
xfree(generated_iseq);
xfree(line_info_table);
- return 0;
+ COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
+ "operand size miss! (%d for %d)",
+ iobj->operand_size, len - 1);
+ return COMPILE_NG;
}
for (j = 0; types[j]; j++) {
@@ -1486,15 +1647,16 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
case TS_OFFSET:
{
/* label(destination position) */
- lobj = (LABEL *)operands[j];
+ LABEL *lobj = (LABEL *)operands[j];
if (!lobj->set) {
- rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
- "unknown label");
+ COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
+ "unknown label");
+ return COMPILE_NG;
}
if (lobj->sp == -1) {
lobj->sp = sp;
}
- generated_iseq[pos + 1 + j] = lobj->position - (pos + len);
+ generated_iseq[code_index + 1 + j] = lobj->position - (code_index + len);
break;
}
case TS_CDHASH:
@@ -1502,87 +1664,102 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
VALUE map = operands[j];
struct cdhash_set_label_struct data;
data.hash = map;
- data.pos = pos;
+ data.pos = code_index;
data.len = len;
rb_hash_foreach(map, cdhash_set_label_i, (VALUE)&data);
- hide_obj(map);
- generated_iseq[pos + 1 + j] = map;
+ rb_hash_rehash(map);
+ freeze_hide_obj(map);
+ generated_iseq[code_index + 1 + j] = map;
break;
}
case TS_LINDEX:
case TS_NUM: /* ulong */
- generated_iseq[pos + 1 + j] = FIX2INT(operands[j]);
+ generated_iseq[code_index + 1 + j] = FIX2INT(operands[j]);
break;
case TS_ISEQ: /* iseq */
{
VALUE v = operands[j];
- rb_iseq_t *block = 0;
- if (v) {
- GetISeqPtr(v, block);
- }
- generated_iseq[pos + 1 + j] = (VALUE)block;
+ generated_iseq[code_index + 1 + j] = v;
break;
}
case TS_VALUE: /* VALUE */
{
VALUE v = operands[j];
- generated_iseq[pos + 1 + j] = v;
+ generated_iseq[code_index + 1 + j] = v;
/* to mark ruby object */
iseq_add_mark_object(iseq, v);
break;
}
case TS_IC: /* inline cache */
{
- int ic_index = FIX2INT(operands[j]);
- IC ic = (IC)&iseq->is_entries[ic_index];
- if (UNLIKELY(ic_index >= iseq->is_size)) {
- rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->is_size);
+ unsigned int ic_index = FIX2UINT(operands[j]);
+ IC ic = (IC)&iseq->body->is_entries[ic_index];
+ if (UNLIKELY(ic_index >= iseq->body->is_size)) {
+ rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->body->is_size);
}
- generated_iseq[pos + 1 + j] = (VALUE)ic;
+ generated_iseq[code_index + 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);
+ struct rb_call_info *base_ci = (struct rb_call_info *)operands[j];
+ struct rb_call_info *ci;
+
+ if (base_ci->flag & VM_CALL_KWARG) {
+ struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&iseq->body->ci_entries[iseq->body->ci_size];
+ struct rb_call_info_with_kwarg *ci_kw = &ci_kw_entries[ISEQ_COMPILE_DATA(iseq)->ci_kw_index++];
+ *ci_kw = *((struct rb_call_info_with_kwarg *)base_ci);
+ ci = (struct rb_call_info *)ci_kw;
+ assert(ISEQ_COMPILE_DATA(iseq)->ci_kw_index <= iseq->body->ci_kw_size);
+ }
+ else {
+ ci = &iseq->body->ci_entries[ISEQ_COMPILE_DATA(iseq)->ci_index++];
+ *ci = *base_ci;
+ assert(ISEQ_COMPILE_DATA(iseq)->ci_index <= iseq->body->ci_size);
}
- generated_iseq[pos + 1 + j] = (VALUE)ci;
+
+ generated_iseq[code_index + 1 + j] = (VALUE)ci;
+ break;
+ }
+ case TS_CALLCACHE:
+ {
+ struct rb_call_cache *cc = &iseq->body->cc_entries[ISEQ_COMPILE_DATA(iseq)->ci_index + ISEQ_COMPILE_DATA(iseq)->ci_kw_index - 1];
+ generated_iseq[code_index + 1 + j] = (VALUE)cc;
break;
}
case TS_ID: /* ID */
- generated_iseq[pos + 1 + j] = SYM2ID(operands[j]);
+ generated_iseq[code_index + 1 + j] = SYM2ID(operands[j]);
break;
case TS_GENTRY:
{
struct rb_global_entry *entry =
(struct rb_global_entry *)(operands[j] & (~1));
- generated_iseq[pos + 1 + j] = (VALUE)entry;
+ generated_iseq[code_index + 1 + j] = (VALUE)entry;
}
break;
+ case TS_FUNCPTR:
+ generated_iseq[code_index + 1 + j] = operands[j];
+ break;
default:
- rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
- "unknown operand type: %c", type);
xfree(generated_iseq);
xfree(line_info_table);
- return 0;
+ COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
+ "unknown operand type: %c", type);
+ return COMPILE_NG;
}
}
if (last_line != iobj->line_no) {
- line_info_table[k].line_no = last_line = iobj->line_no;
- line_info_table[k].position = pos;
- k++;
+ line_info_table[line_info_index].line_no = last_line = iobj->line_no;
+ line_info_table[line_info_index].position = code_index;
+ line_info_index++;
}
- pos += len;
+ code_index += len;
break;
}
case ISEQ_ELEMENT_LABEL:
{
- lobj = (LABEL *)list;
+ LABEL *lobj = (LABEL *)list;
if (lobj->sp == -1) {
lobj->sp = sp;
}
@@ -1606,25 +1783,26 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
if (adjust->line_no != -1) {
if (orig_sp - sp > 0) {
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++;
+ line_info_table[line_info_index].line_no = last_line = adjust->line_no;
+ line_info_table[line_info_index].position = code_index;
+ line_info_index++;
}
- generated_iseq[pos++] = BIN(adjuststack);
- generated_iseq[pos++] = orig_sp - sp;
+ generated_iseq[code_index++] = BIN(adjuststack);
+ generated_iseq[code_index++] = orig_sp - sp;
}
else if (orig_sp - sp == 0) {
/* jump to next insn */
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++;
+ line_info_table[line_info_index].line_no = last_line = adjust->line_no;
+ line_info_table[line_info_index].position = code_index;
+ line_info_index++;
}
- generated_iseq[pos++] = BIN(jump);
- generated_iseq[pos++] = 0;
+ generated_iseq[code_index++] = BIN(nop);
+ generated_iseq[code_index++] = BIN(nop);
}
else {
- rb_bug("iseq_set_sequence: adjust bug");
+ rb_compile_bug_str(ruby_sourcefile_string, adjust->line_no,
+ "iseq_set_sequence: adjust bug %d < %d", orig_sp, sp);
}
}
break;
@@ -1636,20 +1814,13 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
list = list->next;
}
-#if 0 /* XXX */
- /* this check need dead code elimination */
- if (sp != 1) {
- rb_bug("SP is not 0 on %s (%d)\n", RSTRING_PTR(iseq->name), sp);
- }
-#endif
+ iseq->body->iseq_encoded = (void *)generated_iseq;
+ iseq->body->iseq_size = code_index;
+ iseq->body->stack_max = stack_max;
- iseq->iseq = (void *)generated_iseq;
- iseq->iseq_size = pos;
- 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;
+ REALLOC_N(line_info_table, struct iseq_line_info_entry, line_info_index);
+ iseq->body->line_info_table = line_info_table;
+ iseq->body->line_info_size = line_info_index;
return COMPILE_OK;
}
@@ -1670,47 +1841,53 @@ static int
iseq_set_exception_table(rb_iseq_t *iseq)
{
const VALUE *tptr, *ptr;
- int tlen, i;
+ unsigned int tlen, i;
struct iseq_catch_table_entry *entry;
- tlen = (int)RARRAY_LEN(iseq->compile_data->catch_table_ary);
- tptr = RARRAY_CONST_PTR(iseq->compile_data->catch_table_ary);
+ tlen = (int)RARRAY_LEN(ISEQ_COMPILE_DATA(iseq)->catch_table_ary);
+ tptr = RARRAY_CONST_PTR(ISEQ_COMPILE_DATA(iseq)->catch_table_ary);
- iseq->catch_table = tlen ? ALLOC_N(struct iseq_catch_table_entry, tlen) : 0;
- iseq->catch_table_size = tlen;
+ if (tlen > 0) {
+ struct iseq_catch_table *table = xmalloc(iseq_catch_table_bytes(tlen));
+ table->size = tlen;
- for (i = 0; i < tlen; i++) {
- ptr = RARRAY_CONST_PTR(tptr[i]);
- entry = &iseq->catch_table[i];
- entry->type = (enum catch_type)(ptr[0] & 0xffff);
- entry->start = label_get_position((LABEL *)(ptr[1] & ~1));
- entry->end = label_get_position((LABEL *)(ptr[2] & ~1));
- entry->iseq = ptr[3];
+ for (i = 0; i < table->size; i++) {
+ ptr = RARRAY_CONST_PTR(tptr[i]);
+ entry = &table->entries[i];
+ entry->type = (enum catch_type)(ptr[0] & 0xffff);
+ entry->start = label_get_position((LABEL *)(ptr[1] & ~1));
+ entry->end = label_get_position((LABEL *)(ptr[2] & ~1));
+ entry->iseq = (rb_iseq_t *)ptr[3];
- /* register iseq as mark object */
- if (entry->iseq != 0) {
- iseq_add_mark_object(iseq, entry->iseq);
- }
-
- /* stack depth */
- if (ptr[4]) {
- LABEL *lobj = (LABEL *)(ptr[4] & ~1);
- entry->cont = label_get_position(lobj);
- entry->sp = label_get_sp(lobj);
+ /* register iseq as mark object */
+ if (entry->iseq != 0) {
+ iseq_add_mark_object(iseq, (VALUE)entry->iseq);
+ }
- /* TODO: Dirty Hack! Fix me */
- if (entry->type == CATCH_TYPE_RESCUE ||
- entry->type == CATCH_TYPE_BREAK ||
- entry->type == CATCH_TYPE_NEXT) {
- entry->sp--;
+ /* stack depth */
+ if (ptr[4]) {
+ LABEL *lobj = (LABEL *)(ptr[4] & ~1);
+ entry->cont = label_get_position(lobj);
+ entry->sp = label_get_sp(lobj);
+
+ /* TODO: Dirty Hack! Fix me */
+ if (entry->type == CATCH_TYPE_RESCUE ||
+ entry->type == CATCH_TYPE_BREAK ||
+ entry->type == CATCH_TYPE_NEXT) {
+ entry->sp--;
+ }
+ }
+ else {
+ entry->cont = 0;
}
}
- else {
- entry->cont = 0;
- }
+ iseq->body->catch_table = table;
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, 0); /* free */
+ }
+ else {
+ iseq->body->catch_table = NULL;
}
- RB_OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, 0); /* free */
return COMPILE_OK;
}
@@ -1727,11 +1904,11 @@ static int
iseq_set_optargs_table(rb_iseq_t *iseq)
{
int i;
+ VALUE *opt_table = (VALUE *)iseq->body->param.opt_table;
- if (iseq->arg_opts != 0) {
- for (i = 0; i < iseq->arg_opts; i++) {
- iseq->arg_opt_table[i] =
- label_get_position((LABEL *)iseq->arg_opt_table[i]);
+ if (iseq->body->param.flags.has_opt) {
+ for (i = 0; i < iseq->body->param.opt_num + 1; i++) {
+ opt_table[i] = label_get_position((LABEL *)opt_table[i]);
}
}
return COMPILE_OK;
@@ -1781,6 +1958,50 @@ get_prev_insn(INSN *iobj)
return 0;
}
+static void
+unref_destination(INSN *iobj)
+{
+ LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
+ --lobj->refcnt;
+ if (!lobj->refcnt) REMOVE_ELEM(&lobj->link);
+}
+
+static void
+replace_destination(INSN *dobj, INSN *nobj)
+{
+ VALUE n = OPERAND_AT(nobj, 0);
+ LABEL *dl = (LABEL *)OPERAND_AT(dobj, 0);
+ LABEL *nl = (LABEL *)n;
+ --dl->refcnt;
+ ++nl->refcnt;
+ OPERAND_AT(dobj, 0) = n;
+ if (!dl->refcnt) REMOVE_ELEM(&dl->link);
+}
+
+static int
+remove_unreachable_chunk(LINK_ELEMENT *i)
+{
+ int removed = 0;
+ while (i) {
+ if (i->type == ISEQ_ELEMENT_INSN) {
+ switch (INSN_OF(i)) {
+ case BIN(jump):
+ case BIN(branchif):
+ case BIN(branchunless):
+ case BIN(branchnil):
+ unref_destination((INSN *)i);
+ default:
+ break;
+ }
+ }
+ else break;
+ REMOVE_ELEM(i);
+ removed = 1;
+ i = i->next;
+ }
+ return removed;
+}
+
static int
iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcallopt)
{
@@ -1808,13 +2029,14 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* =>
* LABEL:
*/
+ unref_destination(iobj);
REMOVE_ELEM(&iobj->link);
}
- else if (iobj != diobj && diobj->insn_id == BIN(jump)) {
- if (OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
- OPERAND_AT(iobj, 0) = OPERAND_AT(diobj, 0);
- goto again;
- }
+ else if (iobj != diobj && diobj->insn_id == BIN(jump) &&
+ OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
+ replace_destination(iobj, diobj);
+ remove_unreachable_chunk(iobj->link.next);
+ goto again;
}
else if (diobj->insn_id == BIN(leave)) {
/*
@@ -1828,14 +2050,14 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* LABEL:
* leave
*/
- INSN *eiobj = new_insn_core(iseq, iobj->line_no, BIN(leave),
- diobj->operand_size, diobj->operands);
INSN *popiobj = new_insn_core(iseq, iobj->line_no,
BIN(pop), 0, 0);
/* replace */
- REPLACE_ELEM((LINK_ELEMENT *)iobj, (LINK_ELEMENT *)eiobj);
- INSERT_ELEM_NEXT((LINK_ELEMENT *)eiobj, (LINK_ELEMENT *)popiobj);
- iobj = popiobj;
+ unref_destination(iobj);
+ iobj->insn_id = BIN(leave);
+ iobj->operand_size = 0;
+ INSERT_ELEM_NEXT(&iobj->link, &popiobj->link);
+ goto again;
}
/*
* useless jump elimination (if/unless destination):
@@ -1857,13 +2079,21 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
if (niobj == (INSN *)get_destination_insn(piobj)) {
piobj->insn_id = (piobj->insn_id == BIN(branchif))
? BIN(branchunless) : BIN(branchif);
- OPERAND_AT(piobj, 0) = OPERAND_AT(iobj, 0);
+ replace_destination(piobj, iobj);
REMOVE_ELEM(&iobj->link);
}
}
+ else if (remove_unreachable_chunk(iobj->link.next)) {
+ goto again;
+ }
+ }
+
+ if (iobj->insn_id == BIN(leave)) {
+ remove_unreachable_chunk(iobj->link.next);
}
if (iobj->insn_id == BIN(branchif) ||
+ iobj->insn_id == BIN(branchnil) ||
iobj->insn_id == BIN(branchunless)) {
/*
* if L1
@@ -1874,12 +2104,124 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* if L2
*/
INSN *nobj = (INSN *)get_destination_insn(iobj);
- if (nobj->insn_id == BIN(jump)) {
- OPERAND_AT(iobj, 0) = OPERAND_AT(nobj, 0);
+ INSN *pobj = (INSN *)iobj->link.prev;
+ int prev_dup = 0;
+ if (pobj) {
+ if (pobj->link.type != ISEQ_ELEMENT_INSN)
+ pobj = 0;
+ else if (pobj->insn_id == BIN(dup))
+ prev_dup = 1;
+ }
+
+ for (;;) {
+ if (nobj->insn_id == BIN(jump)) {
+ replace_destination(iobj, nobj);
+ }
+ else if (prev_dup && nobj->insn_id == BIN(dup) &&
+ !!(nobj = (INSN *)nobj->link.next) &&
+ /* basic blocks, with no labels in the middle */
+ nobj->insn_id == iobj->insn_id) {
+ /*
+ * dup
+ * if L1
+ * ...
+ * L1:
+ * dup
+ * if L2
+ * =>
+ * dup
+ * if L2
+ * ...
+ * L1:
+ * dup
+ * if L2
+ */
+ replace_destination(iobj, nobj);
+ }
+ else if (pobj) {
+ /*
+ * putnil
+ * if L1
+ * =>
+ * # nothing
+ *
+ * putobject true
+ * if L1
+ * =>
+ * jump L1
+ *
+ * putstring ".."
+ * if L1
+ * =>
+ * jump L1
+ *
+ * putstring ".."
+ * dup
+ * if L1
+ * =>
+ * putstring ".."
+ * jump L1
+ *
+ */
+ int cond;
+ if (prev_dup && pobj->link.prev->type == ISEQ_ELEMENT_INSN) {
+ pobj = (INSN *)pobj->link.prev;
+ }
+ if (pobj->insn_id == BIN(putobject)) {
+ cond = (iobj->insn_id == BIN(branchif) ?
+ OPERAND_AT(pobj, 0) != Qfalse :
+ iobj->insn_id == BIN(branchunless) ?
+ OPERAND_AT(pobj, 0) == Qfalse :
+ FALSE);
+ }
+ else if (pobj->insn_id == BIN(putstring)) {
+ cond = iobj->insn_id == BIN(branchif);
+ }
+ else if (pobj->insn_id == BIN(putnil)) {
+ cond = iobj->insn_id != BIN(branchif);
+ }
+ else break;
+ REMOVE_ELEM(iobj->link.prev);
+ if (cond) {
+ iobj->insn_id = BIN(jump);
+ goto again;
+ }
+ else {
+ unref_destination(iobj);
+ REMOVE_ELEM(&iobj->link);
+ }
+ break;
+ }
+ else break;
+ nobj = (INSN *)get_destination_insn(nobj);
}
}
- if (do_tailcallopt && iobj->insn_id == BIN(leave)) {
+ if (iobj->insn_id == BIN(pop)) {
+ /*
+ * putself / putnil / putobject obj / putstring "..."
+ * pop
+ * =>
+ * # do nothing
+ */
+ LINK_ELEMENT *prev = iobj->link.prev;
+ if (prev->type == ISEQ_ELEMENT_INSN) {
+ enum ruby_vminsn_type previ = ((INSN *)prev)->insn_id;
+ if (previ == BIN(putobject) || previ == BIN(putnil) ||
+ previ == BIN(putself) || previ == BIN(putstring)) {
+ /* just push operand or static value and pop soon, no
+ * side effects */
+ REMOVE_ELEM(prev);
+ REMOVE_ELEM(&iobj->link);
+ }
+ }
+ }
+
+ if (do_tailcallopt &&
+ (iobj->insn_id == BIN(send) ||
+ iobj->insn_id == BIN(opt_aref_with) ||
+ iobj->insn_id == BIN(opt_aset_with) ||
+ iobj->insn_id == BIN(invokesuper))) {
/*
* send ...
* leave
@@ -1887,12 +2229,43 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* send ..., ... | VM_CALL_TAILCALL, ...
* leave # unreachable
*/
- INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
- enum ruby_vminsn_type previ = piobj->insn_id;
+ INSN *piobj = NULL;
+ if (iobj->link.next) {
+ LINK_ELEMENT *next = iobj->link.next;
+ do {
+ if (next->type != ISEQ_ELEMENT_INSN) {
+ next = next->next;
+ continue;
+ }
+ switch (INSN_OF(next)) {
+ case BIN(nop):
+ /*case BIN(trace):*/
+ next = next->next;
+ break;
+ case BIN(jump):
+ /* if cond
+ * return tailcall
+ * end
+ */
+ next = get_destination_insn((INSN *)next);
+ break;
+ case BIN(leave):
+ piobj = iobj;
+ default:
+ next = NULL;
+ break;
+ }
+ } while (next);
+ }
- if (previ == BIN(send) || previ == BIN(opt_send_simple) || previ == BIN(invokesuper)) {
- rb_call_info_t *ci = (rb_call_info_t *)piobj->operands[0];
- if (ci->blockiseq == 0) {
+ if (piobj) {
+ struct rb_call_info *ci = (struct rb_call_info *)piobj->operands[0];
+ if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(invokesuper)) {
+ if (piobj->operands[2] == 0) { /* no blockiseq */
+ ci->flag |= VM_CALL_TAILCALL;
+ }
+ }
+ else {
ci->flag |= VM_CALL_TAILCALL;
}
}
@@ -1903,18 +2276,17 @@ 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 old_opsize = iobj->operand_size;
iobj->insn_id = insn_id;
iobj->operand_size = insn_len(insn_id) - 1;
- if (iobj->operand_size > old_opsize) {
+ if (insn_id == BIN(opt_neq)) {
VALUE *old_operands = iobj->operands;
- if (insn_id != BIN(opt_neq)) {
- rb_bug("insn_set_specialized_instruction: unknown insn: %d", insn_id);
- }
+ iobj->operand_size = 4;
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);
+ iobj->operands[1] = Qfalse; /* CALL_CACHE */
+ iobj->operands[2] = (VALUE)new_callinfo(iseq, idEq, 1, 0, NULL, FALSE);
+ iobj->operands[3] = Qfalse; /* CALL_CACHE */
}
return COMPILE_OK;
@@ -1924,10 +2296,11 @@ static int
iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
{
if (iobj->insn_id == BIN(send)) {
- rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, 0);
+ struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(iobj, 0);
+ const rb_iseq_t *blockiseq = (rb_iseq_t *)OPERAND_AT(iobj, 2);
#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) {
+ if (ci->flag & VM_CALL_ARGS_SIMPLE) {
switch (ci->orig_argc) {
case 0:
switch (ci->mid) {
@@ -1962,8 +2335,10 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
break;
}
}
- if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) {
- iobj->insn_id = BIN(opt_send_simple);
+
+ if ((ci->flag & VM_CALL_ARGS_BLOCKARG) == 0 && blockiseq == NULL) {
+ iobj->insn_id = BIN(opt_send_without_block);
+ iobj->operand_size = insn_len(iobj->insn_id) - 1;
}
}
#undef SP_INSN
@@ -1971,20 +2346,37 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
return COMPILE_OK;
}
+static inline int
+tailcallable_p(rb_iseq_t *iseq)
+{
+ switch (iseq->body->type) {
+ case ISEQ_TYPE_RESCUE:
+ case ISEQ_TYPE_ENSURE:
+ /* rescue block can't tail call because of errinfo */
+ return FALSE;
+ default:
+ return TRUE;
+ }
+}
+
static int
iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
LINK_ELEMENT *list;
- const int do_peepholeopt = iseq->compile_data->option->peephole_optimization;
- const int do_tailcallopt = iseq->compile_data->option->tailcall_optimization;
- const int do_si = iseq->compile_data->option->specialized_instruction;
- const int do_ou = iseq->compile_data->option->operands_unification;
+ const int do_peepholeopt = ISEQ_COMPILE_DATA(iseq)->option->peephole_optimization;
+ const int do_tailcallopt = tailcallable_p(iseq) &&
+ ISEQ_COMPILE_DATA(iseq)->option->tailcall_optimization;
+ const int do_si = ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction;
+ const int do_ou = ISEQ_COMPILE_DATA(iseq)->option->operands_unification;
+ int rescue_level = 0;
+ int tailcallopt = do_tailcallopt;
+
list = FIRST_ELEMENT(anchor);
while (list) {
if (list->type == ISEQ_ELEMENT_INSN) {
if (do_peepholeopt) {
- iseq_peephole_optimize(iseq, list, do_tailcallopt);
+ iseq_peephole_optimize(iseq, list, tailcallopt);
}
if (do_si) {
iseq_specialized_instruction(iseq, (INSN *)list);
@@ -1993,6 +2385,17 @@ iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
insn_operands_unification((INSN *)list);
}
}
+ if (list->type == ISEQ_ELEMENT_LABEL) {
+ switch (((LABEL *)list)->rescued) {
+ case LABEL_RESCUE_BEG:
+ rescue_level++;
+ tailcallopt = FALSE;
+ break;
+ case LABEL_RESCUE_END:
+ if (!--rescue_level) tailcallopt = do_tailcallopt;
+ break;
+ }
+ }
list = list->next;
}
return COMPILE_OK;
@@ -2116,9 +2519,9 @@ 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->location.path), iobj->line_no,
- "insn_set_sc_state error\n");
- return 0;
+ COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
+ "insn_set_sc_state error\n");
+ return COMPILE_NG;
}
}
else {
@@ -2218,8 +2621,9 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
case SCS_XX:
goto normal_insn;
default:
- rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
- "unreachable");
+ COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
+ "unreachable");
+ return COMPILE_NG;
}
/* remove useless pop */
REMOVE_ELEM(list);
@@ -2254,14 +2658,19 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
{
NODE *list = node->nd_next;
VALUE lit = node->nd_lit;
+ LINK_ELEMENT *first_lit = 0;
int cnt = 0;
debugp_param("nd_lit", lit);
if (!NIL_P(lit)) {
cnt++;
- if (RB_TYPE_P(lit, T_STRING))
- lit = node->nd_lit = rb_fstring(node->nd_lit);
+ if (!RB_TYPE_P(lit, T_STRING)) {
+ rb_compile_bug_str(ERROR_ARGS "dstr: must be string: %s",
+ rb_builtin_type_name(TYPE(lit)));
+ }
+ lit = node->nd_lit = rb_fstring(lit);
ADD_INSN1(ret, nd_line(node), putobject, lit);
+ if (RSTRING_LEN(lit) == 0) first_lit = LAST_ELEMENT(ret);
}
while (list) {
@@ -2269,6 +2678,7 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
if (nd_type(node) == NODE_STR) {
node->nd_lit = rb_fstring(node->nd_lit);
ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ lit = Qnil;
}
else {
COMPILE(ret, "each string", node);
@@ -2276,6 +2686,10 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
cnt++;
list = list->nd_next;
}
+ if (NIL_P(lit) && first_lit) {
+ REMOVE_ELEM(first_lit);
+ --cnt;
+ }
*cntp = cnt;
return COMPILE_OK;
@@ -2344,6 +2758,52 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
return COMPILE_OK;
}
+static int
+compile_array_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *ret, const NODE * const root_node, struct rb_call_info_kw_arg ** const kw_arg_ptr)
+{
+ if (kw_arg_ptr == NULL) return FALSE;
+
+ if (nd_type(root_node) == NODE_HASH && root_node->nd_head && nd_type(root_node->nd_head) == NODE_ARRAY) {
+ NODE *node = root_node->nd_head;
+
+ while (node) {
+ NODE *key_node = node->nd_head;
+
+ assert(nd_type(node) == NODE_ARRAY);
+ if (key_node && nd_type(key_node) == NODE_LIT && RB_TYPE_P(key_node->nd_lit, T_SYMBOL)) {
+ /* can be keywords */
+ }
+ else {
+ return FALSE;
+ }
+ node = node->nd_next; /* skip value node */
+ node = node->nd_next;
+ }
+
+ /* may be keywords */
+ node = root_node->nd_head;
+ {
+ int len = (int)node->nd_alen / 2;
+ struct rb_call_info_kw_arg *kw_arg = (struct rb_call_info_kw_arg *)ruby_xmalloc(sizeof(struct rb_call_info_kw_arg) + sizeof(VALUE) * (len - 1));
+ VALUE *keywords = kw_arg->keywords;
+ int i = 0;
+ kw_arg->keyword_len = len;
+
+ *kw_arg_ptr = kw_arg;
+
+ for (i=0; node != NULL; i++, node = node->nd_next->nd_next) {
+ NODE *key_node = node->nd_head;
+ NODE *val_node = node->nd_next->nd_head;
+ keywords[i] = key_node->nd_lit;
+ COMPILE(ret, "keyword values", val_node);
+ }
+ assert(i == len);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
enum compile_array_type_t {
COMPILE_ARRAY_TYPE_ARRAY,
COMPILE_ARRAY_TYPE_HASH,
@@ -2352,7 +2812,7 @@ enum compile_array_type_t {
static int
compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
- enum compile_array_type_t type, int poped)
+ enum compile_array_type_t type, struct rb_call_info_kw_arg **keywords_ptr, int poped)
{
NODE *node = node_root;
int line = (int)nd_line(node);
@@ -2379,22 +2839,30 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
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 (CPDEBUG > 0) {
+ EXPECT_NODE("compile_array", node, NODE_ARRAY);
}
- if (type == COMPILE_ARRAY_TYPE_HASH && !node->nd_head) {
- opt_p = 0;
+ if (type != COMPILE_ARRAY_TYPE_ARRAY && !node->nd_head) {
kw = node->nd_next;
- node = kw->nd_next;
- kw = kw->nd_head;
+ node = 0;
+ if (kw) {
+ opt_p = 0;
+ 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 (type == COMPILE_ARRAY_TYPE_ARGS && node->nd_next == NULL /* last node */ && compile_array_keyword_arg(iseq, anchor, node->nd_head, keywords_ptr)) {
+ len--;
+ }
+ else {
+ COMPILE_(anchor, "array element", node->nd_head, poped);
+ }
}
if (opt_p && type != COMPILE_ARRAY_TYPE_ARGS) {
@@ -2429,7 +2897,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
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));
+ ADD_SEND(ret, line, id_core_hash_from_ary, INT2FIX(1));
}
}
else {
@@ -2440,7 +2908,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
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));
+ ADD_SEND(ret, line, id_core_hash_merge_ary, INT2FIX(1));
}
}
}
@@ -2470,7 +2938,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
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));
+ ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(i + 1));
}
}
if (kw) {
@@ -2478,7 +2946,8 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
if (i > 0 || !first) ADD_INSN(ret, line, swap);
COMPILE(ret, "keyword splat", kw);
- ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_kwd), nhash);
+ ADD_SEND(ret, line, id_core_hash_merge_kwd, nhash);
+ if (nhash == INT2FIX(1)) ADD_SEND(ret, line, rb_intern("dup"), INT2FIX(0));
}
first = 0;
break;
@@ -2500,7 +2969,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
static VALUE
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, type, 0);
+ return compile_array_(iseq, ret, node_root, type, NULL, 0);
}
static VALUE
@@ -2519,6 +2988,12 @@ case_when_optimizable_literal(NODE * node)
}
break;
}
+ case NODE_NIL:
+ return Qnil;
+ case NODE_TRUE:
+ return Qtrue;
+ case NODE_FALSE:
+ return Qfalse;
case NODE_STR:
return node->nd_lit = rb_fstring(node->nd_lit);
}
@@ -2537,7 +3012,8 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, int onl
}
else {
if (rb_hash_lookup(literals, lit) != Qnil) {
- rb_compile_warning(RSTRING_PTR(iseq->location.path), nd_line(val), "duplicated when clause is ignored");
+ rb_compile_warning(ruby_sourcefile, nd_line(val),
+ "duplicated when clause is ignored");
}
else {
rb_hash_aset(literals, lit, (VALUE)(l1) | 1);
@@ -2568,21 +3044,24 @@ 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;
+ struct rb_call_info *ci;
VALUE dupidx;
+ int line = nd_line(node);
COMPILE_POPED(ret, "masgn lhs (NODE_ATTRASGN)", node);
- POP_ELEMENT(ret); /* pop pop insn */
- iobj = (INSN *)POP_ELEMENT(ret); /* pop send insn */
- ci = (rb_call_info_t *)iobj->operands[0];
- ci->orig_argc += 1; ci->argc = ci->orig_argc;
+ iobj = (INSN *)get_prev_insn((INSN *)LAST_ELEMENT(ret)); /* send insn */
+ ci = (struct rb_call_info *)iobj->operands[0];
+ ci->orig_argc += 1;
dupidx = INT2FIX(ci->orig_argc);
- ADD_INSN1(ret, nd_line(node), topn, dupidx);
- ADD_ELEM(ret, (LINK_ELEMENT *)iobj);
- ADD_INSN(ret, nd_line(node), pop); /* result */
- ADD_INSN(ret, nd_line(node), pop); /* rhs */
+ INSERT_BEFORE_INSN1(iobj, line, topn, dupidx);
+ if (ci->flag & VM_CALL_ARGS_SPLAT) {
+ --ci->orig_argc;
+ INSERT_BEFORE_INSN1(iobj, line, newarray, INT2FIX(1));
+ INSERT_BEFORE_INSN(iobj, line, concatarray);
+ }
+ ADD_INSN(ret, line, pop); /* result */
break;
}
case NODE_MASGN: {
@@ -2679,6 +3158,17 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *ret,
return 1;
}
+static void
+adjust_stack(rb_iseq_t *iseq, LINK_ANCHOR *ret, int line, int rlen, int llen)
+{
+ if (rlen < llen) {
+ do {ADD_INSN(ret, line, putnil);} while (++rlen < llen);
+ }
+ else if (rlen > llen) {
+ do {ADD_INSN(ret, line, pop);} while (--rlen > llen);
+ }
+}
+
static int
compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
{
@@ -2689,6 +3179,7 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
if (!poped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
int llen = 0;
+ int expand = 1;
DECL_ANCHOR(lhsseq);
INIT_ANCHOR(lhsseq);
@@ -2704,9 +3195,35 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
if (!poped) {
ADD_INSN(ret, nd_line(node), dup);
}
-
- ADD_INSN2(ret, nd_line(node), expandarray,
- INT2FIX(llen), INT2FIX(lhs_splat));
+ else if (!lhs_splat) {
+ INSN *last = (INSN*)ret->last;
+ if (last->link.type == ISEQ_ELEMENT_INSN &&
+ last->insn_id == BIN(newarray) &&
+ last->operand_size == 1) {
+ int rlen = FIX2INT(OPERAND_AT(last, 0));
+ /* special case: assign to aset or attrset */
+ if (llen == 2) {
+ POP_ELEMENT(ret);
+ adjust_stack(iseq, ret, nd_line(node), rlen, llen);
+ ADD_INSN(ret, nd_line(node), swap);
+ expand = 0;
+ }
+ else if (llen > 2 && llen != rlen) {
+ POP_ELEMENT(ret);
+ adjust_stack(iseq, ret, nd_line(node), rlen, llen);
+ ADD_INSN1(ret, nd_line(node), reverse, INT2FIX(llen));
+ expand = 0;
+ }
+ else if (llen > 2) {
+ last->insn_id = BIN(reverse);
+ expand = 0;
+ }
+ }
+ }
+ if (expand) {
+ ADD_INSN2(ret, nd_line(node), expandarray,
+ INT2FIX(llen), INT2FIX(lhs_splat));
+ }
ADD_SEQ(ret, lhsseq);
if (lhs_splat) {
@@ -2785,6 +3302,8 @@ compile_cpath(LINK_ANCHOR *ret, rb_iseq_t *iseq, NODE *cpath)
}
}
+#define private_recv_p(node) (nd_type((node)->nd_recv) == NODE_SELF)
+
#define defined_expr defined_expr0
static int
defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
@@ -2888,17 +3407,10 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
case NODE_VCALL:
case NODE_FCALL:
case NODE_ATTRASGN:{
- int self = TRUE;
+ const int explicit_receiver =
+ (type == NODE_CALL ||
+ (type == NODE_ATTRASGN && !private_recv_p(node)));
- switch (type) {
- case NODE_ATTRASGN:
- if (node->nd_recv == (NODE *)1) break;
- case NODE_CALL:
- self = FALSE;
- break;
- default:
- /* through */;
- }
if (!lfinish[1]) {
lfinish[1] = NEW_LABEL(nd_line(node));
}
@@ -2906,7 +3418,7 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse);
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
}
- if (!self) {
+ if (explicit_receiver) {
defined_expr(iseq, ret, node->nd_recv, lfinish, Qfalse);
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
COMPILE(ret, "defined/recv", node->nd_recv);
@@ -2983,11 +3495,13 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
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);
+ const rb_iseq_t *rescue = NEW_CHILD_ISEQ(NEW_NIL(),
+ rb_str_concat(rb_str_new2
+ ("defined guard in "),
+ iseq->body->location.label),
+ ISEQ_TYPE_DEFINED_GUARD, 0);
+ lstart->rescued = LABEL_RESCUE_BEG;
+ lend->rescued = LABEL_RESCUE_END;
APPEND_LABEL(ret, lcur, lstart);
ADD_LABEL(ret, lend);
ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
@@ -2995,28 +3509,26 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
return done;
}
-#define BUFSIZE 0x100
-
static VALUE
-make_name_for_block(rb_iseq_t *iseq)
+make_name_for_block(const rb_iseq_t *orig_iseq)
{
int level = 1;
- rb_iseq_t *ip = iseq;
+ const rb_iseq_t *iseq = orig_iseq;
- if (iseq->parent_iseq != 0) {
- while (ip->local_iseq != ip) {
- if (ip->type == ISEQ_TYPE_BLOCK) {
+ if (orig_iseq->body->parent_iseq != 0) {
+ while (orig_iseq->body->local_iseq != iseq) {
+ if (iseq->body->type == ISEQ_TYPE_BLOCK) {
level++;
}
- ip = ip->parent_iseq;
+ iseq = iseq->body->parent_iseq;
}
}
if (level == 1) {
- return rb_sprintf("block in %"PRIsVALUE, ip->location.label);
+ return rb_sprintf("block in %"PRIsVALUE, iseq->body->location.label);
}
else {
- return rb_sprintf("block (%d levels) in %"PRIsVALUE, level, ip->location.label);
+ return rb_sprintf("block (%d levels) in %"PRIsVALUE, level, iseq->body->location.label);
}
}
@@ -3026,9 +3538,9 @@ push_ensure_entry(rb_iseq_t *iseq,
struct ensure_range *er, NODE *node)
{
enl->ensure_node = node;
- enl->prev = iseq->compile_data->ensure_node_stack; /* prev */
+ enl->prev = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack; /* prev */
enl->erange = er;
- iseq->compile_data->ensure_node_stack = enl;
+ ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enl;
}
static void
@@ -3053,7 +3565,7 @@ static void
add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
{
struct iseq_compile_data_ensure_node_stack *enlp =
- iseq->compile_data->ensure_node_stack;
+ ISEQ_COMPILE_DATA(iseq)->ensure_node_stack;
struct iseq_compile_data_ensure_node_stack *prev_enlp = enlp;
DECL_ANCHOR(ensure);
@@ -3067,7 +3579,7 @@ add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
add_ensure_range(iseq, enlp->erange, lstart, lend);
- iseq->compile_data->ensure_node_stack = enlp->prev;
+ ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enlp->prev;
ADD_LABEL(ensure_part, lstart);
COMPILE_POPED(ensure_part, "ensure part", enlp->ensure_node);
ADD_LABEL(ensure_part, lend);
@@ -3080,12 +3592,12 @@ add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
}
enlp = enlp->prev;
}
- iseq->compile_data->ensure_node_stack = prev_enlp;
+ ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = prev_enlp;
ADD_SEQ(ret, ensure);
}
static VALUE
-setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
+setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, struct rb_call_info_kw_arg **keywords)
{
VALUE argc = INT2FIX(0);
int nsplat = 0;
@@ -3105,6 +3617,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
switch (nd_type(argn)) {
case NODE_SPLAT: {
COMPILE(args, "args (splat)", argn->nd_head);
+ ADD_INSN1(args, nd_line(argn), splatarray, nsplat ? Qtrue : Qfalse);
argc = INT2FIX(1);
nsplat++;
*flag |= VM_CALL_ARGS_SPLAT;
@@ -3117,16 +3630,11 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
INIT_ANCHOR(tmp);
COMPILE(tmp, "args (cat: splat)", argn->nd_body);
- if (next_is_array && nsplat == 0) {
- /* none */
+ if (nd_type(argn) == NODE_ARGSCAT) {
+ ADD_INSN1(tmp, nd_line(argn), splatarray, nsplat ? Qtrue : Qfalse);
}
else {
- if (nd_type(argn) == NODE_ARGSCAT) {
- ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
- }
- else {
- ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
- }
+ ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
}
INSERT_LIST(args_splat, tmp);
nsplat++;
@@ -3141,12 +3649,13 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
}
break;
}
- case NODE_ARRAY: {
- argc = INT2FIX(compile_array(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS));
- break;
- }
+ case NODE_ARRAY:
+ {
+ argc = INT2FIX(compile_array_(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS, keywords, FALSE));
+ break;
+ }
default: {
- rb_bug("setup_arg: unknown node: %s\n", ruby_node_name(nd_type(argn)));
+ UNKNOWN_NODE("setup_arg", argn);
}
}
}
@@ -3173,9 +3682,10 @@ build_postexe_iseq(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *body)
{
int line = nd_line(body);
VALUE argc = INT2FIX(0);
- VALUE block = NEW_CHILD_ISEQVAL(body, make_name_for_block(iseq->parent_iseq), ISEQ_TYPE_BLOCK, line);
+ const rb_iseq_t *block = NEW_CHILD_ISEQ(body, make_name_for_block(iseq->body->parent_iseq), ISEQ_TYPE_BLOCK, line);
+
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_CALL_WITH_BLOCK(ret, line, ID2SYM(id_core_set_postexe), argc, block);
+ ADD_CALL_WITH_BLOCK(ret, line, id_core_set_postexe, argc, block);
iseq_set_local_table(iseq, 0);
return Qnil;
}
@@ -3197,21 +3707,28 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (node == 0) {
if (!poped) {
debugs("node: NODE_NIL(implicit)\n");
- ADD_INSN(ret, iseq->compile_data->last_line, putnil);
+ ADD_INSN(ret, ISEQ_COMPILE_DATA(iseq)->last_line, putnil);
}
return COMPILE_OK;
}
- iseq->compile_data->last_line = line = (int)nd_line(node);
+ line = (int)nd_line(node);
+
+ if (ISEQ_COMPILE_DATA(iseq)->last_line == line) {
+ /* ignore */
+ }
+ else {
+ if (node->flags & NODE_FL_NEWLINE) {
+ ISEQ_COMPILE_DATA(iseq)->last_line = line;
+ ADD_TRACE(ret, line, RUBY_EVENT_LINE);
+ saved_last_element = ret->last;
+ }
+ }
+
debug_node_start(node);
type = nd_type(node);
- if (node->flags & NODE_FL_NEWLINE) {
- ADD_TRACE(ret, line, RUBY_EVENT_LINE);
- saved_last_element = ret->last;
- }
-
switch (type) {
case NODE_BLOCK:{
while (node && nd_type(node) == NODE_BLOCK) {
@@ -3282,7 +3799,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
line = nd_line(node);
if (type != NODE_WHEN) {
- COMPILE_ERROR((ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type)));
+ COMPILE_ERROR(ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type));
+ debug_node_end();
+ return COMPILE_NG;
}
endlabel = NEW_LABEL(line);
@@ -3315,12 +3834,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
break;
default:
- rb_bug("NODE_CASE: unknown node (%s)",
- ruby_node_name(nd_type(vals)));
+ UNKNOWN_NODE("NODE_CASE", vals);
}
}
else {
- rb_bug("NODE_CASE: must be NODE_ARRAY, but 0");
+ EXPECT_NODE_NONULL("NODE_CASE", node, NODE_ARRAY);
}
node = node->nd_next;
@@ -3352,6 +3870,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, nd_line(tempnode), dup);
ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch, literals, elselabel);
+ LABEL_REF(elselabel);
}
ADD_SEQ(ret, cond_seq);
@@ -3377,7 +3896,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
vals = node->nd_head;
if (!vals) {
- rb_bug("NODE_WHEN: must be NODE_ARRAY, but 0");
+ rb_compile_bug_str(ERROR_ARGS "NODE_WHEN: must be NODE_ARRAY, but 0");
}
switch (nd_type(vals)) {
case NODE_ARRAY:
@@ -3397,8 +3916,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSNL(ret, nd_line(vals), branchif, l1);
break;
default:
- rb_bug("NODE_WHEN: unknown node (%s)",
- ruby_node_name(nd_type(vals)));
+ UNKNOWN_NODE("NODE_WHEN", vals);
}
node = node->nd_next;
}
@@ -3414,22 +3932,23 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_OPT_N:
case NODE_WHILE:
case NODE_UNTIL:{
- LABEL *prev_start_label = iseq->compile_data->start_label;
- LABEL *prev_end_label = iseq->compile_data->end_label;
- LABEL *prev_redo_label = iseq->compile_data->redo_label;
- int prev_loopval_popped = iseq->compile_data->loopval_popped;
+ LABEL *prev_start_label = ISEQ_COMPILE_DATA(iseq)->start_label;
+ LABEL *prev_end_label = ISEQ_COMPILE_DATA(iseq)->end_label;
+ LABEL *prev_redo_label = ISEQ_COMPILE_DATA(iseq)->redo_label;
+ int prev_loopval_popped = ISEQ_COMPILE_DATA(iseq)->loopval_popped;
struct iseq_compile_data_ensure_node_stack enl;
- LABEL *next_label = iseq->compile_data->start_label = NEW_LABEL(line); /* next */
- LABEL *redo_label = iseq->compile_data->redo_label = NEW_LABEL(line); /* redo */
- LABEL *break_label = iseq->compile_data->end_label = NEW_LABEL(line); /* break */
+ LABEL *next_label = ISEQ_COMPILE_DATA(iseq)->start_label = NEW_LABEL(line); /* next */
+ LABEL *redo_label = ISEQ_COMPILE_DATA(iseq)->redo_label = NEW_LABEL(line); /* redo */
+ LABEL *break_label = ISEQ_COMPILE_DATA(iseq)->end_label = NEW_LABEL(line); /* break */
LABEL *end_label = NEW_LABEL(line);
+ LABEL *adjust_label = NEW_LABEL(line);
LABEL *next_catch_label = NEW_LABEL(line);
LABEL *tmp_label = NULL;
- iseq->compile_data->loopval_popped = 0;
+ ISEQ_COMPILE_DATA(iseq)->loopval_popped = 0;
push_ensure_entry(iseq, &enl, 0, 0);
if (type == NODE_OPT_N || node->nd_state == 1) {
@@ -3439,6 +3958,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
tmp_label = NEW_LABEL(line);
ADD_INSNL(ret, line, jump, tmp_label);
}
+ ADD_LABEL(ret, adjust_label);
ADD_INSN(ret, line, putnil);
ADD_LABEL(ret, next_catch_label);
ADD_INSN(ret, line, pop);
@@ -3460,16 +3980,17 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
else {
ADD_CALL_RECEIVER(ret, line);
- ADD_CALL(ret, line, ID2SYM(idGets), INT2FIX(0));
+ ADD_CALL(ret, line, idGets, INT2FIX(0));
ADD_INSNL(ret, line, branchif, redo_label);
/* opt_n */
}
ADD_LABEL(ret, end_label);
+ ADD_ADJUST_RESTORE(ret, adjust_label);
if (node->nd_state == Qundef) {
/* ADD_INSN(ret, line, putundef); */
- rb_bug("unsupported: putundef");
+ rb_compile_bug_str(ERROR_ARGS "unsupported: putundef");
}
else {
ADD_INSN(ret, line, putnil);
@@ -3486,18 +4007,44 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, redo_label, break_label, 0,
next_catch_label);
ADD_CATCH_ENTRY(CATCH_TYPE_REDO, redo_label, break_label, 0,
- iseq->compile_data->redo_label);
+ ISEQ_COMPILE_DATA(iseq)->redo_label);
- iseq->compile_data->start_label = prev_start_label;
- iseq->compile_data->end_label = prev_end_label;
- iseq->compile_data->redo_label = prev_redo_label;
- iseq->compile_data->loopval_popped = prev_loopval_popped;
- iseq->compile_data->ensure_node_stack = iseq->compile_data->ensure_node_stack->prev;
+ ISEQ_COMPILE_DATA(iseq)->start_label = prev_start_label;
+ ISEQ_COMPILE_DATA(iseq)->end_label = prev_end_label;
+ ISEQ_COMPILE_DATA(iseq)->redo_label = prev_redo_label;
+ ISEQ_COMPILE_DATA(iseq)->loopval_popped = prev_loopval_popped;
+ ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack->prev;
break;
}
- case NODE_ITER:
- case NODE_FOR:{
- VALUE prevblock = iseq->compile_data->current_block;
+ case NODE_FOR:
+ if (node->nd_var) {
+ /* massign to var in "for"
+ * args.length == 1 && Array === (tmp = args[0]) ? tmp : args
+ */
+ NODE *var = node->nd_var;
+ LABEL *not_single = NEW_LABEL(nd_line(var));
+ LABEL *not_ary = NEW_LABEL(nd_line(var));
+ COMPILE(ret, "for var", var);
+ ADD_INSN(ret, line, dup);
+ ADD_CALL(ret, line, idLength, INT2FIX(0));
+ ADD_INSN1(ret, line, putobject, INT2FIX(1));
+ ADD_CALL(ret, line, idEq, INT2FIX(1));
+ ADD_INSNL(ret, line, branchunless, not_single);
+ ADD_INSN(ret, line, dup);
+ ADD_INSN1(ret, line, putobject, INT2FIX(0));
+ ADD_CALL(ret, line, idAREF, INT2FIX(1));
+ ADD_INSN1(ret, line, putobject, rb_cArray);
+ ADD_INSN1(ret, line, topn, INT2FIX(1));
+ ADD_CALL(ret, line, idEqq, INT2FIX(1));
+ ADD_INSNL(ret, line, branchunless, not_ary);
+ ADD_INSN(ret, line, swap);
+ ADD_LABEL(ret, not_ary);
+ ADD_INSN(ret, line, pop);
+ ADD_LABEL(ret, not_single);
+ break;
+ }
+ case NODE_ITER:{
+ const rb_iseq_t *prevblock = ISEQ_COMPILE_DATA(iseq)->current_block;
LABEL *retry_label = NEW_LABEL(line);
LABEL *retry_end_l = NEW_LABEL(line);
@@ -3505,17 +4052,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (nd_type(node) == NODE_FOR) {
COMPILE(ret, "iter caller (for)", node->nd_iter);
- iseq->compile_data->current_block =
- NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK, line);
-
- ADD_SEND_R(ret, line, ID2SYM(idEach), INT2FIX(0),
- iseq->compile_data->current_block, INT2FIX(0));
+ ISEQ_COMPILE_DATA(iseq)->current_block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, line);
+ ADD_SEND_WITH_BLOCK(ret, line, idEach, INT2FIX(0), ISEQ_COMPILE_DATA(iseq)->current_block);
}
else {
- iseq->compile_data->current_block =
- NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK, line);
+ ISEQ_COMPILE_DATA(iseq)->current_block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, line);
COMPILE(ret, "iter caller", node->nd_iter);
}
ADD_LABEL(ret, retry_end_l);
@@ -3524,7 +4067,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, line, pop);
}
- iseq->compile_data->current_block = prevblock;
+ ISEQ_COMPILE_DATA(iseq)->current_block = prevblock;
ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, 0, retry_end_l);
@@ -3533,160 +4076,161 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_BREAK:{
unsigned long level = 0;
- if (iseq->compile_data->redo_label != 0) {
+ if (ISEQ_COMPILE_DATA(iseq)->redo_label != 0) {
/* while/until */
LABEL *splabel = NEW_LABEL(0);
ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, iseq->compile_data->redo_label);
- COMPILE_(ret, "break val (while/until)", node->nd_stts, iseq->compile_data->loopval_popped);
+ ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->redo_label);
+ COMPILE_(ret, "break val (while/until)", node->nd_stts, ISEQ_COMPILE_DATA(iseq)->loopval_popped);
add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, iseq->compile_data->end_label);
+ ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->end_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
ADD_INSN(ret, line, putnil);
}
}
- else if (iseq->type == ISEQ_TYPE_BLOCK) {
+ else if (iseq->body->type == ISEQ_TYPE_BLOCK) {
break_by_insn:
/* escape from block */
COMPILE(ret, "break val (block)", node->nd_stts);
- ADD_INSN1(ret, line, throw, INT2FIX(level | 0x02) /* TAG_BREAK */ );
+ ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_BREAK));
if (poped) {
ADD_INSN(ret, line, pop);
}
}
- else if (iseq->type == ISEQ_TYPE_EVAL) {
+ else if (iseq->body->type == ISEQ_TYPE_EVAL) {
break_in_eval:
- COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with break"));
+ COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with break");
+ debug_node_end();
+ return COMPILE_NG;
}
else {
- rb_iseq_t *ip = iseq->parent_iseq;
+ const rb_iseq_t *ip = iseq->body->parent_iseq;
+
while (ip) {
- if (!ip->compile_data) {
+ if (!ISEQ_COMPILE_DATA(ip)) {
ip = 0;
break;
}
level++;
- if (ip->compile_data->redo_label != 0) {
- level = 0x8000;
- if (ip->compile_data->loopval_popped == 0) {
- /* need value */
- level |= 0x4000;
- }
+ if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
+ level = VM_THROW_NO_ESCAPE_FLAG;
goto break_by_insn;
}
- else if (ip->type == ISEQ_TYPE_BLOCK) {
- level <<= 16;
+ else if (ip->body->type == ISEQ_TYPE_BLOCK) {
+ level <<= VM_THROW_LEVEL_SHIFT;
goto break_by_insn;
}
- else if (ip->type == ISEQ_TYPE_EVAL) {
+ else if (ip->body->type == ISEQ_TYPE_EVAL) {
goto break_in_eval;
}
- ip = ip->parent_iseq;
+ ip = ip->body->parent_iseq;
}
- COMPILE_ERROR((ERROR_ARGS "Invalid break"));
+ COMPILE_ERROR(ERROR_ARGS "Invalid break");
+ debug_node_end();
+ return COMPILE_NG;
}
break;
}
case NODE_NEXT:{
unsigned long level = 0;
- if (iseq->compile_data->redo_label != 0) {
+ if (ISEQ_COMPILE_DATA(iseq)->redo_label != 0) {
LABEL *splabel = NEW_LABEL(0);
debugs("next in while loop\n");
ADD_LABEL(ret, splabel);
COMPILE(ret, "next val/valid syntax?", node->nd_stts);
add_ensure_iseq(ret, iseq, 0);
- ADD_ADJUST(ret, line, iseq->compile_data->redo_label);
- ADD_INSNL(ret, line, jump, iseq->compile_data->start_label);
+ ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->redo_label);
+ ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->start_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
ADD_INSN(ret, line, putnil);
}
}
- else if (iseq->compile_data->end_label) {
+ else if (ISEQ_COMPILE_DATA(iseq)->end_label) {
LABEL *splabel = NEW_LABEL(0);
debugs("next in block\n");
ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, iseq->compile_data->start_label);
+ ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->start_label);
COMPILE(ret, "next val", node->nd_stts);
add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, iseq->compile_data->end_label);
+ ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->end_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
ADD_INSN(ret, line, putnil);
}
}
- else if (iseq->type == ISEQ_TYPE_EVAL) {
+ else if (iseq->body->type == ISEQ_TYPE_EVAL) {
next_in_eval:
- COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with next"));
+ COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with next");
}
else {
- rb_iseq_t *ip;
- ip = iseq;
+ const rb_iseq_t *ip = iseq;
+
while (ip) {
- if (!ip->compile_data) {
+ if (!ISEQ_COMPILE_DATA(ip)) {
ip = 0;
break;
}
- level = 0x8000 | 0x4000;
- if (ip->compile_data->redo_label != 0) {
+ level = VM_THROW_NO_ESCAPE_FLAG;
+ if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
/* while loop */
break;
}
- else if (ip->type == ISEQ_TYPE_BLOCK) {
+ else if (ip->body->type == ISEQ_TYPE_BLOCK) {
break;
}
- else if (ip->type == ISEQ_TYPE_EVAL) {
+ else if (ip->body->type == ISEQ_TYPE_EVAL) {
goto next_in_eval;
}
- ip = ip->parent_iseq;
+ ip = ip->body->parent_iseq;
}
if (ip != 0) {
COMPILE(ret, "next val", node->nd_stts);
- ADD_INSN1(ret, line, throw, INT2FIX(level | 0x03) /* TAG_NEXT */ );
+ ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_NEXT));
if (poped) {
ADD_INSN(ret, line, pop);
}
}
else {
- COMPILE_ERROR((ERROR_ARGS "Invalid next"));
+ COMPILE_ERROR(ERROR_ARGS "Invalid next");
}
}
break;
}
case NODE_REDO:{
- if (iseq->compile_data->redo_label) {
+ if (ISEQ_COMPILE_DATA(iseq)->redo_label) {
LABEL *splabel = NEW_LABEL(0);
debugs("redo in while");
ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, iseq->compile_data->redo_label);
+ ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->redo_label);
add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, iseq->compile_data->redo_label);
+ ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->redo_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
ADD_INSN(ret, line, putnil);
}
}
- else if (iseq->type == ISEQ_TYPE_EVAL) {
+ else if (iseq->body->type == ISEQ_TYPE_EVAL) {
redo_in_eval:
- COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
+ COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with redo");
}
- else if (iseq->compile_data->start_label) {
+ else if (ISEQ_COMPILE_DATA(iseq)->start_label) {
LABEL *splabel = NEW_LABEL(0);
debugs("redo in block");
ADD_LABEL(ret, splabel);
add_ensure_iseq(ret, iseq, 0);
- ADD_ADJUST(ret, line, iseq->compile_data->start_label);
- ADD_INSNL(ret, line, jump, iseq->compile_data->start_label);
+ ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->start_label);
+ ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->start_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
@@ -3694,53 +4238,52 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
}
else {
- rb_iseq_t *ip;
- unsigned long level;
- level = 0x8000 | 0x4000;
- ip = iseq;
+ const rb_iseq_t *ip = iseq;
+ const unsigned long level = VM_THROW_NO_ESCAPE_FLAG;
+
while (ip) {
- if (!ip->compile_data) {
+ if (!ISEQ_COMPILE_DATA(ip)) {
ip = 0;
break;
}
- if (ip->compile_data->redo_label != 0) {
+ if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
break;
}
- else if (ip->type == ISEQ_TYPE_BLOCK) {
+ else if (ip->body->type == ISEQ_TYPE_BLOCK) {
break;
}
- else if (ip->type == ISEQ_TYPE_EVAL) {
+ else if (ip->body->type == ISEQ_TYPE_EVAL) {
goto redo_in_eval;
}
- ip = ip->parent_iseq;
+ ip = ip->body->parent_iseq;
}
if (ip != 0) {
ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, throw, INT2FIX(level | 0x05) /* TAG_REDO */ );
+ ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_REDO));
if (poped) {
ADD_INSN(ret, line, pop);
}
}
else {
- COMPILE_ERROR((ERROR_ARGS "Invalid redo"));
+ COMPILE_ERROR(ERROR_ARGS "Invalid redo");
}
}
break;
}
case NODE_RETRY:{
- if (iseq->type == ISEQ_TYPE_RESCUE) {
+ if (iseq->body->type == ISEQ_TYPE_RESCUE) {
ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, throw, INT2FIX(0x04) /* TAG_RETRY */ );
+ ADD_INSN1(ret, line, throw, INT2FIX(TAG_RETRY));
if (poped) {
ADD_INSN(ret, line, pop);
}
}
else {
- COMPILE_ERROR((ERROR_ARGS "Invalid retry"));
+ COMPILE_ERROR(ERROR_ARGS "Invalid retry");
}
break;
}
@@ -3752,11 +4295,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
LABEL *lstart = NEW_LABEL(line);
LABEL *lend = NEW_LABEL(line);
LABEL *lcont = NEW_LABEL(line);
- VALUE rescue = NEW_CHILD_ISEQVAL(
- node->nd_resq,
- rb_str_concat(rb_str_new2("rescue in "), iseq->location.label),
- ISEQ_TYPE_RESCUE, line);
+ const rb_iseq_t *rescue = NEW_CHILD_ISEQ(node->nd_resq,
+ rb_str_concat(rb_str_new2("rescue in "), iseq->body->location.label),
+ ISEQ_TYPE_RESCUE, line);
+ lstart->rescued = LABEL_RESCUE_BEG;
+ lend->rescued = LABEL_RESCUE_END;
ADD_LABEL(ret, lstart);
COMPILE(ret, "rescue head", node->nd_head);
ADD_LABEL(ret, lend);
@@ -3806,8 +4350,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSNL(ret, line, branchif, label_hit);
break;
default:
- rb_bug("NODE_RESBODY: unknown node (%s)",
- ruby_node_name(nd_type(narg)));
+ UNKNOWN_NODE("NODE_RESBODY", narg);
}
}
else {
@@ -3819,7 +4362,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSNL(ret, line, jump, label_miss);
ADD_LABEL(ret, label_hit);
COMPILE(ret, "resbody body", resq->nd_body);
- if (iseq->compile_data->option->tailcall_optimization) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->tailcall_optimization) {
ADD_INSN(ret, line, nop);
}
ADD_INSN(ret, line, leave);
@@ -3830,11 +4373,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_ENSURE:{
DECL_ANCHOR(ensr);
- VALUE ensure = NEW_CHILD_ISEQVAL(node->nd_ensr,
- rb_str_concat(rb_str_new2
- ("ensure in "),
- iseq->location.label),
- ISEQ_TYPE_ENSURE, line);
+ const rb_iseq_t *ensure = NEW_CHILD_ISEQ(node->nd_ensr,
+ rb_str_concat(rb_str_new2 ("ensure in "), iseq->body->location.label),
+ ISEQ_TYPE_ENSURE, line);
LABEL *lstart = NEW_LABEL(line);
LABEL *lend = NEW_LABEL(line);
LABEL *lcont = NEW_LABEL(line);
@@ -3861,14 +4402,14 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
ADD_LABEL(ret, lcont);
- erange = iseq->compile_data->ensure_node_stack->erange;
+ erange = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack->erange;
while (erange) {
ADD_CATCH_ENTRY(CATCH_TYPE_ENSURE, erange->begin, erange->end,
ensure, lcont);
erange = erange->next;
}
- iseq->compile_data->ensure_node_stack = enl.prev;
+ ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enl.prev;
break;
}
@@ -3900,9 +4441,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_LASGN:{
ID id = node->nd_vid;
- int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+ int idx = iseq->body->local_iseq->body->local_size - get_local_var_idx(iseq, id);
- debugs("lvar: %s idx: %d\n", rb_id2name(id), idx);
+ debugs("lvar: %"PRIsVALUE" idx: %d\n", rb_id2str(id), idx);
COMPILE(ret, "rvalue", node->nd_value);
if (!poped) {
@@ -3916,7 +4457,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_DASGN_CURR:{
int idx, lv, ls;
COMPILE(ret, "dvalue", node->nd_value);
- debugp_param("dassn id", rb_str_new2(rb_id2name(node->nd_vid) ? rb_id2name(node->nd_vid) : "*"));
+ debugi("dassn id", rb_id2str(node->nd_vid) ? node->nd_vid : '*');
if (!poped) {
ADD_INSN(ret, line, dup);
@@ -3925,7 +4466,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
if (idx < 0) {
- rb_bug("NODE_DASGN(_CURR): unknown id (%s)", rb_id2name(node->nd_vid));
+ rb_compile_bug_str(ERROR_ARGS "NODE_DASGN(_CURR): unknown id (%"PRIsVALUE")", rb_id2str(node->nd_vid));
}
ADD_INSN2(ret, line, setlocal, INT2FIX(ls - idx), INT2FIX(lv));
@@ -3948,7 +4489,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, line, dup);
}
ADD_INSN2(ret, line, setinstancevariable,
- ID2SYM(node->nd_vid), INT2FIX(iseq->is_size++));
+ ID2SYM(node->nd_vid), INT2FIX(iseq->body->is_size++));
break;
}
case NODE_CDECL:{
@@ -3981,7 +4522,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_OP_ASGN1: {
DECL_ANCHOR(args);
VALUE argc;
- VALUE flag = 0;
+ unsigned int flag = 0;
+ unsigned int asgnflag = 0;
ID id = node->nd_mid;
int boff = 0;
@@ -4011,7 +4553,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (!poped) {
ADD_INSN(ret, line, putnil);
}
- COMPILE(ret, "NODE_OP_ASGN1 recv", node->nd_recv);
+ asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN1 recv", node);
switch (nd_type(node->nd_args->nd_head)) {
case NODE_ZARRAY:
argc = INT2FIX(0);
@@ -4020,11 +4562,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
boff = 1;
default:
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args->nd_head, &flag);
+ argc = setup_args(iseq, args, node->nd_args->nd_head, &flag, NULL);
ADD_SEQ(ret, args);
}
ADD_INSN1(ret, line, dupn, FIXNUM_INC(argc, 1 + boff));
- ADD_SEND_R(ret, line, ID2SYM(idAREF), argc, Qfalse, LONG2FIX(flag));
+ ADD_SEND_WITH_FLAG(ret, line, idAREF, argc, INT2FIX(flag));
+ flag |= asgnflag;
if (id == 0 || id == 1) {
/* 0: or, 1: and
@@ -4067,14 +4610,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, line, pop);
ADD_INSN(ret, line, pop);
}
- ADD_SEND_R(ret, line, ID2SYM(idASET),
- argc, Qfalse, LONG2FIX(flag));
+ ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(flag));
}
else {
if (boff > 0)
ADD_INSN(ret, line, swap);
- ADD_SEND_R(ret, line, ID2SYM(idASET),
- FIXNUM_INC(argc, 1), Qfalse, LONG2FIX(flag));
+ ADD_SEND_WITH_FLAG(ret, line, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
}
ADD_INSN(ret, line, pop);
ADD_INSNL(ret, line, jump, lfin);
@@ -4087,7 +4628,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
else {
COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body);
- ADD_SEND(ret, line, ID2SYM(id), INT2FIX(1));
+ ADD_SEND(ret, line, id, INT2FIX(1));
if (!poped) {
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
}
@@ -4104,14 +4645,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, line, pop);
ADD_INSN(ret, line, pop);
}
- ADD_SEND_R(ret, line, ID2SYM(idASET),
- argc, Qfalse, LONG2FIX(flag));
+ ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(flag));
}
else {
if (boff > 0)
ADD_INSN(ret, line, swap);
- ADD_SEND_R(ret, line, ID2SYM(idASET),
- FIXNUM_INC(argc, 1), Qfalse, LONG2FIX(flag));
+ ADD_SEND_WITH_FLAG(ret, line, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
}
ADD_INSN(ret, line, pop);
}
@@ -4120,8 +4659,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_OP_ASGN2:{
ID atype = node->nd_next->nd_mid;
+ ID vid = node->nd_next->nd_vid, aid = rb_id_attrset(vid);
+ VALUE asgnflag;
LABEL *lfin = NEW_LABEL(line);
LABEL *lcfin = NEW_LABEL(line);
+ LABEL *lskip = 0;
/*
class C; attr_accessor :c; end
r = C.new
@@ -4164,10 +4706,14 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
*/
- COMPILE(ret, "NODE_OP_ASGN2#recv", node->nd_recv);
+ asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN2#recv", node);
+ if (node->nd_next->nd_aid) {
+ lskip = NEW_LABEL(line);
+ ADD_INSN(ret, line, dup);
+ ADD_INSNL(ret, line, branchnil, lskip);
+ }
ADD_INSN(ret, line, dup);
- ADD_SEND(ret, line, ID2SYM(node->nd_next->nd_vid),
- INT2FIX(0));
+ ADD_SEND(ret, line, vid, INT2FIX(0));
if (atype == 0 || atype == 1) { /* 0: OR or 1: AND */
ADD_INSN(ret, line, dup);
@@ -4181,8 +4727,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
ADD_INSN(ret, line, swap);
ADD_INSN1(ret, line, topn, INT2FIX(1));
- ADD_SEND(ret, line, ID2SYM(node->nd_next->nd_aid),
- INT2FIX(1));
+ ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
ADD_INSNL(ret, line, jump, lfin);
ADD_LABEL(ret, lcfin);
@@ -4190,6 +4735,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_LABEL(ret, lfin);
ADD_INSN(ret, line, pop);
+ if (lskip) {
+ ADD_LABEL(ret, lskip);
+ }
if (poped) {
/* we can apply more optimize */
ADD_INSN(ret, line, pop);
@@ -4197,15 +4745,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
else {
COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
- ADD_SEND(ret, line, ID2SYM(node->nd_next->nd_mid),
- INT2FIX(1));
+ ADD_SEND(ret, line, atype, INT2FIX(1));
if (!poped) {
ADD_INSN(ret, line, swap);
ADD_INSN1(ret, line, topn, INT2FIX(1));
}
- ADD_SEND(ret, line, ID2SYM(node->nd_next->nd_aid),
- INT2FIX(1));
+ ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
ADD_INSN(ret, line, pop);
+ if (lskip) {
+ ADD_LABEL(ret, lskip);
+ }
}
break;
}
@@ -4222,10 +4771,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head);
break;
default:
- do {
- COMPILE_ERROR((ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
- ruby_node_name(nd_type(node->nd_head))));
- } while (0);
+ COMPILE_ERROR(ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
+ ruby_node_name(nd_type(node->nd_head)));
+ debug_node_end();
return COMPILE_NG;
}
mid = node->nd_head->nd_mid;
@@ -4266,7 +4814,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
else {
COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
/* cref obj value */
- ADD_CALL(ret, line, ID2SYM(node->nd_aid), INT2FIX(1));
+ ADD_CALL(ret, line, node->nd_aid, INT2FIX(1));
/* cref value */
ADD_INSN(ret, line, swap); /* value cref */
if (!poped) {
@@ -4319,9 +4867,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_CALL:
+ /* optimization shortcut
+ * "literal".freeze -> opt_str_freeze("literal")
+ */
if (node->nd_recv && nd_type(node->nd_recv) == NODE_STR &&
- node->nd_mid == idFreeze && node->nd_args == NULL)
- {
+ node->nd_mid == idFreeze && node->nd_args == NULL &&
+ ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
+ ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
VALUE str = rb_fstring(node->nd_recv->nd_lit);
iseq_add_mark_object(iseq, str);
ADD_INSN1(ret, line, opt_str_freeze, str);
@@ -4330,6 +4882,26 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
break;
}
+ /* optimization shortcut
+ * obj["literal"] -> opt_aref_with(obj, "literal")
+ */
+ if (node->nd_mid == idAREF && !private_recv_p(node) && node->nd_args &&
+ nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 1 &&
+ nd_type(node->nd_args->nd_head) == NODE_STR &&
+ ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
+ ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
+ VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
+ node->nd_args->nd_head->nd_lit = str;
+ COMPILE(ret, "recv", node->nd_recv);
+ ADD_INSN3(ret, line, opt_aref_with,
+ new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE),
+ NULL/* CALL_CACHE */, str);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_QCALL:
case NODE_FCALL:
case NODE_VCALL:{ /* VCALL: variable or call */
/*
@@ -4339,11 +4911,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
*/
DECL_ANCHOR(recv);
DECL_ANCHOR(args);
+ LABEL *lskip = 0;
ID mid = node->nd_mid;
VALUE argc;
- VALUE flag = 0;
- VALUE parent_block = iseq->compile_data->current_block;
- iseq->compile_data->current_block = Qfalse;
+ unsigned int flag = 0;
+ struct rb_call_info_kw_arg *keywords = NULL;
+ const rb_iseq_t *parent_block = ISEQ_COMPILE_DATA(iseq)->current_block;
+ ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
@@ -4376,12 +4950,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
(mid == goto_id || mid == label_id)) {
LABEL *label;
st_data_t data;
- st_table *labels_table = iseq->compile_data->labels_table;
+ st_table *labels_table = ISEQ_COMPILE_DATA(iseq)->labels_table;
ID label_name;
if (!labels_table) {
labels_table = st_init_numtable();
- iseq->compile_data->labels_table = labels_table;
+ ISEQ_COMPILE_DATA(iseq)->labels_table = labels_table;
}
if (nd_type(node->nd_args->nd_head) == NODE_LIT &&
SYMBOL_P(node->nd_args->nd_head->nd_lit)) {
@@ -4397,7 +4971,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
}
else {
- COMPILE_ERROR((ERROR_ARGS "invalid goto/label format"));
+ COMPILE_ERROR(ERROR_ARGS "invalid goto/label format");
}
@@ -4412,8 +4986,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
#endif
/* receiver */
- if (type == NODE_CALL) {
+ if (type == NODE_CALL || type == NODE_QCALL) {
COMPILE(recv, "recv", node->nd_recv);
+ if (type == NODE_QCALL) {
+ lskip = NEW_LABEL(line);
+ ADD_INSN(recv, line, dup);
+ ADD_INSNL(recv, line, branchnil, lskip);
+ }
}
else if (type == NODE_FCALL || type == NODE_VCALL) {
ADD_CALL_RECEIVER(recv, line);
@@ -4421,7 +5000,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
/* args */
if (nd_type(node) != NODE_VCALL) {
- argc = setup_args(iseq, args, node->nd_args, &flag);
+ argc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
}
else {
argc = INT2FIX(0);
@@ -4441,9 +5020,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
flag |= VM_CALL_FCALL;
}
- ADD_SEND_R(ret, line, ID2SYM(mid),
- argc, parent_block, LONG2FIX(flag));
+ ADD_SEND_R(ret, line, mid, argc, parent_block, INT2FIX(flag), keywords);
+ if (lskip) {
+ ADD_LABEL(ret, lskip);
+ }
if (poped) {
ADD_INSN(ret, line, pop);
}
@@ -4453,93 +5034,107 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_ZSUPER:{
DECL_ANCHOR(args);
int argc;
- VALUE flag = 0;
- VALUE parent_block = iseq->compile_data->current_block;
+ unsigned int flag = 0;
+ struct rb_call_info_kw_arg *keywords = NULL;
+ const rb_iseq_t *parent_block = ISEQ_COMPILE_DATA(iseq)->current_block;
INIT_ANCHOR(args);
- iseq->compile_data->current_block = Qfalse;
+ ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
if (nd_type(node) == NODE_SUPER) {
- VALUE vargc = setup_args(iseq, args, node->nd_args, &flag);
+ VALUE vargc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
argc = FIX2INT(vargc);
}
else {
/* NODE_ZSUPER */
int i;
- rb_iseq_t *liseq = iseq->local_iseq;
+ const rb_iseq_t *liseq = iseq->body->local_iseq;
int lvar_level = get_lvar_level(iseq);
- argc = liseq->argc;
+ argc = liseq->body->param.lead_num;
/* normal arguments */
- for (i = 0; i < liseq->argc; i++) {
- int idx = liseq->local_size - i;
+ for (i = 0; i < liseq->body->param.lead_num; i++) {
+ int idx = liseq->body->local_size - i;
ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
- if (!liseq->arg_simple) {
- if (liseq->arg_opts) {
- /* optional arguments */
+ if (liseq->body->param.flags.has_opt) {
+ /* optional arguments */
+ int j;
+ for (j = 0; j < liseq->body->param.opt_num; j++) {
+ int idx = liseq->body->local_size - (i + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ i += j;
+ argc = i;
+ }
+ if (liseq->body->param.flags.has_rest) {
+ /* rest argument */
+ int idx = liseq->body->local_size - liseq->body->param.rest_start;
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ argc = liseq->body->param.rest_start + 1;
+ flag |= VM_CALL_ARGS_SPLAT;
+ }
+ if (liseq->body->param.flags.has_post) {
+ /* post arguments */
+ int post_len = liseq->body->param.post_num;
+ int post_start = liseq->body->param.post_start;
+
+ if (liseq->body->param.flags.has_rest) {
int j;
- for (j = 0; j < liseq->arg_opts - 1; j++) {
- int idx = liseq->local_size - (i + j);
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->body->local_size - (post_start + j);
ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
- i += j;
- argc = i;
+ ADD_INSN1(args, line, newarray, INT2FIX(j));
+ ADD_INSN (args, line, concatarray);
+ /* argc is settled at above */
}
-
- if (liseq->arg_rest != -1) {
- /* rest argument */
- int idx = liseq->local_size - liseq->arg_rest;
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- argc = liseq->arg_rest + 1;
- flag |= VM_CALL_ARGS_SPLAT;
+ else {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->body->local_size - (post_start + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ argc = post_len + post_start;
}
+ }
- if (liseq->arg_post_len) {
- /* post arguments */
- int post_len = liseq->arg_post_len;
- int post_start = liseq->arg_post_start;
+ if (liseq->body->param.flags.has_kw) { /* TODO: support keywords */
+ int local_size = liseq->body->local_size;
+ argc++;
- if (liseq->arg_rest != -1) {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = liseq->local_size - (post_start + j);
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- }
- ADD_INSN1(args, line, newarray, INT2FIX(j));
- ADD_INSN (args, line, concatarray);
- /* argc is settled at above */
- }
- else {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = liseq->local_size - (post_start + j);
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- }
- argc = post_len + post_start;
- }
- }
+ ADD_INSN1(args, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- if (liseq->arg_keyword >= 0) {
- int local_size = liseq->local_size;
- int idx = local_size - liseq->arg_keyword;
- argc++;
- ADD_INSN1(args, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ if (liseq->body->param.flags.has_kwrest) {
+ ADD_INSN2(args, line, getlocal, INT2FIX(liseq->body->local_size - liseq->body->param.keyword->rest_start), INT2FIX(lvar_level));
+ ADD_SEND (args, line, rb_intern("dup"), INT2FIX(0));
+ }
+ else {
+ ADD_INSN1(args, line, newhash, INT2FIX(0));
+ }
+ for (i = 0; i < liseq->body->param.keyword->num; ++i) {
+ ID id = liseq->body->param.keyword->table[i];
+ int idx = local_size - get_local_var_idx(liseq, id);
+ ADD_INSN1(args, line, putobject, ID2SYM(id));
ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- ADD_SEND (args, line, ID2SYM(rb_intern("dup")), INT2FIX(0));
- for (i = 0; i < liseq->arg_keywords; ++i) {
- ID id = liseq->arg_keyword_table[i];
- idx = local_size - get_local_var_idx(liseq, id);
- ADD_INSN1(args, line, putobject, ID2SYM(id));
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- }
- ADD_SEND(args, line, ID2SYM(id_core_hash_merge_ptr), INT2FIX(i * 2 + 1));
- if (liseq->arg_rest != -1) {
- ADD_INSN1(args, line, newarray, INT2FIX(1));
- ADD_INSN (args, line, concatarray);
- --argc;
- }
+ }
+ ADD_SEND(args, line, id_core_hash_merge_ptr, INT2FIX(i * 2 + 1));
+ if (liseq->body->param.flags.has_rest) {
+ ADD_INSN1(args, line, newarray, INT2FIX(1));
+ ADD_INSN (args, line, concatarray);
+ --argc;
+ }
+ }
+ else if (liseq->body->param.flags.has_kwrest) {
+ ADD_INSN2(args, line, getlocal, INT2FIX(liseq->body->local_size - liseq->body->param.keyword->rest_start), INT2FIX(lvar_level));
+ ADD_SEND (args, line, rb_intern("dup"), INT2FIX(0));
+ if (liseq->body->param.flags.has_rest) {
+ ADD_INSN1(args, line, newarray, INT2FIX(1));
+ ADD_INSN (args, line, concatarray);
+ }
+ else {
+ argc++;
}
}
}
@@ -4547,8 +5142,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
/* dummy receiver */
ADD_INSN1(ret, line, putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
ADD_SEQ(ret, args);
- ADD_INSN1(ret, line, invokesuper, new_callinfo(iseq, 0, argc, parent_block,
- flag | VM_CALL_SUPER | VM_CALL_FCALL));
+ ADD_INSN3(ret, line, invokesuper,
+ new_callinfo(iseq, 0, argc, flag | VM_CALL_SUPER | VM_CALL_FCALL, keywords, parent_block != NULL),
+ Qnil, /* CALL_CACHE */
+ parent_block);
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4556,7 +5153,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_ARRAY:{
- compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, poped);
+ compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, NULL, poped);
break;
}
case NODE_ZARRAY:{
@@ -4593,7 +5190,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
default:
- rb_bug("can't make hash with this node: %s", ruby_node_name(type));
+ rb_compile_bug_str(ERROR_ARGS_AT(node->nd_head) "can't make hash with this node: %s",
+ ruby_node_name(type));
}
if (poped) {
@@ -4605,13 +5203,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
rb_iseq_t *is = iseq;
if (is) {
- if (is->type == ISEQ_TYPE_TOP) {
- COMPILE_ERROR((ERROR_ARGS "Invalid return"));
+ if (is->body->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR(ERROR_ARGS "Invalid return");
}
else {
LABEL *splabel = 0;
- if (is->type == ISEQ_TYPE_METHOD) {
+ if (is->body->type == ISEQ_TYPE_METHOD) {
splabel = NEW_LABEL(0);
ADD_LABEL(ret, splabel);
ADD_ADJUST(ret, line, 0);
@@ -4619,7 +5217,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
COMPILE(ret, "return nd_stts (return val)", node->nd_stts);
- if (is->type == ISEQ_TYPE_METHOD) {
+ if (is->body->type == ISEQ_TYPE_METHOD) {
add_ensure_iseq(ret, iseq, 1);
ADD_TRACE(ret, line, RUBY_EVENT_RETURN);
ADD_INSN(ret, line, leave);
@@ -4630,7 +5228,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
}
else {
- ADD_INSN1(ret, line, throw, INT2FIX(0x01) /* TAG_RETURN */ );
+ ADD_INSN1(ret, line, throw, INT2FIX(TAG_RETURN));
if (poped) {
ADD_INSN(ret, line, pop);
}
@@ -4642,22 +5240,25 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_YIELD:{
DECL_ANCHOR(args);
VALUE argc;
- VALUE flag = 0;
+ unsigned int flag = 0;
+ struct rb_call_info_kw_arg *keywords = NULL;
INIT_ANCHOR(args);
- if (iseq->type == ISEQ_TYPE_TOP) {
- COMPILE_ERROR((ERROR_ARGS "Invalid yield"));
+ if (iseq->body->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR(ERROR_ARGS "Invalid yield");
+ debug_node_end();
+ return COMPILE_NG;
}
if (node->nd_head) {
- argc = setup_args(iseq, args, node->nd_head, &flag);
+ argc = setup_args(iseq, args, node->nd_head, &flag, &keywords);
}
else {
argc = INT2FIX(0);
}
ADD_SEQ(ret, args);
- ADD_INSN1(ret, line, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), 0, flag));
+ ADD_INSN1(ret, line, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), flag, keywords, FALSE));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4667,9 +5268,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_LVAR:{
if (!poped) {
ID id = node->nd_vid;
- int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+ int idx = iseq->body->local_iseq->body->local_size - get_local_var_idx(iseq, id);
- debugs("id: %s idx: %d\n", rb_id2name(id), idx);
+ debugs("id: %"PRIsVALUE" idx: %d\n", rb_id2str(id), idx);
ADD_INSN2(ret, line, getlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
}
break;
@@ -4680,7 +5281,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (!poped) {
idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
if (idx < 0) {
- rb_bug("unknown dvar (%s)", rb_id2name(node->nd_vid));
+ rb_compile_bug_str(ERROR_ARGS "unknown dvar (%"PRIsVALUE")", rb_id2str(node->nd_vid));
}
ADD_INSN2(ret, line, getlocal, INT2FIX(ls - idx), INT2FIX(lv));
}
@@ -4698,16 +5299,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
debugi("nd_vid", node->nd_vid);
if (!poped) {
ADD_INSN2(ret, line, getinstancevariable,
- ID2SYM(node->nd_vid), INT2FIX(iseq->is_size++));
+ ID2SYM(node->nd_vid), INT2FIX(iseq->body->is_size++));
}
break;
}
case NODE_CONST:{
debugi("nd_vid", node->nd_vid);
- if (iseq->compile_data->option->inline_const_cache) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->is_size++;
+ int ic_index = iseq->body->is_size++;
ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
@@ -4733,6 +5334,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_NTH_REF:{
if (!poped) {
+ if (!node->nd_nth) {
+ ADD_INSN(ret, line, putnil);
+ break;
+ }
ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */,
INT2FIX(node->nd_nth << 1));
}
@@ -4769,7 +5374,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
- if (iseq->compile_data->option->specialized_instruction) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
/* TODO: detect by node */
if (recv->last == recv->anchor.next &&
INSN_OF(recv->last) == BIN(putobject) &&
@@ -4781,13 +5386,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, val);
- ADD_INSN1(ret, line, opt_regexpmatch2, new_callinfo(iseq, idEqTilde, 1, 0, 0));
+ ADD_INSN2(ret, line, opt_regexpmatch2, new_callinfo(iseq, idEqTilde, 1, 0, NULL, FALSE), Qnil);
}
}
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, val);
- ADD_SEND(ret, line, ID2SYM(idEqTilde), INT2FIX(1));
+ ADD_SEND(ret, line, idEqTilde, INT2FIX(1));
}
if (poped) {
@@ -4803,10 +5408,24 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_STR:{
- node->nd_lit = rb_fstring(node->nd_lit);
debugp_param("nd_lit", node->nd_lit);
if (!poped) {
- ADD_INSN1(ret, line, putstring, node->nd_lit);
+ node->nd_lit = rb_fstring(node->nd_lit);
+ if (!ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal) {
+ ADD_INSN1(ret, line, putstring, node->nd_lit);
+ }
+ else {
+ if (ISEQ_COMPILE_DATA(iseq)->option->debug_frozen_string_literal || RTEST(ruby_debug)) {
+ VALUE debug_info = rb_ary_new_from_args(2, iseq->body->location.path, INT2FIX(line));
+ VALUE str = rb_str_dup(node->nd_lit);
+ rb_ivar_set(str, id_debug_created_info, rb_obj_freeze(debug_info));
+ ADD_INSN1(ret, line, putobject, rb_obj_freeze(str));
+ iseq_add_mark_object_compile_time(iseq, str);
+ }
+ else {
+ ADD_INSN1(ret, line, putobject, node->nd_lit);
+ }
+ }
}
break;
}
@@ -4816,13 +5435,23 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (poped) {
ADD_INSN(ret, line, pop);
}
+ else {
+ if (ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal) {
+ VALUE debug_info = Qnil;
+ if (ISEQ_COMPILE_DATA(iseq)->option->debug_frozen_string_literal || RTEST(ruby_debug)) {
+ debug_info = rb_ary_new_from_args(2, iseq->body->location.path, INT2FIX(line));
+ iseq_add_mark_object_compile_time(iseq, rb_obj_freeze(debug_info));
+ }
+ ADD_INSN1(ret, line, freezestring, debug_info);
+ }
+ }
break;
}
case NODE_XSTR:{
node->nd_lit = rb_fstring(node->nd_lit);
ADD_CALL_RECEIVER(ret, line);
ADD_INSN1(ret, line, putobject, node->nd_lit);
- ADD_CALL(ret, line, ID2SYM(idBackquote), INT2FIX(1));
+ ADD_CALL(ret, line, idBackquote, INT2FIX(1));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4832,7 +5461,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_DXSTR:{
ADD_CALL_RECEIVER(ret, line);
compile_dstr(iseq, ret, node);
- ADD_CALL(ret, line, ID2SYM(idBackquote), INT2FIX(1));
+ ADD_CALL(ret, line, idBackquote, INT2FIX(1));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4859,10 +5488,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_DREGX_ONCE:{
- int ic_index = iseq->is_size++;
+ int ic_index = iseq->body->is_size++;
NODE *dregx_node = NEW_NODE(NODE_DREGX, node->u1.value, node->u2.value, node->u3.value);
NODE *block_node = NEW_NODE(NODE_SCOPE, 0, dregx_node, 0);
- VALUE block_iseq = NEW_CHILD_ISEQVAL(block_node, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ const rb_iseq_t *block_iseq = NEW_CHILD_ISEQ(block_node, make_name_for_block(iseq),
+ ISEQ_TYPE_ONCE_GUARD, line);
ADD_INSN2(ret, line, once, block_iseq, INT2FIX(ic_index));
@@ -4912,37 +5542,35 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_DEFN:{
- VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
- rb_id2str(node->nd_mid),
- ISEQ_TYPE_METHOD, line);
+ const rb_iseq_t *method_iseq = NEW_ISEQ(node->nd_defn,
+ rb_id2str(node->nd_mid),
+ ISEQ_TYPE_METHOD, line);
- debugp_param("defn/iseq", iseqval);
+ debugp_param("defn/iseq", rb_iseqw_new(method_iseq));
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
- ADD_INSN1(ret, line, putiseq, iseqval);
- ADD_SEND (ret, line, ID2SYM(id_core_define_method), INT2FIX(3));
+ ADD_INSN1(ret, line, putiseq, method_iseq);
+ ADD_SEND (ret, line, id_core_define_method, INT2FIX(2));
if (poped) {
ADD_INSN(ret, line, pop);
}
- debugp_param("defn", iseqval);
break;
}
case NODE_DEFS:{
- VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
- rb_id2str(node->nd_mid),
- ISEQ_TYPE_METHOD, line);
+ const rb_iseq_t * singleton_method = NEW_ISEQ(node->nd_defn,
+ rb_id2str(node->nd_mid),
+ ISEQ_TYPE_METHOD, line);
- debugp_param("defs/iseq", iseqval);
+ debugp_param("defs/iseq", rb_iseqw_new(singleton_method));
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
COMPILE(ret, "defs: recv", node->nd_recv);
ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
- ADD_INSN1(ret, line, putiseq, iseqval);
- ADD_SEND (ret, line, ID2SYM(id_core_define_singleton_method), INT2FIX(3));
+ ADD_INSN1(ret, line, putiseq, singleton_method);
+ ADD_SEND (ret, line, id_core_define_singleton_method, INT2FIX(3));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4954,7 +5582,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
COMPILE(ret, "alias arg1", node->u1.node);
COMPILE(ret, "alias arg2", node->u2.node);
- ADD_SEND(ret, line, ID2SYM(id_core_set_method_alias), INT2FIX(3));
+ ADD_SEND(ret, line, id_core_set_method_alias, INT2FIX(3));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4965,7 +5593,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_INSN1(ret, line, putobject, ID2SYM(node->u1.id));
ADD_INSN1(ret, line, putobject, ID2SYM(node->u2.id));
- ADD_SEND(ret, line, ID2SYM(id_core_set_variable_alias), INT2FIX(2));
+ ADD_SEND(ret, line, id_core_set_variable_alias, INT2FIX(2));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4976,7 +5604,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
COMPILE(ret, "undef arg", node->u2.node);
- ADD_SEND(ret, line, ID2SYM(id_core_undef_method), INT2FIX(2));
+ ADD_SEND(ret, line, id_core_undef_method, INT2FIX(2));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -4984,18 +5612,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_CLASS:{
- VALUE iseqval =
- NEW_CHILD_ISEQVAL(
- node->nd_body,
- rb_sprintf("<class:%s>", rb_id2name(node->nd_cpath->nd_mid)),
- ISEQ_TYPE_CLASS, line);
+ const rb_iseq_t *class_iseq = NEW_CHILD_ISEQ(node->nd_body,
+ rb_sprintf("<class:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, line);
VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
int flags = VM_DEFINECLASS_TYPE_CLASS;
+
if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
if (node->nd_super) flags |= VM_DEFINECLASS_FLAG_HAS_SUPERCLASS;
COMPILE(ret, "super", node->nd_super);
- ADD_INSN3(ret, line, defineclass,
- ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
+ ADD_INSN3(ret, line, defineclass, ID2SYM(node->nd_cpath->nd_mid), class_iseq, INT2FIX(flags));
if (poped) {
ADD_INSN(ret, line, pop);
@@ -5003,17 +5629,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_MODULE:{
- VALUE iseqval = NEW_CHILD_ISEQVAL(
- node->nd_body,
- rb_sprintf("<module:%s>", rb_id2name(node->nd_cpath->nd_mid)),
- ISEQ_TYPE_CLASS, line);
-
+ const rb_iseq_t *module_iseq = NEW_CHILD_ISEQ(node->nd_body,
+ rb_sprintf("<module:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, line);
VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
int flags = VM_DEFINECLASS_TYPE_MODULE;
+
if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
ADD_INSN (ret, line, putnil); /* dummy */
- ADD_INSN3(ret, line, defineclass,
- ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
+ ADD_INSN3(ret, line, defineclass, ID2SYM(node->nd_cpath->nd_mid), module_iseq, INT2FIX(flags));
+
if (poped) {
ADD_INSN(ret, line, pop);
}
@@ -5021,15 +5646,14 @@ 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("singleton class"),
- ISEQ_TYPE_CLASS, line);
+ const rb_iseq_t *singleton_class = NEW_ISEQ(node->nd_body, rb_str_new2("singleton class"),
+ ISEQ_TYPE_CLASS, line);
COMPILE(ret, "sclass#recv", node->nd_recv);
ADD_INSN (ret, line, putnil);
CONST_ID(singletonclass, "singletonclass");
ADD_INSN3(ret, line, defineclass,
- ID2SYM(singletonclass), iseqval,
+ ID2SYM(singletonclass), singleton_class,
INT2FIX(VM_DEFINECLASS_TYPE_SINGLETON_CLASS));
if (poped) {
@@ -5041,7 +5665,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (rb_is_const_id(node->nd_mid)) {
/* constant */
LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->is_size++;
+ int ic_index = iseq->body->is_size++;
DECL_ANCHOR(pref);
DECL_ANCHOR(body);
@@ -5050,7 +5674,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
INIT_ANCHOR(body);
compile_colon2(iseq, node, pref, body);
if (LIST_SIZE_ZERO(pref)) {
- if (iseq->compile_data->option->inline_const_cache) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
}
else {
@@ -5059,7 +5683,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_SEQ(ret, body);
- if (iseq->compile_data->option->inline_const_cache) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
@@ -5073,8 +5697,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
/* function call */
ADD_CALL_RECEIVER(ret, line);
COMPILE(ret, "colon2#nd_head", node->nd_head);
- ADD_CALL(ret, line, ID2SYM(node->nd_mid),
- INT2FIX(1));
+ ADD_CALL(ret, line, node->nd_mid, INT2FIX(1));
}
if (poped) {
ADD_INSN(ret, line, pop);
@@ -5083,12 +5706,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_COLON3:{
LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->is_size++;
+ int ic_index = iseq->body->is_size++;
debugi("colon3#nd_mid", node->nd_mid);
/* add cache insn */
- if (iseq->compile_data->option->inline_const_cache) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
ADD_INSN(ret, line, pop);
}
@@ -5096,7 +5719,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN1(ret, line, putobject, rb_cObject);
ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
- if (iseq->compile_data->option->inline_const_cache) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
@@ -5125,11 +5748,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
LABEL *lend = NEW_LABEL(line);
LABEL *lfin = NEW_LABEL(line);
LABEL *ltrue = NEW_LABEL(line);
- rb_iseq_t *local_iseq = iseq->local_iseq;
+ rb_iseq_t *local_iseq = iseq->body->local_iseq;
rb_num_t cnt;
VALUE key;
- cnt = local_iseq->flip_cnt++ + DEFAULT_SPECIAL_VAR_COUNT;
+ cnt = ISEQ_FLIP_CNT_INCREMENT(local_iseq) + VM_SVAR_FLIPFLOP_START;
key = INT2FIX(cnt);
ADD_INSN2(ret, line, getspecial, key, INT2FIX(0));
@@ -5187,17 +5810,17 @@ 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) {
+ if (iseq->body->type == ISEQ_TYPE_RESCUE) {
ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
}
else {
- rb_iseq_t *ip = iseq;
+ const rb_iseq_t *ip = iseq;
int level = 0;
while (ip) {
- if (ip->type == ISEQ_TYPE_RESCUE) {
+ if (ip->body->type == ISEQ_TYPE_RESCUE) {
break;
}
- ip = ip->parent_iseq;
+ ip = ip->body->parent_iseq;
level++;
}
if (ip) {
@@ -5235,10 +5858,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
/* compiled to:
* ONCE{ rb_mRubyVMFrozenCore::core#set_postexe{ ... } }
*/
- int is_index = iseq->is_size++;
- VALUE once_iseq = NEW_CHILD_ISEQVAL(
- NEW_IFUNC(build_postexe_iseq, node->nd_body),
- make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ int is_index = iseq->body->is_size++;
+ const rb_iseq_t *once_iseq = NEW_CHILD_ISEQ((NODE *)IFUNC_NEW(build_postexe_iseq, node->nd_body, 0),
+ make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
ADD_INSN2(ret, line, once, once_iseq, INT2FIX(is_index));
@@ -5247,47 +5869,41 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
break;
}
- case NODE_KW_ARG:{
- LABEL *default_label = NEW_LABEL(line);
- LABEL *end_label = 0;
- int idx, lv, ls;
- ID id = node->nd_body->nd_vid;
+ case NODE_KW_ARG:
+ {
+ LABEL *end_label = NEW_LABEL(nd_line(node));
+ NODE *default_value = node->nd_body->nd_value;
+
+ if (default_value == (NODE *)-1) {
+ /* required argument. do nothing */
+ rb_compile_bug_str(ERROR_ARGS "unreachable");
+ }
+ else if (nd_type(default_value) == NODE_LIT ||
+ nd_type(default_value) == NODE_NIL ||
+ nd_type(default_value) == NODE_TRUE ||
+ nd_type(default_value) == NODE_FALSE) {
+ rb_compile_bug_str(ERROR_ARGS "unreachable");
+ }
+ else {
+ /* if keywordcheck(_kw_bits, nth_keyword)
+ * kw = default_value
+ * end
+ */
+ int kw_bits_idx = iseq->body->local_size - iseq->body->param.keyword->bits_start;
+ int keyword_idx = iseq->body->param.keyword->num;
+
+ ADD_INSN2(ret, line, checkkeyword, INT2FIX(kw_bits_idx), INT2FIX(keyword_idx));
+ ADD_INSNL(ret, line, branchif, end_label);
+ COMPILE_POPED(ret, "keyword default argument", node->nd_body);
+ ADD_LABEL(ret, end_label);
+ }
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, ID2SYM(id));
- ADD_SEND(ret, line, ID2SYM(rb_intern("key?")), INT2FIX(1));
- ADD_INSNL(ret, line, branchunless, default_label);
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, ID2SYM(id));
- ADD_SEND(ret, line, 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, line, 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, line, 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)));
- }
- if (node->nd_body->nd_value != (NODE *)-1) {
- end_label = NEW_LABEL(nd_line(node));
- ADD_INSNL(ret, nd_line(node), jump, end_label);
}
- ADD_LABEL(ret, default_label);
- if (node->nd_body->nd_value != (NODE *)-1) {
- 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) {
- ADD_SEND(ret, line, ID2SYM(idIntern), INT2FIX(0));
+ ADD_SEND(ret, line, idIntern, INT2FIX(0));
}
else {
ADD_INSN(ret, line, pop);
@@ -5297,24 +5913,52 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_ATTRASGN:{
DECL_ANCHOR(recv);
DECL_ANCHOR(args);
- VALUE flag = 0;
+ unsigned int flag = 0;
+ ID mid = node->nd_mid;
+ LABEL *lskip = 0;
VALUE argc;
+ /* optimization shortcut
+ * obj["literal"] = value -> opt_aset_with(obj, "literal", value)
+ */
+ if (mid == idASET && !private_recv_p(node) && node->nd_args &&
+ nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 2 &&
+ nd_type(node->nd_args->nd_head) == NODE_STR &&
+ ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
+ ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction)
+ {
+ VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
+ node->nd_args->nd_head->nd_lit = str;
+ iseq_add_mark_object(iseq, str);
+ COMPILE(ret, "recv", node->nd_recv);
+ COMPILE(ret, "value", node->nd_args->nd_next->nd_head);
+ if (!poped) {
+ ADD_INSN(ret, line, swap);
+ ADD_INSN1(ret, line, topn, INT2FIX(1));
+ }
+ ADD_INSN3(ret, line, opt_aset_with,
+ new_callinfo(iseq, idASET, 2, 0, NULL, FALSE),
+ NULL/* CALL_CACHE */, str);
+ ADD_INSN(ret, line, pop);
+ break;
+ }
+
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args, &flag);
+ argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
- if (node->nd_recv == (NODE *) 1) {
- flag |= VM_CALL_FCALL;
- ADD_INSN(recv, line, putself);
- }
- else {
- COMPILE(recv, "recv", node->nd_recv);
- }
+ flag |= COMPILE_RECV(recv, "recv", node);
debugp_param("argc", argc);
- debugp_param("nd_mid", ID2SYM(node->nd_mid));
+ debugp_param("nd_mid", ID2SYM(mid));
+ if (!rb_is_attrset_id(mid)) {
+ /* safe nav attr */
+ mid = rb_id_attrset(mid);
+ ADD_INSN(recv, line, dup);
+ lskip = NEW_LABEL(line);
+ ADD_INSNL(recv, line, branchnil, lskip);
+ }
if (!poped) {
ADD_INSN(ret, line, putnil);
ADD_SEQ(ret, recv);
@@ -5324,7 +5968,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN1(ret, line, topn, INT2FIX(1));
if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN1(ret, line, putobject, INT2FIX(-1));
- ADD_SEND(ret, line, ID2SYM(idAREF), INT2FIX(1));
+ ADD_SEND(ret, line, idAREF, INT2FIX(1));
}
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 3));
ADD_INSN (ret, line, pop);
@@ -5332,7 +5976,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
else if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN(ret, line, dup);
ADD_INSN1(ret, line, putobject, INT2FIX(-1));
- ADD_SEND(ret, line, ID2SYM(idAREF), INT2FIX(1));
+ ADD_SEND(ret, line, idAREF, INT2FIX(1));
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2));
ADD_INSN (ret, line, pop);
}
@@ -5344,22 +5988,31 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
}
- ADD_SEND_R(ret, line, ID2SYM(node->nd_mid), argc, 0, LONG2FIX(flag));
+ ADD_SEND_WITH_FLAG(ret, line, mid, argc, INT2FIX(flag));
+ if (lskip) ADD_LABEL(ret, lskip);
ADD_INSN(ret, line, pop);
break;
}
case NODE_PRELUDE:{
+ const rb_compile_option_t *orig_opt = ISEQ_COMPILE_DATA(iseq)->option;
+ rb_compile_option_t new_opt = *orig_opt;
+ if (node->nd_orig) {
+ rb_iseq_make_compile_option(&new_opt, node->nd_orig);
+ ISEQ_COMPILE_DATA(iseq)->option = &new_opt;
+ }
COMPILE_POPED(ret, "prelude", node->nd_head);
COMPILE_(ret, "body", node->nd_body, poped);
+ ISEQ_COMPILE_DATA(iseq)->option = orig_opt;
break;
}
case NODE_LAMBDA:{
/* compile same as lambda{...} */
- VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ const rb_iseq_t *block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
VALUE argc = INT2FIX(0);
+
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_CALL_WITH_BLOCK(ret, line, ID2SYM(idLambda), argc, block);
+ ADD_CALL_WITH_BLOCK(ret, line, idLambda, argc, block);
if (poped) {
ADD_INSN(ret, line, pop);
@@ -5367,7 +6020,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
default:
- rb_bug("iseq_compile_each: unknown node: %s", ruby_node_name(type));
+ UNKNOWN_NODE("iseq_compile_each", node);
return COMPILE_NG;
}
@@ -5442,7 +6095,7 @@ insn_data_to_s_detail(INSN *iobj)
rb_iseq_t *iseq = (rb_iseq_t *)OPERAND_AT(iobj, j);
VALUE val = Qnil;
if (0 && iseq) { /* TODO: invalidate now */
- val = iseq->self;
+ val = (VALUE)iseq;
}
rb_str_concat(str, opobj_inspect(val));
}
@@ -5462,7 +6115,7 @@ 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));
+ rb_str_append(str, rb_id2str(entry->id));
break;
}
case TS_IC: /* inline cache */
@@ -5470,13 +6123,33 @@ insn_data_to_s_detail(INSN *iobj)
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);
+ struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(iobj, j);
+ rb_str_cat2(str, "<callinfo:");
+ if (ci->mid) rb_str_catf(str, "%"PRIsVALUE, rb_id2str(ci->mid));
+ rb_str_catf(str, ", %d>", ci->orig_argc);
+ break;
+ }
+ case TS_CALLCACHE: /* call cache */
+ {
+ rb_str_catf(str, "<call cache>");
break;
}
case TS_CDHASH: /* case/when condition cache */
rb_str_cat2(str, "<ch>");
break;
+ case TS_FUNCPTR:
+ {
+ rb_insn_func_t func = (rb_insn_func_t)OPERAND_AT(iobj, j);
+#ifdef HAVE_DLADDR
+ Dl_info info;
+ if (dladdr(func, &info) && info.dli_sname) {
+ rb_str_cat2(str, info.dli_sname);
+ break;
+ }
+#endif
+ rb_str_catf(str, "<%p>", func);
+ }
+ break;
default:{
rb_raise(rb_eSyntaxError, "unknown operand type: %c", type);
}
@@ -5505,7 +6178,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), iobj->line_no);
+ printf("%04d %-65s(%4u)\n", pos, StringValueCStr(str), iobj->line_no);
pos += insn_data_length(iobj);
break;
}
@@ -5533,6 +6206,7 @@ dump_disasm_list(struct iseq_link_element *link)
link = link->next;
}
printf("---------------------\n");
+ fflush(stdout);
}
const char *
@@ -5566,6 +6240,7 @@ register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
else {
label = (LABEL *)tmp;
}
+ LABEL_REF(label);
return label;
}
@@ -5574,7 +6249,6 @@ get_exception_sym2type(VALUE sym)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
- VALUE sym_inspect;
static VALUE symRescue, symEnsure, symRetry;
static VALUE symBreak, symRedo, symNext;
@@ -5593,9 +6267,7 @@ get_exception_sym2type(VALUE sym)
if (sym == symBreak) return CATCH_TYPE_BREAK;
if (sym == symRedo) return CATCH_TYPE_REDO;
if (sym == symNext) return CATCH_TYPE_NEXT;
- sym_inspect = rb_inspect(sym);
- rb_raise(rb_eSyntaxError, "invalid exception symbol: %s",
- StringValuePtr(sym_inspect));
+ rb_raise(rb_eSyntaxError, "invalid exception symbol: %+"PRIsVALUE, sym);
return 0;
}
@@ -5606,12 +6278,13 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
int i;
for (i=0; i<RARRAY_LEN(exception); i++) {
- VALUE v, type, eiseqval;
+ const rb_iseq_t *eiseq;
+ VALUE v, type;
const VALUE *ptr;
LABEL *lstart, *lend, *lcont;
- int sp;
+ unsigned int sp;
- RB_GC_GUARD(v) = rb_convert_type(RARRAY_AREF(exception, i), T_ARRAY,
+ v = rb_convert_type(RARRAY_AREF(exception, i), T_ARRAY,
"Array", "to_ary");
if (RARRAY_LEN(v) != 6) {
rb_raise(rb_eSyntaxError, "wrong exception entry");
@@ -5619,20 +6292,22 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
ptr = RARRAY_CONST_PTR(v);
type = get_exception_sym2type(ptr[0]);
if (ptr[1] == Qnil) {
- eiseqval = 0;
+ eiseq = NULL;
}
else {
- eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil);
+ eiseq = rb_iseqw_to_iseq(rb_iseq_load(ptr[1], (VALUE)iseq, Qnil));
}
lstart = register_label(iseq, labels_table, ptr[2]);
lend = register_label(iseq, labels_table, ptr[3]);
lcont = register_label(iseq, labels_table, ptr[4]);
- sp = NUM2INT(ptr[5]);
+ sp = NUM2UINT(ptr[5]);
(void)sp;
- ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
+ ADD_CATCH_ENTRY(type, lstart, lend, eiseq, lcont);
+
+ RB_GC_GUARD(v);
}
return COMPILE_OK;
}
@@ -5651,32 +6326,74 @@ insn_make_insn_table(void)
return table;
}
-static VALUE
-iseq_build_load_iseq(rb_iseq_t *iseq, VALUE op)
+static const rb_iseq_t *
+iseq_build_load_iseq(const rb_iseq_t *iseq, VALUE op)
{
- VALUE iseqval;
+ VALUE iseqw;
+ const rb_iseq_t *loaded_iseq;
+
if (RB_TYPE_P(op, T_ARRAY)) {
- iseqval = rb_iseq_load(op, iseq->self, Qnil);
+ iseqw = rb_iseq_load(op, (VALUE)iseq, Qnil);
}
else if (CLASS_OF(op) == rb_cISeq) {
- iseqval = op;
+ iseqw = op;
}
else {
rb_raise(rb_eSyntaxError, "ISEQ is required");
}
- iseq_add_mark_object(iseq, iseqval);
- return iseqval;
+
+ loaded_iseq = rb_iseqw_to_iseq(iseqw);
+ iseq_add_mark_object(iseq, (VALUE)loaded_iseq);
+ return loaded_iseq;
+}
+
+static VALUE
+iseq_build_callinfo_from_hash(rb_iseq_t *iseq, VALUE op)
+{
+ ID mid = 0;
+ int orig_argc = 0;
+ unsigned int flag = 0;
+ struct rb_call_info_kw_arg *kw_arg = 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 vkw_arg = rb_hash_aref(op, ID2SYM(rb_intern("kw_arg")));
+
+ if (!NIL_P(vmid)) mid = SYM2ID(vmid);
+ if (!NIL_P(vflag)) flag = NUM2UINT(vflag);
+ if (!NIL_P(vorig_argc)) orig_argc = FIX2INT(vorig_argc);
+
+ if (!NIL_P(vkw_arg)) {
+ int i;
+ int len = RARRAY_LENINT(vkw_arg);
+ size_t n = rb_call_info_kw_arg_bytes(len);
+
+ kw_arg = xmalloc(n);
+ kw_arg->keyword_len = len;
+ for (i = 0; i < len; i++) {
+ VALUE kw = RARRAY_AREF(vkw_arg, i);
+ SYM2ID(kw); /* make immortal */
+ kw_arg->keywords[i] = kw;
+ }
+ }
+ }
+
+ return (VALUE)new_callinfo(iseq, mid, orig_argc, flag, kw_arg, (flag & VM_CALL_ARGS_SIMPLE) == 0);
}
static int
iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
- VALUE body, struct st_table *labels_table)
+ VALUE body, VALUE labels_wrapper)
{
/* TODO: body should be frozen */
const VALUE *ptr = RARRAY_CONST_PTR(body);
long i, len = RARRAY_LEN(body);
+ struct st_table *labels_table = DATA_PTR(labels_wrapper);
int j;
int line_no = 0;
+ int ret = COMPILE_OK;
/*
* index -> LABEL *label
@@ -5706,14 +6423,17 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
insn = (argc < 0) ? Qnil : RARRAY_AREF(obj, 0);
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->location.path), line_no,
- "unknown instruction: %s", RSTRING_PTR(insn));
+ COMPILE_ERROR(ruby_sourcefile_string, line_no,
+ "unknown instruction: %+"PRIsVALUE, insn);
+ ret = COMPILE_NG;
+ break;
}
if (argc != insn_len((VALUE)insn_id)-1) {
- rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
- "operand size mismatch");
+ COMPILE_ERROR(ruby_sourcefile_string, line_no,
+ "operand size mismatch");
+ ret = COMPILE_NG;
+ break;
}
if (argc > 0) {
@@ -5738,7 +6458,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
case TS_ISEQ:
{
if (op != Qnil) {
- argv[j] = iseq_build_load_iseq(iseq, op);
+ argv[j] = (VALUE)iseq_build_load_iseq(iseq, op);
}
else {
argv[j] = 0;
@@ -5751,30 +6471,15 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
break;
case TS_IC:
argv[j] = op;
- if (NUM2INT(op) >= iseq->is_size) {
- iseq->is_size = NUM2INT(op) + 1;
+ if (NUM2UINT(op) >= iseq->body->is_size) {
+ iseq->body->is_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);
- }
+ argv[j] = iseq_build_callinfo_from_hash(iseq, op);
+ break;
+ case TS_CALLCACHE:
+ argv[j] = Qfalse;
break;
case TS_ID:
argv[j] = rb_convert_type(op, T_SYMBOL,
@@ -5783,16 +6488,30 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
case TS_CDHASH:
{
int i;
+ VALUE map = rb_hash_new();
+
+ rb_hash_tbl_raw(map)->type = &cdhash_type;
op = rb_convert_type(op, T_ARRAY, "Array", "to_ary");
- op = rb_ary_dup(op);
for (i=0; i<RARRAY_LEN(op); i+=2) {
- VALUE sym = rb_ary_entry(op, i+1);
+ VALUE key = RARRAY_AREF(op, i);
+ VALUE sym = RARRAY_AREF(op, i+1);
LABEL *label =
register_label(iseq, labels_table, sym);
- rb_ary_store(op, i+1, (VALUE)label | 1);
+ rb_hash_aset(map, key, (VALUE)label | 1);
}
- argv[j] = op;
- iseq_add_mark_object_compile_time(iseq, op);
+ RB_GC_GUARD(op);
+ argv[j] = map;
+ rb_iseq_add_mark_object(iseq, map);
+ }
+ break;
+ case TS_FUNCPTR:
+ {
+#if SIZEOF_VALUE <= SIZEOF_LONG
+ long funcptr = NUM2LONG(op);
+#else
+ LONG_LONG funcptr = NUM2LL(op);
+#endif
+ argv[j] = (VALUE)funcptr;
}
break;
default:
@@ -5808,87 +6527,197 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
rb_raise(rb_eTypeError, "unexpected object for instruction");
}
}
+ DATA_PTR(labels_wrapper) = 0;
validate_labels(iseq, labels_table);
- st_free_table(labels_table);
- iseq_setup(iseq, anchor);
- return COMPILE_OK;
+ if (!ret) return ret;
+ return iseq_setup(iseq, anchor);
}
#define CHECK_ARRAY(v) rb_convert_type((v), T_ARRAY, "Array", "to_ary")
-#define CHECK_STRING(v) rb_convert_type((v), T_STRING, "String", "to_str")
#define CHECK_SYMBOL(v) rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
-static inline VALUE CHECK_INTEGER(VALUE v) {(void)NUM2LONG(v); return v;}
-VALUE
-rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
+static int
+int_param(int *dst, VALUE param, VALUE sym)
+{
+ VALUE val = rb_hash_aref(param, sym);
+ switch (TYPE(val)) {
+ case T_NIL:
+ return FALSE;
+ case T_FIXNUM:
+ *dst = FIX2INT(val);
+ return TRUE;
+ default:
+ rb_raise(rb_eTypeError, "invalid %+"PRIsVALUE" Fixnum: %+"PRIsVALUE,
+ sym, val);
+ }
+ return FALSE;
+}
+
+static const struct rb_iseq_param_keyword *
+iseq_build_kw(rb_iseq_t *iseq, VALUE params, VALUE keywords)
+{
+ int i, j;
+ int len = RARRAY_LENINT(keywords);
+ int default_len;
+ VALUE key, sym, default_val;
+ VALUE *dvs;
+ ID *ids;
+ struct rb_iseq_param_keyword *keyword = ZALLOC(struct rb_iseq_param_keyword);
+
+ iseq->body->param.flags.has_kw = TRUE;
+
+ keyword->num = len;
+#define SYM(s) ID2SYM(rb_intern(#s))
+ (void)int_param(&keyword->bits_start, params, SYM(kwbits));
+ i = keyword->bits_start - keyword->num;
+ ids = (VALUE *)&iseq->body->local_table[i];
+#undef SYM
+
+ /* required args */
+ for (i = 0; i < len; i++) {
+ VALUE val = RARRAY_AREF(keywords, i);
+
+ if (!SYMBOL_P(val)) {
+ goto default_values;
+ }
+ ids[i] = SYM2ID(val);
+ keyword->required_num++;
+ }
+
+ default_values: /* note: we intentionally preserve `i' from previous loop */
+ default_len = len - i;
+ if (default_len == 0) {
+ return keyword;
+ }
+
+ dvs = ALLOC_N(VALUE, default_len);
+
+ for (j = 0; i < len; i++, j++) {
+ key = RARRAY_AREF(keywords, i);
+ CHECK_ARRAY(key);
+
+ switch (RARRAY_LEN(key)) {
+ case 1:
+ sym = RARRAY_AREF(key, 0);
+ default_val = Qundef;
+ break;
+ case 2:
+ sym = RARRAY_AREF(key, 0);
+ default_val = RARRAY_AREF(key, 1);
+ break;
+ default:
+ rb_raise(rb_eTypeError, "keyword default has unsupported len %+"PRIsVALUE, key);
+ }
+ ids[i] = SYM2ID(sym);
+ dvs[j] = default_val;
+ }
+
+ keyword->table = ids;
+ keyword->default_values = dvs;
+
+ return keyword;
+}
+
+void
+rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
VALUE exception, VALUE body)
{
- int i;
+#define SYM(s) ID2SYM(rb_intern(#s))
+ int i, len;
ID *tbl;
struct st_table *labels_table = st_init_numtable();
+ VALUE labels_wrapper = Data_Wrap_Struct(0, 0, st_free_table, labels_table);
+ VALUE arg_opt_labels = rb_hash_aref(params, SYM(opt));
+ VALUE keywords = rb_hash_aref(params, SYM(keyword));
+ VALUE sym_arg_rest = ID2SYM(rb_intern("#arg_rest"));
DECL_ANCHOR(anchor);
INIT_ANCHOR(anchor);
- iseq->local_table_size = RARRAY_LENINT(locals);
- iseq->local_table = tbl = (ID *)ALLOC_N(ID, iseq->local_table_size);
- iseq->local_size = iseq->local_table_size + 1;
+ len = RARRAY_LENINT(locals);
+ iseq->body->local_table_size = len;
+ iseq->body->local_table = tbl = len > 0 ? (ID *)ALLOC_N(ID, iseq->body->local_table_size) : NULL;
+ iseq->body->local_size = iseq->body->local_table_size + 1;
- for (i=0; i<RARRAY_LEN(locals); i++) {
+ for (i = 0; i < len; i++) {
VALUE lv = RARRAY_AREF(locals, i);
- tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
- }
- /* args */
- if (FIXNUM_P(args)) {
- iseq->arg_size = iseq->argc = FIX2INT(args);
- iseq->arg_simple = 1;
- }
- else {
- int i = 0;
- VALUE argc = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_opt_labels = CHECK_ARRAY(rb_ary_entry(args, i++));
- VALUE arg_post_len = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_post_start = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_rest = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_block = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_simple = CHECK_INTEGER(rb_ary_entry(args, i++));
-
- iseq->argc = FIX2INT(argc);
- iseq->arg_rest = FIX2INT(arg_rest);
- iseq->arg_post_len = FIX2INT(arg_post_len);
- iseq->arg_post_start = FIX2INT(arg_post_start);
- iseq->arg_block = FIX2INT(arg_block);
- iseq->arg_opts = RARRAY_LENINT(arg_opt_labels);
- iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, iseq->arg_opts);
-
- if (iseq->arg_block != -1) {
- iseq->arg_size = iseq->arg_block + 1;
- }
- else if (iseq->arg_post_len) {
- iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
- }
- else if (iseq->arg_rest != -1) {
- iseq->arg_size = iseq->arg_rest + 1;
+ if (sym_arg_rest == lv) {
+ tbl[i] = 0;
}
else {
- iseq->arg_size = iseq->argc + (iseq->arg_opts ? iseq->arg_opts - 1 : 0);
+ tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
}
+ }
- for (i=0; i<RARRAY_LEN(arg_opt_labels); i++) {
- iseq->arg_opt_table[i] =
- (VALUE)register_label(iseq, labels_table,
- rb_ary_entry(arg_opt_labels, i));
+ /*
+ * we currently ignore misc params,
+ * local_size, stack_size and param.size are all calculated
+ */
+
+#define INT_PARAM(F) int_param(&iseq->body->param.F, params, SYM(F))
+ if (INT_PARAM(lead_num)) {
+ iseq->body->param.flags.has_lead = TRUE;
+ }
+ if (INT_PARAM(post_num)) iseq->body->param.flags.has_post = TRUE;
+ if (INT_PARAM(post_start)) iseq->body->param.flags.has_post = TRUE;
+ if (INT_PARAM(rest_start)) iseq->body->param.flags.has_rest = TRUE;
+ if (INT_PARAM(block_start)) iseq->body->param.flags.has_block = TRUE;
+#undef INT_PARAM
+
+ switch (TYPE(arg_opt_labels)) {
+ case T_ARRAY:
+ len = RARRAY_LENINT(arg_opt_labels);
+ iseq->body->param.flags.has_opt = !!(len - 1 >= 0);
+
+ if (iseq->body->param.flags.has_opt) {
+ VALUE *opt_table = ALLOC_N(VALUE, len);
+
+ for (i = 0; i < len; i++) {
+ VALUE ent = RARRAY_AREF(arg_opt_labels, i);
+ LABEL *label = register_label(iseq, labels_table, ent);
+ opt_table[i] = (VALUE)label;
+ }
+
+ iseq->body->param.opt_num = len - 1;
+ iseq->body->param.opt_table = opt_table;
}
+ case T_NIL:
+ break;
+ default:
+ rb_raise(rb_eTypeError, ":opt param is not an array: %+"PRIsVALUE,
+ arg_opt_labels);
+ }
- iseq->arg_simple = NUM2INT(arg_simple);
+ switch (TYPE(keywords)) {
+ case T_ARRAY:
+ iseq->body->param.keyword = iseq_build_kw(iseq, params, keywords);
+ case T_NIL:
+ break;
+ default:
+ rb_raise(rb_eTypeError, ":keywords param is not an array: %+"PRIsVALUE,
+ keywords);
+ }
+
+ if (Qtrue == rb_hash_aref(params, SYM(ambiguous_param0))) {
+ iseq->body->param.flags.ambiguous_param0 = TRUE;
+ }
+
+ if (int_param(&i, params, SYM(kwrest))) {
+ struct rb_iseq_param_keyword *keyword = (struct rb_iseq_param_keyword *)iseq->body->param.keyword;
+ if (keyword == NULL) {
+ iseq->body->param.keyword = keyword = ZALLOC(struct rb_iseq_param_keyword);
+ }
+ keyword->rest_start = i;
+ iseq->body->param.flags.has_kwrest = TRUE;
}
+#undef SYM
+ iseq_calc_param_size(iseq);
/* exception */
iseq_build_from_ary_exception(iseq, labels_table, exception);
/* body */
- iseq_build_from_ary_body(iseq, anchor, body, labels_table);
- return iseq->self;
+ iseq_build_from_ary_body(iseq, anchor, body, labels_wrapper);
}
/* for parser */
@@ -5897,22 +6726,23 @@ int
rb_dvar_defined(ID id)
{
rb_thread_t *th = GET_THREAD();
- rb_iseq_t *iseq;
+ const rb_iseq_t *iseq;
+
if (th->base_block && (iseq = th->base_block->iseq)) {
- while (iseq->type == ISEQ_TYPE_BLOCK ||
- iseq->type == ISEQ_TYPE_RESCUE ||
- iseq->type == ISEQ_TYPE_ENSURE ||
- iseq->type == ISEQ_TYPE_EVAL ||
- iseq->type == ISEQ_TYPE_MAIN
+ while (iseq->body->type == ISEQ_TYPE_BLOCK ||
+ iseq->body->type == ISEQ_TYPE_RESCUE ||
+ iseq->body->type == ISEQ_TYPE_ENSURE ||
+ iseq->body->type == ISEQ_TYPE_EVAL ||
+ iseq->body->type == ISEQ_TYPE_MAIN
) {
- int i;
+ unsigned int i;
- for (i = 0; i < iseq->local_table_size; i++) {
- if (iseq->local_table[i] == id) {
+ for (i = 0; i < iseq->body->local_table_size; i++) {
+ if (iseq->body->local_table[i] == id) {
return 1;
}
}
- iseq = iseq->parent_iseq;
+ iseq = iseq->body->parent_iseq;
}
}
return 0;
@@ -5922,14 +6752,14 @@ int
rb_local_defined(ID id)
{
rb_thread_t *th = GET_THREAD();
- rb_iseq_t *iseq;
+ const rb_iseq_t *iseq;
if (th->base_block && th->base_block->iseq) {
- int i;
- iseq = th->base_block->iseq->local_iseq;
+ unsigned int i;
+ iseq = th->base_block->iseq->body->local_iseq;
- for (i=0; i<iseq->local_table_size; i++) {
- if (iseq->local_table[i] == id) {
+ for (i=0; i<iseq->body->local_table_size; i++) {
+ if (iseq->body->local_table[i] == id) {
return 1;
}
}
@@ -5948,3 +6778,1595 @@ rb_parse_in_main(void)
{
return GET_THREAD()->parse_in_eval < 0;
}
+
+static int
+caller_location(VALUE *path, VALUE *absolute_path)
+{
+ const rb_thread_t *const th = GET_THREAD();
+ const rb_control_frame_t *const cfp =
+ rb_vm_get_ruby_level_next_cfp(th, th->cfp);
+
+ if (cfp) {
+ int line = rb_vm_get_sourceline(cfp);
+ *path = cfp->iseq->body->location.path;
+ *absolute_path = cfp->iseq->body->location.absolute_path;
+ return line;
+ }
+ else {
+ *path = rb_str_new2("<compiled>");
+ *absolute_path = *path;
+ return 1;
+ }
+}
+
+typedef struct {
+ VALUE arg;
+ rb_insn_func_t func;
+ int line;
+} accessor_args;
+
+static const rb_iseq_t *
+method_for_self(VALUE name, VALUE arg, rb_insn_func_t func,
+ VALUE (*build)(rb_iseq_t *, LINK_ANCHOR *, VALUE))
+{
+ VALUE path, absolute_path;
+ accessor_args acc;
+
+ acc.arg = arg;
+ acc.func = func;
+ acc.line = caller_location(&path, &absolute_path);
+ return rb_iseq_new_with_opt((NODE *)IFUNC_NEW(build, (VALUE)&acc, 0),
+ rb_sym2str(name), path, absolute_path,
+ INT2FIX(acc.line), 0, ISEQ_TYPE_METHOD, 0);
+}
+
+static VALUE
+for_self_aref(rb_iseq_t *iseq, LINK_ANCHOR *ret, VALUE a)
+{
+ const accessor_args *const args = (void *)a;
+ const int line = args->line;
+
+ iseq_set_local_table(iseq, 0);
+ iseq->body->param.lead_num = 0;
+ iseq->body->param.size = 0;
+
+ ADD_INSN1(ret, line, putobject, args->arg);
+ ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
+ return Qnil;
+}
+
+static VALUE
+for_self_aset(rb_iseq_t *iseq, LINK_ANCHOR *ret, VALUE a)
+{
+ const accessor_args *const args = (void *)a;
+ const int line = args->line;
+ static const ID vars[] = {1, idUScore};
+
+ iseq_set_local_table(iseq, vars);
+ iseq->body->param.lead_num = 1;
+ iseq->body->param.size = 1;
+
+ ADD_INSN2(ret, line, getlocal, INT2FIX(numberof(vars)-0), INT2FIX(0));
+ ADD_INSN1(ret, line, putobject, args->arg);
+ ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
+ ADD_INSN(ret, line, pop);
+ return Qnil;
+}
+
+/*
+ * func (index) -> (value)
+ */
+const rb_iseq_t *
+rb_method_for_self_aref(VALUE name, VALUE arg, rb_insn_func_t func)
+{
+ return method_for_self(name, arg, func, for_self_aref);
+}
+
+/*
+ * func (index, value) -> (index, value)
+ */
+const rb_iseq_t *
+rb_method_for_self_aset(VALUE name, VALUE arg, rb_insn_func_t func)
+{
+ return method_for_self(name, arg, func, for_self_aset);
+}
+
+/* ISeq binary format */
+
+typedef unsigned int ibf_offset_t;
+#define IBF_OFFSET(ptr) ((ibf_offset_t)(VALUE)(ptr))
+
+struct ibf_header {
+ char magic[4]; /* YARB */
+ unsigned int major_version;
+ unsigned int minor_version;
+ unsigned int size;
+ unsigned int extra_size;
+
+ unsigned int iseq_list_size;
+ unsigned int id_list_size;
+ unsigned int object_list_size;
+
+ ibf_offset_t iseq_list_offset;
+ ibf_offset_t id_list_offset;
+ ibf_offset_t object_list_offset;
+};
+
+struct ibf_id_entry {
+ enum {
+ ibf_id_enc_ascii,
+ ibf_id_enc_utf8,
+ ibf_id_enc_other
+ } enc : 2;
+ char body[1];
+};
+
+struct ibf_dump {
+ VALUE str;
+ VALUE iseq_list; /* [iseq0 offset, ...] */
+ VALUE obj_list; /* [objs] */
+ st_table *iseq_table; /* iseq -> iseq number */
+ st_table *id_table; /* id -> id number */
+};
+
+rb_iseq_t * iseq_alloc(void);
+
+struct ibf_load {
+ const char *buff;
+ const struct ibf_header *header;
+ ID *id_list; /* [id0, ...] */
+ VALUE iseq_list; /* [iseq0, ...] */
+ VALUE obj_list; /* [obj0, ...] */
+ VALUE loader_obj;
+ VALUE str;
+ rb_iseq_t *iseq;
+};
+
+static ibf_offset_t
+ibf_dump_pos(struct ibf_dump *dump)
+{
+ return (unsigned int)rb_str_strlen(dump->str);
+}
+
+static ibf_offset_t
+ibf_dump_write(struct ibf_dump *dump, const void *buff, unsigned long size)
+{
+ ibf_offset_t pos = ibf_dump_pos(dump);
+ rb_str_cat(dump->str, (const char *)buff, size);
+ /* TODO: overflow check */
+ return pos;
+}
+
+static void
+ibf_dump_overwrite(struct ibf_dump *dump, void *buff, unsigned int size, long offset)
+{
+ VALUE str = dump->str;
+ char *ptr = RSTRING_PTR(str);
+ if ((unsigned long)(size + offset) > (unsigned long)RSTRING_LEN(str))
+ rb_bug("ibf_dump_overwrite: overflow");
+ memcpy(ptr + offset, buff, size);
+}
+
+static void *
+ibf_load_alloc(const struct ibf_load *load, ibf_offset_t offset, int size)
+{
+ void *buff = ruby_xmalloc(size);
+ memcpy(buff, load->buff + offset, size);
+ return buff;
+}
+
+#define IBF_W(b, type, n) (type *)(VALUE)ibf_dump_write(dump, (b), sizeof(type) * (n))
+#define IBF_WV(variable) ibf_dump_write(dump, &(variable), sizeof(variable))
+#define IBF_WP(b, type, n) ibf_dump_write(dump, (b), sizeof(type) * (n))
+#define IBF_R(val, type, n) (type *)ibf_load_alloc(load, IBF_OFFSET(val), sizeof(type) * (n))
+
+static int
+ibf_table_lookup(struct st_table *table, st_data_t key)
+{
+ st_data_t val;
+
+ if (st_lookup(table, key, &val)) {
+ return (int)val;
+ }
+ else {
+ return -1;
+ }
+}
+
+static int
+ibf_table_index(struct st_table *table, st_data_t key)
+{
+ int index = ibf_table_lookup(table, key);
+
+ if (index < 0) { /* not found */
+ index = (int)table->num_entries;
+ st_insert(table, key, (st_data_t)index);
+ }
+
+ return index;
+}
+
+/* dump/load generic */
+
+static VALUE ibf_load_object(const struct ibf_load *load, VALUE object_index);
+static rb_iseq_t *ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq);
+
+static VALUE
+ibf_dump_object(struct ibf_dump *dump, VALUE obj)
+{
+ long index = RARRAY_LEN(dump->obj_list);
+ long i;
+ for (i=0; i<index; i++) {
+ if (RARRAY_AREF(dump->obj_list, i) == obj) return (VALUE)i; /* dedup */
+ }
+ rb_ary_push(dump->obj_list, obj);
+ return (VALUE)index;
+}
+
+static VALUE
+ibf_dump_id(struct ibf_dump *dump, ID id)
+{
+ return (VALUE)ibf_table_index(dump->id_table, (st_data_t)id);
+}
+
+static ID
+ibf_load_id(const struct ibf_load *load, const ID id_index)
+{
+ ID id;
+
+ if (id_index == 0) {
+ id = 0;
+ }
+ else {
+ id = load->id_list[(long)id_index];
+
+ if (id == 0) {
+ long *indices = (long *)(load->buff + load->header->id_list_offset);
+ VALUE str = ibf_load_object(load, indices[id_index]);
+ id = NIL_P(str) ? 0 : rb_intern_str(str); /* str == nil -> internal junk id */
+ load->id_list[(long)id_index] = id;
+ }
+ }
+
+ return id;
+}
+
+/* dump/load: code */
+
+static VALUE
+ibf_dump_callinfo(struct ibf_dump *dump, const struct rb_call_info *ci)
+{
+ return (ci->flag & VM_CALL_KWARG) ? Qtrue : Qfalse;
+}
+
+static ibf_offset_t ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq);
+
+static rb_iseq_t *
+ibf_dump_iseq(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ if (iseq == NULL) {
+ return (rb_iseq_t *)-1;
+ }
+ else {
+ int iseq_index = ibf_table_lookup(dump->iseq_table, (st_data_t)iseq);
+ if (iseq_index < 0) {
+ iseq_index = ibf_table_index(dump->iseq_table, (st_data_t)iseq);
+ rb_ary_store(dump->iseq_list, iseq_index, LONG2NUM(ibf_dump_iseq_each(dump, rb_iseq_check(iseq))));
+ }
+ return (rb_iseq_t *)(VALUE)iseq_index;
+ }
+}
+
+static VALUE
+ibf_dump_gentry(struct ibf_dump *dump, const struct rb_global_entry *entry)
+{
+ return (VALUE)ibf_dump_id(dump, entry->id);
+}
+
+static VALUE
+ibf_load_gentry(const struct ibf_load *load, const struct rb_global_entry *entry)
+{
+ ID gid = ibf_load_id(load, (ID)(VALUE)entry);
+ return (VALUE)rb_global_entry(gid);
+}
+
+static VALUE *
+ibf_dump_code(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ const int iseq_size = iseq->body->iseq_size;
+ int code_index;
+ VALUE *code;
+ const VALUE *orig_code = rb_iseq_original_iseq(iseq);
+
+ code = ALLOCA_N(VALUE, iseq_size);
+
+ for (code_index=0; code_index<iseq_size;) {
+ const VALUE insn = orig_code[code_index];
+ const char *types = insn_op_types(insn);
+ int op_index;
+
+ code[code_index++] = (VALUE)insn;
+
+ for (op_index=0; types[op_index]; op_index++, code_index++) {
+ VALUE op = orig_code[code_index];
+ switch (types[op_index]) {
+ case TS_CDHASH:
+ case TS_VALUE:
+ code[code_index] = ibf_dump_object(dump, op);
+ break;
+ case TS_ISEQ:
+ code[code_index] = (VALUE)ibf_dump_iseq(dump, (const rb_iseq_t *)op);
+ break;
+ case TS_IC:
+ {
+ unsigned int i;
+ for (i=0; i<iseq->body->is_size; i++) {
+ if (op == (VALUE)&iseq->body->is_entries[i]) {
+ break;
+ }
+ }
+ code[code_index] = i;
+ }
+ break;
+ case TS_CALLINFO:
+ code[code_index] = ibf_dump_callinfo(dump, (const struct rb_call_info *)op);
+ break;
+ case TS_CALLCACHE:
+ code[code_index] = 0;
+ break;
+ case TS_ID:
+ code[code_index] = ibf_dump_id(dump, (ID)op);
+ break;
+ case TS_GENTRY:
+ code[code_index] = ibf_dump_gentry(dump, (const struct rb_global_entry *)op);
+ break;
+ case TS_FUNCPTR:
+ rb_raise(rb_eRuntimeError, "TS_FUNCPTR is not supported");
+ break;
+ default:
+ code[code_index] = op;
+ break;
+ }
+ }
+ assert(insn_len(insn) == op_index+1);
+ }
+
+ return IBF_W(code, VALUE, iseq_size);
+}
+
+static VALUE *
+ibf_load_code(const struct ibf_load *load, const rb_iseq_t *iseq, const struct rb_iseq_constant_body *body)
+{
+ const int iseq_size = body->iseq_size;
+ int code_index;
+ VALUE *code = IBF_R(body->iseq_encoded, VALUE, iseq_size);
+
+ struct rb_call_info *ci_entries = iseq->body->ci_entries;
+ struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&iseq->body->ci_entries[iseq->body->ci_size];
+ struct rb_call_cache *cc_entries = iseq->body->cc_entries;
+ union iseq_inline_storage_entry *is_entries = iseq->body->is_entries;
+
+ for (code_index=0; code_index<iseq_size;) {
+ const VALUE insn = code[code_index++];
+ const char *types = insn_op_types(insn);
+ int op_index;
+
+ for (op_index=0; types[op_index]; op_index++, code_index++) {
+ VALUE op = code[code_index];
+
+ switch (types[op_index]) {
+ case TS_CDHASH:
+ case TS_VALUE:
+ code[code_index] = ibf_load_object(load, op);
+ break;
+ case TS_ISEQ:
+ code[code_index] = (VALUE)ibf_load_iseq(load, (const rb_iseq_t *)op);
+ break;
+ case TS_IC:
+ code[code_index] = (VALUE)&is_entries[(int)op];
+ break;
+ case TS_CALLINFO:
+ code[code_index] = op ? (VALUE)ci_kw_entries++ : (VALUE)ci_entries++; /* op is Qtrue (kw) or Qfalse (!kw) */
+ break;
+ case TS_CALLCACHE:
+ code[code_index] = (VALUE)cc_entries++;
+ break;
+ case TS_ID:
+ code[code_index] = ibf_load_id(load, (ID)op);
+ break;
+ case TS_GENTRY:
+ code[code_index] = ibf_load_gentry(load, (const struct rb_global_entry *)op);
+ break;
+ case TS_FUNCPTR:
+ rb_raise(rb_eRuntimeError, "TS_FUNCPTR is not supported");
+ break;
+ default:
+ /* code[code_index] = op; */
+ break;
+ }
+ }
+ assert(insn_len(insn) == op_index+1);
+ };
+
+
+ return code;
+}
+
+static VALUE *
+ibf_dump_param_opt_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ int opt_num = iseq->body->param.opt_num;
+
+ if (opt_num > 0) {
+ return IBF_W(iseq->body->param.opt_table, VALUE, opt_num + 1);
+ }
+ else {
+ return NULL;
+ }
+}
+
+static VALUE *
+ibf_load_param_opt_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
+{
+ int opt_num = body->param.opt_num;
+
+ if (opt_num > 0) {
+ ibf_offset_t offset = IBF_OFFSET(body->param.opt_table);
+ VALUE *table = ALLOC_N(VALUE, opt_num+1);
+ MEMCPY(table, load->buff + offset, VALUE, opt_num+1);
+ return table;
+ }
+ else {
+ return NULL;
+ }
+}
+
+static struct rb_iseq_param_keyword *
+ibf_dump_param_keyword(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ const struct rb_iseq_param_keyword *kw = iseq->body->param.keyword;
+
+ if (kw) {
+ struct rb_iseq_param_keyword dump_kw = *kw;
+ int dv_num = kw->num - kw->required_num;
+ ID *ids = kw->num > 0 ? ALLOCA_N(ID, kw->num) : NULL;
+ VALUE *dvs = dv_num > 0 ? ALLOCA_N(VALUE, dv_num) : NULL;
+ int i;
+
+ for (i=0; i<kw->num; i++) ids[i] = (ID)ibf_dump_id(dump, kw->table[i]);
+ for (i=0; i<dv_num; i++) dvs[i] = (VALUE)ibf_dump_object(dump, kw->default_values[i]);
+
+ dump_kw.table = IBF_W(ids, ID, kw->num);
+ dump_kw.default_values = IBF_W(dvs, VALUE, dv_num);
+ return IBF_W(&dump_kw, struct rb_iseq_param_keyword, 1);
+ }
+ else {
+ return NULL;
+ }
+}
+
+static const struct rb_iseq_param_keyword *
+ibf_load_param_keyword(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
+{
+ if (body->param.keyword) {
+ struct rb_iseq_param_keyword *kw = IBF_R(body->param.keyword, struct rb_iseq_param_keyword, 1);
+ ID *ids = IBF_R(kw->table, ID, kw->num);
+ int dv_num = kw->num - kw->required_num;
+ VALUE *dvs = IBF_R(kw->default_values, VALUE, dv_num);
+ int i;
+
+ for (i=0; i<kw->num; i++) {
+ ids[i] = ibf_load_id(load, ids[i]);
+ }
+ for (i=0; i<dv_num; i++) {
+ dvs[i] = ibf_load_object(load, dvs[i]);
+ }
+
+ kw->table = ids;
+ kw->default_values = dvs;
+ return kw;
+ }
+ else {
+ return NULL;
+ }
+}
+
+static struct iseq_line_info_entry *
+ibf_dump_line_info_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ return IBF_W(iseq->body->line_info_table, struct iseq_line_info_entry, iseq->body->line_info_size);
+}
+
+static struct iseq_line_info_entry *
+ibf_load_line_info_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
+{
+ return IBF_R(body->line_info_table, struct iseq_line_info_entry, body->line_info_size);
+}
+
+static ID *
+ibf_dump_local_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ const int size = iseq->body->local_size - 1;
+ ID *table = ALLOCA_N(ID, size);
+ int i;
+
+ for (i=0; i<size; i++) {
+ table[i] = ibf_dump_id(dump, iseq->body->local_table[i]);
+ }
+
+ return IBF_W(table, ID, size);
+}
+
+static ID *
+ibf_load_local_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
+{
+ const int size = body->local_size - 1;
+
+ if (size > 0) {
+ ID *table = IBF_R(body->local_table, ID, size);
+ int i;
+
+ for (i=0; i<size; i++) {
+ table[i] = ibf_load_id(load, table[i]);
+ }
+ return table;
+ }
+ else {
+ return NULL;
+ }
+}
+
+static struct iseq_catch_table *
+ibf_dump_catch_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ const struct iseq_catch_table *table = iseq->body->catch_table;
+
+ if (table) {
+ int byte_size = iseq_catch_table_bytes(iseq->body->catch_table->size);
+ struct iseq_catch_table *dump_table = (struct iseq_catch_table *)ALLOCA_N(char, byte_size);
+ unsigned int i;
+ dump_table->size = table->size;
+ for (i=0; i<table->size; i++) {
+ dump_table->entries[i] = table->entries[i];
+ dump_table->entries[i].iseq = ibf_dump_iseq(dump, table->entries[i].iseq);
+ }
+ return (struct iseq_catch_table *)(VALUE)ibf_dump_write(dump, dump_table, byte_size);
+ }
+ else {
+ return NULL;
+ }
+}
+
+static struct iseq_catch_table *
+ibf_load_catch_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
+{
+ if (body->catch_table) {
+ struct iseq_catch_table *table;
+ unsigned int i;
+ unsigned int size;
+ size = *(unsigned int *)(load->buff + IBF_OFFSET(body->catch_table));
+ table = ibf_load_alloc(load, IBF_OFFSET(body->catch_table), iseq_catch_table_bytes(size));
+ for (i=0; i<size; i++) {
+ table->entries[i].iseq = ibf_load_iseq(load, table->entries[i].iseq);
+ }
+ return table;
+ }
+ else {
+ return NULL;
+ }
+}
+
+static struct rb_call_info *
+ibf_dump_ci_entries(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ const unsigned int ci_size = iseq->body->ci_size;
+ const unsigned int ci_kw_size = iseq->body->ci_kw_size;
+ const struct rb_call_info *ci_entries = iseq->body->ci_entries;
+ struct rb_call_info *dump_ci_entries;
+ struct rb_call_info_with_kwarg *dump_ci_kw_entries;
+ int byte_size = ci_size * sizeof(struct rb_call_info) +
+ ci_kw_size * sizeof(struct rb_call_info_with_kwarg);
+ unsigned int i;
+
+ dump_ci_entries = (struct rb_call_info *)ALLOCA_N(char, byte_size);
+ dump_ci_kw_entries = (struct rb_call_info_with_kwarg *)&dump_ci_entries[ci_size];
+ memcpy(dump_ci_entries, ci_entries, byte_size);
+
+ for (i=0; i<ci_size; i++) { /* conver ID for each ci */
+ dump_ci_entries[i].mid = ibf_dump_id(dump, dump_ci_entries[i].mid);
+ }
+ for (i=0; i<ci_kw_size; i++) {
+ const struct rb_call_info_kw_arg *kw_arg = dump_ci_kw_entries[i].kw_arg;
+ int j;
+ VALUE *keywords = ALLOCA_N(VALUE, kw_arg->keyword_len);
+ for (j=0; j<kw_arg->keyword_len; j++) {
+ keywords[j] = (VALUE)ibf_dump_object(dump, kw_arg->keywords[j]); /* kw_arg->keywords[n] is Symbol */
+ }
+ dump_ci_kw_entries[i].kw_arg = (struct rb_call_info_kw_arg *)(VALUE)ibf_dump_write(dump, &kw_arg->keyword_len, sizeof(int));
+ ibf_dump_write(dump, keywords, sizeof(VALUE) * kw_arg->keyword_len);
+
+ dump_ci_kw_entries[i].ci.mid = ibf_dump_id(dump, dump_ci_kw_entries[i].ci.mid);
+ }
+ return (struct rb_call_info *)(VALUE)ibf_dump_write(dump, dump_ci_entries, byte_size);
+}
+
+static struct rb_call_info *
+ibf_load_ci_entries(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
+{
+ unsigned int i;
+ const unsigned int ci_size = body->ci_size;
+ const unsigned int ci_kw_size = body->ci_kw_size;
+ struct rb_call_info *ci_entries = ibf_load_alloc(load, IBF_OFFSET(body->ci_entries),
+ sizeof(struct rb_call_info) * body->ci_size +
+ sizeof(struct rb_call_info_with_kwarg) * body->ci_kw_size);
+ struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&ci_entries[ci_size];
+
+ for (i=0; i<ci_size; i++) {
+ ci_entries[i].mid = ibf_load_id(load, ci_entries[i].mid);
+ }
+ for (i=0; i<ci_kw_size; i++) {
+ int j;
+ ibf_offset_t kw_arg_offset = IBF_OFFSET(ci_kw_entries[i].kw_arg);
+ const int keyword_len = *(int *)(load->buff + kw_arg_offset);
+ const VALUE *keywords = (VALUE *)(load->buff + kw_arg_offset + sizeof(int));
+ struct rb_call_info_kw_arg *kw_arg = ruby_xmalloc(sizeof(struct rb_call_info_kw_arg) + sizeof(VALUE) * (keyword_len - 1));
+ kw_arg->keyword_len = keyword_len;
+ for (j=0; j<kw_arg->keyword_len; j++) {
+ kw_arg->keywords[j] = (VALUE)ibf_load_object(load, keywords[j]);
+ }
+ ci_kw_entries[i].kw_arg = kw_arg;
+ ci_kw_entries[i].ci.mid = ibf_load_id(load, ci_kw_entries[i].ci.mid);
+ }
+
+ return ci_entries;
+}
+
+static ibf_offset_t
+ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ struct rb_iseq_constant_body dump_body;
+ dump_body = *iseq->body;
+
+ dump_body.location.path = ibf_dump_object(dump, dump_body.location.path);
+ dump_body.location.absolute_path = ibf_dump_object(dump, dump_body.location.absolute_path);
+ dump_body.location.base_label = ibf_dump_object(dump, dump_body.location.base_label);
+ dump_body.location.label = ibf_dump_object(dump, dump_body.location.label);
+
+ dump_body.iseq_encoded = ibf_dump_code(dump, iseq);
+ dump_body.param.opt_table = ibf_dump_param_opt_table(dump, iseq);
+ dump_body.param.keyword = ibf_dump_param_keyword(dump, iseq);
+ dump_body.line_info_table = ibf_dump_line_info_table(dump, iseq);
+ dump_body.local_table = ibf_dump_local_table(dump, iseq);
+ dump_body.catch_table = ibf_dump_catch_table(dump, iseq);
+ dump_body.parent_iseq = ibf_dump_iseq(dump, iseq->body->parent_iseq);
+ dump_body.local_iseq = ibf_dump_iseq(dump, iseq->body->local_iseq);
+ dump_body.is_entries = NULL;
+ dump_body.ci_entries = ibf_dump_ci_entries(dump, iseq);
+ dump_body.cc_entries = NULL;
+ dump_body.mark_ary = ISEQ_FLIP_CNT(iseq);
+
+ return ibf_dump_write(dump, &dump_body, sizeof(dump_body));
+}
+
+static VALUE
+ibf_load_location_str(const struct ibf_load *load, VALUE str_index)
+{
+ VALUE str = ibf_load_object(load, str_index);
+ if (str != Qnil) {
+ str = rb_fstring(str);
+ }
+ return str;
+}
+
+static void
+ibf_load_iseq_each(const struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
+{
+ struct rb_iseq_constant_body *load_body = iseq->body = ZALLOC(struct rb_iseq_constant_body);
+ const struct rb_iseq_constant_body *body = (struct rb_iseq_constant_body *)(load->buff + offset);
+
+ /* memcpy(load_body, load->buff + offset, sizeof(*load_body)); */
+ load_body->type = body->type;
+ load_body->stack_max = body->stack_max;
+ load_body->local_size = body->local_size;
+ load_body->iseq_size = body->iseq_size;
+ load_body->param = body->param;
+ load_body->local_table_size = body->local_table_size;
+ load_body->is_size = body->is_size;
+ load_body->ci_size = body->ci_size;
+ load_body->ci_kw_size = body->ci_kw_size;
+ load_body->line_info_size = body->line_info_size;
+
+ RB_OBJ_WRITE(iseq, &load_body->mark_ary, iseq_mark_ary_create((int)body->mark_ary));
+
+ RB_OBJ_WRITE(iseq, &load_body->location.path, ibf_load_location_str(load, body->location.path));
+ RB_OBJ_WRITE(iseq, &load_body->location.absolute_path, ibf_load_location_str(load, body->location.absolute_path));
+ RB_OBJ_WRITE(iseq, &load_body->location.base_label, ibf_load_location_str(load, body->location.base_label));
+ RB_OBJ_WRITE(iseq, &load_body->location.label, ibf_load_location_str(load, body->location.label));
+ load_body->location.first_lineno = body->location.first_lineno;
+
+ load_body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, body->is_size);
+ load_body->ci_entries = ibf_load_ci_entries(load, body);
+ load_body->cc_entries = ZALLOC_N(struct rb_call_cache, body->ci_size + body->ci_kw_size);
+ load_body->param.opt_table = ibf_load_param_opt_table(load, body);
+ load_body->param.keyword = ibf_load_param_keyword(load, body);
+ load_body->line_info_table = ibf_load_line_info_table(load, body);
+ load_body->local_table = ibf_load_local_table(load, body);
+ load_body->catch_table = ibf_load_catch_table(load, body);
+ load_body->parent_iseq = ibf_load_iseq(load, body->parent_iseq);
+ load_body->local_iseq = ibf_load_iseq(load, body->local_iseq);
+
+ load_body->iseq_encoded = ibf_load_code(load, iseq, body);
+
+ rb_iseq_translate_threaded_code(iseq);
+}
+
+
+static void
+ibf_dump_iseq_list(struct ibf_dump *dump, struct ibf_header *header)
+{
+ const long size = RARRAY_LEN(dump->iseq_list);
+ ibf_offset_t *list = ALLOCA_N(ibf_offset_t, size);
+ long i;
+
+ for (i=0; i<size; i++) {
+ list[i] = (ibf_offset_t)NUM2LONG(rb_ary_entry(dump->iseq_list, i));
+ }
+
+ header->iseq_list_offset = ibf_dump_write(dump, list, sizeof(ibf_offset_t) * size);
+ header->iseq_list_size = (unsigned int)size;
+}
+
+struct ibf_dump_id_list_i_arg {
+ struct ibf_dump *dump;
+ long *list;
+ int current_i;
+};
+
+static int
+ibf_dump_id_list_i(st_data_t key, st_data_t val, st_data_t ptr)
+{
+ struct ibf_dump_id_list_i_arg *arg = (struct ibf_dump_id_list_i_arg *)ptr;
+ int i = (int)val;
+ ID id = (ID)key;
+ assert(arg->current_i == i);
+ arg->current_i++;
+
+ if (rb_id2name(id)) {
+ arg->list[i] = (long)ibf_dump_object(arg->dump, rb_id2str(id));
+ }
+ else {
+ arg->list[i] = 0;
+ }
+
+ return ST_CONTINUE;
+}
+
+static void
+ibf_dump_id_list(struct ibf_dump *dump, struct ibf_header *header)
+{
+ const long size = dump->id_table->num_entries;
+ struct ibf_dump_id_list_i_arg arg;
+ arg.list = ALLOCA_N(long, size);
+ arg.dump = dump;
+ arg.current_i = 0;
+
+ st_foreach(dump->id_table, ibf_dump_id_list_i, (st_data_t)&arg);
+
+ header->id_list_offset = ibf_dump_write(dump, arg.list, sizeof(long) * size);
+ header->id_list_size = (unsigned int)size;
+}
+
+#define IBF_OBJECT_INTERNAL FL_PROMOTED0
+
+/*
+ * Binary format
+ * - ibf_object_header
+ * - ibf_object_xxx (xxx is type)
+ */
+
+struct ibf_object_header {
+ unsigned int type: 5;
+ unsigned int special_const: 1;
+ unsigned int frozen: 1;
+ unsigned int internal: 1;
+};
+
+enum ibf_object_class_index {
+ IBF_OBJECT_CLASS_OBJECT,
+ IBF_OBJECT_CLASS_ARRAY,
+ IBF_OBJECT_CLASS_STANDARD_ERROR
+};
+
+struct ibf_object_string {
+ long encindex;
+ long len;
+ char ptr[1];
+};
+
+struct ibf_object_regexp {
+ long srcstr;
+ char option;
+};
+
+struct ibf_object_array {
+ long len;
+ long ary[1];
+};
+
+struct ibf_object_hash {
+ long len;
+ long keyval[1];
+};
+
+struct ibf_object_struct_range {
+ long class_index;
+ long len;
+ long beg;
+ long end;
+ int excl;
+};
+
+struct ibf_object_bignum {
+ ssize_t slen;
+ BDIGIT digits[1];
+};
+
+enum ibf_object_data_type {
+ IBF_OBJECT_DATA_ENCODING
+};
+
+struct ibf_object_complex_rational {
+ long a, b;
+};
+
+struct ibf_object_symbol {
+ long str;
+};
+
+#define IBF_OBJHEADER(offset) (struct ibf_object_header *)(load->buff + (offset))
+#define IBF_OBJBODY(type, offset) (type *)(load->buff + sizeof(struct ibf_object_header) + (offset))
+
+static void
+ibf_dump_object_unsupported(struct ibf_dump *dump, VALUE obj)
+{
+ rb_obj_info_dump(obj);
+ rb_bug("ibf_dump_object_unsupported: unsupported");
+}
+
+static VALUE
+ibf_load_object_unsupported(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ rb_bug("unsupported");
+ return Qnil;
+}
+
+static void
+ibf_dump_object_class(struct ibf_dump *dump, VALUE obj)
+{
+ enum ibf_object_class_index cindex;
+ if (obj == rb_cObject) {
+ cindex = IBF_OBJECT_CLASS_OBJECT;
+ }
+ else if (obj == rb_cArray) {
+ cindex = IBF_OBJECT_CLASS_ARRAY;
+ }
+ else if (obj == rb_eStandardError) {
+ cindex = IBF_OBJECT_CLASS_STANDARD_ERROR;
+ }
+ else {
+ rb_obj_info_dump(obj);
+ rb_p(obj);
+ rb_bug("unsupported class");
+ }
+ ibf_dump_write(dump, &cindex, sizeof(cindex));
+}
+
+static VALUE
+ibf_load_object_class(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ enum ibf_object_class_index *cindexp = IBF_OBJBODY(enum ibf_object_class_index, offset);
+ enum ibf_object_class_index cindex = *cindexp;
+
+ switch (cindex) {
+ case IBF_OBJECT_CLASS_OBJECT:
+ return rb_cObject;
+ case IBF_OBJECT_CLASS_ARRAY:
+ return rb_cArray;
+ case IBF_OBJECT_CLASS_STANDARD_ERROR:
+ return rb_eStandardError;
+ }
+
+ rb_bug("ibf_load_object_class: unknown class (%d)", (int)cindex);
+}
+
+
+static void
+ibf_dump_object_float(struct ibf_dump *dump, VALUE obj)
+{
+ double dbl = RFLOAT_VALUE(obj);
+ ibf_dump_write(dump, &dbl, sizeof(dbl));
+}
+
+static VALUE
+ibf_load_object_float(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ double *dblp = IBF_OBJBODY(double, offset);
+ return DBL2NUM(*dblp);
+}
+
+static void
+ibf_dump_object_string(struct ibf_dump *dump, VALUE obj)
+{
+ long encindex = (long)rb_enc_get_index(obj);
+ long len = RSTRING_LEN(obj);
+ const char *ptr = RSTRING_PTR(obj);
+
+ if (encindex > RUBY_ENCINDEX_BUILTIN_MAX) {
+ rb_encoding *enc = rb_enc_from_index((int)encindex);
+ const char *enc_name = rb_enc_name(enc);
+ encindex = RUBY_ENCINDEX_BUILTIN_MAX + ibf_dump_object(dump, rb_str_new2(enc_name));
+ }
+
+ IBF_WV(encindex);
+ IBF_WV(len);
+ IBF_WP(ptr, char, len);
+}
+
+static VALUE
+ibf_load_object_string(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const struct ibf_object_string *string = IBF_OBJBODY(struct ibf_object_string, offset);
+ VALUE str = rb_str_new(string->ptr, string->len);
+ int encindex = (int)string->encindex;
+
+ if (encindex > RUBY_ENCINDEX_BUILTIN_MAX) {
+ VALUE enc_name_str = ibf_load_object(load, encindex - RUBY_ENCINDEX_BUILTIN_MAX);
+ encindex = rb_enc_find_index(RSTRING_PTR(enc_name_str));
+ }
+ rb_enc_associate_index(str, encindex);
+
+ if (header->internal) rb_obj_hide(str);
+ if (header->frozen) str = rb_fstring(str);
+
+ return str;
+}
+
+static void
+ibf_dump_object_regexp(struct ibf_dump *dump, VALUE obj)
+{
+ struct ibf_object_regexp regexp;
+ regexp.srcstr = RREGEXP_SRC(obj);
+ regexp.option = (char)rb_reg_options(obj);
+ regexp.srcstr = (long)ibf_dump_object(dump, regexp.srcstr);
+ IBF_WV(regexp);
+}
+
+static VALUE
+ibf_load_object_regexp(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const struct ibf_object_regexp *regexp = IBF_OBJBODY(struct ibf_object_regexp, offset);
+ VALUE srcstr = ibf_load_object(load, regexp->srcstr);
+ VALUE reg = rb_reg_compile(srcstr, (int)regexp->option, NULL, 0);
+
+ if (header->internal) rb_obj_hide(reg);
+ if (header->frozen) rb_obj_freeze(reg);
+
+ return reg;
+}
+
+static void
+ibf_dump_object_array(struct ibf_dump *dump, VALUE obj)
+{
+ long i, len = (int)RARRAY_LEN(obj);
+ IBF_WV(len);
+ for (i=0; i<len; i++) {
+ long index = (long)ibf_dump_object(dump, RARRAY_AREF(obj, i));
+ IBF_WV(index);
+ }
+}
+
+static VALUE
+ibf_load_object_array(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const struct ibf_object_array *array = IBF_OBJBODY(struct ibf_object_array, offset);
+ VALUE ary = rb_ary_new_capa(array->len);
+ int i;
+
+ for (i=0; i<array->len; i++) {
+ rb_ary_push(ary, ibf_load_object(load, array->ary[i]));
+ }
+
+ if (header->internal) rb_obj_hide(ary);
+ if (header->frozen) rb_obj_freeze(ary);
+
+ return ary;
+}
+
+static int
+ibf_dump_object_hash_i(st_data_t key, st_data_t val, st_data_t ptr)
+{
+ struct ibf_dump *dump = (struct ibf_dump *)ptr;
+ long key_index = (long)ibf_dump_object(dump, (VALUE)key);
+ long val_index = (long)ibf_dump_object(dump, (VALUE)val);
+ IBF_WV(key_index);
+ IBF_WV(val_index);
+ return ST_CONTINUE;
+}
+
+static void
+ibf_dump_object_hash(struct ibf_dump *dump, VALUE obj)
+{
+ long len = RHASH_SIZE(obj);
+ IBF_WV(len);
+ if (len > 0) st_foreach(RHASH(obj)->ntbl, ibf_dump_object_hash_i, (st_data_t)dump);
+}
+
+static VALUE
+ibf_load_object_hash(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const struct ibf_object_hash *hash = IBF_OBJBODY(struct ibf_object_hash, offset);
+ VALUE obj = rb_hash_new();
+ int i;
+
+ for (i=0; i<hash->len; i++) {
+ VALUE key = ibf_load_object(load, hash->keyval[i*2 ]);
+ VALUE val = ibf_load_object(load, hash->keyval[i*2+1]);
+ rb_hash_aset(obj, key, val);
+ }
+ rb_hash_rehash(obj);
+
+ if (header->internal) rb_obj_hide(obj);
+ if (header->frozen) rb_obj_freeze(obj);
+
+ return obj;
+}
+
+static void
+ibf_dump_object_struct(struct ibf_dump *dump, VALUE obj)
+{
+ if (rb_obj_is_kind_of(obj, rb_cRange)) {
+ struct ibf_object_struct_range range;
+ VALUE beg, end;
+ range.len = 3;
+ range.class_index = 0;
+
+ rb_range_values(obj, &beg, &end, &range.excl);
+ range.beg = (long)ibf_dump_object(dump, beg);
+ range.end = (long)ibf_dump_object(dump, end);
+
+ IBF_WV(range);
+ }
+ else {
+ rb_bug("ibf_dump_object_struct: unsupported class");
+ }
+}
+
+static VALUE
+ibf_load_object_struct(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const struct ibf_object_struct_range *range = IBF_OBJBODY(struct ibf_object_struct_range, offset);
+ VALUE beg = ibf_load_object(load, range->beg);
+ VALUE end = ibf_load_object(load, range->end);
+ VALUE obj = rb_range_new(beg, end, range->excl);
+ if (header->internal) rb_obj_hide(obj);
+ if (header->frozen) rb_obj_freeze(obj);
+ return obj;
+}
+
+static void
+ibf_dump_object_bignum(struct ibf_dump *dump, VALUE obj)
+{
+ ssize_t len = BIGNUM_LEN(obj);
+ ssize_t slen = BIGNUM_SIGN(obj) > 0 ? len : len * -1;
+ BDIGIT *d = BIGNUM_DIGITS(obj);
+
+ IBF_WV(slen);
+ IBF_WP(d, BDIGIT, len);
+}
+
+static VALUE
+ibf_load_object_bignum(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const struct ibf_object_bignum *bignum = IBF_OBJBODY(struct ibf_object_bignum, offset);
+ int sign = bignum->slen > 0;
+ ssize_t len = sign > 0 ? bignum->slen : -1 * bignum->slen;
+ VALUE obj = rb_integer_unpack(bignum->digits, len * 2, 2, 0,
+ INTEGER_PACK_LITTLE_ENDIAN | (sign == 0 ? INTEGER_PACK_NEGATIVE : 0));
+ if (header->internal) rb_obj_hide(obj);
+ if (header->frozen) rb_obj_freeze(obj);
+ return obj;
+}
+
+static void
+ibf_dump_object_data(struct ibf_dump *dump, VALUE obj)
+{
+ if (rb_data_is_encoding(obj)) {
+ rb_encoding *enc = rb_to_encoding(obj);
+ const char *name = rb_enc_name(enc);
+ enum ibf_object_data_type type = IBF_OBJECT_DATA_ENCODING;
+ long len = strlen(name) + 1;
+ IBF_WV(type);
+ IBF_WV(len);
+ IBF_WP(name, char, strlen(name) + 1);
+ }
+ else {
+ ibf_dump_object_unsupported(dump, obj);
+ }
+}
+
+static VALUE
+ibf_load_object_data(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const enum ibf_object_data_type *typep = IBF_OBJBODY(enum ibf_object_data_type, offset);
+ /* const long *lenp = IBF_OBJBODY(long, offset + sizeof(enum ibf_object_data_type)); */
+ const char *data = IBF_OBJBODY(char, offset + sizeof(enum ibf_object_data_type) + sizeof(long));
+
+ switch (*typep) {
+ case IBF_OBJECT_DATA_ENCODING:
+ {
+ VALUE encobj = rb_enc_from_encoding(rb_enc_find(data));
+ return encobj;
+ }
+ }
+
+ return ibf_load_object_unsupported(load, header, offset);
+}
+
+static void
+ibf_dump_object_complex_rational(struct ibf_dump *dump, VALUE obj)
+{
+ long real = (long)ibf_dump_object(dump, RCOMPLEX(obj)->real);
+ long imag = (long)ibf_dump_object(dump, RCOMPLEX(obj)->imag);
+
+ IBF_WV(real);
+ IBF_WV(imag);
+}
+
+static VALUE
+ibf_load_object_complex_rational(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ const struct ibf_object_complex_rational *nums = IBF_OBJBODY(struct ibf_object_complex_rational, offset);
+ VALUE a = ibf_load_object(load, nums->a);
+ VALUE b = ibf_load_object(load, nums->b);
+ VALUE obj = header->type == T_COMPLEX ?
+ rb_complex_new(a, b) : rb_rational_new(a, b);
+
+ if (header->internal) rb_obj_hide(obj);
+ if (header->frozen) rb_obj_freeze(obj);
+ return obj;
+}
+
+static void
+ibf_dump_object_symbol(struct ibf_dump *dump, VALUE obj)
+{
+ VALUE str = rb_sym2str(obj);
+ long str_index = (long)ibf_dump_object(dump, str);
+ IBF_WV(str_index);
+}
+
+static VALUE
+ibf_load_object_symbol(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
+{
+ /* const struct ibf_object_header *header = IBF_OBJHEADER(offset); */
+ const struct ibf_object_symbol *symbol = IBF_OBJBODY(struct ibf_object_symbol, offset);
+ VALUE str = ibf_load_object(load, symbol->str);
+ ID id = rb_intern_str(str);
+ return ID2SYM(id);
+}
+
+typedef void (*ibf_dump_object_function)(struct ibf_dump *dump, VALUE obj);
+static ibf_dump_object_function dump_object_functions[RUBY_T_MASK+1] = {
+ ibf_dump_object_unsupported, /* T_NONE */
+ ibf_dump_object_unsupported, /* T_OBJECT */
+ ibf_dump_object_class, /* T_CLASS */
+ ibf_dump_object_unsupported, /* T_MODULE */
+ ibf_dump_object_float, /* T_FLOAT */
+ ibf_dump_object_string, /* T_STRING */
+ ibf_dump_object_regexp, /* T_REGEXP */
+ ibf_dump_object_array, /* T_ARRAY */
+ ibf_dump_object_hash, /* T_HASH */
+ ibf_dump_object_struct, /* T_STRUCT */
+ ibf_dump_object_bignum, /* T_BIGNUM */
+ ibf_dump_object_unsupported, /* T_FILE */
+ ibf_dump_object_data, /* T_DATA */
+ ibf_dump_object_unsupported, /* T_MATCH */
+ ibf_dump_object_complex_rational, /* T_COMPLEX */
+ ibf_dump_object_complex_rational, /* T_RATIONAL */
+ ibf_dump_object_unsupported, /* 0x10 */
+ ibf_dump_object_unsupported, /* 0x11 T_NIL */
+ ibf_dump_object_unsupported, /* 0x12 T_TRUE */
+ ibf_dump_object_unsupported, /* 0x13 T_FALSE */
+ ibf_dump_object_symbol, /* 0x14 T_SYMBOL */
+ ibf_dump_object_unsupported, /* T_FIXNUM */
+ ibf_dump_object_unsupported, /* T_UNDEF */
+ ibf_dump_object_unsupported, /* 0x17 */
+ ibf_dump_object_unsupported, /* 0x18 */
+ ibf_dump_object_unsupported, /* 0x19 */
+ ibf_dump_object_unsupported, /* T_IMEMO 0x1a */
+ ibf_dump_object_unsupported, /* T_NODE 0x1b */
+ ibf_dump_object_unsupported, /* T_ICLASS 0x1c */
+ ibf_dump_object_unsupported, /* T_ZOMBIE 0x1d */
+ ibf_dump_object_unsupported, /* 0x1e */
+ ibf_dump_object_unsupported /* 0x1f */
+};
+
+static ibf_offset_t
+lbf_dump_object_object(struct ibf_dump *dump, VALUE obj)
+{
+ struct ibf_object_header obj_header;
+ ibf_offset_t current_offset = ibf_dump_pos(dump);
+ obj_header.type = TYPE(obj);
+
+ if (SPECIAL_CONST_P(obj)) {
+ if (RB_TYPE_P(obj, T_SYMBOL) ||
+ RB_TYPE_P(obj, T_FLOAT)) {
+ obj_header.internal = FALSE;
+ goto dump_object;
+ }
+ obj_header.special_const = TRUE;
+ obj_header.frozen = TRUE;
+ obj_header.internal = TRUE;
+ IBF_WV(obj_header);
+ IBF_WV(obj);
+ }
+ else {
+ obj_header.internal = (RBASIC_CLASS(obj) == 0) ? TRUE : FALSE;
+ dump_object:
+ obj_header.special_const = FALSE;
+ obj_header.frozen = FL_TEST(obj, FL_FREEZE) ? TRUE : FALSE;
+ IBF_WV(obj_header);
+ (*dump_object_functions[obj_header.type])(dump, obj);
+ }
+
+ return current_offset;
+}
+
+typedef VALUE (*ibf_load_object_function)(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t);
+static ibf_load_object_function load_object_functions[RUBY_T_MASK+1] = {
+ ibf_load_object_unsupported, /* T_NONE */
+ ibf_load_object_unsupported, /* T_OBJECT */
+ ibf_load_object_class, /* T_CLASS */
+ ibf_load_object_unsupported, /* T_MODULE */
+ ibf_load_object_float, /* T_FLOAT */
+ ibf_load_object_string, /* T_STRING */
+ ibf_load_object_regexp, /* T_REGEXP */
+ ibf_load_object_array, /* T_ARRAY */
+ ibf_load_object_hash, /* T_HASH */
+ ibf_load_object_struct, /* T_STRUCT */
+ ibf_load_object_bignum, /* T_BIGNUM */
+ ibf_load_object_unsupported, /* T_FILE */
+ ibf_load_object_data, /* T_DATA */
+ ibf_load_object_unsupported, /* T_MATCH */
+ ibf_load_object_complex_rational, /* T_COMPLEX */
+ ibf_load_object_complex_rational, /* T_RATIONAL */
+ ibf_load_object_unsupported, /* 0x10 */
+ ibf_load_object_unsupported, /* T_NIL */
+ ibf_load_object_unsupported, /* T_TRUE */
+ ibf_load_object_unsupported, /* T_FALSE */
+ ibf_load_object_symbol,
+ ibf_load_object_unsupported, /* T_FIXNUM */
+ ibf_load_object_unsupported, /* T_UNDEF */
+ ibf_load_object_unsupported, /* 0x17 */
+ ibf_load_object_unsupported, /* 0x18 */
+ ibf_load_object_unsupported, /* 0x19 */
+ ibf_load_object_unsupported, /* T_IMEMO 0x1a */
+ ibf_load_object_unsupported, /* T_NODE 0x1b */
+ ibf_load_object_unsupported, /* T_ICLASS 0x1c */
+ ibf_load_object_unsupported, /* T_ZOMBIE 0x1d */
+ ibf_load_object_unsupported, /* 0x1e */
+ ibf_load_object_unsupported /* 0x1f */
+};
+
+static VALUE
+ibf_load_object(const struct ibf_load *load, VALUE object_index)
+{
+ if (object_index == 0) {
+ return Qnil;
+ }
+ else if (object_index >= load->header->object_list_size) {
+ rb_raise(rb_eIndexError, "object index out of range: %"PRIdVALUE, object_index);
+ }
+ else {
+ VALUE obj = rb_ary_entry(load->obj_list, (long)object_index);
+ if (obj == Qnil) { /* TODO: avoid multiple Qnil load */
+ ibf_offset_t *offsets = (ibf_offset_t *)(load->header->object_list_offset + load->buff);
+ ibf_offset_t offset = offsets[object_index];
+ const struct ibf_object_header *header = IBF_OBJHEADER(offset);
+
+ if (header->special_const) {
+ VALUE *vp = IBF_OBJBODY(VALUE, offset);
+ obj = *vp;
+ }
+ else {
+ obj = (*load_object_functions[header->type])(load, header, offset);
+ }
+
+ rb_ary_store(load->obj_list, (long)object_index, obj);
+ }
+ iseq_add_mark_object(load->iseq, obj);
+ return obj;
+ }
+}
+
+static void
+ibf_dump_object_list(struct ibf_dump *dump, struct ibf_header *header)
+{
+ VALUE list = rb_ary_tmp_new(RARRAY_LEN(dump->obj_list));
+ int i, size;
+
+ for (i=0; i<RARRAY_LEN(dump->obj_list); i++) {
+ VALUE obj = RARRAY_AREF(dump->obj_list, i);
+ ibf_offset_t offset = lbf_dump_object_object(dump, obj);
+ rb_ary_push(list, UINT2NUM(offset));
+ }
+ size = i;
+ header->object_list_offset = ibf_dump_pos(dump);
+
+ for (i=0; i<size; i++) {
+ ibf_offset_t offset = NUM2UINT(RARRAY_AREF(list, i));
+ IBF_WV(offset);
+ }
+
+ header->object_list_size = size;
+}
+
+static void
+ibf_dump_mark(void *ptr)
+{
+ struct ibf_dump *dump = (struct ibf_dump *)ptr;
+ rb_gc_mark(dump->str);
+ rb_gc_mark(dump->iseq_list);
+ rb_gc_mark(dump->obj_list);
+}
+
+static void
+ibf_dump_free(void *ptr)
+{
+ struct ibf_dump *dump = (struct ibf_dump *)ptr;
+ if (dump->iseq_table) {
+ st_free_table(dump->iseq_table);
+ dump->iseq_table = 0;
+ }
+ if (dump->id_table) {
+ st_free_table(dump->id_table);
+ dump->id_table = 0;
+ }
+ ruby_xfree(dump);
+}
+
+static size_t
+ibf_dump_memsize(const void *ptr)
+{
+ struct ibf_dump *dump = (struct ibf_dump *)ptr;
+ size_t size = sizeof(*dump);
+ if (dump->iseq_table) size += st_memsize(dump->iseq_table);
+ if (dump->id_table) size += st_memsize(dump->id_table);
+ return size;
+}
+
+static const rb_data_type_t ibf_dump_type = {
+ "ibf_dump",
+ {ibf_dump_mark, ibf_dump_free, ibf_dump_memsize,},
+ 0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static void
+ibf_dump_setup(struct ibf_dump *dump, VALUE dumper_obj)
+{
+ RB_OBJ_WRITE(dumper_obj, &dump->str, rb_str_new(0, 0));
+ RB_OBJ_WRITE(dumper_obj, &dump->iseq_list, rb_ary_tmp_new(0));
+ RB_OBJ_WRITE(dumper_obj, &dump->obj_list, rb_ary_tmp_new(1));
+ rb_ary_push(dump->obj_list, Qnil); /* 0th is nil */
+ dump->iseq_table = st_init_numtable(); /* need free */
+ dump->id_table = st_init_numtable(); /* need free */
+
+ ibf_table_index(dump->id_table, 0); /* id_index:0 is 0 */
+}
+
+VALUE
+iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt)
+{
+ struct ibf_dump *dump;
+ struct ibf_header header = {{0}};
+ VALUE dump_obj;
+ VALUE str;
+
+ if (iseq->body->parent_iseq != NULL ||
+ iseq->body->local_iseq != iseq) {
+ rb_raise(rb_eRuntimeError, "should be top of iseq");
+ }
+ if (RTEST(ISEQ_COVERAGE(iseq))) {
+ rb_raise(rb_eRuntimeError, "should not compile with coverage");
+ }
+
+ dump_obj = TypedData_Make_Struct(0, struct ibf_dump, &ibf_dump_type, dump);
+ ibf_dump_setup(dump, dump_obj);
+
+ ibf_dump_write(dump, &header, sizeof(header));
+ ibf_dump_write(dump, RUBY_PLATFORM, strlen(RUBY_PLATFORM) + 1);
+ ibf_dump_iseq(dump, iseq);
+
+ header.magic[0] = 'Y'; /* YARB */
+ header.magic[1] = 'A';
+ header.magic[2] = 'R';
+ header.magic[3] = 'B';
+ header.major_version = ISEQ_MAJOR_VERSION;
+ header.minor_version = ISEQ_MINOR_VERSION;
+ ibf_dump_iseq_list(dump, &header);
+ ibf_dump_id_list(dump, &header);
+ ibf_dump_object_list(dump, &header);
+ header.size = ibf_dump_pos(dump);
+
+ if (RTEST(opt)) {
+ VALUE opt_str = opt;
+ const char *ptr = StringValuePtr(opt_str);
+ header.extra_size = RSTRING_LENINT(opt_str);
+ ibf_dump_write(dump, ptr, header.extra_size);
+ }
+ else {
+ header.extra_size = 0;
+ }
+
+ ibf_dump_overwrite(dump, &header, sizeof(header), 0);
+
+ str = dump->str;
+ ibf_dump_free(dump);
+ DATA_PTR(dump_obj) = NULL;
+ RB_GC_GUARD(dump_obj);
+ return str;
+}
+
+static const ibf_offset_t *
+ibf_iseq_list(const struct ibf_load *load)
+{
+ return (ibf_offset_t *)(load->buff + load->header->iseq_list_offset);
+}
+
+void
+ibf_load_iseq_complete(rb_iseq_t *iseq)
+{
+ struct ibf_load *load = RTYPEDDATA_DATA(iseq->aux.loader.obj);
+ rb_iseq_t *prev_src_iseq = load->iseq;
+ load->iseq = iseq;
+ ibf_load_iseq_each(load, iseq, ibf_iseq_list(load)[iseq->aux.loader.index]);
+ ISEQ_COMPILE_DATA(iseq) = NULL;
+ FL_UNSET(iseq, ISEQ_NOT_LOADED_YET);
+ load->iseq = prev_src_iseq;
+}
+
+#if USE_LAZY_LOAD
+const rb_iseq_t *
+rb_iseq_complete(const rb_iseq_t *iseq)
+{
+ ibf_load_iseq_complete((rb_iseq_t *)iseq);
+ return iseq;
+}
+#endif
+
+static rb_iseq_t *
+ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq)
+{
+ int iseq_index = (int)(VALUE)index_iseq;
+
+ if (iseq_index == -1) {
+ return NULL;
+ }
+ else {
+ VALUE iseqv = rb_ary_entry(load->iseq_list, iseq_index);
+
+ if (iseqv != Qnil) {
+ return (rb_iseq_t *)iseqv;
+ }
+ else {
+ rb_iseq_t *iseq = iseq_imemo_alloc();
+ FL_SET(iseq, ISEQ_NOT_LOADED_YET);
+ iseq->aux.loader.obj = load->loader_obj;
+ iseq->aux.loader.index = iseq_index;
+ rb_ary_store(load->iseq_list, iseq_index, (VALUE)iseq);
+
+#if !USE_LAZY_LOAD
+ ibf_load_iseq_complete(iseq);
+#endif /* !USE_LAZY_LOAD */
+
+ if (load->iseq) {
+ iseq_add_mark_object(load->iseq, (VALUE)iseq);
+ }
+ return iseq;
+ }
+ }
+}
+
+static void
+ibf_load_setup(struct ibf_load *load, VALUE loader_obj, VALUE str)
+{
+ rb_check_safe_obj(str);
+
+ if (RSTRING_LENINT(str) < (int)sizeof(struct ibf_header)) {
+ rb_raise(rb_eRuntimeError, "broken binary format");
+ }
+ RB_OBJ_WRITE(loader_obj, &load->str, str);
+ load->loader_obj = loader_obj;
+ load->buff = StringValuePtr(str);
+ load->header = (struct ibf_header *)load->buff;
+ RB_OBJ_WRITE(loader_obj, &load->iseq_list, rb_ary_tmp_new(0));
+ RB_OBJ_WRITE(loader_obj, &load->obj_list, rb_ary_tmp_new(0));
+ load->id_list = ZALLOC_N(ID, load->header->id_list_size);
+ load->iseq = NULL;
+
+ if (RSTRING_LENINT(str) < (int)load->header->size) {
+ rb_raise(rb_eRuntimeError, "broken binary format");
+ }
+ if (strncmp(load->header->magic, "YARB", 4) != 0) {
+ rb_raise(rb_eRuntimeError, "unknown binary format");
+ }
+ if (load->header->major_version != ISEQ_MAJOR_VERSION ||
+ load->header->minor_version != ISEQ_MINOR_VERSION) {
+ rb_raise(rb_eRuntimeError, "unmatched version file (%u.%u for %u.%u)",
+ load->header->major_version, load->header->minor_version, ISEQ_MAJOR_VERSION, ISEQ_MINOR_VERSION);
+ }
+ if (strcmp(load->buff + sizeof(struct ibf_header), RUBY_PLATFORM) != 0) {
+ rb_raise(rb_eRuntimeError, "unmatched platform");
+ }
+}
+
+static void
+ibf_loader_mark(void *ptr)
+{
+ if (ptr) {
+ struct ibf_load *load = (struct ibf_load *)ptr;
+ rb_gc_mark(load->str);
+ rb_gc_mark(load->iseq_list);
+ rb_gc_mark(load->obj_list);
+ }
+}
+
+static void
+ibf_loader_free(void *ptr)
+{
+ if (ptr) {
+ struct ibf_load *load = (struct ibf_load *)ptr;
+ ruby_xfree(load->id_list);
+ ruby_xfree(load);
+ }
+}
+
+static size_t
+ibf_loader_memsize(const void *ptr)
+{
+ struct ibf_load *load = (struct ibf_load *)ptr;
+ return sizeof(struct ibf_load) + load->header->id_list_size * sizeof(ID);
+}
+
+static const rb_data_type_t ibf_load_type = {
+ "ibf_loader",
+ {ibf_loader_mark, ibf_loader_free, ibf_loader_memsize,},
+ 0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+const rb_iseq_t *
+iseq_ibf_load(VALUE str)
+{
+ struct ibf_load *load;
+ const rb_iseq_t *iseq;
+ VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load);
+
+ ibf_load_setup(load, loader_obj, str);
+ iseq = ibf_load_iseq(load, 0);
+
+ RB_GC_GUARD(loader_obj);
+ return iseq;
+}
+
+VALUE
+iseq_ibf_load_extra_data(VALUE str)
+{
+ struct ibf_load *load;
+ VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load);
+ VALUE extra_str;
+
+ ibf_load_setup(load, loader_obj, str);
+ extra_str = rb_str_new(load->buff + load->header->size, load->header->extra_size);
+ RB_GC_GUARD(loader_obj);
+ return extra_str;
+}
+
diff --git a/complex.c b/complex.c
index 3e9d63117a..5199dcc7c2 100644
--- a/complex.c
+++ b/complex.c
@@ -5,9 +5,13 @@
which is written in ruby.
*/
-#include "ruby.h"
-#include "internal.h"
+#include "ruby/config.h"
+#if defined _MSC_VER
+/* Microsoft Visual C does not define M_PI and others by default */
+# define _USE_MATH_DEFINES 1
+#endif
#include <math.h>
+#include "internal.h"
#define NDEBUG
#include <assert.h>
@@ -15,13 +19,21 @@
#define ZERO INT2FIX(0)
#define ONE INT2FIX(1)
#define TWO INT2FIX(2)
+#define RFLOAT_0 DBL2NUM(0)
+#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
+ !defined(signbit)
+extern int signbit(double);
+#endif
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,
+static VALUE nucomp_abs(VALUE self);
+static VALUE nucomp_arg(VALUE self);
+
+static ID id_abs, id_arg, id_convert,
+ id_denominator, id_eqeq_p, id_expt, id_fdiv,
+ id_negate, id_numerator, id_quo,
+ id_real_p, id_to_f, id_to_i, id_to_r,
id_i_real, id_i_imag;
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
@@ -76,20 +88,6 @@ f_add(VALUE x, VALUE y)
}
inline static VALUE
-f_cmp(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y)) {
- long c = FIX2LONG(x) - FIX2LONG(y);
- if (c > 0)
- c = 1;
- else if (c < 0)
- c = -1;
- return INT2FIX(c);
- }
- return rb_funcall(x, id_cmp, 1, y);
-}
-
-inline static VALUE
f_div(VALUE x, VALUE y)
{
if (FIXNUM_P(y) && FIX2LONG(y) == 1)
@@ -106,16 +104,6 @@ f_gt_p(VALUE x, VALUE y)
}
inline static VALUE
-f_lt_p(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return f_boolcast(FIX2LONG(x) < FIX2LONG(y));
- return rb_funcall(x, '<', 1, y);
-}
-
-binop(mod, '%')
-
-inline static VALUE
f_mul(VALUE x, VALUE y)
{
#ifndef PRESERVE_SIGNEDZERO
@@ -152,16 +140,10 @@ f_sub(VALUE x, VALUE y)
}
fun1(abs)
-fun1(abs2)
fun1(arg)
-fun1(conj)
fun1(denominator)
-fun1(floor)
-fun1(imag)
-fun1(inspect)
fun1(negate)
fun1(numerator)
-fun1(real)
fun1(real_p)
inline static VALUE
@@ -180,9 +162,6 @@ f_to_f(VALUE x)
}
fun1(to_r)
-fun1(to_s)
-
-fun2(divmod)
inline static VALUE
f_eqeq_p(VALUE x, VALUE y)
@@ -194,7 +173,6 @@ f_eqeq_p(VALUE x, VALUE y)
fun2(expt)
fun2(fdiv)
-fun2(idiv)
fun2(quo)
inline static VALUE
@@ -258,12 +236,6 @@ k_numeric_p(VALUE x)
}
inline static VALUE
-k_integer_p(VALUE x)
-{
- return f_kind_of_p(x, rb_cInteger);
-}
-
-inline static VALUE
k_fixnum_p(VALUE x)
{
return f_kind_of_p(x, rb_cFixnum);
@@ -294,10 +266,8 @@ k_complex_p(VALUE x)
}
#define k_exact_p(x) (!k_float_p(x))
-#define k_inexact_p(x) k_float_p(x)
#define k_exact_zero_p(x) (k_exact_p(x) && f_zero_p(x))
-#define k_exact_one_p(x) (k_exact_p(x) && f_one_p(x))
#define get_dat1(x) \
struct RComplex *dat;\
@@ -376,6 +346,8 @@ nucomp_canonicalization(int f)
{
canonicalization = f;
}
+#else
+#define canonicalization 0
#endif
inline static void
@@ -457,13 +429,6 @@ nucomp_s_new(int argc, VALUE *argv, VALUE klass)
}
inline static VALUE
-f_complex_new1(VALUE klass, VALUE x)
-{
- assert(!k_complex_p(x));
- return nucomp_s_canonicalize_internal(klass, x, ZERO);
-}
-
-inline static VALUE
f_complex_new2(VALUE klass, VALUE x, VALUE y)
{
assert(!k_complex_p(x));
@@ -478,6 +443,8 @@ f_complex_new2(VALUE klass, VALUE x, VALUE y)
*
* Complex(1, 2) #=> (1+2i)
* Complex('1+2i') #=> (1+2i)
+ * Complex(nil) #=> TypeError
+ * Complex(1, nil) #=> TypeError
*
* Syntax of string form:
*
@@ -537,7 +504,6 @@ m_log_bang(VALUE x)
imp1(sin)
imp1(sinh)
-imp1(sqrt)
static VALUE
m_cos(VALUE x)
@@ -570,6 +536,8 @@ m_sin(VALUE x)
}
#if 0
+imp1(sqrt)
+
static VALUE
m_sqrt(VALUE x)
{
@@ -593,11 +561,44 @@ m_sqrt(VALUE x)
}
#endif
-inline static VALUE
+static VALUE
f_complex_polar(VALUE klass, VALUE x, VALUE y)
{
assert(!k_complex_p(x));
assert(!k_complex_p(y));
+ if (f_zero_p(x) || f_zero_p(y)) {
+ if (canonicalization) return x;
+ return nucomp_s_new_internal(klass, x, RFLOAT_0);
+ }
+ if (RB_FLOAT_TYPE_P(y)) {
+ const double arg = RFLOAT_VALUE(y);
+ if (arg == M_PI) {
+ x = f_negate(x);
+ if (canonicalization) return x;
+ y = RFLOAT_0;
+ }
+ else if (arg == M_PI_2) {
+ y = x;
+ x = RFLOAT_0;
+ }
+ else if (arg == M_PI_2+M_PI) {
+ y = f_negate(x);
+ x = RFLOAT_0;
+ }
+ else if (RB_FLOAT_TYPE_P(x)) {
+ const double abs = RFLOAT_VALUE(x);
+ const double real = abs * cos(arg), imag = abs * sin(arg);
+ x = DBL2NUM(real);
+ if (canonicalization && imag == 0.0) return x;
+ y = DBL2NUM(imag);
+ }
+ else {
+ y = f_mul(x, DBL2NUM(sin(arg)));
+ x = f_mul(x, DBL2NUM(cos(arg)));
+ if (canonicalization && f_zero_p(y)) return x;
+ }
+ return nucomp_s_new_internal(klass, x, y);
+ }
return nucomp_s_canonicalize_internal(klass,
f_mul(x, m_cos(y)),
f_mul(x, m_sin(y)));
@@ -622,8 +623,8 @@ nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
switch (rb_scan_args(argc, argv, "11", &abs, &arg)) {
case 1:
nucomp_real_check(abs);
- arg = ZERO;
- break;
+ if (canonicalization) return abs;
+ return nucomp_s_new_internal(klass, abs, ZERO);
default:
nucomp_real_check(abs);
nucomp_real_check(arg);
@@ -716,11 +717,12 @@ f_addsub(VALUE self, VALUE other,
* Complex(9, 8) + 4 #=> (13+8i)
* Complex(20, 9) + 9.8 #=> (29.8+9i)
*/
-static VALUE
-nucomp_add(VALUE self, VALUE other)
+VALUE
+rb_nucomp_add(VALUE self, VALUE other)
{
return f_addsub(self, other, f_add, '+');
}
+#define nucomp_add rb_nucomp_add
/*
* call-seq:
@@ -740,6 +742,19 @@ nucomp_sub(VALUE self, VALUE other)
return f_addsub(self, other, f_sub, '-');
}
+static VALUE
+safe_mul(VALUE a, VALUE b, int az, int bz)
+{
+ double v;
+ if (!az && bz && RB_FLOAT_TYPE_P(a) && (v = RFLOAT_VALUE(a), !isnan(v))) {
+ a = signbit(v) ? DBL2NUM(-1.0) : DBL2NUM(1.0);
+ }
+ if (!bz && az && RB_FLOAT_TYPE_P(b) && (v = RFLOAT_VALUE(b), !isnan(v))) {
+ b = signbit(v) ? DBL2NUM(-1.0) : DBL2NUM(1.0);
+ }
+ return f_mul(a, b);
+}
+
/*
* call-seq:
* cmp * numeric -> complex
@@ -752,18 +767,24 @@ nucomp_sub(VALUE self, VALUE other)
* Complex(9, 8) * 4 #=> (36+32i)
* Complex(20, 9) * 9.8 #=> (196.0+88.2i)
*/
-static VALUE
-nucomp_mul(VALUE self, VALUE other)
+VALUE
+rb_nucomp_mul(VALUE self, VALUE other)
{
if (k_complex_p(other)) {
VALUE real, imag;
+ VALUE areal, aimag, breal, bimag;
+ int arzero, aizero, brzero, bizero;
get_dat2(self, other);
- real = f_sub(f_mul(adat->real, bdat->real),
- f_mul(adat->imag, bdat->imag));
- imag = f_add(f_mul(adat->real, bdat->imag),
- f_mul(adat->imag, bdat->real));
+ arzero = !!f_zero_p(areal = adat->real);
+ aizero = !!f_zero_p(aimag = adat->imag);
+ brzero = !!f_zero_p(breal = bdat->real);
+ bizero = !!f_zero_p(bimag = bdat->imag);
+ real = f_sub(safe_mul(areal, breal, arzero, brzero),
+ safe_mul(aimag, bimag, aizero, bizero));
+ imag = f_add(safe_mul(areal, bimag, arzero, bizero),
+ safe_mul(aimag, breal, aizero, brzero));
return f_complex_new2(CLASS_OF(self), real, imag);
}
@@ -776,6 +797,7 @@ nucomp_mul(VALUE self, VALUE other)
}
return rb_num_coerce_bin(self, other, '*');
}
+#define nucomp_mul rb_nucomp_mul
inline static VALUE
f_divide(VALUE self, VALUE other,
@@ -998,8 +1020,8 @@ nucomp_coerce(VALUE self, VALUE other)
if (RB_TYPE_P(other, T_COMPLEX))
return rb_assoc_new(other, self);
- rb_raise(rb_eTypeError, "%s can't be coerced into %s",
- rb_obj_classname(other), rb_obj_classname(self));
+ rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE,
+ rb_obj_class(other), rb_obj_class(self));
return Qnil;
}
@@ -1233,10 +1255,6 @@ nucomp_eql_p(VALUE self, VALUE other)
inline static VALUE
f_signbit(VALUE x)
{
-#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
- !defined(signbit)
- extern int signbit(double);
-#endif
if (RB_TYPE_P(x, T_FLOAT)) {
double f = RFLOAT_VALUE(x);
return f_boolcast(!isnan(f) && signbit(f));
@@ -1285,7 +1303,7 @@ f_format(VALUE self, VALUE (*func)(VALUE))
static VALUE
nucomp_to_s(VALUE self)
{
- return f_format(self, f_to_s);
+ return f_format(self, rb_String);
}
/*
@@ -1306,7 +1324,7 @@ nucomp_inspect(VALUE self)
VALUE s;
s = rb_usascii_str_new2("(");
- rb_str_concat(s, f_format(self, f_inspect));
+ rb_str_concat(s, f_format(self, rb_inspect));
rb_str_cat2(s, ")");
return s;
@@ -1386,6 +1404,20 @@ rb_Complex(VALUE x, VALUE y)
return nucomp_s_convert(2, a, rb_cComplex);
}
+VALUE
+rb_complex_set_real(VALUE cmp, VALUE r)
+{
+ RCOMPLEX_SET_REAL(cmp, r);
+ return cmp;
+}
+
+VALUE
+rb_complex_set_imag(VALUE cmp, VALUE i)
+{
+ RCOMPLEX_SET_IMAG(cmp, i);
+ return cmp;
+}
+
/*
* call-seq:
* cmp.to_i -> integer
@@ -1402,10 +1434,9 @@ nucomp_to_i(VALUE self)
{
get_dat1(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 Integer",
- StringValuePtr(s));
+ if (!k_exact_zero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Integer",
+ self);
}
return f_to_i(dat->real);
}
@@ -1426,10 +1457,9 @@ nucomp_to_f(VALUE self)
{
get_dat1(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 Float",
- StringValuePtr(s));
+ if (!k_exact_zero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Float",
+ self);
}
return f_to_f(dat->real);
}
@@ -1452,10 +1482,9 @@ nucomp_to_r(VALUE self)
{
get_dat1(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));
+ if (!k_exact_zero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
+ self);
}
return f_to_r(dat->real);
}
@@ -1480,10 +1509,9 @@ nucomp_rationalize(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "01", NULL);
- 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));
+ if (!k_exact_zero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
+ self);
}
return rb_funcall2(dat->real, rb_intern("rationalize"), argc, argv);
}
@@ -1668,8 +1696,6 @@ isimagunit(int c)
c == 'j' || c == 'J');
}
-VALUE rb_cstr_to_rat(const char *, int);
-
static VALUE
str2num(char *s)
{
@@ -1774,19 +1800,26 @@ parse_comp(const char *s, int strict,
VALUE *num)
{
char *buf, *b;
+ VALUE tmp;
+ int ret = 1;
- buf = ALLOCA_N(char, strlen(s) + 1);
+ buf = ALLOCV_N(char, tmp, strlen(s) + 1);
b = buf;
skip_ws(&s);
- if (!read_comp(&s, strict, num, &b))
- return 0;
- skip_ws(&s);
+ if (!read_comp(&s, strict, num, &b)) {
+ ret = 0;
+ }
+ else {
+ skip_ws(&s);
- if (strict)
- if (*s != '\0')
- return 0;
- return 1;
+ if (strict)
+ if (*s != '\0')
+ ret = 0;
+ }
+ ALLOCV_END(tmp);
+
+ return ret;
}
static VALUE
@@ -1812,9 +1845,8 @@ string_to_c_strict(VALUE self)
s = (char *)"";
if (!parse_comp(s, 1, &num)) {
- VALUE ins = f_inspect(self);
- rb_raise(rb_eArgError, "invalid value for convert(): %s",
- StringValuePtr(ins));
+ rb_raise(rb_eArgError, "invalid value for convert(): %+"PRIsVALUE,
+ self);
}
return num;
@@ -2055,9 +2087,10 @@ float_arg(VALUE self)
* and i is imaginary unit. Real a equals complex a+0i
* mathematically.
*
- * In ruby, you can create complex object with Complex, Complex::rect,
- * Complex::polar or to_c method.
+ * Complex object can be created as literal, and also by using
+ * Kernel#Complex, Complex::rect, Complex::polar or to_c method.
*
+ * 2+1i #=> (2+1i)
* Complex(1) #=> (1+0i)
* Complex(2, 3) #=> (2+3i)
* Complex.polar(2, 3) #=> (-1.9799849932008908+0.2822400161197344i)
@@ -2091,29 +2124,19 @@ Init_Complex(void)
assert(fprintf(stderr, "assert() is now active\n"));
id_abs = rb_intern("abs");
- id_abs2 = rb_intern("abs2");
id_arg = rb_intern("arg");
- id_cmp = rb_intern("<=>");
- id_conj = rb_intern("conj");
id_convert = rb_intern("convert");
id_denominator = rb_intern("denominator");
- id_divmod = rb_intern("divmod");
id_eqeq_p = rb_intern("==");
id_expt = rb_intern("**");
id_fdiv = rb_intern("fdiv");
- id_floor = rb_intern("floor");
- id_idiv = rb_intern("div");
- id_imag = rb_intern("imag");
- id_inspect = rb_intern("inspect");
id_negate = rb_intern("-@");
id_numerator = rb_intern("numerator");
id_quo = rb_intern("quo");
- id_real = rb_intern("real");
id_real_p = rb_intern("real?");
id_to_f = rb_intern("to_f");
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 */
@@ -2153,10 +2176,6 @@ Init_Complex(void)
rb_undef_method(rb_cComplex, "truncate");
rb_undef_method(rb_cComplex, "i");
-#if 0 /* NUBY */
- rb_undef_method(rb_cComplex, "//");
-#endif
-
rb_define_method(rb_cComplex, "real", nucomp_real, 0);
rb_define_method(rb_cComplex, "imaginary", nucomp_imag, 0);
rb_define_method(rb_cComplex, "imag", nucomp_imag, 0);
@@ -2204,8 +2223,11 @@ Init_Complex(void)
rb_define_method(rb_cComplex, "to_s", nucomp_to_s, 0);
rb_define_method(rb_cComplex, "inspect", nucomp_inspect, 0);
+ rb_undef_method(rb_cComplex, "positive?");
+ rb_undef_method(rb_cComplex, "negative?");
+
rb_define_private_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
- compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject);
+ compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject); /* :nodoc: */
rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
rb_marshal_define_compat(rb_cComplex, compat, nucomp_dumper, nucomp_loader);
@@ -2247,6 +2269,8 @@ Init_Complex(void)
*/
rb_define_const(rb_cComplex, "I",
f_complex_new_bang2(rb_cComplex, ZERO, ONE));
+
+ rb_provide("complex.so"); /* for backward compatibility */
}
/*
diff --git a/configure.in b/configure.in
index ea14b941ed..2cd0f27b64 100644
--- a/configure.in
+++ b/configure.in
@@ -11,6 +11,10 @@ AC_DEFUN([RUBY_PREREQ_AC],
AC_DISABLE_OPTION_CHECKING
+AC_ARG_VAR([cflags], [additional CFLAGS])
+AC_ARG_VAR([cppflags], [additional CPPFLAGS])
+AC_ARG_VAR([cxxflags], [additional CXXFLAGS])
+
AC_DEFUN([RUBY_RM_RECURSIVE], [
m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [2.70]), [-1], [
# suppress error messages, rm: cannot remove 'conftest.dSYM', from
@@ -39,21 +43,20 @@ AC_ARG_WITH(baseruby,
AS_CASE(["$withval"],[*ruby*],[BASERUBY=$withval],[AC_MSG_ERROR(need ruby)])
],
[
- BASERUBY="ruby"
+ AC_PATH_PROG([BASERUBY], [ruby], [false])
])
-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
+if test "`RUBYOPT=- $BASERUBY -e 'print 42' 2>/dev/null`" = 42; then
+ if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'print 42' 2>/dev/null`" = 42; then
BASERUBY="$BASERUBY --disable=gems"
fi
+ $BASERUBY -C "$srcdir/tool" downloader.rb -e gnu config.guess config.sub
+ HAVE_BASERUBY=yes
else
BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
+ HAVE_BASERUBY=no
fi
AC_SUBST(BASERUBY)
-
-for conf in config.guess config.sub; do
- test -f "$srcdir/tool/$conf" && continue
- $BASERUBY -C "$srcdir/tool" get-config_files $conf
-done
+AC_SUBST(HAVE_BASERUBY)
AC_DEFUN([RUBY_MINGW32],
[AS_CASE(["$host_os"],
@@ -99,8 +102,15 @@ AC_DEFUN([RUBY_NACL],
[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(["$target_cpu"],
+ [x86_64], [nacl_cv_cpu_nick=x86
+ nacl_cv_cpu_nick2=x86_64],
+ [i?86], [nacl_cv_cpu_nick=x86
+ nacl_cv_cpu_nick2=x86_32],
+ [le32], [nacl_cv_cpu_nick=pnacl
+ nacl_cv_cpu_nick2=pnacl
+ ac_cv_exeext=.pexe],
+ [nacl_cv_cpu_nick=$target_cpu])
AS_CASE(["$build_os"],
[linux*], [nacl_cv_os_nick=linux],
[darwin*], [nacl_cv_os_nick=mac],
@@ -111,9 +121,15 @@ AC_DEFUN([RUBY_NACL],
ac_tool_prefix="$host_cpu-nacl-"
AC_MSG_CHECKING([NativeClient toolchain])
- if test -d \
+ if test x"$nacl_cv_cpu_nick" = xpnacl; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_pnacl"
+ ac_tool_prefix=pnacl-
+ elif 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}"
+ elif test -d \
+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"
else
AS_CASE(
["${nacl_cv_build_variant}"],
@@ -141,10 +157,32 @@ AC_DEFUN([RUBY_NACL],
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_MSG_RESULT(${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin)
+
+ RUBY_APPEND_OPTIONS(XCFLAGS, '-I$(NACL_SDK_ROOT)/include')
+ if test x"${nacl_cv_cpu_nick}" = xpnacl; then
+ RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/pnacl')
+ elif test x"${nacl_cv_build_variant}" = xnewlib; then
+ RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/newlib')
+ fi
+
+ AC_MSG_CHECKING([nacl library path])
+ if test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}/Release"; then
+ nacl_cv_libpath="${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}"
+ elif test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_cpu_nick2}/Release"; then
+ nacl_cv_libpath="${nacl_cv_cpu_nick2}"
+ else
+ AC_MSG_ERROR([not found])
+ fi
+ AC_MSG_RESULT([${nacl_cv_libpath}])
+ RUBY_APPEND_OPTIONS(XLDFLAGS, '-L$(NACL_SDK_ROOT)/'"lib/${nacl_cv_libpath}/Release")
AC_SUBST(NACL_TOOLCHAIN)
AC_SUBST(NACL_SDK_ROOT)
- AC_SUBST(NACL_SDK_VARIANT, nacl_cv_build_variant)
+ AC_SUBST(NACL_SDK_VARIANT, "${nacl_cv_build_variant}")
+ AC_SUBST(NACL_LIB_PATH, "${nacl_cv_libpath}")
+ AC_CHECK_TOOLS(CC, [clang gcc])
+ AC_CHECK_TOOLS(CXX, [clang++ g++])
])])
AC_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
@@ -197,8 +235,6 @@ AC_SUBST(MINOR)
AC_SUBST(TEENY)
RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h`
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)
RUBY_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h`
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
dnl checks for alternative programs
@@ -223,6 +259,7 @@ AS_CASE(["$build_os"],
[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++}],
+ [xicc], [: ${CXX=icpc}],
[xclang|x/usr/bin/clang], [: ${CXX=clang++}])
])
test -z "$CC" || ac_cv_prog_CC="$CC"
@@ -231,6 +268,9 @@ test -z "$CXX" || ac_cv_prog_CXX="$CXX"
if test "$program_prefix" = NONE; then
program_prefix=
fi
+if test "$prefix" -ef .; then
+ AC_MSG_ERROR(--prefix cannot be the current working directory.)
+fi
RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
AC_SUBST(RUBY_BASE_NAME)
@@ -242,14 +282,21 @@ test x"$target_alias" = x &&
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
ac_install_sh='' # unusable for extension libraries.
-AS_CASE($target_os,
- [darwin*], [os_version_style=major+0],
- [os_version_style=full])
AC_ARG_WITH(os-version-style,
AS_HELP_STRING([--with-os-version-style=TYPE],
[OS version number for target and target_os [[full]]]
[(full|teeny|minor+0|minor|major+0|major|none)]),
- [os_version_style=$withval])
+ [os_version_style=$withval],
+ [os_version_style=full
+ AS_CASE($target_os, [[*[0-9].*]],
+ [AS_CASE([`/usr/bin/ruby -e 'puts RUBY_PLATFORM' 2>/dev/null`],
+ [[*-*[0-9].*.0]], [os_version_style=minor+0],
+ [[*-*[0-9].*.*]], [os_version_style=full],
+ [[*-*[0-9].0] ], [os_version_style=major+0],
+ [[*-*[0-9].*] ], [os_version_style=minor],
+ [[*-*[0-9]] ], [os_version_style=major],
+ )])
+ ])
os_version_style_transform=
AS_CASE("${os_version_style}",
[full|teeny], [],
@@ -308,9 +355,11 @@ AC_MSG_RESULT([$ARCH_FLAG])
AC_DEFUN([RUBY_UNIVERSAL_ARCH], [
# RUBY_UNIVERSAL_ARCH begin
+ARCH_FLAG=`expr " $CXXFLAGS " : ['.* \(-m[0-9][0-9]*\) ']`
+test ${CXXFLAGS+set} && CXXFLAGS=`echo "$CXXFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']`
ARCH_FLAG=`expr " $CFLAGS " : ['.* \(-m[0-9][0-9]*\) ']`
-test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
-test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
+test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']`
+test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']`
unset universal_binary universal_archnames
if test ${target_archs+set}; then
AC_MSG_CHECKING([target architectures])
@@ -388,8 +437,8 @@ else
rb_cv_target_archs=${target_archs}
fi
if test "x${ARCH_FLAG}" != x; then
- CFLAGS="$CFLAGS ${ARCH_FLAG}"
- LDFLAGS="${LDFLAGS+$LDFLAGS }${ARCH_FLAG}"
+ CFLAGS="${CFLAGS:+$CFLAGS }${ARCH_FLAG}"
+ LDFLAGS="${LDFLAGS:+$LDFLAGS }${ARCH_FLAG}"
fi
# RUBY_UNIVERSAL_ARCH end
])
@@ -423,7 +472,7 @@ fi
RUBY_NACL
AS_CASE(["$host_os:$build_os"],
[darwin*:darwin*], [
- AC_CHECK_TOOLS(CC, [gcc-4.2 clang gcc cc])
+ AC_CHECK_TOOLS(CC, [clang gcc cc])
# Following Apple deployed clang are broken
# clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported)
# Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn)
@@ -453,7 +502,9 @@ if test "$GCC" = yes; then
linker_flag=-Wl,
: ${optflags=-O3}
gcc_major=`echo =__GNUC__ | $CC -E -xc - | sed '/^=/!d;s///'`
+ gcc_minor=`echo =__GNUC_MINOR__ | $CC -E -xc - | sed '/^=/!d;s///'`
test -n "$gcc_major" || gcc_major=0
+ test -n "$gcc_minor" || gcc_minor=0
# RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
else
linker_flag=
@@ -571,8 +622,10 @@ AC_DEFUN([RUBY_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
+ AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [
+ # DTrace is available on the system
+ rb_cv_dtrace_available=yes
+ ], [rb_cv_dtrace_available=no])
else
# DTrace is not available while dtrace command exists
# for example FreeBSD 8 or FreeBSD 9 without DTrace build option
@@ -585,6 +638,7 @@ AC_DEFUN([RUBY_DTRACE_AVAILABLE],
AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
[
+ rb_cv_prog_dtrace_g=no
if {
cat >conftest_provider.d <<_PROBES &&
provider conftest {
@@ -592,16 +646,20 @@ AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
};
_PROBES
$DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null &&
- cat >conftest.c <<_CONF &&
- @%:@include "conftest_provider.h"
- int main(void){ CONFTEST_FIRE(); return 0; }
-_CONF
- $CC $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c &&
- $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
+ AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [
+ if {
+ cp -p conftest.${ac_objext} conftest.${ac_objext}.save &&
+ $DTRACE -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null &&
+ :
+ }; then
+ if cmp -s conftest.o conftest.${ac_objext}.save; then
+ rb_cv_prog_dtrace_g=yes
+ else
+ rb_cv_prog_dtrace_g=rebuild
+ fi
+ fi])
fi
rm -f conftest.[co] conftest_provider.[dho]
])
@@ -684,16 +742,25 @@ RUBY_WERROR_FLAG([
]
)
AC_MSG_CHECKING([whether LDFLAGS is valid])
+ {
+ mkdir tmp.$$.try_link &&
+ cd tmp.$$.try_link &&
+ cp ../confdefs.h . &&
+ echo '<?xml?><plist><dict><key>CFBundleIdentifier</key><string></string></dict></plist>' > Info.plist &&
+ :
+ } || AC_MSG_ERROR([failed to make temporary directory])
AC_TRY_LINK([], [],
[AC_MSG_RESULT(yes)],
[
+ cd .. && rm -fr tmp.$$.try_link
AC_MSG_RESULT(no)
AC_MSG_ERROR([something wrong with LDFLAGS="$LDFLAGS"])
]
)
+ cd .. && rm -fr tmp.$$.try_link
])
-AC_DEFUN(RUBY_TRY_CFLAGS, [
+AC_DEFUN([RUBY_TRY_CFLAGS], [
AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
RUBY_WERROR_FLAG([
CFLAGS="[$]CFLAGS $1"
@@ -705,7 +772,7 @@ AC_DEFUN(RUBY_TRY_CFLAGS, [
])
])
-AC_DEFUN(RUBY_TRY_LDFLAGS, [
+AC_DEFUN([RUBY_TRY_LDFLAGS], [
save_LDFLAGS="$LDFLAGS"
LDFLAGS="[$]LDFLAGS $1"
AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
@@ -720,6 +787,24 @@ AC_DEFUN(RUBY_TRY_LDFLAGS, [
save_LDFLAGS=
])
+: ${RPATHFLAG=''}
+rpathflag=''
+AS_IF([test x"${RPATHFLAG}" = x], [
+ AS_CASE(["$target_os"],
+ [hpux*], [AS_IF([test "$rb_cv_prog_gnu_ld" = no], [rpathflag='+b '])],
+ [aix*], [rpathflag='-blibpath:'],
+ [for rpathflag in -R "-rpath "; do
+ AS_CASE("$rpathflag",
+ [*" "], [AS_CASE(["${linker_flag}"],
+ [*,], [rpathflag=`echo "$rpathflag" | tr ' ' ,`])])
+ rpathflag="${linker_flag}${rpathflag}"
+ RUBY_TRY_LDFLAGS([${rpathflag}.], [], [rpathflag=])
+ AS_IF([test "x${rpathflag}" != x], [])
+ done])
+], [
+ rpathflag=`echo "$RPATHFLAG" | sed 's/%.*//'`
+])
+
AS_CASE([$RUBY_PATCHLEVEL], [-*],
[particular_werror_flags=yes], [particular_werror_flags=no])
AC_ARG_ENABLE(werror,
@@ -736,7 +821,11 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
else
extra_warning=
fi
+ if test $gcc_major -eq 5; then
+ extra_warning="$extra_warning -Wno-maybe-uninitialized"
+ fi
for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
+ -diag-disable=2259 \
-Wno-missing-field-initializers \
-Wunused-variable \
-Werror=pointer-arith \
@@ -745,6 +834,8 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
-Werror=shorten-64-to-32 \
-Werror=implicit-function-declaration \
-Werror=division-by-zero \
+ -Werror=deprecated-declarations \
+ -Wno-packed-bitfield-compat \
$extra_warning \
; do
if test "$particular_werror_flags" != yes; then
@@ -770,17 +861,37 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
rb_cv_warnflags="$warnflags"
warnflags=
fi
+RUBY_TRY_CFLAGS(-Qunused-arguments, [RUBY_APPEND_OPTIONS(rb_cv_wsuppress_flags, -Qunused-arguments)])
+
+for n in infinity nan; do
+ m=AS_TR_CPP($n)
+ AC_CACHE_CHECK([whether $m is available without C99 option], rb_cv_$n,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(AC_INCLUDES_DEFAULT([@%:@include <math.h>
+@%:@ifndef $m
+@%:@error no $m
+@%:@endif
+]), [1])], [eval rb_cv_$n=yes], [eval rb_cv_$n=no])])
+ if eval test '"$rb_cv_'$n'"' = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_]$m)
+ fi
+done
+
if test "$GCC" = yes; then
- # -D_FORTIFY_SOURCE
- # When defined _FORTIFY_SOURCE, glibc enables some additional sanity
- # argument check. The performance drop is very little and Ubuntu enables
- # _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
- # a mistake of silly C extensions.
- RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+ # NaCl's glibc build generates undefined references to __memset_chk.
+ # TODO(sbc): Remove this once NaCl's glibc is fixed.
+ AS_CASE(["$target_os"], [nacl], [], [
+ # -D_FORTIFY_SOURCE
+ # When defined _FORTIFY_SOURCE, glibc enables some additional sanity
+ # argument check. The performance drop is very little and Ubuntu enables
+ # _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
+ # a mistake of silly C extensions.
+ RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+ ])
# -fstack-protector
AS_CASE(["$target_os"],
- [mingw*|nacl|haiku], [
+ [mingw*|nacl], [
stack_protector=no
])
if test -z "${stack_protector+set}"; then
@@ -801,21 +912,46 @@ if test "$GCC" = yes; then
# various headers. Most frequent situation is the use of //
# comments. We bypass ANSI C mode for them. Otherwise
# extension libs cannot include those headers.
+
+ # Since math.h in some mingw64 wrongly delcares frexp and modf
+ # to be pure, the variables pointed by the second arguments are
+ # considered uninitialized unexpectedly.
+ AC_CACHE_CHECK([whether frexp and modf are broken],
+ rb_cv_mingw64_broken_frexp_modf,
+ [
+ save_CFLAGS="$CFLAGS"
+ if test "$particular_werror_flags" = "yes"; then
+ CFLAGS="$CFLAGS -Werror=uninitialized"
+ else
+ CFLAGS="$CFLAGS -Werror -Wuninitialized"
+ fi
+ AC_TRY_COMPILE([@%:@include <math.h>
+ int foo(double x)
+ {
+ int exp;
+ frexp(x, &exp);
+ return exp;
+ }], [if (foo(0.0)) return 1;],
+ [rb_cv_mingw64_broken_frexp_modf=no],
+ [rb_cv_mingw64_broken_frexp_modf=yes])
+ CFLAGS="$save_CFLAGS"
+ ])
+ if test "$rb_cv_mingw64_broken_frexp_modf" = yes; then
+ AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF)
+ fi
],
- [cygwin*|darwin*|netbsd*], [
+ [cygwin*|darwin*|netbsd*|nacl], [
# 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)
- ])
+ for ansi_options in -std=iso9899:1999 "-ansi -std=iso9899:199409"; do
+ RUBY_TRY_CFLAGS(${ansi_options}, [
+ RUBY_APPEND_OPTIONS(warnflags, ${ansi_options})
+ RUBY_APPEND_OPTIONS(strict_warnflags, ${ansi_options})
+ ], [ansi_options=])
+ test "x${ansi_options}" = x || break
+ done
])
# suppress annoying -Wstrict-overflow warnings
@@ -850,10 +986,14 @@ if test "$GCC" = yes; then
AS_CASE(["$target_os"], [mingw*], [
RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
+ RUBY_TRY_CFLAGS(-static-libgcc, [static_libgcc=yes], [static_libgcc=no])
+ if test "$static_libgcc" = yes; then
+ RUBY_APPEND_OPTION(EXTLDFLAGS, -static-libgcc)
+ fi
])
# disable fast-math
- for oflag in -fno-fast-math; do
+ for oflag in -fno-fast-math -fp-model\ precise; do
RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
done
fi
@@ -864,17 +1004,11 @@ AC_ARG_WITH(opt-dir,
[
val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
CPPFLAGS="$CPPFLAGS $val"
- 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' ' '`
+ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -L\1/lib${rpathflag:+ $rpathflag\\\\1/lib}|g;s/^ //"`
+ LDFLAGS="$LDFLAGS $val"
LDFLAGS_OPTDIR="$val"
- test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
- LDFLAGS="$LDFLAGS$val"
- test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
- DLDFLAGS="$DLDFLAGS$val"
- ])
+ OPT_DIR="$withval"
+ ], [OPT_DIR=])
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\""
@@ -888,6 +1022,7 @@ AC_ARG_WITH(winnt-ver,
AS_CASE(["$target_os"],
[mingw*], [
RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
+ RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT)
])
AS_CASE(["$target_os"],
@@ -934,15 +1069,33 @@ AS_CASE(["$target_os"],
],
[macosx_10_5=yes], [macosx_10_5=no])
AC_MSG_RESULT($macosx_10_5)
+ AS_IF([test "${target_os@%:@darwin}" -ge 16], [
+ ac_cv_func___syscall=no
+ ac_cv_func_syscall=no
+ ac_cv_header_sys_syscall_h=no
+ ac_cv_header_syscall_h=no
+ ])
if test $macosx_10_5 = yes; then
- ac_cv_header_ucontext_h=no
+ ac_cv_func_getcontext=no
+ ac_cv_func_setcontext=no
else
AC_DEFINE(BROKEN_SETREUID, 1)
AC_DEFINE(BROKEN_SETREGID, 1)
fi
+ incs=`$CC -v -E -xc - < /dev/null 2>&1 | sed ['1,/^@%:@include </d;s/^ *//;s|[^./][^/]*/\.\./||g;/\/include$/!d;s||/lib|;/\/usr\/lib/d']`
+ for d in `$CC -print-search-dirs | sed -e '/^libraries: */!d;s///' | tr : '\012' | fgrep -v /../ | sed -n 's|^\(/.*/lib\)/$|\1|p'`; do
+ incs=`echo "$incs" | fgrep -v "$d"`
+ done
+ for d in $incs; do
+ test -d "$d" && RUBY_APPEND_OPTIONS(LDFLAGS, "-L$d")
+ done
ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage
ac_cv_lib_crypt_crypt=no
ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync()
+ ac_cv_func_vfork=no
+ if test $gcc_major -lt 4 -o \( $gcc_major -eq 4 -a $gcc_minor -lt 3 \); then
+ ac_cv_func___builtin_setjmp=no
+ fi
AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
[AC_TRY_RUN([
#include <stdio.h>
@@ -987,14 +1140,60 @@ main()
],
[hpux*], [ LIBS="-lm $LIBS"
ac_cv_c_inline=no],
-[beos*|haiku*], [
- ac_cv_func_link=no
- ac_cv_func_sched_yield=no
- ac_cv_func_pthread_attr_setinheritsched=no
- AS_CASE(["$target_os"],
- [beos*], [ ac_cv_header_net_socket_h=yes],
- [haiku*], [ ac_cv_func_shutdown=no])
- LIBS="$LIBS" # m lib is include in root under BeOS/Haiku
+[solaris*], [ LIBS="-lm $LIBS"
+ ac_cv_func_vfork=no
+ AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given)
+ AC_TRY_COMPILE([#include <unistd.h>
+ #ifndef _XOPEN_SOURCE
+ #error _XOPEN_SOURCE is not defined
+ #endif
+ ], [],
+ [given_xopen_source=yes], [given_xopen_source=no])
+ AC_MSG_RESULT($given_xopen_source)
+ if test $given_xopen_source = no; then
+ # On Solaris, with gcc, -std=iso9899:1999 in $ansi_options
+ # is often also needed in CPPFLAGS, because some feature
+ # definitions vary depending on such standards options.
+ AS_CASE(["${ansi_options}"],
+ [*-std=iso9899:1999*], [
+ RUBY_APPEND_OPTIONS(CPPFLAGS, ${ansi_options})
+ ])
+ AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define)
+ define_xopen_source=""
+ for tmp_xpg in 7 6 5; do
+ if test x"$define_xopen_source" != x; then
+ break
+ fi
+ # Both AC_TRY_CPP and AC_TRY_COMPILE should pass
+ # because some options may not be set to CPPFLAGS.
+ AC_TRY_CPP([
+ #define _XOPEN_SOURCE ${tmp_xpg}00
+ #include <unistd.h>
+ #ifndef _XPG${tmp_xpg}
+ #error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
+ #endif
+ ], [
+ AC_TRY_COMPILE([
+ #define _XOPEN_SOURCE ${tmp_xpg}00
+ #include <unistd.h>
+ #ifndef _XPG${tmp_xpg}
+ #error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
+ #endif
+ ], [],
+ [define_xopen_source=${tmp_xpg}00], [])
+ ], [])
+ done
+ if test x"$define_xopen_source" = x; then
+ define_xopen_source=no
+ fi
+ AC_MSG_RESULT($define_xopen_source)
+ if test x"$define_xopen_source" != xno; then
+ RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
+ fi
+ fi
+ ],
+[haiku*], [
+ LIBS="$LIBS" # m lib is include in root
],
[cygwin*], [ ac_cv_header_langinfo_h=yes
AC_CHECK_FUNCS(cygwin_conv_path)
@@ -1011,6 +1210,7 @@ main()
ac_cv_header_sys_time_h=no
ac_cv_header_sys_times_h=no
ac_cv_header_sys_socket_h=no
+ ac_cv_func_lstat=yes
ac_cv_func_times=yes
ac_cv_func_waitpid=yes
ac_cv_func_fsync=yes
@@ -1019,7 +1219,10 @@ main()
ac_cv_func_isinf=yes
ac_cv_func_isnan=yes
ac_cv_func_finite=yes
+ ac_cv_func_lchown=yes
ac_cv_func_link=yes
+ ac_cv_func_readlink=yes
+ ac_cv_func_symlink=yes
ac_cv_lib_crypt_crypt=no
ac_cv_func_getpgrp_void=no
ac_cv_func_memcmp_working=yes
@@ -1034,16 +1237,17 @@ main()
ac_cv_func_clock_gettime=yes
ac_cv_func_clock_getres=yes
ac_cv_func_malloc_usable_size=no
+ { test "$target_cpu" = x64 && ac_cv_func___builtin_setjmp=no; }
AC_CHECK_TYPE([NET_LUID], [], [],
- [@%:@include <windows.h>
- @%:@include <iphlpapi.h>])
+ [@%:@include <winsock2.h>
+ @%:@include <iphlpapi.h>])
if test x"$ac_cv_type_NET_LUID" = xyes; then
AC_DEFINE(HAVE_TYPE_NET_LUID, 1)
fi
+ AC_CHECK_FUNCS(_gmtime64_s)
+ AC_CHECK_FUNCS(_wfreopen_s)
AC_LIBOBJ([langinfo])
],
-[os2-emx*], [ LIBS="-lm $LIBS"
- ac_cv_lib_dir_opendir=no],
[bsdi*], [ LIBS="-lm $LIBS"
AC_DEFINE(BROKEN_SETREUID, 1)
AC_DEFINE(BROKEN_SETREGID, 1)
@@ -1054,21 +1258,23 @@ main()
ac_cv_func_shutdown=no
ac_cv_func_close=no
],
+[netbsd*], [ LIBS="-lm $LIBS"
+ ],
[dragonfly*], [ LIBS="-lm $LIBS"
# isinf() and isnan() are macros on DragonFly.
ac_cv_func_isinf=yes
ac_cv_func_isnan=yes
],
+[aix*],[ LIBS="-lm $LIBS"
+ ac_cv_func_round=no
+ ],
[nacl], [
LIBS="-lm $LIBS"
if test "${nacl_cv_build_variant}" = "newlib"; then
RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
- RUBY_APPEND_OPTION(LIBS, '-lnosys')
else
RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
fi
- ac_cv_func_shutdown=no
- ac_cv_func_fcntl=no
],
[ LIBS="-lm $LIBS"])
@@ -1082,44 +1288,46 @@ AC_HEADER_DIRENT
dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
AC_HEADER_STDBOOL
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS( \
- limits.h \
- sys/file.h \
- sys/ioctl.h \
- sys/syscall.h \
- fcntl.h \
- sys/fcntl.h \
- sys/select.h \
- sys/time.h \
- sys/times.h \
- sys/param.h \
- syscall.h \
- pwd.h \
- grp.h \
- a.out.h \
- utime.h \
- direct.h \
- sys/resource.h \
- sys/mkdev.h \
- sys/utime.h \
- float.h \
- ieeefp.h \
- ucontext.h \
- intrinsics.h \
- langinfo.h \
- locale.h \
- sys/sendfile.h \
- time.h \
- net/socket.h \
- sys/socket.h \
- process.h \
- sys/prctl.h \
- atomic.h \
- malloc.h \
- malloc_np.h \
- malloc/malloc.h \
- setjmpex.h
-)
+
+AC_CHECK_HEADERS(a.out.h)
+AC_CHECK_HEADERS(atomic.h)
+AC_CHECK_HEADERS(direct.h)
+AC_CHECK_HEADERS(grp.h)
+AC_CHECK_HEADERS(fcntl.h)
+AC_CHECK_HEADERS(float.h)
+AC_CHECK_HEADERS(ieeefp.h)
+AC_CHECK_HEADERS(intrinsics.h)
+AC_CHECK_HEADERS(langinfo.h)
+AC_CHECK_HEADERS(limits.h)
+AC_CHECK_HEADERS(locale.h)
+AC_CHECK_HEADERS(malloc.h)
+AC_CHECK_HEADERS(malloc/malloc.h)
+AC_CHECK_HEADERS(malloc_np.h)
+AC_CHECK_HEADERS(net/socket.h)
+AC_CHECK_HEADERS(process.h)
+AC_CHECK_HEADERS(pwd.h)
+AC_CHECK_HEADERS(setjmpex.h)
+AC_CHECK_HEADERS(sys/attr.h)
+AC_CHECK_HEADERS(sys/fcntl.h)
+AC_CHECK_HEADERS(sys/file.h)
+AC_CHECK_HEADERS(sys/id.h)
+AC_CHECK_HEADERS(sys/ioctl.h)
+AC_CHECK_HEADERS(sys/mkdev.h)
+AC_CHECK_HEADERS(sys/param.h)
+AC_CHECK_HEADERS(sys/prctl.h)
+AC_CHECK_HEADERS(sys/resource.h)
+AC_CHECK_HEADERS(sys/select.h)
+AC_CHECK_HEADERS(sys/sendfile.h)
+AC_CHECK_HEADERS(sys/socket.h)
+AC_CHECK_HEADERS(sys/syscall.h)
+AC_CHECK_HEADERS(sys/time.h)
+AC_CHECK_HEADERS(sys/times.h)
+AC_CHECK_HEADERS(sys/uio.h)
+AC_CHECK_HEADERS(sys/utime.h)
+AC_CHECK_HEADERS(syscall.h)
+AC_CHECK_HEADERS(time.h)
+AC_CHECK_HEADERS(ucontext.h)
+AC_CHECK_HEADERS(utime.h)
AC_ARG_WITH([gmp],
[AS_HELP_STRING([--without-gmp],
@@ -1129,25 +1337,87 @@ AC_ARG_WITH([gmp],
AS_IF([test "x$with_gmp" != xno],
[AC_CHECK_HEADERS(gmp.h)
AS_IF([test "x$ac_cv_header_gmp_h" != xno],
- AC_CHECK_LIB([gmp], [__gmpz_init]))
- with_gmp="$ac_cv_lib_gmp___gmpz_init"
- AS_IF([test -z "$with_gmp"], [with_gmp=no])])
+ AC_SEARCH_LIBS([__gmpz_init], [gmp],
+ [AC_DEFINE(HAVE_LIBGMP, 1)]))])
+
+AC_ARG_WITH([jemalloc],
+ [AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])],
+ [with_jemalloc=$withval], [with_jemalloc=no])
+AS_IF([test "x$with_jemalloc" = xyes],[
+ AC_SEARCH_LIBS([malloc_conf], [jemalloc],
+ [AC_DEFINE(HAVE_LIBJEMALLOC, 1)], [with_jemalloc=no])
+ AC_CHECK_HEADER(jemalloc/jemalloc.h, [
+ AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>])
+ ])
+ AS_IF([test "x$with_jemalloc" = xno], [
+ AC_CACHE_CHECK([for jemalloc with JEMALLOC_MANGLE], rb_cv_jemalloc_demangle,
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@define JEMALLOC_MANGLE 1
+ @%:@ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
+ @%:@include RUBY_ALTERNATIVE_MALLOC_HEADER
+ @%:@else
+ @%:@include <jemalloc.h>
+ @%:@endif], [return !&malloc_conf])],
+ [rb_cv_jemalloc_demangle=yes],
+ [rb_cv_jemalloc_demangle=no])
+ ])
+ ])
+ AS_IF([test "x$rb_cv_jemalloc_demangle" = xyes], [
+ AC_DEFINE(JEMALLOC_MANGLE)
+ with_jemalloc=yes
+ ])
+ AS_IF([test "x$with_jemalloc" = xyes],
+ [
+ ac_cv_func_malloc_usable_size=yes
+ ],
+ [AC_MSG_ERROR([jemalloc requested but not found])
+ ])
+])
dnl check for large file stuff
mv confdefs.h confdefs1.h
: > confdefs.h
AC_SYS_LARGEFILE
+# On 32-bit Solaris, it is safe to define _LARGEFILE_SOURCE
+# which is not added by AC_SYS_LARGEFILE.
+if test x"$enable_largefile" != xno; then
+ AS_CASE(["$target_os"], [solaris*], [
+ AC_MSG_CHECKING([wheather _LARGEFILE_SOURCE should be defined])
+ AS_CASE(["${ac_cv_sys_file_offset_bits}:${ac_cv_sys_large_files}"],
+ ["64:"|"64:no"|"64:unknown"], [
+ # insert _LARGEFILE_SOURCE before _FILE_OFFSET_BITS line
+ # that is the same order as "getconf LFS_CFLAGS" output
+ mv confdefs.h largefile0.h
+ : > confdefs.h
+ AC_DEFINE(_LARGEFILE_SOURCE)
+ cat largefile0.h >> confdefs.h
+ rm largefile0.h
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+ ])
+fi
mv confdefs.h largefile.h
mv confdefs1.h confdefs.h
cat largefile.h >> confdefs.h
-AS_CASE(["$target_os"],[mingw*], [ac_cv_type_off_t=yes;ac_cv_sizeof_off_t=8])
+AS_CASE(["$target_os"],
+ [mingw*], [ac_cv_type_off_t=yes;ac_cv_sizeof_off_t=8],
+ [aix*], [
+ AS_CASE(["$target_cpu:$ac_cv_sys_large_files"],
+ [ppc64:*|powerpc64:*], [],
+ [*:no|*:unknown], [],
+ [
+ # AIX currently does not support a 32-bit call to posix_fadvise()
+ # if _LARGE_FILES is defined.
+ ac_cv_func_posix_fadvise=no
+ ])
+ ])
AC_C_BIGENDIAN
AC_C_CONST
AC_C_CHAR_UNSIGNED
AC_C_INLINE
AC_C_VOLATILE
+AC_C_TYPEOF
AS_CASE(":$ac_cv_c_const:$ac_cv_c_volatile:",
[*:no:*], [AC_MSG_ERROR(ANSI C-conforming const and volatile are mandatory)])
@@ -1246,7 +1516,6 @@ RUBY_CHECK_SIZEOF(short)
RUBY_CHECK_SIZEOF(long, [int], [ILP LP])
RUBY_CHECK_SIZEOF(long long)
RUBY_CHECK_SIZEOF(__int64)
-RUBY_CHECK_SIZEOF(__int128)
RUBY_CHECK_SIZEOF(off_t)
RUBY_CHECK_SIZEOF(void*, [int long "long long"], [ILP LP LLP])
RUBY_CHECK_SIZEOF(float)
@@ -1254,10 +1523,29 @@ RUBY_CHECK_SIZEOF(double)
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
+AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
+ [rb_cv_packed_struct=no
+ for mac in \
+ "__pragma(pack(push, 1)) x __pragma(pack(pop))" \
+ "x __attribute__((packed))" \
+ ; do
+ AC_TRY_COMPILE([@%:@define PACKED_STRUCT(x) $mac
+ PACKED_STRUCT(struct { int a; });], [],
+ [rb_cv_packed_struct=$mac; break])
+ done])
+packed_struct_unaligned=x
+if test "$rb_cv_packed_struct" != no; then
+ AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], [$rb_cv_packed_struct])
+else
+ AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], x)
+fi
+AC_DEFINE_UNQUOTED(PACKED_STRUCT_UNALIGNED(x), $packed_struct_unaligned)
+
AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [
AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
[rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]
- RUBY_WERROR_FLAG(for pri in $2; do
+ RUBY_WERROR_FLAG(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags)
+ for pri in $2; do
AC_TRY_COMPILE(
[@%:@include <stdio.h>
@%:@include <stddef.h>
@@ -1325,7 +1613,16 @@ AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
[
t=INT])
rb_cv_[$1]_convertible=${u}${t}])
- test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes" && n="$1"
+ if test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes"; then
+ n="$1"
+ else
+ AS_CASE(["${rb_cv_[$1]_convertible}"],
+ [*LL], [n="long long"],
+ [*LONG], [n="long"],
+ [n="int"])
+ AS_CASE(["${rb_cv_[$1]_convertible}"],
+ [U*], [n="unsigned $n"])
+ fi
AS_CASE("${rb_cv_[$1]_convertible}", [U*], [u=+1], [u=-1])
AC_DEFINE_UNQUOTED(rb_[$1], $n)
AC_DEFINE_UNQUOTED([SIGNEDNESS_OF_]AS_TR_CPP($1), $u)
@@ -1447,48 +1744,81 @@ EOH
])dnl
])dnl
-dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
-AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
+dnl RUBY_DECL_ATTRIBUTE(attrib, macroname, cachevar, condition, type, code)
+AC_DEFUN([RUBY_DECL_ATTRIBUTE], [dnl
m4_ifval([$2], dnl
- [AS_VAR_PUSHDEF([attrib],[$2])], dnl
- [AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
+ [AS_VAR_PUSHDEF([attrib], m4_bpatsubst([$2], [(.*)], []))], dnl
+ [AS_VAR_PUSHDEF([attrib], m4_toupper(m4_format(%.4s, [$5]))[_]AS_TR_CPP($1))] dnl
)dnl
m4_ifval([$3], dnl
[AS_VAR_PUSHDEF([rbcv],[$3])], dnl
- [AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
+ [AS_VAR_PUSHDEF([rbcv],[rb_cv_]m4_format(%.4s, [$5])[_][$1])]dnl
)dnl
+m4_pushdef([attrib_code],[m4_bpatsubst([$1],["],[\\"])])dnl
+m4_pushdef([attrib_params],[m4_bpatsubst([$2(x)],[^[^()]*(\([^()]*\)).*],[\1])])dnl
m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
-AC_CACHE_CHECK(for [$1] function attribute, rbcv,
+AC_CACHE_CHECK(for m4_ifval([$2],[m4_bpatsubst([$2], [(.*)], [])],[$1]) [$5] attribute, rbcv, dnl
[rbcv=x
RUBY_WERROR_FLAG([
-for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do
+for mac in \
+ "__attribute__ ((attrib_code)) x" \
+ "x __attribute__ ((attrib_code))" \
+ "__declspec(attrib_code) x" \
+ x; do
m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
AC_TRY_COMPILE(
m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
-[@%:@define ]attrib[(x) $mac]
+[@%:@define ]attrib[](attrib_params)[ $mac]
m4_ifval([$4],${rbcv_cond+[@%:@else]}
-${rbcv_cond+[@%:@define ]attrib[(x) x]}
+${rbcv_cond+[@%:@define ]attrib[](attrib_params)[ x]}
${rbcv_cond+[@%:@endif]})
- attrib[(void conftest_attribute_check(void));], [],
+$6
+ attrib[](attrib_params)[;], [],
[rbcv="$mac"; break])
done
])])
if test "$rbcv" != x; then
- RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
+ RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[](attrib_params)[], $rbcv)
fi
-m4_ifval([$4], [unset rbcv_cond])dnl
+m4_ifval([$4], [unset rbcv_cond]) dnl
+m4_popdef([attrib_params])dnl
+m4_popdef([attrib_code])dnl
AS_VAR_POPDEF([attrib])dnl
AS_VAR_POPDEF([rbcv])dnl
])
+dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
+AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
+ RUBY_DECL_ATTRIBUTE([$1], [$2], [$3], [$4],
+ [function], [@%:@define x void conftest_attribute_check(void)]
+ )
+])
+
+dnl RUBY_TYPE_ATTRIBUTE(attrib, macroname, cachevar, condition)
+AC_DEFUN([RUBY_TYPE_ATTRIBUTE], [dnl
+ RUBY_DECL_ATTRIBUTE([$1], [$2], [$3], [$4],
+ [type], [
+@%:@define x struct conftest_attribute_check {int i;}
+@%:@define mesg ("")
+])
+])
+
RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
+RUBY_FUNC_ATTRIBUTE(deprecated("by "@%:@n), DEPRECATED_BY(n,x), rb_cv_func_deprecated_by)
+RUBY_TYPE_ATTRIBUTE(deprecated mesg, DEPRECATED_TYPE(mesg,x), rb_cv_type_deprecated)
RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
+RUBY_FUNC_ATTRIBUTE(weak, WEAK, rb_cv_func_weak)
+if test "$rb_cv_func_weak" != x; then
+ AC_DEFINE(HAVE_FUNC_WEAK)
+fi
if_i386=${universal_binary+[defined __i386__]}
RUBY_FUNC_ATTRIBUTE(stdcall, [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(cdecl, [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(fastcall, [], [], ${if_i386})
+RUBY_FUNC_ATTRIBUTE(optimize("O0"), FUNC_UNOPTIMIZED, rb_cv_func_unoptimized)
+RUBY_FUNC_ATTRIBUTE(optimize("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized)
if test "$GCC" = yes; then
AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
@@ -1513,6 +1843,7 @@ if test "$GCC" = yes; then
__atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST);
__atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST);
__atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST);
+ __atomic_or_fetch(&atomic_var, 1, __ATOMIC_SEQ_CST);
],
[rb_cv_gcc_atomic_builtins=yes],
[rb_cv_gcc_atomic_builtins=no])])
@@ -1527,6 +1858,8 @@ if test "$GCC" = yes; then
__sync_lock_test_and_set(&atomic_var, 1);
__sync_fetch_and_add(&atomic_var, 1);
__sync_fetch_and_sub(&atomic_var, 1);
+ __sync_or_and_fetch(&atomic_var, 1);
+ __sync_val_compare_and_swap(&atomic_var, 0, 1);
],
[rb_cv_gcc_sync_builtins=yes],
[rb_cv_gcc_sync_builtins=no])])
@@ -1536,8 +1869,8 @@ if test "$GCC" = yes; then
AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
[RUBY_WERROR_FLAG(
- [AC_TRY_LINK([@%:@include <stdlib.h>],
- [exit(0); __builtin_unreachable();],
+ [AC_TRY_LINK([volatile int zero;],
+ [if (zero) __builtin_unreachable();],
[rb_cv_func___builtin_unreachable=yes],
[rb_cv_func___builtin_unreachable=no])
])
@@ -1578,6 +1911,32 @@ if test "$rb_cv_function_name_string" != no; then
AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string])
fi
+AC_CACHE_CHECK(if enum over int is allowed, rb_cv_enum_over_int, [
+ rb_cv_enum_over_int=no
+ if test "x$ac_cv_type_long_long" = xyes; then
+ type="unsigned long long" max="ULLONG_MAX"
+ else
+ type="unsigned long" max="ULONG_MAX"
+ fi
+ RUBY_WERROR_FLAG([
+ AC_COMPILE_IFELSE([
+ AC_LANG_BOOL_COMPILE_TRY([
+ @%:@include <limits.h>
+ enum {conftest_max = $max};
+ ], [
+ (conftest_max == $max) &&
+ (sizeof(conftest_max) == sizeof($type))
+ ]
+ )],
+ [rb_cv_enum_over_int=yes],
+ [rb_cv_enum_over_int=no]
+ )
+ ])
+])
+if test $rb_cv_enum_over_int = yes; then
+ AC_DEFINE(ENUM_OVER_INT, 1)
+fi
+
dnl Check whether we need to define sys_nerr locally
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
@%:@include <errno.h>])
@@ -1611,10 +1970,11 @@ RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t)
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
-RUBY_CHECK_SIZEOF([struct stat.st_size], [int long "long long"], [], [@%:@include <sys/stat.h>])
+RUBY_CHECK_SIZEOF([struct stat.st_size], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
if test "$ac_cv_member_struct_stat_st_blocks" = yes; then
- RUBY_CHECK_SIZEOF([struct stat.st_blocks], [int long "long long"], [], [@%:@include <sys/stat.h>])
+ RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
fi
+RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_atimespec])
AC_CHECK_MEMBERS([struct stat.st_atimensec])
@@ -1624,6 +1984,7 @@ AC_CHECK_MEMBERS([struct stat.st_mtimensec])
AC_CHECK_MEMBERS([struct stat.st_ctim])
AC_CHECK_MEMBERS([struct stat.st_ctimespec])
AC_CHECK_MEMBERS([struct stat.st_ctimensec])
+AC_CHECK_MEMBERS([struct stat.st_birthtimespec])
AC_CHECK_TYPES([struct timeval], [], [], [@%:@ifdef HAVE_TIME_H
@%:@include <time.h>
@@ -1690,7 +2051,6 @@ typedef $1 t; int s = sizeof(t) == 42;])],
["$ac_cv_sizeof_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long"],
["$ac_cv_sizeof_long_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long"],
["$ac_cv_sizeof___int64"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64"],
- ["$ac_cv_sizeof___int128"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int128"],
[ rb_cv_type_$1=no])])])
if test "${rb_cv_type_$1}" != no; then
AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
@@ -1712,8 +2072,6 @@ RUBY_DEFINT(int32_t, 4)
RUBY_DEFINT(uint32_t, 4, unsigned)
RUBY_DEFINT(int64_t, 8)
RUBY_DEFINT(uint64_t, 8, unsigned)
-RUBY_DEFINT(int128_t, 16)
-RUBY_DEFINT(uint128_t, 16, unsigned)
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.
@@ -1823,10 +2181,29 @@ AS_CASE(["$target_os"],[freebsd*],[
AC_DEFINE(BROKEN_CLOSE)
AC_REPLACE_FUNCS(close)
])
-AC_REPLACE_FUNCS(dup2 memmove strerror\
- strchr strstr crypt flock\
- isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \
- strlcpy strlcat ffs setproctitle)
+
+AC_REPLACE_FUNCS(acosh)
+AC_REPLACE_FUNCS(cbrt)
+AC_REPLACE_FUNCS(crypt)
+AC_REPLACE_FUNCS(dup2)
+AC_REPLACE_FUNCS(erf)
+AC_REPLACE_FUNCS(explicit_bzero)
+AC_REPLACE_FUNCS(ffs)
+AC_REPLACE_FUNCS(finite)
+AC_REPLACE_FUNCS(flock)
+AC_REPLACE_FUNCS(hypot)
+AC_REPLACE_FUNCS(isinf)
+AC_REPLACE_FUNCS(isnan)
+AC_REPLACE_FUNCS(lgamma_r)
+AC_REPLACE_FUNCS(memmove)
+AC_REPLACE_FUNCS(nextafter)
+AC_REPLACE_FUNCS(setproctitle)
+AC_REPLACE_FUNCS(strchr)
+AC_REPLACE_FUNCS(strerror)
+AC_REPLACE_FUNCS(strlcat)
+AC_REPLACE_FUNCS(strlcpy)
+AC_REPLACE_FUNCS(strstr)
+AC_REPLACE_FUNCS(tgamma)
# for missing/setproctitle.c
AS_CASE(["$target_os"],
@@ -1848,17 +2225,51 @@ else
AC_LIBOBJ([signbit])
fi
+AC_CACHE_CHECK(for broken memmem, rb_cv_broken_memmem, [
+ AC_TRY_RUN([
+@%:@include <string.h>
+
+int
+main(int argc, char **argv)
+{
+ const char *str = "hogefugafoobar";
+ const char *rs = "foo";
+ const 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;
+ }
+ return 1;
+}
+ ],
+ rb_cv_broken_memmem=no,
+ rb_cv_broken_memmem=yes,
+ rb_cv_broken_memmem=yes)
+])
+test x"$rb_cv_broken_memmem" = xyes && ac_cv_func_memmem=no
+
+AC_FUNC_FORK
+
AC_CHECK_FUNCS(__syscall)
AC_CHECK_FUNCS(_longjmp) # used for AC_ARG_WITH(setjmp-type)
+# we don't use _setjmp if _longjmp doesn't exist.
+test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
AC_CHECK_FUNCS(_setjmp) # used for AC_ARG_WITH(setjmp-type)
AC_CHECK_FUNCS(_setjmpex) # used for AC_ARG_WITH(setjmp-type)
+AC_CHECK_FUNCS(atan2l atan2f)
AC_CHECK_FUNCS(chroot)
AC_CHECK_FUNCS(chsize)
AC_CHECK_FUNCS(clock_gettime)
AC_CHECK_FUNCS(cosh)
AC_CHECK_FUNCS(daemon)
+AC_CHECK_FUNCS(dirfd)
AC_CHECK_FUNCS(dl_iterate_phdr)
AC_CHECK_FUNCS(dlopen)
+AC_CHECK_FUNCS(dladdr)
AC_CHECK_FUNCS(dup)
AC_CHECK_FUNCS(dup3)
AC_CHECK_FUNCS(eaccess)
@@ -1867,24 +2278,31 @@ AC_CHECK_FUNCS(fchmod)
AC_CHECK_FUNCS(fchown)
AC_CHECK_FUNCS(fcntl)
AC_CHECK_FUNCS(fdatasync)
+AC_CHECK_FUNCS(fgetattrlist)
AC_CHECK_FUNCS(fmod)
-AC_CHECK_FUNCS(fork)
AC_CHECK_FUNCS(fsync)
AC_CHECK_FUNCS(ftruncate)
AC_CHECK_FUNCS(ftruncate64) # used for Win32 platform
+AC_CHECK_FUNCS(getattrlist)
AC_CHECK_FUNCS(getcwd)
+AC_CHECK_FUNCS(getgidx)
+AC_CHECK_FUNCS(getgrnam)
AC_CHECK_FUNCS(getgrnam_r)
AC_CHECK_FUNCS(getgroups)
AC_CHECK_FUNCS(getpgid)
AC_CHECK_FUNCS(getpgrp)
AC_CHECK_FUNCS(getpriority)
AC_CHECK_FUNCS(getpwnam_r)
+AC_CHECK_FUNCS(getresgid)
+AC_CHECK_FUNCS(getresuid)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(getsid)
AC_CHECK_FUNCS(gettimeofday) # for making ac_cv_func_gettimeofday
+AC_CHECK_FUNCS(getuidx)
AC_CHECK_FUNCS(gmtime_r)
AC_CHECK_FUNCS(initgroups)
AC_CHECK_FUNCS(ioctl)
+AC_CHECK_FUNCS(isfinite)
AC_CHECK_FUNCS(issetugid)
AC_CHECK_FUNCS(killpg)
AC_CHECK_FUNCS(lchmod)
@@ -1898,7 +2316,12 @@ AC_CHECK_FUNCS(malloc_usable_size)
AC_CHECK_FUNCS(malloc_size)
AC_CHECK_FUNCS(mblen)
AC_CHECK_FUNCS(memalign)
+AC_CHECK_FUNCS(memset_s)
+AC_CHECK_FUNCS(writev)
AC_CHECK_FUNCS(memrchr)
+AC_CHECK_FUNCS(memmem)
+AC_CHECK_FUNCS(mkfifo)
+AC_CHECK_FUNCS(mknod)
AC_CHECK_FUNCS(mktime)
AC_CHECK_FUNCS(pipe2)
AC_CHECK_FUNCS(poll)
@@ -1906,8 +2329,10 @@ AC_CHECK_FUNCS(posix_fadvise)
AC_CHECK_FUNCS(posix_memalign)
AC_CHECK_FUNCS(ppoll)
AC_CHECK_FUNCS(pread)
+AC_CHECK_FUNCS(qsort_r)
AC_CHECK_FUNCS(readlink)
AC_CHECK_FUNCS(round)
+AC_CHECK_FUNCS(sched_getaffinity)
AC_CHECK_FUNCS(seekdir)
AC_CHECK_FUNCS(select_large_fdset)
AC_CHECK_FUNCS(sendfile)
@@ -1948,10 +2373,44 @@ AC_CHECK_FUNCS(utimes)
AC_CHECK_FUNCS(wait4)
AC_CHECK_FUNCS(waitpid)
+AS_IF([test "$ac_cv_func_memset_s" = yes],
+ [RUBY_DEFINE_IF([!defined __STDC_WANT_LIB_EXT1__], [__STDC_WANT_LIB_EXT1__], 1)])
+
+AS_IF([test "$ac_cv_func_getcwd" = yes], [
+ AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_malloc],
+ [AC_TRY_RUN([
+@%:@include <stddef.h>
+@%:@include <stdio.h>
+@%:@ifdef HAVE_UNISTD_H
+@%:@include <unistd.h>
+@%:@endif
+@%:@ifndef EXIT_SUCCESS
+@%:@define EXIT_SUCCESS 0
+@%:@endif
+@%:@ifndef EXIT_FAILURE
+@%:@define EXIT_FAILURE 1
+@%:@endif
+
+int
+main(int argc, char **argv)
+{
+ if (!getcwd(NULL, 0)) return EXIT_FAILURE;
+ return EXIT_SUCCESS;
+}
+],
+ rb_cv_getcwd_malloc=yes,
+ rb_cv_getcwd_malloc=no,
+ AS_CASE($target_os,
+ [linux*|darwin*|*bsd|cygwin*|mingw*|mswin*],
+ [rb_cv_getcwd_malloc=yes],
+ [rb_cv_getcwd_malloc=no]))])
+ AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)])
+])
+
AC_DEFUN([RUBY_CHECK_BUILTIN_FUNC], [dnl
AC_CACHE_CHECK([for $1], AS_TR_SH(rb_cv_builtin_$1),
[AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([], [$2;])],
+ [AC_LANG_PROGRAM([int foo;], [$2;])],
[AS_TR_SH(rb_cv_builtin_$1)=yes],
[AS_TR_SH(rb_cv_builtin_$1)=no])])
if test "${AS_TR_SH(rb_cv_builtin_$1)}" != no; then
@@ -1963,9 +2422,111 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap64, [__builtin_bswap64(0)])
RUBY_CHECK_BUILTIN_FUNC(__builtin_clz, [__builtin_clz(0)])
RUBY_CHECK_BUILTIN_FUNC(__builtin_clzl, [__builtin_clzl(0)])
RUBY_CHECK_BUILTIN_FUNC(__builtin_clzll, [__builtin_clzll(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr, [__builtin_choose_expr(0, 0, 0)])
+RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr, [
+ [int x[__extension__(__builtin_choose_expr(1, 1, -1))]];
+ [int y[__extension__(__builtin_choose_expr(0, -1, 1))]];
+ ])
+if test x$rb_cv_builtin___builtin_choose_expr = xyes; then
+ RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [
+ [int x[__extension__(__builtin_choose_expr(__builtin_constant_p(1), 1, -1))]];
+ [int y[__extension__(__builtin_choose_expr(__builtin_constant_p(foo), -1, 1))]];
+ ])
+fi
RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatible_p(int, int)])
+if test "$ac_cv_func_qsort_r" != no; then
+ AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r,
+ [AC_TRY_COMPILE([
+@%:@include <stdlib.h>
+void qsort_r(void *base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *, void *),
+ void *arg);
+],[ ],
+ [rb_cv_gnu_qsort_r=yes],
+ [rb_cv_gnu_qsort_r=no])
+ ])
+ AC_CACHE_CHECK(whether qsort_r is BSD version, rb_cv_bsd_qsort_r,
+ [AC_TRY_COMPILE([
+@%:@include <stdlib.h>
+void qsort_r(void *base, size_t nmemb, size_t size,
+ void *arg, int (*compar)(void *, const void *, const void *));
+],[ ],
+ [rb_cv_bsd_qsort_r=yes],
+ [rb_cv_bsd_qsort_r=no])
+ ])
+ AS_CASE("$rb_cv_gnu_qsort_r:$rb_cv_bsd_qsort_r",
+ [yes:no], [
+ AC_DEFINE(HAVE_GNU_QSORT_R, 1)
+ ],
+ [no:yes], [
+ AC_DEFINE(HAVE_BSD_QSORT_R, 1)
+ ])
+fi
+
+AC_CACHE_CHECK(whether atan2 handles Inf as C99, rb_cv_atan2_inf_c99, [
+ AS_IF([test $ac_cv_func_atan2f:$ac_cv_func_atan2l = yes:yes], [
+ AC_TRY_RUN([
+@%:@include <math.h>
+@%:@ifdef HAVE_UNISTD_H
+@%:@include <unistd.h>
+@%:@endif
+@%:@ifndef EXIT_SUCCESS
+@%:@define EXIT_SUCCESS 0
+@%:@endif
+@%:@ifndef EXIT_FAILURE
+@%:@define EXIT_FAILURE 1
+@%:@endif
+
+int
+main(int argc, char **argv)
+{
+ if (fabs(atan2(INFINITY, INFINITY) - M_PI_4) <= 0.01) return EXIT_SUCCESS;
+ return EXIT_FAILURE;
+}
+],
+ [rb_cv_atan2_inf_c99=yes],
+ [rb_cv_atan2_inf_c99=no],
+ [AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=yes])]
+ )
+ ], [rb_cv_atan2_inf_c99=no])
+])
+AS_IF([test "x$rb_cv_atan2_inf_c99" = xyes], [AC_DEFINE(ATAN2_INF_C99)])
+
+AS_IF([test "x$ac_cv_func_lgamma_r" = xyes], [
+ AC_CACHE_CHECK(whether lgamma_r handles -0.0, rb_cv_lgamma_r_m0, [
+ AC_TRY_RUN([
+@%:@include <math.h>
+@%:@ifdef HAVE_UNISTD_H
+@%:@include <unistd.h>
+@%:@endif
+@%:@ifndef EXIT_SUCCESS
+@%:@define EXIT_SUCCESS 0
+@%:@endif
+@%:@ifndef EXIT_FAILURE
+@%:@define EXIT_FAILURE 1
+@%:@endif
+
+int
+main(int argc, char **argv)
+{
+ int sign;
+ double x = lgamma_r(-0.0, &sign);
+
+ /* should be [+inf, -1] */
+ if (x <= 0) return EXIT_FAILURE;
+ if (!isinf(x)) return EXIT_FAILURE;
+ if (sign != -1) return EXIT_FAILURE;
+ return EXIT_SUCCESS;
+}
+],
+ [rb_cv_lgamma_r_m0=yes],
+ [rb_cv_lgamma_r_m0=no],
+ [rb_cv_lgamma_r_m0=yes]
+ )
+ ])
+ AS_IF([test "x$rb_cv_lgamma_r_m0" = xno], [AC_DEFINE(LGAMMA_R_M0_FIX)])
+])
+
# Some platform need -lrt for clock_gettime, but the other don't.
if test x"$ac_cv_func_clock_gettime" != xyes; then
# glibc 2.17 moves clock_* functions from librt to the main C library.
@@ -1995,17 +2556,32 @@ AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp,
ac_cv_func_sigsetjmp=yes,
ac_cv_func_sigsetjmp=no)])
+AC_DEFUN([RUBY_CHECK_BUILTIN_SETJMP], [
+if test x"${ac_cv_func___builtin_setjmp}" = xyes; then
+ unset ac_cv_func___builtin_setjmp
+fi
AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
-[AC_TRY_LINK([@%:@include <setjmp.h>
- jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
- [__builtin_setjmp(jb);],
- [ac_cv_func___builtin_setjmp=yes],
- [ac_cv_func___builtin_setjmp=no])
+ [
+ ac_cv_func___builtin_setjmp=no
+ for cast in "" "(void **)"; do
+ RUBY_WERROR_FLAG(
+ [AC_TRY_LINK([@%:@include <setjmp.h>
+ @%:@include <stdio.h>
+ jmp_buf jb;
+ void t(void) {__builtin_longjmp($cast jb, 1);}
+ int jump(void) {(void)(__builtin_setjmp($cast jb) ? 1 : 0); return 0;}],
+ [
+ void (*volatile f)(void) = t;
+ if (!jump()) printf("%d\n", f != 0);
+ ],
+ [ac_cv_func___builtin_setjmp="yes with cast ($cast)"])
+ ])
+ test "$ac_cv_func___builtin_setjmp" = no || break
+ done])
])
-# we don't use _setjmp if _longjmp doesn't exist.
-test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
-
+AC_DEFUN([RUBY_SETJMP_TYPE], [
+RUBY_CHECK_BUILTIN_SETJMP
AC_MSG_CHECKING(for setjmp type)
setjmp_suffix=
AC_ARG_WITH(setjmp-type,
@@ -2019,11 +2595,13 @@ AC_ARG_WITH(setjmp-type,
[setjmpex], [ setjmp_prefix= setjmp_suffix=ex],
[''], [ unset setjmp_prefix],
[ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
+setjmp_cast=
if test ${setjmp_prefix+set}; then
if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp${setjmp_suffix} = no; then
AC_MSG_ERROR(${setjmp_prefix}setjmp${setjmp_suffix} is not available)
fi
-elif test "$ac_cv_func___builtin_setjmp" = yes; then
+elif { AS_CASE("$ac_cv_func___builtin_setjmp", [yes*], [true], [false]) }; then
+ setjmp_cast=`expr "$ac_cv_func___builtin_setjmp" : "yes with cast (\(.*\))"`
setjmp_prefix=__builtin_
setjmp_suffix=
elif test "$ac_cv_header_setjmpex_h:$ac_cv_func__setjmpex" = yes:yes; then
@@ -2044,10 +2622,11 @@ if test x$setjmp_prefix = xsig; then
else
unset setjmp_sigmask
fi
-AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix})
-AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}(env${setjmp_sigmask+,0})])
-AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
+AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix}${setjmp_cast:+\($setjmp_cast\)})
+AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}($setjmp_cast(env)${setjmp_sigmask+,0})])
+AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp($setjmp_cast(env),val)])
AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
+])
# End of setjmp check.
AC_ARG_ENABLE(setreuid,
@@ -2245,6 +2824,14 @@ if test "$ac_cv_func_setpgid:$ac_cv_func_setpgrp" = no:yes; then
AC_FUNC_SETPGRP
fi
+if test x"$ac_cv_func_dirfd" = xno; then
+ AS_CASE(["$target_os"],[solaris*],
+ [AC_CHECK_MEMBERS([DIR.d_fd, DIR.dd_fd],,,[
+#include <sys/types.h>
+#include <dirent.h>
+])])
+fi
+
if test x"$target_cpu" = xia64; then
AC_LIBOBJ([ia64])
AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
@@ -2270,70 +2857,10 @@ 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)"
-for fcnt in dnl
- _cnt dnl
- __cnt dnl
- _r dnl
- readCount dnl
- _rcount dnl for emx0.9c
-; do
- AC_TRY_COMPILE([#include <stdio.h>
-],
- [FILE *f = stdin; f->$fcnt = 0;],
- [rb_cv_fcnt="$fcnt"; break])
-done])
-AS_CASE("$rb_cv_fcnt",
- ["not found"*], [rb_cv_fcnt="not found"],
- [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
- _ptr dnl
- __ptr dnl
- bufpos dnl
- _p dnl
- __bufpos dnl
-; do
- AC_TRY_COMPILE([#include <stdio.h>
-],
- [FILE *f = stdin; char buf[256]; f->$frptr = buf;],
- rb_cv_frptr="$frptr"; break,
- rb_cv_frptr="not found")
-done])
-if test "$rb_cv_frptr" != "not found"; then
- AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
-
- if test "$rb_cv_fcnt" = "not found"; then
- AC_CACHE_CHECK([read buffer end field in FILE structures], rb_cv_frend,
- [for frend in dnl
- _IO_read_end dnl
- bufread dnl
- __bufread dnl
- ; do
- AC_TRY_COMPILE([#include <stdio.h>
- ],
- [FILE *f = stdin; char buf[256]; f->$frend = buf;],
- rb_cv_frend="$frend"; break,
- rb_cv_frend="not found")
- done])
- if test "$rb_cv_frend" != "not found"; then
- AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
- fi
- fi
-fi
-
if test x"$ac_cv_func_gettimeofday" != xyes; then
AC_MSG_ERROR(gettimeofday() must exist)
fi
-RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
-
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),
@@ -2350,7 +2877,7 @@ if test "$ac_cv_func_sysconf" = yes; then
RUBY_CHECK_SYSCONF(CLK_TCK)
fi
-AC_DEFUN(RUBY_STACK_GROW_DIRECTION, [
+AC_DEFUN([RUBY_STACK_GROW_DIRECTION], [
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"],
@@ -2431,25 +2958,104 @@ if test x"$enable_pthread" = xyes; then
else
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
fi
+ AC_CACHE_CHECK([whether pthread_t is scalar type], [rb_cv_scalar_pthread_t], [
+ AC_TRY_COMPILE([
+ @%:@include <pthread.h>
+ ], [
+ pthread_t thread_id;
+ thread_id = 0;
+ if (!thread_id) return 0;
+ ], [rb_cv_scalar_pthread_t=yes], [rb_cv_scalar_pthread_t=no])
+ ])
+ if test x"$rb_cv_scalar_pthread_t" = xyes; then
+ : # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include <pthread.h>])
+ else
+ AC_DEFINE(NON_SCALAR_THREAD_ID)
+ fi
AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
- pthread_getattr_np pthread_attr_get_np pthread_attr_getstack\
+ pthread_attr_get_np pthread_attr_getstack\
pthread_get_stackaddr_np pthread_get_stacksize_np \
thr_stksegment pthread_stackseg_np pthread_getthrds_np \
pthread_cond_init pthread_condattr_setclock pthread_condattr_init \
- pthread_sigmask)
+ pthread_sigmask pthread_setname_np pthread_set_name_np)
+ AS_CASE(["$target_os"],[aix*],[ac_cv_func_pthread_getattr_np=no],[AC_CHECK_FUNCS(pthread_getattr_np)])
if test "${host_os}" = "nacl"; then
ac_cv_func_pthread_attr_init=no
else
AC_CHECK_FUNCS(pthread_attr_init)
fi
+ set_current_thread_name=
+ if test "$ac_cv_func_pthread_setname_np" = yes; then
+ AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_setname_np_arguments],
+ [rb_cv_func_pthread_setname_np_arguments=
+ # Linux,AIX, (pthread_self(), name)
+ # NetBSD (pthread_self(), name, \"%s\")
+ # Darwin (name)
+ for mac in \
+ "(pthread_self(), name)" \
+ "(pthread_self(), name, \"%s\")" \
+ "(name)" \
+ ; do
+ AC_TRY_COMPILE([
+ @%:@include <pthread.h>
+ @%:@ifdef HAVE_PTHREAD_NP_H
+ @%:@include <pthread_np.h>
+ @%:@endif
+ @%:@define SET_THREAD_NAME(name) pthread_setname_np${mac}
+ ],
+ [if (SET_THREAD_NAME("conftest")) return 1;],
+ [rb_cv_func_pthread_setname_np_arguments="${mac}"
+ break])
+ done
+ ]
+ )
+ if test -n "${rb_cv_func_pthread_setname_np_arguments}"; then
+ set_current_thread_name="pthread_setname_np${rb_cv_func_pthread_setname_np_arguments}"
+ fi
+ elif test "$ac_cv_func_pthread_set_name_np" = yes; then
+ set_current_thread_name="pthread_set_name_np(pthread_self(), name)"
+ fi
+ AS_IF([test -n "$set_current_thread_name"], [
+ AC_DEFINE_UNQUOTED(SET_CURRENT_THREAD_NAME(name), $set_current_thread_name)
+ AS_CASE([$set_current_thread_name],
+ [*'pthread_self()'*], [
+ set_another_thread_name=`echo "$set_current_thread_name" | sed 's/pthread_self()/thid/'`
+ AC_DEFINE_UNQUOTED(SET_ANOTHER_THREAD_NAME(thid,name), $set_another_thread_name)
+ ])
+ ])
+fi
+
+if test x"$ac_cv_header_ucontext_h" = xno; then
+ AC_CACHE_CHECK([if signal.h defines ucontext_t], [rb_cv_ucontext_in_signal_h],
+ [AC_TRY_COMPILE([@%:@include <signal.h>],
+ [size_t size = sizeof(ucontext_t);],
+ [rb_cv_ucontext_in_signal_h=yes], [rb_cv_ucontext_in_signal_h=no])])
+ if test x"$rb_cv_ucontext_in_signal_h" = xyes; then
+ AC_DEFINE_UNQUOTED(UCONTEXT_IN_SIGNAL_H, 1)
+ fi
fi
-if test x"$ac_cv_header_ucontext_h" = xyes; then
+if test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" = xyes; then
+ AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr],
+ [AC_TRY_COMPILE([
+ @%:@include <signal.h>
+ @%:@ifdef HAVE_UCONTEXT_H
+ @%:@include <ucontext.h>
+ @%:@endif
+ mcontext_t test(mcontext_t mc) {return mc+1;}
+ ],
+ [test(0);],
+ [rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])])
+ if test x"$rb_cv_mcontext_t_ptr" = xyes; then
+ AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext)
+ else
+ AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->uc_mcontext)
+ fi
if test x"$rb_with_pthread" = xyes; then
AC_CHECK_FUNCS(getcontext setcontext)
fi
fi
-if test "$ac_cv_func_fork" = "yes" -a "$rb_with_pthread" = "yes"; then
+if test "$ac_cv_func_fork_works" = "yes" -a "$rb_with_pthread" = "yes"; then
AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
[AC_TRY_RUN([
#include <stdlib.h>
@@ -2533,8 +3139,8 @@ AC_ARG_WITH(dln-a-out,
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
[AC_TRY_LINK([],[], [
-AS_CASE(["`head -1 conftest$EXEEXT | cat -e`"],
-['^?ELF'*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
+AS_CASE(["`head -1 conftest$EXEEXT | tr -dc '\177ELF' | tr '\177' .`"],
+[.ELF*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
rb_cv_binary_elf=no)])
if test "$rb_cv_binary_elf" = yes; then
@@ -2567,9 +3173,9 @@ AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
+AC_SUBST(ASMEXT, S)dnl
STATIC=
-: ${PATHFLAG=''}
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
@@ -2585,7 +3191,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)],
- [bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ],
+ [bsdi*|cygwin*|mingw*|aix*|interix*], [ ],
[
RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
else
@@ -2602,20 +3208,14 @@ if test "$with_dln_a_out" != yes; then
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"
- fi
AS_CASE(["$target_os"],
[hpux*], [ DLDFLAGS="$DLDFLAGS -E"
: ${LDSHARED='$(LD) -b'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
: ${LIBPATHENV=SHLIB_PATH}
- if test "$rb_cv_prog_gnu_ld" = no; then
- RPATHFLAG=' +b %1$-s'
- fi
rb_cv_dlopen=yes],
- [solaris*], [ if test "$GCC" = yes; then
+ [solaris*], [ if test "$GCC" = yes; then
: ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_prog_gnu_ld" = yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
@@ -2625,6 +3225,10 @@ if test "$with_dln_a_out" != yes; then
fi
if test "$ac_cv_sizeof_voidp" = 8; then
: ${LIBPATHENV=LD_LIBRARY_PATH_64}
+ : ${PRELOADENV=LD_PRELOAD_64}
+ else
+ : ${LIBPATHENV=LD_LIBRARY_PATH_32}
+ : ${PRELOADENV=LD_PRELOAD_32}
fi
rb_cv_dlopen=yes],
[sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
@@ -2642,7 +3246,7 @@ if test "$with_dln_a_out" != yes; then
[bsdi3*], [ AS_CASE(["$CC"],
[*shlicc*], [ : ${LDSHARED='$(CC) -r'}
rb_cv_dlopen=yes])],
- [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu], [
+ [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu | haiku*], [
: ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
@@ -2656,7 +3260,7 @@ if test "$with_dln_a_out" != yes; then
: ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -rdynamic"
- DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
+ DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
else
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
fi
@@ -2667,20 +3271,9 @@ if test "$with_dln_a_out" != yes; then
fi
rb_cv_dlopen=yes],
[darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
- RUBY_APPEND_OPTIONS(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 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"
- fi
+ : ${PRELOADENV=DYLD_INSERT_LIBRARIES}
rb_cv_dlopen=yes],
[aix*], [ : ${LDSHARED='$(CC)'}
LDSHARED="$LDSHARED ${linker_flag}-G"
@@ -2691,33 +3284,7 @@ if test "$with_dln_a_out" != yes; then
TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
: ${LIBPATHENV=LIBPATH}
- RPATHFLAG=" ${linker_flag}-blibpath:%1\$-s:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
- rb_cv_dlopen=yes],
- [beos*], [ AS_CASE(["$target_cpu"],
- [powerpc*], [
- : ${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_ -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'}
- EXTDLDFLAGS='-export $(TARGET_ENTRY)'
- DLDFLAGS="$DLDFLAGS -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
- ],
- [i586*], [
- : ${LDSHARED='$(CC) -shared'}
- ])
- : ${LIBPATHENV=LIBRARY_PATH}
- rb_cv_dlopen=yes ],
[nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
: ${LDSHARED='$(LD) -Bshareable -x'}
LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
@@ -2727,15 +3294,36 @@ if test "$with_dln_a_out" != yes; then
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
: ${LIBPATHENV=""}
+ : ${PRELOADENV=""}
rb_cv_dlopen=yes],
[hiuxmpp], [ : ${LDSHARED='$(LD) -r'}],
[atheos*], [ : ${LDSHARED='$(CC) -shared'}
rb_cv_dlopen=yes],
- [os2-emx*], [ LDFLAGS="$LDFLAGS -Zomf"
- ],
[nacl], [ LDSHARED='$(CC) -shared' ],
- [ : ${LDSHARED='$(LD)'}])
+ [ : ${LDSHARED='$(LD)'}])
AC_MSG_RESULT($rb_cv_dlopen)
+
+ if test "$rb_cv_dlopen" = yes; then
+ AS_CASE(["$target_os"],
+ [darwin*], [
+ for flag in \
+ "-undefined dynamic_lookup" \
+ "-multiply_defined suppress" \
+ ; do
+ test "x${linker_flag}" = x || flag="${linker_flag}`echo ${flag} | tr ' ' ,`"
+ RUBY_TRY_LDFLAGS([$flag], [], [flag=])
+ if test "x$flag" != x; then
+ RUBY_APPEND_OPTIONS(DLDFLAGS, [$flag])
+ fi
+ done
+ ])
+ fi
+
+ AS_IF([test "$enable_rpath:${RPATHFLAG}" = yes:], [
+ AS_IF([test "x$rpathflag" != x], [
+ RPATHFLAG=" ${rpathflag}%1\$-s"
+ ])
+ ])
fi
if test "${LDSHAREDXX}" = ""; then
AS_CASE(["${LDSHARED}"],
@@ -2757,13 +3345,39 @@ AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
+AC_SUBST(PRELOADENV, "${PRELOADENV-LD_PRELOAD}")
AC_SUBST(TRY_LINK)
+if test "x$OPT_DIR" != x; then
+ pat=`echo "${LDFLAGS_OPTDIR}" | sed ['s/[][\\.*|]/\\\\&/']`
+ LDFLAGS=`echo "${LDFLAGS}" | sed "s| ${pat}||"`
+ val=`IFS="$PATH_SEPARATOR"
+ for dir in $OPT_DIR; 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' ' ' | sed 's/ *$//'`
+ if test x"$val" != x; then
+ test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
+ LDFLAGS="$LDFLAGS$val"
+ test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
+ DLDFLAGS="$DLDFLAGS$val"
+ fi
+ LDFLAGS_OPTDIR="$val"
+fi
+
+AS_CASE(["$target_os"],
+[freebsd*], [
+ AC_CHECK_LIB([procstat], [procstat_open_sysctl])
+ if test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes; then
+ AC_CHECK_FUNCS(procstat_getvmmap)
+ fi
+ ])
AS_CASE(["$target_cpu-$target_os"],
[*-darwin*], [
AC_CHECK_HEADERS([execinfo.h])
if test "x$ac_cv_header_execinfo_h" = xyes; then
AC_CHECK_LIB([execinfo], [backtrace])
+ AC_CHECK_HEADERS([libunwind.h])
fi],
[*-freebsd*|x86_64-netbsd*], [
AC_CHECK_HEADERS([execinfo.h])
@@ -2792,24 +3406,25 @@ void sigsegv(int signum, siginfo_t *info, void *ctx){
if (n > 0) {
/*fprintf(stdout, "backtrace:%d\n",n);*/
} else {
- abort();
+ _exit(EXIT_FAILURE);
}
- _exit(0);
+ _exit(EXIT_SUCCESS);
}
int
-main()
+main(void)
{
+ volatile int *a = NULL;
stack_t ss;
ss.ss_sp = malloc(SIGSTKSZ);
if (ss.ss_sp == NULL) {
fprintf(stderr, "cannot allocate memory for sigaltstack\n");
- abort();
+ return EXIT_FAILURE;
}
ss.ss_size = SIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) == -1) {
fprintf(stderr, "sigaltstack failed\n");
- abort();
+ return EXIT_FAILURE;
}
struct sigaction sa;
memset(&sa, 0, sizeof(struct sigaction));
@@ -2818,9 +3433,8 @@ main()
sa.sa_flags |= SA_SIGINFO;
sa.sa_flags |= SA_ONSTACK;
sigaction(SIGSEGV, &sa, NULL);
- int *a = NULL;
a[0] = 1;
- return 0;
+ return EXIT_SUCCESS;
}
],
rb_cv_broken_backtrace=no,
@@ -2871,9 +3485,6 @@ else
[darwin*], [
RUBY_APPEND_OPTION(XLDFLAGS, [-Wl,-u,_objc_msgSend])
DLEXT=bundle],
- [os2-emx*], [
- LOAD_RELATIVE=1
- DLEXT=dll],
[cygwin*|mingw*|*djgpp*], [
LOAD_RELATIVE=1
DLEXT=so],
@@ -2881,7 +3492,6 @@ else
DLEXT=so])
fi
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
fi
@@ -2922,16 +3532,27 @@ EXTSTATIC=
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
+ [AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static],[no],[],[EXTSTATIC="$withval"])])
+AS_CASE([",$EXTSTATIC,"], [,static,|*,enc,*], [
ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
EXTOBJS='ext/extinit.$(OBJEXT)'
AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
-fi
+ AC_SUBST(ENCSTATIC, static)
+], [
+ ENCOBJS='dmyenc.$(OBJEXT)'
+ EXTOBJS='dmyext.$(OBJEXT)'
+])
AC_SUBST(ENCOBJS)
AC_SUBST(EXTOBJS)
-if test -f "$srcdir/ext/Setup.$target_os"; then
+AC_ARG_WITH(setup,
+ AS_HELP_STRING([--with-setup=SETUP], [use extension libraries setup]),
+ [setup=$withval])
+if test -n "$setup"; then
+ if ! test -f "ext/$setup" -o -f "$srcdir/ext/$setup"; then
+ AC_MSG_ERROR(Setup file $setup not found under ext or $srcdir/ext)
+ fi
+elif test -f "$srcdir/ext/Setup.$target_os"; then
setup="Setup.$target_os"
else
setup=
@@ -2985,6 +3606,7 @@ if test x"$cross_compiling" = xyes; then
RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
RUNRUBY='$(RUNRUBY_COMMAND)'
XRUBY='$(MINIRUBY)'
+ BOOTSTRAPRUBY='$(BASERUBY)'
TEST_RUNNABLE=no
CROSS_COMPILING=yes
@@ -3008,6 +3630,7 @@ else
RUNRUBY_COMMAND='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)'
RUNRUBY='$(RUNRUBY_COMMAND) --'
XRUBY='$(RUNRUBY)'
+ BOOTSTRAPRUBY='$(MINIRUBY)'
TEST_RUNNABLE=yes
CROSS_COMPILING=no
fi
@@ -3019,6 +3642,7 @@ AC_SUBST(PREP)
AC_SUBST(RUNRUBY_COMMAND)
AC_SUBST(RUNRUBY)
AC_SUBST(XRUBY)
+AC_SUBST(BOOTSTRAPRUBY)
AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
FIRSTMAKEFILE=""
@@ -3029,7 +3653,7 @@ LIBRUBYARG='$(LIBRUBYARG_STATIC)'
SOLIBS=
AS_CASE(["$target_os"],
- [cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [
+ [cygwin*|mingw*|haiku*|darwin*], [
: ${DLDLIBS=""}
],
[
@@ -3097,7 +3721,7 @@ AS_CASE("$enable_shared", [yes], [
[sunos4*], [
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
],
- [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
+ [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu | haiku*], [
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'" $LDFLAGS_OPTDIR"
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
if test "$load_relative" = yes; then
@@ -3149,12 +3773,6 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
SOLIBS='-lm -lc'
],
- [beos*], [
- AS_CASE(["$target_cpu"],
- [powerpc*], [
- LIBRUBY_DLDFLAGS="-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o $LDFLAGS_OPTDIR"
- ])
- ],
[darwin*], [
RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
@@ -3163,10 +3781,11 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBY_RELATIVE=yes
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(MAJOR).$(MINOR)'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(RUBY_PROGRAM_VERSION)'
if test "$visibility_option" = ld; then
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_ruby_static_id_*'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
@@ -3184,12 +3803,10 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBYARG_SHARED=
# enable PIE if possible
- pie=
+ AC_ARG_ENABLE(pie,
+ AS_HELP_STRING([--disable-pie], [disable PIE feature]),
+ [pie=$enableval], [pie=])
AS_CASE(["$target_os"],
- [haiku], [
- # gcc supports PIE, but doesn't work correctly in Haiku
- pie=no
- ],
[nacl], [
# -pie implies -shared for NaCl.
pie=no
@@ -3217,8 +3834,13 @@ AS_CASE("$enable_shared", [yes], [
])
if test "$enable_rpath" = yes; then
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
- LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix}"
- test "x$cross_compiling" = xyes || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS -L${libprefix}"
+ rpathflag="${RPATHFLAG}"
+ AS_CASE(["${cross_compiling}${load_relative}"], [*yes*], [], [rpathflag="$RPATHFLAG$LIBPATHFLAG"])
+ rpathflag=`IFS="$PATH_SEPARATOR"
+ echo x "$rpathflag" |
+ sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${libprefix}${IFS}g"
+ `
+ LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${rpathflag}"
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
fi
@@ -3234,6 +3856,15 @@ if test "$EXEEXT" = .exe; then
AC_SUBST(EXECUTABLE_EXTS)
fi
+AS_CASE("$cross_compiling:${LIBPATHENV}", [yes:* | no:], [], [
+ AC_MSG_CHECKING(whether wrapper for $LIBPATHENV is needed)
+ AS_IF([env ${LIBPATHENV}=/lib /bin/sh -c ': ${'${LIBPATHENV}'?}' 2>/dev/null],
+ [AC_MSG_RESULT(no)],
+ [PREP="$PREP"' ruby-runner$(EXEEXT)'
+ AC_MSG_RESULT(yes)]
+ )
+])
+
AC_ARG_ENABLE(dtrace,
AS_HELP_STRING([--enable-dtrace],
[enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
@@ -3249,6 +3880,7 @@ if test "${enable_dtrace}" = "auto"; then
fi
LIBRUBY_A_OBJS='$(OBJS)'
+DTRACE_REBUILD=
if test "${enable_dtrace}" = "yes"; then
if test -z "$DTRACE"; then
AC_MSG_ERROR([dtrace(1) is missing])
@@ -3261,9 +3893,11 @@ if test "${enable_dtrace}" = "yes"; then
AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
fi
RUBY_DTRACE_POSTPROCESS()
- if test "$rb_cv_prog_dtrace_g" = 'yes'; then
+ if test "$rb_cv_prog_dtrace_g" != 'no'; then
DTRACE_OBJ='probes.$(OBJEXT)'
- DTRACE_GLOMMED_OBJ='ruby-glommed.$(OBJEXT)'
+ fi
+ if test "$rb_cv_prog_dtrace_g" = 'rebuild'; then
+ DTRACE_REBUILD=yes
LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
fi
AS_CASE("${target_os}", [freebsd*], [
@@ -3277,9 +3911,10 @@ else
fi
AC_SUBST(DTRACE_EXT)
AC_SUBST(DTRACE_OBJ)
-AC_SUBST(DTRACE_GLOMMED_OBJ)
+AC_SUBST(DTRACE_REBUILD)
AC_SUBST(LIBRUBY_A_OBJS)
+RUBY_SETJMP_TYPE
}
{ # build section
@@ -3287,14 +3922,14 @@ dnl build rdoc index if requested
RDOCTARGET=""
CAPITARGET=""
AC_ARG_ENABLE(install-doc,
- AS_HELP_STRING([--disable-install-doc], [do not install neither rdoc indexes nor C API documents during install]),
+ AS_HELP_STRING([--disable-install-doc], [do not install either rdoc indexes or C API documents during install]),
[install_doc=$enableval], [install_doc=yes])
AC_ARG_ENABLE(install-rdoc,
AS_HELP_STRING([--disable-install-rdoc], [do not install rdoc indexes during install]),
[install_rdoc=$enableval], [install_rdoc=yes])
AC_ARG_ENABLE(install-capi,
AS_HELP_STRING([--disable-install-capi], [do not install C API documents during install]),
- [install_capi=$enableval], [install_capi=yes])
+ [install_capi=$enableval], [install_capi=no])
if test "$install_doc" != no; then
if test "$install_rdoc" != no; then
@@ -3349,13 +3984,6 @@ AS_CASE(["$target_os"],
RUBY_APPEND_OPTION(XLDFLAGS, [-framework CoreFoundation])
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework CoreFoundation])
],
- [os2-emx], [
- AC_LIBOBJ([os2])
- 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//'`
- ],
[osf*], [
if test "$GCC" != "yes" ; then
# compile something small: taint.c is fine for this.
@@ -3371,10 +3999,6 @@ AS_CASE(["$target_os"],
CFLAGS="$CFLAGS -std"
fi
],
- [beos*], [
- AS_CASE(["$target_cpu"],[powerpc*], [CFLAGS="$CFLAGS -relax_pointers"])
- CPPFLAGS="$CPPFLAGS -I/boot/home/config/include"
- ],
[cygwin*|mingw*], [
RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)$(TEENY)'
LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
@@ -3424,9 +4048,6 @@ AS_CASE(["$target_os"],
FIRSTMAKEFILE=GNUmakefile:nacl/GNUmakefile.in
])
-AS_CASE(["$with_gmp: $SOLIBS "], [no:* | *' -lgmp '*|*' $(LIBS) '*], [],
- [SOLIBS="-lgmp $SOLIBS"])
-
MINIOBJS="$MINIDLNOBJ"
AS_CASE(["$THREAD_MODEL"],
@@ -3505,44 +4126,12 @@ if test "${universal_binary-no}" = yes ; then
mv -f confdefs1.h confdefs.h
AC_MSG_ERROR([failed])
])])
+ AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
+ AC_TRY_COMPILE([@%:@include <stdio.h>
+ const char arch[[]] = __ARCHITECTURE__;], [puts(arch);],
+ [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
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
@@ -3667,7 +4256,7 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
elif test -z "${ruby_version}"; then
AC_MSG_ERROR([No ruby version, No place for bundled libraries])
else
- RUBY_LIB_VERSION="\"${ruby_version}\""
+ RUBY_LIB_VERSION="${ruby_version}"
fi
AC_SUBST(RUBY_LIB_VERSION_STYLE)
AC_SUBST(RUBY_LIB_VERSION)
@@ -3720,13 +4309,11 @@ AC_SUBST(vendordir)dnl
AC_SUBST(vendorlibdir)dnl
AC_SUBST(vendorarchdir)dnl
+AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl
AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
if test "${universal_binary-no}" = yes ; then
arch="universal-${target_os}"
- AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
- 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__)
else
@@ -3745,7 +4332,8 @@ if test "${universal_binary-no}" = yes ; then
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
else
arch="${target_cpu}-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
+ AS_CASE(["$arch"], [le32-nacl], [arch="pnacl"])
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")
fi
unset sitearch
@@ -3803,7 +4391,7 @@ AC_ARG_WITH(mantype,
AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
[
AS_CASE(["$withval"],
- [man|doc], [MANTYPE=$withval],
+ [man|man.gz|man.bz2|doc|doc.gz|doc.bz2], [MANTYPE=$withval],
[AC_MSG_ERROR(invalid man type: $withval)])
])
if test -z "$MANTYPE"; then
@@ -3837,7 +4425,10 @@ guard=INCLUDE_RUBY_CONFIG_H
grep -v "^#define PACKAGE_" confdefs.h
echo "#endif /* $guard */"
} | tr -d '\015' |
-${srcdir}/tool/ifchange "${config_h}" -
+(
+ if test "x$CONFIGURE_TTY" = xyes; then color=--color; else color=; fi
+ exec ${srcdir}/tool/ifchange $color "${config_h}" -
+) || AC_MSG_ERROR([failed to create ${config_h}])
tr -d '\015' < largefile.h > confdefs.h
rm largefile.h
@@ -3845,7 +4436,7 @@ BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[ ]*=/{' \
-e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
-e '}' "${srcdir}/enc/Makefile.in"`"]
BUILTIN_ENCOBJS=
-for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS `basename $e .c`"'.$(OBJEXT)'; done
+for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS "`echo $e | sed 's/\.c$/.$(OBJEXT)/'`; done
AC_SUBST(BUILTIN_ENCOBJS)
BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
@@ -3854,15 +4445,15 @@ BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
BUILTIN_TRANSSRCS=
BUILTIN_TRANSOBJS=
for e in $BUILTIN_TRANSES; do
- BUILTIN_TRANSSRCS="$BUILTIN_TRANSSRCS `basename $e .trans`"'.c';
- BUILTIN_TRANSOBJS="$BUILTIN_TRANSOBJS `basename $e .trans`"'.$(OBJEXT)';
+ BUILTIN_TRANSSRCS="$BUILTIN_TRANSSRCS "`echo $e | sed 's/\.trans$/.c/'`
+ BUILTIN_TRANSOBJS="$BUILTIN_TRANSOBJS "`echo $e | sed 's/\.trans$/.$(OBJEXT)/'`
done
AC_SUBST(BUILTIN_TRANSSRCS)
AC_SUBST(BUILTIN_TRANSOBJS)
PACKAGE=$RUBY_BASE_NAME
AC_SUBST(PACKAGE)
-AC_MSG_RESULT($PACKAGE library version = $ruby_version)
+AS_MESSAGE([$PACKAGE library version = $ruby_version])
AS_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
@@ -3888,6 +4479,7 @@ AC_CONFIG_FILES(Makefile, [
["git svn"], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
[git], [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
[VCSUP='$(VCS)'])
+ sed -n 's/^@%:@define \(RUBY_RELEASE_DATE\) "\(.*\)"/\1 = \2/p' "$srcdir/version.h"
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
@@ -3913,12 +4505,17 @@ AC_CONFIG_FILES(Makefile, [
[EXEEXT='$EXEEXT' gnumake='$gnumake'])
AC_ARG_WITH([ruby-pc],
- AC_HELP_STRING([pc file basename]),
+ AC_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]),
[ruby_pc="$withval"],
[ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
AC_SUBST(ruby_pc)
AC_SUBST(exec, [exec])
+AC_ARG_WITH(destdir,
+ AS_HELP_STRING([--with-destdir=DESTDIR], [specify default directory to install]),
+ [DESTDIR="$withval"])
+AC_SUBST(DESTDIR)
+
AC_CONFIG_FILES($ruby_pc:template/ruby.pc.in,
[
if sed ['s/\$(\([A-Za-z_][A-Za-z0-9_]*\))/${\1}/g;s/@[A-Za-z_][A-Za-z0-9_]*@//'] $ruby_pc > ruby.tmp.pc &&
diff --git a/constant.h b/constant.h
index 3dc9b8d4ef..23d17ac24c 100644
--- a/constant.h
+++ b/constant.h
@@ -12,19 +12,32 @@
#define CONSTANT_H
typedef enum {
+ CONST_DEPRECATED = 0x100,
+
+ CONST_VISIBILITY_MASK = 0xff,
CONST_PUBLIC = 0x00,
- CONST_PRIVATE = 0x01
+ CONST_PRIVATE,
+ CONST_VISIBILITY_MAX
} rb_const_flag_t;
+#define RB_CONST_PRIVATE_P(ce) \
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
+#define RB_CONST_PUBLIC_P(ce) \
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)
+
+#define RB_CONST_DEPRECATED_P(ce) \
+ ((ce)->flag & CONST_DEPRECATED)
+
typedef struct rb_const_entry_struct {
rb_const_flag_t flag;
+ int line;
const VALUE value; /* should be mark */
const VALUE file; /* should be mark */
- int line;
} rb_const_entry_t;
-VALUE rb_mod_private_constant(int argc, VALUE *argv, VALUE obj);
-VALUE rb_mod_public_constant(int argc, VALUE *argv, VALUE obj);
+VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj);
+VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj);
+VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
void rb_free_const_table(st_table *tbl);
VALUE rb_public_const_get(VALUE klass, ID id);
VALUE rb_public_const_get_at(VALUE klass, ID id);
@@ -32,5 +45,6 @@ VALUE rb_public_const_get_from(VALUE klass, ID id);
int rb_public_const_defined(VALUE klass, ID id);
int rb_public_const_defined_at(VALUE klass, ID id);
int rb_public_const_defined_from(VALUE klass, ID id);
+rb_const_entry_t *rb_const_lookup(VALUE klass, ID id);
#endif /* CONSTANT_H */
diff --git a/cont.c b/cont.c
index fa9e91ee64..b2e48c6202 100644
--- a/cont.c
+++ b/cont.c
@@ -9,7 +9,6 @@
**********************************************************************/
-#include "ruby/ruby.h"
#include "internal.h"
#include "vm_core.h"
#include "gc.h"
@@ -89,24 +88,26 @@ enum context_type {
typedef struct rb_context_struct {
enum context_type type;
- VALUE self;
int argc;
+ VALUE self;
VALUE value;
VALUE *vm_stack;
#ifdef CAPTURE_JUST_VALID_VM_STACK
size_t vm_stack_slen; /* length of stack (head of th->stack) */
size_t vm_stack_clen; /* length of control frames (tail of th->stack) */
#endif
- VALUE *machine_stack;
- VALUE *machine_stack_src;
+ struct {
+ VALUE *stack;
+ VALUE *stack_src;
+ size_t stack_size;
#ifdef __ia64
- VALUE *machine_register_stack;
- VALUE *machine_register_stack_src;
- int machine_register_stack_size;
+ VALUE *register_stack;
+ VALUE *register_stack_src;
+ int register_stack_size;
#endif
- rb_thread_t saved_thread;
+ } machine;
+ rb_thread_t saved_thread; /* selected properties of GET_THREAD() (see cont_save_thread) */
rb_jmpbuf_t jmpbuf;
- size_t machine_stack_size;
rb_ensure_entry_t *ensure_array;
rb_ensure_list_t *ensure_list;
} rb_context_t;
@@ -128,26 +129,30 @@ static machine_stack_cache_t machine_stack_cache[MAX_MACHINE_STACK_CACHE];
static machine_stack_cache_t terminated_machine_stack;
#endif
-typedef struct rb_fiber_struct {
+struct rb_fiber_struct {
rb_context_t cont;
- VALUE prev;
+ struct rb_fiber_struct *prev;
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;
+ int transferred;
#if FIBER_USE_NATIVE
#ifdef _WIN32
void *fib_handle;
#else
ucontext_t context;
+ /* Because context.uc_stack.ss_sp and context.uc_stack.ss_size
+ * are not necessarily valid after makecontext() or swapcontext(),
+ * they are saved in these variables for later use.
+ */
+ void *ss_sp;
+ size_t ss_size;
#endif
#endif
-} rb_fiber_t;
+};
static const rb_data_type_t cont_data_type, fiber_data_type;
static VALUE rb_cContinuation;
@@ -162,7 +167,7 @@ static VALUE rb_eFiberError;
if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
} while (0)
-NOINLINE(static VALUE cont_capture(volatile int *stat));
+NOINLINE(static VALUE cont_capture(volatile int *volatile stat));
#define THREAD_MUST_BE_RUNNING(th) do { \
if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
@@ -183,32 +188,32 @@ cont_mark(void *ptr)
rb_gc_mark_locations(cont->vm_stack,
cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen);
#else
- rb_gc_mark_localtion(cont->vm_stack,
+ rb_gc_mark_locations(cont->vm_stack,
cont->vm_stack, cont->saved_thread.stack_size);
#endif
}
- if (cont->machine_stack) {
+ if (cont->machine.stack) {
if (cont->type == CONTINUATION_CONTEXT) {
/* cont */
- rb_gc_mark_locations(cont->machine_stack,
- cont->machine_stack + cont->machine_stack_size);
+ rb_gc_mark_locations(cont->machine.stack,
+ cont->machine.stack + cont->machine.stack_size);
}
else {
/* fiber */
rb_thread_t *th;
rb_fiber_t *fib = (rb_fiber_t*)cont;
GetThreadPtr(cont->saved_thread.self, th);
- if ((th->fiber != cont->self) && fib->status == RUNNING) {
- rb_gc_mark_locations(cont->machine_stack,
- cont->machine_stack + cont->machine_stack_size);
+ if ((th->fiber != fib) && fib->status == RUNNING) {
+ rb_gc_mark_locations(cont->machine.stack,
+ cont->machine.stack + cont->machine.stack_size);
}
}
}
#ifdef __ia64
- if (cont->machine_register_stack) {
- rb_gc_mark_locations(cont->machine_register_stack,
- cont->machine_register_stack + cont->machine_register_stack_size);
+ if (cont->machine.register_stack) {
+ rb_gc_mark_locations(cont->machine.register_stack,
+ cont->machine.register_stack + cont->machine.register_stack_size);
}
#endif
}
@@ -221,31 +226,31 @@ cont_free(void *ptr)
RUBY_FREE_ENTER("cont");
if (ptr) {
rb_context_t *cont = ptr;
- RUBY_FREE_UNLESS_NULL(cont->saved_thread.stack); fflush(stdout);
+ RUBY_FREE_UNLESS_NULL(cont->saved_thread.stack);
#if FIBER_USE_NATIVE
if (cont->type == CONTINUATION_CONTEXT) {
/* cont */
ruby_xfree(cont->ensure_array);
- RUBY_FREE_UNLESS_NULL(cont->machine_stack);
+ RUBY_FREE_UNLESS_NULL(cont->machine.stack);
}
else {
/* fiber */
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ const rb_thread_t *const th = GET_THREAD();
#ifdef _WIN32
- if (GET_THREAD()->fiber != cont->self && cont->type != ROOT_FIBER_CONTEXT) {
+ if (th && th->fiber != fib && cont->type != ROOT_FIBER_CONTEXT) {
/* don't delete root fiber handle */
- rb_fiber_t *fib = (rb_fiber_t*)cont;
if (fib->fib_handle) {
DeleteFiber(fib->fib_handle);
}
}
#else /* not WIN32 */
- if (GET_THREAD()->fiber != cont->self) {
- rb_fiber_t *fib = (rb_fiber_t*)cont;
- if (fib->context.uc_stack.ss_sp) {
+ if (th && th->fiber != fib) {
+ if (fib->ss_sp) {
if (cont->type == ROOT_FIBER_CONTEXT) {
rb_bug("Illegal root fiber parameter");
}
- munmap((void*)fib->context.uc_stack.ss_sp, fib->context.uc_stack.ss_size);
+ munmap((void*)fib->ss_sp, fib->ss_size);
}
}
else {
@@ -257,10 +262,10 @@ cont_free(void *ptr)
}
#else /* not FIBER_USE_NATIVE */
ruby_xfree(cont->ensure_array);
- RUBY_FREE_UNLESS_NULL(cont->machine_stack);
+ RUBY_FREE_UNLESS_NULL(cont->machine.stack);
#endif
#ifdef __ia64
- RUBY_FREE_UNLESS_NULL(cont->machine_register_stack);
+ RUBY_FREE_UNLESS_NULL(cont->machine.register_stack);
#endif
RUBY_FREE_UNLESS_NULL(cont->vm_stack);
@@ -275,63 +280,48 @@ cont_memsize(const void *ptr)
{
const rb_context_t *cont = ptr;
size_t size = 0;
- if (cont) {
- size = sizeof(*cont);
- if (cont->vm_stack) {
+
+ size = sizeof(*cont);
+ if (cont->vm_stack) {
#ifdef CAPTURE_JUST_VALID_VM_STACK
- size_t n = (cont->vm_stack_slen + cont->vm_stack_clen);
+ size_t n = (cont->vm_stack_slen + cont->vm_stack_clen);
#else
- size_t n = cont->saved_thread.stack_size;
+ size_t n = cont->saved_thread.stack_size;
#endif
- size += n * sizeof(*cont->vm_stack);
- }
+ size += n * sizeof(*cont->vm_stack);
+ }
- if (cont->machine_stack) {
- size += cont->machine_stack_size * sizeof(*cont->machine_stack);
- }
+ if (cont->machine.stack) {
+ size += cont->machine.stack_size * sizeof(*cont->machine.stack);
+ }
#ifdef __ia64
- if (cont->machine_register_stack) {
- size += cont->machine_register_stack_size * sizeof(*cont->machine_register_stack);
- }
-#endif
+ if (cont->machine.register_stack) {
+ size += cont->machine.register_stack_size * sizeof(*cont->machine.register_stack);
}
+#endif
return size;
}
+void
+rb_fiber_mark_self(rb_fiber_t *fib)
+{
+ if (fib)
+ rb_gc_mark(fib->cont.self);
+}
+
static void
fiber_mark(void *ptr)
{
RUBY_MARK_ENTER("cont");
if (ptr) {
rb_fiber_t *fib = ptr;
- rb_gc_mark(fib->prev);
+ rb_fiber_mark_self(fib->prev);
cont_mark(&fib->cont);
}
RUBY_MARK_LEAVE("cont");
}
static void
-fiber_link_join(rb_fiber_t *fib)
-{
- VALUE current_fibval = rb_fiber_current();
- rb_fiber_t *current_fib;
- GetFiberPtr(current_fibval, current_fib);
-
- /* join fiber link */
- fib->next_fiber = current_fib->next_fiber;
- fib->prev_fiber = current_fib;
- current_fib->next_fiber->prev_fiber = fib;
- current_fib->next_fiber = fib;
-}
-
-static void
-fiber_link_remove(rb_fiber_t *fib)
-{
- fib->prev_fiber->next_fiber = fib->next_fiber;
- fib->next_fiber->prev_fiber = fib->prev_fiber;
-}
-
-static void
fiber_free(void *ptr)
{
RUBY_FREE_ENTER("fiber");
@@ -341,7 +331,6 @@ fiber_free(void *ptr)
fib->cont.saved_thread.local_storage) {
st_free_table(fib->cont.saved_thread.local_storage);
}
- fiber_link_remove(fib);
cont_free(&fib->cont);
}
@@ -353,14 +342,13 @@ fiber_memsize(const void *ptr)
{
const rb_fiber_t *fib = ptr;
size_t size = 0;
- if (ptr) {
- size = sizeof(*fib);
- if (fib->cont.type != ROOT_FIBER_CONTEXT &&
- fib->cont.saved_thread.local_storage != NULL) {
- size += st_memsize(fib->cont.saved_thread.local_storage);
- }
- size += cont_memsize(&fib->cont);
+
+ size = sizeof(*fib);
+ if (fib->cont.type != ROOT_FIBER_CONTEXT &&
+ fib->cont.saved_thread.local_storage != NULL) {
+ size += st_memsize(fib->cont.saved_thread.local_storage);
}
+ size += cont_memsize(&fib->cont);
return size;
}
@@ -380,63 +368,82 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
{
size_t size;
- SET_MACHINE_STACK_END(&th->machine_stack_end);
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
#ifdef __ia64
- th->machine_register_stack_end = rb_ia64_bsp();
+ th->machine.register_stack_end = rb_ia64_bsp();
#endif
- if (th->machine_stack_start > th->machine_stack_end) {
- size = cont->machine_stack_size = th->machine_stack_start - th->machine_stack_end;
- cont->machine_stack_src = th->machine_stack_end;
+ if (th->machine.stack_start > th->machine.stack_end) {
+ size = cont->machine.stack_size = th->machine.stack_start - th->machine.stack_end;
+ cont->machine.stack_src = th->machine.stack_end;
}
else {
- size = cont->machine_stack_size = th->machine_stack_end - th->machine_stack_start;
- cont->machine_stack_src = th->machine_stack_start;
+ size = cont->machine.stack_size = th->machine.stack_end - th->machine.stack_start;
+ cont->machine.stack_src = th->machine.stack_start;
}
- if (cont->machine_stack) {
- REALLOC_N(cont->machine_stack, VALUE, size);
+ if (cont->machine.stack) {
+ REALLOC_N(cont->machine.stack, VALUE, size);
}
else {
- cont->machine_stack = ALLOC_N(VALUE, size);
+ cont->machine.stack = ALLOC_N(VALUE, size);
}
FLUSH_REGISTER_WINDOWS;
- MEMCPY(cont->machine_stack, cont->machine_stack_src, VALUE, size);
+ MEMCPY(cont->machine.stack, cont->machine.stack_src, VALUE, size);
#ifdef __ia64
rb_ia64_flushrs();
- size = cont->machine_register_stack_size = th->machine_register_stack_end - th->machine_register_stack_start;
- cont->machine_register_stack_src = th->machine_register_stack_start;
- if (cont->machine_register_stack) {
- REALLOC_N(cont->machine_register_stack, VALUE, size);
+ size = cont->machine.register_stack_size = th->machine.register_stack_end - th->machine.register_stack_start;
+ cont->machine.register_stack_src = th->machine.register_stack_start;
+ if (cont->machine.register_stack) {
+ REALLOC_N(cont->machine.register_stack, VALUE, size);
}
else {
- cont->machine_register_stack = ALLOC_N(VALUE, size);
+ cont->machine.register_stack = ALLOC_N(VALUE, size);
}
- MEMCPY(cont->machine_register_stack, cont->machine_register_stack_src, VALUE, size);
+ MEMCPY(cont->machine.register_stack, cont->machine.register_stack_src, VALUE, size);
#endif
}
static const rb_data_type_t cont_data_type = {
"continuation",
{cont_mark, cont_free, cont_memsize,},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
-static void
+static inline void
cont_save_thread(rb_context_t *cont, rb_thread_t *th)
{
+ rb_thread_t *sth = &cont->saved_thread;
+
/* save thread context */
- cont->saved_thread = *th;
- /* saved_thread->machine_stack_(start|end) should be NULL */
+ sth->stack = th->stack;
+ sth->stack_size = th->stack_size;
+ sth->local_storage = th->local_storage;
+ sth->cfp = th->cfp;
+ sth->safe_level = th->safe_level;
+ sth->raised_flag = th->raised_flag;
+ sth->state = th->state;
+ sth->status = th->status;
+ sth->tag = th->tag;
+ sth->protect_tag = th->protect_tag;
+ sth->errinfo = th->errinfo;
+ sth->first_proc = th->first_proc;
+ sth->root_lep = th->root_lep;
+ sth->root_svar = th->root_svar;
+ sth->ensure_list = th->ensure_list;
+
+ sth->trace_arg = th->trace_arg;
+
+ /* saved_thread->machine.stack_(start|end) should be NULL */
/* because it may happen GC afterward */
- cont->saved_thread.machine_stack_start = 0;
- cont->saved_thread.machine_stack_end = 0;
+ sth->machine.stack_start = 0;
+ sth->machine.stack_end = 0;
#ifdef __ia64
- cont->saved_thread.machine_register_stack_start = 0;
- cont->saved_thread.machine_register_stack_end = 0;
+ sth->machine.register_stack_start = 0;
+ sth->machine.register_stack_end = 0;
#endif
}
@@ -445,7 +452,12 @@ cont_init(rb_context_t *cont, rb_thread_t *th)
{
/* save thread context */
cont_save_thread(cont, th);
+ cont->saved_thread.self = th->self;
+ cont->saved_thread.machine.stack_maxsize = th->machine.stack_maxsize;
+ cont->saved_thread.fiber = th->fiber;
cont->saved_thread.local_storage = 0;
+ cont->saved_thread.local_storage_recursive_hash = Qnil;
+ cont->saved_thread.local_storage_recursive_hash_for_trace = Qnil;
}
static rb_context_t *
@@ -463,20 +475,19 @@ cont_new(VALUE klass)
}
static VALUE
-cont_capture(volatile int *stat)
+cont_capture(volatile int *volatile stat)
{
- rb_context_t *cont;
- rb_thread_t *th = GET_THREAD(), *sth;
+ rb_context_t *volatile cont;
+ rb_thread_t *th = GET_THREAD();
volatile VALUE contval;
THREAD_MUST_BE_RUNNING(th);
rb_vm_stack_to_heap(th);
cont = cont_new(rb_cContinuation);
contval = cont->self;
- sth = &cont->saved_thread;
#ifdef CAPTURE_JUST_VALID_VM_STACK
- cont->vm_stack_slen = th->cfp->sp + th->mark_stack_len - th->stack;
+ cont->vm_stack_slen = th->cfp->sp - th->stack;
cont->vm_stack_clen = th->stack + th->stack_size - (VALUE*)th->cfp;
cont->vm_stack = ALLOC_N(VALUE, cont->vm_stack_slen + cont->vm_stack_clen);
MEMCPY(cont->vm_stack, th->stack, VALUE, cont->vm_stack_slen);
@@ -485,7 +496,7 @@ cont_capture(volatile int *stat)
cont->vm_stack = ALLOC_N(VALUE, th->stack_size);
MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size);
#endif
- sth->stack = 0;
+ cont->saved_thread.stack = 0;
cont_save_machine_stack(th, cont);
@@ -506,8 +517,9 @@ cont_capture(volatile int *stat)
}
if (ruby_setjmp(cont->jmpbuf)) {
- volatile VALUE value;
+ VALUE value;
+ VAR_INITIALIZED(cont);
value = cont->value;
if (cont->argc == -1) rb_exc_raise(value);
cont->value = Qnil;
@@ -520,7 +532,7 @@ cont_capture(volatile int *stat)
}
}
-static void
+static inline void
cont_restore_thread(rb_context_t *cont)
{
rb_thread_t *th = GET_THREAD(), *sth = &cont->saved_thread;
@@ -528,16 +540,14 @@ cont_restore_thread(rb_context_t *cont)
/* restore thread context */
if (cont->type == CONTINUATION_CONTEXT) {
/* continuation */
- VALUE fib;
+ rb_fiber_t *fib;
th->fiber = sth->fiber;
fib = th->fiber ? th->fiber : th->root_fiber;
if (fib) {
- rb_fiber_t *fcont;
- GetFiberPtr(fib, fcont);
- th->stack_size = fcont->cont.saved_thread.stack_size;
- th->stack = fcont->cont.saved_thread.stack;
+ th->stack_size = fib->cont.saved_thread.stack_size;
+ th->stack = fib->cont.saved_thread.stack;
}
#ifdef CAPTURE_JUST_VALID_VM_STACK
MEMCPY(th->stack, cont->vm_stack, VALUE, cont->vm_stack_slen);
@@ -552,7 +562,9 @@ cont_restore_thread(rb_context_t *cont)
th->stack = sth->stack;
th->stack_size = sth->stack_size;
th->local_storage = sth->local_storage;
- th->fiber = cont->self;
+ th->local_storage_recursive_hash = sth->local_storage_recursive_hash;
+ th->local_storage_recursive_hash_for_trace = sth->local_storage_recursive_hash_for_trace;
+ th->fiber = (rb_fiber_t*)cont;
}
th->cfp = sth->cfp;
@@ -579,7 +591,7 @@ fiber_set_stack_location(void)
VALUE *ptr;
SET_MACHINE_STACK_END(&ptr);
- th->machine_stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE));
+ th->machine.stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE));
}
static VOID CALLBACK
@@ -645,6 +657,10 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
rb_thread_t *sth = &fib->cont.saved_thread;
#ifdef _WIN32
+# if defined(_MSC_VER) && _MSC_VER <= 1200
+# define CreateFiberEx(cs, stacksize, flags, entry, param) \
+ CreateFiber((stacksize), (entry), (param))
+# endif
fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
if (!fib->fib_handle) {
/* try to release unnecessary fibers & retry to create */
@@ -654,7 +670,7 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
rb_raise(rb_eFiberError, "can't create fiber");
}
}
- sth->machine_stack_maxsize = size;
+ sth->machine.stack_maxsize = size;
#else /* not WIN32 */
ucontext_t *context = &fib->context;
char *ptr;
@@ -665,12 +681,14 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
context->uc_link = NULL;
context->uc_stack.ss_sp = ptr;
context->uc_stack.ss_size = size;
+ fib->ss_sp = ptr;
+ fib->ss_size = size;
makecontext(context, rb_fiber_start, 0);
- sth->machine_stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
- sth->machine_stack_maxsize = size - RB_PAGE_SIZE;
+ sth->machine.stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
+ sth->machine.stack_maxsize = size - RB_PAGE_SIZE;
#endif
#ifdef __ia64
- sth->machine_register_stack_maxsize = sth->machine_stack_maxsize;
+ sth->machine.register_stack_maxsize = sth->machine.stack_maxsize;
#endif
}
@@ -687,31 +705,31 @@ fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib)
/* restore thread context */
cont_restore_thread(&newfib->cont);
- th->machine_stack_maxsize = sth->machine_stack_maxsize;
- if (sth->machine_stack_end && (newfib != oldfib)) {
- rb_bug("fiber_setcontext: sth->machine_stack_end has non zero value");
+ th->machine.stack_maxsize = sth->machine.stack_maxsize;
+ if (sth->machine.stack_end && (newfib != oldfib)) {
+ rb_bug("fiber_setcontext: sth->machine.stack_end has non zero value");
}
/* save oldfib's machine stack */
if (oldfib->status != TERMINATED) {
STACK_GROW_DIR_DETECTION;
- SET_MACHINE_STACK_END(&th->machine_stack_end);
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
if (STACK_DIR_UPPER(0, 1)) {
- oldfib->cont.machine_stack_size = th->machine_stack_start - th->machine_stack_end;
- oldfib->cont.machine_stack = th->machine_stack_end;
+ oldfib->cont.machine.stack_size = th->machine.stack_start - th->machine.stack_end;
+ oldfib->cont.machine.stack = th->machine.stack_end;
}
else {
- oldfib->cont.machine_stack_size = th->machine_stack_end - th->machine_stack_start;
- oldfib->cont.machine_stack = th->machine_stack_start;
+ oldfib->cont.machine.stack_size = th->machine.stack_end - th->machine.stack_start;
+ oldfib->cont.machine.stack = th->machine.stack_start;
}
}
/* exchange machine_stack_start between oldfib and newfib */
- oldfib->cont.saved_thread.machine_stack_start = th->machine_stack_start;
- th->machine_stack_start = sth->machine_stack_start;
- /* oldfib->machine_stack_end should be NULL */
- oldfib->cont.saved_thread.machine_stack_end = 0;
+ oldfib->cont.saved_thread.machine.stack_start = th->machine.stack_start;
+ th->machine.stack_start = sth->machine.stack_start;
+ /* oldfib->machine.stack_end should be NULL */
+ oldfib->cont.saved_thread.machine.stack_end = 0;
#ifndef _WIN32
- if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib->cont.self) {
+ if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib) {
rb_bug("non_root_fiber->context.uc_stac.ss_sp should not be NULL");
}
#endif
@@ -742,16 +760,16 @@ cont_restore_1(rb_context_t *cont)
((_JUMP_BUFFER*)(&buf))->Frame;
}
#endif
- if (cont->machine_stack_src) {
+ if (cont->machine.stack_src) {
FLUSH_REGISTER_WINDOWS;
- MEMCPY(cont->machine_stack_src, cont->machine_stack,
- VALUE, cont->machine_stack_size);
+ MEMCPY(cont->machine.stack_src, cont->machine.stack,
+ VALUE, cont->machine.stack_size);
}
#ifdef __ia64
- if (cont->machine_register_stack_src) {
- MEMCPY(cont->machine_register_stack_src, cont->machine_register_stack,
- VALUE, cont->machine_register_stack_size);
+ if (cont->machine.register_stack_src) {
+ MEMCPY(cont->machine.register_stack_src, cont->machine.register_stack,
+ VALUE, cont->machine.register_stack_size);
}
#endif
@@ -786,7 +804,7 @@ register_stack_extend(rb_context_t *cont, VALUE *vp, VALUE *curr_bsp)
E(k) = E(l) = E(m) = E(n) = E(o) =
E(p) = E(q) = E(r) = E(s) = E(t) = 0;
}
- if (curr_bsp < cont->machine_register_stack_src+cont->machine_register_stack_size) {
+ if (curr_bsp < cont->machine.register_stack_src+cont->machine.register_stack_size) {
register_stack_extend(cont, vp, (VALUE*)rb_ia64_bsp());
}
cont_restore_0(cont, vp);
@@ -798,7 +816,7 @@ register_stack_extend(rb_context_t *cont, VALUE *vp, VALUE *curr_bsp)
static void
cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
{
- if (cont->machine_stack_src) {
+ if (cont->machine.stack_src) {
#ifdef HAVE_ALLOCA
#define STACK_PAD_SIZE 1
#else
@@ -811,7 +829,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
/* Stack grows downward */
#endif
#if STACK_GROW_DIRECTION <= 0
- volatile VALUE *const end = cont->machine_stack_src;
+ volatile VALUE *const end = cont->machine.stack_src;
if (&space[0] > end) {
# ifdef HAVE_ALLOCA
volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
@@ -827,7 +845,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
/* Stack grows upward */
#endif
#if STACK_GROW_DIRECTION >= 0
- volatile VALUE *const end = cont->machine_stack_src + cont->machine_stack_size;
+ volatile VALUE *const end = cont->machine.stack_src + cont->machine.stack_size;
if (&space[STACK_PAD_SIZE] < end) {
# ifdef HAVE_ALLOCA
volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
@@ -873,6 +891,24 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
* Ron
* Max
*
+ * Also you can call callcc in other methods:
+ *
+ * require "continuation"
+ *
+ * def g
+ * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ]
+ * cc = callcc { |cc| cc }
+ * puts arr.shift
+ * return cc, arr.size
+ * end
+ *
+ * def f
+ * c, size = g
+ * c.call(c) if size > 1
+ * end
+ *
+ * f
+ *
* This (somewhat contrived) example allows the inner loop to abandon
* processing early:
*
@@ -927,7 +963,7 @@ rb_callcc(VALUE self)
}
static VALUE
-make_passing_arg(int argc, VALUE *argv)
+make_passing_arg(int argc, const VALUE *argv)
{
switch (argc) {
case 0:
@@ -1043,9 +1079,6 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
rb_raise(rb_eRuntimeError, "continuation called across stack rewinding barrier");
}
if (cont->saved_thread.fiber) {
- rb_fiber_t *fcont;
- GetFiberPtr(cont->saved_thread.fiber, fcont);
-
if (th->fiber != cont->saved_thread.fiber) {
rb_raise(rb_eRuntimeError, "continuation called across fiber");
}
@@ -1079,7 +1112,7 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
* comes with a small 4KB stack. This enables the fiber to be paused from deeply
* nested function calls within the fiber block.
*
- * When a fiber is created it will not run automatically. Rather it must be
+ * When a fiber is created it will not run automatically. Rather it must
* be explicitly asked to run using the <code>Fiber#resume</code> method.
* The code running inside the fiber can give up control by calling
* <code>Fiber.yield</code> in which case it yields control back to caller
@@ -1131,7 +1164,7 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
static const rb_data_type_t fiber_data_type = {
"fiber",
{fiber_mark, fiber_free, fiber_memsize,},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
@@ -1151,12 +1184,11 @@ fiber_t_alloc(VALUE fibval)
}
THREAD_MUST_BE_RUNNING(th);
- fib = ALLOC(rb_fiber_t);
- memset(fib, 0, sizeof(rb_fiber_t));
+ fib = ZALLOC(rb_fiber_t);
fib->cont.self = fibval;
fib->cont.type = FIBER_CONTEXT;
cont_init(&fib->cont, th);
- fib->prev = Qnil;
+ fib->prev = NULL;
fib->status = CREATED;
DATA_PTR(fibval) = fib;
@@ -1170,6 +1202,7 @@ fiber_init(VALUE fibval, VALUE proc)
rb_fiber_t *fib = fiber_t_alloc(fibval);
rb_context_t *cont = &fib->cont;
rb_thread_t *th = &cont->saved_thread;
+ rb_thread_t *cth = GET_THREAD();
/* initialize cont */
cont->vm_stack = 0;
@@ -1177,34 +1210,33 @@ fiber_init(VALUE fibval, VALUE proc)
th->stack = 0;
th->stack_size = 0;
- fiber_link_join(fib);
-
- th->stack_size = th->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
+ th->stack_size = cth->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
th->stack = ALLOC_N(VALUE, th->stack_size);
th->cfp = (void *)(th->stack + th->stack_size);
th->cfp--;
th->cfp->pc = 0;
- th->cfp->sp = th->stack + 1;
+ th->cfp->sp = th->stack + 2;
#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->ep = th->stack + 1;
+ th->cfp->ep[ 0] = VM_ENVVAL_BLOCK_PTR(0);
+ th->cfp->ep[-1] = 0;
th->cfp->self = Qnil;
- th->cfp->klass = Qnil;
- th->cfp->flag = 0;
+ th->cfp->flag = VM_FRAME_MAGIC_DUMMY | VM_FRAME_FLAG_FINISH;
th->cfp->iseq = 0;
th->cfp->proc = 0;
th->cfp->block_iseq = 0;
- th->cfp->me = 0;
th->tag = 0;
th->local_storage = st_init_numtable();
+ th->local_storage_recursive_hash = Qnil;
+ th->local_storage_recursive_hash_for_trace = Qnil;
th->first_proc = proc;
#if !FIBER_USE_NATIVE
- MEMCPY(&cont->jmpbuf, &th->root_jmpbuf, rb_jmpbuf_t, 1);
+ MEMCPY(&cont->jmpbuf, &cth->root_jmpbuf, rb_jmpbuf_t, 1);
#endif
return fibval;
@@ -1223,61 +1255,19 @@ rb_fiber_new(VALUE (*func)(ANYARGS), VALUE obj)
return fiber_init(fiber_alloc(rb_cFiber), rb_proc_new(func, obj));
}
-static VALUE
-return_fiber(void)
-{
- rb_fiber_t *fib;
- VALUE curr = rb_fiber_current();
- VALUE prev;
- GetFiberPtr(curr, fib);
-
- prev = fib->prev;
- if (NIL_P(prev)) {
- const VALUE root_fiber = GET_THREAD()->root_fiber;
-
- if (root_fiber == curr) {
- rb_raise(rb_eFiberError, "can't yield from root fiber");
- }
- return root_fiber;
- }
- else {
- fib->prev = Qnil;
- return prev;
- }
-}
-
-VALUE rb_fiber_transfer(VALUE fib, int argc, VALUE *argv);
-
-static void
-rb_fiber_terminate(rb_fiber_t *fib)
-{
- VALUE value = fib->cont.value;
- fib->status = TERMINATED;
-#if FIBER_USE_NATIVE && !defined(_WIN32)
- /* Ruby must not switch to other thread until storing terminated_machine_stack */
- terminated_machine_stack.ptr = fib->context.uc_stack.ss_sp;
- terminated_machine_stack.size = fib->context.uc_stack.ss_size / sizeof(VALUE);
- fib->context.uc_stack.ss_sp = NULL;
- fib->cont.machine_stack = NULL;
- fib->cont.machine_stack_size = 0;
-#endif
- rb_fiber_transfer(return_fiber(), 1, &value);
-}
+static void rb_fiber_terminate(rb_fiber_t *fib);
void
rb_fiber_start(void)
{
rb_thread_t *th = GET_THREAD();
- rb_fiber_t *fib;
- rb_context_t *cont;
+ rb_fiber_t *fib = th->fiber;
rb_proc_t *proc;
int state;
- GetFiberPtr(th->fiber, fib);
- cont = &fib->cont;
-
TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
+ rb_context_t *cont = &VAR_FROM_MEMORY(fib)->cont;
int argc;
const VALUE *argv, args = cont->value;
GetProcPtr(cont->saved_thread.first_proc, proc);
@@ -1285,9 +1275,10 @@ rb_fiber_start(void)
cont->value = Qnil;
th->errinfo = Qnil;
th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
- th->root_svar = Qnil;
-
+ th->root_svar = Qfalse;
fib->status = RUNNING;
+
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, Qnil);
cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
}
TH_POP_TAG();
@@ -1321,90 +1312,117 @@ root_fiber_alloc(rb_thread_t *th)
#endif
#endif
fib->status = RUNNING;
- fib->prev_fiber = fib->next_fiber = fib;
return fib;
}
-VALUE
-rb_fiber_current(void)
+static inline rb_fiber_t*
+fiber_current(void)
{
rb_thread_t *th = GET_THREAD();
if (th->fiber == 0) {
/* save root */
rb_fiber_t *fib = root_fiber_alloc(th);
- th->root_fiber = th->fiber = fib->cont.self;
+ th->root_fiber = th->fiber = fib;
}
return th->fiber;
}
-static VALUE
-fiber_store(rb_fiber_t *next_fib)
+static inline rb_fiber_t*
+return_fiber(void)
+{
+ rb_fiber_t *fib = fiber_current();
+ rb_fiber_t *prev = fib->prev;
+
+ if (!prev) {
+ rb_fiber_t *root_fiber = GET_THREAD()->root_fiber;
+
+ if (root_fiber == fib) {
+ rb_raise(rb_eFiberError, "can't yield from root fiber");
+ }
+ return root_fiber;
+ }
+ else {
+ fib->prev = NULL;
+ return prev;
+ }
+}
+
+VALUE
+rb_fiber_current(void)
+{
+ return fiber_current()->cont.self;
+}
+
+static inline VALUE
+fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
{
- rb_thread_t *th = GET_THREAD();
rb_fiber_t *fib;
if (th->fiber) {
- GetFiberPtr(th->fiber, fib);
+ fib = th->fiber;
cont_save_thread(&fib->cont, th);
}
else {
/* create current fiber */
fib = root_fiber_alloc(th);
- th->root_fiber = th->fiber = fib->cont.self;
+ th->root_fiber = th->fiber = fib;
}
-#if !FIBER_USE_NATIVE
- cont_save_machine_stack(th, &fib->cont);
-#endif
-
- if (FIBER_USE_NATIVE || ruby_setjmp(fib->cont.jmpbuf)) {
#if FIBER_USE_NATIVE
- fiber_setcontext(next_fib, fib);
+ fiber_setcontext(next_fib, fib);
+ /* restored */
#ifndef _WIN32
- if (terminated_machine_stack.ptr) {
- if (machine_stack_cache_index < MAX_MACHINE_STACK_CACHE) {
- machine_stack_cache[machine_stack_cache_index].ptr = terminated_machine_stack.ptr;
- machine_stack_cache[machine_stack_cache_index].size = terminated_machine_stack.size;
- machine_stack_cache_index++;
+ if (terminated_machine_stack.ptr) {
+ if (machine_stack_cache_index < MAX_MACHINE_STACK_CACHE) {
+ machine_stack_cache[machine_stack_cache_index].ptr = terminated_machine_stack.ptr;
+ machine_stack_cache[machine_stack_cache_index].size = terminated_machine_stack.size;
+ machine_stack_cache_index++;
+ }
+ else {
+ if (terminated_machine_stack.ptr != fib->cont.machine.stack) {
+ munmap((void*)terminated_machine_stack.ptr, terminated_machine_stack.size * sizeof(VALUE));
}
else {
- if (terminated_machine_stack.ptr != fib->cont.machine_stack) {
- munmap((void*)terminated_machine_stack.ptr, terminated_machine_stack.size * sizeof(VALUE));
- }
- else {
- rb_bug("terminated fiber resumed");
- }
+ rb_bug("terminated fiber resumed");
}
- terminated_machine_stack.ptr = NULL;
- terminated_machine_stack.size = 0;
}
-#endif
-#endif
+ terminated_machine_stack.ptr = NULL;
+ terminated_machine_stack.size = 0;
+ }
+#endif /* not _WIN32 */
+ fib = th->fiber;
+ if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
+ return fib->cont.value;
+
+#else /* FIBER_USE_NATIVE */
+ cont_save_machine_stack(th, &fib->cont);
+ if (ruby_setjmp(fib->cont.jmpbuf)) {
/* restored */
- GetFiberPtr(th->fiber, fib);
+ fib = th->fiber;
if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
+ if (next_fib->cont.value == Qundef) {
+ cont_restore_0(&next_fib->cont, &next_fib->cont.value);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
return fib->cont.value;
}
-#if !FIBER_USE_NATIVE
else {
- return Qundef;
+ VALUE undef = Qundef;
+ cont_restore_0(&next_fib->cont, &undef);
+ rb_bug("rb_fiber_resume: unreachable");
}
-#endif
+#endif /* FIBER_USE_NATIVE */
}
static inline VALUE
-fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
+fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
{
VALUE value;
- rb_fiber_t *fib;
- rb_context_t *cont;
+ rb_context_t *cont = &fib->cont;
rb_thread_t *th = GET_THREAD();
- GetFiberPtr(fibval, fib);
- cont = &fib->cont;
-
- if (th->fiber == fibval) {
+ if (th->fiber == fib) {
/* ignore fiber context switch
* because destination fiber is same as current fiber
*/
@@ -1419,34 +1437,25 @@ fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
}
else if (fib->status == TERMINATED) {
value = rb_exc_new2(rb_eFiberError, "dead fiber called");
- if (th->fiber != fibval) {
- GetFiberPtr(th->fiber, fib);
- if (fib->status != TERMINATED) rb_exc_raise(value);
- fibval = th->root_fiber;
- }
- else {
- fibval = fib->prev;
- if (NIL_P(fibval)) fibval = th->root_fiber;
- }
- GetFiberPtr(fibval, fib);
- cont = &fib->cont;
+
+ if (th->fiber->status != TERMINATED) rb_exc_raise(value);
+
+ /* th->fiber is also dead => switch to root fiber */
+ /* (this means we're being called from rb_fiber_terminate, */
+ /* and the terminated fiber's return_fiber() is already dead) */
+ cont = &th->root_fiber->cont;
cont->argc = -1;
cont->value = value;
#if FIBER_USE_NATIVE
- {
- VALUE oldfibval;
- rb_fiber_t *oldfib;
- oldfibval = rb_fiber_current();
- GetFiberPtr(oldfibval, oldfib);
- fiber_setcontext(fib, oldfib);
- }
+ fiber_setcontext(th->root_fiber, th->fiber);
#else
cont_restore_0(cont, &value);
#endif
+ /* unreachable */
}
if (is_resume) {
- fib->prev = rb_fiber_current();
+ fib->prev = fiber_current();
}
else {
/* restore `tracing' context. see [Feature #4347] */
@@ -1456,56 +1465,69 @@ fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
cont->argc = argc;
cont->value = make_passing_arg(argc, argv);
- value = fiber_store(fib);
-#if !FIBER_USE_NATIVE
- if (value == Qundef) {
- cont_restore_0(cont, &value);
- rb_bug("rb_fiber_resume: unreachable");
- }
-#endif
+ value = fiber_store(fib, th);
RUBY_VM_CHECK_INTS(th);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, Qnil);
+
return value;
}
VALUE
-rb_fiber_transfer(VALUE fib, int argc, VALUE *argv)
+rb_fiber_transfer(VALUE fibval, int argc, const VALUE *argv)
{
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
return fiber_switch(fib, argc, argv, 0);
}
+static void
+rb_fiber_terminate(rb_fiber_t *fib)
+{
+ VALUE value = fib->cont.value;
+ fib->status = TERMINATED;
+#if FIBER_USE_NATIVE && !defined(_WIN32)
+ /* Ruby must not switch to other thread until storing terminated_machine_stack */
+ terminated_machine_stack.ptr = fib->ss_sp;
+ terminated_machine_stack.size = fib->ss_size / sizeof(VALUE);
+ fib->ss_sp = NULL;
+ fib->context.uc_stack.ss_sp = NULL;
+ fib->cont.machine.stack = NULL;
+ fib->cont.machine.stack_size = 0;
+#endif
+ fiber_switch(return_fiber(), 1, &value, 0);
+}
+
VALUE
-rb_fiber_resume(VALUE fibval, int argc, VALUE *argv)
+rb_fiber_resume(VALUE fibval, int argc, const VALUE *argv)
{
rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
- if (fib->prev != Qnil || fib->cont.type == ROOT_FIBER_CONTEXT) {
+ if (fib->prev != 0 || fib->cont.type == ROOT_FIBER_CONTEXT) {
rb_raise(rb_eFiberError, "double resume");
}
- if (fib->transfered != 0) {
+ if (fib->transferred != 0) {
rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
}
- return fiber_switch(fibval, argc, argv, 1);
+ return fiber_switch(fib, argc, argv, 1);
}
VALUE
-rb_fiber_yield(int argc, VALUE *argv)
+rb_fiber_yield(int argc, const VALUE *argv)
{
- return rb_fiber_transfer(return_fiber(), argc, argv);
+ return fiber_switch(return_fiber(), argc, argv, 0);
}
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;
+ th->local_storage = th->root_fiber->cont.saved_thread.local_storage;
}
}
@@ -1585,7 +1607,7 @@ rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
* fiber2.resume
* fiber3.resume
*
- * <em>produces</em>
+ * <em>produces</em>
*
* In fiber 2
* In fiber 1
@@ -1597,8 +1619,8 @@ rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)
{
rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
- fib->transfered = 1;
- return rb_fiber_transfer(fibval, argc, argv);
+ fib->transferred = 1;
+ return fiber_switch(fib, argc, argv, 0);
}
/*
@@ -1659,7 +1681,7 @@ Init_Cont(void)
#else /* not WIN32 */
pagesize = sysconf(_SC_PAGESIZE);
#endif
- SET_MACHINE_STACK_END(&th->machine_stack_end);
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
#endif
rb_cFiber = rb_define_class("Fiber", rb_cObject);
diff --git a/coverage/README b/coverage/README
new file mode 100644
index 0000000000..7e4ff59e2a
--- /dev/null
+++ b/coverage/README
@@ -0,0 +1,17 @@
+Usage
+
+The make task `update-coverage' retrieves simplecov for coverage report.
+
+COVERAGE=1 make test-all TESTS=test/cgi
+
+it generate test coverage to coverage directory.
+
+Limitation
+
+ * test_coverage.rb and test_process.rb broke test suit with SimpleCov
+ * some tests failed randomly.
+
+TODO
+
+ * more reduce bundled simplecov(additional configuration, formatter, etc)
+ * measure rubyspec coverage
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 5bd414d786..edf02242ee 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -33,7 +33,7 @@ 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)
+override 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
RUBYDEF = $(DLL_BASE_NAME).def
@@ -67,11 +67,11 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
$(ECHO) linking $@
$(Q) $(PURIFY) $(CC) -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
-$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ stub.@OBJEXT@
+$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ win32/stub.@OBJEXT@
@rm -f $@
$(ECHO) linking $@
$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) \
- stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
+ win32/stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
$(ECHO) creating $@
@@ -86,7 +86,15 @@ GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
$(OBJS) $(MAINOBJ): win32.h
-dir.$(OBJEXT) win32.$(OBJEXT): win32/dir.h
+dir.$(OBJEXT) win32/win32.$(OBJEXT): win32/dir.h
+file.$(OBJEXT) win32/win32.$(OBJEXT): win32/file.h
+
+MSYS2_ARG_CONV_EXCL_PARAM = --exclude=;--name=
+
+yes-test-ruby: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
+yes-test-all: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
+yes-test-almost: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
+
endif
$(LIBRUBY_SO): $(RUBYDEF)
diff --git a/debug.c b/debug.c
index 2f1e03cc3a..a600259818 100644
--- a/debug.c
+++ b/debug.c
@@ -25,41 +25,11 @@ const union {
enum node_type node_type;
enum ruby_method_ids method_ids;
enum ruby_id_types id_types;
+ enum ruby_fl_type fl_types;
+ enum ruby_encoding_consts encoding_consts;
+ enum ruby_coderange_type enc_coderange_types;
+ enum ruby_econv_flag_type econv_flag_types;
enum {
- RUBY_ENCODING_INLINE_MAX = ENCODING_INLINE_MAX,
- RUBY_ENCODING_SHIFT = ENCODING_SHIFT,
- RUBY_ENC_CODERANGE_MASK = ENC_CODERANGE_MASK,
- RUBY_ENC_CODERANGE_UNKNOWN = ENC_CODERANGE_UNKNOWN,
- RUBY_ENC_CODERANGE_7BIT = ENC_CODERANGE_7BIT,
- RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID,
- RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN,
- RUBY_FL_WB_PROTECTED = FL_WB_PROTECTED,
- RUBY_FL_PROMOTED = FL_PROMOTED,
- RUBY_FL_FINALIZE = FL_FINALIZE,
- RUBY_FL_TAINT = FL_TAINT,
- RUBY_FL_EXIVAR = FL_EXIVAR,
- RUBY_FL_FREEZE = FL_FREEZE,
- RUBY_FL_SINGLETON = FL_SINGLETON,
- RUBY_FL_USER0 = FL_USER0,
- RUBY_FL_USER1 = FL_USER1,
- RUBY_FL_USER2 = FL_USER2,
- RUBY_FL_USER3 = FL_USER3,
- RUBY_FL_USER4 = FL_USER4,
- RUBY_FL_USER5 = FL_USER5,
- RUBY_FL_USER6 = FL_USER6,
- RUBY_FL_USER7 = FL_USER7,
- RUBY_FL_USER8 = FL_USER8,
- RUBY_FL_USER9 = FL_USER9,
- RUBY_FL_USER10 = FL_USER10,
- RUBY_FL_USER11 = FL_USER11,
- RUBY_FL_USER12 = FL_USER12,
- RUBY_FL_USER13 = FL_USER13,
- RUBY_FL_USER14 = FL_USER14,
- RUBY_FL_USER15 = FL_USER15,
- RUBY_FL_USER16 = FL_USER16,
- RUBY_FL_USER17 = FL_USER17,
- RUBY_FL_USER18 = FL_USER18,
- RUBY_FL_USHIFT = FL_USHIFT,
RUBY_NODE_TYPESHIFT = NODE_TYPESHIFT,
RUBY_NODE_TYPEMASK = NODE_TYPEMASK,
RUBY_NODE_LSHIFT = NODE_LSHIFT,
@@ -67,9 +37,7 @@ const union {
} various;
} ruby_dummy_gdb_enums;
-const VALUE RUBY_FL_USER19 = FL_USER19;
const SIGNED_VALUE RUBY_NODE_LMASK = NODE_LMASK;
-const VALUE RUBY_ENCODING_MASK = ENCODING_MASK;
int
ruby_debug_print_indent(int level, int debug_level, int indent_level)
@@ -139,18 +107,20 @@ ruby_debug_breakpoint(void)
static void
set_debug_option(const char *str, int len, void *arg)
{
-#define SET_WHEN(name, var) do { \
+#if defined _WIN32 && RUBY_MSVCRT_VERSION >= 80
+ extern int ruby_w32_rtc_error;
+#endif
+#define SET_WHEN(name, var, val) do { \
if (len == sizeof(name) - 1 && \
strncmp(str, (name), len) == 0) { \
- extern int var; \
- var = 1; \
+ (var) = (val); \
return; \
} \
} while (0)
- SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr);
- SET_WHEN("core", ruby_enable_coredump);
-#if defined _WIN32 && defined _MSC_VER && _MSC_VER >= 1400
- SET_WHEN("rtc_error", ruby_w32_rtc_error);
+ SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
+ SET_WHEN("core", ruby_enable_coredump, 1);
+#if defined _WIN32 && RUBY_MSVCRT_VERSION >= 80
+ SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
#endif
fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
}
diff --git a/defs/default_gems b/defs/default_gems
deleted file mode 100644
index e73e383b26..0000000000
--- a/defs/default_gems
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/defs/gmake.mk b/defs/gmake.mk
index 0acb88ef57..439ca9b6f0 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -1,20 +1,56 @@
# -*- makefile-gmake -*-
+gnumake = yes
+
+CHECK_TARGETS := exam love check%
TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
TEST_TARGETS += $(subst check,test-all,$(patsubst check-%,test-%,$(TEST_TARGETS)))
TEST_TARGETS := $(patsubst test-%,yes-test-%,$(patsubst btest-%,yes-btest-%,$(TEST_TARGETS)))
TEST_DEPENDS := $(if $(TEST_TARGETS),$(filter all main exts,$(MAKECMDGOALS)))
-TEST_DEPENDS += $(TEST_DEPENDS) $(if $(filter check%,$(MAKECMDGOALS)),main)
+TEST_DEPENDS += $(if $(filter $(CHECK_TARGETS),$(MAKECMDGOALS)),main)
+TEST_DEPENDS += $(if $(filter main,$(TEST_DEPENDS)),$(if $(filter all,$(INSTALLDOC)),docs))
+
+ifneq ($(filter -O0 -Od,$(optflags)),)
+override XCFLAGS := $(filter-out -D_FORTIFY_SOURCE=%,$(XCFLAGS))
+endif
+
+ifeq ($(if $(filter all main exts enc trans libencs libenc libtrans \
+ prog program ruby ruby$(EXEEXT) \
+ wprogram rubyw rubyw$(EXEEXT) \
+ miniruby$(EXEEXT) mini,\
+ $(MAKECMDGOALS)),,$(MAKECMDGOALS)),)
+-include $(SHOWFLAGS)
+endif
+
+ifneq ($(filter universal-%,$(arch)),)
+define archcmd
+%.$(1).S: %.c
+ @$$(ECHO) translating $$< with $(2)
+ $$(Q) $$(CC) $$(CFLAGS_NO_ARCH) $(2) $$(XCFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$@ -S $$<
+
+%.S: %.$(1).S
+
+%.$(1).i: %.c
+ @$$(ECHO) preprocessing $$< with $(2)
+ $$(Q) $$(CPP) $$(warnflags) $(2) $$(XCFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$@ -E $$< > $$@
-ifneq ($(filter check% test,$(MAKECMDGOALS)),)
+%.i: %.$(1).i
+endef
+
+$(foreach arch,$(filter -arch=%,$(subst -arch ,-arch=,$(ARCH_FLAG))),\
+ $(eval $(call archcmd,$(patsubst -arch=%,%,$(value arch)),$(patsubst -arch=%,-arch %,$(value arch)))))
+endif
+
+ifneq ($(filter $(CHECK_TARGETS) test,$(MAKECMDGOALS)),)
yes-test-knownbug: $(TEST_DEPENDS) yes-btest-ruby
yes-btest-ruby: $(TEST_DEPENDS) yes-test-sample
yes-test-sample: $(TEST_DEPENDS)
endif
-ifneq ($(filter check%,$(MAKECMDGOALS)) $(filter test-all,$(TEST_TARGETS)),)
-yes-test-all yes-test-ruby: $(filter-out %test-all %test-ruby check%,$(TEST_TARGETS))
+ifneq ($(filter $(CHECK_TARGETS),$(MAKECMDGOALS)) $(filter test-all,$(TEST_TARGETS)),)
+yes-test-testframework yes-test-almost yes-test-ruby: $(filter-out %test-all %test-ruby check%,$(TEST_TARGETS))
endif
-ifneq ($(filter check%,$(MAKECMDGOALS))$(if $(filter test-all,$(MAKECMDGOALS)),$(filter test-knownbug,$(MAKECMDGOALS))),)
-yes-test-all yes-test-ruby: yes-test-knownbug
+ifneq ($(filter $(CHECK_TARGETS),$(MAKECMDGOALS))$(if $(filter test-all,$(MAKECMDGOALS)),$(filter test-knownbug,$(MAKECMDGOALS))),)
+yes-test-testframework yes-test-almost yes-test-ruby: yes-test-knownbug
+yes-test-almost: yes-test-testframework
endif
$(TEST_TARGETS): $(TEST_DEPENDS)
@@ -25,5 +61,18 @@ $(word 1,$(install-targets)): $(word 0,$(install-targets))
endif
ifneq ($(filter reinstall,$(MAKECMDGOALS)),)
-install: uninstall
+install-prereq: uninstall
+uninstall sudo-precheck: all $(if $(filter all,$(INSTALLDOC)),docs)
+endif
+
+ifneq ($(filter exam,$(MAKECMDGOALS)),)
+test-rubyspec: check
+yes-test-all no-test-all: test
+endif
+
+ifneq ($(filter love,$(MAKECMDGOALS)),)
+showflags: up
+sudo-precheck: test
+install-prereq: sudo-precheck
+yes-test-all no-test-all: install
endif
diff --git a/defs/id.def b/defs/id.def
index 53ed3775ad..1ff0d9aa3d 100644
--- a/defs/id.def
+++ b/defs/id.def
@@ -26,6 +26,22 @@ firstline, predefined = __LINE__+1, %[\
initialize_copy
initialize_clone
initialize_dup
+ to_int
+ to_ary
+ to_str
+ to_sym
+ to_hash
+ to_proc
+ to_io
+ to_a
+ to_s
+ to_i
+ bt
+ bt_locations
+ call
+ mesg
+ exception
+
_ UScore
"/*NULL*/" NULL
empty?
@@ -44,6 +60,44 @@ firstline, predefined = __LINE__+1, %[\
core#hash_merge_ary
core#hash_merge_ptr
core#hash_merge_kwd
+
+ - debug#created_info
+]
+
+# VM ID OP Parser Token
+token_ops = %[\
+ Dot2 .. DOT2
+ Dot3 ... DOT3
+ UPlus +@ UPLUS
+ UMinus -@ UMINUS
+ Pow ** POW
+ DSTAR **
+ Cmp <=> CMP
+ PLUS +
+ MINUS -
+ MULT *
+ DIV /
+ MOD %
+ LTLT << LSHFT
+ GTGT >> RSHFT
+ LT <
+ LE <= LEQ
+ GT >
+ GE >= GEQ
+ Eq == EQ
+ Eqq === EQQ
+ Neq != NEQ
+ Not !
+ Backquote `
+ EqTilde =~ MATCH
+ NeqTilde !~ NMATCH
+ AREF []
+ ASET []=
+ COLON2 ::
+ COLON3 ::
+ ANDOP &&
+ OROP ||
+ ANDDOT &.
]
class KeywordError < RuntimeError
@@ -59,6 +113,8 @@ instance_ids = []
global_ids = []
const_ids = []
class_ids = []
+attrset_ids = []
+token_op_ids = []
names = {}
predefined.split(/^/).each_with_index do |line, num|
next if /^#/ =~ line
@@ -75,6 +131,10 @@ predefined.split(/^/).each_with_index do |line, num|
token.sub!(/\A@/, "_I_")
token.gsub!(/\W+/, "")
end
+ if name == '-'
+ preserved_ids << token
+ next
+ end
if prev = names[name]
KeywordError.raise("#{name} is already registered at line #{prev+firstline}", firstline+num)
end
@@ -88,18 +148,27 @@ predefined.split(/^/).each_with_index do |line, num|
when /\A\$(?:\d+|(?!\d)\w+)\z/; global_ids
when /\A@@(?!\d)\w+\z/; class_ids
when /\A@(?!\d)\w+\z/; instance_ids
- when /\A((?!\d)\w+)=\z/
- KeywordError.raise("use ID2ATTRSET(#{$1}) instead of ATTRSET #{name}", firstline+num)
+ when /\A((?!\d)\w+)=\z/; attrset_ids
else preserved_ids
end << token
predefined_ids[token] = name
end
+token_ops.split(/^/).each do |line|
+ next if /^#/ =~ line
+ line.sub!(/\s+#.*/, '')
+ id, op, token = line.split
+ next unless id and op
+ token ||= (id unless /\A\W\z/ =~ op)
+ token_op_ids << [id, op, token]
+end
{
"LOCAL" => local_ids,
"INSTANCE" => instance_ids,
"GLOBAL" => global_ids,
"CONST" => const_ids,
"CLASS" => class_ids,
+ "ATTRSET" => attrset_ids,
:preserved => preserved_ids,
:predefined => predefined_ids,
+ :token_op => token_op_ids,
}
diff --git a/defs/keywords b/defs/keywords
index 1b5719aa85..e0d931cd1f 100644
--- a/defs/keywords
+++ b/defs/keywords
@@ -1,5 +1,5 @@
%{
-struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
+struct kwtable {int name, id[2], state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
static const struct kwtable *reserved_word(const char *, unsigned int);
@@ -13,7 +13,7 @@ __LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
END, {keyword_END, keyword_END}, EXPR_END
-alias, {keyword_alias, keyword_alias}, EXPR_FNAME
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME|EXPR_FITEM
and, {keyword_and, keyword_and}, EXPR_VALUE
begin, {keyword_begin, keyword_begin}, EXPR_BEG
break, {keyword_break, keyword_break}, EXPR_MID
@@ -43,7 +43,7 @@ self, {keyword_self, keyword_self}, EXPR_END
super, {keyword_super, keyword_super}, EXPR_ARG
then, {keyword_then, keyword_then}, EXPR_BEG
true, {keyword_true, keyword_true}, EXPR_END
-undef, {keyword_undef, keyword_undef}, EXPR_FNAME
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME|EXPR_FITEM
unless, {keyword_unless, modifier_unless}, EXPR_VALUE
until, {keyword_until, modifier_until}, EXPR_VALUE
when, {keyword_when, keyword_when}, EXPR_VALUE
diff --git a/defs/known_errors.def b/defs/known_errors.def
index 3cebe90a8e..b9c490d3a2 100644
--- a/defs/known_errors.def
+++ b/defs/known_errors.def
@@ -143,3 +143,6 @@ EPROGMISMATCH
EPROGUNAVAIL
ERPCMISMATCH
EIPSEC
+EHWPOISON
+ECAPMODE
+ENOTCAPABLE
diff --git a/defs/lex.c.src b/defs/lex.c.src
index 1b5719aa85..e0d931cd1f 100644
--- a/defs/lex.c.src
+++ b/defs/lex.c.src
@@ -1,5 +1,5 @@
%{
-struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
+struct kwtable {int name, id[2], state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
static const struct kwtable *reserved_word(const char *, unsigned int);
@@ -13,7 +13,7 @@ __LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
END, {keyword_END, keyword_END}, EXPR_END
-alias, {keyword_alias, keyword_alias}, EXPR_FNAME
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME|EXPR_FITEM
and, {keyword_and, keyword_and}, EXPR_VALUE
begin, {keyword_begin, keyword_begin}, EXPR_BEG
break, {keyword_break, keyword_break}, EXPR_MID
@@ -43,7 +43,7 @@ self, {keyword_self, keyword_self}, EXPR_END
super, {keyword_super, keyword_super}, EXPR_ARG
then, {keyword_then, keyword_then}, EXPR_BEG
true, {keyword_true, keyword_true}, EXPR_END
-undef, {keyword_undef, keyword_undef}, EXPR_FNAME
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME|EXPR_FITEM
unless, {keyword_unless, modifier_unless}, EXPR_VALUE
until, {keyword_until, modifier_until}, EXPR_VALUE
when, {keyword_when, keyword_when}, EXPR_VALUE
diff --git a/defs/opt_operand.def b/defs/opt_operand.def
index ab7103a421..887e3da49a 100644
--- a/defs/opt_operand.def
+++ b/defs/opt_operand.def
@@ -1,5 +1,5 @@
#
-# configration file for operand union optimization
+# configuration file for operand union optimization
#
# format:
# [insn name] op1, op2 ...
diff --git a/dir.c b/dir.c
index 8492ce78d0..7376d5df1c 100644
--- a/dir.c
+++ b/dir.c
@@ -11,9 +11,8 @@
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
#include "internal.h"
+#include "encindex.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -73,24 +72,63 @@ char *strchr(char*,char);
#define rmdir(p) rb_w32_urmdir(p)
#undef opendir
#define opendir(p) rb_w32_uopendir(p)
+#define IS_WIN32 1
+#else
+#define IS_WIN32 0
+#endif
+
+#ifdef HAVE_SYS_ATTR_H
+#include <sys/attr.h>
+#endif
+
+#ifdef HAVE_GETATTRLIST
+# define USE_NAME_ON_FS 1
+# define RUP32(size) ((size)+3/4)
+# define SIZEUP32(type) RUP32(sizeof(type))
+#elif defined _WIN32
+# define USE_NAME_ON_FS 1
+#elif defined DOSISH
+# define USE_NAME_ON_FS 2 /* by fnmatch */
+#else
+# define USE_NAME_ON_FS 0
#endif
#ifdef __APPLE__
-# define HAVE_HFS 1
+# define NORMALIZE_UTF8PATH 1
#else
-# define HAVE_HFS 0
+# define NORMALIZE_UTF8PATH 0
#endif
-#if HAVE_HFS
+
+#if NORMALIZE_UTF8PATH
#include <sys/param.h>
#include <sys/mount.h>
+#include <sys/vnode.h>
+# if defined HAVE_FGETATTRLIST || !defined HAVE_GETATTRLIST
+# define need_normalization(dirp, path) need_normalization(dirp)
+# else
+# define need_normalization(dirp, path) need_normalization(path)
+# endif
static inline int
-is_hfs(DIR *dirp)
-{
- struct statfs buf;
- if (fstatfs(dirfd(dirp), &buf) == 0) {
- return buf.f_type == 17; /* HFS on darwin */
+need_normalization(DIR *dirp, const char *path)
+{
+# if defined HAVE_FGETATTRLIST || defined HAVE_GETATTRLIST
+ u_int32_t attrbuf[SIZEUP32(fsobj_tag_t)];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, ATTR_CMN_OBJTAG,};
+# if defined HAVE_FGETATTRLIST
+ int ret = fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), 0);
+# else
+ int ret = getattrlist(path, &al, attrbuf, sizeof(attrbuf), 0);
+# endif
+ if (!ret) {
+ const fsobj_tag_t *tag = (void *)(attrbuf+1);
+ switch (*tag) {
+ case VT_HFS:
+ case VT_CIFS:
+ return TRUE;
+ }
}
+# endif
return FALSE;
}
@@ -105,10 +143,30 @@ has_nonascii(const char *ptr, size_t len)
return 0;
}
-# define IF_HAVE_HFS(something) something
+# define IF_NORMALIZE_UTF8PATH(something) something
+#else
+# define IF_NORMALIZE_UTF8PATH(something) /* nothing */
+#endif
+
+#ifndef IFTODT
+# define IFTODT(m) (((m) & S_IFMT) / ((~S_IFMT & S_IFMT-1) + 1))
+#endif
+
+typedef enum {
+#ifdef DT_UNKNOWN
+ path_exist = DT_UNKNOWN,
+ path_directory = DT_DIR,
+ path_regular = DT_REG,
+ path_symlink = DT_LNK,
#else
-# define IF_HAVE_HFS(something) /* nothing */
+ path_exist,
+ path_directory = IFTODT(S_IFDIR),
+ path_regular = IFTODT(S_IFREG),
+ path_symlink = IFTODT(S_IFLNK),
#endif
+ path_noent = -1,
+ path_unknown = -2
+} rb_pathtype_t;
#define FNM_NOESCAPE 0x01
#define FNM_PATHNAME 0x02
@@ -120,6 +178,11 @@ has_nonascii(const char *ptr, size_t len)
#else
#define FNM_SYSCASE 0
#endif
+#if _WIN32
+#define FNM_SHORTNAME 0x20
+#else
+#define FNM_SHORTNAME 0
+#endif
#define FNM_NOMATCH 1
#define FNM_ERROR 2
@@ -196,7 +259,7 @@ bracket(
return ok == not ? NULL : (char *)p + 1;
}
-/* If FNM_PATHNAME is set, only path element will be matched. (upto '/' or '\0')
+/* If FNM_PATHNAME is set, only path element will be matched. (up to '/' or '\0')
Otherwise, entire string will be matched.
End marker itself won't be compared.
And if function succeeds, *pcur reaches end marker.
@@ -375,13 +438,13 @@ dir_free(void *ptr)
static size_t
dir_memsize(const void *ptr)
{
- return ptr ? sizeof(struct dir_data) : 0;
+ return sizeof(struct dir_data);
}
static const rb_data_type_t dir_data_type = {
"dir",
{dir_mark, dir_free, dir_memsize,},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE dir_close(VALUE);
@@ -425,9 +488,10 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
rb_encoding *fsenc;
VALUE dirname, opt, orig;
static ID keyword_ids[1];
+ const char *path;
if (!keyword_ids[0]) {
- keyword_ids[0] = rb_intern("encoding");
+ keyword_ids[0] = rb_id_encoding();
}
fsenc = rb_filesystem_encoding();
@@ -452,13 +516,23 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
dp->dir = NULL;
dp->path = Qnil;
dp->enc = fsenc;
- dp->dir = opendir(RSTRING_PTR(dirname));
+ path = RSTRING_PTR(dirname);
+ dp->dir = opendir(path);
if (dp->dir == NULL) {
- if (errno == EMFILE || errno == ENFILE) {
- rb_gc();
- dp->dir = opendir(RSTRING_PTR(dirname));
+ if (rb_gc_for_fd(errno)) {
+ dp->dir = opendir(path);
+ }
+#ifdef HAVE_GETATTRLIST
+ else if (errno == EIO) {
+ u_int32_t attrbuf[1];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0};
+ if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW) == 0) {
+ dp->dir = opendir(path);
+ }
}
+#endif
if (dp->dir == NULL) {
+ RB_GC_GUARD(dirname);
rb_sys_fail_path(orig);
}
}
@@ -504,11 +578,16 @@ dir_closed(void)
}
static struct dir_data *
-dir_check(VALUE dir)
+dir_get(VALUE dir)
{
- struct dir_data *dirp;
rb_check_frozen(dir);
- dirp = rb_check_typeddata(dir, &dir_data_type);
+ return rb_check_typeddata(dir, &dir_data_type);
+}
+
+static struct dir_data *
+dir_check(VALUE dir)
+{
+ struct dir_data *dirp = dir_get(dir);
if (!dirp->dir) dir_closed();
return dirp;
}
@@ -536,9 +615,53 @@ dir_inspect(VALUE dir)
rb_str_cat2(str, ">");
return str;
}
- return rb_funcall(dir, rb_intern("to_s"), 0, 0);
+ return rb_funcallv(dir, rb_intern("to_s"), 0, 0);
}
+/* Workaround for Solaris 10 that does not have dirfd.
+ Note: Solaris 11 (POSIX.1-2008 compliant) has dirfd(3C).
+ */
+#if defined(__sun) && !defined(HAVE_DIRFD)
+# if defined(HAVE_DIR_D_FD)
+# define dirfd(x) ((x)->d_fd)
+# define HAVE_DIRFD 1
+# elif defined(HAVE_DIR_DD_FD)
+# define dirfd(x) ((x)->dd_fd)
+# define HAVE_DIRFD 1
+# endif
+#endif
+
+#ifdef HAVE_DIRFD
+/*
+ * call-seq:
+ * dir.fileno -> integer
+ *
+ * Returns the file descriptor used in <em>dir</em>.
+ *
+ * d = Dir.new("..")
+ * d.fileno #=> 8
+ *
+ * This method uses dirfd() function defined by POSIX 2008.
+ * NotImplementedError is raised on other platforms, such as Windows,
+ * which doesn't provide the function.
+ *
+ */
+static VALUE
+dir_fileno(VALUE dir)
+{
+ struct dir_data *dirp;
+ int fd;
+
+ GetDIR(dir, dirp);
+ fd = dirfd(dirp->dir);
+ if (fd == -1)
+ rb_sys_fail("dirfd");
+ return INT2NUM(fd);
+}
+#else
+#define dir_fileno rb_f_notimplement
+#endif
+
/*
* call-seq:
* dir.path -> string or nil
@@ -560,6 +683,18 @@ dir_path(VALUE dir)
}
#if defined _WIN32
+static int
+fundamental_encoding_p(rb_encoding *enc)
+{
+ switch (rb_enc_to_index(enc)) {
+ case ENCINDEX_ASCII:
+ case ENCINDEX_US_ASCII:
+ case ENCINDEX_UTF_8:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
# define READDIR(dir, enc) rb_w32_readdir((dir), (enc))
#else
# define READDIR(dir, enc) readdir((dir))
@@ -619,18 +754,18 @@ dir_each(VALUE dir)
{
struct dir_data *dirp;
struct dirent *dp;
- IF_HAVE_HFS(int hfs_p);
+ IF_NORMALIZE_UTF8PATH(int norm_p);
RETURN_ENUMERATOR(dir, 0, 0);
GetDIR(dir, dirp);
rewinddir(dirp->dir);
- IF_HAVE_HFS(hfs_p = is_hfs(dirp->dir));
+ IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp->dir, RSTRING_PTR(dirp->path)));
while ((dp = READDIR(dirp->dir, dirp->enc)) != NULL) {
const char *name = dp->d_name;
size_t namlen = NAMLEN(dp);
VALUE path;
-#if HAVE_HFS
- if (hfs_p && has_nonascii(name, namlen) &&
+#if NORMALIZE_UTF8PATH
+ if (norm_p && has_nonascii(name, namlen) &&
!NIL_P(path = rb_str_normalize_ospath(name, namlen))) {
path = rb_external_str_with_enc(path, dirp->enc);
}
@@ -750,8 +885,8 @@ dir_rewind(VALUE dir)
* call-seq:
* dir.close -> nil
*
- * Closes the directory stream. Any further attempts to access
- * <em>dir</em> will raise an <code>IOError</code>.
+ * Closes the directory stream.
+ * Calling this method on closed Dir object is ignored since Ruby 2.3.
*
* d = Dir.new("testdir")
* d.close #=> nil
@@ -761,7 +896,8 @@ dir_close(VALUE dir)
{
struct dir_data *dirp;
- GetDIR(dir, dirp);
+ dirp = dir_get(dir);
+ if (!dirp->dir) return Qnil;
closedir(dirp->dir);
dirp->dir = NULL;
@@ -850,7 +986,6 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
{
VALUE path = Qnil;
- rb_secure(2);
if (rb_scan_args(argc, argv, "01", &path) == 1) {
FilePathValue(path);
path = rb_str_encode_ospath(path);
@@ -887,10 +1022,17 @@ rb_dir_getwd(void)
{
char *path;
VALUE cwd;
+ int fsenc = rb_enc_to_index(rb_filesystem_encoding());
+ if (fsenc == ENCINDEX_US_ASCII) fsenc = ENCINDEX_ASCII;
path = my_getcwd();
+#ifdef __APPLE__
+ cwd = rb_str_normalize_ospath(path, strlen(path));
+ OBJ_TAINT(cwd);
+#else
cwd = rb_tainted_str_new2(path);
- rb_enc_associate(cwd, rb_filesystem_encoding());
+#endif
+ rb_enc_associate_index(cwd, fsenc);
xfree(path);
return cwd;
@@ -906,6 +1048,7 @@ rb_dir_getwd(void)
*
* Dir.chdir("/tmp") #=> 0
* Dir.getwd #=> "/tmp"
+ * Dir.pwd #=> "/tmp"
*/
static VALUE
dir_s_getwd(VALUE dir)
@@ -913,15 +1056,14 @@ dir_s_getwd(VALUE dir)
return rb_dir_getwd();
}
-static void
-check_dirname(volatile VALUE *dir)
+static VALUE
+check_dirname(VALUE dir)
{
- VALUE d = *dir;
+ VALUE d = dir;
char *path, *pend;
long len;
rb_encoding *enc;
- rb_secure(2);
FilePathValue(d);
enc = rb_enc_get(d);
RSTRING_GETMEM(d, path, len);
@@ -929,8 +1071,9 @@ check_dirname(volatile VALUE *dir)
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);
+ StringValueCStr(d);
}
- *dir = rb_str_encode_ospath(d);
+ return rb_str_encode_ospath(d);
}
#if defined(HAVE_CHROOT)
@@ -946,7 +1089,7 @@ check_dirname(volatile VALUE *dir)
static VALUE
dir_s_chroot(VALUE dir, VALUE path)
{
- check_dirname(&path);
+ path = check_dirname(path);
if (chroot(RSTRING_PTR(path)) == -1)
rb_sys_fail_path(path);
@@ -984,7 +1127,7 @@ dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
mode = 0777;
}
- check_dirname(&path);
+ path = check_dirname(path);
if (mkdir(RSTRING_PTR(path), mode) == -1)
rb_sys_fail_path(path);
@@ -1003,26 +1146,56 @@ dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
static VALUE
dir_s_rmdir(VALUE obj, VALUE dir)
{
- check_dirname(&dir);
+ dir = check_dirname(dir);
if (rmdir(RSTRING_PTR(dir)) < 0)
rb_sys_fail_path(dir);
return INT2FIX(0);
}
+struct warning_args {
+#ifdef RUBY_FUNCTION_NAME_STRING
+ const char *func;
+#endif
+ const char *mesg;
+ rb_encoding *enc;
+};
+
+#ifndef RUBY_FUNCTION_NAME_STRING
+#define sys_enc_warning_in(func, mesg, enc) sys_enc_warning(mesg, enc)
+#endif
+
static VALUE
sys_warning_1(VALUE mesg)
{
- rb_sys_warning("%s:%s", strerror(errno), (const char *)mesg);
+ const struct warning_args *arg = (struct warning_args *)mesg;
+#ifdef RUBY_FUNCTION_NAME_STRING
+ rb_sys_enc_warning(arg->enc, "%s: %s", arg->func, arg->mesg);
+#else
+ rb_sys_enc_warning(arg->enc, "%s", arg->mesg);
+#endif
return Qnil;
}
+static void
+sys_enc_warning_in(const char *func, const char *mesg, rb_encoding *enc)
+{
+ struct warning_args arg;
+#ifdef RUBY_FUNCTION_NAME_STRING
+ arg.func = func;
+#endif
+ arg.mesg = mesg;
+ arg.enc = enc;
+ rb_protect(sys_warning_1, (VALUE)&arg, 0);
+}
+
#define GLOB_VERBOSE (1U << (sizeof(int) * CHAR_BIT - 1))
-#define sys_warning(val) \
- (void)((flags & GLOB_VERBOSE) && rb_protect(sys_warning_1, (VALUE)(val), 0))
+#define sys_warning(val, enc) \
+ ((flags & GLOB_VERBOSE) ? sys_enc_warning_in(RUBY_FUNCTION_NAME_STRING, (val), (enc)) :(void)0)
#define GLOB_ALLOC(type) ((type *)malloc(sizeof(type)))
#define GLOB_ALLOC_N(type, n) ((type *)malloc(sizeof(type) * (n)))
+#define GLOB_REALLOC(ptr, size) realloc((ptr), (size))
#define GLOB_FREE(ptr) free(ptr)
#define GLOB_JUMP_TAG(status) (((status) == -1) ? rb_memerror() : rb_jump_tag(status))
@@ -1034,29 +1207,30 @@ sys_warning_1(VALUE mesg)
#ifdef _WIN32
#define STAT(p, s) rb_w32_ustati64((p), (s))
+#undef lstat
+#define lstat(p, s) rb_w32_ulstati64((p), (s))
#else
#define STAT(p, s) stat((p), (s))
#endif
/* System call with warning */
static int
-do_stat(const char *path, struct stat *pst, int flags)
-
+do_stat(const char *path, struct stat *pst, int flags, rb_encoding *enc)
{
int ret = STAT(path, pst);
if (ret < 0 && !to_be_ignored(errno))
- sys_warning(path);
+ sys_warning(path, enc);
return ret;
}
#if defined HAVE_LSTAT || defined lstat
static int
-do_lstat(const char *path, struct stat *pst, int flags)
+do_lstat(const char *path, struct stat *pst, int flags, rb_encoding *enc)
{
int ret = lstat(path, pst);
if (ret < 0 && !to_be_ignored(errno))
- sys_warning(path);
+ sys_warning(path, enc);
return ret;
}
@@ -1069,10 +1243,8 @@ do_opendir(const char *path, int flags, rb_encoding *enc)
{
DIR *dirp;
#ifdef _WIN32
- volatile VALUE tmp;
- if (enc != rb_usascii_encoding() &&
- enc != rb_ascii8bit_encoding() &&
- enc != rb_utf8_encoding()) {
+ VALUE tmp = 0;
+ if (!fundamental_encoding_p(enc)) {
tmp = rb_enc_str_new(path, strlen(path), enc);
tmp = rb_str_encode_ospath(tmp);
path = RSTRING_PTR(tmp);
@@ -1080,17 +1252,23 @@ do_opendir(const char *path, int flags, rb_encoding *enc)
#endif
dirp = opendir(path);
if (dirp == NULL && !to_be_ignored(errno))
- sys_warning(path);
+ sys_warning(path, enc);
+#ifdef _WIN32
+ if (tmp) rb_str_resize(tmp, 0); /* GC guard */
+#endif
return dirp;
}
+/* Globing pattern */
+enum glob_pattern_type { PLAIN, ALPHA, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR };
+
/* Return nonzero if S has any special globbing chars in it. */
-static int
+static enum glob_pattern_type
has_magic(const char *p, const char *pend, int flags, rb_encoding *enc)
{
const int escape = !(flags & FNM_NOESCAPE);
- const int nocase = flags & FNM_CASEFOLD;
+ int hasalpha = 0;
register char c;
@@ -1099,22 +1277,32 @@ has_magic(const char *p, const char *pend, int flags, rb_encoding *enc)
case '*':
case '?':
case '[':
- return 1;
+ return MAGICAL;
case '\\':
- if (escape && !(c = *p++))
- return 0;
- continue;
+ if (escape && p++ >= pend)
+ continue;
+ break;
+#ifdef _WIN32
+ case '.':
+ break;
+
+ case '~':
+ hasalpha = 1;
+ break;
+#endif
default:
- if (!FNM_SYSCASE && ISALPHA(c) && nocase)
- return 1;
+ if (IS_WIN32 || ISALPHA(c)) {
+ hasalpha = 1;
+ }
+ break;
}
p = Next(p-1, pend, enc);
}
- return 0;
+ return hasalpha ? ALPHA : PLAIN;
}
/* Find separator in globbing pattern. */
@@ -1178,9 +1366,6 @@ remove_backslashes(char *p, register const char *pend, rb_encoding *enc)
return p;
}
-/* Globing pattern */
-enum glob_pattern_type { PLAIN, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR };
-
struct glob_pattern {
char *str;
enum glob_pattern_type type;
@@ -1199,7 +1384,7 @@ glob_make_pattern(const char *p, const char *e, int flags, rb_encoding *enc)
while (p < e && *p) {
tmp = GLOB_ALLOC(struct glob_pattern);
if (!tmp) goto error;
- if (p[0] == '*' && p[1] == '*' && p[2] == '/') {
+ if (p + 2 < e && p[0] == '*' && p[1] == '*' && p[2] == '/') {
/* fold continuous RECURSIVEs (needed in glob_helper) */
do { p += 3; while (*p == '/') p++; } while (p[0] == '*' && p[1] == '*' && p[2] == '/');
tmp->type = RECURSIVE;
@@ -1209,12 +1394,13 @@ glob_make_pattern(const char *p, const char *e, int flags, rb_encoding *enc)
}
else {
const char *m = find_dirsep(p, e, flags, enc);
- int magic = has_magic(p, m, flags, enc);
+ const enum glob_pattern_type magic = has_magic(p, m, flags, enc);
+ const enum glob_pattern_type non_magic = (USE_NAME_ON_FS || FNM_SYSCASE) ? PLAIN : ALPHA;
char *buf;
- if (!magic && !recursive && *m) {
+ if (!(FNM_SYSCASE || magic > non_magic) && !recursive && *m) {
const char *m2;
- while (!has_magic(m+1, m2 = find_dirsep(m+1, e, flags, enc), flags, enc) &&
+ while (has_magic(m+1, m2 = find_dirsep(m+1, e, flags, enc), flags, enc) <= non_magic &&
*m2) {
m = m2;
}
@@ -1226,7 +1412,7 @@ glob_make_pattern(const char *p, const char *e, int flags, rb_encoding *enc)
}
memcpy(buf, p, m-p);
buf[m-p] = '\0';
- tmp->type = magic ? MAGICAL : PLAIN;
+ tmp->type = magic > MAGICAL ? MAGICAL : magic > non_magic ? magic : PLAIN;
tmp->str = buf;
if (*m) {
dirsep = 1;
@@ -1283,7 +1469,165 @@ join_path(const char *path, long len, int dirsep, const char *name, size_t namle
return buf;
}
-enum answer {UNKNOWN = -1, NO, YES};
+#ifdef HAVE_GETATTRLIST
+# if defined HAVE_FGETATTRLIST
+# define is_case_sensitive(dirp, path) is_case_sensitive(dirp)
+# else
+# define is_case_sensitive(dirp, path) is_case_sensitive(path)
+# endif
+static int
+is_case_sensitive(DIR *dirp, const char *path)
+{
+ struct {
+ u_int32_t length;
+ vol_capabilities_attr_t cap[1];
+ } __attribute__((aligned(4), packed)) attrbuf[1];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, 0, ATTR_VOL_INFO|ATTR_VOL_CAPABILITIES};
+ const vol_capabilities_attr_t *const cap = attrbuf[0].cap;
+ const int idx = VOL_CAPABILITIES_FORMAT;
+ const uint32_t mask = VOL_CAP_FMT_CASE_SENSITIVE;
+
+# if defined HAVE_FGETATTRLIST
+ if (fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
+ return -1;
+# else
+ if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
+ return -1;
+# endif
+ if (!(cap->valid[idx] & mask))
+ return -1;
+ return (cap->capabilities[idx] & mask) != 0;
+}
+
+static char *
+replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p, int flags, rb_pathtype_t *type)
+{
+ struct {
+ u_int32_t length;
+ attrreference_t ref[1];
+ fsobj_type_t objtype;
+ char path[MAXPATHLEN * 3];
+ } __attribute__((aligned(4), packed)) attrbuf[1];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, ATTR_CMN_NAME|ATTR_CMN_OBJTYPE};
+ const attrreference_t *const ar = attrbuf[0].ref;
+ const char *name;
+ long len;
+ char *tmp;
+ IF_NORMALIZE_UTF8PATH(VALUE utf8str = Qnil);
+
+ *type = path_noent;
+ if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW)) {
+ if (!to_be_ignored(errno))
+ sys_warning(path, enc);
+ return path;
+ }
+
+ switch (attrbuf[0].objtype) {
+ case VREG: *type = path_regular; break;
+ case VDIR: *type = path_directory; break;
+ case VLNK: *type = path_symlink; break;
+ default: *type = path_exist; break;
+ }
+ name = (char *)ar + ar->attr_dataoffset;
+ len = (long)ar->attr_length - 1;
+ if (name + len > (char *)attrbuf + sizeof(attrbuf))
+ return path;
+
+# if NORMALIZE_UTF8PATH
+ if (norm_p && has_nonascii(name, len)) {
+ if (!NIL_P(utf8str = rb_str_normalize_ospath(name, len))) {
+ RSTRING_GETMEM(utf8str, name, len);
+ }
+ }
+# endif
+
+ tmp = GLOB_REALLOC(path, base + len + 1);
+ if (tmp) {
+ path = tmp;
+ memcpy(path + base, name, len);
+ path[base + len] = '\0';
+ }
+ IF_NORMALIZE_UTF8PATH(if (!NIL_P(utf8str)) rb_str_resize(utf8str, 0));
+ return path;
+}
+#elif defined _WIN32
+VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
+int rb_w32_reparse_symlink_p(const WCHAR *path);
+
+static char *
+replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p, int flags, rb_pathtype_t *type)
+{
+ char *plainname = path;
+ volatile VALUE tmp = 0;
+ WIN32_FIND_DATAW fd;
+ WIN32_FILE_ATTRIBUTE_DATA fa;
+ WCHAR *wplain;
+ HANDLE h = INVALID_HANDLE_VALUE;
+ long wlen;
+ int e = 0;
+ if (!fundamental_encoding_p(enc)) {
+ tmp = rb_enc_str_new_cstr(plainname, enc);
+ tmp = rb_str_encode_ospath(tmp);
+ plainname = RSTRING_PTR(tmp);
+ }
+ wplain = rb_w32_mbstr_to_wstr(CP_UTF8, plainname, -1, &wlen);
+ if (tmp) rb_str_resize(tmp, 0);
+ if (!wplain) return path;
+ if (GetFileAttributesExW(wplain, GetFileExInfoStandard, &fa)) {
+ h = FindFirstFileW(wplain, &fd);
+ e = rb_w32_map_errno(GetLastError());
+ }
+ if (fa.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (!rb_w32_reparse_symlink_p(wplain))
+ fa.dwFileAttributes &= ~FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+ free(wplain);
+ if (h == INVALID_HANDLE_VALUE) {
+ *type = path_noent;
+ if (e && !to_be_ignored(e)) {
+ errno = e;
+ sys_warning(path, enc);
+ }
+ return path;
+ }
+ FindClose(h);
+ *type =
+ (fa.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) ? path_symlink :
+ (fa.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? path_directory :
+ path_regular;
+ if (tmp) {
+ char *buf;
+ tmp = rb_w32_conv_from_wchar(fd.cFileName, enc);
+ wlen = RSTRING_LEN(tmp);
+ buf = GLOB_REALLOC(path, base + wlen + 1);
+ if (buf) {
+ path = buf;
+ memcpy(path + base, RSTRING_PTR(tmp), wlen);
+ path[base + wlen] = 0;
+ }
+ rb_str_resize(tmp, 0);
+ }
+ else {
+ char *utf8filename;
+ wlen = WideCharToMultiByte(CP_UTF8, 0, fd.cFileName, -1, NULL, 0, NULL, NULL);
+ utf8filename = GLOB_REALLOC(0, wlen);
+ if (utf8filename) {
+ char *buf;
+ WideCharToMultiByte(CP_UTF8, 0, fd.cFileName, -1, utf8filename, wlen, NULL, NULL);
+ buf = GLOB_REALLOC(path, base + wlen + 1);
+ if (buf) {
+ path = buf;
+ memcpy(path + base, utf8filename, wlen);
+ path[base + wlen] = 0;
+ }
+ GLOB_FREE(utf8filename);
+ }
+ }
+ return path;
+}
+#elif USE_NAME_ON_FS == 1
+# error not implemented
+#endif
#ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
@@ -1304,23 +1648,35 @@ struct glob_args {
rb_encoding *enc;
};
+#define glob_call_func(func, path, arg, enc) (*(func))((path), (arg), (void *)(enc))
+
static VALUE
glob_func_caller(VALUE val)
{
struct glob_args *args = (struct glob_args *)val;
- (*args->func)(args->path, args->value, args->enc);
+ glob_call_func(args->func, args->path, args->value, args->enc);
return Qnil;
}
-#define glob_call_func(func, path, arg, enc) (*(func))((path), (arg), (enc))
+static inline int
+dirent_match(const char *pat, rb_encoding *enc, const char *name, const struct dirent *dp, int flags)
+{
+ if (fnmatch(pat, enc, name, flags) == 0) return 1;
+#ifdef _WIN32
+ if (dp->d_altname && (flags & FNM_SHORTNAME)) {
+ if (fnmatch(pat, enc, dp->d_altname, flags) == 0) return 1;
+ }
+#endif
+ return 0;
+}
static int
glob_helper(
const char *path,
+ long pathlen,
int dirsep, /* '/' should be placed before appending child entry's name to 'path'. */
- enum answer exist, /* Does 'path' indicate an existing entry? */
- enum answer isdir, /* Does 'path' indicate a directory or a symlink to a directory? */
+ rb_pathtype_t pathtype, /* type of 'path' */
struct glob_pattern **beg,
struct glob_pattern **end,
int flags,
@@ -1333,7 +1689,6 @@ glob_helper(
struct glob_pattern **cur, **new_beg, **new_end;
int plain = 0, magical = 0, recursive = 0, match_all = 0, match_dir = 0;
int escape = !(flags & FNM_NOESCAPE);
- long pathlen;
for (cur = beg; cur < end; ++cur) {
struct glob_pattern *p = *cur;
@@ -1345,8 +1700,15 @@ glob_helper(
case PLAIN:
plain = 1;
break;
- case MAGICAL:
+ case ALPHA:
+#if USE_NAME_ON_FS == 1
+ plain = 1;
+#else
magical = 1;
+#endif
+ break;
+ case MAGICAL:
+ magical = 2;
break;
case MATCH_ALL:
match_all = 1;
@@ -1359,33 +1721,28 @@ glob_helper(
}
}
- pathlen = strlen(path);
if (*path) {
- if (match_all && exist == UNKNOWN) {
- if (do_lstat(path, &st, flags) == 0) {
- exist = YES;
- isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
+ if (match_all && pathtype == path_unknown) {
+ if (do_lstat(path, &st, flags, enc) == 0) {
+ pathtype = IFTODT(st.st_mode);
}
else {
- exist = NO;
- isdir = NO;
+ pathtype = path_noent;
}
}
- if (match_dir && isdir == UNKNOWN) {
- if (do_stat(path, &st, flags) == 0) {
- exist = YES;
- isdir = S_ISDIR(st.st_mode) ? YES : NO;
+ if (match_dir && pathtype == path_unknown) {
+ if (do_stat(path, &st, flags, enc) == 0) {
+ pathtype = IFTODT(st.st_mode);
}
else {
- exist = NO;
- isdir = NO;
+ pathtype = path_noent;
}
}
- if (match_all && exist == YES) {
+ if (match_all && pathtype > path_noent) {
status = glob_call_func(func, path, arg, enc);
if (status) return status;
}
- if (match_dir && isdir == YES) {
+ if (match_dir && pathtype == path_directory) {
char *tmp = join_path(path, pathlen, dirsep, "", 0);
if (!tmp) return -1;
status = glob_call_func(func, tmp, arg, enc);
@@ -1394,23 +1751,53 @@ glob_helper(
}
}
- if (exist == NO || isdir == NO) return 0;
+ if (pathtype == path_noent) return 0;
if (magical || recursive) {
struct dirent *dp;
DIR *dirp;
- IF_HAVE_HFS(int hfs_p);
+# if USE_NAME_ON_FS == 2
+ char *plainname = 0;
+# endif
+ IF_NORMALIZE_UTF8PATH(int norm_p);
+# if USE_NAME_ON_FS == 2
+ if (cur + 1 == end && (*cur)->type <= ALPHA) {
+ plainname = join_path(path, pathlen, dirsep, (*cur)->str, strlen((*cur)->str));
+ if (!plainname) return -1;
+ dirp = do_opendir(plainname, flags, enc);
+ GLOB_FREE(plainname);
+ }
+ else
+# endif
dirp = do_opendir(*path ? path : ".", flags, enc);
- if (dirp == NULL) return 0;
- IF_HAVE_HFS(hfs_p = is_hfs(dirp));
+ if (dirp == NULL) {
+# if FNM_SYSCASE || NORMALIZE_UTF8PATH
+ if ((magical < 2) && !recursive && (errno == EACCES)) {
+ /* no read permission, fallback */
+ goto literally;
+ }
+# endif
+ return 0;
+ }
+ IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp, *path ? path : "."));
+# if NORMALIZE_UTF8PATH
+ if (!(norm_p || magical || recursive)) {
+ closedir(dirp);
+ goto literally;
+ }
+# endif
+# ifdef HAVE_GETATTRLIST
+ if (is_case_sensitive(dirp, path) == 0)
+ flags |= FNM_CASEFOLD;
+# endif
while ((dp = READDIR(dirp, enc)) != NULL) {
char *buf;
- enum answer new_isdir = UNKNOWN;
+ rb_pathtype_t new_pathtype = path_unknown;
const char *name;
size_t namlen;
int dotfile = 0;
- IF_HAVE_HFS(VALUE utf8str = Qnil);
+ IF_NORMALIZE_UTF8PATH(VALUE utf8str = Qnil);
if (recursive && dp->d_name[0] == '.') {
++dotfile;
@@ -1427,30 +1814,33 @@ glob_helper(
name = dp->d_name;
namlen = NAMLEN(dp);
-# if HAVE_HFS
- if (hfs_p && has_nonascii(name, namlen)) {
+# if NORMALIZE_UTF8PATH
+ if (norm_p && has_nonascii(name, namlen)) {
if (!NIL_P(utf8str = rb_str_normalize_ospath(name, namlen))) {
RSTRING_GETMEM(utf8str, name, namlen);
}
}
# endif
buf = join_path(path, pathlen, dirsep, name, namlen);
- IF_HAVE_HFS(if (!NIL_P(utf8str)) rb_str_resize(utf8str, 0));
+ IF_NORMALIZE_UTF8PATH(if (!NIL_P(utf8str)) rb_str_resize(utf8str, 0));
if (!buf) {
status = -1;
break;
}
name = buf + pathlen + (dirsep != 0);
if (recursive && dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1)) {
- /* RECURSIVE never match dot files unless FNM_DOTMATCH is set */
-#ifndef _WIN32
- if (do_lstat(buf, &st, flags) == 0)
- new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
+#ifdef DT_UNKNOWN
+ if ((new_pathtype = dp->d_type) != (rb_pathtype_t)DT_UNKNOWN)
+ /* Got it. We need nothing more. */
+ ;
else
- new_isdir = NO;
-#else
- new_isdir = dp->d_isdir ? (!dp->d_isrep ? YES : UNKNOWN) : NO;
+ /* fall back to call lstat(2) */
#endif
+ /* RECURSIVE never match dot files unless FNM_DOTMATCH is set */
+ if (do_lstat(buf, &st, flags, enc) == 0)
+ new_pathtype = IFTODT(st.st_mode);
+ else
+ new_pathtype = path_noent;
}
new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, (end - beg) * 2);
@@ -1463,17 +1853,30 @@ glob_helper(
for (cur = beg; cur < end; ++cur) {
struct glob_pattern *p = *cur;
if (p->type == RECURSIVE) {
- if (new_isdir == YES) /* not symlink but real directory */
+ if (new_pathtype == path_directory || /* not symlink but real directory */
+ new_pathtype == path_exist)
*new_end++ = p; /* append recursive pattern */
p = p->next; /* 0 times recursion */
}
- if (p->type == PLAIN || p->type == MAGICAL) {
- if (fnmatch(p->str, enc, name, flags) == 0)
+ switch (p->type) {
+ case ALPHA:
+# if USE_NAME_ON_FS == 2
+ if (plainname) {
+ *new_end++ = p->next;
+ break;
+ }
+# endif
+ case PLAIN:
+ case MAGICAL:
+ if (dirent_match(p->str, enc, name, dp, flags))
*new_end++ = p->next;
+ default:
+ break;
}
}
- status = glob_helper(buf, 1, YES, new_isdir, new_beg, new_end,
+ status = glob_helper(buf, name - buf + namlen, 1,
+ new_pathtype, new_beg, new_end,
flags, func, arg, enc);
GLOB_FREE(buf);
GLOB_FREE(new_beg);
@@ -1485,13 +1888,17 @@ glob_helper(
else if (plain) {
struct glob_pattern **copy_beg, **copy_end, **cur2;
+# if FNM_SYSCASE || NORMALIZE_UTF8PATH
+ literally:
+# endif
copy_beg = copy_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg);
if (!copy_beg) return -1;
for (cur = beg; cur < end; ++cur)
- *copy_end++ = (*cur)->type == PLAIN ? *cur : 0;
+ *copy_end++ = (*cur)->type <= ALPHA ? *cur : 0;
for (cur = copy_beg; cur < copy_end; ++cur) {
if (*cur) {
+ rb_pathtype_t new_pathtype = path_unknown;
char *buf;
char *name;
size_t len = strlen((*cur)->str) + 1;
@@ -1525,8 +1932,16 @@ glob_helper(
status = -1;
break;
}
- status = glob_helper(buf, 1, UNKNOWN, UNKNOWN, new_beg,
- new_end, flags, func, arg, enc);
+#if USE_NAME_ON_FS == 1
+ if ((*cur)->type == ALPHA) {
+ long base = pathlen + (dirsep != 0);
+ buf = replace_real_basename(buf, base, enc, IF_NORMALIZE_UTF8PATH(1)+0,
+ flags, &new_pathtype);
+ }
+#endif
+ status = glob_helper(buf, pathlen + strlen(buf + pathlen), 1,
+ new_pathtype, new_beg, new_end,
+ flags, func, arg, enc);
GLOB_FREE(buf);
GLOB_FREE(new_beg);
if (status) break;
@@ -1554,7 +1969,7 @@ ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_enco
root = rb_enc_path_skip_prefix(root, root + strlen(root), enc);
#endif
- if (root && *root == '/') root++;
+ if (*root == '/') root++;
n = root - start;
buf = GLOB_ALLOC_N(char, n + 1);
@@ -1567,7 +1982,8 @@ ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_enco
GLOB_FREE(buf);
return -1;
}
- status = glob_helper(buf, 0, UNKNOWN, UNKNOWN, &list, &list + 1, flags, func, arg, enc);
+ status = glob_helper(buf, n, 0, path_unknown, &list, &list + 1,
+ flags, func, arg, enc);
glob_free_pattern(list);
GLOB_FREE(buf);
@@ -1621,7 +2037,15 @@ rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg)
static void
push_pattern(const char *path, VALUE ary, void *enc)
{
- rb_ary_push(ary, rb_external_str_new_with_enc(path, strlen(path), enc));
+#if defined _WIN32 || defined __APPLE__
+ VALUE name = rb_utf8_str_new_cstr(path);
+ rb_encoding *eenc = rb_default_internal_encoding();
+ OBJ_TAINT(name);
+ name = rb_str_conv_enc(name, NULL, eenc ? eenc : enc);
+#else
+ VALUE name = rb_external_str_new_with_enc(path, strlen(path), enc);
+#endif
+ rb_ary_push(ary, name);
}
static int
@@ -1639,7 +2063,7 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
if (*p == '{' && nest++ == 0) {
lbrace = p;
}
- if (*p == '}' && --nest <= 0) {
+ if (*p == '}' && lbrace && --nest == 0) {
rbrace = p;
break;
}
@@ -1677,7 +2101,7 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
GLOB_FREE(buf);
}
else if (!lbrace && !rbrace) {
- status = (*func)(s, arg, enc);
+ status = glob_call_func(func, s, arg, enc);
}
return status;
@@ -1697,12 +2121,12 @@ glob_brace(const char *path, VALUE val, void *enc)
return ruby_glob0(path, arg->flags, arg->func, arg->value, enc);
}
-static int
-ruby_brace_glob0(const char *str, int flags, ruby_glob_func *func, VALUE arg,
- rb_encoding* enc)
+int
+ruby_brace_glob_with_enc(const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
{
struct brace_args args;
+ flags &= ~GLOB_VERBOSE;
args.func = func;
args.value = arg;
args.flags = flags;
@@ -1712,30 +2136,47 @@ ruby_brace_glob0(const char *str, int flags, ruby_glob_func *func, VALUE arg,
int
ruby_brace_glob(const char *str, int flags, ruby_glob_func *func, VALUE arg)
{
- return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg,
- rb_ascii8bit_encoding());
+ return ruby_brace_glob_with_enc(str, flags, func, arg, rb_ascii8bit_encoding());
}
-int
-ruby_brace_glob_with_enc(const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
+struct push_glob_args {
+ struct glob_args glob;
+ int flags;
+};
+
+static int
+push_caller(const char *path, VALUE val, void *enc)
{
- return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg, enc);
+ struct push_glob_args *arg = (struct push_glob_args *)val;
+
+ return ruby_glob0(path, arg->flags, rb_glob_caller, (VALUE)&arg->glob, enc);
}
static int
push_glob(VALUE ary, VALUE str, int flags)
{
- struct glob_args args;
+ struct push_glob_args args;
rb_encoding *enc = rb_enc_get(str);
- if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
- args.func = push_pattern;
- args.value = ary;
- args.enc = enc;
+#if defined _WIN32 || defined __APPLE__
+ str = rb_str_encode_ospath(str);
+#endif
+ if (rb_enc_to_index(enc) == ENCINDEX_US_ASCII)
+ enc = rb_filesystem_encoding();
+ if (rb_enc_to_index(enc) == ENCINDEX_US_ASCII)
+ enc = rb_ascii8bit_encoding();
+ flags |= GLOB_VERBOSE;
+ args.glob.func = push_pattern;
+ args.glob.value = ary;
+ args.glob.enc = enc;
+ args.flags = flags;
+#if defined _WIN32 || defined __APPLE__
+ enc = rb_utf8_encoding();
+#endif
RB_GC_GUARD(str);
- return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
- rb_glob_caller, (VALUE)&args, enc);
+ return ruby_brace_expand(RSTRING_PTR(str), flags,
+ push_caller, (VALUE)&args, enc);
}
static VALUE
@@ -1784,11 +2225,9 @@ dir_globs(long argc, const VALUE *argv, int flags)
/*
* call-seq:
- * Dir[ array ] -> array
* Dir[ string [, string ...] ] -> array
*
* Equivalent to calling
- * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
* <code>Dir.glob([</code><i>string,...</i><code>],0)</code>.
*
*/
@@ -1892,8 +2331,9 @@ dir_s_glob(int argc, VALUE *argv, VALUE obj)
ary = rb_push_glob(str, flags);
}
else {
- volatile VALUE v = ary;
+ VALUE v = ary;
ary = dir_globs(RARRAY_LEN(v), RARRAY_CONST_PTR(v), flags);
+ RB_GC_GUARD(v);
}
if (rb_block_given_p()) {
@@ -2156,18 +2596,23 @@ dir_s_home(int argc, VALUE *argv, VALUE obj)
/*
* 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()
+rb_file_directory_p(void)
{
}
#endif
+/*
+ * call-seq:
+ * Dir.exists?(file_name) -> true or false
+ *
+ * Deprecated method. Don't use.
+ */
static VALUE
rb_dir_exists_p(VALUE obj, VALUE fname)
{
@@ -2199,6 +2644,7 @@ Init_Dir(void)
rb_define_singleton_method(rb_cDir, "entries", dir_entries, -1);
rb_define_method(rb_cDir,"initialize", dir_initialize, -1);
+ rb_define_method(rb_cDir,"fileno", dir_fileno, 0);
rb_define_method(rb_cDir,"path", dir_path, 0);
rb_define_method(rb_cDir,"to_path", dir_path, 0);
rb_define_method(rb_cDir,"inspect", dir_inspect, 0);
@@ -2261,5 +2707,18 @@ Init_Dir(void)
* Allows file globbing through "{a,b}" in File.fnmatch patterns.
*/
rb_file_const("FNM_EXTGLOB", INT2FIX(FNM_EXTGLOB));
+
+ /* Document-const: File::Constants::FNM_SYSCASE
+ *
+ * System default case insensitiveness, equals to FNM_CASEFOLD or
+ * 0.
+ */
rb_file_const("FNM_SYSCASE", INT2FIX(FNM_SYSCASE));
+
+ /* Document-const: File::Constants::FNM_SHORTNAME
+ *
+ * Makes patterns to match short names if existing. Valid only
+ * on Microsoft Windows.
+ */
+ rb_file_const("FNM_SHORTNAME", INT2FIX(FNM_SHORTNAME));
}
diff --git a/dln.c b/dln.c
index e6b20d54e3..0f918af090 100644
--- a/dln.c
+++ b/dln.c
@@ -47,6 +47,7 @@ void *xcalloc();
void *xrealloc();
#endif
+#undef free
#define free(x) xfree(x)
#include <stdio.h>
@@ -84,10 +85,6 @@ char *getenv();
# endif
#endif
-#if defined(__BEOS__) || defined(__HAIKU__)
-# include <image.h>
-#endif
-
#ifndef dln_loaderror
static void
dln_loaderror(const char *format, ...)
@@ -105,13 +102,12 @@ dln_loaderror(const char *format, ...)
# define USE_DLN_DLOPEN
#endif
-#ifndef FUNCNAME_PATTERN
-# if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
-# define FUNCNAME_PREFIX "_Init_"
-# else
-# define FUNCNAME_PREFIX "Init_"
-# endif
+#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(NeXT) || defined(MACOSX_DYLD)
+# define EXTERNAL_PREFIX "_"
+#else
+# define EXTERNAL_PREFIX ""
#endif
+#define FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"
#if defined __CYGWIN__ || defined DOSISH
#define isdirsep(x) ((x) == '/' || (x) == '\\')
@@ -1117,12 +1113,12 @@ dln_sym(const char *name)
#endif
#endif
-#if defined _WIN32 && !defined __CYGWIN__
+#ifdef _WIN32
#include <windows.h>
#include <imagehlp.h>
#endif
-#if defined _WIN32 && !defined __CYGWIN__
+#ifdef _WIN32
static const char *
dln_strerror(char *message, size_t size)
{
@@ -1178,25 +1174,26 @@ dln_strerror(void)
static void
aix_loaderror(const char *pathname)
{
- char *message[1024], errbuf[1024];
- int i;
-#define ERRBUF_APPEND(s) strncat(errbuf, (s), sizeof(errbuf)-strlen(errbuf)-1)
- snprintf(errbuf, sizeof(errbuf), "load failed - %s. ", pathname);
-
- if (loadquery(L_GETMESSAGES, &message[0], sizeof(message)) != -1) {
- ERRBUF_APPEND("Please issue below command for detailed reasons:\n\t");
- ERRBUF_APPEND("/usr/sbin/execerror ruby ");
- for (i=0; message[i]; i++) {
- ERRBUF_APPEND("\"");
- ERRBUF_APPEND(message[i]);
- ERRBUF_APPEND("\" ");
+ char *message[1024], errbuf[1024];
+ int i;
+#define ERRBUF_APPEND(s) strlcat(errbuf, (s), sizeof(errbuf))
+ snprintf(errbuf, sizeof(errbuf), "load failed - %s. ", pathname);
+
+ if (loadquery(L_GETMESSAGES, &message[0], sizeof(message)) != -1) {
+ ERRBUF_APPEND("Please issue below command for detailed reasons:\n\t");
+ ERRBUF_APPEND("/usr/sbin/execerror ruby ");
+ for (i=0; message[i]; i++) {
+ ERRBUF_APPEND("\"");
+ ERRBUF_APPEND(message[i]);
+ ERRBUF_APPEND("\" ");
+ }
+ ERRBUF_APPEND("\n");
}
- ERRBUF_APPEND("\n");
- } else {
- ERRBUF_APPEND(strerror(errno));
- ERRBUF_APPEND("[loadquery failed]");
- }
- dln_loaderror("%s", errbuf);
+ else {
+ ERRBUF_APPEND(strerror(errno));
+ ERRBUF_APPEND("[loadquery failed]");
+ }
+ dln_loaderror("%s", errbuf);
}
#endif
@@ -1253,22 +1250,27 @@ dln_load(const char *file)
#define DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))
#endif
-#if defined _WIN32 && !defined __CYGWIN__
+#if defined _WIN32
HINSTANCE handle;
- char winfile[MAXPATHLEN];
+ WCHAR *winfile;
char message[1024];
void (*init_fct)();
char *buf;
- if (strlen(file) >= MAXPATHLEN) dln_loaderror("filename too long");
-
/* Load the file as an object one */
init_funcname(&buf, file);
- strlcpy(winfile, file, sizeof(winfile));
+ /* Convert the file path to wide char */
+ winfile = rb_w32_mbstr_to_wstr(CP_UTF8, file, -1, NULL);
+ if (!winfile) {
+ dln_memerror();
+ }
/* Load file */
- if ((handle = LoadLibrary(winfile)) == NULL) {
+ handle = LoadLibraryW(winfile);
+ free(winfile);
+
+ if (!handle) {
error = dln_strerror();
goto failed;
}
@@ -1318,33 +1320,32 @@ 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;
}
+# if defined RUBY_EXPORT
+ {
+ static const char incompatible[] = "incompatible library version";
+ void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
+ if (ex && ex != ruby_xmalloc) {
+
+# if defined __APPLE__ && \
+ defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
+ (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11)
+ /* dlclose() segfaults */
+ rb_fatal("%s - %s", incompatible, file);
+# else
+ dlclose(handle);
+ error = incompatible;
+ goto failed;
+# endif
+ }
+ }
+# endif
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 */
- }
-#endif
if (init_fct == NULL) {
error = DLN_ERROR();
dlclose(handle);
@@ -1439,54 +1440,6 @@ dln_load(const char *file)
}
#endif
-#if defined(__BEOS__) || defined(__HAIKU__)
-# define DLN_DEFINED
- {
- status_t err_stat; /* BeOS error status code */
- image_id img_id; /* extension module unique id */
- void (*init_fct)(); /* initialize function for extension module */
-
- /* load extension module */
- img_id = load_add_on(file);
- if (img_id <= 0) {
- dln_loaderror("Failed to load add_on %.200s error_code=%x",
- file, img_id);
- }
-
- /* find symbol for module initialize function. */
- /* The Be Book KernelKit Images section described to use
- B_SYMBOL_TYPE_TEXT for symbol of function, not
- B_SYMBOL_TYPE_CODE. Why ? */
- /* strcat(init_fct_symname, "__Fv"); */ /* parameter nothing. */
- /* "__Fv" dont need! The Be Book Bug ? */
- err_stat = get_image_symbol(img_id, buf,
- B_SYMBOL_TYPE_TEXT, (void **)&init_fct);
-
- if (err_stat != B_NO_ERROR) {
- char real_name[MAXPATHLEN];
-
- strlcpy(real_name, buf, MAXPATHLEN);
- strlcat(real_name, "__Fv", MAXPATHLEN);
- err_stat = get_image_symbol(img_id, real_name,
- B_SYMBOL_TYPE_TEXT, (void **)&init_fct);
- }
-
- if ((B_BAD_IMAGE_ID == err_stat) || (B_BAD_INDEX == err_stat)) {
- unload_add_on(img_id);
- dln_loaderror("Failed to lookup Init function %.200s", file);
- }
- else if (B_NO_ERROR != err_stat) {
- char errmsg[] = "Internal of BeOS version. %.200s (symbol_name = %s)";
- unload_add_on(img_id);
- dln_loaderror(errmsg, strerror(err_stat), buf);
- }
-
- /* call module initialize function. */
- (*init_fct)();
- return (void*)img_id;
- }
-#endif /* __BEOS__ || __HAIKU__ */
-
#ifndef DLN_DEFINED
dln_notimplement();
#endif
diff --git a/dln_find.c b/dln_find.c
index f41ceb051d..b17b0d23e1 100644
--- a/dln_find.c
+++ b/dln_find.c
@@ -78,11 +78,12 @@ dln_find_exe_r(const char *fname, const char *path, char *buf, size_t size
}
if (!path) {
-#if defined(_WIN32)
- path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;.";
-#else
- path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:.";
-#endif
+ path =
+ "/usr/local/bin" PATH_SEP
+ "/usr/ucb" PATH_SEP
+ "/usr/bin" PATH_SEP
+ "/bin" PATH_SEP
+ ".";
}
buf = dln_find_1(fname, path, buf, size, 1 DLN_FIND_EXTRA_ARG);
if (envpath) free(envpath);
@@ -275,13 +276,15 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
}
goto next;
}
-#endif /* _WIN32 or __EMX__ */
+#endif
- if (stat(fbuf, &st) == 0) {
+#ifndef S_ISREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+ if (stat(fbuf, &st) == 0 && S_ISREG(st.st_mode)) {
if (exe_flag == 0) return fbuf;
/* looking for executable */
- if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
- return fbuf;
+ if (eaccess(fbuf, X_OK) == 0) return fbuf;
}
next:
/* if not, and no other alternatives, life is bleak */
diff --git a/dmyenc.c b/dmyenc.c
new file mode 100644
index 0000000000..7e006e826c
--- /dev/null
+++ b/dmyenc.c
@@ -0,0 +1,10 @@
+#define require(name) ruby_require_internal(name, (unsigned int)sizeof(name)-1)
+int ruby_require_internal(const char *, int);
+
+void
+Init_enc(void)
+{
+ if (require("enc/encdb.so") == 1) {
+ require("enc/trans/transdb.so");
+ }
+}
diff --git a/dmyext.c b/dmyext.c
index 34ea7a02f4..4d273f7faf 100644
--- a/dmyext.c
+++ b/dmyext.c
@@ -2,8 +2,3 @@ void
Init_ext(void)
{
}
-
-void
-Init_enc(void)
-{
-}
diff --git a/doc/ChangeLog-0.06_to_0.52 b/doc/ChangeLog-0.06_to_0.52
new file mode 100644
index 0000000000..63826081b3
--- /dev/null
+++ b/doc/ChangeLog-0.06_to_0.52
@@ -0,0 +1,1147 @@
+Fri Oct 14 13:22:18 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.52: ……ãªã‚“ã¦ã“ã£ãŸã„.
+
+ * eval.c(rb_call): returnã®å‡¦ç†ãŒé–“é•ã£ã¦ã„ãŸã®ã§, マシンã«ã‚ˆã£ã¦
+ ã¯returnã§é–¢æ•°ã‚’終了ã™ã‚‹ã ã‘ã§ãªãtoplevelã¾ã§ã¤ã抜ã‘ã¦ã„ãŸ.
+
+ * object.c: Builtinクラスを新設. 組ã¿è¾¼ã¿é–¢æ•°ã‚’Kernelã‹ã‚‰ç§»ã—ãŸ.
+ nilãŒçµ„ã¿è¾¼ã¿é–¢æ•°ã‚’ç†è§£ã™ã‚‹ã¨ãƒˆãƒ©ãƒ–ルã®å…ƒã§ã‚ã‚‹.
+
+ * dbm.c: Dictã¨åŒæ§˜ã«eachãŒ[key,value]ã‚’è¿”ã™ã‚ˆã†ã«.
+
+ * version 0.51
+
+Thu Oct 13 12:13:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(SETUP_ARGS): 付加演算å­ãŒé…列ã§ãªã„時ã«ã¯é…列ã«å¤‰æ›ã™ã‚‹.
+
+ * parse.y: 括弧ãªã—ã®ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã§ã‚‚`*'ã«ã‚ˆã‚‹ä»˜åŠ å¼•æ•°ãŒä½¿ãˆã‚‹
+ よã†ã«ã—ãŸ. ãŸã ã—, 通常引数ãŒä¸€ã¤ã‚‚ãªã„å ´åˆã¯ä¹—算演算å­ã¨åŒºåˆ¥ãŒ
+ ã¤ã‹ãªã„ã®ã§, å¿…ãšæ‹¬å¼§ãŒå¿…è¦.
+
+Wed Oct 12 10:09:07 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(rb_call): キャッシュã®è¨ˆç®—ã‚’inline化. キャッシュミスãŒã‚
+ れã°é–¢æ•°å‘¼ã³å‡ºã—ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚’検索ã™ã‚‹. methods.cã¯ãªããªã£ãŸ.
+
+ * eval.c(rb_eval): ローカル変数用ã®é ˜åŸŸã‚’alloca()ã™ã‚‹ã‚ˆã†ã«å¤‰æ›´.
+ サイズã®å¤‰æ›´ãŒå¿…è¦ã«ãªã‚Œã°æ”¹ã‚ã¦malloc()ã™ã‚‹ã‚ˆã†ã«.
+
+ * parse.y: error recoveryã®éš›ã«lex_stateã‚’æ›´æ–°ã—ã¦ãŠãよã†ã«.
+
+Tue Oct 11 17:10:46 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * socket.c(for_fd): ファイル記述å­(Fixnum)ã‹ã‚‰ã‚½ã‚±ãƒƒãƒˆã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹
+ を得るメソッド. ãŸã¨ãˆã°inetdã‹ã‚‰èµ·å‹•ã•れãŸã‚µãƒ¼ãƒã§æ¨™æº–入出力ã«
+ ソケットæ“作を行ãªã†ãŸã‚ã«ä½¿ã†. ã¤ã¾ã‚ŠSocket.for_fd($stdin)ã§æ¨™
+ 準入力ã«å¯¾å¿œã™ã‚‹ã‚½ã‚±ãƒƒãƒˆã‚ªãƒ–ジェクトãŒå¾—られる.
+
+ * io.c(to_i): IOクラスã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’æ•´æ•°ã«å¤‰æ›ã™ã‚‹ã¨ãã®ãƒ•ァイル
+ 記述å­ã‚’è¿”ã™ã‚ˆã†ã«.
+
+ * numeric.c(num2int): to_iメソッドを使ã£ã¦ã§ãã‚‹é™ã‚Šæ•´æ•°ã«å¤‰æ›ã™ã‚‹.
+ 以å‰ã¯num2fixã ã‘ãŒå…¨ã¦ã®ã‚ªãƒ–ジェクトã«å¯¾ã—ã¦to_iメソッドをé©ç”¨
+ ã—ã¦ã„ãŸ.
+
+ * sprintf.c(Fsprintf): 整数表示ã®éš›, オブジェクトをã§ãã‚‹é™ã‚Šæ•´æ•°
+ ã«å¤‰æ›ã™ã‚‹ã‚ˆã†ã«(to_iメソッドを使ã†).
+
+Fri Oct 7 14:06:32 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(Fcaller): å¿…è¦æ€§ãŒã‚ˆã分ã‹ã‚‰ãªã„ã®ã§ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‹ã‚‰å‰Šé™¤.
+ å°†æ¥ãƒ‡ãƒãƒƒã‚¬ã‚’作る時ã«å¾©æ´»ã•ã›ã‚ˆã†.
+
+ * eval.c(rb_call): Cã§è¨˜è¿°ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã§ã¯ç’°å¢ƒã‚’スタック
+ ã«ã‚»ãƒ¼ãƒ–ã—ãªã„ã“ã¨ã«ã‚ˆã£ã¦é«˜é€ŸåŒ–.
+
+Wed Oct 5 15:00:58 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby.h: 一時env.hã«ç§»å‹•ã—ã¦ãŸQselfã®å®šç¾©ã‚’復活. ãŸã ã—今回ã¯é–¢æ•°
+ ã¨ã—ã¦å®Ÿç¾(env.hã§ã¯å¤‰æ•°ã¨ã—ã¦å†å®šç¾©ã—ã¦ã‚ã‚‹).
+
+ * ruby.h: TRUEã§syntax errorã«ãªã‚‰ãªã„よã†#undefを追加.
+
+ * eval.c(rb_eval): threadåŒ–ã«æŒ‘戦ã—ãŸãŒ, 失敗(速ããªã‚‰ãªã‹ã£ãŸ).
+ ãŒ, Scopingãªã©ã®ç„¡é§„ãªã‚³ãƒ¼ãƒ‰ã®å‰Šé™¤ã¨ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã®å¼•数セッ
+ トã®inline化ã§è‹¥å¹²ã®é«˜é€ŸåŒ–を実ç¾ã—ãŸ. 副作用ã¨ã—ã¦, argc, argvå½¢
+ å¼ã®é–¢æ•°å‘¼ã³å‡ºã—ã®ä»•様ãŒå¤‰åŒ–ã—ãŸ(argvã«selfã‚’å«ã¾ãªããªã£ãŸ).
+
+ * eval.c(rb_call): メソッド呼ã³å‡ºã—ã®é«˜é€ŸåŒ–.
+
+Tue Oct 4 11:40:53 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby-mode.el: 修飾å­ã«å¯¾å¿œã—ãŸ.
+
+ * parse.y: 多é‡ä»£å…¥ã«restã‚’ã¤ã‘ãŸ. ã“ã®æ©Ÿèƒ½ã‚’使ãˆã°optional引数ã®
+ è§£æžãŒç°¡å˜ã«ã§ãã‚‹(ã¯ãš).
+
+ * pack.c(unpack): uuencodeå½¢å¼ã®decodeã®éš›ã«æ–‡å­—列ã®é•·ã•ãŒé–“é•ã£ã¦
+ ã„ãŸ.
+
+Mon Oct 3 15:58:41 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * file.c(type): ファイルタイプを文字列ã§è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰.
+
+Fri Sep 30 11:36:07 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * object.c: デフォルトã®çœŸã®å€¤ã§ã‚ã‚‹%TRUEã®å€¤ã‚’1(Fixnum)ã‹ã‚‰tã«å¤‰
+ æ›´ã—ãŸ. to_sã§æ–‡å­—列ã«å¤‰æ›ã—ãŸæ™‚ã«ã‚‚`t'ã¨è¡¨ç¤ºã•れる. æ›´ã«è¸ã¿è¾¼
+ ã‚“ã§`t'を予約語ã«ã—ã¦lispã®ã‚ˆã†ã«ã—よã†ã‹ã¨ã‚‚æ€ã£ãŸãŒ, ãã“ã¾ã§
+ ã¯æ±ºå¿ƒã§ããªã‹ã£ãŸ. 一文字ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã¯ã‹ãªã‚Šä½¿ã„ãã†ãªæ°—ãŒã™
+ ã‚‹ã®ã§â€¦.
+
+ * array.c,dict.c: equalã‚’å†å®šç¾©ã—ã¦ã„るクラスã§, hashã‚’æ­£ã—ã定義
+ ã—ãŸ.
+
+Wed Sep 28 23:30:28 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c(Ffail): 今ã¾ã§failã¯ã‚«ãƒ¼ãƒãƒ«ã‚¯ãƒ©ã‚¹ã®ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã£ãŸãŒ,
+ æ§‹æ–‡ã«çµ„ã¿è¾¼ã‚“ã . ã“ã®å¤‰æ›´ã«ã‚ˆã£ã¦, 1)`fail'ã¯äºˆç´„語ã¨ãªã‚Š, ロー
+ カル変数ã«ç”¨ã„ã‚‹ã“ã¨ãŒã§ããªããªã£ãŸ. 2)`fail'å˜ä½“ã§ä¾‹å¤–を発生ã™
+ るよã†ã«ãªã£ãŸ. 3)failã¯ãƒ¡ã‚½ãƒƒãƒ‰ã§ã¯ãªããªã£ãŸã®ã§å†å®šç¾©ã•れるå¯
+ 能性ãŒãªããªã£ãŸ.
+
+ * dic.c, dbm.c(indexes): Arrayã®indexesã¨åŒæ§˜ã®æ©Ÿèƒ½ã‚’æŒã¤ãƒ¡ã‚½ãƒƒãƒ‰
+ を追加.
+
+ * array.c(indexes): 引数をインデックスã¨ã™ã‚‹è¦ç´ ã®é…列を返ã™. æ•´æ•°
+ ã®é…列を引数ã¨ã™ã‚‹æ™‚ã«ã¯å¼•æ•°ã®è¦ç´ ã‚’インデックスã¨ã™ã‚‹è¦ç´ ã®é…列
+ ã‚’è¿”ã™.
+
+Mon Sep 19 13:42:31 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * array.c(aset): 部分é…列ã«å¯¾ã™ã‚‹ä»£å…¥ã§é…列以外ã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆãŒæŒ‡
+ 定ã•れãŸå ´åˆã«å¤šé‡ä»£å…¥ã¨åŒã˜ãƒ«ãƒ¼ãƒ«ã§é…列化ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * io.c(print): 引数ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸå„オブジェクトã«print_onメッセー
+ ジを与ãˆã‚‹ã‚ˆã†ã«. 実行速度ã¯è½ã¡ã‚‹ãŒæŸ”軟性ã¯å¢—ã™.
+
+Fri Sep 16 14:59:18 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * glob.c: ワイルドカードã®å°Žå…¥. bashã«ä½¿ã‚れã¦ã„ã‚‹GNUã®globルーãƒ
+ ンをæµç”¨ã—ãŸ.
+
+Mon Sep 12 18:36:58 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(value_expr): å¼ãŒnilã®æ™‚ã«å¯¾å¿œ.
+
+ * class.c: ICLASSã®classãŒå¿…ãšClass/Moduleを指ã™ã‚ˆã†ã«.
+
+Tue Sep 6 16:23:28 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * re.c: æ­£è¦è¡¨ç¾å†…ã§ã€Œ\æ•°å­—ã€å½¢å¼ãŒæŒ‡å®šã§ãるよã†ã«.
+
+ * parse.y:「do expr using var ... endã€å½¢å¼ã¯ãªããªã£ãŸ. 寂ã—ã„æ°—
+ ã‚‚ã™ã‚‹. *BACKWARD INCOMPATIBILITY*
+
+Mon Sep 5 10:59:01 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * numeric.c(next): Numericクラスã«ã‚‚nextã‚’æä¾›.
+
+ * string.c(upto): uptoã‚’æä¾›.
+
+ * range.c(each): nextを使ã£ãŸã‚¤ãƒ³ã‚¿ãƒ•ェースã‹ã‚‰uptoを使ã†ã‚ˆã†ã«å¤‰
+ æ›´ã—ãŸ. ã“ã®æ–¹ãŒä¸€ã¤ã®ãƒ¡ã‚½ãƒƒãƒ‰ã§å‡¦ç†ã‚’ã¾ã¨ã‚ã§è¡Œãªã†ã“ã¨ãŒã§ãã‚‹.
+
+Fri Sep 2 15:25:39 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * dict.c(each): 戻り値を[key, value]ã®ãƒšã‚¢ã«å¤‰æ›´. 今ã¾ã§ã®eachã¯
+ each_valueã¨ã—ã¦æ®‹ã‚‹. *BACKWARD INCOMPATIBILITY*
+
+Thu Sep 1 10:49:04 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * æˆåŠŸã—ãŸ(ç‰¹åˆ¥ãªæˆ»ã‚Šå€¤ã‚’æŒãŸãªã„)システムコールã¯`0'ã‚’è¿”ã™ã‚ˆã†ã«.
+
+Wed Aug 31 00:26:51 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * string.c: ãƒã‚§ãƒƒã‚¯ã‚µãƒ ã‚’得るメソッド`sum'を作ã£ãŸ.
+
+ * class.c(include_class_new): ICLASSã®classã‚’ã‚‚ã¨ã®ã‚¯ãƒ©ã‚¹ã«ã—ãŸ.
+ gcã®éš›ã«å…ƒã‚¯ãƒ©ã‚¹ã‚’マークã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã®ãŒ, フィールドを増やã™ä½™
+ 地ãŒç„¡ã„ã®ã§, classフィールドをæµç”¨ã—ãŸ. ç§ã®è¦‹ç©ã‚ŠãŒé–“é•ã£ã¦ã„
+ ã¦, ICLASSã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã«ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’é€ã‚‹äº‹ãŒã‚れã°, ãŠã‹ã—ãªå‹•
+ 作をã™ã‚‹ã ã‚ã†.
+
+ * eval.c(masign): å¼(a,b = nil)ã®å€¤ã‚’[nil]ã‹ã‚‰nilã«å¤‰æ›´ã—ãŸ.
+
+Mon Aug 29 11:56:09 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * class.c: rb_define_mfuncã‚’ç„¡ãã—ã¦, メタクラスã«ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’イン
+ クルードã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * error.c(yyerror): åŒã˜è¡Œã§è¤‡æ•°ã®syntax errorをリãƒãƒ¼ãƒˆã—ãªã„よã†
+ ã«ã—ãŸ.
+
+ * file.c: FileTestモジュールã«ãƒ•ァイルテストメソッドを分離ã—ãŸ.
+
+ * parse.y: 演算å­ã‚’指定ã™ã‚‹æ™‚ã®lex_stateã‚’æ­£ã—ã設定ã—ãŸ.
+
+Sat Aug 27 01:23:34 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y: if/whileãªã©ã®è¤‡åˆå¼ã‚’primaryã«ç§»å‹•ã—ãŸ. ã“れã«ã‚ˆã£ã¦ä¾‹
+ ãˆã°ã€Œif cond then a else b end.message()ã€ã®ã‚ˆã†ãªå¼ãŒæ›¸ã‘るよ
+ ã†ã«ãªã£ãŸ.
+
+Fri Aug 26 10:46:30 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * spec: æ•´ç†ã•ã‚ŒãŸæ–‡æ³•ã«ã—ãŸãŒã£ã¦æ›¸ãç›´ã—ãŸ.
+
+ * parse.y: ã“ã“æ•°æ—¥ã§æ··ä¹±ã—ã¦ã„ãŸæ–‡æ³•ã‚’æ•´ç†ã—ãŸ. 括弧をçœç•¥ã—ãŸãƒ¡
+ ソッド呼ã³å‡ºã—ãŒã§ãるよã†ã«ãªã£ãŸã“ã¨, modifierãŒä»˜ã‘られるよã†
+ ã«ãªã£ãŸã“ã¨, returnã«ãƒªã‚¹ãƒˆãŒæ¸¡ã›ã‚‹ã‚ˆã†ã«ãªã£ãŸã“ã¨ãŒä¸»ãªå¤‰æ›´ç‚¹
+ ã§ã‚ã‚‹.
+
+ * processå‘¨ã‚ŠãŒæ€ªã—ã„ãŒã¨ã«ã‹ãSolaris 2.3ã§å‹•ãよã†ã«.
+
+ * parse.y: 曖昧性ãŒãªã„å ´åˆã«ã¯ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã®å¼•æ•°ã®æ‹¬å¼§ã‚’çœç•¥
+ ã§ãるよã†ã«. çœç•¥ã§ãるメソッド呼ã³å‡ºã—ã®æ¡ä»¶ã¯, 1)ã‹ãªã‚‰ãš1個
+ 以上ã®å¼•æ•°ã‚’å¿…è¦ã¨ã™ã‚‹ã“ã¨, 2)第1引数ãŒ`+', `-', `(', `[', `{',
+ `/'ãªã©, å¼ã®å§‹ã¾ã‚Šã«ç½®ã‹ã‚ŒãŸæ™‚ã¨é€”中ã«ç¾ã‚ŒãŸæ™‚ã¨ã§è§£é‡ˆãŒé•ã†è¨˜
+ å·ã§å§‹ã¾ã‚‰ãªã„ã“ã¨, ã§ã‚ã‚‹.
+
+Thu Aug 25 13:54:58 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(cond): æ¡ä»¶å¼ã®å±•開部ã«bugãŒã‚ã£ãŸ.
+
+Wed Aug 24 00:01:15 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y: returnã¯ã‚³ãƒ³ãƒžã§åŒºåˆ‡ã£ãŸãƒªã‚¹ãƒˆã‚‚å—ã‘å–るよã†ã«. ã¤ã¾ã‚Š,
+ return a, b, cã¯return [a, b, c]ã¨åŒã˜æ„味ã«ãªã‚‹.
+
+ * parse.y: yield以外ã®å¤§åŸŸè„±å‡ºåˆ¶å¾¡å¼ã‚’exprã‹ã‚‰expr0ã«ç§»ã—ãŸ. よã£
+ ã¦ãƒ¡ã‚½ãƒƒãƒ‰ã®å¼•æ•°ã«åˆ¶å¾¡å¼ã‚’使ãˆãªããªã‚‹(ã“れã§å›°ã‚‹äººã¯ã„ãªã„ã¯ãš).
+
+ * parse.y: `+'ã®å®šæ•°å±•é–‹ã®éš›ã«æ¼”ç®—å­ã®å„ªå…ˆé †ä½ã‚’忘れã¦ã„ãŸ.
+
+ * eval.c: untilã®æˆ»ã‚Šå€¤ã¯nilã«ãªã£ãŸ.
+
+ * parse.y: modifierã¨ã—ã¦ã®if/unless/while/untilを追加.
+
+ * parse.y: 文法ã‹ã‚‰endã®å¾Œã‚ã«ã¤ã‘るキーワードを削除. ã»ã¨ã‚“ã©ä½¿ã‚
+ ãªã‹ã£ãŸä¸Šã«, emacsã§ã¯ruby-modeãŒã‚れã°å¯¾å¿œã®ãƒã‚§ãƒƒã‚¯ãŒæ©Ÿæ¢°çš„ã«
+ 出æ¥ã‚‹ãŸã‚.
+
+Tue Aug 23 18:08:33 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: スクリプト実行開始å‰ã«ä¾‹å¤–ãŒç™ºç”Ÿã—ãŸæ™‚ã«core dumpã—ãŸ.
+ 組ã¿è¾¼ã¿ç”¨ã«ã‚³ãƒ¼ãƒ‰ã‚’変更ã—ãŸæ™‚ã«enbugã—ã¦ã—ã¾ã£ãŸ.
+
+Tue Aug 23 00:07:17 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c: doã®æˆ»ã‚Šå€¤ãŒã„ã¤ã‚‚nilã«ãªã£ã¦ã„ãŸ.
+
+ * parse.y: loop制御変数ã®å¤šé‡ä»£å…¥åŒ–ã«bugãŒã‚ã£ãŸ.
+
+ * parse.y(expand_op): 文字列も畳ã¿è¾¼ã¿ã®å¯¾è±¡ã«.
+
+Mon Aug 22 10:50:01 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(expand_op): `+'ã«é–¢ã—ã¦ã¯çµåˆå‰‡ã‚’使ã£ã¦, より多ã定数畳
+ ã¿è¾¼ã¿ã‚’行ãªã†ã‚ˆã†ã«.
+
+ * ruby.c(proc_options): argcãŒ0ã®æ™‚ã«ã‚‚対応.
+
+ * parse.y: forãªã©ã®åˆ¶å¾¡å¤‰æ•°ã«å¤šé‡ä»£å…¥ã‚‚使ãˆã‚‹ã‚ˆã†ã«.
+
+Sat Aug 20 00:59:40 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y(call_op): 演算å­`~'ã®å–り扱ã„をルール部ã¸ç§»å‹•.
+
+Fri Aug 19 11:44:13 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * main.c: rubyã‚’ã»ã‹ã®ãƒ—ログラムã«çµ„ã¿è¾¼ã‚るよã†ã«main()を分割ã—ãŸ.
+ ãれã«ã¨ã‚‚ãªã„, プログラムã®å‘¼ã³å‡ºã—構造を修正ã—ãŸ.
+
+ * parse.y: æ¡ä»¶å¼ã®å®šç¾©ã‚’変更. ifãªã©ã®æ¡ä»¶å¼ã®ä¸­ã§ã ã‘`&&'ã‚„`||'
+ ãŠã‚ˆã³`!'ã®å¼•æ•°ãŒæ¡ä»¶å¼ã«ãªã‚‹ã‚ˆã†ã«. ã“ã®å¤‰æ›´ã«ã‚ˆã‚Šæ¡ä»¶å¼ä»¥å¤–ã®
+ 場所ã§ã® `&&', `||', `!'演算å­ã®å‹•作ãŒç›´è¦³ã«ä¸€è‡´ã™ã‚‹.
+
+ * parse.y: 実引数ã®`*'ã®å¾Œã«ç¶šã引数ã¯exprã«åˆ¶é™ã—ãŸ. 今ã¾ã§ã¯å…¨ã¦
+ ã®æ–‡ãŒæœ‰åйã§ã‚ã£ãŸãŒ, ã“ã“ã§å®šç¾©æ–‡ãŒã‚ã£ã¦ã‚‚ã—ょã†ãŒãªã„.
+
+Thu Aug 18 10:21:45 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * re.c: æ­£è¦è¡¨ç¾ãƒ«ãƒ¼ãƒãƒ³ã®åˆæœŸåŒ–部分を削除ã—ã¦ã—ã¾ã£ã¦ã„ãŸ. ã“れã§
+ ã¯emacsã®æ­£è¦è¡¨ç¾ã«ãªã£ã¦ã—ã¾ã†.
+
+ * version.c: copyright表示を追加.
+
+ * version.c: ãƒãƒ¼ã‚¸ãƒ§ãƒ³è¡¨ç¤ºã‚’stderrã«.
+
+ * configure.in: gccãŒãªã„å ´åˆtestã«å¤±æ•—ã—ã¦ã„ãŸ.
+
+Fri Aug 12 14:12:23 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * array.c(astore): é…åˆ—ã®æ‹¡å¤§ã™ã‚‹æ™‚ã«ã‚る程度ã®å¤§ãã•ã‚’ã¾ã¨ã‚ã¦æ‹¡
+ 大ã™ã‚‹ã‚ˆã†ã«.
+
+ * io.c(Fprint): é…列ã«å¯¾ã—ã¦ã¯ä¸€åº¦æ–‡å­—列ã«å¤‰æ›ã™ã‚‹ã“ã¨ãªã, 直接内
+ 容を出力ã™ã‚‹ã‚ˆã†ã«.
+
+ * string.c(str_new): memmoveã‹ã‚‰memcpyã¸ç½®ãæ›ãˆãŸ. ã“れã§ã‚‚ã‹ãªã‚Š
+ 速度ãŒé•ã†.
+
+ * ruby.h: データメンãƒã®å–り出ã—ã§åå‰ã‚’文字列ã‹ã‚‰IDã§æŒ‡å®šã™ã‚‹ã‚ˆã†
+ ã«ã—ãŸ. ã‹ãªã‚Šã®é«˜é€ŸåŒ–ã«ãªã‚‹.
+
+ * io.c: $ARGFã¨ã„ã†å¤‰æ•°ã§å¼•数列ã‹ã‚‰ãªã‚‹ä»®æƒ³ãƒ•ァイルをオブジェクト
+ ã¨ã—ã¦æ‰±ãˆã‚‹ã‚ˆã†ã«ã—ãŸ. 今ã¾ã§ã¯ãƒˆãƒƒãƒ—レベルã®gets()ãªã©ã‚’使ã£ã¦
+ アクセスã—ã¦ã„ãŸãŒ, ã©ã†ã‚‚オブジェクト指å‘çš„ã§ã¯ãªã‹ã£ãŸ.
+
+Thu Aug 11 11:43:15 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * gc.c: mark_location()ã®é–“é•ã£ãŸå‘¼ã³å‡ºã—æ–¹ã®è¡ŒãŒæ®‹ã£ã¦ã„ãŸ.
+
+ * method.c: プロトタイプ宣言ãŒè¶³ã‚Šãªã‹ã£ãŸ.
+
+Wed Aug 10 15:54:46 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * variable.c: -vã‚ªãƒ—ã‚·ãƒ§ãƒ³ãŒæŒ‡å®šã•れã¦ã„る時ã¯åˆæœŸåŒ–ã•れã¦ã„ãªã„,
+ 大域変数, インスタンス変数, ローカル変数をå‚ç…§ã—ãŸæ™‚点ã§warning
+ を出ã™ã‚ˆã†ã«ã—ãŸ.
+
+Tue Aug 9 11:50:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * bignum.c: 冪乗ã«é–¢ã—ã¦ã‚‚多å€é•·æ¼”算を行ãªã†ã‚ˆã†ã«. ç‰¹ã«æµ®å‹•å°æ•°ç‚¹
+ æ•°ã®ç¯„囲を越ãˆãŸæ™‚ã®å‡¦ç†ã‚’的確ã«è¡Œãªã†ã‚ˆã†ã«.
+
+ * eval.c: ãƒ¡ã‚½ãƒƒãƒ‰å®šç¾©å¾Œã¯æ§‹æ–‡æœ¨ã‹ã‚‰, メソッド定義部分を外ã™. ç„¡é§„
+ ãªå†å®šç¾©ãŒèµ·ã“らãªã„よã†ã«ã™ã‚‹ãŸã‚ã¨2é‡ã«free()ã•れãªã„ãŸã‚.
+
+ * array.c(Fary_aref): 引数ãŒ1ã¤ã§Fixnumã®æ™‚, Range checkを行ãªã‚ãª
+ ã„よã†ã«ä¿®æ­£.
+
+ * eval.c: メソッドã®å¼•æ•°ã®æ•°ã‚’コンパイル時ã«è¨ˆç®—ã—ã¦è‹¥å¹²ã®é«˜é€ŸåŒ–.
+
+Mon Aug 8 13:06:24 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * object.c: nilã«ã‚ˆã‚‹æ¯”較連鎖をãªãã—ãŸ.
+
+ * parse.y: bit演算å­ã®å„ªå…ˆé †ä½ã‚’比較演算å­ã‚ˆã‚Šã‚‚å¼·ãã—ãŸ. Cã¨ã¯ç•°
+ ãªã‚‹ã“ã¨ã«ãªã‚‹ãŒ, 直観ã«ã¯åˆè‡´ã™ã‚‹.
+
+ * gc.c: クラスを解放ã™ã‚‹æ™‚, 個々ã®ãƒ¡ã‚½ãƒƒãƒ‰æ¯Žã«ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã‚’クリアã™
+ ã‚‹ã®ã§ã¯ãªã, クラスå˜ä½ã§ã‚¯ãƒªã‚¢ã™ã‚‹ã‚ˆã†ã«.
+
+Thu Aug 4 18:45:09 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * methods.c(method_free): 解放ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã«é–¢ã—ã¦ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã‚’ク
+ リアã—ã¦ãŠãå¿…è¦ãŒã‚ã£ãŸ.
+
+ * gc.c: Dataクラスã®ãƒ‡ãƒ¼ã‚¿éƒ¨åˆ†ã‚’free()ã—忘れã¦ã„ãŸ.
+
+Wed Aug 3 09:58:14 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: def func .. endå½¢å¼ã«ã‚ˆã‚‹é–¢æ•°ãƒ¡ã‚½ãƒƒãƒ‰ã®å®šç¾©ã¯ãªããªã£ãŸ.
+
+ * methods.c: funcå½¢å¼ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’ãªãã—ãŸ. ã‚ã£ã¦ã‚‚, ã‚ã¾ã‚Šæ„味ãŒ
+ ãªã„ã®ã§.
+
+ * eval.c: $0ã¸ã®ä»£å…¥ã§ps(1)ã®å‡ºåŠ›ãŒå¤‰åŒ–ã™ã‚‹ã‚ˆã†ã«.
+
+ * io.c(Fsyscall): syscall()を実ç¾.
+
+Mon Aug 1 13:41:11 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: ダブルクォートã§å›²ã¾ã‚ŒãŸæ–‡å­—列や正è¦è¡¨ç¾ä¸­ã§"#{変数å}"
+ ã¾ãŸã¯"#変数å"ã¨ã„ã†å½¢å¼ã§å¤‰æ•°ã®å†…容を埋ã‚込むã“ã¨ãŒã§ãるよã†
+ ã«ãªã£ãŸ.
+
+ * io.c: 関数メソッドsystem2()ã¯ãªããªã£ãŸ. 今ã¯ãƒãƒƒã‚¯ã‚¯ã‚©ãƒ¼ãƒˆãŒã‚
+ ã‚‹ã‹ã‚‰ã­.
+
+ * parse.y: `cmd`ã«ã‚ˆã£ã¦ã‚³ãƒžãƒ³ãƒ‰ã‚’文字列ã«å±•é–‹ã™ã‚‹ã“ã¨ãŒã§ãるよã†
+ ã«ãªã£ãŸ.
+
+ * parse.y: __FILE__, __LINE__を追加. ãれãžã‚Œãƒ•ァイルå(文字列),
+ 行番å·(æ•´æ•°)を値ã¨ã™ã‚‹ç–‘似変数.
+
+Fri Jul 29 13:16:07 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * methods.h: メソッドをオブジェクトã¨ã—ã¦æ‰±ã†ã®ã‚’ã‚„ã‚ã‚‹. メソッド
+ ã®ãƒ¡ãƒ¢ãƒªç®¡ç†ã«ã¯ãƒªãƒ•ァレンスカウントを使ã†ã“ã¨ã«ã—ãŸ. ã“れã§ã‚ªãƒ–
+ ã‚¸ã‚§ã‚¯ãƒˆã®æ•°ãŒæ¸›ã£ã¦ã»ã‚“ã®å°‘ã—ã ã‘GCãŒé€Ÿããªã‚‹(ã‹ãª).
+
+ * purifyã«ã‚ˆã£ã¦ãƒ¡ãƒ¢ãƒªé–¢ä¿‚ã®ãƒã‚°ã‚’検査ã—ãŸ(見ã¤ã‹ã‚‹,見ã¤ã‹ã‚‹â€¦).
+
+ * gc.c: GCをプログラマãŒå¤‰æ•°ã‚’マークã™ã‚‹å½¢å¼ã‹ã‚‰, スタックã¨ãƒ¬ã‚¸ã‚¹
+ ã‚¿ã‹ã‚‰ãƒžãƒ¼ã‚¯ã™ã‚‹æ–¹æ³•ã«å¤‰æ›´. ç§»æ¤æ€§ãŒä¸‹ãŒã‚‹ã‚ˆã†ãªæ°—ã‚‚ã™ã‚‹ãŒ, siod
+ ã‚„scmã§ã‚‚採用ã•れã¦ã„ã‚‹ã‹ã‚‰å¤šåˆ†å¤§ä¸ˆå¤«ã ã‚ã†. Linux on i486ã§ã‚‚å‹•
+ 作を確èªã—ãŸ.
+
+Wed Jul 27 16:13:13 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(Eval): トップレベルã§ã¯æ§‹é€ æœ¨ã‚’freeã—ãªã„よã†ã«. ã©ã†ã›è§£
+ 放ã•れるã‹ã‚‰æ™‚é–“ã®ç„¡é§„ã§ã‚ã‚‹.
+
+ * array.c, dict.c: "=="を構造一致ã«å¤‰æ›´.
+
+Fri Jul 22 10:14:09 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * error.c: 組ã¿è¾¼ã¿ã‚¿ã‚¤ãƒ—ã®åå‰ã‚’登録ã—忘れã¦ã„ãŸ.
+
+Thu Jul 21 14:06:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(freenode),eval.c(Eval): è§£æžæœ¨ã‚’解放ã—忘れã¦ã„ãŸ.
+
+Mon Jul 18 10:19:15 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: 多é‡ä»£å…¥ã‚’処ç†ã™ã‚‹ãƒ«ãƒ¼ãƒ«ã«ãƒã‚°ãŒã‚ã£ã¦, 3è¦ç´ ä»¥ä¸Šã®å¤šé‡
+ 代入ã«å¤±æ•—ã—ã¦ã„ãŸ.
+
+ * eval.c(rb_eval): 多é‡ä»£å…¥ã§, å³è¾ºãŒé…列ã§ãªã„時ã«ã¯`to_a'メソッ
+ ドã§é…列ã«å¤‰æ›ã—ã¦ä»£å…¥ã™ã‚‹ã‚ˆã†ã«ã—ãŸ. 今ã¾ã§ã®ä»•様ã ã¨å³è¾ºå€¤ãŒç¬¬
+ 1è¦ç´ ã«ãã®ã¾ã¾ä»£å…¥ã•れã¦ã„ãŸãŒ, structãªã©é…列ã«å¤‰æ›ã§ãã‚‹ã‚‚ã®
+ ã¯å¤‰æ›ã—ãŸæ–¹ãŒå¬‰ã—ã„æ°—ãŒã™ã‚‹.
+
+ * dbm.c,dict.c(delete_if): メソッド追加.
+
+ * process.c(wait,waitpid): システムコールwaitpidã¾ãŸã¯wait4ãŒã‚ã‚‹
+ 時ã¯ãã¡ã‚‰ã‚’使ã†ã‚ˆã†ã«. configureã‚‚ãれらをãƒã‚§ãƒƒã‚¯ã™ã‚‹ã‚ˆã†ã«å¤‰æ›´.
+
+ * dbm.c, dict.c(clear): メソッド追加.
+
+Fri Jul 15 10:54:45 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * array.c(Fary_fill,Fary_clear): メソッドを追加.
+
+ * string.c(Fstr_split): $;ã®å€¤ãŒé•·ã•1ã®æ–‡å­—列ã§ã‚る時, ã“れを正è¦
+ 表ç¾åŒ–ã—ãªã„ã§, å˜ãªã‚‹æ–‡å­—ã¨ã—ã¦åˆ†å‰²ã™ã‚‹.
+
+ * string.c(Fstr_aset/Fstr_aref): ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ãŒæ–‡å­—列ã®ç¯„囲外ã ã£
+ ãŸæ™‚ã®å‹•作をArrayã‚’å‚考ã«ä¿®æ­£ã—ãŸ.
+
+ * array.c(astore,Fary_aset): 領域をreallocã—ãŸå¾Œ, ゼロã§ã‚¯ãƒªã‚¢ã™ã‚‹
+ よã†ã«. 今ã¾ã§é…列ã«ã‚´ãƒŸãŒå…¥ã£ã¦ã„ãŸ.
+
+ * array.c: []/[]=ã§ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹é–¢ä¿‚ã‚’æ•´ç†. 基本的ã«è² ã®ã‚¤ãƒ³ãƒ‡ãƒƒ
+ クスã«ä»£å…¥ã—ãªã„é™ã‚Šä¾‹å¤–ã¯èµ·ããªã„よã†ã«å¤‰æ›´ã—ãŸ. å¿…è¦ã«å¿œã˜ã¦é©
+ 当ã«è§£é‡ˆã—ã¦, å¿…è¦ãªã‚‰ã°é ˜åŸŸã‚’æ‹¡å¼µã™ã‚‹ã‚ˆã†ã«.
+
+Thu Jul 14 11:18:07 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * autoexec.c: 削除. autoloadé–¢ä¿‚ã®æ©Ÿèƒ½ã¯ä»Šå¾Œæ¤œè¨Žã—よã†.
+
+ * dict.c: è¾žæ›¸ã‚¯ãƒ©ã‚¹ã®æ­£å¼åç§°ã‚’Dictã«å¤‰æ›´ã—ãŸ. 別åã¨ã—ã¦Hashを用
+ æ„ã—ãŸ. 今ã¾ã§Dictionaryãªã©ã¨é•·ã„åå‰ã«ã—ã¦ã„ãŸãŒèª°ã‚‚使ã£ã¦ã„ãª
+ ã‹ã£ãŸã—ã­. *BACKWARD INCOMPATIBILITY*
+
+ * parse.y: Dictを生æˆã™ã‚‹æ§‹æ–‡ã‚’追加. ã“ã¡ã‚‰ã‚’{..}ã«ã—ãŸ.
+
+ * parse.y: é…列を生æˆã™ã‚‹æ§‹æ–‡ã‚’[..]ã«å¤‰æ›´ã—ãŸ. éŽåŽ»ã®Rubyスクリプ
+ トã¨ã®äº’æ›æ€§ãŒä¿ã¦ãªã„ãŒ, Dictを生æˆã™ã‚‹æ§‹æ–‡ã‚’å°Žå…¥ã™ã‚‹ã«å½“ãŸã‚Š,
+ perl5ã«åˆã‚ã›ã¦(æ„è­˜ã—ã¦), 変更ã™ã‚‹æ™‚期ã¯ä»Šã—ã‹ãªã„ã¨è€ƒãˆãŸ.
+ *BACKWARD INCOMPATIBILITY*
+
+ * eval.c(Feval): eval()ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚’定義ã™ã‚‹æ™‚, 定義ã•れるクラスを
+ ãƒ¡ã‚½ãƒƒãƒ‰ã®æ‰€å±žã™ã‚‹ã‚¯ãƒ©ã‚¹ã«ã—ãŸ. 今ã¾ã§ã¯Objectクラスã«å®šç¾©ã•れã¦
+ ã„ãŸ.
+
+ * parse.y: ローカル引数ãŒãªã„時ã®eval()ã§è½ã¡ã¦ã„ãŸ.
+
+Tue Jul 12 09:41:28 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * pack.c: uuencodeå½¢å¼ã®ã‚µãƒãƒ¼ãƒˆ.
+
+ * `-0'ã‚’`-R'ã«. 出力レコードセパレータをコマンドラインã‹ã‚‰æŒ‡å®šã™ã‚‹
+ 方法ã¯ãªããªã£ãŸ. ã©ã†ã‚‚, 仕様ãŒã‚†ã‚Œã‚‹ãªã‚.
+
+Mon Jul 11 09:51:24 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby.c: `-r'オプションã¯`-0'オプションã«ãªã£ãŸ. 当é¢ã¯`-r'も有効
+ ã ãŒå¤‰æ›´ã•れるå¯èƒ½æ€§ãŒã‚ã‚‹. `-R'ã¯å½“é¢ã¯ãã®ã¾ã¾.
+
+ * version.c: versionè¡¨ç¤ºã«æ—¥ä»˜ã‚’å«ã‚ãŸ.
+
+ * parse.y: private methodã®å¾©æ´». Rubyã®privateメソッドã¯C++ã«ãŠã‘
+ ã‚‹protected methodã«è©²å½“ã™ã‚‹ã‚‚ã®ã§, `@'ã§å§‹ã¾ã‚‹åå‰ã‚’æŒã¤.
+
+ * env.h: struct ENVIRONã®å®šç¾©ã‚’分離.
+
+ * parse.y: `\$var', `\@var', `%var'も許ã™ã‚ˆã†ã«.
+
+ * variable.c(Fdefined): idも引数ã¨ã—ã¦å—ã‘付ã‘るよã†ã«.
+
+ * parse.y: ifæ–‡/unlessæ–‡ã«ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰thenを追加. thenãªã—ã¨ã„ã†ã®ã¯,
+ æ„外ã¨é–“é•ã„ãŒå¤šã„ã®ã§. ã‚‚ã¡ã‚ã‚“çœç•¥ã§ãã‚‹.
+
+Sat Jul 9 02:16:04 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c(rb_eval): class/moduleã®è©•ä¾¡ã§æ–°ã—ã„スコープを割り当ã¦ã¦
+ ã„ãªã‹ã£ãŸ. スコープ割り当ã¦éƒ¨åˆ†ã‚’rb_call()ã‹ã‚‰rb_eval()ã«ç§»ã—ãŸ.
+
+ * eval.c(rb_call): realloc()ã«æ¸¡ã•れる事ã®ã‚ã‚‹, ローカル変数用ã®é ˜
+ 域をalloca()ã—ã¦ã„ãŸ. ãŸã¾ã«è½ã¡ã‚‹ã‚ã‘ã .
+
+ * string.c(Fstr_times): 割り当ã¦ãŸé ˜åŸŸã‚’è¶ŠãˆãŸéƒ¨åˆ†ã‚’変更ã—ã¦ã„ãŸ.
+
+Wed Jul 6 15:52:42 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * socket.c: Socket -> BasicSocket, RawSocket -> Socket ã«æ”¹å.
+
+ * string.c(ucfirst,lcfirst): 最åˆã®1文字ã ã‘ã®å¤§æ–‡å­—/å°æ–‡å­—変æ›.
+
+ * numeric.c(chr): æ•´æ•°ã®æ–‡å­—列化メソッド.
+
+ * inits.c, dbm.c: DBMãŒä½¿ãˆãªã„時ã¯ã‚¯ãƒ©ã‚¹ãã®ã‚‚ã®ã‚’定義ã—ãªã„よã†
+ ã«ã—ãŸ. 利用ã§ããªã„クラスã¯nilã¨ã™ã‚‹ã“ã¨ã‚’今後ã®ãƒãƒªã‚·ãƒ¼ã¨ã—よ
+ ã†(ã„ã¾ã¾ã§ã¯ã‚¢ã‚¯ã‚»ã‚¹ã—ãŸæ™‚点ã§ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¦ã„ãŸ). autoexec()
+ ã®ã‚り方も検討ãŒå¿…è¦ã«ãªã‚Šãã†ã .
+
+ * bignum.c(bigadd): ãƒã‚°ä¿®æ­£.
+
+Thu Jul 7 11:12:18 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(Fload,Feval): eval_treeをクリアã—忘れã¦ã„ãŸ.
+
+ * _inspect: オブジェクトをå¯èª­å½¢å¼ã®æ–‡å­—列ã«å¤‰æ›ã™ã‚‹(主ã«ãƒ‡ãƒãƒƒã‚°
+ 出力用).
+
+Wed Jul 6 00:57:18 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * numeric.c, bignum.c: æ•´æ•°ã«å¯¾ã™ã‚‹`[]'演算å­. nビット目ãŒã‚»ãƒƒãƒˆã•
+ れã¦ã„ã‚‹ã‹ã©ã†ã‹ã‚’è¿”ã™.
+
+Tue Jul 5 12:48:39 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * io.c(Feof): 追加. コマンドラインã‹ã‚‰ãªã‚‹ä»®æƒ³ãƒ•ァイルã«ã¤ã„ã¦ã‚‚
+ EOFãŒæ¤œå‡ºã§ãるよã†ã«.
+
+ * ruby.c: -l/-r/-R/-Xオプションã®è¿½åŠ .
+
+ * ruby.c: -n/-pオプションã®loopã®ä»˜åŠ ãªã©ã‚’メインルーãƒãƒ³ã«ç§»å‹•ã—
+ ãŸ. ã“れã§, オプションã®è§£æžé€”中ã§(`-c'オプションã®ã›ã„ã§)終了ãª
+ ã©ã¨ã„ã£ãŸã“ã¨ã¯ãªã„.
+
+ * io.c(Fgets): 高速化. å‡ã£ãŸã“ã¨ã‚’ã—ãªã„æ–¹ãŒé€Ÿã‹ã£ãŸ. 虚ã—ã„.
+
+Mon Jul 4 15:55:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * Socket:getsockname/getpeername - よã†ã‚„ã仕様ãŒå®‰å®šã—ãŸ.
+
+ * io.c(Fgets): eachã§getsを記述ã™ã‚‹ã®ã§ã¯ãªã, getsã§eachを記述ã™
+ るよã†ã«ã—ãŸ.
+
+Fri Jul 1 10:35:49 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * $ENV[env] = nil/$ENV.delete(env)ã§ç’°å¢ƒå¤‰æ•°ã‚’削除ã§ãるよã†ã«ãªã£
+ ãŸ. $ENV.deleteã¯ç’°å¢ƒå¤‰æ•°ã®ä»¥å‰ã®å€¤ã‚’è¿”ã™.
+
+ * !~ã®å®šç¾©ãŒé–“é•ã£ã¦ã„ãŸ.
+
+ * Dict,DBM:[]= - nilã®ä»£å…¥ã«ã‚ˆã£ã¦è¦ç´ ã‚’削除ã§ãるよã†ã«ãªã£ãŸ. ã“
+ れã«ã¨ã‚‚ãªã„nilã¯Dictã®è¦ç´ ã«ãªã‚Œãªããªã£ãŸ.
+
+ * ã‚½ãƒ¼ã‚¹ã®æ•´ç†. 盲腸ã®ã‚ˆã†ãªä½¿ã‚れã¦ã„ãªã„コードをãªãã—ãŸã‚Š, 変数
+ åを付ã‘変ãˆãŸã‚Šã—ãŸ.
+
+Fri Jul 1 00:21:29 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * Array:join() - è¦ç´ æ•°0ã®é…列ã«å¯¾ã—ã¦ç©ºæ–‡å­—列を返ã™.
+
+ * RawSocket:open(),socketpair() - æ–‡å­—åˆ—ã§æŒ‡å®šã§ãるドメインã¨ã‚¿ã‚¤
+ プをã„ãã¤ã‹è¿½åŠ ã—ãŸ.
+
+Thu Jun 30 13:51:29 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * -fオプションをãªãã—ãŸ. 昔(loadã®ãªã‹ã£ãŸé ƒ)ã®å残ãªã®ã§, 今ã¨ãªã£
+ ã¦ã¯å¿…è¦ãªã„ã ã‚ã†.
+
+ * -sオプションを追加. perlã®-sオプションã¨åŒã˜å‹•ãã‚’ã™ã‚‹.
+
+ * RawSocketクラスをæä¾›ã™ã‚‹. Socketã«å¯¾ã™ã‚‹ã‚·ã‚¹ãƒ†ãƒ ã‚³ãƒ¼ãƒ«ãƒ¬ãƒ™ãƒ«ã®
+ アクセスãŒå¯èƒ½ã«ãªã£ãŸ.
+
+Thu Jun 30 00:27:19 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * Socket - bug fixes.
+
+ * linuxã§ã¯syscall(SYS_select)ãŒæ­£å¸¸ã«å‹•作ã—ãªã„.
+
+ * Socket:addr,peeraddr - é…列ã¨ã—ã¦sockaddrã®æƒ…報を返ã™.
+
+Wed Jun 29 00:14:20 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * Socket:setopt,getopt - setsockopt(2), getsockopt(2)ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹
+ を実ç¾.
+
+ * sprintf() - rubyã«ã¯unsignedã¯ç„¡ã„ã®ã§, %uã‚’å–り除ã„ãŸ.
+
+ * sprintf() - %b, %x, %oã§ã¯2ã®è£œæ•°è¡¨ç¾, %B, %X, %Oã§ã¯ç¬¦å·ä»˜ã表
+ ç¾ã§å‡ºåŠ›ã™ã‚‹ã‚ˆã†ã«. ã“ã“æ•°æ—¥ã§sprintf()ã®ä»•様ãŒã‚†ã‚‰ã„ã§ã„ãŸãŒ,
+ ã“れã§è½ã¡ç€ããã†ã .
+
+Tue Jun 28 14:42:03 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * Bignum:<<,>> - 2ã®è£œæ•°ã‚’ã¨ã‚‹å‡¦ç†ã‚’除ã„ãŸ. シフト演算ã«ã¯é–¢ä¿‚ãªã„
+ 処ç†ã ã£ãŸ.
+
+ * Bignum:^ - bug fix. 符åˆãŒå対ã ã£ãŸ.
+
+ * sprintf() - 2進出力å­"%b"を追加.
+
+ * sprintf() - %x, %oã§Fixnumを出力ã™ã‚‹æ™‚, 2ã®è£œæ•°è¡¨ç¤ºã‚’行ãªã‚ãªã„.
+
+ * sprintf() - %x, %oã¯ã‚„ã¯ã‚Šè² ã®æ•°ã®æ™‚ã¯`-'を出力ã™ã‚‹ã‚ˆã†ã«.
+
+Mon Jun 27 14:56:13 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * sprintf() - Bignumã«ã¤ã„ã¦ã‚‚%d, %oã¯(2ã®è£œæ•°è¡¨ç¾ã«å¤‰æ›ã—ã¦)æ­£ã®
+ 整数を表示ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * Bignumã«å¯¾ã™ã‚‹è«–ç†æ¼”ç®—ã®å®šç¾©ã‚’修正ã—ãŸ. è² ã®æ•°ã¯2ã®è£œæ•°è¡¨ç¾ã§ã‚
+ ã‚‹ã¨ã¿ãªã—, ã‹ã¤ä»®æƒ³çš„ã«å·¦å´ã«ç„¡é™ã«1ãŒé€£ç¶šã—ã¦ã„るよã†ãªæ¼”ç®—çµ
+ 果を得る.
+
+ * Fixnum:<<,>> - 符åˆä»˜ã‚·ãƒ•トã«å¤‰æ›´.
+
+ * Bignum:>> - è² ã®æ•´æ•°ã®ã‚·ãƒ•トã«å¯¾å¿œã—ãŸ.
+
+ * __END__, ^D, ^Zã§ã‚¹ã‚¯ãƒªãƒ—トを終了ã§ãã‚‹.
+
+ * -xオプションを追加. #! ..rubyãªã‚‹è¡Œã¾ã§èª­ã¿é£›ã°ã™.
+
+ * -cオプションを追加. コンパイルã®ã¿ã‚’行ã†.
+
+Sat Jun 25 01:37:21 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * Fixnum:<< - å¿…è¦ã«å¿œã˜ã¦Bignumã«æ‹¡å¼µã—ã¦å·¦ã‚·ãƒ•トã™ã‚‹ã‚ˆã†ã«. よã£
+ ã¦, シフト幅ãŒ32ã‚’è¶Šãˆã‚‹ã¨Cã‚„Perlã¨ã¯é•ã£ãŸå€¤ã‚’è¿”ã™.
+
+Fri Jun 24 10:01:28 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ioctl()/fcntl() - システムコールを呼ã³å‡ºã™å‰ã«ãƒãƒƒãƒ•ã‚¡ã®å¤§ãã•ã‚’
+ 調節ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * String:toupper/tolower - æ–‡å­—åˆ—ã‚’ç½®ãæ›ãˆãŸã‚³ãƒ”ーを作るã®ã§ã¯ãª
+ ã, å…ƒã®æ–‡å­—列ã®å†…容を変更ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * inplace editを実ç¾ã—ãŸ. perlã¨åŒã˜ã‚ˆã†ã«`-i'ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã§æŒ‡å®šã™ã‚‹.
+ ã‚‚ã£ã¨ã‚‚, ã“ã¡ã‚‰ã¯MS-DOSã®ã“ã¨ã¨ã‹è€ƒãˆã¦ãªã„ã‘ã©.
+
+ * デフォルトã®å‡ºåŠ›å…ˆã‚’è¿½åŠ ã—ãŸ. 今ã¾ã§ã¯$stdoutã«ä»£å…¥ã™ã‚‹ã—ã‹æ–¹æ³•
+ ã¯ãªã‹ã£ãŸ.
+
+Fri Jun 17 10:55:08 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * 環境変数ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹æ–¹æ³•ã¨ã—ã¦getenv()/setenv()以外ã«$ENVを用
+ æ„ã—ãŸ. $ENVã¯æ–‡å­—列-文字列ã®è¾žæ›¸ã§ã‚ã‚‹ã‹ã®ã‚ˆã†ã«å‹•作ã™ã‚‹EnvDict
+ オブジェクトãŒä»£å…¥ã•れã¦ã„ã‚‹(eachã¯assocを与ãˆã‚‹).
+
+ * nilã«ä»£å…¥ã™ã‚‹ã¨core dumpã—ãŸ. コンパイル時ã®ãƒã‚§ãƒƒã‚¯ã‚’強化.
+
+ * Struct: struct_new()ã®å¼•æ•°ã‚’GCプロテクトã™ã‚‹å¿…è¦ãŒã‚ã‚‹. ã›ã‚ã¦ã‚¹
+ タック領域ã ã‘ã§ã‚‚スキャンã§ãるよã†ã«ã—ãªã‘れã°ã„ã‘ãªã„ã‚“ã ã‚ã†
+ ã‹? ã§ã‚‚, ç§»æ¤æ€§ãŒãªã‚.
+
+Fri Jun 17 01:01:46 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * Time::asctime() - 日付ã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã§æ—¥ãŒè½ã¡ã¦ã„ãŸ.
+
+ * Stat: Statã¯Etcãªã©ã¨åŒæ§˜ã«Structã§å®Ÿç¾ã—ãŸã®ã§, Statクラスã¯ç„¡
+ ããªã£ãŸ.
+
+Thu Jun 16 10:32:23 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * bignum.c: ã„ãã¤ã‹ã®ãƒã‚°ã‚’修正ã—ãŸ. Fixnumを渡ã™ã¹ãã¨ã“ã‚ã§æ™®é€š
+ ã®intを渡ã—ã¦ã„ãŸ. 失敗.
+
+ * big2str() - 1æ¡ãšã¤baseã§å‰²ã‚‹ä»£ã‚りã«, 4æ¡ãšã¤å‰²ç®—を行ãªã†ã‚ˆã†ã«
+ ã—ãŸ. ã“れã§å¤šå€é•·å‰²ç®—ã®å›žæ•°ãŒ1/4ã«ãªã‚‹. ã•ã‚‰ã«æ•´æ•°->æ•°(文字)ã¸
+ ã®å¤‰æ›ã‚’テーブルを用ã„るよã†ã«ã—ãŸ.
+
+ * rb_ivar_get_1() - ã™ã§ã«ä½•らã‹ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’æŒã¤ã‚ªãƒ–ジェク
+ トã§ã¯, 未定義ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã®å€¤ãŒä¸å®šå€¤ã«ãªã£ã¦ã„ãŸ.
+
+ * yylex() - インスタンス変数ã®èªè­˜ã«å¤±æ•—ã—ã¦ã„ãŸ. attr()ã¯æ­£ã—ãå‹•
+ 作ã—ã¦ã„ãŸã®ã§, 混用ã™ã‚‹ã¨å‹•作ã—ãªã‹ã£ãŸ. 全部é•ã£ã¦ã„ãŸã‹ã‚‰å‹•ã„
+ ã¦ã„ãŸã®ã­.
+
+ * Object:attr() - ã™ã§ã«ã‚¢ã‚¯ã‚»ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ãŒå®šç¾©ã•れã¦ã„る時ã«ã¯ãƒ‡ãƒ•ã‚©
+ ルトã®ã‚¢ã‚¯ã‚»ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã‚’定義ã—ãªã„よã†ã«ã—ãŸ. ã‚‚ã£ã¨ã‚‚アクセスメ
+ ソッドã¨åŒåã®ãƒ¡ã‚½ãƒƒãƒ‰ã®åŒºåˆ¥ã¯Rubyã«ã¯å­˜åœ¨ã—ãªã„ã‘ã©, ãれã¯ä»•æ–¹
+ ãŒãªã„よã­.
+
+ * pack.c: エンディアンをautoconfã§åˆ¤å®šã™ã‚‹ã‚ˆã†ã«ã—ãŸã®ã§, v/VãŒä½¿
+ ãˆã‚‹ã‚ˆã†ã«ãªã£ãŸ. ã¾ãŸntoh?()/hton?()も自å‰ã§ç”¨æ„ã—ãŸ.
+
+ * Stat: st_rdevをアクセスã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ã‚’追加. ã•らã«ã‚·ã‚¹ãƒ†ãƒ ãŒstat
+ 構造体ã«st_blksize, st_blockã‚’æŒã£ã¦ã„ã‚‹ã‹ã‚’autoconfã§ãƒã‚§ãƒƒã‚¯ã™
+ るよã†ã«ã—ãŸ.
+
+ * ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å°‘ã—æ•´å‚™ã—ãŸ.
+
+ * INT2FIX()ã®ã†ã¡, 31bitå¹…ãŒä¿è¨¼ã§ããªã„ã‚‚ã®ã¯, int2inum()ã«ç½®ãæ›
+ ãˆãŸ.
+
+Wed Jun 15 10:18:27 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * sprintf() - bignumã®å‡ºåŠ›ã®æ™‚, 出力幅を正ã—ã計算ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * str2inum() - baseãŒ0ã®æ™‚, baseを自動判定ã™ã‚‹ã‚ˆã†ã«(0xã§å§‹ã¾ã‚‹æ™‚
+ 16 進, 0ã§å§‹ã¾ã‚‹æ™‚8進).
+
+Tue Jun 14 16:08:42 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * gc.c: Bignum型を追加ã™ã‚‹ã®ã‚’忘れã¦ã„ãŸ. 組ã¿è¾¼ã¿åž‹ã‚’追加ã—ãŸæ™‚ã«
+ ã¯å¿…ãšmark()ã¨sweep()ã«ãã®åž‹ã«é–¢ã™ã‚‹å‡¦ç†ã‚’追加ã™ã‚‹å¿…è¦ãŒã‚ã‚‹.
+
+ * bignum: 割算も動ã„ãŸã‚ˆã†ãªæ°—ãŒã™ã‚‹. アルゴリズムをç†è§£ã—ã¦ã„ãªã„
+ ã®ã§, 自信ãŒãªã„.
+
+Mon Jun 13 14:36:55 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ã¾ã ã‚µãƒãƒ¼ãƒˆã—ã¦ã„ãªã„メソッドãªã©ãŒã‚ã‚‹ãŒ, 曲ãŒã‚Šãªã‚Šã«ã‚‚Bignum
+ ãŒä½¿ãˆã‚‹ã‚ˆã†ã«ãªã‚‹. ã“れã§ioctlも使ãˆã‚‹.
+
+Fri Jun 10 17:26:42 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * Comparable: 基礎ã¨ãªã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ã‚’`=='ã¨`>'ã‹ã‚‰`<=>'ã«å¤‰æ›´ã—ãŸ. 今
+ 後Comparableã®ã‚µãƒ–クラスã¯`<=>'ã ã‘ã‚’å†å®šç¾©ã™ã‚‹å¿…è¦ãŒã‚ã‚‹.
+
+Wed Jun 8 13:12:18 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * Need_Fixnum()ã‚’ã»ã¨ã‚“ã©ãªãã—ã¦, NUM2INT()ã§ç›´æŽ¥intã«å¤‰æ›ã™ã‚‹ã“
+ ã¨ã«ã—ãŸ. ã“れã§31bitã«ä¸¸ã‚ã¦æ¡è½ã¡ã‚’ãŠã“ã™å•題ãŒãªããªã‚‹.
+
+Tue Jun 7 09:45:31 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby.h: マクロFIXABLE(n)を追加. ã¤ã„ã§ã«FIXNUM周りã®å®šç¾©ã‚’変更ã—
+ ã¦, ç§»æ¤æ€§ã‚’高ã‚ãŸ(ã¤ã‚‚り).
+
+ * C++ã®äºˆç´„語ã§ã‚ã‚‹newを削除ã—ãŸ. ã—ã‹ã—, ã‚‚ã†ã²ã¨ã¤ã®äºˆç´„語ã§ã‚ã‚‹
+ classã«é–¢ã—ã¦ã¯, ç½®ãæ›ãˆã‚‹å˜èªžãŒæ€ã„ã¤ã‹ãªã„ã“ã¨ã‚‚ã‚ã£ã¦ãã®ã¾
+ ã¾ã«ãªã£ã¦ã„ã‚‹.
+
+ * 31bitã‚’è¶Šãˆãã†ãªINT2FIX()を関数呼ã³å‡ºã—ã«å¤‰ãˆãŸ. å°†æ¥bignumãŒå°Ž
+ å…¥ã•ã‚ŒãŸæ™‚ã«ã¯è‡ªå‹•çš„ã«bignumã‚’è¿”ã™ã‚ˆã†ã«ã™ã‚‹.
+
+ * readline() - 引数ã®`-'ã¯æ¨™æº–入力をæ„味ã™ã‚‹ã‚ˆã†ã«ãªã£ãŸ.
+
+ * ruby.h: å³ã‚·ãƒ•トãŒè«–ç†ã‚·ãƒ•トã‹ç®—術シフトã‹ã¯å‡¦ç†ç³»ä¾å­˜ã®ã‚ˆã†ãªã®
+ ã§, ruby.hã§cppを使ã£ã¦ãƒã‚§ãƒƒã‚¯ã™ã‚‹ã‚ˆã†ã«ã—ãŸ. ã“れã§ã†ã¾ãã„ã
+ ã¨æ€ã†ã®ã ãŒ, 手元ã«ç¬¦åˆä»˜intã‚’è«–ç†ã‚·ãƒ•トã™ã‚‹å‡¦ç†ç³»ãŒãªã„ã®ã§ç¢º
+ èªã§ããªã„. NEWS-OSã®CCã¯ç¢ºã‹å³ã‚·ãƒ•トã¯ã„ã¤ã‚‚è«–ç†ã‚·ãƒ•トã ã£ãŸã‚ˆ
+ ã†ãªæ°—ãŒã™ã‚‹ã‚“ã ã‘ã©â€¦.
+
+Mon Jun 6 10:10:22 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * FIX2INT()ã®å®šç¾©ã‚’変更ã—ãŸ. ã©ã†ã—ã¦æ˜”ã¯ã†ã¾ãå‹•ã‹ãªã‹ã£ãŸã‚“ã ã‚
+ ã†ã‹? ã‚‚ã—ã‹ã—ã¦, å³ã‚·ãƒ•トã®ç¬¦å·æ‹¡å¼µã¯å‡¦ç†ç³»ä¾å­˜?
+
+ * FIX2INT()ã¨FIX2UINT()を使ã„分ã‘るよã†ã«ã—ãŸ. ã‚‚ã£ã¨ã‚‚fixnumã¯31
+ ビットã—ã‹ãªã„ã®ã§, 本質的ãªè§£æ±ºã«ã¯ãªã‚‰ãªã„ã®ã ãŒ(ioctlãŒçµ„ã¿è¾¼
+ ã¿ãŸã‹ã£ãŸ).
+
+ * printを関数的メソッドã‹ã‚‰é€šå¸¸ãƒ¡ã‚½ãƒƒãƒ‰ã«å¤‰æ›´. 引数ãŒä¸Žãˆã‚‰ã‚Œãªã„
+ 時ã«ã¯ãƒ¬ã‚·ãƒ¼ãƒã‚’プリントã™ã‚‹ã‚ˆã†ã«ã—ãŸ. ã“れã§printをメッセージ
+ å½¢å¼ã§ã‚‚実行ã§ãるよã†ã«ãªã£ãŸ. 例:
+
+ ruby -e 'readlines().sort.print'
+
+ 上ã®ã‚¹ã‚¯ãƒªãƒ—トã¯, 引数ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸ(ã‚ã‚‹ã„ã¯æ¨™æº–入力ã‹ã‚‰èª­ã¿
+ è¾¼ã¾ã‚ŒãŸ)文字列をå„行毎ã«ã‚½ãƒ¼ãƒˆã—ã¦è¡¨ç¤ºã™ã‚‹.
+
+ * eval.c: argc,argvパターンã§å¼•æ•°ã‚’å—ã‘るメソッドã«å¼•æ•°ãŒä¸€ã¤ã‚‚与
+ ãˆã‚‰ã‚Œãªã„時, argvãŒnilã«ãªã£ã¦ã„ãŸ(argv[0]ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã¨è½ã¡
+ ã¦ã—ã¾ã†).
+
+ * _exit()を追加. ã“ã¡ã‚‰ã¯ä¾‹å¤–処ç†ãªã©è¡Œãªã‚ãªã„.
+
+ * dbmクラス: クラスåç§°ã‚’DBM(大文字)ã«çµ±ä¸€ã—ãŸ.
+
+Sat Jun 4 00:51:04 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * ループ変数ã«ã‚‚属性やé…列è¦ç´ ã‚’指定ã§ãるよã†ã«ã—ãŸ.
+
+Fri Jun 3 09:49:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * 多é‡ä»£å…¥ã«ãŠã„ã¦, 属性代入, é…列è¦ç´ ã¸ã®ä»£å…¥ã‚‚行ãªãˆã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * Need_Fixnum(): nilã‚’0ã«å¤‰æ›ã™ã‚‹ã‚ˆã†ã«.
+
+ * Enumerable:min, max, index, includes - 追加. min, maxã¯è¦ç´ ãŒ
+ `<=>'メソッドをæŒã¤ã“ã¨ã‚’仮定ã—ã¦ã„ã‚‹.
+
+ * Dict/Dbm:length - è¦ç´ æ•°ã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰.
+
+ * Dbmクラスã«to_aメソッドを追加.
+
+ * Sunã«ãŠã‘ã‚‹sortã®èª¤å‹•作ã®ä»¶, 昨日ã®ä¿®æ­£ã§fixã•れãŸ. ã—ã‹ã—, ãれ
+ ã§ãªãœå‹•ã‹ãªã‹ã£ãŸã®ã‹ã¯æ˜Žã‚‰ã‹ã§ã¯ãªã„ãŒâ€¦. 比較関数ãŒã©ã‚“ãªå€¤ã‚’
+ è¿”ã—ã¦ã‚‚指定ã—ãŸé ˜åŸŸå¤–をアクセスã™ã‚‹ã®ã¯ãƒã‚°ã§ã¯ãªã„ã‹.
+
+ * ファイルã®å…¨å†…容を読んã§, å„行をé…列ã¨ã—ã¦è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ã¯pythonã‚’
+ å‚考ã«ã—ã¦`readlines'ã¨ã„ã†åå‰ã«ã—ãŸ. ãれã«ã¨ã‚‚ãªã„getsã«å¯¾ã—
+ ã¦readlineã¨ã„ã†åˆ¥åを用æ„ã—ãŸ.
+
+Fri Jun 3 00:08:38 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * Array:sort - åˆ¤åˆ¥é–¢æ•°ã®æˆ»ã‚Šå€¤ã¯Fixnumã§ã¯ãªã, Intã§ã‚ã‚‹ã¹ãã ã£
+ ãŸ. é–“é•ã„. Sunã§å‹•作ãŒãŠã‹ã—ã‹ã£ãŸã®ã¯ã“ã®ã›ã„ã‹ã‚‚知れãªã„.
+
+Thu Jun 2 11:48:37 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * IO:read_all() - ã‚¹ãƒˆãƒªãƒ¼ãƒ ã®æœ€å¾Œã¾ã§å…¥åŠ›ã—ã¦, å„行をè¦ç´ ã¨ã™ã‚‹é…
+ 列を返ã™ãƒ¡ã‚½ãƒƒãƒ‰ã‚’追加. ã¾ãŸé–¢æ•°ãƒ¡ã‚½ãƒƒãƒ‰ read_all()も追加ã—ãŸ.
+ ã“れã¯å¼•æ•°ã®ãƒ•ァイルã‹ã‚‰èª­ã¿è¾¼ã‚“ã§å„行をè¦ç´ ã¨ã™ã‚‹é…列を返ã™. æ„
+ 味的ã«ã¯
+
+ def read_all()
+ ary = {}
+ while gets()
+ ary.push($_)
+ end
+ end
+
+ ã¨ã»ã¼ç­‰ä¾¡ã§ã‚ã‚‹.
+
+ * String:atoiメソッドを削除. to_aメソッドã‹ã‚‰aãŒé…列ã§ã‚ã‚‹ã¨ã®é€£æƒ³
+ を呼んã§, 混乱を招ã‹ãªã„ãŸã‚. 代ã‚りã«to_iメソッドを使ã†ã“ã¨.
+
+ * é…列ã¸ã®å¤‰æ›ãƒ¡ã‚½ãƒƒãƒ‰to_aã‚’å°Žå…¥ã—ãŸ. 通常ã®ã‚ªãƒ–ジェクトã¯è‡ªåˆ†è‡ªèº«
+ を唯一ã®è¦ç´ ã¨ã™ã‚‹é•·ã•1ã®é…列を返ã™. é…列ã¯è‡ªåˆ†è‡ªèº«ã‚’, 辞書ã¯ã‚­ãƒ¼
+ ã¨å€¤ã®ãƒšã‚¢ã®é…列を返ã™. Enumeratedã‚’includeã—ãŸã‚¯ãƒ©ã‚¹ã¯, eachãŒ
+ è¿”ã™å„è¦ç´ ã‚’å«ã‚€é…列を返ã™.
+
+ * file.c: ä¸å®šå€‹ã®å¼•æ•°ã‚’å—ã‘ã¨ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰(chmod,chown,utimes)を書ã
+ æ›ãˆã¦, æ•´ç†ã—ãŸ. ãれã«ä¼´ã„, 最åˆã«å…¨ã¦ã®å¼•æ•°ã®åž‹ãƒã‚§ãƒƒã‚¯ã‚’行ãª
+ ã†ã‚ˆã†ã«ã—ãŸ. åž‹ãƒã‚§ãƒƒã‚¯ã«å¤±æ•—ã™ã‚‹ã¨å‡¦ç†ã‚’行ãªã‚ãšã«ä¾‹å¤–を発生ã•
+ ã›ã‚‹.
+
+ * configure.in: ä¸å¿…è¦ãªãƒ†ã‚¹ãƒˆã‚’行ãªã‚ãªã„よã†ã«ä¿®æ­£ã—ãŸ.
+
+Tue May 31 10:41:08 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * String:pack(): 2é€²æ•°ã®æ–‡å­—列変æ›(B,b)ã§0ã¨1ãŒé€†ã ã£ãŸ.
+
+ * Math.c: 実数系ã®ãƒ¡ã‚½ãƒƒãƒ‰ã«å¼•æ•°ã¨ã—ã¦æ•´æ•°ãŒæ¸¡ã•ã‚ŒãŸæ™‚ã«è‡ªå‹•çš„ã«å¤‰
+ æ›ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * toupper(), tolower(): 文字列ã®åˆ¤å®šãƒŸã‚¹ã§å¤‰æ›ã•れã¦ã„ãªã‹ã£ãŸ.
+
+ * getopt_long()ã®ä»•様ã«ã‚ˆã£ã¦, スクリプトã¸ã®å¼•æ•°ãŒã‚¤ãƒ³ã‚¿ãƒ—リタã®
+ 引数ã ã¨è§£é‡ˆã•れã¦ã„ãŸ. 引数パターン文字列ã®å…ˆé ­ã«`+'を追加.
+
+ * config.hを削除ã—ãŸ. DEFINEã¯Makefileã§ä¸Žãˆã‚‰ã‚Œã‚‹.
+
+ * sprintf(): "%d"ã«æ–‡å­—列ãŒä¸Žãˆã‚‰ã‚ŒãŸæ™‚ã«ã¯ã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã¯ãªã内容を
+ æ•´æ•°ã«å¤‰æ›ã™ã‚‹ã‚ˆã†ã«ã—ãŸ. ã¤ã„ã§ã«æµ®å‹•å°æ•°ç‚¹æ•°ã‚‚変æ›ã™ã‚‹ã‚ˆã†ã«å¤‰
+ æ›´ã—ãŸ.
+
+ * regexp.c: rubyã®æ‹¡å¼µæ­£è¦è¡¨ç¾(\d, \D, \s, \S)ã®å‡¦ç†ã§å‰²ã‚Šå½“ã¦ãŸé ˜
+ 域を越ãˆã¦ãƒãƒƒãƒ•ã‚¡ã«æ›¸ã込んã§ã„ãŸ. 処ç†å‰ã«ãƒãƒƒãƒ•ã‚¡ã‚’ãã¡ã‚“ã¨æ‹¡
+ å¼µã™ã‚‹ã‚ˆã†ã«ã—ãŸ. ã“ã‚Œã§æ˜¨æ—¥å•題ã«ã—ã¦ã„ãŸãƒ¡ãƒ¢ãƒªã®å•題ã¯è§£æ±ºã§ã
+ ãŸã¨æ€ã†.
+
+ * yylex(): ダブルクォート文字列中ã§ãƒ€ãƒ–ルクォートを表ç¾ã™ã‚‹ãŸã‚
+ ã®ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥è¡¨ç¾ãŒã§ããªã‹ã£ãŸ.
+
+Mon May 30 10:07:42 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * 演算å­`!'ã®å³è¾ºã‚‚æ¡ä»¶å¼ã§ã‚ã‚‹ã¨ã—ãŸ. ã“れã«ã‚ˆã£ã¦, ã“ã®æ¼”ç®—å­ã‚’
+ å†å®šç¾©ã™ã‚‹äººã¯æ··ä¹±ã™ã‚‹ã‹ã‚‚知れãªã„ãŒ, 大多数ã®ã“ã®æ¼”ç®—å­ã‚’使ã†äºº
+ ã¯æ··ä¹±ã‚’é¿ã‘ã‚‹ã“ã¨ãŒã§ãã‚‹ã¨æ€ã†.
+
+ * autoconfを使ã£ã¦, 自動的ã«Makefile, config.hを生æˆã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+ ã“れã§, 多ãã®ãƒžã‚·ãƒ³ã§ã¯`configure'を実行ã—ãŸå¾Œ, `make'一発ã§ã‚³
+ ンパイルã§ãã‚‹ã¨æ€ã†.
+
+ * clone: サブクラスã«å¯¾ã—ã¦ç”¨ã„られãŸå ´åˆ, å…ƒã®ã‚ªãƒ–ジェクトã¨åŒã˜
+ クラスã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’è¿”ã™ã‚ˆã†ã«(以å‰ã¯ãƒ“ルトインクラスã®å ´åˆã‚’
+ 考ãˆã¦ãªã‹ã£ãŸ).
+
+ * ビルトインクラスã®ã‚µãƒ–クラスも作れるよã†ã«, リテラルã®ã‚るクラス
+ ã«ã‚‚newメソッドを追加ã—ãŸ.
+
+ * malloc()ã§è½ã¡ã‚‹. purifyãŒå¿…è¦ã‹ã‚‚知れãªã„.
+
+ * re.c: rb_global_variable()ã®å‘¼ã³ã ã—å½¢å¼ã®é–“é•ã„. 変数ã¸ã®ãƒã‚¤ãƒ³
+ タを渡ã•ãªã‘れã°ã„ã‘ãªã„.
+
+ * parse.y: ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã®æ‰±ã„ã«å¼•æ•°ã®è©•価順ã«ä¾å­˜ã™ã‚‹ç§»æ¤æ€§ã®ãªã„
+ 部分ãŒã‚ã£ãŸ.
+
+ * attr(): 属性設定ã®ãƒã‚°ã‚’ç›´ã—ãŸ. ã„ã¤å†…部仕様ãŒå¤‰ã‚ã£ãŸã‚“ã ã‚ã†â€¦?
+
+Sat May 28 23:08:18 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * æ­£è¦è¡¨ç¾ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã®æ–‡å­—列一致判定をãƒã‚¤ãƒ³ã‚¿ä¸€è‡´ã‹ã‚‰å†…容一致ã«å¤‰
+ æ›´ã—ãŸ. ãã†ã„ãˆã°æ–‡å­—列リテラルã¯ä¸€å›žæ¯Žã«æ–°ã—ãオブジェクトãŒç”Ÿ
+ æˆã•れるã®ã ã£ãŸ.
+
+Fri May 27 11:42:00 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * trã‹ã‚‰æ–‡å­—削除(delete), 文字圧縮(squeeze)を分離ã—ãŸ. ãれã«ã¨ã‚‚
+ ãªã„trã®ã‚ªãƒ—ション引数ã¯ãªããªã£ãŸ.
+
+Thu May 26 10:32:55 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * スクリプト読ã¿è¾¼ã¿ãƒ«ãƒ¼ãƒãƒ³ã‚’書ãç›´ã—ã¦, 通常ファイル以外ã®ãƒ•ァイ
+ ルåや空文字列ãŒã‚¹ã‚¯ãƒªãƒ—トã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸå ´åˆã«å¯¾å¿œã—ãŸ. ã¾ãŸ,
+ 標準入力ã‹ã‚‰ã‚¹ã‚¯ãƒªãƒ—トを読ã¿è¾¼ã‚€æ™‚ã«, 一時ファイルãŒ/tmpã«æ®‹ã‚‰ãª
+ ã„よã†ã«ã—ãŸ.
+
+ * Fixnum:id2name - IDã‹ã‚‰æ–‡å­—åˆ—ã«æˆ»ã™é–¢æ•°. String:internã®é€†.
+
+ * Array: é…列ã®ç¯„囲外ã®è¦ç´ ã‚’アクセスã—ãŸæ™‚ã«ä¾‹å¤–を発生ã•ã›ãšã«,
+ nilã‚’è¿”ã™ã‚ˆã†ã«ã—ãŸ. é…列ã¯è‡ªå‹•çš„ã«æ‹¡å¼µã•れる.
+
+ * string:stripを追加.
+
+ * -nオプションãŒ-eオプションを複数指定ã—ãŸæ™‚も動作ã™ã‚‹ã‚ˆã†ã«.
+
+ * parse.yã§<sys/types.h>もインクルードã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * fname周りã®ç´°ã‹ã„bugを修正.
+
+Wed May 26 11:45:10 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * 定数をキャッシュã™ã‚‹ã‚ˆã†ã«ã—ãŸ. 繰り返ã—ãŒå¤šã„å ´åˆã«ã¯æœ‰åйã®ã¯ãš
+ ã ãŒ, 一度ã—ã‹ã‚¢ã‚¯ã‚»ã‚¹ã—ãªã„å ´åˆã¯é…ããªã‚‹ãªã‚.
+
+Wed May 25 00:42:24 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * 多é‡ä»£å…¥æ–‡(foo, bar = 1, 2)ã®æŽ¡ç”¨.
+
+ * æ¡ä»¶å¼éƒ¨ã«æ–‡å­—列ã‚ã‚‹ã„ã¯æ­£è¦è¡¨ç¾ãƒªãƒ†ãƒ©ãƒ«ã‚’ãŠãã¨`=~'演算å­ã«ã‚ˆã£
+ ã¦`$_'ã¨æ¯”較ã•れる. æ›´ã«`...'ã®ä¸¡è¾ºã§ã¯æ•´æ•°ãƒªãƒ†ãƒ©ãƒ«ãŒ`$.'ã¨æ¯”較
+ ã•れる.
+
+Mon May 23 23:27:03 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * &å¼ å½¢å¼ã¯ãªããªã£ãŸ. 代ã‚りã«kernel:apply(id, args..)ã‚’å°Žå…¥.
+
+ * def op () ..å½¢å¼ã®å°Žå…¥. opã¯å†å®šç¾©å¯èƒ½ãªæ¼”ç®—å­.
+
+ * constantã®ä»£å…¥æ™‚ãƒã‚§ãƒƒã‚¯. æ—¢ã«åˆæœŸåŒ–ã•れã¦ã„る定数ã«ä»£å…¥ã—ãŸå ´åˆ
+ ã¯ä¾‹å¤–ãŒç™ºç”Ÿã™ã‚‹.
+
+ * 多é‡ä»£å…¥æ–‡.
+
+Thu May 19 22:57:07 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * è¤‡åˆæ–‡ã§ã‚‚void valueã®ãƒã‚§ãƒƒã‚¯ã‚’行ã†ã‚ˆã†ã«ã—ãŸ.
+
+ * untilã®å‹•作ã®ä¿®æ­£(do..untilåž‹ã ã£ãŸ).
+
+Wed May 18 01:06:25 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * ç§»æ¤ã«é–¢ã™ã‚‹è‹¥å¹²ã®å•題を修正.
+
+ * 別åã®æ§‹æ–‡ã‚’「def a bã€ã«ã—ãŸ.
+
+ * until/unless: 演算å­ã‹ã‚‰åˆ¶å¾¡æ–‡ã¸. ä¾‹å¤–ã‚’æ•æ‰ã™ã‚‹æ©Ÿèƒ½ã¯ãã®ã¾ã¾.
+
+ * é¸æŠžå¯èƒ½ãªæ©Ÿèƒ½ã‚’config.hã‹ã‚‰defines.hã«ç§»å‹•.
+
+Fri May 13 23:20:21 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * -yオプションを新設. -dオプションã‹ã‚‰ã‚³ãƒ³ãƒ‘イラã®ãƒ‡ãƒãƒƒã‚°éƒ¨åˆ†ã‚’分
+ 離ã—ãŸ.
+
+Tue Apr 25 20:17:33 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * マルãƒãƒã‚¤ãƒˆæ–‡å­—列を識別å­ã«ä½¿ãˆã‚‹ã‚ˆã†ã«. 個人的ã«ã¯ä½¿ã„ãŸãã¯ç„¡
+ ã„ã‘ã©ãªã‚.
+
+ * `-v'フラグã®çŠ¶æ…‹ã‚’$verboseã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãるよã†ã«.
+
+ * CVSã®å°Žå…¥ã«ä¼´ã„, ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç®¡ç†ã®æ–¹æ³•を変更.
+
+ * 真é¢ç›®ã«ChangeLogã‚’ã¤ã‘る事ã«ã—ãŸ.
+
+Tue Mar 8 10:09:25 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * %変数å ã«ã‚ˆã‚‹ã‚¯ãƒ©ã‚¹å®šæ•°ã‚’å°Žå…¥.
+
+ * undef メソッド ã«ã‚ˆã‚‹ãƒ¡ã‚½ãƒƒãƒ‰å®šç¾©ã®å–り消ã—ã‚’å°Žå…¥.
+
+ * rb_get_method_bodyã§ã¯the_envを変更ã›ãš, rb_call()ã§æ˜Žç¤ºçš„ã«å¤‰æ›´
+ ã™ã‚‹ã‚ˆã†ã«. ã“れã§responds_toãªã©ã§ç’°å¢ƒãŒç ´å£Šã•れãªã„.
+
+Mon Mar 7 17:46:15 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * 「&文字列ã€å½¢å¼. 「å¼.文字列ã€åž‹ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚»ãƒ³ãƒ‰ã¯ãªããªã£ãŸ.
+
+ * 自己代入形å¼(+=. -=, ...)
+
+ * obj.attr = exprå½¢å¼ã®æŽ¡ç”¨.
+
+Thu Feb 24 16:23:28 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * toint, tofloat, print_stringã‚’ãれãžã‚Œto_i, to_f, to_sã«å¤‰æ›´.
+
+ * String:clone - Copy on Writeã®å®Ÿç¾.
+
+Tue Feb 22 11:11:44 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * re.c: マッãƒã—ãŸæ–‡å­—列ã®ä¿å­˜ã«å¤±æ•—ã—ã¦ã„ãŸ.
+
+ * trap: å¯èƒ½ãªã‚‰ã°å‡¦ç†ã«æ™‚é–“ã®ã‹ã‹ã‚‹ã‚·ã‚¹ãƒ†ãƒ ã‚³ãƒ¼ãƒ«(read, wait,
+ sigpause, select)をフックã—ã¦å‰²ã‚Šè¾¼ã¿å‡¦ç†ã®å³ç­”性を高ã‚ã‚‹(DOSãª
+ ã©ã§ã¯ç„¡ç†ã ãªã‚).
+
+ * trap: 割り込ã¿ã‚’ãã®å ´ã§å‡¦ç†ã™ã‚‹ã‹(迅速ã ãŒå±é™º), 安全ãªã‚¿ã‚¤ãƒŸãƒ³
+ ã‚°ã§å‡¦ç†ã™ã‚‹ã‹ã‚’é¸æŠžã§ãるよã†ã«.
+
+Tue Feb 17 11:11:12 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * trap: 割り込ã¿ãƒãƒ³ãƒ‰ãƒ©.
+
+Wed Feb 16 12:29:12 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * String:crypt: æš—å·åŒ–ルーãƒãƒ³
+
+ * "::"演算å­ã®è¿½åŠ . a::b 㯠{a, b}ã¨åŒç¾©. a::b::c 㯠{a, {b, c}}ã¨
+ åŒç¾©(å³çµåˆ). åŒç¾©ã¨ã¯ã„ã†ã‚‚ã®ã®, "::"演算å­ã‚’使ã£ãŸæ–¹ãŒå°‘ã—ã ã‘
+ メモリ効率ãŒè‰¯ã„.
+
+ * Dir.rmdir(), File.unlink(), File.utime() -- å„システムコールã¸ã®
+ インタフェース.
+
+ * kill -- kill(2) I/F
+
+ * select(): readã®ãƒã‚§ãƒƒã‚¯ã§ã¯stdioã«ãƒãƒƒãƒ•ァリングã•れã¦ã„ã‚‹ã‹ã©
+ ã†ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ã‚ˆã†ã«.
+
+Tue Feb 15 15:08:31 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * file.c: statをキャッシュã™ã‚‹ã‚ˆã†ã«.
+
+ * File:utime()を追加.
+
+ * unliteralize(): フラグを破壊ã—ã¦ã„ãŸ.
+
+ * Bug(): coreã‚’åãよã†ã«.
+
+ * String:tr -- tr(1)互æ›. 引数パターンãŒã¡ã‚‡ã£ã¨é•ã†ã‘ã©â€¦.
+
+Mon Feb 14 18:24:13 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * unless, untilãŒä¾‹å¤–ã‚‚å½ã¨è¦‹ãªã™ã‚ˆã†ã«.
+
+ * select() -- select(2) I/F
+
+ * Array:pack, String:unpack: perlã®pack/unpackã®åŒç­‰å“
+
+Tue Feb 8 17:11:10 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * setenv()ã®ãªã„システムã®ãŸã‚ã«putenv()を使ã£ãŸã‚³ãƒ¼ãƒ‰ã‚‚用æ„ã—ãŸ.
+
+Mon Feb 7 09:52:44 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * 引数ã®ä¸€ç•ªæœ€å¾Œã«`*'ã‚’ç½®ã‘るよã†ã«ã—ãŸ. ã“れã§rest引数ã®ãƒªã‚¹ãƒˆã‚’
+ æ“作ã™ã‚‹å¿…è¦ãŒå°‘ãªããªã‚‹.
+
+Fri Feb 4 18:23:26 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * ruby-mode.elを書ãç›´ã™. ãšã„ã¶ã‚“ã¾ã—ã«ãªã£ãŸã¨æ€ã†.
+
+ * 文字列リテラルã®Copy on Writeを実ç¾. ã“ã‚Œã§æ–‡å­—列ãŒãƒªãƒ†ãƒ©ãƒ«ã§ã‚
+ ã‚‹ã‹ã‚‰ã¨ã„ã£ã¦ã„ã¡ã„ã¡cloneã—ãªãã¦ã‚‚済む.
+
+Tue Feb 1 09:21:09 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * sub(), gsub()ã§, マッãƒã—ãŸæ–‡å­—列を$&, $1..$9ã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãるよ
+ ã†ã«ã—ãŸ. åŒæ™‚ã«ãƒžãƒƒãƒã—ãŸéƒ¨åˆ†æ–‡å­—列をコピーã—ã¦ãŠãよã†ã«(å…ƒã®
+ 文字列ãŒå¤‰æ›´ã•れã¦ã‚‚状態をä¿å­˜ã™ã‚‹ãŸã‚).
+
+Mon Jan 31 15:16:58 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * プライベートメソッドã®ä»•様を変更. 今ã¾ã§ã¯åŒã˜ã‚¯ãƒ©ã‚¹ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‹
+ らã—ã‹ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã‹ã£ãŸãŒ, サブクラスã®ãƒ¡ã‚½ãƒƒãƒ‰ã‹ã‚‰ã‚‚アクセス
+ ã§ãるよã†ã«ã—ãŸ(C++ã«ãŠã‘ã‚‹protected メンãƒé–¢æ•°).
+
+ * メソッドサーãƒã®ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ ã‚’改善ã—, 10%程度ã®é«˜é€ŸåŒ–を行ãªã£ãŸ.
+
+ * 高速化. Cã§è¨˜è¿°ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™æ™‚ã«ã¯setjmpを呼ã°ãªã„よ
+ ã†ã«ã—ãŸ. ã“れã§Cメソッドを多用ã™ã‚‹å ´åˆã«ã¯3å€ç¨‹åº¦é«˜é€Ÿã«ãªã£ãŸ.
+
+Fri Jan 28 15:44:04 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * sh-modeã‚’å…ƒã«ruby-mode.elを作る. 演算å­ã§çµ‚ã‚‹, 2è¡Œã«æ¸¡ã‚‹æ–‡ã«ã¯å¯¾
+ 応ã—ã¦ã„ãªã„ã‘ã©â€¦.
+
+Thu Jan 27 11:35:19 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * freenode(): NODE_NILã®è§£æ”¾å¿˜ã‚Œ.
+
+ * å­—å¥è§£æžéƒ¨ã®ãƒã‚°ä¿®æ­£(コメントã®å¾Œã®çŠ¶æ…‹ã‚’æˆ»ã—忘れ).
+
+ * protect .. endã®ãƒã‚°ä¿®æ­£. GC_LINKã®ãƒã‚¹ãƒˆãŒä¸æ­£ã ã£ãŸ.
+
+ * joinã®ãƒã‚°ä¿®æ­£(使ã£ã¦ã„るオブジェクトをfreeã—ã¦ã„ãŸ).
+
+ * splitã®ãƒã‚°ä¿®æ­£(アルゴリズムãŒãŠã‹ã—ã‹ã£ãŸ).
+
+ * fork()を追加.
+
+Wed Jan 26 17:09:56 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * ファイルテストメソッドã®è¿½åŠ .
+
+ * rb_autoexec(): クラスをåˆã‚ã¦ã‚¢ã‚¯ã‚»ã‚¹ã—ãŸæ™‚ã®æŒ™å‹•を制御ã§ãるよ
+ ã†ã«ã—ãŸ. ã“れã§autoloadも実ç¾ã§ãã‚‹. ã“れã«ã¨ã‚‚ãªã„メソッド
+ unknownã¯ãªããªã£ãŸ.
+
+Tue Jan 25 15:51:36 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * Dbmクラス, Mathモジュールを作æˆ.
+
+ * -Iオプションã§ã‚µãƒ¼ãƒãƒ‘スã«è¿½åŠ ã§ãるよã†ã«.
+
+ * サーãƒãƒ‘スを変数$load_pathã«è¨­å®šã§ãるよã†ã«.
+
+ * load(): ダイナミックロードを使ãˆã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+Tue Jan 18 14:14:01 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * Comparable:"<=>"
+
+ * Float,Fixnum:"**"
+
+ * Array:sort
+
+Fri Jan 14 16:53:37 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * version 0.07
+
+ * メソッドã«é–¢ã™ã‚‹ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’充実ã•ã›ãŸ.
+
+ * String:index(): 引数positionを増やã—ãŸ.
+
+Thu Jan 13 15:13:52 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * æœªåˆæœŸåŒ–ã®å¤‰æ•°ã‚¢ã‚¯ã‚»ã‚¹ã‚’ãªãã—ãŸ.
+
+ * ç„¡é§„ãªhash tableã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã‚’削除.
+
+ * Purify'd(on Sun)
+
+ * ~RE 㨠~STRã®ã‚³ãƒ³ãƒ‘ã‚¤ãƒ«æ™‚å±•é–‹ã®æŠ‘åˆ¶.
+
+ * Sunã¸ç§»æ¤. signal()ã®æˆ»ã‚Šå€¤. RDataã®bug修正.
+
+ * parse.y: nlsルールを削除.
+
+ * yylex(): 改行ã¨ç¬¦åˆã®è§£æžéƒ¨åˆ†ã‚’変更.
+
+ * missing/strftime.c: ç§»æ¤ç”¨.
+
+ * Time:strftime: ãã®ä»–ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚‚strftimeを利用ã™ã‚‹ã‚ˆã†ã«.
+
+ * メソッドå†å®šç¾©æ™‚ã«ãƒ¡ã‚½ãƒƒãƒ‰ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã‚’クリアã™ã‚‹.
+
+Fri Jan 7 15:23:20 1994 Yukihiro Matsumoto (matz at nws119)
+
+ * Float:coerce(): Fixnumã¨Float以外ã®å¼•数を与ãˆã‚‰ã‚Œã‚‹ãŸæ™‚ã«ã¯ä¾‹å¤–
+ を発生ã™ã‚‹ã‚ˆã†ã«.
+
+ * Stat: stat構造体ã®å…¨ã¦ã®ãƒ¡ãƒ³ãƒã«å¯¾ã™ã‚‹ã‚¢ã‚¯ã‚»ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã‚’用æ„.
+
+ * 未定義ã®ã‚¯ãƒ©ã‚¹/モジュールã¸ã®å‚ç…§ãŒunknownメソッドを呼ã³å‡ºã™ã‚ˆã†
+ ã«ã—ãŸ.
+
+ * baseline - version 0.06.
diff --git a/doc/ChangeLog-0.50_to_0.60 b/doc/ChangeLog-0.50_to_0.60
new file mode 100644
index 0000000000..5f5b03ff40
--- /dev/null
+++ b/doc/ChangeLog-0.50_to_0.60
@@ -0,0 +1,462 @@
+Thu Dec 8 00:32:21 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * io.c($<.file,$<.filename): ãã¡ã‚“ã¨åˆæœŸåŒ–.
+
+ * parse.y(rb_class2name): includeã—ã¦ã„るクラスåを正常ã«è¡¨ç¤ºã§ã
+ ãªã‹ã£ãŸï¼Ž
+
+Wed Dec 7 15:40:36 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * dln.c: config.hã‚’includeã—ã¦ã„ãªã‹ã£ãŸï¼Ž
+
+ * missing/strdup.c: 忘れã¦ã„ãŸï¼Ž
+
+Fri Dec 2 15:21:44 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * 関数ã®å‘½åルールを変ãˆãŸ(クラスメソッド: Sxxx_xxx,ユーティリティ
+ メソッドxxx_xxxãªã©).
+
+ * re.c(casefold): å€‹ã€…ã®æ­£è¦è¡¨ç¾ã‚ªãƒ–ジェクトãŒå¤§æ–‡å­—å°æ–‡å­—を無視ã™
+ ã‚‹ã‹ã©ã†ã‹ã‚’設定ã§ãるよã†ã«ã—ãŸï¼Ž
+
+Thu Dec 1 01:44:51 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * missing.c: ã‚·ã‚¹ãƒ†ãƒ ã§æä¾›ã•れãªã„ãƒ•ã‚¡ã‚¤ãƒ«ã®æ‰±ã„を変更ã—ãŸï¼Ž
+
+ * io.c($<): 変数`$<'ãŒæŒ‡ã—ã¦ã„ã‚‹ã‚‚ã®ã‚’ç¾åœ¨èª­ã¿è¾¼ã¿ä¸­ã®ãƒ•ァイルåã‹
+ ら仮想ファイル($ARGF)ã«å¤‰æ›´ã—ãŸï¼Žã¾ãŸï¼Œç¾åœ¨èª­ã¿è¾¼ã¿ä¸­ã®ãƒ•ァイル
+ åã¨ãƒ•ァイルオブジェクトã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ã‚‚用æ„ã—ãŸï¼Ž
+
+ * ruby.h(data_new): Dataオブジェクトã®å‰²ã‚Šå½“ã¦æ–¹æ³•を改善ã—ãŸï¼Ž
+
+Wed Nov 30 15:36:13 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * Makefile: ルールを整ç†ã—ãŸï¼Ž
+
+Tue Nov 29 00:09:26 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * array.c(`|'): 引数ãŒé…列ã§ãªã,ã‹ã¤ãã®ã‚ªãƒ–ジェクトãŒè¦ç´ ã¨ã—ã¦
+ å«ã¾ã‚Œã¦ã„ãªã„時,ãã®ã‚ªãƒ–ジェクトを追加ã™ã‚‹ï¼Žã‚れã°ãªã«ã‚‚ã—ãªã„.
+
+ * process.c(gid,egid): GIDをアクセスã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ï¼Ž
+
+ * io.c(print): 文字列ã¨é…列ã«å¯¾ã™ã‚‹å‡¦ç†ã‚’組ã¿è¾¼ã‚“ã§è‹¥å¹²ã®é«˜é€ŸåŒ–ã‚’
+ 図ã£ãŸï¼Žå‡ºåŠ›ãŒå¤šã„å ´åˆã«åйã„ã¦ãるよã†ã ï¼Ž
+
+ * parse.y(parse_string): ""ã§å›²ã¾ã‚ŒãŸæ–‡å­—列内ã§ã¯å¯¾å¿œã™ã‚‹ã‚¨ã‚¹ã‚±ãƒ¼
+ プãŒãªã„`\'を残ã•ãªã„よã†ã«ï¼Žã¤ã¾ã‚Šï¼Œä»Šå¾Œã¯"\k" -> "k"ã§ã‚ã‚‹(以
+ å‰ã¯"\k"ã ã£ãŸ).
+
+Mon Nov 28 18:02:31 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * re.c(re_regsub): ç½®æ›æ–‡å­—列ã®ç½®æ›ãˆãŒä¸å®Œå…¨ã ã£ãŸï¼Ž
+
+ * 一時オブジェクトã®è§£æ”¾ã‚’ã™ã¹ã¦GCã«ä»»ã›ãŸï¼Žä»Šã®ã¾ã¾ã§ã¯ã¾ãšã„タイ
+ ミングã§ã‚ªãƒ–ジェクトを解放ã™ã‚‹å¯èƒ½æ€§ãŒã‚ã£ãŸï¼Žæ˜”ã®GCã®æ™‚ã«ã¯ã“れ
+ ã§ã‚‚良ã‹ã£ãŸã®ã ãŒï¼Ž
+
+Tue Nov 22 00:15:24 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c($"): æ—¢ã«ãƒ­ãƒ¼ãƒ‰ã—ãŸãƒ•ァイルåã®é…列.
+
+Mon Nov 21 01:09:50 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * array.c(&,|): 集åˆã¨ã—ã¦ã®ç©æ¼”ç®—ã¨å’Œæ¼”算.
+
+ * io.c($<): 文字列を代入ã—ãŸæ™‚ã«ã¯è‡ªå‹•çš„ã«openã™ã‚‹ã‚ˆã†ã«ï¼ŽIOã®ã‚µãƒ–
+ クラスã‹ã©ã†ã‹ã®ãƒã‚§ãƒƒã‚¯ã‚‚行ã†ï¼Ž
+
+Sun Nov 19 23:02:27 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c($:): $LOAD_PATHã®åˆ¥å.
+
+ * io.c($>): デフォルト出力先.IO.defaultã¯ç„¡ããªã£ãŸï¼Ž
+
+ * io.c($<): $FILENAMEã®åˆ¥å
+
+ * glob.c(each): ワイルドカードã«ãƒžãƒƒãƒã™ã‚‹ã‚‚ã®ãŒãªã„å ´åˆï¼Œãƒ‘ターン
+ ãã®ã‚‚ã®ã‚’与ãˆã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * file.c(chmod,chown,unlink,utime): `\'ã§ãƒ¯ã‚¤ãƒ«ãƒ‰ã‚«ãƒ¼ãƒ‰ã‚’エスケー
+ プã§ãるよã†ã«ï¼Ž
+
+Fri Nov 18 00:20:42 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.55 released
+
+ * file.c(chmod,chown,unlink,utime): 引数ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸæ–‡å­—列ã«ãƒ¯
+ イルドカードãŒå«ã¾ã‚Œã¦ã„ã‚‹å ´åˆã«ã¯Globオブジェクトã«å¤‰æ›ã™ã‚‹.
+
+Wed Nov 16 17:33:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * file.c(chmod,chown,unlink,utime): 引数ã¨ã—ã¦ãƒ¯ã‚¤ãƒ«ãƒ‰ã‚«ãƒ¼ãƒ‰ã‚‚å—ã‘
+ 付ã‘るよã†ã«. ãã®å ´åˆã¯ãƒžãƒƒãƒã™ã‚‹ãƒ•ァイル全体ã«é©ç”¨ã•れる.
+
+Fri Nov 11 00:07:28 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * string.c(strip): 文字列ãã®ã‚‚ã®ã‚’変更ã™ã‚‹ã‚ˆã†ã«.
+
+ * eval.c(rb_cal): 環境をスタックã«ç©ã‚€ã‚¿ã‚¤ãƒŸãƒ³ã‚°ãŒé–“é•ã£ã¦ã„ãŸã®ã§ï¼Œ
+ ä¸é©åˆ‡ãªã‚¨ãƒ©ãƒ¼ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒå‡ºã‚‹æ™‚ãŒã‚ã£ãŸï¼Ž
+
+ * eval.c(rb_undefined): メソッドãŒç„¡ã„時ã¨ãƒ¡ã‚½ãƒƒãƒ‰ã«ã‚¢ã‚¯ã‚»ã‚¹ã§ããª
+ ã„æ™‚ã¨ã§ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’替ãˆãŸï¼Ž
+
+ * string.c: toupper/tolowerã¯upcase/downcaseを使ã£ã¦å®Ÿç¾ï¼Ž
+
+ * string.c: lcfirst/ucfirstã¯å‰Šé™¤ï¼Ž
+
+Thu Nov 10 16:15:16 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * string.c: sub/gsubã¯ç½®æ›å¾Œã®æ–‡å­—列を返ã™ã‚ˆã†ã«ã—ãŸ.
+
+ * string.c: toupper/tolower/lcfirstãªã©ã‚’文字列を変更ã™ã‚‹ã‚‚ã®ã¨ã—
+ ãªã„ã‚‚ã®ã®2 種類をæä¾›ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+Tue Nov 1 17:52:09 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: 変数展開ã«ãƒã‚°ãŒã‚ã£ã¦å…ƒã®æ–‡å­—列を破壊ã—ã¦ã„ãŸ.
+
+Thu Oct 27 09:56:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: rest引数ã®å‡¦ç†ãŒé–“é•ã£ã¦ã„ãŸ.
+
+ * env.c(rb_yield): ローカル変数ã®è¨­å®šãŒé–“é•ã£ã¦ã„ãŸ.
+
+Wed Oct 26 19:01:43 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: 引数セットã®é«˜é€ŸåŒ–.
+
+ * process.c: sleepã®ãƒã‚°.
+
+ * parse.y, gnuglob.c: Sunã®ccã§ã‚‚コンパイルã§ãるよã†ã«.
+
+Tue Oct 25 00:36:16 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: 若干ã®é«˜é€ŸåŒ–. スタックã®å‡¦ç†ã«ã‚ˆã£ã¦rb_call()ãŒå°‘ã—é…ã
+ ãªã£ãŸåˆ†ã®ç©´åŸ‹ã‚ãらã„ã‹.
+
+ * eval.c: blockã‚’envã‹ã‚‰å¤–ã™ãªã©ã—ã¦ã‚¹ã‚¿ãƒƒã‚¯ã‚’軽ãã—ãŸ.
+
+Mon Oct 24 11:47:54 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * re.c: æ­£è¦è¡¨ç¾ã‚¢ã‚¯ã‚»ã‚¹ç”¨ã®å¤‰æ•°($`, $', $+)を追加.
+
+ * re.c($KANJI): 処ç†ã™ã‚‹æ¼¢å­—コードをrubyプログラム内ã‹ã‚‰è¨­å®šã§ãã‚‹
+ よã†ã«ã—ãŸ.
+
+Sat Oct 22 00:42:41 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c: イテレータ内ã®redoã¨retryã®å‡¦ç†ã«ãƒã‚°ãŒã‚ã£ãŸï¼Ž
+
+Fri Oct 21 00:53:21 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * string.c(swapcase): 文字列ã®å¤§æ–‡å­—å°æ–‡å­—ã‚’ç½®ãæ›ãˆã‚‹.
+
+ * string.c(ljust,rjust,center): 文字列ã®ãƒ¬ã‚¤ã‚¢ã‚¦ãƒˆç”¨ãƒ¡ã‚½ãƒƒãƒ‰.
+ sprintf()ã§ã‚‚åŒã˜ã‚ˆã†ãªã“ã¨ã¯ã§ãã‚‹ãŒ.
+
+ * socket.c(recv,recvfrom): flags引数をçœç•¥å¯èƒ½ã«ã—ãŸ. çœç•¥æ™‚ã®å€¤ã¯
+ 0ã§ã‚ã‚‹.
+
+ * socket.c(recvfrom): recvã¨åŒæ§˜ã ãŒ, データã¨ç›¸æ‰‹ã‚¢ãƒ‰ãƒ¬ã‚¹ã®ãƒšã‚¢ã‚’
+ è¿”ã™.
+
+ * socket.c(accept): 戻り値をã¤ãªãŒã£ãŸã‚½ã‚±ãƒƒãƒˆã‹ã‚‰, ソケットã¨ã‚¢ãƒ‰
+ レスã®ãƒšã‚¢ã«å¤‰æ›´ã—ãŸ.
+
+ * eval.c(eval): the_classをセットã™ã‚‹æ™‚ã«, last_moduleãŒincludeã•
+ れã¦ã„るモジュール(T_ICLASS)ã§ã‚れã°, 定義元ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®æ–¹ã‚’セッ
+ トã™ã‚‹ã‚ˆã†ã«. ã“ã®ä¿®æ­£ãŒãªã„ã¨ICLASSã«å¯¾ã—ã¦ãƒ¡ã‚½ãƒƒãƒ‰ãŒå‘¼ã°ã‚Œã‚‹å¯
+ 能性ãŒã‚り, ä¸å¯©ãªå‹•作をã™ã‚‹(ã¯ãš).
+
+ * class.c: オブジェクトã®cloneã®éš›ã«ç‰¹ç•°ã‚¯ãƒ©ã‚¹(特異メソッド用ã®ã‚¯
+ ラス)ã‚’ãã¡ã‚“ã¨ã‚³ãƒ”ーã™ã‚‹ã‚ˆã†ã«ã—ãŸ. 今ã¾ã§ã¯å€‹ã€…ã®ãƒ¡ã‚½ãƒƒãƒ‰ã®ã‚³
+ ピーを忘れã¦ã„ãŸ.
+
+ * numeric.c: Numericã®newã¨cloneã‚’undefã—ãŸ.
+
+Thu Oct 20 11:30:00 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.53 released.
+
+ * parse.y: TopLevelã®defæ–‡ã¯é–¢æ•°ãƒ¡ã‚½ãƒƒãƒ‰ã‚’定義ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * parse.y: defæ–‡ã®private指定ã¯ãªããªã£ãŸ. export/noexportメソッド
+ を使ã£ã¦ã‚‚らã†ã“ã¨ã«ã—ãŸ.
+
+ * parse.y: caseæ–‡ã«thenã‚’å«ã‚€ã“ã¨ãŒã§ãるよã†ã«ãªã£ãŸ.
+
+Wed Oct 19 13:09:58 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * object.c(export,unexport): 関数メソッドã®è¨­å®šç”¨ãƒ¡ã‚½ãƒƒãƒ‰.
+
+ * eval.c, class.c: 関数的メソッドを復活ã•ã›(ã¾ãŸã‹â€¦), `@'ã«ã‚ˆã‚‹
+ privateメソッドをãªãã—ãŸ. ã‚„ã¯ã‚Š, 関数的ãªã‚‚ã®ã¯é–¢æ•°çš„ã«å‘¼ã³ãŸ
+ ã„æ°—ãŒã—ã¦ããŸ. ã“ã†ä»•様ãŒå¤‰å‹•ã—ã¦ã¦ã¯ã„ã‘ãªã„よã†ãªæ°—ã‚‚ã™ã‚‹ãªã‚.
+ *BACKWARD INCOMPATIBILITY*
+
+ * eval.c: ãƒ¡ã‚½ãƒƒãƒ‰ã®æ§‹æˆã‚’変更ã—, 別å管ç†ã¨é–¢æ•°ãƒ¡ã‚½ãƒƒãƒ‰ã®ç®¡ç†ã‚’分
+ 離ã—ãŸ.
+
+ * eval.c: the_env->last_funcã‚’Cãƒ¡ã‚½ãƒƒãƒ‰ã®æ™‚ã«ã‚‚æ›´æ–°ã™ã‚‹. ã“れãŒãª
+ ã„ã¨Structã®ã‚¢ã‚¯ã‚»ã‚¹ãŒå‹•作ã—ãªã„.
+
+Fri Oct 14 13:22:18 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.52 released: ……ãªã‚“ã¦ã“ã£ãŸã„.
+
+ * eval.c(rb_call): returnã®å‡¦ç†ãŒé–“é•ã£ã¦ã„ãŸã®ã§, マシンã«ã‚ˆã£ã¦
+ ã¯returnã§é–¢æ•°ã‚’終了ã™ã‚‹ã ã‘ã§ãªãtoplevelã¾ã§ã¤ã抜ã‘ã¦ã„ãŸ.
+
+ * dbm.c: Dictã¨åŒæ§˜ã«eachãŒ[key,value]ã‚’è¿”ã™ã‚ˆã†ã«.
+
+ * version 0.51 released
+
+Thu Oct 13 12:13:48 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(SETUP_ARGS): 付加引数ãŒé…列ã§ãªã„時ã«ã¯é…列ã«å¤‰æ›ã™ã‚‹.
+
+ * parse.y: 括弧ãªã—ã®ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã§ã‚‚`*'ã«ã‚ˆã‚‹ä»˜åŠ å¼•æ•°ãŒä½¿ãˆã‚‹
+ よã†ã«ã—ãŸ. ãŸã ã—, 通常引数ãŒä¸€ã¤ã‚‚ãªã„å ´åˆã¯ä¹—算演算å­ã¨åŒºåˆ¥ãŒ
+ ã¤ã‹ãªã„ã®ã§, å¿…ãšæ‹¬å¼§ãŒå¿…è¦.
+
+Wed Oct 12 10:09:07 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(rb_call): キャッシュã®è¨ˆç®—ã‚’inline化. キャッシュミスãŒã‚
+ れã°é–¢æ•°å‘¼ã³å‡ºã—ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚’検索ã™ã‚‹. methods.cã¯ãªããªã£ãŸ.
+
+ * eval.c(rb_eval): ローカル変数用ã®é ˜åŸŸã‚’alloca()ã™ã‚‹ã‚ˆã†ã«å¤‰æ›´.
+ サイズã®å¤‰æ›´ãŒå¿…è¦ã«ãªã‚Œã°æ”¹ã‚ã¦malloc()ã™ã‚‹ã‚ˆã†ã«.
+
+ * parse.y: error recoveryã®éš›ã«lex_stateã‚’æ›´æ–°ã—ã¦ãŠãよã†ã«.
+
+Tue Oct 11 17:10:46 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * socket.c(for_fd): ファイル記述å­(Fixnum)ã‹ã‚‰ã‚½ã‚±ãƒƒãƒˆã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹
+ を得るメソッド. ãŸã¨ãˆã°inetdã‹ã‚‰èµ·å‹•ã•れãŸã‚µãƒ¼ãƒã§æ¨™æº–入出力ã«
+ ソケットæ“作を行ãªã†ãŸã‚ã«ä½¿ã†. ã¤ã¾ã‚ŠSocket.for_fd($stdin)ã§æ¨™
+ 準入力ã«å¯¾å¿œã™ã‚‹ã‚½ã‚±ãƒƒãƒˆã‚ªãƒ–ジェクトãŒå¾—られる.
+
+ * io.c(to_i): IOクラスã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’æ•´æ•°ã«å¤‰æ›ã™ã‚‹ã¨ãã®ãƒ•ァイル
+ 記述å­ã‚’è¿”ã™ã‚ˆã†ã«.
+
+ * numeric.c(num2int): to_iメソッドを使ã£ã¦ã§ãã‚‹é™ã‚Šæ•´æ•°ã«å¤‰æ›ã™ã‚‹.
+ 以å‰ã¯num2fixã ã‘ãŒå…¨ã¦ã®ã‚ªãƒ–ジェクトã«å¯¾ã—ã¦to_iメソッドをé©ç”¨
+ ã—ã¦ã„ãŸ.
+
+ * sprintf.c(Fsprintf): 整数表示ã®éš›, オブジェクトをã§ãã‚‹é™ã‚Šæ•´æ•°
+ ã«å¤‰æ›ã™ã‚‹ã‚ˆã†ã«(to_iメソッドを使ã†).
+
+Fri Oct 7 14:06:32 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(Fcaller): å¿…è¦æ€§ãŒã‚ˆã分ã‹ã‚‰ãªã„ã®ã§ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‹ã‚‰å‰Šé™¤.
+ å°†æ¥ãƒ‡ãƒãƒƒã‚¬ã‚’作る時ã«å¾©æ´»ã•ã›ã‚ˆã†.
+
+ * eval.c(rb_call): Cã§è¨˜è¿°ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã§ã¯ç’°å¢ƒã‚’スタック
+ ã«ã‚»ãƒ¼ãƒ–ã—ãªã„ã“ã¨ã«ã‚ˆã£ã¦é«˜é€ŸåŒ–.
+
+Wed Oct 5 15:00:58 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby.h: 一時env.hã«ç§»å‹•ã—ã¦ãŸQselfã®å®šç¾©ã‚’復活. ãŸã ã—今回ã¯é–¢æ•°
+ ã¨ã—ã¦å®Ÿç¾(env.hã§ã¯å¤‰æ•°ã¨ã—ã¦å†å®šç¾©ã—ã¦ã‚ã‚‹).
+
+ * ruby.h: TRUEã§syntax errorã«ãªã‚‰ãªã„よã†#undefを追加.
+
+ * eval.c(rb_eval): threadåŒ–ã«æŒ‘戦ã—ãŸãŒ, 失敗(速ããªã‚‰ãªã‹ã£ãŸ).
+ ãŒ, Scopingãªã©ã®ç„¡é§„ãªã‚³ãƒ¼ãƒ‰ã®å‰Šé™¤ã¨ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã®å¼•数セッ
+ トã®inline化ã§è‹¥å¹²ã®é«˜é€ŸåŒ–を実ç¾ã—ãŸ. 副作用ã¨ã—ã¦, argc, argvå½¢
+ å¼ã®é–¢æ•°å‘¼ã³å‡ºã—ã®ä»•様ãŒå¤‰åŒ–ã—ãŸ(argvã«selfã‚’å«ã¾ãªããªã£ãŸ).
+
+ * eval.c(rb_call): メソッド呼ã³å‡ºã—ã®é«˜é€ŸåŒ–.
+
+Tue Oct 4 11:40:53 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby-mode.el: 修飾å­ã«å¯¾å¿œã—ãŸ.
+
+ * parse.y: 多é‡ä»£å…¥ã«restã‚’ã¤ã‘ãŸ. ã“ã®æ©Ÿèƒ½ã‚’使ãˆã°optional引数ã®
+ è§£æžãŒç°¡å˜ã«ã§ãã‚‹(ã¯ãš).
+
+ * pack.c(unpack): uuencodeå½¢å¼ã®decodeã®éš›ã«æ–‡å­—列ã®é•·ã•ãŒé–“é•ã£ã¦
+ ã„ãŸ.
+
+Mon Oct 3 15:58:41 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * file.c(type): ファイルタイプを文字列ã§è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰.
+
+Fri Sep 30 11:36:07 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * object.c: デフォルトã®çœŸã®å€¤ã§ã‚ã‚‹%TRUEã®å€¤ã‚’1(Fixnum)ã‹ã‚‰tã«å¤‰
+ æ›´ã—ãŸ. to_sã§æ–‡å­—列ã«å¤‰æ›ã—ãŸæ™‚ã«ã‚‚`t'ã¨è¡¨ç¤ºã•れる. æ›´ã«è¸ã¿è¾¼
+ ã‚“ã§`t'を予約語ã«ã—ã¦lispã®ã‚ˆã†ã«ã—よã†ã‹ã¨ã‚‚æ€ã£ãŸãŒ, ãã“ã¾ã§
+ ã¯æ±ºå¿ƒã§ããªã‹ã£ãŸ. 一文字ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã¯ã‹ãªã‚Šä½¿ã„ãã†ãªæ°—ãŒã™
+ ã‚‹ã®ã§â€¦.
+
+ * array.c,dict.c: equalã‚’å†å®šç¾©ã—ã¦ã„るクラスã§, hashã‚’æ­£ã—ã定義
+ ã—ãŸ.
+
+Wed Sep 28 23:30:28 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c(Ffail): 今ã¾ã§failã¯ã‚«ãƒ¼ãƒãƒ«ã‚¯ãƒ©ã‚¹ã®ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã£ãŸãŒ,
+ æ§‹æ–‡ã«çµ„ã¿è¾¼ã‚“ã . ã“ã®å¤‰æ›´ã«ã‚ˆã£ã¦, 1)`fail'ã¯äºˆç´„語ã¨ãªã‚Š, ロー
+ カル変数ã«ç”¨ã„ã‚‹ã“ã¨ãŒã§ããªããªã£ãŸ. 2)`fail'å˜ä½“ã§ä¾‹å¤–を発生ã™
+ るよã†ã«ãªã£ãŸ. 3)failã¯ãƒ¡ã‚½ãƒƒãƒ‰ã§ã¯ãªããªã£ãŸã®ã§å†å®šç¾©ã•れるå¯
+ 能性ãŒãªããªã£ãŸ.
+
+ * dic.c, dbm.c(indexes): Arrayã®indexesã¨åŒæ§˜ã®æ©Ÿèƒ½ã‚’æŒã¤ãƒ¡ã‚½ãƒƒãƒ‰
+ を追加.
+
+ * array.c(indexes): 引数をインデックスã¨ã™ã‚‹è¦ç´ ã®é…列を返ã™. æ•´æ•°
+ ã®é…列を引数ã¨ã™ã‚‹æ™‚ã«ã¯å¼•æ•°ã®è¦ç´ ã‚’インデックスã¨ã™ã‚‹è¦ç´ ã®é…列
+ ã‚’è¿”ã™.
+
+Mon Sep 19 13:42:31 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * array.c(aset): 部分é…列ã«å¯¾ã™ã‚‹ä»£å…¥ã§é…列以外ã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆãŒæŒ‡
+ 定ã•れãŸå ´åˆã«å¤šé‡ä»£å…¥ã¨åŒã˜ãƒ«ãƒ¼ãƒ«ã§é…列化ã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * io.c(print): 引数ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸå„オブジェクトã«print_onメッセー
+ ジを与ãˆã‚‹ã‚ˆã†ã«. 実行速度ã¯è½ã¡ã‚‹ãŒæŸ”軟性ã¯å¢—ã™.
+
+Fri Sep 16 14:59:18 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * glob.c: ワイルドカードã®å°Žå…¥. bashã«ä½¿ã‚れã¦ã„ã‚‹GNUã®globルーãƒ
+ ンをæµç”¨ã—ãŸ.
+
+Mon Sep 12 18:36:58 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(value_expr): å¼ãŒnilã®æ™‚ã«å¯¾å¿œ.
+
+ * class.c: ICLASSã®classãŒå¿…ãšClass/Moduleを指ã™ã‚ˆã†ã«.
+
+Tue Sep 6 16:23:28 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * re.c: æ­£è¦è¡¨ç¾å†…ã§ã€Œ\æ•°å­—ã€å½¢å¼ãŒæŒ‡å®šã§ãるよã†ã«.
+
+ * parse.y:「do expr using var ... endã€å½¢å¼ã¯ãªããªã£ãŸ. 寂ã—ã„æ°—
+ ã‚‚ã™ã‚‹. *BACKWARD INCOMPATIBILITY*
+
+Mon Sep 5 10:59:01 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * numeric.c(next): Numericクラスã«ã‚‚nextã‚’æä¾›.
+
+ * string.c(upto): uptoã‚’æä¾›.
+
+ * range.c(each): nextを使ã£ãŸã‚¤ãƒ³ã‚¿ãƒ•ェースã‹ã‚‰uptoを使ã†ã‚ˆã†ã«å¤‰
+ æ›´ã—ãŸ. ã“ã®æ–¹ãŒä¸€ã¤ã®ãƒ¡ã‚½ãƒƒãƒ‰ã§å‡¦ç†ã‚’ã¾ã¨ã‚ã§è¡Œãªã†ã“ã¨ãŒã§ãã‚‹.
+
+Fri Sep 2 15:25:39 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * dict.c(each): 戻り値を[key, value]ã®ãƒšã‚¢ã«å¤‰æ›´. 今ã¾ã§ã®eachã¯
+ each_valueã¨ã—ã¦æ®‹ã‚‹. *BACKWARD INCOMPATIBILITY*
+
+Thu Sep 1 10:49:04 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * æˆåŠŸã—ãŸ(ç‰¹åˆ¥ãªæˆ»ã‚Šå€¤ã‚’æŒãŸãªã„)システムコールã¯`0'ã‚’è¿”ã™ã‚ˆã†ã«.
+
+Wed Aug 31 00:26:51 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * string.c: ãƒã‚§ãƒƒã‚¯ã‚µãƒ ã‚’得るメソッド`sum'を作ã£ãŸ.
+
+ * class.c(include_class_new): ICLASSã®classã‚’ã‚‚ã¨ã®ã‚¯ãƒ©ã‚¹ã«ã—ãŸ.
+ gcã®éš›ã«å…ƒã‚¯ãƒ©ã‚¹ã‚’マークã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã®ãŒ, フィールドを増やã™ä½™
+ 地ãŒç„¡ã„ã®ã§, classフィールドをæµç”¨ã—ãŸ. ç§ã®è¦‹ç©ã‚ŠãŒé–“é•ã£ã¦ã„
+ ã¦, ICLASSã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã«ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’é€ã‚‹äº‹ãŒã‚れã°, ãŠã‹ã—ãªå‹•
+ 作をã™ã‚‹ã ã‚ã†.
+
+ * eval.c(masign): å¼(a,b = nil)ã®å€¤ã‚’[nil]ã‹ã‚‰nilã«å¤‰æ›´ã—ãŸ.
+
+Mon Aug 29 11:56:09 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * class.c: rb_define_mfuncã‚’ç„¡ãã—ã¦, メタクラスã«ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’イン
+ クルードã™ã‚‹ã‚ˆã†ã«ã—ãŸ.
+
+ * error.c(yyerror): åŒã˜è¡Œã§è¤‡æ•°ã®syntax errorをリãƒãƒ¼ãƒˆã—ãªã„よã†
+ ã«ã—ãŸ.
+
+ * file.c: FileTestモジュールã«ãƒ•ァイルテストメソッドを分離ã—ãŸ.
+
+ * parse.y: 演算å­ã‚’指定ã™ã‚‹æ™‚ã®lex_stateã‚’æ­£ã—ã設定ã—ãŸ.
+
+Sat Aug 27 01:23:34 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y: if/whileãªã©ã®è¤‡åˆå¼ã‚’primaryã«ç§»å‹•ã—ãŸ. ã“れã«ã‚ˆã£ã¦ä¾‹
+ ãˆã°ã€Œif cond then a else b end.message()ã€ã®ã‚ˆã†ãªå¼ãŒæ›¸ã‘るよ
+ ã†ã«ãªã£ãŸ.
+
+Fri Aug 26 10:46:30 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * spec: æ•´ç†ã•ã‚ŒãŸæ–‡æ³•ã«ã—ãŸãŒã£ã¦æ›¸ãç›´ã—ãŸ.
+
+ * parse.y: ã“ã“æ•°æ—¥ã§æ··ä¹±ã—ã¦ã„ãŸæ–‡æ³•ã‚’æ•´ç†ã—ãŸ. 括弧をçœç•¥ã—ãŸãƒ¡
+ ソッド呼ã³å‡ºã—ãŒã§ãるよã†ã«ãªã£ãŸã“ã¨, modifierãŒä»˜ã‘られるよã†
+ ã«ãªã£ãŸã“ã¨, returnã«ãƒªã‚¹ãƒˆãŒæ¸¡ã›ã‚‹ã‚ˆã†ã«ãªã£ãŸã“ã¨ãŒä¸»ãªå¤‰æ›´ç‚¹
+ ã§ã‚ã‚‹.
+
+ * processå‘¨ã‚ŠãŒæ€ªã—ã„ãŒã¨ã«ã‹ãSolaris 2.3ã§å‹•ãよã†ã«.
+
+ * parse.y: 曖昧性ãŒãªã„å ´åˆã«ã¯ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã®å¼•æ•°ã®æ‹¬å¼§ã‚’çœç•¥
+ ã§ãるよã†ã«. çœç•¥ã§ãるメソッド呼ã³å‡ºã—ã®æ¡ä»¶ã¯, 1)ã‹ãªã‚‰ãš1個
+ 以上ã®å¼•æ•°ã‚’å¿…è¦ã¨ã™ã‚‹ã“ã¨, 2)第1引数ãŒ`+', `-', `(', `[', `{',
+ `/'ãªã©, å¼ã®å§‹ã¾ã‚Šã«ç½®ã‹ã‚ŒãŸæ™‚ã¨é€”中ã«ç¾ã‚ŒãŸæ™‚ã¨ã§è§£é‡ˆãŒé•ã†è¨˜
+ å·ã§å§‹ã¾ã‚‰ãªã„ã“ã¨, ã§ã‚ã‚‹.
+
+Thu Aug 25 13:54:58 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(cond): æ¡ä»¶å¼ã®å±•開部ã«bugãŒã‚ã£ãŸ.
+
+Wed Aug 24 00:01:15 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y: returnã¯ã‚³ãƒ³ãƒžã§åŒºåˆ‡ã£ãŸãƒªã‚¹ãƒˆã‚‚å—ã‘å–るよã†ã«. ã¤ã¾ã‚Š,
+ return a, b, cã¯return [a, b, c]ã¨åŒã˜æ„味ã«ãªã‚‹.
+
+ * parse.y: yield以外ã®å¤§åŸŸè„±å‡ºåˆ¶å¾¡å¼ã‚’exprã‹ã‚‰expr0ã«ç§»ã—ãŸ. よã£
+ ã¦ãƒ¡ã‚½ãƒƒãƒ‰ã®å¼•æ•°ã«åˆ¶å¾¡å¼ã‚’使ãˆãªããªã‚‹(ã“れã§å›°ã‚‹äººã¯ã„ãªã„ã¯ãš).
+
+ * parse.y: `+'ã®å®šæ•°å±•é–‹ã®éš›ã«æ¼”ç®—å­ã®å„ªå…ˆé †ä½ã‚’忘れã¦ã„ãŸ.
+
+ * eval.c: untilã®æˆ»ã‚Šå€¤ã¯nilã«ãªã£ãŸ.
+
+ * parse.y: modifierã¨ã—ã¦ã®if/unless/while/untilを追加.
+
+ * parse.y: 文法ã‹ã‚‰endã®å¾Œã‚ã«ã¤ã‘るキーワードを削除. ã»ã¨ã‚“ã©ä½¿ã‚
+ ãªã‹ã£ãŸä¸Šã«, emacsã§ã¯ruby-modeãŒã‚れã°å¯¾å¿œã®ãƒã‚§ãƒƒã‚¯ãŒæ©Ÿæ¢°çš„ã«
+ 出æ¥ã‚‹ãŸã‚.
+
+Tue Aug 23 18:08:33 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: スクリプト実行開始å‰ã«ä¾‹å¤–ãŒç™ºç”Ÿã—ãŸæ™‚ã«core dumpã—ãŸ.
+ 組ã¿è¾¼ã¿ç”¨ã«ã‚³ãƒ¼ãƒ‰ã‚’変更ã—ãŸæ™‚ã«enbugã—ã¦ã—ã¾ã£ãŸ.
+
+Tue Aug 23 00:07:17 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c: doã®æˆ»ã‚Šå€¤ãŒã„ã¤ã‚‚nilã«ãªã£ã¦ã„ãŸ.
+
+ * parse.y: loop制御変数ã®å¤šé‡ä»£å…¥åŒ–ã«bugãŒã‚ã£ãŸ.
+
+ * parse.y(expand_op): 文字列も畳ã¿è¾¼ã¿ã®å¯¾è±¡ã«.
+
+Mon Aug 22 10:50:01 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(expand_op): `+'ã«é–¢ã—ã¦ã¯çµåˆå‰‡ã‚’使ã£ã¦, より多ã定数畳
+ ã¿è¾¼ã¿ã‚’行ãªã†ã‚ˆã†ã«.
+
+ * ruby.c(proc_options): argcãŒ0ã®æ™‚ã«ã‚‚対応.
+
+ * parse.y: forãªã©ã®åˆ¶å¾¡å¤‰æ•°ã«å¤šé‡ä»£å…¥ã‚‚使ãˆã‚‹ã‚ˆã†ã«.
+
+Sat Aug 20 00:59:40 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y(call_op): 演算å­`~'ã®å–り扱ã„をルール部ã¸ç§»å‹•.
+
+Fri Aug 19 11:44:13 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * main.c: rubyã‚’ã»ã‹ã®ãƒ—ログラムã«çµ„ã¿è¾¼ã‚るよã†ã«main()を分割ã—ãŸ.
+ ãれã«ã¨ã‚‚ãªã„, プログラムã®å‘¼ã³å‡ºã—構造を修正ã—ãŸ.
+
+ * parse.y: æ¡ä»¶å¼ã®å®šç¾©ã‚’変更. ifãªã©ã®æ¡ä»¶å¼ã®ä¸­ã§ã ã‘`&&'ã‚„`||'
+ ãŠã‚ˆã³`!'ã®å¼•æ•°ãŒæ¡ä»¶å¼ã«ãªã‚‹ã‚ˆã†ã«. ã“ã®å¤‰æ›´ã«ã‚ˆã‚Šæ¡ä»¶å¼ä»¥å¤–ã®
+ 場所ã§ã® `&&', `||', `!'演算å­ã®å‹•作ãŒç›´è¦³ã«ä¸€è‡´ã™ã‚‹.
+
+ * parse.y: 実引数ã®`*'ã®å¾Œã«ç¶šã引数ã¯exprã«åˆ¶é™ã—ãŸ. 今ã¾ã§ã¯å…¨ã¦
+ ã®æ–‡ãŒæœ‰åй
diff --git a/doc/ChangeLog-0.60_to_1.1 b/doc/ChangeLog-0.60_to_1.1
new file mode 100644
index 0000000000..33b0326892
--- /dev/null
+++ b/doc/ChangeLog-0.60_to_1.1
@@ -0,0 +1,3955 @@
+Tue Aug 12 16:02:18 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * variable.c: option variables: $-0, $-p(readonly), $-v,
+ $-I(load_path), $-a(readonly), $-K, $-d, $-F, $-i, $-l.
+
+ * parse.y (yylex): ignore rd (ruby document) in the code.
+
+Mon Aug 11 12:37:58 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * re.c (Init_Regexp): $-K as alias to the $KCODE.
+
+ * io.c (Init_IO): new virtual variable $-i for the value of -i
+ option.
+
+ * enum.c (Init_Enumerable): include? as alias of member?
+
+Fri Aug 8 11:16:50 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * io.c (io_foreach): now the record separator can be specified.
+
+ * io.c (io_s_readlines): new method to read in whole file (or
+ command output) from path.
+
+ * ext/socket/socket.c (Init_socket): recvfrom did not work.
+
+ * ext/socket/socket.c (sock_send): forgot to check nil for false
+ value.
+
+Thu Aug 7 11:40:01 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * variable.c (mod_constants): lists constants defiend in the
+ modules/classes.
+
+ * variable.c (rb_const_set): no longer warns about constant
+ overriding by subclasses.
+
+ * eval.c (mod_eval): does eval() on module's context. local
+ variables are shared with outer scope.
+
+ * object.c (Init_Object): remove private_attr/public_attr.
+
+Wed Aug 6 14:21:36 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * object.c (mod_attr): forgot to check nil for false value.
+
+Mon Aug 4 11:50:28 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * object.c (class_s_new): need not to specify names to create
+ classes (or modules) dynamically.
+
+ * variable.c (rb_class_path): scan class constants for anonymous
+ classes/modules to make up pathes.
+
+Wed Jul 30 08:45:12 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * eval.c (rb_eval): stop to cache const value in nodes.
+
+Sat Jul 26 03:17:22 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * numeric.c (flo_to_s): wrong .0 at end.
+
+Sat Jul 26 00:36:36 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * eval.c (error_print): always print exception type in the
+ toplevel exception handler.
+
+ * string.c (str_hash): wrong hash value.
+
+Thu Jul 24 11:05:51 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * string.c (uscore_get): proper error message for unset $_.
+
+Wed Jul 23 09:56:55 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (obj_methods): returns list of method names of the
+ specified object.
+
+ * class.c (mod_instance_methods): returns list of method names of
+ the class instnace.
+
+Fri Jul 11 22:38:55 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (class_superclass): returns class's superclass
+ itself. (1.1)
+
+ * object.c (obj_type): returns object's class itself. (1.1)
+
+ * class.c (mod_included_modules): list included modules.
+
+ * object.c (class_superclass): raises error for Object.
+
+Thu Jul 3 09:54:02 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (SETUP_ARGS): save source position, remove nd_line().
+
+ * eval.c (rb_call): replace modulo by bit-masking.
+
+ * eval.c (POP_SCOPE): force recycle scope object to reduce gc rate.
+
+ * gc.c (obj_free): aboid calling run_final() when no finalizer is set.
+
+ * eval.c (PUSH_VARS): do not allocate the dynamic scope's end-mark
+ object.
+
+Wed Jul 2 14:25:07 1997 KIMURA Koichi <kkimura@pure.cpdc.canon.co.jp>
+
+ * Native mswin32 support.
+
+Tue Jul 1 09:59:00 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970701
+
+ * parse.y (mrhs): allow rest-star(*) in right hand side.
+
+Tue Jun 24 19:04:31 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970624
+
+Sat Jun 20 22:22:51 1997 Michio "Karl" Jinbo <karl@marcer.nagaokaut.ac.jp>
+
+ * eval.c: freebsd 3.0 <sys/select.h> support.
+
+Fri Jun 20 01:24:45 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970620
+
+ * gc.c: eliminate uninitilalized field of Hash, Array etc., to
+ avoid dumping core.
+
+Thu Jun 19 01:29:44 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970619
+
+ * string.c (str_split_method): wrong limit.
+
+Sat Jun 14 01:54:16 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * class.c (rb_singleton_class): no singleton for special
+ constants (now raises exception).
+
+ * eval.c (ruby_init): cbase in TOPLEVEL_BINDING need to be
+ initialized.
+
+Sat Jun 14 01:01:16 1997 maeda shugo <shugo@po.aianet.ne.jp>
+
+ * array.c (sort_2): wrong comparison.
+
+Sat Jun 14 00:53:44 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * hash.c (hash_foreach): safe iteration.
+
+Fri Jun 13 14:04:56 1997 Michio "Karl" Jinbo <karl@marcer.nagaokaut.ac.jp>
+
+ * configure.in: -Bshareable option for netbsd.
+
+Fri Jun 13 01:16:22 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * io.c (pipe_open): call io_unbuffered() only for writable pipes.
+
+Thu Jun 12 01:14:15 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970612
+
+ * ext/socket/socket.c (sock_new): use io_unbuffered().
+
+ * ext/marshal/marshal.c (w_long): compact long format, which
+ supports 64 bit architectures (unless longs are >32 bit size).
+
+ * ext/marshal/marshal.c: allows recursive data for marshaling.
+
+ * parse.y (rb_intern): raise exception for non-internable string.
+
+ * ext/marshal/marshal.c (marshal_load): allows direct loading from
+ strings.
+
+ * ext/marshal/marshal.c (marshal_dump): allows direct dump to strings.
+
+ * ext/marshal/marshal.c (marshal_dump): interface changed.
+
+Wed Jun 11 18:26:00 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * gc.c (rb_newobj): remove needless memset().
+
+Mon Jun 9 13:03:43 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): reduce condition checks from while/until loop.
+
+ * eval.c (rb_eval): wrong jump point for `next'.
+
+Fri Jun 6 11:47:39 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.c (ruby_set_argv): initialize dln_argv0 for dln_a_out.
+
+ * ext/socket/socket.c (open_unix): display path name for exceptions.
+
+ * ruby.c (proc_options): option -S did not work well.
+
+Fri May 30 02:14:44 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970530
+
+ * eval.c (eval): set $! properly if exception raised in eval().
+
+ * io.c (io_write): now handles non T_FILE object.
+
+ * io.c (io_defset): $< can be anything which has `write' method.
+
+Thu May 29 15:40:22 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (eval): $@ is always an array (not string).
+
+ * pack.c (pack_unpack): avoid corrupting memory for unexpected
+ input strings.
+
+Wed May 28 12:46:13 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970528
+
+ * process.c (rb_waitpid): do not block other threads.
+
+Tue May 27 12:02:31 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (ruby_init): split initialize and processing command line
+ options.
+
+ * ruby.c (ruby_options): ruby_init(0, 0, envp) dumps core.
+
+Tue May 20 18:59:45 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * variable.c (rb_ivar_set): invalid instance variable access for
+ built-in object raises TypeError.
+
+Fri May 16 17:32:21 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970516
+
+ * dir.c (push_globs): was freeing non heap pointer.
+
+ * gc.c: remove some duplicated prototypes.
+
+ * ext/kconv/kconv.c: fix prototypes.
+
+Fri May 9 11:38:59 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970509
+
+ * gc.c (obj_free): avoid free(NULL).
+
+ * eval.c (rb_check_safe_str): argument missing for TypeError().
+
+Thu May 8 01:14:28 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (file_s_dirname): need to return "." for path without
+ slashes.
+
+Wed May 7 19:18:48 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * process.c (f_fork): child processe does not inherit parent's
+ itimer setting on linux. call setitimer() again in the child
+ process.
+
+Sat May 3 02:49:43 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/curses/curses.c: modified for portability and add to the
+ standard distribution.
+
+Wed Apr 30 00:34:00 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (file_s_size): returns 0 for empty files (not FALSE).
+
+Fri Apr 25 02:17:50 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970425
+
+ * eval.c (f_load): free unused name-table.
+
+ * eval.c (f_load): copy local variable name-table.
+
+ * gc.c (obj_free): avoid free(NULL).
+
+ * eval.c (rb_eval): forgot to make link from the scope object to
+ NODE_SCOPE. It may crash the interpreter.
+
+Thu Apr 24 00:35:09 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * random.c (f_srand): save old seed anyway. srand() returns no
+ value on some systems.
+
+ * gc.c (obj_free): avoid double free of the local variable name
+ table.
+
+ * parse.y (top_local_setup): modify realloc to handle offset.
+
+Tue Apr 22 12:58:26 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970422
+
+Thu Apr 17 00:40:51 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * configure.in (rb_cv_bsdpgrp): proper check for BSD
+ setpgrp/setpgrp.
+
+Wed Apr 16 16:14:02 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (proc_call): proc called in other thread must be orphan.
+
+Tue Apr 15 10:46:31 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970415
+
+ * gc.c (obj_free): NODE_SCOPE marked from SCOPE object.
+
+ * gc.c (gc_mark): some nodes marked wrong.
+
+ * process.c (proc_getpgrp): wrong argument
+
+Fri Apr 14 18:32:42 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970414
+
+Fri Apr 12 01:20:12 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.h: String pointer changed to unsigned char.
+
+Fri Apr 11 10:27:29 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970411
+
+ * Makefile.in: create libruby.a before linking ruby.
+
+ * string.c (str_strip_bang): >0x80 characters for isspace().
+
+ * eval.c (proc_call): set safe-level temporally
+
+ * eval.c (proc_s_new): save safe-level in the proc context.
+
+ * eval.c (rb_eval): no class/module extension in safe mode.
+
+Thu Apr 10 02:10:41 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * gc.c (gc_mark): remove some pointer checks for speeding up.
+
+ * ruby.c (ruby_options): set $0 temporally for -r option.
+
+ * eval.c: built-in security feature.
+
+ * gc.c (gc_sweep): do not free nodes during compile.
+
+ * parse.y (yycompile): set flag when compiling.
+
+Wed Apr 9 10:19:02 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.c: forgot to include <ctype.h> for isspace().
+
+ * file.c: provide S_ISREG for some platforms.
+
+ * io.c (Init_IO): added some $< operations.
+
+ * lib/ping.rb: check host upness using TCP echo.
+
+Tue Apr 8 00:10:15 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (arg_read): bug with 0 length input.
+
+Mon Apr 7 11:36:16 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/fcntl/fcntl.c: module for fcntl constants.
+
+ * eval.c (rb_alias): bug when original was an alias.
+
+ * parse.y (primary): syntax to access singleton class.
+
+ * eval.c (mod_public_method): method's to specify visibitily of
+ the class methods. make_method_{public,private} removed.
+
+Fri Apr 4 21:43:57 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970404
+
+ * gc.c (obj_free): finalizer added for experiment.
+
+Thu Apr 3 02:12:31 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_schedule): make Fatal rise on main_thread on
+ deadlocks.
+
+ * eval.c (thread_join): raise ThreadError instead of Fatal, in
+ case of deadlock.
+
+ * regex.c (re_compile_fastmap): uninitialized local variable.
+
+ * parse.y (parse_regx): new option //[nes] to specify character
+ code for regexp literals. Last specified code option is valid.
+
+ * re.c (reg_s_new): additional 3rd argument to specify compiled
+ regexp's character code.
+
+ * re.c (reg_new_1): regexp character code can be specified for
+ each regexp object.
+
+Wed Apr 2 14:51:06 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_create): handle uncaught throw.
+
+ * eval.c (thread_create): halt on some deadlock conditions.
+
+ * regex.c (is_in_list): wrong result for non-mbc higher-byte
+ characters.
+
+ * regex.c (re_match): wrong skip for multi-byte characters.
+
+ * regex.c (re_compile_fastmap): wrong fastmap in non-mbc mode.
+
+ * hash.c (Init_Hash): hash compatible features added to ENV.
+
+Tue Apr 1 15:24:06 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (obj_extend): remove Object#extend as an iterator which
+ is in experimental state, since it unveils internal singleton
+ classes.
+
+Mon Mar 31 14:29:39 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970331
+
+Sun Mar 30 19:40:57 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * parse.y (terms): avoided win32 gcc's optimization bug.
+
+Sat Mar 29 11:21:58 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * struct.c (make_struct): St[val,..] creates new structure.
+
+Fri Mar 28 11:24:51 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (obj_make_private): new method make_method_{public,private}
+ to change visibility of singleton methods.
+
+ * regex.c (re_compile_pattern): enables numeric literal >= 0x80 in
+ the character class.
+
+ * regex.c (re_compile_pattern): enabled numeric literal >= 0x80,
+ in multibyte mode.
+
+ * regex.c (re_compile_fastmap): modified exantn and charset(_not)
+ to set fastmap for higher bytes properly.
+
+ * regex.c (is_in_list): now matches numeric literals.
+
+Thu Mar 27 13:34:20 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * pack.c (pack_unpack): extra null byte after unpacked string.
+
+Wed Mar 26 15:20:34 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * regex.c (re_compile_pattern): register numbers must be fit in a
+ byte (0 <= regnum <= 0xff).
+
+ * regex.c (re_compile_fastmap): forgot to set mbchar map for
+ charset_not if RE_MBCTYPE is on.
+
+ * regex.c (re_compile_pattern): set list bits for multi-byte
+ characters for \W, \S, \D in range expression.
+
+ * object.c (obj_is_kind_of): defined that nil itself is kind of
+ nil. TRUE is kind of TRUE, FALSE is kind of FALSE likewise.
+ This change makes `obj.kind_of?(eval(obj.type))' always true.
+
+Tue Mar 25 14:08:43 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * lib/English.rb: provides nicer English alias for the variables.
+
+ * parse.y (expr): alias $var1 $var2 makes alias of the global
+ variable.
+
+Mon Mar 24 18:23:20 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970324
+
+Thu Mar 20 22:04:59 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (mod_modfunc): forget to clear method cache.
+
+Wed Mar 19 17:06:55 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (program): set methods' default private/public status
+ correctly under eval().
+
+ * eval.c (eval): set the_class correctly while evaluating string.
+
+Tue Mar 18 12:23:53 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (eval): yield can be called from eval().
+
+ * version 1.0-970318
+
+ * parse.y (program): regexp in condition expression should do
+ matching operation with $_.
+
+ * re.c (reg_regsub): wrong substitution.
+
+Fri Mar 14 14:36:28 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * hash.c (hash_invert): returns value to key mapping of the
+ associative array.
+
+ * ext/socket/extconf.rb: set environment variable SOCKS_SERVER to
+ compile with libsocks.a.
+
+ * ext/socket/socket.c (socks_s_open): SOCKSsocket class to access
+ internet via SOCKS library.
+
+ * sprintf.c (f_sprintf): unsigned formats display leading double
+ dots for imaginary sequence of signed bit to the left.
+
+ * sprintf.c (f_sprintf): correct width and precision formatting
+ for big integers.
+
+ * parse.y (yylex): enables negative hex/octal numbers and `_' in
+ non-decimal numbers.
+
+ * sprintf.c (f_sprintf): %u added for unsigned decimal format.
+
+Thu Mar 13 10:24:27 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sprintf.c (f_sprintf): wrong output for bignums.
+
+ * array.c (ary_reverse_each): iterates in reverse order.
+
+ * pack.c (pack_unpack): L unpacked signed long.
+
+ * io.c (f_backquote): now returns an empty string for no output.
+
+Wed Mar 12 10:20:30 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/socks/socks.c: socket module with socks library.
+
+Mon Mar 10 20:44:22 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * re.c (reg_regsub): \& for substitution. \`, \', and \+ are
+ avaiable also.
+
+Thu Mar 6 01:47:03 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970306
+
+ * sample/rubydb.el (gud): ruby debugger emacs interface
+
+ * lib/debug.rb: ruby debugger
+
+ * parse.y (exprs): more accurate line number display.
+
+Wed Mar 5 21:31:46 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970305
+
+Tue Mar 4 12:28:32 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.c (proc_options): search through RUBYPATH and PATH for
+ option -S.
+
+Mon Mar 3 22:44:55 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_status): returns nil for exception terminated
+ threads.
+
+ * eval.c (thread_value): re-raise exceptions.
+
+Sat Mar 1 00:59:47 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): restore $! value after rescue clause, to
+ re-raise exceptions correctly.
+
+Fri Feb 28 16:43:38 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970228
+
+Thu Feb 27 11:23:41 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_yield_0): redo raises exception
+
+ * eval.c (thread_schedule): bug in interrupt handling by rescue.
+
+Wed Feb 26 00:55:36 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (eval): forgot to restore dynamic local variable
+ bindings.
+
+Tue Feb 25 11:22:08 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/aix_ld.rb: AIX dynamic load support (not tested).
+
+ * eval.c (rb_eval): wrong return value for defined? super.
+
+ * error.c (exception): more error check.
+
+ * re.c (reg_regsub): wrong substitution when sub expanded to null
+ string.
+
+Fri Feb 21 13:01:47 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970221
+
+ * eval.c (f_require): volatile added. register variable was
+ recycled, so that GC did not mark that variable.
+
+ * object.c (Init_Object): forget to mark main object (was mostly
+ ok, but made trouble with early GC.)
+
+Thu Feb 20 11:50:50 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970220
+
+Thu Feb 20 11:25:50 1997 Yasuo OHBA <jammy@shljapan.co.jp>
+
+ * lib/date.rb: update
+
+Thu Feb 20 08:25:57 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (yylex): forgot tokfix() before rb_intern().
+
+ * lib/tk.rb (TkVariable): give up using trace_var.
+
+Wed Feb 19 00:24:35 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970219
+
+ * pack.c (pack_pack): packed by null for A specifier. must be
+ space filled.
+
+ * pack.c (pack_unpack): bug in skipping spaces
+
+ * gc.c (xmalloc): garbage collect for every 4 Meg. allocation.
+
+ * string.c (str_split_method): limit worked wrong way.
+
+ * io.c (io_gets_method): misunderstand 0xff in binary files when
+ $/ == nil.
+
+ * re.c (reg_regsub): re-implement.
+
+ * ext/socket/socket.c (thread_connect): remove O_NONBLOCK, which
+ is not defined on some platform like NeXT.
+
+Mon Feb 17 13:08:30 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970217
+
+ * object.c (mod_eqq): === extended for subclass check (to use case
+ as typecase).
+
+Sat Feb 15 02:07:22 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * regex.c (re_compile_pattern): wrong match backref at end of pattern.
+
+ * io.c (arg_read): now works beyond end of file.
+
+Thu Feb 13 16:21:24 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (expr): return/yield now accept normal argument format.
+
+ * parse.y (yylex): a star in `yield *x' must not be multiplication
+ operator.
+
+Wed Feb 12 15:06:44 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * time.c (time_plus): bug in simple addition.
+
+ * eval.c (thread_raise): raise exceptions from outside.
+
+ * eval.c (Init_Thread): Thread#alive? -- alias for Thread#status.
+
+Mon Feb 10 00:38:55 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.h (Data_Make_Struct): rename macros.
+
+Sun Feb 8 11:48:13 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (f_syscall): argument offset was wrong.
+
+Fri Feb 7 18:01:17 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970207
+
+ * eval.c: add volatiles to avoid variable crobbering by longjmp().
+
+ * eval.c (f_raise): 1st argument can be the GlobalExit object now.
+
+ * array.c (ary_unshift): no longer accept more than 2 args.
+
+ * eval.c (f_raise): bug if 2nd argument is the exception.
+
+Tue Feb 4 00:37:29 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970204
+
+ * eval.c (eval): check compile errors by nerrs.
+
+ * eval.c (rb_eval): check syntax error by nerrs, not by the return
+ value, which may be NULL.
+
+ * eval.c (compile): Do not clear errinfo.
+
+Mon Feb 3 10:13:06 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (obj_extend): move real inclusion to Module#extend_object
+ to allow redfinition.
+
+ * object.c (Init_Object): Kernel class is now Module. Object class
+ became the true root class.
+
+ * object.c (obj_inspect): remove useless buffer.
+
+ * hash.c (any_cmp): disable interrupts and context switching.
+
+ * st.c: remove ALLOW_INTS to disable interrupt during operations.
+
+Fri Jan 31 22:10:08 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * hash.c (hash_rehash): re-register all key-value.
+
+Thu Jan 30 02:14:49 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (io_reopen): re-implement according to clone() way.
+
+ * io.c (io_clone): copy IO object.
+
+ * struct.c (struct_eql): compare elements by eql?.
+
+ * io.c (io_mode_flags): detect "rb", "wb" etc.
+
+ * io.h (FMODE_BINMODE): added.
+
+ * ext/socket/socket.c (Init_socket): undef BasicSocket.new
+
+ * file.c (Init_File): File.new(path[,mode])
+
+ * io.c (Init_IO): IO.new(fd[,mode])
+
+ * eval.c (rb_method_boundp): forgot to enable priv argument.
+
+ * object.c (Init_Object): remove `=~' from Kernel class.
+
+ * ext/socket/socket.c (open_inet): initialize sockaddr before
+ calling bind(2).
+
+ * sample/ruby-mode.el (ruby-calculate-indent): skip comment lines
+
+Wed Jan 29 18:43:22 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (Init_Thread): DEFER_INTS during initializing threads.
+
+ * hash.c (Init_Hash): Hash#eql? checks for object identity.
+
+ * eval.c (thread_set_critical): wrong value assigned.
+
+Mon Jan 27 16:10:51 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (io_print): remove print_on().
+
+ * eval.c (f_missing): proper error message for undefined method
+ without argument
+
+Sat Jan 25 23:32:32 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_sub_s): false alert - sub() does not modify string.
+
+ * array.c (ary_times): negative multiplication detected
+
+ * string.c (str_times): negative multiplication detected
+
+Fri Jan 24 10:51:39 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * time.c (time_arg): month -> 0 == "jan" == "1" == "01", little bit
+ confusing but wanted to conform japanese style.
+
+ * version 1.0-970124
+
+Fri Jan 24 09:52:49 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * util.c (_fixpath): supports SJIS filenames on DJGPP.
+
+Thu Jan 23 16:52:06 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * README.EXT: update. partially translated into English.
+
+ * ext/extmk.rb.in: inherit $LDFLAGS to the final link.
+
+ * ext/socket/socket.c (Init_socket): add various constants.
+
+Mon Jan 23 11:40:59 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * eval.c (Init_Thread): allocate main_thread first to avoid crash.
+
+Thu Jan 23 02:09:26 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * gc.c (ObjectSpace): API modified. each_object method will do all
+ the iteration.
+
+ * eval.c (proc_call): wrong return from nested lambda.
+
+ * ext/GD/GD.c: debugged.
+
+Wed Jan 22 16:12:25 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970122
+
+ * gc.c (gc_mark): forgot to mark match->str.
+
+ * ext/GD/GD.c: GD interface module.
+
+ * eval.c (PUSH_BLOCK): wrong value pushed as the block level.
+
+Mon Jan 20 14:01:31 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_run): no context switch in the critical section.
+
+Mon Jan 20 09:40:59 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * utils.c: supports 8+3 filenames
+
+Sat Jan 18 01:23:03 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970118
+
+ * regex.c (PATFETCH): need cast to unsigned char.
+
+ * io.c (io_ctl): bug in case when arg is not a string.
+
+ * lib/tk.rb: forgot that Kernel#type returns the class name now.
+
+ * regex.c (re_search): "abc\n" =~ "^$" should not match.
+
+Fri Jan 17 12:31:37 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970117
+
+ * ruby.c (ruby_options): constant PLATFORM, which is in the {cpu}-{os}
+ form, defined.
+
+ * configure.in: platform information embedded in the interpreter.
+
+ * regex.c (re_search): /^$/ did not match to "" by wrong exit condition.
+
+ * lib/thread.rb: re-write Mutex/Queue based on Thread.critical.
+
+ * eval.c (thread_set_critical): remove Thread.exclusive, add
+ Thread.critical = TRUE/FALSE instead.
+
+ * re.c (reg_search): re-compile pattern if needed
+
+ * regex.c (PATFETCH): do translate at compile time
+
+Thu Jan 16 00:49:10 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * gc.c (gc_mark_frame): forgot to mark frame->cbase.
+
+ * regex.c (re_compile_pattern): /a$|b)/ causes error.
+
+ * regex.c (re_compile_pattern): /(^|b)/ causes error.
+
+ * version 1.0-970116
+
+ * re.c (Init_Regexp): set RE_CONTEXTUAL_INVALID_OPS flag.
+
+Tue Jan 14 02:09:06 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (proc_call): Proc#callをイテレータã¨ã—ã¦å‘¼ã‚“ã æ™‚ã«å¯¾å¿œ
+
+ * configure.in: nextstep対応?
+
+ * eval.c (rb_eval): a[b]=cã§ç„¡é§„ãªé…列を割り当ã¦ãªã„
+
+ * eval.c (f_send): イテレータã¨ã—ã¦å‘¼ã°ã‚ŒãŸã‚‰ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã¨ã—ã¦ãƒ¡ã‚½ãƒƒ
+ ドを呼ã¶ï¼Ž
+
+ * string.c (str_new4): match共有用ã®ç”Ÿæˆé–¢æ•°
+
+ * re.c (reg_search): matchã®å®Ÿä½“(文字列)をマッãƒã‚’行ã£ãŸæ–‡å­—列ã¨
+ copy-on-writeã§å…±æœ‰
+
+ * string.c (str_hash): toupperã‚’ã‹ã‘ã‚‹æ¡ä»¶ãŒé•ã£ã¦ã„ãŸ
+
+ * array.c (sort_2): Fixnumã¨Stringを特別扱ã„ã—ã¦é«˜é€ŸåŒ–
+
+Mon Jan 13 11:03:53 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_create): threadãŒç”Ÿæˆã•れるã¾ã§å‰²è¾¼ã¿ã‚’設定ã—ãªã„
+
+ * eval.c (Init_Thread): 割込ã¿ã‚¿ã‚¤ãƒŸãƒ³ã‚°ã‚’100msecã«
+
+Sat Jan 11 00:17:05 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * regex.c (re_search): マッãƒã«å¤±æ•—ã™ã‚‹å ´åˆãŒã‚ã£ãŸ(本当ã«ç›´ã£ãŸã‹ï¼Ÿ)
+
+ * io.c (io_ioctl,io_fcntl): 第2引数をçœç•¥å¯èƒ½ã«
+
+ * io.c (io_ioctl,io_fcntl): 戻り値ãŒIOã ã£ãŸï¼Žæ•´æ•°(システムコール
+ ã®æˆ»ã‚Šå€¤)ã‚’è¿”ã™ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * io.c (io_ctl): å¼•æ•°ãŒæ•´æ•°ã®æ™‚ã«å¯¾å¿œ
+
+ * io.c (io_fcntl): file.cã‹ã‚‰ç§»å‹•
+
+Fri Jan 10 17:01:47 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-970110
+
+ * ext/socket/socket.c (thread_connect): open(connect(2))ã§ä»–ã®
+ threadをブロックã—ãªã„よã†ã«
+
+ * eval.c (thread_create): exitã§ãªã„ã¨ãã«exitã ã¨æ€ã„込む
+
+Mon Jan 6 17:42:22 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_sub_s): 文字列長より長ã„offsetã®æ¤œå‡º
+
+ * regex.c (re_search): 空ã«ãƒžãƒƒãƒã™ã‚‹ãƒ‘ターン後ã®$ã§å¤±æ•—
+
+Thu Jan 2 16:36:23 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (file_reopen): Fileã®reopen(pathã¾ãŸã¯IOã§æŒ‡å®š).
+
+ * io.c (io_reopen): IOã®reopen(IOã§æŒ‡å®š) -- change classã¤ã
+
+Wed Jan 1 11:09:01 1997 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (f_select): timeoutã§nilã‚’è¿”ã™
+
+Fri Dec 27 13:06:44 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (file_s_open): サブクラスã§ã¯ãã®ã‚¯ãƒ©ã‚¹ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’è¿”
+ ã™ã‚ˆã†ã«ï¼Ž
+
+Fri Dec 27 08:58:27 1996 <ono@isl.nara.sharp.co.jp>
+
+ * numeric.c (flo_to_s): index()を使ã‚ãªã„.strstr()ã«ï¼Ž
+
+Thu Dec 26 01:34:17 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * lib/tk.rb: placeãŒä½¿ãˆã‚‹ã‚ˆã†ã«
+
+ * pack.c (endian): マクロDYNAMIC_ENDIANを指定ã™ã‚‹ã¨å®Ÿè¡Œæ™‚ã«endian
+ を判定ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * eval.c (thread_alloc): åˆæœŸåŒ–忘れã®ãƒ¡ãƒ³ãƒãŒã‚ã£ãŸï¼Ž
+
+Wed Dec 25 00:33:19 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 1.0-961225
+
+ * io.c (Init_IO): newを無効化
+
+ * lib/tkthcore.rb: tk_call "global $foo; set foo 5"ãªã©ã‚‚ã§ãるよã†ã«
+
+ * eval.c (thread_restore_context): $~, $_ã§ã‚¹ã‚¿ãƒƒã‚¯ã‚’壊ã—ã¦ã„ãŸ
+
+ * process.c (rb_waitpid): threadã«ä¸€å¿œå¯¾å¿œ
+
+Tue Dec 24 15:20:58 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.4-961224
+
+ * configure.in: charãŒunsignedã‹ã©ã†ã‹ã‚‚ãƒã‚§ãƒƒã‚¯
+
+ * regex.c (SIGN_EXTEND_CHAR): __CHAR_UNSIGNED__ã«ã‚‚対応
+
+ * pack.c (pack_unpack): 明示的ã«signed charを指定.
+
+Mon Dec 23 14:41:23 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.c (load_file): 標準入力ã‹ã‚‰ã®ã‚¹ã‚¯ãƒªãƒ—トã§ä¸€æ™‚ファイルを使ã‚
+ ãªã„よã†ã«
+
+ * object.c (f_integer): `0x', `0'ãªã©ã§baseを解釈ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Fri Dec 20 01:44:39 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * Makefile.in (flock.o): flockã«å¯¾å¿œ
+
+Thu Dec 19 20:13:32 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.4-961219
+
+Wed Dec 18 00:06:48 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * glob.c (glob_filename): strrchrãŒãƒžã‚¯ãƒ­ã®å ´åˆã«å¯¾å¿œ
+
+ * configure.in: <sys/select.h>ã‚’ãƒã‚§ãƒƒã‚¯
+
+ * ext/kconv/kconv.c: 1.62ベースã«
+
+ * ext/kconv/kconv.c: Kconvモジュール
+
+ * string.c (str_substr): lenãŒå…ƒã®æ–‡å­—åˆ—ã‚ˆã‚Šé•·ã„æ™‚ã«å¯¾å¿œ
+
+ * parse.y (iterator): 「$bar do .. endã€ãªã©ã¯è¨±ã•ãªã„よã†ã«
+
+ * parse.y (iterator): FID(foo!,foo?)ã‚’doå½¢å¼ã®ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã«ã§ãる.
+
+ * missing/flock.c (flock): lockf()を使ã£ã¦ä»£æ›¿
+
+ * file.c (file_flock): flockを実装
+
+Tue Dec 17 12:13:38 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.4-961217
+
+Fri Dec 13 02:05:03 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * configure.in: RUBYLIBã®ã‚«ãƒ¬ãƒ³ãƒˆã‚’後回ã—(@mix/awk offline)
+
+ * dln.c: AIXã«å¯¾å¿œã—ãŸï¼Ÿ(@mix/awk offline)
+
+ * eval.c (thread_schedule): critical sectionã§ã‚‚明示的ãªã‚³ãƒ³ãƒ†ã‚­ã‚¹
+ トスイッãƒã¯èµ·ããªã„ã¨ã¾ãšã„
+
+ * re.c (reg_search): matchã«å¤±æ•—ã—ãŸæ™‚ã«$~ã‚’nilã«ï¼Ž
+
+ * re.c (reg_search): 毎回matchを生æˆã™ã‚‹ã‚ˆã†ã«
+
+Thu Dec 12 17:03:30 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * numeric.c (flo_to_s): 2.0.to_s -> 2.0ã«
+
+ * eval.c (thread_save_context): $_, $~ã‚’thread毎ã«ä¿å­˜
+
+ * eval.c (thread_kill): main threadã§ã¯exit(0)
+
+ * string.c (str_split_method): é–“é•ã£ãŸçµæžœã‚’è¿”ã—ã¦ã„ãŸ
+
+Thu Dec 12 15:32:48 1996 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * dir.c: CYGWIN32対応
+
+ * ext/socket/socket.c: CYGWIN32対応
+
+ * io.c: CYGWIN32対応
+
+Thu Dec 12 14:43:51 1996 Jun Kuroda <j_kuro@pluto.ai.kutech.ac.jp>
+
+ * lib/tk.rb: wish4.2も探索候補ã«å«ã‚ã‚‹
+
+ * config.guess: JCC対応
+
+Thu Dec 12 00:41:17 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.4-961212
+
+ * parse.y (parse_string): """..."""ã¯ã‚„ã¯ã‚Šç„¡ãã™ã“ã¨ã«ã—ãŸ
+
+ * parse.y (parse_regx): %r|...|ã§terminatorã‚’ \ ã§ã‚¨ã‚¹ã‚±ãƒ¼ãƒ—ã§ãã‚‹
+ よã†ã«
+
+ * signal.c (posix_signal): sigactionを使ã†signal
+
+ * configure.in: posix signal/bsd signalã®æ¤œå‡º
+
+Wed Dec 11 17:47:35 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_schedule): critical sectionã§ã¯ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆã‚¹ã‚¤ãƒƒ
+ ãƒãŒèµ·ããªã„よã†ã«
+
+ * lib/thread.rb: SharedMutexクラス
+
+ * lib/jcode.rb: String#scanを使ã†ã‚ˆã†ã«
+
+Tue Dec 10 12:21:28 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961210
+
+ * string.c (str_split_method): æ­£è¦è¡¨ç¾ã«()ã‚’å«ã‚€æ™‚ã«ãƒã‚°
+
+ * lib/jcode.rb: ã¡ã‚‡ã£ã¨ã¾ã—ã«ãªã£ãŸ
+
+ * string.c (tr_setup_table): ç½®æ›æ–‡å­—ãŒçŸ­ã™ãŽã‚‹(2文字)ã®ã¨ãã®ãƒã‚°
+
+Mon Dec 9 11:38:04 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_scan): 文字列ã®ãƒžãƒƒãƒã‚’行ã†ï¼Žã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã¨ã—ã¦ã‚‚å‹•
+ 作ã™ã‚‹
+
+ * regex.c (re_copy_registers): allocatedãŒåˆæœŸåŒ–ã•れã¦ã„ãªã‹ã£ãŸ
+
+ * re.c (match_to_s): $~ã®æ–‡å­—列化
+
+ * re.c (match_to_a): $~ã‚’é…列化ã§ãるよã†ã«
+
+ * re.c (match_getter): レジスタãŒåˆæœŸåŒ–ã•れã¦ã„ãªã‹ã£ãŸ
+
+Thu Dec 5 11:06:10 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_split_method): マッãƒã—ãªã‹ã£ãŸæ‹¬å¼§ã¯ç©ºæ–‡å­—列を
+ pushã™ã‚‹ã¹ãã§ã¯ãªã„
+
+ * string.c (str_succ): アルファベットをå«ã¾ãªã„文字ã«å¯¾å¿œ
+
+Wed Dec 4 10:48:09 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961204
+
+ * io.c (io_binmode): DJGPPã§ã®binmode対応
+
+ * sprintf.c (f_sprintf): intã®ç¯„å›²ã®æ•°å€¤ã¯ç›´æŽ¥sprintfã§å¤‰æ›ã™ã‚‹
+
+ * sprintf.c (f_sprintf): "%02s"ã«é ¼ã‚‰ãªã„
+
+ * re.c (reg_search): indexã§SEGV
+
+Tue Dec 3 10:09:36 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961203
+
+ * ext/extmk.rb.in (install): INSTALL_DATAã‹ã‚‰INSTALLã«å¤‰æ›´
+
+ * dln.c: hpux対応
+
+ * string.c (str_aset_method): è² ã®å€¤ã‚’å«ã‚€ç¯„囲ã§ã‚‚例外を起ã“ã•ãªã„
+
+ * array.c (ary_replace): è² ã®å€¤ã‚’å«ã‚€ç¯„囲ã§ã‚‚例外を起ã“ã•ãªã„
+
+ * array.c (beg_len): beg==endã®æ™‚,長ã•0ã«
+
+Mon Dec 2 14:07:12 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * configure.in: HP shl対応
+
+ * string.c (str_upto): beg > endã®æ™‚ç„¡é™ãƒ«ãƒ¼ãƒ—ã«è½ã¡ã‚‹ã®ã‚’æ­¢ã‚ãŸ
+
+ * range.c (range_each): String#uptoãŒå†å®šç¾©ã•れãŸå ´åˆã«å¯¾å¿œ
+
+ * string.c (str_split_method): "ABC".split(/(B)/)ãŒèª¤å‹•作
+
+Sat Nov 30 01:43:52 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): undefã§SEGV
+
+Fri Nov 29 12:17:59 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-parse-region): %Q#..#ãªã©ã«å¯¾å¿œï¼Žã—ã‹
+ ã—ï¼ŒåŒºåˆ‡ã‚Šæ–‡å­—ãŒæ¼”ç®—å­ã§è¡Œæœ«ã«ã‚ã‚‹å ´åˆã«ã¯å¯¾å¿œã§ããªã‹ã£ãŸï¼Ž
+
+ * re.c (reg_raise): 例外ã§ã‚‚スラッシュをエスケープ
+
+ * re.c (reg_inspect): スラッシュをエスケープ
+
+ * parse.y (parse_string): `%[QqXxRr](.)..\1'ãªã‚‹æ–‡å­—列形å¼(テスト
+ 採用)
+
+ * parse.y (parse_qstring): '''...'''ã®å½¢å¼
+
+ * ext/dbm/dbm.c (Init_dbm): 述語key?,value?ã®è¿½åŠ 
+
+ * ext/dbm/dbm.c (Init_dbm): includes->include?
+
+ * hash.c (Init_Hash): 述語key?,value?,include?ã®è¿½åŠ 
+
+ * eval.c (rb_eval): unlessã§else節ãŒå®Ÿè¡Œã•れãªã„(ã†ãƒ¼ã‚“)
+
+ * string.c (str_sub_iter_s): イテレータブロック内ã§ãƒžãƒƒãƒãŒè¡Œã‚れ
+ ã‚‹ã¨ä½ç½®ãŒãšã‚Œã‚‹(時ã«ç„¡é™ãƒ«ãƒ¼ãƒ—ã«è½ã¡ã‚‹)
+
+ * string.c (str_resize): lenãŒ0ã®æ™‚sizeã®èª¿æ•´ãŒè¡Œã‚れãªã‹ã£ãŸ
+
+Thu Nov 28 00:59:54 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961128
+
+ * parse.y (parse_string): 3-quote styleã®æ–‡å­—列(例:"""abc"d"e""")
+
+ * configure.in (EXTSTATIC): extã‚’é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹æ™‚ã«ã¯rubyã¯dllã‚’
+ 使ã†ã‚ˆã†ã«
+
+ * io.c (Init_IO): getsã®å¼•æ•°ãŒé–“é•ã£ã¦ã„ãŸ
+
+ * string.c (str_each_line): RSã‚’æ˜Žç¤ºçš„ã«æŒ‡å®šã§ãるよã†ã«
+
+Wed Nov 27 12:37:46 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961127
+
+ * eval.c (rb_eval): iver defined? ã§selfを指定ã™ã‚‹ã®ã‚’忘れãŸ
+
+ * io.c: getsç­‰ã§RSã‚’æ˜Žç¤ºçš„ã«æŒ‡å®šã§ãるよã†ã«
+
+ * ext/extmk.rb.in (install): static linkã«å¤±æ•—
+
+Tue Nov 26 10:33:04 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961126
+
+ * string.c (str_sub_s): ç½®æ›å¾Œã®æ–‡å­—列長ã•ãŒé–“é•ã£ã¦ã„ãŸ
+
+Mon Nov 25 09:11:22 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * numeric.c (fix_rshift): 32以上ã®å³ã‚·ãƒ•トã§0ã‚’è¿”ã™ã‚ˆã†ã«(Cã®
+ rshiftã¯(x>>(y%32))ã‚’è¿”ã—ã¦ã„ãŸ).
+
+ * string.c (str_gsub): ç½®æ›ãŒè¡Œã‚れãªã„å ´åˆãŒã‚ã£ãŸ
+
+ * string.c (str_resize): 本当ã«å¿…è¦ãªæ™‚ã ã‘realloc
+
+Thu Nov 21 04:13:21 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * configure.in (EXTSTATIC): --with-static-linked-extã§å…¨ã¦ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼
+ ルをé™çš„リンクã™ã‚‹ã‚ˆã†ã«
+
+ * pack.c (pack_unpack): è¡Œæœ«ã®æ”¹è¡ŒãŒãªã„時ã«ã‚‚ãƒã‚§ãƒƒã‚¯ã‚µãƒ ã‚’スキッ
+ プã™ã‚‹ã‚ˆã†ã«
+
+Wed Nov 20 21:42:51 1996 Yasuo OHBA <jammy@shljapan.co.jp>
+
+ * configure.in: freebsd対応
+
+Wed Nov 20 10:24:24 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/extmk.rb.in (install): 通常リンク用ã®LDFLAGSã¨ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ãƒª
+ ンク用ã®DLDFALGSを分離
+
+ * ext/extmk.rb.in (install): ã‚³ãƒ³ãƒ‘ã‚¤ãƒ«ã®æˆåŠŸã—ãŸã‚‚ã®ã‚’é™çš„リンク
+ ã®ãƒªã‚¹ãƒˆã«è¿½åŠ ã™ã‚‹
+
+ * eval.c (f_missing): ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆã®æ–‡å­—列表ç¾ãŒé•·ã™ãŽã‚‹æ™‚ãƒãƒƒãƒ•ã‚¡
+ ã‚’æ›¸ãæ½°ã—ã¦ã„ãŸ
+
+ * process.c (proc_exec_v): forkã—ãŸå¾Œä¾‹å¤–を発生ã•ã›ã¦ã¯ã„ã‘ãªã„
+
+Tue Nov 19 13:28:15 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961119
+
+ * eval.c (mod_method_defined): Module#method_defined? ã®è¿½åŠ 
+
+ * parse.y (call_args): 引数ãŒå”¯ä¸€ã®ã‚³ãƒžãƒ³ãƒ‰ã‚³ãƒ¼ãƒ«ã§ã‚る時ã®ãƒã‚°(戻
+ り値ãŒå±•é–‹ã•れã¦ã—ã¾ã†)
+
+Mon Nov 18 13:28:18 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_sub): 失敗ã—ãŸæ™‚ã«nilã‚’è¿”ã—ã¦ã„ãŸ
+
+ * string.c (str_split_method): 検索開始ä½ç½®ãŒç§»å‹•ã—ã¦ãªã‹ã£ãŸ
+
+ * ext/socket/socket.c (sock_s_getservbyaname): ã¾ã é–“é•ã£ã¦ã„ãŸ
+
+ * version 0.99.3-961118
+
+ * string.c (str_sub_s): å…ƒã®æ–‡å­—列を置æ›ã™ã‚‹ã®ã‚’æ­¢ã‚ãŸ
+
+ * pack.c (encodes): 領域外をアクセスã—ã¦ã„ãŸ
+
+Fri Nov 15 17:10:35 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * bignum.c (big_divmod): BignumãŒå¼•æ•°ã®å ´åˆã®å¯¾å¿œå¿˜ã‚Œ
+
+ * sample/ruby-mode.el (ruby-expr-beg): word?å½¢å¼ã¸ã®å¯¾å¿œãŒä¸å®Œå…¨
+
+Wed Nov 13 15:42:40 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_tr_s_bang): tr_sã§trãŒè¡Œã‚れã¦ã„ãªã‹ã£ãŸ
+
+ * eval.c (rb_eval): autoloadクラスã®ãƒã‚§ãƒƒã‚¯
+
+ * string.c (f_sub): subãŒsub!ã¨åŒã˜å‹•作ã«ãªã£ã¦ã„ãŸ
+
+ * eval.c (thread_sleep): stopã¨sleepã®åˆ†é›¢
+
+Mon Nov 11 13:53:19 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961111
+
+ * numeric.c (fix_step): to, stepãŒæ•´æ•°ä»¥å¤–ã®å ´åˆã«å¯¾å¿œ
+
+ * eval.c (rb_call): dynamic varãŒdynamic scopingã«ãªã£ã¦ã„ãŸ(ã“れ
+ ã¯ã¾ãšã„)
+
+ * string.c (str_chop_bang): é•·ã•0ã®æ–‡å­—列ã®chopã§ï¼Œé ˜åŸŸå¤–ã®ã‚¢ã‚¯ã‚»
+ スãŒç™ºç”Ÿã—ã¦ã„ãŸï¼Ž
+
+ * parse.y (yyerror): 割り当ã¦ãŸé ˜åŸŸå¤–をアクセスã—ã¦ã„ãŸ
+
+Fri Nov 8 11:54:46 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_yield): scopeã‚’heapã«ã‚³ãƒ”ー
+
+Thu Nov 7 09:56:53 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * numeric.c (num_coerce): ã¨ã‚Šã‚ãˆãšä¸¡è¾ºã‚’Floatã«å¤‰æ›ã™ã‚‹ã“ã¨ã«
+
+Wed Nov 6 10:45:13 1996 Yasuo OHBA <jammy@shljapan.co.jp>
+
+ * lib/parsearg.rb: 第2引数を変更.
+
+Tue Nov 5 14:21:09 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961105
+
+Sat Nov 2 01:11:40 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * bignum.c (big_pow): typo (dy -> dx)
+
+ * bignum.c (big_divmod): 知らãªã„åž‹ã¯floatã«å¤‰æ›ã—ã¦ã¿ã‚‹
+
+ * numeric.c (fix_lshift): 境界æ¡ä»¶ã®ãƒã‚°(è² ã«ãªã£ã¦ã„ãŸ)
+
+ * bignum.c (big_pow): ç„¡é§„ãªfloatã¸ã®å¤‰æ›ã‚’ãªãã—ãŸ
+
+ * math.c (math_atan2): typo(x -> y)
+
+Fri Nov 1 15:30:59 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/socket/socket.c (sock_gethostname): gethostnameãŒãªã„時ã«ã¯
+ unameを使ã£ã¦ãƒ›ã‚¹ãƒˆåã‚’å¾—ã‚‹
+
+ * ext/etc/etc.c (etc_getlogin): getloginãŒNULLã‚’è¿”ã—ã¦ã‚‚環境変数を
+ 調ã¹ã‚‹ã‚ˆã†ã«
+
+ * object.c (krn_clone): オブジェクトã®ãƒ•ラグもコピー
+
+ * hash.c (rb_cmp): ãƒãƒƒã‚·ãƒ¥ã®æ¯”較を`=='ã§ãªã`eql?'ã«å¤‰æ›´
+
+ * math.c (Need_Float): Float()を使ã£ã¦å¤‰æ›ã™ã‚‹
+
+ * compar.c (cmp_gt): 以å‰ã®å³è¾ºã‚’è¿”ã™ä»•様ã®åæ®‹ãŒæ®‹ã£ã¦ã„ãŸ
+
+Thu Oct 31 12:55:51 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961031
+
+ * numeric.c (Init_Numeric): typo
+
+ * eval.c (error_print): é•·ã™ãŽã‚‹trace backを途中çœç•¥ã™ã‚‹
+
+ * regex.c (re_compile_pattern): 全角ã®rangeã«å¯¾å¿œ
+
+Wed Oct 30 03:03:18 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.3-961030
+
+ * io.c (f_ungetc): 関数を追加
+
+ * eval.c (dyna_var_asgn): return値忘れ
+
+Tue Oct 29 10:05:28 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (f_split): 関数splitを追加
+
+ * eval.c (rb_call): ãƒã‚¹ãƒˆã—ãŸå¤–å´ã®ã‚¯ãƒ©ã‚¹/モジュールã®å®šæ•°ã‚’å‚ç…§
+ ã§ãるよã†ã«
+
+Mon Oct 28 09:51:03 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_sub): offsetãŒæ–‡å­—ã®æœ«å°¾ã«ã‚る時ã®ãƒã‚§ãƒƒã‚¯
+
+ * regex.c (re_match): 割り当ã¦ã‚‹ãƒ¬ã‚¸ã‚¹ã‚¿ã®æ•°ãŒ1多ã‹ã£ãŸ
+
+ * io.c (io_gets): $/ = ""ã®å‹•作をperlã«åˆã‚ã›ã‚‹(awkã¨ã¯ã¡ã‚‡ã£ã¨é•
+ ã†ã‚‰ã—ã„)
+
+ * io.c (io_gets): $/ = nilã®æ™‚å°‘ã—高速化
+
+ * string.c (str_split_method): 括弧ãŒnullã«ãƒžãƒƒãƒã—ãŸæ™‚ã«ã‚‚無視ã—
+ ãªã„よã†ã«
+
+ * string.c (str_split_method): 括弧ã«ãƒžãƒƒãƒã—ãŸåˆ†ã¯limitã®æ•°ã«å«ã‚
+ ãªã„よã†ã«ï¼Ž
+
+ * numeric.c (num_coerce_bin): coerceã®å®šç¾©ã‚’変更,2è¦ç´ ã®é…列
+ [x,y]ã‚’è¿”ã™ã‚ˆã†ã«
+
+ * sample/ruby-mode.el (ruby-calculate-indent): "do |aa|"ã®å¯¾å¿œã‚’改
+ å–„ã—ãŸï¼Ž
+
+Sat Oct 26 01:43:51 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/marshal/marshal.c (w_object): ビルトインクラスã®ã‚µãƒ–クラスを
+ æ­£ã—ã復旧ã§ãるよã†ã«
+
+ * ext/marshal/marshal.c (w_object): ユーザ定義dumpã®å„ªå…ˆ
+
+ * numeric.c (flo_coerce): Float()を使ã£ã¦å®šç¾©
+
+ * numeric.c (Init_Numeric): Numericã®newã®undefã¯ã¾ãšã„
+
+ * ext/marshal/marshal.c (w_symbol): シンボルã®å†…容(文字列)ã¯ä¸€åº¦ã—
+ ã‹ãƒ•ã‚¡ã‚¤ãƒ«ã«æ›¸ã出ã•ãªã„.
+
+ * sample/ruby-mode.el (ruby-parse-region): if/while修飾å­ã«å¯¾å¿œã—
+ ãªããªã£ã¦ã„ãŸ
+
+ * bignum.c (Init_Bignum): Bignum.newを除ã
+
+ * eval.c (rb_eval): 引数評価後ã«ãƒ•ァイルåã¨è¡Œç•ªå·ã‚’å†è¨­å®š
+
+ * numeric.c (flo_div): typo
+
+ * sample/ruby-mode.el (ruby-parse-region): def /, def `ã«å¯¾å¿œ
+
+Fri Oct 25 09:26:29 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-calculate-indent): "do |aa|"ã«å¯¾å¿œ
+
+ * array.c (ary_aset): indexãŒfixnumã®å ´åˆã¡ã‚‡ã£ã¨é«˜é€ŸåŒ–
+
+ * eval.c (thread_fd_writable): 書ãè¾¼ã¿å‰ã®selectãƒã‚§ãƒƒã‚¯
+
+ * array.c (ary_assoc): ç„¡é™ãƒ«ãƒ¼ãƒ—ã«è½ã¡ãŸ
+
+ * eval.c (thread_wait_for): selectãŒã‚¨ãƒ©ãƒ¼çµ‚了ã—ãŸæ™‚,linux以外ã§
+ ã®å‹•ä½œãŒæ­£ã—ããªã‹ã£ãŸï¼Ž
+
+Thu Oct 24 08:26:48 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (backtrace): `$@'を文字列ã‹ã‚‰é…列ã«å¤‰æ›´ã—ãŸï¼Ž
+
+ * eval.c (eval): eval中ã®ä¾‹å¤–発生ä½ç½®ã‚’ä¿å­˜ã™ã‚‹
+
+ * bignum.c (bigsub): オペランドã®å¤§å°æ¯”較ã®å¤±æ•—
+
+ * re.c (reg_search): 直接å‚ç…§ãŒãªã„時ã«ã‚‚`$~'ãŒã‚»ãƒƒãƒˆã•れるよã†ã«
+
+Wed Oct 23 10:40:10 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-961023
+
+ * ext/marshal/marshal.c (r_bytes): mallocã‚’ã‚„ã‚,allocaを使ã†
+
+ * sample/ruby-mode.el (ruby-calculate-indent): 括弧ã®å¯¾å¿œã‚’変更.
+ ()内ã§ã¯ã‚¤ãƒ³ãƒ‡ãƒ³ãƒˆã‚’レベルをåˆã‚ã›ã‚‹ã‚ˆã†ã«
+
+Tue Oct 22 12:59:11 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * hash.c (hash_s_new): sizeを指定ã§ãるよã†ã«
+
+ * ext/marshal/marshal.c (w_object): dumpã™ã‚‹æ·±ã•制é™ã‚’指定ã§ãるよ
+ ã†ã«
+
+ * array.c (ary_s_new): sizeを指定ã—ãŸæ™‚ã®åˆæœŸåŒ–忘れ
+
+ * object.c (f_float): big2dblã®å®£è¨€å¿˜ã‚Œï¼Ž
+
+ * bignum.c (bigsub): 大ãã•ã®è¿‘ã„BignumåŒå£«ã®æ¼”ç®—ã§çµæžœãŒè² ã«ãªã‚‹
+ å ´åˆã«é–“é•ã„ãŒã‚ã£ãŸï¼Ž
+
+ * array.c (ary_aset): ç½®æ›å…ˆã¨ç½®æ›å…ƒãŒåŒã˜é•·ã•ã®æ™‚内容を
+ shift(memmove)ã—ãªã„よã†ã«ï¼Ž
+
+ * ext/marshal/marshal.c (marshal_dump): ファイルフォーマットã«ãƒãƒ¼
+ ジョンを埋ã‚込むよã†ã«
+
+ * ext/marshal/marshal.c (tmpnam): linux-aout-dln用ã«å®šç¾©
+
+Mon Oct 21 08:40:20 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/socket/socket.c (sock_s_gethostbyname): hostentæ§‹é€ ä½“ã®æƒ…å ±
+ ã‚’è¿”ã™
+ (sock_s_gethostbyaddr): IPアドレスã‹ã‚‰hostent構造体を得る
+ (sock_s_getservbyaname): getservbyname(3)
+
+Fri Oct 18 10:37:36 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-indent-to): 移動先カラムãŒè² ã«ãªã‚‹ãƒã‚°
+
+ * eval.c (compile): evalã§å…ƒã‚½ãƒ¼ã‚¹ã®è¡Œç•ªå·ã§ã‚¨ãƒ©ãƒ¼ã‚’表示ã™ã‚‹
+
+Thu Oct 17 09:52:28 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (eval): evalã§æ–‡æ³•エラーãŒã‚ã£ãŸæ™‚ã«SEGV
+
+ * lib/safe.rb: Restricted.evalã®ä¸­ã ã‘制é™ã‚’加ãˆã‚‹ï¼Ž
+
+ * eval.c (error_print): ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ã®å‡ºåŠ›ï¼Žcallerã§ä¾‹å¤–発生ä½ç½®
+ を調整ã—ãŸæ™‚ã«å•題ãŒå‡ºã‚‹(ãã‚“ãªã“ã¨ã‚’ã—ãªã‘れã°è‰¯ã„ã®ã ãŒâ€¦)
+
+ * eval.c (make_backtrace): ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ã®ç”Ÿæˆ
+
+Wed Oct 16 12:56:22 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby-man-0.99.2-jp/index.html: 日本語版ドキュメントã®å®Œæˆ(é•·ã‹ã£ãŸâ€¦)
+
+ * re.c (reg_regcomp): $=ãŒnilã®æ™‚ã®å‡¦ç†
+
+ * string.c (f_chop): $_ã«å¯¾ã™ã‚‹chop
+
+Tue Oct 15 11:04:23 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-961015
+
+Mon Oct 14 18:22:38 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_schedule): BOW対応.selectãŒ-1ã‚’è¿”ã—ãŸæ™‚ã«ãƒã‚°(実
+ ã¯do .. whileãŒcontinueã§å…ˆé ­ã«ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã¨æ€ã„込んã§ã„ãŸï¼Žæ¡
+ ä»¶ã®ç›´å‰ã ã£ãŸã®ã­ ^^);;;;;
+
+ * sample/ruby-mode.el (ruby-mode-syntax-table): ?ã®syntaxãŒ"/"ã§ã¯
+ ã¾ãšã„らã—ã„
+
+ * hash.c (rb_hash): name conflict
+
+Fri Oct 11 00:23:05 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-961011
+
+ * ext/marshal/marshal.c (w_object): çµå±€å‹•ã„ã¦ã„ãªã‹ã£ãŸå¾ªç’°ã‚ªãƒ–ジェ
+ クト対応を外ã—ãŸï¼Ž
+
+ * hash.c (rb_hash): Fixnumã¨æ–‡å­—列ã®é«˜é€ŸåŒ–
+
+ * ext/marshal/marshal.c (w_object): ç„¡é§„ãªãƒ‡ãƒ¼ã‚¿ã®å‰Šé™¤(フォーマッ
+ トã®éžäº’æ›æ€§)
+
+ * io.c (io_readline): 戻り値ã®ä¸å‚™
+
+ * ext/marshal/marshal.c (marshal_dumps): MSDOS対応
+
+ * ruby.c (load_file): MSDOS対応
+
+Wed Oct 9 17:46:27 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/extmk.rb.in (install): ç„¡é§„ãªã‚³ãƒ”ーをé¿ã‘ã‚‹
+
+ * string.c (str_sub_method): マッãƒãŒãªã‹ã£ãŸæ™‚ã®String#subã®å€¤ãŒ
+ é•ã£ã¦ã„ãŸï¼Ž
+
+ * eval.c (obj_extend): extendã—ãŸæ™‚ã«object_extendedを呼ã¶ã‚ˆã†ã«
+
+Tue Oct 8 00:55:38 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_alloc): 割当ã®å¹³å‡åŒ–
+
+ * eval.c (thread_schedule): joinã®ãƒã‚°ã‚’修正
+
+ * eval.c (thread_wait_for): selectã¸ã®å‰²è¾¼ã¿ãªã©ã«å¯¾å¿œ
+
+ * eval.c (thread_select): linuxã®selectã®æŒ™å‹•ã«å¯¾å¿œ(timeoutãŒå¤‰åŒ–
+ ã™ã‚‹)
+
+Mon Oct 7 09:47:19 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-961007
+
+ * eval.c (PUSH_BLOCK): the_classã®ä¿å­˜ã‚’忘れã¦ã„ãŸï¼Ž
+
+ * ext/dbm/dbm.c (fdbm_store): sizeã®ä¿å­˜ã™ã‚‹å ´æ‰€ãŒé–“é•ã£ã¦ã„ãŸ
+
+ * ext/socket/socket.c (s_accept): thread対応ã—ã¦ã„ãªã‹ã£ãŸ
+
+Sat Oct 5 01:32:27 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (io_readchar): EOFã§ä¾‹å¤–を発生ã•ã›ã‚‹
+
+Fri Oct 4 11:59:54 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/marshal/marshal.c (w_object): Hashã¨Objectã®å¾©æ—§ã«å¿…è¦ãªãƒãƒƒ
+ ã‚·ãƒ¥ãƒ†ãƒ¼ãƒ–ãƒ«ãŒæ¸¡ã•れã¦ã„ãªã‹ã£ãŸï¼Ž
+
+ * variable.c (rb_path2class): ユーザ定義クラスã®å¾©æ—§ã«å¤±æ•—ã—ã¦ã„ãŸ
+
+ * variable.c (rb_path2class): クラスãŒå­˜åœ¨ã—ãªã„時ã®ã‚¨ãƒ©ãƒ¼ã‚’Fatal
+ ã‹ã‚‰NameErrorã¸ï¼Ž
+
+ * range.c (range_s_new): first,lastãŒä¸¡æ–¹Numericã®æ™‚エラーã«ãªã£ã¦
+ ã„ãŸï¼Ž
+
+ * range.c: start->first, end->last
+
+Wed Oct 2 02:02:46 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c: DJGPPã§chmod,chownを使ãˆã‚‹ã‚ˆã†ã«(ã£ã¦DOSã«chownãŒã‚ã‚‹ã®ã‹?)
+
+ * class.c (rb_singleton_class): ビルトインクラスもextendã—ãŸã‚Šç‰¹ç•°
+ メソッドを追加ã—ãŸã‚Šã§ãるよã†ã«
+
+ * variable.c (rb_set_class_path): ユーザ定義ã®ãƒˆãƒƒãƒ—レベルクラスã«
+ pathを設定ã—ãªã„
+
+ * eval.c (eval): 例外ãŒRuntimeErrorã«åŒ–ã‘ã¦ã„ãŸ
+
+ * eval.c (eval): eval中ã®ä¾‹å¤–ã®è¡¨ç¾ã®æ”¹å–„
+
+ * eval.c (eval): eval_with_bindingã¨ã®ä¸€æœ¬åŒ–
+
+ * eval.c (rb_eval): クラス/モジュール定義ã®ä¸­ã‹ã‚‰å®šç¾©ä¸­ã®ã‚¯ãƒ©ã‚¹/モ
+ ジュールãŒå‚ç…§ã§ãるよã†ã«
+
+Tue Oct 1 01:40:09 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-961001
+
+ * parse.y: cur_crefãŒ2度宣言ã•れã¦ã„ãŸ
+
+ * signal.c (trap): SIGSEGV,SIGBUSã®ãªã„機種ã«å¯¾å¿œ
+
+ * io.c (Init_IO): å¼•æ•°ã‚¿ã‚¤ãƒ—ã®æŒ‡å®šé–“é•ã„
+
+Mon Sep 30 15:28:00 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-960930
+
+ * config.guess,config.sub: $host_osãŒæ­£ã—ã設定ã•れãªã„
+
+ * eval.c (rb_eval): yieldã§æ­£ã—ããªã„selfãŒè¨­å®šã•れã¦ã„ãŸ
+
+ * eval.c (ruby_run): toplevelã®ä¾‹å¤–処ç†ã®ãƒã‚°
+
+Mon Sep 30 09:13:26 1996 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * djgpp対応
+
+Sat Sep 28 02:45:10 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-960928
+
+ * sample/ruby-mode.el (ruby-beginning-of-block): ブロックã®å…ˆé ­ã«
+ 移動(æ­£ã—ãインデントã—ã¦ã„ãªã„ã¨å‹•作ã—ãªã„)
+ (ruby-end-of-block): åŒä¸Š
+
+ * eval.c (class_s_new): Class#newãŒã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã¨ã—ã¦å‘¼ã°ã‚ŒãŸæ™‚ã¯
+ initializeもイテレータã¨ã—ã¦å‘¼ã°ã‚Œã‚‹ã‚ˆã†ã«
+
+ * signal.c (sigsegv): SEGVã§backtraceを表示ã™ã‚‹ã‚ˆã†ã«
+
+Fri Sep 27 09:51:07 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-960927
+
+ * eval.c (error_print): 引数ã®ãªã„raiseã§ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒæ­£ã—ã表示ã•
+ れるよã†ã«ï¼Ž
+
+ * eval.c (rb_longjmp): mesgãŒnilã®æ™‚RuntimeErrorを生æˆã™ã‚‹ï¼Ž
+
+ * eval.c (f_raise): 引数ãŒãªã„時ã«å¯¾å¿œ
+
+ * eval.c (thread_mark): stack上ã«ãªã„データã®ã‚¢ãƒ‰ãƒ¬ã‚¹å¤‰æ›ã‚’行ã£ã¦
+ ã„ãŸï¼Ž
+
+ * eval.c (Init_Thread): 割込ã¿ã®é–“éš”ãŒ1ç§’ã¨é•·ã™ãŽãŸï¼Ž
+
+Thu Sep 26 16:02:45 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_schedule): 一度ペンディングã«ãªã‚‹ã¨ãƒ•ラグãŒã‚¯ãƒªã‚¢
+ ã•れã¦ã„ãªã‹ã£ãŸï¼Ž
+
+ * process.c (rb_proc_exec): system/execã®å¼•æ•°ãŒç©ºæ–‡å­—列ã§ã‚ã£ãŸå ´
+ åˆï¼Œä¾‹å¤–を発生ã™ã¹ãã ã£ãŸï¼Ž
+
+ * config.sub/config.guess: æ–°ã—ã„ã‚‚ã®ã«ç½®ãæ›ãˆ
+
+Thu Sep 26 15:41:35 1996 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * io.c (next_argv): -i.bakã‚’BOWã¨DOSã«å¯¾å¿œï¼Ž
+
+Thu Sep 26 01:31:43 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (io_sysread): EOFã§ä¾‹å¤–
+
+ * io.c (f_readline): EOFã§ä¾‹å¤–を発生ã™ã‚‹ã‚ˆã†ã«ï¼Žgetsã¯äº’æ›æ€§ã®ãŸã‚
+ nilã‚’è¿”ã™ã¾ã¾ã«ã™ã‚‹
+
+ * eval.c (proc_call): lambdaã‹ã‚‰ã®returnã§IN_BLOCKフラグãŒç«‹ã£ãŸã¾
+ ã¾ã ã£ãŸ
+
+ * eval.c (PUSH_BLOCK2): threadã«å¯¾å¿œã™ã‚‹ãŸã‚Blockを一度stackã«ã‚³ãƒ”ー
+
+Wed Sep 25 11:54:11 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (method_call): Const::method()å½¢å¼ã‚’使ãˆã‚‹ã‚ˆã†ã«ã—ã¦ã¿ãŸï¼Ž
+ 引数括弧ã¯çœç•¥ã§ããªã„.
+
+ * sample/test.rb: Process.killã®å­˜åœ¨ã‚’確ã‹ã‚ã¦ã‹ã‚‰ãƒ†ã‚¹ãƒˆã‚’行ã†
+
+ * eval.c (eval_with_binding): 第2引数ã¨ã—ã¦binding(ã¾ãŸã¯lambda)ã‚’
+ 与ãˆã‚‹ã¨ãã®ç’°å¢ƒã§evalを実行ã™ã‚‹ã‚ˆã†ã«ã—ãŸ
+
+ * eval.c (f_binding): ç¾åœ¨ã®bindingã‚’è¿”ã™é–¢æ•°
+
+ * eval.c: block構造体ã«the_classã‚’ä¿å­˜ã™ã‚‹ãƒ¡ãƒ³ãƒã‚’追加
+
+ * process.c (Init_process): kill,wait,waitpidã‚’Processã«ç§»å‹•
+
+Tue Sep 24 02:44:43 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el: ã„ã‚ã„ã‚å•題ãŒå¤šã„ã®ã§ä»¥å‰ã®é«˜é€ŸåŒ–ã¯ç ´æ£„.
+ 別ã®ã‚¢ãƒ—ローãƒã‚’使ã£ãŸï¼Ž
+
+ * lib/tk.rb (Tk.pack): 複数ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’å—ã‘付ã‘ã‚‹pack
+
+Sat Sep 21 11:08:09 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (exprs): 空文もå—ã‘付ã‘るよã†ã«æ–‡æ³•を変更.今ã¾ã§ã¯æ”¹è¡Œ
+ ã®é€£ç¶šã ã‘ãŒè¨±ã•れã¦ã„ãŸï¼Ž
+
+Fri Sep 20 11:39:18 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * Failã®å¤§åŠã‚’åå‰ã¤ã例外ã«å¤‰æ›´ï¼Ž
+
+ * re.c (Init_Regexp): åå‰ã¤ã例外を導入.
+
+ * eval.c (f_missing): Objectã¯inspectã—ãªã„.
+
+ * object.c (inspect_i): Object#inspectã§loopã«å¯¾å¿œï¼Ž
+
+ * regex.c (re_search): /^$/ãŒ""ã«ãƒžãƒƒãƒã—ãªã‹ã£ãŸï¼Ž
+
+Thu Sep 19 19:25:12 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * regex.c (re_search): /^$/ãŒéžç©ºè¡Œã«ãƒžãƒƒãƒã—ã¦ã„ãŸï¼Ž
+
+Tue Sep 17 10:28:11 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-960917
+
+Mon Sep 16 10:47:56 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-calculate-indent): 演算å­ç¶™ç¶šã®å ´åˆã®
+ 文字列ã®åˆ¤å®šã®ãƒã‚°
+
+ * sample/ruby-mode.el (ruby-calculate-indent): elseãªã©ã®æ¬¡ã®è¡Œã®
+ インデント計算を正ã—ã.
+
+Sat Sep 14 08:37:19 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.2-960914
+
+Fri Sep 13 08:06:03 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/socket/socket.c (tcpaddr): port番å·ã«ntohsã‚’ã¤ã‘忘れ
+
+ * dln.c (link_undef): テーブルã®ç¨®é¡žãŒé–“é•ã£ã¦ã„ãŸï¼Ž
+
+ * bignum.c (bigadd): 引ãç®—ãŒç™ºç”Ÿã™ã‚‹æ™‚ã«è¨ˆç®—é•ã„ãŒèµ·ãã¦ã„ãŸï¼Ž
+
+ * parse.y (iter_do_block): do..endã§ã‚‚dynamic variableを.
+
+ * bignum.c (big_pow): より正確ãªè¨ˆç®—ã‚’(æ•´æ•°åŒå£«ã§ã¯floatã«å¤‰æ›ã—ãª
+ ã„).
+
+Thu Sep 12 13:11:55 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * variable.c (rb_set_class_path): StringクラスãŒåˆæœŸåŒ–ã•れるå‰ã«
+ Stringを作ã£ã¦ã„ãŸï¼Žçµ„è¾¼ã¿ã‚¯ãƒ©ã‚¹ã«ã¯pathã¯ã„らãªã„
+
+ * parse.y (yylex): 0.1ãŒ0ã«ãªã£ã¦ã„ãŸ
+
+ * parse.y (yylex): 行番å·ã®ä¸æ•´åˆ
+
+ * gc.c (oblist_live_obj): 今「生ãã¦ã„ã‚‹ã€å…¨éƒ¨ã®ã‚ªãƒ–ジェクトを返ã™
+ イテレータ.ãã®ã‚¯ãƒ©ã‚¹(ã¾ãŸã¯ã‚µãƒ–クラス)ã®å…¨éƒ¨ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’è¿”
+ ã™each_object_ofも定義ã—ãŸï¼Ž
+
+ * class.c (rb_define_class_id): ç„¡é§„ãªã‚¯ãƒ©ã‚¹ã‚’割り当ã¦ã¦ã„ãŸï¼Žçµæžœ
+ ã¨ã—ã¦æœªåˆæœŸåŒ–ã®ã‚¯ãƒ©ã‚¹ã‚ªãƒ–ジェクトãŒå­˜åœ¨ã—ã¦ã„ãŸï¼Ž
+
+Wed Sep 11 00:56:23 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (yylex): octalã®å®šæ•°ã®æ¤œå‡ºã‚’より正確ã«(090ã¯ã‚¨ãƒ©ãƒ¼ã¨ã‹).
+
+ * bignum.c (big_minus): yãŒxより大ãã„å ´åˆã«ã‚¨ãƒ©ãƒ¼ï¼Ž
+
+ * parse.y (yylex): エラー行番å·ã®è¡¨ç¤ºã‚’より正確ã«
+
+ * sample/ruby-mode.el (ruby-expr-beg): 変数åãŒ1æ–‡å­—ã®æ™‚誤動作ã—ã¦
+ ã„ãŸï¼Ž
+
+ * sample/ruby-mode.el (ruby-calculate-indent): ?/ã§ãƒ«ãƒ¼ãƒ—ã«è½ã¡ã„
+ ãŸãƒã‚°ã‚’修正.
+
+ * enum.c (enum_min,enum_max): sortã®ã‚ˆã†ã«ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã¨ã—ã¦ã‚‚動作ã™
+ るよã†ã«ï¼Ž
+
+ * enum.c (enum_find_all): typo
+
+Tue Sep 10 12:07:12 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * node.h (nd_line): NODEã®lineã‚’flagsã«æŠ¼ã—è¾¼ã‚ã¦ã‚ªãƒ–ジェクトサイ
+ ズをå°ã•ãã—ãŸï¼Žåˆ¶é™:32bit intã®ãƒžã‚·ãƒ³ã®å ´åˆï¼Œãƒ•ァイルã®è¡Œæ•°ãŒ
+ 32767ã‚’è¶Šãˆã‚‹ã¨æ­£å¸¸ã«è¡¨ç¤ºã•れãªã„.
+
+ * st.c: hashã¨compareã®é–¢æ•°ãƒ¡ãƒ³ãƒã‚’構造体ã«ãƒ‘ック,クラス的ãªä½¿ã„
+ 方を行ã†ï¼Ž1 tableã‚ãŸã‚Š4 byteã®ç¯€ç´„.
+
+Mon Sep 9 16:35:54 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (file_truncate): æä¾›ã•れãªã„時ã«ã¯ç‰¹åˆ¥ãªä¾‹å¤–を発生ã™ã‚‹ã‚ˆ
+ ã†ã«ï¼Ž
+
+ * eval.c (Init_Proc): ä¸é©åˆ‡ãªä½ç½®ã®local-jumpを例外ã«ï¼Ž
+
+Sat Sep 7 17:06:15 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (proc_call): ã¾ã ã‚¹ã‚³ãƒ¼ãƒ—ãŒã‚¹ã‚¿ãƒƒã‚¯ä¸Šã«ã‚る時ã«ã¯å±€æ‰€è„±å‡º
+ を有効ã«ã™ã‚‹ï¼Žã“れã§ï¼Œprocを生æˆã—ã¦callã™ã‚‹ã“ã¨ã¯ï¼Œã‚¹ã‚³ãƒ¼ãƒ—を脱
+ 出ã—ãªã„é™ã‚Šï¼Œyieldã¨åŒã˜æ„味をæŒã¤ã“ã¨ã«ãªã‚‹ï¼Ž
+
+Fri Sep 6 13:30:59 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-indent-to): インデントãŒå¤‰ã‚らãªã„時ã«
+ ã¯ãƒãƒƒãƒ•ァを変更ã—ãªã„.
+ (ruby-calculate-indent): ã¾ãšæ–‡å­—åˆ—ã®å†…部ã‹åˆ¤æ–­ã—ã¦ã‹ã‚‰ï¼Œå‰ã®è¡Œ
+ ã‹ã‚‰ãƒ‘ーズを行ã†ï¼ŽdefunãŒå¤§ãããªã£ãŸæ™‚ã®é«˜é€ŸåŒ–.
+ (ruby-in-string-p): 文字列ã®å†…部ã‹ã©ã†ã‹ã‚’判断ã™ã‚‹é–¢æ•°(以å‰ã®
+ parseã‹ã‚‰åˆ†é›¢)
+ (ruby-parse-region): 文字列ã«å¯¾ã™ã‚‹å‡¦ç†ã‚’ã¯ãšã™ï¼Ž
+ (ruby-beginning-of-block): ブロックã®å…ˆé ­ã«
+ (ruby-end-of-block): ãƒ–ãƒ­ãƒƒã‚¯ã®æœ«å°¾ã«(é…ã„…)
+
+Thu Sep 5 14:23:07 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (file_s_split): [dirname,basename]ã«splitã™ã‚‹ï¼Ž
+
+ * eval.c (rb_eval): evalã®ä¸­ã§ã‚‚定数ã®å€¤ãŒæ­£ã—ããªã‚‹ã‚ˆã†ã«ï¼Žã“れã§
+ 定数ã«é–¢ã—ã¦ã¯é™çš„ãªã‚¹ã‚³ãƒ¼ãƒ—ãŒä¿è¨¼ã•れるよã†ã«ãªã£ãŸï¼Ž
+
+ * st.c (rehash): ãƒãƒƒã‚·ãƒ¥æ‹¡å¤§ã®ç³»æ•°ã‚’2ã‹ã‚‰1.79ã«ï¼Žå‰²ç®—ãŒã‚ˆã‚Šè‰¯ã„値
+ ã‚’è¿”ã™ã‚ˆã†ã«ï¼Ž
+
+Thu Sep 5 00:32:07 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (class_superclass) クラスã®ã‚¹ãƒ¼ãƒ‘ークラスを返ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼Ž
+
+Wed Sep 4 16:54:56 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * random.c (f_rand): Bignumã‚„longã®ç¯„囲を越ãˆã‚‹Floatã«å¯¾ã™ã‚‹ä¹±æ•°ã‚‚
+ 発生ã§ãるよã†ã«ï¼Ž
+
+ * struct.c (struct_alloc): Fatalã§ã¯ãªã例外を発生ã•ã›ã‚‹ã‚ˆã†ã«(通
+ 常ã®ä½¿ç”¨ã§ç™ºç”Ÿã—ã†ã‚‹).
+
+ * struct.c (struct_s_members): Structã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã§ã¯ãªã,生æˆ
+ ã•れãŸStructクラスã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã«ã—ãŸï¼Ž
+
+ * st.c (st_init_table): ruby専用ã«ãƒ‘ラメタを固定ã«ã—ãŸ(サイ
+ ã‚ºãŒæ¸›ã£ãŸ)
+
+Mon Sep 2 11:37:59 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * array.c (ary_shift): capaãŒã‚ã¾ã‚Šã«ã‚‚大ãã„æ™‚ã«ã¯é ˜åŸŸã‚’REALLOC
+ (ary_pop): åŒä¸Š
+
+ * string.c (str_inspect): multibyte character 対応ã«ãƒŸã‚¹ï¼Ž
+ (str_inspect): unsigned charã«ã—ãªã„ã¨ç¬¦å·å±•é–‹ã•れã¦ã—ã¾ã†
+
+ * parse.y (primary): `::'ã‚’primaryã«ç§»å‹• Foo::Bar.BazãŒã‚¨ãƒ©ãƒ¼ã«ãª
+ らãªã„よã†ã«ï¼Ž
+
+ * parse.y (primary): オペレータ形å¼ã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ãŒå®šç¾©ã§ããªã„
+
+ * random.c (f_rand): maxãŒ0ã®æ™‚ã«å¯¾å¿œ
+
+ * io.c (io_printf): 関数を定義ã—ã¦ã„ãŸãŒã‚¤ãƒ³ã‚¿ãƒ—リタã«ç™»éŒ²ã—ã¦ã„ãª
+ ã‹ã£ãŸï¼Ž
+
+ * file.c (file_s_basename): 第2引数ãŒç„¡ã„時ã«ã‚¨ãƒ©ãƒ¼ï¼Ž
+
+Thu Aug 29 10:49:40 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (expr): ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã®æ–°å½¢å¼ã«ã€Œmethod do .. endã€å½¢å¼ã‚’採
+ 用ã—ãŸï¼Žã‚‚ã¡ã‚ん昔ã®å½¢å¼ã‚‚有効.
+
+ * sample/ruby-mode.el (ruby-calculate-indent): endã®æ•°ã®æ–¹ãŒå¤šã„å ´
+ åˆã«ã‚‚エラーを起ã“ã•ãªã„よã†ã«ï¼Ž
+
+Wed Aug 28 09:41:36 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * numeric.c (upto,downto,step,times): 対象ãŒfixnumã®ç¯„囲を越ãˆã¦ã‚‚
+ 動作ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Mon Aug 26 10:04:37 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * missing/setenv.c (envix): typo(missing `== 0' for memcmp)
+
+ * dir.c (dir_foreach): foreach(dir open -> read loop -> closeã¾ã§)
+
+ * io.c (io_foreach): foreach(file open -> read loop -> closeã¾ã§)
+
+ * Fatalã®ã†ã¡æ•æ‰å¯èƒ½ãªã„ãã¤ã‹ã‚’例外ã«ï¼Ž
+
+Sat Aug 24 23:56:37 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * bignum.c (bigdivmod): FIX2INT -> INT2FIX 大間é•ã„
+
+Fri Aug 23 18:13:03 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * regex.c (re_free_registers): allocateã—ã¦ã„ãªã„時ã«ã¯å½“ç„¶ free
+ ã—ã¦ã¯ã„ã‘ãªã„.
+
+Thu Aug 22 01:20:35 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_create): 外å´ã‹ã‚‰å¼·åˆ¶çµ‚了ã•ã›ã‚‰ã‚ŒãŸthreadã¯
+ cleanupã™ã‚‹å¿…è¦ãŒç„¡ã„.
+
+Wed Aug 21 09:57:28 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_create): threadを終了ã•ã›ãŸå¤§åŸŸè„±å‡ºã®æƒ…報を
+ main_threadã«æ¸¡ã™ã‚ˆã†ã«ï¼Ž
+
+ * parse.y (call_args): æœ€çµ‚å¼•æ•°ã«æ‹¬å¼§ã‚’çœç•¥ã—ãŸãƒ¡ã‚½ãƒƒãƒ‰å‘¼å‡ºã—ã‚’ç½®
+ ã‘るよã†ã«(例: print foo bar, baz == print(foo(bar,baz)))
+
+Tue Aug 20 13:37:16 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (masign): 多é‡ä»£å…¥ã¨rest引数ã®å‹•作をåˆã‚ã›ã¦ç©ºã®é…列を代
+ å…¥ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * parse.y (arg): defined?ã®å¼·åº¦ã‚’ã‚‚ã†ã¡ã‚‡ã£ã¨å¼·ã
+
+ * eval.c (error_print): -wã§ä¾‹å¤–åも表示ã™ã‚‹ã‚ˆã†ã«
+
+ * eval.c (rb_eval): æ–°æ§‹æ–‡ã«å¯¾å¿œ
+ (handle_rescue): æ•æ‰ã™ã‚‹ä¾‹å¤–ã‚’ kind_of? ã§åŒå®š
+
+ * parse.y (primary): rescueã®æ§‹æ–‡ã‚’変更(åŒå®šå¼•æ•°ã®è¿½åŠ ï¼Œè¤‡æ•°rescue)
+
+ * Fail()ã®ã‹ãªã‚Šã‚’é©å½“ãªä¾‹å¤–を使ã†ã‚ˆã†ã«
+
+ * eval.c (thread_interrupt): Interrupt(今ã¯non-local jump)ã¯
+ main-threadã«é€ã‚‰ã‚Œã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * eval.c (rb_longjmp): $! ã®å†…容を文字列ã‹ã‚‰ä¾‹å¤–クラスã«å¤‰æ›´
+ (rb_raise): rb_fail ã‹ã‚‰å称変更
+ (rb_interrupt): 例外化
+ (rb_exit): 例外化
+
+ * error.c (Init_Exception): ä¾‹å¤–ã‚¯ãƒ©ã‚¹ã®æ–°è¨­(文字列ã®ã‚µãƒ–クラス)
+
+Mon Aug 19 19:40:52 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * signal.c (trap): å¤ã„ãƒãƒ³ãƒ‰ãƒ©ã‚’è¿”ã™ã‚ˆã†ã«ï¼Ž
+
+Wed Aug 14 00:07:18 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_trap_eval): ãƒãƒ³ãƒ‰ãƒ©ã®ãŸã‚ã«threadã‚’forkã™ã‚‹ã“ã¨ã‚’æ­¢
+ ã‚ãŸï¼Ž
+
+ * eval.c (thread_mark): thread毎㮠$!, $@ をマークã—忘れ
+
+ * ext/dbm/dbm.c (fdbm_delete): イテレータã¨ã—ã¦å‘¼ã°ã‚ŒãŸå ´åˆï¼Œè¦ç´ 
+ ãŒç„¡ã‘れã°ãƒ–ロックを評価ã™ã‚‹ï¼Ž
+
+ * hash.c (hash_delete): イテレータã¨ã—ã¦å‘¼ã°ã‚ŒãŸå ´åˆï¼Œè¦ç´ ãŒç„¡ã‘れ
+ ã°ãƒ–ロックを評価ã™ã‚‹ï¼Ž
+
+ * array.c (ary_delete): イテレータã¨ã—ã¦å‘¼ã°ã‚ŒãŸå ´åˆï¼Œè¦ç´ ãŒç„¡ã‘れ
+ ã°ãƒ–ロックを評価ã™ã‚‹ï¼Ž
+
+ * eval.c (rb_interrupt): SIGINTã®ãƒ‡ãƒ•ォルトをexitã‹ã‚‰ç‰¹åˆ¥ãªå¤§åŸŸè„±
+ 出ã«ï¼Žã‚„ã¯ã‚Šå‰²ã‚Šè¾¼ã¾ã‚ŒãŸä½ç½®ã®è¡¨ç¤ºãŒç„¡ã„ã®ã¯å¯‚ã—ã„ã®ã§ï¼Ž
+
+Tue Aug 13 01:34:00 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_exit): sub-thread内ã§ã®exitã‚‚statusã‚’ä¿å­˜ã™ã‚‹ã‚ˆã†ã«
+ (thread_create): 自thread内ã®exitã«å¯¾å¿œ
+
+ * signal.c (sighandle): SIGINTã®ãƒ‡ãƒ•ォルトãƒãƒ³ãƒ‰ãƒ©ã¯exitã™ã‚‹ã‚ˆã†ã«
+ (以å‰ã¯ä¾‹å¤–を発生ã—ã¦ã„ãŸ).
+
+ * 例外ã®ä¸€éƒ¨ã‚’Fatalã«ï¼Ž
+
+ * string.c (str_aset): 文字列ã®ç½®æ›ã®å¯¾è±¡ãŒéƒ¨åˆ†æ–‡å­—列ã§ãªã‹ã£ãŸæ™‚,
+ 例外を発生ã•ã›ãªã„よã†ã«
+
+ * eval.c (proc_call): Procã®ä¸­ã‹ã‚‰break/nextã¯é€šã—,他ã®ã‚‚ã®ã¯é€šã•
+ ãªã„よã†ã«
+
+Mon Aug 12 14:15:09 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (krn_type): 文字列を返ã™
+
+ * eval.c (thread_create): sub-thread内ã§ã®exitã«å¯¾å¿œ
+
+ * numeric.c (fix_type): 文字列を返ã™
+
+ * io.c (f_p): デãƒãƒƒã‚°ç”¨ãƒ‡ãƒ¼ã‚¿è¡¨ç¤ºãƒ¡ã‚½ãƒƒãƒ‰
+
+ * eval.c (f_missing): nil/TRUE/FALSEを特別扱ã„
+
+ * string.c (str_inspect): é•·ã„æ–‡å­—列を短縮表示.inspectã®åƒãã‚’
+ human readable stringã®ç”Ÿæˆã«çµ±ä¸€(re-generatable string ã¯æ­£å¼ã«
+ ç„¡ããªã£ãŸ).
+
+Sat Aug 10 16:54:21 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (Init_Object): kernel/nil/false/trueã®ã‚¯ãƒ©ã‚¹åを変更(å°
+ 文字ã«),rubyスクリプトã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã„よã†ã«ï¼Ž
+
+ * eval.c (rb_eval): CONSTANTã®ã‚¢ã‚¯ã‚»ã‚¹å…ˆã‚’å˜ç´”化.crefを使ã‚ãªã„.
+
+ * eval.c (f_eval): 特異メソッド内ã§ã‚‚定数ã®å€¤ãŒæ­£ã—ããªã‚‹ã‚ˆã†ã«
+
+Fri Aug 9 12:23:17 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * array.c (ary_concat): append -> concat Stringã«åˆã‚ã›ãŸ
+
+ * parse.y (yylex): `$;'ãŒä½¿ãˆãªã‹ã£ãŸï¼Ž
+
+ * array.c (ary_push_method): 複数引数をå—ã‘付ã‘るよã†ã«ï¼Ž
+ (ary_unshift): 複数引数をå—ã‘付ã‘るよã†ã«ï¼Ž
+
+ * io.c (io_popen): IO.popenã§command pipeãŒé–‹ã‘るよã†ã«ï¼Ž
+
+ * object.c (Init_Object): Kernelã¨Nilã‚’ruby scriptã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã§ã
+ ãªã„よã†ã«ï¼Ž
+
+Thu Aug 8 01:21:47 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (f_integer): æ•´æ•°ã¸ã®å¤‰æ›é–¢æ•°
+ (f_float): 実数ã¸ã®å¤‰æ›é–¢æ•°
+ (f_string): 文字列ã¸ã®å¤‰æ›é–¢æ•°
+ (f_array): é…列ã¸ã®å¤‰æ›é–¢æ•°
+
+ * bignum.c (big_to_i): FIXNUMã®ç¯„囲ã§ãªã„時ã¯Bignumã®ã¾ã¾è¿”ã™ã‚ˆã†
+ ã«å¤‰æ›´ï¼Ž
+
+Wed Aug 7 09:28:38 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99.1-960807
+
+ * parse.y (mlhs): 「*foo = 1,2,3ã€ã‚¿ã‚¤ãƒ—ã®å¤šé‡ä»£å…¥ã‚‚å¯èƒ½ã«ï¼Ž
+
+ * object.c (Init_Object): クラスTrue/Falseã‚’ruby scriptã‹ã‚‰ã‚¢ã‚¯ã‚»
+ スã§ããªã„よã†ã«ï¼Ž
+
+ * object.c (nil_inspect): inspect表ç¾ã¯"nil"ã«
+
+ * io.c (io_print): nilã®printã‚’nilã«ï¼Ž
+
+ * object.c (nil_to_s): nilã®æ–‡å­—列表ç¾ã‚’""ã«ï¼Ž
+
+Tue Aug 6 01:12:32 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * dir.c (dir_s_open): file descripterãŒè¶³ã‚Šãªã„時ã«ã¯gcã—ã¦ã‹ã‚‰ã‚‚
+ ã†ä¸€åº¦openã—ã¦ã¿ã‚‹ï¼Ž
+
+ * io.c (rb_fopen): ã™ã¹ã¦ã®fopen()ã«ã¤ã„ã¦file descripterãŒè¶³ã‚Šãª
+ ã„æ™‚ã«ã¯gcã—ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦openã—ã¦ã¿ã‚‹ï¼Ž
+
+ * ext/socket/socket.c (Init_socket): 定数ã®è¿½åŠ ï¼Ž
+
+ * sample/ruby-mode.el (ruby-indent-to): インデント後ã®ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®
+ ã®èª¿æ•´ã‚’æ­£ã—ã.
+
+ * gc.c (gc): 割込ã¿ãƒã‚§ãƒƒã‚¯ã‚’行ã‚ãªã„(Cコードã®ä¸­ã§å®‰å¿ƒã—ã¦
+ malloc()ãŒä½¿ãˆãªããªã‚‹ã®ã§).
+
+ * st.c (call_hash_func): signalã¨threadã«ã‚ˆã‚‹å‰²è¾¼ã¿ã«å¯¾å¿œï¼Ž
+
+ * sig.h (DEFER_INTS): 割込ã¿ç¦æ­¢åŒºé–“ã®æŒ‡å®š
+
+ * eval.c (f_require): threadã«ã‚ˆã‚‹requireã®ç«¶åˆã«å¯¾å¿œ(最åˆã®
+ requireãŒçµ‚了ã™ã‚‹ã¾ã§ä»–ã®threadã¯å¾…ã¤).
+
+ * bignum.c (str2inum): 0x80000000ã®å€¤ãŒè² ã«ãªã£ã¦ã„ãŸ
+
+ * sprintf.c (f_sprintf): 文字列末尾,行末ã®å˜ç‹¬ã®`%'ã«å¯¾å¿œ
+
+ * bignum.c (big_cmp): 比較ã®çµæžœãŒé€†ã«ãªã‚‹æ™‚ãŒã‚ã£ãŸï¼Ž
+
+Mon Aug 5 10:58:13 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * process.c (proc_exec_v): 例外ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’分ã‹ã‚Šã‚„ã™ã.
+
+ * ext/dbm/dbm.c (fdbm_store): nilã‚’æ ¼ç´ã™ã‚‹ã¨è¦ç´ ã®å‰Šé™¤ã«ãªã‚‹
+
+ * ext/dbm/dbm.c: サイズをキャッシュ.
+
+Sat Aug 3 01:52:52 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_fail): `fail'ãŒå¼•æ•°ç„¡ã—ã§å‘¼ã°ã‚ŒãŸæ™‚ã ã‘以å‰ã®`$@'ã‚’ä¿
+ å­˜ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * eval.c (f_fail): frameã®èª¿æ•´
+
+Fri Aug 2 11:26:21 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/socket/socket.c (bsock_setopt): valã¨ã—ã¦TRUE/FALSE/Fixnumã‚‚
+ å—ã‘付ã‘るよã†ã«ï¼Ž
+
+ * ext/socket/socket.c (Init_socket): SO_REUSEADDRç­‰ã®å®šæ•°ã®è¿½åŠ 
+
+ * ext/md5/md5init.c: md5モジュール(åˆã®è¤‡æ•°ãƒ•ァイルã‹ã‚‰ãªã‚‹ãƒ¢ã‚¸ãƒ¥ãƒ¼
+ ルã§ã‚‚ã‚ã‚‹)
+
+ * ruby.h (Make_Data_Struct): Data: objectã®instanceå¤‰æ•°ã«æ ¼ç´ ->
+ Dataåž‹ã®Objectã«(Dir,Time,Proc,Thread,DBM)
+
+Thu Aug 1 11:38:44 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/dbm/dbm.c (fdbm_store): valueãŒæ–‡å­—ã§ç„¡ã„時ã«å¯¾å¿œ
+
+Wed Jul 31 10:53:42 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/socket/socket.c (open_inet): htonsãŒå¿…è¦ã§ã‚ã£ãŸ
+ (tcpaddr): ntohlã§å¤‰æ›ã—ãŸ
+
+ * process.c (rb_proc_exec): execvp -> execv
+
+Tue Jul 30 17:48:33 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c: `$?'ã‚’thread localã«
+
+ * Makefile.in (install): install時ã«stripを行ã†
+
+ * configure.in: install時ã®stripã®æ¤œå‡º
+
+ * configure.in: NEXTSTEP対応
+
+ * version 0.99.1-960730
+
+Tue Jul 30 16:40:35 1996 SHIROYAMA Takayuki <psi@fortune.nest.or.jp>
+
+ * dln.c (dln_load): NeXT dln(mach-o)対応.configureã¯æœªå¯¾å¿œ
+
+Tue Jul 30 09:46:51 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * process.c (f_system): 複数引数もã¨ã‚Œã‚‹ã‚ˆã†ã«
+
+ * process.c (f_exec): 複数引数もã¨ã‚Œã‚‹ã‚ˆã†ã«
+
+ * array.c (ary_append): é…列(ã¾ãŸã¯Enum)ã®è¦ç´ ã‚’破壊的ã«è¿½åŠ 
+
+ * array.c (ary_plus): Enumã¯ãã®è¦ç´ ã‚’追加
+
+ * file.c (file_s_open): File.openを追加
+
+ * struct.c (struct_new): FIX2INTを忘れã¦ã„ãŸ
+
+ * file.c (Init_File): exists? -> exist?
+
+ * object.c (obj_is_kind_of): is_kind_of? -> kind_of?, is_a?
+
+ * object.c (obj_is_instance_of): is_instance_of? -> instance_of?
+
+Mon Jul 29 16:40:02 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (parse_regx): å¼å±•開を行ã£ãŸå ´åˆï¼Œcasefoldã®è¨­å®šãŒã§ãã¦
+ ã„ãªã‹ã£ãŸï¼Ž
+
+ * object.c (true_type): TRUE/FALSEã«typeを実装.
+
+ * parse.y (read_escape): 3文字以内ã®octalã«å¯¾å¿œ(\0ã¨ã‹)
+
+Fri Jul 26 00:31:45 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * array.c (ary_reverse_bang): in-placeã§é…列をå転ã•ã›ã‚‹
+ (ary_sort_bang): in-placeã§sortã™ã‚‹
+ (ary_sort): sortã—ãŸé…列を返ã™ã‚ˆã†ã«
+ (ary_delete_at): 指定ã—ãŸä½ç½®ã®è¦ç´ ã‚’削除ã™ã‚‹
+
+ * eval.c (rb_call): stackæ·±ã•ãƒã‚§ãƒƒã‚¯ã‚’毎回ã¯è¡Œã‚ãªã„よã†ã«
+
+ * error.c (Warning): 実行中ã®warningãŒè¡¨ç¤ºã•れã¦ã„ãªã‹ã£ãŸ
+
+ * eval.c (compile): 例外発生を分離.
+
+ * eval.c (f_eval): 変数rb_in_evalã‚’æ­£ã—ã管ç†ã™ã‚‹ã‚ˆã†ã«
+
+ * ext/dbm/dbm.c (fdbm_store): æ ¼ç´ã™ã‚‹keyを文字列ã«å¤‰æ›
+
+ * eval.c (rb_call): ç„¡é™å†å¸°ã®ãƒã‚§ãƒƒã‚¯ã‚’大域脱出を行ã†C methodã«ã‚‚
+ 対応ã•ã›ãŸï¼Žthreadã®stackæ·±ã•ãƒã‚§ãƒƒã‚¯ãƒ«ãƒ¼ãƒãƒ³ã‚’æµç”¨ï¼Ž
+
+ * parse.y (yylex): 第1引数ã®unary -/+ã®åˆ¤å®šãŒé–“é•ã£ã¦ã„ãŸï¼Ž
+
+ * parse.y (yylex): unary +ã§æ•°å­—を余計ã«èª­ã‚“ã§ã„ãŸ(ex. +5 -> 55)
+
+Thu Jul 25 12:15:04 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (yylex): 曖昧ã§ãªã„引数ã«å¯¾ã—ã¦è­¦å‘Šã‚’出ã—ã¦ã„ãŸï¼Ž
+
+ * eval.c (iterator_p): 引数ã§å‘¼ã‚“ã§ã‚‚æ­£ã—ã„çµæžœã‚’è¿”ã™ã‚ˆã†ã«ï¼Ž
+
+ * parse.y: break/next/redo/retryã®ãƒ¡ã‚½ãƒƒãƒ‰åŒ–.
+
+ * sample/ruby-mode.el (ruby-calculate-indent): nestã®ãƒã‚§ãƒƒã‚¯ãƒŸã‚¹
+
+ * sample/ruby-mode.el (ruby-parse-region): 予約語ã®ãƒã‚§ãƒƒã‚¯ã‚’強化
+
+ * parse.y (primary): unless/untilã®å¾©æ´»
+
+Tue Jul 23 18:50:10 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * array.c (Array#empty?), Hash.c (Hash#empty?), ext/dbm/dbm.c (DBM#empty?):
+ 空ã®åˆ¤å®šè¿°èªž
+
+ * eval.c (f_unless): ifã®é€†ã‚’ã™ã‚‹ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿
+
+ * eval.c (f_until): whileã®é€†ã‚’ã™ã‚‹ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿
+
+ * parse.y: notã®å„ªå…ˆé †ä½ã‚’and/orより高ã
+
+ * parse.y (expr): `!'を引数括弧をçœç•¥ã—ãŸcallã§ã‚‚有効ã«
+
+Mon Jul 22 10:15:38 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99-960722
+
+ * array.c (ary_print_on): OFSã®NILãƒã‚§ãƒƒã‚¯ãŒä¸å®Œå…¨
+
+ * ruby.c (load_file): 標準入力ã‹ã‚‰ã®ã‚¹ã‚¯ãƒªãƒ—トãŒç©ºã®æ™‚ã«å¯¾å¿œï¼Ž
+
+ * ruby.c (proc_options): -wã§ã¯å¼•æ•°ç„¡ã—ã®æ™‚ã«ã¯æ¨™æº–入力ã‹ã‚‰ã‚¹ã‚¯ãƒª
+ プトをã¨ã‚‹(-vã§ã¯ãŸã‚“ã«çµ‚了ã™ã‚‹).
+
+ * array.c (ary_compact): nilã®è¦ç´ ã‚’å–り除ãメソッド
+
+ * array.c (ary_nitems): nilã§ãªã„è¦ç´ ã‚’æ•°ãˆã‚‹ãƒ¡ã‚½ãƒƒãƒ‰
+
+Sun Jul 20 00:51:53 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.c (proc_options): -w optionを追加
+
+ * parse.y: {}ãŒé–‰ã˜ã¦ã„ãªã„時ã«ã¯å±•é–‹ã—ãªã„文字列を
+
+Fri Jul 19 16:16:05 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99-960719
+
+ * lib/find.rb: 石塚版(pruneã®æ‹¡å¼µä»˜ã)
+
+ * file.c (test_l): lstatã§èª¿ã¹ãªã„ã¨ã­ï¼Ž
+
+ * eval.c (f_throw): 第2引数をçœç•¥å¯èƒ½ã«ï¼Ž
+
+ * parse.y (str_extend): {}ã®ãƒã‚¹ãƒˆã«å¯¾å¿œ
+
+Thu Jul 18 18:25:46 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99-960718
+
+ * parse.y (str_extend): 文字列中ã®å¼å±•é–‹ã« \" ' ` / ã‚’å«ã‚€äº‹ãŒã§ã
+ るよã†ã«ï¼Ž
+
+Tue Jul 16 15:55:31 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-parse-region): æ­£è¦è¡¨ç¾å†…ã®ã‚¨ã‚¹ã‚±ãƒ¼ãƒ—
+ ã«å¯¾å¿œ
+
+ * version 0.99-960716
+
+Fri Jul 12 10:06:19 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (f_select): 引数ã®close check.
+
+ * ruby.c (load_file): #!行ã®å¼•æ•°ãƒã‚§ãƒƒã‚¯ã‚’第1引数ã«é™å®š(実をã„ã†ã¨
+ DOS改行対策)
+
+Wed Jul 10 17:18:35 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99-960710
+
+ * time.c (time_s_timegm/time_s_timelocal): 時間を生æˆã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰
+
+Mon Jun 17 15:59:20 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99-960617
+
+ * parse.y (yyerror): エラー表示ã®ç°¡ç•¥åŒ–.
+
+Wed Jun 12 14:11:01 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * signal.c (rb_trap_exit): trap 0ã¯threadを生æˆã›ãšã«å‡¦ç†ã™ã‚‹ï¼Ž
+
+Fri Jun 7 10:17:01 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * array.c/hash.c (indexes): é…列1引数ã®ãƒ‘ターンを無ãã—ãŸï¼Žé…列ã®
+ å ´åˆã¯`*ary'を使ã£ã¦ã‚‚らãŠã†ï¼Ž
+
+ * eval.c (thread_wait_threads): main_threadãŒçµ‚了ã™ã‚‹å‰ã«ä»–ã®
+ threadã‚’å¾…ã¤(強制的ã«ã¯çµ‚了ã•ã›ãªã„).
+ (ruby_run): ä»–ã®threadã‚’å¾…ã£ã¦ã„ã‚‹é–“ã«ã‚·ã‚°ãƒŠãƒ«ãŒæ¥ãŸã‚‰ï¼Œå…¨thread
+ を強制終了ã•ã›ã‚‹ï¼Ž
+
+ * eval.c (rb_fail): メソッドåã‚’`$!'ã«åŸ‹ã‚込む.
+
+ * eval.c (thread_create): main_threadã®ã‚³ãƒ³ãƒ†ã‚¯ã‚¹ãƒˆãŒã‚»ãƒ¼ãƒ–ã•れãª
+ ã„å ´åˆãŒã‚ã£ãŸï¼Ž
+
+ * process.c (f_sleep): 時間を指定ã›ãšï¼ŒthreadãŒã²ã¨ã¤ã—ã‹ãªã„状æ³
+ ã«ã‚‚対応.
+
+ * eval.c (thread_create): create後,fnを呼ã³å‡ºã™å‰ã«context switch
+ ãŒèµ·ãã‚‹ã¨é•ã†contextã§fnãŒå®Ÿè¡Œã•れã¦ã—ã¾ã†ãƒã‚°ï¼Ž
+
+Mon Jun 3 08:03:17 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * struct.c (struct_s_def): メンãƒã®æŒ‡å®šã‚’文字列,シンボル(FIXNUM)
+ åŒæ–¹ã§å¯èƒ½ã«ã—ãŸï¼Ž
+
+ * ext/etc/etc.c (Init_etc): 構造体オブジェクトをGCã‹ã‚‰ä¿è­·ã—ãŸï¼Ž
+
+ * error.c (rb_sys_fail): nil/FALSEを引数ã¨ã—ã¦å—ã‘付ã‘るよã†ã«ï¼Ž
+
+Thu May 30 16:19:08 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_select): EINTRã«å¯¾å¿œï¼Ž
+
+Wed May 29 11:04:51 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (f_catch): catch/throwを実装ã—ãŸï¼Ž
+
+Tue May 28 13:30:52 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99-960528
+
+ * eval.c (thread_cleanup): main threadãŒçµ‚了ã™ã‚‹ã¨ä»–ã®threadも終了
+ ã™ã‚‹ã“ã¨ã®æ˜Žç¢ºåŒ–.
+
+ * signal.c (trap): SIGINTã®ãƒ‡ãƒ•ォルトã®è¨­å®šãƒŸã‚¹(本当ã«SIG_DFLã§ã¯
+ ã¾ãšã‹ã£ãŸ).rubyã§ã¯ã¡ã‚ƒã‚“ã¨ãƒãƒ³ãƒ‰ãƒ«ã—ãªã„ã¨ï¼Ž
+
+ * eval.c (thread_interrupt): SIGINTã¯main_threadã«ä¾‹å¤–を発生ã•ã›ã‚‹
+ よã†ã«ï¼Ž
+
+Mon May 27 15:13:31 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_status): threadã®çŠ¶æ…‹ã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼Žthreadã®çµ‚了
+ ã‚’å¾…ãŸãªã„.
+
+ * eval.c (thread_value): 一種ã®promiseを実装ã™ã‚‹ãŸã‚ã®ãƒ¡ã‚½ãƒƒãƒ‰ï¼Ž
+
+ * eval.c (thread_join): å¾…ã£ã¦ã„ã‚‹threadãŒä¾‹å¤–ã‚’èµ·ã“ã—ãŸæ™‚ã«ã¯ï¼Œ
+ joinãŒãã®ä¾‹å¤–を発生ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * eval.c (thread_create): threadã§ã®ä¾‹å¤–ã‚’propagateã—ãªã„よã†ã«ï¼Ž
+
+Fri May 24 10:47:53 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * enum.c (Init_Enumerable): `size' as alias to the `length'
+
+ * eval.c (thread_save_context): `$@', `$!'をスレッド毎ã«ã‚»ãƒ¼ãƒ–.
+
+ * eval.c (superclass): エラー表示をより親切ã«ï¼Ž
+
+Thu May 23 10:38:41 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.99-960523
+
+ * eval.c (superclass): エラー時ã«ã‚¹ãƒ¼ãƒ‘ークラスåã‚’(分ã‹ã‚Œã°)表示
+ ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Wed May 22 19:48:42 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (superclass): ã‚¹ãƒ¼ãƒ‘ãƒ¼ã‚¯ãƒ©ã‚¹ã®æŒ‡å®šå­ã‚’`:'ã‹ã‚‰`<'ã«å¤‰æ›´ï¼Ž
+
+Tue May 21 09:27:59 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * lib/thread.rb: threadをサãƒãƒ¼ãƒˆã™ã‚‹ã‚¯ãƒ©ã‚¹(Mutex, Queue).
+
+Mon May 20 09:39:49 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * time.c (time_cmp): æµ®å‹•å°æ•°ç‚¹æ•°ã‚‚扱ãˆã‚‹ã‚ˆã†ã«ï¼Ž
+ (time_minus): Time - TimeãŒæµ®å‹•å°æ•°ç‚¹æ•°ã‚’è¿”ã™ã‚ˆã†ã«ï¼Ž
+
+Fri May 17 15:40:10 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * process.c (rb_proc_exec): Thread対応時ã«execã®ç›´å‰ã«
+ ITIMER_VIRTUALをリセットã™ã‚‹ï¼Ž
+
+Tue May 14 02:12:44 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * signal.c (sighandle): SIGINTã«å¯¾ã—ã¦ãƒ‡ãƒ•ォルトã§ä¾‹å¤–を発生ã•ã›ã‚‹
+ ã®ã‚’ã‚„ã‚,status 130ã§exitã™ã‚‹ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * eval.c (thread_schedule): Threadã®ãƒã‚°ã¯ã»ã¨ã‚“ã©ã¨ã‚ŒãŸã‚ˆã†ã ï¼Ž
+
+Fri May 10 11:21:08 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (thread_schedule): ユーザレベルThread機能.効率ã¯ã¨ã‚‚ã‹ã
+ ç§»æ¤æ€§ã¯ã‚る.今後,threadé–“ã®é€šä¿¡æ©Ÿèƒ½ã‚’実装ã™ã‚‹äºˆå®šï¼Ž
+
+Thu May 2 21:22:31 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * time.c (time_timeval): struct timevalを直接返ã™ã‚ˆã†ã«(static変数
+ を使ã‚ãªã„).
+
+Wed May 1 17:27:32 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * process.c (f_sleep): 整数以外ã®timeを指定ã§ãるよã†ã«ï¼Ž
+
+Thu Apr 25 08:19:15 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (file_s_dirname): ファイルåãŒ"/"ã‚’å«ã¾ãªã„時,"."ã‚’è¿”ã™
+ よã†ã«(GNU dirnameã®ä»•様).
+
+ * file.c (file_s_basename): ã¾ã nilã¨0ã‚’æ··åŒã—ã¦ã„ã‚‹ã‚½ãƒ¼ã‚¹ãŒæ®‹ã£ã¦
+ ã„ãŸï¼Ž
+
+ * parse.y (exprs): エラーリカãƒãƒªã‚’追加.
+
+Wed Apr 24 15:51:05 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_chop_bang): CRLFã®å ´åˆ2 bytesã‚’chop!ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * ext/socket/socket.c (tcp_svr_s_open): ã¾ã nilã¨0ã‚’æ··åŒã—ã¦ã„るソー
+ ã‚¹ãŒæ®‹ã£ã¦ã„ãŸï¼Ž
+
+Tue Apr 23 18:14:25 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * pack.c (pack_pack): "A/a"ã®ãƒã‚°ï¼Žä½™è¨ˆãªpaddingãŒå…¥ã£ã¦ã„ãŸï¼Ž
+
+Thu Apr 18 13:02:11 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * configure.in: アーキテクãƒãƒ£ä¾å­˜éƒ¨ã‚’別ディレクトリã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«
+ ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * parse.y (yyerror): エラー発生時ã«ã‚¨ãƒ©ãƒ¼è¡Œã¨ãã®ä½ç½®ã‚’表示ã™ã‚‹ã‚ˆ
+ ã†ã«ï¼Ž
+
+Wed Apr 17 14:22:42 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * defines.h: SAFE_SIGHANDLEã‚’ç„¡ãã—,å±é™ºãªé¸æŠžã¯ã§ããªã„よã†ã«ï¼Ž
+
+ * io.c (io_ungetc): 新機能.
+
+ * ruby.c (load_file): ファイルã‹ã‚‰ã®èª­ã¿è¾¼ã¿æ–¹å¼ãŒå¤‰ã‚ã£ãŸã®ã«å¯¾å¿œï¼Ž
+
+ * parse.y (compile_file): ファイルã‹ã‚‰ã®å…¥åŠ›ã‚’ä¸€åº¦å…¨éƒ¨èª­ã¿è¾¼ã‚€ã®ã‚’
+ æ­¢ã‚ã¦ï¼Œgetsを使ã†ã“ã¨ã«ã—ãŸï¼Ž
+
+Wed Apr 10 17:40:11 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.98
+
+Tue Apr 9 09:54:30 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (iter_block): ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯ã®æŒ‡å®šã‚’メソッド呼ã³å‡ºã—
+ ã«é™å®šï¼Žæ–‡æ³•ã®æ˜Žç¢ºåŒ–.
+
+ * eval.c (rb_eval): æ¡ä»¶å¼ã®æ­£è¦è¡¨ç¾ã®æ¯”較をinline化.
+
+ * eval.c (rb_eval): defined? 㮠定義情報(種別)を文字列ã§è¿”ã™ï¼Ž
+
+ * node.h: NODE_BEGIN -> NODE_RESCUE, NODE_ENSUREã«åˆ†é›¢ï¼Ž
+
+ * eval.c (rb_eval): option -n/-pã®ãƒˆãƒƒãƒ—レベルループã®inline展開.
+
+ * parse.y (cond0): æ¡ä»¶å¼ä¸­ã®æ–‡å­—åˆ—ã¯æ¯”較ã®å¯¾è±¡ã¨ã—ãªã„
+
+Wed Mar 27 12:33:54 1996 Tairo Nomura <tairo@hucom.tp.titech.ac.jp>
+
+ * defines.h: NeXT対応
+
+Wed Mar 27 10:02:44 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y: 予約語ã®å¤‰æ›´ continue -> next
+
+Mon Mar 25 07:34:37 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (parse_regx): o(once)オプションを追加.
+
+Fri Mar 22 14:25:35 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.97d
+
+ * eval.c (dyna_var_defined): 動的ローカル変数ã®å®šç¾©ãƒã‚§ãƒƒã‚¯ç”¨ãƒ«ãƒ¼
+ ãƒãƒ³ï¼Ž
+
+ * parse.y (gettable): eval()ã®ä¸­ã§ã®å‹•的ローカル変数(æ—¢ã«å€¤ã‚’æŒã£
+ ã¦ã„ã‚‹ã‚‚ã®)ã®æ¤œå‡ºã«å¤±æ•—ã—ã¦ã„ãŸï¼Ž
+
+Tue Mar 19 10:46:47 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.97c
+
+ * re.c (reg_s_new): compile時ã«segmentation fault.
+
+ * parse.y (str_extend): ã„ã¤ã‚‚evalã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Wed Mar 13 11:00:42 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (str_extend): 文字列中ã®å¼å±•é–‹ã®ä¸å‚™ã‚’ç„¡ãã—ãŸï¼Ž
+
+ * parse.y: 下手ãªã‚¨ãƒ©ãƒ¼ãƒªã‚«ãƒãƒªã‚’外ã—ãŸï¼Ž
+
+Tue Mar 12 12:30:20 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rescue): é–“é•ã£ã¦ensureã§ã‚‚ä¾‹å¤–ã‚’æ•æ‰ã—ã¦ã„ãŸï¼Ž
+
+Wed Mar 6 12:11:03 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (var_extend): 変数展開"#{}"ã§ï¼Œä»»æ„ã®å¼ã‚’書ã‘るよã†ã«ã—
+ ãŸï¼Œã“れã§ã€Œå¤‰æ•°ã€å±•é–‹ã§ã¯ç„¡ããªã£ã¡ã‚ƒã£ãŸãªã‚.
+
+ * regex.c (init_syntax_once): `_'ã‚’wordã«è¿½åŠ ï¼Ž
+
+ * regex.c (re_compile_pattern): `\w',`\W'ã®åˆ¤å®šã‚’syntax tableを使
+ ã†ã‚ˆã†ã«ï¼Ž
+
+Tue Feb 27 10:15:32 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (obj_inspect): 表示ã™ã‚‹ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ãŒç„¡ã„時ã«ã¯ï¼Œ
+ to_sを使ã†ï¼Ž
+
+ * configure.in: dlnã®æ¤œå‡ºã‚’自動的ã«ï¼Ž
+
+Mon Feb 26 19:55:33 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.c (readin): read(2)ã§ä¸€åº¦ã«ãƒ•ァイルãŒèª­ã¿è¾¼ã‚ãªã„å ´åˆã«å¯¾å¿œï¼Ž
+
+Sat Feb 24 14:47:18 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.97b
+
+Fri Feb 23 11:26:02 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * class.c (rb_define_module): C言語ã§å®šç¾©ã•れãŸãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®PATHã®
+ 設定忘れ.文字列化ã§core dump.
+
+ * eval.c (mod_include): 戻り値をnilã«ï¼Ž
+
+ * version 0.97a
+
+Thu Feb 22 21:03:42 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * array.c (ary_times): 「é…列*文字列ã€ãŒjoinã¨åŒã˜åƒãã‚’ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Wed Feb 21 11:18:09 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * configure.in : fileCountをcache.
+
+ * configure.in : Linuxã§ELFç’°å¢ƒã‚’è‡ªå‹•çš„ã«æ¤œå‡ºã§ãるよã†ï¼Ž
+
+Tue Feb 20 11:18:09 1996 Mitsuhide Satou <mit-sato@aries.bekkoame.or.jp>
+
+ * FreeBSD dynamic link対応.
+
+Fri Feb 16 08:50:01 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (obj_inspect): インスタンス変数をæŒãŸãªã„オブジェクトも
+ æ­£ã—ã表示ã•れるよã†ã«ï¼Ž
+
+Wed Feb 14 16:56:44 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): æ¡ä»¶å¼ã®`2..2'ãªã©å·¦è¾ºæˆç«‹ç›´å¾Œã«å³è¾ºãŒæˆç«‹ã™ã‚‹
+ パターンã«ãƒã‚°ï¼Ž
+
+Tue Feb 13 18:22:22 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.97
+
+Fri Feb 9 21:32:55 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * lib/tkscrollbox.rb: スクロールã§tclã®è¨­å®šã‚’行ã„,ruby<->wishã®ä¸
+ è¦ãªé€šä¿¡ã‚’ç„¡ãã—ãŸï¼Ž
+
+Wed Feb 7 10:26:52 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_aref): indexã‚’unsigned intã§ã¨ã£ã¦ã„ãŸï¼Ž
+
+ * string.c (str_aref): 範囲外ã®indexã«å¯¾ã—ã¦nilã‚’è¿”ã™ï¼Ž
+
+ * parse.y (special_local_set): `$_'ãŒå®£è¨€ç„¡ã—ã«ä½¿ã‚れãŸå ´åˆã«å¯¾å¿œï¼Ž
+ 関数をvariable.cã‹ã‚‰ç§»å‹•.
+
+ * string.c (str_sub): ç½®æ›é–‹å§‹ä½ç½®ãŒé–“é•ã£ã¦ã„ãŸï¼Ž
+
+Tue Feb 6 16:17:31 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-parse-region): コメントã®èª­ã¿é£›ã°ã—ã®
+ ãƒã‚°ï¼Ž
+
+Fri Feb 2 18:35:28 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * variable.c (lastline_get): `$_'ã‚’`$~'ã¨åŒã˜ã‚ˆã†ã«SCOPEローカルãª
+ 変数ã«ã—ãŸï¼Ž
+
+Thu Feb 1 14:14:07 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c: statã®cacheã‚’ã‚„ã‚ãŸï¼Ž
+
+Wed Jan 31 07:13:08 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (proc_s_new): procã®ä¸­ã§yieldを呼ã°ã‚ŒãŸæ™‚ã«core dumpã—ã¦
+ ã„ãŸï¼Žã¨ã‚Šã‚ãˆãšä¾‹å¤–を発生ã•ã›ã‚‹ï¼Ž
+
+ * variable.c (rb_class2path): singleton classã«å¯¾å¿œï¼Ž
+
+ * ext/etc/etc.c (Init_etc): struct_defineã®ã‚¿ãƒ¼ãƒŸãƒãƒ¼ã‚¿ãŒnilã ã£ãŸ
+ (0ã§ãªã‘れã°ãªã‚‰ãªã„).
+
+ * ext/marshal/marshal.c: TRUE/FALSEã‚’åã出ã›ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * eval.c (rb_get_method_body): キャッシュã®alias対応,ã„ã¾ã¾ã§ã¯
+ aliasã¯ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã«å…¥ã£ã¦ã„ãªã‹ã£ãŸï¼Ž
+
+Tue Jan 30 09:55:13 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): NODE_BLOCK - tail recursive(ã¨ã„ã†ã»ã©ã§ã‚‚ãªã„
+ ãŒ).
+
+ * io.c (io_pipe): pipe(2)を実装ã—ãŸï¼Ž
+
+ * eval.c (rb_eval): Qselfã‚’ãªãã—ãŸï¼Žthread対応ã¸ã®ç¬¬ä¸€æ­©ï¼Žå…ˆã¯é 
+ ã„ãŒâ€¦ï¼Ž
+
+ * eval.c (proc_call): procã®ä¸­ã§ã®returnã¯procã®çµ‚了をæ„味ã™ã‚‹ã‚ˆã†
+ ã«ï¼ŽãŸã ã—,procã‹ã‚‰ã®yieldã®ä¸­ã§ã®returnã¯ä¾‹å¤–を発生ã™ã‚‹ï¼Ž
+
+Wed Jan 24 11:33:48 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.96a
+
+ * dir.c (dir_each): `$_'ã®å€¤ã‚’変更ã™ã‚‹ã®ã‚’ã‚„ã‚ãŸï¼Ž
+
+ * io.c (f_readlines): nilã¨FALSEã®åˆ†é›¢ã®ã‚ãŠã‚Šã§ç„¡é™ãƒ«ãƒ¼ãƒ—ã«è½ã¡ã¦
+ ã„ãŸï¼Ž
+
+ * ruby.c (ruby_options): $0ã®è¨­å®šãƒŸã‚¹ï¼Ž
+
+Tue Jan 23 15:28:21 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): ``ã¯æ–‡å­—列を引数ã¨ã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰(`)呼ã³å‡ºã—ã®ã‚·
+ ンタックスシュガーã§ã‚ã‚‹ã¨ã—ãŸï¼Ž
+
+ * ruby.c (addpath): `-I'オプションã§ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãŒã€Œå‰ã«ã€è¿½åŠ ã•れ
+ るよã†ã«å¤‰æ›´ï¼Ž
+
+Fri Jan 19 11:23:12 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * dln.c (load_1): N_INDR対応(出æ¥ãŸã‚ˆã†ãªæ°—ãŒã™ã‚‹).
+
+Thu Jan 18 18:14:20 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.texi: FALSEã¨nilã®åˆ†é›¢ã‚’åæ˜ ã—ãŸï¼Ž
+
+Tue Jan 16 17:39:23 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.96 - ã¨ã‚Šã‚ãˆãšnilã¨FALSEを区別ã™ã‚‹ç‰ˆ
+
+Wed Jan 10 15:31:48 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * re.c (reg_match): マッãƒã—ãªã‹ã£ãŸæ™‚ã®æˆ»ã‚Šå€¤ã¯FALSE.
+
+ * object.c (rb_equal): `0 == nil'ãŒTRUEã«ãªã‚‹ãƒã‚°ï¼Ž
+
+Tue Jan 9 00:44:58 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * nilã¨FALSEãŒåˆ†é›¢å¯èƒ½ã«å¤‰æ›´ï¼Ž
+
+ * nilã¨FALSEã¨0ã®åŒºåˆ¥ã‚’厳密ã«ï¼Ž
+
+ * struct.c (struct_new): 引数を0ã§çµ‚ã‚‹å¿…è¦ãŒç„¡ããªã£ãŸï¼Ž
+
+ * object.c (inspect_i): オブジェクトã®ãƒã‚§ãƒƒã‚¯ã®ãƒã‚°(Fixnumã§core
+ dumpã—ã¦ã„ãŸ).
+
+ * range.c (range_to_s): Rangeã®è¡¨ç¤ºã‚’改善.
+
+ * object.c (true_inspect): TRUEã®è¡¨ç¤ºã‚’`TRUE'ã«ï¼Ž
+
+Mon Jan 8 15:02:33 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * numeric.c (fix_mul): divide by zero errorãŒç™ºç”Ÿã—ãŸ(オーãƒãƒ¼ãƒ•ロー
+ 検出ã®ãƒã‚°)
+
+ * texinfo.texをパッケージã«å«ã‚ãŸï¼Ž
+
+Sun Dec 31 00:08:49 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): `::'ã§ã¯ï¼Œãã®ã‚¯ãƒ©ã‚¹ã§å®šç¾©ã•れãŸå®šæ•°ã‚’å‚ç…§ã™ã‚‹
+ よã†ã«å¤‰æ›´ï¼Ž
+
+ * string.c (Init_String): eachã‚’each_lineã«æˆ»ã—ãŸï¼Ž
+
+Thu Dec 28 12:31:55 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): caseã®æ¼”ç®—å­ã‚’`=~'ã‹ã‚‰`==='ã«ï¼Ž
+
+ * variable.c (rb_const_set): クラス定数ã®å†å®šç¾©ã‚’許ã™(åŒã˜ã‚¯ãƒ©ã‚¹ã§
+ ã¯ä¸å¯).警告ã¯å‡ºã™ï¼Ž
+
+Wed Dec 27 13:27:52 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.95c
+
+ * ext/tkutil/tkutil.c: wishãŒã‚ã£ã¦ã‚‚ãªãã¦ã‚‚一応コンパイルã ã‘ã¯
+ ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * lib/tk.rb: 環境変数PATHã‹ã‚‰{wish|wish4.0}を探ã™ã‚ˆã†ã«ï¼Ž
+
+Tue Dec 26 01:03:42 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-parse-region): æ­£è¦è¡¨ç¾ã®æ¤œå‡ºå¼·åŒ–.
+
+ * numeric.c (fix_mul): ä¹—ç®—ã®ã‚ªãƒ¼ãƒãƒ¼ãƒ•ロー検出アルゴリズムã®ãƒã‚°ï¼Ž
+
+ * ext/extmk.rb.in: ./install-shを使ã†å ´åˆã®PATHを調整.
+
+ * Makefile.in (install): lib/*.rbを一ã¤ãšã¤ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ï¼Ž
+
+ * io.c (io_each_line): ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã®æˆ»ã‚Šå€¤ã‚’nilã§çµ±ä¸€ï¼Ž
+
+Fri Dec 22 10:34:32 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.95b
+
+ * variable.c (f_untrace_var): 第2引数を指定ã™ã‚‹ã¨ç‰¹å®šã®traceを削除
+ ã§ãるよã†ã«ï¼Ž
+
+ * variable.c (f_trace_var): 第2引数ãŒnilã®æ™‚,traceを削除ã™ã‚‹ï¼Ž
+
+ * lib/tk.rb (file_readable/file_writable): 第2引数をnilã«ã™ã‚‹ã“ã¨
+ ã«ã‚ˆã‚‹event handlerã®å‰Šé™¤ï¼Ž
+
+ * parse.y (variable): ドキュメントã«`__FILE__'ã¨`__LINE__'ãŒæ®‹ã£ã¦
+ ã„ãŸï¼Ž`caller(0)'ã§ä»£ç”¨ã—ãŸã¯ãšã ã£ãŸã®ã«ï¼Ž
+
+ * eval.c (f_eval): $!ã®ãƒªã‚»ãƒƒãƒˆï¼Ž
+
+ * error.c (err_sprintf): 勿‰‹ã«"\n"を付加ã™ã‚‹ã®ã‚’æ­¢ã‚ãŸï¼Ž
+
+ * parse.y (f_arglist): 引数リスト直後ã®if/whileã®èª­ã¿é–“é•ã„.
+ lex_stateã®å€¤ãŒè¨­å®šã•れã¦ã„ãªã‹ã£ãŸï¼Ž
+
+Thu Dec 21 00:56:57 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.95a - ^^;;;
+
+ * lib/tkscrollbox.rb: パッケージã«å…¥ã£ã¦ãªã‹ã£ãŸï¼Ž
+
+ * configure.in: FILE structureã®ãƒã‚§ãƒƒã‚¯ã«ãƒã‚°ï¼Ž
+
+ * Makefile.in (clean): ext以下をinstallã—ã¦ã„ãŸï¼Ž
+
+ * ext/socket/extconf.rb: Solarisã«ãŠã‘ã‚‹-lnlsã®ãƒã‚§ãƒƒã‚¯ï¼Ž
+
+ * array.c (beg_len): ãƒã‚°ãŒã‚ã£ãŸâ€¦ï¼Žæ‚²ã—ã„.
+
+ * version 0.95 - fj.sourcesã«
+
+ * eval.c (rb_eval): rescueã®ãƒ­ã‚¸ãƒƒã‚¯ã‚’rb_rescue()ã«ä¸€å…ƒåŒ–.
+
+Wed Dec 20 19:30:58 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * Makefile.in: ä¸è¦ãªã‚³ãƒ³ãƒ‘イルã®å›žé¿(より完全ã«).
+
+ * class.c (singleton_class_new): `single'->`singleton'
+
+Tue Dec 19 07:14:33 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * io.c (closed?): IOãŒcloseã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ã‚’知る述語.
+
+ * parse.y (primary): 特異メソッドã®å¼•æ•°ã®lex_stateãŒä¸é©åˆ‡ï¼Ž
+
+ * lib/tk.rb: tcl->rubyã®å¤‰æ›é–¢æ•°ã®ç”¨æ„.
+
+ * ext/extmk.rb.in (install): installã®2é‡ã‚³ãƒ³ãƒ‘イルã®å›žé¿ï¼Ž
+
+ * array.c (range_beg_len): range指定ã®ä¸é©åˆ‡ãªã‚¨ãƒ©ãƒ¼ã‚’訂正.
+
+ * string.c (str_aref): range指定ã®ãƒã‚°ã‚’削除.
+
+ * lib/tk.rb (tk_split_list): Tclã®ãƒªã‚¹ãƒˆã«å¯¾å¿œï¼Ž
+
+Mon Dec 18 09:58:12 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.94
+
+ * dln.c (dln_load): HP対応(未確èª)
+
+ * eval.c (Init_Proc): Blockã‚’Procã«æ”¹å.
+
+Sat Dec 16 13:46:14 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): retryã§ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã®å†å®Ÿè¡ŒãŒã§ãるよã†ã«ï¼Ž
+
+Fri Dec 15 17:14:30 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c: proc:lambdaã®è¦ªã—ã¿ã‚„ã™ã„別å
+
+Thu Dec 14 17:21:55 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (dyna_var_asgn): ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯å†…ã§æœ€åˆã«åˆæœŸåŒ–ã•れãŸ
+ ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã®æœ‰åŠ¹ç¯„å›²ã‚’ãã®ãƒ–ロック内ã«é™å®šï¼Žã“れã§lambdaã¨å‘¼ã¹
+ ãªã„ã“ã¨ã¯ãªã„.
+
+Wed Dec 13 02:30:58 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * gc.c: autoloadã®ãƒžãƒ¼ã‚¯ãƒŸã‚¹ï¼Ž
+
+ * lib/tk.rb: wishã‹ã‚‰ã®è¤‡æ•°è¡Œã®æˆ»ã‚Šå€¤ã«å¯¾å¿œ
+
+ * lib/tkcomposite.rb: 複åˆwidget
+
+ * variable.c (rb_class2path): ICLASSã«å¯¾å¿œã—ã¦ãªã‹ã£ãŸï¼Ž
+
+ * eval.c (ruby_run): exit(0)ã®ãƒã‚°
+
+Sat Dec 9 01:21:24 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/marshal/marshal.c (dumps|load): 文字列ã«å¯¾ã™ã‚‹å…¥å‡ºåŠ›ã‚’å¯èƒ½ã«
+ ã—ãŸ(ãŸã ã—実ã¯ãƒ•ァイル経由ãªã®ã ).
+
+Fri Dec 8 18:29:11 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/marshal/marshal.c: シンボルを一度ã ã‘åˆæœŸåŒ–ã™ã‚‹ï¼Ž
+
+Thu Dec 7 07:58:50 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (yylex): 第1å¼•æ•°ã®æ­£è¦è¡¨ç¾ã®èªè­˜ã«ã‚¨ãƒ©ãƒ¼ãŒã‚ã£ãŸï¼ŽåŒæ™‚ã«
+ 状態数を減らã—ãŸï¼Ž
+
+ * string.c (str_sub): ç½®æ›ã§ã‚¹ã‚­ãƒƒãƒ—å¹…ãŒå¤§ãã™ãŽãŸï¼Ž
+
+Wed Dec 6 15:14:23 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_sub_method): sub/gsub(!ãªã—)ã¯ç½®æ›ãŒè¡Œãªã‚れãªã‹ã£
+ ãŸæ™‚,置æ›å‰ã®æ–‡å­—列を返ã™ï¼Ž
+
+Tue Dec 5 00:55:15 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (yylex): 括弧をçœç•¥ã—ãŸæ™‚ã®å¼•数展開ã®`*'ã«å¯¾å¿œï¼Ž
+
+ * eval.c (ruby_run): EXITãƒãƒ³ãƒ‰ãƒ©å†…ã§ã®ä¾‹å¤–ã«å¯¾å¿œï¼Ž
+
+ * bignum.c (big_cmp): Bignumã¨Fixnumã®æ¯”較ã§è½ã¡ã‚‹ï¼Ž
+
+Mon Dec 4 14:21:18 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (call_op): コンパイル時ã®å®šæ•°å¼ã®å±•é–‹ã‚’ã‚„ã‚ãŸï¼ŽåŠ´å¤šãã—
+ ã¦ç›Šå°‘ãªã„ã¨åˆ¤æ–­ã—ãŸã®ã§ï¼Ž
+
+Thu Nov 30 01:35:15 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * lib/tk.rb: {Radio,Check}Buttonã®variableã®å®Ÿè£….
+
+ * eval.c (rb_yield_0): Block.callãŒãƒã‚¹ãƒˆã—ãŸæ™‚ã®ãƒã‚°ï¼Ž
+
+ * io.c (f_select): 常ã«é…列3ã¤ã‚’ãµãã‚€é…列を返ã™ã‚ˆã†ã«
+
+ * lib/tk.rb: fileeventã‚’rubyå´ã§å®Ÿè£….
+
+Wed Nov 29 17:53:23 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * variable.c (rb_ivar_get): selfã‚’å¸¸ã«æŒ‡å®šã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Tue Nov 14 00:07:29 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * lib/tk.rb: Tk4.0対応
+
+Mon Nov 13 16:23:32 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.93
+
+Thu Nov 9 23:26:01 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * gc.c (gc_mark): モジュールã®Mixinã®ãƒžãƒ¼ã‚¯å¿˜ã‚Œï¼Ž
+
+ * parse.y (f_arglist): メソッド定義ã®å¼•æ•°ã‚’æ‹¬å¼§ã§æ‹¬ã‚‰ãªãã¦ã‚‚良ã„
+ よã†ã«ã—ãŸï¼Ž
+
+Wed Nov 8 00:17:51 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_yield_0): æœªåˆæœŸåŒ–ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ãŒã‚ã£ãŸï¼Ž
+
+ * eval.c (rb_eval): pendig signalã®ãƒã‚§ãƒƒã‚¯ã‚’eval実行後ã«è¡Œã†ã‚ˆã†
+ ã«ã—ãŸï¼Žã§ãªã„ã¨ã‚·ã‚°ãƒŠãƒ«ã®ç™ºç”Ÿã¨æ¤œå‡ºãŒé ã離れã¦ã—ã¾ã†äº‹ãŒã‚る.
+
+ * parse.y: classæ–‡ã®superclass部を定数ã‹ã‚‰å¼ã«æ‹¡å¼µã—ãŸï¼Ž
+
+ * lib/tk.rb: Tkã®ã»ã¼å…¨ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚¯ãƒ©ã‚¹ã«å¯¾å¿œï¼Žã‚­ãƒ£ãƒ³ãƒã‚¹ã¨ãƒ†ã‚­ã‚¹
+ ト上ã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆãŒæ®‹ã£ã¦ã„る.
+
+Tue Nov 7 08:18:37 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * signal.c (trap): ブロックを指定ã§ãるよã†ã«ï¼Ž
+
+Mon Nov 6 16:44:00 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (f_caller): å‘¼å‡ºå…ƒã®æƒ…報を得る.
+
+ * ext/tkutil/tkutil.c: wishã®stderr出力を監視ã™ã‚‹ã“ã¨ã§ï¼Œã‚¨ãƒ©ãƒ¼å‡¦
+ ç†ã‚’行ã†ï¼Ž
+
+ * ext/tkutil/tkutil.c: wishã¨ã®é€šä¿¡éƒ¨ã‚’Cã§è¨˜è¿°ï¼Ž
+
+Sat Nov 4 01:12:59 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el (ruby-calculate-indent): インデントã®è¨ˆç®—ã‚’
+ ã‚‚ã†å°‘ã—スマートã«ã—ãŸ(æ­£è¦è¡¨ç¾ã®ãƒã‚§ãƒƒã‚¯ï¼Œç¶™ç¶šè¡Œã®ãƒã‚§ãƒƒã‚¯).
+
+ * eval.c (rb_call): ç„¡é™å†å¸°ã‚’é¿ã‘ã‚‹ãŸã‚,関数ã®ãƒã‚¹ãƒˆãƒ¬ãƒ™ãƒ«ã®åˆ¶é™
+ を行ãªã†ï¼Ž
+
+ * lib/tk.rb: Tkインターフェース.ã¾ã ä¸å®Œå…¨ã ãŒï¼Ž
+
+ * eval.c (rb_yield_0): 空ã®Blockã®ãƒã‚°ï¼Ž
+
+ * sample/ruby-mode.el (ruby-calculate-indent): è¡Œæœ«ã®æ¼”ç®—å­ã«ã‚ˆã‚‹
+ 行継続ã«å¯¾å¿œï¼Ž
+
+Fri Nov 3 12:56:21 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_call): 本体ãŒç©ºã®é–¢æ•°ã®å®Ÿè¡Œã«ãƒã‚°ï¼Ž
+
+ * parse.y (var_extend): æ–‡å­—åˆ—ã®æœ«å°¾ã®å¤‰æ•°å±•é–‹ã®ãƒã‚°ï¼Ž
+
+ * variable.c (rb_gvar_set): traceã®è©•価時ã«ã«å¤‰æ•°å€¤ã‚’与ãˆã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * eval.c (f_require): ruby scriptã®requireã«bug.
+
+ * variable.c (rb_const_get): モジュールã®include対策.
+
+Thu Oct 19 13:56:06 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * dln.c (dln_load): HP対応ã§ã®typo.
+
+Wed Oct 18 17:39:39 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.92
+
+ * object.c (krn_type): オブジェクトã®å‹•çš„ãªåž‹ã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼Ž
+
+Tue Oct 17 00:48:18 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.c (proc_options): -X オプション.chdirã ã‘を行ã†ï¼Ž
+
+ * re.c (reg_search): 漢字コードを途中ã§å¤‰æ›´ã§ãるよã†ã«ï¼Žã‚³ãƒ³ãƒ‘イ
+ ル時ã®ã‚³ãƒ¼ãƒ‰ãŒå¤‰æ›´ã•ã‚ŒãŸæ™‚ã«ã¯ãƒžãƒƒãƒã®ç›´å‰ã«æ­£è¦è¡¨ç¾ã®å†ã‚³ãƒ³ãƒ‘イ
+ ルを行ã†ï¼Žå®šæ•°KCODEã‹ã‚‰å¤‰æ•°$KCODEã¸ï¼Ž
+
+ * parse.y: ()ã®ãªã‹ã«compexprを許ã™ï¼Ž
+
+ * re.c (reg_search): メモリリークを直ã—ãŸï¼Ž
+
+Fri Oct 13 13:19:19 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (str_sub): 文字列置æ›ã«ãƒã‚°ï¼Ž
+
+ * string.c (str_strip_bang): 文字列ã®å¾Œã‚ã®é•·ã•ã®èª¿æ•´ãŒè¡Œã‚れã¦ã„
+ ãªã‹ã£ãŸï¼Ž
+
+ * re.c (reg_search): $&, $1...ã¯ãƒ­ãƒ¼ã‚«ãƒ«ã«æŸç¸›ã™ã‚‹ã‚ˆã†ã«ãªã£ãŸï¼Žå‘¼
+ ã³å‡ºã—ãŸãƒ¡ã‚½ãƒƒãƒ‰ã§ã®ãƒžãƒƒãƒã¯ç¾ã‚¹ã‚³ãƒ¼ãƒ—ã®$&ãªã©ã®å€¤ã«å½±éŸ¿ã—ãªã„.
+ マッãƒã®æƒ…報をスコープ外ã§å¾—ãŸã„ã¨ãã«ã¯$~を使ã£ã¦æŸç¸›æƒ…報をæŒã¡
+ 出ã™å¿…è¦ãŒã‚る.
+
+Thu Oct 12 00:33:33 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * re.c (reg_search): String:split, String:indexã§ã¯$&, $1...ãŒå¤‰åŒ–
+ ã—ãªã„よã†ã«ã—ãŸï¼Ž
+
+ * io.c (rb_str_setter): setterã®ä»•様ãŒå¤‰æ›´ã«ãªã£ã¦ã„ãŸï¼Ž
+
+ * variable.c (f_trace_var): 第2引数をçœç•¥ã—ã¦ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã¨ã—ã¦å‘¼ã¹
+ るよã†ã«ï¼Ž
+
+Wed Oct 11 11:50:59 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.91
+
+ * variable.c (var_setter): 引数ãŒé–“é•ã£ã¦ã„ãŸï¼Žè‡´å‘½çš„ãƒã‚°ï¼Ž
+
+ * io.c (pipe_open): $stderrã®å€¤ãŒå¤‰æ›´ã•れã¦ã„る時ã«ã¯ãã¡ã‚‰ã‚’
+ å­ãƒ—ロセスã®stderrã«è¨­å®šã™ã‚‹ï¼Ž
+
+Mon Oct 9 13:06:33 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (mod_to_s): モジュール内ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯`::'を使ã£ãŸè¡¨ç¾
+ ã§è¡¨ç¤ºã•れるよã†ã«ï¼Ž
+
+ * variable.c (rb_gvar_set): 代入ã«ã‚ˆã‚‹ãƒ«ãƒ¼ãƒ—ãŒç™ºç”Ÿã—ãªã„よã†ã«ï¼Œ
+ trace内ã§ã®ä»£å…¥ã§ã¯traceを評価ã—ãªã„.
+
+ * struct.c (struct_equal): structã®equal判定ã«ã‚¯ãƒ©ã‚¹ã®ä¸€è‡´ã‚’å«ã‚ãŸï¼Ž
+
+Sat Oct 7 00:18:32 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_eval): defined?ã®æ©Ÿèƒ½ã‚’æ‹¡å¼µ(yieldã®ãƒã‚§ãƒƒã‚¯ï¼Œsuperã®
+ 存在ãªã©).
+
+Fri Oct 6 12:06:47 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.90
+
+ * st.c (st_foreach): è¦ç´ ã‚’削除ã—ãŸæ™‚ã«è¦ç´ æ•°ãŒå¤‰åŒ–ã—ã¦ã„ãªã‹ã£ãŸï¼Ž
+
+ * hash.c (hash_values): ãƒã‚°ä¿®æ­£ï¼Žkeysã‚’è¿”ã—ã¦ã„ãŸâ€¦ï¼Ž
+
+ * parse.y (call_op): defined? ã®å¼•æ•°ã§ã¯å®šæ•°ã®ç•³ã¿è¾¼ã¿ã‚’行ã‚ãªã„
+ (ãƒã‚§ãƒƒã‚¯ã™ã‚‹å‰ã«ã‚³ãƒ³ãƒ‘イルエラーã«ãªã£ã¦ã¯å›°ã‚‹).
+
+ * スコープ生æˆã®ä¸€éƒ¨è¦‹ç›´ã—.
+
+Thu Oct 5 00:29:43 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * 関数ã¨ã‚¯ãƒ©ã‚¹ã®å‘½åè¦å‰‡ã‚’変更ã—ãŸï¼Žé–¢æ•°å,変数åã®å…¨é¢æ›¸ãæ›ãˆï¼Ž
+
+ * gc.c (looks_pointerp): ヒープãƒã‚§ãƒƒã‚¯ã®é«˜é€ŸåŒ–.
+
+ * struct.c (Fstruct_aset): 構造体ã«å¯¾ã™ã‚‹`[]='.
+ (struct_set): 構造体メンãƒã«å¯¾ã™ã‚‹ä»£å…¥ï¼Ž
+
+Wed Oct 4 09:54:07 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.89
+
+ * eval.c (Frequire): ダイナミックロードã®ã‚¨ãƒ©ãƒ¼ãƒã‚§ãƒƒã‚¯ã‚’厳ã—ã.
+
+ * struct.c: structã®æ§‹é€ ã‚’å®Œå…¨ã«æ›¸ãæ›ãˆãŸï¼Žä»¥å‰ã¯é †åºä»˜ãã®
+ id->valueã®é€£æƒ³é…列ã§ã‚ã£ãŸãŒï¼Œä»Šåº¦ã¯æ§‹é€ ä½“æ¯Žã«æ–°ã—ã„クラスを生
+ æˆã™ã‚‹ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * parse.y: `::'ã®æ„味をAssocã®ç”Ÿæˆã‹ã‚‰ã‚¯ãƒ©ã‚¹(モジュール)内ã®å®šæ•°ã‚¢
+ クセスã¸å¤‰æ›´ï¼Ž
+
+ * assoc.c: ãªãã™ï¼Ž
+
+Tue Oct 3 13:31:08 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * variable.c (Ftrace_var): trace_var, 大域変数ã¸ã®æ›¸ãè¾¼ã¿hookを設
+ 定ã™ã‚‹ï¼Ž
+
+ * variable.c: global_entryã®æ§‹æˆã‚’æ›¸ãæ›ãˆãŸï¼Žã“れã§trace_varを実
+ 装ã§ãる.
+
+ * file.c (Ffile_stat): "&"ã§ç›´å‰ã®fstatã®çµæžœã‚‚å‚ç…§ã§ãるよã†ã«ï¼Ž
+
+Fri Sep 29 14:15:13 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.88
+
+ * dln.c (dln_load): AIXã¨HPã«å¯¾å¿œã—ãŸã‚³ãƒ¼ãƒ‰ã‚’入れãŸ(å‹•ä½œã¯æœªç¢ºèª).
+
+ * ext/extmk.rb.in: å¿…è¦ã«å¿œã˜ã¦ï¼Œå®šæ•°EXTLIBを定義ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * dln.c (dln_load): dlnç‹¬ç«‹ã«æ›¸ãæ›ãˆã‚‹ï¼Žå°†æ¥ã®æ‹¡å¼µç”¨ï¼Ž
+ (load_1): dln_a_outã«ãŠã„ã¦ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã§ãƒ©ã‚¤ãƒ–ラリを明示的ã«ãƒ­ãƒ¼
+ ドã™ã‚‹å¿…è¦ãŒãªã„よã†ã«å¤‰æ›´ã—ãŸï¼Ž
+
+Thu Sep 28 13:31:37 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/ruby-mode.el: ã‚‚ã£ã¨ã¾ã—ãªhilit19対応(æ­£è¦è¡¨ç¾).
+
+Wed Sep 27 04:12:44 1995 Takahasi Mamoru <taka@soum.co.jp>
+
+ * sample/test.rb: echoã§-nを使ã‚ãªã„よã†ã«(SysV対策).
+
+ * ext/extmk.rb.in: sub -> sub!
+
+Tue Sep 26 19:12:42 1995 Yasuo OHBA <jammy@csg.mes.co.jp>
+
+ * dln.c (dln_find_1): `.', `..'ã‹ã‚‰å§‹ã¾ã‚‹ãƒ‘スã«å¯¾å¿œã—ãŸ.
+
+Mon Sep 25 12:33:03 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.87
+
+Sat Sep 23 10:00:18 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (Fmod_modfunc): メソッドをprivateã«ã—ï¼ŒåŒæ™‚ã«ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰
+ も定義ã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ï¼Žãƒ‘ãƒƒã‚±ãƒ¼ã‚¸çš„ä½¿ã„æ–¹ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ç”¨ï¼Ž
+
+Fri Sep 22 11:02:44 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * lib/find.rb: findã‚’æä¾›ã™ã‚‹ãƒ©ã‚¤ãƒ–ラリ
+
+ * variable.c (rb_define_variable): hookã®è¨­å®šã‚’分離.
+ (add_hook): 1変数ã«å¯¾ã—ã¦è¤‡æ•°ã®hookを設定ã§ãるよã†ã«ï¼Ž
+
+Thu Sep 21 00:22:11 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (Fstr_frozen): æ–‡å­—åˆ—ãŒæ›´æ–°ä¸å¯ã‹ã©ã†ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹è¿°
+ 語メソッド.
+
+ * hash.c (Fhash_aset): keyãŒæ–‡å­—åˆ—ã®æ™‚,キーã®å†…容ãŒå¤‰åŒ–ã—ãªã„よã†
+ ã«ï¼Œdupã—ã¦freezeã™ã‚‹ï¼Ž
+
+Wed Sep 20 16:12:44 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.86
+
+ * ext/extmk.rb.in (have_header): キャッシュã«ãƒã‚°ï¼Ž
+
+ * ext/extmk.rb.in (have_library): 引数ã®é †åºãŒå¤‰ã‚ã£ãŸï¼Ž
+
+Thu Sep 14 18:00:59 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * object.c (obj_is_instance_of): is_member_ofã‹ã‚‰å称変更.
+
+ Wed Sep 13 15:44:35 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (Fstr_tr_bang): ç¯„å›²å¤–ã®æ–‡å­—ã«å¯¾ã™ã‚‹å¤‰æ›ãƒã‚°ï¼Ž
+
+Tue Sep 12 14:27:58 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (Sfile_expand_path): expand_file_name -> expand_pathã«å
+ 称変更.
+
+ * enum.c (Fenum_member): includes? -> member? ã«å称変更.
+
+ * string.c (Fstr_each_byte): Stringã¯ByteArrayã§ã‚ã‚‹ã¨ã„ã†åŸºæœ¬ã«æˆ»ã£
+ ã¦ï¼Œeachã®å®šç¾©ã‚’each_byteã«å¤‰æ›´ã—ãŸï¼Žä»Šã¾ã§ã®eachã¯each_lineã§ã‚¢
+ クセスã§ãる.
+
+Mon Sep 11 18:31:17 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (cache_stat): ファイルåã¨ã—ã¦"&"を指定ã™ã‚‹ã¨ç›´å‰ã®
+ stat(2)ã®çµæžœã‚’å†åˆ©ç”¨ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Fri Sep 8 14:18:51 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ruby.texi: `!', `?'ã«å¯¾å¿œã—ã¦ã‚¢ãƒƒãƒ—デート.
+
+ * parse.y: defined -> defined?
+
+ * file.c: FileOpã®ä¸€æ–‡å­—メソッドをãªãã™ï¼Žä¸€æ–‡å­—テストã¯testメソッ
+ ドã«ã¾ã‹ã›ã‚‹ï¼Ž
+
+ * parse.y (yylex): 変数åã®å¾Œã‚ã«`?'も許ã™ï¼Žè¿°èªžãƒ¡ã‚½ãƒƒãƒ‰ã®å¾Œã‚ã«
+ `?'を追加ã™ã‚‹ï¼Ž
+
+Thu Sep 7 20:01:33 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c: 文字列ã®ä¸­èº«ã‚’æ›´æ–°ã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ã®åå‰ã®çµ‚りã«`!'を付加.
+ `!'ã®ç„¡ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚‚用æ„ã—ãŸï¼Ž
+
+ * parse.y: 変数åã®å¾Œã‚ã«`!'を許ã™ï¼Ž
+
+Wed Sep 6 14:12:19 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.85
+
+ * string.c (Fstr_dup): 文字列ã®è¤‡è£½ã‚’作る
+ (Fstr_freeze): æ–‡å­—åˆ—ã®æ›´æ–°ä¸å¯å±žæ€§ã‚’設定ã§ãるよã†ã«ï¼Ž
+ (Fsub/Fgsub): $_ã®å†…容をdupã—ã¦ã‹ã‚‰ç½®æ›ã‚’行ã†ã‚ˆã†ã«ï¼Ž
+
+ * ruby.h (CLONESETUP): flagsã®çŠ¶æ…‹ã‚‚ã‚³ãƒ”ãƒ¼
+
+Tue Sep 5 01:27:50 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * sample/test.rb: å¤±æ•—ã®æ¤œå‡ºã‚’厳ã—ã.
+
+Fri Aug 25 14:31:02 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * process.c (Ffork): イテレータã¨ã—ã¦ã‚‚動作ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * version 0.84
+
+ * signal.c (sig_beg): ãƒãƒ³ãƒ‰ãƒ©ãŒè¨­å®šã•れã¦ã„る時ã«ã¯å†è¨­å®šã—ãªã„.
+
+ * ext/extmk.rb.in (create_makefile): shared objectã®ãƒªãƒ³ã‚¯ã®éš›ã«
+ `-l'オプションを指定ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * signal.c (trap): `EXIT'ã§çµ‚了処ç†ã‚’行ã†è¨­å®šãŒå‡ºæ¥ã‚‹ï¼Ž
+
+Wed Aug 16 00:13:22 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * signal.c (sig_beg): デフォルトã§ã¯begin節ã®ä¸­ã§ã ã‘SIGINTã‚’æ•æ‰
+ ã™ã‚‹ã‚ˆã†ã«å¤‰æ›´ï¼Ž
+
+ * io.c (io_ctl): fcntlã‚’æŒãŸãªã„システムã«ã‚‚対応.
+
+ * å„ディレクトリã«åˆ†æ•£ã—ã¦ã„ãŸMANIFESTã‚’ã¾ã¨ã‚ãŸï¼Žæ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«æ¯Ž
+ ã«ã¯å¿…è¦ï¼Ž
+
+ * string.c (Sstr_new,str_sub,Fstr_crypt): å¼•æ•°ã‚’è‡ªå‹•çš„ã«æ–‡å­—列ã«å¤‰
+ æ›ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Sat Aug 12 00:44:02 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * string.c (Fstr_crypt): PD cryptを用æ„ã—ãŸï¼Ž
+
+Fri Aug 11 14:37:03 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * assoc.c (Fassoc_clone): assocã‚‚cloneã§ãるよã†ã«ï¼Ž
+
+ * io.c: マクロREAD_DATA_PENDINGã®å®šç¾©ã‚’変更(Linux対応)
+
+ * io.c (io_fptr_finalize): fptrã®é–‹æ”¾æ™‚ã®å‡¦ç†ã‚’指定ã§ãるよã†ã«ï¼Ž
+
+Wed Aug 9 16:52:41 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * eval.c (rb_provided): 複数ã®featureをロードã™ã‚‹ã¨ç„¡é™ãƒ«ãƒ¼ãƒ—ã«è½
+ ã¡ã‚‹ã¨ã„ã†å˜ç´”ãª(ã—ã‹ã—凶悪ãª)ミス.
+
+ * ext/extmk.rb.in (install): dlopen対応を行ã£ãŸï¼Žä»Šã¾ã§dlnã«ã—ã‹å
+ 分ã«å¯¾å¿œã—ã¦ã„ãªã‹ã£ãŸï¼Ž
+
+Tue Aug 8 14:17:06 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.83
+
+Mon Aug 7 12:47:41 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y: resque -> rescue.æ¥ãšã‹ã—ã„ãŒtypoを残ã—ã¦ãŠãã‚ã‘ã«ã¯
+ ã„ã‹ãªã„よãªã‚.ãªã‚“ã§ä»Šã¾ã§æ°—ãŒã¤ã‹ãªã‹ã£ãŸã®ã‹â€¦ï¼Ž
+
+Thu Aug 3 18:18:05 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * missing/nt.c: NTç§»æ¤ç”¨ã®é–¢æ•°ç¾¤ã‚’ã¾ã¨ã‚ãŸï¼Ž
+
+ * variable.c (rb_const_get): ã¾ãŸä¾‹å¤–を発生ã™ã‚‹ã‚ˆã†ã«ã—ãŸï¼Ždefined
+ ãŒã‚る以上例外を発生ã•ã›ãªã„ç†ç”±ãŒãªã„ã®ã§(例外ãŒç™ºç”Ÿã—ãŸæ–¹ãŒã‚¿
+ ã‚¤ãƒ—ãƒŸã‚¹ã®æ¤œå‡ºãªã©ã®ç‚¹ã§æœ‰åˆ©).
+
+ * variable.c (Fautoload): autoloadを実装.今度ã¯ä½¿ãˆã‚‹ã‹ï¼Ž
+
+Mon Jul 31 15:44:21 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (arg_ambiguous): 第1引数ã®ã‚ã„ã¾ã„ã•を警告(-vオプション
+ ã§æœ‰åй).
+
+ * eval.c (rb_eval): `-v'オプションをã¤ã‘ã¦`def'ãŒå‘¼ã°ã‚Œã‚‹ã¨ä¸å¿…è¦
+ ãªã‚¨ãƒ©ãƒ¼ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒå‡ºãŸï¼Ž
+
+ * parse.y (yylex): メソッドã®ç¬¬1引数ã®åˆ¤å®šã‚’ã‚‚ã†ã¡ã‚‡ã£ã¨è³¢ãã—ãŸï¼Ž
+
+Fri Jul 28 19:04:43 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (yylex): `+/-/['ã®ç›´å‰ã«ç©ºç™½ãŒæ¥ã‚‹ã‹ã©ã†ã‹ã§å‹•作を変更ã—
+ ãŸ(æ··ä¹±ã®ã‚‚ã¨ã‹?)
+
+Wed Jul 26 09:21:23 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.82a
+
+ * sprintf.c (Fsprintf): `%s'ã§'\0'ã‚’å«ã‚€æ–‡å­—列ã«å¯¾å¿œï¼Ž
+
+ * pack.c (Fpck_pack): packã®è¦ç´ ç¢ºä¿ã®ãƒã‚°ï¼Ž
+
+ * eval.c (Floop): ç„¡é™ãƒ«ãƒ¼ãƒ—ã®ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ï¼Ž
+
+ * io.c (next_argv): 存在ã—ãªã„ファイルåãŒæŒ‡å®šã•ã‚ŒãŸæ™‚ã®ã‚¨ãƒ©ãƒ¼å‡¦ç†
+ ãŒè¡Œã‚れã¦ã„ãªã‹ã£ãŸï¼Ž
+
+Mon Jul 24 17:37:34 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.82
+
+ * ext/extmk.rb.in (install): 拡張モジュールをstatic linkã™ã‚‹å ´åˆã¯
+ ãã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ãŒæ—¢ã«requireã•れãŸã®ã¨åŒã˜ã‚ˆã†ã«featureを設定ã™ã‚‹ï¼Ž
+ ã“ã‚Œã§æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®æ©Ÿèƒ½ãŒå¿…è¦ãªæ™‚ã«ã¯(static linkã•れã¦ã„ã‚‹ã‹
+ ã©ã†ã‹ã«ã‹ã‹ã‚らãš)requireã™ã‚Œã°ã‚ˆããªã‚‹ï¼Ž
+
+ * eval.c (Frequire): `$"'ã«æ ¼ç´ã™ã‚‹æ–‡å­—列をフルパスã§ãªãフィーãƒãƒ£
+ åã¨ã™ã‚‹ï¼Žrubyスクリプトをロードã—ãŸæ™‚ã«ã¯`.rb',オブジェクトを
+ ロードã—ãŸæ™‚ã«ã¯`.o'をフィーãƒãƒ£åã«ä»˜åŠ ã™ã‚‹ï¼Žlispã®requireã¨
+ provideã®åƒãã«(å°‘ã—)è¿‘ã„.
+
+Thu Jul 20 12:50:05 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * Makefile.in (test): make testãŒã§ãるよã†ã«ï¼Ž
+
+ * struct.c (struct_new): typo.
+
+ * eval.c (rb_eval): `defined'を追加.メソッド/変数/定数ã®å®šç¾©çŠ¶æ…‹
+ を知る事ãŒå‡ºæ¥ã‚‹ï¼Ž
+
+Wed Jul 19 18:04:01 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.81
+
+Mon Jul 17 14:53:51 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * variable.c (rb_const_get): æœªåˆæœŸåŒ–ã®CONSTANTã®å€¤ã‚’nilã«ã—ãŸï¼Žã—
+ ã‹ã—,今後ã¾ãŸä¾‹å¤–ã«æˆ»ã™å¯èƒ½æ€§ã¯ã‚る.è¦ã¯optionalãªã‚¯ãƒ©ã‚¹/モジュー
+ ルãŒå­˜åœ¨ã™ã‚‹ã‹ãƒã‚§ãƒƒã‚¯ã—ãŸã„ã ã‘ãªã‚“ã ãªï¼Ž
+
+ * st.c (int): grow_factorを固定ã«ã—ãŸ(大嶋ã•ã‚“ã®ãƒžã‚·ãƒ³ã«å¯¾å¿œ).
+
+Fri Jul 14 00:48:40 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * ext/extmk.rb.in: キャッシュã®ãƒã‚°ã‚’修正.
+
+ * parse.y (var_extend): #{$æ•°å­—}ã«å¯¾å¿œã—ãŸï¼Ž
+
+ * dln.c (dln_load_1): `Init_FILENAME'ã ã‘を有効ã«ï¼Ž`init_*'ã¯ä»Šå¾Œ
+ 実行ã—ãªã„.
+
+ * ext/etc/etc.c : Etcモジュールを拡張モジュールã¨ã—ã¦åˆ†é›¢ï¼Žå®Ÿã¯NT
+ 対応ã¸ã®å¸ƒçŸ³ã ã£ãŸã‚Šã™ã‚‹ã‹ã‚‚ã—れãªã„.
+
+Tue Jul 11 17:12:48 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * gcc -Wallã§å‡ºãŸwarningã‚’å…ƒã«ã‚½ãƒ¼ã‚¹ã‚’変更.
+
+ * signal.c (trap): typo.
+
+Fri Jul 7 10:08:51 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.80
+
+ * ruby.texi: texinfo documentã‚’æä¾›ï¼Žspecã¨ruby.1ã¯ç„¡ããªã£ãŸï¼Ž
+
+ * signal.c (Ftrap): 割込ã¿ç¦æ­¢ä¸­ã®ä¾‹å¤–発生ã«å¯¾å¿œï¼Ž
+
+ * eval.c (Flambda): Blockオブジェクトを返ã™ï¼ŽBlock.newã¨åŒç¾©ï¼Ž
+
+Thu Jul 6 00:35:03 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * signal.c (Ftrap): SIG_DFLã®å‡¦ç†ã‚’変更.SIGINTã¸ã®ãƒ‡ãƒ•ォルトãƒãƒ³
+ ドラを用æ„(例外を発生ã™ã‚‹).
+
+ * file.c (Sfile_expand_fname): パスåを絶対パスã«å±•é–‹ã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ï¼Ž
+ (Sfile_basename): basenameを得るメソッド.拡張å­ã‚‚外ã›ã‚‹ï¼Ž
+ (Sfile_dirname): basenameã®å対.
+
+ * eval.c (rb_call): argument評価中ã®ä¾‹å¤–発生ã«å¯¾å¿œï¼Ž
+
+ * file.c (Ftest): `M', `A', `C'を追加.
+
+Tue Jul 4 12:36:33 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * file.c (Ftest): ファイルテスト用メソッド.
+
+ * ruby.c (proc_options): `-r'オプションを追加.
+
+ * parse.y (f_args): デフォルト引数を追加.
+
+ * eval.c (rb_call): 該当ã™ã‚‹å¼•æ•°ãŒç„¡ã„時,rest引数ã®å€¤ã‚’nilã«ï¼Ž
+
+ * numeric.c (num_equal): 数値以外ã¨ã®æ¯”較ã§ä¾‹å¤–ãŒç™ºç”Ÿã—ã¦ã„ãŸï¼Ž
+ FALSEã‚’è¿”ã™ã‚ˆã†ã«ï¼Ž
+
+ * eval.c (masign): 多é‡ä»£å…¥ã®rest部ã®å‹•作ãŒãŠã‹ã—ã‹ã£ãŸï¼Ž
+
+Sat Jun 17 01:03:16 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * parse.y (gettable): æœªåˆæœŸåŒ–ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã®å‚ç…§(独立ã—ãŸè­˜åˆ¥å­)
+ ã¯æ­£å¼ã«ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã¨ã—ãŸï¼Ž
+
+ * parse.y (read_escape): tokenbufを使ã‚ãªã„よã†ã«ä¿®æ­£ï¼Žãれã«ã¨ã‚‚
+ ãªã„,`\C-x',`\M-x'ãªã©ã®ã‚¨ã‚¹ã‚±ãƒ¼ãƒ—表ç¾ã‚’復活.ã“れã§ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³
+ トã¨å®Ÿéš›ã®å‡¦ç†ç³»ãŒä¸€è‡´ã—ãŸï¼Ž
+
+Thu Jun 15 15:42:00 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * re.c (re_regcomp): cacheã®ãƒã‚§ãƒƒã‚¯ã‚’改善.
+
+Mon Jun 12 18:50:51 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * version 0.79
+
+Sat Jun 10 00:25:01 1995 Yukihiro Matsumoto <matz@caelum.co.jp>
+
+ * re.c (re_regcomp): cache判定ã«`$='ã®å€¤ã‚‚åæ˜ ã•ã›ãŸï¼Ž
+
+ * sample/test.rb: test suite作æˆï¼Ž
+
+Fri Jun 9 15:58:34 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * re.c (re_regcomp): cacheã®åˆ¤å®šãŒé–“é•ã£ã¦ã„ãŸï¼Ž
+
+Fri Jun 9 00:01:35 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c (rb_yield): block構造体ã«åˆæœŸåŒ–ã—ã¦ã„ãªã„メンãƒ(iter)ãŒã‚ã£
+ ãŸã®ã§ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã®ãƒã‚¹ãƒˆãŒæ­£ã—ã動作ã—ãªã‹ã£ãŸï¼Ž
+
+Thu Jun 8 00:59:03 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * re.c (=~): String以外ã¨ã®æ¯”較ãŒFALSEã‚’è¿”ã™ã‚ˆã†ã«(例外を発生ã—ã¦
+ ã„ãŸ).
+
+ * extmk.rb.in: 判定ã—ãŸå€¤ã‚’ファイルã«ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã™ã‚‹ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * assoc.c (to_a): to_aメソッドãŒå†å®šç¾©ã•れã¦ã„ãªã‹ã£ãŸï¼Ž
+
+ * eval.c (rb_eval): åˆæœŸåŒ–ã•れã¦ã„ãªã„ローカル変数ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã‚’引
+ æ•°ã®ç„¡ã„メソッド呼ã³å‡ºã—ã¨è§£é‡ˆã™ã‚‹ï¼ŽãŸã ã—,(ç¾çжã§ã¯)メソッドãŒ
+ 定義ã•れã¦ã„ãªã„å ´åˆï¼Œã‚¨ãƒ©ãƒ¼ã«ã›ãšå¤‰æ•°æœªåˆæœŸåŒ–ã®waringを出ã—ã¦
+ nilã‚’è¿”ã—ã¦ã„る.「ruby -pe printã€ãªã©ãŒå®Ÿè¡Œã§ãã‚‹ã¨ã„ã†æ„味ã§
+ ã¯ã‚りãŒãŸã„ã“ã®ä»•様ã¯ï¼Œã—ã‹ã—ä»Šå¾Œã®æ¤œè¨ŽãŒå¿…è¦ã§ã‚る.-- メソッ
+ ド呼ã³å‡ºã—ã¨ã™ã‚‹ã®ã‚’æ­¢ã‚ã‚‹ã‹(以å‰ã®ä»•様),ã„ã¤ã‚‚メソッド呼ã³å‡ºã—
+ ã¨ã™ã‚‹(未定義ãªã‚‰ã°ã‚¨ãƒ©ãƒ¼)ã‹ï¼Œä»Šã®ä»•様ã§è¡Œãã‹ï¼Ž
+
+ * eval.c (rb_eval): åˆæœŸåŒ–ã•れã¦ã„ãªã„ローカル変数ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã§
+ (evalãªã©ã§)åˆæœŸåŒ–ã•れãŸäº‹ãŒåˆ†ã‹ã£ãŸæ™‚ã«ã¯ä»¥å¾ŒåˆæœŸåŒ–ã•れãŸãƒ­ãƒ¼ã‚«
+ ル変数ã¨ã¿ãªã™ï¼Ž
+
+Wed Jun 7 11:58:12 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * eval.c (rb_fail): 例外処ç†å¾Œã‚‚`$!'をクリアã—ãªã„よã†ã«ï¼Ž
+ (rb_fail): `$!'å¤‰æ•°ã«æœ€å¾Œã«æ”¹è¡Œã‚’追加ã—ãªã„.
+
+ * io.c (Fprint): privateメソッドã«å¤‰æ›´ï¼Žå¼•æ•°ã‚’å–らãªã„時ã®å‹•作を変
+ æ›´(`$_'を出力ã™ã‚‹).
+ (Fio_print): 出力先指定ã®printメソッド.
+ (Fio_printf): 出力先指定ã®printfメソッド.
+
+ * parse.y: not演算å­ã®è¿½åŠ ï¼Žå„ªå…ˆé †ä½ã®ä½Žã„`!'演算å­ï¼Ž
+
+Mon Jun 5 19:00:55 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * version 0.78
+
+Fri Jun 2 17:52:03 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * ruby.c (proc_options): -Iオプションã§`$:'ã¸ã®è¿½åŠ ã•れる順番を修
+ æ­£ã—ãŸï¼Ž
+
+Fri Jun 2 00:36:34 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y: while修飾å­ã®å‹•作を通常ã®whileã¨åŒã˜ã«ã—ãŸï¼ŽãŸã ã—,
+ beginå¼ã¸ã®while修飾å­ã ã‘ã¯do..whileåž‹ã®ãƒ«ãƒ¼ãƒ—ã¨ãªã‚‹ï¼Ž
+
+Wed May 31 18:36:30 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * version 0.77
+
+Mon May 29 18:39:37 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * ext/extmk.rb.in (install): 拡張モジュールもインストールã§ãるよ
+ ã†ã«ï¼Ž
+
+Fri May 26 14:43:01 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * process.c (Fsystem): 戻り値をサブプロセスã®å¤±æ•—/æˆåŠŸã‚’è¡¨ã™çœŸå½å€¤
+ ã«ã—ãŸï¼Žçµ‚了ステータスã¯`$?'ã§å¾—る.
+
+Tue May 23 10:58:11 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * string.c (Fstr_upto): ç„¡é™ãƒ«ãƒ¼ãƒ—ã«é™¥ã‚‰ãªã„よã†ã«ï¼Ž
+
+ * parse.y (cond): `||'ãªã©ã®å³è¾ºã«åˆ¶å¾¡å¼ãŒæ›¸ã‘るよã†ã«ï¼Œæ¡ä»¶å¼ãŒã‹
+ ãªã‚‰ãšã—も値をæŒãŸãªãã¦ã‚‚良ã„よã†ã«ã—ãŸï¼Ž
+
+ * ext/marshal/marshal.c: オブジェクトã®èª­ã¿æ›¸ãをメソッドã®å†å®šç¾©
+ ã§ã‚³ãƒ³ãƒˆãƒ­ãƒ¼ãƒ«ã§ãるよã†ã«ï¼Žã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ãŒ`_dump_to'ã¨ã„ã†ãƒ¡ã‚½ãƒƒ
+ ドを定義ã—ã¦ã„る時ã¯ãã¡ã‚‰ã‚’使ã†ã‚ˆã†ã«ï¼Ž
+
+ * ext/extmk.rb.in: static linkも設定ã§ãるよã†ãªä»•様ã«ã—ãŸï¼Ž
+ ext/Setupã¨ã„ã†ãƒ•ァイルã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªåを記述ã™ã‚‹ã¨ãã®ãƒ‡ã‚£ãƒ¬ã‚¯
+ トリã«å­˜åœ¨ã™ã‚‹ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯static linkã•れる(ã¯ãš).
+
+ * eval.c (rb_eval): `..'を文法ã«çµ„ã¿è¾¼ã¿ï¼Œ`..'ã¨`...'ã®å‹•作をperl
+ ã«åˆã‚ã›ãŸï¼Ž
+
+Sat May 20 01:22:48 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * io.c (select): timeout時ã¨å‰²è¾¼ã¿æ™‚ã®å‹•ä½œã®æ˜Žç¢ºåŒ–.
+
+Fri May 19 15:33:23 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * version 0.76
+
+Fri May 19 00:48:08 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * string.c (Fstr_each): ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯ä¸­ã§æ–‡å­—列ã®å¤‰æ›´ãŒè¡Œã‚れ
+ ãŸã‹ã©ã†ã‹ã‚’ãƒã‚§ãƒƒã‚¯ï¼Žãƒã‚¤ãƒ³ã‚¿ã®å€¤ãŒå¤‰ã‚ã£ã¦ã„れã°ä¾‹å¤–を発生ã™ã‚‹ï¼Ž
+
+ * ruby-mode.el: ruby-electric-braceã®æ–°è¨­ï¼Ž
+
+Thu May 18 12:27:23 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * string.c (Fstr_tr): trã®ç½®æ›å¯¾è±¡ã«`\0'ã‚’å«ã‚€æ™‚ã«æ­£ã—ãç½®æ›ã‚’行ã‚
+ ãªã„ãƒã‚°ãŒã‚ã£ãŸï¼Žæ›´ã«ç½®æ›æ–‡å­—列をASCIIé †ã«æŒ‡å®šã—ãªã„ã¨å‹•作ã—ãª
+ ã„å•題もã‚ã£ãŸï¼Žçµæžœã¨ã—ã¦trã‚’æ›¸ãæ›ãˆãŸã®ã§ï¼Œcopyrightã®å•題ã¯
+ ç„¡ããªã£ãŸ(ã¨æ€ã†).
+
+ * gc.c (gc): the_scopeをマークã—ã¦ã„ãªã‹ã£ãŸã®ã§ï¼Œãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã®æŒ‡
+ ã—ã¦ã„るオブジェクトãŒé–“é•ã£ã¦é–‹æ”¾ã•れる場åˆãŒã‚ã£ãŸï¼Ž
+
+ * gc.c (mark_locations_array): 若干ã®é«˜é€ŸåŒ–.
+
+Mon May 15 11:43:49 1995 Yukihiro Matsumoto <matz@ix-02>
+
+ * ext/extmk.rb.in: Dynamic Loadモジュールã®ã‚³ãƒ³ãƒ‘イル用ãƒã‚§ãƒƒã‚¯ã‚’
+ 行ã†ruby script.autoconfã«è¿‘ã„æ„Ÿè¦šã§ä½¿ãˆã‚‹ï¼Žæ–°ã—ã„モジュールを
+ æä¾›ã—ãŸã„人ã¯extã®ä¸‹ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’作るã ã‘ã§è‰¯ã„.必須ã®ãƒ•ã‚¡
+ イルã¯ãƒ•ァイルåã®ä¸€è¦§ã‚’記録ã—ãŸ`MANIFEST'ã¨ã„ã†ãƒ•ァイルã®ã¿ï¼Žå¿…
+ è¦ã«å¿œã˜ã¦`depend'(ファイルã®ä¾å­˜é–¢ä¿‚を記述ã™ã‚‹ãƒ•ァイル gcc -MM
+ ã®å‡ºåŠ›),`extconf.rb'(コンパイル用ã«ãƒ©ã‚¤ãƒ–ラリã¨é–¢æ•°ã®å­˜åœ¨ãƒã‚§ãƒƒ
+ クã™ã‚‹ãƒ•ァイル)を用æ„ã§ãる.
+
+ * eval.c (rb_call): rubyメソッドã®å¼•æ•°ãƒã‚§ãƒƒã‚¯æ™‚ã«æœªåˆæœŸåŒ–ã®
+ jmp_bufを使用ã—ã¦ã„ãŸï¼Ž
+
+ * parse.y: `or'ã¨`and'ã®å„ªå…ˆé †ä½ã‚’åŒã˜ã«ã—ãŸï¼Ž
+
+Wed May 3 18:21:36 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * dln.c: Linuxã§ã¯`__.SYMDEF/'ã§ã‚ã£ãŸï¼Ž
+
+ * dln.c: system callã®ã‚¨ãƒ©ãƒ¼ãƒã‚§ãƒƒã‚¯ã‚’忘れã¦ã„ãŸï¼Ž
+
+Wed Apr 26 09:50:56 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: イテレータブロックã®å¤‰æ•°å®£è¨€ã‚’`|'ã§æ‹¬ã‚‹ã‚ˆã†ã«ã—ãŸï¼Žã“れ
+ ã§ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿å¤‰æ•°ãŒãªã„時ã¯å®£è¨€ãã®ã‚‚ã®ã‚’çœç•¥ã§ãる.文法ã®å¤‰æ›´ã¯
+ ä¹…ã—ã¶ã‚Šã ï¼Ž
+
+Tue Apr 25 12:04:17 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(require): loadã‹ã‚‰ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ãƒ­ãƒ¼ãƒ‰ã®æ©Ÿèƒ½ã‚’ç§»ã—ã¦ããŸï¼Ž
+ ã•ã‚‰ã«æ‹¡å¼µå­ã®è£œå®Œæ©Ÿèƒ½ã‚’追加ã—ã¦ãƒ¦ãƒ¼ã‚¶ãŒdln/dlopenã®å·®ã‚’æ„è­˜ã™ã‚‹
+ å¿…è¦ã®ãªã„よã†ã«ã—ãŸï¼Ž
+
+ * string.c(sub,sub): イテレータã¨ã—ã¦ã‚‚動作ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * object.c: init_object -> initialize.
+
+Mon Apr 24 14:22:39 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * NEWS-OS 3.4対応
+
+ * io.c: Solarisã®stdioã®å‹•作ãŒé•ã†ã‚ˆã†ã ï¼Žsignalã§EOFã‚’è¿”ã—ã¦ã—ã¾
+ ã†â€¦ï¼Žperlã§ã‚‚åŒæ§˜ã®å•題ãŒã‚る.
+
+Fri Apr 21 20:04:39 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.75
+
+ * signal.c: trapãŒãªããªã£ã¦ã„ãŸï¼Žã†ãƒ¼ã‚€ï¼Ž
+
+ * configure: Solaris 2.3対応.
+
+ * io.c: #elifã®ãªã„cppã‚‚ã‚る.
+
+ * dir.c: autoconf 2.xã¸ã®å¯¾å¿œãŒä¸å分
+
+Thu Apr 20 12:31:24 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.74
+
+ * env.h, gc.c, regex.c: IRIXã¸ã®ç§»æ¤å¯¾å¿œ
+
+ * configure: dlopen用ã«picを生æˆã™ã‚‹optionã®æ¤œå‡ºã®ãŸã‚,システムタ
+ イプをãƒã‚§ãƒƒã‚¯ã™ã‚‹ã‚ˆã†ã«ï¼Ž
+
+Tue Apr 18 19:08:17 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * gc.c(xrealloc): ptr=nilã®æ™‚,malloc()ã¨åŒã˜åƒãã‚’
+
+ * array.c(astore): 空ã®é…列ã®0番目ã®è¦ç´ ã«ä»£å…¥ã™ã‚‹ã¨size=0ã§
+ realloc()を呼んã§ã„ãŸï¼Ž
+
+ * configure, glob.c: Solaris 2.xã§ã‚³ãƒ³ãƒ‘イルã§ãるよã†ã«
+
+Mon Apr 10 18:36:06 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.73
+
+Fri Apr 7 13:51:08 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * cons.c->assoc.c: consã®ä½™è¨ˆãªæ©Ÿèƒ½ã¯å¤–ã—ã¦pairã¨ã—ã¦ã®æ©Ÿèƒ½ã ã‘ã‚’
+ 残ã—ãŸï¼ŽEnumerableã‚’includeã™ã‚‹ã®ã‚‚ã‚„ã‚ãŸï¼Ž
+
+ * string.c(esub): 文字列置æ›ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ï¼Žperlã®s///eã®ç›¸å½“ã™ã‚‹ï¼Ž
+
+Wed Apr 5 11:35:21 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.72
+
+ * EWS4800対応
+
+ * file.c: utimesãŒãªã„時ã¯utimeを使ã†ã‚ˆã†ã«ï¼Ž
+
+Mon Apr 3 15:19:41 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.71
+
+ * regexp.c(re_match): ãƒã‚°ãŒã‚ã£ãŸï¼Žmatch_2を削除ã—ãŸæ™‚ã«enbugã—ã¦
+ ã„ãŸã®ã ã£ãŸï¼Ž
+
+Mon Mar 27 15:41:43 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * dict.c: Dict->Hashã«å…¨é¢çš„ã«ç§»è¡Œï¼Ž
+
+Thu Mar 23 20:30:00 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * dbm.c,socket.c: extディレクトリã«åˆ†é›¢ï¼Ž
+
+ * configure: dln周りã®ãƒã‚§ãƒƒã‚¯ã®å¼·åŒ–
+
+ * dln.c: initã®å‘¼ã³å‡ºã—ã‚’dlopen()版ã«åˆã‚ã›ãŸï¼Ž
+
+Mon Mar 20 17:45:08 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * configure: autoconf 2.2ã«å¯¾å¿œ(一部).
+
+Fri Mar 17 15:56:44 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * dln.c: dlopenã®ã‚るマシンã§ã¯ãã¡ã‚‰ã‚’使ã†ã‚ˆã†ã«ï¼ŽãŸã ã—,ã¡ã‚ƒã‚“
+ ã¨å‹•ã„ã¦ã„ã‚‹ã‹ã©ã†ã‹ã¯è‡ªä¿¡ãŒãªã„.
+
+ * regex.c: virtual concatinationã‚’ã‚„ã‚ãŸï¼Ž
+
+Thu Mar 16 11:32:57 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.70
+
+ * eval.c,regex.c: gccã§ã®ã‚³ãƒ³ãƒ‘イルエラー.
+
+ * io.c: inplace-editã§æ‹¡å¼µå­ãŒæŒ‡å®šã•れãªã„å ´åˆï¼Œã‚‚ã¨ã®ãƒ•ァイルを削
+ 除ã™ã‚‹ï¼Ž
+
+Wed Mar 15 14:59:18 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.69
+
+ * eval.c(method_missing): unknownã‹ã‚‰å称変更.
+
+ * eval.c(single_method_added): 特異メソッドãŒå®šç¾©ã•ã‚ŒãŸæ™‚ã«å‘¼ã°ã‚Œ
+ るメソッド.hookã¨ã—ã¦ä½¿ãˆã‚‹ï¼Žå®Ÿéš›ã«å®šç¾©ã•れる直å‰ã«å‘¼ã°ã‚Œã‚‹ï¼Ž
+
+Tue Mar 14 14:46:44 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby.c(proc_options): 引数ã®è§£æžã‚’自分ã§ã‚„ã‚‹ã“ã¨ã«ã‚ˆã‚Šå¼•数指定ã®
+ 方法ãŒperlã«è¿‘付ã„ãŸï¼Žgetopt_longã¯ã‚‚ã†ä½¿ã‚ãªã„.
+
+ * dir.c(glob): `{}'ã®ãƒã‚¹ãƒˆã‚’許ã™ã‚ˆã†ã«ã—ãŸï¼Ž
+
+Mon Mar 13 17:56:25 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * glob.c: Glob(ワイルドカードオブジェクト)ã¯ãªããªã£ãŸï¼Žãƒ¯ã‚¤ãƒ«ãƒ‰ã‚«ãƒ¼
+ ドã®å±•é–‹ã¯Dir.glob(文字列)を使ã†ï¼Žãƒ¯ã‚¤ãƒ«ãƒ‰ã‚«ãƒ¼ãƒ‰ã®ãƒžãƒƒãƒã¯æ­£è¦è¡¨
+ ç¾ã§ä»£ç”¨ï¼Ž
+
+Fri Mar 10 18:35:46 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: Mathã®ã‚ˆã†ãªãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯è‡ªåˆ†è‡ªèº«ã§extendã™ã‚‹ï¼Ž
+
+ * eval.c: クラスやモジュールを定義ã™ã‚‹æ™‚,既ã«åŒåã®ã‚‚ã®ãŒã‚れã°è¿½
+ 加定義ã¨ãªã‚‹ã‚ˆã†ã«ï¼ŽãŸã ã—.superクラスã®é•ã„ãªã©ã¯ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Ž
+
+ * regex.c: debug.
+
+ * math.c: 定数PIã¨Eを定義.
+
+Thu Mar 9 21:35:12 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * regex.c: EUC,SJISモードã§ã¯0x80以上ã®8進,16é€²ãƒªãƒ†ãƒ©ãƒ«ã‚’ç¦æ­¢ï¼Ž
+
+ * regex.c: クラス内ã§ã‚‚数値リテラル・文字クラスãŒä½¿ãˆã‚‹ã‚ˆã†ã—ãŸï¼Ž
+
+Wed Mar 8 17:39:05 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * regex.c: \200ãªã©æ‹¬å¼§ã®æ•°ä»¥ä¸Šã®è¡¨ç¾ã¯8進リテラルã¨è§£é‡ˆã™ã‚‹ï¼ŽãŸã 
+ ã—,\1ã‹ã‚‰\9ã¾ã§ã¯ä¾‹å¤–.
+
+ * regex.c: \9以上ã®ãƒªãƒ•ァレンスも有効ã«ã—ãŸï¼Ž
+
+Tue Mar 7 14:26:01 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(public/private): スコープ制御メソッドã®å称変更.é™çš„ãªã‚¢
+ クセスも出æ¥ã‚‹ã‚ˆã†ã«ã—ã¦ã¿ãŸãŒï¼Œä¸æŽ¡ç”¨ï¼Ž
+
+Mon Mar 6 19:34:32 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c(inlcude): メソッド化.動的ã«ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’インクルードã§ã
+ るよã†ã«ï¼Žã•らã«ä»»æ„ã®ã‚ªãƒ–ジェクトã«ã‚‚モジュールをインクルードã§
+ ãるメソッド `extend'も用æ„ã—ãŸï¼Ž
+
+ * parse.y: 文法ã‹ã‚‰includeを削除.メソッド化.
+
+Tue Feb 28 15:35:10 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: é…列,連想é…åˆ—ã®æœ€å¾Œã«`,'ã‚’ãŠã‘るよã†ã«ï¼Ž
+
+Fri Feb 24 13:15:43 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.68
+
+Thu Feb 23 11:19:19 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: resque節ã®selfã®å€¤ãŒé–“é•ã£ã¦ã„ãŸï¼Ž
+
+ * eval.c(rb_clear_cache): キャッシュã®ã‚¯ãƒªã‚¢ã—忘れãŒã‚ã£ãŸï¼Ž
+
+ * eval.c: 定数ã®ã‚¹ã‚³ãƒ¼ãƒ—をクラス内ã®é™çš„スコープã«å¤‰æ›´ã—ãŸï¼Žã“れã«
+ よã£ã¦ï¼Œç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã‹ã‚‰å‚ç…§ã•れる定数ã¯ï¼Œãƒ¬ã‚·ãƒ¼ãƒã®ã‚¯ãƒ©ã‚¹ã§ã¯ãª
+ ã,定義ã•れãŸã‚¹ã‚³ãƒ¼ãƒ—ã®ã‚¯ãƒ©ã‚¹ã®å®šæ•°ã¨ãªã‚‹ï¼Ž
+
+Wed Feb 22 00:51:38 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * regex.c: ignorecaseã‚’æ­£è¦è¡¨ç¾ã®ã‚³ãƒ³ãƒ‘イルå‰ã«æŒ‡å®šã—ãªã„ã¨æ­£ã—ã
+ 動作ã—ãªã„.修正.
+
+ * string.c(toupper,tolower): bug fix.
+
+ * ENV,VERSION: readonly変数ã‹ã‚‰å®šæ•°ã¸ï¼Ž
+
+Tue Feb 21 18:56:56 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * io.c(STDIN, STDOUT, STDERR): 定数ã¨ã—ã¦å®šç¾©ï¼Ž
+
+ * io.c(select): bug fix.
+
+ * version 0.67
+
+Mon Feb 20 16:10:14 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(yylex): 定数を`%識別å­'ã‹ã‚‰ï¼Œç¬¬1文字ãŒå¤§æ–‡å­—ã®è­˜åˆ¥å­ã«å¤‰
+ 更.ãれã«ã¨ã‚‚ãªã„クラスã¯å®šæ•°ã¨ãªã£ãŸï¼Ž
+
+ * eval.c: クラス定義内ã®selfãŒã‚¯ãƒ©ã‚¹å®šç¾©å¤–部ã®the_classã ã£ãŸï¼Ž
+
+ * variable.c(rb_name_class): クラスåã‚’ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã«æ ¼ç´ã™ã‚‹ï¼Ž
+
+Thu Feb 16 15:36:17 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: BLOCKã‚’braceã§è¡¨ç¾ã™ã‚‹æ–‡æ³•ã«å¤‰æ›´ã—ãŸã‚‚ã®ã‚’作ã£ã¦ã¿ã‚‹ï¼Ž
+ MLã«æç¤ºã—ã¦ã¿ã‚‹ãŒå応ãŒãªã„.
+
+ * object.c(do,forever): ãªãã—ãŸï¼Ž
+
+Wed Feb 15 13:20:49 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * re.c(new): 第2引数ãŒä¸Žãˆã‚‰ã‚Œã¦ï¼Œã‹ã¤nilã§ãªã„ã¨ãã ã‘設定ã™ã‚‹ã‚ˆ
+ ã†ã«(以å‰ã¯nilã®æ™‚ã«ã‚‚設定を行ãªã£ã¦ã„ãŸ).
+
+ * parse.y(parse_regexp): æ­£è¦è¡¨ç¾ãƒªãƒ†ãƒ©ãƒ«ã§å¤§æ–‡å­—å°æ–‡å­—を無視ã™ã‚‹
+ ã‹ã©ã†ã‹æŒ‡å®šã§ãるよã†ã«ï¼Ž
+
+Tue Feb 14 00:55:33 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y: (compexpr) -> (expr).
+
+Fri Feb 10 16:30:00 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * ruby.c(load_file): scriptを読ã¿è¾¼ã‚€æ™‚ã ã‘"#!"ã®è§£æžã‚’行ã†ã‚ˆã†ã«ï¼Ž
+
+ * ruby.c(readin): ファイル読ã¿è¾¼ã¿æ™‚ã«å…ˆé ­ã«"#!"ãŒã‚り,ãã®è¡ŒãŒ
+ "ruby"ã¨ã„ã†æ–‡å­—列をå«ã‚€æ™‚,rubyã«å¼•æ•°ãŒä¸Žãˆã‚‰ã‚Œã¦ã„れã°ï¼Œãã®å¼•
+ 数も有効ã«ãªã‚‹ï¼Ž
+
+ * parse.y(yylex): コメント行ã®çµ‚りãŒ`\'ã§ã‚ã£ãŸæ™‚,次ã®è¡Œã«ç¶™ç¶šã—
+ ã¦ã„ã‚‹ã¨ã¿ãªã™ã‚ˆã†ã«ã—ãŸï¼Ž
+
+Thu Feb 9 16:18:37 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.66
+
+ * parse.y: protectã‚’beginã«å¤‰æ›´ï¼Žbegin..endã¯ä¾‹å¤–処ç†ã ã‘ã§ãªã,
+ 文括弧ã¨ã—ã¦ã‚‚åƒãã“ã¨ã«ãªã£ãŸï¼Ž
+
+Wed Feb 1 19:48:24 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * version 0.65
+
+ * string.c(str_replace): ç½®ãæ›ãˆã‚‹æ–‡å­—列ã®é•·ã•ãŒç­‰ã—ã„æ™‚メモリコ
+ ピーをã—ãªã„.
+
+ * string.c(rindex): ãƒã‚°ä¿®æ­£ï¼Ž
+
+Mon Jan 30 11:23:05 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(value_expr): ifã®ãƒã‚§ãƒƒã‚¯ã‚’追加.
+
+ * gc.c(gc_mark): free cellã®æ‰±ã„ã«ãƒã‚°ï¼Ž
+
+ * parse.y: 文法ã®å¤‰æ›´(よりシンプルã«).例外を減らã—ãŸï¼Ž
+
+Thu Jan 26 00:52:55 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * parse.y: 引数ã¨ã—ã¦é€£æƒ³é…列を置ãã“ã¨ãŒã§ãるよã†ã«ï¼Žã“ã®å ´åˆï¼Œ
+ 連想é…åˆ—ãƒªãƒ†ãƒ©ãƒ«ãŒæœ€çµ‚引数ã¨ãªã‚‹ï¼Ž
+
+ * parse.y: é…列å‚ç…§ã®`[]'内ãŒç©ºã§ã‚‚よã„ã“ã¨ã«ã—ãŸï¼Ž
+
+Tue Jan 24 14:45:15 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * class.c(rb_include_module): `-v'を指定ã—ãŸæ™‚ã«ã¯includeã—ãŸãƒ¢ã‚¸ãƒ¥ãƒ¼
+ ルã¨ã‚¯ãƒ©ã‚¹å®šæ•°ãŒè¡çªã—ã¦ã„ãªã„ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Ž
+
+Mon Jan 23 10:42:09 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(rb_class2name): メタクラスã«é–¢ã™ã‚‹bug fix.
+
+ * dict.c: Dict[..]ã§è¾žæ›¸ã®ç”ŸæˆãŒå‡ºæ¥ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * array.c: Array[..]ã§é…列ã®ç”ŸæˆãŒå‡ºæ¥ã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * parse.y: 辞書ã®è¡¨ç¾ã¨ã—ã¦{a,b,..}ã¨ã„ã†å½¢å¼ã‚‚許ã™ã‚ˆã†ã«ï¼Ž
+
+Fri Jan 20 10:28:38 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * re.c(Regexp.quote): æ­£è¦è¡¨ç¾ã‚’エスケープã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ï¼Ž
+
+ * ç„¡é§„ãªrb_intern()を減らã—ãŸï¼Ž
+
+ * parse.y: `!', `!=', `!~'を特殊演算å­ã«ã™ã‚‹ï¼Žã‚ˆã£ã¦ã“れらã¯å†å®šç¾©
+ ã§ããªããªã£ãŸï¼Ž
+
+Wed Jan 18 13:20:41 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: æ–‡æ³•ã®æ•´ç†(unless,untilã‚’ãªãã—ãŸ).
+
+Tue Jan 17 11:11:27 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: defã§ãƒ¡ã‚½ãƒƒãƒ‰å†å®šç¾©æ™‚ã«ã¯ã‚¹ãƒ¼ãƒ‘ークラスã®ãƒ¡ã‚½ãƒƒãƒ‰ã®å¯è¦–
+ 性を継承ã™ã‚‹ï¼Žæœ€åˆã®å®šç¾©ã®æ™‚ã¯ä»Šã¾ã§ã¨åŒã˜ãƒ‡ãƒ•ォルト(トップレベ
+ ルã§é–¢æ•°çš„,クラス定義内ã§é€šå¸¸ãƒ¡ã‚½ãƒƒãƒ‰).
+
+ * object.c(Class#new): オブジェクトã®ç”Ÿæˆæ™‚ã«é–¢æ•°çš„メソッド
+ init_objectãŒå¿…ãšå‘¼ã°ã‚Œã‚‹ã‚ˆã†ã«å¤‰æ›´ï¼Ž
+
+ * eval.c: 未定義ã®ãƒ¡ã‚½ãƒƒãƒ‰ã«å¯¾ã—ã¦unknownメソッドãŒå‘¼ã°ã‚Œã‚‹ã‚ˆã†ã«
+ ãªã£ãŸï¼Žã‚¨ãƒ©ãƒ¼è¡¨ç¤ºãŒä»Šã¾ã§ã¨åŒã˜ã«ãªã‚‹ã‚ˆã†ã«envを調節ã—ã¦ã„る.
+
+Fri Jan 13 14:40:30 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * gc.c: gcã‚’è‹¥å¹²æ›¸ãæ›ãˆã¦æ•´ç†ã—ãŸï¼ŽãŒï¼Œã‚ã¾ã‚Šå¤‰åŒ–ã¯ãªã‹ã£ãŸã‚ˆã†ã ï¼Ž
+
+ * parse.y(yylex): symbolã‚’\symã‹ã‚‰:symã«å¤‰æ›´ã—ãŸï¼Ž
+
+Thu Jan 12 01:39:28 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c: æ–°è¦é–¢æ•° rb_eval_string().
+
+ * gc.c: gc_mark()を一部éžå†å¸°åŒ–.
+
+ * variable.c(rb_ivar_{get,set}): インスタンス変数ã®ã‚¢ã‚¯ã‚»ã‚¹å‘¨ã‚Šã§
+ ãƒã‚§ãƒƒã‚¯ãŒè¶³ã‚Šãªã‹ã£ãŸï¼Ž
+
+ * variable.c: クラス定数ã¨ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã§ãƒãƒƒã‚·ãƒ¥ãƒ†ãƒ¼ãƒ–ルを共有
+ ã™ã‚‹ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * ruby.h: iv_tblã‚’RBasicã‹ã‚‰RObjectã¨RClassã¸ç§»å‹•ã—ãŸï¼Žã“れã«ã‚ˆã‚Šï¼Œ
+ Objectã¨Class,Moduleã—ã‹ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’æŒã¦ãªããªã‚‹ï¼ŽãŒï¼Œãƒ¡ãƒ¢
+ リ効率ã¯è‹¥å¹²å‘上ã™ã‚‹ï¼Ž
+
+Tue Jan 10 00:58:20 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * 0.64 released
+
+ * eval.c: レシーãƒã¨å¼•æ•°ã¯å¸¸ã«iterã§ã¯ãªã„.
+
+ * cons.c(aref,aset): negative offset対応.
+
+Mon Jan 9 14:40:39 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: foo{..}ã®å½¢å¼ã«ãŠã„ã¦ï¼Œfooをローカル変数やクラスåã§ã¯
+ ãªã,引数ãªã—ã®é–¢æ•°åž‹ãƒ¡ã‚½ãƒƒãƒ‰å‘¼ã³å‡ºã—ã¨ã¿ãªã™ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * list.c -> cons.c: å称変更(クラスåã‚‚).
+
+ * list.c: a::b::c::nilをリスト(a b c)ã¨ã¿ãªã™lispå½¢å¼ã‹ã‚‰ï¼Œa::b::c
+ をリスト(a b c)ã¨ã¿ãªã™rubyå½¢å¼ã«å¤‰æ›´ï¼Ž[], []=, eachã‚‚ãれã«ä¼šã‚
+ ã›ãŸä»•様ã¨ã™ã‚‹ï¼Ž
+
+ * list.c: consペアã¨ã—ã¦ã®æ©Ÿèƒ½ã‚’強調.仕様変更.
+
+Sat Jan 7 01:26:26 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c: 自己代入ã®ä¸å…·åˆä¿®æ­£ï¼Ž
+
+ * eval.c(masign): 多é‡ä»£å…¥ãŒé…列もリストもã¨ã‚Œã‚‹ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * list.c: assocã‚’2è¦ç´ ã®é…列ã‹ã‚‰List(CONSペア)ã«å¤‰æ›´ã—ãŸï¼Ž
+
+Fri Jan 6 13:42:12 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: a[b]+=cã‚„a.b+=cãªã©ã®è‡ªå·±ä»£å…¥å½¢å¼ã§ï¼Œaã‚„bã‚’2度評価ã—ãª
+ ããªã£ãŸï¼Ž
+
+ * eval.c: iterator設定ã®ãƒã‚°ãƒ•ィックス.
+
+ * list.c: Listクラスを新設.
+
+Thu Jan 5 13:55:00 1995 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: SCOPEã®ãƒ¡ãƒ¢ãƒªãƒªãƒ¼ã‚¯ã‚’ãªãã—ãŸï¼Ž
+
+ * eval.c: built-inメソッドã¸ã®å¼•æ•°ã®å¼•ãæ¸¡ã—方を変更ã—ã¦ï¼Œé…列ã®ç”Ÿ
+ æˆæ•°ã‚’減らã—ãŸï¼Ž
+
+ * re.c: match-dataを毎回生æˆã™ã‚‹ã“ã¨ã‚’ã‚„ã‚ãŸï¼Ž`$~'をアクセスã—ãŸæ™‚
+ ã«on-demandã§ç”Ÿæˆã™ã‚‹ï¼Ž
+
+ * string.c etc: ä¸å¿…è¦ãªmemmoveã‚’memcpyã«ç½®æ›ï¼Ž
+
+ * parse.y: =~, !~ã¯å‰¯ä½œç”¨ãŒã‚ã‚‹ã®ã§ã‚³ãƒ³ãƒ‘イル時ã«å±•é–‹ã§ããªã„.
+
+Tue Jan 3 02:04:36 1995 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c: rest引数ã®bug fix.
+
+ * eval.c,gc.c: scopeをオブジェクトã«ã—ãŸï¼Ž
+
+ * eval.c: envã¨scopeã®æ‰±ã„を変更ã—ãŸï¼Ž
+
+Wed Dec 28 09:46:57 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: evalã§ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ãŒè¿½åŠ ã•れãŸå ´åˆã«å¯¾å¿œã—ãŸï¼Ž
+
+ * parse.y: 演算å­ã‚’å«ã‚€aliasã®bug fix.
+
+Tue Dec 27 16:45:20 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: def A Bã‚’alias A Bã«å¤‰æ›´ï¼Ž
+
+ * eval.c: alias関係ã®bug修正.nodeをオブジェクト化ã—ãŸæ™‚ã«enbugã—
+ ãŸã‚ˆã†ã ï¼Ž
+
+ * signal.c: システムコールã®å†å®šç¾©ã‚’æ­¢ã‚ãŸï¼Ž
+
+ * io.c(select): write/exceptã®ãƒ•ラグ設定ã«ãƒã‚°ï¼Ž
+
+ * Makefile.in: static link用オプションをMake変数ã¨ã—ã¦ç‹¬ç«‹ã•ã›ãŸï¼Ž
+
+Tue Dec 20 00:46:19 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * 0.63 released
+
+ * eval.c(rb_call): superã®å‘¼ã³å‡ºã—ã§è½ã¡ã‚‹ï¼Žargc, argvã®è¨­å®šã‚’忘れ
+ ã¦ã„ãŸï¼Ž
+
+ * parse.y(read_escape): 展開エラー.
+
+ * variable.c: 定義済ã¿ã®å¤‰æ•°ã®hookを変更ã—ãªã„よã†ã«ï¼Ž
+
+Mon Dec 19 12:01:10 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y(cond): æ¡ä»¶å¼ã«ä»£å…¥å¼ãŒç½®ã‹ã‚ŒãŸå ´åˆï¼Œ`-v'オプションã§è­¦
+ 告ãŒå‡ºã‚‹ã‚ˆã†ã«ï¼Ž
+
+ * parse.y(**): 冪乗演算å­`**'ã®å„ªå…ˆé †ä½ã‚’å˜é …演算å­ã‚ˆã‚Šé«˜ãã—ãŸï¼Ž
+
+ * parse.y(and,or): 優先順ä½ã®ä½Žã„演算å­`and', `or'.
+
+ * 0.62 released.
+
+ * eval.c: ä¸å¿…è¦ã«ãªã£ãŸPUSH_ENV, POP_ENVを減らã—ãŸï¼Ž
+
+ * env.h: ENVIONã‹ã‚‰selfã‚’ã¯ãšã—ãŸï¼ŽPUSH_ENVã¯superã®æº–å‚™ã®ãŸã‚ã ã‘
+ ã«ç”¨ã„ã‚‹ã“ã¨ã«ã—ãŸï¼Ž
+
+ * eval.c: 下記ã®ã‚ªãƒ–ジェクト化ã§é…ããªã£ãŸå®Ÿè¡Œé€Ÿåº¦ã‚’ã‚‚ã¨ã«æˆ»ã—ãŸï¼Ž
+
+Mon Dec 17 23:01:10 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * eval.c: env.{argv,argc}ã¨scope.local_varsã®ã‚ªãƒ–ジェクト化.
+
+ * eval.c: 1スコープ内ã§è¤‡æ•°Blockを生æˆã—ãŸã¨ãã®ãƒã‚°ã‚’修正.
+
+Fri Dec 16 15:52:06 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * parse.y: `&&'ã¨`||'ã®ä¸¡è¾ºã¯ã„ã¤ã§ã‚‚æ¡ä»¶å¼ã¨ã—ãŸï¼Ž
+
+Thu Dec 15 00:16:04 1994 Yukihiro Matsumoto (matz@dyna)
+
+ * eval.c(Block): Blockオブジェクトを実ç¾ï¼Ž
+
+ * node.h: NODE_QLISTã¯ãªããªã£ãŸï¼Ž
+
+ * eval.c(rb_call): 引数ã¸ã®ä»£å…¥ã‚’åå‰ã§ä¸€ã¤ãšã¤ä»£å…¥ã™ã‚‹ã®ã‚’ã‚„ã‚ã¦ï¼Œ
+ 一度ã«ã‚³ãƒ”ーã™ã‚‹ã‚ˆã†ã«ã—ãŸï¼Ž
+
+ * eval.c(rb_call): rubyã§è¨˜è¿°ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã¸ã®å¼•数渡ã—ã‚’inline化.
+
+ * eval.c: イテレータ判定処ç†ã®å…¨é¢æ›¸ãæ›ãˆï¼Žä¸é©åˆ‡ãªã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿å‘¼ã³
+ 出ã—ã‚’ãªãã—ãŸï¼Žä¾‹ãˆã°ã€Œ[foo(),bar()]{i|baz(i)}ã€ã§fooã‚‚barもイ
+ テレータã¨ã—ã¦å‘¼ã³å‡ºã•れ*ãªã„*.
+
+ * eval.c(rb_call): SCOPE処ç†ã‚’inline化.メソッド呼ã³å‡ºã—ã®è‹¥å¹²ã®é«˜
+ 速化.
+
+Wed Dec 14 18:09:33 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * node.h: nodeもオブジェクトã«ã™ã‚‹ï¼Žã‚ˆã£ã¦GCã§å›žåŽã•れる.
+
+Thu Dec 8 14:17:29 1994 Yukihiro Matsumoto (matz@ix-02)
+
+ * 0.60 released - alpha test baseline.
diff --git a/doc/ChangeLog-1.8.0 b/doc/ChangeLog-1.8.0
index 07d7c6b165..0d00266735 100644
--- a/doc/ChangeLog-1.8.0
+++ b/doc/ChangeLog-1.8.0
@@ -1454,7 +1454,7 @@ Fri Jun 27 03:24:54 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
Thu Jun 26 21:34:49 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* class.c (class_instance_method_list): get rid of warning about
- arguement type mismatch, and inline method_list().
+ argument type mismatch, and inline method_list().
[ruby-core:01198]
Wed Jun 25 14:40:33 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -3361,7 +3361,7 @@ Fri Apr 11 02:41:35 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
Thu Apr 10 21:12:19 2003 Minero Aoki <aamine@loveruby.net>
- * lib/net/pop.rb: Exception line was accidentaly removed.
+ * lib/net/pop.rb: Exception line was accidentally removed.
[ruby-dev:19989]
Thu Apr 10 18:42:13 2003 Tadayoshi Funaba <tadf@dotrb.org>
@@ -5986,7 +5986,7 @@ Thu Nov 7 09:51:37 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
Wed Nov 6 16:57:06 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* class.c (rb_define_method): do not set NOEX_CFUNC if klass is
- really a module, whose methods must be safe for reciever's type.
+ really a module, whose methods must be safe for receiver's type.
* eval.c (rb_eval): nosuper should not be inherited unless the
overwritten method is an undef placeholder.
diff --git a/doc/ChangeLog-1.9.3 b/doc/ChangeLog-1.9.3
index b8e3162511..b3deb551b0 100644
--- a/doc/ChangeLog-1.9.3
+++ b/doc/ChangeLog-1.9.3
@@ -3541,7 +3541,7 @@ Sun May 15 23:45:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
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
+ implicit conversion 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.
@@ -8041,7 +8041,7 @@ Sat Dec 25 17:33:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
anonymous classes.
* lib/csv.rb (CSV#init_separators): use IO#gets with length
- parameter to get rid of wrong convertion.
+ parameter to get rid of wrong conversion.
* lib/csv.rb (CSV::foreach, CSV#initialize): directly use encoding
@@ -8382,7 +8382,7 @@ Tue Dec 14 14:24:15 2010 NAKAMURA Usaku <usa@ruby-lang.org>
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.
+ made by make_temfile is already closed.
Tue Dec 14 13:52:19 2010 NAKAMURA Usaku <usa@ruby-lang.org>
@@ -22363,7 +22363,7 @@ Tue Sep 29 22:19:36 2009 Tanaka Akira <akr@fsij.org>
Tue Sep 29 21:16:35 2009 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (rb_scan_open_args): add UTF8-MAC to no-convertion encoding.
+ * io.c (rb_scan_open_args): add UTF8-MAC to no-conversion encoding.
Tue Sep 29 21:21:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -33712,7 +33712,7 @@ Thu Dec 25 14:51:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
Thu Dec 25 14:32:23 2008 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.c (vm_method_search): fix control flow bug.
- (commited at r20981)
+ (committed at r20981)
Thu Dec 25 13:28:20 2008 NAKAMURA Usaku <usa@ruby-lang.org>
@@ -71774,7 +71774,7 @@ Wed Mar 1 17:13:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
Thu Mar 2 17:54:45 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * gc.c: commited magic for reducing RVALUE size on windows. (24->20byte)
+ * gc.c: committed magic for reducing RVALUE size on windows. (24->20byte)
[ruby-core:7474]
Thu Mar 2 14:12:26 2006 Tanaka Akira <akr@m17n.org>
@@ -73761,7 +73761,7 @@ Fri Oct 21 15:42:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/socket/extconf.rb: BeOS is only one platform should call
closesocket, so check __BEOS__ macro directly. (I was worried
- accidently HAVE_CLOSESOCKET is defined on windows again because
+ accidentally HAVE_CLOSESOCKET is defined on windows again because
it has it)
* ext/socket/{getaddrinfo.c,socket.c}: ditto.
@@ -73770,7 +73770,7 @@ Fri Oct 21 15:42:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
Fri Oct 21 15:23:23 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * bignum.c (bignew_1): convertion from `int' to `char' discards
+ * bignum.c (bignew_1): conversion from `int' to `char' discards
upper bits, (ie. (char)0xff00 -> 0) so it's better to test if
nonzero and set 0 or 1 instead of simply casting ... as a flag usage.
(but I believe this won't cause actual bug in current implementation)
@@ -74937,7 +74937,7 @@ Mon Sep 12 20:32:00 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
Mon Sep 12 19:58:53 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * dln.c: avoid warning of const to non-const convertion.
+ * dln.c: avoid warning of const to non-const conversion.
[ruby-dev:27041]
* eval.c, io.c, ruby.c: ditto.
@@ -83155,7 +83155,7 @@ Thu Aug 19 16:29:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: Fail to treat a hash value of 'font' option.
- * ext/tk/lib/tk.rb: bindinfo cannot return '%' substiturion infomation.
+ * ext/tk/lib/tk.rb: bindinfo cannot return '%' substiturion information.
* ext/tk/lib/menu.rb: typo bug.
@@ -83584,7 +83584,7 @@ Wed Jul 14 18:05:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
Wed Jul 14 12:20:05 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strtod): should not convert string in the form of
- "-I.FE-X" which both "I" and "F" are ommitted. [ruby-dev:23883]
+ "-I.FE-X" which both "I" and "F" are omitted. [ruby-dev:23883]
* test/ruby/test_float.rb (test_strtod): add test for bug fix.
@@ -84298,7 +84298,7 @@ Sat May 22 11:54:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sat May 22 05:37:11 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/lib/remote-tk.rb: (NEW library) controll Tk interpreters
+ * ext/tk/lib/remote-tk.rb: (NEW library) control Tk interpreters
on the other processes by Tcl/Tk's 'send' command
Fri May 21 09:22:05 2004 Dave Thomas <dave@pragprog.com>
@@ -85607,10 +85607,10 @@ Wed Mar 17 00:22:03 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
Tue Mar 16 11:14:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (fnmatch_helper): File.fnmatch('\.', '.') should return true.
- (Rev1.112 lost compatiblity)
+ (Rev1.112 lost compatibility)
* dir.c (fnmatch_helper): File.fnmatch('\/', '/', File::FNM_PATHNAME)
- should return true. (Rev1.112 lost compatiblity)
+ should return true. (Rev1.112 lost compatibility)
* dir.c (fnmatch): File.fnmatch('**/.boo', '.foo/.boo',
File::FNM_PATHNAME) should return false because of leading period.
@@ -86434,7 +86434,7 @@ Mon Feb 16 22:22:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
Mon Feb 16 20:28:52 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * bcc32/Makefile.sub: show more warnings. (refering to mingw)
+ * bcc32/Makefile.sub: show more warnings. (referring to mingw)
* bcc32/setup.mak: ditto.
@@ -86492,7 +86492,7 @@ Mon Feb 16 12:29:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Feb 16 10:29:52 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (CompareImpl): File.fnmatch and Dir.glob get better performance
- in Win32. This is achived by calling downcase() for single-byte
+ in Win32. This is achieved by calling downcase() for single-byte
characters. (CharLower() is slower than downcase())
Mon Feb 16 02:14:29 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
@@ -86561,7 +86561,7 @@ Sat Feb 14 11:14:12 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
Fri Feb 13 21:51:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- * lib/fileutils.rb: slighly improved documentation (sync with 1.8)
+ * lib/fileutils.rb: slightly improved documentation (sync with 1.8)
Fri Feb 13 19:57:01 2004 Kouhei Sutou <kou@cozmixng.org>
@@ -86877,7 +86877,7 @@ Sun Feb 1 18:21:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
Sun Feb 1 05:30:06 2004 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb (URI::Generic#find_proxy): warn HTTP_PROXY.
- raise an errror on non-http proxy URI.
+ raise an error on non-http proxy URI.
(OpenURI::Buffer#<<): make a tempfile binmode. [ruby-talk:90793]
Sun Feb 1 00:57:41 2004 Kouhei Sutou <kou@cozmixng.org>
@@ -89179,7 +89179,7 @@ Thu Nov 27 22:05:48 2003 Akinori MUSHA <knu@iDaemons.org>
Thu Nov 27 17:36:42 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkafter.rb: bug fix on TkTimer#cancel_on_exception=(mode).
- TkTimer#wait recieves the exception of the callback.
+ TkTimer#wait receives the exception of the callback.
The exception is kept on @return_value.
Thu Nov 27 16:58:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
diff --git a/doc/ChangeLog-2.1.0 b/doc/ChangeLog-2.1.0
new file mode 100644
index 0000000000..f80b2d6bd1
--- /dev/null
+++ b/doc/ChangeLog-2.1.0
@@ -0,0 +1,18060 @@
+Fri Dec 20 17:52:50 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_method.c: check definition of
+ GLOBAL_METHOD_CACHE_SIZE and GLOBAL_METHOD_CACHE_MASK.
+
+Fri Dec 20 17:03:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN into
+ RB_OBJ_WRITE and RB_OBJ_WRITTEN.
+
+ * array.c, class.c, compile.c, hash.c, internal.h, iseq.c,
+ proc.c, process.c, re.c, string.c, variable.c, vm.c,
+ vm_eval.c, vm_insnhelper.c, vm_insnhelper.h,
+ vm_method.c: catch up this change.
+
+Fri Dec 20 16:01:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: add a comment for WB interfaces.
+
+Fri Dec 20 16:00:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: DLDFLAGS is defined in --with-opt-dir handler, so
+ ${DLDFLAGS=} does not work now. use RUBY_APPEND_OPTIONS instead.
+ [ruby-dev:47855] [Bug #9256]
+
+Fri Dec 20 14:19:12 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (AC_ARG_WITH): use withval directly.
+ fix failure on FreeBSD.
+ http://fb32.rubyci.org/~chkbuild/ruby-trunk/log/20131217T070301Z.diff.html.gz
+
+Fri Dec 20 14:00:01 2013 Aman Gupta <ruby@tmm1.net>
+
+ * include/ruby/ruby.h (struct RClass): add super, remove iv_index_tbl.
+ since RCLASS_SUPER() is commonly used inside while loops, we move it
+ back inside struct RClass to improve cache hits. this provides a
+ small improvement (1%) in hotspots like rb_obj_is_kind_of()
+ * internal.h (struct rb_classext_struct): remove super, add
+ iv_index_table
+ * internal.h (RCLASS_SUPER): update for new location
+ * internal.h (RCLASS_SET_SUPER): ditto
+ * internal.h (RCLASS_IV_INDEX_TBL): ditto
+ * object.c (rb_class_get_superclass): ditto
+ * include/ruby/backward/classext.h (RCLASS_SUPER): ditto
+
+Fri Dec 20 07:07:35 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 03d6ae7. Changes include:
+
+ * Fixed typos.
+
+ * Relaxed Gem.ruby test for ruby packagers that do not use `ruby`.
+
+ * test/rubygems: ditto.
+
+Thu Dec 19 14:03:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_get_freeobj): improve hot path performance.
+
+ * gc.c (heap_get_freeobj_from_next_freepage): replace with
+ heap_get_freepage(). It returns freeobj instead of freepage.
+ This is not on hot path.
+
+Thu Dec 19 12:05:17 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master af60443. Changes include:
+
+ * Improved speed of `gem install --ignore-dependencies`.
+
+ * Open read-write for exclusive flock. [ruby-trunk - Bug #9257]
+
+ * Remove specification before install to prevent infinite loop.
+
+Thu Dec 19 11:23:49 2013 Aman Gupta <ruby@tmm1.net>
+
+ * vm_insnhelper.c (vm_call_iseq_setup_normal): simple for loop
+ condition optimization. this area shows up as a hotspot in VM
+ profiles.
+
+Thu Dec 19 10:50:13 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (newobj_of): don't need to RBASIC_SET_CLASS() which includes WB
+ here because created obj is always YOUNG/INFANT.
+
+Thu Dec 19 10:48:37 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: check GC::OPTS availability
+ for not MRI 2.1.0.
+
+Thu Dec 19 03:10:30 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (heap_get_freeobj): remove redundant assignment. heap->freelist
+ is set after the while() loop already.
+
+Thu Dec 19 01:54:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/runner.rb: fix commit miss on r44278.
+
+Thu Dec 19 00:26:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect_body): lazy_sweep setting should work
+ without USE_RGENGC.
+
+Wed Dec 18 23:31:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_dump_major_reason): fix this function because major_reason
+ can be OR of multiple reasons.
+
+ * gc.c (gc_profile_dump_on): ditto.
+
+Wed Dec 18 17:03:00 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_record_get): should return an empty array
+ when profiling is active.
+
+Wed Dec 18 16:49:40 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_clear, gc_profile_enable): remove rest_sweep().
+
+ * gc.c: check objspace->profile.current_record before inserting
+ profiling record by new macro gc_prof_enabled().
+
+Wed Dec 18 14:32:06 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_exec.h (VM_DEBUG_STACKOVERFLOW): added.
+ disable stack overflow check for every stack pushing as default.
+
+ * vm_exec.c (vm_stack_overflow_for_insn): ditto.
+
+Wed Dec 18 10:00:22 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master d8f12e2. This increases the
+ speed of `gem install --ignore-dependencies` which helps bundler
+ tests.
+ * test/rubygems: ditto.
+
+Wed Dec 18 09:00:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb (test_expand_heap): allow +/-1 diff.
+
+Tue Dec 17 23:44:15 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * test/ruby/test_io.rb: fix duplicated test name.
+
+Tue Dec 17 20:15:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_reject): revert to deprecated behavior, with
+ warnings, due to compatibility for HashWithDifferentAccess.
+ [ruby-core:59154] [Bug #9223]
+
+Tue Dec 17 17:30:56 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el: Import version 2.1.1 from
+ https://github.com/knu/ruby-electric.el.
+
+ * ruby-electric-delete-backward-char: Enable support for number
+ prefix.
+
+ * ruby-electric-curlies: Fix electric operation after an open
+ curly.
+
+Tue Dec 17 16:19:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_trace.c (rb_postponed_job_flush): isolate exceptions in
+ postponed jobs and restore outer ones. based on a patch by
+ tarui. [ruby-core:58652] [Bug #9168]
+
+Tue Dec 17 10:48:04 2013 Aman Gupta <ruby@tmm1.net>
+
+ * configure.in (RUBY_DTRACE_POSTPROCESS): Fix compatibility with
+ systemtap on linux. stap requires `dtrace -G` post-processing, but
+ the dtrace compatibility wrapper is very strict about probes.d
+ syntax.
+
+Tue Dec 17 05:18:17 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 1c5f4b3. Allows rubygems
+ repackagers to disable backward-compatible shared gem directory
+ behavior.
+ * test/rubygems: ditto.
+
+Tue Dec 17 05:14:35 2013 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS (RDoc): Update version number so I don't have to change it
+ for the final release.
+
+Mon Dec 16 19:19:19 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_markable_object_p): should check special_const_p
+ first (by is_markable_object()).
+
+Mon Dec 16 19:12:54 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c (reachable_object_from_root_i): use
+ compare_by_identity hash to avoid hash modify problem
+ during iteration.
+ [Bug #9252]
+
+ * ext/objspace/objspace.c (reachable_objects_from_root): ditto.
+
+Mon Dec 16 18:16:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_verify_internal_consistency): should not use
+ rb_objspace_each_objects() because it call rest_sweep().
+
+Mon Dec 16 18:07:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_markable_object_p): fix last commit (build error).
+
+Mon Dec 16 18:04:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_markable_object_p): it should be live objects.
+
+Mon Dec 16 18:00:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_each_objects): should not clear dont_lazy_sweep
+ flag in nested case.
+
+Mon Dec 16 16:40:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_method.c (rb_method_entry_make): fix WB miss.
+ Note that rb_method_entry_t::klass is not constified.
+ We may constify this field.
+
+ * test/ruby/test_alias.rb: add a test.
+
+Mon Dec 16 14:14:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: use gc_verify_internal_consistency() instead of
+ gc_check_before_marks_i() for check consistency
+ on RGENGC_CHECK_MODE >= 2.
+
+Mon Dec 16 14:01:48 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c (make_clock_result): add :second as a unit for
+ Process.clock_gettime.
+
+Mon Dec 16 13:10:54 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: introduce GC.verify_internal_consistency method to verify GC
+ internal data structure.
+
+ Now this method only checks generation (old/young) consistency.
+
+Mon Dec 16 11:49:26 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (gc_info_decode): Fix build errors when compiled with
+ RGENGC_ESTIMATE_OLDMALLOC=0
+ * gc.c (objspace_malloc_increase): ditto
+
+Sun Dec 15 13:38:29 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c (reachable_object_from_root_i):
+ reachable objects should not include categories and
+ category_objects because it is noisy information.
+
+ In fact, objects created after calling
+ ObjectSpace.reachable_objects_from_root should not be included
+ as a returning hash objects. Currently, mswin64 platform has a
+ problem because of this behavior. Should we trace new objects?
+
+Sun Dec 15 07:09:28 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc master 263a9e5. This improves the
+ accessibility of the search box.
+
+Sat Dec 14 17:39:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_callee_setup_arg_complex): count post
+ arguments as mandatory arguments. [ruby-core:57706] [Bug #8993]
+
+ * vm_insnhelper.c (vm_yield_setup_block_args): ditto.
+
+Sat Dec 14 16:26:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rubylibprefix): replace exec_prefix as well as
+ bindir and libdir. a patch by kimuraw (Wataru Kimura) at
+ [ruby-dev:47852]. [Bug #9160]
+
+Sat Dec 14 14:42:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/logger.rb (lock_shift_log): no need to rotate the log file
+ if it has been rotated by another process. based on the patch
+ by no6v (Nobuhiro IMAI) in [ruby-core:58620]. [Bug #9133]
+
+Sat Dec 14 13:01:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (mnew_from_me): method by respond_to_missing? should be
+ owned by the original class.
+
+Sat Dec 14 11:55:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/scanf.rb (IO#scanf): fix mistaken use of rescue modifier.
+ a patch by Mon_Ouie at [ruby-core:52813]. [Bug #7940]
+
+Sat Dec 14 11:44:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (ruby_qsort): fix potential stack overflow on a large
+ machine. based on the patch by Conrad Irwin <conrad.irwin AT
+ gmail.com> at [ruby-core:51816]. [Bug #7772]
+
+Sat Dec 14 11:25:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_mod_const_defined): support nested class path as
+ well as const_get. [Feature #7414]
+
+Sat Dec 14 01:31:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_rescue2): reuse tags pushed for body proc to protect
+ rescue proc too.
+
+Sat Dec 14 01:15:51 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (wmap_final_func): Bugfix. Should update *value to new pointer.
+
+Sat Dec 14 01:05:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb: Don't test $! in "ensure" clause because
+ it may be set before the body.
+ Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247]
+
+ * lib/cgi/core.rb: Ditto.
+
+ * lib/drb/ssl.rb: Ditto.
+
+Sat Dec 14 00:34:31 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * internal.h (ruby_sized_xrealloc2): fix typo introduced in r44117,
+ which cause compile error on Solaris.
+
+Sat Dec 14 00:22:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c: (exec_recursive): use rb_catch_protect() instead of
+ rb_catch_obj() and PUSH_TAG(), and reduce pushing tags and
+ machine stack usage.
+
+Sat Dec 14 00:18:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (mnew_from_me): achieve the original defined_class from
+ prepended iclass, to fix inherited owner.
+
+ * proc.c (method_owner): return the defined class, but not the
+ class which the method object is created from.
+
+Fri Dec 13 22:29:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (method_owner): return the class where alias is defined, not
+ the class original method is defined.
+
+ * vm_method.c (rb_method_entry_make, rb_alias): store the originally
+ defined class in me. [Bug #7993] [Bug #7842] [Bug #9236]
+
+ * vm_method.c (rb_method_entry_get_without_cache): cache included
+ module but not iclass.
+
+Fri Dec 13 16:27:17 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (gc_info_decode): Use :major_by=>:nofree as fallback reason
+ when other trigger conditions are present.
+
+Fri Dec 13 13:25:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * error.c: add Exception#backtrace_locations.
+ Now, there are no setter and independent from Exception#backtrace.
+ [Feature #8960]
+
+ * eval.c (setup_exception): set backtrace locations for `bt_location'
+ special attribute.
+
+ * vm_backtrace.c (rb_backtrace_to_location_ary): added.
+
+ * internal.h: ditto.
+
+ * test/ruby/test_backtrace.rb: add a test for
+ Exception#backtrace_locations.
+
+Fri Dec 13 12:01:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect_body): use rb_bug() and explicit error message
+ instead of using assert().
+ [Bug #9222]
+
+Fri Dec 13 11:52:41 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c: fix comment to remove the word "shady".
+
+ * variable.c: ditto.
+
+Fri Dec 13 11:33:55 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename *shady* func/macros.
+ * RVALUE_RAW_SHADY() -> RVALUE_WB_PROTECTED_RAW()
+ * RVALUE_SHADY() -> RVALUE_RAW_SHADY()
+ * rgengc_check_shady() -> rgengc_check_relation().
+ And fix some messages using "shady" to "non-WB-protected".
+
+Fri Dec 13 10:04:23 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/request_set/lockfile.rb: Import RubyGems master a8d0669
+ with a 1.8.7 compatibility fix.
+ * test/rubygems/test_gem_request_set_lockfile.rb: ditto.
+
+Fri Dec 13 09:50:49 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master ddac51f. Changes:
+
+ * Allow override for the shared gem installation directory for
+ rubygems packagers.
+
+ * Lock gem cache files for read and write to improve thread safety.
+
+ * Use io/console when available.
+
+ * Minor cleanup.
+
+ * test/rubygems: ditto.
+
+Fri Dec 13 08:15:31 2013 Aman Gupta <ruby@tmm1.net>
+
+ * class.c (include_modules_at): use RCLASS_M_TBL_WRAPPER for
+ equality checks. this avoids an unnecessary deference inside a tight
+ loop, fixing a performance regression from r43973.
+ * object.c (rb_obj_is_kind_of): ditto.
+ * object.c (rb_class_inherited_p): ditto.
+
+Wed Dec 13 02:00:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (VpSetPTR): fix for limitation of the resulting
+ precision.
+ [ruby-core:50269] [Bug #7458]
+
+ * test/bigdecimal/test_bigdecimal.rb (test_limit): add tests for the above
+ change.
+
+Wed Dec 13 01:56:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (VpAddAbs): put out a conditional branch from
+ the inside of while-loop.
+
+ * ext/bigdecimal/bigdecimal.c (VpSubAbs): ditto.
+
+Wed Dec 13 01:53:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (VPrint): be a static function, support another
+ dump formats, and add more information of the given bigdecimal.
+
+ * ext/bigdecimal/bigdecimal.h: ditto.
+
+Wed Dec 11 16:45:58 2013 Koichi Sasada <ko1@atdot.net>
+
+ * eval.c (rb_raise_jump): call c_return hook immediately after
+ popping `raise' frame.
+ Patches by deivid (David Rodriguez). [Bug #8886]
+
+ * test/ruby/test_settracefunc.rb: catch up this fix.
+
+Wed Dec 11 16:01:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_reject): return a plain hash, without copying
+ the class, default value, instance variables, and taintedness.
+ they had been copied just by accident.
+ [ruby-core:59045] [Bug #9223]
+
+Wed Dec 11 15:36:15 2013 Aman Gupta <ruby@tmm1.net>
+
+ * compile.c (iseq_specialized_instruction): emit opt_aset instruction
+ to optimize Hash#[]= and Array#[]= when called with Fixnum argument.
+ [Bug #9227] [ruby-core:58956]
+
+Wed Dec 11 04:54:03 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master ec8ed22. Notable changes
+ include:
+
+ * Renamed extension_install_dir to extension_dir (backwards
+ compatible).
+
+ * Fixed creation of gem.deps.rb.lock file from
+ TestGemRequestSet#test_install_from_gemdeps_install_dir
+
+ * Fixed a typo and some documentation.
+
+ * test/rubygems: ditto.
+
+Wed Dec 11 03:18:08 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * insns.def: Fix optimization bug of Float#/ [Bug #9238]
+
+Tue Dec 10 23:58:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/date/date_strptime.c (date__strptime_internal): unset
+ case-insensitive flag for [:alpha:], which already implies both
+ cases, to get rid of backtrack explosion. [ruby-core:58984]
+ [Bug #9221]
+
+Tue Dec 10 23:44:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_hash): add salt to differentiate false and empty
+ array. [ruby-core:58993] [Bug #9231]
+
+ * hash.c (rb_any_hash, rb_hash_hash): ditto.
+
+Tue Dec 10 18:16:09 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * man/ruby.1: [DOC] Use www.ruby-toolbox.com instead of RAA.
+
+Tue Dec 10 17:21:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (wmap_finalize, wmap_aset_update): use simple malloced array
+ instead of T_ARRAY, to reduce GC pressure.
+
+Tue Dec 10 15:56:48 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (reflist_add): revert changes from r44109. it is unnecessary
+ after r44113
+ * gc.c (allrefs_i): fix whitespace
+ * gc.c (allrefs_roots_i): fix whitespace
+
+Tue Dec 10 15:46:03 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (allrefs_add): push obj only if allrefs table doesn't have
+ obj.
+
+ * gc.c (allrefs_roots_i): ditto.
+
+Tue Dec 10 15:28:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (RGENGC_CHECK_MODE): separate checkers to different modes.
+ * 2: enable generational bits check (for debugging)
+ * 3: enable livness check
+ * 4: show all references
+
+Tue Dec 10 15:15:37 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_marks_check): disable GC during checking and
+ restore malloc_increase info.
+
+Tue Dec 10 14:41:53 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (reflist_add): return 0 if reference already exists
+ * gc.c (allrefs_add): return 1 on newly added references
+ * gc.c (allrefs_i): follow references to construct complete object
+ graph. before this patch, RGENGC_CHECK could fail to verify some WB
+ miss issues. [Bug #9226] [ruby-core:58959]
+
+Tue Dec 10 11:20:56 2013 Aman Gupta <ruby@tmm1.net>
+
+ * ext/objspace/objspace_dump.c (dump_object): include fstring flag on
+ strings. include gc flags (old, remembered, wb_protected) on all objects.
+ * ext/objspace/objspace_dump.c (Init_objspace_dump): initialize lazy
+ IDs before first use.
+ * gc.c (rb_obj_gc_flags): new function to retrieve object flags
+ * internal.h (RB_OBJ_GC_FLAGS_MAX): maximum flags allowed for one obj
+ * test/objspace/test_objspace.rb (test_dump_flags): test for above
+ * test/objspace/test_objspace.rb (test_trace_object_allocations):
+ resolve name before dump (for rb_class_path_cached)
+
+Tue Dec 10 07:48:29 2013 Aman Gupta <ruby@tmm1.net>
+
+ * vm_method.c (rb_clear_method_cache_by_class): fire
+ ruby::method-cache-clear probe on global or klass-level method cache
+ clear [Bug #9190]
+ * probes.d (provider ruby): new dtrace probe
+ * doc/dtrace_probes.rdoc: docs for new probe
+ * test/dtrace/test_method_cache.rb: test for new probe
+
+Tue Dec 10 06:14:11 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/.document: Remove curses from documentable directories.
+
+Tue Dec 10 04:55:36 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/lib/openssl/digest.rb: Deprecate OpenSSL::Digest::Digest
+ [Fixes GH-446] https://github.com/ruby/ruby/pull/446
+
+Tue Dec 10 00:41:42 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/thread/thread.c: [DOC] add call-seq alias for Queue#enq, #<<, etc.
+
+ * ext/thread/thread.c (Init_thread): use rb_define_alias instead of
+ rb_alias to document alias.
+
+Mon Dec 9 20:00:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * internal.h (RCLASS_SERIAL): Add RCLASS_SERIAL as a convenience
+ accessor for RCLASS_EXT(klass)->class_serial.
+
+ * class.c, vm_insnhelper.c, vm_method.c: Use RCLASS_SERIAL
+
+Mon Dec 9 19:50:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * compile.c, insns.def, test/ruby/test_rubyvm.rb, vm.c, vm_core.h,
+ vm_insnhelper.c, vm_insnhelper.h, vm_method.c: Rename method_serial
+ to global_method_state and constant_serial to global_constant_state
+ after discussion with ko1.
+
+Mon Dec 9 18:50:43 2013 Aman Gupta <ruby@tmm1.net>
+
+ * hash.c (rb_hash_replace): fix segv on `{}.replace({})` introduced
+ in r44060 [Bug #9230] [ruby-core:58991]
+ * test/ruby/test_hash.rb: regression test for above
+
+Mon Dec 9 18:10:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (vm_stat): renamed from ruby_vm_stat.
+ Should not use ruby_ prefix here.
+
+Mon Dec 9 16:13:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (wmap_size): add ObjectSpace::WeakMap#size and #length.
+
+Mon Dec 9 15:26:17 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/test_curses.rb: removed.
+
+Mon Dec 9 13:36:55 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/curses, sample/curses: removed curses.
+
+ * NEWS: added an entry for the above change.
+
+Mon Dec 9 12:26:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/objspace/object_tracing.c (newobj_i): use cached class path
+ only to get rid object allocation during NEWOBJ hook.
+ [ruby-core:58853] [Bug #9212]
+
+ * variable.c (rb_class_path_cached): returns cached class path
+ only, without searching and allocating new class path string.
+
+Mon Dec 9 11:14:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/date/date_parse.c (parse_time): unset case-insensitive flag
+ for [:alpha:], which already implies both cases, to get rid of
+ backtrack explosion. [ruby-core:58876] [Bug #9221]
+
+Mon Dec 9 08:40:40 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master bf37240. Fixes useless
+ error message with `gem install -g` with no gem dependencies file.
+ * test/rubygems: ditto.
+
+Mon Dec 9 04:52:25 2013 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS: Update RubyGems entry with notable features.
+
+Mon Dec 9 04:43:54 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/.document: Add syslog/lib and thread/thread.c to documentable
+ items. [ruby-trunk - Bug #9228]
+
+Mon Dec 9 04:28:50 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 096db36. Changes include
+ support for PATH in Gemfile.lock and a typo fix from Akira Matsuda.
+ * test/rubygems: ditto.
+
+Mon Dec 9 02:10:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/responses.rb:
+ Add `HTTPIMUsed`, as it is also supported by rack/rails.
+ RFC - http://tools.ietf.org/html/rfc3229
+ by Vipul A M <vipulnsward@gmail.com>
+ https://github.com/ruby/ruby/pull/447 fix GH-447
+
+Sun Dec 8 20:47:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_get_kwargs): when values is non-null, remove
+ extracted keywords from the rest keyword argument.
+
+Sun Dec 8 20:26:54 2013 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+
+ * common.mk (ruby.imp): avoid circular dependency on AIX
+
+Sun Dec 8 20:21:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * bigdecimal.c (BigDecimal_coerce): convert a Float to a BigDecimal instead
+ of converting the receiver to a Float. The reason is there are BigDecimal
+ instances with precisions that is smaller than the Float's precision.
+ [ruby-core:58756] [Bug #9192]
+
+ * test/bigdecimal/test_bigdecimal.rb: add tests for the above change.
+
+Sun Dec 8 18:28:20 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * NEWS: [DOC] update NEWS about GC.
+
+Sun Dec 8 17:52:24 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * object.c: [DOC] document Module#singleton_class?.
+
+Sun Dec 8 16:19:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_get_kwargs): if optional is negative, unknown
+ keywords are allowed.
+
+ * vm_insnhelper.c (vm_callee_setup_keyword_arg): check unknown
+ keywords.
+
+Sun Dec 8 14:55:12 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * array.c (rb_ary_shuffle_bang, rb_ary_sample): rename local variables.
+
+Sun Dec 8 13:59:38 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * array.c (rb_ary_shuffle_bang, rb_ary_sample): check
+ unknown keywords.
+
+ * test/ruby/test_array.rb (test_shuffle, test_sample): tests for
+ the above.
+
+Sun Dec 8 13:01:11 2013 Aman Gupta <ruby@tmm1.net>
+
+ * vm.c (ruby_vm_stat): add RubyVM.stat() for access to internal cache
+ counters. this methods behaves like GC.stat, accepting an optional
+ hash or symbol argument. [Bug #9190] [ruby-core:58750]
+ * test/ruby/test_rubyvm.rb: test for new method
+
+Sun Dec 8 11:59:40 2013 Aman Gupta <ruby@tmm1.net>
+
+ * hash.c (rb_hash_replace): add a write barrier to fix GC mark miss on
+ hashes using Hash#replace [Bug #9226] [ruby-core:58948]
+
+Sun Dec 8 11:21:00 2013 Aman Gupta <ruby@tmm1.net>
+
+ * include/ruby/ruby.h: add RGENGC_WB_PROTECTED_NODE_CREF setting
+ In a large app, this reduces the size of
+ remembered_shady_object_count by 80%. [Bug #9225] [ruby-core:58947]
+ * gc.c (rb_node_newnode): add FL_WB_PROTECTED flag to NODE_CREF
+ * class.c (rewrite_cref_stack): insert OBJ_WRITE for NODE_CREF
+ * iseq.c (set_relation): ditto
+ * iseq.c (rb_iseq_clone): ditto
+ * vm_eval.c (rb_yield_refine_block): ditto
+ * vm_insnhelper.c (vm_cref_push): ditto
+ * vm_insnhelper.h (COPY_CREF): ditto
+
+Sun Dec 8 10:45:05 2013 Aman Gupta <ruby@tmm1.net>
+
+ * hash.c (hash_aset_str): revert r43870 due to performance issue
+ [Bug #9188] [ruby-core:58730]
+ * parse.y (assoc): convert literal string hash keys to fstrings
+ * test/ruby/test_hash.rb (class TestHash): expand test
+
+Sun Dec 8 10:22:38 2013 Aman Gupta <ruby@tmm1.net>
+
+ * parse.y (register_symid_str): use fstrings in symbol table
+ [Bug #9171] [ruby-core:58656]
+ * parse.y (rb_id2str): ditto
+ * string.c (rb_fstring): create frozen_strings on first usage. this
+ allows rb_fstring() calls from the parser (before cString is created)
+ * string.c (fstring_set_class_i): set klass on fstrings generated
+ before cString was defined
+ * string.c (Init_String): convert frozen_strings table to String
+ objects after boot
+ * ext/-test-/symbol/type.c (bug_sym_id2str): expose rb_id2str()
+ * test/-ext-/symbol/test_type.rb (module Test_Symbol): verify symbol
+ table entries are fstrings
+
+Sun Dec 8 10:24:20 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Update version for upcoming ruby 2.1.0 RC.
+
+Sun Dec 8 10:21:36 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 14749ce. This fixes bugs
+ handling of gem dependencies lockfiles (Gemfile.lock).
+
+ * test/rubygems: ditto.
+
+Sun Dec 8 09:40:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * array.c (rb_ary_or): use RHASH_TBL_RAW instead of RHASH_TBL
+
+ * process.c (rb_execarg_fixup): use RHASH_TBL_RAW and insert write
+ barriers where appropriate
+
+ * vm.c (kwmerge_i): use RHASH_TBL_RAW
+
+ * vm.c (HASH_ASET): use rb_hash_aset instead of calling directly into
+ st_insert
+
+Sat Dec 7 11:15:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_reject): copy unrejected elements only to new hash,
+ so that the change on the original receiver can affect.
+ [ruby-core:58914] [Bug #9223]
+
+Sat Dec 7 08:25:00 2013 Richo Healey <richo@psych0tik.net>
+
+ * test/ruby/test_struct.rb: Add regression test for question marks and
+ bangs in struct members. [Closes GH-468]
+
+Fri Dec 6 19:33:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_extract_keywords, rb_get_kwargs): move from
+ vm_insnhelper.c.
+
+Fri Dec 6 19:18:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change oldmalloc meaning.
+ Increase oldmalloc_increase with malloc_increase
+ instead of using obj_memsize_of().
+
+ This change will avoid the danger of memory full without major GC.
+
+Fri Dec 6 19:08:48 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (atomic_sub_nounderflow): not 0 but val itself.
+
+Fri Dec 6 18:37:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_alloc, Init_heap): initialize
+ oldmalloc_increase_limit at Init_heap.
+
+ rb_objspace_alloc() is not called on some platforms.
+
+Fri Dec 6 18:33:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect_body): bug fix.
+ initialize after recording.
+
+Fri Dec 6 17:49:46 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (atomic_sub_nounderflow): added to simplify atomic sub with
+ care about underflow.
+
+ * gc.c (objspace_malloc_increase): use it.
+
+Fri Dec 6 17:10:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (rb_get_kwargs): get keyword argument values from an
+ option hash, not only checking keys.
+
+ * dir.c (dir_initialize): use rb_get_kwargs.
+
+ * gc.c (gc_start_internal): ditto.
+
+Fri Dec 6 16:47:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-brace-to-do-end): split single line block.
+
+ * misc/ruby-mode.el (ruby-do-end-to-brace): shrink single line block
+ to one line.
+
+Fri Dec 6 16:16:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_start_internal): do not use rb_gc_start() and rb_gc().
+
+Fri Dec 6 15:24:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_start_internal, rb_gc): do not need
+ heap_pages_free_unused_pages() here.
+ It was done in after_sweep().
+
+ * gc.c (rb_gc): The reason is now GPR_FLAG_CAPI.
+
+Fri Dec 6 14:05:19 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (gc_start_internal): GC.start() now accepts two optional
+ keyword arguments. These can be used to disable full_mark (minor
+ mark only) or disable immediate_sweep (use lazy sweep). These new
+ options are useful for benchmarking GC behavior, or performing minor
+ GC out-of-band.
+ * test/ruby/test_gc.rb (class TestGc): tests for new options.
+
+Fri Dec 6 11:51:28 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/erb.rb: [DOC] fix broken link, Use rubygems.org and www.ruby-toolbox.com instead of RAA.
+ [Bug #9197]
+
+Fri Dec 6 10:50:54 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/webrick/httprequest.rb: [DOC] Fix broken link of CGI specification by @udzura [fix GH-466]
+
+Thu Dec 6 01:27:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec):
+ treat 0.0 and -0.0 of floating-point numbers specially for an optimization
+ and to correctly propagate its signbit to the result.
+ [Bug #9214] [ruby-core:58858]
+
+ * test/bigdecimal/test_bigdecimal.rb: add tests case for the above change.
+
+ * test/bigdecimal/test_bigdecimal_util.rb: ditto.
+
+Thu Dec 5 22:18:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (configuration): strip destdir part from prefix to get
+ rid of duplication. a patch by arton at [ruby-core:58859].
+ [ruby-core:58856] [Bug #9213]
+
+Thu Dec 5 21:53:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_or): lhs elements are preferred, so should not
+ replace with rhs elements.
+
+ * test/ruby/test_array.rb (test_OR_in_order): import the test failed
+ by r43969 from rubyspec/core/array/union_spec.rb.
+
+Thu Dec 5 21:05:42 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_info_decode): fix to avoid syntax error on VS2012.
+
+Thu Dec 5 19:35:35 2013 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * st.c: tweaked comment
+
+Thu Dec 5 19:21:10 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (struct rb_objspace): rename internal last_collection_flags to
+ latest_gc_info
+ * gc.c (gc_latest_collection_info): add GC.latest_gc_info() with similar
+ behavior to GC.stat()
+ * gc.c (rb_gc_latest_gc_info): new c-api for above
+ * gc.c (gc_stat_internal): remove :last_collection_flags from GC.stat
+ * gc.c (gc_profile_decode_flags): remove GC::Profiler.decode_flags
+ * include/ruby/intern.h (rb_gc_latest_gc_info): export new c-api
+ * test/ruby/test_gc.rb (class TestGc): test for new behavior
+ * NEWS: note about new api
+
+ * gc.c (gc_stat_internal): raise TypeError on wrong type
+ * gc.c (gc_stat): fix error message
+
+Thu Dec 5 18:18:08 2013 Aman Gupta <ruby@tmm1.net>
+
+ * ext/objspace/gc_hook.c: remove this file
+ * ext/-test-/tracepoint/gc_hook.c: new filename for above
+ * ext/objspace/objspace.c: remove ObjectSpace.after_gc_start_hook=
+ * test/objspace/test_objspace.rb: remove test
+ * test/-ext-/tracepoint/test_tracepoint.rb: add above test for
+ tracepoint re-entry
+
+Thu Dec 5 17:44:53 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change function names vm_ prefix to objspace_ prefix.
+ They are objspace_ functionality.
+
+Thu Dec 5 16:11:04 2013 Aman Gupta <ruby@tmm1.net>
+
+ * include/ruby/intern.h: add rb_gc_stat() for access to GC.stat
+ variables from c-api
+ * gc.c (rb_gc_stat): new c-api method. accepts either VALUE hash like
+ GC.stat, or VALUE symbol key and returns size_t directly. the second
+ form is useful to avoid allocations, i.e. for usage inside
+ INTERNAL_EVENT_GC tracepoints.
+ * gc.c (gc_stat): add GC.stat(:key) to return single value instead of hash
+ * gc.c (gc_stat_internal): helper method to retrieve single or all stat values
+ * test/ruby/test_gc.rb (class TestGc): test for new behavior
+ * NEWS: note about this new api
+
+Thu Dec 5 14:40:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash): revert r43981 and bail out to the outermost frame
+ when recursion is detected.
+
+Thu Dec 5 13:47:15 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (vm_malloc_size): added.
+ return malloc_usable_size() if possible.
+
+ * gc.c (MALLOC_ALLOCATED_SIZE): add new setting macro to enable
+ GC.allocated_size.
+ If platform supports `malloc_usable_size()' (or similar one),
+ GC.allocated_size can be implemented with this function.
+ Default is 0.
+
+ * gc.c (vm_xmalloc, vm_xrealloc, vm_xfree): use vm_malloc_size()
+ to detect collect allocated size.
+
+ * gc.c (vm_malloc_increase): refactoring.
+
+Thu Dec 5 13:19:03 2013 Aman Gupta <ruby@tmm1.net>
+
+ * include/ruby/ruby.h: remove INTERNAL_EVENT_GC_END and replace with
+ two new events: GC_END_MARK and GC_END_SWEEP
+ * gc.c (gc_after_sweep): emit GC_END_SWEEP after lazy sweep is done
+ * gc.c (gc_marks_body): emit GC_END_MARK at end of minor/major mark
+ * ext/-test-/tracepoint/tracepoint.c (struct tracepoint_track): tests
+ for new events.
+ * test/-ext-/tracepoint/test_tracepoint.rb (class TestTracepointObj):
+ ditto.
+ * NEWS: remove ObjectSpace.after_gc_*_hook. These are only a sample,
+ and will be removed before ruby 2.1.
+ * ext/objspace/gc_hook.c: remove ObjectSpace.after_gc_end_hook=
+
+Thu Dec 5 10:47:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby_atomic.h (ATOMIC_PTR_EXCHANGE): atomic exchange function for
+ a generic pointer.
+
+Thu Dec 5 10:47:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (finalize_deferred): flush all deferred finalizers while other
+ finalizers can get ready to run newly by lazy sweep.
+ [ruby-core:58833] [Bug #9205]
+
+Thu Dec 5 09:07:59 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (ruby_gc_set_params): Accept safe_level argument so GC tuning
+ settings can be applied before rb_safe_level() is available.
+ * internal.h (rb_gc_set_params): ditto.
+ * ruby.c (process_options): Apply GC tuning early during boot process
+ so boot-time allocations can benefit. This also benefits any code
+ loaded in via `ruby -r`.
+
+Wed Dec 4 13:02:13 2013 Aman Gupta <ruby@tmm1.net>
+
+ * vm_trace.c (rb_suppress_tracing): Fix initialization of stack
+ allocated rb_trace_arg_t structure. Without this patch, sometimes
+ INTERNAL_EVENT_GC would be skipped accidentally inside
+ rb_threadptr_exec_event_hooks_orig().
+
+Wed Dec 4 12:57:24 2013 Aman Gupta <ruby@tmm1.net>
+
+ * string.c (fstr_update_callback): Improve implementation in r43968
+ based on feedback from @nagachika. In the existing case, we can
+ return ST_STOP to prevent any hash modification. In the !existing
+ case, set both key and value to the fstr.
+
+Wed Dec 4 12:47:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/delegate.rb (Delegator#method_missing): ignore the target if not
+ set, and delegate to global methods. [ruby-core:58572] [Bug #9155]
+
+ * lib/delegate.rb (Delegator#respond_to_missing): ditto.
+
+ * lib/delegate.rb (SimpleDelegator#__getobj__): yield and return if
+ not delegated but a block is given, like as Hash#fetch.
+
+ * lib/delegate.rb (DelegateClass#__getobj__): ditto.
+
+Tue Dec 3 23:48:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: check malloc_size() availability.
+
+ * gc.c: use malloc_size() with malloc/malloc.h if available.
+
+Tue Dec 3 23:06:20 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * object.c (rb_obj_clone): don't copy FL_WB_PROTECTED of a
+ original object.
+
+Tue Dec 3 22:32:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_recursive): make similar (recursive) constructs
+ return same hash value. execute recursively, and rewind to the
+ topmost frame with an object which .eql? to the recursive
+ object, if recursion is detected.
+
+ * hash.c (rb_hash): detect recursion for all `hash' methods. each
+ `hash' methods no longer need to use rb_exec_recursive().
+
+Tue Dec 3 21:53:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_catch_protect): new function similar to
+ rb_catch_obj(), but protect from all global jumps like as
+ rb_load_protect(), rb_protect(), etc.
+
+Tue Dec 3 20:18:46 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * object.c (rb_obj_clone): Protect FL_PROMOTED and FL_WB_PROTECTED
+ flags of a destination object.
+
+Tue Dec 3 20:16:38 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new(),
+ to hide temporary object from ObjectSpace. [Bug #9187]
+
+Tue Dec 3 17:11:47 2013 Aman Gupta <ruby@tmm1.net>
+
+ * load.c (features_index_add_single): Move loaded_features_index array values off
+ the ruby heap. [Bug #9201] [ruby-core:58805]
+ * load.c (loaded_features_index_clear_i): Clean up off-heap array structure.
+ * vm.c (rb_vm_mark): Remove unnecessary mark_tbl for loaded_features_index.
+ This improves minor GC time by 15% in a large application.
+
+Tue Dec 3 17:01:45 2013 Aman Gupta <ruby@tmm1.net>
+
+ * include/ruby/ruby.h (struct RClass): Add wrapper struct around
+ RClass->m_tbl with serial. This prevents double marking method
+ tables, since many classes/modules can share the same method table.
+ This improves minor mark time in a large application by 30%.
+ * internal.h (struct method_table_wrapper): Define new
+ wrapper struct with additional serial.
+ * internal.h (RCLASS_M_TBL_INIT): New macro for initializing method
+ table wrapper and st_table.
+ * method.h (void rb_sweep_method_entry): Rename rb_free_m_table to
+ rb_free_m_tbl for consistency
+ * .gdbinit (define rb_method_entry): Update rb_method_entry gdb helper
+ for new method table structure.
+ * class.c: Use RCLASS_M_TBL_WRAPPER and
+ RCLASS_M_TBL_INIT macros.
+ * class.c (rb_include_class_new): Share WRAPPER between module and
+ iclass, so serial can prevent double marking.
+ * eval.c (rb_prepend_module): ditto.
+ * eval.c (rb_using_refinement): ditto.
+ * gc.c: Mark and free new wrapper struct.
+ * gc.c (obj_memsize_of): Count size of additional wrapper struct.
+
+Tue Dec 3 14:05:49 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_uniq_bang): remove duplicate code.
+
+Tue Dec 3 13:40:42 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (ary_add_hash): set and return values because string keys
+ will be frozen. [ruby-core:58809] [Bug #9202]
+
+ * array.c (rb_ary_uniq_bang): ditto.
+
+ * array.c (rb_ary_or): ditto.
+
+ * array.c (rb_ary_uniq): ditto.
+
+ * test/ruby/test_array.rb: tests for above.
+
+ The patch is from normalperson (Eric Wong).
+
+Tue Dec 3 12:20:21 2013 Aman Gupta <ruby@tmm1.net>
+
+ * string.c (rb_fstring): Use st_update instead of st_lookup +
+ st_insert.
+ * string.c (fstr_update_callback): New callback for st_update.
+
+Tue Dec 3 12:17:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/constant.rb (RDoc::Constant#documented?): workaround for
+ NoMethodError when the original of alias is not found.
+
+Tue Dec 3 10:43:58 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/lib/openssl/buffering.rb: Return ASCII-8BIT strings from
+ SSLSocket methods. [ruby-trunk - Bug #9028]
+ * test/openssl/test_ssl.rb: Test for the above.
+
+Tue Dec 3 09:42:27 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc master 900de99. Changes include:
+
+ Fixed documentation display of constants
+
+ Fixed handling of unknown parsers
+
+ * test/rdoc: ditto.
+
+Mon Dec 2 22:30:10 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * hash.c (getenv): fixed test failures introduced by r43950.
+ [ruby-core:58774] [Bug #9195] reported by phasis68 (Heesob Park).
+
+Mon Dec 2 21:49:19 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_rehash): make temporary st_table under the control
+ of GC. [Bug #9187]
+
+ * test/ruby/test_hash.rb: add a test for above.
+
+Mon Dec 2 17:23:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * variable.c (rb_mod_constants): when calling Module#constants with
+ inherit=false, there is no need to use a hashtable to deduplicate
+ constant names. [Feature #9196] [ruby-core:58786]
+
+Mon Dec 2 14:16:52 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/smtp.rb (Net::SMTP#critical): Always return a
+ Net::SMTP::Response. Patch by Pawel Veselov.
+ [ruby-trunk - Bug #9125]
+ * test/net/smtp/test_smtp.rb: Test for the above.
+
+Mon Dec 2 05:52:33 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master baa965b. Notable changes:
+
+ Copy directories to lib/ when installing extensions. This completes
+ the fix for [ruby-trunk - Bug #9106]
+
+ * test/rubygems: ditto.
+
+Mon Dec 2 02:03:47 2013 Shota Fukumori <her@sorah.jp>
+
+ * test/ruby/test_case.rb (test_nomethoderror):
+ Add test related to r43913, r43914
+
+Mon Dec 2 00:53:01 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * hash.c (getenv): use ANSI codepage version of getenv() for miniruby
+ on Windows.
+ [ruby-core:58732] [Bug #9189] reported by phasis68 (Heesob Park).
+
+Sun Dec 1 22:14:27 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributors.rdoc: [DOC] Import contributors from redmine wiki
+ Many wiki pages have become outdated and spam-ridden, we will import
+ these to trunk and begin maintaining them in ruby-trunk. This will
+ also allow new contributors to easily contribute patches to update
+ these pages, where previously a redmine account with wiki access was
+ required. Another bonus is having a contributors file to show thanks
+ to all of the people who have submitted a patch to Ruby.
+
+Sun Dec 1 18:03:26 2013 Zachary Scott <e@zzak.io>
+
+ * doc/maintainers.rdoc: [DOC] Current maintainers of Ruby
+
+Sun Dec 1 17:17:36 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Current branch maintainers
+
+Sun Dec 1 17:16:36 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Reporting other (ruby-lang.org) issues
+
+Sun Dec 1 17:15:51 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Current platform maintainers
+
+Sun Dec 1 17:14:55 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Reporting downstream distro issues
+
+Sun Dec 1 14:37:20 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_to_a): specify array capa.
+
+Sun Dec 1 14:15:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_rehash): fix to free new st_table when exception
+ is raised in do_hash(). [Bug #9187]
+
+Sun Dec 1 11:57:59 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/lib/openssl/buffering.rb: Fix warning in copyright
+
+Sun Dec 1 08:27:28 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 66e5c39. Notable changes:
+
+ Implement gem.deps.rb (Gemfile) .lock support
+
+ Fixed `gem uninstall` for a relative directory in GEM_HOME.
+
+ * test/rubygems: ditto.
+
+Sun Dec 1 06:00:49 2013 Aman Gupta <ruby@tmm1.net>
+
+ * test/ruby/test_gc.rb (test_gc_reason): Force minor GC by consuming
+ free slots to fix test.
+
+Sat Nov 30 21:22:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_initialize): check unknown keywords. [ruby-dev:47152]
+ [Bug #8060]
+
+Sat Nov 30 18:05:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32ole/win32ole.c (hash2named_arg): correct declaration to fix
+ build failure. a patch by phasis68 (Heesob Park) at
+ [ruby-core:58710]. [Bug #9184]
+
+Sat Nov 30 17:46:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (ruby_cleanup): determine exit status and signal to terminate
+ before finalization, to get rid of access destroyed T_DATA exception
+ object. [ruby-core:58643] [Bug #9167]
+
+Sat Nov 30 16:25:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (enumerator_with_index): should not store local variable
+ address to memoize the arguments. it is invalidated after the return.
+ [ruby-core:58692] [Bug #9178]
+
+Sat Nov 30 13:28:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * siphash.c (sip_hash24): fix for aligned word access little endian
+ platforms. [ruby-core:58658] [Bug #9172]
+
+Sat Nov 30 13:21:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_yield_block): implement non-nil block argument.
+
+Fri Nov 29 20:59:39 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * vm_dump.c (rb_vmdebug_debug_print_pre): Bugfix. Get PC directly.
+ PC is cached into local stack and cfp->pc is incorrect at next of
+ branch or jump.
+ * vm_exec.h (DEBUG_ENTER_INSN): catch up this change.
+ * vm_core.h: update signature of rb_vmdebug_debug_print_pre.
+
+Fri Nov 29 20:43:57 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * compile.c: Bugsfix for dump_disasm_list.
+ rb_inspect denies a hidden object. So, insert wrapper that creates
+ the unhidden one.
+ adjust->label is null sometimes.
+ insn_data_line_no makes no sense at all.
+
+Fri Nov 29 18:06:45 2013 Shota Fukumori <her@sorah.jp>
+
+ * test/ruby/test_case.rb (test_method_missing): Test for r43913.
+
+Fri Nov 29 17:53:22 2013 Shota Fukumori <her@sorah.jp>
+
+ * vm_insnhelper.c (check_match): Fix SEGV with VM_CHECKMATCH_TYPE_CASE
+ and class of `pattern` has `method_missing`
+ [Bug #8872] [ruby-core:58606]
+
+Fri Nov 29 17:06:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_yield_block): yield block with rb_block_call_func
+ arguments.
+
+ * range.c (range_each): use rb_yield_block.
+
+ * include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): constify argv.
+
+ * enum.c (rb_enum_values_pack): ditto.
+
+ * vm_eval.c (rb_block_call, rb_check_block_call): ditto.
+
+ * include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration
+ argument list of rb_block_call_func.
+
+Fri Nov 29 11:26:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (rb_block_call_func): add blockarg. block
+ function can take block argument, e.g., proc {|&blockarg| ...}.
+
+Thu Nov 28 21:43:48 2013 Zachary Scott <e@zzak.io>
+
+ * doc/dtrace_probes.rdoc: [DOC] Import dtrace probes doc from wiki
+
+Thu Nov 28 21:17:32 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Add heading above ChangeLog tips to
+ setup entry for commits, its not required. Actually easier if
+ contributors don't include a ChangeLog entry.
+
+Thu Nov 28 21:16:18 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Add coding style heading for patch
+ rules
+
+Thu Nov 28 21:15:45 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Add notes about deciding what to patch
+
+Thu Nov 28 19:43:45 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * benchmark/bm_hash_flatten.rb: added. r43896 is about 4 times faster
+ than 2.0.0p353.
+
+ * benchmark/bm_hash_keys.rb: added. r43896 is about 5 times faster
+ than 2.0.0p353.
+
+ * benchmark/bm_hash_values.rb: added. r43896 is about 5 times faster
+ than 2.0.0p353.
+
+Thu Nov 28 19:29:04 2013 Zachary Scott <e@zzak.io>
+
+ * doc/contributing.rdoc: [DOC] Add notes about slideshow proposals
+ from wiki page: HowToRequestFeatures
+
+Thu Nov 28 17:34:42 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * st.c: add st_values() and st_values_check().
+
+ * include/ruby/st.h: add prototypes for above.
+
+ * hash.c (rb_hash_values): use st_values_check() for performance
+ improvement if VALUE and st_data_t are compatible.
+
+Thu Nov 28 17:14:14 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * st.c (st_keys): fix not to use Qundef in st.c.
+
+ * include/ruby/st.h: define modified prototype.
+
+ * hash.c (rb_hash_keys): use modified st_keys().
+
+Thu Nov 28 16:34:43 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c: Expose details about last garbage collection via GC.stat.
+ * gc.c (gc_stat): Add :last_collection_flags for reason/trigger/type of
+ last GC run.
+ * gc.c (gc_prof_sweep_timer_stop): Record HAVE_FINALIZE GPR even
+ without GC_PROFILE_MORE_DETAIL.
+ * gc.c (gc_profile_flags): Add GC::Profiler.decode_flags to make sense
+ of GC.stat[:last_collection_flags]
+ * test/ruby/test_gc.rb (class TestGc): Test for above.
+
+Thu Nov 28 16:15:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_dup2): extract from rb_cloexec_dup2() and
+ redirect_dup2().
+
+Tue Nov 28 14:40:00 2013 Akira Matsuda <ronnie@dio.jp>
+
+ * lib/drb/ssl.rb: [Doc] Fix typo
+
+Thu Nov 28 13:56:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (Doxyfile): tool/file2lastrev.rb needs running with
+ BASERUBY since r43617. [ruby-dev:47823] [Bug #9169]
+
+Thu Nov 28 09:18:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (rb_fstring): fstrings should be ELTS_SHARED.
+ If we resurrect dying objects (non-marked, but not swept yet),
+ pointing shared string can be collected.
+ To avoid such issue, fstrings (recorded to fstring_table)
+ should not be ELTS_SHARED (should not have a shared string).
+
+Thu Nov 28 01:35:08 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * st.c (st_keys): fix to use st_index_t for size of hash.
+
+Thu Nov 28 00:36:52 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * st.c (st_keys): define st_keys(). it writes each key to buffer.
+
+ * hash.c (rb_hash_keys): use st_keys() for performance improvement
+ if st_data_t and VALUE are compatible.
+
+ * include/ruby/st.h: define macro ST_DATA_COMPATIBLE_P() to predicate
+ whether st_data_t and passed type are compatible.
+
+ * configure.in: check existence of builtin function to use in
+ ST_DATA_COMPATIBLE_P().
+
+Thu Nov 28 00:07:28 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * ruby_atomic.h: remove duplicate definitions between ATOMIC_XXX
+ and ATOMIC_SIZE_XXX.
+
+Wed Nov 27 23:55:50 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * ruby_atomic.h: define ATOMIC_SIZE_CAS() with
+ __atomic_compare_exchange_n() and refactoring.
+
+Tue Nov 27 21:43:00 2013 Akira Matsuda <ronnie@dio.jp>
+
+ * lib/irb/notifier.rb: [Doc] Fix typo
+ * ext/json/lib/json/common.rb: Ditto.
+
+Tue Nov 27 18:04:57 2013 Akira Matsuda <ronnie@dio.jp>
+
+ * lib/irb/notifier.rb: Fix typo
+
+Wed Nov 27 17:54:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_stacked_objects): check only when check_mode > 0.
+
+Wed Nov 27 16:07:19 2013 Aman Gupta <ruby@tmm1.net>
+
+ * test/ruby/test_gc.rb (class TestGc): Fix warning in
+ test_expand_heap.
+
+Wed Nov 27 15:55:52 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (Init_GC): Add new GC::INTERNAL_CONSTANTS for information about
+ GC heap/page/slot sizing.
+ * test/ruby/test_gc.rb (class TestGc): test for above.
+
+Wed Nov 27 15:21:17 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (gc_page_sweep): Fix compile warning from last commit.
+ * hash.c (hash_aset_str): Re-use existing variable to avoid
+ unnecessary pointer dereferencing.
+
+Wed Nov 27 15:12:55 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_page_sweep): disable debug print.
+
+Wed Nov 27 15:05:59 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): add new information heap_eden_page_length and
+ heap_tomb_page_length.
+
+ * test/ruby/test_gc.rb: fix to use GC.stat[:heap_eden_page_length]
+ instead of GC.stat[:heap_length].
+ This test expects `heap_eden_page_length' (used pages size).
+
+Wed Nov 27 15:02:53 2013 Aman Gupta <ruby@tmm1.net>
+
+ * test/ruby/test_eval.rb (class TestEval): Use assert_same instead of
+ assert_equal.
+ * test/ruby/test_hash.rb (class TestHash): ditto.
+ * test/ruby/test_iseq.rb (class TestISeq): ditto.
+
+Wed Nov 27 14:50:02 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rinda/ring.rb: Announce RingServer for the same process.
+ [ruby-trunk - Bug #9163]
+ * test/rinda/test_rinda.rb: Tests for the above.
+
+Wed Nov 27 14:37:33 2013 Aman Gupta <ruby@tmm1.net>
+
+ * test/ruby/test_eval.rb (class TestEval): Add test for shared eval
+ filenames via rb_fstring().
+ * test/ruby/test_iseq.rb (class TestISeq): Add test for shared
+ iseq labels via rb_fstring(). [Bug #9159]
+
+Wed Nov 27 14:24:55 2013 Aman Gupta <ruby@tmm1.net>
+
+ * hash.c (hash_aset_str): Use rb_fstring() to de-duplicate hash string
+ keys. Patch by Eric Wong. [Bug #8998] [ruby-core:57727]
+ * test/ruby/test_hash.rb (class TestHash): test for above.
+
+Wed Nov 27 10:39:39 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c: Rename rb_heap_t members:
+ used -> page_length
+ limit -> total_slots
+
+Wed Nov 27 08:24:49 2013 Aman Gupta <ruby@tmm1.net>
+
+ * compile.c: Use rb_fstring() to de-duplicate string literals in code.
+ [ruby-core:58599] [Bug #9159] [ruby-core:54405]
+ * iseq.c (prepare_iseq_build): De-duplicate iseq labels and source
+ locations.
+ * re.c (rb_reg_initialize): Use rb_fstring() for regex string.
+ * string.c (rb_fstring): Handle non-string and already-fstr arguments.
+ * vm_eval.c (eval_string_with_cref): De-duplicate eval source
+ filename.
+
+Wed Nov 27 07:13:54 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: psych version 2.0.2
+ * ext/psych/psych.gemspec: ditto
+
+Wed Nov 27 06:40:18 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: fix support for negative
+ years.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * test/psych/test_date_time.rb: test for change.
+ Fixes: https://github.com/tenderlove/psych/issues/168
+
+Wed Nov 27 04:46:55 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: fix regexp for matching TIME
+ strings.
+ * test/psych/test_date_time.rb: test for change.
+ Fixes: https://github.com/tenderlove/psych/issues/171
+
+Wed Nov 27 02:26:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (str_new4): copy the original capacity so that memsize of
+ frozen shared string returns correct size.
+
+Wed Nov 27 02:20:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_hash): should not ignore the rest of recursive
+ constructs.
+
+ * hash.c (rb_hash_hash): ditto.
+
+ * range.c (range_hash): ditto.
+
+ * struct.c (rb_struct_hash): ditto.
+
+ * test/-ext-/test_recursion.rb (TestRecursion): separate from
+ test/ruby/test_thread.rb.
+
+Tue Nov 26 22:43:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash): cut off if recursion detected to get rid of stack
+ overflow. [ruby-core:58567] [Bug #9151]
+
+Tue Nov 26 20:02:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_settracefunc.rb: add tests for a_call/a_return
+ by Brandur <brandur@mutelight.org> [Feature #9120]
+
+Tue Nov 26 19:29:52 2013 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: add useful config "set breakpoint pending on"
+ for run.gdb.
+
+Tue Nov 26 19:17:47 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/object_tracing.c (newobj_i): skip class_path if class
+ is frozen.
+
+ rb_class_path() can modify frozen classes (and causes errors).
+ This patch is temporary. We need no-modification/no-allocation
+ class path function.
+
+Tue Nov 26 18:12:13 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: skip "exception check" and "reentrant check (only normal
+ events) for internal events.
+
+ Reentrant check for internal events are remaining.
+
+Tue Nov 26 17:38:16 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: prohibit to specify normal events and internal events
+ simultaneously.
+ I will introduce special care for internal events later.
+
+ * ext/-test-/tracepoint/tracepoint.c: test this behavior.
+
+ * test/-ext-/tracepoint/test_tracepoint.rb: ditto.
+
+Tue Nov 26 16:30:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_readlink): fix buffer overflow on a long symlink. since
+ rb_str_modify_expand() expands from its length but not its capacity,
+ need to set the length properly for each expansion.
+ [ruby-core:58592] [Bug #9157]
+
+Tue Nov 26 14:23:17 2013 Aman Gupta <ruby@tmm1.net>
+
+ * ext/objspace/objspace_dump.c (dump_append_string_value): Escape
+ control characters for strict json parsers.
+ * ext/objspace/objspace_dump.c (objspace_dump): Document File/IO
+ output option.
+
+Tue Nov 26 11:43:19 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * ruby_atomic.h: use __atomic builtin functions supported by GCC.
+ __sync family are legacy functions now and it is recommended
+ that new code use the __atomic functions.
+ http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
+
+ * configure.in: check existence of __atomic functions.
+
+Tue Nov 26 10:57:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.gemspec: revert Gem::Specification#date
+ for snapshot/release tarballs.
+
+Tue Nov 26 06:42:50 2013 Aman Gupta <ruby@tmm1.net>
+
+ * NEWS: Add ObjectSpace.after_gc_{start,end}_hook=
+ * ext/objspace/objspace_dump.c: [DOC] catch up dump/dump_all to r43679
+
+Tue Nov 26 04:12:10 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 612f85a. Notable changes:
+
+ Fixed installation and activation of git: and path: gems via
+ Gem.use_gemdeps
+
+ Improved documentation coverage
+
+ * test/rubygems: ditto.
+
+Mon Nov 25 22:23:03 2013 Zachary Scott <e@zzak.io>
+
+ * lib/xmlrpc.rb: [DOC] Fix link to xmlrpc4r site [Bug #9148]
+ Patch by Giorgos Tsiftsis
+
+Mon Nov 25 19:48:10 2013 Zachary Scott <e@zzak.io>
+
+ * lib/uri/common.rb: [DOC] typo fixes by @vipulnsward [Fixes GH-456]
+ https://github.com/ruby/ruby/pull/456
+ * lib/uri/generic.rb: [DOC] ditto.
+
+Mon Nov 25 14:34:42 2013 Zachary Scott <e@zzak.io>
+
+ * ext/bigdecimal/bigdecimal.gemspec: bump BigDecimal to 1.2.3 for
+ proper release date in RubyGems
+
+Mon Nov 25 14:25:08 2013 Zachary Scott <e@zzak.io>
+
+ * ext/bigdecimal/bigdecimal.gemspec: Remove Gem::Specification#date
+ We should rely on rubygems to create the date the gem was released
+ for each version.
+
+Mon Nov 25 06:53:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * internal.h: do not use ruby_sized_xrealloc() and ruby_sized_xfree()
+ if HAVE_MALLOC_USABLE_SIZE (or _WIN32) is defined.
+
+ We don't need these function if malloc_usable_size() is available.
+
+ * gc.c: catch up this change.
+
+ * gc.c: define HAVE_MALLOC_USABLE_SIZE on _WIN32.
+
+ * array.c (ary_resize_capa): do not use ruby_sized_xfree() with
+ local variable to avoid "unused local variable" warning.
+ This change only has few impact.
+
+ * string.c (rb_str_resize): ditto.
+
+Mon Nov 25 05:05:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/-ext-/tracepoint/test_tracepoint.rb: catch up GC.stat changes
+ at r43835.
+
+Mon Nov 25 04:45:59 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: continue to change OLDSPACE -> OLDMALLOC.
+ RGENGC_ESTIMATE_OLDSPACE -> RGENGC_ESTIMATE_OLDMALLOC.
+
+ * gc.c: add a new major GC reason GPR_FLAG_MAJOR_BY_OLDMALLOC.
+
+Mon Nov 25 04:16:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change terminology "..._num" to "..._slots" about slot operation.
+ * final_num -> final_slots
+ * objspace_live_num() -> objspace_live_slots()
+ * objspace_limit_num() -> objspace_limit_slots()
+ * objspace_free_num() -> objspace_free_slots()
+
+Mon Nov 25 04:03:12 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): add internal information.
+ * heap_swept_slot
+ * malloc_increase
+ * malloc_limit
+ * remembered_shady_object
+ * remembered_shady_object_limit
+ * old_object
+ * old_object_limit
+ * oldmalloc_increase
+ * oldmalloc_limit
+
+ * gc.c (gc_stat): rename names.
+ * heap_live_num -> heap_live_slot
+ * heap_free_num -> heap_free_slot
+ * heap_final_slot -> heap_final_slot
+
+ Quote from RDoc of GC.stat():
+ "The contents of the hash are implementation specific and may
+ be changed in the future."
+
+ * test/ruby/test_gc.rb: catch up this change.
+
+Mon Nov 25 03:59:45 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb: catch up last commit.
+ Now RUBY_GC_OLDSPACE_LIMIT(...) is RUBY_GC_OLDMALLOC_LIMIT(...).
+
+Mon Nov 25 03:10:46 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change terminology OLDSPACE -> OLDMALLOC.
+ (oldspace -> oldmalloc for variable names)
+
+ OLDSPACE is confusing because it is not includes slots.
+ To more clearly, rename such as (oldspace_limit -> oldmalloc_limit).
+ It is clear that it measures (estimates) malloc()'ed size.
+
+Mon Nov 25 00:50:03 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * internal.h: use __builtin_bswap16() if possible.
+
+ * configure.in: check existence of __builtin_bswap16().
+
+Sun Nov 24 22:24:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigxor_int): Apply BIGLO for long in a BDIGIT expression.
+ (bigor_int): Ditto.
+ (bigand_int): Ditto.
+
+Sun Nov 24 18:13:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h (SIZEOF_ACTUAL_BDIGIT): Defined.
+
+ * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Use
+ SIZEOF_ACTUAL_BDIGIT instead of SIZEOF_BDIGITS.
+ SIZEOF_BDIGITS can be different to sizeof(BDIGIT).
+
+Sun Nov 24 13:49:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h: Don't use int128_t for Bignum.
+ It's not always faster.
+
+ * bignum.c: Ditto.
+
+Sun Nov 24 10:18:15 2013 Aman Gupta <ruby@tmm1.net>
+
+ * NEWS: Add details about new debugging features and APIs.
+
+Sun Nov 24 09:37:20 2013 Andrew Vit <andrew@avit.ca>
+
+ * lib/csv.rb: Optimize header hashes by freezing string keys.
+ [ruby-core:58510]
+
+Sun Nov 24 09:18:06 2013 Aman Gupta <ruby@tmm1.net>
+
+ * ext/objspace/objspace_dump.c (dump_object): Use PRIuSIZE to print
+ size_t for better win32 compatibility.
+ * test/objspace/test_objspace.rb (test_dump_all): Hold reference to
+ test string to avoid failure due to GC. Reduce size of failure message
+ using grep(/TEST STRING/).
+
+Sun Nov 24 08:38:00 2013 Kyle Stevens <kstevens715@gmail.com>
+
+ * lib/csv.rb: If skip_lines is set to a String, convert it to a Regexp
+ to prevent the alternative, which is that each line in the CSV gets
+ converted to a Regexp when calling skip_lines#match.
+
+Sun Nov 24 01:03:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead
+ of FIX2INT to avoid conversion error.
+
+Sun Nov 24 00:44:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros
+ defined in defines.h, instead of complex and repeated expression.
+
+Sat Nov 23 22:22:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Limit the value to
+ less than 8.
+
+Sat Nov 23 19:52:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/lib/bigdecimal/math.rb (BigMath.E): Use BigMath.exp.
+ [Feature #6857] [ruby-core:47130]
+
+Sat Nov 23 19:46:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Optimize the
+ calculation algorithm to reduce the number of divisions.
+ This optimization was proposed by Rafal Michalski.
+ [Feature #6857] [ruby-core:47130]
+
+Sat Nov 23 19:20:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): The signature was
+ changed to allow us to pass arguments directly.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_div3): Added for the role of
+ the old BigDecimal_div2.
+
+Sat Nov 23 12:31:00 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix global variable name.
+ Now we have following environments (and related variable names).
+
+ * RUBY_GC_HEAP_INIT_SLOTS
+ * RUBY_GC_HEAP_FREE_SLOTS
+ * RUBY_GC_HEAP_GROWTH_FACTOR (new from 2.1)
+ * RUBY_GC_HEAP_GROWTH_MAX_SLOTS (new from 2.1)
+
+ * obsolete
+ * RUBY_FREE_MIN -> RUBY_GC_HEAP_FREE_SLOTS (from 2.1)
+ * RUBY_HEAP_MIN_SLOTS -> RUBY_GC_HEAP_INIT_SLOTS (from 2.1)
+
+ * RUBY_GC_MALLOC_LIMIT
+ * RUBY_GC_MALLOC_LIMIT_MAX (new from 2.1)
+ * RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR (new from 2.1)
+
+ * RUBY_GC_OLDSPACE_LIMIT (new from 2.1)
+ * RUBY_GC_OLDSPACE_LIMIT_MAX (new from 2.1)
+ * RUBY_GC_OLDSPACE_LIMIT_GROWTH_FACTOR (new from 2.1)
+
+ * test/ruby/test_gc.rb: catch up this change.
+
+Sat Nov 23 09:45:49 2013 Aman Gupta <ruby@tmm1.net>
+
+ * marshal.c (w_object): Use HASH_PROC_DEFAULT directly from internal.h
+
+Sat Nov 23 08:43:23 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c: Rename heap_pages_swept_num to heap_pages_swept_slots to
+ clarify meaning (number of slots, not pages).
+
+Sat Nov 23 08:23:23 2013 Aman Gupta <ruby@tmm1.net>
+
+ * lib/set.rb (class SortedSet): Fix source_location for methods
+ defined via eval.
+
+Sat Nov 23 03:44:03 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master dcce4ff. Important changes
+ in this commit:
+
+ Remove automatic detection of gem dependencies files. This prevents a
+ security hole as described in [ruby-core:58490]
+
+ Fixed bugs for installing git gems.
+
+ * test/rubygems: ditto.
+
+Fri Nov 22 22:30:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_power):
+ Round the result value only if the precision is given.
+
+Fri Nov 22 17:20:50 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * transcode.c (str_transcode0): don't scrub invalid chars if
+ str.encode doesn't have explicit invalid: :replace.
+ workaround fix for see #8995
+
+Fri Nov 22 17:11:26 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * include/ruby/intern.h, internal.h: Expose rb_gc_count().
+
+Fri Nov 22 17:07:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.gemspec: version 1.2.2.
+
+Fri Nov 22 17:04:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_data_type):
+ Use RUBY_TYPED_FREE_IMMEDIATELY only if it is available.
+
+Fri Nov 22 16:49:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Round the result value.
+ [Bug #8818] [ruby-core:56802]
+
+ * test/bigdecimal/test_bigdecimal.rb: Add a test for the above fix.
+
+Fri Nov 22 16:25:43 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_set_increment): accept minimum additional page number.
+
+ * gc.c (gc_after_sweep): allocate pages to allocate at least
+ RUBY_HEAP_MIN_SLOTS.
+ [Bug #9137]
+
+Fri Nov 22 16:19:52 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * include/ruby/intern.h (rb_gc_set_params): Deprecate
+ rb_gc_set_params because it's only used in ruby internal.
+
+ * internal.h (ruby_gc_set_params): Declare rb_gc_set_params's
+ alias function.
+
+ * gc.c: ditto.
+
+ * ruby.c: use ruby_gc_set_params.
+
+Fri Nov 22 14:55:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Insert rb_thread_check_ints.
+
+Fri Nov 22 14:35:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix the inserting points
+ of RB_GC_GUARDs.
+
+Fri Nov 22 14:31:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c: Fix indentation.
+
+Fri Nov 22 14:03:00 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf: merge nkf 2.1.3 2a2f2c5.
+
+Fri Nov 22 12:43:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (ruby_strtod): ignore too long fraction part, which does not
+ affect the result.
+
+Fri Nov 22 12:17:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#initialize):
+ initialize of a module should pass arguments to super.
+
+Fri Nov 22 12:02:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_settracefunc.rb: Ignore events from other threads.
+
+Fri Nov 22 10:35:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (ruby_vm_destruct): do not use ruby_xfree() after freeing
+ objspace.
+
+ * gc.c (ruby_mimfree): added. It is similar to ruby_mimmalloc().
+
+ * internal.h: ditto.
+
+Fri Nov 22 09:42:35 2013 Zachary Scott <e@zzak.io>
+
+ * test/digest/test_digest.rb: Reverse order of assert_equal
+ Reported by @splattael
+
+Fri Nov 22 09:03:16 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * gc.c: fix build failure on FreeBSD introduced by r43763.
+ malloc_usable_size() is defined by malloc_np.h on FreeBSD.
+
+ * configure.in: check malloc.h and malloc_np.h.
+
+Fri Nov 22 08:27:13 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 50a8210. Important changes
+ in this commit:
+
+ RubyGems now automatically checks for gem.deps.rb or Gemfile when
+ running ruby executables. This behavior is similar to `bundle exec
+ rake`. This change may be reverted before Ruby 2.1.0 if too many bugs
+ are found.
+
+ * test/rubygems: ditto.
+
+Thu Nov 21 22:33:59 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: RGENGC_CHECK_MODE should be 0.
+
+Thu Nov 21 21:40:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (VpAlloc): Fix the expr to adjust the size
+ of the digit array.
+
+Thu Nov 21 21:36:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix the precision of
+ the result BigDecimal of sqrt.
+ [Bug #5266] [ruby-dev:44450]
+
+ * test/bigdecimal/test_bigdecimal.rb: add tests for the above changes.
+
+Thu Nov 21 18:49:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (vm_xrealloc, vm_xfree): use malloc_usable_size() to obtain old
+ size if available.
+
+Thu Nov 21 18:47:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/delegate.rb (SimpleDelegator#__getobj__): target object must be set.
+
+ * lib/delegate.rb (DelegateClass#__getobj__): ditto.
+
+Thu Nov 21 18:28:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tempfile.rb (Tempfile#initialize): use class method to get rid
+ of warnings when $VERBOSE.
+
+Thu Nov 21 17:43:29 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename initial_xxx variables to gc_params.xxx.
+ They are not only used initial values.
+
+ Chikanaga-san: Congratulations on RubyPrize!
+
+Thu Nov 21 17:16:00 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: enable "RGENGC_ESTIMATE_OLDSPACE" option as default.
+ Without this option, some application consumes huge memory.
+ (and there are only a few performance down)
+
+ Introduced new environment variables:
+ * RUBY_GC_HEAP_OLDSPACE (default 16MB)
+ * RUBY_GC_HEAP_OLDSPACE_MAX (default 128 MB)
+ * RUBY_GC_HEAP_OLDSPACE_GROWTH_FACTOR (default 1.2)
+
+ * gc.c (initial_malloc_limit): rename to initial_malloc_limit_min.
+
+Thu Nov 21 16:51:34 2013 Zachary Scott <e@zzak.io>
+
+ * ext/digest/bubblebabble/bubblebabble.c: Teach RDoc digest/bubblebabble
+
+Thu Nov 21 16:50:16 2013 Zachary Scott <e@zzak.io>
+
+ * test/digest/test_digest.rb: Add more tests for digest/bubblebabble
+
+Thu Nov 21 16:32:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/delegate.rb (Delegator#method_missing): try private methods defined in
+ Kernel after the target. [Fixes GH-449]
+
+Thu Nov 21 16:25:08 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/uri/test_generic.rb (URI#test_merge): Test uri + URI(path)
+ in addition to uri + path.
+
+Thu Nov 21 15:36:08 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/lib/openssl/buffering.rb: [DOC] Fix HEREDOC comment for
+ OpenSSL::Buffering which breaks overview because of RDoc bug
+
+Thu Nov 21 14:46:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * eval_intern.h (SAVE_ROOT_JMPBUF): workaround for the failure of
+ test/ruby/test_exception.rb on Windows.
+ wrap by __try and __exception statements on mswin to raise SIGSEGV
+ when EXCEPTION_STACK_OVERFLOW is occurred, because MSVCRT doesn't
+ handle the exception.
+ however, (1) mingw-gcc doesn't support __try and __exception
+ statements, and (2) we cannot retry SystemStackError after this
+ change yet (maybe crashed) because SEH and longjmp() are too
+ uncongenial.
+
+ * signal.c (check_stack_overflow, CHECK_STACK_OVERFLOW): now defined on
+ Windows, too.
+
+ * thread_win32.c (ruby_stack_overflowed_p): ditto.
+
+Thu Nov 21 14:18:24 2013 Zachary Scott <e@zzak.io>
+
+ * object.c: [DOC] Clarify Object#dup vs #clone [Bug #9128]
+ Moving existing doc for this comparison to separate section of #dup
+ Adding examples to document behavior of #dup with Module#extend.
+ Based on a patch by stevegoobermanhill
+
+Thu Nov 21 14:06:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_marks_check): do not dump all refs.
+
+ * gc.c (allrefs_dump_i): fix output format.
+
+Thu Nov 21 13:43:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change RGENGC_CHECK_MODE (>= 2) logic.
+ Basically, make an object graph of all of living objects before and
+ after marking and check status.
+
+ [Before marking: check WB sanity]
+ If there is a non-old object `obj' pointed from old object
+ (`parent') then `parent' or `obj' should be remembered.
+
+ [After marking: check marking miss]
+ Traversible objects with the object graph should be marked.
+ (However, this alert about objects pointed by machine context
+ can be false positive. We only display alert.)
+
+ [Implementation memo]
+ objspace_allrefs() creates an object graph.
+ The object graph is represented by st_table, key is object (VALUE)
+ and value is referring objects. Referring objects are stored by
+ "struct reflist".
+
+ * gc.c (init_mark_stack): do not use push_mark_stack_chunk() at init.
+ This pre-allocation causes failure on is_mark_stack_empty()
+ without any pushing.
+
+Thu Nov 21 13:40:20 2013 Zachary Scott <e@zzak.io>
+
+ * lib/observer.rb: [DOC] Clarify default observer method.
+ By @edward [Fixes GH-450] https://github.com/ruby/ruby/pull/450
+
+Thu Nov 21 13:32:53 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_engine.c: [DOC] Documentation for OpenSSL::Engine
+ This patch is based off work by @vbatts in GH-436 completing the
+ documentation for this class and its methods.
+ https://github.com/ruby/ruby/pull/436
+
+Thu Nov 21 10:45:22 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/lib/openssl/buffering.rb: Remove unused arguments from
+ OpenSSL::Buffering.new [Fixes GH-445]
+
+Thu Nov 21 10:30:47 2013 Zachary Scott <e@zzak.io>
+
+ * test/digest/test_digest.rb: Add test for Digest::SHA256.bubblebabble
+
+Wed Nov 20 20:54:01 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * tool/instruction.rb : fix typo.
+
+Wed Nov 20 19:45:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (rand_init): Make it possible to specify arbitrary array
+ for init_genrand().
+
+Wed Nov 20 17:34:13 2013 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y (rb_gc_mark_symbols): set global_symbols.minor_marked only
+ when full_mark is 0.
+ rb_gc_mark_symbols() (with full_mark == 1) can be called by other
+ than GC (such as rb_objspace_reachable_objects_from_root()).
+
+Wed Nov 20 11:46:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: merge JSON 1.8.1.
+ https://github.com/nurse/json/compare/002ac2771ce32776b32ccd2d06e5604de6c36dcd...e09ffc0d7da25d0393873936c118c188c78dbac3
+ * Remove Rubinius exception since transcoding should be working now.
+ * Fix https://github.com/flori/json/issues/162 reported by Marc-Andre
+ Lafortune <github_rocks@marc-andre.ca>. Thanks!
+ * Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress
+ warning with -Wchar-subscripts and better validate UTF-8 strings.
+ * Applied patch by ginriki@github to remove unnecessary if.
+ * Add load/dump interface to JSON::GenericObject to make
+ serialize :some_attribute, JSON::GenericObject
+ work in Rails active models for convenient
+ SomeModel#some_attribute.foo.bar access to serialised JSON data.
+
+Wed Nov 20 01:39:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/constant.rb (RDoc::Constant#documented?): workaround for
+ NoMethodError when the original of alias is not found.
+
+Tue Nov 19 23:38:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (--with-os-version-style): option to transform target
+ OS version string.
+
+Tue Nov 19 21:27:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/net/http/utils.rb (spawn_server): Specify zero for port to
+ avoid reusing an allocated port.
+
+ * test/net/http/test_http.rb: Don't specify port here.
+
+ * test/net/http/test_https.rb: Ditto.
+
+Tue Nov 19 18:52:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_is_swept_object): use heap_page::before_sweep flag.
+
+Tue Nov 19 18:49:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_reachable_objects_from_root): do major marking.
+
+Tue Nov 19 18:45:40 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_resurrect): added.
+ rb_fstring() used rb_gc_mark() to avoid freeing used string.
+ However, rb_gc_mark() set mark bit *and* pushes mark_stack.
+ rb_gc_resurrect() does only set mark bit if it is before sweeping.
+
+ * string.c (rb_fstring): use rb_gc_resurrect.
+
+ * internal.h: add decl.
+
+Tue Nov 19 09:47:02 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc master a1195ce. Changes include:
+
+ Improved accessibility of the main sidebar navigation.
+
+ Fixed handling of regexp options in HTML source highlighting.
+
+ * test/rdoc: ditto.
+
+Tue Nov 19 09:33:52 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:
+
+ Compatibly renamed Gem::DependencyResolver to Gem::Resolver.
+
+ Added support for git gems in gem.deps.rb and Gemfile.
+
+ Fixed resolver bugs.
+
+ * test/rubygems: ditto.
+
+ * lib/rubygems/LICENSE.txt: Updated to license from RubyGems trunk.
+ [ruby-trunk - Bug #9086]
+
+ * lib/rubygems/commands/which_command.rb: RubyGems now indicates
+ failure when any file is missing. [ruby-trunk - Bug #9004]
+
+ * lib/rubygems/ext/builder: Extensions are now installed into the
+ extension install directory and the first directory in the require
+ path from the gem. This allows backwards compatibility with msgpack
+ and other gems that calculate full require paths.
+ [ruby-trunk - Bug #9106]
+
+
+Tue Nov 19 07:21:56 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in (LOCALTIME_OVERFLOW_PROBLEM): Define it for cross
+ compiling.
+ [ruby-core:58391] [Bug #9119] Reported by Luis Lavena.
+ Analyzed by Heesob Park.
+
+Tue Nov 19 05:55:05 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/rubygems_hook.rb: Remove debugging puts committed by
+ accident.
+
+Mon Nov 18 22:47:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_intern.h (TH_PUSH_TAG, TH_EXEC_TAG): refine stack overflow
+ detection. chain local tag after setjmp() successed on it, because
+ calling setjmp() also can overflow the stack.
+ [ruby-dev:47804] [Bug #9109]
+
+ * vm_eval.c (rb_catch_obj): now th->tag points previous tag until
+ TH_EXEC_TAG().
+
+ * thread_pthread.c (ruby_init_stack): set stack_start properly by
+ get_main_stack() if possible.
+
+Mon Nov 18 22:45:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_jump.c (rb_exec_end_proc): unlink and free procs data before
+ calling for each procs. [Bug #9110]
+
+Sun Nov 17 06:33:32 2013 Shota Fukumori <her@sorah.jp>
+
+ * configure.in: Use $LIBS for base of $SOLIBS, also in darwin.
+ By this fix, environment that libgmp is located in $LIBS can build
+ ruby.
+
+Sun Nov 17 01:56:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * thread_pthread.c (rb_thread_create_timer_thread): Show error
+ message instead of error number.
+ (thread_create_core): Ditto.
+
+ * cont.c (fiber_machine_stack_alloc): Ditto.
+
+Sat Nov 16 18:28:08 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/ultralightparser.rb
+ (REXML::Parsers::UltraLightParser#parse): Fix wrong :start_doctype
+ position.
+ [Bug #9061] [ruby-dev:47778]
+ Patch by Ippei Obayashi. Thanks!!!
+
+ * test/rexml/parser/test_ultra_light.rb: Add a test for this case.
+
+Sat Nov 16 02:13:56 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * cont.c : Introduce ensure rollback mechanism. Please see below.
+
+ * internal.h (ruby_register_rollback_func_for_ensure): catch up above change.
+ Add rollback mechanism API.
+
+ * vm_core.h (typedef struct rb_vm_struct): catch up above change.
+ Introduce ensure-rollback relation table.
+
+ * vm_core.h (typedef struct rb_thread_struct): catch up above change.
+ Introduce ensure stack.
+
+ * eval.c (rb_ensure): catch up above change.
+ Introduce ensure stack.
+
+ * hash.c : New function for rollback ensure, and register it to
+ ensure-rollback relation table. [ruby-dev:47803] [Bug #9105]
+
+ Ensure Rollback Mechanism:
+ A rollback's function is a function to rollback a state before ensure's
+ function execution.
+ When the jump of callcc is across the scope of rb_ensure,
+ ensure's functions and rollback's functions are executed appropriately
+ for keeping consistency.
+
+ Current API is unstable, and only internal use.
+
+ ruby_register_rollback_func_for_ensure(ensure_func,rollback_func)
+ This API create relation ensure's function to rollback's function.
+ By registered rollback's function, it is executed When jumping into
+ corresponding rb_ensure scope.
+
+Sat Nov 16 00:18:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * eval_jump.c (rb_exec_end_proc): fix double free or corruption error
+ when reentering by callcc. [ruby-core:58329] [Bug #9110]
+
+ * test/ruby/test_beginendblock.rb: test for above.
+
+Fri Nov 15 01:06:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/objspace/objspace_dump.c (dump_output): allow IO object as
+ output, and use Tempfile.create and return open file instead of
+ mkstemp() and path name for :file output.
+ [ruby-core:58266] [Bug #9102]
+
+ * test/objspace/test_objspace.rb (TestObjSpace#dump_my_heap_please):
+ remove temporary output file.
+
+Thu Nov 14 23:39:00 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] remove example of
+ Rational#to_d without argument. [Bug #8958]
+
+Thu Nov 14 20:24:15 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ruby_atomic.h (ATOMIC_SIZE_CAS): fix compile error on Solaris
+ since r43460.
+
+Thu Nov 14 19:53:00 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/test_cipher.rb (test_aes_gcm_wrong_tag): Don't use
+ String#succ because it can make modified (wrong) auth_tag longer
+ than 16 bytes. The longer auth_tag makes that
+ EVP_CIPHER_CTX_ctrl (and internally aes_gcm_ctrl) fail.
+ [ruby-core:55143] [Bug #8439] reported by Vit Ondruch.
+
+Thu Nov 14 11:33:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (foreach_safe_i, hash_foreach_iter): deal with error detected
+ by ST_CHECK.
+
+ * st.c (st_foreach_check): call with non-error argument in normal case.
+
+Thu Nov 14 02:37:14 2013 Zachary Scott <e@zzak.io>
+
+ * ext/thread/thread.c: [DOC] This patch accomplishes the following:
+
+ - Teach RDoc about ConditionVariable
+ - Teach RDoc about Queue
+ - Teach RDoc about SizedQueue
+ - Use fully-qualified namespace for Document-method
+ This is necessary to separate definitions between classes
+ - Fix rdoc bug in call_seq vs. call-seq
+ - Correct doc for SizedQueue#pop patch by @jackdanger [Bug #8988]
+
+Thu Nov 14 01:11:54 2013 Zachary Scott <e@zzak.io>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] +precision+ is required
+
+Wed Nov 13 19:21:36 2013 Zachary Scott <e@zzak.io>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] Document the required
+ +precision+ argument for Rational#to_d [Bug #8958]
+
+Wed Nov 13 19:02:05 2013 Zachary Scott <e@zzak.io>
+
+ * ext/digest/*: [DOC] Fix several typos and broken http links.
+ Improved examples for Digest overview and fixed a broken example in
+ Digest::HMAC overview. This patch also adds a description of
+ Digest::SHA256.bubblebabble to the Digest overview.
+
+ Patched by @stomar [Bug #9027]
+
+Wed Nov 13 18:32:12 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_config.c: [DOC] Document the following:
+
+ - OpenSSL::ConfigError
+ - OpenSSL::Config::DEFAULT_CONFIG_FILE
+
+ Patched by @vbatts via GH-436
+ https://github.com/ruby/ruby/pull/436
+
+Wed Nov 13 18:03:00 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_asn1.c: [DOC] Document parts of
+ OpenSSL::ASN1::ObjectId included a fix for the class overview, which
+ previously showed the documentation for Constructive due to missing
+ ObjectId overview. This patch also includes a note for Primitive.
+
+ Based on a patch by @vbatts via GH-436
+ https://github.com/ruby/ruby/pull/436
+
+Wed Nov 13 17:19:36 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/lib/openssl/config.rb: In #parse use +string+ for +str+
+
+Wed Nov 13 17:09:45 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/lib/openssl/*.rb: [DOC] Document the following:
+
+ - Integer#to_bn
+ - OpenSSL::Buffering module
+ - Deprecated OpenSSL::Digest::Digest compatibility class
+ - OpenSSL::Config
+
+ These changes were based on a patch by @vbatts via GH-436
+ https://github.com/ruby/ruby/pull/436
+
+Wed Nov 13 10:55:43 2013 Zachary Scott <e@zzak.io>
+
+ * doc/regexp.rdoc: [DOC] Fix typo in Special global variables section.
+ Reported by Alex Johnson on ruby-doc.org
+
+Wed Nov 13 10:43:19 2013 Zachary Scott <e@zzak.io>
+
+ * hash.c: [DOC] Adds an example for Hash#store
+
+Wed Nov 13 09:03:40 2013 Zachary Scott <e@zzak.io>
+
+ * doc/regexp.rdoc: [DOC] add note about Bug #4044 as suggested by
+ duerst-san in [ruby-core:43612] [Fixes GH-443] Patched by @rosenfeld
+ https://github.com/ruby/ruby/pull/443
+
+Tue Nov 12 10:15:14 2013 Eric Hodel <drbrain@segment7.net>
+
+ * test/rubygems/insure_session.rb: Remove unused test file.
+
+Tue Nov 12 09:16:24 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master b9213d7. Changes include:
+
+ Fixed tests on Windows (I hope) by forcing platform for
+ platform-dependent tests.
+
+ Fixed File.exists? warnings.
+
+ Improved testing infrastructure.
+
+ * test/rubygems: ditto.
+
+ * test/rdoc/test_rdoc_rubygems_hook.rb: Switch to util_spec like
+ RubyGems.
+
+Mon Nov 11 18:31:12 2013 Aman Gupta <ruby@tmm1.net>
+
+ * internal.h: move common string/hash flags to include file.
+ * ext/objspace/objspace_dump.c: remove flags shared above.
+ * hash.c: ditto.
+ * string.c: ditto.
+
+Mon Nov 11 04:36:14 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking
+ if extensions should be built. Fixes a ruby-ci failure.
+ * test/rubygems/test_gem_specification.rb: Test for the above.
+
+Mon Nov 11 03:15:56 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (symbol2event_flag): add secret feature.
+ add a_call/a_return events.
+ a_call is call | b_call | c_call, and same as a_return.
+
+Mon Nov 11 02:51:17 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes
+ in this commit:
+
+ RubyGems now chooses the test server port reliably. Patch by akr.
+
+ Partial implementation of bundler's Gemfile format.
+
+ Refactorings to improve the new resolver.
+
+ Fixes bugs in the resolver.
+
+ * test/rubygems: Tests for the above.
+
+Mon Nov 11 01:02:06 2013 Zachary Scott <e@zzak.io>
+
+ * lib/timeout.rb: [DOC] Add note about change from #8730 [Fixes GH-440]
+ * NEWS: [DOC] Improve grammar on change to Timeout
+ Patched by @srawlins in https://github.com/ruby/ruby/pull/440
+
+Sun Nov 10 23:47:05 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * gc.c (rb_gcdebug_print_obj_condition): catch up recent changes
+ to compile on GC_DEBUG.
+
+Sun Nov 10 22:16:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (exc_cause): captured previous exception.
+
+ * eval.c (make_exception): capture previous exception automagically.
+ [Feature #8257]
+
+Sun Nov 10 08:37:20 2013 Zachary Scott <e@zzak.io>
+
+ * thread.c: [DOC] Remove duplicate reference
+
+Sun Nov 10 08:09:29 2013 Zachary Scott <e@zzak.io>
+
+ * lib/drb/drb.rb: [DOC] promote better windows-safe filename regular
+ expression in DRb Logger example. Reported by Chris Pheonix
+ [Bug #9074]
+
+Sun Nov 10 08:03:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (rb_define_finalizer, rb_undefine_finalizer): rename and export
+ finalizer functions.
+
+Sun Nov 10 07:41:22 2013 Zachary Scott <e@zzak.io>
+
+ * lib/weakref.rb: [DOC] fix typos by @xaviershay [Fixes GH-439]
+ https://github.com/ruby/ruby/pull/439
+
+Sun Nov 10 06:14:39 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): emit opt_str_freeze if the #freeze
+ method is called on a static string literal with no arguments.
+
+ * defs/id.def (firstline): add freeze so idFreeze is available
+
+ * insns.def (opt_str_freeze): add opt_str_freeze instruction which
+ pushes a frozen string literal without allocating a new object if
+ String#freeze is not overridden
+
+ * string.c (Init_String): define String#freeze
+
+ * vm.c (vm_init_redefined_flag): define BOP_FREEZE on String class as
+ a basic operation
+
+ * vm_insnhelper.h: ditto
+
+ [Feature #8992] [ruby-core:57705]
+
+Sun Nov 10 01:34:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (vm_malloc_increase): sweep immediately on GC due to malloc().
+ To reduce memory usage, sweep as soon as possible.
+ This behavior is same as Ruby 2.0.0 and before.
+
+Sun Nov 10 00:39:26 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: output version description and GC::OPTS.
+
+Sun Nov 10 00:36:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (should_be_callable): allow private call since rb_eval_cmd
+ calls even private methods.
+
+Sun Nov 10 00:33:17 2013 Zachary Scott <e@zzak.io>
+
+ * lib/racc/rdoc/grammar.en.rdoc: [DOC] fix typo by Tsuyoshi Sawada
+ [Bug #9077]
+
+Sat Nov 9 22:35:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (Gem::Specification.load): obtain spec date from
+ VCS for the case using git, RUBY_RELEASE_DATE is the last resort.
+ probably fixes [Bug #9085].
+
+Sat Nov 9 20:56:12 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * ext/objspace/object_tracing.c: use declarations in internal.h.
+
+ * ext/objspace/objspace.c: ditto
+
+Sat Nov 9 20:32:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/objspace/test_objspace.rb (test_dump_all): Make the test string
+ shorter to be an embedded string on 32bit environment as well as
+ 64bit environment.
+
+Sat Nov 9 15:00:16 2013 Zachary Scott <e@zzak.io>
+
+ * io.c: [DOC] ARGF.gets may return nil [Bug #9029] patch by znz
+
+Sat Nov 9 14:54:52 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/*: [DOC] document various constants @steveklabnik [Bug #8812]
+
+Sat Nov 9 14:50:09 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/rss.rb: [DOC] document Time#w3cdtf by @steveklabnik
+ [Bug #8821]
+
+Sat Nov 9 14:29:04 2013 Zachary Scott <e@zzak.io>
+
+ * ext/dl/cfunc.c: [DOC] fix typo in example [Bug #8944]
+ Patched by Heesob Park
+
+Sat Nov 9 13:59:58 2013 Zachary Scott <e@zzak.io>
+
+ * lib/test/unit/assertions.rb: [DOC] better example for assert_send()
+ Patch by Andrew Grimm [Bug #8975]
+
+Sat Nov 9 12:45:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * insns.def: unify ic_constant_serial and ic_class_serial into one field
+ ic_serial. This is possible because these fields are only ever used
+ exclusively with each other.
+
+ * insns.def: ditto
+ * vm_core.h: ditto
+ * vm_insnhelper.c: ditto
+
+Sat Nov 9 12:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * class.c: unify names of vm state version counters to 'serial'.
+ This includes renaming 'vm_state_version_t' to 'rb_serial_t',
+ 'method_state' to 'method_serial', 'seq' to 'class_serial',
+ 'vmstat' to 'constant_serial', etc.
+
+ * insns.def: ditto
+ * internal.h: ditto
+ * vm.c: ditto
+ * vm_core.h: ditto
+ * vm_insnhelper.c: ditto
+ * vm_insnhelper.h: ditto
+ * vm_method.c: ditto
+
+Sat Nov 9 09:22:29 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_page_sweep, rgengc_rememberset_mark): Refactoring.
+ Get bitmaps directly.
+
+Sat Nov 9 09:16:36 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (RVALUE_PROMOTE_INFANT): Refactoring. Remove duplicated nonsense
+ code.
+
+Sat Nov 9 09:04:48 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_marks_test): Bugfix. Fix a struct member name for build
+ with RGENGC_CHECK_MODE.
+
+Sat Nov 9 08:58:23 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c : Add GC_PROFILE_DETAIL_MEMORY option.
+ If GC_PROFILE_MORE_DETAIL && GC_PROFILE_DETAIL_MEMORY,
+ maxrss, minflt and majflt are added to each profile record.
+
+Sat Nov 9 07:41:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (rb_vm_backtrace_object, rb_gc_count): make prototype
+ declarations, not old-K&R style.
+
+Sat Nov 9 06:11:14 2013 vo.x (Vit Ondruch) <vondruch@redhat.com>
+
+ * tool/rbinstall.rb (Gem::Specification#collect): make stable
+ Gem::Specification.files in default .gemspecs the different order of
+ "files" in .gemspec files makes them different therefore possibly
+ conflicting in multilib scenario. patch by vo.x (Vit Ondruch) at
+ [ruby-core:57544] [Bug #8623].
+
+Sat Nov 9 01:59:18 2013 Aman Gupta <ruby@tmm1.net>
+
+ * ext/objspace/objspace_dump.c: Add experimental methods to
+ dump objectspace as json: ObjectSpace.dump_all and
+ ObjectSpace.dump(obj). These methods are useful for debugging
+ reference leaks and memory growth in large ruby applications.
+ [Bug #9026] [ruby-core:57893] [Fixes GH-423]
+ * test/objspace/test_objspace.rb: tests for above.
+
+Sat Nov 9 00:26:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (GetLastError): already defined in windows.h on nowadays
+ cygwin, and caused the confliction with the system provided
+ definition on cygwin64. by @kou1okada [Fixes GH-433].
+
+Fri Nov 8 18:35:31 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/open3.rb: receive arguments as keyword arguments.
+
+Fri Nov 8 13:19:26 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * io.c (rb_io_open_with_args): use RARRAY_CONST_PTR().
+
+ * io.c (rb_scan_open_args): use const qualifier for above.
+
+ * io.c (rb_open_file): ditto.
+
+ * io.c (rb_io_open_with_args): ditto.
+
+Fri Nov 8 11:35:06 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * dir.c, pack.c, ruby.c, struct.c, vm_eval.c: use RARRAY_CONST_PTR().
+
+Fri Nov 8 10:58:02 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * compile.c (iseq_build_from_ary_exception): use RARRAY_CONST_PTR().
+
+ * compile.c (iseq_build_from_ary_body): ditto.
+
+Fri Nov 8 10:49:34 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * enumerator.c (append_method): use RARRAY_CONST_PTR().
+
+ * enumerator.c (lazy_init_iterator): ditto.
+
+Fri Nov 8 02:44:29 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (vm_malloc_increase): check GVL before gc_rest_sweep().
+ vm_malloc_increase() can be called without GVL.
+ However, gc_rest_sweep() assumes acquiring GVL.
+ To avoid this problem, check GVL before gc_rest_sweep().
+ [Bug #9090]
+
+ This workaround introduces possibility to set malloc_limit as
+ wrong value (*1). However, this may be rare case. So I commit it.
+
+ *1: Without rest_sweep() here, gc_rest_sweep() can decrease
+ malloc_increase due to ruby_sized_xfree().
+
+Fri Nov 8 02:50:25 2013 Zachary Scott <e@zzak.io>
+
+ * lib/securerandom.rb: [DOC] specify arguments passed to ::random_bytes
+ By @chastell [Fixes GH-412] https://github.com/ruby/ruby/pull/412
+
+Fri Nov 8 02:43:01 2013 Zachary Scott <e@zzak.io>
+
+ * ext/objspace/object_tracing.c: [DOC] trace_object_allocations_stop
+ By @srawlins [Fixes GH-421] https://github.com/ruby/ruby/pull/421
+
+Fri Nov 8 02:34:20 2013 Zachary Scott <e@zzak.io>
+
+ * lib/net/ftp.rb: [DOC] Document Net::FTP.mdtm and .set_socket and fix
+ spelling typo, based on patch by @artfuldodger [Fixes GH-426]
+ https://github.com/ruby/ruby/pull/426
+
+Fri Nov 8 02:14:37 2013 Zachary Scott <e@zzak.io>
+
+ * array.c: [DOC] Add note about negative indices in Array overview
+ By @ckaenzig [Fixes GH-427] https://github.com/ruby/ruby/pull/427
+
+Fri Nov 8 02:09:12 2013 Zachary Scott <e@zzak.io>
+
+ * lib/csv.rb: [DOC] Fix typo in CSV.parse_line by @funky-bibimbap
+ [Fixes GH-430] https://github.com/ruby/ruby/pull/430
+
+Fri Nov 8 01:01:54 2013 Zachary Scott <e@zzak.io>
+
+ * golf_prelude.rb: syntax formatting for whitespace [Fixes GH-425]
+ Patch by @edward https://github.com/ruby/ruby/pull/425
+
+Thu Nov 7 19:36:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: modify malloc_limit strategy.
+
+ * fix default values:
+ GC_MALLOC_LIMIT_GROWTH_FACTOR
+ GC_MALLOC_LIMIT: 8MB -> 16MB
+ GC_MALLOC_LIMIT_MAX: 384MB -> 32MB
+
+ * algorithm of malloc_limit increment.
+ if (malloc_increase < malloc_limit) {
+ next_malloc_limit = malloc_limit * factor
+ if (malloc_limit > malloc_limit_max) {
+ malloc_limit = malloc_increase
+ }
+ }
+ This algorithm change malloc_limit from
+ 16MB -> 32MB slowly.
+ If malloc_limit exceeds malloc_limit_max, then
+ increase with malloc_increase.
+
+Thu Nov 7 11:06:05 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_shuffle_bang): use RARRAY_PTR_USE() without WB
+ because there are not new relations.
+
+Thu Nov 7 10:34:12 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_sample): use rb_ary_dup().
+
+Thu Nov 7 09:39:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig): errinfo should not
+ be propagated to trace blocks so that no argument raise does not
+ throw internal objects. [ruby-dev:47793] [Bug #9088]
+
+Wed Nov 6 21:30:55 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_before_sweep): Change algorithm of malloc_limit to
+ conservative for closing to memory consumption of ruby 2.0.
+
+ * gc.c (GC_MALLOC_LIMIT, GC_MALLOC_LIMIT_GROWTH_FACTOR):
+ Adjust parameters for new algorithm.
+
+Wed Nov 6 21:16:51 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_shift_m): use RARRAY_PTR_USE() without WB because
+ there are not new relations.
+
+Wed Nov 6 21:05:20 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_reverse): use RARRAY_PTR_USE().
+
+Wed Nov 6 19:30:44 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * common.mk (help): add texts about gcbench.
+
+Wed Nov 6 16:32:32 2013 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/open3.rb: tweaked grammar in comments
+
+Wed Nov 6 11:46:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_sample): use RARRAY_AREF() and RARRAY_PTR_USE()
+ instead of RARRAY_PTR().
+
+Wed Nov 6 10:37:07 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_and): defer hash creation and some refactoring.
+
+Wed Nov 6 09:14:31 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_vm1_gc_short_lived.rb: added.
+ These GC benchmarks do not reflect practical applications.
+ They are only for tuning.
+
+ * benchmark/bm_vm1_gc_short_with_complex_long.rb: added.
+
+ * benchmark/bm_vm1_gc_short_with_long.rb: added.
+
+ * benchmark/bm_vm1_gc_short_with_symbol.rb: added.
+
+ * benchmark/bm_vm1_gc_wb_ary.rb: added.
+
+ * benchmark/bm_vm1_gc_wb_obj.rb: added.
+
+ * benchmark/bm_vm_thread_queue.rb: added.
+ This benchmark is added to know how fast C version of thread.so.
+
+Wed Nov 6 09:13:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: define RGENGC_ESTIMATE_OLDSPACE == 0 if USE_RGENGC is 0.
+
+Wed Nov 6 07:13:18 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (Init_GC): add GC::OPTS to show options.
+
+Wed Nov 6 07:12:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: add some options to make quiet.
+
+Wed Nov 6 04:14:25 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: process merge keys before
+ reviving objects. Fixes GH psych #168
+ * test/psych/test_merge_keys.rb: test for change
+ https://github.com/tenderlove/psych/issues/168
+
+Tue Nov 5 21:21:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_thread.rb (test_thread_join_in_trap):
+ Run the test in a different process.
+
+Tue Nov 5 20:14:32 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (is_live_object): A hidden object may be a live object.
+ [ruby-dev:47788] [Bug #9072]
+
+Tue Nov 5 13:37:19 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add support to estimate increase of oldspace memory usage.
+ This is another approach to solve an issue discussed at r43530.
+ This feature is disabled as default.
+
+ This feature measures an increment of memory consumption by oldgen
+ objects. It measures memory consumption for each objects when
+ the object is promoted. However, measurement of memory consumption
+ is not accurate now. So that this measurement is `estimation'.
+
+ To implement this feature, move memsize_of() function from
+ ext/objspace/objspace.c and expose rb_obj_memsize_of().
+
+ Some memsize() functions for T_DATA (T_TYPEDDATA) have problem to
+ measure memory size, so that we ignores T_DATA objects now.
+ For example, some functions skip NULL check for pointer.
+
+ The macro RGENGC_ESTIMATE_OLDSPACE enables/disables this feature,
+ and turned off as default.
+
+ We need to compare 3gen GC and this feature carefully.
+ (it is possible to enable both feature)
+ We need a help to compare them.
+
+ * internal.h: expose rb_obj_memsize_of().
+
+ * ext/objspace/objspace.c: use rb_obj_memsize_of() function.
+
+ * cont.c (fiber_memsize): fix to check NULL.
+
+ * variable.c (autoload_memsize): ditto.
+
+ * vm.c (vm_memsize): ditto.
+
+Tue Nov 5 04:03:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (GC_MALLOC_LIMIT_MAX): fix default value 512MB -> 384MB.
+ 512MB is huge.
+
+Tue Nov 5 03:31:23 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add 3gen GC patch, but disabled as default.
+
+ RGenGC is designed as 2 generational GC, young and old generation.
+ Young objects will be promoted to old objects after one GC.
+ Old objects are not collect until major (full) GC.
+
+ The issue of this approach is some objects can promoted as old
+ objects accidentally and not freed until major GC.
+ Major GC is not frequently so short-lived but accidentally becoming
+ old objects are not freed.
+
+ For example, the program "loop{Array.new(1_000_000)}" consumes huge
+ memories because short lived objects (an array which has 1M
+ elements) are promoted while GC and they are not freed before major
+ GC.
+
+ To solve this problem, generational GC with more generations
+ technique is known. This patch implements three generations gen GC.
+
+ At first, newly created objects are "Infant" objects.
+ After surviving one GC, "Infant" objects are promoted to "Young"
+ objects.
+ "Young" objects are promoted to "Old" objects after surviving
+ next GC.
+ "Infant" and "Young" objects are collected if it is not marked
+ while minor GC. So that this technique solves this problem.
+
+ Representation of generations:
+ * Infant: !FL_PROMOTED and !oldgen_bitmap [00]
+ * Young : FL_PROMOTED and !oldgen_bitmap [10]
+ * Old : FL_PROMOTED and oldgen_bitmap [11]
+
+ The macro "RGENGC_THREEGEN" enables/disables this feature, and
+ turned off as default because there are several problems.
+ (1) Failed sometimes (Heisenbugs).
+ (2) Performance down.
+ Especially on write barriers. We need to detect Young or Old
+ object by oldgen_bitmap. It is slower than checking flags.
+
+ To evaluate this feature on more applications, I commit this patch.
+ Reports are very welcome.
+
+ This patch includes some refactoring (renaming names, etc).
+
+ * include/ruby/ruby.h: catch up 3gen GC.
+
+ * .gdbinit: fix to show a prompt "[PROMOTED]" for promoted objects.
+
+Tue Nov 5 00:05:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * node.h: catch up comments for last commit.
+
+Tue Nov 5 00:02:00 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: rename FL_OLDGEN to FL_PROMOTED.
+ This flag represents that "this object is promoted at least once."
+
+ * gc.c, debug.c, object.c: catch up this change.
+
+Mon Nov 4 22:20:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/xmlrpc: Don't use fixed ports: 8070 and 8071.
+
+Mon Nov 4 15:25:52 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/xmlrpc/webrick_testing.rb (start_server): Initialize the server
+ at main thread to fail early.
+
+Mon Nov 4 10:08:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_intern.h (TH_EXEC_TAG, TH_JUMP_TAG): get rid of undefined
+ behavior of setjmp() in rhs of assignment expression.
+ [ISO/IEC 9899:1999] 7.13.1.1
+
+Sun Nov 3 23:06:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * sample/test.rb: Make temporary file names unique.
+
+Sun Nov 3 20:41:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/xmlrpc: Wrap definitions by TestXMLRPC module.
+
+Sun Nov 3 20:23:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/xmlrpc/webrick_testing.rb (stop_server): Don't try to shutdown
+ the server if the server is not started.
+
+Sun Nov 3 09:35:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_feature_p): deal with default loadable suffixes.
+
+ * load.c (load_lock): initialize statically linked extensions.
+
+ * load.c (search_required, rb_require_safe): deal with statically
+ linked extensions.
+
+ * load.c (ruby_init_ext): defer initialization of statically linked
+ extensions until required actually. [Bug #8883]
+
+Sat Nov 2 15:14:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log):
+ open file can't be removed or renamed on Windows. [ruby-dev:47790]
+ [Bug #9046]
+
+ * test/logger/test_logger.rb (TestLogDevice#run_children): don't use
+ fork.
+
+Sat Nov 2 07:08:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/logger.rb: Inter-process locking for log rotation
+ Current implementation fails log rotation on multi process env.
+ by sonots <sonots@gmail.com>
+ https://github.com/ruby/ruby/pull/428 fix GH-428 [Bug #9046]
+
+Fri Nov 1 23:24:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (wmap_mark_map): mark live objects only, but delete zombies.
+ [ruby-dev:47787] [Bug #9069]
+
+Fri Nov 1 22:45:54 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (struct heap_page, gc_page_sweep, gc_sweep): Refactoring for
+ performance. Add before_sweep condition to heap_page structure.
+
+ * gc.c (rb_gc_force_recycle): Use before_sweep member.
+
+ * gc.c (heap_is_before_sweep, is_before_sweep): Remove. They have not
+ already been used.
+
+Fri Nov 1 22:20:28 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (make_deferred): Refactoring. Collect codes which should be
+ atomic.
+
+ * gc.c (make_io_deferred, obj_free, rb_objspace_call_finalizer,
+ gc_page_sweep): Correspond to the above.
+
+Fri Nov 1 21:40:35 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (typedef struct rb_objspace): Refactoring. Move some members
+ into profile member.
+
+ * gc.c (newobj_of): Correspond to the above.
+
+ * gc.c (finalize_list): Ditto.
+
+ * gc.c (objspace_live_num): Ditto.
+
+ * gc.c (gc_page_sweep): Ditto.
+
+ * gc.c (rb_gc_force_recycle): Ditto.
+
+ * gc.c (garbage_collect_body): Ditto.
+
+ * gc.c (rb_gc_count): Ditto.
+
+ * gc.c (gc_stat): Ditto.
+
+ * gc.c (gc_prof_set_heap_info): Ditto.
+
+ * gc.c (gc_profile_dump_on): Ditto.
+
+Fri Nov 1 20:53:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_scrub): fix typo, should yield invalid byte
+ sequence to be scrubbed. reported by znz at IRC.
+
+Fri Nov 1 17:25:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (is_live_object): finalizer may not run because of lazy-sweep.
+ [ruby-dev:47786] [Bug #9069]
+
+Fri Nov 1 16:55:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_scrub): export with fixed length arguments, and
+ allow nil as replacement string instead of omitting.
+
+Fri Nov 1 06:20:44 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_struct): reduce rb_mutex_t size by 8 bytes
+ on 64bit platform. Patch by Eric Wong. [Feature #9068][ruby-core:58114]
+
+Fri Nov 1 01:08:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: print HWM (high water mark) if possible.
+
+Thu Oct 31 21:48:31 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/streamparser.rb: Add dependency file require.
+ [Bug #9062] [ruby-dev:47779]
+ Reported by Ippei Obayashi. Thanks!!!
+
+Thu Oct 31 14:09:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_method.c (rb_method_entry_make): fix to pass an ISeq value.
+ OBJ_WRITTEN() accepts only VALUE.
+
+Wed Oct 30 19:07:57 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el (ruby-brace-to-do-end)
+ (ruby-do-end-to-brace, ruby-toggle-block): Remove functions that
+ are already in the latest released version of Emacs (24.3).
+ [Bug #7565]
+
+Wed Oct 30 12:44:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (config.status): add missing variables,
+ PLATFORM_DIR and THREAD_MODEL.
+
+Wed Oct 30 12:20:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (v2w): Normalize a rational value to an integer if possible.
+ [ruby-core:58070] [Bug #9059] reported by Isaac Schwabacher.
+
+Wed Oct 30 12:08:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_uniq_bang): use rb_ary_modify_check() instead of
+ rb_ary_modify() because the array will be unshared soon.
+
+Wed Oct 30 03:25:10 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: make less garbage when
+ testing if a string is binary.
+
+Wed Oct 30 03:08:24 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: string subclasses should
+ not be considered to be binary. Fixes Psych / GH 166
+ https://github.com/tenderlove/psych/issues/166
+
+ * test/psych/test_string.rb: test for fix
+
+Tue Oct 29 23:01:18 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_zip): some refactoring.
+
+Tue Oct 29 22:11:37 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_uniq_bang): use st_foreach() instead of for loop.
+
+Tue Oct 29 20:01:58 2013 Koichi Sasada <ko1@atdot.net>
+
+ * add RUBY_TYPED_FREE_IMMEDIATELY to data types which only use
+ safe functions during garbage collection such as xfree().
+
+ On default, T_DATA objects are freed at same points as finalizers.
+ This approach protects issues such as reported by [ruby-dev:35578].
+ However, freeing T_DATA objects immediately helps heap usage.
+
+ Most of T_DATA (in other words, most of dfree functions) are safe.
+ However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default
+ for safety.
+
+ * cont.c: ditto.
+
+ * dir.c: ditto.
+
+ * encoding.c: ditto.
+
+ * enumerator.c: ditto.
+
+ * error.c: ditto.
+
+ * file.c: ditto.
+
+ * gc.c: ditto.
+
+ * io.c: ditto.
+
+ * iseq.c: ditto.
+
+ * marshal.c: ditto.
+
+ * parse.y: ditto.
+
+ * proc.c: ditto.
+
+ * process.c: ditto.
+
+ * random.c: ditto.
+
+ * thread.c: ditto.
+
+ * time.c: ditto.
+
+ * transcode.c: ditto.
+
+ * variable.c: ditto.
+
+ * vm.c: ditto.
+
+ * vm_backtrace.c: ditto.
+
+ * vm_trace.c: ditto.
+
+ * ext/bigdecimal/bigdecimal.c: ditto.
+
+ * ext/objspace/objspace.c: ditto.
+
+ * ext/stringio/stringio.c: ditto.
+
+ * ext/strscan/strscan.c: ditto.
+
+Tue Oct 29 19:48:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: fix typo (FL_WB_PROTECT -> FL_WB_PROTECTED).
+
+Tue Oct 29 18:45:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (tp_free): removed because empty free function.
+ Use RUBY_TYPED_NEVER_FREE instead.
+
+Tue Oct 29 18:37:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: introduce new flags for T_TYPEDDATA.
+ * RUBY_TYPED_FREE_IMMEDIATELY: free the data given by DATA_PTR()
+ with dfree function immediately. Otherwise (default), the data
+ freed at finalization point.
+ * RUBY_TYPED_WB_PROTECTED: make this object with FL_WB_PROTECT
+ (not shady).
+
+ * gc.c (obj_free): support RUBY_TYPED_FREE_IMMEDIATELY.
+
+Tue Oct 29 16:49:03 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (vm_malloc_increase): decrease it more carefully.
+
+Tue Oct 29 16:24:52 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_page_resurrect): return a page in tomb heap even if
+ freelist is NULL.
+
+Tue Oct 29 15:46:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby_atomic.h (ATOMIC_SIZE_CAS): new macro, compare and swap size_t.
+
+Tue Oct 29 12:08:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/readline/readline.c (readline_getc): Consider
+ NULL as input.
+
+Tue Oct 29 11:10:08 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (gc_profile_total_time): fix off-by-one error in
+ GC::Profiler.total_time.
+ * test/ruby/test_gc.rb (class TestGc): test for above.
+
+Tue Oct 29 09:53:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: split
+ ruby_vm_global_state_version into two separate counters - one for the
+ global method state and one for the global constant state. This means
+ changes to constants do not affect method caches, and changes to
+ methods do not affect constant caches. In particular, this means
+ inclusions of modules containing constants no longer globally
+ invalidate the method cache.
+
+ * class.c, eval.c, include/ruby/intern.h, insns.def, vm.c, vm_method.c:
+ rename rb_clear_cache_by_class to rb_clear_method_cache_by_class
+
+ * class.c, include/ruby/intern.h, variable.c, vm_method.c: add
+ rb_clear_constant_cache
+
+ * compile.c, vm_core.h, vm_insnhelper.c: rename vmstat field in
+ rb_call_info_struct to method_state
+
+ * vm_method.c: rename vmstat field in struct cache_entry to method_state
+
+Mon Oct 28 23:26:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/readline/test_readline.rb (teardown): Clear Readline.input and
+ Readline.output.
+
+Mon Oct 28 21:35:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/file/depend, ext/-test-/postponed_job/depend,
+ ext/-test-/tracepoint/depend: New files for dependencies.
+
+Mon Oct 28 15:32:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/depend (ossl.o): work around of dependency of
+ thread_native.h, which depends on headers by THREAD_MODEL.
+ [ruby-dev:47777]
+
+ * ext/openssl/extconf.rb: need THREAD_MODEL.
+
+Mon Oct 28 14:57:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (ruby_init_ext): share feature names between frame name and
+ provided features.
+
+Mon Oct 28 14:41:27 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el: Import ruby-electric.el 2.1 from
+ https://github.com/knu/ruby-electric.el.
+
+ * Hitting the newline-and-indent key within a comment fires
+ comment-indent-new-line.
+
+ * Introduce a new feature
+ `ruby-electric-autoindent-on-closing-char`.
+
+ * Fix fallback behavior of ruby-electric-space/return that
+ caused error with auto-complete.
+
+Mon Oct 28 13:17:17 2013 Or Cohen <orc@fewbytes.com>
+
+ * error.c (name_err_to_s): remove no longer needed overriding, since
+ r30455 which made exc_to_s almost same. Fixes [GH-413].
+
+Mon Oct 28 12:42:11 2013 Tanaka Akira <akr@fsij.org>
+
+ * common.mk, ext/objspace/depend, ext/coverage/depend,
+ ext/-test-/debug/depend, ext/date/depend: Update dependencies.
+
+Mon Oct 28 09:29:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * vm.c: vm_clear_all_cache is not necessary now we use a 64 bit counter
+ for global state version.
+
+ * vm_insnhelper.h: ruby_vm_global_state_version overflow is unnecessary
+
+Mon Oct 28 07:47:32 2013 Aman Gupta <ruby@tmm1.net>
+
+ * vm_backtrace.c (rb_profile_frame_classpath): do not use rb_inspect
+ directly, since it might have a custom implementation or show ivars.
+
+Mon Oct 28 04:10:41 2013 Aman Gupta <ruby@tmm1.net>
+
+ * vm_backtrace.c (rb_profile_frame_classpath): handle singleton
+ methods defined directly on an object.
+ * test/-ext-/debug/test_profile_frames.rb: test for above.
+
+Mon Oct 28 00:52:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (new_struct): fix warning message, class name and encoding.
+
+Sun Oct 27 20:53:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/readline/readline.c: Include ruby/thread.h for
+ rb_thread_call_without_gvl2.
+ (readline_rl_instream, readline_rl_outstream): Record FILE
+ structures allocated by this extension.
+ (getc_body): New function extracted from readline_getc.
+ (getc_func): New function.
+ (readline_getc): Use rb_thread_call_without_gvl2 to invoke getc_func.
+ [ruby-dev:47033] [Bug #8749]
+ (clear_rl_instream, clear_rl_outstream): Close FILE structure
+ allocated by this extension reliably. [ruby-core:57951] [Bug #9040]
+ (readline_readline): Use clear_rl_instream and clear_rl_outstream.
+ (readline_s_set_input): Set readline_rl_instream.
+ (readline_s_set_output): Set readline_rl_outstream.
+ (Init_readline): Don't call readline_s_set_input because
+ readline_getc doesn't block other threads for any FILE structure now.
+
+ [ruby-dev:47033] [Bug #8749] reported by Nobuhiro IMAI.
+ [ruby-core:57951] [Bug #9040] reported by Eamonn Webster.
+
+Sat Oct 26 19:31:28 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * gc.c: catch up recent changes to compile on GC_DEBUG,
+ RGENGC_CHECK_MODE.
+
+Sat Oct 26 19:08:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * range.c (range_initialize_copy): disallow to modify after
+ initialized.
+
+Sat Oct 26 17:48:54 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb (meta_add_field): : Re-implemented.
+ [ruby-core:58017] [Bug #9051] patch by Eamonn Webster.
+
+Sat Oct 26 14:35:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_dump_on): use "Page" terminology.
+
+Sat Oct 26 13:25:45 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_sweep, gc_heap_lazy_sweep): fix measurement code.
+ We only need one sweep time measurement without lazy sweep.
+
+Sat Oct 26 11:59:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * addr2line.c: Include ELF header after system headers (especially
+ sys/types.h) to avoid compilation failure,
+ "usr/include/sh3/elf_machdep.h:4:2: error: #error Define _BYTE_ORDER!",
+ on NetBSD/sh3 (dreamcast, hpcsh, landisk, mmeye).
+
+Sat Oct 26 11:35:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: tuning parameters.
+
+ * gc.c (GC_MALLOC_LIMIT): change default value to 16MB.
+
+ * gc.c (GC_MALLOC_LIMIT_GROWTH_FACTOR): change default value to 2.0.
+
+ * gc.c (gc_before_sweep): change decrease ratio of `malloc_limit'
+ from 1/4 to 1/10.
+
+Sat Oct 26 11:30:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (vm_malloc_increase): do gc_rest_sweep() before GC.
+ gc_rest_sweep() can reduce malloc_increase, so try it before GC.
+ Otherwise, malloc_increase can be less than malloc_limit at
+ gc_before_sweep(). This means that re-calculation of malloc_limit
+ may be wrong value.
+
+Sat Oct 26 06:35:41 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_before_heap_sweep): Restructure code to mean clearly.
+ heap->freelist is connected to end of list.
+
+Sat Oct 26 04:01:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_before_heap_sweep): fix freelist management.
+ After rb_gc_force_recycle() for a object belonging to heap->freelist,
+ `heap->using_page->freelist' is not null.
+
+Thu Oct 24 21:57:24 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * parse.y: Remove +(binary) and -(binary) special cases
+ [Feature #9048]
+
+Thu Oct 24 12:45:53 2013 Zachary Scott <e@zzak.io>
+
+ * object.c: [DOC] Document first argument also takes string for:
+
+ rb_mod_const_get, rb_mod_const_set, rb_mod_const_defined
+
+ Also added note about NameError exception for invalid constant name
+
+Thu Oct 24 12:23:58 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_terminate_all): add a comment why we need
+ state check and call terminate_i again.
+
+Thu Oct 24 12:15:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_terminate_all): add a comment why infinite
+ sleep is safe.
+
+Thu Oct 24 07:41:42 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c: add new initial_growth_max tuning parameter.
+ [ruby-core:57928] [Bug #9035]
+ * gc.c (heap_set_increment): when initial_growth_max is set,
+ do not grow number of slots by more than growth_max at a time.
+ * gc.c (rb_gc_set_params): load optional new tuning value from
+ RUBY_HEAP_SLOTS_GROWTH_MAX environment variable.
+ * test/ruby/test_gc.rb (class TestGc): test for above.
+
+Thu Oct 24 01:34:12 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/win32.h (rb_infinity_float): suppress overflow in
+ constant arithmetic warnings. [ruby-core:57981] [Bug #9044]
+
+Thu Oct 24 00:11:24 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/ostruct.rb: raise NoMethodError with a #name and #args.
+ Raise RuntimeError when modifying frozen instances
+ instead of TypeError.
+ (OpenStruct#each_pair): Return an enumerator with size
+ (OpenStruct#delete): Use the converted argument.
+ Patches by Kenichi Kamiya. [Fixes GH-383]
+
+ * test/ostruct/test_ostruct.rb: Added tests for above.
+
+Thu Oct 24 00:10:22 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * array.c: Add Array#to_h [Feature #7292]
+
+ * enum.c: Add Enumerable#to_h
+
+Wed Oct 23 23:48:28 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c: Rename free_min to min_free_slots and free_min_page to
+ max_free_slots. The algorithm for heap growth is:
+ if (swept_slots < min_free_slots) pages++
+ if (swept_slots > max_free_slots) pages--
+
+Wed Oct 23 22:51:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (config.h): VC 2013 supports C99 mathematics
+ functions. [ruby-core:57981] [Bug #9044]
+
+Wed Oct 23 19:13:18 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: move increment from heap to heap_pages.
+ Share `increment' information with heaps.
+
+ * gc.c: change ratio of heap_pages_free_min_page
+ to 0.80.
+ This change means slow down page freeing speed.
+
+Wed Oct 23 17:52:03 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_pages_free_unused_pages): cast to (int) for size_t
+ variable `i'.
+
+Wed Oct 23 17:39:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: introduce tomb heap.
+ Tomb heap is where zombie objects and ghost (freed slot) lived in.
+ Separate from other heaps (now there is only eden heap) at sweeping
+ helps freeing pages more efficiently.
+ Before this patch, even if there is an empty page at former phase
+ of sweeping, we can't free it.
+
+ Algorithm:
+ (1) Sweeping all pages in a heap and move empty pages from the
+ heap to tomb_heap.
+ (2) Check all existing pages and free a page
+ if all slots of this page are empty and
+ there is enough empty slots (checking by swept_num)
+
+ To introduce this patch, there are several tuning of GC parameters.
+
+Wed Oct 23 14:20:56 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_prof_sweep_timer_stop): catch up recent changes
+ to compile on GC_PROFILE_MORE_DETAIL=1.
+
+Wed Oct 23 11:43:27 2013 Zachary Scott <e@zzak.io>
+
+ * file.c: [DOC] fix rdoc format of File#expand_path from r43386
+
+Tue Oct 22 21:58:28 2013 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * vm_core.h (enum): avoid syntax error.
+
+ * method.h: ditto.
+
+ * internal.h: ditto.
+
+Tue Oct 22 19:53:16 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (Init_heap): move logics from heap_pages_init() and remove
+ heap_pages_init().
+
+Tue Oct 22 19:19:05 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: allow multiple heaps.
+ Now, objects are managed by page. And a set of pages is called heap.
+ This commit supports multiple heaps in the object space.
+
+ * Functions heap_* and rb_heap_t manages heap data structure.
+ * Functions heap_page_* and struct heap_page manage page data
+ structure.
+ * Functions heap_pages_* and struct rb_objspace_t::heap_pages
+ maintains all pages.
+ For example, pages are allocated from the heap_pages.
+
+ See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/GC_design
+ and https://bugs.ruby-lang.org/attachments/4015/data-heap_structure_with_multiple_heaps.png
+ for more details.
+
+ Now, there is only one heap called `eden', which is a space for all
+ new generated objects.
+
+Tue Oct 22 18:26:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/pp.rb (object_address_group): Use Kernel#to_s to obtain the class
+ name and object address.
+ This fix a problem caused by %p in C generates variable length
+ address.
+ Reported by ko1 via IRC.
+
+Tue Oct 22 16:57:48 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * file.c (File#expand_path): [DOC] improve documentation of File#expand_path.
+ Based on patch by Prathamesh Sonpatki. [ruby-core:57734] [Bug #9002]
+
+Tue Oct 22 15:59:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): don't skip current directories if FNM_DOTMATCH
+ is given. [ruby-core:53108] [Bug #8006]
+
+Tue Oct 22 14:53:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: exterminate Zombies.
+ There is a bug that T_ZOMBIE objects are not collected.
+ Because there is a pass to miss finalizer postponed job
+ with multi-threading. This patch solve this issue.
+
+ * vm_trace.c (rb_postponed_job_register_one): set
+ RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) if another same job
+ is registered.
+ There is a possibility to remain a postponed job without
+ interrupt flag.
+
+ * vm_trace.c (rb_postponed_job_register_one): check interrupt
+ carefully.
+
+ * vm_trace.c (rb_postponed_job_register_one): use additional space
+ to avoid buffer full.
+
+ * gc.c (gc_finalize_deferred_register): check failure.
+
+ * thread.c (rb_threadptr_execute_interrupts): check
+ `postponed_job_interrupt' immediately. There is a possibility
+ to miss this flag.
+
+Tue Oct 22 12:11:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: check if the given CFLAGS and LDFLAGS are working, and
+ bail out early if not.
+
+Tue Oct 22 00:06:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_exists_p): warn deprecated name. [Bug #9041]
+
+Mon Oct 21 23:57:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (load_encoding): should preserve outer errinfo, so that
+ expected exception may not be lost. [ruby-core:57949] [Bug #9038]
+
+Sun Oct 20 15:41:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_reopen): create a new, temporary FD via rb_sysopen and
+ call rb_cloexec_dup2 on it to atomically replace the file fptr->fd
+ points to. This leaves no possible window where fptr->fd is invalid
+ to userspace (even for any threads running w/o GVL). based on the
+ patch by Eric Wong <normalperson@yhbt.net> at [ruby-core:57943].
+ [Bug #9036]
+
+Sun Oct 20 15:29:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_syserr_fail_path_in): new function split from
+ rb_sys_fail_path_in to raise SystemCallError without errno.
+
+ * internal.h (rb_syserr_fail_path): like rb_sys_fail_path but without
+ errno.
+
+Sun Oct 20 13:58:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (rb_obj_wb_unprotect, rb_obj_written),
+ (rb_obj_write): suppress unused-parameter warnings.
+
+Sun Oct 20 10:32:48 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update RubyGems to master 0886307. This commit
+ improves documentation and should bring ruby above 75% documented on
+ rubyci.
+
+Sun Oct 20 09:30:56 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 3de7e0f. Changes:
+
+ Only attempt to build extensions for newly-installed gems. This
+ prevents compilation attempts at gem activation time for gems that
+ already have extensions built.
+
+ Fix crash in the dependency resolver for dependencies that cannot be
+ resolved.
+
+ * test/rubygems: ditto.
+
+Sun Oct 20 05:24:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_class2name): should return real class name, not
+ singleton class or iclass.
+
+Sun Oct 20 04:18:48 2013 Aman Gupta <ruby@tmm1.net>
+
+ * variable.c (rb_class2name): call rb_tmp_class_path() directly to
+ avoid extra rb_str_dup() from rb_class_name().
+
+Sat Oct 19 19:59:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/file.c (code_page): use simple array instead of st_table.
+
+ * encoding.c (rb_locale_encindex): defer initialization of win32 code
+ page table until encoding db loaded.
+
+Sat Oct 19 08:25:05 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix rb_objspace_t.
+ * make "struct heap" and move most of variables
+ in rb_objspace_t::heap.
+ * rename rb_objspace_t::heap::sorted to
+ rb_objspace_t::heap_sorted_pages
+ and make a macro heap_sorted_pages.
+ * rename rb_objspace_t::heap::range to
+ rb_objspace_t::heap_range and rename macros
+ lomem/himem to heap_lomem/heap_himem.
+
+Sat Oct 19 07:14:40 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 42543b6. Changes:
+
+ Fix `gem update` for gems with multiple platforms.
+
+ * test/rubygems: ditto.
+
+Sat Oct 19 06:55:52 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 0a3814b. Changes:
+
+ Fixed extension directory in Gem::Specification#require_paths.
+
+ Allow installation of gems when $HOME is nonexistent or unwritable.
+
+ Use proper API in InstallCommand.
+
+ Improve support for path option in gem dependency files.
+
+ Remove warnings.
+
+ * test/rubygems: ditto.
+
+Fri Oct 18 15:23:34 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change terminology of heap.
+ Change "slot" to "page". "Slot" is a space of RVALUE.
+ 1. "Heap" consists of a set of "heap_page"s (pages).
+ 2. Each "heap_page" has "heap_page_body".
+ 3. "heap_page_body" has RVALUE (a.k.a. "slot") spaces.
+ 4. "sorted" is a sorted array of "heap_page"s, sorted
+ by address of heap_page_body (for "is_pointer_to_heap").
+
+ See https://bugs.ruby-lang.org/attachments/4008/data-heap_structure.png.
+
+Fri Oct 18 09:40:43 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master cee6788. Changes:
+
+ Fix test failure on vc10-x64 Server on rubyci.org due to attempting
+ to File.chmod where it is not supported.
+
+ Continuing work on improved gem dependencies file (Gemfile) support.
+
+ * test: ditto.
+
+Fri Oct 18 06:02:49 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master f738c67. Changes:
+
+ Fixed test bug for ruby with ENABLE_SHARED = no
+
+ * test/rubygems: ditto.
+
+Fri Oct 18 00:57:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/tsort.rb (TSort.tsort): Extracted from TSort#tsort.
+ (TSort.tsort_each): Extracted from TSort#tsort_each.
+ (TSort.strongly_connected_components): Extracted from
+ TSort#strongly_connected_components.
+ (TSort.each_strongly_connected_component): Extracted from
+ TSort#each_strongly_connected_component.
+
+Thu Oct 17 18:50:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (CALC_EXACT_MALLOC_SIZE_CHECK_OLD_SIZE): introduced.
+ This macro enable checker compare with allocated memory and
+ declared old_size of sized_xfree and sized_xrealloc.
+
+Thu Oct 17 18:45:41 2013 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (STR_HEAP_SIZE): includes TERM_LEN(str).
+
+ * string.c (rb_str_memsize): use STR_HEAP_SIZE().
+
+Thu Oct 17 17:43:00 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): set ci->me to 0 when the
+ original method of a refined method is undef to avoid SEGV.
+
+ * vm_method.c (rb_method_entry_without_refinements): return 0 when
+ the original method of a refined method is undef to avoid SEGV.
+
+ * test/ruby/test_refinement.rb: related test.
+
+Thu Oct 17 17:38:36 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, internal.h: rename ruby_xsizefree/realloc to
+ rb_sized_free/realloc.
+
+ * array.c: catch up these changes.
+
+ * string.c: ditto.
+
+Thu Oct 17 17:32:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c, string.c: use ruby_xsizedfree() and ruby_xsizedrealloc().
+
+ * internal.h (SIZED_REALLOC_N): define a macro as REALLOC_N().
+
+Thu Oct 17 17:11:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (console_emulator_p): check by comparison between
+ module handle of WriteConsoleW and kernel32.dll.
+
+ * configure.in, win32/Makefile.sub, win32/setup.mak: no longer need
+ psapi.lib.
+
+Thu Oct 17 16:53:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, internal.h: add new internal memory management functions.
+ * void *ruby_xsizedrealloc(void *ptr, size_t new_size, size_t old_size)
+ * void ruby_xsizedfree(void *x, size_t size)
+ These functions accept additional size parameter to calculate more
+ accurate malloc_increase parameter which control GC timing.
+ [Feature #8985]
+
+Thu Oct 17 14:21:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/file.c (rb_file_expand_path_internal): fix memory leaks at
+ a non-absolute home exception.
+
+Thu Oct 17 14:06:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/object_tracing.c (newobj_i): fix memory leak.
+ There is possibility to remain info due to missing FREEOBJ event.
+ FREEOBJ events are skipped while suppress_tracing state, for example,
+ during trace events are invoking.
+
+Thu Oct 17 12:30:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/tsort.rb (TSort.each_strongly_connected_component_from):
+ Extracted from TSort#each_strongly_connected_component_from.
+
+Thu Oct 17 11:07:06 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 941c21a. Changes:
+
+ Restored method bundler wants to remove for compatibility.
+
+ Improvements to Gemfile compatibility.
+
+ * test/rubygems: ditto.
+
+Thu Oct 17 08:08:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/object_tracing.c (newobj_i): add workaround.
+ some bugs hits this check.
+
+ * ext/objspace/object_tracing.c (object_allocations_reporter_i): cast as pointer.
+
+Thu Oct 17 07:36:53 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 2abce58. Changes:
+
+ Fixed documentation generation when sdoc and json are installed as
+ gems.
+
+ Added some missing documentation.
+
+Thu Oct 17 07:10:26 2013 Zachary Scott <e@zzak.io>
+
+ * ext/curses/curses.c: [DOC] Cleaned up formatting consistency of rdoc
+ comments for Curses, including period spacing and column width.
+
+ This patch also fixed some typos. Thanks to @postmodern for the patch!
+ [Fixes GH-420] https://github.com/ruby/ruby/pull/420
+
+Thu Oct 17 06:58:42 2013 Zachary Scott <e@zzak.io>
+
+ * ext/date/date_core.c: [DOC] plural grammar fixed by @scott113341
+ Contributed via documenting-ruby.org: documenting-ruby/ruby#16
+ https://github.com/documenting-ruby/ruby/pull/16
+
+Thu Oct 17 05:52:31 2013 Zachary Scott <e@zzak.io>
+
+ * ext/io/nonblock/nonblock.c: [DOC] Document io/nonblock by reprah
+ [Fixes GH-418] https://github.com/ruby/ruby/pull/418 based on the
+ original discussion from documenting-ruby/ruby#18
+
+Thu Oct 17 05:40:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_each_objects): do not skip empty RVALUEs.
+
+Thu Oct 17 05:31:31 2013 Koichi Sasada <ko1@atdot.net>
+
+ * error.c (rb_bug_reporter_add): return simply 0 if failed.
+ Please check return value.
+
+Thu Oct 17 05:17:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/object_tracing.c: add new method
+ ObjectSpace.trace_object_allocations_debug_start for GC debugging.
+ If you encounter the BUG "... is T_NONE" (and so on) on your
+ application, please try this method at the beginning of your app.
+
+Wed Oct 16 22:35:27 2013 Zachary Scott <e@zzak.io>
+
+ * ext/io/nonblock/nonblock.c: use rb_cIO instead of VALUE
+
+Wed Oct 16 17:45:13 2013 Koichi Sasada <ko1@atdot.net>
+
+ * bootstraptest/runner.rb: check nil before calling `signal?'
+ for a process status.
+
+Wed Oct 16 17:37:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * error.c, internal.h (rb_bug_reporter_add): add a new C-API.
+ rb_bug_reporter_add() allows to register a function which
+ is called at rb_bug() called.
+
+ * ext/-test-/bug_reporter/bug_reporter.c: add a test for this C-API.
+
+ * ext/-test-/bug_reporter/extconf.rb: ditto.
+
+ * test/-ext-/bug_reporter/test_bug_reporter.rb: ditto.
+
+Wed Oct 16 15:14:21 2013 Koichi Sasada <ko1@atdot.net>
+
+ * NEWS: add a line into NEWS for last commit.
+
+Wed Oct 16 15:09:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c: add a new method `reachable_objects_from_root'.
+ ObjectSpace.reachable_objects_from_root returns all objects referred
+ from root (called "root objects").
+ This feature is for deep object analysis.
+
+ * test/objspace/test_objspace.rb: add a test.
+
+Wed Oct 16 15:00:21 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master b955554. Changes:
+
+ Fixed NameError for Gem::Ext due to re-entering file lookup in
+ RubyGems' overridden require. Bug by Koichi Sasada.
+
+ Fixed possible circular require warning in tests.
+
+ Used existing constant for `gem install -g` dependency file list.
+
+ * test/rubygems: ditto.
+
+Wed Oct 16 09:42:42 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 278d00d. Changes:
+
+ Fixes building extensions without a "clean" make rule
+
+ Adds gem dependency file autodetection to "gem install -g"
+
+ * test/rubygems: Tests for the above.
+
+Wed Oct 16 09:12:23 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master commit 2a74263. This fixes
+ several bugs in RubyGems 2.2.0.preview.1.
+
+ * test/rubygems: ditto.
+
+Wed Oct 16 07:25:02 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (gc_mark_roots): rename roots to be categories
+ instead of function names.
+
+Tue Oct 15 19:18:13 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.h (rb_objspace_reachable_objects_from_root): added.
+ This API provides information which objects are root objects.
+ `category' shows what kind of root objects.
+
+ * gc.c (gc_mark_roots): separate from gc_marks_body().
+
+Tue Oct 15 17:47:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c: Fix a typo. MacOS X doesn't have ENOTSUPP.
+
+Mon Oct 14 12:32:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (process_options): load statically linked extensions before
+ rubygems, because of ext/thread.
+
+ * ruby.c (process_options): use gem_prelude instead of requiring
+ rubygems directly when --enable=gems is given.
+
+ * Makefile.in (DEFAULT_PRELUDES): always use gem_prelude regardless of
+ --disable-rubygems.
+
+Mon Oct 14 11:07:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (have_framework): should append framework options to
+ $LIBS, not $LDFLAGS. The former is propagated to exts.mk when
+ enable-static-linked-ext.
+
+ * lib/mkmf.rb (create_makefile): ranlib on static library, not DLLIB.
+
+Sun Oct 13 23:53:40 2013 Andrew Grimm <andrew.j.grimm@gmail.com>
+
+ * vsnprintf.c: Fix spelling from compliment to complement.
+ Patch by @agrimm.
+
+ * include/ruby/ruby.h: ditto
+
+Sun Oct 13 20:59:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (Init_BareVM): initialize defined_module_hash here,
+ Init_top_self() is too late to register core classes/modules.
+
+ * compile.c (compile_array_): no hash to merge if it is empty.
+
+ * vm.c (m_core_hash_merge_kwd): just check keys if only one argument
+ is given, without merging.
+
+Sat Oct 12 06:35:01 2013-10-11 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake: Update to rake 10.1.0
+ * bin/rake: ditto.
+ * test/rake: ditto.
+
+ * NEWS: Update NEWS to include rake 10.1.0 and links to release notes.
+
+Sat Oct 12 03:26:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * class.c, variable.c, gc.c (rb_class_tbl): removed.
+
+ * vm.c, vm_core.h (rb_vm_add_root_module): added to register as a
+ defined root module or class.
+ This guard helps mark miss from defined classes/modules they are
+ only referred from C's global variables in C-exts.
+ Basically, it is extension's bug.
+ Register to hash object VM has.
+ Marking a hash objects allows generational GC supports.
+
+ * gc.c (RGENGC_PRINT_TICK): disable (revert).
+
+Sat Oct 12 03:24:49 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_method.c (rb_gc_mark_unlinked_live_method_entries):
+ revert last commit to introduce debug prints.
+
+Fri Oct 11 21:05:19 2013 Koichi Sasada <ko1@atdot.net>
+
+ * internal.h, parse.y: use `full_mark' instead of `full_marking'.
+
+Fri Oct 11 20:58:16 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: use terminology `full_mark' instead of `minor_gc'
+ in mark functions.
+
+Fri Oct 11 20:46:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: use __GNUC__ instead of __GCC__.
+
+Fri Oct 11 20:35:59 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, parse.y: support generational Symbol related marking.
+ Each symbols has String objects respectively to represent
+ Symbols.
+ These objects are marked only when:
+ * full marking
+ * new symbols are added
+ This hack reduce symbols (related strings) marking time.
+ For example, on my Linux environment, the following code
+ "20_000_000.times{''}"
+ with 40k symbols (similar symbol number on Rails 3.2.14 app,
+ @jugyo tells me) boosts, from 7.3sec to 4.2sec.
+
+ * internal.h: change prototype of rb_gc_mark_symbols().
+
+Fri Oct 11 19:27:22 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el: Import ruby-electric.el 2.0.1 which fixes
+ a bug and a flaw with auto-end introduced in the revamp.
+
+ * ruby-forward-sexp is inappropriate here because it moves the
+ cursor past the keyword.
+
+ * Fix a reversed looking-back check in
+ ruby-electric--block-beg-keyword-at-point-p.
+
+ * Do not add end again if space or return is hit repeatedly
+ after a block beginning keyword.
+
+Fri Oct 11 18:12:47 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/gc_hook.c: prohibit reentrant.
+
+Fri Oct 11 18:11:34 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_postponed_job_flush): fix bit operation.
+
+Fri Oct 11 17:33:24 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el: Import ruby-electric.el 2.0 from
+ https://github.com/knu/ruby-electric.el which integrates changes
+ from another fork by @qoobaa.
+
+ * Allow ruby-electric-mode to be disabled by introducing a
+ dedicated key map. Electric key bindings are now defined in
+ ruby-electric-mode-map instead of overwriting ruby-mode-map.
+
+ * Add ruby-electric-mode-hook.
+
+ * Use a remap in binding ruby-electric-delete-backward-char.
+
+ * Totally revamp electric keywords and then introduce electric
+ return. Modifier keywords are now properly detected making
+ use of ruby-mode's indentation level calculator, and
+
+ * block-mid keywords (then, else, elsif, when, rescue and
+ ensure) also become electric with automatic reindentation.
+
+ * Add standardized comments for ELPA integration.
+
+ * Fix interaction with smartparens-mode by disabling its end
+ keyword completion, since ruby-electric has become more clever
+ at it.
+
+ * The custom variable `ruby-electric-keywords` is changed to
+ `ruby-electric-keywords-alist`, allowing user to fine-grained
+ configuration.
+
+Fri Oct 11 16:53:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_postponed_job_flush): simplify.
+
+Fri Oct 11 03:36:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_threadptr_execute_interrupts): flush postponed job only
+ once at last.
+
+ * vm_trace.c (rb_postponed_job_flush): defer calling postponed jobs
+ registered while flushing to get rid of infinite reentrance of
+ ObjectSpace.after_gc_start_hook. [ruby-dev:47400] [Bug #8492]
+
+Thu Oct 10 23:04:00 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_or): remove unused variables.
+
+Thu Oct 10 23:01:16 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_or): use rb_hash_keys().
+
+Thu Oct 10 21:36:16 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_compact_bang): use ary_resize_smaller().
+
+Thu Oct 10 17:25:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (vm_exec): support :b_return event for "lambda{return}.call".
+ [Bug #8622]
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
+Thu Oct 10 13:52:37 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (postponed_job): use preallocated buffer.
+ Pre-allocate MAX_POSTPONED_JOB (1024) sized buffer
+ and use it.
+ If rb_postponed_job_register() cause overflow, simply it
+ fails and returns 0.
+ And maybe rb_postponed_job_register() is signal safe.
+
+ * vm_core.h: change data structure.
+
+Thu Oct 10 11:11:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (Init_VM): hide also the singleton class of frozen-core, not
+ only frozen-core itself.
+
+Thu Oct 10 06:02:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_rand.rb: fix r43224. local variable `e' is
+ no longer available.
+
+Thu Oct 10 00:02:35 2013 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * numeric.c (fix_aref): avoid a possible undefined behavior.
+ 1L << 63 on 64-bit platform is undefined, at least, according to
+ ISO/IEC 9899 (C99) 6.5.7.
+
+Wed Oct 9 23:57:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (id_for_attr): avoid inadvertent symbol creation.
+
+Wed Oct 9 18:03:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_attr): preserve encoding of the attribute ID in
+ error message.
+
+Wed Oct 9 17:40:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_fstring): because of lazy sweep, str may be unmarked
+ already and swept at next time, so mark it for the time being.
+ [ruby-core:57756]
+
+Wed Oct 9 13:53:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compar.c (cmp_eq): fail if recursion. [ruby-core:57736] [Bug #9003]
+
+ * thread.c (rb_exec_recursive_paired_outer): new function which is
+ combination of paired and outer variants.
+
+Wed Oct 9 09:18:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/debug.h,
+ vm_backtrace.c (rb_profile_frame_full_label): add new C API
+ rb_profile_frame_full_label() which returns label with
+ qualified method name.
+ Note that in future version of Ruby label() may return
+ same return value of full_label().
+
+ * ext/-test-/debug/profile_frames.c,
+ test/-ext-/debug/test_profile_frames.rb: fix a test for this change.
+
+
+Wed Oct 9 00:55:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (load_lock): display backtrace to $stderr at circular
+ require.
+
+ * vm_backtrace.c (rb_backtrace_print_to): new function to print
+ backtrace to the given output.
+
+Tue Oct 8 21:03:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c, include/ruby/debug.h: add new APIs
+ * VALUE rb_profile_frame_method_name(VALUE frame)
+ * VALUE rb_profile_frame_qualified_method_name(VALUE frame)
+
+ * iseq.c (rb_iseq_klass), internal.h: add new internal function
+ rb_iseq_method_name().
+
+ * ext/-test-/debug/profile_frames.c (profile_frames),
+ test/-ext-/debug/test_profile_frames.rb: add a test.
+
+Tue Oct 8 16:11:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_uniq): use rb_hash_values(), as well as the case no
+ block is given.
+
+ * internal.h: define rb_hash_values() as internal API.
+
+Tue Oct 8 13:53:21 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_uniq): use rb_hash_keys().
+
+ * internal.h: define rb_hash_keys() as internal API.
+
+ * hash.c (rb_hash_keys): ditto.
+
+Tue Oct 8 10:56:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c: disable FIBER_USE_NATIVE on GNU/Hurd because it doesn't
+ support a combination getcontext() and threads. Patch by
+ Gabriele Giacone (1o5g4r8o@gmail.com). [Bug #8990][ruby-core:57685]
+
+Tue Oct 8 05:58:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.strptime): Time.strptime('0', '%s') returns local
+ time Time object as Ruby 2.0 and before.
+
+Tue Oct 8 05:40:37 2013 Eric Hodel <drbrain@segment7.net>
+
+ * .travis.yml: Rebuild Travis CI's "ruby-head" version on successful
+ build. Patch by Konstantin Haase. [Fixes GH-417]
+ https://github.com/ruby/ruby/pull/417
+
+Tue Oct 8 04:28:25 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-mode.el: Use preceding-char/following-char
+ (returning 0 at BOF/EOF) instead of char-before/char-after
+ (returning nil at BOF/EOF) to avoid error from char-syntax when
+ at BOF/EOF.
+
+Tue Oct 8 04:12:45 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el (ruby-mode-set-encoding): Add a missing
+ else clause to unbreak with `cp932`, etc.
+
+ * misc/ruby-mode.el (ruby-mode-set-encoding): Ditto.
+
+Tue Oct 8 03:57:34 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el (ruby-mode-set-encoding): Use
+ `default-buffer-file-coding-system` if the :prefer-utf-8
+ property is not available.
+
+ * misc/ruby-mode.el (ruby-mode-set-encoding): Ditto.
+
+ * misc/ruby-additional.el (ruby-encoding-map): Override the
+ default value.
+
+Tue Oct 8 03:19:19 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el (ruby-mode-set-encoding): Add support
+ for `prefer-utf-8` which was introduced in Emacs trunk.
+
+ * misc/ruby-additional.el (ruby-encoding-map): Add a mapping from
+ `japanese-cp932` to `cp932` to fix the problem where saving a
+ source file written in Shift_JIS twice would end up having
+ `coding: japanese-cp932` which Ruby could not recognize.
+
+ * misc/ruby-additional.el (ruby-mode-set-encoding): Add support
+ for encodings mapped to nil in `ruby-encoding-map`.
+
+ * misc/ruby-additional.el (ruby-encoding-map): Map `us-ascii` and
+ `utf-8` to nil by default, meaning they need not be explicitly
+ declared in magic comment.
+
+ * misc/ruby-additional.el (ruby-encoding-map): Add type
+ declaration for better customize UI.
+
+ * misc/ruby-mode.el: Ditto for the above.
+
+Tue Oct 8 00:14:53 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el: Add a standard header and footer,
+ including (provide 'ruby-additional).
+
+Mon Oct 7 22:52:45 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-space-can-be-expanded-p):
+ Return nil to avoid "end" insertion when in smartparens-mode
+ that is configured to insert "end" for the same keyword.
+
+ * misc/ruby-electric.el (ruby-electric-keywords): New custom
+ variable to replace `ruby-electric-simple-keywords-re` with.
+
+Mon Oct 7 22:52:16 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el: Use preceding-char/following-char
+ (returning 0 at BOF/EOF) instead of char-before/char-after
+ (returning nil at BOF/EOF) to avoid error from char-syntax when
+ at BOF/EOF.
+
+Mon Oct 7 22:45:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * cont.c (FIBER_USE_NATIVE): split long conditions.
+
+Mon Oct 7 20:29:31 2013 Zachary Scott <e@zzak.io>
+
+ * lib/time.rb: [DOC] typo in Time.rb overview by @srt32 [Fixes GH-416]
+ https://github.com/ruby/ruby/pull/416
+
+Mon Oct 7 20:07:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.strptime): Use :offset.
+ Patch by Felipe Contreras. [ruby-core:57694]
+
+Mon Oct 7 16:47:27 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/-ext-/debug/test_profile_frames.rb: rename class C to
+ something long name because one test depends on absence of
+ class ::C.
+
+Mon Oct 7 16:33:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/-test-/debug/profile_frames.c:
+ test/-ext-/debug/test_profile_frames.rb: add a test for new C-APIs.
+
+Mon Oct 7 16:12:36 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/debug.h: add backtrace collecting APIs for profiler.
+ * int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
+ Collect information of frame information.
+
+ * VALUE rb_profile_frame_path(VALUE frame);
+ * VALUE rb_profile_frame_absolute_path(VALUE frame);
+ * VALUE rb_profile_frame_label(VALUE frame);
+ * VALUE rb_profile_frame_base_label(VALUE frame);
+ * VALUE rb_profile_frame_first_lineno(VALUE frame);
+ * VALUE rb_profile_frame_classpath(VALUE frame);
+ * VALUE rb_profile_frame_singleton_method_p(VALUE frame);
+ Get information about each frame.
+
+ These APIs are designed for profilers, for example, no object allocation,
+ and enough information for profilers.
+ In this version, this API collects only Ruby level frames.
+ This issue will be fixed after Ruby 2.1.
+
+ * vm_backtrace.c: implement above APIs.
+
+ * iseq.c (rb_iseq_klass): return local_iseq's class.
+
+Mon Oct 7 14:26:01 2013 Koichi Sasada <ko1@atdot.net>
+
+ * proc.c: catch up last commit.
+ Type of return value of rb_iseq_first_lineno() is now VALUE.
+
+ * vm_insnhelper.c (argument_error): ditto.
+
+ * vm_method.c (rb_method_entry_make): ditto.
+
+Mon Oct 7 14:07:45 2013 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c, internal.h: change to public (but internal) functions
+ * VALUE rb_iseq_path(VALUE iseqval);
+ * VALUE rb_iseq_absolute_path(VALUE iseqval);
+ * VALUE rb_iseq_label(VALUE iseqval);
+ * VALUE rb_iseq_base_label(VALUE iseqval);
+ * VALUE rb_iseq_first_lineno(VALUE iseqval);
+ And new (temporary) function:
+ * VALUE rb_iseq_klass(VALUE iseqval);
+
+ * iseq.c. vm_core.h (int rb_iseq_first_lineno): remove
+ function `int rb_iseq_first_lineno(const rb_iseq_t *iseq)'.
+ Use `VALUE rb_iseq_first_lineno(VALUE iseqval)' instead.
+
+ * proc.c. vm_insnhelper.c, vm_method.c: catch up this change.
+
+Sun Oct 6 08:37:39 2013 Zachary Scott <e@zzak.io>
+
+ * lib/webrick.rb: [DOC] fix grammar in WEBrick overview [Fixes GH-413]
+ Based on patch by @chastell https://github.com/ruby/ruby/pull/413
+
+Sat Oct 5 11:21:01 2013 Aaron Pfeifer <aaron.pfeifer@gmail.com>
+
+ * thread.c (terminate_atfork_i): fix locking mutexes not unlocked in
+ forks when not tracked in thread. [ruby-core:55102] [Bug #8433]
+
+Fri Oct 4 19:54:09 2013 Zachary Scott <e@zzak.io>
+
+ * ext/dbm/dbm.c: [DOC] Fix wrong constant name in DBM by @edward
+ [Fixes GH-409] https://github.com/ruby/ruby/pull/409
+
+Fri Oct 4 19:49:42 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c: rename heap.free_num as heap.swept_num to clarify meaning and
+ avoid confusion with objspace_free_num().
+
+Fri Oct 4 19:02:01 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c (objspace_free_num): new method for available/free slots on
+ heap. [ruby-core:57633] [Bug #8983]
+ * gc.c (gc_stat): change heap_free_num definition to use new method.
+ * test/ruby/test_gc.rb: test for above.
+
+Fri Oct 4 18:53:42 2013 Aman Gupta <ruby@tmm1.net>
+
+ * gc.c: add rb_objspace.limit to keep accurate count of total heap
+ slots [ruby-core:57633] [Bug #8983]
+
+Fri Oct 4 09:32:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/csv.rb (CSV.foreach): support enumerator. based on a patch by
+ Hanmac (Hans Mackowiak) at [ruby-core:57643]. [ruby-core:57283]
+ [Feature #8929]
+
+Thu Oct 3 18:20:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (console_emulator_p, constat_handle): disable built-in
+ console colorizing when console-emulator-like DLL is injected.
+ [Feature #8201]
+
+Thu Oct 3 18:01:44 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: define gc_profile_record::allocated_size if
+ CALC_EXACT_MALLOC_SIZE is true.
+
+Thu Oct 3 13:42:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (yes-test-sample): use RUNRUBY instead of MINIRUBY to set
+ runtime library path and run the built ruby. [Bug #8971]
+
+Thu Oct 3 00:17:15 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el: Properly quote the body. An unquoted
+ body given to eval-after-load is evaluated immediately!
+
+Wed Oct 2 21:38:30 2013 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * ext/socket/ifaddr.c (rsock_getifaddrs): fix possible memory leak.
+ When a system had no interface, this function used xmalloc for root
+ but did not return any reference to it. This patch fixes it by
+ immediately returning an empty array if no interface is found.
+ Coverity Scan found this bug.
+
+Wed Oct 2 21:37:04 2013 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * random.c (make_seed_value): a local array declaration was accessed
+ out of scope. Coverity Scan found this bug.
+
+Wed Oct 2 18:52:40 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: relax GC condition due to malloc_limit.
+
+ * gc.c (GC_MALLOC_LIMIT_MAX): change default value
+ (256MB -> 512MB) and permit zero to ignore max value.
+
+ * gc.c (vm_malloc_increase, vm_xrealloc): do not cause GC on realloc.
+
+ * gc.c (gc_before_sweep): change debug messages.
+
+Wed Oct 2 16:26:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_close_read): duplex IO should wait its child process
+ even after close_read.
+
+Wed Oct 2 15:39:13 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_core.h: use __has_attribute() instead of __clang__major__ because
+ clang says "Note that marketing version numbers should not be used
+ to check for language features, as different vendors use different
+ numbering schemes. Instead, use the Feature Checking Macros."
+ http://clang.llvm.org/docs/LanguageExtensions.html
+
+Wed Oct 2 14:19:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_close_write): detach tied IO for writing before closing
+ to get rid of race condition. [ruby-list:49598]
+
+ * io.c (rb_io_close_read): keep fptr in write_io to be discarded, to
+ fix freed pointer access when it is in use by other threads, and get
+ rid of potential memory/fd leak.
+
+Tue Oct 1 23:44:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * vm_core.h: use __attribute__((unused)) in UNINITIALIZED_VAR on clang
+ 4.0+ instead of just on 4.2. Clang has supported the unused attribute
+ since before version 4, so this should be safe.
+
+Tue Oct 1 22:03:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tempfile.rb (Tempfile#unlink): finalizer is no longer needed
+ after unlinking. patched by by normalperson (Eric Wong) at
+ [ruby-core:56521] [Bug #8768]
+
+Tue Oct 1 20:54:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (stat_new_0): constify.
+
+ * file.c (rb_stat_new): constify and export. based on a patch by
+ Hanmac (Hans Mackowiak) at [ruby-core:53225]. [Feature #8050]
+
+Tue Oct 1 16:03:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (ruby_safe_level_4_warning): needed by extension
+ libraries which check safe level 4. [ruby-dev:47517] [Bug #8652]
+
+Mon Sep 30 23:14:36 2013 Zachary Scott <e@zzak.io>
+
+ * ext/objspace/objspace.c: [DOC] Cleaned up many rdoc formatting
+ issues and several duplicate grammar bugs.
+
+Mon Sep 30 23:01:01 2013 Zachary Scott <e@zzak.io>
+
+ * ext/objspace/object_tracing.c: [DOC] Adjust rdoc formatting and fix
+ small grammar typo
+
+Mon Sep 30 17:28:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/object_tracing.c: [DOC] add some notes for
+ ObjectSpace::trace_object_allocations.
+
+Mon Sep 30 16:46:58 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/object_tracing.c: add new 3 methods to control tracing.
+ * ObjectSpace::trace_object_allocations_start
+ * ObjectSpace::trace_object_allocations_stop
+ * ObjectSpace::trace_object_allocations_clear
+ And some refactoring.
+
+ * test/objspace/test_objspace.rb: add a test for new methods.
+
+ * NEWS: add a description for new methods.
+
+Mon Sep 30 11:18:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_disable): do rest_sweep() before disable GC.
+ This fix may solve a failure of
+ TestTracepointObj#test_tracks_objspace_events
+ [test/-ext-/tracepoint/test_tracepoint.rb:43].
+
+Mon Sep 30 10:40:20 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_method.c (rb_undef): raise a NameError if the original method
+ of a refined method is not defined.
+
+ * vm_insnhelper.c (rb_method_entry_eq): added NULL check to avoid SEGV.
+
+ * test/ruby/test_refinement.rb: related test.
+
+Sun Sep 29 23:45:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_id_attrset, intern_str): allow junk attrset ID for
+ Struct.
+
+ * parse.y (rb_id_attrset): fix inconsistency with literals, allow
+ ID_ATTRSET and return it itself, but ID_JUNK cannot make ID_ATTRSET.
+ and raise a NameError instead of rb_bug() for invalid argument.
+
+Sun Sep 29 18:45:05 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args):
+ clear keyword arguments to prevent GC bug which occurs
+ while marking VM stack.
+ [ruby-dev:47729] [Bug #8964]
+
+ * test/ruby/test_keyword.rb: tests for the above.
+
+Sat Sep 28 23:25:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * math.c (math_log, math_log2, math_log10): fix for Bignum argument.
+ numbits should be add only when right shifted.
+
+Sat Sep 28 14:30:29 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/dl/test_base.rb: {libc, libm} detection now handle GNU/Hurd
+ correctly. Patch by Gabriele Giacone (1o5g4r8o@gmail.com).
+ [Bug #8937][ruby-core:57311]
+ * test/fiddle/helper.rb: ditto.
+
+Sat Sep 28 00:19:41 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/curses/extconf.rb: check the size of chtype.
+
+ * ext/curses/curses.c (NUM2CH, CH2NUM): use proper macros for
+ the size of chtype.
+
+ [ruby-core:56090] [Bug #8659]
+
+Fri Sep 27 18:33:23 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add two GC tuning environment variables.
+ RUBY_GC_MALLOC_LIMIT_MAX and RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR.
+ See r43067 for details.
+
+ * gc.c (rb_gc_set_params): refactoring. And change verbose notation.
+ Mostly duplicated functions get_envparam_int/double is not cool.
+ Please rewrite it.
+
+ * test/ruby/test_gc.rb: fix a test for this change.
+
+Fri Sep 27 17:44:41 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (GC_MALLOC_LIMIT): 8,000,000 -> 8 * 1,024 * 1,024.
+
+Fri Sep 27 17:19:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_before_sweep): cast to size_t to suppress warnings.
+
+Fri Sep 27 17:07:55 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add some fine-grained profiling codes to tuning marking phase.
+ If you enable RGENGC_PRINT_TICK to 1, then profiling results by RDTSC
+ (on x86/amd64 environment) are printed at last.
+ Thanks Yoshii-san.
+
+Fri Sep 27 16:32:27 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: simplify threshold of GC caused by malloc_increase.
+ Now, malloc_limit is increased/decreased by mysterious logic.
+ This fix simplify malloc_limit increase/decrease logic such as:
+ if (malloc_increase > malloc_limit) /* so many malloc */
+ malloc_limit += malloc_limit * (GC_MALLOC_LIMIT_FACTOR-1);
+ else
+ malloc_limit -= malloc_limit * (GC_MALLOC_LIMIT_FACTOR-1)/4;
+ Default value of GC_MALLOC_LIMIT_FACTOR is 1.8.
+ malloc_limit is bounded by GC_MALLOC_LIMIT_MAX (256MB by default).
+ This logic runs at gc_before_sweep(). So there are no effect from
+ caused by lazy sweep. And we can remove malloc_increase2.
+
+ * gc.c (HEAP_MIN_SLOTS, FREE_MIN, HEAP_GROWTH_FACTOR): rename to
+ GC_HEAP_MIN_SLOTS, GC_FREE_MIN, GC_HEAP_GROWTH_FACTOR respectively.
+ Check them by `#ifndef' so you can specify these values outside gc.c.
+
+ * gc.c (ruby_gc_params_t): add initial_malloc_limit_factor and
+ initial_malloc_limit_max.
+
+ * gc.c (vm_malloc_prepare, vm_xrealloc): use vm_malloc_increase to
+ add and check malloc_increase.
+
+Fri Sep 27 01:05:00 2013 Zachary Scott <e@zzak.io>
+
+ * re.c: [DOC] arguments of Regexp::union receive #to_regexp [Bug #8205]
+
+Fri Sep 27 00:39:27 2013 Zachary Scott <e@zzak.io>
+
+ * struct.c: [DOC] grammar of ArgumentError in Struct.new [Bug #8936]
+ Patch by Prathamesh Sonpatki
+
+Thu Sep 26 22:11:56 2013 Zachary Scott <e@zzak.io>
+
+ * ext/bigdecimal/bigdecimal.c: [DOC] several fixes by @chastell
+ This includes fixing the capitalization of Infinity, return value of
+ example "BigDecimal.new('NaN') == 0.0", and code style in example.
+ [Fixes GH-398] https://github.com/ruby/ruby/pull/398
+
+Thu Sep 26 22:08:11 2013 Zachary Scott <e@zzak.io>
+
+ * lib/observer.rb: [DOC] syntax improvement in example by @chastell
+ [Fixes GH-400] https://github.com/ruby/ruby/pull/400
+
+Thu Sep 26 22:03:15 2013 Zachary Scott <e@zzak.io>
+
+ * ext/digest/digest.c: [DOC] typo in overview by @chastell
+ [Fixes GH-399] https://github.com/ruby/ruby/pull/399
+
+Thu Sep 26 22:00:42 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl.c: [DOC] typo in example by @zoranzaric
+ [Fixes GH-401] https://github.com/ruby/ruby/pull/401
+
+Thu Sep 26 21:07:49 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-delete-backward-char): Add
+ support for smartparens-mode.
+
+ * misc/ruby-electric.el (ruby-electric-cua-replace-region-maybe)
+ (ruby-electric-cua-delete-region-maybe): New functions that
+ combine `ruby-electric-cua-*-region` with
+ `ruby-electric-cua-*-region-p`, using a slightly better way to
+ detect if it is in cua-mode.
+
+Thu Sep 26 16:51:00 2013 Shota Fukumori <her@sorah.jp>
+
+ * insns.def (opt_regexpmatch2): Check String#=~ hasn't overridden
+ before calling rb_reg_match().
+
+ * test/ruby/test_string.rb: Test for above.
+
+ * vm.c (vm_init_redefined_flag): Add BOP flag for String#=~
+
+ [ruby-core:57385] [Bug #8953]
+
+Thu Sep 26 16:43:42 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el: Avoid use of the interactive function
+ `self-insert-command` which fires `post-self-insert-hook` and
+ `post-command-hook`, to make the ruby-electric commands work
+ nicely with those minor modes that make use of them to do
+ similar input assistance, such as electric-pair-mode,
+ autopair-mode and smartparens-mode.
+
+Thu Sep 26 16:24:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * insns.def (opt_regexpmatch1): check Regexp#=~ is not defined before
+ calling rb_reg_match()
+
+ * test/ruby/test_regexp.rb: add test
+
+ * vm.c (ruby_vm_redefined_flag): change type to short[]
+
+ * vm.c (vm_redefinition_check_flag): return REGEXP_REDEFINED_OP_FLAG if
+ klass == rb_cRegexp
+
+ * vm.c (vm_init_redefined_flag): setup BOP flag for Regexp#=~
+
+ * vm_insnhelper.h: add REGEXP_REDEFINED_OP_FLAG
+
+ [ruby-core:57385] [Bug #8953]
+
+Thu Sep 26 14:46:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (mark_locations_array): disable AddressSanitizer. based on a
+ patch by halfie (Ruby Guy) at [ruby-core:57372].
+ [ruby-core:56155] [Bug #8680]
+
+Wed Sep 25 17:41:29 2013 Koichi Sasada <ko1@atdot.net>
+
+ * README.EXT, README.EXT.ja: remove description of RARRAY_PTR()
+ and add a caution of accessing internal data structure directly.
+ Also add a description of rb_ary_store().
+ [Bug #8399]
+
+Wed Sep 25 17:12:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: rename RARRAY_RAWPTR() to RARRAY_CONST_PTR().
+ RARRAY_RAWPTR(ary) returns (const VALUE *) type pointer and
+ usecase of this macro is not acquire raw pointer, but acquire
+ read-only pointer. So we rename to better name.
+ RSTRUCT_RAWPTR() is also renamed to RSTRUCT_CONST_PTR()
+ (I expect that nobody use it).
+
+ * array.c, compile.c, cont.c, enumerator.c, gc.c, proc.c, random.c,
+ string.c, struct.c, thread.c, vm_eval.c, vm_insnhelper.c:
+ catch up this change.
+
+Wed Sep 25 16:58:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (rb_float_value, rb_float_new): move inline functions
+ from ruby/ruby.h.
+
+ * numeric.c (rb_float_value, rb_float_new): define external functions
+ for extension libraries.
+
+Wed Sep 25 15:37:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/rdoc/test_rdoc_generator_darkfish.rb: add a guard for windows.
+
+Wed Sep 25 09:53:11 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Fix CVE-2013-4363. Miscellaneous minor improvements.
+
+ * test/rubygems: Tests for the above.
+
+Tue Sep 24 17:38:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_inspect): get rid of out-of-bound access.
+
+ * string.c (rb_str_inspect): when a UTF-16/32 string doesn't have a
+ BOM, inspect as a dummy encoding string.
+
+Tue Sep 24 17:15:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/encdb.c (ENC_DUMMY_UNICODE): make BOM-encodings dummy.
+
+ * encoding.c (enc_autoload): keep dummy encodings dummy.
+
+Tue Sep 24 16:41:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry#write): data size
+ is in bytes, not chars. terminators should be placed automatically.
+
+Tue Sep 24 16:39:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry#each_value): encode
+ name.
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry#each_key): ditto.
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry#export_string):
+ encode to locale encoding if default internal is not set.
+
+Tue Sep 24 16:35:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumKey):
+ size of the name is in WCHARs, not in bytes.
+
+Tue Sep 24 14:07:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * gc.c (free_method_cache_entry_i): unused function
+
+ * gc.c (rb_free_mc_table): ditto
+
+ * internal.h (method_cache_entry_t): unused struct
+
+ * vm_method.c (verify_method_cache): remove unused variable
+
+ * vm_method.c (rb_method_entry): ditto
+
+Tue Sep 24 14:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * class.c (class_alloc): remove mc_tbl
+
+ * gc.c (obj_free): ditto
+
+ * internal.h (struct rb_classext_struct): ditto
+
+ * method.h (rb_method_entry): remove ent param
+
+ * vm_method.c: restore the global method cache. Per class cache tables
+ turned out to be far too slow.
+
+ [ruby-core:57289] [Bug #8930]
+
+Tue Sep 24 12:51:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::API): need
+ Constants.
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumValue):
+ size of the name is in WCHARs, not in bytes.
+
+Mon Sep 23 22:16:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): Unicode with BOM
+ must be based on big endian variants, so that actual encodings would
+ work. [ruby-core:57318] [Bug #8940]
+
+Mon Sep 23 12:11:26 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (env_each_pair): do not call rb_assoc_new() if
+ it isn't needed.
+
+Mon Sep 23 10:42:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_module.rb (TestModule#test_include_toplevel): test
+ for top level main.include. based on a part of the patch by
+ kyrylo at [GH-395].
+
+Mon Sep 23 05:07:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_ary_cat): move from internal.h, since it
+ is described in README.EXT.
+
+Sun Sep 22 20:55:20 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm_insnhelper.c (vm_make_proc_with_iseq): fix bug message.
+ This is follow up to changes in r42637.
+
+Sun Sep 22 20:35:38 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/-test-/tracepoint/tracepoint.c (Init_tracepoint): prevent from GC.
+
+Sun Sep 22 19:00:28 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * benchmark/bm_app_answer.rb: revert r42990, benchmark scripts should
+ be self-contained and avoid dependencies, especially such small one.
+ See https://github.com/ruby/ruby/pull/393#issuecomment-24861301.
+
+Sat Sep 21 20:11:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (rb_fork_internal): remove cloexec setting on pipes
+ created by rb_cloexec_pipe. patch by normalperson (Eric Wong) at
+ [ruby-core:56523]. [Bug #8769]
+
+Sat Sep 21 01:04:25 2013 Zachary Scott <e@zzak.io>
+
+ * lib/benchmark.rb: [DOC] grammar of Benchmark#bm [Bug #8888]
+ Patch by Prathamesh Sonpatki
+
+Sat Sep 21 00:50:02 2013 Zachary Scott <e@zzak.io>
+
+ * enumerator.c: [DOC] Enumerator#each arguments documentation [GH-388]
+ Patch by @kachick https://github.com/ruby/ruby/pull/388
+
+Sat Sep 21 00:49:16 2013 Zachary Scott <e@zzak.io>
+
+ * enum.c: [DOC] Enumerable#to_a accepts arguments [GH-388]
+ Patch by @kachick https://github.com/ruby/ruby/pull/388
+
+Sat Sep 21 00:47:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_conv_enc_opts): make sure to scan coderange to get
+ rid of unnecessary conversion.
+
+Sat Sep 21 00:21:08 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer
+ Based on a patch by Rafal Lisowski [Bug #8758]
+
+Fri Sep 20 23:54:03 2013 Zachary Scott <e@zzak.io>
+
+ * lib/gserver.rb: [DOC] correct gserver.rb license [Bug #8913]
+
+Fri Sep 20 23:48:34 2013 Zachary Scott <e@zzak.io>
+
+ * ext/psych/yaml/yaml.h: [DOC] merge upstream typo fix by @GreenGeorge
+ https://github.com/tenderlove/psych/pull/161
+
+Fri Sep 20 23:37:40 2013 Zachary Scott <e@zzak.io>
+
+ * lib/securerandom.rb: [DOC] SecureRandom.hex length argument
+ [Fixes GH-394] Patch by @avdi https://github.com/ruby/ruby/pull/394
+
+Fri Sep 20 23:34:48 2013 Zachary Scott <e@zzak.io>
+
+ * benchmark/bm_app_answer.rb: removed duplicate code [Fixes GH-393]
+ Patch by @gouravtiwari https://github.com/ruby/ruby/pull/393
+
+Fri Sep 20 23:24:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (btest, btest-ruby, test-knownbug): add $(RUN_OPTS) to
+ ruby to be run, so that tests are runnable before making exts.
+
+ * common.mk (test-sample): ditto, and use $(MINIRUBY) as rubytest.rb
+ does not need extension libraries.
+
+ * tool/rubytest.rb: pass $(RUN_OPTS) to testing ruby using --run-opt.
+
+Fri Sep 20 15:01:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (intern_str): sigil only names are junk, at least one
+ identifier character is needed. [ruby-dev:47723] [Bug #8928]
+
+ * parse.y (rb_enc_symname_type): fix out of bound access.
+
+Fri Sep 20 14:14:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/printf/printf.c (printf_test_call): Fix an end of buffer
+ argument.
+
+Thu Sep 19 16:59:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (lambda): adjust position to the beginning of the block.
+
+Thu Sep 19 16:25:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): initialize cp so that size is 0 in the
+ commented case. fix an accidental bug at r16716.
+
+Thu Sep 19 14:33:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * NEWS: add a news for r42974.
+
+Thu Sep 19 14:12:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: make Symbol objects frozen.
+ [Feature #8906]
+ I want to freeze this good day, too.
+
+ * test/ruby/test_eval.rb: catch up this change.
+
+ * test/ruby/test_symbol.rb: add a test to check frozen symbols.
+
+Thu Sep 19 09:11:33 2013 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS: Update for RDoc 4.1.0.preview.1 and RubyGems 2.2.0.preview.1
+
+Thu Sep 19 08:59:41 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/markdown/literals_1_9.rb: Fix trailing whitespace.
+
+ Previously kpeg (which generates this file) added trailing
+ whitespace, but this bug is now fixed.
+
+ * lib/rdoc/markdown.rb: ditto.
+
+Thu Sep 19 08:33:14 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc 4.1.0.preview.1
+
+ RDoc 4.1.0 contains a number of enhancements including a new default
+ style and accessibility support. You can see the changelog here:
+
+ https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc
+
+ * test/rdoc: ditto.
+
+Thu Sep 19 07:16:26 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: updating Psych version
+
+ * ext/psych/psych.gemspec: ditto
+
+Thu Sep 19 06:39:40 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/dependency_resolver.rb: Switch the iterative resolver
+ algorithm from recursive to iterative to avoid possible
+ SystemStackError.
+
+Thu Sep 19 06:29:30 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.2.0.preview.1
+
+ This brings several new features to RubyGems summarized here:
+
+ https://github.com/rubygems/rubygems/blob/v2.2.0.preview.1/History.txt
+
+ * test/rubygems: ditto.
+
+Wed Sep 18 23:14:58 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_enumerate_lines): make String#each_line and
+ #lines not raise invalid byte sequence error when it is called
+ with an argument. The patch also causes performance improvement.
+ [ruby-dev:47549] [Bug #8698]
+
+ * test/ruby/test_m17n_comb.rb (test_str_each_line): remove
+ assertions which check that String#each_line and #lines will
+ raise an error if the receiver includes invalid byte sequence.
+
+Wed Sep 18 16:32:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (mnew_from_me): allocate structs after allocated wrapper
+ object successfully, to get rid of potential memory leak.
+
+Tue Sep 17 15:54:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/shell/command-processor.rb (Shell::CommandProcessor#find_system_command):
+ return executable file only, should ignore directories and
+ unexecutable files. [ruby-core:57235] [Bug #8918]
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert_throw):
+ assertion for throw. MiniTest::Assertions#assert_throws discards
+ the caught value.
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert_nothing_thrown):
+ returns the result of the given block.
+
+Tue Sep 17 12:55:58 2013 Eric Hodel <drbrain@segment7.net>
+
+ * doc/regexp.rdoc: [DOC] Replace paragraphs in verbatim sections with
+ plain paragraphs to improve readability as ri and HTML.
+
+Mon Sep 16 07:32:35 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: removed meaningless lines.
+ * rational.c: ditto.
+
+Mon Sep 16 00:44:23 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * ext/socket/mkconstants.rb: define MSG_FASTOPEN.
+ [ruby-core:57138] [Feature #8897]
+
+Sun Sep 15 13:31:23 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * rational.c (nurat_div): reverted r28844, r28886 and r28887.
+ REASON: Nobuyoshi Nakada <nobu@ruby-lang.org>'s commits are buggy.
+ So Rational#/ may produce exact number with inexact number.
+ Moreover, without reducing.
+ REALLY NONSENSE COMMITS.
+ A bug report by me [ruby-dev:44710] is also caused by this behavior.
+ Kenta Murata <mrkn@mrkn.jp> patched it up.
+ But he did not fix the origin.
+ Today, the bug is still alive in ruby 1.9.3 and 2.0.0.
+
+Sat Sep 14 06:08:10 2013 Eric Hodel <drbrain@segment7.net>
+
+ * dir.c (dir_s_glob): [DOC] Improve wording and layout.
+
+ * dir.c (file_s_fnmatch): ditto.
+
+ * dir.c (Init_Dir): [DOC] Document File::Constants::FNM_XXX
+ constants. (These won't show up in RDoc until a new RDoc is
+ imported.)
+
+Thu Sep 12 14:58:58 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI::Generic.find_proxy): return nil if
+ http_proxy environment variable is empty string.
+ [ruby-core:57140] [Bug #8898]
+
+Fri Sep 13 10:40:28 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.1.3
+
+ Fixed installing platform gems
+
+ Restored concurrent requires
+
+ Fixed installing gems with extensions with --install-dir
+
+ Fixed `gem fetch -v` to install the latest version
+
+ Fixed installing gems with "./" in their files entries
+
+ * test/rubygems/test_gem_package.rb: Tests for the above.
+
+ * NEWS: Updated for RubyGems 2.1.3
+
+Thu Sep 12 22:40:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_CHECK_SIGNEDNESS): macro to check signedness of a
+ type.
+
+ * configure.in (size_t): must be unsigned.
+ [ruby-core:57149] [Feature #8890]
+
+Thu Sep 12 22:37:08 2013 Anton Ovchinnikov <revolver112@gmail.com>
+
+ * ext/bigdecimal/bigdecimal.c, ext/digest/md5/md5.c,
+ ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c:
+ Eliminate less-than-zero checks for unsigned variables.
+ According to section 4.1.5 of C89 standard, size_t is an unsigned
+ type. These checks were found with 'cppcheck' static analysis tool.
+ [ruby-core:57117] [Feature #8890]
+
+Thu Sep 12 21:35:46 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * Makefile.in (libruby-static.a): change LDFLAGS order. LDFLAGS may
+ include library path that should be specified before LIBS.
+ [ruby-dev:47707] [Bug #8901]
+
+Thu Sep 12 20:07:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vsnprintf.c (MAXEXP, MAXFRACT): calculate depending on constants in
+ float.h.
+
+ * vsnprintf.c (BSD_vfprintf): limit length for cvt() to get rid of
+ buffer overflow. [ruby-core:57023] [Bug #8864]
+
+ * vsnprintf.c (exponent): make expbuf size more precise.
+
+Wed Sep 11 17:30:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUNRUBY): append -- only after runruby.rb, not
+ cross-compiling baseruby, so that $(RUN_OPT) can be command line
+ options. [ruby-dev:47703] [Bug #8893]
+
+Wed Sep 11 07:55:17 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_unlock): Mutex#unlock no longer raise
+ an exception even if uses on trap. [Bug #8891]
+
+Tue Sep 10 14:37:01 2013 Shota Fukumori <sorah@tubusu.net>
+
+ * vm_backtrace.c (vm_backtrace_to_ary): Ignore the second argument if
+ it is nil. [Bug #8884] [ruby-core:57094]
+
+ * test/ruby/test_backtrace.rb (test_caller_with_nil_length):
+ Test for above.
+
+Tue Sep 10 12:39:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (method_entry_i): should exclude refined methods from
+ instance method list. [ruby-core:57080] [Bug #8881]
+
+Tue Sep 10 12:05:04 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * io.c (rb_f_printf): [DOC] add missing parenthesis in rdoc.
+
+Tue Sep 10 10:08:00 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: Update RubyGems note.
+
+Tue Sep 10 09:51:22 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.1.0. Fixes CVE-2013-4287.
+
+ See http://rubygems.rubyforge.org/rubygems-update/CVE-2013-4287_txt.html
+ for CVE information.
+
+ See http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.1.0+%2F+2013-09-09
+ for release notes.
+
+ * test/rubygems: Tests for the above.
+
+Mon Sep 9 21:31:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c: Remove spaces between SI prefix and unit to follow
+ SI brochure.
+ http://www.bipm.org/en/si/si_brochure/
+ https://www.nmij.jp/library/units/si/
+
+ * time.c: Ditto.
+
+ * ext/socket/ancdata.c: Ditto.
+
+Mon Sep 9 16:55:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_add_refined_method_entry): clear cache in the
+ refined class since refining a method entry is modifying the class.
+ [ruby-core:57079] [Bug #8880]
+
+Mon Sep 9 09:14:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (Gem::Specification#initialize): default date to
+ RUBY_RELEASE_DATE. [ruby-core:57072] [Bug #8878]
+
+ * tool/rbinstall.rb (Gem::Specification#to_ruby): add date.
+
+Sun Sep 8 16:01:54 2013 Tanaka Akira <akr@fsij.org>
+
+ * rational.c (f_gcd): Relax the condition to use GMP.
+
+Sun Sep 8 13:56:38 2013 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (folevariant_initialize): check type of
+ element of array.
+
+ * test/win32ole/test_win32ole_variant.rb (test_s_new_ary): ditto.
+
+Sat Sep 7 21:33:10 2013 Tanaka Akira <akr@fsij.org>
+
+ * math.c (math_log): Test the sign for bignums.
+ (math_log2): Ditto.
+ (math_log10): Ditto.
+
+Sat Sep 7 20:25:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * math.c (math_log): Support bignums bigger than 2**1024.
+ (math_log2): Ditto.
+ (math_log10): Ditto.
+
+Sat Sep 7 15:36:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * vm_eval.c (vm_call0): fix prototype, the id parameter should be of
+ type ID, not VALUE
+
+ * vm_insnhelper.c (check_match): the rb_funcall family of functions
+ does not care about refinements. We need to use
+ rb_method_entry_with_refinements instead to call === with
+ refinements. Thanks to Jon Conley for reporting this bug.
+ [ruby-core:57051] [Bug #8872]
+
+ * test/ruby/test_refinement.rb: add test
+
+Sat Sep 7 13:49:40 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * variable.c (classname): the name of class that has
+ non class id should not be nil. This bug was introduced
+ in r36577.
+
+ * test/thread/test_cv.rb: test for change.
+
+Sat Sep 7 13:29:22 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * lib/find.rb (Find.find): respect the encodings of arguments.
+ [ruby-dev:47530] [Feature #8657]
+
+ * test/test_find.rb: add tests.
+
+Sat Sep 7 10:40:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb (TCP_FASTOPEN): Defined for TCP fast open.
+ [ruby-core:57048] [Feature #8871] patch by Masaki Matsushita.
+
+Fri Sep 6 23:53:31 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * common.mk: use RUNRUBY instead of MINIRUBY because MINIRUBY can't
+ require extension libraries. The patch is from nobu
+ (Nobuyoshi Nakada).
+
+ * ext/thread/extconf.rb: for build ext/thread/thread.c.
+
+ * include/ruby/intern.h: ditto.
+
+ * thread.c: ditto.
+
+ * lib/thread.rb: removed and replaced by ext/thread/thread.c.
+
+ * ext/thread/thread.c: Queue, SizedQueue and ConditionVariable
+ implementations in C. This patch is based on patches from panaggio
+ (Ricardo Panaggio) and funny_falcon (Yura Sokolov) and ko1
+ (Koichi Sasada). [ruby-core:31513] [Feature #3620]
+
+ * test/thread/test_queue.rb (test_queue_thread_raise): add a test for
+ ensuring that killed thread should be removed from waiting threads.
+ It is based on a code by ko1 (Koichi Sasada). [ruby-core:45950]
+
+Fri Sep 6 22:47:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Define ac_cv_func_clock_getres to yes for mingw*.
+
+Fri Sep 6 21:04:10 2013 Tanaka Akira <akr@fsij.org>
+
+ * rational.c: Include gmp.h if GMP is used.
+ (GMP_GCD_DIGITS): New macro.
+ (rb_gcd_gmp): New function.
+ (f_gcd_normal): Renamed from f_gcd.
+ (rb_gcd_normal): New function.
+ (f_gcd): Invoke rb_gcd_gmp or f_gcd_normal.
+
+ * internal.h (rb_gcd_normal): Declared.
+ (rb_gcd_gmp): Ditto.
+
+ * ext/-test-/rational: New directory.
+
+ * test/-ext-/rational: New directory.
+
+Fri Sep 6 14:23:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (clock_getres): required as well as clock_gettime().
+ [ruby-dev:47699] [Bug #8869]
+
+Fri Sep 6 11:45:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * transcode.c (rb_econv_append): new function to append a string data
+ with converting its encoding. split from rb_econv_substr_append.
+
+Fri Sep 6 02:37:22 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: use double quotes when
+ strings start with special characters.
+ https://github.com/tenderlove/psych/issues/157
+
+ * test/psych/test_string.rb: test for change.
+
+Fri Sep 6 00:05:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rewrite_cref_stack): remove recursion.
+
+Thu Sep 5 18:05:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * string.c (fstring_cmp): take string encoding into account when
+ comparing fstrings [ruby-core:57037] [Bug #8866]
+
+ * test/ruby/test_string.rb: add test
+
+Thu Sep 5 17:25:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_fstring, rb_str_free): use st_data_t instead of VALUE.
+
+ * string.c (rb_fstring): get rid of duplicating already frozen object.
+
+Thu Sep 5 14:01:22 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/optparse.rb: The Integer acceptable now allows binary and
+ hexadecimal numbers per the documentation. [ruby-trunk - Bug #8865]
+
+ DecimalInteger, OctalInteger, DecimalNumeric now validate their input
+ before converting to a number. [ruby-trunk - Bug #8865]
+
+ * test/optparse/test_acceptable.rb: Tests for the above, tests for all
+ numeric acceptables for existing behavior.
+
+Thu Sep 5 13:49:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * include/ruby/ruby.h: add RSTRING_FSTR flag
+
+ * internal.h: add rb_fstring() prototype
+
+ * string.c (rb_fstring): deduplicate frozen string literals
+
+ * string.c (rb_str_free): delete fstrings from frozen_strings table when
+ they are GC'd
+
+ * string.c (Init_String): initialize frozen_strings table
+
+Thu Sep 5 12:48:00 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * configure.in (with_gmp): set with_gmp no if it is empty.
+
+Thu Sep 5 10:41:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_getivar): use class sequence to check class
+ identity, instead of pointer + vm state
+
+ * vm_insnhelper.c (vm_setivar): ditto
+
+Thu Sep 5 08:20:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (GMP_DIV_DIGITS): New macro.
+ (bary_divmod_gmp): New function.
+ (rb_big_divrem_gmp): Ditto.
+ (bary_divmod_branch): Ditto.
+ (bary_divmod): Use bary_divmod_branch.
+ (bigdivrem): Ditto.
+
+ * internal.h (rb_big_divrem_gmp): Declared.
+
+Thu Sep 5 06:22:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_divmod_normal): Reduce temporary array allocations.
+
+Thu Sep 5 02:17:06 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_divrem_normal): Add GC guards.
+
+Thu Sep 5 00:38:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_divrem_normal): New function.
+
+ * internal.h (rb_big_divrem_normal): Declared.
+
+ * ext/-test-/bignum/div.c: New file.
+
+ * test/-ext-/bignum/test_div.rb: New file.
+
+Thu Sep 5 00:08:44 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_normal): Removed.
+ (bary_divmod_normal): New function.
+ (bary_divmod): Use bary_divmod_normal.
+ (bigdivrem): Use bary_divmod_normal.
+
+Wed Sep 4 23:02:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Useless declaration removed.
+
+Wed Sep 4 22:56:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (NUM_STEP_GET_INF): split from NUM_STEP_SCAN_ARGS(), since
+ inf is not used in num_step_size().
+
+Wed Sep 4 20:22:43 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_normal): Add assertions.
+
+Wed Sep 4 19:18:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (vm_state_version_t): prefer LONG_LONG to uint64_t.
+
+Wed Sep 4 16:28:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (vm_state_version_t): use uint64_t when it is larger than
+ LONG_LONG, and fallback to unsigned long.
+
+Wed Sep 4 15:37:05 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/utf8_mac-tbl.rb: fix r42789.
+ Fix conversion table and logic. [ruby-dev:47680]
+
+Wed Sep 4 14:08:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * class.c, compile.c, eval.c, gc.h, insns.def, internal.h, method.h,
+ variable.c, vm.c, vm_core.c, vm_insnhelper.c, vm_insnhelper.h,
+ vm_method.c: Implement class hierarchy method cache invalidation.
+
+ [ruby-core:55053] [Feature #8426] [GH-387]
+
+Wed Sep 4 11:13:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (str_gsub): use BEG(0) for whole matched position not
+ return value from rb_reg_search(), for \K matching.
+ [ruby-dev:47694] [Bug #8856]
+
+Wed Sep 4 11:11:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (SOLIBS): LIBRUBY_SO also needs linking with gmp, to
+ run worker processes in test-all on non-ELF platforms.
+
+Tue Sep 3 23:01:41 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/parser/test_tree.rb
+ (TestTreeParser::TestInvalid#test_unmatched_close_tag):
+ Compute expected value from test value.
+
+Tue Sep 3 22:59:58 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/treeparser.rb (REXML::Parsers::TreeParser#parse):
+ Add source information to parse exception on no close tag error.
+ [Bug #8844] [ruby-dev:47672]
+ Patch by Ippei Obayashi. Thanks!!!
+ * test/rexml/parser/test_tree.rb: Add a test for the above case.
+
+Tue Sep 3 22:57:57 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/parser/test_tree.rb: Fix test name to describe test
+ content.
+
+Tue Sep 3 22:54:46 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/treeparser.rb (REXML::Parsers::TreeParser#parse):
+ Remove needless nested parse exception information.
+ [Bug #8844] [ruby-dev:47672]
+ Reported by Ippei Obayashi. Thanks!!!
+ * test/rexml/parser/test_tree.rb: Add a test for the above case.
+
+Tue Sep 3 22:03:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_enc_str_new_cstr): new function to create a string from
+ the C-string pointer with the specified encoding.
+
+Tue Sep 3 21:41:37 2013 Akira Matsuda <ronnie@dio.jp>
+
+ * eval.c (Init_eval): Make Module#include and Module#prepend public
+ [Feature #8846]
+
+ * test/ruby/test_module.rb (class TestModule): Test for above
+
+Tue Sep 3 21:35:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (sys/dyntune.h): for gettune().
+
+ * thread_pthread.c (hpux_attr_getstackaddr): fix missing *.
+ [ruby-core:56983] [Feature #8793]
+
+Tue Sep 3 20:12:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (GMP_STR2BIG_DIGITS): New macro.
+ (str2big_gmp): New function.
+ (rb_cstr_to_inum): Use str2big_gmp for big bignums.
+ (rb_str2big_gmp): New function.
+
+ * internal.h (rb_str2big_gmp): Declared.
+
+Tue Sep 3 19:44:40 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry#values): added.
+ [Feature #7763] [ruby-core:51783]
+
+Tue Sep 3 18:26:00 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/inf-ruby.el (inf-ruby-keys, run-ruby): Add magic autoload
+ comments.
+
+ * misc/rdoc-mode.el (rdoc-mode): Ditto.
+
+ * misc/ruby-electric.el (ruby-electric-mode): Ditto.
+
+ * misc/ruby-style.el (ruby-style-c-mode): Ditto.
+
+Tue Sep 3 17:06:15 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_rubyoptions.rb
+ (TestRubyOptions::SEGVTest::ExpectedStderr): the URL was changed at
+ r42800.
+
+Tue Sep 3 14:48:25 2013 Zachary Scott <e@zzak.io>
+
+ * lib/thread.rb: [DOC] CV#wait typo by @avdi [Fixes GH-386]
+ https://github.com/ruby/ruby/pull/386
+
+Tue Sep 3 14:37:53 2013 Zachary Scott <e@zzak.io>
+
+ * error.c: [DOC] Update bug tracker url by @ScotterC [Fixes GH-390]
+ https://github.com/ruby/ruby/pull/390
+
+Tue Sep 3 12:45:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_str2big_poweroftwo): New function.
+ (rb_str2big_normal): Ditto.
+ (rb_str2big_karatsuba): Ditto.
+
+ * internal.h (rb_str2big_poweroftwo): Declared.
+ (rb_str2big_normal): Ditto.
+ (rb_str2big_karatsuba): Ditto.
+
+ * ext/-test-/bignum/str2big.c: New file.
+
+ * test/-ext-/bignum/test_str2big.rb: New file.
+
+ * ext/-test-/bignum/depend: Add the dependency for str2big.c.
+
+Tue Sep 3 12:09:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): Support times() based monotonic clock.
+ (rb_clock_getres): Ditto.
+
+Tue Sep 3 12:03:02 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (str2big_scan_digits): Extracted from rb_cstr_to_inum.
+
+Tue Sep 3 11:23:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_select_with_thread): rounding up the fraction of
+ tv_usec instead of rounding down.
+ this change is an experiment to get rid of failures on vc10-x64 CI.
+
+Tue Sep 3 11:00:28 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (do_select): constify timeout.
+
+ * win32/win32.c (rb_w32_select_with_thread): constify 10ms wait and
+ 0ms wait structs.
+
+Tue Sep 3 10:03:42 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/openssl/test_pair.rb
+ (OpenSSL::TestPair#test_write_nonblock_no_exceptions): on some CIs
+ such as Debian 6.0, Ubuntu 10.04, CentOS and vc10-x64 (maybe depend
+ on OpenSSL version), writing to SSLSocket after SSL_ERROR_WANT_WRITE
+ causes SSL_ERROR_SSL "bad write retry".
+
+Tue Sep 3 08:20:46 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/utf8_mac-tbl.rb: update conversion table to recent OS X.
+ Previous table is used on Mac OS X 10.1 or prior.
+ This table is used on 10.2 or later. [ruby-dev:47680]
+
+Tue Sep 3 07:49:25 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * numeric.c (NUM_STEP_SCAN_ARGS): On second thought, keep
+ Numeric#step backward compatible in that it raises TypeError
+ when nil is given as second argument.
+
+ * test/ruby/test_float.rb (TestFloat#test_num2dbl): Revert.
+
+ * test/ruby/test_numeric.rb (TestNumeric#test_step): Fix test
+ cases for the above change.
+
+Tue Sep 3 07:39:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bytes_2comp): Define it only for little endian
+ environment.
+
+Tue Sep 3 07:31:29 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * numeric.c (NUM_STEP_SCAN_ARGS): Numeric#step should raise
+ TypeError if a non-numeric parameter is given.
+
+ * test/ruby/test_float.rb (TestFloat#test_num2dbl): Allow nil as
+ step, as with the keyword argument.
+
+ * test/ruby/test_numeric.rb (TestNumeric#test_step): Add tests for
+ nil as step or limit.
+
+Tue Sep 3 07:28:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (bit_length): Add casts to fix compilation error with
+ clang 3.0 -Werror,-Wshorten-64-to-32.
+ [ruby-dev:47687] reported by SASADA Koichi.
+
+Tue Sep 3 03:17:26 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_search_super_method): use ci->argc instead of
+ ci->orig_argc. ci->argc can be changed by splat arguments.
+ [ruby-list:49575]
+ This fix should be applied to Ruby 2.0.0 series.
+
+ * test/ruby/test_super.rb: add a test for above.
+
+Mon Sep 2 23:46:29 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * numeric.c (num_step): Default the limit argument to infinity and
+ allow it to be omitted. Keyword arguments (by: and to:) are
+ introduced for ease of use. [Feature #8838] [ruby-dev:47662]
+ [ruby-dev:42194]
+
+ * numeric.c (num_step): Optimize for infinite loop.
+
+Mon Sep 2 22:55:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (ISDIGIT): Unused macro removed.
+
+Mon Sep 2 22:49:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (str2big_poweroftwo): Extracted from rb_cstr_to_inum.
+ (str2big_normal): Ditto.
+ (str2big_karatsuba): Ditto.
+
+Mon Sep 2 14:39:29 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * ruby.c (Process#setproctitle): [DOC] Fix and improve rdoc.
+
+ * ruby.c (Process#argv0): [DOC] Improve rdoc.
+
+Mon Sep 2 14:15:00 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * NEWS: fix description of number literal suffixes.
+
+Mon Sep 2 14:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * test/rake/test_rake_rules.rb: add space after string literal to
+ prevent conflict with string options syntax "foo"opts
+
+ * test/rss/rss-assertions.rb: ditto
+
+Mon Sep 2 12:28:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_bignum.rb (test_interrupt_during_to_s): Disable it
+ when GMP is used.
+
+Mon Sep 2 07:02:10 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (Init_Bignum): Define Bignum::GMP_VERSION when GMP is used.
+
+Mon Sep 2 01:46:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_generic): Reduce arguments.
+ (big2str_gmp): Ditto.
+ (rb_big2str1): Follow the above change.
+
+Mon Sep 2 00:08:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (get_mach_timebase_info): Extracted from rb_clock_gettime.
+ (rb_clock_gettime): Use get_mach_timebase_info.
+ (rb_clock_getres): Support MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC.
+
+Sun Sep 1 23:30:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (GMP_BIG2STR_DIGITS): New constant.
+ (big2str_gmp): New function.
+ (rb_big2str1): Use big2str_gmp for big bignums.
+
+ * internal.h (rb_big2str_gmp): Declared.
+
+ * ext/-test-/bignum/big2str.c (big2str_gmp): New method.
+
+Sun Sep 1 22:37:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_gmp): Use mpz_init and mpz_clear instead of
+ mpz_inits and mpz_clears.
+ Older GMP don't have them.
+
+Sun Sep 1 21:17:54 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/net/http/test_http.rb (test_bind_to_local_port): Choose an open
+ port more reliably.
+
+Sun Sep 1 20:32:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_base_poweroftwo): Renamed from
+ big2str_base_powerof2.
+ (rb_big2str_poweroftwo): New function for test.
+ (big2str_generic): Extracted from rb_big2str1.
+ (rb_big2str_generic): New function for test.
+
+ * internal.h (rb_big2str_poweroftwo): Declared.
+ (rb_big2str_generic): Ditto.
+
+ * ext/-test-/bignum/big2str.c: New file.
+
+ * test/-ext-/bignum/test_big2str.rb: New file.
+
+Sun Sep 1 15:21:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_2bdigits): Renamed from big2str_orig.
+
+Sun Sep 1 13:02:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Remove BITSPERDIG >= INT_MAX test. The static assertion,
+ SIZEOF_BDIGITS <= sizeof(BDIGIT) is enough.
+
+Sun Sep 1 11:38:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (maxpow_in_bdigit): Removed.
+
+Sun Sep 1 10:30:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (rb_fix_bit_length): Moved from bignum.c.
+
+Sun Sep 1 09:55:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (bit_length): Moved from bignum.c.
+ (nlz_int): Ditto.
+ (nlz_long): Ditto.
+ (nlz_long_long): Ditto.
+ (nlz_int128): Ditto.
+
+Sun Sep 1 03:32:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bit_length): Renamed from bitsize.
+
+Sun Sep 1 00:07:09 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_bit_length): New method.
+ (rb_fix_bit_length): Ditto.
+ [ruby-core:56247] [Feature #8700]
+
+Sat Aug 31 22:18:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_getres): New method.
+ (timetick2dblnum_reciprocal): New function.
+
+ * configure.in: Check clock_getres.
+
+ [ruby-core:56780] [Feature #8809] accepted as a CRuby feature at
+ DevelopersMeeting20130831Japan
+ https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130831Japan
+
+Sat Aug 31 21:02:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Use GMP to accelerate big Bignum multiplication.
+ (bary_mul_gmp): New function.
+ (bary_mul): Use bary_mul_gmp.
+ (bigsq): Use different threshold with GMP.
+
+ * configure.in: Detect GMP.
+
+ [ruby-core:56658] [Feature #8796]
+
+Sat Aug 31 15:03:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * compile.c (NODE_MATCH3): pass CALL_INFO to opt_regexpmatch2
+
+ * insns.def (opt_regexpmatch2): use CALL_SIMPLE_METHOD to call =~ if
+ the receiver is not a T_STRING [Bug #8847] [ruby-core:56916]
+
+Sat Aug 31 14:07:11 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb (random_bytes): Use Process.clock_gettime.
+
+Sat Aug 31 00:25:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/encoding.h (rb_{ascii8bit,utf8,usascii}_encindex): get
+ rid of conflict with macros defined in internal.h.
+
+Fri Aug 30 22:37:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (native_thread_init_stack): wait the creator thread
+ to fill machine stack info, if get_stack_of() is available.
+
+ * thread_pthread.c (native_thread_create): fill the created thread
+ stack info after starting, if get_stack_of() is available.
+
+ * thread_pthread.c (native_thread_create): define attr only if it is
+ used, and merge pthread_create() calls.
+
+ * thread_pthread.c (get_main_stack): separate function to get stack of
+ main thread.
+
+Thu Aug 29 18:05:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * struct.c (rb_struct_define_without_accessor_under): added.
+ This function is similar to rb_define_class_under() against
+ rb_define_class().
+
+ * include/ruby/intern.h: add a declaration of this function.
+
+Thu Aug 29 17:03:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): a method entry refers the based
+ class/module, so should search superclass from the origin i-class
+ where the entry belongs to, to get rid of infinite loop when zsuper
+ in a prepended class/module. [ruby-core:54105] [Bug #8238]
+
+Thu Aug 29 05:35:58 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (zstream_run): Fix handling of deflate streams that
+ need a dictionary but are being decompressed by Zlib::Inflate.inflate
+ (which has no option to set a dictionary). Now Zlib::NeedDict is
+ raised instead of crashing. [ruby-trunk - Bug #8829]
+ * test/zlib/test_zlib.rb (TestZlibInflate): Test for the above.
+
+Thu Aug 29 02:40:45 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: invalid floats should be
+ treated as strings.
+ https://github.com/tenderlove/psych/issues/156
+
+ * test/psych/test_string.rb: test for change
+
+Wed Aug 28 17:20:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (hpux_attr_getstackaddr): basic support for the
+ get_stack() under HP-UX. based on the patch by michal@rokos.cz
+ (Michal Rokos) at [ruby-core:56645]. [Feature #8793]
+
+Wed Aug 28 11:24:20 2013 Michal Rokos <michal@rokos.cz>
+
+ * configure.in (sys/pstat.h): fix missing header check for
+ missing/setproctitle.c on HP-UX. [ruby-core:56644] [Bug #8792]
+
+Wed Aug 28 04:54:33 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_ssl.c (ossl_ssl_read): Replace duplicate
+ wait_writable with wait_readable.
+
+Tue Aug 27 17:18:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/timeout.rb (Timeout#timeout): skip rescue clause only when no
+ exception class is given.
+
+Tue Aug 27 17:02:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (copy_stream_body): should write in binary mode. based on a
+ patch by godfat (Lin Jen-Shin) at [ruby-core:56556].
+ [ruby-core:56518] [Bug #8767]
+
+Tue Aug 27 17:02:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (copy_stream_body): move common open flags.
+
+Tue Aug 27 16:56:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (enumerator_size): use rb_check_funcall() instead of
+ respond_to? and call.
+
+ * enumerator.c (enumerator_each): ensure that argument array size
+ does not overflow at appending.
+
+Tue Aug 27 16:46:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_index, rb_ary_rindex): use optimized equality to
+ improve performance. [Feature #8820]
+
+ * vm_insnhelper.c (rb_equal_opt): optimized equality function.
+
+Tue Aug 27 16:11:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (opt_eq_func): use RBASIC_CLASS() instead of HEAP_CLASS_OF().
+
+ * insns.def (opt_plus, opt_minus, opt_mult, opt_div, opt_mod, opt_lt),
+ (opt_gt, opt_ltlt, opt_aref, opt_aset, opt_length, opt_size),
+ (opt_empty_p, opt_succ): ditto.
+
+Tue Aug 27 16:08:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_check_funcall, rb_check_funcall_with_hook): constify
+ argv.
+
+Tue Aug 27 13:03:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/stringio/stringio.c (strio_read_nonblock): declare local
+ variables at the first of function.
+
+Tue Aug 27 11:51:37 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * enumerator.c: Allow Enumerator size argument to be any callable.
+ Patch by Avdi Grimm. [bug #8641] [ruby-core:56032] [fix GH-362]
+
+ * test/ruby/test_enumerator.rb: Test for above
+
+Tue Aug 27 11:46:31 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_clear): do rest_sweep() before clearing
+ profile.current_record.
+
+Tue Aug 27 07:35:05 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * io.c (io_read_nonblock): support non-blocking reads without raising
+ exceptions. As in: `io.read_nonblock(size, exception: false)`
+ [ruby-core:38666] [Feature #5138]
+ * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): ditto
+ * ext/stringio/stringio.c (strio_sysread): ditto
+ * io.c (rb_io_write_nonblock): support non-blocking writes without
+ raising an exception.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_write_internal): ditto
+ * test/openssl/test_pair.rb (class OpenSSL): tests
+ * test/ruby/test_io.rb (class TestIO): ditto
+ * test/socket/test_nonblock.rb (class TestSocketNonblock): ditto
+ * test/stringio/test_stringio.rb (class TestStringIO): ditto
+
+Tue Aug 27 05:24:34 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems 2.1.0 Release Candidate
+ * test/rubygems: ditto.
+
+Mon Aug 26 16:24:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_nextc): warn carriage return in middle of line.
+ [ruby-core:56240] [Feature #8699]
+
+Mon Aug 26 15:27:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/timeout.rb (Timeout#timeout): should not be caught by rescue
+ clause. [Bug #8730]
+
+Mon Aug 26 14:44:26 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_splice): use RARRAY_PTR_USE() without WB because
+ there are not new relations.
+
+ * enum.c (enum_sort_by): ditto.
+
+ * struct.c (setup_struct): use RARRAY_RAWPTR().
+
+ * vm_eval.c (yield_under): ditto.
+
+ * ext/pathname/pathname.c (path_entries): use RARRAY_AREF().
+
+ * ext/pathname/pathname.c (path_s_glob): ditto.
+
+Mon Aug 26 13:11:10 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * array.c (ary_ensure_room_for_push): fix typo in r42658.
+
+Mon Aug 26 12:37:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/sizes.c.tmpl: generate automatically by extracting
+ RUBY_CHECK_SIZEOF from configure.in.
+
+Mon Aug 26 10:16:59 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * process.c (gcd_timetick_int): Renamed from gcd_timtick_int.
+
+Sun Aug 25 21:02:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * sizes.c (Init_sizes): Define the size of clock_t.
+
+Sun Aug 25 01:47:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BARY_SHORT_MUL): Renamed from BARY_MUL1.
+ (bary_short_mul): Renamed from bary_mul1.
+
+Sat Aug 24 10:35:09 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): The emulated clock names changed.
+
+Fri Aug 23 22:22:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): Add a cast to fix compile error by
+ -Werror,-Wshorten-64-to-32.
+
+Fri Aug 23 22:12:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (rb_intern): no symbol cache while initialization.
+
+Fri Aug 23 22:07:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (clock_t): needs time.h.
+
+Fri Aug 23 21:37:28 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (reduce_factors): New function.
+ (timetick2dblnum): Use reduce_factors.
+ (timetick2integer): Ditto.
+ (make_clock_result): Follow the above change.
+ (rb_clock_gettime): Ditto.
+
+Fri Aug 23 21:00:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (timetick_int_t): Renamed from timetick_giga_count_t.
+ (gcd_timtick_int): Renamed from gcd_ul and make the arguments
+ timetick_giga_count_t.
+ (reduce_fraction): Make the arguments timetick_int_t.
+ (timetick2integer): Ditto.
+ (make_clock_result): Ditto.
+ (timetick2dblnum): Fix the return type.
+ (rb_clock_gettime): Use timetick_int_t.
+
+Fri Aug 23 20:50:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (gcd_ul): New function.
+ (reduce_fraction): Ditto.
+ (reduce_fraction): Ditto.
+ (timetick2dblnum): Ditto.
+ (timetick2integer): Ditto.
+ (make_clock_result): Use timetick2dblnum and timetick2integer.
+ (rb_clock_gettime): Follow the make_clock_result change.
+
+Fri Aug 23 18:39:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_make_shared): shared ary as shady. Need more effort to
+ make it normal object.
+
+ * array.c (rb_ary_modify): use RARRAY_PTR_USE() without WB because
+ there are not new relations.
+
+ * array.c (ary_ensure_room_for_unshift): use RARRAY_RAWPTR() because
+ there are not new relations.
+
+Fri Aug 23 11:25:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c: introduce ARY_SHARED_OCCUPIED(shared).
+
+Fri Aug 23 11:07:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (config.h): now SIZEOF_CLOCK_T is needed for
+ unsigned_clock_t.
+
+Thu Aug 22 22:01:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): Strip "s" from unit names.
+
+Thu Aug 22 20:14:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (unsigned_clock_t): Defined.
+ (rb_clock_gettime): Consider clock_t overflow for
+ ISO_C_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID.
+
+ * configure.in: Check the size of clock_t.
+
+Thu Aug 22 16:22:48 2013 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (build_postexe_iseq): fix to setup the local table.
+
+Thu Aug 22 15:42:43 2013 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (rb_iseq_compile_node): accept NODE_IFUNC to support
+ custom compilation.
+
+ * compile.c (NODE_POSTEXE): compile to
+ "ONCE{ VMFrozenCore::core#set_postexe{...} }" with a new custom
+ compiler `build_postexe_iseq()'.
+
+ * vm.c (m_core_set_postexe): remove parameters (passed by a block).
+
+Thu Aug 22 06:54:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): Change emulation symbols for
+ Process.clock_gettime.
+
+Thu Aug 22 06:24:54 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (make_clock_result): Extracted from rb_clock_gettime.
+
+Wed Aug 21 22:30:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): clock() based CLOCK_PROCESS_CPUTIME_ID
+ emulation implemented.
+
+Wed Aug 21 21:02:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_proc_times): Use RB_GC_GUARD to guard objects from GC.
+
+Wed Aug 21 20:33:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (get_clk_tck): Extracted from rb_proc_times.
+ (rb_clock_gettime): times() based CLOCK_PROCESS_CPUTIME_ID emulation
+ is implemented.
+
+Wed Aug 21 19:31:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c: POSIX_GETTIMEOFDAY_CLOCK_REALTIME is renamed to
+ SUS_GETTIMEOFDAY_CLOCK_REALTIME.
+
+Wed Aug 21 19:17:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): CLOCK_PROCESS_CPUTIME_ID emulation
+ using getrusage is implemented.
+
+Wed Aug 21 17:34:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * gc.c (getrusage_time): Fallback clock_gettime to getrusage when
+ clock_gettime fails.
+ Reported by Eric Saxby. [ruby-core:56762] [Bug #8805]
+
+Wed Aug 21 02:32:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def: fix regexp's once option behavior.
+ fix [ruby-trunk - Bug #6701]
+
+ * insns.def: remove `onceinlinecache' and introduce `once' instruction.
+ `once' doesn't use `setinlinecache' insn any more.
+
+ * vm_core.h: `union iseq_inline_storage_entry' to store once data.
+
+ * compile.c: catch up above changes.
+
+ * iseq.c: ditto.
+
+ * vm.c, vm_insnhelper.c: ditto. fix `m_core_set_postexe()' which
+ is depend on `onceinlinecache' insn.
+
+ * test/ruby/test_regexp.rb: add tests.
+
+ * iseq.c: ISEQ_MINOR_VERSION to 1 (should increment major?)
+
+Wed Aug 21 02:30:15 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gcdebug_print_obj_condition): add printing information.
+
+Tue Aug 20 13:38:00 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/gdbm/test_gdbm.rb: skip TestGDBM#test_s_open_lock on Solaris.
+ On Solaris (and platforms which do not have flock and have lockf),
+ with GDBM 1.10, gdbm_open(3) blocks when opening already locked
+ gdbm file. [Bug #8790] [ruby-dev:47631]
+
+Tue Aug 20 02:32:52 2013 Zachary Scott <e@zzak.io>
+
+ * lib/test/: [DOC] Document Test::Unit, hide most submodules and
+ classes from rdoc. Since lib/test is only present as a compatibility
+ layer with the legacy test suite many test/unit users will be using
+ minitest or the test/unit gem instead. It is recommended to use one
+ of these alternatives for writing new tests.
+
+ This patch was based on a patch submitted by Steve Klabnik.
+ [ruby-core:56694] [Bug #8778]
+
+Tue Aug 20 02:10:19 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/rss.rb: [DOC] Document for constants by Steve Klabnik
+ [ruby-core:56705] [Bug #8798]
+
+Tue Aug 20 02:01:10 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/xmlparser.rb: [DOC] Hide legacy constant from rdoc
+ Patch by Steve Klabnik [ruby-core:56708] [Bug #8799]
+
+Tue Aug 20 01:52:05 2013 Zachary Scott <e@zzak.io>
+
+ * ext/socket/unixserver.c: [DOC] Document #accept
+ * ext/socket/tcpserver.c: ditto
+ * ext/socket/udpsocket.c: [DOC] Fix indentation of documentation
+ * ext/socket/socket.c: ditto
+ Patches by David Rodr'iguez [ruby-core:56734] [Bug #8802]
+
+Tue Aug 20 01:19:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Define ac_cv_func_clock_gettime to yes for mingw*.
+
+Mon Aug 19 21:31:35 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h: Fix a compilation error with
+ i586-mingw32msvc-gcc of gcc-mingw32 package on Debian squeeze.
+ ruby/missing.h should be included before include/ruby/win32.h
+ because struct timespec, used in the clock_gettime declaration in
+ include/ruby/win32.h, is defined in ruby/missing.h instead of
+ system headers.
+
+Mon Aug 19 20:55:12 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix around GC_DEBUG.
+
+ * gc.c (RVALUE::line): should be VALUE. On some environment
+ (such as mswin64), `int' introduces alignment mismatch.
+
+ * gc.c (newobj_of): add an assertion to check VALUE alignment.
+
+ * gc.c (aligned_malloc): `&' is low priority than `=='.
+
+ * gc.c: define GC_DEBUG everytime and use it as value 0 or 1.
+
+Mon Aug 19 17:43:44 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_fiber.rb: collect garbage fibers immediately.
+
+Mon Aug 19 17:41:49 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/profile_test_all.rb: add `failed?' information.
+
+Mon Aug 19 17:00:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (retry_fork): retry with GC if ENOMEM occurred, to free
+ swap/kernel space.
+
+Mon Aug 19 13:28:47 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/win32.h (CLOCK_MONOTONIC): typo.
+
+ * win32/win32.c: removed duplicated declarations.
+
+Mon Aug 19 13:03:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (clock_gettime): should not overwrite cache variable
+ with different condition. otherwise -lrt is not linked and the link
+ fails, after reconfig.
+
+Mon Aug 19 12:56:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (Init_process): Add constants: CLOCK_REALTIME_ALARM and
+ CLOCK_BOOTTIME_ALARM.
+
+Sun Aug 18 20:17:41 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * variable.c, vm_method.c: remove dead code.
+
+ * test/ruby/test_fiber.rb, test/ruby/test_thread.rb:
+ change accordingly.
+
+Sun Aug 18 19:32:26 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * error.c, file.c, gc.c, hash.c, thread.c, variable.c, vm_eval.c, bin/erb:
+ $SAFE=4 is obsolete.
+
+Sun Aug 18 14:30:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): Rename POSIX_TIME_CLOCK_REALTIME to
+ ISO_C_TIME_CLOCK_REALTIME.
+
+Sun Aug 18 14:22:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Revert r42604. It causes linking librt on systems
+ with newer glibc uselessly.
+
+Sun Aug 18 13:18:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (Init_process): Add constants: CLOCK_REALTIME_COARSE,
+ CLOCK_MONOTONIC_COARSE and CLOCK_BOOTTIME.
+
+Sun Aug 18 12:41:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (clock_gettime): need to check with -lrt prior to check
+ for the function only. otherwise -lrt is not linked and the link
+ fails, when ac_cv_func_clock_gettime is cached as yes.
+
+Sun Aug 18 10:05:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2str1): Make an expression more explicit.
+
+Sun Aug 18 03:18:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2str1): Use power_level instead of bitsize(xn).
+
+Sun Aug 18 00:44:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BIGDIVREM_EXTRA_WORDS): Redefine to 1.
+ (bigdivrem_num_extra_words): Removed.
+ (bigdivrem_normal): Simplified.
+ (big2str_karatsuba): Ditto.
+
+Sat Aug 17 23:25:19 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * test/ruby/test_time.rb: use the in_timezone() helper
+ and define it at the top with other helpers.
+
+Sat Aug 17 22:20:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * time.c (time_mload): ignore auxiliary data, offset and zone, if
+ invalid. [ruby-core:56648] [Bug #8795]
+
+Sat Aug 17 20:11:49 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * process.c: [DOC] MACH_ABSOLUTE_TIME_CLOCK_MONOTONIC is an
+ available emulation for a monotonic clock on Darwin.
+ https://developer.apple.com/library/mac/qa/qa1398/_index.html
+
+Fri Aug 16 18:12:05 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/profile_test_all.rb: fix typo.
+
+Fri Aug 16 18:09:20 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/profile_test_all.rb: remove space characters from test names.
+
+Fri Aug 16 17:32:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/profile_test_all.rb: refactoring memory profiling tool for
+ test-all.
+ Add profiling targets /proc/meminfo and /proc/self/status.
+
+ * test/runner.rb: accept other than 'true'.
+
+Fri Aug 16 11:23:35 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * file.c (rb_file_size, rb_file_flock): improve performance of Windows.
+
+ * file.c (rb_file_truncate): removed unnecessary #ifdef.
+
+ * test/test_file.rb (TestFile#test_truncate_size): added an assertion
+ for File#size.
+
+Fri Aug 16 10:07:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_single1): Renamed from bigdivrem_single. Add
+ x_higher_bdigit argument.
+ (bigdivrem_single): Just call bigdivrem_single1.
+ (bigdivrem_restoring): Use bigdivrem_single1 to avoid memmove.
+
+Fri Aug 16 09:17:00 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_small_rshift): Specify the higher BDIGIT instead of
+ sign bit.
+ (big_shift3): Follow the above change.
+
+Fri Aug 16 02:20:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_toom3): Reduce a branch.
+
+Fri Aug 16 02:14:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c (rb_clock_gettime): add CLOCK_MONOTONIC support on OS X.
+ http://developer.apple.com/library/mac/qa/qa1398/_index.html
+ [Feature #8658]
+
+Fri Aug 16 01:37:43 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_single): Use shift when y is a power of two.
+
+Fri Aug 16 01:09:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_restoring): Use bigdivrem_single if non-topmost
+ BDIGITs of y are zero.
+
+Fri Aug 16 00:33:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2str1): Truncate topmost zeros of x.
+
+Fri Aug 16 00:00:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_divmod): Simplify an expression.
+
+Thu Aug 15 23:26:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_normal): Remove a local variable.
+
+Thu Aug 15 23:08:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_karatsuba): Use bigdivrem_restoring directly to
+ reduce working buffer and memory copy.
+ (rb_big2str1): Allocate working buffer for big2str_karatsuba here.
+
+Thu Aug 15 20:51:29 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c, internal.h (rb_io_flush_raw): new function to select calling
+ fsync() (on Windows).
+
+ * io.c (rb_io_flush_raw): use above function.
+
+ * file.c (rb_file_truncate): use above function.
+
+ * test/ruby/test_file.rb (TestFile#test_truncate_size): test for
+ above changes.
+
+Thu Aug 15 18:39:31 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (clock_gettime): improve precision when freq is less
+ than and nearly equals 10**9.
+
+Thu Aug 15 17:43:15 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_lazy_sweep): remove heap_increment() here because heap_inc
+ may be 0.
+
+Thu Aug 15 16:59:56 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_io_rewind): remove fsync() for Windows to improve the
+ performance.
+
+Thu Aug 15 16:30:23 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/fileutils/test_fileutils.rb (TestFileUtils#test_rmdir):
+ FileUtils.rmdir ignores Errno::ENOTEMPTY, so, in such cases, this
+ assertion is nonsense.
+
+Thu Aug 15 15:49:35 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): [DOC] FreeBSD 7.1 supports
+ CLOCK_THREAD_CPUTIME_ID.
+ http://www.freebsd.org/releases/7.1R/relnotes.html
+
+Thu Aug 15 14:30:23 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/win32.h, win32/Makefile.sub, win32/win32.c
+ (clock_gettime): [experimental] emulates clock_gettime(2) of posix.
+
+Thu Aug 15 02:32:40 2013 Zachary Scott <e@zzak.io>
+
+ * hash.c (rb_hash_aset): [DOC] Document key dup patch by @kachick
+ [Fixes GH-382] https://github.com/ruby/ruby/pull/382
+
+Wed Aug 14 14:28:39 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * proc.c (rb_mod_define_method): now they return the symbols of the
+ defined methods, not the methods/procs themselves.
+ [ruby-dev:42151] [Feature #3753]
+
+ * NEWS: documents about above change and def-expr (see r42337).
+
+ * test/ruby/test_module.rb: tests about above change.
+
+Wed Aug 14 00:51:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_restoring): xn argument removed.
+ (bigdivrem_normal): Follow the above change.
+
+Wed Aug 14 00:18:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_div_struct): Remove xn and j field. Add zn field.
+ (bigdivrem1): Follow the above change.
+ (bigdivrem_restoring): Ditto.
+
+Tue Aug 13 23:38:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_div_struct): ynzero field removed.
+ (bigdivrem1): Follow the above change.
+ (bigdivrem_restoring): Ditto.
+
+Tue Aug 13 23:01:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_restoring): Extracted from bigdivrem_normal.
+
+Tue Aug 13 22:12:59 2013 Kenichi Kamiya <kachick1@gmail.com>
+
+ * random.c (rb_random_ulong_limited): coerce before check negative.
+ [Fixes GH-379]
+
+Tue Aug 13 21:52:15 2013 Kenichi Kamiya <kachick1@gmail.com>
+
+ * object.c (Init_Object): undef Module#prepend_features on Class, as
+ well as Module#append_features. [Fixes GH-376]
+
+ * test_class.rb: Added test for above. And ensure type checking
+ on similar methods as module_function.
+
+Tue Aug 13 08:52:18 2013 Zachary Scott <e@zzak.io>
+
+ * doc/syntax/literals.rdoc: [DOC] String literal concat by @cknadler
+ [Fixes GH-380] https://github.com/ruby/ruby/pull/380
+
+Mon Aug 12 23:07:21 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_marks_test): inhibit gc for st's operation.
+
+Mon Aug 12 15:59:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_whole_match_p): treat CR in middle of a line as a
+ mere whitespace.
+
+Mon Aug 12 15:16:58 2013 Koichi Sasada <ko1@atdot.net>
+
+ * class.c (rb_prepend_module): make T_ICLASS object shady because
+ this T_ICLASS object seems to share method table with other class
+ objects. It was causes WB miss.
+ TODO: need to know the data structure.
+
+ * test/ruby/test_module.rb: add a test for WB miss.
+
+Mon Aug 12 13:47:54 2013 Zachary Scott <e@zzak.io>
+
+ * process.c: [DOC] RDoc formatting of Process.clock_gettime
+
+Mon Aug 12 13:29:09 2013 Zachary Scott <e@zzak.io>
+
+ * lib/yaml/dbm.rb: [DOC] Document call-seq for YAML::DBM
+
+Mon Aug 12 12:57:26 2013 Zachary Scott <e@zzak.io>
+
+ * ext/dbm/extconf.rb: [DOC] Hide from RDoc
+ Some libraries might want to document extconf.rb so RDoc treats it
+ like any other ruby program. However, DBM users shouldn't care about
+ these methods.
+
+Mon Aug 12 12:53:39 2013 Zachary Scott <e@zzak.io>
+
+ * ext/dbm/dbm.c: [DOC] Reformat headings of DBM class
+
+Mon Aug 12 12:46:31 2013 Zachary Scott <e@zzak.io>
+
+ * lib/yaml.rb, lib/yaml/: [DOC] Document YAML::DBM#key and add
+ references to similar methods with more detail. This patch brings
+ lib/yaml to 100% documentation coverage.
+
+Mon Aug 12 02:51:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_s_set_input): on OS X with editline,
+ Readline.readline doesn't work because readline_get doesn't use
+ rl_getc. The difference is introduced by r42402 [ruby-dev:47509]
+ [Bug #8644]. Before it rb_io_stdio_file set ifp->stdio_file.
+ Therefore add manually setting the value.
+
+ * ext/readline/readline.c (readline_s_set_output): ditto.
+
+Sun Aug 11 23:27:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_str_encode_ospath): OS path encoding on Mac OS X is also
+ fixed.
+
+Sun Aug 11 22:57:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_require.rb (assert_require_nonascii_path): OS path
+ encoding on Windows is fixed, so encoding of __FILE__ should be it.
+ [ruby-core:56498] [Bug #8764]
+
+Sun Aug 11 19:11:45 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/parser/test_sax2.rb: Expand abbreviated class name.
+
+Sun Aug 11 19:06:03 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/sax2listener.rb (REXML::SAX2Listener#notationdecl): Fix
+ wrong number of arguments in the template listener.
+ [Bug #8731] [ruby-dev:47582]
+ Reported by Ippei Obayashi.
+ * test/rexml/parser/test_sax2.rb: Add tests for parsing notation
+ declarations with SAX2 API.
+
+Sun Aug 11 18:44:04 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/sax2listener.rb (REXML::SAX2Listener#elementdecl): Fix wrong
+ examples. [Bug #8731] [ruby-dev:47582]
+ Reported by Ippei Obayashi.
+
+Sun Aug 11 18:42:13 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/sax2parser.rb
+ (REXML::Parsers::SAX2Parser#handle_entitydecl): Extract.
+
+Sun Aug 11 18:40:25 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):
+ Fix wrong "%" position in parameter entity declaration event argument.
+ * test/rexml/parser/test_sax2.rb: Add tests for the above case.
+
+Sun Aug 11 18:08:40 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):
+ Support NDATA in external ID entity declaration.
+ * test/rexml/parser/test_sax2.rb: Add tests for the above case.
+
+Sun Aug 11 18:07:39 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb
+ (REXML::Parsers::BaseParser#pull_event): Support optional NDATA
+ in external ID entity declaration.
+
+Sun Aug 11 17:54:07 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * NEWS (REXML::Parsers::SAX2Parser): Add about this change.
+ * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):
+ Fix wrong number of arguments. Document says "an array of the
+ entity declaration" but it passes two or more arguments.
+ This is a bug but it break backward compatibility.
+ Reported by Ippei Obayashi. [Bug #8731] [ruby-dev:47582]
+ * lib/rexml/sax2listener.rb (REXML::SAX2Listener#entitydecl): ditto.
+ The listener template accepted two arguments.
+ * test/rexml/parser/test_sax2.rb: Add tests for external ID case.
+
+Sun Aug 11 17:41:41 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/parser/test_sax2.rb: Add SAX2 API test.
+
+Sun Aug 11 15:10:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_enc_symname_type): allow ID_ATTRSET for ID_INSTANCE,
+ ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756]
+
+Sun Aug 11 13:17:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * include/ruby/encoding.h: Reduce ENCODING_INLINE_MAX to 127 as this
+ should be sufficient to represent all the encodings Ruby supports.
+
+Sun Aug 11 11:54:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_clock_gettime): New method.
+ This is accepted in the meeting:
+ https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130809
+ This method is accepted as a CRuby feature.
+ I.e. Other Ruby implementations don't need to implement it.
+ [ruby-core:56087] [Feature #8658]
+
+Sun Aug 11 10:40:48 2013 Zachary Scott <e@zzak.io>
+
+ * lib/time.rb: [DOC] Correcting rdoc visibility of time.rb constants
+ Reported by Tanaka Akira [ruby-core:56517]
+
+Sun Aug 11 04:48:14 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (rb_str_normalize_ospath):
+ HFS Plus (Mac OS Extended) uses a variant of Normal Form D in which
+ U+2000 through U+2FFF, U+F900 through U+FAFF, and U+2F800 through
+ U+2FAFF are not decomposed (this avoids problems with round trip
+ conversions from old Mac text encodings).
+ http://developer.apple.com/library/mac/qa/qa1173/_index.html
+ Therefore fix r42457 to exclude the range.
+
+Sun Aug 11 03:26:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bitsize): Fix a conditional expression.
+
+Sun Aug 11 02:44:03 2013 Zachary Scott <e@zzak.io>
+
+ * lib/time.rb: [DOC] Document constants by @markijbema [Fixes GH-377]
+ https://github.com/ruby/ruby/pull/377
+
+Sun Aug 11 01:28:52 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Revert r42458.
+ It removes the HAVE_CLOCK_GETTIME from config.h.
+ http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20130809T044800Z.diff.html.gz
+
+Sat Aug 10 13:53:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_id_attrset): allow other than ID_ATTRSET.
+
+ * parse.y (intern_str): ditto. try stem ID for ID_INSTANCE,
+ ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756]
+
+Sat Aug 10 12:49:50 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb
+ (REXML::Parsers::BaseParser::CDATA_END): Use "\A" instead of "^".
+ It is not an used constant but I fix it. (Or should I remove it?)
+
+Sat Aug 10 12:47:19 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):
+ Fix wrong constant name. "]>" pattern match is the same but
+ it is used for "<!DOCTYPE" end mark not "<![CDATA[" end mark.
+
+Sat Aug 10 12:43:15 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):
+ Use "\A" instead of "^" in document type declaration patterns
+ because they are used as the head match in content not the head
+ match in line. They don't cause any problems in the current code
+ but it should be fixed.
+
+Sat Aug 10 12:39:00 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/parse/test_document_type_declaration.rb: Add tests for
+ parsing document type declaration.
+
+Sat Aug 10 12:00:45 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::SYSTEM):
+ Fix loose "head" match regular expression. It doesn't cause any
+ problem in the current code but it should be fixed because readers
+ may confuse it.
+ Patch by Ippei Obayashi. Thanks!!!
+
+Sat Aug 10 11:58:24 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/parse/test_notation_declaration.rb (#test_system_public):
+ Add a test for PUBLIC notation and SYSTEM notation order case.
+
+Sat Aug 10 11:31:35 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::PUBLIC):
+ Fix loose "head" match regular expression.
+ [Bug #8701] [ruby-dev:47551]
+ Patch by Ippei Obayashi. Thanks!!!
+ * test/rexml/parse/test_notation_declaration.rb (#test_system_public):
+ Add a test for the above case.
+
+Sat Aug 10 09:20:21 2013 Zachary Scott <e@zzak.io>
+
+ * NEWS: [DOC] typo in example reported by @moretea
+ https://github.com/ruby/ruby/commit/a39e724#commitcomment-3831489
+
+Sat Aug 10 09:19:04 2013 Zachary Scott <e@zzak.io>
+
+ * proc.c: [DOC] rdoc code formatting
+
+Sat Aug 10 09:12:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_id_attrset): check if the argument is valid type as an
+ attribute.
+
+Sat Aug 10 05:44:08 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/trackback.rb: [DOC] Hide RSS::Trackback from rdoc
+ Patch by Steve Klabnik [Bug #8755] [ruby-core:56456]
+
+Sat Aug 10 04:52:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_div_struct): Use size_t.
+ (bigdivrem1): Ditto.
+ (bigdivrem_num_extra_words): Ditto.
+ (bigdivrem_single): Ditto.
+ (bigdivrem_normal): Ditto.
+ (bary_divmod): Ditto.
+
+Fri Aug 9 23:47:15 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rss/rexmlparser.rb: Remove needless REXML version check.
+ Both RSS Parser and REXML are bundled in Ruby. RSS Parser can
+ always use the latest REXML. [Bug #8754] [ruby-core:56454]
+ Patch by Steve Klabnik. Thanks!!!
+
+Fri Aug 9 22:51:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (XLDFLAGS, LIBRUBYARG_STATIC): CoreFoundation framework
+ option is now needed always, regardless enable-shared.
+ [ruby-core:56467] [Bug #8759]
+
+Fri Aug 9 22:20:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (load_file_internal): use rb_parser_compile_string_path and
+ rb_parser_compile_file_path, String path name versions. [Bug #8753]
+
+Fri Aug 9 07:16:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/io/console/console.c: delete redefinition of rb_cloexec_open.
+ drop support for 1.8 and 1.9 from the next release of io-console gem.
+
+Fri Aug 9 19:13:54 2013 Koichi Sasada <ko1@atdot.net>
+
+ * NEWS: update about new methods for Binding.
+
+Fri Aug 9 18:48:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * proc.c: add Binding#local_variable_get/set/defined?
+ to access local variables which a binding contains.
+ Most part of implementation by nobu.
+
+ * test/ruby/test_proc.rb: add a tests for above.
+
+ * vm.c, vm_core.h (rb_binding_add_dynavars): add a new function
+ to add a new environment to create space for new local variables.
+
+Fri Aug 9 14:02:01 2013 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * tool/make-snapshot: Fix order of priority for option parameter.
+
+Fri Aug 9 12:06:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_str_normalize_ospath): normalize to Normalization Form C
+ using CFString.
+
+Fri Aug 9 10:53:57 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * time.c (get_timeval, get_new_timeval): use rb_obj_class()
+ instead of CLASS_OF() because CLASS_OF() may return
+ a singleton class.
+
+Fri Aug 9 10:42:11 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm_insnhelper.c (vm_invoke_block): returning from lambda proc
+ now always exits from the Proc. [ruby-core:56193] [Feature #8693]
+
+ * NEWS, test/ruby/test_lambda.rb: ditto. Patch by nobu.
+
+Fri Aug 9 00:10:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (lazy_zip_func): fix non-single argument. fix
+ out-of-bound access and pack multiple yielded values.
+ [ruby-core:56383] [Bug #8735]
+
+Thu Aug 8 23:01:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_mod_singleton_p): new method Module#singleton_class? to
+ return whether the receiver is a singleton class or not.
+ [ruby-core:51087] [Feature #7609]
+
+Thu Aug 8 21:56:44 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (time_overflow_p): Avoid signed integer overflow.
+ (rb_time_new): Fix overflow condition.
+
+Thu Aug 8 19:58:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_threadptr_pending_interrupt_check_mask):
+ use RARRAY_RAWPTR() instead of RARRAY_PTR() because
+ there is no new reference.
+
+Thu Aug 8 19:56:52 2013 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (rb_str_format_m): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR() because there is no new reference.
+
+Thu Aug 8 19:55:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: define USE_RGENGC_LOGGING_WB_UNPROTECT.
+
+Thu Aug 8 16:44:25 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: add old macro name `RUBY_EVENT_SWITCH'.
+ This macro name is obsolete because it is renamed to
+ RUBY_INTERNAL_EVENT_SWITCH, but it has compatibility problem
+ using this macro name like ruby-prof.
+ I want to remove this macro after ruby 2.1.
+
+Thu Aug 8 15:37:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/coverage/test_coverage.rb (TestCoverage#test_big_code): use `1'
+ instead of `p' to get rid of a side effect.
+ Kernel#p without any argument seems to do nothing, but flushes stdout.
+ and, if stdout is redirected to file, fsync() will be called on
+ Windows. so, when running test-all on Windows with redirection, such
+ as CI environment, this test took a lot of time.
+
+Thu Aug 8 14:54:18 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * NEWS: add description of incompatibility introduced by r42396.
+ [ruby-core:56329] [Bug #8722]
+
+Thu Aug 8 14:50:36 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (mini): portable target to build miniruby
+
+ * common.mk (bisect): run git-bisect with miniruby
+
+ * common.mk (bisect-ruby): run git-bisect with ruby
+
+ * tool/bisect.sh: script for git-bisect
+
+Thu Aug 8 12:11:43 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/webrick/test_httpresponse.rb (test_send_body_*_chunked): these
+ expectations assumes that the IOs are binmode. fixed test failures
+ introduced at r42427 on Windows.
+
+Thu Aug 8 10:27:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * range.c (range_last): revert r42400. [Bug #8739]
+
+Thu Aug 8 10:26:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_str_normalize_ospath): extract and move from dir.c.
+
+Thu Aug 8 05:59:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * test/openssl/test_ssl.rb: Fix test for CVE-2013-4073.
+ Patch by Antonio Terceiro. [Bug #8750] [ruby-core:56437]
+
+Thu Aug 8 03:37:38 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/httpresponse.rb: Allow #body to be an IO-like object
+ that responds to #readpartial and #read.
+ [ruby-trunk - Feature #8155]
+ * NEWS: NEWS for above
+ * test/webrick/test_httpresponse.rb: Tests for above.
+
+Wed Aug 7 23:06:26 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * ruby.c (Process.argv0): New method to return the original value
+ of $0. [Feature #8696]
+
+Wed Aug 7 23:05:55 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * ruby.c (Process.setproctitle): New method to change the title of
+ the running process that is shown in ps(1). [Feature #8696]
+
+Wed Aug 7 20:05:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_odd_p): Check the bignum length.
+ (rb_big_even_p): Ditto.
+
+Wed Aug 7 19:29:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (dbl2big): A condition simplified.
+
+Wed Aug 7 16:34:30 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#{start_cgi_server,test_cgi}):
+ mswin is not only mswin32 but also mswin64. [Bug #8746]
+
+Wed Aug 7 16:19:12 2013 Koichi Sasada <ko1@atdot.net>
+
+ * cont.c (rb_fiber_start): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR() because there is no new reference.
+
+ * proc.c (curry): ditto.
+
+ * proc.c (rb_proc_call): remove line break.
+
+Wed Aug 7 13:20:12 2013 Koichi Sasada <ko1@atdot.net>
+
+ * random.c (random_load): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR() because there is no new reference.
+
+Wed Aug 7 12:58:23 2013 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (thread_start_func_2): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR() because there is no new reference.
+
+Wed Aug 7 09:00:24 2013 Zachary Scott <e@zzak.io>
+
+ * string.c: [DOC] Description of rb_str_equal [Fixes GH-375]
+ Based on a patch by @markijbema
+ https://github.com/ruby/ruby/pull/375
+
+Wed Aug 7 08:30:38 2013 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_hmac.c: [DOC] Documentation for OpenSSL::HMAC
+ based on a patch by @repah documenting-ruby/ruby#14
+ https://github.com/documenting-ruby/ruby/pull/14
+
+Wed Aug 7 07:46:23 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/utils.rb: [DOC] RSS::Utils by Steve Klabnik [Bug #8745]
+
+Wed Aug 7 07:38:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (nlz16): Removed.
+ (nlz32): Ditto.
+ (nlz64): Ditto.
+ (nlz128): Ditto.
+ (nlz_int): New function.
+ (nlz_long): New function.
+ (nlz_long_long): New function.
+ (nlz_int128): New function.
+ (nlz): Follow above changes.
+ (bitsize): Follow above changes.
+
+Tue Aug 6 22:38:15 2013 Zachary Scott <e@zzak.io>
+
+ * time.c: [DOC] Typo in Time overview by @sparr [Fixes GH-374]
+ https://github.com/ruby/ruby/pull/374
+
+Tue Aug 6 22:35:32 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/1.0.rb: [DOC] Document RSS10 by Steve Klabnik [Bug #8740]
+
+Tue Aug 6 22:14:11 2013 Kouji Takao <kouji.takao@gmail.com>
+
+ * ext/readline/readline.c (readline_s_delete_text): remove
+ checking "$SAFE == 4".
+
+ * ext/readline/readline.c: fix rdoc, remove "Raises SecurityError"
+ and add "Raises NotImplementedError".
+
+Tue Aug 6 22:04:38 2013 Kouji Takao <kouji.takao@gmail.com>
+
+ * ext/readline/readline.c, test/readline/test_readline.rb: fix
+ indent.
+
+Tue Aug 6 21:59:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * range.c (range_last): return nil for empty range, or in the case the
+ predecessor is smaller than the begin. [Bug #8739]
+
+Tue Aug 6 21:48:31 2013 Kouji Takao <kouji.takao@gmail.com>
+
+ * ext/readline/readline.c (readline_s_set_point, Init_readline):
+ add Readline.point=(pos). Patched by naruse. [ruby-dev:47535]
+ [Feature #8675]
+
+Tue Aug 6 21:14:11 2013 Kouji Takao <kouji.takao@gmail.com>
+
+ * ext/readline/readline.c (Init_readline, readline_s_set_output)
+ (clear_rl_outstream, readline_s_set_input, clear_rl_instream)
+ (readline_readline): fix causing SEGV if closed IO object that is
+ set Readline.input or Readline.output. Patched by akr
+ [ruby-dev:47509] [Bug #8644]
+
+Tue Aug 6 17:56:40 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_push_frame): change type of stack_max to size_t.
+
+Tue Aug 6 17:42:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * range.c (range_last): exclude the last number of the exclusive range
+ if the end is Numeric. [ruby-dev:47587] [Bug #8739]
+
+Tue Aug 6 17:42:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_conv_from_wchar): converted string to CP_UTF8
+ should have UTF-8 encoding. otherwise no conversion takes place
+ later.
+
+Tue Aug 6 17:21:38 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_push_frame): fix stack overflow check codes.
+ Stack overflow check should be done *after* pushing a stack frame.
+ However, some stack overflow checking codes checked *before*
+ pushing a stack frame with iseq->stack_max.
+ To solve this problem, add a new parameter `stack_max' to specify
+ a possible consuming stack size.
+
+ * vm_core.h (CHECK_VM_STACK_OVERFLOW0): add to share the stack overflow
+ checking code.
+
+ * insns.def: catch up this change.
+
+ * vm.c, vm_eval.c: ditto.
+
+ * test/ruby/test_exception.rb: add a stack overflow test.
+ This code is reported by nobu.
+
+Tue Aug 6 17:02:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_conv_from_wchar): use WideCharToMultiByte(),
+ as like as mbstr_to_wstr(), in the first step of the conversion from
+ WCHAR.
+
+Tue Aug 6 16:14:32 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_eval.c (eval_string_with_cref): copy cref to limit the scope of
+ refinements in the eval string. [ruby-core:56329] [Bug #8722]
+
+ * test/ruby/test_refinement.rb: related test.
+
+Tue Aug 6 12:23:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_realloc): Use VALGRIND_MAKE_MEM_UNDEFINED to
+ declare undefined memory area.
+ (bignew_1): Ditto.
+
+ * internal.h (VALGRIND_MAKE_MEM_DEFINED): Moved from gc.c
+ (VALGRIND_MAKE_MEM_UNDEFINED): Ditto.
+
+Tue Aug 6 01:40:37 2013 Zachary Scott <e@zzak.io>
+
+ * process.c: [DOC] Document caveats of command form of Process.spawn
+ with regard to the shell and OS. Patched by Steve Klabnik [Bug #8550]
+
+Tue Aug 6 01:28:35 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/0.9.rb: [DOC] Typo in example [Bug #8732]
+
+Tue Aug 6 01:22:37 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/2.0.rb: [DOC] Document RSS::Rss by Steve Klabnik #8740
+ * lib/rss/atom.rb: [DOC] Typo in rdoc by Steve Klabnik
+
+Mon Aug 5 23:47:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Rename local variables.
+
+Mon Aug 5 22:23:59 2013 Zachary Scott <e@zzak.io>
+
+ * vm_trace.c: [DOC] Fix TracePoint return values in examples
+ Based on a patch by @sho-h [Fixes GH-373]
+ https://github.com/ruby/ruby/pull/373
+
+Mon Aug 5 17:38:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_write_console): use MultiByteToWideChar() for
+ the last step of conversion to WCHAR, to get rid of warnings from
+ rb_enc_find() in miniruby. [ruby-dev:47584] [Bug #8733]
+
+ * win32/win32.c (wstr_to_mbstr, mbstr_to_wstr): fix wrong trimming.
+ WideCharToMultiByte() and MultiByteToWideChar() do not count
+ NUL-terminator in the size for conversion result, unless the input
+ length is -1.
+
+Mon Aug 5 11:51:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * include/ruby/encoding.h: document which user flags are used by
+ ENCODING_MASK for better greppability
+
+Mon Aug 5 10:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * object.c (rb_class_inherited_p): allow iclasses to be tested for
+ inheritance. [Bug #8686] [ruby-core:56174]
+
+ * test/ruby/test_method.rb: add test
+
+Mon Aug 5 06:13:48 2013 Zachary Scott <e@zzak.io>
+
+ * enumerator.c: [DOC] Remove reference to Enumerator::Lazy#cycle
+ Patch by @kachick [Fixes GH-372]
+ https://github.com/ruby/ruby/pull/372
+
+Mon Aug 5 03:57:16 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rss/0.9.rb: [DOC] Document RSS09 by Steve Klabnik [Bug #8732]
+
+Mon Aug 5 03:35:11 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rexml/attribute.rb: [DOC] Update example for #namespace
+ Patch by Ippei Obayashi [Bug #8685] [ruby-core:56173]
+
+Sun Aug 4 21:08:29 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_zip): performance implement by using
+ ALLOCA_N() to allocate tmp buffer.
+
+Sun Aug 4 07:14:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * README.EXT, README.EXT.ja: Mention rb_integer_pack and
+ rb_integer_unpack.
+
+Sun Aug 4 01:54:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BARY_TRUNC): New macro.
+ (bary_cmp): Use BARY_TRUNC.
+ (bary_mul_toom3): Ditto.
+ (bary_divmod): Ditto.
+ (abs2twocomp): Ditto.
+ (bigfixize): Ditto.
+ (rb_cstr_to_inum): Ditto.
+ (big2str_karatsuba): Ditto.
+ (bigdivrem): Ditto.
+
+Sun Aug 4 00:57:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_karatsuba): Don't allocate new temporary buffer
+ if the buffer is enough for current invocation.
+
+Sun Aug 4 00:22:34 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary2bdigitdbl): New function.
+ (bdigitdbl2bary): Ditto.
+ (bary_mul_single): Use bdigitdbl2bary.
+ (power_cache_get_power): Ditto.
+ (bary_divmod): Use bary2bdigitdbl.
+ (big2str_orig): Ditto.
+ (bigdivrem): Ditto.
+
+Sat Aug 3 22:47:11 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: The branch condition of selecting multiplication
+ algorithms should check smaller argument because Karatsuba and Toom3
+ is effective only if both arguments are big.
+ (bary_mul_toom3_branch): Compare the smaller argument to
+ TOOM3_MUL_DIGITS.
+ (bary_mul): Compare the smaller argument to KARATSUBA_MUL_DIGITS.
+
+Sat Aug 3 22:23:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_orig): Receive the number to stringize as
+ BDIGIT array and size.
+ (big2str_karatsuba): Receive the number to stringize as BDIGIT array
+ and size. Use an temporary array of BDIGIT.
+ (rb_big2str1): Follow the above change.
+
+Sat Aug 3 13:30:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (MAX_BASE36_POWER_TABLE_ENTRIES): Renamed from
+ MAX_BIG2STR_TABLE_ENTRIES.
+ (base36_power_cache): Renamed from big2str_power_cache.
+ (base36_numdigits_cache): Renamed from big2str_numdigits_cache.
+
+Sat Aug 3 10:33:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_set_integer_literal): use rb_rational_raw1() for
+ integral rational because no reduction is needed with 1.
+
+Sat Aug 3 09:46:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/etc/etc.c (setup_passwd, setup_group): set proper encodings to
+ string members.
+
+Sat Aug 3 09:30:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (rb_struct_define_under): new function to define Struct
+ under the given namespace, not under Struct. [Feature #8264]
+
+ * ext/etc/etc.c: use rb_struct_define_under.
+
+Sat Aug 3 06:55:29 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * parse.y (value_expr_gen): now NODE_DEFN and NODE_DEFS are not void
+ value expressions. get rid of wrong warning with -w, and make to
+ pass tests with chkbuild. ref. [Feature #3753]
+
+Sat Aug 3 04:23:48 2013 Eric Hodel <drbrain@segment7.net>
+
+ * doc/syntax/refinements.rdoc: Remove mention of instance_eval and
+ module_eval from scope section per:
+ http://twitter.com/shugomaeda/status/363219951336693761
+
+Sat Aug 3 02:22:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_orig): Refactored.
+
+Sat Aug 3 01:20:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigadd_core): Removed.
+ (bigadd): Use bary_add instead of bigadd_core.
+
+Sat Aug 3 00:52:43 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2str1): Simplify power_level calculation.
+
+Sat Aug 3 00:34:20 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_zip): use rb_ary_new2() to create buffer
+ if rb_block_arity() > 1.
+
+Sat Aug 3 00:12:00 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * NEWS: Add the description that IO#seek supports SEEK_DATA
+ and SEEK_HOLE.
+
+Fri Aug 2 23:57:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm.c (m_core_define_method, m_core_define_singleton_method): now
+ the value of def-expr is the Symbol of the name of the method, not
+ nil.
+ ref. [ruby-dev:42151] [Feature #3753]
+
+ * test/ruby/test_syntax.rb (TestSyntax#test_value_of_def): test for
+ above changes.
+
+Fri Aug 2 23:54:11 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_zip): performance improvement by avoiding
+ array creation if rb_block_arity() > 1.
+
+Fri Aug 2 23:50:53 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (power_cache_get_power): Apply bigtrunc to the result of
+ bigsq.
+ (big2str_karatsuba): Fix number of leading zero characters.
+
+Fri Aug 2 23:48:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): calculate denominator directly as powers of
+ ten, not parsing string.
+
+ * parse.y (parser_number_literal_suffix): return bit set of found
+ suffixes.
+
+ * parse.y (parser_set_number_literal, parser_set_integer_literal):
+ split from parser_number_literal_suffix to set yylval.
+
+ * parse.y (parser_yylex): parse rational number literal with decimal
+ point precisely.
+
+ * parse.y (simple_numeric): integrate numeric literals and simplify
+ numeric rules.
+
+ * ext/ripper/eventids2.c (ripper_init_eventids2): ripper support for
+ new literals, tRATIONAL and tIMAGINARY.
+
+Fri Aug 2 18:33:28 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_karatsuba): Reduce power_level more than one at
+ recursion, if possible.
+ (rb_big2str1): Follow the above change.
+
+Fri Aug 2 12:25:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul): Swap x and y for bary_mul1 if x is longer than y.
+ [ruby-dev:47565] [Bug #8719] Reported by Narihiro Nakamura.
+
+Fri Aug 2 10:39:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * parse.y (negate_lit): add T_RATIONAL and T_COMPLEX to the switch
+ statement, and call rb_bug() if an unknown type is passed to
+ negate_lit(). [ruby-core:56316] [Bug #8717]
+
+ * bootstraptest/test_literal_suffix.rb (assert_equal): add test
+
+Fri Aug 2 09:14:47 2013 Eric Hodel <drbrain@segment7.net>
+
+ * doc/syntax/refinements.rdoc: Improve description of where you may
+ activate refinements.
+
+Fri Aug 2 07:45:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_orig): Remove len argument.
+ (big2str_karatsuba): Ditto.
+ (rb_big2str1): Follow above change.
+
+Thu Aug 2 02:32:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * NEWS: Add the description of number literal suffixes.
+
+Thu Aug 2 00:02:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * bootstraptest/test_literal_suffix.rb: add two test cases to
+ examine that "1if true" and "1rescue nil" are recognized as 1.
+
+Thu Aug 1 23:45:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * rational.c (rb_flt_rationalize_with_prec): new public C function
+ to rationalize a Float instance with a precision.
+
+ * rational.c (rb_flt_rationalize): new public C function to
+ rationalize a Float instance. A precision is calculated from
+ the given float number.
+
+ * include/ruby/intern.h: Add rb_flt_rationalize_with_prec and
+ rb_flt_rationalize.
+
+ * parse.y: implement number literal suffixes, 'r' and 'i'.
+ [ruby-core:55096] [Feature #8430]
+
+ * bootstraptest/test_literal_suffix.rb: add tests for parser to scan
+ number literals with the above tsuffixes.
+
+Thu Aug 1 23:55:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2str1): Remove a local variable.
+
+Thu Aug 1 23:33:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_cstr_to_inum): Use power_cache_get_power.
+
+Thu Aug 1 21:02:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2str1): Raise an error for too big number.
+
+Thu Aug 1 20:46:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (power_cache_get_power): Hide cached Bignum objects.
+
+Thu Aug 1 19:15:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2str1): Remove non-trim mode.
+ (rb_big2str0): Non-trim mode implemented here.
+ (big2str_find_n1): Change the result type to long again.
+ (big2str_base_powerof2): Don't take arguments: len and trim.
+ (rb_big2str): Follow above change.
+
+Thu Aug 1 12:37:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_alloc): New function to allocate the result string.
+ It is called after actual length is calculated.
+ (big2str_struct): Add fields: negative, result and ptr.
+ (big2str_orig): Write out the result via b2s->ptr.
+ (big2str_orig): Ditto.
+ (rb_big2str1): Don't allocate the result string at beginning.
+
+Thu Aug 1 07:36:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_orig): Use temporary buffer when trim mode.
+
+Thu Aug 1 06:28:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_orig): Simplified because RBIGNUM_LEN(x) <= 2 now.
+ (big2str_struct): Two fields added: hbase2, hbase2_numdigits.
+ (rb_big2str1): Initialize above fields.
+
+Thu Aug 1 04:06:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/options.rb (RDoc#finish): include root path in include
+ paths, to work in another directory than the source directory.
+ [ruby-core:56282] [Bug #8712]
+
+ * test/test_rdoc_markup_pre_process.rb (TestRDocMarkupPreProcess#setup):
+ fix input_file_name, as the test script is not pre-processed.
+
+Thu Aug 1 01:45:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_karatsuba): Fix a condition of power_level.
+
+Thu Aug 1 01:09:02 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (LOG2_KARATSUBA_BIG2STR_DIGITS): Removed.
+ (KARATSUBA_BIG2STR_DIGITS): Removed.
+ (big2str_numdigits_cache): New variable.
+ (power_cache_get_power): Merged with power_cache_get_power0.
+ This function returns maxpow_in_bdigit_dbl(base)**(2**power_level).
+ (rb_big2str1): use power_cache_get_power.
+
+Wed Jul 31 23:59:28 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_find_n1): Change the return type to size_t.
+ (big2str_orig): Ditto.
+ (big2str_karatsuba): Ditto.
+ (rb_big2str1): Follow the above changes.
+
+Wed Jul 31 23:19:06 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (power_cache_get_power): Change numdigits_ret to size_t *.
+ (big2str_orig): Change len argument to size_t.
+ (big2str_karatsuba): Ditto.
+ (rb_big2str1): Follow the above changes.
+
+Wed Jul 31 22:59:47 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/parse/test_notation_declaration.rb: Change class
+ name to follow file name change.
+
+Wed Jul 31 22:57:50 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Rename to ...
+ * test/rexml/parse/test_notation_declaration.rb: ... this.
+
+Wed Jul 31 22:54:39 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_mixin.rb: Remove duplicated tests.
+
+Wed Jul 31 22:52:55 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Fix typos in expected
+ value.
+ pubilc ->
+ public
+ ^^
+
+Wed Jul 31 22:50:51 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Add tests that focus
+ system literal in external ID system notation declaration.
+
+Wed Jul 31 22:36:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_cmp): Extracted from rb_big_cmp.
+ (power_cache_get_power): Change n1 argument (number of digits) to
+ power_level which is just passed to power_cache_get_power0.
+ (big2str_karatsuba): Ditto.
+ (rb_big2str1): Calculate the initial power_level.
+
+Wed Jul 31 22:04:36 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Fix a typo.
+ Extern ID ->
+ ExternalID
+ ^^
+
+Wed Jul 31 22:01:36 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Add tests that focus
+ public ID in external ID notation declaration.
+
+Wed Jul 31 22:01:24 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * parse.y: fix build error with bison-3.0.
+
+Wed Jul 31 21:58:53 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Split test patterns.
+
+Wed Jul 31 21:42:33 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Group tests.
+
+Wed Jul 31 21:37:51 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_mixin.rb (TestNotationDecl#test_name):
+ Move to ...
+ * test/rexml/test_notationdecl_parsetest.rb
+ (TestNotationDecl#test_name): ... here.
+
+Wed Jul 31 21:37:47 2013 Kouhei Sutou <kou@cozmixng.org>
+
+Wed Jul 31 21:31:49 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: Remove setup because it
+ doesn't share anything with other tests.
+
+Wed Jul 31 21:24:55 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_attributes_mixin.rb: Remove a needless shebang.
+ * test/rexml/test_notationdecl_mixin.rb: ditto.
+ * test/rexml/test_doctype.rb: ditto.
+ * test/rexml/test_xml_declaration.rb: ditto.
+ * test/rexml/test_changing_encoding.rb: ditto.
+
+Wed Jul 31 21:20:08 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_notationdecl_parsetest.rb: remove a needless shebang.
+
+Wed Jul 31 20:11:01 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_rindex): fix bug introduced in r42269.
+ "".rindex("") should return 0.
+ (str_rindex): ditto.
+
+Wed Jul 31 19:55:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (MAX_BIG2STR_TABLE_ENTRIES): Use SIZEOF_SIZE_T.
+ (power_cache_get_power0): Add rb_bug call for too bit i argument.
+ (power_cache_get_power): Simplified.
+
+Wed Jul 31 18:32:25 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/uri/common.rb (URI.decode_www_form_component): Use String#b.
+
+Wed Jul 31 18:24:02 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_mod_refine, mod_using, top_using): don't show
+ warnings because Refinements are no longer experimental.
+ [ruby-core:55993] [Feature #8632]
+
+ * test/ruby/test_refinement.rb: related test.
+
+ * NEWS: fixes for the above change.
+
+Wed Jul 31 17:55:55 2013 Shota Fukumori <her@sorah.jp>
+
+ * lib/uri/common.rb (URI.decode_www_form_component):
+ Don't raise error when str includes multibyte characters.
+
+Wed Jul 31 17:45:39 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_rindex): performance improvement by using
+ memrchr(3).
+
+Wed Jul 31 16:43:30 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_rindex): refactoring and avoid to call str_nth() if
+ pos == 0.
+
+Wed Jul 31 14:41:36 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb: [DOC] Add a couple of notes on Hash as storage.
+ ref. [Feature #6589]
+
+Wed Jul 31 14:38:52 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb: [DOC] Fix example result. Hash is now ordered.
+
+Wed Jul 31 14:38:10 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb: [DOC] Use the term "sorted" instead of "ordered"
+ when mentioning SortSet.
+
+Wed Jul 31 12:18:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_struct): New structure.
+ (big2str_orig): Use big2str_struct.
+ (big2str_karatsuba): Ditto.
+ (rb_big2str1): Ditto.
+
+Wed Jul 31 12:02:16 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rubygems.rb: [DOC] typo in url patch by @Red54 [Fixes #369]
+ https://github.com/ruby/ruby/pull/369
+
+Wed Jul 31 07:09:07 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems from master as of commit 523551c
+ * test/rubygems: ditto.
+
+Tue Jul 30 22:21:54 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * test/ruby/test_hash.rb: add a test for enumeration order of Hash.
+
+Tue Jul 30 18:52:27 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#intersect?, Set#disjoint?): Add new methods for
+ testing if two sets have any element in common.
+ [ruby-core:45641] [Feature #6588] Based on the code by marcandre.
+
+Tue Jul 30 17:16:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (ruby__sfvextra): add QUOTE flag to escape unprintable
+ characters.
+
+Tue Jul 30 11:00:52 2013 Zachary Scott <e@zzak.io>
+
+ * ext/curses/extconf.rb: [DOC] nodoc to reduce Object pollution
+
+Tue Jul 30 08:19:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * sizes.c (Init_sizes): Define sizes only if the type actually exists.
+
+Mon Jul 29 22:55:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sizes.c (Init_sizes): define RbConfig::SIZEOF. [Feature #8568]
+
+Mon Jul 29 22:25:20 2013 Zachary Scott <e@zzak.io>
+
+ * ext/curses/curses.c: [DOC] Update location of samples
+ * samples/curses/*: Move Curses samples and refactor from mixin
+ The samples are included in rdoc for module and use of mixin is
+ confusing
+
+Mon Jul 29 22:16:11 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (LOG2_KARATSUBA_BIG2STR_DIGITS): Renamed from
+ LOG2_KARATSUBA_DIGITS.
+ (KARATSUBA_BIG2STR_DIGITS): Renamed from KARATSUBA_DIGITS.
+
+Mon Jul 29 22:04:45 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_compare_by_id): add function prototype.
+
+Mon Jul 29 21:53:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_compare_by_id): don't call rb_hash_rehash()
+ if self.compare_by_identity? == true.
+
+Mon Jul 29 21:29:48 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_assoc): performance improvement by replacing
+ compare function in RHASH(hash)->ntbl->type temporarily like r42224.
+ it falls back to rb_hash_foreach() if st_lookup() doesn't find the key.
+
+ * test/ruby/test_hash.rb: add a test for above.
+
+Mon Jul 29 21:15:30 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/ruby/test_lazy_enumerator.rb
+ (TestLazyEnumerator#test_initialize): Make sure
+ Enumerator::Lazy#initialize raises error if the object is
+ frozen. The check was performed by rb_ivar_set() before
+ rb_check_frozen() was added to enumerator_init().
+
+Mon Jul 29 21:06:42 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * enumerator.c (enumerator_init): Add a frozenness check to
+ prevent a frozen Enumerator object from being reinitialized with
+ a different enumerable object. This is the least we should do,
+ and more fixes will follow. [Fixes GH-368] Patch by Kenichi
+ Kamiya.
+
+ * enumerator.c (generator_init): Ditto.
+
+Mon Jul 29 20:14:24 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_assoc): revert r42224. table->type->compare is
+ called only if hashes are matched.
+
+ * test/ruby/test_hash.rb: add a test to check using #== to compare.
+
+Mon Jul 29 17:00:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (yycompile): store file name as String to keep the encoding.
+
+ * parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path):
+ new functions to pass file name as a String.
+
+ * parse.y (gettable_gen): return a copy of the original file name, not
+ a copy in filesystem encoding.
+
+ * vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)".
+
+Mon Jul 29 16:53:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_initialize_copy): copy st_table type even if empty.
+ [ruby-core:56256] [Bug #8703]
+
+Mon Jul 29 16:34:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_initialize_copy): clear old table before copy new
+ table.
+
+Mon Jul 29 16:34:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_assoc): aggregate object can be initialized only
+ with link time constants.
+
+Mon Jul 29 14:54:44 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_assoc): performance improvement by replacing
+ compare function in RHASH(hash)->ntbl->type temporarily.
+
+Mon Jul 29 14:52:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (xsystem): expand environment variable in all macros not
+ expanded with RbConfig. [Bug #8702]
+
+ * test/mkmf/test_framework.rb (create_framework): replace all $@ not
+ only once.
+
+Mon Jul 29 06:54:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_pipe): use enum for compile time constants,
+ instead of const int for debugging.
+
+Mon Jul 29 00:11:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Specialized implementation added for
+ nx == 2 && ny == 2
+
+Sun Jul 28 20:28:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * io.c (io_getpartial): use rb_str_locktmp_ensure().
+ [ruby-core:56121] [Bug #8669]
+
+ * io.c (rb_io_sysread): ditto.
+
+ * test/ruby/test_io.rb: add tests for above.
+
+Sun Jul 28 20:10:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (extmake): should make static libraries for extensions
+ to be statically linked. [Bug #7948]
+
+Sun Jul 28 17:38:32 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c: add internal API rb_str_locktmp_ensure().
+
+ * io.c (io_fread): use rb_str_locktmp_ensure().
+ [ruby-core:56121] [Bug #8669]
+
+ * test/ruby/test_io.rb: add a test for above.
+
+Sun Jul 28 13:04:39 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * io.c (interpret_seek_whence): support SEEK_DATA and SEEK_HOLE.
+ These are whences for lseek(2) supported by Linux since version 3.1.
+ [ruby-core:56123] [Feature #8671]
+
+ * test/ruby/test_io.rb: Add tests for above.
+
+Sun Jul 28 12:41:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (absint_numwords_generic): The char_bit variable changed
+ to static constant.
+
+Sun Jul 28 12:03:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Constify bary_* functions.
+
+Sun Jul 28 11:12:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_absint_size): Declaration moved from
+ internal.h to calculate required buffer size to pack integers.
+ (rb_absint_numwords): Ditto.
+ (rb_absint_singlebit_p): Ditto.
+ [ruby-core:42813] [Feature #6065]
+
+Sun Jul 28 10:54:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_pipe): fix pipe name formatting. as "%x" may
+ not contain '0' at all, fill at fixed position instead.
+
+Sun Jul 28 00:35:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_size): Return the bignum "bytewise" size.
+ [ruby-core:55578] [Feature #8553]
+ This is accepted by matz on DevelopersMeeting20130727Japan.
+
+Sun Jul 28 00:07:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_integer_pack): Declaration moved from
+ internal.h.
+ (rb_integer_unpack): Ditto.
+ [ruby-core:42813] [Feature #6065]
+
+Fri Jul 26 23:18:13 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * NEWS: Add a new feature that REXML::Parsers::StreamParser
+ supports "entity" event.
+
+Fri Jul 26 23:14:31 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/streamparser.rb
+ (REXML::Parsers::StreamParser#parse): Add "entity" event support to
+ listener. [Bug #8689] [ruby-dev:47542]
+ Reported by Ippei Obayashi.
+ * test/rexml/test_stream.rb (StreamTester#entity): Add a test for
+ the above case.
+
+Fri Jul 26 23:05:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): separate numeric literal from succeeding
+ token, and treat 'e' as floating point number only if followed by
+ exponent part.
+
+Fri Jul 26 22:14:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_exec.h (CHECK_VM_STACK_OVERFLOW_FOR_INSN): surround with
+ do/while (0), and remove unnecessary casts.
+
+Fri Jul 26 20:12:07 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/syslog/lib/syslog/logger.rb (Syslog::Logger): Add facility
+ to Syslog::Logger. [Fixes GH-305] patch by Max Shytikov
+ https://github.com/ruby/ruby/pull/305
+
+Fri Jul 26 19:25:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_exec.h, tool/instruction.rb: not an error, but a BUG if stack
+ overflow checking failed just before/after the beginning of an
+ instruction. It should be treated as a BUG.
+ Please tell us if your code cause BUG with this problem.
+ This check will removed soon (for performance).
+
+Fri Jul 26 18:30:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_memcpy): cast to int to suppress a warning.
+
+Fri Jul 26 18:21:58 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_memcpy): try to enable optimization.
+ At least on my environments, I don't see any errors
+ with many trials. Please tell us if you find any GC bugs.
+
+Fri Jul 26 17:49:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/file.c (fix_string_encoding): fix target encoding. the
+ parameter `encoding' is not the target encoding but the original
+ encoding.
+
+Fri Jul 26 14:05:19 2013 Zachary Scott <e@zzak.io>
+
+ * ext/fiddle/*: [DOC] More doc on dlopen and RTLD_DEFAULT from r42184
+
+Fri Jul 26 13:08:53 2013 Zachary Scott <e@zzak.io>
+
+ * ext/fiddle/lib/fiddle.rb: [DOC] Document Fiddle.dlopen(nil)
+ * ext/fiddle/handle.c: [DOC] Document Fiddle::Handle.new(nil)
+
+Fri Jul 26 13:04:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_load_internal): use rb_load_file_str() to keep path
+ encoding.
+
+ * load.c (rb_require_safe): search in OS path encoding for Windows.
+
+ * ruby.c (rb_load_file_str): load file with keeping path encoding.
+
+ * win32/file.c (rb_file_load_ok): use WCHAR type API assuming incoming
+ path is encoded in UTF-8. [ruby-core:56136] [Bug #8676]
+
+ * file.c (rb_str_encode_ospath): simplify using rb_str_conv_enc().
+
+ * win32/file.c (fix_string_encoding): simplify with rb_str_conv_enc().
+
+ * win32/file.c (convert_mb_to_wchar): use bare pointer instead of
+ VALUE, and remove useless argument.
+
+Fri Jul 26 11:42:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * rational.c (f_round_common): Rational is expected to be returned by
+ Rational#*, but mathn.rb breaks that assumption. [ruby-core:56177]
+ [Bug #8687]
+
+Fri Jul 26 01:37:45 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/ruby.h: check defined(USE_RGENGC_LOGGING_WB_UNPROTECT)
+
+Fri Jul 26 01:21:41 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (rb_file_expand_path_internal): fix r42160; skip '~'.
+
+Thu Jul 25 17:53:18 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTP#connect): disable Nagle's algorithm on
+ HTTP connection. [ruby-core:56158] [Feature #8681]
+
+Thu Jul 25 17:49:42 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * re.c (rb_reg_to_s): convert closing parenthesis to the target encoding
+ if it is ASCII incompatible encoding. [ruby-core:56063] [Bug #8650]
+
+Thu Jul 25 17:21:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (is_obj_encoding): new macro to check if obj is an
+ Encoding. obj can be any type while is_data_encoding expects T_DATA
+ only.
+
+Thu Jul 25 17:17:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_expand_path_internal): should clear coderange after
+ copying user name as binary data.
+
+Thu Jul 25 16:17:55 2013 Koichi Sasada <ko1@atdot.net>
+
+ * encoding.c (check_encoding): Check T_DATA or not.
+ is_data_encoding(obj) assumes that `obj' is T_DATA.
+
+Thu Jul 25 13:06:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_s_home): use rb_home_dir_of and rb_default_home_dir.
+
+ * file.c (rb_home_dir_of): split from rb_home_dir() for the home
+ directry of the given user, and the user name is a VALUE, not a bare
+ pointer. should raise if the user does not exist.
+
+ * file.c (rb_default_home_dir): split from rb_home_dir() for the home
+ directry of the current user.
+
+Thu Jul 25 12:32:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/openssl/ossl.c: support additional three thread synchronization
+ functions. [ruby-trunk - Bug #8386]
+
+Thu Jul 25 07:15:58 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems from master as of commit 4ff70cc
+ * test/rubygems: ditto.
+
+Wed Jul 24 20:57:44 2013 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_set_arguments): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR() because there is no new reference.
+
+ * compile.c (iseq_set_exception_table): ditto.
+
+Wed Jul 24 19:49:54 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is
+ a relative URI. [Bug #8645]
+
+Wed Jul 24 18:56:06 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_expandarray): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR() because there is no new reference.
+
+ * vm_insnhelper.c (vm_caller_setup_args): ditto.
+
+ * vm_insnhelper.c (vm_yield_setup_block_args): ditto.
+
+Wed Jul 24 18:40:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c, gc.c: move ary_unprotect_logging() into
+ rb_gc_unprotect_logging() which is general version
+
+ * include/ruby/ruby.h: add USE_RGENGC_LOGGING_WB_UNPROTECT
+ to enable.
+
+Wed Jul 24 17:37:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_expand_path_internal): preserve the file name
+ encoding in an exception message.
+
+Wed Jul 24 08:04:49 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/-ext-/tracepoint/test_tracepoint.rb: add GC on/off to count
+ GC events strictly.
+
+Tue Jul 23 23:19:24 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/extconf.rb (CRYPTO_THREADID): check exist or not.
+
+ * ext/openssl/ossl.c (ossl_thread_id): use rb_nativethread_self()
+ implemented at r42137 to allow threads which doesn't associated with
+ Ruby thread to use openssl functions.
+
+ * ext/openssl/ossl.c (Init_ossl_locks): If CRYPTO_THREADID is defined
+ (OpenSSL 1.0.0 or later has it) use CRYPTO_THREADID_set_callback()
+ instead of CRYPTO_set_id_callback() because its argument is
+ unsigned long; it may cause id collision on mswin64
+ whose sizeof(unsigned long) < sizeof(void*).
+ http://www.openssl.org/docs/crypto/threads.html
+
+ * ext/openssl/ossl.c (ossl_threadid_func): defined for above.
+
+Tue Jul 23 20:47:36 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Move functions.
+
+Tue Jul 23 20:14:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_divmod): Add special cases for x < y easily detected
+ and nx == 2 && ny == 2.
+
+Tue Jul 23 19:48:38 2013 Koichi Sasada <ko1@atdot.net>
+
+ * thread_(pthread|win32).h: rename rb_thread_cond_t to
+ rb_nativethread_cond_t.
+
+ * thread.c, thread_pthread.c, thread_win32.c, vm_core.h: catch up
+ renaming.
+
+Tue Jul 23 19:44:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * thread_native.h: add rb_nativethread_self() which returns
+ current running native thread identifier.
+
+ * thread_[pthread|win32].c: implement rb_nativethread_self().
+
+Tue Jul 23 19:34:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.h, thread_win32.h: rename rb_thread_id_t to
+ rb_nativethread_id_t.
+
+ * thread_pthread.c, vm_core.h: use rb_nativethread_id_t.
+
+Tue Jul 23 18:56:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/openssl/ossl.c: use system native (system provided)
+ thread locking APIs added by last commit.
+ This patch fixes [Bug #8386].
+ "rb_mutex_*" APIs control only "Ruby" threads.
+ Not for native threads.
+
+Tue Jul 23 18:44:15 2013 Koichi Sasada <ko1@atdot.net>
+
+ * thread_native.h: added.
+ Move native thread related lines from vm_core.h.
+ And declare several functions "rb_nativethread_lock_*",
+ manipulate locking.
+
+ * common.mk: add thread_native.h.
+
+ * thread.c: add functions "rb_nativethread_lock_*".
+
+ * thread.c, thread_[pthread,win32].[ch]: rename rb_thread_lock_t
+ to rb_nativethread_lock_t to make it clear that this lock is for
+ native threads, not for ruby threads.
+
+Tue Jul 23 16:14:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_before_sweep): fix spacing.
+
+Tue Jul 23 15:57:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_get_freeobj): clear slot->freelist here.
+ This means that this slot doesn't have any free objects.
+ And store this slot with objspace->heap.using_slot.
+
+ * gc.c (gc_before_sweep): restore objspace->freelist
+ into objspace->heap.using_slot->freelist.
+ This means that using_slot has free objects which are
+ pointed from objspace->freelist.
+
+ * gc.c (gc_slot_sweep): do not need to clear slot->freelist.
+
+Tue Jul 23 09:34:49 2013 Zachary Scott <e@zzak.io>
+
+ * sample/drb/README*.rdoc: [DOC] migrate DRb sample READMEs to rdoc
+
+Tue Jul 23 09:28:05 2013 Zachary Scott <e@zzak.io>
+
+ * lib/drb/invokemethod.rb: [DOC] nodoc InvokeMethod18Mixin
+
+Tue Jul 23 08:44:37 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_asn1.c (asn1time_to_time): Implement YYMMDDhhmmZ
+ format for ASN.1 UTCTime. [ruby-trunk - Bug #8664]
+ * test/openssl/test_asn1.rb: Test for the above.
+
+Tue Jul 23 08:11:32 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rexml/streamlistener.rb: [DOC] Fix examples in
+ REXML::StreamListener#entitydecl patch by Ippei Obayashi [Bug #8665]
+
+Tue Jul 23 07:44:59 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems from master as of commit b165260
+ * test/rubygems: ditto.
+
+Tue Jul 23 07:14:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mulsub_1xN): New function.
+ (bary_mul_toom3): Use bary_mulsub_1xN.
+
+Tue Jul 23 03:32:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (KARATSUBA_BALANCED): New macro.
+ (TOOM3_BALANCED): Ditto.
+ (bary_mul_balance_with_mulfunc): Use KARATSUBA_BALANCED and
+ TOOM3_BALANCED.
+ (rb_big_mul_balance): Relax a condition.
+ (rb_big_mul_karatsuba): Use KARATSUBA_BALANCED.
+ (rb_big_mul_toom3): Use TOOM3_BALANCED.
+ (bary_mul_karatsuba_branch): Use KARATSUBA_BALANCED.
+ (bary_mul_toom3_branch): Use TOOM3_BALANCED.
+
+Tue Jul 23 01:34:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem_mulsub): Extracted from bigdivrem1.
+ (bigdivrem1): Use bary_add.
+
+Mon Jul 22 18:39:52 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_enumerate_chars): specify array capa
+ with str_strlen().
+
+ * string.c (rb_str_enumerate_codepoints): ditto.
+
+Mon Jul 22 18:01:33 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_enumerate_chars): specify array capa.
+
+Mon Jul 22 17:24:14 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_each_char_size): performance improvement by
+ using rb_str_length().
+
+Mon Jul 22 16:32:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (eval_string_with_cref): check by Check_TypedStruct
+ instead of rb_obj_is_kind_of.
+
+Mon Jul 22 13:19:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_resize_capa): use RARRAY_RAWPTR() because
+ this code creates no new references.
+
+Mon Jul 22 12:58:18 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_memfill): added.
+
+ * array.c (rb_ary_initialize): use ary_memfill().
+
+ * array.c (rb_ary_fill): ditto.
+
+ * array.c (rb_ary_slice_bang): use RARRAY_RAWPTR() because
+ this code creates no new references.
+
+Mon Jul 22 10:09:46 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_slot_sweep): need to add empty RVALUE as freeobj.
+
+Mon Jul 22 09:48:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (eval_string_with_cref): use the given file name unless
+ eval even if scope is given. additional fix for [Bug #8436].
+ based on the patch by srawlins at [ruby-core:56099] [Bug #8662].
+
+Mon Jul 22 09:24:19 2013 Kouji Takao <kouji@takao7.net>
+
+ * ext/readline/readline.c (Init_readline): added
+ Readline.delete_text. [ruby-dev:45789] [Feature #6626]
+ * ext/readline/extconf.rb: check for rl_delete_text() in Readline library.
+
+ Thanks, Nobuyoshi Nakada, for the patch.
+
+Mon Jul 22 03:15:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/date/date_parse.c (rfc2822_cb): check if wday is given, since it
+ can be omitted.
+
+Mon Jul 22 00:15:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_sq_fast): Refine expressions.
+
+Sun Jul 21 21:08:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul): Use simple multiplication if yl is small.
+ (rb_cstr_to_inum): Invoke bigsq instead of bigmul0.
+ (bigsq): Re-implemented.
+ (bigmul0): Invoke bigsq if two arguments are identical.
+
+Sun Jul 21 09:58:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_toom3): New function based on bigmul1_toom3.
+ (bary_mul_toom3_branch): Call bary_mul_toom3.
+ (rb_big_mul_toom3): Ditto.
+ (bigmul1_toom3): Removed.
+ (big_real_len): Ditto.
+ (big_split): Ditto.
+ (big_split3): Ditto.
+
+Sun Jul 21 08:12:16 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * proc.c (proc_to_s): use PRIsVALUE to preserve the result encoding.
+
+Sun Jul 21 03:36:18 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * hash.c (rb_hash_flatten): use NUM2INT to raise TypeError on 32bit
+ platform. it's introduced by r42039
+
+Sun Jul 21 01:07:45 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * common.mk (help): Fix environment variable name and argument.
+ Actually it can also be a directory or any argument for
+ test/unit runner. [Fixes GH-363]
+
+Sat Jul 20 22:44:50 2013 Zachary Scott <e@zzak.io>
+
+ * common.mk: Document running a single test [Fixes GH-363]
+ Patch by Avdi Grimm https://github.com/ruby/ruby/pull/363
+
+Sat Jul 20 22:39:56 2013 Zachary Scott <e@zzak.io>
+
+ * sample/*: whitespace patch by Sergio Campama [Fixes GH-364]
+ https://github.com/ruby/ruby/pull/364
+
+Sat Jul 20 22:33:13 2013 Zachary Scott <e@zzak.io>
+
+ * doc/regexp.rdoc: [DOC] Fix typo in example [Fixes GH-365]
+ Patch by Juanito Fatas https://github.com/ruby/ruby/pull/365
+
+Sat Jul 20 17:46:03 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_succ): add missing case NEIGHBOR_WRAPPED.
+ r42078 caused buggy behavior like "\xFF".b -> "\x01\xFF".b
+
+Sat Jul 20 15:22:38 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_resize): use simple memcpy because there are no new
+ references.
+
+Sat Jul 20 15:02:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * safe.c (ruby_safe_level_4_warning): define for old extension
+ libraries. [Bug #8652]
+
+Sat Jul 20 14:38:00 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_make_shared): make shared array shady.
+ Making non-shady shared array causes SEGV (see rubyci).
+ It seems a bug around shared array.
+
+Sat Jul 20 12:14:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (enc_succ_char, enc_pred_char): consider wchar case.
+ [ruby-core:56071] [Bug #8653]
+
+ * string.c (rb_str_succ): do not replace with invalid char.
+
+ * encoding.c (rb_enc_code_to_mbclen): add new function which returns
+ mbclen from codepoint like as rb_enc_codelen() but 0 for invalid
+ char.
+
+ * include/ruby/encoding.h (rb_enc_code_to_mbclen): declaration and
+ shortcut macro.
+
+Fri Jul 19 21:59:12 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: declare type_name() at the beginning of file.
+
+Fri Jul 19 21:35:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c: reduce shady operations.
+
+ * array.c (rb_ary_modify, ary_make_partial, rb_ary_splice,
+ rb_ary_replace, rb_ary_eql, rb_ary_compact_bang):
+ use RARRAY_RAWPTR() instead of RARRAY_PTR().
+
+ * array.c (rb_ary_shift): use RARRAY_PTR_USE() without WB because
+ there are not new relations.
+
+ * array.c (ary_ensure_room_for_unshift): ditto.
+
+ * array.c (rb_ary_sort_bang): ditto.
+
+ * array.c (rb_ary_delete_at): ditto.
+
+ * array.c (rb_ary_reverse_m): use RARRAY_RAWPTR() because
+ there are not new relations.
+
+Fri Jul 19 20:58:20 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c: reduce shade operations.
+
+ * array.c (rb_ary_modify): use RARRAY_RAWPTR().
+
+ * array.c (ary_make_substitution, rb_ary_s_create, ary_make_partial,
+ rb_ary_splice, rb_ary_resize, rb_ary_rotate_m, rb_ary_times):
+ use ary_memcpy().
+
+Fri Jul 19 19:55:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_mem_clear): added. This operation doesn't need WB
+ because this operation creates a reference to Qnil.
+
+ * array.c (ary_make_shared, rb_ary_store, rb_ary_shift_m,
+ rb_ary_splice, rb_ary_resize, rb_ary_fill): use ary_mem_clear()
+ instead of rb_mem_clear().
+
+ * array.c (ary_make_shared): use RARRAY_RAWPTR() instead of RARRAY_PTR().
+
+Fri Jul 19 19:18:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c: fix commit miss.
+ RGENGC_UNPROTECT_LOGGING should be 0.
+
+Fri Jul 19 19:15:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_resurrect): use RARRAY_RAWPTR() because there is no
+ writing.
+
+ * array.c (rb_ary_new_from_values): use ary_memcpy().
+
+Fri Jul 19 19:07:31 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_memcpy): add a function to copy VALUEs into ary
+ with write barrier. If ary is promoted, use write barrier correctly.
+
+ * array.c (rb_ary_cat, rb_ary_unshift_m, rb_ary_dup,
+ rb_ary_sort_bang, rb_ary_replace, rb_ary_plus): use ary_memcpy().
+
+Fri Jul 19 15:32:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_store): use RARRAY_PTR_USE() instead of RARRAY_PTR().
+ Clearing memory space doesn't need WBs.
+
+Fri Jul 19 15:19:37 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_ensure_room_for_push): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR. In this code, there are no "write" operation.
+
+ * array.c (rb_ary_equal): ditto.
+
+ * array.c (recursive_equal): ditto.
+
+Fri Jul 19 15:09:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, internal.h (rb_gc_writebarrier_remember_promoted): add a new
+ function to remember an specified object. This api is only
+ experimental (strongly depend on WB/rgengc strategy).
+
+Fri Jul 19 14:56:00 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_unprotect_logging): use (void *) for first parameter
+ because VALUE is not defined before including ruby/ruby.h.
+
+Fri Jul 19 14:19:48 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/pathname/pathname.c (path_inspect): use PRIsVALUE to preserve
+ the result encoding.
+
+Fri Jul 19 12:35:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_tcp.rb (test_initialize_failure): Use EADDRNOTAVAIL
+ to test an error message generated by bind() failure.
+
+Fri Jul 19 11:27:38 2013 Zachary Scott <e@zzak.io>
+
+ * lib/racc/parser.rb: [DOC] Capitalize "Ruby" in documentation
+ Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+
+Fri Jul 19 11:26:28 2013 Zachary Scott <e@zzak.io>
+
+ * ext/psych/lib/psych*: [DOC] Capitalize "Ruby" in documentation
+ Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+
+Fri Jul 19 11:25:12 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rdoc/*: [DOC] Capitalize "Ruby" in documentation
+ Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+
+Fri Jul 19 11:23:55 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rubygems*: [DOC] Capitalize "Ruby" in documentation
+ Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+
+Fri Jul 19 11:16:54 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#to_set): Define Set#to_set so that aSet.to_set
+ returns self. [Fixes GH-359]
+
+Fri Jul 19 11:10:23 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rake/*: [DOC] Capitalize "Ruby" in documentation
+ Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+
+Fri Jul 19 01:04:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/bignum/intpack.c: Renamed from ext/-test-/bignum/pack.c.
+ (Init_intpack): Renamed from Init_pack.
+ Reported by Naohisa Goto. [ruby-dev:47526] [Bug #8655]
+
+Fri Jul 19 00:54:27 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * test/ruby/test_array.rb (test_count): add a test case for #count
+ with an argument. See Bug #8654.
+
+Thu Jul 18 23:45:06 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_eql): compare RARRAY_PTR() for performance
+ improvement in case of that self and other are shared.
+
+Thu Jul 18 22:46:42 2013 Zachary Scott <e@zzak.io>
+
+ * lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]
+ Patch by Dave Worth https://github.com/ruby/ruby/pull/341
+ * lib/webrick.rb: ditto
+ * lib/scanf.rb: ditto
+ * lib/xmlrpc/config.rb: ditto
+ * lib/resolv.rb: ditto
+ * lib/e2mmap.rb: ditto
+ * lib/fileutils.rb: ditto
+ * lib/mkmf.rb: ditto
+ * lib/cgi/session.rb: ditto
+ * lib/yaml.rb: ditto
+ * lib/erb.rb: ditto
+ * lib/irb.rb: ditto
+ * lib/tracer.rb: ditto
+ * lib/net/http.rb: ditto
+ * ext/syslog/lib/syslog/logger.rb: ditto
+ * sample/pty/expect_sample.rb: ditto
+
+Thu Jul 18 21:30:50 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_sq_fast): Specialize the last iteration of the
+ outer loop.
+ (bigfixize): A condition simplified.
+
+Thu Jul 18 21:15:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_equal): compare RARRAY_PTR() for performance
+ improvement in case of that self and other are shared.
+
+Thu Jul 18 20:44:51 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_fill): use memfill().
+
+Thu Jul 18 20:35:14 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * array.c (rb_ary_count): check length to avoid SEGV
+ while iterating. Remove other pointer loop when arg is given.
+
+ * test/ruby/test_array.rb (test_count): add test for bug.
+ [ruby-core:56072] [Bug #8654]
+
+Thu Jul 18 18:14:36 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_count): iterate items appropriately.
+ [Bug #8654]
+
+Thu Jul 18 17:35:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_flatten): performance improvement by not using
+ rb_hash_to_a() to avoid array creation with rb_assoc_new().
+
+Thu Jul 18 16:16:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c: add logging feature for RGenGC's write barrier unprotect
+ event.
+
+Thu Jul 18 15:45:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): make only
+ rb_set_safe_level(4) an error always but make rb_secure(4) an error
+ only in the core. [ruby-dev:47517] [Bug #8652]
+
+Thu Jul 18 15:42:01 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: fix spell miss.
+
+Thu Jul 18 15:11:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (ruby_safe_level_4): get rid of special
+ character. [ruby-dev:47512] [misc #8646]
+
+Thu Jul 18 14:51:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ary_alloc): slim setup process.
+
+Thu Jul 18 14:37:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (str_alloc): no need to clear RString (already cleared).
+
+Thu Jul 18 12:57:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BDIGITS_ZERO): Defined.
+ (bary_pack): Use BDIGITS_ZERO.
+ (bary_unpack): Ditto.
+ (bary_mul_single): Ditto.
+ (bary_mul_normal): Ditto.
+ (bary_sq_fast): Ditto.
+ (bary_mul_balance_with_mulfunc): Ditto.
+ (bary_mul_precheck): Ditto.
+ (bary_mul_toom3_branch): Ditto.
+ (rb_cstr_to_inum): Ditto.
+ (big_shift3): Ditto.
+ (bigmul1_toom3): Ditto.
+ (bary_divmod): Ditto.
+
+Thu Jul 18 06:30:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename gc related functions with prefix "gc_".
+ * before_gc_sweep() -> gc_before_sweep().
+ * after_gc_sweep() -> gc_after_sweep().
+ * lazy_sweep() -> gc_lazy_sweep().
+ * rest_sweep() -> gc_rest_sweep().
+ * slot_sweep() -> gc_slot_sweep().
+
+ * gc.c: rename a heap management function with prefix "heap_".
+ * get_freeobj() -> heap_get_freeobj().
+
+ * gc.c: rename markable_object_p() to is_markable_object().
+
+Wed Jul 17 22:57:40 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (delete_if_i): use ST_DELETE.
+
+Wed Jul 17 22:34:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: An static assertion for relation of SIZEOF_LONG and
+ SIZEOF_BDIGITS is added.
+ (bary_mul_precheck): Reduce comparisons.
+ (bary_mul): Invoke bary_sq_fast or bary_mul1 if the bignum size is
+ small.
+ (bigfixize): Resize the argument bignum here.
+ (bignorm): Don't call bigtrunc after bigfixize.
+
+Wed Jul 17 22:13:26 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_replace): performance improvement by using
+ st_copy().
+
+Wed Jul 17 17:19:54 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename heap management functions with prefix "heap_".
+ * allocate_sorted_array() -> heap_allocate_sorted_array().
+ * slot_add_freeobj() -> heap_slot_add_freeobj().
+ * assign_heap_slot() -> heap_assign_slot().
+ * add_heap_slots() -> heap_add_slots().
+ * init_heap() -> heap_init().
+ * set_heap_increment() -> heap_set_increment().
+
+ * gc.c (initial_expand_heap): inlined in rb_gc_set_params().
+
+Wed Jul 17 17:12:23 2013 Matthew M. Boedicker <matthewm@boedicker.org>
+
+ * hash.c (env_fetch): Add key name to message on ENV.fetch KeyError,
+ as well as Hash#fetch. [ruby-core:56062] [Feature #8649]
+
+Wed Jul 17 15:59:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: catch up last changes for debugging/checking mode.
+
+Wed Jul 17 15:50:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_free): free slot itself.
+
+ * gc.c (objspace_each_objects): fix condition.
+ Use slot->body instead of slot.
+
+ * gc.c (count_objects): use "slot" variable.
+
+Wed Jul 17 15:21:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (unlink_heap_slot): fix memory leak.
+ free slot itself at free_heap_slot().
+
+ Reproduce-able code is here:
+ N1 = 100_000; N2 = 1_000_000
+ N1.times{ary = []; N2.times{ary << ''}}
+ Maybe this problem is remaining in Ruby 2.0.0.
+
+ * gc.c (unlink_heap_slot): remove not working code.
+
+Wed Jul 17 14:31:13 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: re-design the heap structure.
+
+ (1) The heap is consists of a set of slots.
+ (2) Each "slot" has a "slot_body".
+ slot::start and slot::limit specify RVALUE beginning address
+ and number of RVALUE in a "slot_body".
+ (3) "slot_body" contains a pointer to slot (slot_body::header::slot)
+ and an array of RVALUE.
+ (4) heap::sorted is an array of "slots", sorted by an address of
+ slot::body.
+
+ See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/GC_design
+ for more details (figure).
+
+ * gc.c: Avoid "heaps" terminology. It is ambiguous.
+
+Wed Jul 17 13:29:16 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix heaps_header and heaps_slot to reduce memory consumption.
+ (1) move heaps_header::start and limit to heaps_slot.
+ (2) remove heaps_header::end which can be calculated by start+limit.
+
+ * gc.c: catch up above change.
+
+Wed Jul 17 12:30:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/st.h (st_strcasecmp): Macro defined for compatibility.
+ (st_strncasecmp): Ditto.
+
+Wed Jul 17 11:57:45 2013 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/util.rb (CGI::Util#escape, unescape): Avoid use of regexp
+ special global variable. [Feature #8648] Thanks to fotos.
+
+Wed Jul 17 11:57:10 2013 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/erb.rb (ERB::Util#url_encode): Avoid use of regexp special global
+ variable. [Feature #8648] Thanks to fotos.
+
+Wed Jul 17 08:12:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * st.c (st_locale_insensitive_strcasecmp): Renamed from st_strcasecmp.
+ (st_locale_insensitive_strncasecmp): Renamed from st_strncasecmp.
+
+ * include/ruby/st.h: Follow above changes.
+
+ * include/ruby/ruby.h: Ditto.
+
+Wed Jul 17 00:14:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigmul1_toom3): Use bigdivrem_single instead of bigdivrem.
+ (big_three): Removed.
+ (Init_Bignum): Don't initialize big_three.
+
+Tue Jul 16 21:46:03 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * configure.in: revert r42008. strcasecmp() uses the current locale.
+
+ * include/ruby/ruby.h: ditto.
+
+ * st.c (st_strcasecmp): ditto.
+
+Tue Jul 16 21:07:04 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * configure.in: check strcasecmp().
+
+ * include/ruby/ruby.h: use strcasecmp() as st_strcasecmp() if it
+ exists.
+
+ * st.c (st_strcasecmp): define the function only if strcasecmp()
+ doesn't exist.
+
+Tue Jul 16 20:21:28 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigsq): Renamed from bigsqr.
+
+Tue Jul 16 19:42:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (USHORT): Unused macro removed.
+
+Tue Jul 16 19:18:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: slim a path of newobj_of().
+
+ * gc.c (objspace): add a new field objspace::freelist, which contains
+ available RVALUEs.
+
+ * gc.c (newobj_of): simply call new function `get_freeobj()'.
+ get_freeobj() returns objspace::freelist. If objspace::freelist
+ is not available, refill objspace::freelist with a slot pointed by
+ objspace::heap::free_slots.
+
+ * gc.c (before_gc_sweep): clear objspace::freelist.
+
+ * gc.c (slot_sweep): clear slot::freelist.
+
+ * gc.c (heaps_prepare_freeslot): renamed to heaps_prepare_freeslot.
+
+ * gc.c (unlink_free_heap_slot): remove unused function.
+
+ * gc.c (rb_free_const_table): remove unused function.
+
+Tue Jul 16 19:05:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_shift3): Big shift width is not a problem for right
+ shift.
+
+Tue Jul 16 18:50:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_count): [DOC] fix typo. Array#count uses ==, not
+ ===. a question at asakusa.rb ML.
+
+Tue Jul 16 18:35:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_karatsuba): Avoid duplicate calculation when
+ squaring.
+ (bary_mul_toom3_branch): Ditto.
+
+Tue Jul 16 17:43:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (link_free_heap_slot): removed.
+
+ * gc.c (slot_sweep): use `heaps_add_freeslot' instead of
+ `link_free_heap_slot'.
+
+ * gc.c (assign_heap_slot): use local variable `slot' instead of
+ `heaps'.
+
+Tue Jul 16 17:21:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (assign_heap_slot): refactoring variable names.
+
+ * gc.c (slot_add_freeobj): added.
+
+ * gc.c (heaps_add_freeslot): added.
+
+ * gc.c (finalize_list, rb_gc_force_recycle, slot_sweep): use
+ `slot_add_freeobj' instead of modifying linked list directly.
+
+Tue Jul 16 16:30:58 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (lazy_sweep): refactoring.
+
+Tue Jul 16 13:32:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (enc_set_index): since r41967, old terminator is dealt
+ with in str_fill_term(). should not consider it here because this
+ function is called before any encoding is set.
+
+Tue Jul 16 11:12:03 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * proc.c (rb_block_arity): raise ArgumentError if no block given.
+
+Tue Jul 16 08:15:22 2013 Zachary Scott <e@zzak.io>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] document top-level
+ classes from BigDecimal utils native extensions
+
+Tue Jul 16 03:23:03 2013 Zachary Scott <e@zzak.io>
+
+ * numeric.c: [DOC] improve rdoc formatting for parameters and links
+
+Mon Jul 15 14:40:00 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_big2str0): Deprecated.
+
+ * bignum.c (rb_big2str1): Renamed from rb_big2str0.
+ (rb_big2str0): Deprecated wrapper for rb_big2str1.
+ (rb_big2str): Invoke rb_big2str1 instead of rb_big2str0.
+
+Mon Jul 15 14:13:02 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * struct.c (rb_struct_each_pair): use rb_yield_values(2, key, value)
+ instead of rb_yield(rb_assoc_new(key, value)) if rb_block_arity()
+ is greater than 1.
+
+Mon Jul 15 13:46:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Add static assertions.
+
+Mon Jul 15 13:36:02 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_each_pair): performance improvement by using
+ rb_block_arity().
+
+Mon Jul 15 13:15:37 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * proc.c (rb_block_arity): create internal API rb_block_arity().
+ it returns arity of given block.
+
+Mon Jul 15 13:07:27 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * lib/prime.rb (Prime::EratosthenesGenerator,
+ Prime::EratosthenesSieve): New implementation by
+ robertjlooby <robertjlooby AT gmail.com>.
+
+ * test/test_prime.rb: updated with new method name
+
+Mon Jul 15 11:32:46 2013 Zachary Scott <e@zzak.io>
+
+ * numeric.c (rb_cNumeric): [DOC] Added comment for Numeric to fix doc
+
+Mon Jul 15 11:24:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (maxpow_in_bdigit_dbl): Useless #if removed.
+
+Mon Jul 15 11:10:46 2013 Zachary Scott <e@zzak.io>
+
+ * bignum.c (rb_big_coerce): [DOC] Add docs for Bignum#coerce
+ Based on patch by Juanito Fatas [Fixes GH-360]
+ https://github.com/ruby/ruby/pull/360
+
+Mon Jul 15 10:56:01 2013 Zachary Scott <e@zzak.io>
+
+ * thread.c (mutex_sleep): [DOC] Awake thread will reacquire lock
+ By Tim Abdulla [Fixes GH-342] https://github.com/ruby/ruby/pull/342
+
+Mon Jul 15 10:45:09 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (nlz16): Use __builtin_clz if possible.
+ (nlz32): Use __builtin_clz or __builtin_clzl if possible.
+ (nlz64): Use __builtin_clzl or __builtin_clzll if possible.
+ (nlz128): Use __builtin_clzll if possible.
+
+ * configure.in: Check __builtin_clz, __builtin_clzl and
+ __builtin_clzll.
+
+Mon Jul 15 09:39:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (power_cache_get_power): Use bitsize instead of ceil_log2.
+ (ones): Removed.
+ (next_pow2): Removed.
+ (floor_log2): Removed.
+ (ceil_log2): Removed.
+
+ * configure.in (__builtin_popcountl): Don't check.
+
+Mon Jul 15 02:47:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * localeinit.c (rb_locale_charmap, Init_enc_set_filesystem_encoding):
+ move from encoding.c.
+
+ * miniinit.c (rb_locale_charmap, Init_enc_set_filesystem_encoding):
+ define miniruby specific functions only.
+
+Mon Jul 15 02:32:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_init): no longer needs NO_PRESERVED_ENCODING.
+
+ * encoding.c (enc_inspect): defer loading autoloaded encoding.
+
+ * encoding.c (enc_check_encoding): use is_data_encoding() to check
+ type consistently.
+
+ * encoding.c (must_encoding): return rb_encoding* instead of encoding
+ index.
+
+ * encoding.c (enc_check_encoding): use is_data_encoding() to check
+ type consistently.
+
+ * encoding.c (must_encoding): return rb_encoding* instead of encoding
+ index.
+
+Mon Jul 15 02:21:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (str_fill_term): consider old terminator length, and should
+ not use rb_enc_ascget since it depends on the current encoding which
+ may not be compatible with the new terminator. [Bug #8634]
+
+ * encoding.c (enc_inspect): use PRIsVALUE to preserve the result
+ encoding.
+
+Sun Jul 14 23:21:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Check __builtin_popcountl, __builtin_bswap32 and
+ __builtin_bswap64.
+
+ * internal.h (swap32): Use the configure result for the condition to
+ use __builtin_bswap32.
+ (swap64): Use the configure result for the condition to use
+ __builtin_bswap64.
+
+ * bignum.c (ones): Use the configure result for the condition to use
+ __builtin_popcountl.
+ (bary_unpack_internal): Use appropriate types for swap argument.
+
+Sun Jul 14 22:21:11 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_subb): Support xn < yn.
+ (bigsub_core): Removed.
+ (bigsub): Don't compare before subtraction. Just subtract and
+ get the two's complement if the subtraction causes a borrow.
+
+Sun Jul 14 00:36:03 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (DIGSPERLONG): Unused macro removed.
+ (DIGSPERLL): Ditto.
+
+Sun Jul 14 00:32:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_aref): Less scan when the number is negative.
+
+Sun Jul 14 00:17:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_shift): Avoid signed integer overflow.
+
+Sun Jul 14 00:14:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_precheck): Use bary_small_lshift or
+ bary_mul_normal if xl is 1.
+
+Sat Jul 13 22:58:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_shift3): New function.
+ big_lshift and big_rshift are merged.
+ (big_shift2): New function.
+ (big_lshift): Use big_shift3.
+ (big_rshift): Ditto.
+ (check_shiftdown): Removed.
+ (rb_big_lshift): Use big_shift2 and big_shift3.
+ (rb_big_rshift): Ditto.
+ (big_lshift): Removed.
+ (big_rshift): Ditto.
+
+Sat Jul 13 15:51:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_small_lshift): Use size_t instead of long.
+ (bary_small_rshift): Ditto.
+
+Sat Jul 13 15:33:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_small_lshift): Functions moved to remove
+ declaration.
+ (bary_small_rshift): Ditto.
+
+Sat Jul 13 12:27:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_associate_index): fill new terminator length, not
+ old one.
+
+Sat Jul 13 12:24:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32: move from ext/dl and ext/fiddle. since ext/extmk.rb
+ builds extensions in alphabetical order, compiled?('fiddle') under
+ ext/dl makes no sense.
+
+Sat Jul 13 09:26:09 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (biglsh_bang): Removed.
+ (bigrsh_bang): Ditto.
+ (bigmul1_toom3): Use bary_small_lshift and bary_small_rshift.
+
+Sat Jul 13 01:04:43 2013 Zachary Scott <e@zzak.io>
+
+ * lib/rubygems/psych_additions.rb: Ignore Psych docs here
+
+Fri Jul 12 18:10:46 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/fiddle/win32/lib/win32/registry.rb
+ (Win32::Registry::API#make_wstr): same as r41922.
+
+Fri Jul 12 16:28:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_associate_index): refill the terminator if it
+ becomes longer than before. [ruby-dev:47500] [Bug #8624]
+
+ * string.c (str_null_char, str_fill_term): get rid of out of bound
+ access.
+
+ * string.c (rb_str_fill_terminator): add a parameter for the length of
+ new terminator.
+
+Fri Jul 12 11:26:25 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_reject_bang): do not call rb_hash_foreach() if RHash
+ has ntbl and it is empty.
+
+Fri Jul 12 11:17:41 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (recursive_hash): use RHASH_SIZE() to check hash size.
+
+Fri Jul 12 00:20:00 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_size): use RHASH_SIZE().
+
+Fri Jul 12 00:08:24 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_values): set array capa to RHASH_SIZE().
+
+Thu Jul 11 23:54:45 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_keys): set array capa to RHASH_SIZE().
+
+Thu Jul 11 21:30:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_pow): undef pow to get rid of infinite
+ recursive call. re-fix [Bug #8495]. [ruby-core:55923] [Bug #8621]
+
+Thu Jul 11 20:18:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/win32/lib/win32/registry.rb (Win32::Registry::API#make_wstr):
+ remove workaround to append WCHAR terminator.
+
+ * transcode.c (str_encode_associate): fill terminator after conversion.
+
+ * string.c (rb_enc_str_new, rb_str_set_len, rb_str_resize): fill
+ minimum length of the encoding as the terminator.
+
+ * string.c (str_buf_cat, rb_str_buf_append, rb_str_splice_0): ditto.
+
+ * string.c (str_make_independent_expand, rb_str_modify_expand): make
+ the capacity enough for multi-byte terminator.
+
+ * string.c (rb_string_value_cstr): fill minimum length of the encoding
+ as the terminator.
+
+ * string.c (rb_string_value_cstr): check null char in char, not in
+ byte.
+
+Thu Jul 11 14:48:35 2013 Zachary Scott <e@zzak.io>
+
+ * array.c: Replace confusing example for #reverse_each in overview
+ Patch by Earl St Sauver [Fixes documenting-ruby/ruby-12]
+ https://github.com/documenting-ruby/ruby/pull/12
+
+Thu Jul 11 14:22:37 2013 Zachary Scott <e@zzak.io>
+
+ * test/drb/ut_eq.rb: Use localhost for drb tests [Bug #7311]
+ Patch by Vit Ondruch [ruby-core:49101]
+ * test/drb/ut_array.rb: ditto
+ * test/drb/ut_array_drbssl.rb: ditto
+
+Thu Jul 11 13:48:03 2013 Zachary Scott <e@zzak.io>
+
+ * sprintf.c: Fix typo patch by @hynkle [Fixes GH-357]
+ https://github.com/ruby/ruby/pull/357
+
+Thu Jul 11 13:00:34 2013 Zachary Scott <e@zzak.io>
+
+ * lib/securerandom.rb: Refactor conditions by Rafal Chmiel
+ [Fixes GH-326] https://github.com/ruby/ruby/pull/326
+
+Thu Jul 11 12:04:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Don't use toom3 after once karatsuba is chosen.
+ (mulfunc_t): New type.
+ (bary_mul_toom3_start): Renamed from bary_mul.
+ (bary_mul_karatsuba_start): Renamed from bary_mul.
+ (bary_mul_balance_with_mulfunc): Renamed from bary_mul_balance and
+ new argument, mulfunc, is added.
+ (rb_big_mul_balance): Invoke bary_mul_balance_with_mulfunc with
+ bary_mul_toom3_start.
+ (bary_mul_karatsuba): Invoke bary_mul_karatsuba_start instead of
+ bary_mul.
+ (bary_mul_precheck): Extracted from bary_mul.
+ (bary_mul_karatsuba_branch): Extracted from bary_mul.
+ (bary_mul_karatsuba_start): New function to call bary_mul_precheck
+ and bary_mul_karatsuba_branch.
+ (bary_mul_toom3_branch): Extracted from bary_mul.
+ (bary_mul_toom3_start): New function to call bary_mul_precheck and
+ bary_mul_toom3_branch.
+ (bary_mul): Just call bary_mul_toom3_start.
+ Arguments for work memory are removed.
+ (rb_cstr_to_inum): Follow the bary_mul change.
+ (bigmul0): Ditto.
+
+Thu Jul 11 10:46:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/probes_to_wiki.rb: fix usage comment. use Enumerable#grep
+ which yields each elements to reduce unnecessary array.
+
+Thu Jul 11 10:09:18 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c (rb_daemon): daemon(3) is implemented with fork(2).
+ Therefore it needs rb_thread_atfork(). (and revert r41903)
+
+Thu Jul 11 03:22:10 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * tool/probes_to_wiki.rb: adding a script to convert probes.d to wiki
+ format for easy wiki updates.
+
+Thu Jul 11 00:54:07 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * man/ri.1: Incorrect use of .Dd macro [Bug #8620] by Tristan Hill
+
+Thu Jul 11 00:48:29 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/delegate.rb: Add example for __setobj__ and __getobj__
+ [Bug #8615] Patch by Caleb Thompson
+
+Wed Jul 10 23:29:22 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/logger.rb: Use :call-seq: for method signature rdoc
+
+Wed Jul 10 23:23:18 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/logger.rb (#add): Remove incorrect rdoc for return value
+ [Bug #8567] Reported by Tim Pease.
+
+Wed Jul 10 23:12:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_subpos): make public function.
+
+Wed Jul 10 22:44:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Add a static assertion for RBIGNUM_EMBED_LEN_MAX.
+
+Wed Jul 10 22:31:25 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * string.c (rb_str_index): cache single byte flag and some
+ cosmetic changes.
+
+Wed Jul 10 22:03:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_2comp): Don't use bary_plus_one.
+ (bary_add_one): Replaced by the implementation of bary_plus_one.
+
+Wed Jul 10 20:48:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (sizeof_bdigit_dbl): check sizeof(BDIGIT_DBL).
+
+ * internal.h (STATIC_ASSERT): move from enum.c.
+
+Wed Jul 10 20:08:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (SIZEOF_BDIGIT_DBL): Add a ifdef guard for test.
+
+Wed Jul 10 14:18:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (fork_daemon): kill the other threads all and abandon the
+ kept mutexes.
+
+Wed Jul 10 11:35:36 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/net/http/test_http.rb (TestNetHTTP_v1_2#test_get,
+ TestNetHTTP_v1_2_chunked#test_get): shouldn't check
+ HttpResponse#decode_content if Zlib is not available.
+ ko1 complained via IRC.
+
+Wed Jul 10 10:20:07 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/rbinstall.rb: always require rubygems to stabilize rubygems
+ related status like whether Gem::Specification is defined or not.
+
+ * tool/rbinstall.rb (Gem::Specification.unresolved_deps): define stub.
+
+Wed Jul 10 08:21:15 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems 2.1
+ * test/rubygems: Ditto.
+
+Wed Jul 10 07:34:34 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/ext/ext_conf_builder.rb: Remove siteconf file after
+ building the gem.
+ * test/rubygems/test_gem_ext_ext_conf_builder.rb: Test for the above.
+
+ * lib/rubygems/psych_tree.rb (module Gem): Add backward compatibility
+ for r41148
+
+ * test/rubygems/test_gem_package.rb: Add backward compatibility for
+ double-slash elimination.
+
+Wed Jul 10 06:22:27 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_parse.c (date_zone_to_diff): [ruby-core:55831].
+
+Wed Jul 10 00:41:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul): x*1 is x.
+
+Tue Jul 9 22:24:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul1): No need to invoke MEMZERO at last.
+ (bary_mul_single): Invoke MEMZERO here.
+
+Tue Jul 9 21:40:01 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_text.rb: Add missing tests for Text#<<.
+ Reported by nagachika. Thanks!!!
+
+Tue Jul 9 18:02:38 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/fileutils.rb (FileUtils#chown_R): Do not skip traversal even
+ if user and group are both nil, to be consistent with #chown and
+ other commands.
+
+Tue Jul 9 17:58:26 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/fileutils/test_fileutils.rb
+ (TestFileUtils#assert_output_lines): New utility assertion
+ method for testing verbose output.
+
+Tue Jul 9 17:43:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/test_tracer.rb: catch up recent rubygems changes.
+
+Tue Jul 9 16:58:30 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/{dl,fiddle}/win32/lib/win32/registry.rb: hope that the final
+ resolution to fix the failure of test-all. and includes Win64
+ support (fixed a potential bug).
+
+Tue Jul 9 15:57:20 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * object.c: Fix rdoc for Kernel#<=>. [Fixes GH-352]
+
+Tue Jul 9 15:53:51 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/fileutils.rb (FileUtils#mode_to_s): Define mode_to_s() also
+ as singleton method, or FileUtils.chmod fails in verbose mode.
+
+Tue Jul 9 15:16:02 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/fileutils/fileasserts.rb
+ (Test::Unit::FileAssertions#assert_not_symlink): Add a missing
+ optional argument "message".
+
+Tue Jul 9 15:03:24 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user
+ and group are both nil, print ":".
+
+Tue Jul 9 12:47:08 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * io.c (appendline): use READ_CHAR_PENDING_XXX macros and
+ RSTRING_END().
+
+ * io.c (rb_io_getline_1): rewrite nested if statement into one
+ statement.
+
+Tue Jul 9 11:04:35 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/{dl,fiddle}/win32/lib/win32/registry.rb (Win32::Registry#check):
+ should report the position of the error.
+
+ * ext/{dl,fiddle}/win32/lib/win32/registry.rb
+ (Win32::Registry#QueryValue): workaround for test-all crash.
+
+Tue Jul 9 10:27:56 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/{dl,fiddle}/win32/lib/win32/registry.rb
+ (Win32::Registry.expand_environ): use suitable encoding for the
+ string.
+
+ * ext/{dl,fiddle}/win32/lib/win32/registry.rb (Win32::Registry#read):
+ should return REG_SZ, REG_EXPAND_SZ and REG_MULTI_SZ values with
+ the expected encoding -- assumed as the same encoding of name.
+
+Tue Jul 9 10:02:45 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/{dl,fiddle}/win32/lib/win32/registry.rb
+ (Win32::Registry::Error#initialize): use suitable encoding for the
+ string.
+
+Tue Jul 9 09:46:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/win32/lib/win32/registry.rb (Win32::Registry.expand_environ):
+ use suitable encoding for the string. fixed a test-all error of
+ r41838.
+
+ * ext/fiddle/win32/lib/win32/registry.rb: same changes of r41838 and
+ this revision of dl's win32/registry.rb.
+
+Tue Jul 9 07:39:45 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.0.4. See
+ https://github.com/rubygems/rubygems/blob/2.0/History.txt for changes
+
+Tue Jul 9 01:47:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (biglsh_bang): Don't shift a BDIGIT with BITSPERDIG bits.
+ (bigrsh_bang): Ditto.
+
+Tue Jul 9 01:17:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigrsh_bang): Fix bignum digits overrun.
+
+Tue Jul 9 00:46:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (biglsh_bang): Fix bignum digits under-run.
+
+Mon Jul 8 23:36:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/win32/lib/win32/registry.rb (Error, API): use WCHAR
+ interfaces. c.f. [Bug #8508]
+
+Mon Jul 8 23:13:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_pow): move from win32.h and disable strict
+ ANSI mode macro to let _controlfp() stuff defined.
+ [ruby-core:55312] [Bug #8495]
+
+ * numeric.c (finite): add declaration for strict ANSI.
+ [ruby-core:55312] [Bug #8495]
+
+ * thread_win32.c (w32_thread_start_func, thread_start_func_1),
+ (timer_thread_func): use __stdcall instead of _stdcall which is
+ unavailable in strict ANSI mode. [ruby-core:55312] [Bug #8495]
+
+ * win32/win32.c (gettimeofday): use __cdecl instead of _cdecl.
+
+Mon Jul 8 22:41:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul): Arguments for work memory added.
+ (bary_mul_balance): Ditto.
+ (bary_mul_karatsuba): Ditto.
+
+Mon Jul 8 22:03:30 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_sq_fast): New function for testing.
+ (rb_big_mul_toom3): Ditto.
+
+ * internal.h (rb_big_sq_fast): Declared.
+ (rb_big_mul_toom3): Ditto.
+
+Mon Jul 8 21:59:34 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_balance): Initialize a local variable to suppress
+ a warning.
+
+Mon Jul 8 20:55:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_balance): Reduce work memory.
+
+Mon Jul 8 08:26:15 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * test/openssl/test_pkey_ec.rb: Skip tests for "Oakley" curves as
+ they are not suitable for ECDSA.
+ [ruby-core:54881] [Bug #8384]
+
+Mon Jul 8 08:03:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul): Add a RB_GC_GUARD.
+
+Sun Jul 7 23:56:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_karatsuba): Unreachable code removed. Remove
+ several branches.
+
+Sun Jul 7 22:59:06 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_big_mul_normal): Declared.
+ (rb_big_mul_balance): Ditto.
+ (rb_big_mul_karatsuba): Ditto.
+
+ * bignum.c (rb_big_mul_normal): New function for tests.
+ (rb_big_mul_balance): Ditto.
+ (rb_big_mul_karatsuba): Ditto.
+
+Sun Jul 7 19:21:30 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Reorder functions to decrease forward reference.
+
+Sun Jul 7 14:41:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: (bigsub_core): Use bary_sub.
+ (bary_sub): Returns a borrow flag. Use bary_subb.
+ (bary_subb): New function for actually calculating subtraction with
+ borrow.
+ (bary_sub_one): New function.
+ (bigadd_core): Use bary_add.
+ (bary_add): Returns a carry flag. Use bary_addc.
+ (bary_addc): New function for actually calculating addition with
+ carry.
+ (bary_add_one): New function.
+ (bary_muladd_1xN): Extracted from bary_mul_normal.
+ (bigmul1_normal): Removed.
+ (bary_mul_karatsuba): New function.
+ (bary_mul1): Invoke rb_thread_check_ints after bary_mul_normal.
+ (bary_mul): Remove most and least significant zeros before actual
+ multiplication. Use bary_sq_fast, bary_mul_balance,
+ bary_mul_karatsuba and bigmul1_toom3 as bigmul0.
+ (bigmul1_balance): Removed.
+ (bigmul1_karatsuba): Removed.
+ (bigsqr_fast): Removed.
+ (bary_sparse_p): Extracted from big_sparse_p.
+ (big_sparse_p): Removed.
+ (bigmul0): Use bary_mul.
+
+Sun Jul 7 11:54:33 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * NEWS: Add REXML::Text#<< related updates.
+
+Sun Jul 7 11:49:19 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/text.rb (REXML::Text#<<): Support appending in not
+ "raw" mode. [Bug #8602] [ruby-dev:47482]
+ Reported by Ippei Obayashi. Thanks!!!
+
+Sun Jul 7 11:43:13 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/text.rb (REXML::Text#<<): Support method chain use by "<<"
+ like other objects.
+
+Sun Jul 7 11:34:18 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/text.rb (REXML::Text#clear_cache): Extract common
+ cache clear code.
+
+Sun Jul 7 11:01:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_DTRACE_POSTPROCESS): dtrace version SUN D 1.11
+ introduces a check in the dtrace compiler to ensure that probes
+ actually exist. If there are no probes, then the -G step will
+ fail. As this test is only being used to determine whether -G is
+ necessary (for instance, on OSX it is not), adding a real probe to
+ the conftest allows it to succeed on newer versions of dtrace.
+ Patch by Eric Saxby <sax AT livinginthepast.org> at
+ [ruby-core:55826]. [Fixes GH-351], [Bug #8606].
+
+Sun Jul 7 10:07:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_sq_fast): Extracted from bigsqr_fast and
+ ensure not to access zds[2*xn].
+ (bigsqr_fast): Allocate the result bignum with 2*xn words.
+
+Sat Jul 6 07:37:43 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * ext/openssl/ossl_pkey_ec.c: Ensure compatibility to builds of
+ OpenSSL with OPENSSL_NO_EC2M defined, but OPENSSL_NO_EC not
+ defined.
+ * test/openssl/test_pkey_ec.rb: Iterate over built-in curves
+ (and assert their non-emptiness!) instead of hard-coding them, as
+ this may cause problems with respect to the different availability
+ of individual curves in individual OpenSSL builds.
+ [ruby-core:54881] [Bug #8384]
+
+ Thanks to Vit Ondruch for providing the patch!
+
+Sat Jul 6 07:12:39 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * test/openssl/test_x509crl.rb: Remove unused variable.
+ [ruby-core:53501] [Bug #8114]
+
+ Thanks, Vipul Amler, for pointing this out!
+
+Sat Jul 6 06:37:10 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * ext/openssl/ossl.c: Provide CRYPTO_set_locking_callback() and
+ CRYPTO_set_id_callback() callback functions ossl_thread_id and
+ ossl_lock_callback to ensure the OpenSSL extension is usable in
+ multi-threaded environments.
+ [ruby-core:54900] [Bug #8386]
+
+ Thanks, Dirkjan Bussink, for the patch!
+
+Sat Jul 6 06:06:16 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * lib/openssl/ssl.rb: Fix SSL client connection crash for SAN marked
+ critical.
+ The patch for CVE-2013-4073 caused SSL crash when a SSL server returns
+ the certificate that has critical SAN value. X509 extension could
+ include 2 or 3 elements in it:
+
+ [id, criticality, octet_string] if critical,
+ [id, octet_string] if not.
+
+ Making sure to pick the last element of X509 extension and use it as
+ SAN value.
+ [ruby-core:55685] [Bug #8575]
+
+ Thank you @nahi for providing the patch!
+
+Sat Jul 6 04:49:38 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: register time objects so
+ they are referenced as ids during output.
+ * test/psych/test_date_time.rb: corresponding test.
+
+Fri Jul 5 20:46:39 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic): this
+ assertion doesn't seems to be checking the unicode string on command
+ line, but seems to be checking how to treat the unicode string from
+ stdin. so, should escape '\' before 'u'. this fixes a test failure
+ on Windows.
+
+Fri Jul 5 19:05:40 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): Fix the
+ wrong output message when user is nil, which should be "chown
+ :group file" instead of "chown group file".
+
+Fri Jul 5 16:21:56 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/ruby/test_regexp.rb
+ (TestRegexp#test_options_in_look_behind)
+ (TestRegexp#assert_match_at): Add tests for another problem
+ fixed in Onigmo 5.13.5. Previously Onigmo did not allow option
+ enclosures in look-behind, which makes it impossible to
+ interpolate a regexp into another in the middle of a look-behind
+ pattern. cf. https://github.com/k-takata/Onigmo/pull/17
+
+ * test/ruby/test_regexp.rb
+ (TestRegexp#test_options_in_look_behind)
+ (TestRegexp#assert_match_at): Parse regexps in run time rather
+ than in compile time.
+
+Fri Jul 5 12:14:40 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_notfound): after
+ r41710, the path of command uses backslash as the separator on
+ Windows.
+
+Fri Jul 5 11:29:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (assert_raise_with_message): move from
+ test/fileutils/test_fileutils.rb. this is still experimental and
+ the interface may be changed.
+
+Fri Jul 5 11:08:00 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (w32_spawn): r41710 made that if the command starts with
+ a quote and includes slash, removed the top quote and NOT removed the
+ last quote.
+ this fixes test failures on test/ruby/test_process.rb and
+ test/webrick.
+
+Fri Jul 5 09:53:15 2013 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/mkmf.rb (CONFIG['CPPOUTFILE']): fix r41769; CONFIG['CPPOUTFILE']
+ may be nil.
+
+Fri Jul 5 05:39:53 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BARY_MUL1): Renamed from BARY_MUL.
+ (bary_mul1): Renamed from bary_mul.
+ (bary_mul): Renamed from bary_mul2.
+
+Fri Jul 5 04:58:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_balance): Extracted from bigmul1_balance and
+ use bary_mul2 and bary_add to decrease allocations.
+
+Fri Jul 5 02:14:00 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): Fix the wrong
+ character class [+-=], which happened to match all desired
+ characters but also match undesired characters.
+
+ * lib/fileutils.rb (FileUtils.chmod{,_R}): Enhance the symbolic
+ mode parser to support the permission symbols u/g/o and multiple
+ actions as defined in SUS, so that chmod("g=o+w", file) works as
+ expected. Invalid symbolic modes are now rejected with
+ ArgumentError.
+
+Fri Jul 5 00:25:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (have_framework): allow header file to check.
+ [ruby-core:55745] [Bug #8593]
+
+Thu Jul 4 22:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * object.c (rb_obj_equal): Fixed an rb_obj_equal documentation typo
+ where "a" was used instead of "obj".
+ Fixes GH-349. Patch by @adnandoric
+
+Thu Jul 4 20:39:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * tool/make-snapshot: Exit with EXIT_FAILURE when it fails.
+
+Thu Jul 4 20:20:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (maxpow_in_bdigit_dbl): Use tables if available.
+ (maxpow_in_bdigit): Ditto.
+ (U16): New macro.
+ (U32): Ditto.
+ (U64): Ditto.
+ (U128): Ditto.
+ (maxpow16_exp): New table.
+ (maxpow16_num): New table.
+ (maxpow32_exp): New table.
+ (maxpow32_num): New table.
+ (maxpow64_exp): New table.
+ (maxpow64_num): New table.
+ (maxpow128_exp): New table.
+ (maxpow128_num): New table.
+
+Thu Jul 4 18:25:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_cstr_to_inum): Avoid temporary buffer allocation except
+ very big base non-power-of-2 numbers.
+
+Thu Jul 4 15:51:56 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_succ): use ONIGENC_MBCLEN_CHARFOUND_P correctly.
+
+ * string.c (rb_str_dump): ditto.
+
+Thu Jul 4 10:04:11 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c (): Merge Onigmo 5.13.5 23b523076d6f1161.
+
+ * [bug] (thanks Akinori MUSHA and Ippei Obayashi)
+ Fix a renumbering bug in condition regexp with a named
+ capture. [Bug #8583]
+ * [spec] (thanks Akinori MUSHA)
+ Allow ENCLOSE_OPTION in look-behind.
+
+Thu Jul 4 00:36:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (SIGNED_INTEGER_MAX): suppress warning C4146 on VC6.
+ seems a logical ORed expression becomes unsigned.
+
+Thu Jul 4 00:13:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby_atomic.h (rb_w32_atomic_cas): call InterlockedCompareExchange
+ directly.
+
+ * ruby_atomic.h (ATOMIC_CAS): fix missing function call.
+
+Wed Jul 3 23:47:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby_atomic.h (ATOMIC_CAS): suppress C4022 and C4047 warnings in
+ VC6. only InterlockedCompareExchange is declared using PVOID.
+
+Wed Jul 3 22:29:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (ruby_digit36_to_number_table): Declared.
+
+ * util.c (ruby_digit36_to_number_table): Moved from scan_digits.
+
+ * bignum.c (conv_digit): Use ruby_digit36_to_number_table.
+
+ * pack.c (hex2num): Ditto.
+
+Wed Jul 3 18:12:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (install_dirs): revert DESTDIR prefix by r39841, since
+ it is fixed by r41648. [ruby-core:55760] [Bug #8115]
+
+Wed Jul 3 14:15:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (do_stat): use rb_w32_ustati64() in win32.c to get rid of
+ mysterious behavior of FindFirstFile() Windows API which treat "<"
+ and ">" like as wildcard characters. [ruby-core:55764] [Bug #8597]
+
+Wed Jul 3 12:06:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (maxpow_in_bdigit): Renamed from calc_hbase and return
+ maxpow.
+
+Tue Jul 2 23:47:50 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (roomof): Cast to long.
+ (rb_ull2big): Fix bignew arguments.
+
+Tue Jul 2 21:17:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_cstr_to_inum): Merge two temporary buffers.
+
+Tue Jul 2 20:25:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_cstr_to_inum): Use BDIGIT_DBL to collect adjacent digits.
+ (BDIGIT_DBL_MAX): New macro.
+ (maxpow_in_bdigit_dbl): New function.
+
+Tue Jul 2 17:23:33 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * doc/syntax/refinements.rdoc: add description of Module#using and
+ refinement inheritance by module inclusion.
+
+Tue Jul 2 17:22:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h: add EUC-JP and Windows-31J.
+
+ * re.c (rb_char_to_option_kcode): use built-in encoding indexes in
+ internal.h.
+
+ * internal.h: add UTF8-MAC.
+
+ * dir.c (rb_utf8mac_encoding): use built-in encoding indexes in
+ internal.h.
+
+ * internal.h: add UTF-{16,32} dummy encodings.
+
+ * string.c (rb_str_inspect, str_scrub0): use built-in encoding indexes
+ in internal.h.
+
+ * internal.h: add UTF-{16,32}{BE,LE}.
+
+ * io.c (io_strip_bom): use built-in encoding indexes in internal.h.
+
+ * internal.h (rb_{ascii8bit,utf8,usascii}_encindex): use built-in
+ encoding indexes for optimization.
+
+ * encoding.c (enc_inspect, rb_locale_encindex),
+ (enc_set_filesystem_encoding, rb_filesystem_encindex): use built-in
+ encoding indexes directly.
+
+ * encoding.c (rb_enc_set_index, rb_enc_associate_index): validate
+ argument encoding index.
+
+ * include/ruby/encoding.h (ENCODING_SET): use rb_enc_set_index()
+ instead of setting inlined bits directly.
+
+ * encoding.c (rb_enc_init): register preserved indexes.
+
+ * internal.h (ruby_preserved_encindex): move from encoding.c.
+
+Tue Jul 2 11:14:36 2013 Shota Fukumori <sorah@cookpad.com>
+
+ * lib/mkmf.rb (try_config): Fix to not replace $LDFLAGS with $libs
+ (1.9.3 behavior) [ruby-core:55752] [Bug #8595]
+
+Tue Jul 2 00:39:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): Don't try mismatched
+ address family if already failed.
+
+Mon Jul 1 23:07:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * template/encdb.h.tmpl: define encoding index macros to use the index
+ statically from C source.
+
+Mon Jul 1 22:57:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul2): New function.
+ (rb_cstr_to_inum): Use a better algorithm to compose the result
+ if input length is very long.
+
+Mon Jul 1 20:22:00 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * ext/bigdecimal/bigdecimal.h (RB_UNUSED_VAR, UNREACHABLE):
+ import macros from ruby.h for 1.9.3.
+ [Bug #8588] [ruby-core:55730]
+
+ * ext/bigdecimal/bigdecimal.gemspec: Bump version to 1.2.1.
+
+Mon Jul 1 20:03:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): Use an address
+ family for local address which is different to the remote
+ address if no other choice.
+
+Mon Jul 1 15:05:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/csv.rb (CSV#<<): use StringIO#set_encoding instead of creating
+ new StringIO instance with String#force_encoding, forcing encoding
+ discards the cached coderange bits and can make further operations
+ very slow. [ruby-core:55714] [Bug #8585]
+
+ * ext/stringio/stringio.c (strio_write): keep coderange of
+ ptr->string.
+
+ * string.c (rb_enc_cr_str_buf_cat, rb_str_append): consider an empty
+ string 7bit-clean and should not discard cached coderange of string
+ to be appended.
+
+Mon Jul 1 12:56:41 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_using_module): activate refinements in the ancestors of
+ the argument module to support refinement inheritance by
+ Module#include. [ruby-core:55671] [Feature #8571]
+
+ * test/ruby/test_refinement.rb: related test.
+
+Mon Jul 1 12:02:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_cstr_to_inum): Skip leading zeros.
+
+Mon Jul 1 00:59:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (nlz16): New function.
+ (nlz32): Ditto.
+ (nlz64): Ditto.
+ (nlz128): Ditto.
+ (nlz): Redefined using an above function.
+ (bitsize): New macro.
+ (rb_cstr_to_inum): Use bitsize instead of nlz.
+
+Sun Jun 30 22:40:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * lib/prime.rb: Corrected a few comments. Patch by @Nullset14.
+ Fixes GH-346.
+
+Sun Jun 30 21:53:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_cstr_to_inum): Use rb_integer_unpack if base is a power
+ of 2.
+
+Sun Jun 30 10:59:23 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (join_argv): use backslash instead of slash in program
+ path, otherwise cannot invoke "./c\u{1ee7}a.exe" for some reason.
+ [ruby-core:24309] [Bug #1771]
+
+ * io.c (spawnv, spawn): use UTF-8 spawn family. [Bug #1771]
+
+ * process.c (proc_exec_sh, proc_spawn_cmd, proc_spawn_sh): ditto.
+
+ * win32/win32.c (translate_char, join_argv, has_redirection): make
+ codepage aware.
+
+ * win32/win32.c (rb_w32_udln_find_exe_r, rb_w32_udln_find_file_r):
+ codepage independent versions.
+
+ * win32/win32.c (w32_spawn): extract codepage aware code from
+ rb_w32_spawn().
+
+ * win32/win32.c (rb_w32_uspawn): add UTF-8 version function.
+
+ * win32/win32.c (w32_aspawn_flags): extract codepage aware code from
+ rb_w32_aspawn_flags().
+
+ * win32/win32.c (rb_w32_uaspawn_flags, rb_w32_uaspawn_flags): add
+ UTF-8 version functions.
+
+ * win32/win32.c (w32_getenv): extract codepage aware code from
+ rb_w32_ugetenv() and rb_w32_getenv().
+
+ * win32/win32.c (w32_stati64): extract codepage aware code from
+ rb_w32_ustati64() and rb_w32_stati64().
+
+ * dln.h (DLN_FIND_EXTRA_ARG, DLN_FIND_EXTRA_ARG_DECL): allow extra
+ arguments to dln_find_{exe,file}_r().
+
+ * dln_find.c (dln_find_exe_r, dln_find_file_r): add extract arguments.
+
+ * process.c (EXPORT_STR, EXPORT_DUP): convert to default process
+ encoding if defined.
+
+ * process.c (check_exec_env_i): convert environment variables too.
+
+ * process.c (rb_exec_fillarg): convert program path and arguments too.
+
+Sun Jun 30 01:57:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_rshift): Use abs2twocomp and twocomp2abs_bang.
+
+Sun Jun 30 00:14:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (RBIGNUM_SET_NEGATIVE_SIGN): New macro.
+ (RBIGNUM_SET_POSITIVE_SIGN): Ditto.
+ (rb_big_neg): Inline get2comp to avoid double negation.
+
+Sat Jun 29 23:26:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_neg): Extracted from bary_2comp.
+ (bary_plus_one): Extracted from bary_2comp.
+ (bary_2comp): Use bary_neg and bary_plus_one.
+ (big_extend_carry): Extracted from get2comp.
+ (get2comp): Use big_extend_carry.
+ (rb_integer_unpack): Use big_extend_carry.
+ (rb_big_neg): Use bary_neg.
+
+Sat Jun 29 22:31:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_2comp): Simplified.
+
+Sat Jun 29 09:33:53 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigor_int): Return -1 if y == -1.
+
+Sat Jun 29 09:07:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigor_int): Use RB_GC_GUARD.
+ (bigxor_int): Take xn and hibitsx arguments. Use twocomp2abs_bang.
+ (rb_big_xor): Use abs2twocomp and twocomp2abs_bang.
+
+Sat Jun 29 08:19:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigand_int): Don't apply bitwise and for BDIGIT and long.
+ (bigor_int): Take xn and hibitsx arguments. Use twocomp2abs_bang.
+ (rb_big_or): Use abs2twocomp and twocomp2abs_bang.
+
+Fri Jun 29 01:08:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * numeric.c (fix_mul): remove FIT_SQRT_LONG test as it was causing
+ fix_mul to return an incorrect result for -2147483648*-2147483648
+ on 64 bit platforms
+
+ * test/ruby/test_integer_comb.rb (class TestIntegerComb): add test case
+
+Fri Jun 28 12:26:53 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_and): Allocate new bignum with same size to shorter
+ argument if it's high bits are zero.
+
+Fri Jun 28 12:14:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): Don't use local
+ addresses which address family is different to remote address.
+
+Fri Jun 28 08:06:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigand_int): Add arguments, xn and hibitsx.
+ Use twocomp2abs_bang.
+
+Thu Jun 27 23:58:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (abs2twocomp_bang): Removed.
+ (abs2twocomp): Take n_ret argument to return actual length.
+ (rb_big_and): Follow above change.
+
+Thu Jun 27 22:52:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (get2comp): Use bary_2comp.
+ (abs2twocomp_bang): New function.
+ (abs2twocomp): New function.
+ (twocomp2abs_bang): New function.
+ (rb_big_and): Use abs2twocomp and twocomp2abs_bang.
+
+Thu Jun 27 20:03:13 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/ssl.rb (verify_certificate_identity): fix
+ hostname verification. Patched by nahi.
+
+ * test/openssl/test_ssl.rb (test_verify_certificate_identity): test for
+ above.
+
+
+Thu Jun 27 00:23:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_pow): Retry if y is a Bignum and it is
+ representable as a Fixnum.
+ Use rb_absint_numwords.
+
+Wed Jun 26 23:53:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode): fix typo.
+ Fixes GH-343. Patch by @jgarber.
+
+Wed Jun 26 23:22:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (rb_enumeratorize_with_size): use strict definition
+ rb_enumerator_size_func.
+
+Wed Jun 26 23:11:14 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * gc.c (is_before_sweep): Add a missing space before a parenthesis.
+ * gc.c (rb_gc_force_recycle): Add a missing space around a parenthesis.
+
+Wed Jun 26 22:44:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_enumeratorize_with_size): cast for
+ backward compatibility.
+
+ * include/ruby/intern.h (rb_enumerator_size_func): define strict
+ function declaration for rb_enumeratorize_with_size().
+
+Wed Jun 26 21:01:22 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): skip if
+ writing a file is slow.
+ [ruby-core:55541] [Bug #8519]
+
+Wed Jun 26 16:42:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb: should use expanded values for header directories
+ unless extmk. patch by vo.x (Vit Ondruch) at [ruby-core:55653]
+ [Bug #8115], rhbz#921650.
+
+Wed Jun 26 12:48:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigxor_int): Fix a buffer over read.
+
+Wed Jun 26 12:13:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigand_int): Consider negative values.
+ (bigor_int): The allocated bignum should have enough size
+ to store long.
+ This fixes (bignum fits in a BDIGIT) | (fixnum bigger than BDIGIT)
+ on platforms which SIZEOF_BDIGITS < SIZEOF_LONG,
+ such as LP64 with 32bit BDIGIT (no int128).
+
+Wed Jun 26 12:08:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_udp.rb: Close sockets explicitly.
+ Don't use fixed port number.
+
+Wed Jun 26 07:27:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigand_int): Fix a buffer over read.
+
+Wed Jun 26 06:48:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigadd_int): Fix a buffer over read.
+
+Wed Jun 26 01:18:13 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (is_before_sweep): Add new helper function that check the object
+ is before sweep?
+ * gc.c (rb_gc_force_recycle): Have to clear mark bit if object's slot
+ already ready to minor sweep.
+
+Wed Jun 26 01:17:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigsub_int): Fix a buffer over read.
+
+Tue Jun 25 22:45:43 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_absint_singlebit_p): Use POW2_P.
+ (bary_pack): Ditto.
+ (rb_big2str0): Ditto.
+ (POW2_P): Moved to top.
+
+Tue Jun 25 22:28:07 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/rubygems/ext/builder.rb (Gem::Ext::Builder.make): Pass
+ DESTDIR via command line to override what's in MAKEFLAGS. This
+ fixes an installation problem under a package building
+ environment where DESTDIR is specified in the (parent) command
+ line. [Fixes GH-327]
+
+Tue Jun 25 21:43:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL.
+ (bary_mul_normal): Remove a useless cast.
+
+Tue Jun 25 21:26:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases when
+ the argument x is not a BigDecimal.
+ This change is based on the patch made by Heesob Park and Garth Snyder.
+ [Bug #6862] [ruby-core:47145]
+ [Fixes GH-332] https://github.com/ruby/ruby/pull/332
+
+Tue Jun 25 20:36:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2ulong): "check" argument removed.
+ (rb_big2ulong): Follow above change.
+ (rb_big2long): Ditto.
+ (rb_big_rshift): Ditto.
+ (rb_big_aref): Ditto.
+
+Tue Jun 25 20:08:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big2ulong_pack): Use rb_integer_pack.
+ (rb_big_aref): Call big2ulong with TRUE for "check" argument.
+ It should be non-effective.
+
+Tue Jun 25 19:07:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (LSHIFTX): Revert r41611.
+ The redundant expression suppresses a warning, C4293, by Visual
+ Studio.
+ http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130625T072854Z.log.html.gz#miniruby
+
+Tue Jun 25 19:03:00 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2ulong): Add a cast.
+ (big2ull): Add a specialized code for SIZEOF_LONG_LONG <=
+ SIZEOF_BDIGITS.
+
+Tue Jun 25 12:42:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_unpack_single_bdigit): Use "1 + ~u" instead of
+ "-u" to suppress warning (C4146) by Visual Studio.
+ Reported by ko1 via IRC.
+
+Tue Jun 25 12:28:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2ulong): Add code specialized for SIZEOF_LONG <=
+ SIZEOF_BDIGITS.
+ This prevents shift width warning from "num <<= BITSPERDIG".
+
+Tue Jun 25 12:23:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix oldgen/remembered_shady counting algorithm.
+
+ * gc.c (rgengc_check_shady): increment
+ `objspace->rgengc.remembered_shady_object_count' here.
+
+ * gc.c (rgengc_remember): return FALSE if obj is already remembered.
+
+ * gc.c (rgengc_rememberset_mark): make it void.
+
+ * gc.c (gc_mark_children): fix to double counting oldgen_object_count
+ at minor GC.
+
+Tue Jun 25 12:07:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (MSB): Removed.
+ (BDIGIT_MSB): Defined using BIGRAD_HALF.
+ (bary_2comp): Apply BIGLO after possible over flow of BDIGIT.
+ (get2comp): Ditto.
+ (bary_unpack_internal): Use BDIGIT_MSB.
+ Apply BIGLO after possible over flow of BDIGIT.
+ (rb_integer_unpack): Use BDIGIT_MSB.
+ (calc_hbase): Use BDIGMAX.
+ (big2dbl): Use BDIGMAX.
+ Apply BIGLO after possible over flow of BDIGIT.
+ (rb_big_neg): Apply BIGLO after possible over flow of BDIGIT.
+ (biglsh_bang): Ditto.
+ (bigrsh_bang): Ditto.
+ (bary_divmod): Use BDIGIT_MSB.
+ (bigdivrem): Ditto.
+ (bigxor_int): Apply BIGLO after possible over flow of BDIGIT.
+
+ * marshal.c (shortlen): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT).
+
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use SIZEOF_BDIGITS
+ instead of sizeof(BDIGIT).
+
+Tue Jun 25 11:40:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (big2ulong): suppress shorten-64-to-32 warning. BDIGIT can
+ be bigger than long now.
+
+ * bignum.c (LSHIFTX): remove redundant never-true expression.
+
+Tue Jun 25 00:55:54 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (typedef struct rb_objspace): Change members for monitor objects.
+ * gc.c (gc_marks_test): Check all WriteBarrier Errors and track them in obj-tree.
+ * gc.c (rgengc_check_shady): Ditto.
+ * gc.c (gc_marks): Move 2 function calls to gc_marks_test for test initialize.
+
+Mon Jun 24 23:30:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_unpack_single_bdigit): Refine code to filling
+ higher bits and use BIGLO.
+
+Mon Jun 24 22:26:31 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6):
+ ifindex() function may not be implemented on Windows. We use another
+ check for the case.
+
+Mon Jun 24 22:11:37 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_nolock):
+ skip a failing test on Windows because flock() implementation is
+ different from Unix.
+
+Mon Jun 24 22:06:14 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/rubygems/test_gem_installer.rb (test_install_extension_flat):
+ use ruby in build directory in case ruby is not installed.
+ [ruby-core:53265] [Bug #8058]
+
+Mon Jun 24 22:04:02 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * ext/dl/cfunc.c (rb_dlcfunc_call): fix conversion from Bignum to
+ pointer. sizeof(DLSTACK_TYPE) is larger than sizeof(long) on
+ Windows x64 and higher bits over sizeof(long) of DLSTACK_TYPE was
+ zero even if a pointer value was over 32 bits which causes SEGV on
+ DL::TestCPtr#test_to_ptr_io. Adding a cast solves the bug.
+
+Mon Jun 24 22:04:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * eval_error.c (warn_printf): use rb_vsprintf instead so ruby specific
+ extensions like PRIsVALUE can be used in format strings
+ * eval_error.c (error_print): use warn_print_str (alias for
+ rb_write_error_str) to print a string value instead of using
+ RSTRING_PTR and RSTRING_LEN manually
+ * eval.c (setup_exception): use PRIsVALUE instead of %s and RSTRING_PTR
+
+Mon Jun 24 20:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * compile.c (make_name_for_block): use PRIsVALUE in format string
+ instead of %s and RSTRING_PTR to protect objects from being garbage
+ collected too soon
+ * encoding.c (str_to_encindex): ditto
+ * hash.c (rb_hash_fetch_m): ditto
+ * io.c (rb_io_reopen): ditto
+ * parse.y (reg_fragment_check_gen): ditto
+ * parse.y (reg_compile_gen): ditto
+ * parse.y (ripper_assert_Qundef): ditto
+ * re.c (rb_reg_raise): ditto
+ * ruby.c (set_option_encoding_once): ditto
+ * vm_eval.c (rb_throw_obj): ditto
+
+Mon Jun 24 07:57:18 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (after_gc_sweep): Have to record malloc info before reset.
+ * gc.c (gc_prof_timer_start): Pick out part of new record creation as gc_prof_setup_new_record.
+ * gc.c (gc_prof_set_malloc_info): Move point of recording allocation size to front of mark.
+
+Mon Jun 24 02:53:09 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c: Return value in Array overview example found by @PragTob
+ [Fixes GH-336] https://github.com/ruby/ruby/pull/336
+
+Mon Jun 24 02:45:51 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c (rb_ary_zip): typo by @PragTob [Fixes GH-337]
+ https://github.com/ruby/ruby/pull/337
+
+Mon Jun 24 02:42:01 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * win32/README.win32: grammar typo by @blankenshipz [Fixes GH-334]
+ https://github.com/ruby/ruby/pull/334
+
+Mon Jun 24 00:59:35 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BIGUP): Use LSHIFTX and avoid cast to consider the type
+ of x is bigger than BDIGIT_DBL.
+ (big2ulong): Use unsigned long to store the result.
+ (big2ull): Use unsigned LONG_LONG to store the result.
+ (bigand_int): Use long for num to avoid data loss.
+ (bigor_int): Ditto.
+ (bigxor_int): Ditto.
+
+Sun Jun 23 23:05:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h (BDIGIT): Define it only if it is not defined
+ yet. This eases tests and debug.
+ (SIZEOF_BDIGITS): Ditto.
+ (BDIGIT_DBL): Ditto.
+ (BDIGIT_DBL_SIGNED): Ditto.
+ (PRI_BDIGIT_PREFIX): Ditto.
+ (PRI_BDIGIT_DBL_PREFIX): Ditto.
+ (PRIdBDIGIT): Define it only if PRI_BDIGIT_PREFIX is defined.
+ (PRIiBDIGIT): Ditto.
+ (PRIoBDIGIT): Ditto.
+ (PRIuBDIGIT): Ditto.
+ (PRIxBDIGIT): Ditto.
+ (PRIXBDIGIT): Ditto.
+ (PRIdBDIGIT_DBL): Ditto.
+ (PRIiBDIGIT_DBL): Ditto.
+ (PRIoBDIGIT_DBL): Ditto.
+ (PRIuBDIGIT_DBL): Ditto.
+ (PRIxBDIGIT_DBL): Ditto.
+ (PRIXBDIGIT_DBL): Ditto.
+
+ * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Define it only if it is
+ not defined yet.
+
+Sun Jun 23 17:29:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_unpack_single_bdigit): Use a cast.
+
+Sun Jun 23 15:38:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * bootstraptest/test_thread.rb: rescue resource limitation errors.
+
+Sun Jun 23 08:19:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_unpack_single_bdigit): Extracted from
+ bary_unpack_internal.
+
+Sun Jun 23 07:41:52 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_unpack_internal): Suppress warnings (C4146) on Visual Studio.
+ Reported by ko1 via IRC.
+
+Sun Jun 23 06:49:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h, gc.c: rename macros and functions:
+ OBJ_WB_GIVEUP() -> OBJ_WB_UNPROTECT(),
+ rb_obj_wb_giveup() -> rb_obj_wb_unprotect(),
+ rb_gc_giveup_promoted_writebarrier() ->
+ rb_gc_writebarrier_unprotect_promoted(),
+
+ * class.c, eval.c, hash.c: use OBJ_WB_UNPROTECT().
+
+Sun Jun 23 05:41:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * class.c (rb_include_class_new), eval.c (rb_using_refinement):
+ make classes/modules (who share method table) shady.
+ If module `a' and `b' shares method table m_tbl and new method
+ with iseq is added, then write barrier is applied only `a' or `b'.
+ To avoid this issue, shade such classes/modules.
+
+ * vm_method.c (rb_method_entry_make): add write barriers.
+
+Sun Jun 23 01:27:54 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bytes_zero_p): Removed.
+ (bary_pack): Don't call bytes_zero_p.
+
+Sun Jun 23 00:51:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bytes_zero_p): Extracted from bary_pack.
+ (bary_pack): Use bytes_zero_p.
+
+Sun Jun 23 00:16:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (MSB): New macro.
+ (bary_unpack_internal): Use MSB.
+ (bary_divmod): Ditto.
+ (bigdivrem): Ditto.
+
+Sat Jun 22 23:45:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_swap): New function.
+ (bary_pack): Use bary_swap.
+ (bary_unpack_internal): Ditto.
+
+Sat Jun 22 23:18:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bytes_2comp): Renamed from quad_buf_complement.
+ (bary_pack): Use bytes_2comp.
+ (rb_quad_pack): Use rb_integer_pack.
+ (rb_quad_unpack): Use rb_integer_unpack.
+
+Sat Jun 22 21:46:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_unpack): Don't allocate a Bignum if possible.
+
+Sat Jun 22 21:03:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (pack_unpack): Remove specialized unpackers for integers.
+
+Sat Jun 22 20:36:50 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_unpack_internal): Specialized unpacker implemented.
+ (bary_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION.
+ (rb_integer_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION.
+
+Sat Jun 22 18:53:10 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_pack): Support
+ INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION flag.
+ Fix byte order and word order handling in code specialized for
+ wordsize % SIZEOF_BDIGITS == 0.
+
+ * internal.h (INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION): Defined.
+
+Sat Jun 22 15:41:25 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rgengc_check_shady): add new WB miss checking
+ on RGENGC_CHECK_MODE >= 2.
+
+ (1) Save bitmaps before marking
+ (2) Run full marking
+ (3) On each traceable object,
+ (a) object was not oldgen (== newly or shady object) &&
+ (b) parent object was oldgen &&
+ (c) parent object was not remembered &&
+ (d) object was not remembered
+ then, it should be WB miss.
+
+ This idea of this checker is by Masaya Tarui <tarui@ruby-lang.org>.
+
+Sat Jun 22 15:25:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/etc/etc.c (setup_passwd): revert r41560, unnecessary
+
+Sat Jun 22 14:39:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/etc/etc.c (Init_etc): omit 'passwd' from definition of Etc::Passwd
+ if HAVE_STRUCT_PASSWD_PW_PASSWD is not defined to prevent mismatch of
+ fields and values in setup_passwd
+
+Sat Jun 22 14:35:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/dl/cfunc.c (rb_dlcfunc_call): Use rb_big_pack instead of
+ rb_big2ulong_pack and rb_big2ull.
+
+ * include/ruby/intern.h (rb_big2ulong_pack): Deprecated.
+
+Sat Jun 22 14:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/etc/etc.c (setup_passwd): pass 0 as VALUE to rb_struct_new to
+ prevent segfault if the compiler passes it as a 32 bit integer on
+ a 64 bit ruby
+
+Sat Jun 22 13:47:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_pack): MEMZERO can be used even if nails is not zero.
+
+Sat Jun 22 13:43:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
+ of %s and RSTRING_PTR
+
+ * ext/etc/etc.c (etc_getgrnam): ditto
+
+Sat Jun 22 13:07:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (CLEAR_LOWBITS): Rewritten without RSHIFTX.
+ (RSHIFTX): Removed.
+
+Sat Jun 22 10:38:03 2013 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (num2i32): Removed.
+ (pack_pack): Don't use num2i32.
+
+Sat Jun 22 09:55:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (LSHIFTX): Defined to suppress a warning.
+ (RSHIFTX): Ditto.
+ (CLEAR_LOWBITS): Use LSHIFTX and RSHIFTX.
+ (FILL_LOWBITS): Use LSHIFTX.
+ Reported by ko1 via IRC.
+
+Sat Jun 22 09:11:33 2013 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 4.7.5 (r8724)
+ * test/minitest/*: ditto
+
+Sat Jun 22 07:20:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_prof_set_heap_info, after_gc_sweep): call
+ gc_prof_set_heap_info() just after sweeping to calculate
+ live object number correctly.
+ (live object number = total generated number (before marking) -
+ total freed number (after sweeping))
+
+ * gc.c (gc_marks): record `oldgen_object_count' into current profile`
+ record directly.
+
+ * gc.c (rgengc_rememberset_mark): same for remembered_normal_objects
+ and remembered_shady_objects.
+
+Sat Jun 22 06:46:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace::profile): rename rb_objspace::profile::record to
+ records (because it points a set of records) and add a field
+ rb_objspace::profile::current_record to point a current profiling
+ record.
+
+ * gc.c: use above fields.
+
+Sat Jun 22 06:05:36 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_giveup_promoted_writebarrier): remove `rest_sweep()'
+ because all of remembered objects are called for gc_mark_children().
+
+Sat Jun 22 05:08:03 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rgengc_rememberset_mark): call gc_mark_children() for
+ remembered objects directly instead of pushing on the mark stack.
+
+Sat Jun 22 04:48:53 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for second
+ parameter `slot'. You don't need to write a cast (VALUE *) any more.
+
+ * class.c, compile.c, hash.c, iseq.c, proc.c, re.c, variable.c,
+ vm.c, vm_method.c: remove cast expressions for OBJ_WRITE().
+
+Sat Jun 22 04:37:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (slot_sweep_body): rename to slot_sweep().
+ No need to separate major/minor GC.
+
+ * gc.c (gc_setup_mark_bits): remove gc_clear_mark_bits() and unify to
+ this function.
+
+Sat Jun 22 04:20:21 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (check_bitmap_consistency): add to check flag and bitmap consistency.
+ Use this function in several places.
+
+Sat Jun 22 02:18:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_pack): Specialized packers implemented.
+ (HOST_BIGENDIAN_P): New macro.
+ (ALIGNOF): New macro.
+ (CLEAR_LOWBITS): New macro.
+ (FILL_LOWBITS): New macro.
+ (swap_bdigit): New macro.
+ (bary_2comp): Returns an int.
+
+ * internal.h (swap16): Moved from pack.c
+ (swap32): Ditto.
+ (swap64): Ditto.
+
+Fri Jun 21 21:29:49 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (typedef enum): Introduce flags of major gc reason.
+ * gc.c (garbage_collect_body): Ditto.
+ * gc.c (gc_profile_flags): Ditto.
+ * gc.c (gc_profile_dump_on): Ditto.
+
+Fri Jun 21 21:11:53 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (allocate_sorted_heaps): remove unused variable `add'.
+
+Fri Jun 21 20:50:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: constify RArray::as::ary and RArray::heap::ptr.
+ Use RARRAY_ASET() or RARRAY_PTR_USE() to modify Array objects.
+
+ * array.c, gc.c: catch up above changes.
+
+Fri Jun 21 20:32:13 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_eval.c (eval_string_with_cref): fix WB miss.
+
+Fri Jun 21 20:15:49 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: support write barrier protection for T_STRUCT.
+ Introduce the following C APIs:
+ * RSTRUCT_RAWPTR(st) returns pointer (do WB on your risk).
+ The type of returned pointer is (const VALUE *).
+ * RSTRUCT_GET(st, idx) returns idx-th value of struct.
+ * RSTRUCT_SET(st, idx, v) set idx-th value by v with WB.
+ And
+ * RSTRUCT_PTR(st) returns pointer with shady operation.
+ The type of returned pointer is (VALUE *).
+
+ * struct.c, re.c, gc.c, marshal.c: rewrite with above APIs.
+
+Fri Jun 21 19:38:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BDIGMAX): Use BIGRAD.
+ (BIGLO): Use BDIGMAX.
+ (bigdivrem1): Ditto.
+ (bigor_int): Ditto.
+ (rb_big_or): Ditto.
+
+Fri Jun 21 19:18:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (pack_pack): Move the implementation for 'c' directive after
+ pack_integer label.
+
+Fri Jun 21 19:11:56 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h, re.c: support write barrier for T_REGEXP.
+
+ Note: T_MATCH object is also easy to support write barriers.
+ However, most of T_MATCH objects are short-lived objects.
+ So I skipped to support non-shady T_MATCH.
+
+Fri Jun 21 18:56:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigsub_int): Use bdigit_roomof.
+ (bigadd_int): Ditto.
+ (bigand_int): Ditto.
+ (bigor_int): Ditto.
+ (bigxor_int): Ditto.
+
+Fri Jun 21 17:56:25 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: fix summary of benchmark result notation.
+
+Fri Jun 21 16:38:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/openssl/ossl_x509attr.c: change OSSL_X509ATTR_IS_SINGLE and
+ OSSL_X509ATTR_SET_SINGLE macros to use ->value.set rather than
+ ->set to fix compile failure
+
+Fri Jun 21 15:26:45 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_sweep): profile sweep time correctly when LAZY_SWEEP is
+ disabled.
+
+ * gc.c (gc_marks_test): store oldgen count and shady count
+ before test marking and restore them after marking.
+
+Fri Jun 21 15:07:42 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: enable lazy sweep (commit miss).
+
+Fri Jun 21 14:31:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (ruby_setenv): refine error message so include the variable
+ name.
+
+Fri Jun 21 14:15:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix to use total_allocated_object_num and heaps_used
+ at the GC time for profiler.
+
+Fri Jun 21 12:35:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: RGENGC_CHECK_MODE should be 0.
+
+Fri Jun 21 11:18:25 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_marks_body): fix to get `th' in this function.
+
+Fri Jun 21 10:21:44 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heaps_header/heaps_slot): embed bitmaps into heaps_slot.
+ no need to maintain allocation/free bitmaps.
+
+Fri Jun 21 09:22:16 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (slot_sweep_body): add counters at a time.
+
+ * gc.c (gc_profile_dump_on): fix line break position.
+
+Fri Jun 21 08:14:00 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c: refactoring bitmaps. introduce bits_t type and some Consts.
+
+Fri Jun 21 08:04:32 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix to support USE_RGENGC == 0 (disable RGenGC).
+ If USE_RGENGC==0, it caused compilation error.
+
+Fri Jun 21 08:08:11 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (lazy_sweep): Use is_lazy_sweeping()
+ * gc.c (rest_sweep): Ditto.
+ * gc.c (gc_prepare_free_objects): Ditto.
+
+Fri Jun 21 07:34:47 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_record::oldgen_objects): added.
+
+ * gc.c (gc_profile_dump_on): print the following information:
+ * Living object counts
+ * Free object counts
+ If RGENGC_PROFILE > 0 then
+ * Oldgen object counts
+ * Remembered normal object counts
+ * Remembered shady object counts
+
+Fri Jun 21 06:43:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_ull2big): Refactored.
+ (rb_uint2big): Useless code removed.
+
+Fri Jun 21 05:37:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_prof_sweep_timer_stop): accumulate sweep time only when
+ record->gc_time > 0.
+
+Fri Jun 21 00:37:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/bigdecimal: Workaround fix for bigdecimal test failures caused
+ by [ruby-dev:47413] [Feature #8509]
+
+ * ext/bigdecimal/bigdecimal.h (BDIGIT): Make it independent from the
+ definition for bignum.c.
+ (SIZEOF_BDIGITS): Ditto.
+ (BDIGIT_DBL): Ditto.
+ (BDIGIT_DBL_SIGNED): Ditto.
+ (PRI_BDIGIT_PREFIX): Undefine the definition.
+ (PRI_BDIGIT_DBL_PREFIX): Ditto.
+
+ * ext/bigdecimal/bigdecimal.c (RBIGNUM_ZERO_P): Use rb_bigzero_p.
+ (bigzero_p): Removed.
+ (is_even): Use rb_big_pack.
+
+Thu Jun 20 22:52:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigmul1_toom3): Don't call bignorm twice.
+
+Thu Jun 20 22:49:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum.
+
+Thu Jun 20 22:29:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_uint2big): Refactored.
+
+Thu Jun 20 22:24:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (dump_bignum): Use SIZEOF_BDIGITS.
+
+Thu Jun 20 22:22:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2ulong): Change the return type to unsigned long.
+ (rb_big2ulong_pack): Follow the above change.
+ (rb_big2long): Ditto.
+ (rb_big_lshift): Ditto.
+ (rb_big_rshift): Ditto.
+ (rb_big_aref): Ditto.
+
+Thu Jun 20 22:02:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_unpack_internal): Return -2 when negative overflow.
+ (bary_unpack): Set the overflowed bit if an extra BDIGIT exists.
+ (rb_integer_unpack): Set the overflowed bit.
+
+Thu Jun 20 21:17:19 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rgengc_rememberset_mark): record
+ (1) normal objects count in remember set
+ (2) shady objects count in remember set
+ each GC timing.
+
+ * gc.c (gc_profile_record_get): enable to access above information
+ and REMOVING_OBJECTS, EMPTY_OBJECTS.
+
+Thu Jun 20 18:29:26 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: Do not use GC::Profiler::disable because
+ GC::Profiler::disable prohibit to access profiling data. It should
+ be spec bug.
+
+ Skip GC::Profiler::report if RUBY_VERSION < '2.0.0'
+
+Thu Jun 20 17:59:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: stop GC::Profiler before output results.
+ Generating GC::Profiler result under profiling causes infinite loop.
+
+Thu Jun 20 17:24:24 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/gcbench.rb: don't use __dir__ to make compatible
+ with ruby 1.9.3.
+
+Thu Jun 20 16:57:19 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_app_aobench.rb: use attr_accessor/reader instead of
+ defining methods.
+
+Thu Jun 20 16:46:46 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_app_aobench.rb: added.
+
+ * benchmark/gc/aobench.rb: added.
+
+Thu Jun 20 16:28:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_so_binary_trees.rb: disable `puts' method
+ and change iteration parameter to increase execution time.
+
+ * benchmark/gc/binarytree.rb: added.
+
+Thu Jun 20 16:06:37 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/pentomino.rb: added.
+ Simply load pentomino puzzle in the benchmark/ directory.
+
+Thu Jun 20 15:32:56 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc/redblack.rb: import red black tree benchmark from
+ https://github.com/jruby/rubybench/blob/master/time/bench_red_black.rb
+
+ * benchmark/gc/ring.rb: add a benchmark. This benchmark create many
+ old objects.
+
+Thu Jun 20 15:14:00 2013 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/gc: create a directory to store GC related benchmark.
+
+ * benchmark/gc/gcbench.rb: moved from tool/gcbench.rb.
+
+ * benchmark/gc/hash(1|2).rb: ditto.
+
+ * benchmark/gc/rdoc.rb: ditto.
+
+ * benchmark/gc/null.rb: added.
+
+ * common.mk: fix rule.
+
+Thu Jun 20 14:09:54 2013 Koichi Sasada <ko1@atdot.net>
+
+ * tool/hashbench1.rb: fix parameter too. Increase temporary objects.
+
+Thu Jun 20 14:01:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * tool/hashbench1.rb: fix parameters.
+
+Thu Jun 20 14:00:34 2013 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: remove dependency from ruby.
+
+Thu Jun 20 13:14:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_check_backtrace): evaluate RARRAY_AREF only once.
+ the first argument of RB_TYPE_P is expanded twice for non-immediate
+ types.
+
+Thu Jun 20 08:09:29 2013 Koichi Sasada <ko1@atdot.net>
+
+ * tool/gcbench.rb: Summary in one line.
+
+ * common.mk: separate gcbench-hash to gcbench-hash1 and gcbench-hash2.
+
+Thu Jun 20 08:07:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BIGSIZE): New macro.
+ (bigfixize): Use BIGSIZE.
+ (big2ulong): Ditto.
+ (check_shiftdown): Ditto.
+ (rb_big_aref): Ditto.
+
+Thu Jun 20 07:46:48 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (rb_gc_writebarrier): give up rescan A and register B directly
+ if A has huge number of children.
+
+Thu Jun 20 07:30:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: add new rules `gcbench-rdoc', `gcbench-hash'.
+
+ * tool/gcbench.rb: separate GC bench framework and process.
+
+ * tool/hashbench1.rb, tool/hashbench2.rb: add two types GC bench.
+ hashbench1: many temporal objects (GC by newobj)
+ hashbench2: hash size becomes bigger and bigger (GC by malloc)
+ Two benches are executed by `gcbench-hash' rule.
+
+ * tool/rdocbench.rb: separated.
+
+Thu Jun 20 06:25:39 2013 Koichi Sasada <ko1@atdot.net>
+
+ * tool/rdocbench.rb: add summary.
+
+Thu Jun 20 06:18:01 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_total_time): check objspace->profile.next_index > 0.
+
+Thu Jun 20 05:47:41 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_prof_sweep_timer_start): fix merge miss.
+
+ * gc.c (GC_PROFILE_MORE_DETAIL): set it 0.
+
+Thu Jun 20 05:38:56 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: Accumulate sweep time to GC time.
+ Now [GC time] is [mark time] + [sweep time] + [misc].
+ ([GC time] >= [mark time] + [sweep time])
+
+ * gc.c (gc_prof_sweep_slot_timer_start/stop): rename to
+ gc_prof_sweep_timer_start/stop and locate at lazy_sweep().
+
+ * gc.c (elapsed_time_from): add a utility function.
+
+Thu Jun 20 05:08:53 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_marks): fix wrong option. FALSE means major/full GC.
+ It should be TRUE (minor marking).
+
+Thu Jun 20 02:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (waitpid): should not return 0 but wait until exit
+ unless WNOHANG is given. waiting huge process may return while
+ active, for some reason.
+
+Thu Jun 20 01:34:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bdigit_roomof): Use SIZEOF_BDIGITS.
+ (bigfixize): Refine an ifdef condition.
+ (rb_absint_size): Use bdigit_roomof.
+ (rb_absint_singlebit_p): Ditto.
+ (rb_integer_pack): Ditto.
+ (integer_pack_fill_dd): Use BITSPERDIG.
+ (integer_unpack_push_bits): Use BITSPERDIG, BIGLO and BIGDN.
+
+Thu Jun 20 01:07:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (MARKED_IN_BITMAP, FL_TEST2): return boolean value since always
+ used as boolean value.
+
+ * gc.c (MARK_IN_BITMAP, CLEAR_IN_BITMAP): evaluate bits once.
+
+Thu Jun 20 00:05:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (RVALUE_PROMOTED): fix type.
+
+Wed Jun 19 23:39:01 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_marks_test): rewrite checking code.
+ When RGENGC_CHECK_MODE >= 2, all minor marking, run normal minor
+ marking *and* major/full marking. After that, compare the results
+ and shows BUG if a object living with major/full marking but dead
+ with minor marking.
+ After detecting bugs, print references information.
+ (RGENGC_CHECK_MODE == 2, show references to dead object)
+ (RGENGC_CHECK_MODE == 3, show all references)
+
+Wed Jun 19 23:51:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigfixize): Use rb_absint_size.
+ (check_shiftdown): Ditto.
+ (big2ulong): Use bdigit_roomof.
+
+Wed Jun 19 23:32:23 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (RVALUE_PROMOTED): check consistency between oldgen flag and
+ oldgen bitmap if RGENGC_CHECK_MODE > 0.
+
+Wed Jun 19 23:29:29 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_force_recycle): clear oldgen bitmap, too.
+
+Wed Jun 19 21:02:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_uint2big): Consider environments BDIGIT is bigger than
+ long.
+ (big2ulong): Ditto.
+ (rb_big_aref): Ditto.
+ (rb_big_pack): Just call rb_integer_pack.
+ (rb_big_unpack): Just call rb_integer_unpack.
+
+Wed Jun 19 20:51:21 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * gc.c (gc_stress_get): GC.stress can be Fixnum.
+
+Wed Jun 19 19:31:30 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (DIGSPERLONG): Don't define if BDIGIT is bigger than long.
+ (DIGSPERLL): Don't define if BDIGIT is bigger than LONG_LONG
+ (rb_absint_size): Consider environments BDIGIT is bigger than long.
+ Use BIGLO and BIGDN.
+ (rb_absint_singlebit_p): Ditto.
+ (rb_integer_pack): Ditto.
+ (bigsub_int): Consider environments BDIGIT is bigger than long.
+ Use SIZEOF_BDIGITS instead of sizeof(BDIGIT).
+ (bigadd_int): Ditto.
+ (bigand_int): Ditto.
+ (bigor_int): Ditto.
+ (bigxor_int): Ditto.
+
+Wed Jun 19 15:14:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h (struct rb_data_type_struct), gc.c: add
+ rb_data_type_struct::flags. Now, this flags is passed
+ at T_DATA object creation. You can specify FL_WB_PROTECTED
+ on this flag.
+
+ * iseq.c: making non-shady iseq objects.
+
+ * class.c, compile.c, proc.c, vm.c: add WB for iseq objects.
+
+ * vm_core.h, iseq.h: constify fields to detect WB insertion.
+
+Wed Jun 19 15:11:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (gc_mark_children): show more info for broken object.
+
+Wed Jun 19 14:04:41 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/envutil.rb (EnvUtil#rubybin): remove unnecessary
+ unless expression.
+
+Wed Jun 19 07:47:48 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect_body): use FIX2INT for ruby_gc_stress.
+
+Wed Jun 19 07:44:31 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace::gc_stress): int -> VALUE to store Fixnum object.
+
+Wed Jun 19 07:25:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (make_deferred): clear flags to T_ZOMBIE.
+
+ * gc.c (slot_sweep_body): fix indent.
+
+Wed Jun 19 07:18:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_aref): Apply BIGLO to ~xds[i] for environment which
+ BDIGIT is 16bit.
+
+Wed Jun 19 07:09:26 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rgengc_remember): fix output level.
+
+ * gc.c (rgengc_rememberset_mark): fix to output clear count.
+ (shady_object_count + clear_count = count of remembered objects)
+
+Wed Jun 19 07:06:21 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rgengc_remember): check T_NONE and T_ZOMBIE
+ if RGENGC_CHECK_MODE > 0.
+
+Wed Jun 19 07:02:19 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (RGENGC_CHECK_MODE): add new check mode `3'.
+ In this mode, show all references if there is
+ a miss-corrected object.
+
+Wed Jun 19 06:31:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stress_set): add special option of GC.stress.
+ `GC.stress=(flag)' accepts integer to control behavior of GC.
+ See code for details. Of course, this feature is only for MRI.
+
+ You can debug RGenGC (WB) using `GC.stress = 1'.
+ Using this option, do minor marking at all possible places.
+
+ GC::STRESS_MINOR_MARK = 1 and GC::STRESS_LAZY_SWEEP = 2
+ seem good to add.
+
+Wed Jun 19 06:29:31 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (kwmerge_i): add WB.
+
+Wed Jun 19 06:26:49 2013 Koichi Sasada <ko1@atdot.net>
+
+ * hash.c: `st_update()' also has same issue of last fix.
+ write barriers at callback function are too early.
+ All write barriers are executed after `st_update()'
+
+Wed Jun 19 04:33:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * variable.c (rb_const_set): fix WB miss.
+
+ WBs had located before creating reference between a klass
+ and constant value. It causes GC bug.
+
+ # pseudo code:
+ WB(klass, value); # WB and remember klass
+ st_insert(klass->const_table, const_id, value);
+
+ `st_insert()' can cause GC before inserting `value' and
+ forget `klass' from the remember set. After that, relationship
+ between `klass' and `value' are created with constant table.
+ Now, `value' can be young (shady) object and `klass' can be old
+ object, without remembering `klass' object.
+ At the next GC, old `klass' object will be skipped and
+ young (shady) `value' will be miss-collected. -> GC bug
+
+ Lesson: The place of a WB is important.
+
+Tue Jun 18 22:01:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): ensure methods of type
+ VM_METHOD_TYPE_ATTR_SET are called with 1 argument
+
+ * test/ruby/test_module.rb
+ (TestModule#test_attr_writer_with_no_arguments): add test
+ [ruby-core:55543] [Bug #8540]
+
+Tue Jun 18 22:36:23 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_profile_record_flag): fix typo.
+
+Tue Jun 18 22:08:53 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/objspace/object_tracing.c: Return for ::allocation_generation
+
+Tue Jun 18 22:04:35 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/objspace/object_tracing.c: Document object_tracing methods.
+
+Tue Jun 18 21:58:17 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * gc.c: Rename rb_mObSpace -> rb_mObjSpace
+
+Tue Jun 18 20:55:05 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/objspace/objspace.c: Document ObjectSpace::InternalObjectWrapper.
+
+Tue Jun 18 20:39:04 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/objspace/object_tracing.c: Teach rdoc object_tracing.c [Bug #8537]
+
+Tue Jun 18 20:29:47 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/.document: add object_tracing.c to document file
+
+Tue Jun 18 20:20:27 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/objspace/objspace.c: rdoc on require to overview from r41355
+
+Tue Jun 18 18:39:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Check __int128.
+
+ * include/ruby/defines.h (BDIGIT_DBL): Use uint128_t if it is available.
+ (BDIGIT): Use uint64_t if uint128_t is available.
+ (SIZEOF_BDIGITS): Defined for above case.
+ (BDIGIT_DBL_SIGNED): Ditto.
+ (PRI_BDIGIT_PREFIX): Ditto.
+
+ * include/ruby/ruby.h (PRI_64_PREFIX): Defined.
+
+ * bignum.c (rb_big_pow): Don't use BITSPERDIG for the condition which
+ rb_big_pow returns Float or Bignum.
+
+ [ruby-dev:47413] [Feature #8509]
+
+Tue Jun 18 16:43:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_heredoc_restore): clear lex_strterm always to get
+ rid of marking recycled node. this bug is revealed by r41372 with
+ GC.stress=true.
+
+Tue Jun 18 12:53:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (nlz): Cast the result explicitly.
+ (big2dbl): Don't assign BDIGIT values to int variable.
+
+Tue Jun 18 12:25:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_xor): Non-effective code removed.
+
+Tue Jun 18 11:26:05 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): add `generated_normal_object_count_types' for
+ RGENGC_PROFILE >= 2.
+
+Tue Jun 18 11:02:18 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_maybe): check to skip T_NONE.
+
+ * gc.c (markable_object_p): do not need to check (flags == 0) here.
+
+Tue Jun 18 10:17:37 2013 Koichi Sasada <ko1@atdot.net>
+
+ * variable.c (rb_autoload): fix WB miss.
+
+Tue Jun 18 04:20:18 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_children): don't need to care about T_ZOMBIE here.
+
+Mon Jun 17 22:16:02 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * test/ruby/test_proc.rb (TestProc#test_block_given_method_to_proc):
+ run test for r41359.
+
+Mon Jun 17 21:42:18 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * include/ruby/ruby.h, vm_eval.c (rb_funcall_with_block):
+ new function to invoke a method with a block passed
+ as an argument.
+
+ * string.c (sym_call): use the above function to avoid
+ a block sharing. [ruby-dev:47438] [Bug #8531]
+
+ * vm_insnhelper.c (vm_yield_with_cfunc): don't set block
+ in the frame.
+
+ * test/ruby/test_symbol.rb (TestSymbol#test_block_given_to_proc):
+ run related tests.
+
+Mon Jun 17 21:33:27 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * include/ruby/intern.h, proc.c (rb_method_call_with_block):
+ new function to invoke a Method object with a block passed
+ as an argument.
+
+ * proc.c (bmcall): use the above function to avoid a block sharing.
+ [ruby-core:54626] [Bug #8341]
+
+ * test/ruby/test_proc.rb (TestProc#test_block_persist_between_calls):
+ run related tests.
+
+Mon Jun 17 20:53:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * loadpath.c (RUBY_REVISION): Defined to suppress revision.h
+ inclusion actually. r41352 removes the dependency.
+
+Mon Jun 17 18:15:57 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * ext/objspace/objspace.c: let rdoc know about objspace methods.
+ Specify 'objspace' should be required. See #8537.
+
+Mon Jun 17 17:44:31 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * gc.c (ObjectSpace): is a module not a class.
+
+ * ext/objspace/objspace.c: try to include overview in rdoc,
+ see #8537.
+
+Mon Jun 17 17:38:24 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * gc.c: fix example of ObjectSpace.define_finalizer in overview
+
+Mon Jun 17 16:59:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/tk/tkutil/tkutil.c: use rb_sprintf(), rb_id2str(), and
+ rb_intern_str() instead of rb_intern() and RSTRING_PTR() with
+ RB_GC_GUARD(), to prevent temporary objects from GC.
+ [ruby-core:39000] [Bug #5199]
+
+Mon Jun 17 14:27:54 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm_backtrace.c: Update rdoc for Backtrace#label with @_ko1
+
+Mon Jun 17 13:04:01 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * tool/ifchange (until): Fix the condition, although harmless in
+ this case.
+
+Mon Jun 17 11:50:29 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_maybe): added. check `is_pointer_to_heap()' and
+ type is not T_ZOMBIE.
+
+ * gc.c: use `gc_mark_maybe()'. T_ZOMBIE objects should not be pushed
+ to the mark stack.
+
+Mon Jun 17 07:56:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_small_lshift): Renamed from bdigs_small_lshift.
+ (bary_small_rshift): Renamed from bdigs_small_rshift.
+
+Mon Jun 17 07:38:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (absint_numwords_bytes): Removed.
+ (rb_absint_numwords): Don't call absint_numwords_bytes.
+
+Sun Jun 16 23:14:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (BARY_ADD): New macro.
+ (BARY_SUB): Ditto.
+ (BARY_MUL): Ditto.
+ (BARY_DIVMOD): Ditto.
+ (BARY_ZERO_P): Ditto.
+ (absint_numwords_generic): Use these macros.
+
+Sun Jun 16 21:41:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_2comp): Extracted from get2comp.
+ (integer_unpack_num_bdigits): Extracted from
+ rb_integer_unpack_internal.
+ (bary_unpack_internal): Renamed from bary_unpack and support
+ INTEGER_PACK_2COMP.
+ (bary_unpack): New function to validate arguments and invoke
+ bary_unpack_internal.
+ (rb_integer_unpack_internal): Removed.
+ (rb_integer_unpack): Invoke bary_unpack_internal.
+ (rb_integer_unpack_2comp): Removed.
+
+ * internal.h (rb_integer_unpack_2comp): Removed.
+
+ * pack.c: Follow the above change.
+
+Sun Jun 16 18:41:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (INTEGER_PACK_2COMP): Defined.
+ (rb_integer_pack_2comp): Removed.
+
+ * bignum.c (bary_pack): Support INTEGER_PACK_2COMP.
+ (rb_integer_pack): Invoke bary_pack directly.
+ (rb_integer_pack_2comp): Removed.
+ (rb_integer_pack_internal): Ditto.
+ (absint_numwords_generic): Follow the above change.
+
+ * pack.c (pack_pack): Ditto.
+
+ * sprintf.c (rb_str_format): Ditto.
+
+Sun Jun 16 17:48:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (absint_numwords_generic): rb_funcall invocations removed.
+
+Sun Jun 16 16:04:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/config_files.rb: use URI.read to allow it runs with Ruby 1.8.5.
+
+Sun Jun 16 14:32:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_pack) Extracted from rb_integer_pack_internal.
+ (absint_numwords_generic): Use bary_pack.
+
+Sun Jun 16 11:01:57 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * NEWS (XMLRPC::Client#http): Add.
+ [ruby-core:55197] [Feature #8461]
+
+Sun Jun 16 10:38:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_add): New function.
+ (bary_zero_p): Extracted from bigzero_p.
+ (absint_numwords_generic): Use bary_zero_p and bary_add.
+ (bary_mul): Fix an argument for bary_mul_single.
+ (bary_divmod): Use size_t for arguments.
+
+Sun Jun 16 08:55:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Use a BDIGIT variable to store the return
+ value of bigdivrem_single.
+
+Sun Jun 16 08:43:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_divmod): New function.
+ (absint_numwords_generic): Use bary_divmod.
+ (bigdivrem_num_extra_words): Extracted from bigdivrem.
+ (bigdivrem_single): Ditto.
+ (bigdivrem_normal): Ditto.
+ (BIGDIVREM_EXTRA_WORDS): Defined.
+
+Sun Jun 16 05:51:51 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c: Fixup around GC by MALLOC.
+ Add allocate size to malloc_increase before GC
+ for updating limit in after_gc_sweep.
+ Reset malloc_increase into garbage_collect()
+ for preventing GC again soon.
+
+Sun Jun 16 05:15:36 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c: Add some columns to more detail profile.
+ new columns: Allocated size, Prepare Time, Removing Objects, Empty Objects
+
+Sun Jun 16 02:04:40 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_prof_timer_stop): Merge function codes of GC_PROFILE_MORE_DETAIL and !GC_PROFILE_MORE_DETAIL.
+ * gc.c (gc_prof_mark_timer_start): Ditto.
+ * gc.c (gc_prof_mark_timer_stop): Ditto.
+ * gc.c (gc_prof_sweep_slot_timer_start): Ditto.
+ * gc.c (gc_prof_sweep_slot_timer_stop): Ditto.
+ * gc.c (gc_prof_set_malloc_info): Ditto.
+ * gc.c (gc_prof_set_heap_info): Ditto.
+
+Sat Jun 15 23:50:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_sub): New function.
+ (absint_numwords_generic): Use bary_sub.
+ (bigsub_core): Skip unnecessary copy.
+
+Sat Jun 15 22:05:30 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul): New function.
+ (absint_numwords_generic): Use bary_mul.
+ (bary_mul_single): Extracted from bigmul1_single.
+ (bary_mul_normal): Extracted from bigmul1_normal.
+
+Sat Jun 15 20:13:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_unpack): Extracted from rb_integer_unpack_internal.
+ (absint_numwords_generic): Use bary_unpack.
+ (roomof): Defined.
+ (bdigit_roomof): Defined.
+ (BARY_ARGS): Defined.
+ (bary_unpack): Declared.
+
+Sat Jun 15 19:35:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (absint_numwords_bytes): Make it static.
+ (absint_numwords_small): Ditto.
+ (absint_numwords_generic): Ditto.
+
+Sat Jun 15 17:14:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigmul1_normal): Shrink the result Bignum length.
+
+Sat Jun 15 10:19:42 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/bigdecimal/bigdecimal.c: Update overview formatting of headers
+
+Sat Jun 15 10:19:06 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/bigdecimal/bigdecimal.gemspec: Update authors
+
+Sat Jun 15 10:02:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bdigs_small_rshift): Extracted from big_rshift.
+ (bigdivrem): Use bdigs_small_rshift.
+
+Sat Jun 15 08:37:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (eval_string_with_cref): propagate absolute path from the
+ binding if it is given explicitly. patch by Gat (Dawid Janczak) at
+ [ruby-core:55123]. [Bug #8436]
+
+Sat Jun 15 02:40:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bdigs_small_lshift): Extracted from big_lshift.
+ (bigdivrem): Use bdigs_small_lshift.
+
+Fri Jun 14 20:47:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Reduce number of digits before bignew() for div.
+
+Fri Jun 14 20:12:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Use bignew when ny == 1.
+
+Fri Jun 14 18:52:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (rb_iseq_compile_node): fix location of a `trace'
+ instruction (b_return event).
+ [ruby-core:55305] [ruby-trunk - Bug #8489]
+ (need a backport to 2.0.0?)
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
+Fri Jun 14 18:18:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * class.c, include/ruby/ruby.h: add write barriers for T_CLASS,
+ T_MODULE, T_ICLASS.
+
+ * constant.h: constify rb_const_entry_t::value and file to detect
+ assignment.
+
+ * variable.c, internal.h (rb_st_insert_id_and_value, rb_st_copy):
+ added. update table with write barrier.
+
+ * method.h: constify some variables to detect assignment.
+
+ * object.c (init_copy): add WBs.
+
+ * variable.c: ditto.
+
+ * vm_method.c (rb_add_method): ditto.
+
+Fri Jun 14 14:33:47 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * NEWS: add a note for Module#using.
+
+Fri Jun 14 13:40:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * .travis.yml (before_script): update config files.
+
+ * common.mk ($(srcdir)/tool/config.{guess,sub}): use get-config_files.
+
+ * tool/config_files.rb: split get-config_files.
+
+ * common.mk (update-config_files): rule to download config files.
+
+ * tool/config.guess, tool/config.sub: remove and download from the
+ upstream.
+
+ * tool/config_files.rb: download config files from GNU.
+
+Fri Jun 14 12:21:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): suppress warnings
+ "left-hand operand of comma expression has no effect", on gcc 4.4.
+
+Fri Jun 14 09:48:48 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * NEWS: add notes for $SAFE.
+
+ * doc/security.rdoc: remove the description of $SAFE=4.
+
+Fri Jun 14 00:14:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Zero test condition simplified.
+
+Thu Jun 13 23:43:11 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/bigdecimal/*: improve documentation, nodoc samples with @mrkn
+
+Thu Jun 13 23:02:14 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/xmlrpc/client.rb (XMLRPC::Client#http): Add reader for raw
+ Net::HTTP. [ruby-core:55197] [Feature #8461]
+ Reported by Herwin Weststrate. Thanks!!!
+
+Thu Jun 13 22:44:52 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/xmlrpc/client.rb (XMLRPC::Client#parse_set_cookies): Support
+ multiple names in a response. [ruby-core:41711] [Bug #5774]
+ Reported by Roman Riha. Thanks!!!
+ * test/xmlrpc/test_client.rb (XMLRPC::ClientTest#test_cookie_override):
+ Add a test of the above case.
+
+Thu Jun 13 22:35:50 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/xmlrpc/client.rb (XMLRPC::Client#parse_set_cookies): Use
+ guard style.
+
+Thu Jun 13 22:12:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/fileutils.rb (FileUtils#rmdir): fix traversal loop, not trying
+ remove same directory only.
+
+Thu Jun 13 21:30:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (opt-dir), tool/ifchange: get rid of "alternate value"
+ expansion for legacy sh. [ruby-dev:47420] [Bug #8524]
+
+Thu Jun 13 21:24:09 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Refactored to use ALLOCV_N for temporary
+ buffers.
+
+Thu Jun 13 18:54:11 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * bignum.c (integer_unpack_num_bdigits_generic): reorder terms (but not
+ changed the intention of the expression) because VC++ reports a
+ warning for it. reported by ko1 via IRC.
+
+Thu Jun 13 18:53:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_thread.rb (test_thread_local_security): Don't create
+ an unused thread.
+
+Thu Jun 13 18:34:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigdivrem): Use nlz.
+
+Thu Jun 13 14:51:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): check constant safe
+ level at compile time.
+
+Thu Jun 13 14:39:08 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/-ext-/test_printf.rb, test/rss/test_parser.rb,
+ test/ruby/test_array.rb, test/ruby/test_hash.rb,
+ test/ruby/test_m17n.rb, test/ruby/test_marshal.rb,
+ test/ruby/test_object.rb, test/ruby/test_string.rb: don't use
+ untrusted?, untrust, and trust to avoid warnings in case $VERBOSE is
+ true.
+
+Thu Jun 13 10:47:16 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * bootstraptest/test_autoload.rb, bootstraptest/test_method.rb:
+ remove tests for $SAFE=4.
+
+ * lib/pp.rb: use taint instead of untrust to avoid warnings when
+ $VERBOSE is set to true.
+
+Thu Jun 13 06:12:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_unpack_num_bdigits_small): Fix a compile error on
+ clang -Werror,-Wshorten-64-to-32
+ Reported by Eric Hodel. [ruby-core:55467] [Bug #8522]
+
+Thu Jun 13 05:32:13 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X
+ 10.7+. [ruby-trunk - Bug #8517]
+
+Thu Jun 13 00:17:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_unpack_2comp): New function.
+ (rb_integer_unpack_internal): Extracted from rb_integer_unpack and
+ nlp_bits_ret argument added.
+ (integer_unpack_num_bdigits_small): nlp_bits_ret argument added to
+ return number of leading padding bits.
+ (integer_unpack_num_bdigits_generic): Ditto.
+
+ * internal.h (rb_integer_unpack_2comp): Declared.
+
+ * pack.c (pack_unpack): Use rb_integer_unpack_2comp and
+ rb_integer_unpack.
+
+Wed Jun 12 23:27:03 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (mod_using): new method Module#using, which activates
+ refinements of the specified module only in the current class or
+ module definition. [ruby-core:55273] [Feature #8481]
+
+ * test/ruby/test_refinement.rb: related test.
+
+Wed Jun 12 22:58:48 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
+ when $SAFE is set to 4. $SAFE=4 is now obsolete.
+ [ruby-core:55222] [Feature #8468]
+
+ * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust):
+ Kernel#untrusted?, untrust, and trust are now deprecated.
+ Their behavior is same as tainted?, taint, and untaint,
+ respectively.
+
+ * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED()
+ and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(),
+ respectively.
+
+ * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c,
+ ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c,
+ ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c,
+ ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c,
+ ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c,
+ ext/socket/socket.c, ext/socket/udpsocket.c,
+ ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c,
+ ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c,
+ load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c,
+ safe.c, string.c, thread.c, transcode.c, variable.c,
+ vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for
+ $SAFE=4.
+
+ * test/dl/test_dl2.rb, test/erb/test_erb.rb,
+ test/readline/test_readline.rb,
+ test/readline/test_readline_history.rb, test/ruby/test_alias.rb,
+ test/ruby/test_array.rb, test/ruby/test_dir.rb,
+ test/ruby/test_encoding.rb, test/ruby/test_env.rb,
+ test/ruby/test_eval.rb, test/ruby/test_exception.rb,
+ test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb,
+ test/ruby/test_io.rb, test/ruby/test_method.rb,
+ test/ruby/test_module.rb, test/ruby/test_object.rb,
+ test/ruby/test_pack.rb, test/ruby/test_rand.rb,
+ test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb,
+ test/ruby/test_struct.rb, test/ruby/test_thread.rb,
+ test/ruby/test_time.rb: remove tests for $SAFE=4.
+
+Wed Jun 12 22:18:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_unpack_num_bdigits_generic): Rewritten without
+ rb_funcall.
+ (integer_unpack_num_bdigits_bytes): Removed.
+ (rb_integer_unpack): integer_unpack_num_bdigits_bytes invocation
+ removed.
+
+Wed Jun 12 20:18:03 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/xmlrpc/client.rb (XMLRPC::Client#parse_set_cookies): Extract.
+
+Wed Jun 12 18:19:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (validate_integer_pack_format): supported_flags argument
+ added and validate given flags.
+ (rb_integer_pack_internal): Specify supported_flags.
+ (rb_integer_unpack): Ditto.
+
+Wed Jun 12 16:41:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_sort_bang): remove duplicated assertions.
+ ARY_HEAP_PTR() implies ary not to be embedded. [ruby-dev:47419]
+ [Bug #8518]
+
+Wed Jun 12 12:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_getc): fix 7bit coderange condition, check if ascii read
+ data instead of read length. [ruby-core:55444] [Bug #8516]
+
+Wed Jun 12 12:35:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (pack_pack): Use rb_integer_pack_2comp.
+
+Wed Jun 12 12:07:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * sprintf.c (rb_str_format): Fix a dynamic format string.
+
+Wed Jun 12 12:04:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_uniq_bang): must not be modified once frozen even in
+ a callback method.
+
+Wed Jun 12 12:03:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_sort_bang): must not be modified once frozen even in
+ a callback method.
+
+Wed Jun 12 12:00:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (FL_SET_EMBED): shared object is frozen even when get
+ unshared.
+
+ * array.c (rb_ary_modify): ARY_SET_CAPA needs unshared array.
+
+Wed Jun 12 07:32:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (rand_int): Use rb_big_uminus.
+
+Wed Jun 12 07:12:54 2013 Eric Hodel <drbrain@segment7.net>
+
+ * struct.c: Improve documentation: replace "instance variable" with
+ "member", recommend the use of a block to customize structs, note
+ that member accessors are created, general cleanup.
+
+Wed Jun 12 06:35:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (INTEGER_PACK_NEGATIVE): Defined.
+ (rb_integer_unpack): sign argument removed.
+
+ * bignum.c (rb_integer_unpack): sign argument removed.
+ Non-negative integers generated by default.
+ INTEGER_PACK_NEGATIVE flag is used to generate non-positive integers.
+
+ * pack.c (pack_unpack): Follow the above change.
+
+ * random.c (int_pair_to_real_inclusive): Ditto.
+ (make_seed_value): Ditto.
+ (mt_state): Ditto.
+ (limited_big_rand): Ditto.
+
+ * marshal.c (r_object0): Ditto.
+
+Wed Jun 12 00:07:46 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/xmlrpc/test_client.rb (XMLRPC::ClientTest#test_cookie_simple):
+ Add a test for the extracted method.
+
+Tue Jun 11 23:56:24 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/xmlrpc/test_client.rb (XMLRPC::ClientTest::Fake::HTTP#started):
+ Add a missing empty line.
+
+Tue Jun 11 23:37:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (validate_integer_pack_format): Don't require a word order
+ flag if numwords is 1 or less.
+ (absint_numwords_generic): Don't specify a word order for
+ rb_integer_pack.
+
+ * hash.c (rb_hash): Ditto.
+
+ * time.c (v2w_bignum): Ditto.
+
+Tue Jun 11 23:01:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (validate_integer_pack_format): Refine error messages.
+
+Tue Jun 11 22:25:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (validate_integer_pack_format): numwords argument added.
+ Move a varidation from rb_integer_pack_internal and rb_integer_unpack.
+ (rb_integer_pack_internal): Follow above change.
+ (rb_integer_unpack): Ditto.
+
+Tue Jun 11 20:52:43 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_pack_internal): Renamed from rb_integer_pack
+ and overflow_2comp argument added.
+ (rb_integer_pack): Just call rb_integer_pack_internal.
+ (rb_integer_pack_2comp): New function.
+
+ * internal.h (rb_integer_pack_2comp): Declared.
+
+ * sprintf.c (rb_str_format): Use rb_integer_pack and
+ rb_integer_pack_2comp to format binary/octal/hexadecimal integers.
+ (ruby_digitmap): Declared.
+ (remove_sign_bits): Removed.
+ (BITSPERDIG): Ditto.
+ (EXTENDSIGN): Ditto.
+
+Tue Jun 11 16:15:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (ary_shrink_capa): shrink the capacity so it fits just with
+ the length.
+
+ * array.c (ary_make_shared): release never used elements from frozen
+ array to be shared. [ruby-dev:47416] [Bug #8510]
+
+Tue Jun 11 12:49:01 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * doc/re.rdoc: Rename to doc/regexp.rdoc
+ * re.c: Update rdoc include for rename of file
+
+Tue Jun 11 07:13:13 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * eval_error.c (error_print): keep that errat is non-shady object.
+ and guard errat from GC.
+
+Tue Jun 11 05:04:25 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * ext/racc/cparse/cparse.c: use rb_ary_entry() and
+ rb_ary_subseq() instead of RARRAY_PTR.
+ Based on a patch by Dirkjan Bussink. See Bug #8399.
+
+Mon Jun 10 23:51:51 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * array.c (rb_ary_new_from_values): fix a typo. pointed out by
+ nagachika.
+ http://d.hatena.ne.jp/nagachika/20130610/ruby_trunk_changes_41199_41220
+
+Mon Jun 10 21:51:03 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Fix indent.
+
+Mon Jun 10 21:49:43 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Add missing return
+ value assignment.
+
+Mon Jun 10 20:58:11 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/socket/raddrinfo.c (nogvl_getaddrinfo): work around for Ubuntu
+ 13.04's getaddrinfo issue with mdns4. [ruby-list:49420]
+
+Mon Jun 10 19:34:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_pack): Returns sign instead of words.
+ (absint_numwords_generic): Follow the above change.
+ (big2str_base_powerof2): Follow the above change.
+
+ * internal.h: Ditto.
+
+ * hash.c (rb_hash): Ditto.
+
+ * pack.c (pack_pack): Ditto.
+
+ * random.c (int_pair_to_real_inclusive): Ditto.
+ (rand_init): Ditto.
+ (random_load): Ditto.
+ (limited_big_rand): Ditto.
+
+ * time.c (v2w_bignum): Ditto.
+
+Mon Jun 10 17:20:01 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rgengc_remember): permit promoted object.
+ (rb_gc_writebarrier -> remember)
+
+Mon Jun 10 17:14:01 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (RVALUE_PROMOTE): fix parameter name (`x' to `obj')
+ and make it inline function (like RVALUE_PROMOTE).
+
+Mon Jun 10 16:22:50 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_new_from_values): add assertion
+ (ary should be young object).
+
+Mon Jun 10 16:05:59 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (wmap_mark): check allocation of `w->obj2wmap'.
+ (no-allocation `w->obj2wmap' will be NULL pointer reference)
+
+Mon Jun 10 15:36:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_error.c (error_print): use checking functions instead of
+ catching exceptions.
+
+ * eval_error.c (error_print): restore errinfo for the case new
+ exception raised while printing the message. [ruby-core:55365]
+ [Bug #8501]
+
+ * eval_error.c (error_print): reduce calling setjmp.
+
+Mon Jun 10 12:10:06 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_unpack_num_bdigits_small: Extracted from
+ rb_integer_unpack.
+ (integer_unpack_num_bdigits_generic): Ditto.
+ (integer_unpack_num_bdigits_bytes): New function.
+ (rb_integer_unpack): Use above functions.
+ Return a Bignum for INTEGER_PACK_FORCE_BIGNUM even when the result
+ is zero.
+
+Mon Jun 10 05:38:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (absint_numwords_small): New function.
+ (absint_numwords_generic): Use absint_numwords_small if possible.
+
+Mon Jun 10 01:07:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (absint_numwords_bytes): New function.
+ (absint_numwords_generic): Extracted from rb_absint_numwords.
+ (rb_absint_numwords): Use absint_numwords_bytes if possible.
+
+Sun Jun 9 21:33:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_absint_numwords): Return (size_t)-1 when overflow.
+ Refine variable names.
+ (rb_absint_size): Refine variable names.
+
+ * internal.h (rb_absint_size): Refine an argument name.
+ (rb_absint_numwords): Ditto.
+
+Sun Jun 9 16:51:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_absint_numwords): Renamed from rb_absint_size_in_word.
+
+ * internal.h (rb_absint_numwords): Follow the above change.
+
+ * pack.c (pack_pack): Ditto.
+
+ * random.c (rand_init): Ditto.
+ (limited_big_rand): Ditto.
+
+Sun Jun 9 14:41:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_pack): numwords_allocated argument removed.
+
+ * internal.h (rb_integer_pack): Follow the above change.
+
+ * hash.c (rb_hash): Ditto.
+
+ * time.c (v2w_bignum): Ditto.
+
+ * pack.c (pack_pack): Ditto.
+
+ * random.c (int_pair_to_real_inclusive): Ditto.
+ (rand_init): Ditto.
+ (random_load): Ditto.
+ (limited_big_rand): Ditto.
+
+Sun Jun 9 09:34:44 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2str_base_powerof2): New function.
+ (rb_big2str0): Use big2str_base_powerof2 if base is 2, 4, 8, 16 or 32.
+
+Sun Jun 9 00:59:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * hash.c (rb_hash): Use rb_integer_pack to obtain least significant
+ long integer.
+
+Sat Jun 8 23:56:00 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (rb_num_to_uint): Use rb_absint_size instead of
+ RBIGNUM_LEN.
+
+Sat Jun 8 22:53:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * marshal.c (r_object0): Use rb_integer_unpack.
+
+Sat Jun 8 22:18:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (v2w): Use rb_absint_size instead of RBIGNUM_LEN.
+
+Sat Jun 8 21:47:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (v2w_bignum): Simplified using rb_integer_pack.
+ (rb_big_abs_find_maxbit): Removed.
+
+Sat Jun 8 21:03:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_absint_singlebit_p): New function.
+
+ * internal.h (rb_absint_singlebit_p): Declared.
+
+ * time.c (v2w_bignum): Use rb_absint_singlebit_p instead of
+ rb_big_abs_find_minbit.
+ (rb_big_abs_find_minbit): Removed.
+
+Sat Jun 8 20:24:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (rb_big_abs_find_maxbit): Use rb_absint_size.
+ (bdigit_find_maxbit): Removed.
+
+Sat Jun 8 19:47:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * class.c (include_modules_at): invalidate method cache if included
+ module contains constants
+
+ * test/ruby/test_module.rb: add test
+
+Sat Jun 8 19:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * random.c (limited_big_rand): declare rnd, lim and mask as uint32_t
+ to avoid 64 bit to 32 bit shorten warnings.
+
+Sat Jun 8 19:23:53 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * win32/Makefile.sub: r41163 changed win32/win32.c and configure.in
+ but it didn't treat about mswin32/mswin64, so fix it.
+ NOTE: this needs a review by usa whether additional condition is
+ required or not.
+
+Sat Jun 8 19:06:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c: Unused RBignum internal accessing macros removed.
+
+Sat Jun 8 19:04:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (limited_big_rand): The argument, limit, is changed to
+ VALUE. Use rb_integer_pack and rb_integer_unpack.
+
+Sat Jun 8 17:15:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (make_seed_value): Fix the length given for
+ rb_integer_unpack.
+
+Sat Jun 8 16:38:02 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_unpack): Don't use rb_funcall if possible.
+
+ * random.c: Use uint32_t for elements of seed.
+ (make_seed_value): Use rb_integer_unpack.
+
+Sat Jun 8 15:58:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (rand_init): Add a cast to fix clang compile error:
+ random.c:410:32: error: implicit conversion loses integer precision:
+ 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
+ This cast doesn't cause a problem because len is not bigger than
+ MT_MAX_STATE.
+
+Sat Jun 8 15:30:03 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (rand_init): Use rb_integer_pack.
+ (roomof): Removed.
+
+Sat Jun 8 14:58:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (INTEGER_PACK_FORCE_BIGNUM): New flag constant.
+
+ * bignum.c (rb_integer_unpack): Support INTEGER_PACK_FORCE_BIGNUM.
+
+ * random.c (int_pair_to_real_inclusive): Use
+ INTEGER_PACK_FORCE_BIGNUM to use rb_big_mul instead of rb_funcall.
+
+Sat Jun 8 14:17:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: check for NET_LUID. header macro varies across
+ compiler versions.
+
+ * win32/win32.c: use configured macro.
+
+Sat Jun 8 11:59:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (int_pair_to_real_inclusive): Use rb_funcall instead of
+ rb_big_mul because rb_integer_unpack can return a Fixnum.
+
+Sat Jun 8 11:17:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (int_pair_to_real_inclusive): Use rb_integer_pack.
+
+Sat Jun 8 09:49:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (int_pair_to_real_inclusive): Use rb_integer_unpack.
+
+Sat Jun 8 08:12:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (random_load): Use rb_integer_pack.
+
+Sat Jun 8 06:15:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (numberof): Removed.
+
+Sat Jun 8 06:00:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c: include internal.h.
+ (mt_state): Use rb_integer_unpack.
+
+Sat Jun 8 00:55:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_pack_loop_setup): word_num_nailbytes_ret argument
+ removed.
+ (rb_integer_pack): Follow the above change.
+ (rb_integer_unpack): Follow the above change.
+
+Sat Jun 8 00:37:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (validate_integer_pack_format): Renamed from
+ validate_integer_format.
+ (integer_pack_loop_setup): Renamed from integer_format_loop_setup.
+ (integer_pack_fill_dd): Renamed from int_export_fill_dd.
+ (integer_pack_take_lowbits): Renamed from int_export_take_lowbits.
+ (integer_unpack_push_bits): Renamed from int_import_push_bits.
+
+Fri Jun 7 23:58:06 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_pack): Arguments changed. Use flags to
+ specify word order and byte order.
+ (rb_integer_unpack): Ditto.
+ (validate_integer_format): Follow the above change.
+ (integer_format_loop_setup): Ditto.
+
+ * pack.c: Ditto.
+
+ * internal.h: Ditto.
+ (INTEGER_PACK_MSWORD_FIRST): Defined.
+ (INTEGER_PACK_LSWORD_FIRST): Ditto.
+ (INTEGER_PACK_MSBYTE_FIRST): Ditto.
+ (INTEGER_PACK_LSBYTE_FIRST): Ditto.
+ (INTEGER_PACK_NATIVE_BYTE_ORDER): Ditto.
+ (INTEGER_PACK_LITTLE_ENDIAN): Ditto.
+ (INTEGER_PACK_BIG_ENDIAN): Ditto.
+
+Fri Jun 7 22:10:50 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/specification.rb (Gem::Specification#to_yaml):
+ use Gem::NoAliasYAMLTree.create instead of Gem::NoAliasYAMLTree.new
+ to suppress deprecated warnings.
+
+Fri Jun 7 21:39:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_pack): Renamed from rb_int_export.
+ (rb_integer_unpack): Renamed from rb_int_import.
+
+ * internal.h, pack.c: Follow the above change.
+
+Fri Jun 7 21:05:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (integer_format_loop_setup): Extracted from rb_int_export
+ and rb_int_import.
+
+Fri Jun 7 19:48:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (validate_integer_format): Extracted from rb_int_export and
+ rb_int_import.
+
+Fri Jun 7 19:23:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_absint_size): Use numberof.
+ (rb_int_export): Ditto.
+
+Fri Jun 7 18:58:56 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (numberof): Gathered from various files.
+
+ * array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c,
+ load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c,
+ error.c, ruby.c: Remove the definitions of numberof.
+
+Fri Jun 7 18:24:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_absint_size): Declare a variable, i, just before used
+ to suppress a warning.
+ (rb_int_export): Ditto.
+
+Fri Jun 7 17:41:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * bignum.c (rb_absint_size): explicit cast to BDIGIT to avoid implicit
+ 64 bit to 32 bit shortening warning
+ * bignum.c (rb_int_export): ditto
+ * bignum.c (int_import_push_bits): ditto
+
+Fri Jun 7 17:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * internal.h (RCLASS_SUPER): use descriptive variable name
+ * internal.h (RCLASS_SET_SUPER): ditto
+
+Fri Jun 7 13:25:27 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
+ RB_GC_GUARD. it should be after the object is used.
+
+Fri Jun 7 13:22:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * gc.c (before_gc_sweep): noinline can also avoid the segv instead of
+ -O0 of r41084. this way is expected less slow.
+
+Fri Jun 7 11:45:42 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * rational.c (numeric_quo): move num_quo in numeric.c to numeric_quo
+ in rational.c to refer canonicalization state for mathn support.
+ [ruby-core:41575] [Bug #5736]
+
+ * numeric.c (num_quo): ditto.
+
+ * test/test_mathn.rb: add a test for the change at r41109.
+
+Fri Jun 7 11:41:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: revert r41106. size_t may not be unsigned
+
+ * bignum.c (rb_absint_size_in_word, rb_int_export, rb_int_import): use
+ NUM2SIZET() and SIZET2NUM() already defined in ruby/ruby.h.
+
+Fri Jun 7 11:28:37 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c: use oldgen bitmap as initial mark bitmap when major gc.
+ so can skip oldgen bitmap check around mark & sweep.
+ * gc.c (slot_sweep_body): change scan algorithm for performance:
+ from object's pointer base to bitmap one.
+
+Fri Jun 7 11:25:56 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c: introduce oldgen bitmap for preparing performance tuning.
+
+Fri Jun 7 11:20:57 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (MARKED_IN_BITMAP, MARK_IN_BITMAP, CLEAR_IN_BITMAP): bring
+ bitmap macros in one place, and introduce BITMAP_BIT.
+
+Fri Jun 7 11:18:35 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * array.c (ary_new): change order of allocation in order
+ to remove FL_OLDGEN operation.
+
+Fri Jun 7 11:16:28 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * tool/rdocbench.rb: add gc total time information.
+
+Fri Jun 7 10:12:01 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: remove "Sunny" terminology.
+ "Sunny" doesn't mean antonym of "Shady" (questionable, doubtful, etc).
+ Instead of "Sunny", use "non-shady" or "normal".
+
+Fri Jun 7 09:29:33 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * bignum.c (rb_int_import): explicitly casting BDIGIT_DBL to BDIGIT
+ to prevent warning.
+
+Fri Jun 7 07:29:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_int_export): countp argument is split into
+ wordcount_allocated and wordcount.
+
+ * bignum.c (rb_int_export): Follow the above change.
+
+ * pack.c (pack_pack): Ditto.
+
+Fri Jun 7 07:17:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * NEWS: describe a compatibility issue of Numeric#quo
+ introduced at r41109.
+
+Fri Jun 7 07:15:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * NEWS: fix style.
+
+Fri Jun 7 06:48:17 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * numeric.c: remove unused ID id_to_r introduced in r41109.
+
+Fri Jun 7 06:15:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_int_import): New function.
+ (int_import_push_bits): Ditto.
+
+ * internal.h (rb_int_import): Declared.
+
+ * pack.c (pack_unpack): Use rb_int_import for BER compressed integer.
+
+Thu Jun 6 22:24:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * numeric.c (num_quo): Use to_r method to convert the receiver to
+ rational. [ruby-core:41575] [Bug #5736]
+
+ * test/ruby/test_numeric.rb: add a test for the above change.
+
+Thu Jun 6 20:40:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Invoke RUBY_REPLACE_TYPE for size_t.
+ Don't invoke RUBY_CHECK_PRINTF_PREFIX for size_t to avoid conflict
+ with RUBY_REPLACE_TYPE.
+
+ * internal.h (rb_absint_size): Declared.
+ (rb_absint_size_in_word): Ditto.
+ (rb_int_export): Ditto.
+
+ * bignum.c (rb_absint_size): New function.
+ (rb_absint_size_in_word): Ditto.
+ (int_export_fill_dd): Ditto.
+ (int_export_take_lowbits): Ditto.
+ (rb_int_export): Ditto.
+
+ * pack.c (pack_pack): Use rb_int_export for BER compressed integer.
+
+Thu Jun 6 19:31:33 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: fixed coding error [ruby-core:55337].
+ reported by Riley Lynch.
+
+Thu Jun 6 14:16:37 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * ext/objspace/object_tracing.c: rename allocation_info to
+ lookup_allocation_info. At times I confused "struct
+ allocation_info" with "function allocation_info".
+
+Thu Jun 6 13:57:06 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * ext/objspace/object_tracing.c: allocation_info function isn't
+ called by any other file.
+
+Thu Jun 6 09:41:00 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * numeric.c (num_quo): should return a Float for a Float argument.
+ [ruby-dev:44710] [Bug #5515]
+
+ * test/ruby/test_fixnum.rb: Add an assertion for the above change.
+
+ * test/ruby/test_bignum.rb: ditto.
+
+Thu Jun 6 00:59:44 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (gc_mark): get rid of pushing useless objects.
+ * gc.c (rgengc_rememberset_mark): bypass gc_mark() in order to push
+ sunny old object at minor gc.
+ * gc.c (gc_mark_children): move sunny old check to gc_mark().
+ * gc.c (rgengc_check_shady): remove DEMOTE that already unnecessary.
+ * gc.c (rb_gc_writebarrier): ditto.
+
+ change sunny old check point in order to save mark stack and
+ remove unnatural rest_sweep & demote.
+
+Thu Jun 6 00:52:42 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (rgengc_rememberset_mark): change scan algorithm for performance:
+ from object's pointer base to bitmap one.
+
+Thu Jun 6 00:30:04 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * win32/win32.c (NET_LUID): define it on MinGW32.
+ mingw-w64 has NET_LUID but mingw32 (mingw.org) still doesn't have
+ NET_LUID. reported by taco on IRC
+
+Thu Jun 6 00:05:08 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * string.c (String#b): Allow code range scan to happen later so
+ ascii_only? on a result string returns the correct value.
+ [ruby-core:55315] [Bug #8496]
+
+Wed Jun 5 22:40:42 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (capability_response): should ignore trailing
+ spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415]
+
+ * test/net/imap/test_imap_response_parser.rb: related test.
+
+Wed Jun 5 21:17:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big_fdiv): Use nlz() instead of bdigbitsize().
+ (bdigbitsize): Removed.
+
+Wed Jun 5 20:32:00 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * include/ruby/ruby.h: fix alignment in comment.
+
+Wed Jun 5 20:05:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * random.c (int_pair_to_real_inclusive): Add a cast to BDIGIT.
+ (random_load): Fix shift width for fixnums.
+ Re-implement bignum extraction without ifdefs.
+
+Wed Jun 5 15:26:10 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * gc.c (before_gc_sweep): don't optimize it to avoid segv on Ubuntu
+ 10.04 gcc 4.4.
+ http://u32.rubyci.org/~chkbuild/ruby-trunk/log/20130527T190301Z.diff.html.gz
+
+Wed Jun 5 09:46:46 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
+ EACCES for Windows.
+
+Wed Jun 5 08:13:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_pow): Don't need to multiply SIZEOF_BDIGITS.
+ Use nlz instead of bitlength_bdigit.
+ (bitlength_bdigit): Removed.
+
+Wed Jun 5 07:14:18 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (d_lite_cmp, d_lite_equal): simplified.
+
+Wed Jun 5 07:07:01 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: fixed a bug [ruby-core:55295]. reported
+ by Riley Lynch.
+
+Wed Jun 5 06:44:08 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.0.3
+
+ * test/rubygems: Tests for the above.
+
+ * NEWS: Added RubyGems 2.0.3 note.
+
+Wed Jun 5 06:35:15 2013 Eric Hodel <drbrain@segment7.net>
+
+ * doc/marshal.rdoc: Add description of Marshal format.
+
+Wed Jun 5 01:16:09 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * array.c (Array#+): fix documentation example.
+ Patch by Logan Serman. [Fixes GH-324]
+
+Wed Jun 5 00:21:54 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/irb/lc/ja/help-message: update help messages.
+ following r41028. [ruby-dev:46707] [Feature #7510]
+
+Wed Jun 5 00:09:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * marshal.c (r_object0): Generalize a round up expression.
+ Use BDIGIT instead of int.
+
+Tue Jun 4 23:44:02 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * object.c (rb_Hash): fix docs. patched by Stefan Sch"ussler.
+ [ruby-core:55299] [Bug #8487]
+
+Tue Jun 4 23:16:49 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * lib/irb/completion.rb: Use %w literal construction for long lists.
+ Patch by Dave Goodchild. [Fixes GH-299]
+
+Tue Jun 4 23:08:42 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * ext/objspace/objspace.c: improve wording and remove duplicated comment.
+ Based on a patch by Dave Goodchild. [Fixes GH-299]
+
+Tue Jun 4 18:41:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bitlength_bdigit): Fix an off-by-one error.
+
+Tue Jun 4 15:30:00 2013 Kenta Murata <mrkn@cookpad.com>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the number
+ of figures. Patch by Vipul A M <vipulnsward@gmail.com>.
+ https://github.com/ruby/ruby/pull/323 fix GH-323
+
+ * test/bigdecimal/test_bigdecimal_util.rb: fix for the above change.
+
+Tue Jun 4 00:44:27 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
+ EEXIST for Linux. (suggested by nurse)
+
+Mon Jun 3 23:58:19 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * lib/fileutils.rb (FileUtils.rmdir): use remove_tailing_slash.
+ * test/fileutils/test_fileutils.rb: test for above.
+
+Mon Jun 3 23:47:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bitlength_bdigit): New function.
+ (rb_big_pow): Use bitlength_bdigit instead of ffs.
+
+Mon Jun 3 23:11:19 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/fileutils.rb: fix behavior when mkdir/mkdir_p accepted "/".
+ * test/fileutils/test_fileutils.rb: add test for above change.
+ Patched by Mitsunori Komatsu. [GH-319]
+
+Mon Jun 3 19:02:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (is_hfs): use the file descriptor instead of a path.
+
+Mon Jun 3 07:15:17 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: removes AC_CHECK_FUNCS(readdir_r). readdir_r()
+ is only used from dir.c and it doesn't need readdir_r().
+ * configure.in (SIZEOF_STRUCT_DIRENT_TOO_SMALL): removed. It is
+ only used for readdir_r.
+ * dir.c: removes NAME_MAX_FOR_STRUCT_DIRENT. It is not right way
+ to detect maximum length of path len. POSIX require to use
+ fpathconf(). IOW, it might have lead to make a vulnerability
+ using stack smashing. Moreover, readdir() works enough for our
+ usage.
+ * dir.c (READDIR): removes an implementation which uses
+ readdir_r() and parenthesize in a macro body correctly.
+ * dir.c (dir_read): removes IF_HAVE_READDIR_R(DEFINE_STRUCT_DIRENT
+ entry), it is used only for readdir_r().
+ * dir.c (dir_each): ditto.
+ * dir.c (glob_helper): ditto.
+
+ * dir.c (READDIR): removes entry and dp argument.
+ * dir.c (dir_read): adjust for the above change.
+ * dir.c (dir_each): ditto.
+ * dir.c (glob_helper): ditto.
+
+Mon Jun 3 03:40:29 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019.
+ The code is not useless.
+
+Mon Jun 3 01:25:25 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/socket/test_sockopt.rb: change test name. follow r41037.
+
+Mon Jun 3 01:08:43 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/rinda/test_rinda.rb: rename functions introduced in r41009.
+
+Sun Jun 2 23:33:42 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * enc/trans/japanese_euc.trans, test/ruby/test_transcode.rb,
+ tool/transcode-tblgen.rb: change EUC-JP-2004 to EUC-JIS-2004.
+ This is follow up to changes in r41024.
+
+Sun Jun 2 22:44:42 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/socket/option.c: rename functions introduced in r41009
+ s/ip/ipv4/g because they are ipv4 functions.
+ (there's a policy that the name "ip" is for methods which supports
+ both ipv4 and ipv6)
+
+Sun Jun 2 16:15:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln_find.c (dln_find_exe, dln_find_file): remove deprecated
+ non-reentrant functions.
+
+Sun Jun 2 15:04:35 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/cgi/util.rb, lib/erb.rb: Use String#b [Feature #8394] by znz
+
+Sun Jun 2 14:10:21 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/irb/lc/help-message: Apply english updates for irb --help #7510
+
+Sun Jun 2 12:03:58 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * range.c: Fix rdoc on Range#bsearch [Bug #8242] [ruby-core:54143]
+
+Sun Jun 2 02:08:37 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/euc_jp.c: fix typo: the name of EUC-JIS-2004.
+
+Sat Jun 1 23:17:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * vm_eval.c (rb_mod_module_eval): mention in docs that arguments passed
+ to the method are passed to the block
+
+Sat Jun 1 17:58:13 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#freeze, taint, untaint): Save a "self" by
+ utilizing super returning self, and add tests while at it.
+
+Sat Jun 1 17:24:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_set_arguments): not a simple single argument if any
+ keyword arguments exist. [ruby-core:55203] [Bug #8463]
+
+ * vm_insnhelper.c (vm_yield_setup_block_args): split single parameter
+ if any keyword arguments exist, and then extract keyword arguments.
+ [ruby-core:55203] [Bug #8463]
+
+Sat Jun 1 11:16:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_exc_new_cstr): rename from rb_exc_new2.
+
+ * error.c (rb_exc_new_str): rename from rb_exc_new3.
+
+Sat Jun 1 10:13:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_new[2-5], rb_{tainted,usascii}_str_new2),
+ (rb_str_buf_new2): remove old interfaces.
+
+Sat Jun 1 08:00:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc),
+ (gzreader_gets): check EOF. [ruby-core:55220] [Bug #8467]
+
+Sat Jun 1 07:32:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Use BDIGIT type for hbase.
+
+Sat Jun 1 02:37:35 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/socket/option.c (sockopt_s_byte): constructor of the sockopt
+ whose value's is byte.
+
+ * ext/socket/option.c (sockopt_byte): getter for above.
+
+ * ext/socket/option.c (inspect_byte): inspect for above.
+
+ * ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of
+ the sockopt whose optname is IP_MULTICAST_LOOP.
+
+ * ext/socket/option.c (sockopt_ip_multicast_loop): getter for above.
+
+ * ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of
+ the sockopt whose optname is IP_MULTICAST_TTL.
+
+ * ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above.
+
+ * ext/socket/option.c (sockopt_inspect): use above.
+
+Sat Jun 01 01:50:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2big
+ to convert a double value to a Bignum.
+
+Sat Jun 1 00:19:50 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (calc_hbase): Make hbase the maximum power of base
+ representable in BDIGIT.
+
+Fri May 31 23:56:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (calc_hbase): Extracted from rb_big2str0.
+
+Fri May 31 23:22:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Don't hard code SIZEOF_BDIGITS for log_base(hbase).
+ (big2str_orig): hbase_numdigits argument added.
+ (big2str_karatsuba): Ditto.
+ (rb_big2str0): Calculate hbase_numdigits.
+
+Fri May 31 17:57:21 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * process.c: Improve Process::exec documentation
+
+Fri May 31 17:26:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_funcallv): add better names of rb_funcall2.
+
+ * vm_eval.c (rb_funcallv_public): ditto for rb_funcall3.
+
+Fri May 31 17:04:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_new_capa): add better names of rb_ary_new2.
+
+ * array.c (rb_ary_new_from_args): ditto for rb_ary_new3.
+
+ * array.c (rb_ary_new_from_values): ditto for rb_ary_new4.
+
+Fri May 31 16:35:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (HAVE_ATTRIBUTE_FUNCTION_ALIAS): define to tell if
+ alias attribute is available.
+
+Fri May 31 16:03:23 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c, proc.c: s/call_seq/call-seq in rdoc. [Fixes GH-322]
+
+Fri May 31 15:56:36 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/openssl/ossl_ssl.c: Add missing paren in rdoc [Fixes GH-321]
+
+Fri May 31 11:58:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (set_visibility): extract from rb_mod_public(),
+ rb_mod_protected() and rb_mod_private().
+
+Thu May 30 19:47:42 2013 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * vm_insnhelper.c (vm_callee_setup_keyword_arg,
+ vm_callee_setup_arg_complex): consider a hash argument for keyword
+ only when the number of arguments is more than the expected
+ mandatory parameters. [ruby-core:53199] [ruby-trunk - Bug #8040]
+
+ * test/ruby/test_keyword.rb: update a test for above.
+
+Thu May 30 17:55:04 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * process.c: RDoc on Process.spawn
+
+Thu May 30 00:08:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_enable): rest_sweep() to finish last GC.
+ Profiling record is allocated at first of marking phase.
+ Enable at lazy sweeping may cause an error (SEGV).
+
+Wed May 29 10:33:27 2013 Koichi Sasada <ko1@atdot.net>
+
+ * hash.c: fix WB bug.
+ (1) Hash's key also needs WB.
+ (2) callback parameter *key and *value of st_update() is not a
+ storage of st_table itself (only local variable). So that
+ OBJ_WRITE() is not suitable, especially for `!existing'.
+ OBJ_WRITTEN() is used instead of OBJ_WRITE().
+
+Tue May 28 12:31:21 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/object_tracing.c: fix a bug reported at
+ "[ruby-core:55182] [ruby-trunk - Bug #8456][Open] Sugfault in Ruby Head"
+ Care about the case TracePoint#path #=> `nil'.
+
+ * ext/objspace/object_tracing.c: add two new methods:
+ * ObjectSpace.allocation_class_path(o)
+ * ObjectSpace.allocation_method_id(o)
+ They are not useful for Object.new because they are always
+ "Class" and :new.
+ To trace more useful information, we need to maintain call-tree
+ using call/return hooks, which is implemented by
+ ll-prof <http://sunagae.net/wiki/doku.php?id=software:llprof>
+
+ * test/objspace/test_objspace.rb: add a test.
+
+Tue May 28 11:30:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (extmake): leave makefiles untouched if the content is
+ not changed, to get rid of unnecessary re-linking.
+
+Tue May 28 03:11:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to
+ hook GC invocation.
+ * ObjectSpace.after_gc_start_hook=(proc)
+ * ObjectSpace.after_gc_end_hook=(proc)
+
+ Note that hooks are not kicked immediately. Procs are kicked
+ at postponed_job.
+
+ This feature is a sample of new internal event and
+ rb_postponed_job API.
+
+Tue May 28 02:56:15 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): remove wrong rest_sweep().
+
+Tue May 28 02:44:23 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect_body): fix GC_ENABLE_LAZY_SWEEP condition.
+
+ * gc.c (GC_NOTIFY): move debug print location and use stderr instead
+ of stdout.
+
+Tue May 28 02:07:21 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_postponed_job_register_one): fix iteration bug.
+
+ * ext/-test-/postponed_job/postponed_job.c,
+ test/-ext-/postponed_job/test_postponed_job.rb: add a test.
+
+Tue May 28 00:34:23 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h, gc.c: add new internal event
+ RUBY_INTERNAL_EVENT_GC_END. This event invokes at the end of
+ after_sweep().
+ Time chart with lazy sweep is:
+ (1) Kick RUBY_INTERNAL_EVENT_GC_START
+ (2) [gc_marks()]
+ (3) [lazy_sweep()]
+ (4) [... run Ruby program (mutator) with lazy_sweep() ...]
+ (5) [after_sweep()]
+ (6) Kick RUBY_INTERNAL_EVENT_GC_END
+ (7) [... run Ruby program (mutator), and go to (1) ...]
+ Time chart without lazy sweep (GC.start, etc) is:
+ (1) Kick RUBY_INTERNAL_EVENT_GC_START
+ (2) [gc_marks()]
+ (3) [gc_sweep()]
+ (4) [after_sweep()]
+ (5) Kick RUBY_INTERNAL_EVENT_GC_END
+ (6) [... run Ruby program (mutator), and go to (1) ...]
+
+ * ext/-test-/tracepoint/tracepoint.c,
+ test/-ext-/tracepoint/test_tracepoint.rb: modify a test.
+
+Tue May 28 00:18:57 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_postponed_job_flush): remove a wrong comment.
+
+Mon May 27 22:09:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h (RHASH_SIZE): Add a cast to suppress a
+ warning, comparison between signed and unsigned integer
+ expressions [-Wsign-compare], on ILP32.
+
+Mon May 27 19:25:47 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: rename RUBY_INTERNAL_EVENT_FREE to
+ RUBY_INTERNAL_EVENT_FREEOBJ.
+
+ * ext/-test-/tracepoint/tracepoint.c,
+ ext/objspace/object_tracing.c,
+ gc.c, vm_trace.c: catch up this change.
+
+Mon May 27 18:57:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.
+ Read the following test to know HOWTO.
+ This feature is a sample of RUBY_INTERNAL_EVENT.
+
+ * test/objspace/test_objspace.rb: add a test.
+
+ * ext/objspace/object_tracing.c: ditto.
+
+ * gc.c (rb_gc_count): add. This function returns GC count.
+
+ * internal.h: add decl. of rb_gc_count(). Same as `GC.count'.
+
+Mon May 27 17:33:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (install_recursive): add maxdepth option.
+
+ * tool/rbinstall.rb (bin-comm): limit depth of bindir and reject empty
+ files. [ruby-core:55101] [Bug #8432]
+
+Mon May 27 16:16:18 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_postponed_job_flush, rb_postponed_job_register): use
+ ruby_xmalloc/xfree. It is safe during GC.
+
+Mon May 27 09:24:03 2013 Koichi Sasada <ko1@atdot.net>
+
+ * test/-ext-/postponed_job/test_postponed_job.rb: fix typo and class name.
+
+Mon May 27 09:05:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h, gc.c, vm_trace.c: add internal events.
+ * RUBY_INTERNAL_EVENT_NEWOBJ: object created.
+ * RUBY_INTERNAL_EVENT_FREE: object freed.
+ * RUBY_INTERNAL_EVENT_GC_START: GC started.
+ And rename `RUBY_EVENT_SWITCH' to `RUBY_INTERNAL_EVENT_SWITCH'.
+
+ Internal events can not invoke any Ruby program because the tracing
+ timing may be critical (under huge restriction).
+ These events can be hooked only by C-extensions.
+ We recommend to use rb_postponed_job_register() API to call Ruby
+ program safely.
+
+ This change is mostly written by Aman Gupta (tmm1).
+ https://bugs.ruby-lang.org/issues/8107#note-12
+ [Feature #8107]
+
+ * include/ruby/debug.h, vm_trace.c: added two new APIs.
+ * rb_tracearg_event_flag() returns rb_event_flag_t of this event.
+ * rb_tracearg_object() returns created/freed object.
+
+ * ext/-test-/tracepoint/extconf.rb,
+ ext/-test-/tracepoint/tracepoint.c,
+ test/-ext-/tracepoint/test_tracepoint.rb: add a test.
+
+Mon May 27 08:38:21 2013 Koichi Sasada <ko1@atdot.net>
+
+ * ext/-test-/postponed_job/postponed_job.c: fix `init' function name.
+
+Mon May 27 06:22:41 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/debug.h, vm_trace.c: add rb_postponed_job API.
+ Postponed jobs are registered with this API. Registered jobs
+ are invoked at `ruby-running-safe-point' as soon as possible.
+ This timing is completely same as finalizer timing.
+
+ There are two APIs:
+ * rb_postponed_job_register(flags, func, data): register a
+ postponed job with data. flags are reserved.
+ * rb_postponed_job_register_one(flags, func, data): same as
+ `rb_postponed_job_register', but only one `func' job is
+ registered (skip if `func' is already registered).
+
+ This change is mostly written by Aman Gupta (tmm1).
+ https://bugs.ruby-lang.org/issues/8107#note-15
+ [Feature #8107]
+
+ * gc.c: use postponed job API for finalizer.
+
+ * common.mk: add dependency from vm_trace.c to debug.h.
+
+ * ext/-test-/postponed_job/extconf.rb, postponed_job.c,
+ test/-ext-/postponed_job/test_postponed_job.rb: add a test.
+
+ * thread.c: implement postponed API.
+
+ * vm_core.h: ditto.
+
+Mon May 27 02:26:02 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): collect promote_operation_count and
+ types (RGENGC_PROFILE >= 2).
+
+Mon May 27 01:40:58 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): collect shade_operation_count,
+ remembered_sunny_object_count and remembered_shady_object_count
+ for each types when RGENGC_PROFILE >= 2.
+ They are informative for optimization.
+
+Mon May 27 01:15:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * hash.c (rb_hash_tbl_raw), internal.h: added.
+ Returns st_table without shading hash.
+
+ * array.c: use rb_hash_tbl_raw() for read-only purpose.
+
+ * compile.c (iseq_compile_each): ditto.
+
+ * gc.c (count_objects): ditto.
+
+ * insns.def: ditto.
+
+ * process.c: ditto.
+
+ * thread.c (clear_coverage): ditto.
+
+ * vm_insnhelper.c: ditto.
+
+Mon May 27 00:31:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/make-snapshot: use ENV["AUTOCONF"] instead of directly using
+ literal "autoconf".
+
+Sun May 26 21:31:46 2013 Koichi Sasada <ko1@atdot.net>
+
+ * hash.c, include/ruby/ruby.h: support WB protected hash.
+ * constify RHash::ifnone and make new macro RHASH_SET_IFNONE().
+ * insert write barrier for st_update().
+
+ * include/ruby/intern.h: declare rb_hash_set_ifnone(hash, ifnone).
+
+ * marshal.c (r_object0): use RHASH_SET_IFNONE().
+
+ * ext/openssl/ossl_x509name.c (Init_ossl_x509name): ditto.
+
+Sat May 25 23:22:38 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * test/fiddle/test_c_struct_entry.rb,
+ test/fiddle/test_c_union_entity.rb,
+ test/fiddle/test_cparser.rb, test/fiddle/test_func.rb,
+ test/fiddle/test_handle.rb, test/fiddle/test_import.rb,
+ test/fiddle/test_pointer.rb: don't run test if the system
+ don't support fiddle.
+
+Sat May 25 21:29:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stable
+ added O_CLOEXEC support to posix_openpt, so assume FreeBSD 9.2 or
+ later supports it.
+ http://www.freebsd.org/cgi/query-pr.cgi?pr=162374
+
+Sat May 25 18:46:23 2013 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * proc.c (rb_method_entry_min_max_arity): fix missing break in switch.
+ This was introduced in r38236, which is not intentional apparently.
+ This has caused no actual harm because VM_METHOD_TYPE_OPTIMIZED is
+ not used except for OPTIMIZED_METHOD_TYPE_SEND, but may do in
+ future. Coverity Scan found this inadequacy.
+
+Sat May 25 18:08:06 2013 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * dir.c (bracket): fix copy-paste error. When the first and last
+ characters of fnmatch range have different length, fnmatch may
+ have wrongly matched a path that does not really match.
+ Coverity Scan found this bug.
+
+Sat May 25 17:06:25 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (after_gc_sweep): reduce full GC timing.
+
+Sat May 25 11:28:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (set_const_visibility): return without clearing method
+ cache if no arguments.
+
+ * vm_method.c (set_method_visibility): ditto.
+
+Sat May 25 11:27:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (set_method_visibility): quote unprintable method name.
+
+Sat May 25 11:24:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_frame_callee): returns the called name of the current
+ frame, not the previous frame.
+
+ * eval.c (prev_frame_callee, prev_frame_func): rename and make static,
+ as these are used by rb_f_method_name() and rb_f_callee_name() only.
+
+ * variable.c (set_const_visibility): use the called name.
+
+Sat May 25 08:58:23 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_quote_unprintable): check if argument is a string.
+
+Fri May 24 19:32:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * variable.c (set_const_visibility): use rb_frame_this_func() instead
+ of rb_frame_callee() for getting the name of the called method
+
+ * test/ruby/test_module.rb: add test for private_constant with no args
+
+Fri May 24 18:53:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: do major/full GC when:
+ * number of oldgen object is bigger than twice of
+ number of oldgen object at last full GC.
+ * number of remembered shady object is bigger than twice of
+ number of remembered shady object at last full GC.
+ * number of oldgen object and remembered shady object is bigger
+ than half of total object space.
+ (please fix my English!)
+
+Fri May 24 17:07:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * intern.h: remove dangling rb_class_init_copy declaration
+ [ruby-core:55120] [Bug #8434]
+
+Fri May 24 16:31:23 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/strscan/strscan.c (strscan_aref): raise error if given
+ name reference is not found.
+
+Fri May 24 15:48:18 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (after_gc_sweep, garbage_collect_body): do major GC (full GC)
+ before extending heaps.
+ TODO: do major GC when there are many old (promoted) objects.
+
+ * gc.c (after_gc_sweep): remove TODO comments.
+
+Fri May 24 11:04:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBRUBY_RPATHFLAGS): do not append -L option with
+ runtime library directory if cross compiling, but only -R option.
+ runtime path makes no sense on the host system. [ruby-dev:47363]
+ [Bug #8443]
+
+Fri May 24 02:57:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * object.c (rb_obj_clone): should not propagate OLDGEN status.
+ This propagation had caused WB miss for class.
+
+Thu May 23 17:35:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (loaded_feature_path): fix invalid read by index underflow.
+ the beginning of name is also a boundary as well as just after '/'.
+
+Thu May 23 17:21:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (gc_profile_dump_on): revert r40898. ok to show the record
+ accumulating while lazy_sweep().
+
+Wed May 22 16:50:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (gc_profile_dump_on): use size_t to get rid of overflow and
+ show the header when next_index > 0, instead of next_index != 1.
+
+Wed May 22 15:18:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (setup_overlapped): check the error code in addition
+ to the result of SetFilePointer() to determine if an error occurred,
+ because INVALID_SET_FILE_POINTER is a valid value.
+ [ruby-core:55098] [Bug #8431]
+
+ * win32/win32.c (setup_overlapped, finish_overlapped): extract from
+ rb_w32_read() and rb_w32_write().
+
+Wed May 22 14:19:56 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position
+ of `during_gc' setting.
+
+Wed May 22 07:36:08 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect): all GC is start from garbage_collect()
+ (or garbage_collect_body()). `garbage_collect()' accept additional
+ two parameters `full_mark' and `immediate_sweep'.
+ If `full_mark' is TRUE, then force it full gc (major gc), otherwise,
+ it depends on status of object space. Now, it will be minor gc.
+ If `immediate_sweep' is TRUE, then disable lazy sweep.
+ To allocate free memory, `full_mark' and `immediate_sweep' should be
+ TRUE. Otherwise, they should be FALSE.
+
+ * gc.c (gc_prepare_free_objects): use `garbage_collect_body()'.
+
+ * gc.c (slot_sweep, before_gc_sweep, after_gc_sweep): add logging code.
+
+Tue May 21 22:47:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/strscan/strscan.c (strscan_aref): support named captures.
+ patched by Konstantin Haase [ruby-core:54664] [Feature #8343]
+
+Tue May 21 21:48:44 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/ruby/test_dir_m17n.rb (TestDir_M17N#test_entries_compose):
+ Use #each instead of #map just for iteration.
+
+Tue May 21 19:57:22 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/digest/lib/digest.rb (Digest::Class.file): Take optional
+ arguments that are passed to the constructor of the digest
+ class.
+
+Tue May 21 17:21:12 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: remove gc_profile_record::is_marked. always true.
+
+Tue May 21 17:13:40 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix to collect additional information for GC::Profiler.
+ * major/minor GC
+ * trigger reason of GC
+
+ * gc.c (gc_profile_dump_on): change reporting format with
+ added information.
+
+ * gc.c (gc_profile_record_get): return added information by
+ :GC_FLAGS => array.
+
+Tue May 21 16:45:31 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: GC::Profiler's sweeping time is accumulated all slot
+ sweeping time. At lazy GC, GC::Profiler makes new record entry
+ for each lazy_sweep(). In this change, accumulating all
+ slot_sweep() time.
+ And change indentation.
+
+Tue May 21 16:29:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk (rdoc-bench): add a benchmark rule
+ using RDoc. Generate all rdoc related files
+ (same as `make rdoc') in temporary directory
+ and remove them. Execution time, GC::Profiler
+ and results of GC.stat are printed.
+
+ * tool/rdocbench.rb: added for `rdoc-bench'.
+
+Tue May 21 16:25:05 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_profile_dump_on): `count' should be (int) because it
+ can be negative number.
+ And use pointer for `record' (don't copy).
+
+Tue May 21 03:11:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_each): compose HFS file names from
+ UTF8-MAC. [ruby-core:48745] [Bug #7267]
+
+Tue May 21 03:08:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/envutil.rb (assert_separately): require envutil in the
+ child process too.
+
+Tue May 21 03:07:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_conv_enc_opts): should infect.
+
+Mon May 20 22:24:45 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#delete_if, Set#keep_if): Avoid blockless call of
+ proc, which is not portable to JRuby. Replace &method() with
+ faster and simpler literal blocks while at it.
+
+Mon May 20 22:00:31 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/e2mmap.rb: Format of E2MM documentation
+
+Mon May 20 21:41:15 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/extmk.rb: nodoc this file
+
+Mon May 20 20:43:32 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/cmath.rb: Remove duplicate RDoc heading from overview
+
+Mon May 20 20:36:19 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/securerandom.rb: Update position of overview for RDoc
+
+Mon May 20 19:33:55 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * math.c: improve and fix documentation of sin, tan and log
+
+Mon May 20 19:31:49 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * lib/logger.rb (Logger::Application): show namespace in documentation
+
+Mon May 20 11:50:12 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/pp.rb: Revert part of r40834 and nodoc PP::ObjectMixin
+ [ruby-core:55068]
+
+Mon May 20 10:40:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/webrick/htmlutils.rb (WEBrick::HTMLUtils#escape): replace HTML
+ meta chars even in non-ascii string. [Bug #8425] [ruby-core:55052]
+
+ * lib/webrick/httputils.rb (WEBrick::HTTPUtils#{_escape,_unescape}):
+ fix %-escape encodings. [Bug #8425] [ruby-core:55052]
+
+ * lib/webrick/httpservlet/filehandler.rb (set_dir_list): revert r20152
+ partially and fix misuse of bytesize and regexp repetition operator.
+
+Mon May 20 08:03:51 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/profiler.rb: Document Profiler__ methods
+
+Mon May 20 08:02:13 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/tempfile.rb: nodoc Tempfile#inspect
+
+Mon May 20 07:48:24 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/stringio/stringio.c: Correct position of method rdoc
+
+Mon May 20 07:27:41 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * math.c: RDoc formatting of Math core docs with domains and codomains
+ Patch by @eLobato [Fixes GH-309]
+
+Mon May 20 05:58:12 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/bigdecimal/bigdecimal.c: Formatting for BigMath [Fixes GH-306]
+ Based on a patch by @eLobato.
+ * ext/bigdecimal/lib/bigdecimal/math.rb: ditto
+
+Mon May 20 04:56:59 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/forwardable.rb: Forwardable examples in overview were broken
+ Based on patch by @joem [Fixes GH-303] [Bug #8392]
+
+Mon May 20 03:35:26 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/optparse.rb: nodoc OptionParser::Version and SPLAT_PROC
+
+Mon May 20 03:16:52 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/pp.rb: Document PP::ObjectMixin [Fixes GH-312]
+
+Sun May 19 23:52:22 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/webrick/test_htmlutils.rb: add test for WEBrick::HTMLUtils.
+
+Sun May 19 23:12:07 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * encoding.c: document fix, change default script encoding.
+ patched by @windwiny [Fixes GH-310]
+
+Sun May 19 17:29:07 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#delete_if, Set#keep_if): Add comments.
+
+Sun May 19 11:37:36 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/fiddle/extconf.rb: ignore rc version of libffi to fix build failure.
+
+Sun May 19 10:38:50 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-delete-backward-char): Use
+ delete-char instead of delete-backward-char, which is an
+ interactive function.
+
+Sun May 19 03:59:29 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (str_scrub0): added for refactoring.
+
+Sun May 19 03:48:26 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (URI.decode_www_form): scrub string if decoded
+ bytes are invalid for the encoding.
+
+Sun May 19 02:46:32 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#delete_if, Set#keep_if): Make Set#delete_if and
+ Set#keep_if more space and time efficient by avoiding to_a.
+
+Sun May 19 02:33:09 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-setup-keymap): Make
+ backquotes electric as well. It was listed in
+ ruby-electric-expand-delimiters-list but not activated.
+
+ * misc/ruby-electric.el (ruby-electric-delete-backward-char):
+ Introduce electric DEL that deletes what the previous electric
+ command has input.
+
+ * misc/ruby-electric.el (ruby-electric-matching-char): Make
+ electric quotes work again at the end of buffer.
+
+Sun May 19 01:39:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (setjmp-type): check if setjmpex() is really available.
+ workaround for i686-w64-mingw32 which declares it but lacks its
+ definition.
+
+ * include/ruby/defines.h: include setjmpex.h only if also setjmpex()
+ is available.
+
+Sat May 18 23:57:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (setjmp-type): use setjmpex() on w64-mingw32 to get rid
+ of -Wclobbered warnings.
+
+ * include/ruby/defines.h: include setjmpex.h here becase setjmp.h is
+ included from win32.h via intrin.h, winnt.h, and so on.
+
+Sat May 18 20:28:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.
+
+Sat May 18 20:15:28 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (str_scrub_bang): add String#scrub!. [Feature #8414]
+
+Sat May 18 16:59:52 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb (INTEGER2NUM): Renamed from INTEGER2VALUE.
+
+Sat May 18 16:57:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb (INTEGER2VALUE): Suppress a warning:
+ comparison between signed and unsigned integer expressions
+
+Sat May 18 16:38:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): forward anonymous and first keyword
+ rest argument one. [ruby-core:55033] [Bug #8416].
+
+Sat May 18 15:49:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_core.h (rb_vm_tag): move jmpbuf between tag and prev so ensure to
+ be accessible.
+
+Sat May 18 11:05:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (inspect_enumerator): use VALUE instead of mere char*
+ by using rb_sprintf() and rb_id2str().
+
+ * enumerator.c (append_method): extract from inspect_enumerator().
+
+Sat May 18 09:00:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.
+
+Sat May 18 00:38:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: Convert integer constants bigger than int
+ correctly.
+
+Fri May 17 22:02:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ifaddr.c: Use unsigned LONG_LONG to represent flags
+ because SunOS 5.11 (OpenIndiana) defines ifa_flags as uint64_t.
+
+Fri May 17 21:47:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * cont.c: Typo in constant MAX_MACHINE_STACK_CACHE from '..MAHINE..'
+ patch by @schmurfy [Fixes GH-307]
+
+Fri May 17 19:18:24 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-matching-char): Do not put
+ a closing quote when the quote typed does not start a string, as
+ in $', ?\' or ?\".
+
+Fri May 17 18:06:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Consider error messages to find out version option of
+ C compiler.
+ The C compiler of Sun Studio C emits "Warning: Option -qversion
+ passed to ld, if ld is invoked, ignored otherwise" and exit
+ successfully.
+
+Fri May 17 17:34:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (rb_gc_guarded_ptr): unoptimize on other compilers than gcc and
+ msvc.
+
+Fri May 17 11:06:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_intern.h (TH_PUSH_TAG): ensure jmpbuf to be accessible before
+ pushing tag to get rid of unaccessible tag by stack overflow.
+
+Thu May 16 17:15:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_eval.c (rb_catch_obj): add volatile to tag to prevent crash
+ experimentally.
+ http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20130515T133500Z.log.html.gz
+
+Thu May 16 16:19:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (verconf.in): no longer used.
+
+ * win32/Makefile.sub (config.status): fix typo.
+
+ * configure.in, template/verconf.h.in (RUBY_EXEC_PREFIX): fix for
+ default prefix.
+
+Thu May 16 13:12:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/verconf.h.in: generate verconf.h from the template and
+ rbconfig.rb.
+
+Thu May 16 05:47:18 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: fix syntax error.
+ Thanks @spastorino! [ruby-core:55011]
+
+Thu May 16 03:05:45 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_node_newnode): use newobj_of() instead of rb_newobj().
+
+Thu May 16 02:03:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/depend: Add a dependency for ifaddr.o.
+
+Thu May 16 01:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (verconf.h): $< cannot be used in explicit rules with
+ nmake.
+
+ * win32/Makefile.sub (CONFIG_H): create verconf.in instead of
+ verconf.h.
+
+Thu May 16 01:25:07 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: only emit warnings when
+ -w is enabled.
+
+Wed May 15 18:58:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (newobj): rename to `newobj_of' and accept additional
+ three parameters v1, v2, v3. newobj_of() do OBJSETUP() and
+ fill values with v1, v2, v3.
+
+ * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc):
+ use newobj_of().
+
+Wed May 15 17:55:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_PLATFORM): move to config.h as needed by
+ version.c.
+
+Wed May 15 17:04:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add an additional RGENGC_PROFILE mode (2).
+ Profiling result can be check by GC.stat.
+
+ * gc.c (type_name): separate from obj_type_name().
+
+Wed May 15 16:58:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: save configured load path values into verconf.in.
+
+ * common.mk (verconf.h): create from verconf.in with shvar_to_cpp.rb.
+
+ * tool/shvar_to_cpp.rb: turn shell variables into C macros.
+ [Bug #7959]
+
+ * loadpath.c: split load path staffs from version.c.
+
+ * dmyloadpath.c: miniruby has no builtin load paths, so verconf.h is
+ not needed.
+
+Wed May 15 03:56:09 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: adding backwards
+ compatible YAMLTree.new method
+
+Wed May 15 02:22:16 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: Adding Psych.safe_load for loading a user
+ defined, restricted subset of Ruby object types.
+ * ext/psych/lib/psych/class_loader.rb: A class loader for
+ encapsulating the logic for which objects are allowed to be
+ deserialized.
+ * ext/psych/lib/psych/deprecated.rb: Changes to use the class loader
+ * ext/psych/lib/psych/exception.rb: ditto
+ * ext/psych/lib/psych/json/stream.rb: ditto
+ * ext/psych/lib/psych/nodes/node.rb: ditto
+ * ext/psych/lib/psych/scalar_scanner.rb: ditto
+ * ext/psych/lib/psych/stream.rb: ditto
+ * ext/psych/lib/psych/streaming.rb: ditto
+ * ext/psych/lib/psych/visitors/json_tree.rb: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ditto
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * ext/psych/psych_to_ruby.c: ditto
+ * test/psych/helper.rb: ditto
+ * test/psych/test_safe_load.rb: tests for restricted subset.
+ * test/psych/test_scalar_scanner.rb: ditto
+ * test/psych/visitors/test_to_ruby.rb: ditto
+ * test/psych/visitors/test_yaml_tree.rb: ditto
+
+Wed May 15 02:06:35 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * test/psych/helper.rb: envutil is not available outside Ruby, so
+ port the functions from envutil to the test helper.
+
+ * test/psych/test_deprecated.rb: ditto
+
+ * test/psych/test_encoding.rb: ditto
+
+Wed May 15 00:42:54 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * signal.c: need to include unistd.h for write(2).
+ unistd.h is now included via ruby/defines.h, but should explicitly
+ include here. (suggested by kosaki)
+
+Tue May 14 23:43:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/.document: Add ifaddr.c.
+
+Tue May 14 23:24:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/extconf.rb: check for if_nametoindex() for
+ i686-w64-mingw32, and check for declarations of if_indextoname() and
+ if_nametoindex().
+
+ * ext/socket/ifaddr.c (ifaddr_ifindex): not-implement unless
+ if_nametoindex() is available.
+
+ * ext/socket/rubysocket.h: declare if_indextoname() and
+ if_nametoindex() if available but not declared.
+
+Tue May 14 19:58:17 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * ext/dl/lib/dl/func.rb (DL::Function#call): check tainted when
+ $SAFE > 0.
+ * ext/fiddle/function.c (function_call): check tainted when $SAFE > 0.
+ * test/fiddle/test_func.rb (module Fiddle): add test for above.
+
+
+Tue May 14 14:51:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/win32.h (INTPTR_MAX, INTPTR_MIN, UINTPTR_MAX): split
+ from intptr_t and uintptr_t, since VC9 defines the latter only in
+ crtdefs.h.
+
+Tue May 14 12:21:28 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (NET_LUID): mingw may have NET_LUID and not defined
+ _IFDEF_.
+
+Tue May 14 03:33:17 2013 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (rb_str_new_frozen): remove debug print.
+
+Tue May 14 03:22:51 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: enable to generate write barrier protected
+ arrays (T_ARRAY).
+
+Tue May 14 03:21:42 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: enable to generate write barrier protected
+ strings (T_STRING).
+
+Tue May 14 03:19:59 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: enable to generate write barrier protected
+ objects (T_OBJECT).
+
+Tue May 14 03:17:15 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: enable to generate write barrier protected
+ objects for numeric types (Float, Complex, Rational, Bignum).
+
+Tue May 14 03:10:59 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: enable RGENGC (USE_RGENGC)
+ but no type creates write protected (sunny) objects
+ (RGENGC_WB_PROTECTED_* == 0).
+
+Tue May 14 02:47:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: support RGENGC. [ruby-trunk - Feature #8339]
+ See this ticket about RGENGC.
+
+ * gc.c: Add several flags:
+ * RGENGC_DEBUG: if >0, then prints debug information.
+ * RGENGC_CHECK_MODE: if >0, add assertions.
+ * RGENGC_PROFILE: if >0, add profiling features.
+ check GC.stat and GC::Profiler.
+
+ * include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0).
+
+ * array.c: add write barriers for T_ARRAY and generate sunny objects.
+
+ * include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if
+ you want to access raw pointers. If you modify the contents which
+ pointer pointed, then you need to care write barrier.
+
+ * bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects.
+
+ * complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX
+ and generate sunny objects.
+
+ * rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write
+ barriers for T_RATIONAL and generate sunny objects.
+
+ * internal.h: add write barriers for RBasic::klass.
+
+ * numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects.
+
+ * object.c (rb_class_allocate_instance), range.c:
+ generate sunny T_OBJECT objects.
+
+ * string.c: add write barriers for T_STRING and generate sunny objects.
+
+ * variable.c: add write barriers for ivars.
+
+ * vm_insnhelper.c (vm_setivar): ditto.
+
+ * include/ruby/ruby.h, debug.c: use two flags
+ FL_WB_PROTECTED and FL_OLDGEN.
+
+ * node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED):
+ move flag bits.
+
+Tue May 14 01:54:48 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: remove rb_objspace_t::marked_num.
+ We can use `objspace_live_num()' instead of removed `marked_num'
+ if it is after `after_gc_sweep()' function call.
+
+ * gc.c (after_gc_sweep): use objspace_live_num() instead of removed
+ rb_objspace_t::marked_num.
+
+ * gc.c (gc_mark_ptr, gc_marks): remove rb_objspace_t::marked_num code.
+
+ * gc.c (gc_prepare_free_objects): do not call set_heaps_increment()
+ with checking objspace->heap.marked_num. At this point, we only
+ need to check availability of free-cell.
+
+ * gc.c (lazy_sweep): call after_gc_sweep() if there are no sweep_able entry.
+
+ * gc.c (rest_sweep, gc_prepare_free_objects): remove after_gc_sweep() call.
+
+Tue May 14 01:50:41 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: disable GC_PROFILE_MORE_DETAIL (fix last commit).
+
+ * gc.c (gc_prof_set_malloc_info): fix "objspace->heap.live_num" to
+ "objspace_live_num(objspace)". There is no such member variable.
+
+Tue May 14 01:25:55 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: refactoring GC::Profiler.
+
+ * gc.c (gc_prof_sweep_timer_start/stop): removed because
+ they doesn't support lazy sweep.
+
+ * gc.c (gc_prof_sweep_slot_timer_start/stop): added.
+ redefine `sweeping time' to accumulated time of all of
+ slot_sweep().
+
+ * gc.c (rb_objspace_t::profile::count): renamed to
+ rb_objspace_t::profile::next_index. `counter' seems ambiguous.
+ increment it when next record is acquired.
+
+Tue May 14 00:48:55 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: constify RRational::(num,den) and
+ RComplex::(real,imag).
+ Add macro to set these values:
+ * RRATIONAL_SET_NUM()
+ * RRATIONAL_SET_DEN()
+ * RCOMPLEX_SET_REAL()
+ * RCOMPLEX_SET_IMAG()
+ This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
+
+ TODO: API design. RRATIONAL_SET(rat,num,den) is enough?
+ TODO: Setting constify variable with cast has same issue of r40691.
+
+ * complex.c, rational.c: use above macros.
+
+Mon May 13 21:49:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Check socketpair again.
+ It is required on Unix.
+
+Mon May 13 21:20:32 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (getipaddrs): use alternative interface name if
+ available, because if_nametoindex() requires them.
+
+Mon May 13 20:23:24 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, include/ruby/win32.h (getipaddrs): [experimental]
+ emulate getipaddrs(3) on Unix.
+
+ * win32/Makefile.sub, configure.in (LIBS): need iphlpapi.lib for above
+ function.
+
+ * include/ruby/win32.h (socketpair): rb_w32_socketpair() doesn't
+ substitute for any function, so use non-prefixed name.
+
+ * ext/socket/extconf.rb (socketpair); follow above change.
+
+Mon May 13 20:11:06 2013 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (prepare_iseq_build): remove additional line break.
+
+Mon May 13 19:29:54 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: constify RBasic::klass and add
+ RBASIC_CLASS(obj) macro which returns a class of `obj'.
+ This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
+
+ * object.c: add new function rb_obj_reveal().
+ This function reveal internal (hidden) object by rb_obj_hide().
+ Note that do not change class before and after hiding.
+ Only permitted example is:
+ klass = RBASIC_CLASS(obj);
+ rb_obj_hide(obj);
+ ....
+ rb_obj_reveal(obj, klass);
+
+ TODO: API design. rb_obj_reveal() should be replaced with others.
+
+ TODO: modify constified variables using cast may be harmful for
+ compiler's analysis and optimization.
+ Any idea to prohibit inserting RBasic::klass directly?
+ If rename RBasic::klass and force to use RBASIC_CLASS(obj),
+ then all codes such as `RBASIC(obj)->klass' will be
+ compilation error. Is it acceptable? (We have similar
+ experience at Ruby 1.9,
+ for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
+
+ * internal.h: add some macros.
+ * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
+ object.
+ * RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
+ * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
+ without write barrier (planned).
+ * RCLASS_SET_SUPER(a, b) set super class of a.
+
+ * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
+ file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
+ parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
+ string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
+ Use above macros and functions to access RBasic::klass.
+
+ * ext/coverage/coverage.c, ext/readline/readline.c,
+ ext/socket/ancdata.c, ext/socket/init.c,
+ * ext/zlib/zlib.c: ditto.
+
+Mon May 13 18:44:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * *.c, parse.y, insns.def: use RARRAY_AREF/ASET macro
+ instead of using RARRAY_PTR().
+
+Mon May 13 16:53:53 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: add new utility macros to access
+ Array's element.
+ * RARRAY_AREF(a, i) returns i-th element of an array `a'
+ * RARRAY_ASET(a, i, v) set i-th element of `a' to `v'
+ This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
+
+Mon May 13 15:31:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * object.c (rb_obj_setup): added.
+
+ * include/ruby/ruby.h (OBJSETUP): use rb_obj_setup() instead of
+ a macro.
+
+Mon May 13 15:24:16 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_data_object_alloc): check klass only if klass is not 0.
+ klass==0 means internal object.
+
+Mon May 13 14:57:28 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc):
+ use NEWOBJ_OF() instead of NEWOBJ().
+
+Mon May 13 14:51:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_obj_singleton_method): new method Kernel#singleton_method
+ which returns a Method object of the singleton method.
+ non-singleton method causes NameError, but not aliased or zsuper
+ method, right now.
+ [ruby-core:54914] [Feature #8391]
+
+ * vm_method.c (rb_method_entry_at): return the method entry for id at
+ klass, without ancestors.
+
+ * class.c (rb_singleton_class_get): get the singleton class if exists,
+ or nil.
+
+Mon May 13 10:20:59 2013 Yuki Yugui Sonoda <yugui@google.com>
+
+ * ext/openssl/ossl_ssl.c: Disabled OpenSSL::SSL::SSLSocket if
+ defined(OPENSSL_NO_SOCK).
+
+ This fixes a linkage error on platforms which do not have socket.
+ OpenSSL itself is still useful as a set of cryptographic functions
+ even on such platforms.
+
+Mon May 13 10:30:04 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]
+
+Mon May 13 10:04:22 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * random.c: Document Random::DEFAULT by @eLobato [Fixes GH-304]
+
+Sun May 12 21:12:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (OFFT2NUM): RUBY_REPLACE_TYPE also defines macro
+ to convert int type to VALUE if found.
+
+Wed May 8 13:46:52 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/intern.h (rb_iv_set, rb_iv_get): removed. Because
+ ruby.h has a declaration for that.
+
+Wed May 8 13:49:06 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/intern.h (rb_uint2big, rb_int2big, rb_uint2inum)
+ (rb_int2inum, rb_ll2inum, rb_ull2inum): removed because ruby.h
+ has a declaration for these.
+
+Sun May 12 17:52:23 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: removes 'ac_cv_func_fseeko=yes' form MinGW
+ specific definitions.
+
+Sun May 12 17:25:46 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (rb_file_s_truncate): use correct type. chsize takes
+ a long.
+
+Sun May 12 17:18:46 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c: move '#define HAVE_SPAWNV 1' to win32/Makefile.sub.
+ * win32/Makefile.sub: see above.
+
+Sun May 12 17:13:32 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: removes AC_CHECK_FUNCS(setitimer) because it's
+ unused.
+
+Sun May 12 17:08:16 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: removes AC_CHECK_FUNCS(pause) because it's unused.
+
+Sun May 12 17:05:18 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (rb_f_kill): fixes typo. s/HAS_KILLPG/HAVE_KILLPG/.
+
+Sun May 12 17:03:27 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: abort if gettimeofday doesn't exist.
+
+Sun May 12 16:31:27 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: adds RUBY_REPLACE_TYPE(off_t) for creating
+ NUM2OFFT.
+ * file.c (rb_file_truncate): use correct type. chsize() take
+ a long.
+ * include/ruby/ruby.h (NUM2OFFT): use a definition created by
+ a configure script by default.
+
+Sun May 12 16:03:41 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: removes AC_CHECK_FUNC(fseeko, fseeko64, ftello,
+ ftello64). They are not used from anywhere.
+
+ * win32/win32.c (fseeko): removes.
+ * win32/win32.c (rb_w32_ftello): removes.
+ * include/ruby/win32.h: removes declarations of rb_w32_ftello and
+ rb_w32_fseeko.
+ * win32/Makefile.sub: removes '#define HAVE_FTELLO 1'.
+
+Sun May 12 15:51:47 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: remove AC_CHECK_FUNC(close). It is not used from
+ anywhere.
+
+Sun May 12 15:50:45 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: adds comments for setjmp check.
+
+Sun May 12 15:38:09 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: move clock_gettime() check into regular place.
+
+Wed May 8 13:45:53 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: add getenv() declaration check.
+ * dln_find.c: add HAVE_DECL_GETENV test.
+
+Sun May 12 15:33:18 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: sorts AC_CHECK_FUNCS()s as alphabetical order.
+
+Wed May 8 13:41:57 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * bignum.c: remove redundant decl for big_lshift() big_rshift().
+
+Sun May 12 16:06:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/socket/rubysocket.h (rsock_inspect_sockaddr): as r40646
+ check HAVE_TYPE_STRUCT_SOCKADDR_DL.
+
+Sat May 11 23:01:58 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/socket/rubysocket.h (HAVE_TYPE_STRUCT_SOCKADDR_DL):
+ MSVC has struct sockaddr_dl, but its content is broken.
+ http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130511T103938Z.log.html.gz
+
+Sat May 11 22:07:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/rinda/test_rinda.rb: Socket.getifaddrs may returns an interface
+ which #addr method returns nil for venet0 in OpenVZ.
+
+Sat May 11 21:56:34 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (rsock_inspect_sockaddr): Add casts to
+ suppress warnings.
+
+Sat May 11 17:28:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: New method, Socket.getifaddrs, implemented.
+ [ruby-core:54777] [Feature #8368]
+
+Sat May 11 00:47:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * gc.h (SET_MACHINE_STACK_END): Add !defined(_ILP32) to a defining
+ condition to avoid compilation error on x32.
+ https://sites.google.com/site/x32abi/
+
+Fri May 10 23:56:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_peek_variable_name): treat invalid global, class,
+ and instance variable names as mere strings rather than errors.
+ [ruby-core:54885] [Bug #8375]
+
+Fri May 10 20:22:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Move library checks into "Checks for libraries." part.
+
+Fri May 10 19:32:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Reformat arguments of AC_CHECK_HEADERS and
+ AC_CHECK_FUNCS to track modifications easily.
+
+Fri May 10 12:01:36 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Don't link librt if clock_gettime is available in
+ the main C library.
+ glibc 2.17 moves clock_* from librt to the main C library.
+ http://sourceware.org/ml/libc-announce/2012/msg00001.html
+
+Thu May 9 22:00:35 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should
+ not be negative.
+
+Thu May 9 21:09:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * file.c, ext/etc/etc.c, ext/socket/unixsocket.c,
+ ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use
+ HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER.
+
+Thu May 9 20:43:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): Always set
+ controls_num to raise NotImplementedError appropriately.
+ (bsock_recvmsg_internal): Raise NotImplementedError if
+ :scm_rights=>true is given on platforms which don't have
+ 4.4BSD style control message.
+
+Thu May 9 12:06:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/rubysocket.h, ext/socket/unixsocket.c,
+ ext/socket/ancdata.c: Use HAVE_STRUCT_MSGHDR_MSG_CONTROL instead
+ of HAVE_ST_MSG_CONTROL.
+
+Thu May 9 11:30:02 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * string.c: Add call-seq alias for String#=== [Bug #8381]
+
+Thu May 9 11:14:18 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * doc/contributing.rdoc: Add guide for contributing to CRuby
+
+Thu May 9 04:55:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Check socket library again. shutdown() is used in
+ io.c.
+
+Thu May 9 01:52:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Don't check socketpair. socketpair is not used in
+ ruby command itself.
+
+Thu May 9 01:05:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_mod_included_modules): should not include non-modules.
+ [ruby-core:53158] [Bug #8025]
+
+Wed May 8 22:46:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_mod_included_modules): should not include the original
+ module itself. [ruby-core:53158] [Bug #8025]
+
+Wed May 8 17:43:55 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_ext_int_to_encs): ignore internal encoding if external
+ encoding is ASCII-8BIT. [Bug #8342]
+
+Wed May 8 13:49:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/generator/generator.c (isArrayOrObject): cast char to
+ unsigned char. [Bug #8378]
+
+Wed May 8 13:46:10 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/generator/depend: fix dependencies [Bug #8379]
+
+ * ext/json/parser/depend: ditto.
+
+Wed May 8 13:07:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): fail if $, @, @@ are not followed by a valid
+ name character. [ruby-core:54846] [Bug #8375].
+
+Wed May 8 13:06:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (ISGRAPH): add missing macro.
+
+Wed May 8 06:42:56 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/socket/socket.c (socket_s_ip_address_list): fix wrongly filled
+ sin6_scope_id on KAME introduced by r40593 for OpenIndiana.
+ KAME uses fe80:<scope_id>::<interface id> for link-local address
+ internally.
+ Setting sin6_scope_id causes it leaked.
+ see also comments of sockaddr_obj().
+
+Tue May 7 22:12:34 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/readline/readline.c (insert_ignore_escape): Add a cast to
+ unsigned char * before dereference.
+ This suppress a warning on Cygwin.
+
+Tue May 7 12:15:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): Add a cast to
+ suppress warning.
+ Bionic defines socklen_t as int.
+ Bionic defines msg_controllen as unsigned int (__kernel_size_t)
+ instead of socklen_t as POSIX.
+
+Tue May 7 12:12:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (ancillary_inspect): Don't call
+ anc_inspect_ipv6_pktinfo if !HAVE_TYPE_STRUCT_IN6_PKTINFO.
+ anc_inspect_ipv6_pktinfo is not defined in the case.
+
+Tue May 7 12:10:52 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (socket_s_ip_address_list): Cast EXTRA_SPACE as
+ int. This suppress a warning.
+
+Tue May 7 12:09:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Set close_fds false for Cygwin.
+ Cygwin doesn't support fd passing.
+ This enables socket extension library cross-compilable by default.
+
+Tue May 7 12:07:35 2013 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (swap32): Don't redefine it if it is already defined.
+ Bionic defines it.
+ (swap64): Ditto.
+
+Mon May 6 20:50:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (socket_s_ip_address_list): Fill sin6_scope_id
+ if getifaddrs() returns an IPv6 link local address which
+ sin6_scope_id is zero, such as on OpenIndiana SunOS 5.11.
+
+Sun May 5 18:56:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * insns.def (defined): use vm_search_superclass() like as normal super
+ call. based on a patch <https://gist.github.com/wanabe/5520026> by
+ wanabe.
+
+ * vm_insnhelper.c (vm_search_superclass): return error but not raise
+ exceptions.
+
+ * vm_insnhelper.c (vm_search_super_method): check the result of
+ vm_search_superclass and raise exceptions on error.
+
+Sun May 5 16:29:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * insns.def (defined): get method entry from the method top level
+ frame, not block frame. [ruby-core:54769] [Bug #8367]
+
+Sun May 5 13:28:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/ruby.pc.in (Cflags): use rubyarchhdrdir for multiarch.
+ [Bug #7874]
+
+Sat May 4 07:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * doc/security.rdoc: Add note about reporting security vulns
+
+Sat May 4 04:13:27 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/defines.h (RUBY_ATTR_ALLOC_SIZE): New for
+ attribute((alloc_size(params))).
+
+ * include/ruby/defines.h (xmalloc, xmalloc2, xcalloc)
+ (xrealloc, xrealloc2): Annotated by RUBY_ATTR_ALLOC_SIZE.
+ * include/ruby/ruby.h (rb_alloc_tmp_buffer): ditto.
+
+Fri May 3 19:32:13 2013 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/util.rb: All class methods modulized.
+ We can use these methods like a function when "include CGI::Util".
+ [Feature #8354]
+
+Fri May 3 14:09:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Make default_ipv6 true for Cygwin.
+ Cygwin supports IPv6 since Cygwin 1.7.1 (2009-12).
+ http://cygwin.com/ml/cygwin-announce/2009-12/msg00027.html
+
+Fri May 3 13:35:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/{getaddrinfo,getnameinfo}.c: define socklen_t if not
+ defined, e.g., older VC.
+
+Fri May 3 13:29:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/win32.h (INTPTR_MAX, INTPTR_MIN, UINTPTR_MAX): also
+ should be defined when defining intptr_t and uintptr_t.
+ bigdecimal.c requires the former two now.
+
+Fri May 3 13:22:12 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (poll_child_status): fix build error on older mingw.
+
+Fri May 3 00:15:58 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * common.mk: remove timestamps in distclean-ext realclean-ext.
+
+Thu May 2 23:23:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_obj_is_kind_of): skip prepending modules.
+ [ruby-core:54742] [Bug #8357]
+
+ * object.c (rb_class_inherited_p): ditto.
+ [ruby-core:54736] [Bug #8357]
+
+Thu May 2 22:11:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bin/irb: remove dead code from sample/irb.rb.
+
+Thu May 2 17:32:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (copy_ivar_i): get rid of overwriting already copied
+ instance variables. c.f. [Bug #8276]
+
+Thu May 2 16:55:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (id_locals): use cached ID.
+
+ * vm.c (ruby_thread_init): ditto.
+
+ * defs/id.def: add more predefined IDs used in core.
+
+Thu May 2 13:42:42 2013 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 4.7.4 (r8483)
+ * test/minitest/*: ditto
+
+Thu May 2 11:32:22 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (poll_child_status): [experimental] set the cause of
+ a child's death to status if its exitcode seems to be an error.
+
+ * test/ruby/test_process.rb (TestProcess#test_no_curdir): maybe now
+ we can test it.
+
+ * test/ruby/test_thread.rb (TestThread#test_thread_timer_and_interrupt):
+ ditto.
+
+Thu May 2 11:24:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/yaml.rb: nodoc EngineManager, add History doc #8344
+
+Wed May 1 21:11:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (localtime_with_gmtoff_zone): musl libc may return NULL for
+ tm_zone.
+
+Wed May 1 18:59:36 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * enum.c (Enumerable#chunk): fix grammar of error message
+ for symbols beginning with an underscore [Bug #8351]
+
+Wed May 1 16:47:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/curses/extconf.rb (curses_version): try once for each tests, a
+ function or a variable. fallback to variable for old SVR4.
+
+Wed May 1 16:17:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (extmake): extensions not to be installed should not
+ make static libraries, but make dynamic libraries always.
+
+Wed May 1 12:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/rake/version.rb: Fix RDoc warning with :include: [Bug #8347]
+
+Wed May 1 11:40:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * defs/id.def (predefined): add "idProc".
+
+ * eval.c (frame_func_id): use predefined IDs.
+
+ * proc.c (mnew, mproc, mlambda): use predefined IDs.
+
+ * vm.c (rb_vm_control_frame_id_and_class): ditto.
+
+ * vm.c (Init_VM): ditto.
+
+Tue Apr 30 23:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/benchmark.rb: Update Benchmark results on newer CPU
+
+Tue Apr 30 12:31:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (mproc, mlambda): use frozen core methods instead of plain
+ global methods, so that methods cannot be overridden.
+ [ruby-core:54687] [Bug #8345]
+
+ * vm.c (Init_VM): define proc and lambda on the frozen core object.
+
+ * include/ruby/intern.h (rb_block_lambda): add declaration instead of
+ deprecated rb_f_lambda.
+
+Mon Apr 29 17:02:30 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/nkf.h: Bionic libc doesn't have locale.
+ [Feature #8338]
+
+
+Mon Apr 29 06:58:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): no need of alloca for
+ small fixed size array.
+
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): check overflow first,
+ and use alloca for small size input.
+
+Mon Apr 29 00:40:13 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * lib/yaml.rb: Clarify documentation about YAML being always Psych.
+ Give a tip about using Syck. See #8344.
+
+Sun Apr 28 23:34:01 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * lib/yaml.rb: Use another trick to define the YAML module.
+ https://twitter.com/n0kada/status/328342207511801856
+
+Sun Apr 28 23:19:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/pp.rb: Update PP module overview by @geopet
+
+Sun Apr 28 22:04:37 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): fix buffer overflow on
+ x64 Windows and memory leak when initializing with integer.
+ [ruby-core:54615] [Bug #8337]
+
+Sun Apr 28 12:38:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * README.EXT: correct method name to be used. [Bug #7982]
+
+ * README.EXT.ja: add notes too.
+
+Sun Apr 28 10:35:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c: With feedback from Steve Klabnik, reverted a change to
+ #untrusted? and #tainted?. Also adjusted grammar for $SAFE levels
+
+Sun Apr 28 10:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/yaml.rb: Disable setting YAML const twice [ruby-core:54642]
+
+Sun Apr 28 09:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c: Documentation for taint and trust [Bug #8162]
+
+Sun Apr 28 09:40:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * README.EXT: Copy note from r40505 for rb_sprintf() [Bug #7982]
+
+Sun Apr 28 08:28:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/curses/curses.c: Update Curses::Window example for nicer output
+ Patch by Michal Suchanek [Bug #8121] [ruby-core:53520]
+
+Sun Apr 28 08:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * README.EXT: Update note from r40504, by Jeremy Evans [Bug #7982]
+
+Sun Apr 28 08:02:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * README.EXT: Add note to warn use of %i in Exceptions [Bug #7982]
+
+Sun Apr 28 02:41:05 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Fix a typo. Should check endgrent() instead of
+ endgrnam().
+
+Sun Apr 28 00:35:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c (obj2gid): Don't call endgrent() if not exist.
+ Bionic (Android's libc) don't have endgrent().
+
+ * configure.in: Check endgrnam function.
+
+Sat Apr 27 23:53:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+
+ * lib/yaml.rb: add security warning to YAML documentation
+
+Sat Apr 27 23:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/yaml.rb: Documentation for YAML module [Bug #8213]
+
+Sat Apr 27 20:19:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * thread_pthread.c (ruby_init_stack): Add STACK_GROW_DIR_DETECTION.
+ This fixes a compilation failure while cross-compiling for Tensilica
+ Xtensa Processor.
+
+Sat Apr 27 19:32:44 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * thread.c: fix typos and documentation
+
+Sat Apr 27 19:04:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * sparc.c: Use __asm__ instead of asm for gcc.
+ gcc doesn't provide asm keyword if -ansi option is given.
+ http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
+
+Sat Apr 27 17:22:50 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Redundant test removed.
+
+Sat Apr 27 16:00:10 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb (test_recvmsg_with_msg_peek_creates_fds):
+ Extracted.
+
+Sat Apr 27 15:50:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (SIGNED_INTEGER_TYPE_P): New macro.
+ (SIGNED_INTEGER_MAX): Ditto.
+ (SIGNED_INTEGER_MIN): Ditto.
+ (UNSIGNED_INTEGER_MAX): Ditto.
+ (TIMET_MAX): Use SIGNED_INTEGER_MAX and UNSIGNED_INTEGER_MAX.
+ (TIMET_MIN): Use SIGNED_INTEGER_MIN.
+
+ * thread.c (TIMEVAL_SEC_MAX): Use SIGNED_INTEGER_MAX.
+ (TIMEVAL_SEC_MIN): Use SIGNED_INTEGER_MIN.
+
+Sat Apr 27 10:52:52 2013 Tanaka Akira <akr@fsij.org>
+
+ * thread.c (TIMEVAL_SEC_MAX, TIMEVAL_SEC_MIN): Consider environments,
+ sizeof(time_t) is smaller than sizeof(tv_sec), such as
+ OpenBSD 5.2 (amd64).
+
+Fri Apr 26 23:34:59 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/text.rb (REXML::Text.normalize): Fix a bug that all
+ entity filters are ignored. [ruby-dev:47278] [Bug #8302]
+ Patch by Ippei Obayashi. Thanks!!!
+ * test/rexml/test_entity.rb (EntityTester#test_entity_filter): Add
+ a test of the above change.
+
+Fri Apr 26 22:53:55 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/element.rb (REXML::Attributes#to_a): Support
+ namespaced attributes. [ruby-dev:47277] [Bug #8301]
+ Patch by Ippei Obayashi. Thanks!!!
+ * test/rexml/test_attributes.rb
+ (AttributesTester#test_to_a_with_namespaces): Add a test of the
+ above change.
+
+Fri Apr 26 21:48:29 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rss/atom.rb (RSS::Atom::Entry): Fix indent of document comment.
+
+Fri Apr 26 21:21:17 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rss/maker.rb (RSS::Maker): Fix indent of document comment.
+
+Fri Apr 26 18:41:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Use a block of enable_config() for
+ --{enable,disable}-close-fds-by-recvmsg-with-peek configure option
+
+Fri Apr 26 18:08:08 2013 Tanaka Akira <akr@fsij.org>
+
+ * dir.c (dir_set_pos): Fix a compilation error when seekdir() is not
+ exist.
+
+Fri Apr 26 17:41:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * thread_pthread.c (ruby_init_stack): Add STACK_GROW_DIR_DETECTION.
+ This fixes a compilation failure while cross-compiling for ARM.
+
+Fri Apr 26 14:35:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/rss/atom.rb: Documentation for RSS::Atom based on a patch by
+ Michael Denomy
+ * lib/rss/maker.rb: Documentation for RSS::Maker also by @mdenomy
+
+Fri Apr 26 12:41:22 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: Test linkability of curses_version at first.
+
+ * ext/socket/extconf.rb: Test the behavior of fd passing with MSG_PEEK
+ only if recvmsg(), msg_control member, AF_UNIX and SCM_RIGHTS are
+ available.
+
+Fri Apr 26 00:07:52 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * lib/rinda/ring.rb (Rinda::RingServer#initialize): accept array
+ arguments of address to specify multicast interface.
+
+ * lib/rinda/ring.rb (Rinda::RingServer#make_socket): add optional
+ arguments for multicast interface.
+
+ * test/rinda/test_rinda.rb
+ (TestRingFinger#test_ring_server_ipv4_multicast,
+ TestRingFinger#test_ring_server_ipv6_multicast): add tests for
+ above change.
+
+ * test/rinda/test_rinda.rb
+ (TestRingServer#test_make_socket_ipv4_multicast,
+ TestRingServer#test_make_socket_ipv6_multicast): change bound
+ interface address because multicast address is not allowed on Linux
+ or Windows.
+ [ruby-core:53692] [Bug #8159]
+
+Thu Apr 25 23:45:02 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * lib/rinda/ring.rb (Rinda::RingServer#initialize): add a socket
+ to @sockets in make_socket() to close sockets on shutdown even if
+ make_socket() is called after initialize.
+
+ * lib/rinda/ring.rb (Rinda::RingServer#make_socket): ditto.
+
+Thu Apr 25 23:39:42 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/rinda/test_rinda.rb (TupleSpaceProxyTest#test_take_bug_8215):
+ use KILL on Windows since TERM doen't work and ruby process remains
+ after test-all on Windows.
+
+Thu Apr 25 23:16:28 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: Implement
+ --with-curses-version={function,variable} configure option for
+ cross-compiling.
+
+Thu Apr 25 18:15:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Don't use WIDE getaddrinfo by default.
+
+Thu Apr 25 17:56:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Remove obsolete options: ---with-ipv6-lib and
+ --with-ipv6-libdir.
+
+Thu Apr 25 17:43:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Implement
+ --{enable,disable}-close-fds-by-recvmsg-with-peek configure option
+ for cross-compiling.
+ Make --{enable,disable}-wide-getaddrinfo configure option
+ cross-compiling friendly.
+
+Thu Apr 25 16:11:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_ext_int_to_encs, parse_mode_enc): bom-prefixed name is
+ not a real encoding name, just a fallback. so the proper conversion
+ should take place even if if the internal encoding is equal to the
+ bom-prefixed name, unless actual encoding is equal to the internal
+ encoding. [ruby-core:54563] [Bug #8323]
+
+ * io.c (io_set_encoding_by_bom): reset extenal encoding if no BOM
+ found. [ruby-core:54569]
+
+Thu Apr 25 14:35:01 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): allow Fixnum and Bignum.
+ [ruby-core:53986] [Feature #8217]
+
+Thu Apr 25 14:26:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.
+ It gets encoding argument to specify the character encoding.
+ It now allows loose percent encoded strings, but denies ;-separator.
+ [ruby-core:53475] [Bug #8103]
+
+ * lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.
+ It gets encoding argument to convert before percent encode.
+ Now UTF-16 strings aren't converted to UTF-8 before percent encode
+ by default.
+
+Wed Apr 25 14:26:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+
+ * benchmark/bm_hash_shift.rb: add benchmark for Hash#shift
+
+ * hash.c (rb_hash_shift): use st_shift if hash is not being iterated to
+ delete element without iterating the whole hash.
+
+ * hash.c (shift_i): remove function
+
+ * include/ruby/st.h (st_shift): add st_shift function
+
+ * st.c (st_shift): ditto
+
+ [Bug #8312] [ruby-core:54524] Patch by funny-falcon
+
+Thu Apr 25 12:03:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Extract C programs as toplevel constants.
+
+Thu Apr 25 02:23:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_RM_RECURSIVE): this hack is needed by only
+ autoconf 2.69 or earlier on darwin.
+
+Thu Apr 25 01:22:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tracer.rb (get_line): simply read by File.readlines.
+
+ * lib/debug.rb (script_lines): get source lines from SCRIPT_LINES__ or
+ read from the file.
+
+ * lib/debug.rb (display_list): use script_lines instead of recursion.
+ [Bug #8318]
+
+ * lib/debug.rb (line_at): use script_lines same as display_list.
+
+ * lib/debug.rb (display_list): Fix debug listing when called from the
+ same file it has been required. patch by Dario Bertini <berdario AT
+ gmail.com> [Bug #8318] [fix GH-280]
+
+Wed Apr 24 21:51:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Check mblen().
+ mblen() is optional in uClibc.
+
+ * eval_intern.h (CharNext): Don't use mblen() is not available.
+
+Wed Apr 24 15:55:06 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_fd_fix_cloexec): use rb_update_max_fd().
+
+Wed Apr 24 14:08:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * numeric.c: Fix wiki link on Float imprecision in overview, patched
+ by Makoto Kishimoto [Bug #8304] [ruby-dev:47280]
+
+Wed Apr 24 14:03:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): disallow $- without following identifier
+ character. [ruby-talk:406969]
+
+ * parse.y (is_special_global_name): mere $- is not a valid global
+ variable name.
+
+Wed Apr 24 13:54:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * string.c: Document String#setbyte return value by @gjmurakami-10gen
+ [Fixes GH-294]
+
+Wed Apr 24 13:45:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * class.c: Example of Object#methods by @windwiny [Fixes GH-293]
+ * ruby.c: Document return values of Kernel #sub, #gsub, and #chop
+
+Wed Apr 24 12:54:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/socket/lib/socket.rb: Doc typos by @vipulnsward [Fixes GH-292]
+
+
+Wed Apr 24 12:54:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/socket/lib/socket.rb: Doc typos by @vipulnsward [Fixes GH-292]
+
+Wed Apr 24 12:27:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c: Fix documentation for Array#index and #replace aliases
+ Based on a patch by @phiggins [Fixes GH-282]
+
+Tue Apr 23 21:14:38 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_inspect): refix r40413, on Ruby 1.9 usual character
+ escape uses hex/Unicode escapes, so fix to use Unicode escape on
+ Unicode strings and hex on others. [ruby-core:54458] [Bug #8290]
+
+Tue Apr 23 20:10:02 2013 Tanaka Akira <akr@fsij.org>
+
+ * missing/isnan.c (isnan): Don't define if isnan() macro is defined.
+ This fixes a compilation failure on uClibc based Gentoo system.
+
+Tue Apr 23 17:40:40 2013 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/rexml/document.rb, lib/rexml/element.rb,
+ lib/rexml/formatters/pretty.rb: remove opinionated
+ language in documentation. [Bug #8309],
+ reported by Charles Beckmann
+
+Tue Apr 23 14:04:44 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
+ response correctly. [ruby-core:54365] [Bug #8281]
+
+Tue Apr 23 11:58:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_scrub): fix for UTF-32. strlen() on strings
+ contain NUL returns wrong result, use sizeof operator instead.
+ [ruby-dev:45975] [Feature #6752]
+
+Tue Apr 23 10:26:50 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/ruby/test_module.rb
+ (TestModule#test_const_get_invalid_name)
+ (test_const_defined_invalid_name): Fix expected values.
+
+Tue Apr 23 09:51:26 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * string.c (rb_str_inspect): NUL should not be represented as "\0"
+ when octal digits may follow. [ruby-core:54458] [Bug #8290]
+
+Mon Apr 22 22:54:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+
+ * insns.def (opt_mod): Use % operator if both operands are positive for
+ a significant performance improvement. Thanks to @samsaffron.
+
+Mon Apr 22 17:09:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (r_object0): copy all instance variables not only generic
+ ivars, before calling post proc. [ruby-core:51163] [Bug #7627]
+
+Mon Apr 22 10:25:21 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * util.c (ruby_hdtoa): revert r29729.
+ If you want ruby to behave as before on x86, specify to use SSE like
+ -msse2 -mfpmath=sse for gcc.
+
+Sun Apr 21 23:19:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+
+ * configure.in: Revert using sigsetjmp by default due to performance
+ problems on some systems (eg. older Linux)
+
+Sun Apr 21 21:35:00 2013 Charlie Somerville <charlie@charliesomerville.com>
+
+ * configure.in: Use sigsetjmp by default so jumping out of signal
+ handlers properly restores the signal mask and SS_ONSTACK flag.
+ [ruby-core:54175] [Bug #8254]
+
+ * configure.in: Manually check for presence of sigsetjmp. It is not a
+ function on some systems, so AC_CHECK_FUNCS cannot be used.
+
+Sun Apr 21 08:00:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/csv/test_features.rb, test/logger/test_logger.rb
+ test/mkmf/test_have_macro.rb, test/net/http/test_http.rb,
+ test/openssl/test_config.rb, test/psych/test_encoding.rb,
+ test/psych/test_exception.rb, test/psych/test_psych.rb,
+ test/psych/test_tainted.rb, test/readline/test_readline.rb,
+ test/rexml/test_contrib.rb, test/ruby/test_autoload.rb,
+ test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb,
+ test/ruby/test_file.rb, test/ruby/test_io.rb,
+ test/ruby/test_marshal.rb, test/ruby/test_process.rb,
+ test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb,
+ test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb,
+ test/zlib/test_zlib.rb: Use Tempfile.create.
+
+Sun Apr 21 00:15:36 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/tempfile.rb (Tempfile.create): Close when the block exits.
+
+Sat Apr 20 23:38:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/httpauth/htpasswd.rb: Use Tempfile.create to avoid
+ unintentional unlink() by the finalizer.
+ lib/webrick/httpauth/htdigest.rb: Ditto.
+
+Sat Apr 20 22:47:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/tempfile.rb (Tempfile.create): New method.
+ The method name is proposed by Shugo Maeda. [ruby-dev:47220]
+ [ruby-core:41478] [Feature #5707]
+
+Sat Apr 20 14:22:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_object): dump no ivars to the original by marshal_dump.
+ [ruby-core:54334] [Bug #8276]
+
+ * marshal.c (r_object0): copy all ivars of marshal_dump data to the
+ result object instead. [ruby-core:51163] [Bug #7627]
+
+Sat Apr 20 02:33:27 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (str_scrub): add ruby method String#scrub which verify and
+ fix invalid byte sequence. [ruby-dev:45975] [Feature #6752]
+
+ * string.c (str_compat_and_valid): check given string is compatible
+ and valid with given encoding.
+
+ * transcode.c (str_transcode0): If invalid: :replace is specified for
+ String#encode, replace invalid byte sequence even if the destination
+ encoding equals to the source encoding.
+
+Fri Apr 19 21:55:40 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * README.EXT.ja (Data_Wrap_Struct): Remove a description about
+ orphan argument. Oh, I renamed the argument name without
+ changing description at r36180... Sorry....
+ Patch by Makoto Kishimoto. Thanks!!! [ruby-dev:47269] [Bug #8292]
+ * README.EXT.ja (Data_Make_Struct): Add a sample code that describes
+ how it works.
+ Patch by Makoto Kishimoto. Thanks!!! [ruby-dev:47269] [Bug #8292]
+
+Fri Apr 19 17:54:57 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (body_type_msg): should accept
+ message/delivery-status with extra data.
+ [ruby-core:53741] [Bug #8167]
+
+ * test/net/imap/test_imap_response_parser.rb: related test.
+
+Fri Apr 19 13:03:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_object): do not dump encoding which is dumped with
+ marshal_dump data. [ruby-core:54334] [Bug #8276]
+
+Fri Apr 19 11:36:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (stack_protector): control use of -fstack-protector.
+
+ * configure.in (debugflags): let -fstack-protector precede and disable
+ debugflags, because they can't work together on SmartOS. [Bug #8268]
+
+Fri Apr 19 07:43:52 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/openssl/test_cipher.rb: Correct a typo
+ by jgls <joerg@joergleis.com>
+ https://github.com/ruby/ruby/pull/291 fix GH-291
+
+Thu Apr 18 16:58:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_mod_public_method): fix visibility on anonymous
+ module. set visibility of singleton method, not method in base
+ class. [ruby-core:54404] [Bug #8284]
+
+Thu Apr 18 16:20:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): should skip dot directories only for recursion,
+ but should not if matching to the given pattern. [ruby-core:54387]
+ [Bug #8283]
+
+Thu Apr 18 16:20:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (pack_unpack): increase buffer size to fix buffer overflow,
+ and fix garbage just after unpacking without missing paddings.
+ [Bug #8286]
+
+Thu Apr 18 13:35:54 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * pack.c (pack_unpack): output characters even if the input doesn't
+ have paddings. [Bug #8286]
+
+Thu Apr 18 08:20:48 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (clean-ext): remove timestamps.
+
+Wed Apr 17 22:07:50 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/rubysocket.h (SOCKLEN_MAX): Expression simplified.
+
+Wed Apr 17 20:09:19 2013 Aman Gupta <ruby@tmm1.net>
+
+ * compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object().
+
+ * insns.def (setinlinecache): Ditto.
+
+ * iseq.c (rb_iseq_add_mark_object): New function to allocate
+ iseq->mark_ary on demand. [Bug #8142]
+
+ * iseq.h (rb_iseq_add_mark_object): Ditto.
+
+ * iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed.
+
+ * iseq.c (rb_iseq_build_for_ruby2cext): Ditto.
+
+Wed Apr 17 20:00:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/rubysocket.h (SOCKLEN_MAX): Defined.
+
+ * ext/socket/raddrinfo.c (ext/socket/raddrinfo.c): Reject too long
+ Linux abstract socket name.
+
+Wed Apr 17 19:45:27 2013 Aman Gupta <tmm1@ruby-lang.org>
+
+ * iseq.c (iseq_location_setup): re-use existing string when iseq has
+ the same path and absolute_path. [Bug #8149]
+
+Wed Apr 17 11:38:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
+ UNASSIGNED is not a valid message.
+
+Wed Apr 17 10:58:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (sleep_timeval): get rid of overflow on Windows where
+ timeval.tv_sec is not time_t but mere long.
+
+Tue Apr 16 23:07:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/unixsocket.c (unix_send_io): Suppress a warning by clang.
+ (unix_recv_io): Ditto.
+
+Tue Apr 16 12:27:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/sdbm/init.c: Fix comment indentation, by windwiny [Fixes GH-277]
+
+Tue Apr 16 12:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/socket/option.c: Document synonymous methods, by windwiny [GH-277]
+ * ext/stringio/stringio.c: ditto
+ * ext/io/wait/wait.c: ditto
+ * ext/gdbm/gdbm.c: ditto
+ * ext/dl/cfunc.c: ditto
+ * ext/zlib/zlib.c: ditto
+ * ext/win32ole/win32ole.c: ditto
+ * ext/dbm/dbm.c: ditto
+ * ext/json/generator/generator.c: ditto
+ * ext/date/date_core.c: ditto
+
+Tue Apr 16 11:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/openssl/*: Document synonymous methods, by windwiny [GH-277]
+
+Mon Apr 15 22:21:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/fiddle/depend: New file.
+
+Mon Apr 15 22:01:02 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-insert): Check
+ ruby-electric-is-last-command-char-expandable-punct-p here.
+
+ * misc/ruby-electric.el (ruby-electric-closing-char): New
+ interactive function bound to closing characters. Typing one of
+ those closing characters right after the matching counterpart
+ cancels the effect of automatic closing. For example, typing
+ "{" followed by "}" simply makes "{}" instead of "{ } }".
+
+Mon Apr 15 12:54:42 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * ext/openssl/ossl_ssl.c: Correct shutdown behavior w.r.t GC.
+
+ * test/openssl/test_ssl.rb: Add tests to verify correct behavior.
+
+ [Bug #8240] Patch provided by Shugo Maeda. Thanks!
+
+Mon Apr 15 10:23:39 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/coverage/depend: fix id.h place as r40283.
+
+ * ext/coverage/extconf.rb: add topdir and topsrcdir to VPATH.
+
+Sun Apr 14 19:46:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/debug/depend: New file.
+
+ * ext/-test-/exception/depend: Ditto.
+
+ * ext/-test-/printf/depend: Ditto.
+
+ * ext/-test-/string/depend: Ditto.
+
+ * ext/coverage/depend: Ditto.
+
+ * ext/io/console/depend: Ditto.
+
+ * ext/io/nonblock/depend: Ditto.
+
+ * ext/io/wait/depend: Ditto.
+
+ * ext/openssl/depend: Ditto.
+
+ * ext/pathname/depend: Ditto.
+
+ * ext/psych/depend: Ditto.
+
+ * ext/zlib/depend: Ditto.
+
+Sun Apr 14 02:46:50 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#create_makefile): remove {$(VPATH)} other
+ than nmake.
+
+ * ext/ripper/depend: use VPATH expecting removed by above.
+
+Sat Apr 13 23:06:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (timestamp_file): gather timestamp files in one
+ directory from each extension directories.
+
+Sat Apr 13 21:09:02 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#create_makefile): output new macro
+ disthdrdir to specify the path of id.h, parse.h and etc.
+
+ * ext/ripper/depend: use above macro.
+
+Sat Apr 13 20:28:08 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.
+ [bug] fix problem with optimization of \z (Issue #16) [Bug #8210]
+
+Sat Apr 13 18:56:15 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/ripper/depend: parse.h and id.h may be created on topdir.
+
+Sat Apr 13 12:08:16 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Vector#cross_product, patch by Luis Ezcurdia
+ [fix GH-276] [rubyspec:81eec89a124]
+
+Sat Apr 13 10:20:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (rb_struct_define_without_accessor, rb_struct_define),
+ (rb_struct_s_def): hide member names array.
+
+ * struct.c (anonymous_struct, new_struct, setup_struct): split
+ make_struct() for each purpose.
+
+Sat Apr 13 09:34:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,
+ ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile.
+
+ * ext/-test-/old_thread_select/depend: Update dependencies.
+
+ * ext/-test-/wait_for_single_fd/depend: Ditto.
+
+ * ext/bigdecimal/depend: Ditto.
+
+ * ext/curses/depend: Ditto.
+
+ * ext/digest/bubblebabble/depend: Ditto.
+
+ * ext/digest/depend: Ditto.
+
+ * ext/digest/md5/depend: Ditto.
+
+ * ext/digest/rmd160/depend: Ditto.
+
+ * ext/digest/sha1/depend: Ditto.
+
+ * ext/digest/sha2/depend: Ditto.
+
+ * ext/dl/callback/depend: Ditto.
+
+ * ext/dl/depend: Ditto.
+
+ * ext/etc/depend: Ditto.
+
+ * ext/nkf/depend: Ditto.
+
+ * ext/objspace/depend: Ditto.
+
+ * ext/pty/depend: Ditto.
+
+ * ext/readline/depend: Ditto.
+
+ * ext/ripper/depend: Ditto.
+
+ * ext/sdbm/depend: Ditto.
+
+ * ext/socket/depend: Ditto.
+
+ * ext/stringio/depend: Ditto.
+
+ * ext/strscan/depend: Ditto.
+
+ * ext/syslog/depend: Ditto.
+
+ * ext/-test-/num2int/depend: Removed.
+
+ * ext/dbm/depend: Ditto.
+
+ * ext/fcntl/depend: Ditto.
+
+ * ext/gdbm/depend: Ditto.
+
+ * ext/racc/cparse/depend: Ditto.
+
+Sat Apr 13 00:15:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/etc/etc.c (Init_etc): move Passwd and Group under Etc namespace
+ as primary names.
+
+Fri Apr 12 21:06:55 2013 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: pack.o depends on internal.h.
+
+Fri Apr 12 20:59:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (ones): Use __builtin_popcountl if available.
+
+ * internal.h (GCC_VERSION_SINCE): Macro moved from pack.c.
+
+ * pack.c: Include internal.h for GCC_VERSION_SINCE.
+
+Fri Apr 12 18:29:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: version.o depends on $(srcdir)/include/ruby/version.h
+ instead of {$(VPATH)}version.h to avoid confusion by VPATH between
+ top level version.h and include/ruby/version.h for build in-place.
+ [ruby-dev:47249] [Bug #8256]
+
+Fri Apr 12 15:21:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_callee_setup_keyword_arg): non-symbol key is not
+ a keyword argument, keep it as a positional argument.
+
+Fri Apr 12 11:58:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c: Document synonymous methods, by windwiny [GH-277]
+ * bignum.c: ditto
+ * complex.c: ditto
+ * dir.c: ditto
+ * encoding.c: ditto
+ * enumerator.c: ditto
+ * numeric.c: ditto
+ * proc.c: ditto
+ * re.c: ditto
+ * string.c: ditto
+
+Thu Apr 11 23:41:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: Add dependencies for include/ruby.h
+
+ * tool/update-deps: Use "make -p all miniruby ruby golf" to extract
+ dependencies in makefiles.
+
+Thu Apr 11 23:21:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Use "make -p all golf" to extract dependencies in
+ makefiles.
+
+Thu Apr 11 21:02:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: Dependency updated.
+
+ * tool/update-deps: Rewritten.
+
+Thu Apr 11 19:59:48 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk: partially revert r40183, which breaks building on
+ other than source directory. (its commit log also says the same
+ thing, but such failure is not reproducible on my environment
+ and the commit breaks build on my environment)
+
+Thu Apr 11 16:10:01 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 on
+ Mac OS X and Linux [Bug #3371]
+
+Thu Apr 11 13:19:22 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/drb/drbtest.rb (Drb{Core,Ary}#teardown): retry Process.kill
+ if it fails with Errno::EPERM on Windows (workaround).
+ [ruby-dev:47245] [Bug #8251]
+
+Thu Apr 11 11:11:38 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * dir.c: Fix a typo.
+
+Thu Apr 11 10:39:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): add missing case:
+ RUBY_LIBFFI_MODVERSION is not defined (usually on Windows).
+
+Thu Apr 11 09:27:04 2013 Konstantin Haase <me@rkh.im>
+
+ * dir.c (file_s_fnmatch): Document File::FNM_EXTGLOB flag.
+
+Thu Apr 11 09:17:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * README: Fix typo by Benjamin Winkler [Fixes GH-281]
+
+Thu Apr 11 06:15:51 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regint.h: fix typo: _M_AMD86 -> _M_AMD64.
+
+ * siphash.c: ditto.
+
+ * st.c: ditto.
+
+Thu Apr 11 06:09:57 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/fiddle/extconf.rb: define RUBY_LIBFFI_MODVERSION macro.
+
+ * ext/fiddle/closure.c (USE_FFI_CLOSURE_ALLOC): define 0 or 1
+ with platform and libffi's version. [Bug #3371]
+
+Thu Apr 11 05:30:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/mkmf.rb (pkg_config): Add optional argument "option".
+ If it is given, it returns the result of
+ `pkg-config --<option> <pkgname>`.
+
+Thu Apr 11 03:33:05 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/fiddle/closure.c (initialize): check mprotect's return value.
+ If mprotect is failed because of PaX or something, its function call
+ will cause SEGV.
+ http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130401T210301Z.diff.html.gz
+
+Wed Apr 10 17:39:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable
+ even when overflow.
+
+Wed Apr 10 12:32:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_ll2big): Don't overflow on signed integer negation.
+
+ * ext/bigdecimal/bigdecimal.c (MUL_OVERFLOW_SIGNED_VALUE_P): New
+ macro.
+ (AddExponent): Don't overflow on signed integer multiplication.
+ (VpCtoV): Don't overflow on signed integer arithmetic.
+ (VpCtoV): Don't overflow on signed integer arithmetic.
+
+Wed Apr 10 06:32:12 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (MUL_OVERFLOW_INT_P): New macro.
+
+ * sprintf.c (GETNUM): Don't overflow on signed integer multiplication.
+
+Tue Apr 9 20:38:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (MUL_OVERFLOW_SIGNED_INTEGER_P): New macro.
+ (MUL_OVERFLOW_FIXNUM_P): Ditto.
+ (MUL_OVERFLOW_LONG_P): Ditto.
+
+ * array.c (rb_ary_product): Don't overflow on signed integer
+ multiplication.
+
+ * numeric.c (fix_mul): Ditto.
+ (int_pow): Ditto.
+
+ * rational.c (f_imul): Ditto.
+
+ * insns.def (opt_mult): Ditto.
+
+ * thread.c (sleep_timeval): Don't overflow on signed integer addition.
+
+ * bignum.c (rb_int2big): Don't overflow on signed integer negation.
+ (rb_big2ulong): Ditto.
+ (rb_big2long): Ditto.
+ (rb_big2ull): Ditto.
+ (rb_big2ll): Ditto.
+
+Tue Apr 9 19:45:44 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb: Support multiple fields with same field
+ name (like Set-Cookie).
+ (OpenURI::Meta#metas): New accessor to obtain fields as a Hash from
+ field name (string) to field values (array of strings).
+ [ruby-core:37734] [Bug #4964] reported by ren li.
+
+Tue Apr 9 15:26:12 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): append keyword hash to argument array
+ to splat if needed. [ruby-core:54094] [Bug #8236]
+
+Tue Apr 9 10:02:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (timestamp_file): gather timestamp files in one
+ directory from each extension directories, with considering
+ target_prefix.
+
+Tue Apr 9 04:57:59 JST 2013 Charles Oliver Nutter <headius@headius.com>
+
+ * error.c: Capture EAGAIN, EWOULDBLOCK, EINPROGRESS exceptions and
+ export them for use in WaitReadable/Writable exceptions.
+ * io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that
+ include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail
+ for nonblocking failures using those exceptions. Use that
+ function in io_getpartial and io_write_nonblock instead of
+ rb_mod_sys_fail
+ * ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include
+ WaitReadable and WaitWritable. Use those classes for
+ write_would_block and read_would_block instead of rb_mod_sys_fail.
+ * ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of
+ rb_mod_sys_fail in bsock_sendmsg_internal and
+ bsock_recvmsg_internal.
+ * ext/socket/init.c: Use rb_readwrite_sys_fail instead of
+ rb_mod_sys_fail in rsock_s_recvfrom_nonblock and
+ rsock_s_connect_nonblock.
+ * ext/socket/socket.c: Use rb_readwrite_sys_fail instead of
+ rb_mod_sys_fail in sock_connect_nonblock.
+ * include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead
+ of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and
+ RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail.
+
+Tue Apr 9 02:44:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/extconf.rb: $defs needs -D or -U. nothing is added
+ otherwize.
+
+ * ext/socket/extconf.rb: check struct in_addr6, which is defined in
+ VC6 instead of in6_addr.
+
+ * ext/socket/option.c (optname_to_sym): fix macro name.
+
+ * ext/socket/constants.c (rsock_cmsg_type_arg): fix macro name.
+
+Mon Apr 8 23:57:21 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (id_for_setter): extract common code from const, class
+ variable, instance variable setters.
+
+Mon Apr 8 23:55:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/depend (ENCOBJS, TRANSOBJS): use explicit path to ruby.h for
+ nmake.
+
+ * ext/depend (ENCOBJS, TRANSOBJS): fix header dependency, VPATH has
+ $(srcdir)/include/ruby but not $(srcdir)/include, so cannot find out
+ ruby/ruby.h. use ruby.h instead and ../ruby for include/ruby.h.
+
+Mon Apr 8 20:30:37 2013 Yuki Yugui Sonoda <yugui@google.com>
+
+ * ext/depend (ENCOBJS, TRANSOBJS): Add missing dependencies.
+
+Mon Apr 8 17:19:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32ole/win32ole.c (fole_missing): should check actual argument
+ count before accessing.
+
+Mon Apr 8 16:03:55 2013 Yuki Yugui Sonoda <yugui@google.com>
+
+ Fixes a build failure of ext/ripper/ripper.c on building out of place.
+ * common.mk (id.h, id.c): Always generated in $(srcdir).
+ (ext/ripper/ripper.c): Passes $(PATH_SEPARATOR) too to the sub make.
+
+Mon Apr 8 12:05:02 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * object.c (rb_obj_ivar_set): call to_str for string only once.
+ to_str was called from rb_is_const_name and rb_to_id before.
+
+ * object.c (rb_mod_const_set): ditto.
+
+ * object.c (rb_mod_cvar_set): ditto.
+
+Sun Apr 7 13:56:16 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
+ RUBY_PLATFORM should escape as Regexp,
+ because RUBY_PLATFORM may contain '.'.
+
+Sun Apr 7 10:44:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h: Simplify the logic to include sys/select.h.
+ This fixes a compilation error on Haiku (gcc2 and gcc4).
+
+ * configure.in: Use shared linker as $(CC) for Haiku.
+ This fixes a build error on Haiku (gcc2).
+
+Sun Apr 7 10:41:30 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (MDNSOneShot#sender): Delete an unused variable.
+
+Sun Apr 7 03:24:36 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: use more generic type:
+ * u_char -> unsigned char
+ * u_short -> unsigned short
+ * u_int -> unsigned int
+ * u_long -> unsigned long
+ * quad_t -> int64_t
+ * u_quad_t -> uint64_t
+
+ * addr2line.c (imax): inline is defined by configure.
+
+Sun Apr 7 01:40:39 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-hash): New electric
+ function that expands a hash sign inside a string or regexp to
+ "#{}".
+
+ * misc/ruby-electric.el (ruby-electric-curlies): Do not insert
+ spaces inside when the curly brace is a delimiter of %r, %w,
+ etc.
+
+ * misc/ruby-electric.el (ruby-electric-curlies): Insert another
+ space before a closing curly brace when
+ ruby-electric-newline-before-closing-bracket is nil.
+
+Sun Apr 7 01:01:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * strftime.c (rb_strftime_with_timespec): Test yday range.
+ [ruby-core:44088] [Bug #6247] reported by Ruby Submit.
+
+Sat Apr 6 23:46:54 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in (AC_CHECK_HEADERS): atomic.h for Solaris atomic_ops.
+
+ * ruby_atomic.h: Skip using Solaris10 atomic_ops on Solaris 9 or
+ earlier if atomic.h is not available. [ruby-dev:47229] [Bug #8228]
+
+Sat Apr 6 23:40:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: Support LOC resources.
+ [ruby-core:23361] [Feature #1436] by JB Smith.
+
+Sat Apr 6 23:38:09 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * addr2line.c: quad_t and u_quad_t is not available on Solaris.
+ __inline is not available with old compilers on Solaris.
+ [ruby-dev:47229] [Bug #8227]
+
+Sat Apr 6 23:31:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: Add one-shot multicast DNS support.
+ [ruby-core:53387] [Feature #8089] by Eric Hodel.
+
+Sat Apr 6 22:12:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (Resolv::DNS.fetch_resource): New method to obtain
+ full result.
+ [ruby-dev:43587] [Feature #4788] proposed by Makoto Kishimoto.
+
+Sat Apr 6 20:17:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (rsock_sys_fail_raddrinfo): Renamed from
+ rsock_sys_fail_addrinfo.
+ (rsock_sys_fail_raddrinfo_or_sockaddr): Renamed from
+ rsock_sys_fail_addrinfo_or_sockaddr.
+
+ * ext/socket/rubysocket.h: Follow the above change.
+
+Sat Apr 6 19:24:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (rsock_sys_fail_sockaddr): Takes struct sockaddr
+ and socklen_t instead of String object.
+ (rsock_sys_fail_addrinfo_or_sockaddr): Follow the above change.
+
+ * ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow the above
+ change.
+
+Sat Apr 6 14:28:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/rubysocket.h (SockAddrStringValueWithAddrinfo): New macro.
+ (rsock_sockaddr_string_value_with_addrinfo): New declaration.
+ (rsock_addrinfo_inspect_sockaddr): Ditto.
+ (rsock_sys_fail_addrinfo): Ditto.
+ (rsock_sys_fail_sockaddr_or_addrinfo): Ditto.
+
+ * ext/socket/raddrinfo.c (rsock_addrinfo_inspect_sockaddr): Renamed
+ from addrinfo_inspect_sockaddr and exported.
+ (rsock_sockaddr_string_value_with_addrinfo): New function to obtain
+ string and possibly addrinfo object.
+
+ * ext/socket/socket.c (rsock_sys_fail_sockaddr): Don't use
+ rsock_sys_fail_host_port which is IP dependent. Invoke
+ rsock_sys_fail_addrinfo.
+ (rsock_sys_fail_addrinfo): New function using
+ rsock_addrinfo_inspect_sockaddr.
+ (rsock_sys_fail_addrinfo_or_sockaddr): New function.
+ (sock_connect): Use SockAddrStringValueWithAddrinfo and
+ rsock_sys_fail_addrinfo_or_sockaddr.
+ (sock_connect_nonblock): Ditto.
+ (sock_bind): Ditto.
+
+Sat Apr 6 13:34:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (rsock_sys_fail_sockaddr): Delete 2nd argument.
+
+ * ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow above
+ change.
+
+Sat Apr 6 13:13:39 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (rsock_sys_fail_path): Use rb_str_inspect only
+ for String to avoid SEGV.
+
+Sat Apr 6 12:40:16 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/rubysocket.h (rsock_sys_fail_host_port): Wrap by NORETURN.
+ (rsock_sys_fail_path): Ditto.
+ (rsock_sys_fail_sockaddr): Ditto.
+
+Sat Apr 6 11:49:35 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (rsock_sys_fail_path): Use rb_str_inspect if the
+ path contains a NUL.
+
+Sat Apr 6 11:39:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: Improve socket exception message to show socket address.
+ [ruby-core:45617] [Feature #6583] proposed Eric Hodel.
+
+ * ext/socket/rubysocket.h (rsock_sys_fail_host_port): Declared.
+ (rsock_sys_fail_path): Ditto.
+ (rsock_sys_fail_sockaddr): Ditto.
+
+ * ext/socket/udpsocket.c (udp_connect): Use rsock_sys_fail_host_port.
+ (udp_bind): Ditto.
+ (udp_send): Ditto.
+
+ * ext/socket/init.c (rsock_init_sock): Specify a string for rb_sys_fail
+ argument.
+ (make_fd_nonblock): Ditto.
+ (rsock_s_accept): Ditto.
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): Use
+ rsock_sys_fail_host_port.
+
+ * ext/socket/socket.c (rsock_sys_fail_host_port): Defined.
+ (rsock_sys_fail_path): Ditto.
+ (rsock_sys_fail_sockaddr): Ditto.
+ (setup_domain_and_type): Use rsock_sys_fail_sockaddr.
+ (sock_connect_nonblock): Ditto.
+ (sock_bind): Ditto.
+ (sock_gethostname): Specify a string for rb_sys_fail argument.
+ (socket_s_ip_address_list): Ditto.
+
+ * ext/socket/basicsocket.c (bsock_shutdown): Specify a string for
+ rb_sys_fail argument.
+ (bsock_setsockopt): Use rsock_sys_fail_path.
+ (bsock_getsockopt): Ditto.
+ (bsock_getpeereid): Refine the argument for rb_sys_fail.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): Use
+ rsock_sys_fail_path.
+ (unix_path): Ditto.
+ (unix_send_io): Ditto.
+ (unix_recv_io): Ditto.
+ (unix_addr): Ditto.
+ (unix_peeraddr): Ditto.
+
+Sat Apr 6 11:23:18 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
+ fix load path for encoding to run the test as stand-alone.
+
+Sat Apr 6 09:54:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (NATINT_LEN): fix definition order, must be after
+ NATINT_PACK.
+
+Sat Apr 6 03:11:07 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: fix symbol keys in coder
+ emission. Thanks @tjwallace
+ * test/psych/test_coder.rb: test for change
+
+Sat Apr 6 02:54:08 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/exception.rb: there should be only one exception
+ base class. Fixes tenderlove/psych #125
+ * ext/psych/lib/psych.rb: require the correct exception class
+ * ext/psych/lib/psych/syntax_error.rb: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ditto
+
+Sat Apr 6 02:30:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (new_defined): remove all extra parentheses, and return
+ "nil" for defined? with empty expression.
+ [ruby-core:54024] [Bug #8224]
+
+Sat Apr 6 02:06:04 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: correctly register
+ self-referential strings. Fixes tenderlove/psych #135
+
+ * test/psych/test_string.rb: appropriate test.
+
+Sat Apr 6 01:21:56 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/init.c (cloexec_accept): Fix a compile error on
+ Debian GNU/kFreeBSD. Consider HAVE_ACCEPT4 is defined
+ but SOCK_CLOEXEC is not defined.
+
+Sat Apr 6 00:19:30 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * load.c (features_index_add): use rb_str_subseq() to specify C string
+ position properly to fix require non ascii path.
+ [ruby-core:53733] [Bug #8165]
+
+ * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
+ a test for the above.
+
+Fri Apr 5 20:41:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h (HAVE_TRUE_LONG_LONG): Defined to distinguish
+ availability of long long and availability of 64bit integer type.
+
+ * pack.c: Use HAVE_TRUE_LONG_LONG to distinguish q! and Q! support.
+
+Fri Apr 5 20:19:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * addr2line.c: Include ruby/missing.h to fix compile error on Debian.
+
+Fri Apr 5 19:39:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): fix of defined? with empty
+ expression. [ruby-core:53999] [Bug #8220]
+
+Fri Apr 5 13:22:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/curses/curses.c (Init_curses): fix implementation function,
+ crmode should be same as cbreak. [ruby-core:54013] [Bug #8222]
+
+Fri Apr 5 12:06:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/curses/hello.rb: Typo in Curses example by Drew Blas
+ [Fixes GH-273]
+
+Thu Apr 4 23:45:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (bind_random_port): Rescue EACCES for SunOS.
+ bind() on SunOS for port 2049 (nfs) and 4045 (lockd) causes
+ EACCES with unprivileged process. cf. PRIV_SYS_NFS in privileges(5)
+ [ruby-core:48064] [Bug #7183] reported by Frank Meier.
+
+Thu Apr 4 23:24:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Remove condition for bcc.
+
+Thu Apr 4 22:53:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h (FIX2LONG): Parenthesize the macro body.
+
+Thu Apr 4 22:32:32 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (time_strftime): Describe %L and %N truncates digits under
+ the specified length.
+ [ruby-core:52130] [Bug #7829]
+
+Thu Apr 4 22:08:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * object.c (rb_mod_cvar_set): Reverted "avoid inadvertent
+ symbol creation" to avoid SEGV by
+ Class.new.class_variable_set(1, 2).
+
+Thu Apr 4 20:07:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_write): New method.
+ (path_binwrite): Ditto.
+ [ruby-core:49468] [Feature #7378]
+
+Thu Apr 4 16:51:29 2013 Yuki Yugui Sonoda <yugui@google.com>
+
+ * thread_pthread.c: Fixes wrong scopes of #if USE_SLEEPY_TIMER_THREAD
+ .. #endif sections. This fixes a build error on NativeClient.
+
+Wed Apr 3 17:25:31 2013 Yuki Yugui Sonoda <yugui@google.com>
+
+ * thread_pthread.c (ruby_init_stack): Avoid using uninitialized value.
+ stackaddr and size are not set if get_stack() fails.
+
+Thu Apr 4 16:55:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (make_struct): avoid inadvertent symbol creation.
+ (rb_struct_aref): ditto.
+ (rb_struct_aset): ditto.
+
+Thu Apr 4 16:54:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_mod_const_set): avoid inadvertent symbol creation.
+ (rb_obj_ivar_set): ditto.
+ (rb_mod_cvar_set): ditto.
+
+Thu Apr 4 15:46:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (enum_inject): avoid inadvertent symbol creation.
+
+Thu Apr 4 14:37:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_thread_aref): avoid inadvertent symbol creation.
+ (rb_thread_variable_get): ditto.
+ (rb_thread_key_p): ditto.
+ (rb_thread_variable_p): ditto.
+
+Thu Apr 4 11:33:57 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_to_i): Use bn2hex to speed up.
+ In general, binary to/from decimal needs extra cost.
+
+Thu Apr 4 07:24:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Specify arguments to test functions.
+
+Thu Apr 4 03:25:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): fix can't create from bn.
+
+Wed Apr 3 22:09:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Test functions and libraries after headers.
+
+Wed Apr 3 21:23:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_io_seek_m): Accept :CUR, :END, :SET as "whence" argument.
+ (interpret_seek_whence): New function.
+ [ruby-dev:45818] [Feature #6643]
+
+Wed Apr 3 20:52:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * process.c: Describe the behavior which Ruby invokes a commandline
+ directly without shell if the commandline is simple enough.
+ [ruby-core:50459] [Bug #7489]
+
+Wed Apr 3 20:27:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/extmk.rb (extmake): Invoke Logging::log_close in a ensure
+ clause.
+
+Wed Apr 3 18:53:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/extmk.rb (extmake): Use Logging.open to switch stdout and
+ stderr. Delay Logging::log_close until the failure message is
+ written. Write the failure message only if log file is opened.
+
+ * lib/mkmf.rb (Logging.log_opened?): New method.
+
+ [ruby-dev:47215] [Bug #8209]
+
+Wed Apr 3 17:11:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (constat_apply): pass through unknown sequence which
+ starts with ESC but is not followed by a bracket. [ruby-core:53879]
+ [Bug #8201]
+
+Wed Apr 3 16:35:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (rb_big_eq): hide intermediate Bignums not just freeing
+ memory. [ruby-core:53893] [Bug #8204]
+
+ * object.c (rb_obj_hide): hide an object by clearing klass.
+
+ * bignum.c (rb_big_eq): test as Fixnum if possible and get rid of zero
+ length Bignum. [ruby-core:53893] [Bug #8204]
+
+Tue Apr 2 23:56:03 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb (SecureRandom.random_bytes): Use
+ OpenSSL::Random.random_add instead of OpenSSL::Random.seed and
+ specify 0.0 as the entropy.
+ [ruby-core:47308] [Bug #6928]
+
+Tue Apr 2 20:24:52 2013 Tanaka Akira <akr@fsij.org>
+
+ * pack.c: Support Q! and q! for long long.
+ (natstr): Moved to toplevel. Add q and Q if there is long long type.
+ (endstr): Moved to toplevel.
+ (NATINT_PACK): Consider long long.
+ (NATINT_LEN_Q): New macro.
+ (pack_pack): Support Q! and q!.
+ (pack_unpack): Ditto.
+ [ruby-dev:43970] [Feature #3946]
+
+Tue Apr 2 19:24:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/num2int/num2int.c: Define utility methods
+ as module methods of Num2int.
+
+ * test/-ext-/num2int/test_num2int.rb: Follow the above change.
+
+Tue Apr 2 18:49:01 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb: Don't use Array#to_s.
+ [ruby-core:52058] [Bug #7811] fixed by zzak (Zachary Scott).
+
+Tue Apr 2 17:38:20 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * re.c (rb_reg_to_s): suppress duplicated charclass warning.
+ Regexp#to_s suppress extra its whole regexp options by calling
+ onig_new with its source, but it doesn't call rb_reg_preprocess.
+ Therefore its Unicode escapes (\u{XXXX}) are given as is,
+ and it may cause duplicated charclass warning for example
+ "[\u{33}]" (3 is duplicated) or "[\u{a}\u{b}]" (u is duplicated).
+ [ruby-core:53649] [Bug #8151]
+
+Tue Apr 2 16:00:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_dump.c (rb_print_backtrace): separate to ease showing C backtrace.
+
+ * internal.h (rb_print_backtrace): ditto.
+
+Tue Apr 2 15:22:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/ruby/envutil.rb (assert_separately): stop_auto_run of
+ Test::Unit::Runner to prevent auto runner use ARGV.
+
+ * test/ruby/envutil.rb (assert_separately): add $: to separate process.
+
+ * test/ruby/envutil.rb (assert_separately): fail if stderr is not
+ empty and ignore_stderr is false.
+
+Tue Apr 2 06:46:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/num2int/num2int.c: Rename utility methods
+ to global functions to ease manual experiments.
+
+ * test/-ext-/num2int/test_num2int.rb: Follow the above change.
+
+Mon Apr 1 22:26:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/zlib/zlib.c (rb_gzfile_set_mtime): Use NUM2UINT.
+ The old logic doesn't work well on LP64 platforms as:
+ .. -2**63-1 => error,
+ -2**63 .. -2**62-1 => success,
+ -2**62 .. -2**31-1 => error,
+ -2**31 .. 2**31-1 => success,
+ 2**31 .. 2**62-1 => error,
+ 2**62 .. 2**64-1 => success,
+ 2**64 .. => error.
+
+Mon Apr 1 22:08:02 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * ext/zlib/zlib.c (Zlib::Inflate.new):
+ Fix documentation syntax and naming errors.
+ Based on patch by Robin Dupret. Fix GH-271.
+
+Mon Apr 1 21:22:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/-ext-/num2int/test_num2int.rb: Test small bignums.
+
+Mon Apr 1 21:10:56 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (rb_num2ulong_internal): Don't cast a negative double value
+ into unsigned long, which is undefined behavior.
+ (rb_num2ull): Don't cast a value bigger than LLONG_MAX into
+ long long, which is undefined behavior.
+
+Mon Apr 1 20:57:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/num2int/num2int.c: Return string for result, instead of
+ printing.
+
+ * test/-ext-/num2int/test_num2int.rb: updated to follow above change.
+
+Mon Apr 1 20:08:07 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (rb_num2long): Don't use SIGNED_VALUE uselessly.
+ (check_int): Ditto.
+ (check_short): Ditto.
+ (rb_num2fix): Ditto.
+ (rb_num2ulong_internal): Add a cast.
+
+Mon Apr 1 18:41:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: skip autoconf 2.64 and 2.66, 2.67 seems short-lived
+ but stick on it for Debian Squeeze.
+
+Mon Apr 1 14:22:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: check clang version by predefined macro values.
+ [Bug #8192]
+
+Mon Apr 1 12:05:15 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (check_uint): Take the 1st argument as unsigned long,
+ instead of VALUE. Refine the validity test conditions.
+ (check_ushort): Ditto.
+
+Mon Apr 1 07:15:03 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * configure.in: use quadrigraph to put '[' or ']'. [Bug #8192]
+
+Mon Apr 1 04:16:41 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: kick old clang. [ruby-dev:47204] [Bug #8192]
+
+Mon Apr 1 01:12:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h (FIX2ULONG): Make it consistent with NUM2ULONG.
+
+ * ext/-test-/num2int/num2int.c: Add utility methods for FIX2XXX tests.
+
+ * test/-ext-/num2int/test_num2int.rb: Add tests for FIX2XXX.
+
+Sun Mar 31 17:17:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_mod_define_method): consider visibility in define_method.
+ patch by mashiro <mail AT mashiro.org>. fix GH-268.
+
+Sun Mar 31 15:40:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/configure.bat: try to fix option arguments split by commas and
+ equals here. this batch file no longer run with old command.com.
+
+ * tool/mkconfig.rb: no hacks for cmd.exe.
+
+Sun Mar 31 13:47:04 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (rb_num2ulong_internal): New function similar to
+ rb_num2ulong but integer wrap around flag is also returned.
+ (rb_num2ulong): Use rb_num2ulong_internal.
+ (rb_num2uint): Use rb_num2ulong_internal and the wrap around flag is
+ used instead of negative_int_p(val).
+ (rb_num2ushort): ditto.
+
+Sun Mar 31 06:27:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (HAVE_METACLASS_P): should check FL_SINGLETON flag before get
+ instance variable to get rid of wrong warning about __attached__.
+ [ruby-core:53839] [Bug #8188]
+
+Sat Mar 30 14:11:28 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * bcc32: removed. agreed at
+ http://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130223Japan
+
+Sat Mar 30 03:58:00 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/file.c (code_page): use cp1252 instead of cp20127 as US-ASCII.
+ fix [ruby-core:53079] [Bug #7996]
+ reported and patched by mmeltner (Michael Meltner).
+
+Sat Mar 30 03:49:21 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (wrename): use MoveFileExW instead of MoveFileW,
+ because the latter fails on cross device file move of some
+ environments.
+ fix [ruby-core:53492] [Bug #8109]
+ reported by mitchellh (Mitchell Hashimoto).
+
+Fri Mar 29 22:09:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_mutex_synchronize_m): yield no block params. patch by
+ splattael (Peter Suschlik) in [ruby-core:53773] [Bug #8097].
+ fix GH-266.
+
+Fri Mar 29 16:51:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (argf_next_argv): set init flag if succeeded to forward, after
+ skipping.
+
+ * io.c (argf_block_call_i, argf_block_call): no more forwarding if
+ forwarded after skipping. [ruby-list:49185]
+
+ * io.c (argf_close): deal with init flag.
+
+ * io.c (argf_block_call_i, argf_block_call): forward next file if
+ skipped while iteration, to get rid of IOError. [ruby-list:49185]
+
+Fri Mar 29 11:09:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (configuration): not include all CFLAGS in CXXFLAGS, to
+ use different set than C for C++. [ruby-core:45273] [Bug #6504]
+
+Fri Mar 29 10:24:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/io.h: undef POSIX compliant names on AIX, which are no
+ longer needed. patch suggested by edelsohn (David Edelsohn) in
+ [ruby-core:53815]. [Bug #8174]
+
+Fri Mar 29 06:39:42 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (rb_num2ull): Cast double to unsigned LONG_LONG via
+ LONG_LONG instead of double to unsigned LONG_LONG directly.
+ This is a challenge to fix a test_num2ull(TestNum2int)
+ failure (NUM2ULL(-1.0) should be "18446744073709551615" but was "0")
+ on Mac OS X with 32bit clang.
+ http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-trunk-m32-o0/log/20130328T191100Z.diff.html.gz
+
+Fri Mar 29 00:54:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be
+ preserved. [ruby-core:53745] [Bug #8169]
+
+Thu Mar 28 23:11:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: Test Windows platform by detecting LoadError when
+ require 'win32/resolv' suggested by Nobuyoshi Nakada [ruby-core:53389].
+ [ruby-core:53388] [Feature #8090] Reported by Charles Nutter.
+
+Thu Mar 28 23:10:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/io.h: rename SVR3,4 member names as POSIX compliant,
+ to get rid of conflict on AIX. [ruby-core:53765] [Bug #8174]
+
+Thu Mar 28 18:22:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/-ext-/num2int/test_num2int.rb: extract
+ assert_num2i_success_internal and assert_num2i_error_internal and
+ provide assertion messages as "NUM2XXX(NNN)".
+
+Thu Mar 28 07:05:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h: Delete redundant inclusions caused by
+ AC_INCLUDES_DEFAULT in defines.h.
+
+ * include/ruby/defines.h: Ditto.
+
+ * include/ruby/ruby.h: Ditto.
+
+ * include/ruby/st.h: Ditto.
+
+Thu Mar 28 06:51:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h: Fix a compilation error on NetBSD,
+ "type of formal parameter 1 is incomplete" for the rb_thread_wait_for
+ invocation in rb_file_flock, by including header files as
+ AC_INCLUDES_DEFAULT of autoconf.
+
+Wed Mar 27 22:09:14 2013 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (LONG_MIN_MINUS_ONE_IS_LESS_THAN): New macro.
+ (LLONG_MIN_MINUS_ONE_IS_LESS_THAN): Ditto.
+ (rb_num2long): Use LONG_MIN_MINUS_ONE_IS_LESS_THAN.
+ (rb_num2ulong): Ditto.
+ (rb_num2ll): Use LLONG_MIN_MINUS_ONE_IS_LESS_THAN.
+ (rb_num2ull): Ditto.
+
+ * test/-ext-/num2int/test_num2int.rb (assert_num2i_success): Test the
+ value converted into a Float if Float can represent the value
+ exactly.
+ (assert_num2i_error): Ditto.
+
+Wed Mar 27 20:59:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/-ext-/num2int/test_num2int.rb (assert_num2i_success): New
+ utility method.
+ (assert_num2i_error): Ditto.
+
+Wed Mar 27 20:37:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * time.c (num_exact): Use to_r method only if to_int method is
+ available.
+ [ruby-core:53764] [Bug #8173] Reported by Hiro Asari.
+
+Wed Mar 27 12:07:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/-ext-/num2int/test_num2int.rb (test_num2ll): test LLONG_MIN,
+ not LONG_MIN.
+
+Wed Mar 27 12:02:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (TIMET_MAX_PLUS_ONE): definition simplified.
+
+Wed Mar 27 06:39:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MAIN_DOES_NOTHING): force to refer symbols for tests
+ to be preserved. [ruby-core:53745] [Bug #8169]
+
+Wed Mar 27 05:15:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_REPLACE_TYPE): define SIGNEDNESS_OF_type same as
+ check_signedness of mkmf.rb.
+
+ * internal.h (TIMET_MAX, TIMET_MIN, TIMET_MAX_PLUS_ONE): use
+ SIGNEDNESS_OF_TIME_T.
+
+Wed Mar 27 00:28:45 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (TIMET_MAX_PLUS_ONE): Defined.
+
+ * thread.c (double2timeval): Saturate out-of-range values.
+
+Tue Mar 26 23:41:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: Define TIMET_MAX and TIMET_MIN here.
+
+ * time.c: Remove TIMET_MAX and TIMET_MIN definitions.
+
+ * thread.c: Ditto.
+
+ * thread_pthread.c: Remove TIMET_MAX definition.
+
+ * thread_win32.c: Ditto.
+
+Tue Mar 26 22:31:10 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (sockaddr_len): return the shortest length for
+ unknown socket address.
+
+Tue Mar 26 22:14:46 2013 Tanaka Akira <akr@fsij.org>
+
+ * thread.c (double2timeval): convert the infinity to TIME_MAX to avoid
+ SEGV by Thread.new {}.join(Float::INFINITY) on
+ Debian GNU/Linux (amd64).
+
+Mon Mar 25 07:09:20 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rinda/tuplespace.rb: Only return tuple entry once on move,
+ either through port or regular return, not both. This results in a
+ 120% speedup when combined with #8125. Patch by Joel VanderWerf.
+ [ruby-trunk - Feature #8119]
+
+Mon Mar 25 06:59:01 2013 Eric Hodel <drbrain@segment7.net>
+
+ * test/rinda/test_rinda.rb: Skip IPv6 tests if no IPv6 addresses
+ exist. Skip fork-dependent test if fork is not available.
+ [ruby-trunk - Bug #8159]
+
+Sun Mar 24 10:38:24 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * addr2line.c (putce): suppress unused return value warning.
+
+Mon Mar 25 02:01:03 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * proc.c (bm_free): need to clean up the mark flag of a free and
+ unlinked method entry. [Bug #8100] [ruby-core:53439]
+
+Sun Mar 24 22:13:51 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_rpartition): revert r39903, and convert byte offset
+ to char offset; the return value of rb_reg_search is byte offset,
+ but other than it of rb_str_rpartition expects char offset.
+ [Bug #8138] [ruby-dev:47183]
+
+Sun Mar 24 18:29:46 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * string.c (rb_str_rpartition): Fix String#rpartition(/re/)
+ against a multibyte string. [Bug #8138] [ruby-dev:47183]
+
+Sun Mar 24 13:42:24 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (GC_ENABLE_LAZY_SWEEP): new macro to switch lazy sweeping
+ for debugging. [Feature #8024] [ruby-dev:47135]
+
+Sun Mar 24 12:55:47 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: We have no chance to expand the heap when lazy sweeping is
+ restricted. So collecting is often invoked if there is not
+ enough free space in the heap. Try to expand heap when this is
+ the case.
+
+Sun Mar 24 11:03:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_require.rb: Remove temporally files in the tests.
+
+ * test/ruby/test_rubyoptions.rb: Ditto.
+
+ * test/logger/test_logger.rb: Ditto.
+
+ * test/psych/test_psych.rb: Ditto.
+
+ * test/readline/test_readline.rb: Ditto.
+
+ * test/syslog/test_syslog_logger.rb: Ditto.
+
+ * test/webrick/test_httpauth.rb: Ditto.
+
+ * test/zlib/test_zlib.rb: Ditto.
+
+Sun Mar 24 05:36:29 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rinda/ring.rb: Added documentation for multicast support.
+
+ * NEWS: Point to above documentation.
+
+Sun Mar 24 05:32:39 2013 Eric Hodel <drbrain@segment7.net>
+
+ * test/rinda/test_rinda.rb: Restore tests commented out while fixing
+ test slowdown bug before r39895.
+
+Sun Mar 24 05:03:36 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rinda/ring.rb: Add multicast support to Rinda::RingFinger and
+ Rinda::RingServer. [ruby-trunk - Bug #8073]
+ * test/rinda/test_rinda.rb: Test for the above.
+
+ * NEWS: Update with Rinda multicast support
+
+Sun Mar 24 04:13:27 2013 Eric Hodel <drbrain@segment7.net>
+
+ * test/rinda/test_rinda.rb: Fixed test failures in r39890 and r39891
+ due to stopping DRb service.
+
+Sun Mar 24 03:34:02 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rinda/rinda.rb: Fixed loss of tuple when remote is alive but the
+ call stack was unwound. Patch by Joel VanderWerf.
+ [ruby-trunk - Bug #8125]
+ * test/rinda/test_rinda.rb: Test for the above.
+
+Sun Mar 24 02:14:53 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/mkmf/test_have_macro.rb: remove temporally files in the tests.
+
+Sat Mar 23 23:50:04 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (kprintf): added from FreeBSD libstand's printf.
+ this is consided as async signal safe function.
+
+ * addr2line.c (rb_dump_backtrace_with_lines): use kfprintf.
+ [Bug #8144] [ruby-core:53632]
+
+Sat Mar 23 23:28:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Use Qnil and NIL_P
+ instead of (VALUE)0 as a return value.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_div): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_divremain): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_remainder): ditto.
+
+Sat Mar 23 17:39:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (check_funcall_respond_to): preserve passed_block, which
+ is modified in vm_call0_body() via vm_call0(), and caused a bug of
+ rb_check_funcall() by false negative result of rb_block_given_p().
+ re-fix [ruby-core:53650] [Bug #8153].
+ [ruby-core:53653] [Bug #8154]
+
+Fri Mar 22 17:48:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/forwardable.rb (Forwardable::FILE_REGEXP): create regexp object
+ outside sources for eval, to reduce allocations in def_delegators
+ wrappers. //o option does not make each regexps shared. patch by
+ tmm1 (Aman Gupta) in [ruby-core:53620] [Bug #8143].
+
+Fri Mar 22 17:38:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_feature_p), vm_core.h (rb_vm_struct): turn
+ loaded_features_index into st_table. patches by tmm1 (Aman Gupta)
+ in [ruby-core:53251] and [ruby-core:53274] [Bug #8048]
+
+Fri Mar 22 10:29:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c: Fix style.
+
+Fri Mar 22 05:30:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (ambiguous_operator): refine warning message, since this
+ warning is shown after literal too.
+
+Fri Mar 22 04:51:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_callee_setup_keyword_arg): should check required
+ keyword arguments even if rest hash is defined. [ruby-core:53608]
+ [Bug #8139]
+
+Fri Mar 22 01:00:17 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * process.c (rb_execarg_addopt, run_exec_pgroup): use rb_pid_t
+ instead of pid_t.
+
+ * ext/pty/pty.c (raise_from_check, pty_check): ditto.
+
+Fri Mar 22 00:04:15 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (rb_dump_backtrace_with_lines): output line at once.
+
+Thu Mar 21 23:17:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (ruby_kill): get rid of deadlock on signal 0.
+ [ruby-dev:47182] [Bug #8137]
+
+Thu Mar 21 22:39:46 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * marshal.c (marshal_dump, marshal_load): workaround for segv on
+ Intel Solaris compiled with Oracle SolarisStudio 12.3.
+ Partly revert r38174. [ruby-core:52042] [Bug #7805]
+
+Thu Mar 21 16:48:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (simple_re_meta): escape all closing characters, not only
+ round parenthesis. [ruby-core:53578] [Bug #8133]
+
+Thu Mar 21 13:50:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_core.h (UNINITIALIZED_VAR): suppress warnings by clang 4.2.
+ [ruby-core:51742] [Bug #7756]
+
+Thu Mar 21 07:34:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/date/date_core.c: Typo in Date::MONTHNAMES by Matt Gauger
+ [GH fixes #261]
+
+Wed Mar 20 22:53:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (find_library): fix to format message.
+ [ruby-core:53568] [Bug #8130]
+
+Wed Mar 20 22:52:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (install_dirs, with_destdir): prefix with DESTDIR
+ directories to install only unless bundled extension libraries.
+ [ruby-core:53502] [Bug #8115]
+
+Wed Mar 20 17:47:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup):
+ allow using different root for source and build directories.
+ this may fixes a minor problem of r39834.
+
+Wed Mar 20 16:40:48 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_signal.rb (test_hup_me): skip if HUP isn't supported.
+ On Windows this test causes ArgumentError.
+
+Wed Mar 20 16:24:12 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/rubygems/test_gem_installer.rb (test_install_extension_flat):
+ use ruby in build directory in case ruby is not installed.
+ [ruby-core:53265] [Bug #8058]
+
+Wed Mar 20 15:22:07 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): use
+ relative path to get rid of "too long commandline" error.
+
+Wed Mar 20 04:27:42 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/rinda/test_rinda.rb: remove unused variables.
+ patched by Vipul A M <vipulnsward@gmail.com>
+
+Wed Mar 20 04:15:32 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/bigdecimal/bigdecimal.c: fixed typo.
+ patched by Vipul A M <vipulnsward@gmail.com>
+
+Sat Mar 16 03:40:49 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_signal.rb (test_hup_me): added a few comments.
+
+Sat Mar 16 03:39:38 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (ruby_kill): added a few comments.
+
+Sat Mar 16 03:36:56 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (ruby_kill): release GVL while waiting signal delivered.
+
+Tue Mar 19 19:50:48 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ruby_kill (internal.h, thread.c): use rb_pid_t instead of pid_t.
+ this fixes the build failure of mswin introduced at r39819.
+
+Tue Mar 19 17:09:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_conv_enc_opts): convert with one converter, instead
+ of re-creating converters for each buffer expansion.
+
+Tue Mar 19 17:06:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): compose HFS file names from UTF8-MAC.
+ [ruby-core:48745] [Bug #7267]
+
+Sat Mar 16 01:44:29 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * internal.h: added a declaration of ruby_kill().
+ * thread.c (ruby_kill): helper function of kill().
+
+ * signal.c (rb_f_kill): use ruby_kill() instead of kill().
+ * signal.c (rb_f_kill): call rb_thread_execute_interrupts()
+ to ensure that make SignalException if sent a signal
+ to myself. [Bug #7951] [ruby-core:52864]
+
+ * vm_core.h (typedef struct rb_thread_struct): added
+ th->interrupt_cond.
+ * thread.c (rb_threadptr_interrupt_common): added to
+ initialization of th->interrupt_cond.
+ * thread.c (thread_create_core): ditto.
+
+ * test/ruby/test_signal.rb (TestSignal#test_hup_me): test for
+ the above.
+
+Sat Mar 16 00:42:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (linux_iocparm_len): enable only exist _IOC_SIZE().
+ Because musl libc doesn't have it. [Bug #8051] [ruby-core:53229]
+
+Tue Mar 19 10:05:04 2013 Shota Fukumori <her@sorah.jp>
+
+ * ext/objspace/objspace.c: Fix typo in doc. Patch by Sho Hashimoto.
+ [Bug #8116] [ruby-dev:47177]
+
+Tue Mar 19 02:13:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: set ac_cv_prog_cxx if CXX is supplied.
+
+Tue Mar 19 01:18:00 2013 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: Fix c++ compiler auto-selection not only for
+ Darwin 11.x, but also the other versions of Darwin.
+
+Tue Mar 19 00:26:22 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: Improve accuracy of objspace_live_num() and
+ allocated/freed counters. patched by tmm1(Aman Gupta).
+ [Bug #8092] [ruby-core:53392]
+
+Mon Mar 18 21:42:48 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: Avoid unnecessary heap growth. patched by tmm1(Aman Gupta).
+ [Bug #8093] [ruby-core:53393]
+
+Mon Mar 18 17:58:36 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: Fix unlimited memory growth with large values of
+ RUBY_FREE_MIN. patched by tmm1(Aman Gupta).
+ [Bug #8095] [ruby-core:53405]
+
+Mon Mar 18 14:46:19 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/win32ole/test_err_in_callback.rb
+ (TestErrInCallBack#test_err_in_callback): shouldn't create a file in
+ the top of build directory.
+
+Mon Mar 18 13:29:52 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_dump.c (backtrace): on darwin use custom backtrace() to trace
+ beyond _sigtramp. darwin's backtrace can't trace beyond signal
+ trampoline with sigaltstack.
+
+ * configure.in: check execinfo.h on darwin.
+
+Mon Mar 18 11:03:23 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_exec.h (END_INSN): revert r39517 because the segv seems fixed by
+ r39806.
+
+Mon Mar 18 10:41:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_exec.c: Correct predefined macro name. This typo is introduced by
+ r36534 and should be backported to ruby_2_0_0.
+
+Mon Mar 18 03:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c: Typo in Array#delete by Timo Sand [GH fixes #258]
+
+Mon Mar 18 01:14:56 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_fillbuf): show fd number on failure to debug.
+ http://c5632.rubyci.org/~chkbuild/ruby-trunk/log/20130316T050302Z.diff.html.gz
+
+Sun Mar 17 02:38:21 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/date/date_core.c: include sys/time.h for avoiding implicit
+ declaration of gettimeofday().
+
+Sun Mar 17 00:55:31 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/missing.h: removed __linux__. it's unnecessary.
+
+Fri Mar 15 14:57:16 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug.
+ [Bug #8080] [ruby-core:53349]
+ * test/ruby/test_io.rb (TestIO#test_io_select_with_many_files):
+ test for the above.
+
+Wed Mar 13 15:16:35 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/missing.h (__syscall): moved to...
+ * io.c: here. because __syscall() is only used from io.c.
+
+ * include/ruby/missing.h: move "#include <sys/type.h>" to ....
+ * include/ruby/intern.h: here. because it was introduced for
+ fixing NFDBITS issue. [ruby-core:05179].
+
+Wed Mar 13 14:38:53 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/missing.h (struct timespec): include <sys/time.h>
+
+Wed Mar 13 13:54:45 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: check struct timeval exist or not.
+ * include/ruby/missing.h (struct timeval): check HAVE_STRUCT_TIMEVAL
+ properly. and don't include sys/time.h if struct timeval exist.
+
+ * file.c: include sys/time.h explicitly.
+ * random.c: ditto.
+ * thread_pthread.c: ditto.
+ * time.c: ditto.
+ * ext/date/date_strftime.c: ditto.
+
+Fri Mar 15 14:45:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in (_FORTIFY_SOURCE): added a few comments.
+
+Fri Mar 15 14:17:55 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (numberof): renamed from ARRAY_SIZE() because
+ other all files use numberof().
+
+Say Mar 15 01:33:00 2013 Charles Oliver Nutter <headius@headius.com>
+
+ * test/ruby/test_lazy_enumerator.rb (TestLazyEnumerator#test_drop_while):
+ Modify while condition to show dropping remains off after first false
+ value. This change was made in 39711.
+
+Fri Mar 15 23:06:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * time.c (GetTimeval): check if already initialized instance.
+
+ * time.c (GetNewTimeval): check if newly created instance.
+
+ * time.c (time_init_0, time_init_1, time_init_copy, time_mload): must
+ be newly created instance. [ruby-core:53436] [Bug #8099]
+
+Fri Mar 15 14:51:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_sys_fail_path_with_func): share same function, and path
+ may be nil.
+
+Fri Mar 15 08:24:51 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_sys_fail_path): define & use rb_sys_fail_path0 like r39752
+
+Fri Mar 15 04:08:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * proc.c: Typo in Proc.arity found by Jack Nagel [Bug #8094]
+
+Thu Mar 14 16:59:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_function_name_string): macro for function name
+ string predefined identifier, __func__ in C99, or __FUNCTION__ in
+ gcc.
+
+ * file.c (rb_sys_fail_path): use RUBY_FUNCTION_NAME_STRING.
+
+Thu Mar 14 14:12:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (rb_sys_fail_path): use rb_sys_fail_path0 only on GCC.
+ __func__ is C99 feature.
+
+Thu Mar 14 12:59:59 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (rb_sys_fail_path0): add to append the name of called function
+ to ease debugging for example blow umask_spec failure.
+ http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20130309T010202Z.diff.html.gz
+
+ * file.c (rb_sys_fail_path): use rb_sys_fail_path0.
+
+Thu Mar 14 12:53:15 2013 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (get_user_from_path): add internal function that retrieves
+ username from supplied path (refactored).
+ * win32/file.c (rb_file_expand_path_internal): refactor expansion of user
+ home to use get_user_from_path and cover dir_string corner cases.
+ [ruby-core:53168] [Bug #8034]
+
+Thu Mar 14 11:53:01 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * NEWS: describe RUBY_HEAP_SLOTS_GROWTH_FACTOR.
+
+Thu Mar 14 10:01:12 2013 Eric Hodel <drbrain@segment7.net>
+
+ * doc/globals.rdoc: $? is thread-local
+
+Wed Mar 13 23:25:59 2013 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: allow to tune growth of heap by environment variable
+ RUBY_HEAP_SLOTS_GROWTH_FACTOR. patched by tmm1(Aman Gupta).
+ [Feature #8015] [ruby-core:53131]
+
+Wed Mar 13 19:43:46 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * doc/irb/irb.rd.ja: fix typo
+
+ * ext/tk/MANUAL_tcltklib.eng: fix typos
+
+ * ext/tk/sample/tktextframe.rb (Tk#component_delegates): fix typo
+
+Wed Mar 13 15:13:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_obj_singleton_methods): collect methods from the origin
+ class. [ruby-core:53207] [Bug #8044]
+
+Wed Mar 13 14:51:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_export_method): directly override the flag of method
+ defined in prepending class too, not adding zsuper entry.
+ [ruby-core:53106] [Bug #8005]
+
+Wed Mar 13 13:06:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rm, shvar_to_cpp, unexpand_shvar): local is not
+ available on old shells.
+
+ * configure.in (shvar_to_cpp): escape quotes for old shells.
+ [Bug #7959] [Bug #8071]
+
+Wed Mar 13 11:11:07 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * object.c (Init_Object): remove Module#used, which has been
+ introduced in Ruby 2.0 by mistake. [Bug #7916] [ruby-core:52719]
+
+Wed Mar 13 05:49:29 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/irb.rb: Fix typo
+
+Tue Mar 12 22:20:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_set_arguments, iseq_compile_each): support required
+ keyword arguments. [ruby-core:51454] [Feature #7701]
+
+ * iseq.c (rb_iseq_parameters): ditto.
+
+ * parse.y (f_kw, f_block_kw): ditto. this syntax is still
+ experimental, the notation may change.
+
+ * vm_core.h (rb_iseq_struct): ditto.
+
+ * vm_insnhelper.c (vm_callee_setup_keyword_arg): ditto.
+
+Tue Mar 12 17:02:53 2013 TAKANO Mitsuhiro <tak@no32.tk>
+
+ * date_core.c: clearly specify operator precedence.
+
+Tue Mar 12 17:00:45 2013 TAKANO Mitsuhiro <tak@no32.tk>
+
+ * insns.def: fix condition.
+
+Tue Mar 12 16:48:19 2013 TAKANO Mitsuhiro <tak@no32.tk>
+
+ * rational.c: fix dangling if, else-if and else.
+
+Tue Mar 12 06:27:59 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/setup_command.rb: Don't delete non-rubygems
+ files when installing RubyGems.
+ * test/rubygems/test_gem_commands_setup_command.rb: Test for the
+ above.
+
+ * lib/rubygems/ext/ext_conf_builder.rb: Use full path to siteconf.rb
+ in case the extconf.rb changes directories (like memcached does).
+
+ * lib/rubygems/package.rb: Remove double slash from path.
+ * test/rubygems/test_gem_package.rb: Test for the above.
+ * test/rubygems/test_gem_package_old.rb: ditto.
+
+ * lib/rubygems/source.rb: Revert automatic HTTPS upgrade
+ * lib/rubygems/spec_fetcher.rb: ditto.
+ * test/rubygems/test_gem_remote_fetcher.rb: ditto.
+ * test/rubygems/test_gem_source.rb: ditto.
+ * test/rubygems/test_gem_spec_fetcher.rb: ditto.
+
+Tue Mar 12 02:25:19 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/smtp.rb: Added Net::SMTP#rset method to implement the SMTP
+ RSET command. [ruby-trunk - Feature #5373]
+ * NEWS: ditto.
+ * test/net/smtp/test_smtp.rb: Test for the above.
+
+Mon Mar 11 22:44:57 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv-replace.rb (TCPSocket#initialize): resolve the 3rd
+ argument only if non-nil value is given.
+ [ruby-dev:47150] [ruby-trunk - Bug #8054] reported and analyzed by
+ mrkn.
+
+Mon Mar 11 19:22:54 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/mkmf/base.rb: class name conflict.
+
+Mon Mar 11 18:45:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enumerator.c (enumerator_with_index): try to convert given offset to
+ integer. fix bug introduced in r39594.
+
+Mon Mar 11 17:27:57 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/ruby/envutil.rb (EnvUtil.with_default_external): add for
+ changing Encoding.default_external without warnings.
+
+ * test/ruby/envutil.rb (EnvUtil.with_default_internal): ditto.
+
+ * test/ruby/test_io_m17n.rb: use above with_default_external.
+
+Mon Mar 11 16:57:00 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (extract_binmode): raise error even if binmode and textmode
+ don't conflict. [Bug #5918] [ruby-core:42199]
+
+Mon Mar 11 12:25:12 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Merge Onigmo d4bad41e16e3eccd97ccce6f1f96712e557c4518.
+ fix lookbehind assertion fails with /m mode enabled. [Bug #8023]
+ fix \Z matches where it shouldn't. [Bug #8001]
+
+Mon Mar 11 11:53:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#dir_config, MakeMakefile#_libdir_basename):
+ defer use of instance variable until needed. [Bug #8074]
+
+Thu Mar 7 10:42:28 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/thread.rb (Queue#clear): return self.
+ Patch by Cubing Cube. Thank you! [Bug #7947] [ruby-dev:47098]
+ * lib/thread.rb (Queue#push): ditto.
+ * lib/thread.rb (SizedQueue#push): ditto.
+ * test/thread/test_queue.rb: add tests for the above.
+
+Thu Mar 7 10:40:49 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * tool/change_maker.rb (#diff2index): check Encoding::BINARY.
+ BASERUBY may still be 1.8.x.
+
+Thu Mar 7 08:47:42 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * NEWS (Mutex#owned?): no longer experimental.
+
+Sun Mar 10 23:38:15 2013 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (rb_file_expand_path_internal): Expand home directory when
+ used as second parameter (dir_string). [ruby-core:53168] [Bug #8034]
+ * test/ruby/test_file_exhaustive.rb: add test to verify.
+
+Sun Mar 10 23:27:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
+ it is impossible to predict which file will be installed to where,
+ by the arguments, so use intermediate destination directory always.
+ [Bug #7698]
+
+Sun Mar 10 17:00:22 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: edited rdoc.
+ * rational.c: ditto.
+
+Sun Mar 10 15:02:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (setup_communication_pipe): remove unused function.
+ it was unintentionally added r39683.
+
+Wed Mar 6 00:30:40 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * tool/gen_ruby_tapset.rb: add tapset generator.
+
+Wed Mar 6 03:27:43 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * probes.d (symbol-create): change argument name `string' to
+ `str'. `string' is a keyword for systemtap.
+
+Tue Mar 5 22:23:01 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * probes.d: added argument name
+
+Thu Mar 7 01:17:00 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/thread/test_queue.rb (TestQueue#test_thr_kill): reduce
+ iterations from 2000 to 250. When running on uniprocessor
+ systems, every th.kill needs TIME_QUANTUM_USEC time (i.e.
+ 100msec on posix systems). Because, "r.read 1" is 3 steps
+ operations that 1) release GVL 2) read 3) acquire gvl and
+ (1) invoke context switch to main thread. and then, main
+ thread's th.kill resume (1), but not (2). Thus read interrupt
+ need TIME_QUANTUM_USEC. Then maximum iteration is 30sec/100msec
+ = 300.
+
+Thu Mar 7 00:14:51 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_update_max_fd): use ATOMIC_CAS because this function
+ is used from timer thread too.
+
+Wed Mar 6 23:30:21 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (ARRAY_SIZE): new.
+ * thread_pthread.c (gvl_acquire_common): use low priority
+ notification for avoiding timer thread interval confusion.
+ If we use timer_thread_pipe[1], every gvl_yield() request
+ one more gvl_yield(). It lead to thread starvation.
+ [Bug #7999] [ruby-core:53095]
+ * thread_pthread.c (rb_reserved_fd_p): adds timer_thread_pipe_low
+ to reserved fds.
+
+Wed Mar 6 22:36:19 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (rb_thread_wakeup_timer_thread_fd): add fd
+ argument and remove hardcoded dependency of timer_thread_pipe[1].
+ * thread_pthread.c (consume_communication_pipe): add fd argument.
+ * thread_pthread.c (close_communication_pipe): ditto.
+
+ * thread_pthread.c (timer_thread_sleep): adjust the above changes.
+
+ * thread_pthread.c (setup_communication_pipe_internal): factor
+ out pipe initialize logic.
+
+Wed Mar 6 22:56:14 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (ubf_select): add to small comments why we
+ need to call rb_thread_wakeup_timer_thread().
+
+Wed Mar 6 21:42:24 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (rb_thread_create_timer_thread): factor out
+ creating communication pipe logic into separate function.
+ * thread_pthread.c (setup_communication_pipe): new helper function.
+ * thread_pthread.c (set_nonblock): moves a definition before
+ setup_communication_pipe.
+
+Sun Mar 3 02:42:29 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (consume_communication_pipe): retry when
+ read returned CCP_READ_BUFF_SIZE.
+
+Wed Mar 6 21:31:35 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (timer_thread_sleep): use poll() instead of
+ select(). select doesn't work if timer_thread_pipe[0] is
+ greater than FD_SETSIZE.
+ * thread_pthread.c (USE_SLEEPY_TIMER_THREAD): add a dependency
+ against poll.
+
+Wed Mar 6 21:00:23 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (USE_SLEEPY_TIMER_THREAD): use more accurate
+ ifdef conditions.
+
+Sun Mar 3 02:30:36 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (set_nonblock): new helper function for set
+ O_NONBLOCK.
+ * thread_pthread.c (rb_thread_create_timer_thread): set O_NONBLOCK
+ to timer_thread_pipe[0] too.
+
+Sun Mar 10 09:12:51 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: described syntax of string form.
+ * rational.c: ditto.
+
+Sat Mar 9 11:58:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_extended): check for prepended object.
+ [ruby-core:53206] [Bug #8043]
+
+Sat Mar 9 08:36:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (features_index_add_single, rb_feature_p): store single index
+ as Fixnum to reduce the number of arrays for the indexes. based on
+ the patch by tmm1 (Aman Gupta) in [ruby-core:53216] [Bug #8048].
+
+Sat Mar 9 00:25:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (r_object0): load prepended objects. treat the class of
+ extended object in the included modules as prepended singleton
+ class. [ruby-core:53202] [Bug #8041]
+
+Fri Mar 8 19:44:00 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * man/rake.1, man/ruby.1: Use the Pa macro to make URLs stand out.
+
+Fri Mar 8 13:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/pathname/pathname.c (path_f_pathname): rdoc for Pathname()
+
+Fri Mar 8 12:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * man/rake.1: Document ENVIRONMENT variables on RAKE(1) manpage
+
+Fri Mar 8 10:44:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/webrick/httpproxy.rb: Fix typos in HTTPProxyServer [Bug #8013]
+ Patch by Nobuhiro IMAI [ruby-core:53127]
+
+Fri Mar 8 03:16:15 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * class.c (rb_mod_ancestors): Include singleton_class in ancestors
+ list [Feature #8035]
+
+ * test/ruby/test_module.rb (class): test for above
+
+ * test/ruby/marshaltestlib.rb (module): adapt test
+
+ * NEWS: list change
+
+Thu Mar 7 14:21:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): pass keyword arguments to zsuper,
+ with current values. [ruby-core:53114] [Bug #8008]
+
+Thu Mar 7 12:53:47 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/setup_command.rb: Install .pem files.
+ * test/rubygems/test_gem_commands_setup_command.rb: Test for the
+ above.
+
+ * lib/rubygems/spec_fetcher.rb: Test HTTPS upgrade with URI::HTTPS,
+ not URI::HTTP. Fixes bug in automatic HTTPS upgrade.
+ * test/rubygems/test_gem_spec_fetcher.rb: Test for the above.
+
+ * lib/rubygems.rb: Version 2.0.2
+
+ * lib/rubygems/test_utilities.rb: Ensure scheme and uri class match.
+
+Thu Mar 7 10:39:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (gem): Gem.ensure_gem_subdirectories now has mode
+ option since r39607. refix of r38870.
+
+Wed Mar 6 13:14:28 2013 Eric Hodel <drbrain@segment7.net>
+
+ * test/rubygems/test_gem_spec_fetcher.rb: Removed unused variable.
+
+Wed Mar 6 08:10:15 2013 Eric Hodel <drbrain@segment7.net>
+
+ * test/rubygems/test_require.rb: Fix tests when 'a.rb' exists.
+ [ruby-trunk - Bug #7749]
+
+Wed Mar 6 08:00:59 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Allow specification of directory permissions.
+ [ruby-trunk - Bug #7713]
+ * test/rubygems/test_gem.rb: Test for the above.
+
+Wed Mar 6 07:40:21 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/query_command.rb: Only fetch remote specs when
+ showing details. [ruby-trunk - Bug #8019] RubyGems bug #487
+ * lib/rubygems/remote_fetcher.rb: ditto.
+ * lib/rubygems/security/policy.rb: ditto.
+ * test/rubygems/test_gem_commands_query_command.rb: Test for the
+ above.
+
+ * lib/rubygems/security.rb: Make OpenSSL optional for RubyGems.
+ * lib/rubygems/commands/cert_command.rb: ditto.
+
+ * lib/rubygems/config_file.rb: Display file with YAML error, not
+ ~/.gemrc
+
+ * lib/rubygems/remote_fetcher.rb: Only create gem subdirectories when
+ installing gems.
+ * lib/rubygems/dependency_resolver.rb: ditto.
+ * lib/rubygems/test_utilities.rb: ditto.
+ * test/rubygems/test_gem_commands_fetch_command.rb: Test for the
+ above.
+
+ * lib/rubygems/spec_fetcher.rb: Only try to upgrade
+ http://rubygems.org to HTTPS
+ * test/rubygems/test_gem_spec_fetcher.rb: Test for the above.
+
+ * lib/rubygems.rb: Update win_platform? check for JRuby compatibility.
+
+ * test/rubygems/test_gem_installer.rb: Update for Ruby 1.9.2
+ compatibility
+
+Wed Mar 6 01:19:28 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * enumerator.c (enumerator_with_index, lazy_take): use INT2FIX(0)
+ instead of INT2NUM(0).
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): ditto.
+
+ * ext/fiddle/function.c (function_call): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): ditto.
+
+ * process.c (proc_getsid): ditto.
+
+ * transcode.c (econv_finish): ditto.
+
+Tue Mar 5 21:36:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_prepend_module): check redefinition of built-in optimized
+ methods. [ruby-dev:47124] [Bug #7983]
+
+ * vm.c (rb_vm_check_redefinition_by_prepend): ditto.
+
+Tue Mar 5 20:29:25 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (mnew): revert r39224. [ruby-core:53038] [Bug #7988]
+
+Tue Mar 5 20:23:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_check_arity): make a static inline
+ function so it can be used as an expression and argc would be
+ evaluated only once.
+
+Tue Mar 5 12:30:55 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Bump version to 2.0.1 for upcoming bugfix release
+
+ * lib/rubygems/ext/ext_conf_builder.rb: Restore ruby 1.8 compatibility
+ for [Bug #7698]
+ * test/rubygems/test_gem_installer.rb: Ditto.
+
+ * lib/rubygems/package.rb: Restore ruby 1.8 compatibility.
+
+ * test/rubygems/test_gem_dependency_installer.rb: Fix warnings
+
+Tue Mar 5 12:24:23 2013 Eric Hodel <drbrain@segment7.net>
+
+ * enumerator.c (enumerator_with_index): Restore handling of a nil memo
+ from r39594.
+
+Tue Mar 5 10:40:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/objspace/objspace.c (count_nodes): count also newly added nodes,
+ and fix key for unknown node. patch by tmm1 (Aman Gupta) in
+ [ruby-core:53130] [Bug #8014]
+
+Tue Mar 5 10:20:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (enumerator_with_index_i): allow Bignum as offset, to
+ get rid of conversion exception and integer overflow.
+ [ruby-dev:47131] [Bug #8010]
+
+ * numeric.c (rb_int_succ, rb_int_pred): shortcut optimization for
+ Bignum.
+
+Tue Mar 5 10:02:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
+ clear DESTDIR so RUBYARCHDIR and RUBYLIBDIR are not be overridden.
+ [Bug #7698]
+
+Mon Mar 4 15:33:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
+ fix for unusual cases again. install to a temporary directory once
+ and move installed files to the destination directory, if it is same
+ as the current directory. [Bug #7698]
+
+Mon Mar 4 14:13:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments
+ must appear after object files with newer versions of gcc. patch by
+ tmm1 (Aman Gupta) in [ruby-core:53121] [Bug #8009]
+
+Mon Mar 4 10:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * encoding.c: Typo in Encoding overview by Tom Wardrop [GH fixes #255]
+
+Sun Mar 3 12:35:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#libpath_env): set runtime library path for
+ the case rpath is disabled.
+
+Sun Mar 3 12:17:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rubygems/ext/ext_conf_builder.rb
+ (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
+ circular dependencies in install-so too. [ruby-core:52882]
+ [Bug #7698]
+
+Sun Mar 3 07:33:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/socket/tcpserver.c: Grammar for TCPServer.new from r39554
+
+Sun Mar 3 01:17:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rubygems/ext/ext_conf_builder.rb
+ (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
+ circular dependencies for old style gems which locate extconf.rb on
+ the toplevel. [ruby-core:53059] [ruby-trunk - Bug #7698]
+
+ * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
+ use RUBYOPT instead of -r option, and revert some tests. [Bug #7698]
+
+ * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
+ revert use of temporary directory for build, to work some buggy
+ extconf.rb which cannot build outside the source directory.
+ [ruby-core:53056] [Bug #7698]
+
+Sun Mar 3 00:04:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/depend (CPPFLAGS), lib/mkmf.rb (MakeMakefile#create_makefile):
+ define RUBY_EXPORT for static-linked-ext mswin. [Bug #7960]
+
+Sat Mar 2 22:49:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (ENCOBJS, EXTOBJS, config.h): definitions for
+ static-linked-ext. [Bug #7960]
+
+Sat Mar 2 17:34:19 2013 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/utils.rb: use Socket.tcp_server_sockets to create server
+ sockets.
+ fix [Bug #7100] https://bugs.ruby-lang.org/issues/7100
+ reported by sho-h (Sho Hashimoto).
+
+Sat Mar 2 02:45:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c: typo in comment patch by Nami-Doc [Github fixes #253]
+
+Sat Mar 2 01:33:17 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Merge Onigmo 0fe387da2fee089254f6b04990541c731a26757f
+ v5.13.3 [Bug#7972] [Bug#7974]
+
+Fri Mar 1 11:09:06 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/fileutils.rb: Revert r34669 which altered the way
+ metaprogramming in FileUtils occurred. [ruby-trunk - Bug #7958]
+
+ * test/fileutils/visibility_tests.rb: Refactored tests of FileUtils
+ options modules to expose bug found in #7958
+ * test/fileutils/test_dryrun.rb: ditto.
+ * test/fileutils/test_nowrite.rb: ditto.
+ * test/fileutils/test_verbose.rb: ditto.
+
+Fri Mar 1 09:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/psych.rb: specify in rdoc what object is returned in parser
+ By Adam Stankiewicz [Github tenderlove/psych#133]
+
+Fri Mar 1 07:21:41 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/ext/builder.rb: Fix incompatibilities when installing
+ extensions. Patch by Nobu.
+ [ruby-trunk - Bug #7698] [ruby-trunk - Bug #7971]
+ * lib/rubygems/ext/ext_conf_builder.rb: ditto.
+ * lib/rubygems/installer.rb: ditto.
+ * test/rubygems/test_gem_ext_ext_conf_builder.rb: Test for the above.
+ * test/rubygems/test_gem_installer.rb: ditto.
+
+ * lib/rubygems/commands/sources_command.rb: Prefer HTTPS over HTTP.
+ * lib/rubygems/defaults.rb: ditto
+ * lib/rubygems/dependency_resolver.rb: Ditto.
+ * lib/rubygems/source.rb: ditto.
+ * lib/rubygems/spec_fetcher.rb: ditto.
+ * lib/rubygems/specification.rb: ditto.
+ * lib/rubygems/test_utilities.rb: ditto.
+ * test/rubygems/test_gem.rb: Test for the above.
+ * test/rubygems/test_gem_commands_sources_command.rb: ditto.
+ * test/rubygems/test_gem_dependency_resolver_api_set.rb: ditto.
+ * test/rubygems/test_gem_remote_fetcher.rb: ditto.
+ * test/rubygems/test_gem_source.rb: ditto.
+ * test/rubygems/test_gem_spec_fetcher.rb: ditto.
+
+Fri Mar 1 03:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/psych/lib/psych.rb: rdoc for Psych overview by Adam Stankiewicz
+ [Github tenderlove/psych#134]
+
+Thu Feb 28 22:57:48 2013 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_compile_each): remove redundant trace(line)
+ instruction. for example, at the following script
+ def m()
+ p:xyzzy
+ 1
+ 2
+ end
+ compiler ignores `1' because there is no effect. However,
+ `trace(line)' instruction remains in bytecode.
+ This modification removes such redundant trace(line) instruction.
+
+ * test/ruby/test_iseq.rb: add a test.
+
+Thu Feb 28 22:23:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (inspect_sockaddr): don't show that Unix
+ domain socket filename is bigger than sizeof(sun_path).
+ This limit is not rigid on some platforms such as Darwin and SunOS.
+
+Thu Feb 28 21:33:01 2013 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * configure.in(AC_DISABLE_OPTION_CHECKING): avoid warning "WARNING:
+ Unrecognized options: --with-PACKAGE".
+
+Thu Feb 28 20:22:04 2013 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (iseq_data_to_ary): fix condition.
+ r34303 introduces a bug to avoid all line information from
+ a result of ISeq#to_a. This is a regression problem from 2.0.0p0.
+
+ * test/ruby/test_iseq.rb: add a test of lines after ISeq#to_a.
+
+Thu Feb 28 08:20:33 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/available_set.rb: Undent for style
+
+ * lib/rubygems/dependency_installer.rb: Pick latest prerelease gem to
+ install. Fixes RubyGems bug #468.
+ * test/rubygems/test_gem_dependency_installer.rb: Test for the above.
+
+ * lib/rubygems/dependency_installer.rb: Don't display "Done installing
+ documentation" if documentation will not be installed.
+ * lib/rubygems/rdoc.rb: ditto
+
+ * lib/rubygems/dependency_list.rb: Use Array#concat for Ruby 1.x
+ performance.
+
+ * lib/rubygems/installer.rb: Use formatted program name when comparing
+ executables. RubyGems pull request #471
+ * test/rubygems/test_gem_installer.rb: Test for the above.
+
+ * lib/rubygems/package.rb: Use more explicit feature check to work
+ around JRuby bug #552
+
+ * lib/rubygems/ssl_certs/GeoTrust_Global_CA.pem: Added GeoTrust root
+ certificate.
+
+ * test/rubygems/test_gem_source_list.rb: Use "example" instead of real
+ hostname
+
+Thu Feb 28 05:57:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c: rdoc formatting for Thread, ThreadGroup, and ThreadError
+
+Thu Feb 28 02:42:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm.c: Typo in overview for example of Thread#status returning false
+ Reported by Lee Jarvis
+
+Wed Feb 27 22:54:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/rubysocket.h (union_sockaddr): make it longer for SunOS
+ and Darwin.
+
+Wed Feb 27 21:14:34 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/security.rb (REXML::Security): create.
+ * lib/rexml/rexml.rb: move entity_expansion_limit and
+ entity_expansion_text_limit accessors to ...
+ * lib/rexml/security.rb: ... here.
+ * lib/rexml/document.rb: use REXML::Security.
+ * lib/rexml/text.rb: use REXML::Security.
+ * test/rexml/test_document.rb: use REXML::Security.
+
+Wed Feb 27 19:53:32 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * vm.c (Thread): fix typos in overview
+
+Wed Feb 27 13:21:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm.c (Thread): Typo in overview, swap setting and getting
+
+Wed Feb 27 13:02:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm.c (Thread): Documentation overview of Thread class
+
+Wed Feb 27 12:57:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c (rb_thread_wakeup): rdoc formatting
+
+Wed Feb 27 12:53:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c (rb_thread_group): rdoc formatting
+
+Wed Feb 27 12:33:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/ostruct.rb: Typo in OpenStruct overview [Github Fixes #251]
+ Patch by Chun-wei Kuo
+
+Wed Feb 27 12:13:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_exec.h (END_INSN): llvm-gcc may optimize out reg_cfp and cause
+ Stack/cfp consistency error when the instruction doesn't use reg_cfp.
+ Usually instructions use PUSH() but for example trace doesn't.
+ This hack cause speed down but you shouldn't use llvm-gcc, use clang.
+ [Bug #7938]
+
+Wed Feb 27 10:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c (thread_raise_m): rdoc formatting
+
+Tue Feb 26 23:32:44 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/document.rb: move entity_expansion_limit accessor to ...
+ * lib/rexml/rexml.rb: ... here for consistency.
+ * lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
+ deprecated.
+ * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
+ deprecated.
+
+Tue Feb 26 23:26:13 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...
+ * lib/rexml/rexml.rb: ... here to make rexml/text independent from
+ REXML::Document. It causes circular require.
+ * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
+ deprecated.
+ * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
+ deprecated.
+ * lib/rexml/text.rb: add missing require "rexml/rexml" for
+ REXML.entity_expansion_text_limit.
+ Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]
+
+Tue Feb 26 15:12:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/mkconfig.rb: reconstruct comma separated list values. a
+ command line to Windows batch file is split not only by spaces
+ and equal signs but also by commas and semicolons.
+
+Tue Feb 26 15:04:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (unexpand_shvar): get rid of non-portable shell
+ behavior on OpenBSD, so no extra quotes. [Bug #7959]
+
+Tue Feb 26 10:24:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (IS_LABEL_POSSIBLE): allow labels for keyword arguments just
+ after method definition without a parenthesis. [ruby-core:52820]
+ [Bug #7942]
+
+Tue Feb 26 04:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * error.c: clarify reason for sleep in SignalException example
+
+Tue Feb 26 03:47:00 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * error.c: clarify a document of SignalException. Process.kill()
+ doesn't have any guarantee when signal will be delivered.
+ [Bug #7951] [ruby-core:52864]
+
+Mon Feb 25 23:51:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/version.h: bump RUBY_API_VERSION same as RUBY_VERSION.
+
+Mon Feb 25 21:03:34 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (str_byte_substr): don't set coderange if it's not known.
+ [Bug #7954] [ruby-dev:47108]
+
+Mon Feb 25 16:47:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (realclean-local): miniprelude.c is made by srcs, so it
+ should not removed by distclean but by realclean. [Bug #6807]
+
+Mon Feb 25 16:30:30 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/config_file.rb: Lazily load .gem/credentials to only
+ check permissions when necessary. RubyGems bug #465
+ * test/rubygems/test_gem_config_file.rb: Test for the above.
+
+ * test/rubygems/test_gem_commands_push_command.rb: Remove duplicated
+ test.
+
+Mon Feb 25 15:47:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/depend (ARFLAGS): VisualC++ linker does not allow spaces between
+ output option and the output file name. [Bug #7950]
+
+ * enc/depend (RANLIB): set default command to do nothing, or make the
+ entire line a label on Windows.
+
+Mon Feb 25 14:41:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#init_mkmf): default libdirname to libdir.
+
+ * tool/rbinstall.rb: ditto.
+
+Mon Feb 25 13:12:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (setup): find Setup file from target_os 1. by
+ suffix (e.g. Setup.nacl, Setup.atheos), 2. by "platform"
+ option (e.g. Setup.nt, Setup.emx), and 3. default Setup. And
+ Setup.dj had been removed.
+
+Mon Feb 25 12:48:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c: Document Thread::new, clean up ::fork and mention calling
+ super if subclassing Thread
+
+Mon Feb 25 12:38:50 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: don't test ss_family and ss_len member of
+ struct sockaddr_storage. They are not used now except SunOS
+ specific code.
+
+Mon Feb 25 11:03:38 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in (unexpand_shvar): Use the numeric comparison
+ operator instead of '==' which is a ksh extension. [Bug #7941]
+
+Mon Feb 25 02:37:56 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: define and use union_sockaddr instead of struct
+ sockaddr_storage for less casts.
+
+ * ext/socket/rubysocket.h (union_sockaddr): defined.
+
+ * ext/socket/socket.c (sock_accept): use union_sockaddr.
+ (sock_accept_nonblock): ditto.
+ (sock_sysaccept): ditto.
+ (sock_s_getnameinfo): ditto.
+
+ * ext/socket/basicsocket.c (bsock_getsockname): ditto.
+ (bsock_getpeername): ditto.
+ (bsock_local_address): ditto.
+ (bsock_remote_address): ditto.
+
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): ditto.
+
+ * ext/socket/init.c (recvfrom_arg): ditto.
+ (recvfrom_blocking): ditto.
+ (rsock_s_recvfrom): ditto.
+ (rsock_s_recvfrom_nonblock): ditto.
+ (rsock_getfamily): ditto.
+
+ * ext/socket/raddrinfo.c (rb_addrinfo_t): ditto.
+ (ai_get_afamily): ditto.
+ (inspect_sockaddr): ditto.
+ (addrinfo_mdump): ditto.
+ (addrinfo_mload): ditto.
+ (addrinfo_getnameinfo): ditto.
+ (addrinfo_ip_port): ditto.
+ (extract_in_addr): ditto.
+ (addrinfo_ipv6_to_ipv4): ditto.
+ (addrinfo_unix_path): ditto.
+
+ * ext/socket/tcpserver.c (tcp_accept): ditto.
+ (tcp_accept_nonblock): ditto.
+ (tcp_sysaccept): ditto.
+
+ * ext/socket/ipsocket.c (ip_addr): ditto.
+ (ip_peeraddr): ditto.
+ (ip_s_getaddress): ditto.
+
+Sun Feb 24 21:15:05 2013 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:52303]
+
+Sun Feb 24 15:33:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (rb_random_ulong_limited): limit is inclusive, but generic
+ rand method should return a number less than it, so increase for the
+ difference. [ruby-core:52779] [Bug #7935]
+
+Sun Feb 24 15:32:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (rb_random_ulong_limited): limit is inclusive, but generic
+ rand method should return a number less than it, so increase for the
+ difference. [ruby-core:52779] [Bug #7935]
+
+Sun Feb 24 15:14:43 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Removed duplicate Accept-Encoding in Net::HTTP#get.
+ [ruby-trunk - Bug #7924]
+ * test/net/http/test_http.rb: Test for the above.
+
+Wed Feb 20 14:28:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c: Document ThreadGroup::Default
+
+Wed Feb 20 14:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c: Grammar for #backtrace_locations and ::handle_interrupt
+
+Sun Feb 24 13:35:57 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): block level control frame does not
+ have method entry, so obtain the method entry from method top-level
+ control frame to be compared with refined method entry.
+ [ruby-core:52750] [Bug #7925]
+
+Wed Feb 20 13:23:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c: Document methods receiving string and convert to symbol
+ Patch by Stefan Rusterholz
+ * vm_eval.c: ditto
+ * vm_method.c: ditto
+
+Wed Feb 20 07:20:56 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (sigsegv): suppress unused result warning. Because
+ write(2) is marked __warn_unused_result__ on Linux glibc.
+
+Sun Feb 24 07:50:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_set_arguments): no keyword check if any keyword rest
+ argument exists, even unnamed. [ruby-core:52744] [Bug #7922]
+
+Sat Feb 23 16:51:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c: Documentation for Thread#backtrace_locations
+
+Sat Feb 23 16:05:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm.c: Typo in ObjectSpace::WeakMap overview
+
+Sat Feb 23 16:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c: Improved rdoc for ::handle_interrupt, ::pending_interrupt?
+ and #pending_interrupt?
+
+Sat Feb 23 12:26:43 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el (ruby-electric-curlies)
+ (ruby-electric-matching-char, ruby-electric-bar): Avoid electric
+ insertion when there is a prefix argument.
+
+ * misc/ruby-electric.el (ruby-electric-insert)
+ (ruby-electric-cua-replace-region-p)
+ (ruby-electric-cua-replace-region): Avoid electric insertion and
+ fall back when cua-mode is enabled and a region is active.
+
+Sat Feb 23 12:35:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c: Document #<=> return values and formatting
+ * bignum.c: ditto
+ * file.c: ditto
+ * object.c: ditto
+ * numeric.c: ditto
+ * rational.c: ditto
+ * string.c: ditto
+ * time.c: ditto
+
+Sat Feb 23 10:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * array.c (rb_ary_diff, rb_ary_and, rb_ary_or): Document return order
+ [RubySpec #7803]
+
+Sat Feb 23 10:17:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c (rb_obj_comp): Documenting Object#<=> return values
+ Patch by Stefan Rusterholz
+
+Sat Feb 23 09:48:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (file_s_fnmatch, fnmatch_brace): encoding-incompatible pattern
+ and string do not match, instead of exception. [ruby-dev:47069]
+ [Bug #7911]
+
+Sat Feb 23 08:57:46 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * doc/NEWS-*: Update NEWS from their respective branches
+
+Sat Feb 23 08:14:43 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * NEWS: many additions for Ruby 2.0.0
+
+ * object.c: Add doc for Module.prepended
+
+Sat Feb 23 07:52:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/ruby.pc.in: reorder library flags which may refer library
+ names. [Bug #7913]
+
+Fri Feb 22 23:46:20 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
+ fix a typo in comment in r39384.
+
+Fri Feb 22 18:31:46 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
+ new attribute to read/write entity expansion text limit. the default
+ limit is 10Kb.
+
+ * lib/rexml/text.rb (REXML::Text.unnormalize): check above attribute.
+
+Fri Feb 22 17:36:23 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/test_rbconfig.rb (TestRbConfig): fix r39372.
+ It must see RbConfig::CONFIG instead of CONFIG.
+
+Fri Feb 22 14:55:41 2013 Naohisa Goto <ngotogenome@gmail.com>
+
+ * signal.c (ruby_abort): fix typo in r39354 [Bug #5014]
+
+Fri Feb 22 12:46:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (rb_random_ulong_limited): fix error message for negative
+ value. [ruby-dev:47061] [Bug #7903]
+
+Fri Feb 22 11:36:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/test_rbconfig.rb (TestRbConfig): skip user defined values by
+ configuration options. [Bug #7902]
+
+Fri Feb 22 11:33:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#init_mkmf): adjust default library path
+ for multiarch. [Bug #7874]
+
+Fri Feb 22 11:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * enum.c (Enumerable#chunk: Improved examples, grammar, and formatting
+ Patch by Dan Bernier and Rich Bruchal of newhaven.rb
+ [Github documenting-ruby/ruby#8]
+
+Fri Feb 22 11:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * numeric.c: Examples and formatting for Numeric and Float
+ Based on a patch by Zach Morek and Oren K of newhaven.rb
+ [Github documenting-ruby/ruby#5]
+
+Fri Feb 22 07:04:41 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/installer.rb (build_extensions): Create extension
+ install destination before building extension. Patch by Kenta Murata.
+ [ruby-trunk - Bug #7897]
+ * test/rubygems/test_gem_installer.rb: Test for the above.
+
+Fri Feb 22 06:30:57 2013 Eric Hodel <drbrain@segment7.net>
+
+ * doc/globals.rdoc: Document what setting $DEBUG does.
+
+ * doc/globals.rdoc: Added pointer to $-d for full documentation.
+
+Fri Feb 22 06:27:07 2013 Eric Hodel <drbrain@segment7.net>
+
+ * doc/globals.rdoc: Document what setting $VERBOSE does. [Bug #7899]
+
+ * doc/globals.rdoc: Added pointer to $-w and $-v for full
+ documentation.
+
+Fri Feb 22 02:33:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/abbrev.rb: Add words parameter to Abbrev::abbrev
+ Patch by Devin Weaver [Github documenting-ruby/ruby#7]
+
+Thu Feb 21 17:28:14 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/merger.rb: add interaction when only ChangeLog is modified.
+
+Thu Feb 21 16:34:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (check_stack_overflow): extract duplicated code and get rid
+ of declaration-after-statement. [Bug #5014]
+
+Thu Feb 21 14:14:13 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (sigsegv): avoid to use async signal unsafe functions
+ when nested sigsegv is happen.
+ [Bug #5014] [ruby-dev:44082]
+
+Thu Feb 21 13:47:59 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (rb_group_member): added an error check. SUS says,
+ getgroups(small_value) may return EINVAL.
+
+Thu Feb 21 13:37:07 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (RB_MAX_GROUPS): moved to
+ * internal.h (RB_MAX_GROUPS): here.
+
+ * file.c (rb_group_member): use RB_MAX_GROUPS instead of
+ RUBY_GROUP_MAX. They are the same.
+
+Thu Feb 21 13:15:40 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (access_internal): removed.
+ * file.c (rb_file_readable_real): use access() instead of
+ access_internal().
+ * file.c (rb_file_writable_real): ditto.
+ * file.c (rb_file_executable_real): ditto.
+
+Thu Feb 21 13:04:59 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (eaccess): use access() when not using setuid nor setgid.
+ This is minor optimization.
+
+Thu Feb 21 12:56:19 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (rb_group_member): get rid of NGROUPS dependency.
+ [Bug #7886] [ruby-core:52537]
+
+Thu Feb 21 12:45:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (ruby_init_loadpath_safe): try two levels upper for stripping
+ libdir name. [Bug #7874]
+
+ * configure.in (libdir_basename): expand with multiarch in configure,
+ not to defer the expansion till ruby.pc.in and mkmf.rb. [Bug #7874]
+
+ * configure.in (libdir_basename): also -rpath and -install_name flags
+ are affected when libruby directory changes. [Bug #7874]
+
+Wed Feb 20 19:27:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (HAVE_RB_SCAN_ARGS_OPTIONAL_HASH): for
+ rb_scan_args() optional hash feature. [Bug #7861]
+
+Wed Feb 20 18:02:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (target_os): do not strip -gnu suffix on Linux if
+ --target is given explicitly. [Bug #7874]
+
+ * configure.in (libdirname): adjust library path name which libruby
+ files will be installed. [Bug #7874]
+
+ * tool/rbinstall.rb (libdir): ditto.
+
+Wed Feb 20 13:37:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/pty/pty.c: Documentation for the PTY module
+
+Wed Feb 20 12:18:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c: Document Data class [Bug #7890] [ruby-core:52549]
+ Patch by Matthew Mongeau
+
+Wed Feb 20 11:50:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/mutex_m.rb: Add rdoc for Mutex_m module
+
+Wed Feb 20 09:34:43 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/update_command.rb: Create the installer after
+ options are processed. [ruby-trunk - Bug #7779]
+ * test/rubygems/test_gem_commands_update_command.rb: Test for the
+ above.
+
+Wed Feb 20 07:51:19 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/installer.rb: Use gsub instead of gsub! to avoid
+ altering @bin_dir. Fixes tests on windows. [ruby-trunk - Bug #7885]
+
+Tue Feb 19 20:50:00 2013 Kenta MURATA <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.gemspec: bump to 1.2.0.
+ [ruby-core:51777] [Bug #7761]
+
+Tue Feb 19 13:07:25 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/syslog/syslog.c (Init_syslog): Define inspect as a singleton
+ method and remove it as an instance method. [Bug #6502]
+
+Tue Feb 19 12:30:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c: rdoc formatting for Kernel#Array()
+ * array.c: Add rdoc for Array() method to Creating Arrays section
+
+Tue Feb 19 10:35:52 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl.c (class OpenSSL): Use only inner parenthesis in
+ create_extension examples.
+
+Tue Feb 19 10:27:12 2013 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl.c (class OpenSSL): Fixed ExtensionFactory example.
+ Patch by Richard Bradley. [ruby-trunk - Bug #7551]
+
+Tue Feb 19 08:32:11 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_eval.c (vm_call0_body): check interrupts after method dispatch
+ from C methods. [Bug #7878]
+
+Tue Feb 19 08:14:40 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/installer.rb: Fixed placement of executables with
+ --user-install. [ruby-trunk - Bug #7779]
+ * test/rubygems/test_gem_installer.rb: Test for above.
+
+Tue Feb 19 06:04:06 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_dump: FreeBSD ports' libexecinfo's backtrace(3) can't trace
+ beyond signal trampoline, and as described in r38342 it can't
+ trace on -O because it see stack frame pointers.
+ libunwind unw_backtrace see dwarf information in the binary
+ and it works with -O (without frame pointers).
+
+ * configure.in: remove r38342's hack and check libunwind.
+
+Tue Feb 19 04:26:29 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: check whether backtrace(3) works well or not.
+
+ * vm_dump.c: set HAVE_BACKTRACE 0 if BROKEN_BACKTRACE.
+
+Mon Feb 18 16:30:18 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/ipaddr.rb (IPAddr#in6_addr): Fix a typo with the closing
+ parenthesis.
+
+Mon Feb 18 12:32:24 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/ipaddr.rb (IPAddr#in6_addr): Fix the parser so that it can
+ recognize IPv6 addresses with only one edge 16-bit piece
+ compressed, like [::2:3:4:5:6:7:8] or [1:2:3:4:5:6:7::].
+ [Bug #7477]
+
+Mon Feb 18 10:09:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (unexpand_shvar): regularize a shell variable by
+ unexpanding shell variables in it.
+
+Sun Feb 17 20:55:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compar.c (rb_invcmp): compare by inversed comparison, with preventing
+ from infinite recursion. [ruby-core:52305] [Bug #7870]
+
+ * string.c (rb_str_cmp_m), time.c (time_cmp): get rid of infinite
+ recursion.
+
+Sun Feb 17 17:23:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb: remove extra topdir in VPATH, which was in
+ win32/Makefile.sub for some reason and moved from there.
+ [ruby-dev:46998] [Bug #7864]
+
+Sun Feb 17 01:19:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/psych/lib/psych/y.rb: Document Kernel#y by Adam Stankiewicz
+ [Github tenderlove/psych#127]
+
+Sun Feb 17 00:52:14 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/mkconfig.rb: remove prefix from rubyarchdir.
+ r39267 expands variables, it changes expansion timing,
+ breaks RbConfig::CONFIG["includedir"] and building
+ extension libraries with installed ruby.
+
+Sat Feb 16 20:51:17 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (ENV_IN_HEAP_P): fix off-by-one error.
+
+Sat Feb 16 20:47:16 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in (LIBRUBY_DLDFLAGS): Fix a bug where --with-opt-dir
+ options given were not reflected to LIBRUBY_DLDFLAGS on many
+ platforms including Linux and other GNU-based systems, NetBSD,
+ AIX and BeOS.
+
+Sat Feb 16 20:43:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (rsock_recvmsg): ignore truncated part of
+ socket address returned from recvmsg().
+
+ * ext/socket/init.c (recvfrom_blocking): ignore truncated part of
+ socket address returned from recvfrom().
+ (rsock_s_recvfrom_nonblock): ditto.
+
+Sat Feb 16 20:05:26 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/ruby/test_thread.rb: fixed typo
+ patched by Hiroki Matsue via https://github.com/ruby/ruby/pull/248
+
+Sat Feb 16 16:08:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (rb_thread_mark): mark a working Proc of bmethod
+ (a method defined by define_method) even if the method was removed.
+ We could not trace working Proc object which represents the body
+ of bmethod if the method was removed (alias/undef/overridden).
+ Simply, it was mark miss.
+ This patch by Kazuki Tsujimoto. [Bug #7825]
+
+ NOTE: We can brush up this marking because we do not need to mark
+ `me' on each living control frame. We need to mark `me's
+ only if `me' was free'ed. This is future work after Ruby 2.0.0.
+
+ * test/ruby/test_method.rb: add a test.
+
+Sat Feb 16 15:45:56 2013 Koichi Sasada <ko1@atdot.net>
+
+ * proc.c (rb_binding_new_with_cfp): create binding object even if
+ the frame is IFUNC. But return a ruby-level binding to keep
+ compatibility.
+ This patch fix degradation introduced from r39067.
+ [Bug #7774] [ruby-dev:46960]
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
+Sat Feb 16 13:40:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (shvar_to_cpp): do not substitute exec_prefix itself
+ with RUBY_EXEC_PREFIX, which cause recursive definition.
+ [ruby-core:52296] [Bug #7860]
+
+Sat Feb 16 13:13:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/io-console.gemspec: bump to 0.4.2. now explicitly
+ requires ruby 1.9.3 or later. [Bug #7847]
+
+ * ext/io/console/console.c (console_dev): compatibility with ruby 1.8.
+
+ * ext/io/console/console.c (rawmode_opt, console_dev): compatibility
+ with ruby 1.9. [ruby-core:52220] [Bug #7847]
+
+Sat Feb 16 12:45:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: unexpand arch sitearch and exec_prefix values, so
+ directly specified bindir, libdir, rubyprefix, etc can be properly
+ substituted. [ruby-core:52296] [Bug #7860]
+
+Sat Feb 16 12:15:20 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * parse.y: add dtrace probe for symbol create.
+
+ * probes.d: ditto
+
+Sat Feb 16 09:27:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: don't test sys/feature_tests.h which is not
+ used now.
+ It was included in r7901 as "bug of gcc 3.0 on Solaris 8 ?".
+
+Sat Feb 16 09:24:37 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: reorder header tests to consider inclusion
+ order in rubysocket.h.
+
+Sat Feb 16 08:42:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in, ext/socket/extconf.rb: test netinet/in_systm.h in
+ ext/socket/extconf.rb instead of configure.in.
+
+ Originally, netinet/in_systm.h is included for NextStep, OpenStep,
+ and Rhapsody. [ruby-core:1596]
+
+Sat Feb 16 07:55:40 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: don't test xti.h here.
+
+ * ext/socket/extconf.rb: test xti.h here.
+
+ Originally, xti.h is included for IRIX [ruby-core:14447].
+
+Sat Feb 16 07:16:49 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: test struct sockaddr_un and its member,
+ sun_len.
+
+ * ext/socket/sockport.h (INIT_SOCKADDR_UN): new macro defined.
+
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): use INIT_SOCKADDR_UN.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
+
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): ditto.
+ (addrinfo_mload): ditto.
+
+Sat Feb 16 07:05:59 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/sockport.h (INIT_SOCKADDR_IN): don't need family
+ argument. it is always AF_INET.
+
+ * ext/socket/raddrinfo.c (make_inetaddr): follow INIT_SOCKADDR_IN
+ change.
+ (addrinfo_ipv6_to_ipv4): ditto.
+
+Sat Feb 16 04:21:07 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/extconf.rb: workaround for mswin/mingw build problem.
+ sendmsg emulation in win32/win32.c is not enough.
+
+Sat Feb 16 00:19:20 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: use all all tested available headers for
+ have_func.
+
+Fri Feb 15 22:21:37 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in: Fix a bug introduced in r38342 that the cflagspat
+ substitution is messed up by the way CFLAGS and optflags are
+ modified, which affected FreeBSD and NetBSD/amd64 when
+ configured to use libexecinfo. This bug resulted in CFLAGS and
+ CXXFLAGS in RbConfig::CONFIG having warnflags expanded in them,
+ forcing third-party C/C++ extensions to follow what warnflags
+ demands, like ANSI/ISO-C90 conformance. ref [Bug #7101]
+
+Fri Feb 15 20:29:11 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/sockport.h (SET_SIN_LEN): defined for strict-aliasing
+ rule.
+ (INIT_SOCKADDR_IN): ditto.
+
+ * ext/socket/raddrinfo.c (make_inetaddr): use INIT_SOCKADDR_IN.
+ (addrinfo_ipv6_to_ipv4): ditto.
+
+Fri Feb 15 18:24:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#try_run): bail out explicitly if cross
+ compiling, because it cannot work of course.
+
+Fri Feb 15 12:34:58 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: test struct sockaddr_storage directly.
+
+ * ext/socket/rubysocket.h: use HAVE_TYPE_STRUCT_SOCKADDR_STORAGE.
+
+Fri Feb 15 12:26:13 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/getaddrinfo.c (GET_AI): don't cast 1st argument for
+ INIT_SOCKADDR.
+
+Fri Feb 15 08:12:11 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/sockport.h (SET_SS_LEN): removed.
+ (SET_SIN_LEN): removed.
+ (INIT_SOCKADDR): new macro.
+
+ * ext/socket/ancdata.c (extract_ipv6_pktinfo): use INIT_SOCKADDR.
+
+ * ext/socket/raddrinfo.c (make_inetaddr): use INIT_SOCKADDR.
+ (addrinfo_ipv6_to_ipv4): ditto.
+
+ * ext/socket/getaddrinfo.c (GET_AI): use INIT_SOCKADDR.
+
+Fri Feb 15 07:49:27 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc.rb: Update to release version of 4.0.0
+
+ * lib/rubygems.rb: Update to release version of 2.0.0
+
+Fri Feb 15 07:07:27 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/sockport.h (SA_LEN): removed because unused now.
+ (SS_LEN): ditto.
+ (SIN_LEN): ditto.
+
+Thu Feb 14 10:45:31 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_process.rb (test_setsid): Added a workaround for
+ MacOS X. Patch by nagachika. [Bug #7826] [ruby-core:52126]
+
+Fri Feb 15 00:15:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/sockport.h (VALIDATE_SOCKLEN): new macro to validate
+ sa_len member of 4.4BSD socket address.
+
+ * ext/socket/getnameinfo.c (getnameinfo): use VALIDATE_SOCKLEN,
+ instead of SA_LEN.
+
+ * ext/socket/socket.c (sock_s_getnameinfo): use VALIDATE_SOCKLEN
+ instead of SS_LEN.
+
+Thu Feb 14 22:25:54 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (sockaddr_len): extracted from sockaddr_obj.
+ (sockaddr_obj): add an argument to length of socket address.
+ (socket_s_ip_address_list): call sockaddr_obj with actual socket
+ address length if given, use sockaddr_len otherwise.
+
+Thu Feb 14 20:11:23 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: always operate length of socket address companion with
+ socket address.
+
+ * ext/socket/rubysocket.h (rsock_make_ipaddr): add an argument for
+ socket address length.
+ (rsock_ipaddr): ditto.
+
+ * ext/socket/ipsocket.c (ip_addr): pass length to rsock_ipaddr.
+ (ip_peeraddr): ditto.
+ (ip_s_getaddress): pass length to rsock_make_ipaddr.
+
+ * ext/socket/socket.c (make_addrinfo): pass length to rsock_ipaddr.
+ (sock_s_getnameinfo): pass actual address length to rb_getnameinfo.
+ (sock_s_unpack_sockaddr_in): pass length to rsock_make_ipaddr.
+
+ * ext/socket/init.c (rsock_s_recvfrom): pass length to rsock_ipaddr.
+ (rsock_s_recvfrom_nonblock): ditto.
+
+ * ext/socket/tcpsocket.c (tcp_sockaddr): pass length to
+ rsock_make_ipaddr.
+
+ * ext/socket/raddrinfo.c (make_ipaddr0): add an argument for socket
+ address length. pass the length to rb_getnameinfo.
+ (rsock_ipaddr): ditto.
+ (rsock_make_ipaddr): add an argument for socket address length.
+ pass the length to make_ipaddr0.
+ (make_inetaddr): pass length to make_ipaddr0.
+ a local variable renamed.
+ (host_str): a local variable renamed.
+ (port_str): ditto.
+
+Thu Feb 14 14:31:43 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Removed OpenSSL dependency from Net::HTTP.
+
+ * test/net/http/test_http.rb: Remove Zlib dependency from tests.
+ * test/net/http/test_http_request.rb: ditto.
+
+Thu Feb 14 11:08:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (include_modules_at): detect cyclic prepend with original
+ method table. [ruby-core:52205] [Bug #7841]
+
+Thu Feb 14 10:30:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c: call method_removed hook on called class, not on
+ prepending iclass. [ruby-core:52207] [Bug #7843]
+
+Thu Feb 14 10:05:57 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http: Do not handle Content-Encoding when the user sets
+ Accept-Encoding. This allows users to handle Content-Encoding for
+ themselves. This restores backwards-compatibility with Ruby 1.x.
+ [ruby-trunk - Bug #7831]
+ * lib/net/http/generic_request.rb: ditto.
+ * lib/net/http/response.rb: ditto
+ * test/net/http/test_http.rb: Test for the above.
+ * test/net/http/test_http_request.rb: ditto.
+ * test/net/http/test_httpresponse.rb: ditto.
+
+Thu Feb 14 08:18:47 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: don't define HAVE_SA_LEN and HAVE_SA_LEN.
+ use HAVE_STRUCT_SOCKADDR_SA_LEN and HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ instead.
+
+Wed Feb 13 20:59:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: don't define socklen_t here, just test.
+
+ * ext/socket/rubysocket.h: define socklen_t if not available.
+
+Wed Feb 13 18:37:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (mnew): skip prepending modules and return the method bound
+ on the given class. [ruby-core:52160] [Bug #7836]
+
+Wed Feb 13 18:11:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (method_original_name): new methods Method#original_name and
+ UnboundMethod#original_name. [ruby-core:52048] [Bug #7806]
+ [EXPERIMENTAL]
+
+ * proc.c (method_inspect): show the given name primarily, and
+ original_id if aliased. [ruby-core:52048] [Bug #7806]
+
+Wed Feb 13 17:56:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (warnflags): disable -Werror by default unless
+ development. [ruby-core:52131] [Bug #7830]
+
+Wed Feb 13 06:05:52 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Return BINARY strings from Gem.gzip and Gem.gunzip.
+ Fixes intermittent test failures. RubyGems issue #450 by Jeremey
+ Kemper.
+ * test/rubygems/test_gem.rb: Test for the above.
+
+Wed Feb 13 05:49:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: test functions just after struct members.
+
+Tue Feb 12 12:02:35 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: merge JSON 1.7.7.
+ This includes security fix. [CVE-2013-0269]
+ https://github.com/flori/json/commit/d0a62f3ced7560daba2ad546d83f0479a5ae2cf2
+ https://groups.google.com/d/topic/rubyonrails-security/4_YvCpLzL58/discussion
+
+Mon Feb 11 23:08:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: enable rb_cv_page_size_log test for MirOS BSD.
+
+Mon Feb 11 20:06:38 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: use -pthread on mirbsd*.
+
+Mon Feb 11 16:07:09 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: add SOLIBS and LIBRUBY_SO definition for mirbsd*.
+
+Mon Feb 11 13:17:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rubysitearchprefix): sitearchdir and vendorarchdir
+ should use sitearch, not arch. [ruby-dev:46964] [Bug #7823]
+
+ * win32/Makefile.sub (config.status): site and vendor directories
+ should use sitearch, not arch. [ruby-dev:46964] [Bug #7823]
+
+Mon Feb 11 12:31:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: move OS specific header/function knowledge before
+ automatic header tests.
+
+Mon Feb 11 11:04:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: move the test for -march=i486 just after
+ RUBY_UNIVERSAL_ARCH/RUBY_DEFAULT_ARCH.
+
+Sun Feb 10 23:42:26 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: test structure members just after types test.
+
+Sun Feb 10 20:58:17 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: test types just after headers test.
+
+Sun Feb 10 16:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/rake/doc/MIT-LICENSE: Add license file from upstream
+ * lib/rake/doc/README.rdoc: Link to license file from Rake README
+ * lib/rake/version.rb: Include README rdoc for Rake module overview
+
+Sun Feb 10 15:26:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/rake/doc/*: Sync Rake rdoc files from upstream
+
+Sun Feb 10 15:50:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_exec.h (DISPATCH_ARCH_DEPEND_WAY): use __asm__ __volatile__
+ instead of asm volatile.
+
+Sun Feb 10 15:50:02 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * gc.h (SET_MACHINE_STACK_END): use __volatile__ instead of volatile.
+
+Sun Feb 10 14:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * doc/rake/, lib/rake/doc/: Move Rake rdoc files to lib/rake
+
+Sun Feb 10 12:10:25 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: test headers at first.
+
+Sun Feb 10 12:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * doc/rake/*: Removed stale Rake static files
+
+Sun Feb 10 09:10:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/pp.rb, lib/prettyprint.rb: Documentation for PP and PrettyPrint
+ Based on a patch by Vincent Batts [ruby-core:51253] [Bug #7656]
+
+Sat Feb 9 21:11:21 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: move header files check to the beginning of
+ "header and library section".
+ test rlim_t with sys/types.h and sys/time.h for MirOS BSD.
+ sys/types.h and sys/time.h is guarded by #ifdef and the above
+ move is required for this change.
+
+Sat Feb 9 17:45:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in, version.c: prevent duplicated load paths by empty
+ version string, it does not work right now.
+
+Sat Feb 9 17:38:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: fix arch parameters in help message. [Bug #7804]
+
+Sat Feb 9 13:13:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm_trace.c: Note about TracePoint events set, and comment on
+ Kernel#set_trace_func to prefer new TracePoint API
+
+Sat Feb 9 10:07:47 2013 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * BSDL: update copyright notice for 2013.
+
+Sat Feb 9 09:24:38 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/package/old.rb: Fix behavior only on ruby 1.8.
+
+ * lib/rubygems/package.rb: Include checksums.yaml.gz signatures for
+ verification.
+ * test/rubygems/test_gem_package.rb: Test for the above.
+
+Sat Feb 9 01:23:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * test/fiddle/helper.rb: specify libc and libm locations for MirOS BSD.
+
+ * test/dl/test_base.rb: ditto.
+
+Fri Feb 8 23:25:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: change CFLAGS temporally to test
+ ARCH_FLAG="-march=i486".
+
+Fri Feb 8 21:19:41 2013 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: don't define ARCH_FLAG="-march=i486" if it causes
+ compilation problem.
+
+For the changes before 2.0.0, see doc/ChangeLog-2.0.0
+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
+
+Local variables:
+coding: us-ascii
+add-log-time-format: (lambda ()
+ (let* ((time (current-time))
+ (system-time-locale "C")
+ (diff (+ (cadr time) 32400))
+ (lo (% diff 65536))
+ (hi (+ (car time) (/ diff 65536))))
+ (format-time-string "%a %b %e %H:%M:%S %Y" (list hi lo) t)))
+indent-tabs-mode: t
+tab-width: 8
+change-log-indent-text: 2
+end:
+vim: tabstop=8 shiftwidth=2
diff --git a/doc/ChangeLog-2.2.0 b/doc/ChangeLog-2.2.0
new file mode 100644
index 0000000000..5a7dbf826d
--- /dev/null
+++ b/doc/ChangeLog-2.2.0
@@ -0,0 +1,12157 @@
+Thu Dec 25 16:01:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_expand_path_internal): drop characters ignored
+ by filesystem on Mac OS X.
+
+Thu Dec 25 15:36:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (replace_real_basename): get the real name and replace the
+ base name with it by getattrlist(2) if available.
+ suggested by Matthew Draper at [ruby-core:67116]. [Bug #10015]
+
+ * dir.c (glob_helper): get the real name of the whole path, not
+ only the last name.
+
+Thu Dec 25 13:59:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (NET_LUID): include also ifdef.h as a workaround of
+ a bug in mingw-w64 header. [ruby-core:67103] [Bug #10640]
+
+Thu Dec 25 12:47:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (gettable_gen): warn possible reference to a local
+ variable defined in a past scope.
+
+Thu Dec 25 10:09:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/console.c (console_dev): id_console is not a
+ constant name, use rb_const_remove() to get rid of NameError.
+
+Thu Dec 25 09:18:55 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
+ set timeout for recvfrom because if client thread is crashed, it
+ waits infinity.
+
+Thu Dec 25 08:42:11 2014 Eric Wong <e@80x24.org>
+
+ * lib/uri/generic.rb (split_userinfo): fstring for 1-byte split
+ (set_port): reduce bytecode size
+ (check_path): reduce garbage via opt_str_freeze
+ (query=): ditto
+ (fragment=): ditto
+ [misc #10628]
+ * lib/uri/rfc3986_parser.rb (regexp): cache as attr
+ (initialize): setup and freeze regexp attr once
+ (split): reduce bytecode size, use opt_str_freeze
+ (parse): minor bytecode and garbage reduction
+ (default_regexp): rename for initialize
+
+Wed Dec 24 20:38:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_make_pattern): restrict searching case-insensitive
+ name from the filesystem to only last part, for the performance.
+ [ruby-core:63591] [Bug #10015]
+
+Wed Dec 24 18:21:27 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: remove unused rb_objspace_t::rgengc::old_objects_at_gc_start.
+
+Wed Dec 24 13:25:22 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/redmine-backporter.rb: require view_changesets permission.
+
+Wed Dec 24 13:00:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/downloader.rb (Downloader.download): fix the exception to
+ re-raise. initialize methods of subclasses of Exception may
+ have different parameters. [ruby-core:67086] [Bug #10639]
+
+Wed Dec 24 12:16:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.h (rb_data_type_t): revert r48647 and revise parent member.
+ [ruby-core:66969] [Bug #10621]
+
+Wed Dec 24 05:40:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/downloader.rb: use config.guess in gcc repo.
+
+Wed Dec 24 11:50:19 2014 Koichi Sasada <ko1@atdot.net>
+
+ * hash.c (rb_hash_delete): return Qnil if there are no corresponding
+ entry. [Bug #10623]
+
+ * hash.c (rb_hash_delete_entry): try delete and return Qundef if there
+ are no corresponding entry.
+
+ * internal.h: add rb_hash_delete_entry()'s declaration.
+
+ * symbol.c: use rb_hash_delete_entry().
+
+ * thread.c: use rb_hash_delete_entry().
+
+ * ext/-test-/hash/delete.c: use rb_hash_delete_entry().
+
+Wed Dec 24 09:35:11 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/fiddle/extconf.rb: remove ffitarget.h generated by configure on
+ mswin, because it's not normal file (cygwin's symlink) and have
+ system attribute.
+
+Wed Dec 24 05:40:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/downloader.rb: support ruby 1.8.
+
+Wed Dec 24 02:44:06 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/response.rb (Net::HTTPResponse): require one or more
+ spaces [Bug #10591].
+ by leriksen <leif.eriksen.au@gmail.com>
+ https://github.com/ruby/ruby/pull/782 fix GH-782
+ NOTE: graph.facebook.com returns without SP Reason-Phrase.
+
+Wed Dec 24 02:12:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/make-snapshot (package): VCS#branch_list expects glob a
+ pattern string but not a regexp. based on the patch by Vit
+ Ondruch. in [ruby-core:67064]. [Bug #10636]
+
+ * tool/vcs.rb (VCS::SVN#branch_list): strip newlines.
+
+ * tool/vcs.rb (VCS::GIT.get_revisions): retrieve modified time
+ from toplevel log too.
+
+ * tool/vcs.rb (VCS::GIT#branch_list): yield for each lines.
+
+Wed Dec 24 00:23:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/extlibs.rb (do_extract): the pipe should be binmode.
+
+Wed Dec 24 00:21:44 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * Makefile.in, common.mk: move common-srcs to Makefile.in because
+ it breaks build on mswin.
+
+Wed Dec 24 00:04:45 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/open-uri.rb (OpenURI.open_http): accept multiple certs path in
+ ssl_ca_certs.
+
+ * tool/downloader.rb: use certs of rubygems for downloading gems.
+
+Tue Dec 23 22:39:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/fiddle/extlibs: libffi-3.2.1 and patch for mswin.
+
+Tue Dec 23 22:04:38 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI::Generic#query=): don't escape [\]^
+ on both rfc2396 and rfc3986. [Bug #10619]
+
+Tue Dec 23 16:03:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::Error#initialize):
+ try en_US message if the default message cannot be encoded to
+ locale. [ruby-core:65295] [Bug #10300]
+
+Tue Dec 23 11:42:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/ossl_cipher.c (ossl_cipher_update_long): update huge
+ data gradually not to exceed INT_MAX. workaround of OpenSSL API
+ limitation. [ruby-core:67043] [Bug #10633]
+
+Mon Dec 22 21:30:16 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_event.rb: some tests are
+ executed on standard Windows OS without ADO.
+
+Mon Dec 22 14:08:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (received_signal): fix condition to define.
+ [ruby-core:67032] [Bug #10629]
+
+Sun Dec 21 10:51:51 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_event.rb: test_s_new_exception is
+ executed on standard Windows OS without ADO.
+
+Sun Dec 21 08:35:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (jemalloc): fix option argument, should use
+ `$withval` but not `yes` always. [ruby-core:66994] [Bug #10625]
+
+ * configure.in (jemalloc): defer adding the liner option to get
+ rid of linking contest against jemalloc, so that it works
+ without runtime dynamic load path.
+
+Sat Dec 20 17:49:03 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/tmpdir.rb (Dir.mktmpdir): Accept nil again, as Ruby 2.1.
+ [ruby-core:66943] [Bug #10616] Fixed by Alex Slynko.
+
+Sat Dec 20 11:22:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/fiddle/depend, ext/fiddle/extconf.rb: try to build bundled
+ libffi if existing.
+
+Sat Dec 20 05:21:00 2014 Eric Wong <e@80x24.org>
+
+ * test/test_weakref.rb (test_repeated_object_leak): increase timeout
+ [Bug #10618]
+
+Fri Dec 19 22:33:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Use $(hdrdir) if possible.
+
+Fri Dec 19 22:10:00 2014 Kenta Murata <mrkn@cookpad.com>
+
+ * ext/bigdecimal/depend: Fix dependencies to make bigdecimal
+ installable by rubygems.
+
+ * ext/bigdecimal/bigdecimal.gemspec: version 1.2.6.
+
+Fri Dec 19 20:00:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (PRIsVALUE): put a space after string
+ literals not to be confused with C++11 string literal suffix.
+ https://github.com/ruby/ruby/commit/a9f3eb7#commitcomment-9040169
+
+Fri Dec 19 15:36:02 2014 Simon Genier <simon.genier@shopify.com>
+
+ * hash.c (hash_equal): prefer true than the result of implicit
+ conversion from int returned by rb_eql() to VALUE. [Fix GH-789]
+
+Thu Dec 18 17:45:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_binary_elf): get rid of -e option of cat
+ which is not available on BusyBox, use tr instead.
+ [ruby-core:64824] [Bug #10210]
+
+Thu Dec 18 14:25:17 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * signal.c (ruby_signal): since SIGKILL is not supported by MSVCRT,
+ should be treated before calling signal(3).
+ [Bug #10615]
+
+Wed Dec 17 12:20:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (rb_method_for_self_aref, rb_method_for_self_aset):
+ move from iseq.c to build from node instead of arrays.
+
+Wed Dec 17 10:50:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/gdbm/test_gdbm.rb: Added test for each_key called without a block.
+ Patch by @joeyates [fix GH-783]
+
+Wed Dec 17 10:18:42 2014 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_compile_each): check
+ iseq->compile_data->option->specialized_instruction for opt_* insn.
+
+ * test/ruby/test_iseq.rb: check no specialized_instructions option.
+
+Wed Dec 17 09:48:57 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (iseq_compile_each): only emit opt_str_freeze,
+ opt_aref_with, and opt_aset_with insn when no block is given
+ [Bug #10557] [ruby-core:66595]
+ * test/ruby/test_optimization.rb (test_block_given_aset_aref):
+ new test for bug thanks to Bartosz Kopinski.
+ (test_string_freeze): additional assertion for object_id
+
+Wed Dec 17 01:06:47 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/win32/lib/Win32API.rb (Win32API#call): need to splat. hmm, when
+ was this broken?
+
+Tue Dec 16 15:18:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): call
+ accessor functions directly, not to be affected by [] and []=
+ methods. [ruby-core:66846] [Bug #10601]
+
+ * struct.c (define_aref_method, define_aset_method): ditto.
+
+ * vm_insnhelper.c (rb_vm_opt_struct_aref, rb_vm_opt_struct_aset):
+ direct accessors of Struct.
+
+Tue Dec 16 12:01:29 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ extend timeout seconds to 60 for RGENGC_CHECK_MODE > 0 environment.
+
+Tue Dec 16 08:53:12 2014 Eric Wong <e@80x24.org>
+
+ * tool/vcs.rb: fix Ruby 1.8 compatibility harder
+
+Tue Dec 16 07:37:18 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (GC_HEAP_FREE_SLOTS): move definition to match use order
+ (RUBY_GC_HEAP_GROWTH_SLOTS): s/factor/number of slots/
+
+ * man/ruby.1: add section for GC environment variables
+ [Feature #10197]
+
+Tue Dec 16 05:41:46 2014 Eric Wong <e@80x24.org>
+
+ * tool/vcs.rb: fix Ruby 1.8 compatibility
+
+Mon Dec 15 17:51:28 2014 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c: ObjectSpace.memsize_of(obj) returns
+ with sizeof(RVALUE). [Bug #8984]
+
+ * gc.c (obj_memsize_of): ditto.
+
+ * NEWS: add a NEWS entry.
+
+ * test/objspace/test_objspace.rb: catch up this fix.
+
+ * test/ruby/test_file_exhaustive.rb: ditto.
+
+Mon Dec 15 16:19:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_enc_str_coderange): dummy wchar, non-endianness
+ encoding string cannot be ascii only.
+ [ruby-core:66835] [Bug #10598]
+
+Sun Dec 14 20:11:42 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (primary): restore current_arg so that circular
+ reference after a method definition is also warned.
+ [ruby-core:61299] [Bug #9593]
+
+Sat Dec 13 20:41:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_trace.c (rb_postponed_job_flush): mask signal trap interrupt
+ too to defer handling after finalizers finished.
+ [ruby-core:66825] [Bug #10595]
+
+Sat Dec 13 18:33:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/openssl/test_pkey_ec.rb: ignored tests with old OpenSSL.
+
+Sat Dec 13 18:01:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (check_stack_overflow): check sp also on i386/x86_64
+ FreeBSD.
+
+Sat Dec 13 09:58:41 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (define_final0): avoid duplicate blocks
+ [Bug #10537]
+ * test/test_weakref.rb (test_repeated_object_leak): new test
+
+Sat Dec 13 04:59:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bin/erb (ERB::Main#run): get rid of shadowing outer local
+ variables. [ruby-core:65772] [Feature #10395]
+
+Fri Dec 12 21:56:44 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * gems/bundled_gems: Upgrade to test-unit 3.0.8. assert_throw and
+ assert_nothing_thrown in test-unit 3.0.7 were broken by
+ UncaughtThrowError change introduced in Ruby 2.2.0
+ preview2. These assertions in test-unit 3.0.8 work well with
+ UncaughtThrowError in Ruby 2.2.0 preview2.
+
+Fri Dec 12 19:48:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bin/erb (ARGV.switch, ERB::Main#run): allow variables to be set
+ from the command line. [ruby-core:65772] [Feature #10395]
+
+Fri Dec 12 19:31:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/erb.rb (ERB#lineno): accessor for line number to eval.
+
+ * lib/erb.rb (ERB#location=): setter of file name and line number.
+
+Fri Dec 12 13:09:13 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_latest_gc_info): return :state field to show current
+ GC state (none/marking/sweeping).
+ [Feature #10590]
+
+Fri Dec 12 10:49:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_crypt): check arguments more strictly.
+ * crypt() is not for wide char strings
+ * salt bytes should not be NUL
+
+Fri Dec 12 08:16:01 2014 Matt Hoyle <matt@deployable.co>
+
+ * io.c (io_read) Fix spelling in docco for read. [Fix GH-781]
+ try > tries
+
+Thu Dec 11 19:06:01 2014 Koichi Sasada <ko1@atdot.net>
+
+ * class.c (class_alloc): Start from age == 2.
+ Class and Module objects can be living long life.
+
+ * iseq.c: Same for ISeq objects.
+
+ * gc.c (RVALUE_AGE_RESET): added.
+
+ * gc.c (newobj_of): allow to generate (age != 0) objects.
+
+ * gc.c (rb_copy_wb_protected_attribute): reset age for wb unprotected
+ objects.
+
+ * include/ruby/ruby.h: add RUBY_TYPED_PROMOTED1 as an unrecommended
+ flag.
+
+Thu Dec 11 05:37:52 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/prime.rb: Remove useless loop and block capture.
+ See [#10354]
+
+Thu Dec 11 04:27:24 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: introduce new field
+ rb_thread_t::local_storage_recursive_hash_for_trace to store
+ recursive hash to avoid creating new recursive (nested) hashes
+ for each trace events.
+ [Bug #10511]
+
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig): use it.
+
+ * cont.c: catch up this fix.
+
+ * vm.c (rb_thread_mark): ditto.
+
+Wed Dec 10 13:39:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (define_aref_method, define_aset_method): use iseq
+ VALUE instead of rb_iseq_t to prevent from GC, as RB_GC_GUARD
+ makes sense only for local variables. [Feature #10575]
+
+Wed Dec 10 09:38:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (exec_recursive): use the same last method name as
+ recursive_push in the error message when recursive_pop failed.
+ [ruby-core:66742] [Bug #10579]
+
+Wed Dec 10 02:48:46 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/net/http/test_https.rb
+ (TestNetHTTPS#test_certificate_verify_failure): on Windows,
+ Errno::ECONNRESET will be raised when the verify is failure at the
+ client side, and it'll be eaten by WEBrick.
+
+ * test/open-uri/test_ssl.rb (TestOpenURISSL#test_validation_failure):
+ ditto.
+
+Wed Dec 10 00:42:13 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset):
+ new methods to generate bytecode for struct.c
+ [Feature #10575]
+ * struct.c (rb_struct_ref, rb_struct_set): remove
+ (define_aref_method, define_aset_method): new functions
+ (setup_struct): use new functions
+ * test/ruby/test_struct.rb: add test for struct >10 members
+ * benchmark/bm_vm2_struct_big_aref_hi.rb: new benchmark
+ * benchmark/bm_vm2_struct_big_aref_lo.rb: ditto
+ * benchmark/bm_vm2_struct_big_aset.rb: ditto
+ * benchmark/bm_vm2_struct_small_aref.rb: ditto
+ * benchmark/bm_vm2_struct_small_aset.rb: ditto
+
+Tue Dec 9 20:24:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * string.c: [DOC] Add missing documentation around String#chomp.
+ Patch by @stderr [ci skip][fix GH-780]
+
+Tue Dec 9 18:20:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c: [DOC] Revise documentation by Marcus Stollsteimer at
+ [ruby-core:66368]. [Bug #10526]
+
+ * #inspect: be more specific about generated string, remove
+ obsolete example.
+ * #nil?: use code examples instead of different call-seq's.
+ * #tap: clarify what is yielded.
+ * Integer(): be more specific about to_int and to_i, remove
+ reference to Ruby 1.8.
+ * Array(): fix error.
+ * Class: fix variable name style and indentation in example.
+ * improve consistency, fix typos and formatting.
+
+Tue Dec 9 12:48:32 2014 Josef Simanek <josef.simanek@gmail.com>
+
+ * vm_eval.c (rb_eval_string_wrap): [DOC] Fix `rb_eval_string_wrap`
+ documentation. It is referencing `require` instead of `load`.
+ The former does not have the optional argument. [Fix GH-779]
+
+Tue Dec 9 10:16:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_frame_last_func): return the most recent frame method
+ name.
+
+ * thread.c (recursive_list_access): use the last method name,
+ instead of the current method name which can be unset in some
+ cases, not to use a symbol by the invalid ID.
+ [ruby-core:66742] [Bug #10579]
+
+Sun Dec 7 19:36:12 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/socket/basicsocket.c, ext/socket/sockssocket.c:
+ remove code for $SAFE=4.
+
+Sun Dec 7 10:20:55 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc 4.2.0.
+ * test/rdoc: ditto.
+
+Sun Dec 7 09:52:30 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.4.5.
+ * test/rubygems: ditto.
+
+Sat Dec 6 10:05:08 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb: Fix undefined variable usage & refactor/DRY
+ code. Patch by @aledovsky. [Fixes GH-770]
+
+ * test/net/test_imap.rb: related test.
+
+Sat Dec 6 10:09:44 2014 Eric Wong <e@80x24.org>
+
+ * thread.c (do_select): rename parameters to avoid shadowing
+
+Sat Dec 6 09:22:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rake: Update to rake 10.4.2
+ * test/rake: ditto.
+
+Sat Dec 6 06:48:03 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (rb_iseq_build_from_ary): remove misc handling
+
+Sat Dec 6 06:14:23 2014 Vit Ondruch <vondruch@redhat.com>
+
+ * configure.in (RUBY_LIB_VERSION): Fix --with-ruby-version
+ configuration option. get rid of quoting in config.status.
+
+ * template/verconf.h.tmpl: quote RUBY_LIB_VERSION here.
+ [ruby-core:66724] [Bug #10572]
+
+Sat Dec 6 04:33:52 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/pp.rb (File::Stat#pretty_print): some platforms (such as Windows)
+ does not have major/minor parts of device.
+
+Fri Dec 5 22:43:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/psych/lib/psych.rb: bump version to 2.0.8
+ * ext/psych/psych.gemspec: ditto.
+ * ext/psych/psych_emitter.c: ditto.
+ * ext/psych/psych_parser.c: ditto.
+
+Fri Dec 5 17:09:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/option.c (inet_ntop): link aliased inet_ntop in
+ libruby on mswin not rb_w32_inet_ntop which fails to link for
+ unknown reason.
+
+Fri Dec 5 11:09:54 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (prepare_iseq_build): remove unused block_opt param
+ (rb_iseq_new_with_bopt_and_opt): remove
+ (rb_iseq_new_with_opt): inline removed function
+ (rb_iseq_new_with_bopt): remove
+ (iseq_load): adjust prepare_iseq_build call
+ [Feature #10565]
+
+Fri Dec 5 09:46:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): fix lex_state after tLABEL_END, should
+ be EXPR_LABELARG to be followed by "paren with arg".
+ [ruby-core:66705] [Feature #4935]
+
+Fri Dec 5 02:27:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb: as all extension objects including initializations
+ of ext and enc should be linked to libruby if enable-shared,
+ EXTOBJS should not be linked to main programs.
+ [ruby-core:66675] [Bug #10566]
+
+Thu Dec 4 07:06:02 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (rb_iseq_build_from_exception): entry->sp is unsigned
+ (iseq_build_callinfo_from_hash): account for kw_arg
+ (iseq_build_from_ary_body): update for r35459
+ (CHECK_STRING, CHECK_INTEGER): remove unused checks
+ (int_param): new function for checking new `params' hash
+ (iseq_build_kw): new function for loading rb_iseq_param_keyword
+ (rb_iseq_build_from_ary): account for `misc' entry and general
+ structure changes
+ [Feature #8543]
+ * iseq.c (CHECK_HASH): new macro (for `misc' and `param' entries)
+ (iseq_load): account for `misc' and `params' hashes
+ (iseq_data_to_ary): add final opt to arg_opt_labels,
+ fix kw support, account for unsigned entry->sp
+ * ext/-test-/iseq_load/iseq_load.c: new ext for test
+ * ext/-test-/iseq_load/extconf.rb: ditto
+ * test/-ext-/iseq_load/test_iseq_load.rb: new test
+
+Thu Dec 4 06:56:57 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (iseq_free): avoid segfault on incomplete iseq
+ * test/ruby/test_syntax.rb (test_invalid_next): new test
+ for syntax error, not segfault
+
+Thu Dec 4 04:20:34 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (ruby_require_internal): ignore error detail, just return
+ an error.
+
+Wed Dec 3 17:13:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (load_encoding): use rb_require_internal instead of
+ calling rb_require_safe with protection.
+
+Wed Dec 3 16:47:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (register_init_ext, ruby_init_ext): defer running the
+ registered initialization function until required, not to enable
+ extensions which have global effects just by loading, e.g.,
+ mathn/complex and mathn/rational. fix `make test` with
+ --with-static-linked-ext.
+
+ * enc/encinit.c.erb (Init_enc): initialize encdb and transdb
+ directly.
+
+Wed Dec 3 14:51:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (ruby_require_internal): separate from rb_require_safe,
+ not to raise exceptions.
+
+ * ruby.c (process_options): remove unnatural encoding search.
+
+Wed Dec 3 14:34:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (setup_fake_str): fake string does not share another
+ string, but just should not free.
+
+Wed Dec 3 11:14:14 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (w32_spawn): `v2` is used not only for `shell` but also
+ `cmd`, so must not free before using `cmd`.
+ [ruby-core:66648] [Bug #10563]
+
+Wed Dec 3 09:48:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/racc/cparse/cparse.c (cparse_params_type): use typed data.
+
+Tue Dec 2 21:33:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: use typed data for com_hash.
+
+Tue Dec 2 15:30:30 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * array.c (rb_ary_plus): in documentation, added note about
+ inefficiency of repeated += operations.
+
+Tue Dec 2 07:20:21 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (iseq_data_to_ary): keep hidden variables
+ Thanks to wanabe [ruby-core:66566]
+
+Tue Dec 2 06:46:57 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: bumping version
+
+ * ext/psych/psych.gemspec: ditto
+
+Tue Dec 2 06:34:08 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: support objects that are
+ marshalable, but inherit from basic object.
+ Thanks Sean Griffin <sean@thoughtbot.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+
+ * test/psych/test_marshalable.rb: test for fix
+
+Tue Dec 2 06:32:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (ripper_flush_string_content): preserve the dispatched
+ results at tSTRING_CONTENT. [ruby-dev:48714] [Bug #10437]
+
+ * parse.y (regexp_contents): check in ripper only if the whole
+ content is a single regexp without interpolation.
+ [ruby-dev:48714] [Bug #10437]
+
+Tue Dec 2 06:30:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (rb_reg_region_copy): new function to try with GC if copy
+ failed and return the error.
+
+Tue Dec 2 04:43:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (CHECK_REGION_COPIED): onig_region_copy() can fail when
+ memory exhausted but returns nothing, so check by if allocated.
+
+Tue Dec 2 02:53:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (magic_comment_encoding): enable in ripper, since the
+ encoding is necessary to parse non-default encoding scripts.
+
+Tue Dec 2 02:30:25 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI::Generic.build):
+ use hostname= to detect and wrap IPv6 hosts.
+ Build is accepting URI components and users may not expect
+ that a host component needs to be wrapped with square brackets
+ since it's not providing a URI.
+ Note: initialize with arg_check => true does not wrap IPv6 hosts.
+ by Joe Rafaniello <jrafanie@redhat.com>
+ https://github.com/ruby/ruby/pull/765 fix GH-765
+
+ * test/uri/test_generic.rb: Add more tests
+
+Mon Dec 1 20:01:12 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: use typed data for WIN32OLE.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_event.c: ditto.
+
+Mon Dec 1 17:20:42 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (verconf.h): so depends on verconf.mk, which
+ is rebuilt by setup.mak.
+
+Mon Dec 1 11:05:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * proc.c: fix grammar by @BenMorganIO [fix GH-764][ci skip]
+
+Mon Dec 1 10:49:53 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * man/rake.1: Update latest man content by @aledovsky
+ [fix GH-771][ci skip]
+
+Mon Dec 1 10:42:31 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * doc/syntax/refinements.rdoc: refinements are no longer experimental.
+ patch by @gaurish [fix GH-775][ci skip]
+
+Sun Nov 30 20:05:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (regexp_contents): fix a typo. pointed out by wanabe.
+ [ruby-dev:48741] [Bug #10543]
+
+Sun Nov 30 18:55:32 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ Don't raise Interrupt.
+
+Sun Nov 30 17:11:05 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): Use
+ assert_separately.
+
+Sun Nov 30 00:02:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (process_options, ruby_script): transcode script name and
+ program name to locale encoding as well as argv.
+ [ruby-dev:48752] [Bug #10555]
+
+ * ruby.c (translit_char_bin): should not use code page dependent
+ CharNext on UTF-8 string. [ruby-dev:48752] [Bug #10555]
+
+Sat Nov 29 16:53:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (ruby_set_argv): convert argv from UTF-8.
+
+ * win32/win32.c (rb_w32_sysinit, cmdglob, w32_cmdvector): convert
+ wide char command line to UTF-8 argv, and glob in UTF-8 so that
+ metacharacters would match multibyte characters.
+ [ruby-dev:48752] [Bug #10555]
+
+Sat Nov 29 10:49:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (win32_direct_conv, rb_w32_readdir): convert UTF-8
+ and filesystem code page by using Win32 API directly.
+
+Sat Nov 29 09:37:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (syserr_initialize): simplify message building and get
+ rid of potential invalid byte sequence.
+
+Sat Nov 29 06:09:44 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * eval_error.c (error_print): respect the encoding of the message.
+
+ * io.c (rb_write_error_str): use rb_w32_write_console() on Windows
+ if stderr is a tty.
+
+Fri Nov 28 05:10:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (--with-setup): add option to select ext/Setup file.
+
+Fri Nov 28 05:02:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dmyenc.c (Init_enc): separate from dmyext.c for statically
+ linked extension excluding encoding libraries.
+
+Thu Nov 27 21:58:30 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk (miniprelude.c): It does not depend on prelude.rb now.
+
+Thu Nov 27 21:49:49 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: List up files built always in the source directory
+ and source files built always in the build directory.
+
+Thu Nov 27 21:24:55 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: add obsolete callcc.
+
+Thu Nov 27 19:59:49 2014 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_compile_each): remove duplicated line event.
+ [Bug #10449]
+
+ * test/ruby/test_settracefunc.rb: add and fix tests.
+
+Thu Nov 27 19:04:50 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_args.c: fix backtrace location for keyword related exceptions.
+
+ For example, the following program
+ def foo(k1: 1); end # line 1
+ foo(k2: 2) # line 2
+ causes "unknown keyword: k2 (ArgumentError)".
+
+ Before this patch, the backtrace location is only line 2.
+ However, error should be located at line 1 (over line 2 in
+ stack trace). This patch fix this problem.
+
+ * class.c (rb_keyword_error_new): separate exception creation logic
+ from rb_keyword_error(), to use in vm_args.c.
+
+ * vm_insnhelper.c (rb_arg_error_new): rename to rb_arity_error_new().
+
+ * vm_args.c (argument_arity_error): rename to argument_arity_error().
+
+ * vm_args.c (argument_kw_error): added to fix backtrace.
+
+ * test/ruby/test_keyword.rb: add tests.
+
+Thu Nov 27 17:31:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (prelude.c): no longer depends on miniruby, since not
+ depending on rbconfig.rb.
+
+Thu Nov 27 17:12:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (miniprelude.c): miniruby needs no preludes.
+
+Thu Nov 27 17:10:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/prelude.c.tmpl: no code if no prelude code is given.
+
+Thu Nov 27 13:11:00 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_malloc_increase): enable lazy sweep on GC by malloc()
+ (malloc_increase) to make GC incrementally.
+
+ This change can increase memory consumption. Report us if you find
+ any problem.
+
+Thu Nov 27 12:46:38 2014 Tanaka Akira <akr@fsij.org>
+
+ * time.c (time_s_mkutc): [DOC] Time.utc's 10 arguments form
+ doesn't examine wday, yday, isdst and tz.
+ (time_s_mktime): [DOC] Time.mktime's 10 arguments form
+ doesn't examine wday, yday and tz.
+ Suggested by naruse.
+
+Thu Nov 27 11:45:33 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (iseq_data_to_ary): add missing GC guard
+
+Thu Nov 27 10:51:59 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: add rb_thread_t::local_storage_recursive_hash
+ to speed up Thread#[:__recursive_key__] access.
+ [Bug #10511]
+
+ * thread.c (threadptr_local_aref): add fast path for
+ :__recursive_data__.
+
+ * thread.c (threadptr_recursive_hash, threadptr_recursive_hash_set):
+ add special accessor for recursive hash.
+
+ * cont.c: store/restore local_storage_recursive_hash.
+
+ * vm.c: init and mark local_storage_recursive_hash.
+
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig): clear and restore
+ local_storage_recursive_hash directly.
+
+Thu Nov 27 07:11:00 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (iseq_calc_param_size): hoist out of iseq_set_arguments
+
+Wed Nov 26 22:28:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (rb_get_kwargs, rb_extract_keywords): export
+ keyword argument functions.
+
+Wed Nov 26 21:18:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/inlinetest.rb: removed unused test helper.
+
+Wed Nov 26 20:47:28 2014 Masaya Tarui <tarui@ruby-lang.org>
+
+ * ext/continuation/continuation.c (Init_continuation): obsolete callcc.
+ first step of [Feature #10548].
+
+Wed Nov 26 19:57:54 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb (test_latest_gc_info): do test separately
+ to avoid mysterious behavior.
+
+Wed Nov 26 19:54:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (constat_reset): do nothing on non-standard
+ console emulators. [ruby-core:66471] [Bug #10546]
+
+Wed Nov 26 19:44:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/tsort.rb: Returns an enumerator if no block is given.
+ [ruby-core:66270] [Feature #10508] Proposed by Andrey Savchenko.
+
+Wed Nov 26 17:25:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (f_label, f_kw, formal_argument_gen): ignore invalid
+ formal argument in keyword argument definition.
+ [ruby-dev:48742] [Bug #10545]
+
+Wed Nov 26 15:32:06 2014 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_set_sequence): use "nop" insn instead of
+ "jump to next insn".
+ https://bugs.ruby-lang.org/issues/8543#change-50085
+
+Wed Nov 26 11:01:35 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (iseq_s_compile_file): close IO when done
+
+Wed Nov 26 06:06:23 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: encdb.h and transdb.h depends on $(PREP).
+ So prebuild files for them in tarball are useless.
+
+Wed Nov 26 02:08:44 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/make-snapshot: Don't generate enc/trans/newline.c in tarball.
+
+Wed Nov 26 00:41:44 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk (prereq): Don't depends on prelude.c and golf_prelude.c.
+ Since they depend on $(PREP) which is miniruby, they are rebuilt
+ after miniruby is built, even if tarball contains them.
+
+Wed Nov 26 00:20:48 2014 Tanaka Akira <akr@fsij.org>
+
+ * template/prelude.c.tmpl: Don't expand RbConfig::Config[...].
+ It is not used now.
+
+ * common.mk: prelude.c and golf_prelude.c doesn't depend on rbconfig.
+
+Tue Nov 25 17:07:06 2014 Koichi Sasada <ko1@atdot.net>
+
+ * NEWS: add an "Implementation changes" section.
+
+Tue Nov 25 16:09:28 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Do not attempt SSL session resumption when the
+ session is expired. [Bug #10533]
+
+Tue Nov 25 15:59:46 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake: Update to rake 10.4.0
+ * test/rake: ditto.
+ * NEWS: ditto.
+
+ * test/lib/minitest/unit.rb: Add compatibility shim for minitest 5.
+ This only provides minitest 5 unit test naming compatibility.
+
+Tue Nov 25 15:26:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/vcs.rb (get_revisions): use Time.new instead of Time.mktime
+ which does not accept UTC offset, and offset manually for older
+ versions than 1.9.
+
+Tue Nov 25 12:14:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (Init_process): initialize static IDs before constant
+ definitions. [ruby-core:66445]
+
+Tue Nov 25 10:32:23 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (iseq_build_callinfo_from_hash): hoist out
+ (iseq_build_from_ary_body): shorten callinfo case
+
+Mon Nov 24 23:03:21 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * gems/bundled_gems: Update to test-unit 3.0.7.
+
+Mon Nov 24 12:44:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (check_exec_redirect_fd, check_exec_redirect),
+ (rb_execarg_addopt): get rid of inadvertent ID pindown.
+
+Mon Nov 24 02:03:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_setter): preserve encoding of global variable
+ name in error message.
+
+Mon Nov 24 02:03:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * iseq.c (rb_insn_operand_intern): preserve encoding of method
+ name in CALL_INFO at disassembling.
+
+Mon Nov 24 02:02:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (must_respond_to): preserve encodings of variable name and
+ class name in warning message.
+
+Sun Nov 23 10:46:23 2014 Eric Wong <e@80x24.org>
+
+ * internal.h (struct rb_execarg): 160 => 144 bytes on x86-64
+ * ruby.c (struct load_file_arg): 48 => 40 bytes on x86-64
+ * vm_args.c (struct args_info): ditto
+
+Sun Nov 23 07:46:54 2014 Andy Maloney <asmaloney@gmail.com>
+
+ * io.c (rb_io_sysread): Remove redundant assignment of 'n'.
+ [Fix GH-767]
+
+Sat Nov 22 09:48:33 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/make-snapshot: Specify PWD macro for make.
+ PWD environment variable may not exist.
+
+Fri Nov 21 11:58:58 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/resolv.rb: fall back if canonicalization fails.
+ Thanks Vit Ondruch for the patch! [ruby-core:65836]
+
+ * test/resolv/test_dns.rb: test for patch
+
+Sat Nov 22 01:11:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_mod_const_get, rb_mod_const_defined): ditto.
+
+ * variable.c (rb_const_missing, rb_mod_const_missing): call
+ const_missing without new ID to get rid of inadvertent ID
+ creation.
+
+Fri Nov 21 19:32:57 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (ext/ripper/ripper.c): revert about srcdir and top_srcdir.
+
+ * common.mk (ext/ripper/ripper.c): use $(PWD) for Unix,
+ $(MAKEDIR) for Windows.
+
+Fri Nov 21 18:12:37 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Refactored.
+
+Fri Nov 21 14:25:40 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (top_srcdir): added because lacking this macro
+ causes build error at r48526.
+
+Fri Nov 21 12:00:58 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps (in_makefile): Use FILES_NEED_VPATH and
+ FILES_CONFUSING.
+
+ * ext/objspace/extconf.rb: Add VPATH for id.h
+
+Fri Nov 21 09:10:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (ext/ripper/ripper.c): fix dependencies for the case
+ to make ripper.y and id.h under the build directory.
+
+Fri Nov 21 08:42:21 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (ext/ripper/ripper.c): id.h in VPATH may exist in the build
+ directory.
+
+ * common.mk (ext/ripper/ripper.c): $(RM) was not defined.
+
+Fri Nov 21 00:36:09 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/x509.rb
+ (OpenSSL::X509::Name::RFC2253DN::StringChar): get rid of a false
+ positive assertion in ripper's test.
+
+Fri Nov 21 00:29:51 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/net/imap.rb (Net::IMAP::ResponseParser::BEG_REGEXP): no need to
+ use embed string.
+
+Fri Nov 21 00:19:17 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/uri/mailto.rb (URI::MailTo::EMAIL_REGEXP): should escape `#`.
+
+Thu Nov 20 23:17:11 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Insert all dependencies found by compiler.
+
+Thu Nov 20 15:51:01 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/depend (nkf.o): add nkf.c as dependency.
+ bsdmake tries to make nkf.o with nkf-utf8/nkf.c without this.
+
+Thu Nov 20 08:54:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (struct parser_params): reduce size by reordering
+ members and an unused member.
+
+Thu Nov 20 02:44:27 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Vector#independent? and associated class method
+ patch by gogo tanaka [#10451]
+
+Thu Nov 20 02:32:34 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Vector#angle_with
+ Patch by Egunov Dmitriy [#10442]
+
+Thu Nov 20 02:10:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (ripper_flush_string_content, parser_parse_string):
+ preserve parsed string content. [ruby-dev:48714] [Bug #10437]
+
+ * parse.y (ripper_new_yylval): abstract function to create ripper
+ wrapper, and make it able to hold another object.
+
+Thu Nov 20 01:00:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (reg_named_capture_assign_gen): use predefined ID
+ instead of rb_intern.
+
+Thu Nov 20 00:54:57 2014 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (ruby_init_setproctitle): Declare here.
+
+Thu Nov 20 00:26:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_here_document): append byte sequence directly to
+ the delayed content instead of creating an intermediate string
+ object.
+
+Wed Nov 19 21:11:01 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (ext/json/parser/parser.c): don't touch parse.c,
+ ruby repo is a downstream.
+
+Wed Nov 19 20:38:11 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (ext/ripper/ripper.c): use $(PWD) to get
+ <build-directory>/ext/ripper.
+
+Wed Nov 19 18:12:17 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/downloader.rb (RubyGems.download): Don't download gem if the
+ version is already downloaded. A gem file is versioned and
+ it must be identical if the version is the same.
+
+Wed Nov 19 17:59:25 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (ext/ripper/ripper.c): pass build directory as VPATH.
+
+ * ext/ripper/depend (.y.c): use VPATH for y.tab.c.
+
+Wed Nov 19 10:07:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/prelude.c.tmpl (Prelude#translate): strip VPATH prefix
+ from prelude names, so that srcdir differences do not make the
+ generated code different.
+
+Wed Nov 19 07:45:11 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_write): should set the error of
+ GetOverlappedResult()'s, not WriteFile()'s (it's always
+ ERROR_IO_PENDING, of course).
+
+Tue Nov 18 14:16:47 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_record): add information for debug print.
+
+Wed Nov 19 04:49:07 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * debug.c (set_debug_option): need the declaration.
+
+ * debug.c (set_debug_option): use the same macro with the implementation
+ at win32/win32.c.
+
+Wed Nov 19 04:16:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (symbol_list): fix the node type of literal symbol list
+ with no interpolation. [ruby-core:66343]
+
+Wed Nov 19 00:26:15 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Sort dependencies.
+
+Wed Nov 19 00:24:18 2014 Tanaka Akira <akr@fsij.org>
+
+ * enc/encdb.c: Include internal.h.
+
+Tue Nov 18 23:23:45 2014 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: Gather declarations in non-header files.
+
+Tue Nov 18 23:45:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * debug.c (SET_WHEN): Don't declare debug variables here.
+ ruby_initial_gc_stress_ptr is changed int* to VALUE* at r41406.
+
+ * internal.h (ruby_initial_gc_stress_ptr): Declared.
+ (ruby_enable_coredump): Ditto.
+
+Tue Nov 18 18:06:43 2014 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/io.h (FMODE_WSPLIT): Removed. The write() system call
+ is not required to split. It was useful to avoid whole process
+ blocking in Ruby 1.8 but not useful since write() is invoked without
+ GVL.
+ (FMODE_WSPLIT_INITIALIZED): Ditto.
+
+ * io.c (wsplit_p): Removed.
+ (io_writable_length): Removed.
+ (rb_fcntl): Don't update the removed flags.
+
+Tue Nov 18 03:23:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (check_setter_id): show the original argument instead
+ of nil on TypeError.
+
+Tue Nov 18 03:20:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * symbol.h (is_{local,global,instance,attrset,const,class,junk}_sym):
+ fix ID type names.
+
+Mon Nov 17 20:17:59 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_event.c: use typed data.
+
+Mon Nov 17 12:54:56 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rubygems/*, test/rubygems/*: Update to RubyGems 2.4.4
+ master (2f6e42e).
+
+Mon Nov 17 06:13:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (proc_binding): use the original iseq on a binding from
+ proc from method object to get the location.
+
+Sun Nov 16 19:38:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_current_receiver): new function to return the
+ receiver in the current control frame. [Feature #10195]
+
+Sun Nov 16 19:11:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/timeout.rb (Timeout::ExitException#exception): rescue
+ UncaughtThrowError which is specific for throw, instead of
+ ArgumentError.
+
+Sun Nov 16 18:22:18 2014 Eric Wong <e@80x24.org>
+
+ * tool/update-deps: warning to disable ccache
+
+Sun Nov 16 13:11:35 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk (CCAN_LIST_INCLUDES): Unused variable removed.
+ (ENCODING_H_INCLUDES): Ditto.
+ (PROBES_H_INCLUDES): Ditto.
+ (VM_CORE_H_INCLUDES): Ditto.
+
+Sun Nov 16 11:07:25 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_io.rb (test_readpartial_locktmp):
+ remove unnecessary begin/end
+
+Sun Nov 16 00:45:23 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: Specify dependencies for generated C sources.
+
+Sat Nov 15 23:10:45 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: No need to declare dependencies which
+ will be detected by inference rules.
+
+Sat Nov 15 20:34:23 2014 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: Include ruby.h and ruby/encoding.h to be
+ includable without prior inclusion.
+
+Sat Nov 15 20:46:44 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest):
+ Group tests by general entity and parameter entity.
+
+Sat Nov 15 20:43:31 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest): Define
+ test XML in each test method because (1) each XML in used only
+ one test and (2) related data and code should be close.
+
+Sat Nov 15 20:39:06 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest): Use
+ one test method for one test.
+
+Sat Nov 15 20:16:59 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest): Use
+ setup and teardown instead of ensure in test.
+
+Sat Nov 15 20:11:34 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb (REXMLTests::TestDocument): Group
+ entity expansion limit related tests.
+
+Sat Nov 15 20:09:00 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb (REXMLTests::TestDocument::BomTest):
+ Fix wrong parent class. It doesn't need inherit tests in
+ TestDocument class.
+
+Sat Nov 15 19:48:59 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb (depend_rules): support comments during a line.
+
+ * lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency
+ file contains path.
+
+Sat Nov 15 19:25:46 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: Remove comments in Dependency lines.
+ Notified by usa.
+
+ * enc/depend: Ditto.
+
+ * ext/**/depend: Ditto.
+
+Sat Nov 15 16:28:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_throw_obj): throw UncaughtThrowError instead of
+ ArgumentError. [Feature #10480]
+
+Sat Nov 15 14:13:38 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Extend to fix dependencies.
+
+ * common.mk: Dependencies updated by tool/update-deps.
+
+ * enc/depend: Ditto.
+
+ * ext/**/depend: Ditto.
+
+Fri Nov 14 17:36:48 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Support GNU Make 4.0.
+
+Fri Nov 14 16:59:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (default_proc_for_compat_func): check arguments number and
+ type, and get rid of reentering this default proc.
+
+Fri Nov 14 16:33:06 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): support compatible layer for
+ GC.stat(symbol) type access.
+
+Fri Nov 14 16:19:08 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): add compatible layer.
+ From Ruby 2.2, keys of GC.stat are changed [Feature #9924].
+ To provide compatible layer, GC.stat add a default_proc
+ (if default_proc of given Hash object is not set).
+
+ At first use of this compatible layer of interpreter process,
+ show a warning message like that:
+ program: GC.stat[:total_allocated_object]
+ warning message: "warning: GC.stat keys were changed from Ruby
+ 2.1. In this case, you refer to obsolete `total_allocated_object'
+ (new key is `total_allocated_objects').
+ Please check <https://bugs.ruby-lang.org/issues/9924>
+ for more information."
+
+ Please correct my English message :)
+
+ * hash.c (rb_hash_set_default_proc): export (in internal).
+
+ * internal.h: ditto.
+
+Fri Nov 14 10:41:25 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: guard by #if/#endif with GC_ENABLE_INCREMENTAL_MARK
+ to hide unused codes.
+
+ * gc.c: similar to GC_ENABLE_LAZY_SWEEP.
+
+Fri Nov 14 10:23:35 2014 Eric Wong <e@80x24.org>
+
+ * vm_eval.c (rb_eval_cmd): use pre-defined idCall
+
+Fri Nov 14 09:25:44 2014 Eric Wong <e@80x24.org>
+
+ * vm_eval.c (rb_yield_splat): add missing GC guard
+ [Bug #10509]
+
+Fri Nov 14 08:12:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * gc.c: fix build error caused by implicit conversion with clang.
+
+Fri Nov 14 06:54:06 2014 Eric Wong <e@80x24.org>
+
+ * insns.def (opt_succ): remove Time#succ optimization
+ [Feature #10501]
+
+Fri Nov 14 05:29:46 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: refactoring.
+
+ * gc.c: use GC_ENABLE_INCREMENTAL_MARK instead of USE_RINCGC.
+
+ * gc.c (gc_start): check FORCE_MAJOR_GC.
+
+Fri Nov 14 04:51:18 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: Tuning RincGC parameters.
+
+ Before this patch, gc_marks_step() marks (white -> grey) fixed
+ number objects. However, this strategy does not fit practical
+ cases, for example too slow to make progress.
+
+ This patch changes this strategy how many objects the
+ gc_marks_step() should handle.
+
+ We can estimate how many times gc_marks_step() is called during
+ this major marking (== C) with the free slot number in pooled
+ pages. We also can estimate the living object number (== L)
+ using last marked_slots value. We can solve this problem (how
+ many objects should be process in gc_marks_step()) by L/C.
+
+ * gc.c (rb_objspace_t): add rb_objspace_t::rincgc::pooled_slots and
+ step_slots.
+
+Fri Nov 14 01:26:47 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (search_response): parse MODSEQ in SEARCH
+ responses properly. [ruby-core:64203] [Bug #10112]
+
+Fri Nov 14 01:03:17 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/envutil.rb: Moved from test/ruby/.
+
+ * test/lib/find_executable.rb: Ditto.
+
+ * test/lib/memory_status.rb: Ditto.
+
+ * test/lib/test/unit.rb: require envutil.
+
+ * test/: Don't require envutil in test files.
+
+Thu Nov 13 21:59:58 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * lib/rexml/document.rb: add REXML::Document#document.
+ reported by Tomas Hoger <thoger@redhat.com> and patched by nahi.
+
+Thu Nov 13 21:51:56 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/monitor/test_monitor.rb: Use assert_join_threads.
+
+Thu Nov 13 21:45:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl: Don't specify port number.
+
+Thu Nov 13 21:22:35 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/ssl_server.rb: Unused file removed.
+ It is not used since r16111, Ruby 1.9.1.
+
+Thu Nov 13 18:50:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_ensure): remove obsolete prot_tag comment. patch by
+ Jack Danger at [ruby-core:66238]. [misc #10502]
+
+Thu Nov 13 18:10:38 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (rb_vm_make_proc_lambda): similar to rb_vm_make_proc() with
+ is_lambda argument.
+
+Thu Nov 13 12:11:18 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_fstat{,i64}): speed up. adjusting
+ timestamps in this function is to get rid of the side effect of
+ ENV["TZ"]. then, if ENV["TZ"] is not set, no need to adjust.
+ this change makes File#stat about 60% faster.
+
+Thu Nov 13 11:56:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c: include "internal.h" for STATIC_ASSERT.
+
+Thu Nov 13 03:56:38 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (struct heap_page): trivial packing
+ 304 => 296 bytes on x86-64
+
+Wed Nov 12 22:50:12 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * gems/bundled_gems: Update to test-unit 3.0.6 and minitest 5.4.3.
+
+Wed Nov 12 22:30:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rubygems/*: Update to RubyGems 2.4.3 master (7b1f684).
+
+Wed Nov 12 00:26:37 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_object.rb: Specify an exception class for rescue clause.
+
+ * test/dbm/test_dbm.rb: Ditto.
+
+ * test/gdbm/test_gdbm.rb: Ditto.
+
+ * test/sdbm/test_sdbm.rb: Ditto.
+
+Tue Nov 11 23:43:51 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/fileutils/test_fileutils.rb: Use assert_join_threads.
+
+Tue Nov 11 22:51:14 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/resolv/test_dns.rb: Use assert_join_threads.
+
+Tue Nov 11 22:33:08 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/net/pop/test_pop.rb: Use assert_join_threads.
+
+Tue Nov 11 22:07:20 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/net/http/test_https_proxy.rb: Use assert_join_threads.
+
+Tue Nov 11 18:09:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/prelude.c.tmpl: move from tool/compile_prelude.rb and
+ expand by generic_erb.rb.
+
+Tue Nov 11 13:01:31 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/commands/contents_command.rb (files_in_default_gem):
+ remove useless sort. show_files will sort the result and
+ another branch, files_in_gem, doesn't sort.
+ it should be removed for consistency.
+
+ * test/rubygems/test_gem_commands_contents_command.rb
+ (test_execute_default_gem): adjust the sort algorithm with
+ Gem::Commands::ContentsCommand#show_files, which sort items
+ as array of [prefix, basename] not strings.
+
+Tue Nov 11 10:37:09 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (sym_equal): use rb_obj_equal().
+ rb_obj_equal() is specially optimized in
+ opt_eq_func()@vm_insnhelper.c.
+
+ This fix is made from this discussion:
+ https://www.omniref.com/ruby/2.1.4/symbols/Symbol/%3D%3D#line=8361.
+
+Tue Nov 11 09:38:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rdoc/known_classes.rb: reverted regression changes of
+ rdoc known class.
+
+Tue Nov 11 00:21:50 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/net/imap/test_imap.rb: Don't ignore exceptions on server
+ threads.
+
+Mon Nov 10 23:34:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
+ exceptions on server thread.
+ Delete read_timeout method call to fix NoMethodError.
+
+Mon Nov 10 20:20:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_read): retry with reduced length if cannot to
+ write any data but no error occurs.
+
+Mon Nov 10 20:04:16 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/server.rb: Setup shutdown pipe in listen method.
+
+Mon Nov 10 19:37:09 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, include/win32/win32.h (rb_w32_set_nonblock): new
+ function to support nonblock-mode of pipes.
+
+ * win32/win32.c (rb_w32_read): nonblock-mode pipe returns ERROR_NO_DATA
+ if there is no data, but also returns it if remote-end is closed.
+
+ * win32/win32.c (rb_w32_write): if cannot to write any data, it may be
+ blocking.
+
+ * io.c (rb_io_set_nonblock): use rb_w32_set_nonblock for Windows.
+
+ * ext/io/nonblock/nonblock.c (rb_io_nonblock_set): use ruby's API when
+ setting nonblock-mode.
+
+ * test/ruby/test_io.rb: test nonblock pipes on Windows.
+
+Mon Nov 10 17:24:34 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/etc/etc.c (etc_getlogin): set login name encoding properly.
+ [ruby-core:66163] [Bug #10493]
+
+Mon Nov 10 16:20:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rubygems/*.rb: Update to RubyGems master(3e36528).
+
+Mon Nov 10 16:09:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (rb_f_kill): [DOC] mention known signal list.
+ [ruby-core:66162] [Bug #10492]
+
+Mon Nov 10 14:17:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rdoc/*.rb: Update to RDoc 4.2.0.alpha(579a11c)
+
+Mon Nov 10 12:44:39 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/server.rb: Less instance variables.
+
+Mon Nov 10 12:19:43 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/server.rb (shutdown): Use close() on @shutdown_pipe_w to
+ notify readability on the read side of the pipe.
+ write_nonblock() is not usable for pipe on Windows.
+ (cleanup_shutdown_pipe): Rescue IOError for @shutdown_pipe_w.close.
+
+Mon Nov 10 07:31:59 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/server.rb (initialize): Initialize shutdown pipe here
+ to avoid race condition.
+ (cleanup_shutdown_pipe): New private method.
+ (cleanup_listener): Extracted from shutdown method.
+ Call this method from start method to avoid race condition.
+
+Mon Nov 10 05:57:53 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/webrick/webrick.cgi: Don't use debug mode.
+
+ * test/webrick/webrick_long_filename.cgi: Ditto.
+
+Sun Nov 9 23:25:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (vm_call_super): allow bound proc method to call super
+ method.
+
+ * vm_insnhelper.c (vm_yield_with_cfunc): push defined class and
+ bound proc method entry to the control frame.
+
+Sun Nov 9 22:46:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/open-uri: Test server log in server thread.
+
+ * test/webrick: Ditto.
+
+Sun Nov 9 22:28:34 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/httpstatus.rb: require webrick/accesslog for AccessLog.
+
+Sun Nov 9 21:03:59 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/webrick: Fix the argument order of assert_equal.
+
+Sun Nov 9 20:29:01 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/webrick: Store log in an array.
+
+ * test/net/http: Ditto.
+
+ * test/open-uri: Ditto.
+
+Sun Nov 9 18:35:36 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/xmlrpc: Refine log test.
+
+Sun Nov 9 18:33:33 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/normalize.rb: Replaced if-else by
+ case in self.normalized? in parallel to r48309.
+
+Sun Nov 9 18:07:00 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/xmlrpc: Use assert_join_threads.
+
+Sun Nov 9 14:06:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/xmlrpc: Test webrick error log is empty.
+
+Sun Nov 9 13:47:02 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (is_incremental_marking): use #if/#else because
+ rb_objspace_t::flags::during_incremental_marking is not defined
+ when GC_ENABLE_INCREMENTAL_MARK is 0.
+
+ * gc.c (will_be_incremental_marking, is_full_marking): similar fix.
+
+Sun Nov 9 12:16:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/securerandom.rb (SecureRandom.gen_random): separate
+ implementation details and select at the load time.
+
+Sun Nov 9 12:09:38 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::API#Enum{Value,Key):
+ ditto.
+
+Sun Nov 9 11:48:40 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/net/http: Examine webrick log.
+
+Sun Nov 9 11:45:19 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * gems/bundled_gems: upgraded to test-unit 3.0.5.
+
+Sun Nov 9 11:40:50 2014 Tanaka Akira <akr@fsij.org>
+
+ * defs/known_errors.def: More errors for FreeBSD.
+
+Sun Nov 9 11:25:11 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * gems/bundled_gems: upgraded to power_assert 0.2.0.
+
+Sun Nov 9 10:31:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/securerandom.rb: set the script encoding to make a string
+ literal in SecureRandom::Kernel32.last_error_message single byte
+ encoding so msg[] works in bytes, since FormatMessage() returns
+ the size in TCHARs, not in characters.
+
+Sun Nov 9 09:50:22 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/webrick: Refine log tests.
+
+Sun Nov 9 08:58:05 2014 Tanaka Akira <akr@fsij.org>
+
+ * defs/known_errors.def (EHWPOISON): New errno symbol.
+ It is defined by glibc-2.16.
+
+Sun Nov 9 05:00:23 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/securerandom.rb (initialize): call the special method for Win32
+ before checking `/dev/urandom` because we know windows doesn't have it.
+
+Sun Nov 9 04:01:46 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/securerandom.rb (SecureRandom::AdvApi32): split from `initialize`.
+ thanks @zzak to remember it.
+
+Sun Nov 9 02:05:33 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/net/http/utils.rb: Don't connect to spawned server
+ before actual test.
+
+Sun Nov 9 01:51:50 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * object.c (Module#const_defined?): [DOC] Revise the documentation.
+ Patch by Xavier Noria.
+ [Fixes GH-754] https://github.com/ruby/ruby/pull/754
+
+Sun Nov 9 00:37:44 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/webrick: Examine log and use assert_join_threads.
+
+Fri Nov 7 00:00:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/unicode_norm_gen.tmpl: expand kompatible_table so that
+ recursive expansion is not needed at runtime.
+
+Thu Nov 6 23:58:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (pack_pack): escape unprintable characters and preserve
+ the encoding of warning message.
+
+Thu Nov 6 23:55:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (sym_printable): QUOTE() should not raise an exception
+ even on invalid byte sequence.
+
+Thu Nov 6 21:44:36 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/test_unicode_normalize.rb: Rename TestNormalize to
+ TestUnicodeNormalize.
+ Define constants under TestUnicodeNormalize.
+
+Thu Nov 6 21:22:59 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/open-uri/test_open-uri.rb: Check empty webrick log.
+
+Thu Nov 6 19:27:34 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * re.c (unescape_nonascii): cast -1 for the case char is unsigned char.
+ If char is signed char, for example gcc for ARM or ppc64, it caused
+ infinite loop.
+ http://kmuto.jp/build-ruby/arm/ruby-trunk/log/20141106T013005Z.fail.html.gz
+ http://rubyci.blob.core.windows.net/f19p8/ruby-trunk/log/20141106T090217Z.fail.html.gz
+
+Thu Nov 6 09:53:18 2014 Eric Wong <e@80x24.org>
+
+ * lib/uri/rfc2396_parser.rb (initialize): reduce bytecode size
+ 2088 => 1332 bytes on 32-bit x86
+
+Thu Nov 6 08:49:49 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/normalize.rb: Comment clarification.
+
+Wed Nov 5 23:43:24 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * compile.c (compile_data_alloc): add padding when strict alignment
+ is required for memory access. Currently, the padding is enabled
+ only when the CPU is 32-bit SPARC and the compiler is GCC.
+ [Bug #9681] [ruby-core:61715]
+
+ * compile.c (STRICT_ALIGNMENT): defined if strict alignment is required
+
+ * compile.c (ALIGNMENT_SIZE, ALIGNMENT_SIZE_MASK, PADDING_SIZE_MAX):
+ new macros for alignment word size, bit mask, max size of padding.
+
+ * compile.c (calc_padding): new function to calculate padding size.
+
+Wed Nov 5 23:24:45 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/open-uri/test_open-uri.rb: Don't ignore webrick's log.
+
+Wed Nov 5 19:20:08 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/server.rb: Stop listener loop properly.
+ [ruby-core:66085] [Bug #10478] Fixed by Charles Nutter.
+
+Wed Nov 5 17:20:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_disable_super, rb_enable_super): warn
+ as deprecated at build time, instead of ignoring silently or
+ warning at runtime only.
+
+Wed Nov 5 16:55:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_f_lambda): remove deprecated function, which has been
+ unavailable from extension libraries.
+
+Wed Nov 5 16:26:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_clear_cache): mark as deprecated, not
+ only warnings at runtime.
+
+Wed Nov 5 15:05:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_{,l,r}strip_bang): rb_str_subseq() will not
+ NUL-terminate the result string, in the future, so it will not
+ be needed in other cases.
+
+Wed Nov 5 14:11:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (lib/unicode_normalize/tables.rb): do nothing unless
+ BASERUBY is available. MINIRUBY cannot load extension libraries,
+ so cannot update Unicode data.
+
+Wed Nov 5 12:13:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_lstrip, rb_str_strip): reduce memory copy by
+ copying necessary part only.
+
+ * string.c (rb_str_strip_bang, rb_str_strip): ditto.
+
+Wed Nov 5 12:13:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_lstrip, rb_str_strip): reduce memory copy by
+ copying necessary part only.
+
+ * string.c (rb_str_strip_bang, rb_str_strip): ditto.
+
+Wed Nov 5 10:54:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_lstrip_bang, rb_str_rstrip_bang): terminate
+ wchar strings with wchar 0.
+
+Tue Nov 4 21:23:22 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/win32/lib/Win32API.rb: Fiddle::Importer is defined in
+ fiddle/import.rb and it's not loaded implicitly.
+
+ * ext/win32/lib/Win32API.rb (Win32API#initialize): `import` is a string.
+
+ * ext/win32/lib/Win32API.rb (Win32API#initialize):
+ Fiddle::Importer::CALL_TYPE_TO_ABI is private constant.
+
+Tue Nov 4 21:20:07 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/securerandom.rb (SecureRandom.random_bytes): use fiddle directly
+ instead of using Win32API.
+
+Tue Nov 4 21:04:30 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_request_set_lockfile.rb
+ (test_relative_path_from): driveletter support.
+
+Tue Nov 4 16:23:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/rubygems/test_gem_remote_fetcher.rb (RemoteFetcherCleanup):
+ close all pooled connections for each tests to fix leaked file
+ descriptors.
+
+Tue Nov 4 12:51:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (PRIsVALUE), vsnprintf.c (BSD_vfprintf): add
+ RUBY_PRI_VALUE_MARK to reduce danger of accidental conflict with
+ plain "%i". binary incompatible with extension libraries using
+ PRIsVALUE and built for 2.1 and earlier. [EXPERIMENTAL]
+
+Tue Nov 4 12:33:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * object.c: fix document of Kernel#String by @suzukaze
+ [fix GH-743][ci skip]
+
+Tue Nov 4 12:21:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/csv.rb: added documentation for skip_blanks option by @decasia
+ [fix GH-744][ci skip]
+
+Tue Nov 4 12:09:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/open3.rb: fix code formatting in documentation by @JoshCheek
+ [fix GH-747][ci skip]
+
+Tue Nov 4 08:57:37 2014 Eric Wong <e@80x24.org>
+
+ * encoding.c (enc_memsize): remove unnecessary function
+ [ruby-core:65304]
+
+Mon Nov 3 18:09:39 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/utils.rb: The default of :ignore_listener_error is
+ changed to false.
+
+Mon Nov 3 14:42:37 2014 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (iseq_free): resolve memory leak.
+
+Mon Nov 3 13:49:18 2014 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (iseq_memsize): catch up recent changes.
+
+Mon Nov 3 13:38:28 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: change semantics of opt_num and opt_table.
+ `opt_num' was the number of optional parameters + 1.
+ `opt_table' has "opt_num" entries.
+
+ Change them to:
+ `opt_num' is the number of optional parameters.
+ `opt_table' has "opt_num + 1" entries.
+
+ This change simplify parameter fitting logics.
+
+ * compile.c: catch up this change.
+
+ * iseq.c: ditto.
+
+ * proc.c: ditto.
+
+ * vm_args.c: ditto.
+
+Mon Nov 3 11:47:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * NEWS: added period into Matrix section. [ci skip]
+ [misc #10446][ruby-core:65987]
+
+Mon Nov 3 09:43:30 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * vm_args.c: fixed build error with clang
+
+Mon Nov 3 09:32:46 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/rfc3986_parser.rb (URI::RFC3986_Parser::RFC3986_URI):
+ allow '[' and ']' for URI input (and escape). [Bug #10402]
+
+ * lib/uri/generic.rb (URI#query=): escape '[', '\', and ']'.
+
+Mon Nov 3 07:49:34 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: change iseq parameter data structure.
+ https://bugs.ruby-lang.org/issues/10440#change-49694
+
+ * change terminology `arg' to `param'.
+ * move rb_iseq_t::arg_* to rb_iseq_t::param.
+ * move rb_iseq_t::arg_size to rb_iseq_t::param::size.
+ * move rb_iseq_t::argc to rb_iseq_t::param::lead_num.
+ * move rb_iseq_t::arg_opts to rb_iseq_t::param::opt_num.
+ * move rb_iseq_t::arg_rest to rb_iseq_t::param::rest_start.
+ * move rb_iseq_t::arg_post_num to rb_iseq_t::param::post_num.
+ * move rb_iseq_t::arg_post_start to rb_iseq_t::param::post_start.
+ * move rb_iseq_t::arg_block to rb_iseq_t::param::block_start.
+ * move rb_iseq_t::arg_keyword* to rb_iseq_t::param::keyword.
+ rb_iseq_t::param::keyword is allocated only when keyword
+ parameters are available.
+ * introduce rb_iseq_t::param::flags to represent parameter
+ availability. For example, rb_iseq_t::param::flags::has_kw
+ represents that this iseq has keyword parameters and
+ rb_iseq_t::param::keyword is allocated.
+ We don't need to compare with -1 to check availability.
+ * remove rb_iseq_t::arg_simple.
+
+ * compile.c: catch up this change.
+
+ * iseq.c: ditto.
+
+ * proc.c: ditto.
+
+ * vm.c, vm_args.c, vm_dump.c, vm_insnhelper.c: ditto.
+
+ * iseq.c (iseq_data_to_ary): support keyword argument.
+
+Mon Nov 3 03:39:04 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_method.rb: r48239 makes this test green.
+
+Mon Nov 03 03:02:38 2014 Koichi Sasada <ko1@atdot.net>
+
+ * rewrite method/block parameter fitting logic to optimize
+ keyword arguments/parameters and a splat argument.
+ [Feature #10440] (Details are described in this ticket)
+
+ Most of complex part is moved to vm_args.c.
+
+ Now, ISeq#to_a does not catch up new instruction format.
+
+ * vm_core.h: change iseq data structures.
+
+ * introduce rb_call_info_kw_arg_t to represent keyword arguments.
+ * add rb_call_info_t::kw_arg.
+ * rename rb_iseq_t::arg_post_len to rb_iseq_t::arg_post_num.
+ * rename rb_iseq_t::arg_keywords to arg_keyword_num.
+ * rename rb_iseq_t::arg_keyword to rb_iseq_t::arg_keyword_bits.
+ to represent keyword bitmap parameter index.
+ This bitmap parameter shows that which keyword parameters are given
+ or not given (0 for given).
+ It is referred by `checkkeyword' instruction described bellow.
+ * rename rb_iseq_t::arg_keyword_check to rb_iseq_t::arg_keyword_rest
+ to represent keyword rest parameter index.
+ * add rb_iseq_t::arg_keyword_default_values to represent default
+ keyword values.
+ * rename VM_CALL_ARGS_SKIP_SETUP to VM_CALL_ARGS_SIMPLE
+ to represent
+ (ci->flag & (SPLAT|BLOCKARG)) &&
+ ci->blockiseq == NULL &&
+ ci->kw_arg == NULL.
+
+ * vm_insnhelper.c, vm_args.c: rewrite with refactoring.
+
+ * rewrite splat argument code.
+ * rewrite keyword arguments/parameters code.
+ * merge method and block parameter fitting code into one code base.
+
+ * vm.c, vm_eval.c: catch up these changes.
+
+ * compile.c (new_callinfo): callinfo requires kw_arg parameter.
+
+ * compile.c (compile_array_): check the last argument Hash object or
+ not. If Hash object and all keys are Symbol literals, they are
+ compiled to keyword arguments.
+
+ * insns.def (checkkeyword): add new instruction.
+ This instruction check the availability of corresponding keyword.
+
+ For example, a method "def foo k1: 'v1'; end" is compiled to the
+ following instructions.
+
+ 0000 checkkeyword 2, 0 # check k1 is given.
+ 0003 branchif 9 # if given, jump to address #9
+ 0005 putstring "v1"
+ 0007 setlocal_OP__WC__0 3 # k1 = 'v1'
+ 0009 trace 8
+ 0011 putnil
+ 0012 trace 16
+ 0014 leave
+
+ * insns.def (opt_send_simple): removed and add new instruction
+ "opt_send_without_block".
+
+ * parse.y (new_args_tail_gen): reorder variables.
+ Before this patch, a method "def foo(k1: 1, kr1:, k2: 2, **krest, &b)"
+ has parameter variables "k1, kr1, k2, &b, internal_id, krest",
+ but this patch reorders to "kr1, k1, k2, internal_id, krest, &b".
+ (locate a block variable at last)
+
+ * parse.y (vtable_pop): added.
+ This function remove latest `n' variables from vtable.
+
+ * iseq.c: catch up iseq data changes.
+
+ * proc.c: ditto.
+
+ * class.c (keyword_error): export as rb_keyword_error().
+
+ * common.mk: depend vm_args.c for vm.o.
+
+ * hash.c (rb_hash_has_key): export.
+
+ * internal.h: ditto.
+
+Mon Nov 3 02:35:32 2014 Koichi Sasada <ko1@atdot.net>
+
+ * sample/simple-bench.rb: added to measure performance of simple
+ lines.
+
+Mon Nov 3 02:33:43 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (obj_info): show T_STRING more details.
+
+Sun Nov 2 01:30:32 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/test_ssl.rb: Don't ignore errors on listener threads,
+ as much as possible.
+
+ * test/openssl/test_ssl_session.rb: Ditto.
+
+ * test/openssl/test_partial_record_read.rb: Ditto.
+
+Sat Nov 1 23:11:05 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/utils.rb (start_server): Don't close sockets before
+ threads finished.
+
+Sat Nov 1 22:06:24 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/test_ssl_session.rb (test_ctx_client_session_cb): Don't
+ ignore errors of SSL accept.
+ (test_ctx_server_session_cb): Ditto.
+
+ * test/openssl/utils.rb (server_loop): Add ignore_ssl_accept_error
+ argument.
+ (start_server): Refine threads waits.
+
+ * test/ruby/envutil.rb (assert_join_threads): Show a thread before
+ backtrace.
+
+Sat Nov 1 20:40:18 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/utils.rb (start_server, server_loop): Use a
+ pipe to stop server instead of shutdown/close a listening socket.
+
+Sat Nov 1 19:24:59 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/envutil.rb (assert_join_threads): New assertion to
+ join multiple threads without exceptions.
+
+Sat Nov 1 17:09:32 2014 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bary_mul_balance_with_mulfunc): Fix free work area
+ location.
+ [ruby-dev:48723] [Bug #10464]
+ [ruby-core:66044] [Bug #10465]
+ Reported by Kohji Nishihama.
+
+Sat Nov 1 15:45:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parse_atmark): mere atmark and two atmarks without
+ succeeding identifiers are invalid as instance/class variable
+ names.
+
+Sat Nov 1 06:31:41 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_variant.c: use typed data.
+
+Fri Oct 31 13:55:28 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/dl/*: remove DL as it is replaced by Fiddle.
+ [Feature #5458] Thanks to Jonan Scheffler <jonanscheffler@gmail.com>
+ for this patch
+
+ * test/dl/*: ditto.
+
+Fri Oct 31 15:26:02 2014 Charles Oliver Nutter <headius@headius.com>
+
+ * test/openssl/test_ssl.rb: Add certificate verification chain
+ test from JRuby community.
+
+Fri Oct 31 18:58:02 2014 Charles Oliver Nutter <headius@headius.com>
+
+ * test/psych/test_emitter.rb: Fix line_width test...initial value
+ is impl-specific and attr assignment always returns LHS.
+
+Fri Oct 31 22:19:30 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/digest/lib/digest.rb (Digest()): This function should now be
+ thread-safe. If you have a problem with regard to on-demand
+ loading under a multi-threaded environment, preload "digest/*"
+ modules on boot or use this method instead of directly
+ referencing Digest::*. [Bug #9494]
+ cf. https://github.com/aws/aws-sdk-ruby/issues/525
+
+Fri Oct 31 21:33:17 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/digest/test_digest.rb: Drop #!. This no longer runs
+ stand-alone because it depends on ruby/envutil.
+
+Fri Oct 31 17:22:19 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/setup.mak: $(APPEND) with some arguments insert a space before
+ the arguments, so it causes error if the arguments are expected to be
+ a macro definition. this fix resolve the build error introduced at
+ r48210.
+
+Fri Oct 31 16:47:35 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/syslog/lib/syslog/logger.rb (Syslog::Logger::VERSION): Bump
+ the VERSION to 2.1.0. [ruby-core:64483] [Bug #10159]
+
+Fri Oct 31 16:33:46 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/net/imap.rb (Net::IMAP#fetch): [DOC] Document that
+ Net::IMAP#fetch will return nil instead of an empty array.
+
+Fri Oct 31 12:54:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (.unicode-tables.time): needs Unicode files always,
+ and should update after downloading these files.
+ [ruby-core:66026] [Bug #10461]
+
+Fri Oct 31 10:16:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: reverted r48199, it's unrelated configuration.
+
+Fri Oct 31 09:58:14 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_unicode_normalize.rb: added unicode version number to
+ test data location.
+
+Fri Oct 31 09:56:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .gitignore: ignored unicode data with version directories.
+
+Fri Oct 31 09:35:30 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: tweak build scripts for unicode_normalize.rb.
+
+Thu Oct 30 18:47:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk: fix for the case ALWAYS_UPDATE_UNICODE=no
+
+Thu Oct 30 13:23:23 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: changed Unicode data download location
+ from latest Unicode version to Unicode 7.0.0.
+
+Thu Oct 30 11:16:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_callee_setup_arg{_complex,}): try conversion
+ by to_ary for a lambda, as well as a proc.
+ [ruby-core:65887] [Bug #9605]
+
+Wed Oct 29 21:13:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (gettable_gen): warn circular argument reference, for
+ transition from 2.1 and earlier. [ruby-core:65990] [Bug #10314]
+
+Wed Oct 29 20:41:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_params): remove unused member `cur_mid`.
+ this has been taken over by `in_def` since 1.6.
+
+Wed Oct 29 14:44:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_f_load): path name needs to be transcoded to OS path
+ encoding. [ruby-list:49994]
+
+Wed Oct 29 11:48:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (__builtin_setjmp): disable with gcc/clang earlier
+ than 4.3 on Mac OS X. [ruby-core:65174] [Bug #10272]
+
+Wed Oct 29 11:43:43 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Generalize Vector#cross_product to arbitrary
+ dimensions
+ based on a patch by gogo tanaka [#10074]
+
+Wed Oct 29 11:43:11 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Matrix#adjucate
+ patch by gogo tanaka [#10056]
+
+Wed Oct 29 11:42:33 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add aliases for Vector#cross & dot
+ patch by gogo tanaka [#10352]
+
+Wed Oct 29 10:00:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * gems/bundled_gems: Update latest version of bundled gems.
+
+Tue Oct 28 16:52:07 2014 Eric Wong <e@80x24.org>
+
+ * signal.c (install_sighandler): remove rb_disable_interrupt and
+ rb_enable_interrupt calls
+ (init_sigchld): ditto
+ (Init_signal): disable and enable interrupt once around all
+ install_sighandler and init_sigchld to reduce syscalls at start
+ [Feature #9345] [ruby-core:59480]
+
+Tue Oct 28 16:22:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (process_options, load_file_internal2): should not
+ require other files when dump option is given.
+ [ruby-dev:48712] [Bug #10435]
+
+Tue Oct 28 14:51:38 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: remove apple-gcc4.2 from CC candidates.
+
+Mon Oct 27 20:13:37 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rexml/entity.rb: keep the entity size within the limitation.
+ reported by Willis Vandevanter <will@silentrobots.com> and
+ patched by nahi.
+
+Mon Oct 27 17:17:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (method_proc): the receiver of binding from method should
+ be same as the receiver of the method.
+ [ruby-core:65917] [Bug #10432]
+
+Mon Oct 27 16:26:37 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_super.rb: add a test to check block passing.
+
+Mon Oct 27 15:59:26 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: is_incremental_marking(), will_be_incremental_marking():
+ use `&&' with GC_ENABLE_INCREMENTAL_MARK instead of using
+ #if/#else/#endif.
+
+Mon Oct 27 13:40:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (gc_sweep_rest): sweep rest pages regardless of whether
+ lazy sweep is enabled or not. based on the patch by Masahiro
+ Ide at [ruby-dev:48706]. [Bug #10431]
+
+Mon Oct 27 11:18:32 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ reduce garbage during forks
+
+Sun Oct 25 12:26:26 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * template/insns.inc.tmpl, insns_info.inc.tmpl, known_errors.inc.tmpl,
+ minsns.inc.tmpl: fixed path of generating script.
+
+Sun Oct 26 12:24:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/ripper/lib/ripper/sexp.rb (Ripper.sexp, Ripper.sexp_raw):
+ return nil on error. [ruby-dev:48678] [Bug #10405]
+
+Sun Oct 25 11:24:24 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * string.c: improved comment.
+
+Sun Oct 26 07:40:11 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_val2variant, ole_invoke): refactoring.
+ use ole_variant2variant to convert WIN32OLE_VARIANT object to
+ VARIANT object.
+
+ * ext/win32ole/win32ole_variant.c: refactoring. add
+ ole_variant2variant.
+ * ext/win32ole/win32ole_variant.h: ditto.
+
+Sat Oct 25 22:28:17 2014 Tanaka Akira <akr@fsij.org>
+
+ * io.c (io_binwrite_string): Test writev() failure.
+
+Sat Oct 25 20:19:19 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/test-unicode_normalize.rb: added test_us_ascii.
+
+Sat Oct 25 20:09:09 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/normalize.rb: added US_ASCII
+ as trivially supported encoding (is always normalized,
+ and may appear mixed in with UTF-8 or other Unicode
+ encodings).
+
+Sat Oct 25 20:01:01 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/test-unicode_normalize.rb: added
+ test_raise_exception_for_non_unicode_encoding.
+
+Sat Oct 25 19:30:30 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/test-unicode_normalize.rb: removed unused function.
+
+Sat Oct 25 18:41:41 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * template/unicode_norm_gen.tmpl: Adjusted name of generating file.
+
+Fri Oct 24 22:49:42 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): dispatch newline and space at fluent
+ interface, so that the following identifier does not include the
+ space. [ruby-dev:48684] [Bug #10411]
+
+Fri Oct 24 20:41:36 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * signal.c (check_reserved_signal_): fix write count since r47991.
+
+Thu Oct 23 21:42:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_delete): now does not call the block given to
+ the current method. [ruby-core:65861] [Bug #10413]
+
+Thu Oct 23 19:13:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_method_entry_make): warn redefinition only for
+ already defined methods, but not for undefined methods.
+ [ruby-dev:48691] [Bug #10421]
+
+Thu Oct 23 17:19:04 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/source.rb (REXML::IOSource#encoding_updated): Fix a
+ bug that can't parse XML correctly when
+ Encoding.default_internal is different with XML
+ encoding. REXML::Source converts XML encoding on read. So IO
+ should not convert XML encoding.
+ Based on patch by NAKAMURA Usaku.
+ [ruby-dev:48686] [Bug #10418]
+
+ * test/rexml/test_encoding.rb
+ (REXMLTests::EncodingTester#test_parse_utf16_with_utf8_default_internal):
+ Add the for the above case.
+
+Thu Oct 23 16:29:02 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_encoding.rb
+ (REXMLTests::EncodingTester#test_parse_utf16): Use meaningful
+ test name. "ticket" in the old test name means the ticket in
+ REXML's issue tracker. The REXML's issue tracker was gone. So
+ "ticket" is meaningless.
+
+ * test/rexml/data/ticket_110_utf16.xml: Rename to ...
+ * test/rexml/data/utf16.xml: ... this.
+
+Thu Oct 23 16:18:11 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_encoding.rb
+ (REXMLTests::EncodingTester#test_ticket_110): Fix expected and
+ actual order.
+ Patch by NAKAMURA Usaku. Thanks!!!
+
+Thu Oct 23 10:47:16 2014 Eric Wong <e@80x24.org>
+
+ * insns.def (getlocal,setlocal): add comment to def/opt_operand.def
+
+Thu Oct 23 10:22:41 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ use IO#wait_readable instead of timeout
+
+Thu Oct 23 10:22:24 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ ensure exit! during fork failure
+
+Thu Oct 23 10:21:21 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * NEWS: Added String#unicode_normalize(|!|d?) [ci skip]
+
+Thu Oct 23 03:41:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (unknown_keyword_error): delete expected keywords
+ directly from raw table, so that the given block is not called.
+ [ruby-core:65837] [Bug #10413]
+
+Thu Oct 23 02:33:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (update-unicode): invert dependency to run every times.
+ [ruby-core:65842] [Bug #10415]
+
+ * common.mk (after-update): update files under source tree.
+ [ruby-core:65840] [Bug #10414]
+
+Wed Oct 22 22:38:59 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/ssl.rb (DEFAULT_PARAMS): override
+ options even if OpenSSL::SSL::OP_NO_SSLv3 is not defined.
+ this is pointed out by Stephen Touset. [ruby-core:65711] [Bug #9424]
+
+Wed Oct 22 21:31:56 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (prelude.c): add dependency to LIB_SRCS because
+ enc/prelude.rb requires lib/unicode_normalize.rb, and it's also
+ requires lib/unicode_normalize/tables.rb (=LIB_SRCS).
+
+Wed Oct 22 21:09:51 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * configure.in (nacl_cv_cpu_nick): fix typo in PNaCl.
+ (XCFLAGS) Add -isystem flag to pnacl and nacl-newlib
+ (CXX): added
+
+ * nacl/GNUmakefile.in (CXX): Added
+ (PPROGRAM): Use clang++ instead of clang because libnacl_io
+ depends on c++ std lib.
+
+Wed Oct 22 21:07:32 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * common.mk (build-ext): avoid trying to build dynamic libraries
+ if configured --with-static-linked-ext.
+
+Wed Oct 22 20:33:33 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * common.mk: Fixed grammar in comment [ci skip]
+
+Wed Oct 22 19:18:18 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/unicode_norm_gen.rb: Fixed escaping of backslash and
+ double quote ('\\\&' -> "\\\\\\\&"; double quoted string
+ is needed to make \& mean last match; double double
+ backslashes are needed because of two layers of escaping).
+
+Wed Oct 22 18:13:29 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/test-unicode_normalize.rb: as often said, ruby is sometimes built
+ at non-srcdir.
+
+Wed Oct 22 18:12:12 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/test-unicode_normalize.rb: Adjusted path for test
+ data file (now ../enc/unicode/data/NormalizationTest.txt).
+
+Wed Oct 22 18:07:07 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/test-unicode_normalize.rb: Removed explicit require,
+ changed method names, adjusted copyright.
+
+Wed Oct 22 18:00:00 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/test-unicode_normalize.rb: Importing from
+ https://github.com/duerst/eprun/blob/master/test/test_normalize.rb.
+ (removing trailing whitespace, fixing EOLs and adding EOL property)
+
+Wed Oct 22 08:21:09 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * nacl/pepper_main.c (Instance_DidCreate): mount devfs and rebind fd 0
+ .. 2 so that stderr goes to the console of the browser.
+
+Wed Oct 22 03:47:43 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/etc/etc.c (etc_nprocessors_affin): maximum "n" should be 16384.
+
+Wed Oct 22 03:37:00 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/etc/etc.c (etc_nprocessors_affin): minor spell fix.
+
+Wed Oct 22 03:33:58 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/etc/etc.c (etc_nprocessors_affin): optimize memory usage a
+ bit. Typical rubyist never use 8k cpus machine.
+
+Wed Oct 22 00:01:09 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * configure.in (XCFLAGS): Add include path for NaCl libraries.
+ (XLDFLAGS): ditto.
+ (NACL_LIB_PATH): new substitution
+
+ * nacl/nacl-config.rb: support NACL_LIB_PATH
+
+ * nacl/package.rb: ditto.
+
+ * nacl/pepper_main.c: replace old implementations with nacl_io.
+
+ * nacl/GNUmakefile.in: link nacl_io to pepper_ruby
+
+ * ruby.c (rb_load_file): remove __attribute__((weak)) because the old
+ override hack was replaced with nacl_io.
+
+ * file.c (rb_file_load_ok): ditto.
+
+Tue Oct 21 17:32:32 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * common.mk: Adding explicit creation of directory
+ enc/unicode/data because git doesn't handle empty
+ directories. [patch by Masahiro Ide, filed with r48073]
+
+Tue Oct 21 17:12:12 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/tables.rb: Committing to make version
+ update easier and more predictable, and reducing compilation
+ time.
+
+Tue Oct 21 15:56:56 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/normalize.rb: Added comment to point to
+ relevant portion of Unicode standard for Hangul (de)composition
+ identifiers and algorithm.
+
+Tue Oct 21 11:49:16 2014 Andreas Schwab <schwab@suse.de>
+
+ * gc.c (mark_current_machine_context) [__mc68000__]: Update stack
+ marking.
+ (rb_gc_mark_machine_stack) [__mc68000__]: Also handle it here.
+
+Mon Oct 20 23:59:38 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * enc/prelude.rb: we sometimes run ruby without library path (especially
+ for test), so should permit to run ruby if unicode_normalize.rb is
+ missing.
+
+Mon Oct 20 23:57:58 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (lib/unicode_normalize/tables.rb): enable running (n)make
+ in non-srcdir.
+
+Mon Oct 20 23:58:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/downloader.rb: add -a option to always download regardless
+ existing files.
+
+Mon Oct 20 23:18:18 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb: no need to convert path separator for COPY because it's
+ ruby -run cp and it can treat '/' on any platform.
+
+Mon Oct 20 19:54:54 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * config.mk: Added missing data files as targets for
+ prerequisite update_unicode.
+
+Mon Oct 20 19:06:06 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: revert r48046. The s in sIndex
+ is not hungarian notation. The variable name sIndex is
+ directly taken from the relevant part of the Unicode
+ Standard, where it is written SIndex and stands for
+ 'syllable index'. See pp. 144/145 of
+ http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf.
+
+Mon Oct 20 12:46:46 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: removing unnecessary 'self'.
+
+Mon Oct 20 12:37:37 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: change method names
+ in commented-out code. Followup to r48027.
+
+Mon Oct 20 02:23:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_ivar_get), vm_insnhelper.c (vm_getivar): improve
+ instance variable retrieval performance by checking ruby_verbose
+ before call of rb_warning and evaluation of its argument.
+ [ruby-core:65786] [Feature #10396]
+
+Sun Oct 19 23:31:29 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * lib/unicode_normalize.rb: (unicode_normalize!): change method name.
+ catch up the method name change at r48014. [Feature #10084]
+
+Sun Oct 19 20:05:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/tk/lib/tkextlib/tile/treeview.rb: fix syntax error.
+
+Sun Oct 19 18:39:39 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * enc/prelude.rb: Added automatic loading of
+ lib/unicode_normalize.rb. This makes sure that all
+ the methods that are available on String are
+ available without explicit require.
+
+Sun Oct 19 18:35:35 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/normalize.rb: Added a missing
+ file extension in require statement.
+
+Sun Oct 19 18:13:13 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * common.mk: Added a rule to generate
+ lib/unicode_normalize/tables.rb. This rule still
+ needs to be integrated into the overall make process.
+
+Sun Oct 19 17:53:53 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: Changed to dynamic
+ loading of actual normalization code and tables.
+
+Sun Oct 19 17:37:37 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: Small documentation fix.
+
+Sun Oct 19 17:26:26 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: Added documentation.
+
+Sun Oct 19 11:09:09 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/unicode_norm_gen.rb, lib/unicode_normalize.rb:
+ File name change from lib/unicode_normalize/normalize_tables.rb
+ to lib/unicode_normalize/tables.rb.
+
+Sun Oct 19 10:12:12 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: Changing method names, see
+ https://bugs.ruby-lang.org/issues/10084#note-7
+
+Sun Oct 19 10:10:10 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: Changing module name.
+
+Sun Oct 19 10:08:08 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: Changing require statement,
+ adjusting copyright.
+
+Sun Oct 19 10:04:04 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize.rb: Importing from
+ https://github.com/duerst/eprun/blob/master/lib/string_normalize.rb.
+ (removing trailing whitespace, fixing EOLs and adding EOL property)
+
+Sun Oct 19 09:56:56 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/unicode_norm_gen.rb: Changed module name.
+
+Sun Oct 19 09:48:48 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/normalize.rb: Changed module name,
+ adjusted copyright.
+
+Sun Oct 19 09:38:38 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize/normalize.rb: Importing from
+ https://github.com/duerst/eprun/blob/master/lib/normalize.rb.
+
+Sat Oct 18 20:40:52 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm_core.h, proc.c, vm_backtrace.c, vm_trace.c:
+ remove rb_binding_new_with_cfp, and use rb_vm_make_binding instead.
+
+Sat Oct 18 20:38:48 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm_core.h, vm.c, proc.c: fix GC mark miss on bindings.
+ [ruby-dev:48616] [Bug #10368]
+
+ * test/ruby/test_eval.rb: add a test code.
+
+Fri Oct 17 22:47:11 2014 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (pack_unpack): Add casts for char references for 'u'.
+ Fix line ending recognition algorithm.
+
+Fri Oct 17 21:49:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (pack_unpack): Add casts for char references for 'b' and 'h'.
+
+Fri Oct 17 17:50:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * Avoid undefined behaviors found by gcc -fsanitize=undefined.
+ gcc (Debian 4.9.1-16) 4.9.1
+
+ * string.c (rb_str_sum): Avoid undefined behavior.
+
+Fri Oct 17 17:43:50 2014 Tanaka Akira <akr@fsij.org>
+
+ * Avoid undefined behaviors found by gcc -fsanitize=undefined.
+ gcc (Debian 4.9.1-16) 4.9.1
+
+ * include/ruby/ruby.h (INT2FIX): Avoid undefined behavior.
+
+ * node.h (nd_set_line): Ditto.
+
+ * pack.c (encodes): Ditto.
+ (pack_unpack): Ditto.
+
+ * regint.h (BIT_STATUS_AT): Ditto.
+ (BS_BIT): Ditto.
+
+ * time.c (time_mdump): Ditto.
+ (time_mload): Ditto.
+
+ * vm_core.h (VM_FRAME_MAGIC_MASK): Ditto.
+
+ * vm_trace.c (recalc_add_ruby_vm_event_flags): Ditto.
+
+Fri Oct 17 15:06:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (unescape_nonascii): make dynamically compiled US-ASCII
+ regexps ASCII-8BIT encoding if binary (hexadecimal, control,
+ meta) escapes are contained, as well as literal regexps.
+ [ruby-dev:48626] [Bug #10382]
+
+Fri Oct 17 03:05:08 2014 Eric Wong <e@80x24.org>
+
+ * test/-ext-/bug_reporter/test_bug_reporter.rb
+ (test_bug_reporter_add): revert r47972
+ * test/ruby/test_rubyoptions.rb (test_segv_test): revert r47971
+ [ruby-core:65764]
+
+Thu Oct 16 23:17:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (rb_sigaltstack_size): double default size to get rid
+ of heap corruption by alternate stack overflow in SEGV handler.
+ typically happened at fprintf() in control_frame_dump().
+
+Thu Oct 16 22:43:12 2014 Tanaka Akira <akr@fsij.org>
+
+ * vm_backtrace.c (id2str): Fix a variable name.
+ [ruby-dev:48642] [Bug #10389]
+
+Thu Oct 16 20:01:26 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/envutil.rb (assert_pattern_list): Show number of matched
+ patterns and characters.
+
+Thu Oct 16 16:26:09 2014 Eric Wong <e@80x24.org>
+
+ * cont.c (fiber_store): fix WIN32 fibers
+ [ruby-core:65745] [ruby-core:65758]
+
+Thu Oct 16 15:05:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_here_document): do not append already appended
+ and disposed code fragment. [ruby-dev:48647] [Bug #10392]
+
+Thu Oct 16 10:35:33 2014 Eric Wong <e@80x24.org>
+
+ * test/-ext-/bug_reporter/test_bug_reporter.rb
+ (test_bug_reporter_add): fix race
+
+Thu Oct 16 10:09:02 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_rubyoptions.rb (test_segv_test): fix race
+
+Thu Oct 16 09:17:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * cont.c (rb_fiber_t): fix compile error caused by move to
+ vm_core.h at r47964. [Feature #10341]
+
+Thu Oct 16 08:58:11 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ avoid killing wrong parent
+
+Thu Oct 16 08:40:04 2014 Eric Wong <e@80x24.org>
+
+ * cont.c (fiber_store): restore references to next_fib (fix typo)
+
+Thu Oct 16 08:26:08 2014 Eric Wong <e@80x24.org>
+
+ * cont.c (fiber_store): remove references to nextfib
+ fix build when FIBER_USE_NATIVE is 0
+
+Thu Oct 16 06:51:35 2014 Knut Franke <Knut.Franke@gmx.de>
+
+ * vm_core.h: declare rb_fiber_t typedef
+ (rb_thread_t): fiber and root_fiber become rb_fiber_t * (from VALUE)
+ * vm.c (rb_thread_mark): use rb_fiber_mark_self
+ * cont.c (rb_fiber_t): prev becomes rb_fiber_t * (from VALUE)
+ (cont_mark, cont_free): simplify conditions
+ (rb_fiber_mark_self): new function
+ (fiber_mark): use rb_fiber_mark_self
+ (cont_save_thread, cont_restore_thread): inline
+ (cont_restore_thread): simplify
+ (fiber_setcontext): simplify conditions
+ (rb_cont_call): remove dereference
+ (fiber_t_alloc): update for rb_fiber_t->prev type change
+ (rb_fiber_start): ditto
+ (fiber_current): extract from rb_fiber_current
+ (return_fiber): move, simplify type checks
+ (rb_fiber_current): use fiber_current
+ (fiber_store): simplify type checks
+ (fiber_switch): ditto, simplify call to fiber_setcontext,
+ use fiber_current
+ (rb_fiber_transfer): update for type changes
+ (rb_fiber_terminate): move, use fiber_switch
+ (rb_fiber_resume): update for type changes
+ (rb_fiber_reset_root_local_storage): ditto
+ (rb_fiber_yield): use rb_fiber_switch instead of rb_fiber_transfer
+ (rb_fiber_m_transfer): ditto
+ [ruby-core:65518] [Feature #10341]
+
+Thu Oct 16 06:25:29 2014 Knut Franke <Knut.Franke@gmx.de>
+
+ * cont.c (rb_context_t): comment on saved_thread
+ (cont_save_thread): sparse copy
+ (cont_init): copy extra fields
+ (fiber_init): use current thread VM stack size
+ [ruby-core:65518] [Feature #10341]
+
+Thu Oct 16 06:13:09 2014 Knut Franke <Knut.Franke@gmx.de>
+
+ * cont.c (cont_capture): remove unnecessary variable
+ [ruby-core:65518] [Feature #10341]
+
+Thu Oct 16 05:02:31 2014 Knut Franke <Knut.Franke@gmx.de>
+
+ * cont.c (fiber_store, fiber_switch): simplify
+ [ruby-core:65518] [Feature #10341]
+
+Thu Oct 16 04:28:41 2014 Knut Franke <Knut.Franke@gmx.de>
+
+ * cont.c (rb_fiber_t): remove prev_fiber/next_fiber
+ (fiber_link_join, fiber_link_remove): remove functions
+ (fiber_free, fiber_init, root_fiber_alloc):
+ remove references to removed fields and functions
+ [ruby-core:65518] [Feature #10341]
+
+Wed Oct 15 22:08:37 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.
+ CentOS 5 don't have CPU_ALLOC().
+
+Wed Oct 15 18:26:19 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinity
+ for getting precious number of available cpus.
+
+ * ext/etc/etc.c (etc_nprocessors): use etc_nprocessors_affinity if
+ possible.
+
+ [Feature #10267] etc-nprocessors-kosaki2.patch
+
+Wed Oct 15 17:53:28 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/envutil.rb (assert_pattern_list) Renamed from
+ assert_regexp_list.
+ Show multiline string in multi lines.
+
+ * test/-ext-/bug_reporter/test_bug_reporter.rb: Use
+ assert_pattern_list.
+
+Wed Oct 15 12:26:58 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/envutil.rb (assert_regexp_list): New assertion method.
+
+ * test/ruby/test_rubyoptions.rb: Use assert_regexp_list.
+
+Wed Oct 15 07:21:09 2014 Tanaka Akira <akr@fsij.org>
+
+ * enum.c: min(n) drops elements bigger than the n-th maximum element.
+ (struct nmin_data): New field to record the n-th maximum element, limit
+ (nmin_filter): Update limit field.
+ (nmin_i): Drop too big elements.
+ (nmin_run): Initialize limit field.
+
+Wed Oct 15 07:00:14 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_optimization.rb (test_string_size): new test
+
+Wed Oct 15 06:51:13 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_optimization.rb (test_string_eq_neq): new test
+ (test_string_ltlt): ditto
+
+Wed Oct 15 06:50:29 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_optimization.rb (test_hash_aset_with):
+ assert assignment
+
+Wed Oct 15 04:56:27 2014 Zachary Scott <e@zzak.io>
+
+ * gc.c (rb_obj_id): [DOC] Fix typo, clean up sentence, and wrap cols
+
+Wed Oct 15 04:53:30 2014 Zachary Scott <e@zzak.io>
+
+ * error.c: [DOC] Fix case of type in exception message by @tricknotes
+ [Fixes GH-740] https://github.com/ruby/ruby/pull/740
+
+ * object.c: ditto
+
+Tue Oct 14 21:39:16 2014 Vit Ondruch <vondruch@redhat.com>
+
+ * tool/rbinstall.rb (gem): Fix permissions of bundled gems
+ specification files. [ruby-core:65700] [Bug #10383]
+
+Tue Oct 14 19:15:31 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_record.c: use typed data.
+
+Tue Oct 14 16:23:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * symbol.c (global_symbols): make ids two-dimensional array of
+ strings and symbols, for write-barrier.
+
+ * symbol.c (global_symbols): make IDs immortal always, instead
+ of treating dynamic symbols as IDs.
+
+ * iseq.c, marshal.c, string.c: use rb_str_intern instead of
+ rb_str_dynamic_intern.
+
+ * symbol.c (rb_str_intern): rename rb_str_dynamic_intern.
+
+Tue Oct 14 10:19:10 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_optimization.rb (test_string_freeze): new test
+ (test_hash_aref_with): ditto
+ (test_hash_aset_with): ditto
+
+Tue Oct 14 01:27:54 2014 Tanaka Akira <akr@fsij.org>
+
+ * enum.c (nmin_run): max(n) and max_by(n) returns an array in
+ descending order.
+ [ruby-core:65452] Suggested by David Grayson.
+
+Mon Oct 13 20:44:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (update-gems): chdir to the target directory and then
+ add the tool directory to load paths, for older BASERUBY.
+ [Bug #10372][ruby-core:65630]
+
+Mon Oct 13 17:53:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/xmlrpc/parser.rb: added new parser class using libxml-ruby gem.
+ [Feature #9379][ruby-core:59633]
+ * lib/xmlrpc/config.rb: ditto.
+
+Mon Oct 13 16:32:56 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/find.rb (Find.find): Call to_path for arguments to obtain
+ strings.
+ [ruby-core:63713] [Bug #10035] Reported by Herwin.
+
+Mon Oct 13 15:42:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * common.mk: use relative load path for bundled_gems directory.
+ [Bug #10372][ruby-core:65630]
+
+Mon Oct 13 08:44:06 2014 Zachary Scott <e@zzak.io>
+
+ * README.EXT: [DOC] fix example missing typedef with patch by
+ @steveklabnik [Fixes GH-739] https://github.com/ruby/ruby/pull/739
+
+ * README.EXT.ja: ditto.
+
+Mon Oct 13 06:52:09 2014 Eric Wong <e@80x24.org>
+
+ * array.c (ary_recycle_hash): add RB_GC_GUARD
+ (rb_ary_diff): remove volatile
+ [Bug #10369]
+
+Mon Oct 13 03:20:23 2014 Zachary Scott <e@zzak.io>
+
+ * ext/date/date_core.c: [DOC] Clean up whitespace, examples, and typos
+ in date_core based on a patch by @vipulnsward [Fixes GH-724]
+ https://github.com/ruby/ruby/pull/724
+
+Mon Oct 13 02:39:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (remove_duplicate_keys): should not simply eliminate all
+ value nodes, which may have side effects.
+ [ruby-core:65625] [Bug #10315]
+
+Sun Oct 12 10:39:16 2014 Zachary Scott <e@zzak.io>
+
+ * vm.c: [DOC] fix typo by @yui-knk [Fixes GH-738]
+ https://github.com/ruby/ruby/pull/738
+
+Sun Oct 12 09:24:15 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/test/unit.rb: Hide skips by default.
+
+Sun Oct 12 01:37:11 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * file.c: include sys/time.h only if HAVE_SYS_TIME_H
+
+Sat Oct 11 22:29:40 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * file.c (HAVE_UTIMENSAT): disabled for NativeClient.
+ Fixes build error.
+
+Sat Oct 11 22:11:58 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * ext/extmk.rb: generates the rule for extinit.$(OBJEXT).
+ extinit.$(OBJEXT) used to be generated by the builtin rule, thus
+ didn't accept custom $(CC) and caused linkage error for cross
+ compiling.
+
+Sat Oct 11 18:46:50 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * include/ruby/intern.h (rb_fd_select): declare struct timeval, or the
+ struct gets local to the function in C99.
+
+ * file.c (#include): add nacl/stat.h for PNaCl.
+ (utimes): added a declaration for PNaCl.
+ (stat_atimespec): stat::st_atimensec is long long but
+ timespec::tv_nsec is long in PNaCl.
+ (stat_mtimespec, stat_ctimespec): ditto.
+ (rb_group_member): disable getgroups unless HAVE_GETGROUPS.
+ (eaccess): unify the fallback to generic defined(USE_GETEUID).
+
+ * io.c: include sys/time.h for struct timeval.
+ (rb_close_before_exec): nothing we can do if F_GETFD is not
+ available.
+ (ioctl): pnacl newlib actually doesn't have ioctl.
+
+ * process.c (maxgroups): it is used iff
+ defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX) but not
+ defined(HAVE_GETGROUPS) || defined(HAVE_SETGROUPS).
+ (obj2gid): fail unless the object is a Fixnum if getgrnam is not
+ available.
+ (disable_child_handler_fork_child): sigaction is not available in
+ PNaCl newlib.
+
+ * configure.in (warnflags, strict_warnflags): avoid -ansi for strlcpy.
+ (rb_cv_gcc_atomic_builtins): also check
+ __atomic_or_etch because it is used in ruby_atomic.h.
+ (rb_cv_gcc_sync_builtins): ditto.
+ (HAVE_GETGRNAM): added.
+
+Sat Oct 11 15:32:08 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (iseq_build_from_ary_exception): move RB_GC_GUARD
+ (iseq_build_from_ary_body): use PRIsVALUE instead of RB_GC_GUARD
+
+Sat Oct 11 14:57:08 2014 Eric Wong <e@80x24.org>
+
+ * string.c (rb_str_intern): remove unnecessary RB_GC_GUARD
+
+Sat Oct 11 13:47:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (remove_duplicate_keys): remove duplicate literal keys,
+ i.e., symbols and strings. [ruby-core:65368] [Bug #10315]
+
+ * vm.c (kwmerge_i): override existing keys by new keys.
+ [ruby-core:65368] [Bug #10315]
+
+ * parse.y (assocs): concatenate splatted literal hashes. the
+ former key has precedence even if duplicated literal keys
+ follow. [ruby-core:65368] [Bug #10315]
+
+Sat Oct 11 12:27:03 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * configure.in (RUBY_NACL): automatically locate pnacl-clang.
+ (RUBY_PLATFORM): pnacl instead of le32-nacl.
+
+Sat Oct 11 11:27:14 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * io.c: fix issues in the last two commits. don't disable cloexec for
+ platforms other than NativeClient.
+
+ * ChangeLog: ditto. add entries for the last two commits.
+
+Sat Oct 11 11:12:00 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * signal.c (install_signalhandler, init_sigchld): allow failure because it
+ always fails with ENOSYS on NaCl.
+
+Sat Oct 11 11:11:53 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * configure.in (RUBY_NACL and others): merge patch from naclports. Supports PNaCl.
+
+ * dln.c: ditto. replace the old hacky dynamic loading over HTTP with nacl_io.
+
+ * file.c: ditto. tentatively use access(2) instead of eaccess.
+ (rb_file_load_ok): weaken with attribute but not by postprocess.
+
+ * io.c: ditto.
+ (socket.h): now NaCl has socket.h
+ (flock): disable here instead of nacl/ioctl.h
+
+ * nacl/GNUmakefile.in: ditto.
+ (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY):
+ respect path to them if they are absolute.
+ This helps naclports to build ruby in their source tree.
+ (PROGRAM_NMF, .SUFFIXES): support .pnexe for PNaCl.
+ (ruby.o, file.o): move the hack to attributes in ruby.c and file.c
+
+ * nacl/ioctl.h: ditto. removed. move the hack to io.c.
+
+ * nacl/nacl-config.rb: ditto. support arm, pnacl and others.
+
+ * nacl/pepper_main.c: ditto. support build in a naclports tree.
+
+ * ruby.c (rb_load_file): ditto. weaken with attribute but not by postprocess.
+
+Sat Oct 11 09:32:00 2014 Zachary Scott <e@zzak.io>
+
+ * ext/socket/unixsocket.c: [DOC] Fix example to render in HTML
+ properly, with a patch by @eval [Fixes GH-733]
+ https://github.com/ruby/ruby/pull/733
+
+Sat Oct 11 04:14:41 2014 Kir Shatrov <shatrov@me.com>
+
+ * lib/open-uri.rb (OpenURI::Options): add :open_timeout default
+ * (def OpenURI.open_http): check :open_timeout option
+ * (module OpenURI): rdoc for :open_timeout
+ * test/open-uri/test_open-uri.rb (test_open_timeout): new test
+ [Feature #10361]
+
+Fri Oct 10 11:27:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags):
+ deprecate old macros for compatibility for ruby 1.8 and older.
+
+Thu Oct 9 23:31:47 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * bignum.c (absint_numwords_generic): set an array element after
+ definition of a variable to fix compile error with older version
+ of fcc (Fujitsu C Compiler) 5.6 on Solaris 10 on Sparc.
+ [Bug #10350] [ruby-dev:48608]
+
+Thu Oct 9 16:15:26 2014 Eric Wong <e@80x24.org>
+
+ * ext/-test-/st/foreach/extconf.rb: new file
+ * ext/-test-/st/foreach/foreach.c: ditto
+ * test/-ext-/st/test_foreach.rb: ditto
+ [Feature #10321]
+
+Thu Oct 9 12:40:28 2014 Eric Wong <e@80x24.org>
+
+ * benchmark/bm_hash_aref_sym*.rb: force static symbols
+
+Thu Oct 9 12:38:28 2014 Eric Wong <e@80x24.org>
+
+ * hash.c (rb_any_hash): remove unnecessary dsym check
+
+Thu Oct 9 07:20:30 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * missing/setproctitle.c: Avoid invalidating argv[1], argv[2],
+ etc. until the first call to Process.setproctitle, because
+ the ps command of AIX refers to the argv array.
+ [Bug #10090]
+
+Thu Oct 9 00:53:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_s_aref): fix rdoc. `Dir.glob` allows an array but
+ `Dir[]` not. the former accepts an optional parameter `flags`,
+ while the latter accepts arbitrary number of arguments but no
+ `flags`. [ruby-core:65265] [Bug #10294]
+
+Wed Oct 8 21:44:10 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_variable.c: use typed data.
+
+Wed Oct 8 16:36:47 2014 gogo tanaka <mail@tanakakazuki.com>
+
+ * test/ruby/test_syntax.rb: added syntax tests of underscore
+ arguments. [Feature #10340][ruby-core:65496]
+
+Wed Oct 8 07:42:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI#inspect): remove Object id.
+ URI is considered that it doesn't require id.
+
+Wed Oct 8 05:22:42 2014 Eric Wong <e@80x24.org>
+
+ * ext/etc/etc.c (etc_systmpdir): set default tmplen correctly
+ Fixup r47826
+
+Wed Oct 8 05:16:32 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add @- and @+ for Matrix and Vector.
+ patch by gogo tanaka [#10068] [#10069]
+
+Wed Oct 8 04:58:48 2014 John Bachir <j@jjb.cc>
+
+ * bootstraptest/test_io.rb (assert_finish):
+ normalize rescue for Timeout::Error
+ * lib/net/ftp.rb (Net#read_timeout): ditto for doc
+ * lib/resolv.rb (Resolv::ResolvTimeout): ditto for subclass
+ * lib/webrick/httprequest.rb (_read_data): ditto for rescue
+ * sample/timeout.rb (p timeout): ditto for call
+ * test/drb/drbtest.rb (test_06_timeout): ditto
+ * test/ruby/test_readpartial.rb (test_open_pipe): ditto
+ * test/thread/test_queue.rb (test_queue_thread_raise): ditto
+ * thread.c (rb_thread_s_handle_interrupt): ditto for doc
+ [ruby-core:65481] [misc #10339]
+
+Wed Oct 8 04:38:29 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * test/ruby/test_process.rb (TestProcess#test_setsid): AIX
+ does not allow Process::getsid(pid) when pid is in a
+ different session.
+
+Wed Oct 8 04:33:04 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_encoding):
+ On AIX, locale_charmap is ISO-8859-1 with LANG=C. This means
+ the source encoding of stdin is ISO-8859-1, so "invalid
+ multibyte char" error does not occur.
+
+Wed Oct 8 04:30:29 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Matrix#laplace_expansion.
+ patch by gogo tanaka [#10073]
+
+Wed Oct 8 04:29:21 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Vector.basis.
+ Based on patch by gogo tanaka [#10072]
+
+Tue Oct 7 23:40:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (rb_f_kill): get rid of deadlock as unhandled and
+ discarded signals do not make interrupt_cond signaled.
+ based on the patch by Kazuki Tsujimoto at [ruby-dev:48606].
+ [Bug #9820]
+
+Tue Oct 7 22:43:44 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_method.c: use typed data.
+
+Tue Oct 7 21:47:05 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_param.c: refactoring.
+
+Tue Oct 7 21:40:17 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_method.c: refactoring. add
+ olemethod_data_get_struct to wrap Data_Get_Struct.
+ * ext/win32ole/win32ole_method.h: ditto.
+
+ * ext/win32ole/win32ole_param.c (oleparam_ole_param):
+ call olemethod_data_get_struct instead of Data_Get_Struct.
+
+Tue Oct 7 11:17:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/etc/etc.c (etc_systmpdir): try user temporary directory by
+ confstr() on Mac OS X.
+ c.f. http://www.opensource.apple.com/source/ruby/ruby-104/patches/ext_etc_etc.c.diff
+
+Tue Oct 7 10:48:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (struct stat.st_size): prefer off_t over int, long,
+ and so on. inspired by
+ http://www.opensource.apple.com/source/ruby/ruby-104/patches/config.h.ed
+
+Tue Oct 7 10:37:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_UNIVERSAL_ARCH): fix missing quoting
+ brackets. incorporated from
+ http://www.opensource.apple.com/source/ruby/ruby-104/patches/configure.diff
+
+Mon Oct 6 23:34:42 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_param.c: use typed data.
+
+Mon Oct 6 22:37:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * symbol.h (struct RSymbol): move from internal.h.
+
+Mon Oct 6 21:43:03 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * error.c: update exception tree. [DOC]
+ reported by @hemge via twitter.
+
+Mon Oct 6 18:43:03 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * configure.in: Fix typo. [Bug #9914]
+
+Mon Oct 6 16:23:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (rb_f_kill): should not ignore signal unless the
+ default handler is registered. [ruby-dev:48592] [Bug #9820]
+
+Mon Oct 6 16:07:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_string.rb (test_LSHIFT_neary_long_max): enable
+ only on platforms where string size range is smaller than memory
+ space. this test does not make sense but just wastes memory and
+ time on other platforms, as it is hardly possible that a string
+ size becomes neary LONG_MAX if long size equals pointer size.
+ [ruby-core:65410] [Bug #10325]
+
+Mon Oct 6 11:21:21 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/unicode_norm_gen.rb: Adding/tweaking comments.
+
+Mon Oct 6 10:57:57 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/unicode_norm_gen.rb: Adjusted directory paths.
+
+Mon Oct 6 10:27:27 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/unicode_norm_gen.rb: Data generation script imported from
+ https://github.com/duerst/eprun/blob/master/lib/generate.rb
+
+Mon Oct 6 10:15:15 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: Adjust example in documentation for
+ Downloader.download.
+
+Mon Oct 6 10:07:07 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * lib/unicode_normalize: New folder for Unicode normalization
+ functionality
+
+Sun Oct 5 11:04:13 2014 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+
+ * ext/digest/{md5,rmd160,sha1,sha2}/extconf.rb: configure OpenSSL
+ only if bundled libraries is not used, so that OpenSSL is not
+ linked unnecessarily. [ruby-core:65404] [Bug #10324]
+
+Sun Oct 5 10:39:11 2014 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+
+ * ext/digest/rmd160/extconf.rb: fix transform function name to
+ check. [ruby-core:65091] [Bug #10252]
+
+Sun Oct 5 05:46:00 2014 Eric Wong <e@80x24.org>
+
+ * ext/zlib/zlib.c (zstream_mark, zstream_free): update signature
+ (gzfile_mark, gzfile_free): ditto
+ (zstream_memsize): new function for rb_data_type->dsize
+ (gzfile_memsize): ditto
+ (zstream_data_type, gzfile_data_type): new data types
+ (zstream_new): Data_Make_Struct => TypedData_Make_Struct
+ (gzfile_new): ditto
+ (get_zstream, get_gzfile): Data_Get_Struct => TypedData_Get_Struct
+ (rb_zstream_flush_next_in): ditto
+ (rb_zstream_flush_next_out): ditto
+ (rb_zstream_avail_out): ditto
+ (rb_zstream_avail_in): ditto
+ (rb_zstream_closed_p): ditto
+ (rb_deflate_initialize): ditto
+ (rb_deflate_init_copy): ditto
+ (rb_inflate_initialize): ditto
+ (gzfile_ensure_close): ditto
+ (rb_gzfile_closed_p): ditto
+ (rb_gzfile_path): ditto
+ (rb_gzwriter_initialize): ditto
+ (rb_gzreader_initialize): ditto
+ (rb_gzreader_unused): ditto
+ [ruby-core:65377] [Feature #10319]
+
+Sat Oct 4 16:24:41 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * test/test_syslog.rb (TestSyslog#test_log): In AIX, each output
+ line of LOG_PERROR to stderr has an additional empty line appended,
+ so skip that line.
+
+Sat Oct 4 16:05:49 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * test/socket/test_unix.rb (TestSocket_UNIXSocket#test_too_long_path):
+ sockaddr_un.sun_path in AIX is defined as char[1024],
+ so "a" * 300 is not too long. "a" * 3000 would be enough.
+
+Sat Oct 4 09:12:03 2014 Zachary Scott <e@zzak.io>
+
+ * ext/win32ole/sample/example*.rb: Add wait input to quit for examples
+ with patch provided by @windwiny [Fixes GH-705]
+ https://github.com/ruby/ruby/pull/705
+
+Sat Oct 4 09:08:18 2014 Zachary Scott <e@zzak.io>
+
+ * ext/win32ole/win32ole.c: [DOC] Fix typo in :nodoc: reported by
+ @windwiny to [Fix GH-705] https://github.com/ruby/ruby/pull/705
+
+ * ext/pty/pty.c: ditto
+
+Sat Oct 4 08:59:45 2014 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_rand.c: [DOC] Add call signature for pseudo_bytes
+ and random_bytes, wrap lines at 80 chars, and remove useless
+ comments.
+
+Sat Oct 4 08:49:34 2014 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_rand.c: [DOC] Add rdoc for method descriptions
+ By @vipulnsward [Fixes GH-657] https://github.com/ruby/ruby/pull/657
+
+Sat Oct 4 08:23:48 2014 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_rand.c: Use rb_define_module_function instead of
+ macro. [Fixes GH-686] https://github.com/ruby/ruby/pull/686
+
+Sat Oct 4 06:04:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_method.c(olemethod_set_member): remove
+ redundant NULL check.
+ * ext/win32ole/win32ole_type.c(oletype_set_member): ditto.
+
+Sat Oct 4 00:25:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: removed needless preparation for gcc.
+
+Fri Oct 3 23:41:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: enabled gcc build with osx on travis.
+
+Fri Oct 3 23:22:23 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * template/fake.rb.in: fix make install failure due to MSYS path
+ with mingw on MSYS environment.
+ [ruby-core:64965] [Bug #10230]
+
+Fri Oct 3 21:02:32 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_io.rb (TestIO#test_advise): avoid to infinite loop.
+
+Fri Oct 3 19:26:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: enabled test results of linux.
+
+Fri Oct 3 18:52:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_io.rb (TestIO#test_advise): added workaround of fadvise(2)
+ with tmpfs and old linux kernel. [ruby-core:65355][Bug #10313]
+
+Fri Oct 3 18:22:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: Disabled to generate document on travis.
+ Reduce test running time.
+
+Fri Oct 3 12:42:15 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add hstack & vstack methods.
+ Based on a patch by creasywuqiong. [Fix GH-344]
+
+Fri Oct 3 12:37:48 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Fix Matrix.rows copy bug.
+ Patch by Arron Mabrey. [Fix GH-707]
+
+Fri Oct 3 06:06:28 2014 Eric Wong <e@80x24.org>
+
+ * st.c (next_pow2): new function (from old bignum.c)
+ (new_size): use next_pow2 function
+
+Fri Oct 3 05:58:58 2014 Eric Wong <e@80x24.org>
+
+ * vm_trace.c (rb_tp_t): pack 56 => 48 bytes on 64-bit
+
+Thu Oct 2 18:41:45 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/etc/etc.c (etc_nprocessors): Windows support.
+ see [Feature #10267]
+
+Thu Oct 2 12:21:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/etc/etc.c (etc_nprocessors): New method.
+ Accepted by matz at RubyKaigi 2014.
+ [ruby-core:65142] [Feature #10267]
+
+Thu Oct 2 07:56:49 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (rb_iseq_line_trace_each): explicit cast
+ Fix https://travis-ci.org/ruby/ruby/jobs/36814282
+
+Thu Oct 2 05:40:05 2014 Eric Wong <e@80x24.org>
+
+ * ruby.h: set rb_event_flag_t to uint32_t
+ [ruby-core:65315] [misc #10249]
+
+Thu Oct 2 05:32:17 2014 Eric Wong <e@80x24.org>
+
+ * io.c (fptr_finalize): free memory before GC sweep
+ [ruby-core:65269] [Feature #10295]
+
+Thu Oct 2 05:27:24 2014 Eric Wong <e@80x24.org>
+
+ * marshal.c (w_class): check dump_arg->compat_tbl before lookup
+ (w_object): lazy init ->compat_tbl before insert
+ (obj_alloc_by_class): ditto
+ (clear_dump_arg): free only non-NULL ->compat_tbl
+ (clear_load_arg): ditto for ->compat_tbl
+ (marshal_dump): ->compat_tbl defaults to zero
+ (marshal_load): ditto for ->compat_tbl
+ (r_entry0): check l->compat_tbl before lookup
+ (r_fixup_compat): ditto
+ [ruby-core:65305] [Feature #10302]
+
+Wed Oct 1 21:14:34 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_type.c: use typed data.
+
+Wed Oct 1 18:15:42 2014 Nolan Evans <nolane@gmail.com>
+
+ * compile.c: remove commented out code.
+
+Wed Oct 1 17:38:53 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * test/fileutils/test_fileutils.rb: AIX does not allow
+ a sticky bit on a regular file.
+
+Wed Oct 1 17:31:41 2014 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS: Add RubyGems update.
+
+Wed Oct 1 17:28:58 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.4.2.
+ * test/rubygems: ditto.
+
+Tue Sep 30 22:25:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_data_type): separate ripper data type for from
+ parser.
+
+Tue Sep 30 18:46:31 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_typelib.c: use typed data.
+
+Tue Sep 30 09:51:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * common.mk: fixed broken reference of update-config_files task
+
+Mon Sep 29 22:54:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/file.c (append_wstr): set expanded length, not length of
+ appended string. fix "probable buffer overflow" bug.
+ [ruby-core:65317] [Bug #10304]
+
+ * string.c (str_make_independent_expand): drop NOFREE flag after
+ reallocation, static buffer is not pointed anymore.
+ [ruby-core:65317] [Bug #10304]
+
+Sun Sep 28 23:59:17 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * gc.c (rb_gcdebug_print_obj_condition): use RVALUE_REMEMBERED
+ because GET_HEAP_REMEMBERSET_BITS is obsoleted.
+
+Sun Sep 28 11:14:14 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * common.mk: Created new target update-unicode to download
+ some Unicode data files.
+
+Fri Sep 26 15:03:19 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/uri/rfc3986_parser.rb: raise URI::InvalidURIError when
+ uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150]
+
+ * test/uri/test_parser.rb: test for above.
+
+Sat Sep 27 10:31:48 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * gems/bundled_gems: upgraded to power_assert 0.1.4.
+
+Fri Sep 26 12:52:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_write): ASCII-8BIT StringIO
+ should be writable any encoding strings, without conversion.
+ [ruby-core:65240] [Bug #10285]
+
+Fri Sep 26 05:21:01 2014 Eric Wong <e@80x24.org>
+
+ * object.c (rb_class_real): do not dereference 0 VALUE
+
+ * test/ruby/test_module.rb (test_inspect_segfault):
+ Test case and bug report by Thomas Stratmann.
+ [ruby-core:65214] [Bug #10282]
+
+Fri Sep 26 05:12:10 2014 Eric Wong <e@80x24.org>
+
+ * man/ruby.1: document stack size env variables
+ [Feature #10197]
+
+Thu Sep 25 19:37:34 2014 Eric Wong <e@80x24.org>
+
+ * io.c (free_io_buffer): new function for a common pattern
+ (clear_readconv): use free_io_buffer
+ (rb_io_fptr_finalize): ditto
+
+Thu Sep 25 07:51:07 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/matrix.rb: Fix docs. Patched by Ben Woodall. [GH-726]
+
+Wed Sep 24 19:04:04 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * enc/unicode/data: New directory for downloaded Unicode
+ data files.
+
+Wed Sep 24 18:59:59 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: Adjusting example for
+ Downloader.download to implementation changes in r47693.
+
+Wed Sep 24 18:06:06 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: Removing unused method
+ Downloader.download_if_modified_since.
+ (if ever used, just replace with Downloader.download)
+
+Wed Sep 24 17:59:59 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: Fixing raise after return.
+
+Wed Sep 24 17:55:55 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: Made Unicode data file location available
+ via :unicode Symbol.
+
+Wed Sep 24 10:45:45 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: Small fix to documentation comment.
+
+Tue Sep 23 22:00:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parse_ident): just after a label, new expression should
+ start, cannot be a modifier. [ruby-core:65211] [Bug #10279]
+
+Tue Sep 23 16:07:07 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * tool/downloader.rb: added Downloader.download_if_modified_since
+ to reduce downloads of large files that change only rarely.
+ [ruby-core:65164] [CommonRuby - Feature #10084]
+
+Tue Sep 23 11:55:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: added rubyspec into travis tasks and eliminate to stdout.
+
+Mon Sep 22 20:00:29 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_time2date_with_msec): test by using only
+ assert_in_delta to avoid to fail when converting Time object with
+ 999999999 nanoseconds into VT_DATE Variant.
+
+Mon Sep 22 19:49:12 2014 Zachary Scott <e@zzak.io>
+
+ * doc/syntax/methods.rdoc: [DOC] [] and []= methods by @process
+ [Fixes GH-662] https://github.com/ruby/ruby/pull/662
+
+Mon Sep 22 18:21:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: Only osx build is enabled. linux builds is random failure
+ and test results of major linux is covered by rubyci.
+
+Mon Sep 22 12:10:29 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_time_tz.rb: Fix test error with tzdata-2014g.
+ [ruby-core:65058] [Bug #10245] Reported by Vit Ondruch.
+
+Mon Sep 22 09:28:43 2014 Eric Wong <e@80x24.org>
+
+ * ext/socket/ancdata.c ({send,recv}msg_args_struct): 24 => 16 bytes
+ * ext/socket/init.c (connect_arg): ditto
+ * ext/socket/raddrinfo.c (getnameinfo_arg): 56 => 48 bytes
+ (reductions only for 64-bit systems)
+
+Mon Sep 22 02:04:25 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/drb/drb.rb: Support graceful shutdown.
+ (DRbTCPSocket#initialize): Create a pipe for shutdown notification.
+ (DRbTCPSocket#close): Invoke close_shutdown_pipe.
+ (DRbTCPSocket#close_shutdown_pipe): New private method.
+ (DRbTCPSocket#accept): Use accept_or_shutdown.
+ (DRbTCPSocket#accept_or_shutdown): New private method which returns
+ nil on shutdown.
+ (DRbServer#stop_service): Use shutdown instead of Thread#kill.
+ (DRbServer#run): Break infinite loop when main_loop returns nil.
+ (DRbServer#main_loop): @protocol.accept may return nil.
+
+ * lib/drb/ssl.rb: Follow above change.
+
+ * lib/drb/unix.rb: Ditto.
+
+Sun Sep 21 13:54:36 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * time.c: raise exception when minutes of utc_offset is out of 00-59.
+ patch is from Kenichi Kamiya.
+ [ruby-dev:47539] [Bug #8679]
+
+ * test/ruby/test_time.rb: test for above.
+ patch is from Kenichi Kamiya.
+
+Sun Sep 21 19:04:08 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * st.c (do_hash_bin): unused macro.
+
+Sun Sep 21 18:45:01 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * parse.y (parser_class_nest): unused variable after YARV
+ merged (r11439).
+
+Sun Sep 21 18:14:03 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * st.c (numberof): unused. internal.h has same macro.
+
+ * node.c (F_CUSTOM2): unused.
+
+Sun Sep 21 14:11:23 2014 Tanaka Akira <akr@fsij.org>
+
+ * thread_pthread.c (native_set_thread_name): New function to
+ set thread name visible with ps command on GNU/Linux.
+ Ex. ps -o %c -L
+
+ * thread.c (thread_start_func_2): Call native_set_thread_name at
+ beginning.
+ (rb_thread_inspect_msg): Extract from rb_thread_inspect.
+
+Sun Sep 21 12:49:11 2014 Eric Wong <e@80x24.org>
+
+ * iseq.c (rb_iseq_defined_string): trim redundant semi-colon
+
+Sun Sep 21 12:19:29 2014 Eric Wong <e@80x24.org>
+
+ * file.c (rb_find_file_ext_safe): clear tmp buffer on failure
+ (rb_find_file_safe): ditto
+
+Sat Sep 20 04:42:18 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/csv.rb: avoid unnecessary object allocations.
+ patch is from Andrew Vit. [ruby-core:63215] [Feature #9952]
+
+Sun Sep 21 12:10:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rexml/**/*.rb: removed commented-out code.
+
+Sat Sep 20 03:46:58 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c: use rb_equal_opt() for performance improvement.
+ [ruby-core:64954] [Feature #10227]
+
+Sun Sep 21 11:16:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (rbtime2vtdate, vtdate2rbtime): fix
+ the bug in conversion of milliseconds. [Bug #10258]
+
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_dbl2date_with_msec,
+ test_conversion_time2date_with_msec): use assert_in_delta instead
+ of assert_equal to treat an acceptable error range.
+
+Sun Sep 21 11:03:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (ruby_signal): although "EINVAL from sigaction(2) is
+ not a bug", but even it is a failure. pointed at toRuby/guRuby
+ in RubyHiroba.
+
+Sat Sep 20 03:00:26 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/tempfile.rb: define parameters appropriately and some
+ refactoring.
+
+ * lib/tmpdir.rb: ditto.
+
+Sat Sep 20 23:58:21 2014 Tanaka Akira <akr@fsij.org>
+
+ * enum.c (enum_chunk): Deprecate the state management.
+ (enum_slice_before): Ditto.
+
+Sat Sep 20 15:39:11 2014 Tanaka Akira <akr@fsij.org>
+
+ * enum.c (enum_slice_when): New method: Enumerable#slice_when.
+ (slicewhen_i): New function.
+ (slicewhen_ii): New function.
+
+ * enumerator.c (InitVM_Enumerator): New method:
+ Enumerator::Lazy#slice_when.
+
+ [ruby-core:62499] [Feature #9826]
+
+Sat Sep 20 11:55:19 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: added new configurations for osx on travis ci.
+ [fix GH-723]
+ * test/ruby/test_object.rb: tweaked to memory leak limit for osx build.
+
+Sat Sep 20 10:48:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (assoc): allow quoted ID as a key of a hash literal.
+ [ruby-core:34453] [Feature #4276]
+
+Sat Sep 20 10:23:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_set_arguments): store local variable IDs in
+ temporary list as Symbols. previously these are stored as
+ Fixnums to prevent from GC, but IDs of dynamic symbols can
+ exceed Fixnum range and cause RangeError at inverting from
+ Fixnum. [ruby-dev:48564] [Bug #10266]
+
+Sat Sep 20 10:02:51 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#pretty_print):
+ New method.
+ (OpenSSL::X509::Certificate#pretty_print): Ditto.
+
+ * ext/openssl/lib/openssl/bn.rb (OpenSSL::BN#pretty_print): Ditto.
+
+Sat Sep 20 07:55:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (eval_string_with_cref): fix super from eval with
+ scope. set klass in the current control frame to the class of
+ the receiver in the context to be evaluated, this class/module
+ must match the actual receiver to call super.
+ [ruby-core:65122] [Bug #10263]
+
+Fri Sep 19 20:06:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * symbol.c (rb_str_dynamic_intern): check if the stem ID of
+ attrset ID is already registered as a static ID.
+ [ruby-dev:48559] [Bug #10259]
+
+Fri Sep 19 15:48:09 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (VCSUP): nothing to do if this worktree is not
+ under any VCS (it means that the worktree may be from the release
+ package).
+
+Fri Sep 19 10:47:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_math.rb (TestMath#assert_infinity): Float#finite?
+ returns true also for NaN, so use Float#infinite? instead.
+ [ruby-core:65117] [Feature #10261]
+
+Fri Sep 19 05:36:16 2014 Eric Wong <e@80x24.org>
+
+ * NEWS: note --with-jemalloc option [ci skip]
+
+Thu Sep 18 16:26:27 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_commands_setup_command.rb: @ui uses StringIO
+ as its streams, and Encoding.default_external does not effect to
+ StringIOs already exist. so, we need to set external_encoding of
+ @ui.outs directly. this problem (test failure) does not appear in
+ the environments default_external is us-ascii or utf-8.
+
+Thu Sep 18 15:02:15 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_specification.rb: '/' is not always the root.
+
+Thu Sep 18 09:36:37 2014 Scott Francis <scott.francis@shopify.com>
+
+ * vm_method.c (Init_Method): make global method cache size
+ configurable by environment variable
+ "RUBY_GLOBAL_METHOD_CACHE_SIZE" [Fix GH-719]
+
+Thu Sep 18 07:03:36 2014 Eric Wong <e@80x24.org>
+
+ * test/-ext-/string/test_modify_expand.rb: increase limit
+ for {je,tc}malloc [Bug #10236]
+
+Thu Sep 18 06:41:18 2014 Eric Wong <e@80x24.org>
+
+ * ext/zlib/zlib.c (struct gzfile): pack (288 => 272 bytes) on 64-bit
+
+Thu Sep 18 05:44:05 2014 Eric Wong <e@80x24.org>
+
+ * ext/socket/init.c (rsock_connect): refactor for blocking
+ (wait_connectable): clear error before wait
+ [Bug #9356]
+
+Wed Sep 17 23:12:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/rfc3986_parser.rb: specify a regexp for :OPAQUE; generic.rb
+ assumes it is present, and will refuse all values otherwise.
+ by Matthew Draper <matthew@trebex.net>
+ https://github.com/ruby/ruby/pull/718 fix GH-718
+
+Wed Sep 17 16:22:58 2014 Eric Wong <e@80x24.org>
+
+ * ext/zlib/zlib.c (zlib_mem_alloc): check overflow
+
+Wed Sep 17 11:33:35 2014 Laurent Arnoud <laurent@spkdev.net>
+
+ * test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
+ added test for long long [fix GH-716]
+
+Wed Sep 17 11:09:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * tool/rbinstall.rb: fixed invalid options with latest rubygems.
+ https://github.com/rubygems/rubygems/issues/1013
+
+Tue Sep 16 19:19:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * benchmark/bm_app_aobench.rb: update outdated links to the
+ original program. [ruby-dev:48550] [Feature #10247]
+
+Tue Sep 16 01:06:40 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * reg*.c: Merge Onigmo 5.15.0 38a870960aa7370051a3544
+
+Mon Sep 15 16:21:10 2014 Eric Wong <e@80x24.org>
+
+ * io.c (struct io_advise_struct): 32 => 24 bytes on 64-bit
+ * io.c (struct io_internal_writev_struct): 24 => 16 bytes on 64-bit
+ * process.c (struct waitpid_arg): ditto
+
+Mon Sep 15 10:29:25 2014 Natalie Weizenbaum <nweiz@google.com>
+
+ * ext/pathname/lib/pathname.rb (SAME_PATHS):
+ Pathname#relative_path_from uses String#casecmp to compare strings
+ on case-insensitive filesystem platforms (e.g., Windows). This can
+ return nil for strings with different encodings, and the code
+ previously assumed that it always returned a Fixnum. [Fix GH-713]
+
+Mon Sep 15 09:43:18 2014 Sho Hashimoto <sho.hsmt@gmail.com>
+
+ * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof): fix typo,
+ SIZEOF_LONG_LON. [Fix GH-714]
+
+Mon Sep 15 08:13:40 2014 Matthew Draper <matthew@trebex.net>
+
+ * sprintf.c (rb_str_format): rational 'f' format works for more
+ values. [fix GH-717]
+
+Sun Sep 14 16:57:27 2014 Eric Wong <e@80x24.org>
+
+ * template/vm.inc.tmpl: "insns.c" => "insns.def"
+ * tool/instruction.rb: typo fix
+
+Sun Sep 14 12:29:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_tracer.rb: fixed testcase for rubygems update.
+
+Sun Sep 14 12:29:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
+ Complete history at:
+ https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216
+
+ * test/rubygems: ditto.
+
+Sun Sep 14 11:03:24 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: update version
+ * ext/psych/psych.gemspec: ditto
+
+Sun Sep 14 08:43:37 2014 Eric Wong <e@80x24.org>
+
+ * ccan/container_of/container_of.h (container_of_or_null): added
+ [ccan 7ec5b8e06b2fd5fa98b1fcde1158c286d2d429d8] (David Gibson)
+
+Sun Sep 14 08:41:44 2014 Eric Wong <e@80x24.org>
+
+ * ccan/list/list.h (list_del_init, list_node_init): new functions
+ for multiple list_del() calls
+ [ccan ec8654d94d3c5c47aa5f82698f7e8048c79765b1] (Rusty Russell)
+
+Sat Sep 13 22:19:26 2014 Bernard Potocki <bernard.potocki@imanel.org>
+
+ * hash.c (rb_hash_aset): fix misleading example which may suggest
+ that Hash.store will return self instead of value - Hash#store
+ is returning value and update itself, as well as Hash#[]=.
+ [Fix GH-715]
+
+Sat Sep 13 15:16:31 2014 Eric Wong <e@80x24.org>
+
+ * class.c: use ALLOC(rb_subclass_entry_t)
+
+Sat Sep 13 14:14:00 2014 Eric Wong <e@80x24.org>
+
+ * process.c (free_exec_arg): remove
+ (memsize_exec_arg): ptr is never NULL
+ (exec_arg_data_type): use RUBY_TYPED_DEFAULT_FREE
+
+ * variable.c (autoload_i_free): remove
+ (autoload_data_i_type): use RUBY_TYPED_DEFAULT_FREE
+ (autoload_memsize): ptr is never NULL
+
+ * vm_backtrace.c (location_free): remove
+ (location_mark): ptr is never NULL
+ (location_data_type): use RUBY_TYPED_DEFAULT_FREE
+ (backtrace_mark): ditto
+ (backtrace_free): ditto
+
+Sat Sep 13 13:43:07 2014 Eric Wong <e@80x24.org>
+
+ * doc/NEWS-2.0.0: fix typo for default RUBY_FIBER_MACHINE_STACK_SIZE
+ [ci skip]
+
+Sat Sep 13 11:16:58 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_event.c(ev_advise, ole_event_free,
+ fev_s_allocate, fev_unadvise): avoid segmentation fault when COM
+ server freed before calling Unadvise from WIN32OLE_EVENT object.
+ * ext/win32ole/win32ole.c: ditto.
+
+Sat Sep 13 09:47:44 2014 Eric Wong <e@80x24.org>
+
+ * man/ruby.1: use https for *.ruby-lang.org links
+
+Sat Sep 13 06:31:23 2014 Eric Wong <e@80x24.org>
+
+ * vm.c (thread_alloc): remove needless volatile
+
+Sat Sep 13 06:13:55 2014 Eric Wong <e@80x24.org>
+
+ * proc.c (proc_free): remove, use RUBY_TYPED_DEFAULT_FREE
+ (proc_mark, proc_memsize): remove needless branching
+
+ * vm.c (env_free): remove, use RUBY_TYPED_DEFAULT_FREE
+ (env_mark, env_memsize): remove needless branching
+
+Sat Sep 13 05:52:15 2014 Eric Wong <e@80x24.org>
+
+ * proc.c (rb_proc_alloc): inline and move to vm.c
+ (rb_proc_wrap): new wrapper function used by rb_proc_alloc
+ (proc_dup): simplify alloc + copy + wrap operation
+ [ruby-core:64994]
+
+ * vm.c (rb_proc_alloc): new inline function
+ (rb_vm_make_proc): call rb_proc_alloc
+
+ * vm_core.h: remove rb_proc_alloc, add rb_proc_wrap
+
+ * benchmark/bm_vm2_newlambda.rb: short test to show difference
+
+Sat Sep 13 04:40:04 2014 Eric Wong <e@80x24.org>
+
+ * process.c (Init_process): subclass Thread as Process::Waiter
+ (rb_detach_process): use Process::Waiter instead of singleton class
+ Thanks to headius and nobu. [Bug #10231]
+
+ * test/ruby/test_process.rb (test_process_detach): new test
+
+ * inits.c (rb_call_inits): call Init_Thread before Init_process to
+ ensure Process::Waiter may be a subclass of Thread
+
+Fri Sep 12 18:14:28 2014 Eric Wong <e@80x24.org>
+
+ * vm.c (env_alloc): inline to avoid extra zeroing
+ tiny speedup [ruby-core:64980]
+
+Fri Sep 12 17:13:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_method_entry_make, remove_method): ditto.
+
+Fri Sep 12 14:39:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * gems/bundled_gems: Upgraded to test-unit-3.0.1 and minitest-5.4.1
+
+Fri Sep 12 06:55:40 2014 Eric Wong <e@80x24.org>
+
+ * string.c (Init_frozen_strings): use st_init_table_with_size
+
+Fri Sep 12 06:15:37 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (sym_find): remove Symbol.find because we have Symbol GC now.
+ https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20140904Japan
+ If you still want this, request again on Redmine. [Feature #7854]
+ https://bugs.ruby-lang.org/issues/7854
+
+ * ext/-test-/symbol/init.c (sym_find): moved from string.c for tests.
+
+Fri Sep 12 04:24:03 2014 Eric Wong <e@80x24.org>
+
+ * insns.def (once): define and use fake RUNNING_THREAD_ONCE_DONE
+ pointer to indicate is->once.running_thread is done.
+
+ * vm_core.h (iseq_inline_storage_entry): remove done field,
+ allowing the union to be reduced from 24=>16 bytes on 64-bit
+ [Feature #10187]
+
+Thu Sep 11 20:10:00 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (rb_thread_mark): use rb_gc_mark_values() to mark VM stack.
+
+Thu Sep 11 19:50:57 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (rb_vm_register_special_exception): make new function to
+ make and register special exceptions.
+
+ * vm.c (rb_vm_mark): do not need to mark special exceptions
+ because they are registered by rb_gc_register_mark_object().
+
+ * eval.c (Init_eval): use rb_vm_register_special_exception().
+
+ * gc.c (Init_GC): ditto.
+
+ * proc.c (Init_Proc): ditto.
+
+ * thread.c (Init_Thread): ditto.
+
+Thu Sep 11 19:32:30 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_mark_values): added.
+ This function is similar to rb_gc_mark_locations(), but not
+ conservative.
+
+ * internal.h: ditto.
+
+ * vm.c (env_mark): use rb_gc_mark_values() because env values should
+ be Ruby VALUEs.
+
+Thu Sep 11 19:16:39 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_ptr): rename to gc_mark_set.
+
+ * gc.c (gc_mark): add gc_mark_ptr() to skip is_markable_object()
+ check. gc_mark_maybe() can use gc_mark_ptr() directly because
+ passed pointer is checked by is_pointer_to_heap().
+
+Thu Sep 11 18:40:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .gitignore: ignored temporary files and coverage results.
+
+Thu Sep 11 18:15:30 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .gitignore: ignored only simplecov.
+ * coverage/README: Added coverage docs.
+
+Thu Sep 11 17:25:31 2014 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h, gc.c: add new internal events
+ RUBY_INTERNAL_EVENT_GC_ENTER and
+ RUBY_INTERNAL_EVENT_GC_EXIT.
+
+ When invoking GC process, GC_ENTER event is called.
+ When exiting from GC process, GC_EXIT event is called.
+
+ Incremental GC (incremental marking and lazy sweep) can call
+ these events many times.
+
+ For example (minor marking):
+ (1) GC_ENTER
+ - (2) GC_START (minor GC)
+ (minor marking)
+ - (3) GC_END_MARK
+ (start lazy sweep)
+ (4) GC_EXIT
+ (ruby process)
+ (5) GC_ENTER
+ (lazy sweep)
+ (6) GC_EXIT
+ (ruby process)
+ (... repeat (5), (6))
+ (7) GC_ENTER
+ (finish lazy sweep)
+ - (8) GC_END_SWEEP
+ (9) GC_EXIT
+
+ 2nd example (incremental major marking):
+ (1) GC_ENTER
+ - (2) GC_START (minor GC)
+ (start incremental marking)
+ (3) GC_EXIT
+ (ruby process)
+ (4) GC_ENTER
+ (incremental marking)
+ (5) GC_EXIT
+ (ruby process)
+ (... repeat (4), (5))
+ (6) GC_ENTER
+ (finish incremental marking)
+ - (7) GC_END_MARK
+ (start lazy sweep)
+ (8) GC_EXIT
+ (ruby process)
+ (9) GC_ENTER
+ (lazy sweep)
+ (10) GC_EXIT
+ (ruby process)
+ (... repeat (9), (10))
+ (11) GC_ENTER
+ (finish lazy marking)
+ - (12) GC_STOP_SWEEP
+ (13) GC_EXIT
+
+ These internal events enable to measure GC pause time completely.
+
+Thu Sep 11 17:04:54 2014 Eric Wong <e@80x24.org>
+
+ * lib/benchmark.rb: remove CLOCK_MONOTONIC_RAW support
+ Thanks to Vit Ondruch for reporting the issue on ARM.
+ [Bug #10202]
+
+Thu Sep 11 14:31:57 2014 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: freeze nil/true/false.
+ [Feature #8923]
+
+ * gc.c (should_be_finalizable): check frozen after checkin FL_ABLE.
+
+ * object.c (rb_obj_taint): check
+ OBJ_TAINTABLE(obj).
+
+ * object.c (rb_obj_freeze): remove immediate_frozen_tbl
+ because all of immediate values are frozen. YAY!
+
+ * object.c (rb_obj_frozen_p): ditto.
+
+ * test/ruby/test_eval.rb: skip instance_variable_set for
+ frozen objects.
+
+ * test/ruby/test_weakmap.rb: check ArgumentError instead of
+ RuntimeError.
+
+Thu Sep 11 10:03:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(21b241a)
+
+Wed Sep 10 17:52:25 2014 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (rb_vm_addr2insn): rename to rb_vm_insn_addr2insn
+ to clear what address.
+
+Wed Sep 10 16:22:26 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb: fix condition.
+
+Wed Sep 10 15:29:46 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (rb_call_info_t): ci->flag becomes 32-bit unsigned int
+ ci->index becomes a 32-bit signed int (from signed long).
+ Reorder for better packing on 64-bit, giving an 8 byte reduction
+ from 104 to 96 bytes for each ci.
+ [Feature #10187]
+
+ * compile.c (new_callinfo, setup_args, iseq_compile_each,
+ iseq_build_from_ary_body): adjust for type changes
+
+ * vm_insnhelper.c (vm_getivar): ditto
+
+Wed Sep 10 15:07:35 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (rb_iseq_translate_threaded_code):
+ modify in-place w/o copy
+ (rb_vm_addr2insn): new function for debug
+ (rb_iseq_original_iseq): ditto
+ (iseq_set_sequence): assign iseq_encoded directly
+ [Feature #10185]
+
+ * vm_core (rb_iseq_t): move original ->iseq to bottom
+
+ * iseq.c (iseq_free, iseq_free): adjust for new layout
+ (rb_iseq_disasm): use original iseq for dump
+ (iseq_data_to_ary): ditto
+ (rb_iseq_line_trace_each): ditto
+ (rb_iseq_build_for_ruby2cext): use iseq_encoded directly
+
+ * vm_dump.c (rb_vmdebug_debug_print_pre): use original iseq
+
+Wed Sep 10 15:00:11 2014 Eric Wong <e@80x24.org>
+
+ * time.c (time_mark): remove NULL check
+ (time_memsize): ditto
+ (time_free): remove, use RUBY_TYPED_DEFAULT_FREE instead
+ [Feature #10219]
+
+Wed Sep 10 14:14:57 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (encs enc trans libencs libenc libtrans): force to run
+ enk.mk because common.mk does not know the dependency, but enk.mk
+ knows. [ruby-dev:48530] [Bug #10220]
+
+Wed Sep 10 11:59:10 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): update rdoc.
+
+Wed Sep 10 11:52:08 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): rename:
+ * malloc_increase -> malloc_increase_bytes
+ * malloc_limit -> malloc_increase_bytes_limit
+ * oldmalloc_increase -> oldmalloc_increase_bytes
+ * oldmalloc_limit -> oldmalloc_increase_bytes_limit
+ ref: [Feature #9924]
+
+Wed Sep 10 11:45:40 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): rename `heap_used' to `heap_allocated_pages'.
+ ref: [Feature #9924]
+
+ * test/ruby/test_gc.rb: add constraints test for gc stat information.
+
+Wed Sep 10 11:31:16 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): rename:
+ * remembered_shady_object -> remembered_wb_unprotected_objects
+ * remembered_shady_object_limit -> remembered_wb_unprotected_objects_limit
+ * old_object -> old_objects
+ * old_object_limit -> old_objects_limit
+ ref: [Feature #9924]
+
+Wed Sep 10 11:12:25 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): support:
+ * total_allocated_pages
+ * total_freed_pages
+ ref: [Feature #9924]
+
+Wed Sep 10 10:48:04 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb: catch up last fix.
+
+Wed Sep 10 10:36:08 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_total_slot): rename objspace_available_slots.
+
+ * gc.c (objspace_live_slot, objspace_free_slot): rename
+ ..._slot() to ..._slots().
+
+ * gc.c (objspace_free_slot): should subtract heap_pages_final_slots.
+
+ * gc.c (gc_stat_internal):
+ * add `heap_available_slots' field
+ * rename heap_live_slot to heap_live_slots
+ * rename heap_free_slot to heap_free_slots
+ ref: [Feature #9924]
+
+Wed Sep 10 07:22:53 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: refactoring for RGENGC_PROFILE > 0.
+
+ * rename rb_objspace_t::profile::..._count
+ to rb_objspace_t::profile::total_..._count
+ * rename promote_infant_types to promote_types
+
+ * gc.c (gc_remember_unprotected): count remembered shady objects here.
+
+Wed Sep 10 03:12:12 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * gc.c (init_mark_stack): MEMZERO() receive type as 2nd argument instead
+ of size.
+ Coverity Scan found this bug.
+
+Tue Sep 9 21:55:39 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/sample/excel2.rb: remove some commented-out code.
+ rotate graph more slowly to see graph clearly.
+
+Tue Sep 9 19:52:33 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename rb_objspace_t::marked_objects to marked_slots.
+
+ * gc.c (gc_marks_start): should be clear first.
+
+ * gc.c (gc_marks_start): remembered shady objects are also marked.
+
+ * gc.c (gc_stat_internal): add heap_marked_slots.
+
+Tue Sep 9 18:58:48 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename
+ * total_allocated_object_num -> total_allocated_objects
+ * total_allocated_object_num_at_gc_start -> total_allocated_objects_at_gc_start
+ * total_freed_object_num -> total_freed_objects
+
+ * gc.c (gc_stat_internal):
+ * rename total_allocated_object -> total_allocated_objects
+ * rename total_freed_object -> total_freed_objects
+
+Tue Sep 9 18:51:36 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): fix symbol names
+ * heap_final_slot -> heap_final_slots
+ * heap_swept_slot -> heap_swept_slots
+
+Tue Sep 9 18:18:07 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_t::heap_pages): rename field names:
+ * used -> allocated_pages
+ * increment -> allocatable_pages
+ * length -> sorted_length
+ And remove unused `limit' field.
+
+ * gc.c: rename macros:
+ * heap_pages_used -> heap_allocated_pages
+ * heap_pages_length -> heap_pages_sorted_length
+ * heap_pages_increment -> heap_allocatable_pages
+
+ * gc.c (gc_stat_internal): fix symbol names
+ * heap_used -> heap_allocated_pages
+ * heap_eden_page_length -> heap_eden_pages
+ * heap_tomb_page_length -> heap_tomb_pages
+ * heap_increment -> heap_allocatable_pages
+ * heap_length -> heap_sorted_length
+
+ ref: [Feature #9924]
+ https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
+ Yellow color fields in this table are changed.
+
+ * test/ruby/test_gc.rb: catch up this change.
+
+Tue Sep 9 14:56:03 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: continue layout changing.
+
+ newobj_of() also touch:
+ (4) increment total_allocated_object_num
+ (5) check hook_events
+
+ And gather fields related to marking phase.
+
+Tue Sep 9 14:21:50 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix layout of rb_objspace_t to improve cache locality.
+
+ newobj_of() accesses:
+ (1) rb_objspace_t::flags
+ (2) rb_objspace_t::eden_heap::freelist
+ (3) and rb_objspace_t::eden_heap::free_pages if freelist is NULL.
+
+Tue Sep 9 14:09:36 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: move rb_objspace_t::flags::gc_stressful after during_gc
+ to make accessing both parameters easy.
+
+ * gc.c (heap_get_freeobj): add LIKELY() hint.
+
+ * gc.c (heap_get_freeobj_from_next_freepage): ditto.
+
+ * gc.c (newobj_of): check both parameters at once for exceptional
+ case.
+
+Tue Sep 9 13:51:32 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add rb_objspace_t::flags::gc_stressful and
+ ruby_gc_stressful macro.
+ Rename objspace->gc_stress to objspace->gc_stress_mode.
+
+ If objspace->gc_stress_mode is true (!nil and !false) then
+ ruby_gc_stressful becomes TRUE.
+
+ ruby_gc_stressful will speedup newobj_of() slightly.
+
+ * gc.c: initialize ruby_gc_stress(full|_mode) by gc_params.gc_stress
+ even if ENABLE_VM_OBJSPACE is false.
+
+Tue Sep 9 13:05:50 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: remove ruby_disable_gc_stress and add ruby_disable_gc
+ to speed-up newobj_of().
+
+ * gc.c (ready_to_gc): check ruby_disable_gc.
+
+ * signal.c: use ruby_disable_gc.
+
+Tue Sep 9 12:11:41 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename gc_stat entries and check stat transition.
+
+Tue Sep 9 12:06:03 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_sweep_rest): remove wrong modification of during_gc flag.
+
+Tue Sep 9 11:39:41 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: pack boolean values into rb_objspace_t::flags with bit fields
+ to improve cache locality.
+
+Tue Sep 9 11:11:05 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_object.rb: extend timeout.
+
+Tue Sep 9 09:02:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#pkg_config): append --cflags to also
+ $CXXFLAGS, as they are often used by C++ compiler.
+ [ruby-core:54532] [Bug #8315]
+
+Tue Sep 9 07:03:22 2014 Eric Wong <e@80x24.org>
+
+ * compile.c: remove needless SYM2ID <-> ID2SYM conversions
+ [misc #10207]
+
+Tue Sep 9 05:48:42 2014 Eric Wong <e@80x24.org>
+
+ * symbol.c (rb_intern_cstr_without_pindown): check dsymbol on return
+ This is not a complete fix for bug 10206, but seems to reduce
+ that crash and also looks correct.
+
+Tue Sep 9 04:36:24 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (rb_env_t): use flexible array
+ This reduces allocations and speeds up the lambda calculus
+ fizzbuzz (bm_app_lc_fizzbuzz.rb) benchmark [ruby-core:64858]
+ * proc.c (get_local_variable_ptr): deconst to adjust for flex array
+ * vm.c (env_mark, env_free, env_memsize): remove check for env->env
+ * vm.c (env_alloc): single allocation for flex array
+ * vm.c (vm_make_env_each): adjust env_alloc call
+
+Mon Sep 8 16:08:22 2014 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_app_lc_fizzbuzz.rb: should skip output on benchmark.
+
+Mon Sep 8 16:04:02 2014 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_app_lc_fizzbuzz.rb: `answer.to_a' does not return
+ a string, but an array.
+
+Mon Sep 8 13:18:37 2014 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_app_lc_fizzbuzz.rb: added.
+
+ This program is described closely in "Understanding Computation"
+ chapter 6 by Tom Stuart. <http://computationbook.com/>
+
+ Japanese translation will be published soon.
+ <http://www.oreilly.co.jp/books/9784873116976/>
+
+Mon Sep 8 12:01:39 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add incremental GC algorithm. [Feature #10137]
+
+ Please refer this ticket for details.
+
+ This change also introduces the following changes.
+
+ * Remove RGENGC_AGE2_PROMOTION and introduce object age (0 to 3).
+ Age can be count with FL_PROMOTE0 and FL_PROMOTE1 flags in
+ RBasic::flags (2 bit). Age == 3 objects become old objects.
+ * WB_PROTECTED flag in RBasic to WB_UNPROTECTED bitmap.
+ * LONG_LIVED bitmap to represent living objects while minor GCs
+ It specifies (1) Old objects and (2) remembered shady objects.
+ * Introduce rb_objspace_t::marked_objects which counts marked
+ objects in current marking phase. marking count is needed to
+ introduce incremental marking.
+ * rename mark related function and sweep related function to
+ gc_(marks|sweep)_(start|finish|step|rest|continue).
+ * rename rgengc_report() to gc_report().
+ * Add obj_info() function to get cstr of object details.
+ * Add MEASURE_LINE() macro to measure execution time of specific line.
+ * and many small fixes.
+
+ * include/ruby/ruby.h: add flag USE_RINCGC.
+ Now USE_RINCGC can be set only with USE_RGENGC.
+
+ * include/ruby/ruby.h: introduce FL_PROMOTED0 and add FL_PROMOTED1
+ to count object age.
+
+ * include/ruby/ruby.h: rewrite write barriers for incremental marking.
+
+ * debug.c: catch up flag name changes.
+
+ * internal.h: add rb_gc_writebarrier_remember() instead of
+ rb_gc_writebarrier_remember_promoted().
+
+ * array.c (ary_memcpy0): use rb_gc_writebarrier_remember().
+
+ * array.c (rb_ary_modify): ditto.
+
+ * hash.c (rb_hash_keys): ditto.
+
+ * hash.c (rb_hash_values): ditto.
+
+ * object.c (init_copy): use rb_copy_wb_protected_attribute() because
+ FL_WB_PROTECTED is moved from RBasic::flags.
+
+ * test/objspace/test_objspace.rb: catch up ObjectSpace.dump() changes.
+
+Sun Sep 7 12:47:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c: PTHREAD_CANCEL_DISABLE is not defined on Android.
+
+Sat Sep 6 20:59:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (has_privilege): The gid zero is not a privilege.
+
+Sat Sep 6 20:19:16 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (struct child_handler_disabler_state): cancelstate field
+ added.
+ (disable_child_handler_before_fork): Record cancelstate.
+ (disable_child_handler_fork_parent): Restore cancelstate.
+
+Sat Sep 6 19:27:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (struct child_handler_disabler_state): Defined.
+
+Sat Sep 6 18:31:32 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rake.rb, lib/rake/*, test/rake/*: Update latest rake master(e47d023)
+
+Sat Sep 6 16:38:08 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_variant.c (ole_val2variant_err,
+ ole_val2variantdata, Init_win32ole_variant): support VT_ERROR
+ variant with error code. add WIN32OLE_VARIANT::NoParam.
+ * test/win32ole/test_win32ole_variant.rb(test_c_noparam,
+ test_vt_error_noparam): ditto.
+ * ext/win32ole/win32ole.c: ditto.
+
+Sat Sep 6 11:08:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (arg_ambiguous_gen): fix warning message, "even" does
+ not mean the number of spaces here. state the place to put a
+ space and the operator. [ruby-core:64790] [Bug #10204]
+
+Sat Sep 6 08:44:40 2014 Zachary Scott <e@zzak.io>
+
+ * lib/rdoc/generator/template/darkfish/js/jquery.js: Backport
+ rdoc/rdoc@74f60fcb04fee1778fe2694d1a0ea6513f8e67b7
+
+Sat Sep 6 08:10:44 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_io.rb (test_readpartial_locktmp): use IO#nonblock=
+ Old fcntl invocation may drop necessary flags on some platforms.
+
+Sat Sep 6 07:46:51 2014 Eric Wong <e@80x24.org>
+
+ * test/ruby/test_io.rb (test_readpartial_locktmp): avoid EBADF
+ [ruby-core:64773] [ruby-core:64775]
+
+Sat Sep 6 01:34:31 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_f_exec): Call before_exec_async_signal_safe and
+ after_exec_async_signal_safe around rb_exec_async_signal_safe.
+ (rb_exec_async_signal_safe): Don't call
+ before_exec_async_signal_safe and after_exec_async_signal_safe.
+ (rb_exec_without_timer_thread): Call before_exec and
+ after_exec.
+ (disable_child_handler_fork_child): Make SIGPIPE handler SIG_DFL.
+
+Sat Sep 6 00:49:41 2014 Tanaka Akira <akr@fsij.org>
+
+ * signal.c (ruby_signal): Don't set SA_SIGINFO for SIG_IGN and
+ SIG_DFL.
+
+Fri Sep 5 21:45:33 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (disable_child_handler_before_fork): New function.
+ (disable_child_handler_fork_parent): Ditto.
+ (disable_child_handler_fork_child): Ditto.
+ (retry_fork_async_signal_safe): Call above functions to disable
+ signal handlers in child process.
+
+Fri Sep 5 21:02:54 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (handle_fork_error): Make try_gc_p argument volatile to
+ suppress "clobbered" warning.
+
+Fri Sep 5 20:48:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (handle_fork_error): Don't need state_p argument.
+
+Fri Sep 5 20:35:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (has_privilege): Fix a return value.
+
+Fri Sep 5 19:00:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/shellwords.rb: proofreading documentation.
+ [Bug #10155][ruby-core:64471]
+
+Fri Sep 5 18:34:33 2014 Laurent Arnoud <laurent@spkdev.net>
+
+ * test/csv/test_row.rb: Added some missing tests in CSV.
+ [fix GH-710]
+ * test/csv/test_table.rb: ditto.
+
+Fri Sep 5 12:57:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (has_privilege): Refine uid/gid check.
+
+Fri Sep 5 12:40:55 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Check sys/id.h, getuidx and getgidx for AIX.
+
+ * process.c (getresuid): Defined for AIX.
+ (getresgid): Ditto
+ AIX don't have getresuid/getresgid but getuidx/getgidx.
+
+Fri Sep 5 12:28:21 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (has_privilege): Fix assignments.
+
+Fri Sep 5 11:10:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rdoc/generator/pot/po.rb: fixed broken tests for trailing whitespace.
+ * test/rdoc/test_rdoc_generator_pot.rb: ditto.
+ * test/rdoc/test_rdoc_generator_pot_po.rb: ditto.
+
+Fri Sep 5 10:41:07 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_parse_file_encoding):
+ typofix.
+
+Fri Sep 5 10:39:14 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287)
+
+Fri Sep 5 06:04:22 2014 Eric Wong <e@80x24.org>
+
+ * vm.c: remove unused USE_THREAD_RECYCLE [misc #10198]
+
+Fri Sep 5 00:29:08 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in (dirfd): Check function.
+
+ * dir.c (dir_fileno): New method.
+ [ruby-dev:48265] [Feature #9880]
+
+Thu Sep 4 23:39:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (has_privilege): New function.
+ (retry_fork_async_signal_safe): Don't use vfork() for privileged
+ process.
+
+ * configure.in (getresuid): Check function.
+ (getresgid): Ditto.
+
+Thu Sep 4 20:22:14 2014 Laurent Arnoud <laurent@spkdev.net>
+
+ * test/pathname/test_pathname.rb: added testcase for Pathname#mountpoint?.
+ [fix GH-709]
+
+Thu Sep 4 20:09:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * symbian/*: removed Symbian support.
+ [Feature #10199][ruby-core:64725]
+ * dln.c: ditto.
+ * include/ruby/defines.h: ditto.
+ * thread_pthread.c: ditto.
+ * vm.c: ditto.
+
+Thu Sep 4 17:44:40 2014 Koichi Sasada <ko1@atdot.net>
+
+ * dir.c (glob_helper): use #ifdef instead of #if.
+ gcc's -Wundef option shows warning for undefined macro.
+
+ * numeric.c (flo_is_finite_p): ditto.
+
+ * vm_dump.c (rb_vmdebug_thread_dump_state): ditto.
+
+ * vm_core.h: define VM_DEBUG_VERIFY_METHOD_CACHE to 0.
+
+Thu Sep 4 03:57:46 2014 Eric Wong <e@80x24.org>
+
+ * man/ruby.1: spelling fix ("bellow" => "below") [ci-skip]
+
+Thu Sep 4 03:52:16 2014 Eric Wong <e@80x24.org>
+
+ * man/ruby.1: add trailing slash to URLs [ci-skip]
+
+Wed Sep 3 19:10:28 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (before_fork_ruby): Renamed from before_fork.
+ (after_fork_ruby): Renamed from after_fork.
+
+Wed Sep 3 18:56:05 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (forked_child): Removed.
+
+Wed Sep 3 16:56:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_obj_copy_ivar): allocate no memory for empty
+ instance variables. [ruby-core:64700] [Bug #10191]
+
+Wed Sep 3 12:05:17 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (retry_fork_async_signal_safe): Use vfork() if available.
+ vfork() is still faster than fork() especially when the parent
+ process uses big memory.
+
+ ruby -rbenchmark -e 'a = "a" * 1_000_000_000; puts Benchmark.measure { system("true") }'
+ fork: 0.000000 0.010000 0.010000 ( 0.014968)
+ vfork: 0.000000 0.000000 0.000000 ( 0.000912)
+ on Debian sid.
+
+Wed Sep 3 11:33:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/openssl/test_pkey_rsa.rb (OpenSSL#test_sign_verify_memory_leak):
+ added timeout into testcase for low performance environment.
+ [Bug #9984][ruby-core:63367]
+
+Wed Sep 3 07:50:15 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Use AC_FUNC_FORK.
+
+ * io.c: Use HAVE_WORKING_FORK instead of HAVE_FORK.
+
+ * process.c: Ditto.
+
+Wed Sep 3 00:12:44 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (retry_fork_async_signal_safe): Don't return on in child
+ process.
+
+Tue Sep 2 23:47:35 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (retry_fork_async_signal_safe): Specialized version of
+ retry_fork respect to rb_fork_async_signal_safe.
+ (retry_fork_ruby): Specialized version of retry_fork respect to
+ rb_fork_ruby.
+ (rb_fork_ruby): Removed.
+
+Tue Sep 2 23:26:26 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (send_child_error): Simplified.
+ (recv_child_error): Ditto.
+
+Tue Sep 2 22:56:25 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork_async_signal_safe): Inline rb_fork_internal.
+ (rb_fork_ruby): Ditto.
+ (rb_fork_internal): Removed.
+ (chfunc_protect): Removed.
+
+Tue Sep 2 22:43:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_io.rb (test_new_with_block): Set autoclose to avoid
+ EBADF.
+
+Tue Sep 2 22:01:51 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * Makefile.in (update-coverage): Remove a never executed line.
+
+Tue Sep 2 19:48:26 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (handle_fork_error): Extracted from retry_fork.
+
+Tue Sep 2 17:02:53 2014 Vit Ondruch <v.ondruch@tiscali.cz>
+
+ * tool/rbinstall.rb: fixed error of local installation.
+ [Bug #10192][ruby-core:64702]
+
+Tue Sep 2 16:58:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/runner.rb: reporting test coverage for test-all with COVERAGE env.
+ [Feature #10189][ruby-core:64681][fix GH-708]
+ * Makefile.in: added task for coverage report.
+ * common.mk: added definition of forked simplecov url.
+ * .gitignore: ignored coverage directory.
+
+Mon Sep 1 20:11:02 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (rbtime2vtdate): try to convert millisecond
+ of Time object to millisecond of VT_DATE VARIANT.
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_time2date_with_msec): ditto.
+
+Sun Aug 31 16:58:49 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/benchmark.rb: Fix a syntax error.
+
+Sun Aug 31 08:46:44 2014 Eric Wong <e@80x24.org>
+
+ * ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE
+ [Bug #10101]
+
+ * test/zlib/test_zlib.rb (test_rewind): test each_byte
+
+Sat Aug 30 19:22:47 2014 Eric Wong <e@80x24.org>
+
+ * symbol.c (rb_sym2id): do not return garbage object
+
+Sat Aug 30 06:39:48 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: fix NameError dumping and
+ loading. Fixes GH #85. Thanks @brentdax for the patch!
+ * test/psych/test_exception.rb: test for fix
+
+Sat Aug 30 06:23:40 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: fix loading strings that
+ look like integers but have a newline. Fixes GH #189
+ * test/psych/test_string.rb: test for fix
+
+Sat Aug 30 06:10:39 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: merge keys with a hash
+ should merge the hash in to the parent.
+ * test/psych/test_merge_keys.rb: test for change. Fixes GH #202
+
+Sat Aug 30 06:00:26 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: quoted "<<" strings
+ should not be treated as merge keys.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: hashes with keys
+ containing "<<" should roundtrip.
+ * test/psych/test_merge_keys.rb: test for change. Fixes GH #203
+
+Fri Aug 29 17:56:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/net/imap/test_imap_response_parser.rb: removed needless code.
+
+Fri Aug 29 17:36:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/rinda/test_rinda.rb: removed useless assignment variables.
+ * test/rss/rss-assertions.rb: ditto.
+ * test/rss/test_maker_itunes.rb: ditto.
+
+Fri Aug 29 16:18:26 2014 Eric Wong <e@80x24.org>
+
+ * string.c: revert part of r47311, add rb_vm_fstring_table(),
+ remove vm_core.h dependency. [ruby-core:64627]
+
+Fri Aug 29 15:17:13 2014 Eric Wong <e@80x24.org>
+
+ * string.c: remove static frozen_strings
+ * string.c (Init_frozen_strings): new function
+ * string.c (rb_fstring): remove check for frozen strings,
+ use per-VM table
+ * string.c (rb_str_free): use per-VM table
+ * string.c (Init_String): use per-VM table
+ * vm_core.h (rb_vm_t): add frozen_strings table
+ * internal.h (Init_frozen_strings): new function prototype
+ * eval.c (ruby_setup): call Init_frozen_strings
+ [Feature #10182]
+
+Wed Aug 27 23:10:24 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/tempfile.rb: remove "require 'thread'". its features are no
+ longer used.
+
+Wed Aug 27 21:19:40 2014 gogo tanaka <mail@tanakakazuki.com>
+
+ * lib/drb/acl.rb: Removed meaningless #to_s methods in interpolation.
+ [Feature #10174][ruby-core:64584]
+ * lib/erb.rb: ditto.
+ * lib/observer.rb: ditto.
+ * lib/rake/invocation_chain.rb: ditto.
+ * lib/rubygems/command_manager.rb: ditto.
+ * lib/rubygems/config_file.rb: ditto.
+ * lib/uri/common.rb: ditto.
+
+Wed Aug 27 21:08:20 2014 gogo tanaka <mail@tanakakazuki.com>
+
+ * lib/drb/drb.rb: use attr_reader instead of Module#attr.
+ [Feature #10172][ruby-core:64582]
+ * lib/irb/ruby-token.rb: ditto.
+ * lib/net/telnet.rb: ditto.
+ * lib/rdoc/ruby_token.rb: ditto.
+ * lib/thwait.rb: ditto.
+
+Wed Aug 27 19:52:33 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (vtdate2rbtime): try to convert millisecond
+ of VT_DATE VARIANT to nsec of Time object.
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_dbl2date_with_msec): ditto.
+
+Wed Aug 27 09:57:29 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_complex.rb: removed unreachable code.
+ * test/ruby/test_rational.rb: ditto.
+
+Wed Aug 27 07:59:17 2014 Eric Wong <e@80x24.org>
+
+ * compile.c (iseq_set_sequence): check for multiplication overflow
+
+Tue Aug 26 22:07:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_complex.rb: cherry-picked working assertions from r47251.
+ * test/ruby/test_rational.rb: cherry-picked working assertions from r47263.
+
+Tue Aug 26 21:07:56 2014 gogo tanaka <mail@tanakakazuki.com>
+
+ * lib/mathn.rb (Fixnum#**, Bignum#**, Float#**, Rational#**):
+ remove as these are now built-in. [ruby-core:63973] [Bug #10086]
+
+Tue Aug 26 20:46:55 2014 Tanaka Akira <akr@fsij.org>
+
+ * time.c (rb_time_unmagnify_to_float): Avoid double rounding.
+ Reported by Tsuyoshi Sawada.
+ https://bugs.ruby-lang.org/issues/10135#note-1
+
+Tue Aug 26 17:12:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_close): ignore only "closed stream" IOError and
+ NoMethodError, do not swallow other exceptions at the end of
+ block. [ruby-core:64463] [Bug #10153]
+
+Tue Aug 26 13:46:33 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * template/fake.rb.in: fix failed to make install when @srcdir@ is
+ absolute path.
+
+Tue Aug 26 13:43:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_range.rb: added workaround for VERBOSE message.
+
+Tue Aug 26 12:38:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_mathn.rb: added workaround for VERBOSE messages.
+
+Tue Aug 26 11:44:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/shell/process-controller.rb: removed commented-out code.
+
+Tue Aug 26 11:39:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/thwait.rb (ThreadsWait): removed needless constant.
+
+Tue Aug 26 09:27:10 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/mathn.rb: mathn library is deprecated on ruby 2.2.
+ [Feature #10169][ruby-core:64553]
+
+Tue Aug 26 09:25:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/mathn.rb: removed commented-out code.
+
+Mon Aug 25 20:15:50 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c(fole_s_connect, fole_initialize): raise a
+ security error with the tainted string object.
+ * ext/win32ole/win32ole_event.c(ev_advise): ditto.
+ * test/win32ole/test_win32ole.rb(test_s_new_exc_svr_tainted,
+ test_s_new_exc_host_tainted): ditto.
+ * test/win32ole/test_win32ole_event.rb(test_s_new_exc_tainted): ditto.
+
+Mon Aug 25 12:56:54 2014 Ivan Korunkov <ivankorunkov@ya.ru>
+
+ * lib/logger.rb (format_datetime): use "%6N" to show microsecond.
+ [Fix GH-704]
+
+Mon Aug 25 11:02:07 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (rb_iseq_location_t): change first_lineno type to VALUE
+ * iseq.c (rb_iseq_build_for_ruby2cext): update based on argument
+
+Sun Aug 24 16:14:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/e2mmap.rb: remove needless instance variables.
+ * lib/irb.rb: ditto.
+ * lib/irb/**/*.rb: ditto.
+ * lib/shell.rb: ditto.
+
+Sun Aug 24 12:44:26 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_complex.rb: removed needless conditions.
+ * test/ruby/test_rational.rb: ditto.
+
+Sun Aug 24 11:47:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_rational.rb: fixed indent.
+
+Sun Aug 24 11:44:11 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_rational.rb: remove commented-out code.
+
+Sun Aug 24 11:09:29 2014 Eric Wong <e@80x24.org>
+
+ * lib/benchmark.rb (measure): reduce allocations as in r47260
+
+Sun Aug 24 10:35:54 2014 Pete Higgins <pete@peterhiggins.org>
+
+ * lib/benchmark.rb (module Benchmark): define BENCHMARK_CLOCK
+ (realtime): use Process.clock_gettime(BENCHMARK_CLOCK)
+ Reduces allocations to improve performance [Feature #10165]
+
+ * test/benchmark/test_benchmark.rb (test_realtime_output): new test
+
+Fri Aug 22 20:23:54 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (rb_fstring): fix condition (easy to cause infinite loop!).
+
+Fri Aug 22 20:07:43 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (rb_fstring, fstr_update_callback): simply delete garbage
+ key first.
+
+ Garbage keys can be swept by lazy sweeping invoked by creating new
+ fstring. So that simply do:
+ (1) delete garbage key and return `fstr_update_callback' immediately
+ (2) try again `fstr_update_callback()' to create a new fstr.
+
+ This bug can be cause memory corruption, reported by
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20140821T220302Z.fail.html.gz
+
+Fri Aug 22 19:30:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_complex.rb: removed commented-out code.
+
+Fri Aug 22 19:25:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_complex.rb: fixed broken tests. Math is not
+ compatible CMath now.
+
+Fri Aug 22 15:36:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (Doxyfile): revert r43888, not to require preinstalled
+ ruby. [ruby-core:64488] [Bug #10161]
+
+Fri Aug 22 12:32:15 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/shell.rb: removed commented-out code.
+ * lib/shell/builtin-command.rb: ditto.
+ * lib/shell/command-processor.rb: ditto.
+
+Fri Aug 22 12:21:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/complex.rb: removed deprecated library.
+ * lib/rational.rb: ditto.
+
+Fri Aug 22 11:38:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/prettyprint.rb: removed PrettyPrint#first?
+ because it is obsoleted method since Ruby 1.8.2
+
+Thu Aug 21 17:10:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (constat_attr): manage reverse video internally
+ since Windows console window does not manage it. based on the
+ patch by white leaf in [ruby-dev:48483]. [Bug #10158]
+
+Thu Aug 21 14:45:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/e2mmap.rb: removed commented-out code.
+
+Thu Aug 21 13:23:34 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rinda/ring.rb: split executable code into sample directory.
+ * sample/rinda-ring.rb: ditto.
+
+Thu Aug 21 13:21:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/drb/acl.rb: split executable code into sample directory.
+ * sample/drb/acl.rb: ditto.
+
+Thu Aug 21 12:55:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .gitignore: ignored temporary file for Changelog.
+ http://mkosaki.blog46.fc2.com/blog-entry-1284.html
+
+Thu Aug 21 12:40:22 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/net/imap.rb: split executable code into sample directory.
+ * sample/net-imap.rb: ditto.
+
+Thu Aug 21 12:23:56 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/net/imap.rb: removed commented-out code.
+
+Wed Aug 20 17:27:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_TRY_CFLAGS, RUBY_TRY_LDFLAGS),
+ (RUBY_CHECK_BUILTIN_SETJMP, RUBY_SETJMP_TYPE),
+ (RUBY_STACK_GROW_DIRECTION): quote defun names, for some
+ versions of autoconf possibly. [ruby-core:64473] [Bug #10156]
+
+Tue Aug 19 22:28:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (rb_str_format): fix condition to round.
+ [ruby-core:64454] [Bug #10151]
+
+Tue Aug 19 22:22:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/trans/euckr-tbl.rb (EUCKR_TO_UCS_TBL): add missing euro and
+ registered signs. [ruby-core:64452] [Bug #10149]
+
+Tue Aug 19 13:59:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compar.c (rb_cmperr): preserve encodings of arguments in the
+ message.
+
+Tue Aug 19 10:13:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/thread/thread.c (get_array): check instance variables are
+ initialized properly. [ruby-core:63826][Bug #10062]
+
+Mon Aug 18 17:06:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (rb_str_format): support rational 'f' format.
+ [ruby-core:64382] [Bug #10136]
+
+Mon Aug 18 08:03:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * spec/default.mspec: use 2.2 definition.
+
+Sun Aug 17 19:41:40 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * gc.c (obj_memsize_of): don't calculate memsize of T_NODE
+ when called from check_gen_consistency. It fixes segmentation
+ fault on RGENGC_CHECK_MODE >= 1 introduced by r47188.
+
+Sun Aug 17 17:08:12 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_invoke): use RHASH_SIZE instead of
+ calling Hash#length method.
+
+Sat Aug 16 19:32:06 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_event.c (evs_length): use RARRAY_LEN instead
+ of calling Array#length method.
+
+Sat Aug 16 10:20:17 2014 Eric Wong <e@80x24.org>
+
+ * time.c (time_timespec): fix tv_nsec overflow
+ [Bug #10144]
+
+Fri Aug 15 20:34:17 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE_EVENT src from
+ win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_event.c: ditto.
+ * ext/win32ole/win32ole_event.h: ditto.
+ * ext/win32ole/depend: ditto.
+
+Fri Aug 15 19:38:00 2014 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (rb_iseq_clone): Should not insert write barrier from
+ non-RVALUE data (to non-RVALUE data, of course).
+
+ Ruby 2.1 also has a same problem.
+
+Fri Aug 15 19:34:33 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (setup_fake_str): fake strings should not set class by
+ RBASIC_SET_CLASS() because it insert write barriers to fake
+ (non-RVALUE) structure.
+
+ It can cause unexpected behaviour.
+
+ Ruby 2.1 also have a same problem (setup_fake_str() in parse.y).
+
+ * symbol.c (setup_fake_str): ditto.
+
+Fri Aug 15 19:27:25 2014 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_tmp_new_fill): added.
+ This function creates internal use only array (which is completely
+ hided by ObjectSpace.each_object) with filling nil.
+
+ Otherwise, it can be includes strange VALUEs.
+
+ * internal.h: added.
+
+ * node.h: use rb_ary_tmp_new_fill() for MEMO.
+
+Fri Aug 15 10:13:37 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/gserver.rb: removed unmaintained code.
+ [ruby-core:40313][Feature #5480]
+ * lib/xmlrpc/httpserver.rb: ditto.
+
+Fri Aug 15 09:22:12 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (rb_thread_struct): reorder to pack
+ * cont.c (rb_context_struct, rb_fiber_struct): ditto
+ On x86-64, these changes reduces:
+ rb_thread_struct to 1000 bytes (from 1016)
+ rb_context_struct to 1288 bytes (from 1312)
+ rb_fiber_struct to 2272 bytes (from 2304)
+
+Fri Aug 15 09:06:31 2014 Eric Wong <e@80x24.org>
+
+ * thread_pthread.h: define RB_NATIVETHREAD_LOCK_INIT and
+ RB_NATIVETHREAD_COND_INIT macros
+
+ * thread_pthread.c (native_mutex_lock, native_mutex_unlock,
+ native_mutex_trylock, native_mutex_initialize,
+ native_mutex_destroy, native_cond_wait):
+ use rb_nativethread_lock_t instead of pthread_mutex_t
+ [Feature #10134]
+
+ * thread_pthread.c (native_mutex_debug): make argument type-agnostic
+ to avoid later cast.
+
+ * thread_pthread.c (register_cached_thread_and_wait):
+ replace PTHREAD_COND_INITIALIZER with RB_NATIVETHREAD_COND_INIT,
+ use native_mutex_{lock,unlock}
+
+ * thread_pthread.c (use_cached_thread):
+ use native_mutex_{lock,unlock}
+
+ * thread_pthread.c (native_sleep):
+ use rb_nativethread_lock_t to match th->interrupt_lock,
+ use native_mutex_{lock,unlock}
+
+ * thread_pthread.c (timer_thread_lock): use rb_nativethread_lock_t type
+
+Fri Aug 15 08:10:29 2014 Eric Wong <e@80x24.org>
+
+ * cont.c (cont_mark): fix typo in unused path [ci skip]
+
+Fri Aug 15 06:00:56 2014 Eric Wong <e@80x24.org>
+
+ * vm.c (rb_thread_mark): update comment about marking `me'
+ [ruby-core:64340] [ruby-core:64341]
+
+Fri Aug 15 05:53:59 2014 Eric Wong <e@80x24.org>
+
+ * README.EXT: preliminary documentation for RB_GC_GUARD
+ [Bug #10100] [ruby-core:60741]
+
+Thu Aug 14 00:26:19 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE_RECORD src from
+ win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_record.c: ditto.
+ * ext/win32ole/win32ole_record.h: ditto.
+ * ext/win32ole/depend: ditto.
+
+Wed Aug 13 21:41:04 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE_VARIANT src from
+ win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_variant.c: ditto.
+ * ext/win32ole/win32ole_variant.c: ditto.
+ * ext/win32ole/depend: ditto.
+
+Wed Aug 13 20:09:37 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: remove unused variable.
+
+Wed Aug 13 19:31:27 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_search_handler_method, rescue_callback,
+ folerecord_inspect): use PRIsVALUE in rb_sprintf.
+
+ * ext/win32ole/win32ole_param.c (foleparam_inspect): ditto.
+
+ * ext/win32ole/win32ole_variable.c (folevariable_inspect): use
+ PRIsVALUE in rb_sprintf, use rb_inspect.
+
+Wed Aug 13 11:54:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/irb/completion.rb: reverted r47163.
+ because another case can't be show completion target.
+
+Wed Aug 13 11:17:00 2014 Shimpei Makimoto <github@makimoto.org>
+
+ * lib/irb.rb: Prevent irb from crashing when exception with
+ nil backtrace is raised.
+ [fix GH-434][ruby-core:58078][Bug #9063]
+ * test/irb/test_raise_no_backtrace_exception.rb: ditto.
+
+Wed Aug 13 11:08:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/irb/completion.rb: fixed broken completion list with
+ String including spaces. Contributed from @dunric. [fix GH-465]
+
+Wed Aug 13 00:07:01 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE_PARAM src from win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_param.c: ditto.
+ * ext/win32ole/win32ole_param.h: ditto.
+ * ext/win32ole/depend: ditto.
+
+Tue Aug 12 23:17:47 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: refactoring. move some methods
+ into win32ole_type.c / win32ole_method.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_method.c: ditto.
+ * ext/win32ole/win32ole_method.h: ditto.
+ * ext/win32ole/win32ole_type.h: ditto.
+ * ext/win32ole/win32ole_type.h: ditto.
+
+Tue Aug 12 22:59:48 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: refactoring. move
+ ole_typelib_from_itypeinfo into win32ole_typelib.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_typelib.h: ditto.
+ * ext/win32ole/win32ole_typelib.h: ditto.
+
+Tue Aug 12 21:49:40 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_create_dcom): use the converted
+ result if the argument can be converted to a string, to get rid
+ of invalid access. Thanks to nobu. [ruby-dev:48467] [Bug #10127]
+
+Tue Aug 12 14:22:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * configure.in: ignored working directory same as prefix value.
+ [ruby-core:54999] [Bug #8409]
+
+Tue Aug 12 13:34:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/fileutils.rb: enable to remove with non-owner directory.
+ [ruby-dev:45976] [Bug #6756]
+ * test/fileutils/test_fileutils.rb: add testcase for #6756.
+
+Tue Aug 12 12:57:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * vm_exec.c: improve performance in ppc64 arch.
+ [ruby-core:63437] [Feature #9997]
+
+Tue Aug 12 12:14:52 2014 Akira Matsuda <ronnie@dio.jp>
+
+ * lib/fileutils.rb: fix typo.
+ [ruby-dev:47831] [Bug #9180]
+
+Tue Aug 12 10:10:42 2014 Eric Wong <e@80x24.org>
+
+ * vm_method.c (release_method_definition): use rb_free_method_entry
+
+Tue Aug 12 06:16:09 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE_METHOD src from
+ win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_method.c: ditto.
+ * ext/win32ole/win32ole_method.h: ditto.
+ * ext/win32ole/depend: ditto.
+
+Mon Aug 11 22:19:15 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_variable.c (folevariable_inspect): refactoring.
+
+Mon Aug 11 20:47:27 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE_VARIABLE src from
+ win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_variable.c: ditto.
+ * ext/win32ole/win32ole_variable.h: ditto.
+ * ext/win32ole/depend: ditto.
+
+Mon Aug 11 16:17:21 2014 Tony Miller <mcfiredrill@gmail.com>
+
+ * dir.c (rb_dir_exists_p): [DOC] Document that Dir.exists? is
+ deprecated. [ruby-core:64135] [Bug #10102]
+
+Mon Aug 11 11:26:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tempfile.rb: start rdoc parsing inside singleton class
+ definition to include the document there.
+ [ruby-core:64157] [Bug #10105]
+
+Sun Aug 10 12:22:43 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_type.c: refactoring.
+
+Sun Aug 10 10:34:00 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/cgi/session/pstore.rb: separated sample code.
+ * lib/open3.rb: ditto.
+
+Sun Aug 10 10:03:24 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/irb/ext/multi-irb.rb: removed commented-out code.
+
+Sat Aug 9 11:02:07 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/irb.rb: removed commented-out code.
+ * lib/irb/**/*.rb: ditto.
+
+Sat Aug 9 10:35:30 2014 Laurent Arnoud <laurent@spkdev.net>
+
+ * lib/cmath.rb: fixed indent. [fix GH-696]
+ * lib/drb/ssl.rb: ditto.
+ * lib/irb/**/*.rb: ditto.
+
+Sat Aug 9 10:28:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/minitest/test_minitest_unit.rb: removed obsoleted condition
+ for Ruby 1.8.
+ * test/ruby/test_time_tz.rb: ditto.
+
+Sat Aug 9 10:18:00 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/cgi/test_cgi_core.rb: removed obsoleted condition for Ruby 1.8.
+ * test/cgi/test_cgi_header.rb: ditto.
+ * test/cgi/test_cgi_multipart.rb: ditto.
+ * test/cgi/test_cgi_tag_helper.rb: ditto.
+
+Sat Aug 9 00:34:37 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE_TYPE src from win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_type.c: ditto.
+ * ext/win32ole/win32ole_type.h: ditto.
+ * ext/win32ole/depend: ditto.
+
+Fri Aug 8 01:53:37 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/securerandom.rb: use OpenSSL::BN for performance improvement.
+
+ * benchmark/bm_securerandom.rb: benchmark script.
+
+Fri Aug 8 17:19:57 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/open-uri.rb: remove needless condition for old ruby version.
+ * test/open-uri/test_open-uri.rb: ditto.
+
+Fri Aug 8 16:40:59 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/irb/init.rb: removed unreachable code.
+
+Fri Aug 8 16:34:22 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/drb/drb.rb: removed unreachable code.
+
+Fri Aug 8 14:33:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/webrick/httpproxy.rb: remove needless condition
+ for old ruby version.
+
+Fri Aug 8 01:07:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): fix invalid char in eval, should raise
+ an syntax error too, as well as directly coded.
+ [ruby-core:64243] [Bug #10117]
+
+Thu Aug 7 23:25:29 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/open3.rb: avoid unnecessary write if stdin_data is empty.
+
+Thu Aug 7 21:42:49 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole_typelib.c (foletypelib_version): return
+ version string.
+
+ * test/win32ole/test_win32ole_typelib.rb (test_version): ditto.
+
+Thu Aug 7 15:13:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/cgi.rb: remove needless condition for old ruby version.
+
+Thu Aug 7 06:04:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yyerror): preserve source code encoding in
+ syntax error messages. [ruby-core:64228] [Bug #10114]
+
+Wed Aug 6 20:56:02 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate src of WIN32OLE_TYPELIB from
+ win32ole.c
+
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_typelib.c: ditto.
+ * ext/win32ole/win32ole_typelib.h: ditto.
+ * ext/win32ole/depend: ditto.
+
+Wed Aug 6 20:44:07 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * enum.c (enum_one): [DOC] Move enum.one? documentation before the
+ relevant method. Submitted by @vipulnsward. [Fixes GH-687]
+ https://github.com/ruby/ruby/pull/687
+
+Wed Aug 6 20:25:47 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#replace): Check if an object given is enumerable
+ before clearing self. Reported by yui-knk. [GH-675]
+ https://github.com/ruby/ruby/pull/675
+
+Wed Aug 6 20:07:26 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (olerecord_ivar_set): remove rb_str_subseq.
+
+Wed Aug 6 19:09:27 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set): Implement Set#clone by splitting
+ initialize_copy into initialize_dup and initialize_clone.
+ Submitted by yui-knk. [Fixes GH-661]
+ https://github.com/ruby/ruby/pull/661
+
+Wed Aug 6 18:42:58 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate src of WIN32OLERuntimeError
+ from win32ole.c.
+
+ * ext/win32ole/win32ole.h: ditto
+ * ext/win32ole/depend: ditto.
+ * ext/win32ole/win32ole_error.c: ditto.
+ * ext/win32ole/win32ole_error.h: ditto.
+
+Wed Aug 6 04:33:58 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTP.proxy_uri): use initializer instead
+ of parser to handle IPv6 address. [Bug #9129]
+
+Wed Aug 6 04:16:05 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/requests.rb (Net::HTTP::Options::RESPONSE_HAS_BODY):
+ OPTIONS requests may have response bodies. [Feature #8429]
+ http://tools.ietf.org/html/rfc7231#section-4.3.7
+
+Wed Aug 6 03:18:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/generic_request.rb (Net::HTTP::GenericRequest#exec):
+ handle req['host'] in update_uri.
+
+ * lib/net/http/generic_request.rb
+ (Net::HTTP::GenericRequest#update_uri):
+ use req['host'] if it is explicitly set. Even if URI is given,
+ it is already used for the initial value of req['host'].
+ Therefore overwritten value should be respected. [Bug #10054]
+
+Wed Aug 6 03:17:34 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/generic_request.rb
+ (Net::HTTP::GenericRequest#update_uri):
+ handle scheme, host, and port to reflect connection to @uri.
+
+ * lib/net/http.rb (Net::HTTP#begin_transport): move trivial handling
+ to Net::HTTP::GenericRequest#update_uri.
+
+
+Wed Aug 6 02:16:43 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/generic_request.rb
+ (Net::HTTP::GenericRequest#initialize):
+ optimize object allocation.
+
+Wed Aug 6 01:16:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI::Generic#path_query): remove a private method.
+
+Wed Aug 6 01:15:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI::Generic#normalize!): use String#empty?
+
+ * lib/uri/generic.rb (URI::Generic#path_query): optimized.
+
+ * lib/uri/generic.rb (URI::Generic#to_s): optimized.
+
+Wed Aug 6 00:15:10 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/http.rb (URI::HTTP#request_uri): optimized.
+ decrease object allocation, and ensure always create at least one new
+ object for return value.
+
+Wed Aug 6 03:41:21 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: backwards compatibility for
+ hashes emitted by Syck. Github #198
+ * test/psych/test_hash.rb: test for change.
+
+Tue Aug 5 19:27:59 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_invoke): skip VariantClear when
+ argument is VT_RECORD variant.
+
+Tue Aug 5 15:52:51 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * gems/bundled_gems: Upgrade to test-unit-3.0.0 and minitest-5.4.0.
+
+Mon Aug 4 21:50:09 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_record.rb: add for WIN32OLE_RECORD
+ test(need .NET Framework 3.5 to run test).
+
+Mon Aug 4 19:49:34 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_invoke): call rb_hash_foreach instead
+ of rb_block_call.
+
+ * ext/win32ole/win32ole.c: add comment for rdoc of WIN32OLE_VARIANT
+ class.
+
+Mon Aug 4 09:12:47 2014 Eric Wong <e@80x24.org>
+
+ * variable.c: cleanup to use rb_const_lookup
+ [Feature #10107]
+
+ * vm_insnhelper.c: ditto
+
+Sun Aug 3 10:55:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/encoding.h (rb_check_symbol_cstr): ditto.
+
+Sun Aug 3 10:43:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): unusable super class should cause
+ method missing when BasicObject is refined but not been using.
+ [ruby-core:64166] [Bug #10106]
+
+Sat Aug 2 23:47:45 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: separate WIN32OLE::VARIANT src file
+ from win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_variant_m.c: ditto.
+ * ext/win32ole/win32ole_variant_m.h: ditto.
+ * ext/win32ole/depend: ditto.
+ * ext/.document: ditto.
+
+Sat Aug 2 14:34:58 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: add comments for rdoc.
+
+Sat Aug 2 10:26:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_obj_itself): new method Object#itself. based on the
+ patch by Rafael Franca in [ruby-core:64156].
+ [EXPERIMENTAL] this method may be renamed due to compatibilities.
+ [ruby-core:44704] [Feature #6373]
+
+Fri Aug 1 22:30:40 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (folerecord_initialize): accept
+ only 2 arguments. The 2nd argument should be WIN32OLE object or
+ WIN32OLE_RECORD object.
+
+Fri Aug 1 20:17:33 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_variant2val): call
+ folerecord_s_allocate instead of WIN32OLE_RECORD.new.
+
+Fri Aug 1 18:39:57 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/date/test_date.rb: remove commented-out code.
+ * test/date/test_date_arith.rb: ditto.
+ * test/date/test_date_attr.rb: ditto.
+ * test/date/test_date_parse.rb: ditto.
+
+Fri Aug 1 16:35:32 2014 Evan Miller <evan@squareup.com>
+
+ * numeric.c (flodivmod): all results are NaN if divisor is NaN.
+ [fix GH-692]
+
+Thu Aug 01 07:28:12 2014 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c: [DOC] Add description of
+ `BigDecimal.new` exceptions. Patched by @joker1007 and
+ @prathamesh-sonpatki [Fixes GH-690]
+ https://github.com/ruby/ruby/pull/690
+
+Thu Jul 31 22:20:12 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: add WIN32OLE_RECORD#inspect.
+
+Thu Jul 31 20:35:32 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: add
+ WIN32OLE_RECORD#ole_instance_variable_set and
+ WIN32OLE_RECORD#ole_instance_variable_get
+
+Wed Jul 30 23:28:10 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * sprintf.c (rb_str_format): like r47006, get rid of
+ function calls in RSTRING_PTR().
+
+Wed Jul 30 22:10:29 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * process.c (rlimit_resource_type, rlimit_resource_value):
+ get rid of inadvertent dynamic symbol pin-down.
+
+ * re.c (match_backref_number): ditto.
+
+ * signal.c (esignal_init, rb_f_kill, trap_signm): ditto.
+
+ * transcode.c (econv_opts): ditto.
+
+ * vm_trace.c (symbol2event_flag): ditto.
+
+Wed Jul 30 21:29:39 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_invoke): pass WIN32OLE_RECORD variant
+ by reference when invoke OLE methods at first.
+
+ * ext/win32ole/win32ole.c (olerecord_set_ivar): release
+ IRecordInfo interface before setting another IRecordInfo interface.
+
+Wed Jul 30 13:17:35 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: remove unused macros.
+
+Tue Jul 29 22:21:37 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (hash2olerec): ignore WIN32OLE_RECORD
+ instance variable if the variable is nil.
+
+Tue Jul 29 19:43:27 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (folerecord_method_missing): refactoring.
+ divide functionality of folerecord_method_missing into
+ olerecord_ivar_set and olerecord_ivar_get.
+
+Mon Jul 28 20:20:08 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win23ole.c (folerecord_method_missing): support
+ setter of member of WIN32OLE_RECORD object.
+
+Mon Jul 28 06:37:19 2014 Zachary Scott <e@zzak.io>
+
+ * vm_eval.c: [DOC] Fix rdoc formatting of patch from [Bug #9551]
+
+Mon Jul 28 06:34:43 2014 Zachary Scott <e@zzak.io>
+
+ * vm_eval.c: [DOC] [Bug #9551] Improve clarity of Kernel::catch
+ documentation, patch by Jesse Sielaff.
+
+Mon Jul 28 06:24:54 2014 Zachary Scott <e@zzak.io>
+
+ * lib/uri/common.rb: [DOC] [Bug #9563] Recommend using URI.escape
+ before parsing a uri to avoid invalid characters. Reported by
+ Evgeniy Serykh.
+
+Mon Jul 28 05:55:56 2014 Zachary Scott <e@zzak.io>
+
+ * time.c: [DOC] Clarify %Y in strftime, which can accept any digits
+ and will output at least 4 digits as the year. Reported by Yury
+ Trofimenko [Bug #10049]
+
+ * lib/time.rb: ditto
+
+Mon Jul 28 05:32:06 2014 Zachary Scott <e@zzak.io>
+
+ * lib/uri/common.rb: [DOC] [Bug #10075] Clarify how URI.join arguments
+ are handled by RFC3986, originally reported by John Feminella.
+
+Mon Jul 28 05:21:41 2014 Zachary Scott <e@zzak.io>
+
+ * file.c: [DOC] Clarify how File.file? handles symbolic links. Also
+ cleaned up the rdoc style for this method, more to follow.
+ Originally reported by Michael Renner [Bug #10067]
+
+Mon Jul 28 05:12:22 2014 Zachary Scott <e@zzak.io>
+
+ * time.c: [DOC] Remove dead link and old bug report, which hasn't been
+ reproduced in a few years. Reported by Federico Builes [Bug #10071]
+
+Mon Jul 28 04:39:58 2014 Zachary Scott <e@zzak.io>
+
+ * ext/zlib/zlib.c: [DOC] Remove default value of Zlib constants, as
+ they may change in the implementation without notice. Patched by
+ @robin850 [Fixes GH-682] https://github.com/ruby/ruby/pull/682
+
+Mon Jul 28 04:35:35 2014 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_hmac.c: Fix NO_HMAC warning [Fixes GH-665]
+ Patched by @vipulnsward https://github.com/ruby/ruby/pull/665
+
+Sun Jul 27 19:49:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/cgi/core.rb: remove unused variables.
+ * lib/erb.rb: ditto.
+ * lib/mkmf.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * lib/optparse/version.rb: ditto.
+ * lib/prime.rb: ditto.
+ * lib/racc/parser.rb: ditto.
+ * lib/rexml/document.rb: ditto.
+ * lib/rexml/dtd/dtd.rb: ditto.
+ * lib/rexml/element.rb: ditto.
+ * lib/rexml/functions.rb: ditto.
+ * lib/rexml/parsers/xpathparser.rb: ditto.
+
+Sun Jul 27 05:11:21 2014 Zachary Scott <e@zzak.io>
+
+ * lib/irb.rb: [DOC] PROMPT_I cannot be nil, patch by @hgillane
+ Fixes documenting-ruby/ruby#37
+ https://github.com/documenting-ruby/ruby/pull/37
+
+Sun Jul 27 02:41:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/shell/command-processor.rb: remove unused variable.
+ * lib/shell/system-command.rb: ditto.
+ * lib/tmpdir.rb: ditto.
+ * lib/uri/generic.rb: ditto.
+
+Sun Jul 27 02:08:31 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/weakref.rb: split executable code into sample directory.
+ * sample/weakref.rb: ditto.
+
+Sun Jul 27 02:06:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/delegate.rb: split executable code into sample directory.
+ * sample/delegate.rb: ditto.
+
+Sun Jul 27 01:46:34 2014 Zachary Scott <e@zzak.io>
+
+ * proc.c (method_super_method): [DOC] Method#super_method
+
+Sun Jul 27 01:22:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (method_super_method): new method Method#super_method,
+ which returns a method object of the method to be called by
+ `super` in the receiver method object.
+ [ruby-core:62202] [Feature #9781]
+
+Sat Jul 26 17:22:14 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * ext/objspace/objspace_dump.c (dump_append): avoid fflush.
+
+ because dump_append_string_value() iterates over each chars,
+ fflush()-ing here effectively issues system calls on every single
+ bytes exist in a ruby process.
+
+Sat Jul 26 16:55:18 2014 Eric Wong <e@80x24.org>
+
+ * iseq.h (struct iseq_compile_data_storage): reduce overhead
+ to 16 bytes (from 32) on 64-bit
+
+Sat Jul 26 16:28:06 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (struct rb_iseq_struct): reduce to 280 bytes
+ (from 288 bytes) on 64-bit
+
+Sat Jul 26 06:44:43 2014 Eric Wong <e@80x24.org>
+
+ * parse.y (struct parse_params): shrink to 320 to 304 bytes on 64-bit
+
+Sat Jul 26 05:58:35 2014 Eric Wong <e@80x24.org>
+
+ * include/ruby/ruby.h (ZALLOC, ZALLOC_N): implement
+ (Data_Make_Struct, TypedData_Make_Struct):
+ ZALLOC replaces ALLOC+memset
+ [ruby-core:63951][Feature #10082]
+ * compile.c (iseq_seq_sequence): ZALLOC_N replaces ALLOC_N+MEMZERO
+ * cont.c (fiber_t_alloc): ZALLOC replaces ALLOC+MEMZERO
+ * io.c (rb_io_reopen): ditto
+ * iseq.c (prepare_iseq_build): ditto
+ * parse.y (new_args_tail_gen, parser_new, ripper_s_allocate): ditto
+ * re.c (match_alloc): ditto
+ * variable.c (rb_const_set): ditto
+ * ext/socket/raddrinfo.c (get_addrinfo): ditto
+ * ext/strscan/strscan.c (strscan_s_allocate): ditto
+ * gc.c (rb_objspace_alloc): calloc replaces malloc+MEMZERO
+
+Sat Jul 26 05:54:54 2014 Eric Wong <e@80x24.org>
+
+ * symbol.c (dsymbol_check): remove unneeded semi-colon
+
+Fri Jul 25 14:07:27 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change objspace::rgengc::parent_object_is_old (boolean)
+ to objspace::rgengc::parent_object (VALUE).
+ Use Qfalse or RVALUE pointer instead of FALSE and TRUE.
+
+ * gc.c (gc_marks_body): should clear parent_object just before
+ gc_mark_roots() because there are no parents objects
+ for root objects.
+
+Fri Jul 25 13:45:39 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_writebarrier_remember_promoted): should remember only
+ OLD objects on RGENGC_AGE2_PROMOTION.
+
+Fri Jul 25 13:42:02 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_stacked_objects): fix error message.
+
+Fri Jul 25 13:18:00 2014 Will Farrington <wfarrington@digitalocean.com>
+
+ * ext/socket/socket.c (sock_gethostname): Use NI_MAXHOST to support
+ hostnames longer than 64 characters if the system supports it.
+ [fixes GH-683]
+
+Fri Jul 25 12:21:11 2014 Santiago Pastorino <santiago@wyeworks.com>
+
+ * compile.c (defined_expr): make the condition if the receiver
+ is explicit or implicit cleaner. [fix GH-681]
+
+Fri Jul 25 03:53:52 2014 Eric Hodel <drbrain@segment7.net>
+
+ * doc/keywords.rdoc: [DOC] Describe each keyword.
+
+Thu Jul 24 22:40:24 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (Init_win32ole): add WIN32OLE_RECORD#initialize
+ method.
+
+ * ext/win32ole/win32ole.c (ole_val2variant): convert WIN32OLE_RECORD
+ object to VT_RECORD variant.
+
+Thu Jul 24 20:10:59 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: fix major GC flags.
+ * add GPR_FLAG_MAJOR_BY_FORCE, which indicates
+ major GC by METHOD, CAPI and so on (see GC_BY).
+ * remove GPR_FLAG_MAJOR_BY_RESCAN because not used.
+ * remove GPR_FLAG_MAJOR_BY_STRESS, use FORCE instead.
+
+ * test/ruby/test_gc.rb: catch up.
+
+Thu Jul 24 15:55:02 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * include/ruby/io.h (struct rb_io_buffer_t): PACKED_STRUCT should not
+ be used for platform-specific optimization. PACKED_STRUCT_UNALIGNED
+ should be used. [ruby-core:63988] [Bug #10088]
+
+Thu Jul 24 04:42:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/benchmark.rb: split executable code into sample directory.
+ * sample/benchmark.rb: ditto.
+
+Thu Jul 24 04:36:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/tempfile.rb: split executable code into sample directory.
+ * sample/tempfile.rb: ditto.
+
+Thu Jul 24 04:29:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/pstore.rb: split executable code into sample directory.
+ * sample/pstore.rb: ditto.
+
+Wed Jul 23 23:50:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/defines.h, siphash.c, st.c (UNALIGNED_WORD_ACCESS):
+ add PowerPC64 too, which is capable to access unaligned words.
+ patched by Gustavo Frederico Temple Pedrosa in [ruby-core:63937].
+ [Feature #10081]
+
+ * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): ditto.
+
+Wed Jul 23 04:04:38 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/drb/extserv.rb: remove duplicate code with sample directory.
+ contributed from @vipulnsward. [fix GH-679]
+
+Tue Jul 22 12:56:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_count): fix wrong single-byte optimization.
+ 7bit ascii can be a trailing byte in Shift_JIS.
+ [ruby-dev:48442] [Bug #10078]
+
+Tue Jul 22 01:48:38 2014 Eric Wong <e@80x24.org>
+
+ * include/ruby/io.h (rb_io_buffer_t): fix packing on gcc
+ r46892 caused packing to be a no-op on gcc (4.7.2-5, Debian)
+ [Bug #10079][ruby-core:63912]
+
+Mon Jul 21 15:55:42 2014 fuji70 <fujifuji70@gmail.com>
+
+ * lib/optparse.rb (getopts): print default values and descriptions
+ in the help message. [fix GH-676]
+
+Sun Jul 20 14:26:27 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (rb_proc_t): reduce to 64 bytes from 72 on 64-bit
+
+Sun Jul 20 13:50:34 2014 Eric Wong <e@80x24.org>
+
+ * transcode.c (rb_econv_t): reduce to 184 bytes from 200 on 64-bit
+
+Sun Jul 20 12:44:23 2014 Eric Wong <e@80x24.org>
+
+ * include/ruby/io.h (rb_io_buffer_t): pack structure
+ Reduces rb_io_t from 200 to 192 bytes, allowing rb_io_t to
+ occupy one less cache line.
+ [Feature #10050]
+
+Sun Jul 20 12:41:53 2014 Eric Wong <e@80x24.org>
+
+ * include/ruby/io.h (rb_io_t): shrink to 200 bytes from 216 on 64-bit
+ This puts us within 8 bytes of being three cache lines instead of
+ four lines on x86-64. This breaks the ABI.
+ [Feature #10050]
+
+Sun Jul 20 12:36:46 2014 Eric Wong <e@80x24.org>
+
+ * include/ruby/oniguruma.h (struct re_pattern_buffer): shrink to 448
+ bytes from 464 bytes on 64-bit. This breaks the ABI.
+ [Feature #10034]
+
+Sun Jul 20 01:06:06 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/openssl/ossl.c: use encryptor instead of encrypter in doc.
+ contributed from @vipulnsward. [fix GH-663]
+
+Sun Jul 20 00:32:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_initialize): [DOC] fix rdoc of append mode. it does
+ not move the pointer at open. [ruby-core:63747] [Bug #10039]
+
+Sat Jul 19 12:40:50 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): allow to access private attribute
+ reader in op_assign. [ruby-core:63817] [Bug #10060]
+
+Sat Jul 19 11:56:36 2014 Grey Baker <greysteil@gmail.com>
+
+ * lib/time.rb (Time#apply_offset): Guards against a `nil` return
+ value from `Time.month_days` when offsetting date. Out of range
+ values are then caught when `Time.utc` is called (as usual).
+
+ Previously a `nil` return value from `Time.month_days` would
+ have the `<` operator called on it, and raise `NoMethodError`.
+ [fix GH-667]
+
+ * lib/rdoc/parser/changelog.rb (RDoc#parse_entries): fix dirty hack.
+
+Sat Jul 19 06:19:01 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: refactoring.
+
+Fri Jul 18 22:34:41 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (folevariant_initialize): WIN32OLE_VARIANT
+ does not support VT_RECORD. VT_RECORD should be supported in
+ WIN32OLE_RECORD.
+
+ * test/win32ole/test_win32ole_variant.rb (test_s_new_vt_record_exc):
+ ditto.
+
+Fri Jul 18 19:54:03 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (folevariant_initialize): remove unnecessary
+ code.
+
+Fri Jul 18 19:11:03 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix/eigenvalue_decomposition: Style fix
+ Patch by Gogo Tanaka [#10058]
+
+Fri Jul 18 19:03:53 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Avoid using `and`.
+ Patch by gogo tanaka [#10058]
+
+Fri Jul 18 17:41:54 2014 GoGo tanaka <qlli.illb@gmail.com>
+
+ * test/matrix/test_matrix.rb: Add tests for Matrix class.
+ [Feature #10057][ruby-core:63809]
+
+Fri Jul 18 10:14:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/fileutils.rb: added missing options of FileUtils.touch by @Domon.
+ [fix GH-669]
+
+Thu Jul 17 19:57:27 2014 Herwin <herwin@quarantainenet.nl>
+
+ * ext/thread/thread.c (rb_szqueue_push): add optional parameter,
+ non_block defaulted to false. [ruby-core:63794] [Feature #10052]
+
+Wed Jul 16 23:01:43 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_variant2val): support array of
+ VT_RECORD variant.
+
+Wed Jul 16 20:21:49 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm_core.h (struct rb_iseq_struct): stack_max is changed to int
+ because all calculations related to stack_max in compile.c
+ (iseq_set_sequence) and vm_insnhelper.c (vm_push_frame) are
+ conducted by using int. This partly reverts r23945.
+ * vm_insnhelper.c (vm_push_frame): ditto. This reverts r42401.
+
+Wed Jul 16 19:55:32 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm_core.h (struct rb_iseq_struct): temporal workaround of [Bug 10037].
+ Add padding on big-endian 64-bit architecture (e.g. sparc64).
+
+Wed Jul 16 19:32:23 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (fole_record_method_missing): call
+ rb_hash_fetch instead of rb_hash_aref.
+
+Wed Jul 16 18:08:47 2014 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (rb_iseq_defined_string): use rb_gc_mark_object() instead of
+ marking from vm_mark().
+
+ * vm.c (rb_vm_mark): ditto.
+
+Wed Jul 16 18:03:50 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_roots): call rb_vm_mark directly.
+
+ * vm.c: remove mark function for RubyVM object because
+ RubyVM object marked manually.
+
+Wed Jul 16 12:25:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c: Merge Onigmo 5.14.1 25a8a69fc05ae3b56a09.
+ this includes Support for Unicode 7.0 [Bug #9092].
+
+Tue Jul 15 23:59:27 2014 Jared Jennings <jared.jennings.ctr@us.af.mil>
+
+ * ext/digest: make built-in digest function implementations
+ indicate success or failure of init and final functions.
+ [ruby-core:61614] [Bug #9659]
+
+ * ext/digest/digest.c: expect digest init and finish functions to
+ indicate success or failure; raise exception on failure.
+ [ruby-core:61614] [Bug #9659]
+
+Tue Jul 15 20:31:40 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: modify document for WIN32OLE_RECORD.
+
+Tue Jul 15 12:42:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * defs/default_gems: change version definition file of rake.
+
+Tue Jul 15 12:00:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rake.rb, lib/rake/*.rb: Upgrade to rake-10.3.2
+ [fix GH-668]
+ * test/rake/*.rb: ditto.
+
+Mon Jul 14 19:14:51 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: modify WIN32OLE class document and
+ add comment for constants of WIN32OLE.
+
+Mon Jul 14 16:38:45 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (struct rb_iseq_struct): reduce to 288 bytes
+ on x86-64 (from 296 bytes)
+
+Mon Jul 14 16:07:25 2014 Eric Wong <e@80x24.org>
+
+ * iseq.h (struct iseq_catch_table_entry): shrink to 32 bytes
+ on x86-64 (from 48 bytes)
+
+Mon Jul 14 16:04:41 2014 Eric Wong <e@80x24.org>
+
+ * iseq.h (struct iseq_catch_table): new flexible array struct
+ (iseq_catch_table_bytes): allocated size function
+ * vm_core.h (struct rb_iseq_struct): update catch_table member
+ This reduces the struct from 304 to 296 bytes on x86-64.
+ * compile.c (iseq_set_exception_table): update for struct changes
+ * iseq.c (iseq_free): ditto
+ * iseq.c (iseq_memsize): ditto
+ * iseq.c (rb_iseq_disasm): ditto
+ * iseq.c (iseq_data_to_ary): ditto
+ * iseq.c (rb_iseq_build_for_ruby2cext): ditto (untested)
+ * vm.c (vm_exec): ditto
+ * vm_core.h (struct rb_iseq_struct): ditto
+ * vm_insnhelper.c (vm_throw): ditto
+
+Sun Jul 13 17:49:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/openssl/ossl_cipher.c: Fix call to ciphers class method and
+ spell out `encryption` by @vipulnsward [fix GH-664]
+
+Sun Jul 13 17:31:51 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/gdbm/gdbm.c: fix wrong arguments in GetDBM2 macro.
+ * ext/sdbm/init.c: ditto.
+
+Sun Jul 13 17:25:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/dbm/dbm.c: fix wrong arguments in GetDBM2 macro by @v2e4lisp.
+ [fix GH-655]
+
+Sun Jul 13 16:44:56 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (struct rb_call_info_struct): improve packing
+ This reduces the struct from 112 to 104 bytes on x86-64.
+
+Sun Jul 13 15:53:25 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (struct rb_iseq_struct): stack_max is uint32_t
+ This reduces the struct from 312 to 304 bytes on x86-64.
+
+Sun Jul 13 10:56:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_broken_backtrace): exit with failure
+ normally, no needs to abort. [ruby-core:63678] [Bug #10008]
+
+Sat Jul 12 15:10:22 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (fole_record_method_missing): correct
+ fields Hash key.
+
+Sat Jul 12 04:17:40 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/net/smtp.rb (Net::SMTP#data): enable buffering while
+ 'data' send for optimizing Net::SMTP#send_message.
+ [ruby-dev:48329] [misc #9981]
+ patch by Masahiro Tomita.
+
+Sat Jul 12 01:13:45 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/ruby/envutil.rb (assert_no_memory_leak): On Solaris 9 or later,
+ if possible, execute child ruby with environment variables
+ LD_PRELOAD=libumem.so UMEM_OPTIONS="backend=mmap". With these
+ variables, freed memory is immediately returned to the OS.
+ [Bug #10020] [ruby-dev:48391]
+
+Fri Jul 11 20:49:10 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c: add WIN32OLE_RECORD class to support
+ VT_RECORD OLE variables.
+
+Fri Jul 11 17:15:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/abbrev.rb: remove executable.
+
+Fri Jul 11 16:45:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/fileutils.rb: handle ENOENT error with symlink targeted to
+ non-exists file. [ruby-dev:45933] [Bug #6716]
+
+Fri Jul 11 15:59:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * array.c: Clarify documentation for Array#insert.
+ [ruby-core:62934] [Bug #9901]
+
+Fri Jul 11 15:39:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * io.c: Improve Documentation by @dapplebeforedawn.
+ [fix GH-658] [ruby-core:63579] [Bug #10012]
+
+Fri Jul 11 14:19:14 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Fix sign for cross_product [#9499]
+
+Fri Jul 11 11:11:50 2014 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/prepare_so_k_nucleotide.rb: use require_relative.
+
+ * benchmark/prepare_so_reverse_complement.rb: ditto.
+
+Fri Jul 11 10:09:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (encodes): fix buffer overrun by tail_lf. Thanks to
+ Mamoru Tasaka and Tomas Hoger. [ruby-core:63604] [Bug #10019]
+
+Thu Jul 10 23:51:36 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * hash.c (ruby_setenv): Fix TestEnv#test_aset failure on Solaris 9.
+ When name contains '=', ruby_setenv raises Errno::EINVAL.
+ That is the same behavior as Solaris 10.
+ NULL check for malloc return value is also added.
+
+Thu Jul 10 15:02:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_callee_setup_keyword_arg): adjust VM stack
+ pointer to get rid of overwriting splat arguments by arguments
+ for `to_hash` conversion. [ruby-core:63593] [Bug #10016]
+
+Thu Jul 10 01:09:57 2014 Koichi Sasada <ko1@atdot.net>
+
+ * symbol.c: remove rb_gc_mark_symbols().
+
+ fstrings referred by static symbols and pinned dynamic symbols
+ are registered by rb_gc_register_mark_object().
+
+ fstrings referred by dynamic symbols (not pinned symbols)
+ are referred from global_symbols.dsymbol_fstr_hash (Hash object).
+
+ Note that fstrings referred from dynamic symbols must live logger
+ than symbol objects themselves because rb_gc_free_dsymbol() uses
+ fstrings to remove from symbol tables.
+ This is why we can not mark fstrings from dynamic symbols.
+
+ This technique reduces root objects for GC marking.
+
+ * gc.c (gc_mark_roots): ditto.
+
+ * internal.h: ditto.
+
+Thu Jul 10 00:24:18 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * common.mk (DTRACE_DEPENDENT_OBJS): fix build failure on Solaris
+ introduced in r46768. Object files containing dtrace probes should
+ be listed in DTRACE_DEPENDENT_OBJS.
+
+Wed Jul 9 17:07:28 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * symbol.c, symbol.h: Symbol class implementation and internals,
+ split from parse.y.
+
+Wed Jul 9 14:45:39 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y: change Symbol <-> ID relationship to avoid
+ exposing IDs from collectable symbols.
+ [Bug #10014]
+
+ Now, rb_check_id() returns 0 if corresponding symbol is
+ pinned dynamic symbol.
+
+ There is remaining intern_cstr_without_pindown(), it can return
+ IDs from collectable symbols. We must be careful to use it
+ (only used in parse.y). I think it should be removed if
+ it does not have impact for performance.
+
+ * parse.y:
+ add:
+ * STATIC_SYM2ID()
+ * STATIC_ID2SYM()
+ rename:
+ * rb_pin_dynamic_symbol() -> dsymbol_pindown()
+
+ * internal.h:
+ remove:
+ * rb_check_id_without_pindown()
+ * rb_sym2id_without_pindown()
+ add:
+ * rb_check_symbol()
+ * rb_check_symbol_cstr()
+
+ * load.c: use rb_check_id() or rb_check_id_cstr().
+
+ * object.c: ditto.
+
+ * struct.c: ditto.
+
+ * thread.c: ditto.
+
+ * vm_method.c: ditto.
+
+ * string.c (sym_find): use only rb_check_symbol().
+
+ * sprintf.c (rb_str_format): use rb_check_symbol_cstr().
+
+Wed Jul 9 12:21:55 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y (symbols_i): delete garbage symbols for Symbol.all_symbols.
+
+Wed Jul 9 05:49:08 2014 Eric Wong <e@80x24.org>
+
+ * thread_pthread.h (struct rb_global_vm_lock_struct):
+ do not expose pthread type for lock
+
+Wed Jul 9 05:41:40 2014 Eric Wong <e@80x24.org>
+
+ * thread_pthread.h: remove unneeded semaphore.h include
+
+Wed Jul 9 00:12:28 2014 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/irb/ruby-lex.rb: fix counting indent in identify_string_dvar.
+
+Tue Jul 8 16:58:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/memory_status.rb (Memory::PSCMD): use ps command which
+ outputs expected result. [ruby-dev:48370] [Bug #10010]
+
+Tue Jul 8 14:45:17 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y (dsymbol_alloc): set global_symbols.minor_marked to 0.
+
+ * parse.y (dsymbol_check): set RSYMBOL(sym)->fstr to 0
+ because we should not touch fstr after that.
+
+ * parse.y (rb_gc_free_dsymbol): skip deleting str and sym
+ from tables if fstr == 0.
+
+Mon Jul 7 14:31:52 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y: remove global_symbols::pinned_dsym
+ (and ::pinned_dsym_minor_marked).
+
+ Mark pinned dsymbols by rb_gc_register_mark_object() because
+ they are immortal.
+
+ * parse.y (rb_gc_free_dsymbol): rename parameter name `ptr' to `sym'.
+
+Mon Jul 7 12:45:51 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: revert miss-commit.
+
+Mon Jul 7 12:40:59 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y: need to use updated (re-created) symbols.
+
+Mon Jul 7 11:02:55 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/mkconfig.rb: remove not to require rbconfig/obsolete.rb.
+
+ * lib/rbconfig/obsolete.rb: removed.
+
+Mon Jul 7 10:52:03 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y: do not use rb_gc_resurrect(), but create a new dynamic
+ symbol for garbage dynamic symbol.
+
+ * common.mk: use gc.h by parse.y.
+
+Mon Jul 7 02:18:42 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (fstr_update_callback): do not use rb_gc_resurrect()
+ any more.
+
+ Make new frozen string and replace with garbage frozen string.
+
+ * common.mk: use gc.h from string.c.
+
+Mon Jul 7 00:36:13 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename is_dying_object() to is_garbage_object().
+
+ * gc.h: rb_objspace_garbage_object_p() as an exported function.
+
+Sun Jul 6 21:30:35 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (is_dying_object): fix missed condition.
+
+ * gc.c (is_live_object): move frequent path first.
+
+Sun Jul 6 21:00:11 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename is_dead_object() to is_dying_object().
+ This function is not opposite against is_live_object()
+ because is_dying_object() does *not* check object type.
+
+ * gc.c (is_dying_object): change condition.
+
+ * gc.c (is_live_object): use T_NONE instead of 0.
+
+ * gc.c (rb_objspace_dying_object_p): added.
+
+Sun Jul 6 13:37:27 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_register_mark_object): change data structure.
+ From single array, to array of arrays. Each array only has 1024
+ entries.
+
+ * vm.c (Init_vm_objects): change default capa from 1 to 128.
+
+Sat Jul 5 05:05:53 2014 Vipul A M <vipulnsward@gmail.com>
+
+ * lib/irb/locale.rb (IRB::Locale#modifier): fix wrong attr_reader
+ `modifieer` => `modifier` from irb locale. [fix GH-656]
+
+Fri Jul 4 20:45:26 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y: rename symbols::sym_id to symbols::str_id.
+ This table is not {Symbol => ID} table, but
+ {String => ID} table.
+
+ * parse.y (lookup_sym_id): also rename lookup_sym_id() to
+ lookup_str_id() because key is not Symbol, but String.
+
+Fri Jul 4 18:42:04 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y (must_be_dynamic_symbol): fix missed-condition.
+
+Fri Jul 4 18:38:11 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y (rb_pin_dynamic_symbol): should be `static' function.
+
+Fri Jul 4 18:03:35 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y (must_be_dynamic_symbol): refactoring.
+ * add `inline'.
+ * use UNLIKELY().
+ * check only DYNAMIC_SYM_P(), otherwise it is a bug.
+ * lookup_id_str() is not needed in second condition.
+
+Fri Jul 4 11:53:56 2014 Koichi Sasada <ko1@atdot.net>
+
+ * parse.y: remove unused code
+ surrounded by `#if ENABLE_SELECTOR_NAMESPACE'
+
+Fri Jul 4 10:08:24 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/rubygems/test_gem_package.rb: avoid tempfile leaks using Tempfile#close!
+ * test/rubygems/test_gem_request_set.rb: ditto.
+ * test/rubygems/test_gem_request_set_gem_dependency_api.rb: ditto.
+
+Fri Jul 4 04:42:05 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/response.rb (Net::Inflater#inflate_adapter):
+ prevent automatic encoding conversion.
+
+Fri Jul 4 04:39:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http/response.rb (Net::HTTPResponse.each_response_header):
+ raise first exception even if inflate_body_io.finish raises error.
+ when begin block raises error, finish usually raises error too.
+
+Fri Jul 4 02:56:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (URI::Generic#query=): remove validation, just
+ escape. [Feature #2542]
+
+ * lib/uri/generic.rb (URI::Generic#fragment=): ditto.
+
+ * lib/uri/generic.rb (URI::Generic#check_query): removed.
+
+ * lib/uri/generic.rb (URI::Generic#set_query): ditto.
+
+ * lib/uri/generic.rb (URI::Generic#check_fragment): ditto.
+
+ * lib/uri/generic.rb (URI::Generic#set_fragment): ditto.
+
+Thu Jul 3 12:40:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (--with-static-linked-ext): fix for extensions to
+ be linked statically.
+
+ * Makefile.in, common.mk: use ENCSTATIC for enc directory.
+
+ * ext/extmk.rb: supply dependencies of statically linked extension
+ libraries.
+
+Wed Jul 2 15:45:49 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_heap_lazy_sweep): simplify logic.
+
+ * gc.c (gc_page_sweep): return TRUE if empty slots are available.
+
+Wed Jul 2 09:48:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * logger.rb: removed unmaintained code.
+ [Feature #9860][ruby-core:62724]
+ * test/logger/test_application.rb: ditto.
+
+Wed Jul 2 03:20:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * node.c (dump_node): handle nd_value == (NODE *)-1 to mean this
+ keyword argument is required
+
+Wed Jul 2 02:57:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (rb_vm_env_local_variables): returns array of local
+ variable name symbols in the environment by envval.
+
+ * proc.c (bind_local_variables): use rb_vm_env_local_variables.
+
+Wed Jul 2 02:23:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (bind_receiver): new method to return the bound receiver
+ of the binding object. [ruby-dev:47613] [Feature #8779]
+
+Wed Jul 2 02:14:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (bind_local_variables): update env from envval for each
+ iterations. [ruby-dev:48351] [Bug #10001]
+
+Tue Jul 1 23:46:34 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * NEWS: [DOC] mention about Binding#local_variables, introduced at
+ r44392 (see [Feature #8773]).
+
+Tue Jul 1 23:30:51 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * numeric.c (num_step_scan_args): table argument of rb_get_kwargs() is
+ array of IDs, not Symbols. [ruby-dev:48353] [Bug #9811]
+
+Tue Jul 1 16:18:22 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/digest/lib/digest/hmac.rb, test/digest/test_digest_hmac.rb:
+ Digest::HMAC is finally removed as previously noticed.
+ [fix GH-648]
+
+Tue Jul 1 11:13:43 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/date/lib/date/format.rb: removed empty file by @vipulnsward.
+ * ext/date/lib/date.rb: removed needless require.
+ [fix GH-647]
+
+Mon Jun 30 16:42:52 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat_internal): return size_t value instead of VALUE
+ and remove `out' parameter.
+
+ * gc.c: add braces for `if' statements.
+
+ * gc.c (gc_stat_internal): fix comment.
+
+Mon Jun 30 15:07:34 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: support `USE_RGENGC == 0'.
+
+ * test/ruby/test_gc.rb: ditto.
+
+Mon Jun 30 11:36:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * file.c: [DOC] document File.join returns a string.
+ Contributed by @dapplebeforedawn. [fix GH-646]
+
+Sat Jun 28 22:57:01 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/pathname/pathname.c (path_birthtime): Windows support.
+ see [Feature #9857] [ruby-dev:48339]
+
+Sat Jun 28 22:44:16 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_birthtime): New method,
+ Pathname#birthtime.
+ Proposed by Kazuhiro NISHIYAMA. [ruby-dev:48232] [Feature #9857]
+
+Sat Jun 28 20:29:03 2014 Simon Baird <simon.baird@gmail.com>
+
+ * ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error
+ message about zero or negative precision for clarity and
+ consistency with other methods. [GH-644]
+
+Sat Jun 28 15:32:57 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/utils.rb (create_listeners): Close socket objects.
+
+Sat Jun 28 13:58:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (setup_exception): should not overwrite SystemStackError
+ backtrace if set already. [ruby-core:63377] [Feature #6216]
+
+ * eval.c (setup_exception): get rid of method calls before raising
+ stack overflow, not to cause stack overflow again.
+
+ * defs/id.def: add IDs for backtraces.
+
+Sat Jun 28 04:08:22 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/mailto.rb: update to latest specs, RFC 6068 and HTML5.
+
+ * lib/uri/mailto.rb (HEADER_PATTERN): removed.
+
+ * lib/uri/mailto.rb (HEADER_REGEXP): use RFC 6068 hfields.
+
+ * lib/uri/mailto.rb (EMAIL_REGEXP): use HTML5 email regexp.
+
+ * lib/uri/mailto.rb (URI::MailTo.build): support multiple to addresses.
+
+ * lib/uri/mailto.rb (URI::MailTo#initialize): Support multiple to
+ addresses. Don't check with regexp, only split.
+
+ * lib/uri/mailto.rb (URI::MailTo#check_to): verify by matching
+ URI path-rootless and HTML5 email regexp with unescaped one.
+
+ * lib/uri/mailto.rb (URI::MailTo#check_headers): verify only by
+ HEADER_REGEXP.
+
+ * lib/uri/mailto.rb (URI::MailTo#set_headers): don't check by
+ HEADER_REGEXP, only split it.
+
+Sat Jun 28 00:35:10 2014 Lauri Tirkkonen <lotheac@iki.fi>
+
+ * tool/mkconfig.rb: fix empty RbConfig::CONFIG["prefix"] when
+ configured --with-rubyarchprefix, remove prefix from rubyarchdir
+ after expansion for the case it does not start with '$(prefix)'.
+ [fix GH-643]
+
+Fri Jun 27 15:20:12 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rubygems/test_case.rb: rescue Gem::LoadError in Gem::TestCase.
+ because it's effected by removing minitest from stdlib.
+
+Fri Jun 27 12:29:37 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/rubygems/specification.rb: fixed broken condition caused
+ by removing YAML::ENGINE.
+ * lib/rubygems/package/old.rb: ditto.
+
+Fri Jun 27 05:33:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (env_shift): fix memory leak on Windows, free environment
+ strings block always. [ruby-dev:48332] [Bug #9983]
+
+Fri Jun 27 03:41:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (GETASTER): should not use the numbered argument to be
+ formatted, raise ArgumentError instead.
+ [ruby-dev:48330] [Bug #9982]
+
+Thu Jun 26 18:18:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/with_different_ofs.rb: move into test library directory.
+ * test/csv/base.rb: fix require path for with_different_ofs.rb.
+ * test/digest/test_digest_extend.rb: ditto.
+
+Thu Jun 26 18:06:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/profile_test_all.rb: move into test library directory.
+ * test/runner.rb: fix require path for profile_test_all.rb.
+
+Thu Jun 26 17:57:57 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/webrick/httpproxy.rb: remove useless assigned variables.
+ * lib/webrick/httpservlet/cgihandler.rb: ditto.
+ * lib/webrick/httpservlet/erbhandler.rb: ditto.
+ * lib/webrick/server.rb: ditto.
+
+Thu Jun 26 08:28:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (env_select): fix memory leak and crash on Windows, make
+ keys array first instead of iterating on environ directly.
+ [ruby-dev:48325] [Bug #9978]
+
+Thu Jun 26 02:45:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_error.c (error_print): put a newline after an anonymous
+ exception class name.
+
+Wed Jun 25 22:31:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (ruby_setenv): fix memory leak on Windows, free
+ environment strings block after check for the size.
+ [ruby-dev:48323] [Bug #9977]
+
+Wed Jun 25 15:44:12 2014 Eric Wong <e@80x24.org>
+
+ * ccan/container_of/container_of.h (container_off_var):
+ avoid warning with -Wcast-qual
+ [ccan ba5ad771af4aa9e085498de6c3c665c52694460f (Rusty Russell)]
+
+Wed Jun 25 10:19:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (env_aset, env_has_key, env_assoc, env_has_value),
+ (env_rassoc, env_key): prohibit tainted strings if $SAFE is
+ non-zero. [Bug #9976]
+
+Tue Jun 24 14:46:17 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/gserver.rb: remove redundant use of to_s in interpolation.
+ * lib/logger.rb: ditto.
+ * lib/optparse.rb: ditto.
+ * lib/rbconfig/obsolete.rb: ditto.
+ * lib/resolv.rb: ditto.
+ * lib/webrick/httpresponse.rb: ditto.
+
+Tue Jun 24 10:50:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (env_path_str_new): make PATH environment variable
+ string, to be frozen.
+
+Tue Jun 24 10:40:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * tool/make-snapshot: download bundle gems when package making.
+ [Feature #9852][ruby-core:62676]
+ * gems/bundled_gems: listed bundled gems for Ruby 2.2.
+
+Tue Jun 24 10:20:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * tool/downloader.rb: make Downloader class to general download utility.
+ It can be used without config.guess and config.sub.
+ * tool/get-config_files: ditto.
+ * tool/make-snapshot: ditto.
+
+Tue Jun 24 06:17:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * eval.c (setup_exception): "mesg == sysstack_error" and
+ sysstack_error_p(mesg) are duplicated.
+ r46502 seems to want to use latter.
+
+Tue Jun 24 06:15:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/tk/tcltklib.c: fix format specifiers for VALUE and
+ Tcl_Interp*. [ruby-core:63283] [Bug #9972]
+
+Tue Jun 24 05:40:41 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * nacl/nacl-config.rb: Use File.exist? instead of executable?
+ for irt_core. Recent nacl_sdk has non-executable irt_core.
+ Patch by Shinichiro Hamaji.
+ [Fixes GH-529] https://github.com/ruby/ruby/pull/529
+
+Mon Jun 23 18:44:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * tool/config_files.rb: rename class ConfigFiles to Downloader.
+ * tool/get-config_files: ditto.
+ * tool/make-snapshot: ditto.
+
+Mon Jun 23 18:03:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * tool/rbinstall.rb: support to install bundle gems.
+
+Mon Jun 23 17:33:11 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/net/imap.rb (Net::IMAP#fetch): [DOC] Describe how a range in
+ +set+ is interpreted, and mention -1 which can be used for '*'.
+
+Mon Jun 23 16:22:50 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * include/ruby/ruby.h (struct RHash): no longer. [Feature #9889]
+
+ * include/ruby/ruby.h (RHASH): ditto.
+
+ * include/ruby/ruby.h (RHASH_ITER_LEV): deprecated. Will be deleted later.
+
+ * include/ruby/ruby.h (RHASH_IFNONE): ditto.
+
+ * internal.h (struct RHash): moved here.
+
+ * internal.h (RHASH): ditto.
+
+ * hash.c (rb_hash_iter_lev): do not use this.
+
+ * hash.c (rb_hash_ifnone): ditto.
+
+Mon Jun 23 13:30:11 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * include/ruby/ruby.h (struct RComplex): no longer. [Feature #9888]
+
+ * include/ruby/ruby.h (RCOMPLEX): ditto.
+
+ * include/ruby/ruby.h (RCOMPLEX_SET_REAL): deprecated. Will be deleted later.
+
+ * include/ruby/ruby.h (RCOMPLEX_SET_IMAG): ditto.
+
+ * internal.h (struct RFloat): moved here.
+
+ * internal.h (RCOMPLEX): ditto.
+
+ * complex.c (rb_complex_set_real): do not use this.
+
+ * complex.c (rb_complex_set_imag): ditto.
+
+Mon Jun 23 13:10:15 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * include/ruby/ruby.h (struct RFloat): no longer. [Feature #9863]
+
+ * include/ruby/ruby.h (RFLOAT): ditto.
+
+ * internal.h (struct RFloat): moved here.
+
+ * internal.h (RFLOAT): ditto.
+
+Mon Jun 23 12:01:42 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb (check_port): allow strings for port= as
+ described in rdoc.
+
+ * lib/uri/rfc3986_parser.rb (regexp): implementation detail of above.
+
+Mon Jun 23 11:35:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (setup_exception): set backtrace in system stack error
+ other than the pre-allocated sysstack_error. [Feature #6216]
+
+ * proc.c (Init_Proc): freeze the pre-allocated sysstack_error.
+
+ * vm_insnhelper.c (vm_stackoverflow): raise new instance for each
+ times without calling any methods to keep the backtrace with no
+ further stack overflow.
+
+ * object.c (rb_obj_copy_ivar): extract function to copy instance
+ variables only for T_OBJECT from init_copy.
+
+Mon Jun 23 11:11:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (check_stack_overflow): drop the last tag too close to
+ the fault page, to get rid of stack overflow deadlock.
+ [Bug #9971]
+
+Sun Jun 22 09:11:15 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/generic.rb: remove registry.
+ 'registry' is not used and RFC3986 doesn't use it.
+
+Sun Jun 22 09:10:09 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/rfc3986_parser.rb: raise exception when given a URI string
+ has non ASCII in order to keep the regexp compiled for US-ASCII.
+
+Sun Jun 22 09:05:42 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (URI::REGEXP): move to lib/uri/rfc2396_parser.rb.
+
+ * lib/uri/common.rb (URI::Parser): ditto.
+
+ * lib/uri/common.rb (URI.split): use RFC3986_Parser. [Feature #2542]
+
+ * lib/uri/common.rb (URI.parse): ditto.
+
+ * lib/uri/common.rb (URI.join): ditto.
+
+ * lib/uri/common.rb (URI.extract): deprecated.
+
+ * lib/uri/common.rb (URI.regexp): ditto.
+
+ * lib/uri/rfc2396_parser.rb: added.
+
+ * lib/uri/rfc3986_parser.rb: added.
+
+Sun Jun 22 09:04:50 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/mailto.rb (initialize): as previous commit, fix arg_check
+
+Sun Jun 22 09:01:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/ftp.rb (initialize): argument checking flag is arg_check,
+ but arg[-1] is fragment.
+
+ * lib/uri/ftp.rb (initialize): explicitly specify arguments.
+
+Sat Jun 21 12:50:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
+ with 3-digit. libffi 3.1 returns just 2-digit.
+ [ruby-core:62920] [Bug #9897]
+
+Sat Jun 21 07:06:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (enc_find): [DOC] never accepted a symbol.
+ [ruby-dev:48308] [Bug #9966]
+
+Fri Jun 20 17:15:43 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/lib/tracepointchecker.rb: add to check TracePoint healthiness.
+
+ * test/runner.rb: use it.
+
+Fri Jun 20 07:26:44 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_settracefunc.rb: rewrite tests with
+ assert_consistent_call_return().
+
+ assert_consistent_call_return() is also modified to check
+ consistency.
+
+Fri Jun 20 07:07:28 2014 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (rb_iseq_compile_node): put start label of block after
+ trace (b_call).
+ [Bug #9964]
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
+ added assert_consistent_call_return() method check call/return
+ consistency.
+
+Fri Jun 20 05:26:27 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_eval.c (rb_catch_protect): fix same problem of [Bug #9961].
+
+ * vm_eval.c (rb_iterate): ditto.
+
+Thu Jun 19 21:41:30 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (rb_vm_rewind_cfp): add new function to rewind specified cfp
+ with invoking RUBY_EVENT_C_RETURN.
+ [Bug #9961]
+
+ * vm_core.h: ditto.
+
+ * eval.c (rb_protect): use it.
+
+ * eval.c (rb_rescue2): ditto.
+
+ * vm_eval.c (rb_iterate): ditto.
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
+ * vm_core.h (rb_vm_rewind_cfp): add the prototype declaration.
+
+Thu Jun 19 19:47:21 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (invoke_block_from_c): move call/return event timing for
+ bmethod. It can invoke inconsistent call event if this call raises
+ argument error.
+ [Bug #9959]
+
+ * vm_insnhelper.c (vm_call_bmethod_body): ditto.
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
+Thu Jun 19 18:14:47 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: add VM_FRAME_MAGIC_RESCUE to recognize normal block or
+ rescue clause.
+
+ * vm.c (vm_exec): use VM_FRAME_MAGIC_RESCUE on at rescue/ensure.
+
+ * test/ruby/test_settracefunc.rb: should not invoke b_return at rescue
+ clause.
+ [Bug #9957]
+
+ * vm_dump.c (control_frame_dump): check VM_FRAME_MAGIC_RESCUE.
+
+ * vm_dump.c (vm_stack_dump_each): ditto.
+
+Thu Jun 19 13:39:11 2014 Arne Brasseur <arne@arnebrasseur.net>
+
+ * proc.c (rb_method_curry): Implement Method#curry, which delegates
+ to to_proc.curry. [ruby-core:62212] [Feature #9783]
+
+Tue Jun 17 16:41:49 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (gets, readline): read lines without LF properly.
+ [ruby-core:63205] [Bug #9949]
+
+ * test/net/ftp/test_buffered_socket.rb: related test.
+
+Tue Jun 17 12:35:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (extract_raise_opts): pass unknown options to the
+ exception, so that exception class can receive a hash argument.
+ [ruby-core:63203] [Feature #8257]
+
+Tue Jun 17 12:24:57 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (obj_memsize_of): memsize_of(T_ZOMBIE) returns 0, not a rb_bug.
+ ObjectSpace.count_objects_size() uses memsize_of(T_ZOMBIE).
+
+ This bug introduced at r46348.
+
+Mon Jun 16 19:00:11 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/runner.rb: failure message should be passed as an argument.
+
+Mon Jun 16 18:42:57 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/runner.rb: capture TracePoint stat before setup and compare
+ it after teardown.
+
+Mon Jun 16 14:33:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (open): use UTF-8 version function to support
+ non-ascii path properly. [ruby-core:63185] [Bug #9946]
+
+Sat Jun 14 10:54:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rcombinate0): remove recursion, by looping with indexes
+ stored in `p`.
+
+ * array.c (rpermute0): remove recursion, by looping with indexes
+ stored in `p`.
+
+ * array.c (permute0): remove recursion, by looping with indexes
+ stored in `p`. [ruby-core:63103] [Bug #9932]
+
+Sat Jun 14 10:52:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_resize): update capa only when buffer get
+ reallocated.
+ http://d.hatena.ne.jp/nagachika/20140613/ruby_trunk_changes_46413_46420#r46413
+
+Sat Jun 14 08:28:59 2014 Zachary Scott <e@zzak.io>
+
+ * man/rake.1: [DOC] Update links for Rake, patch by @hsbt [Bug #9904]
+ [Fixes GH-628] https://github.com/ruby/ruby/pull/628
+
+Fri Jun 13 17:58:58 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: add new method TracePoint.stat to debug
+ TracePoint mechanism.
+
+ Ruby users should not use this method. So I don't note this method
+ in the NEWS file.
+
+ * test/runner.rb: detect zombie active TracePoints with
+ TracePoint.stat.
+
+Fri Jun 13 17:46:31 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: clear and restore recursive checking thread local data
+ to avoid unexpected throw from TracePoint.
+ [Bug #9940]
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
+ * thread.c: added
+ * rb_threadptr_reset_recursive_data(rb_thread_t *th);
+ * rb_threadptr_restore_recursive_data(rb_thread_t *th, VALUE old);
+
+ * vm_core.h: ditto.
+
+Fri Jun 13 17:33:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_combination): iterate on a shared copy, and use
+ array of indexes instead of array of chosen objects.
+ [ruby-core:63149] [Bug #9939]
+
+ * array.c (yield_indexed_values): extract from permute0(),
+ rpermute0(), and rcombinate0().
+
+Fri Jun 13 13:42:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_permutation): `p` is the array of size `r`, as
+ commented at permute0(). since `n >= r` here, buffer overflow
+ never happened, just reduce unnecessary allocation though.
+
+Thu Jun 12 20:32:28 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_resize): should consider the capacity instead
+ of the old length, as pointed out by nagachika.
+
+Thu Jun 12 18:31:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/net/http/responses.rb: added Net::HTTPPermanentRedirect(308)
+ Contributed by @yorkie [fix GH-638]
+
+Thu Jun 12 13:27:38 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_freeze): shrink the buffer before freezing, as
+ pointed out by Eric Wong at [ruby-core:63119].
+
+Thu Jun 12 13:09:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (expand_path): shrink expanded path which no longer needs
+ rooms to append. [ruby-core:63114] [Bug #9934]
+
+Wed Jun 11 17:37:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_scalar_pthread_t): pthread_t is not required
+ to be a scalar type.
+
+ * thread.c (fill_thread_id_string, thread_id_str): dump pthread_t
+ in hexadecimal form if it is not a scalar type, assume it can be
+ represented in a pointer form otherwise. based on the patch by
+ Rei Odaira at [ruby-core:62867]. [ruby-core:62857] [Bug #9884]
+
+ * thread_pthread.c (Init_native_thread, thread_start_func_1),
+ (native_thread_create): set thread_id_str if needed.
+
+ * vm_core.h (rb_thread_t): add thread_id_string if needed.
+
+Wed Jun 11 01:53:22 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: invoke GC before memory allocation (xmalloc/xrealloc)
+ when GC.stress = true.
+ [Bug #9859]
+
+ * test/ruby/test_gc.rb: add a test.
+
+Tue Jun 10 13:20:14 2014 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/core.rb: Provide a mechanism to specify the
+ max_multipart_length of multipart data.
+ [Feature #8370] patch by Leif Eriksen <leif.eriksen.au@gmail.com>
+
+Tue Jun 10 10:57:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/csv.rb (CSV#<<): honor explicitly given encoding. based on
+ the patch by DAISUKE TANIWAKI <daisuketaniwaki AT gmail.com> at
+ [ruby-core:62113]. [Bug #9766]
+
+Mon Jun 9 20:40:48 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change full GC timing to keep lower memory usage.
+
+ Extend heap only at
+ (1) after major GC
+ or
+ (2) after several (two times, at current) minor GC
+
+ Details in https://bugs.ruby-lang.org/issues/9607#note-9
+ [Bug #9607]
+
+Mon Jun 9 16:01:41 2014 Masahiro Ide <imasahiro9@gmail.com>
+
+ * gc.c (gcdebug_sentinel): fix typo, "sentinel" not "sential".
+ [fix GH-634]
+
+Mon Jun 9 00:04:25 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (posix_fadvise): disable use of posix_fadvise
+ itself on 32-bit AIX. [ruby-core:62968] [Bug #9914]
+
+Sun Jun 8 23:28:00 2014 <kanemoto@ruby-lang.org>
+
+ * io.c (rb_io_advise): AIX currently does not support a 32-bit call to
+ posix_fadvise() if _LARGE_FILES is defined. Patch by Rei Odaira.
+ [ruby-core:62968] [Bug #9914]
+
+Sun Jun 8 04:52:40 2014 Jun Hiroe <Jun.Hiroe@gmail.com>
+
+ * string.c (rb_str_slice_bang): [DOC] update return value against
+ a fixnum, which has changed because of M17N. [fix GH-631]
+
+Sat Jun 7 22:13:42 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * numeric.c (do_coerce): Add a warning when an exception is raised
+ or an invalid value is returned in #coerce called by
+ numeric comparison operators and the exception
+ thrown by the caller has no information on the failure.
+ In the next release such exception should not be rescued or
+ should be the cause of the caller exception. nil is accepted
+ as the "no possible coercion" return value. See #7688.
+
+ * test/ruby/test_numeric.rb: Add corresponding test.
+
+Sat Jun 7 18:15:33 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * numeric.c (bit_coerce): remove constant parameter `err'
+ (always TRUE) of bit_coerce().
+
+Sat Jun 7 16:01:57 2014 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+
+ * cont.c (rb_fiber_struct): keep context.uc_stack.ss_sp and context.uc_stack.ss_size
+ for later use. Patch by Rei Odaira. [ruby-core:62945] [Bug #9905]
+
+Sat Jun 7 12:51:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (read_all): truncate the buffer before appending read data,
+ instead of truncating before reading.
+ [ruby-core:55951] [Bug #8625]
+
+Sat Jun 7 12:28:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/digest/digest.c (rb_digest_instance_equal): no need to call
+ `to_s` twice. [Bug #9913]
+
+Sat Jun 7 11:35:01 2014 Tanaka Akira <akr@fsij.org>
+
+ * object.c (rb_mod_initialize_clone): Override Kernel#initialize_clone
+ to avoid an exception on Class.new.freeze.clone.to_s.
+ Reported by Andrew Grimm. [ruby-core:41858] [Bug #5828]
+
+Sat Jun 7 06:03:11 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * ext/digest/digest.c (rb_digest_instance_equal):
+ fix #== for non-string arguments. [ruby-core:62967] [Bug #9913]
+
+ * test/digest/test_digest.rb: add test for above.
+
+Fri Jun 6 22:19:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (private_recv_p): check by node type, instead of a
+ magic number.
+
+ * node.h (NODE_PRIVATE_RECV), parse.y (attrset_gen): remove
+
+Fri Jun 6 17:07:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each), parse.y (new_attr_op_assign_gen):
+ allow op assign to a private attribute.
+ [ruby-core:62949] [Bug #9907]
+
+Fri Jun 6 13:39:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_setstrbuf, io_read): should not shorten the given buffer until
+ read succeeds. [ruby-core:55951] [Bug #8625]
+
+Fri Jun 6 07:41:41 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a
+ tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
+ * test/psych/test_symbol.rb: test for change
+
+Thu Jun 5 16:08:39 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_page_sweep): refactoring.
+
+ * gc.c (gc_page_sweep): should not set, but add final_slots into
+ sweep_page->final_slots.
+
+Thu Jun 5 14:36:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (jemalloc): check for the header regardless drop-in
+ libjemalloc is found, for `malloc_conf` declaration.
+
+ * version.c (ruby_show_version): show `malloc_conf` if set.
+ [Feature #9113]
+
+ * configure.in (with-jemalloc): also check for header, for ABIs
+ which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF
+ platforms. [ruby-core:62939] [Feature #9113]
+
+ * include/ruby/missing.h: include alternative malloc header to
+ replace memory management functions.
+
+ * dln.c, io.c, parse.y, st.c: undef malloc family before
+ re-definition to suppress warnings.
+
+Thu Jun 5 12:52:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * man/ruby.1: remove rubyforge entry.
+
+Thu Jun 5 12:45:32 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * misc/README: use github link instead of rubyforge.
+
+Thu Jun 5 10:03:29 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (obj_free): check also FL_PROMOTED bit by RVALUE_OLD_P().
+
+Thu Jun 5 03:45:28 2014 Eric Wong <e@80x24.org>
+
+ * configure.in: add --with-jemalloc option
+ [ruby-core:62912]
+
+Wed Jun 4 22:28:14 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: introduce RZombie to manage zombie objects.
+ Rewrite finalizing logics with this type.
+
+ * gc.c (gc_verify_internal_consistency): verify zombie (finalizing)
+ objects count.
+
+Wed Jun 4 22:09:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (match_aref, rb_reg_regsub): consider encoding of captured
+ names, encoding-incompatible should not match.
+ [ruby-dev:48278] [Bug #9903]
+
+Wed Jun 4 21:23:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (match_aref): should not ignore name after NUL byte.
+ [ruby-dev:48275] [Bug #9902]
+
+Wed Jun 4 04:08:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (core_hash_merge_kwd): should return the result hash, which
+ may be converted from and differ from the given argument.
+ [ruby-core:62921] [Bug #9898]
+
+Tue Jun 3 23:32:34 2014 Tanaka Akira <akr@fsij.org>
+
+ * ruby.c (load_file_internal2): Extracted from load_file_internal.
+ (load_file_internal): Invoke load_file_internal2 using rb_protect.
+ Close an opened FD if load_file_internal2 raises an exception.
+
+Tue Jun 3 19:11:45 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_objspace_free): should not rest_sweep() here.
+ Some data structures are already freed.
+
+Tue Jun 3 18:43:51 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb: allocate more objects to invoke GC by newobj.
+ GC allows extending pages depends on heap_increment.
+
+Tue Jun 3 18:01:27 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_call_finalizer_at_exit): add
+ gc_verify_internal_consistency() when RGENGC_CHECK_MODE >= 2.
+
+Tue Jun 3 17:54:21 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: change the counting method for young objects.
+ clear counter at the beginning of every GC and
+ count promoted (infant->young) objects.
+
+ Some promotions (infant->young) are transition of promoting to old
+ objects. We should not count such promotions.
+
+ With this technique, we don't need to check young objects
+ at obj_free().
+
+Tue Jun 3 16:38:19 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: add verifying counters code in gc_verify_internal_consistency().
+ gc_verify_internal_consistency() counts all
+ - live objects
+ - young objects (if age2 promotion)
+ - old objects
+ in all pages and compares with objspace managing counters.
+
+ * gc.c (gc_after_sweep): do gc_verify_internal_consistency()
+ when RGENGC_CHECK_MODE >= 2.
+
+Tue Jun 3 13:14:04 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a body
+ type as "MIXED" followed immediately by params
+ [ruby-core:62864] [Bug #9885]
+ Patch by @rayners (David Raynes). [Fixes GH-622]
+ https://github.com/ruby/ruby/pull/622
+
+Tue Jun 3 13:18:24 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_live_slot): live slot count should not include final
+ slot (contains T_ZOMBIE) count.
+
+Tue Jun 3 13:03:21 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (obj_free): fix spacing.
+
+Tue Jun 3 12:59:32 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (check_gen_consistency): fix error message.
+
+Tue Jun 3 12:40:23 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: count old/young objects more correctly.
+
+ * gc.c (RVALUE_DEMOTE_FROM_OLD): decrement old object count.
+
+ * gc.c (RVALUE_DEMOTE_FROM_YOUNG): decrement young object count.
+
+ * gc.c (rb_gc_resurrect): increment old object count.
+
+ * gc.c (gc_marks_body): should not add old object count.
+ This code is completely my misunderstanding.
+
+ * gc.c (rb_gc_force_recycle): decrement young or old object count
+ correctly.
+
+Tue Jun 3 12:26:47 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/memory_status.rb: add $LOAD_PATH to load test/unit
+ correctly for fiddle/import unavailable environments.
+
+Tue Jun 3 09:45:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/openssl/test_ssl.rb (OpenSSL::TestSSL#test_verify_result):
+ shouldn't use same server for respective tests, because the 1st
+ test sometimes kills the server main loop silently.
+ [Bug #9881] [ruby-dev:48266]
+
+Tue Jun 3 01:34:59 2014 Zachary Scott <e@zzak.io>
+
+ * README.EXT: [DOC] Add rb_call_super when subclassing from @robin850
+ [Fixes GH-623] https://github.com/ruby/ruby/pull/623
+
+Mon Jun 2 17:14:49 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (ruby_vm_destruct): remove useless call of
+ rb_gc_force_recycle().
+
+ At this line, a VM object is already freed
+ (is changed to T_NONE) by rb_gc_call_finalizer_at_exit().
+
+Mon Jun 2 15:50:24 2014 Koichi Sasada <ko1@atdot.net>
+
+ * eval.c (rb_using_refinement): add write-barriers for
+ cref->nd_refinements.
+
+Mon Jun 2 12:26:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * CONTRIBUTING.md: added contributing guide for github. [fix GH-625]
+
+Mon Jun 2 07:30:33 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/envutil.rb (default_warning): New method.
+
+ * test/ruby/test_autoload.rb: Use EnvUtil.default_warning.
+
+Mon Jun 2 07:05:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/encoding.h: constify `rb_encoding` arguments.
+
+ * include/ruby/oniguruma.h: constify `OnigEncoding` arguments.
+
+Sun Jun 1 12:05:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/drb: Wrap tests definitions by DRbTests module. This makes
+ several tests (ACLEntryTest, TestBug4409, etc.) easier to understand
+ that they are tests for DRb.
+
+Sun Jun 1 11:36:25 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/rinda/ring.rb (RingFinger#make_socket): Close the socket on
+ exception.
+
+Sun Jun 1 06:55:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (intern_str): dynamic attrset ID is registered by
+ `rb_id_attrset()` already, so no further registration is needed.
+ [ruby-core:62861]
+
+Sun Jun 1 04:52:47 2014 Zachary Scott <e@zzak.io>
+
+ * lib/English.rb: [DOC] $LOADED_FEATURES moved to load.c [Fixes GH-620]
+ Patch submitted by @leafac in https://github.com/ruby/ruby/pull/620
+ * doc/globals.rdoc: Added $LOADED_FEATURES to list
+
+Sat May 31 22:30:14 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/leakchecker.rb: Leak checker extracted from
+ test/lib/minitest/unit.rb.
+
+Sat May 31 21:15:43 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * thread.c (rb_thread_atfork_internal): My compiler complains
+ about this variable being used before initialized. I looked at
+ the code and expanded the macro and turned out it was actually
+ USED for pointer arithmetic, not dereferenced. So this was
+ never a serious bug. But is annoying indeed to see warnings
+ every time. I added `=0` and all went healthy.
+
+ * configure.in: Also, I found that the problematic macro expansion
+ only happens when we lack __typeof__ C extension, which shall
+ not be the case of my compiler. I added AC_C_TYPEOF to kick ass.
+
+Sat May 31 16:32:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/ipaddr.rb: extracted inline tests into test dir.
+ * test/test_ipaddr.rb: ditto.
+
+Sat May 31 16:29:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/digest/lib/digest/hmac.rb: extracted inline tests into test dir.
+ * test/digest/test_digest_hmac.rb: ditto.
+
+Sat May 31 16:02:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_syslog.rb: remove executable.
+
+Sat May 31 08:58:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/unicode.c (init_case_fold_table): no longer need to
+ initialize tables at runtime.
+
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case unfolding table 3.
+
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case unfolding table 2.
+
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case unfolding table 1.
+
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case folding table.
+
+ * enc/unicode/case-folding.rb (print_table): merge non-locale and
+ locale tables, and reduce initializing loops.
+
+ * enc/unicode/case-folding.rb (CaseFolding): modularize, and add
+ --output-file option.
+
+ * enc/unicode/case-folding.rb: script to convert CaseFolding.txt,
+ translated from CaseFolding.py.
+
+Sat May 31 08:31:41 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Check Tempfile leaks for each test method
+ again.
+
+Sat May 31 03:50:50 2014 Zachary Scott <e@zzak.io>
+
+ * lib/delegate.rb: [DOC] Document raise in Delegator class
+ Patch by @lucasmazza. [Fixes GH-621]
+ https://github.com/ruby/ruby/pull/621
+
+Fri May 30 21:23:26 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/server.rb: Use a pipe to detect server shutdown.
+ shutdown() or close() for listening socket is not a reliable.
+ Actually, both doesn't work (doesn't wake up select()) on
+ DragonFly BSD 3.6.2.
+
+ * test/webrick/utils.rb: :ShutdownSocketWithoutClose is not required
+ now to immediate server shutdown detection.
+ This fixes fd leaks.
+
+ * test/net/http/utils.rb: Ditto.
+
+Fri May 30 20:58:37 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb (check_fd_leak): Sort the inspected
+ objects list for a FD.
+
+Fri May 30 18:06:55 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb (check_fd_leak): Try GC to delete leaked
+ FDs.
+
+Fri May 30 12:05:59 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/lib/test/unit/parallel.rb (_run_suite): orig_stdout may be nil
+ though I don't know the reason.
+
+Fri May 30 11:33:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_substr): need to reset code range for shared
+ string too, not only copied string.
+ [ruby-core:62842] [Bug #9882]
+
+Fri May 30 10:22:21 2014 Mark Lorenz <mlorenz@covermymeds.com>
+
+ * lib/erb.rb (result): [DOC] no longer accepts a Proc, as
+ Kernel.eval does not. [fix GH-619]
+
+Fri May 30 07:25:46 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/-test-/dir: Dir#fileno implemented.
+
+ * test/lib/minitest/unit.rb (find_fds): Don't return the fd used to
+ scan /proc/$$/fd.
+
+Fri May 30 04:48:00 2014 Eric Wong <e@80x24.org>
+
+ * parse.y (rb_gc_mark_parser): remove, empty since r8758
+ * internal.h: ditto, not usable from extensions since 2.0.0
+ * gc.c (gc_mark_roots): remove checkpoint for parser
+
+Thu May 29 23:27:50 2014 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * signal.c (ruby_signal): should return either `old.sa_sigaction`
+ or `old.sa_handler`, depending on whether `SA_SIGINFO` is set in
+ `old.sa_flags`, because they may not be a union.
+ [ruby-core:62836] [Bug #9878]
+
+Thu May 29 23:11:20 2014 Tanaka Akira <akr@fsij.org>
+
+ * io.c (pipe_open): Close pipes when rb_execarg_fixup() raises
+ an exception.
+ (rb_execarg_fixup_v): New function.
+
+Thu May 29 22:18:57 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb (capture_subprocess_io): Close fds.
+
+Thu May 29 19:47:08 2014 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_io_s_pipe): Close pipes if io_encoding_set() raises an
+ exception.
+ (io_encoding_set_v): New function.
+
+Thu May 29 19:42:49 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/csv.rb (CSV.open): Close the opened file when an exception
+ occur.
+
+Thu May 29 19:31:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/lib/openssl/ssl.rb (SSLServer#accept): Close a socket
+ if any exception occur.
+
+Thu May 29 05:05:29 2014 Eric Wong <e@80x24.org>
+
+ * include/ruby/ruby.h: Hide Symbol internals.
+ (struct RSymbol): moved to internal.h
+ (RSYMBOL): ditto
+
+Thu May 29 00:28:56 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): Open a socket
+ after path length check.
+ This fixes a fd leak by TestSocket_UNIXSocket#test_too_long_path.
+
+Wed May 28 23:04:35 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_io.rb (test_flush_in_finalizer1): Use
+ ObjectSpace.each_object to close files.
+ GC.start is not reliable.
+
+Wed May 28 19:00:31 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket when
+ any exception occur.
+ This fixes a fd leak by IMAPTest#test_imaps_post_connection_check
+ which start_tls_session() raises an exception.
+
+Wed May 28 18:06:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_ssl_close): Fix sync_close to work
+ when SSL is not started.
+ This fix the fd leak by test_https_proxy_authentication in
+ test/net/http/test_https_proxy.rb.
+
+Wed May 28 10:29:28 2014 Eric Wong <e@80x24.org>
+
+ * vm.c (rb_vm_living_threads_foreach): remove function
+ [ruby-core:62745]
+ * thread.c (terminate_i): remove
+ * thread.c (terminate_all): implement (inlines old terminate_i)
+ * thread.c (rb_thread_terminate_all): use terminate_all
+ * thread.c (rb_thread_fd_close_i): remove
+ * thread.c (rb_thread_fd_close): iterate inline
+ * thread.c (thread_list_i): remove
+ * thread.c (rb_thread_list): iterate inline
+ * thread.c (rb_thread_atfork_internal): iterate inline
+ * thread.c (terminate_atfork_i): update types to remove casts
+ * thread.c (terminate_atfork_before_exec_i): ditto
+ * thread.c (struct thgroup_list_params): remove definition
+ * thread.c (thgroup_list_i): remove
+ * thread.c (thgroup_list): iterate inline
+ * thread.c (check_deadlock_i): remove
+ * thread.c (debug_deadlock_check): implement (inlines check_deadlock_i)
+ * thread.c (debug_i): remove
+ * thread.c (rb_check_deadlock): iterate inline
+ * vm.c (vm_mark_each_thread_func): remove
+ * vm.c (rb_vm_mark): iterate inline
+ * vm_core.h (rb_vm_living_threads_remove): remove
+ * vm_trace.c (clear_trace_func_i): remove
+ * vm_trace.c (rb_clear_trace_func): iterate inline
+
+Wed May 28 09:30:51 2014 Eric Wong <e@80x24.org>
+
+ * signal.c (signal_exec): ignore immediate cmd for SIG_IGN
+ * signal.c (trap_handler): set cmd to true for SIG_IGN
+ * signal.c (trap): handle nil and true values for oldcmd
+ [Bug #9835]
+
+Wed May 28 01:02:54 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/tempfile.rb (Tempfile#inspect): Show "(closed)" if the tempfile
+ is closed.
+
+Wed May 28 00:38:09 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Use Tempfile#close! instead of
+ Tempfile#unlink to close file descriptors.
+
+ * test/openssl/test_config.rb: Ditto.
+
+ * test/ruby/test_io.rb: Ditto.
+
+Wed May 28 00:06:18 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/net/ftp.rb (transfercmd): Close TCP server socket even if an
+ exception occur.
+
+Tue May 27 23:50:07 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/cgi/core.rb: Use Tempfile#close! instead of Tempfile#unlink
+ to close file descriptors.
+
+Tue May 27 23:06:46 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_number_literal_suffix): refine error message for
+ extra dot and digits.
+
+Tue May 27 22:44:20 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/rexml: Avoid fd leaks.
+
+Tue May 27 22:24:25 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb: Indent.
+
+Tue May 27 22:15:29 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb: Wrap by REXMLTests module.
+
+Tue May 27 22:11:10 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_encoding_2.rb: Remove a needless file.
+
+Tue May 27 22:10:30 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_contrib.rb: Indent.
+
+Tue May 27 21:28:16 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/socket/ifaddr.c (ifaddr_inspect_flags): support IFF_SIMPLEX.
+
+Tue May 27 21:03:03 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/: Use REXMLTests as wrapping module for REXML tests.
+ I avoid using the same module for library in test because
+ it provides "include REXML" environment in test. Normally,
+ users don't use REXML on "include REXML" environment. So I
+ don't want to write tests on "include REXML" environment.
+
+Tue May 27 20:59:37 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_comment.rb: Remove needless REXML module wrapping.
+
+Tue May 27 20:56:49 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/openssl/test_pkcs7.rb: Fix inverted expected and actual values.
+
+Tue May 27 20:26:06 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (test_flush_in_finalizer1): some opened fds are
+ remain before GC, so unlink the tempfile is failed.
+
+Tue May 27 19:07:26 2014 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_io_autoclose_p): Don't raise on frozen IO.
+
+ * test/lib/minitest/unit.rb: IO#autoclose? may raise IOError.
+
+Tue May 27 19:01:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/openssl/test_pair.rb: Modify TestSSL#test_read_and_write
+ to handle partial sysreads. [Bug #7398][ruby-core:49563]
+ * test/openssl/test_ssl.rb: ditto.
+
+Tue May 27 18:46:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/openssl/test_pkcs7.rb: Add tests for PKCS7#type= and add_data.
+ [Feature #7399][ruby-core:49565]
+
+Tue May 27 17:45:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/openssl/test_hmac.rb (test_binary_update): Added Test for
+ HMAC signing with UTF-8 String. [Bug #7512][ruby-core:50559]
+
+Tue May 27 17:10:14 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/runner.rb: fixed randomly test failure.
+ [Bug #6573][ruby-core:45563]
+
+Tue May 27 16:58:12 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_timeout.rb (test_timeout): inverted test condition.
+ [Bug #8523]
+
+Tue May 27 12:24:22 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Show leaked file descriptors.
+
+Tue May 27 11:12:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_fileno, rb_io_inspect): non-modification does not
+ error on frozen IO. [ruby-dev:48241] [Bug #9865]
+
+Tue May 27 00:00:21 2014 yui-knk <spiketeika@gmail.com>
+
+ * insns.def (defineclass): fix typo in the instruction comment.
+ [fix GH-618]
+
+Mon May 26 16:33:15 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_file.rb: skip the test of atime on Windows, because
+ Windows delays updating atime about 1 hour.
+ see more details:
+ http://msdn.microsoft.com/en-us/library/windows/desktop/ms724290%28v=vs.85%29.aspx
+
+Mon May 26 12:25:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optionparser.rb, lib/optparse.rb (OptParse): aliases.
+ [ruby-core:62751] [Feature #9864]
+
+Mon May 26 07:59:34 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Show Finished threads line-by-line.
+
+Mon May 26 01:39:02 2014 Zachary Scott <e@zzak.io>
+
+ * lib/csv.rb: Reject nil as data source for CSV.new, patch by @Peeja.
+ [Fixes GH-580] https://github.com/ruby/ruby/pull/580
+
+Mon May 26 01:07:51 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Show leaked threads and tempfiles
+ line-by-line.
+
+Sun May 25 23:02:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb (MiniTest::Assertions#diff): Remove
+ tempfiles.
+
+Sun May 25 22:42:27 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Check tempfile leak for each test class.
+
+Sun May 25 20:31:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (ac_cv_func_{getcontext,setcontext}): do not
+ disable ucontext.h entirely, but disable use of functions only.
+ `ucontext_t` is necessary in the signal handler now.
+
+Sun May 25 20:00:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (check_stack_overflow): revert part of r46100, the
+ previous condition was correct, and fix compilation error on
+ other architecture linux. [ruby-core:62746] [Bug #9862]
+
+Sun May 25 17:09:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Less ObjectSpace.each_object(Tempfile)
+ invocation.
+
+Sun May 25 16:54:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Use Thread.list instead of
+ ObjectSpace.each_object(Thread).
+
+Sun May 25 15:53:54 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/rinda/ring.rb (Rinda::RingServer#shutdown): Join the killed
+ threads.
+
+Sun May 25 15:26:17 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/utils.rb: Override the inspect method of the thread
+ used in WEBrick::Utils::TimeoutHandler.
+
+Sun May 25 14:22:30 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl: Join threads.
+
+Sun May 25 12:46:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_bug_context): new function to report bug with
+ context.
+
+ * vm_dump.c (rb_vm_bugreport): accepts `ucontext_t` argument to
+ dump machine registers. based on [GH-584].
+
+ * signal.c (sigbus, sigsegv): dump machine registers if available.
+
+Sun May 25 12:32:42 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Sort leaked threads and tempfiles.
+
+Sun May 25 12:15:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (check_stack_overflow): fix condition to use ucontext
+ register, mcontext_t dereference, and its member names, on Mac
+ OS X.
+
+Sun May 25 11:58:26 2014 Zachary Scott <e@zzak.io>
+
+ * enumerator.c: [DOC] Fix example to show Enumerator#peek behavior
+ Patch by Erik Hollembeak [Bug #9814]
+
+Sun May 25 11:56:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): fix string width when precision is
+ given. as the result of `memchr` is NULL or its offset from the
+ start cannot exceed the size, the comparison was always false.
+ [ruby-core:62737] [Bug #9861]
+
+Sun May 25 11:32:42 2014 Zachary Scott <e@zzak.io>
+
+ * lib/yaml.rb: Remove Psych::EngineManager [Bug #8344]
+ * test/psych/*: ditto.
+
+Sun May 25 10:34:15 2014 Zachary Scott <e@zzak.io>
+
+ * doc/regexp.rdoc: [DOC] Clarify whitespace matching by @allolex
+ [Fixes GH-606] https://github.com/ruby/ruby/pull/606
+
+Sun May 25 10:19:34 2014 Zachary Scott <e@zzak.io>
+
+ * enum.c: [DOC] Use #find in example to clarify alias by @rachellogie
+ Patch submitted via documenting-ruby/ruby#34
+
+Sun May 25 10:16:43 2014 Zachary Scott <e@zzak.io>
+
+ * cont.c: [DOC] Fix rdoc in example for Fiber#transfer by @majjoha
+ Patch submitted via documenting-ruby/ruby#33
+
+Sun May 25 10:01:11 2014 Zachary Scott <e@zzak.io>
+
+ * lib/irb.rb: [DOC] Fixed syntax error in example by @jasdeepsingh.
+ Patch submitted via documenting-ruby/ruby#32
+
+Sun May 25 09:58:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/fileutils/test_fileutils.rb (test_chown_R): Add tests for
+ chown_R. [Feature #9383][ruby-core:59641]
+
+Sun May 25 09:57:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/fileutils/test_fileutils.rb: Added recursively chown tests.
+ [Feature #9303][ruby-core:59325]
+
+Sun May 25 09:41:56 2014 Zachary Scott <e@zzak.io>
+
+ * class.c: [DOC] Fixed grammar and examples of instance_methods.
+ By @alex-frost via documenting-ruby/ruby#31
+
+Sun May 25 09:40:44 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb: Show leaked threads and tempfiles.
+
+Sun May 25 08:54:38 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/openssl/test_partial_record_read.rb: Testing read_nonblock on
+ a partial TLS record results in IO::WaitReadable by @mohamedhafez.
+ [fix GH-547]
+
+Sun May 25 08:43:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/logger.rb: refactored to include Logger::Period.
+
+Sun May 25 06:50:19 2014 Zachary Scott <e@zzak.io>
+
+ * vm_eval.c: [DOC] Improve instance_eval description when given a
+ block or String arguments. By @nathanl via documenting-ruby/ruby#28
+
+Sun May 25 06:29:39 2014 Zachary Scott <e@zzak.io>
+
+ * array.c: [DOC] Clarify default argument for Array.new.
+ By @Elffers [Fixes GH-610]
+
+Sat May 24 22:37:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * array.c: [DOC] Add more documents to shuffle! and shuffle.
+ Contributed by @JuanitoFatas [ci skip][fix GH-612]
+
+Sat May 24 22:28:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/lib/minitest/.document: removed unused configuration.
+
+Sat May 24 19:08:47 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/spec.rb: Unused file removed.
+
+ * test/lib/minitest/autorun.rb: Don't require minitest/spec.
+
+ * test/lib/minitest/benchmark.rb: Ditto.
+
+Sat May 24 18:45:30 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/benchmark/test_benchmark.rb: Use test/unit.
+
+Sat May 24 16:20:59 2014 Eric Wong <e@80x24.org>
+
+ * process.c (proc_getgroups, proc_setgroups): use ALLOCV_N
+ [Bug #9856]
+
+Sat May 24 15:49:39 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/unit.rb (parallelize_me!): Removed.
+ This fixes the line-by-line structure of the test result in verbose
+ mode. [ruby-core:54905]
+
+ * test/lib/minitest/parallel_each.rb: Removed.
+
+ * test/minitest/test_minitest_mock.rb: Don't call parallelize_me!.
+
+ * test/minitest/test_minitest_spec.rb: Ditto.
+
+ * test/minitest/test_minitest_unit.rb: Ditto.
+ Tests for parallel feature removed.
+
+Sat May 24 15:29:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest/hell.rb: Unused file removed.
+
+ * test/lib/minitest/pride.rb: Ditto.
+
+Sat May 24 15:05:32 2014 yui-knk <spiketeika@gmail.com>
+
+ * enumerator.c (yielder_yield_push): Insert a break after the
+ method return value. [fix GH-617]
+
+Sat May 24 14:59:12 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/lib/minitest: Remove comments not appropriate now.
+
+ * test/minitest: Ditto.
+
+Sat May 24 14:02:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * NEWS: added minitest changes.
+
+Sat May 24 13:42:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/lib/test/unit/test-unit.gemspec: removed needless gemspec file.
+
+Sat May 24 09:39:06 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * defs/default_gems: removed minitest entry.
+
+Sat May 24 06:17:33 2014 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest: minitest 4.7.5 removed. Need to support proper
+ gem packaging / installation before minitest 5 can be added.
+
+Sat May 24 05:54:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: More constants
+
+Sat May 24 00:25:34 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * NEWS: add information of incompatibility about Prime.prime?
+ * lib/prime.rb: fix docs.
+
+Fri May 23 21:36:28 2014 Josh Goebel <dreamer3@gmail.com>
+
+ * net/protocol.rb (using_each_crlf_line): fix SMTP dot-stuffing
+ for messages not ending with a new-line.
+ [ruby-core:61441] [Bug #9627] [fix GH-616]
+
+Fri May 23 03:48:08 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (rb_free_m_tbl): mark function as static
+
+ * method.h (rb_free_m_tbl): remove prototype
+
+Thu May 22 22:58:27 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: More TCP option constants.
+ Describe Linux and glibc versions.
+
+Thu May 22 20:38:10 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (stat_birthtime): add birthtime support [Feature #9647]
+
+ * file.c (rb_stat_birthtime): add File::Stat.birthtime
+
+ * file.c (rb_file_s_birthtime): add File.birthtime
+
+ * file.c (rb_file_birthtime): add File#birthtime
+
+ * configure.in: check struct stat.st_birthtimespec.
+
+Thu May 22 19:38:14 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c: remove IO::Statfs because of reject. [Feature #9772]
+
+Thu May 22 14:02:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/jis/props.kwd: constify character property tables of JIS
+ based encodings by perfect hash.
+
+ * enc/euc_jp.c, enc/shift_jis.c: use character property functions.
+
+Wed May 21 12:21:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c: Fix compilation error on Android.
+ Bionic doesn't define TCP state constants.
+
+Wed May 21 11:42:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: workaround for Info.plist to get rid of `dsymutil`
+ crash by wrong files in parent directories.
+ [ruby-core:62594] [Bug #9840]
+
+Tue May 20 20:57:34 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_dir.rb (test_glob): added testcase of double
+ slash path.
+
+Tue May 20 04:58:54 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: Don't check fields of struct tcp_info if the
+ structure is not available.
+
+Mon May 19 23:13:33 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c (inspect_tcp_info): Permit longer data. (glibc
+ 2.7 adds tcpi_rcv_rtt, tcpi_rcv_space and tcpi_total_retrans to
+ struct tcp_info.)
+
+Mon May 19 20:49:07 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c (inspect_tcp_info): New function to inspect
+ struct tcp_info.
+ (sockopt_inspect): Use inspect_tcp_info.
+
+ * ext/socket/extconf.rb: Check tcp_info related things.
+
+ * ext/socket/rubysocket.h: Include netinet/tcp_fsm.h if available.
+
+Mon May 19 19:36:39 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/dbm/test_dbm.rb: Use Etc.uname.
+
+ * test/gdbm/test_gdbm.rb: Ditto.
+
+Mon May 19 16:54:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/etc/etc.c (etc_uname): add support for Windows using
+ GetVersionExW(), GetSystemInfo(), and GetComputerNameExW() with
+ `ComputerNameDnsHostname`. [Feature #9842]
+
+Mon May 19 16:29:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_pat_search): advance by byte offset but not by char
+ offset. [ruby-core:62669] [Bug #9849]
+
+Mon May 19 14:06:18 2014 Shota Fukumori <her@sorah.jp>
+
+ * bin/testrb: Removed. Forgot to remove in r45971.
+ [Feature #9711] [ruby-core:62620]
+
+Sun May 18 16:42:08 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_m17n_comb.rb (test_str_crypt): Use Etc.confstr to
+ detect the glibc version.
+ libc.so is not an executable on Debian GNU/kFreeBSD 7.0 (wheezy).
+
+Sun May 18 12:15:54 2014 Jonathan Mukai-Heidt <johnnymukai@gmail.com>
+
+ * io.c (argf_each_line, argf_inplace_mode_set): [DOC] Update ARGF
+ documentation examples. `ARGF.lines` has been deprecated in
+ favor of `ARGF.each_line`. [Fixes GH-615]
+
+Sun May 18 11:59:25 2014 Tanaka Akira <akr@fsij.org>
+
+ * missing/nextafter.c: Include ruby/missing.h.
+
+Sun May 18 11:09:28 2014 Tanaka Akira <akr@fsij.org>
+
+ * win32/Makefile.sub: Add nextafter.obj to MISSING.
+
+Sun May 18 10:46:04 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/etc/etc.c: Etc.sysconf, Etc.confstr and IO#pathconf implemented.
+
+ * ext/etc/extconf.rb: Check sysconf(), confstr() and fpathconf().
+
+ * ext/etc/mkconstants.rb: New file.
+
+ [ruby-core:62600] [Feature #9842]
+
+Sun May 18 09:58:17 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/etc/etc.c: Etc.uname method implemented.
+
+ * ext/etc/extconf.rb: Check uname() function.
+
+ [ruby-core:62139] [Feature #9770]
+
+Sun May 18 09:16:33 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Check nextafter() availability.
+
+ * include/ruby/missing.h (nextafter): New optional declaration.
+
+ * missing/nextafter.c: New file.
+
+ * numeric.c: Float#next_float and Float#prev_float implemented.
+
+ [ruby-core:62562] [Feature #9834]
+
+Sun May 18 09:02:17 2014 Tanaka Akira <akr@fsij.org>
+
+ * enum.c: Enumerable#slice_after implemented.
+
+ * enumerator.c: Enumerator::Lazy#slice_after implemented.
+
+ Requested by Tsuyoshi Sawada. [ruby-core:58123] [Feature #9071]
+
+Sun May 18 08:22:25 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_setstrbuf): always check if the buffer is modifiable.
+ [ruby-core:62643] [Bug #9847]
+
+Sun May 18 01:21:23 2014 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h: Hide Rational internal.
+ (RRational): Moved to internal.h
+ (RRATIONAL): Ditto.
+ (RRATIONAL_SET_NUM): Moved to rational.c.
+ (RRATIONAL_SET_DEN): Ditto.
+
+ * rational.c (rb_rational_num): New function.
+ (rb_rational_den): Ditto.
+
+ * include/ruby/intern.h (rb_rational_num): Declared.
+ (rb_rational_den): Ditto.
+
+ * ext/bigdecimal/bigdecimal.c: Follow the above change.
+
+ * ext/date/date_core.c: Ditto.
+
+ [ruby-core:60665] [Feature #9513]
+
+Sat May 17 17:04:32 2014 Shota Fukumori <her@sorah.jp>
+
+ * NEWS: Add news about removal of lib/test/**/*.rb.
+
+Sat May 17 16:57:33 2014 Shota Fukumori <her@sorah.jp>
+
+ * lib/test: Removed because ruby's test cases now independent to
+ lib/test by r45970. [Feature #9711] [ruby-core:62620]
+
+ I'm still considering about the future of lib/minitest, lib/test.
+ (bundling gems?)
+
+Sat May 17 15:06:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/runner.rb: remove dependency test-unit and minitest
+ from stdlib when running with test-all.
+ [Feature #9711][ruby-core:61890]
+ * test/testunit/*.rb: ditto.
+ * test/lib: ditto.
+
+Sat May 17 11:02:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): try match PLAIN as well as ALPHA, which are
+ separated by previous commits. [ruby-core:61552] [Bug #9648]
+
+ * dir.c (glob_make_pattern): set PLAIN for non-magical path to
+ skip parts which not need to glob.
+ [ruby-core:61552] [Bug #9648]
+
+ * dir.c (has_magic): return ALPHA at alphabetical name regardless
+ FNM_CASEFOLD flag.
+
+ * dir.c (glob_helper): fix conditions for ALPHA.
+ [ruby-core:61552] [Bug #9648]
+
+Sat May 17 01:49:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): reduce matching at non-magical path on
+ Windows.
+
+Sat May 17 01:49:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_pattern_type): separate names with alphabet but no
+ magical from plain.
+
+ * dir.c (glob_helper): match plain names as-is to treat super-root
+ same as the root. [ruby-core:61552] [Bug #9648]
+
+Fri May 16 17:38:22 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_marks, gc_marks_body): increase the counter of young objects
+ at the major GC because AGE2Promotion changes all old objects into
+ young objects at major GC.
+
+Fri May 16 17:26:24 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_before_sweep): heap_pages_swept_slots should contains
+ heap_pages_increment.
+
+ For example, GC by exceeding malloc_limit can remain
+ heap_pages_increment.
+
+Thu May 15 21:18:43 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * configure.in: enable SSE2 on mingw. target='i386-pc-mingw32'.
+ [ruby-core:62095] [Bug #8358]
+
+Thu May 15 21:04:06 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * lib/test/unit/parallel.rb: fix test-all parallel failure if a test
+ is skipped after raise.
+ DL::TestFunc#test_sinf is skipped after raise on mingw ruby.
+ But it causes Marshal.load failure due to undefined class/module
+ DL::DLError when doing test-all parallel and test-all doesn't
+ complete. We create new MiniTest::Skip object to avoid Marshal.load
+ failure.
+ [ruby-core:62133] [Bug #9767]
+
+ * test/testunit/test_parallel.rb (TestParallel): add a test.
+
+ * test/testunit/tests_for_parallel/ptest_forth.rb: ditto.
+
+Thu May 15 18:57:23 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect_body): move gc_heap_prepare_minimum_pages()
+ from gc_sweep().
+
+Thu May 15 18:51:25 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_extend_pages): calculate next growing heap size.
+
+ * gc.c (heap_set_increment): accept addition pages instead of
+ minimum pages.
+
+ * gc.c (gc_after_sweep): use heap_etend_pages().
+
+ * gc.c (gc_heap_prepare_minimum_pages): add only 1 page.
+
+ * gc.c (heap_ready_to_gc): add only 1 page.
+
+Thu May 15 18:42:49 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: introduce macros to remove magic number.
+
+ GC_HEAP_FREE_SLOTS_MIN_RATIO = 0.3: guarantee minimum empty slots
+ ratio after sweep.
+ GC_HEAP_FREE_SLOTS_MAX_RATIO = 0.8: allow to free pages 0.2 (= 1-0.8)
+ of current existing slots.
+
+Thu May 15 17:32:51 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * thread_win32.c (rb_w32_stack_overflow_handler): use Structured
+ Exception Handling by AddVectoredExceptionHandler() for machine
+ stack overflow on mingw.
+ This would be equivalent to the handling using __try and __except
+ on mswin introduced by r43748.
+
+Wed May 14 19:31:03 2014 Koichi Sasada <ko1@atdot.net>
+
+ * ext/openssl/depend: remove dependency from internal headers.
+ [Feature #9612]
+
+ * ext/openssl/ossl.c (ossl_fips_mode_set): ditto.
+
+ * ext/coverage/depend: ditto.
+
+ * include/ruby/thread_native.h: added.
+
+ This header file only provides wrapper functions to control
+ native threads. These wrapper functions are used by MRI
+ implementation.
+
+ * vm_core.h: use include/ruby/thread_native.h.
+
+ * thread.c: ditto.
+
+ * thread_pthread.h: ditto.
+
+ * thread_win32.h: ditto.
+
+ * thread_native.h: removed.
+
+Wed May 14 18:03:28 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: enable RGENGC_AGE2_PROMOTION.
+
+Wed May 14 18:02:30 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rgengc_rememberset_mark): promote remembered object earlier.
+
+Mon May 12 23:57:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_atan2_inf_c99): check whether runtime atan2
+ handles Inf as C99. [ruby-core:62536] [Bug #9831]
+
+Mon May 12 20:33:01 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Invoke AC_REPLACE_FUNCS for each function.
+
+Mon May 12 19:52:11 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: count young object correctly and show it in GC.stat
+ on RGENGC_AGE2_PROMOTION.
+
+ * gc.c (RVALUE_PROMOTE_YOUNG): decrement young object count on
+ YOUNG->OLD.
+
+ * gc.c (obj_free): decrement young object count when young object
+ freed.
+
+ * gc.c (gc_marks): should not clear young object count.
+
+ * gc.c (gc_stat_internal): GC.stat :young_object information.
+
+Mon May 12 01:30:59 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ifaddr.c (IS_IFADDRS): Unused macro removed.
+
+ * ext/strscan/strscan.c (BUFSIZE): Ditto.
+
+ * ext/zlib/zlib.c (OBJ_IS_FREED): Ditto.
+
+Sun May 11 22:27:18 2014 Tanaka Akira <akr@fsij.org>
+
+ * compile.c (BUFSIZE): Unused macro removed.
+
+ * vm.c (BUFSIZE): Ditto.
+
+ * pack.c (INT64toNUM): Ditto.
+ (UINT64toNUM): Ditto.
+ (BYTEWIDTH): Ditto.
+
+ * time.c (lshift): Ditto.
+ (UINT64toNUM): Ditto.
+ (id_lshift): Unused variable removed.
+
+Sun May 11 21:23:27 2014 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (swaps): Unused macro removed.
+ (swapi): Ditto.
+ (swapl): Ditto.
+ (swapll): Ditto.
+
+Sun May 11 08:02:49 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (rb_vm_t): list_head and counter for living_threads
+ (rb_thread_t): vmlt_node for living_threads linkage
+ (rb_vm_living_threads_init): new function wrapper
+ (rb_vm_living_threads_insert): ditto
+ (rb_vm_living_threads_remove): ditto
+ * vm.c (rb_vm_living_threads_foreach): new function wrapper
+ * thread.c (terminate_i, thread_start_func_2, thread_create_core,
+ thread_fd_close_i, thread_fd_close): update to use new APIs
+ * vm.c (vm_mark_each_thread_func, rb_vm_mark, ruby_vm_destruct,
+ vm_memsize, vm_init2, Init_VM): ditto
+ * vm_trace.c (clear_trace_func_i, rb_clear_trace_func): ditto
+ * benchmark/bm_vm_thread_close.rb: added to show improvement
+ * ccan/build_assert/build_assert.h: added as a dependency of list.h
+ * ccan/check_type/check_type.h: ditto
+ * ccan/container_of/container_of.h: ditto
+ * ccan/licenses/BSD-MIT: ditto
+ * ccan/licenses/CC0: ditto
+ * ccan/str/str.h: ditto (stripped of unused macros)
+ * ccan/list/list.h: ditto
+ * common.mk: add CCAN_LIST_INCLUDES
+ [ruby-core:61871][Feature #9632 (part 1)]
+
+Sun May 11 01:10:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * signal.c (rb_f_kill): directly enqueue an ignored signal to self,
+ except for SIGSEGV and SIGBUS. [ruby-dev:48203] [Bug #9820]
+
+Sat May 10 22:37:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (push_glob): match in UTF-8 on Mac OS X.
+ [ruby-dev:48213] [Bug #9825]
+
+Sat May 10 13:32:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (thread_start_func_2): stop if forked in a sub-thread,
+ the thread has become the main thread.
+ [ruby-core:62070] [Bug #9751]
+
+Sat May 10 09:32:19 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * man/ruby.1: remove deadlink. [ruby-core:62145][Bug #9773]
+
+Sat May 10 08:47:36 2014 Tanaka Akira <akr@fsij.org>
+
+ * signal.c (trap): Return "SYSTEM_DEFAULT" if SIG_DFL is set.
+
+Fri May 9 14:27:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_SETJMP_TYPE): check for setjmp type after
+ CCDLFLAGS is appended to CFLAGS, since __builtin_setjmp can be
+ affected. [ruby-core:62469] [Bug #9818]
+
+Fri May 9 03:59:06 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/delegate.rb: Fix example of using delegator.
+ patched from Andrey Koleshko. [Fixes GH-505]
+
+Fri May 9 03:42:43 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/shell.rb: add documentation in lib/shell.rb
+ patched from reprah. [Fixes GH-516]
+
+Fri May 9 03:28:04 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/fileutils.rb: show fileutils require at top.
+ patched from Richard Schneeman. [Fixes GH-604]
+
+Fri May 9 03:07:09 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/prime.rb (Prime#prime?): negative numbers can't be primes
+ by definition. reported by Ivan Kataitsev. [Bug #7395]
+ * test/test_prime.rb: add test.
+
+Thu May 8 14:34:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_mod_init_copy): always clear instance variable,
+ constant and method tables first, regardless the source tables.
+ [ruby-dev:48182] [Bug #9813]
+
+Thu May 8 10:53:14 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: OpenBSD needs to include sys/param.h before include
+ sys/mount.h. [ruby-dev:48167]
+
+Thu May 8 10:17:04 2014 Karsten Sperling <karsten@sperling.co.nz>
+
+ * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): stop
+ handling requests on shutdown, even if the socket is readable
+ and IO.select() returns true. [Fixes GH-607]
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#start): IO.select()
+ raises ENOTSOCK on shutdown on Windows.
+
+Wed May 7 21:45:00 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#accept):
+ Consider Socket#accept as well as TCPServer#accept.
+ Reported by Sam Stelfox. [ruby-core:62064] [Bug #9750]
+
+Wed May 7 17:24:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (num_step_scan_args): check keyword arguments and fail
+ if they conflict with positional arguments.
+ [ruby-dev:48177] [Bug #9811]
+
+Wed May 7 12:06:14 2014 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/driver.rb: remove debug output and output results into
+ specified file.
+
+Wed May 7 11:55:40 2014 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/driver.rb: add '--rawdata-output=[FILE] option to output
+ raw results into FILE.
+
+Wed May 7 11:25:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_f_local_variables): exclude variables hidden by
+ shadowing. [ruby-core:60501] [Bug #9486]
+
+ * vm.c (collect_local_variables_in_iseq): ditto.
+
+Tue May 6 23:29:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (new_bv_gen): no duplicated names, if already added in
+ shadowing_lvar().
+
+ * parse.y (local_tbl_gen): remove local variables duplicated with
+ arguments.
+ [ruby-core:60501] [Bug #9486]
+
+Tue May 6 18:48:50 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.make_time): Adjust the time zone of "now".
+
+Tue May 6 18:33:12 2014 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * io.c (io_{read,write}_nonblock): use rb_get_kwargs instead of
+ rb_hash_aref.
+
+Tue May 6 18:03:05 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.make_time): Argument validation code moved from
+ Time.parse and Time.strptime.
+
+Tue May 6 17:27:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.parse): [DOC] Fix an example in the documentation
+ to use EST.
+ Reported by Marcus Stollsteimer.
+ [ruby-core:60778] [Bug #9521] and [ruby-core:61718] [Bug #9682]
+
+Tue May 6 04:31:48 2014 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * file.c (rb_f_test): removed meaningless "case 'a'".
+
+Tue May 6 01:28:14 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb (OpenURI.open_uri): Call StringIO#close only if
+ the StringIO object is not closed yet.
+ Reported by Jordi Massaguer Pla. [ruby-core:42538] [Bug #6010]
+
+Tue May 6 01:08:01 2014 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/driver.rb: define File::NULL if not defined and /dev/null
+ is available to run benchmark driver on ruby 1.9.2.
+
+Mon May 5 23:53:24 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: Add IP_TRANSPARENT.
+ IP_TRANSPARENT is provieded since glibc-2.12.
+ Reported by Eliezer Croitoru. [ruby-core:50372] [Bug #7476]
+
+Mon May 5 22:29:47 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (check_exec_redirect): Open the file in write mode for
+ redirect from [:out, :err].
+ Proposed and implemented by Yusuke Endoh.
+ [ruby-dev:41430] [Feature #3348]
+
+Mon May 5 21:52:35 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/lib/pathname.rb (cleanpath_aggressive): make all
+ separators File::SEPARATOR from File::ALT_SEPARATOR.
+ Reported by Daniel Rikowski.
+ Fixed by Nobuyoshi Nakada. [Bug #9618]
+
+ * ext/pathname/lib/pathname.rb (cleanpath_conservative): ditto.
+
+Mon May 5 21:48:04 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/lib/pathname.rb (Pathname#/): Aliased to Pathname#+.
+ Suggested by Alexey Muranov. [ruby-core:61432] [Feature #9625]
+
+Mon May 5 17:26:09 2014 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * math.c (rb_math_sqrt): omitted exporting an unused function,
+ anyway.
+ * internal.h: follows the above change.
+
+Mon May 5 11:44:03 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.strptime): Raise ArgumentError if Date._strptime
+ doesn't extract date information.
+ Reported by tadayoshi funaba. [ruby-core:62349]
+
+Mon May 5 01:12:27 2014 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (rt_rewrite_frags): a new feature (not a
+ bug fix) of strptime. applies offset even if the given date is
+ not local time (%s and %Q). This is an exceptional feature and
+ I do NOT recommend to use this at all. Thank you git community.
+
+Sun May 4 20:51:32 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.force_zone!): Use usual local time if it has
+ expected offset from UTC.
+
+Sun May 4 17:58:12 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.force_zone!): New private method.
+ (Time.make_time): Use Time.force_zone!.
+ (Time.strptime): Ditto.
+ (Time.rfc2822): Ditto.
+ (Time.xmlschema): Ditto.
+
+ * lib/rss/rss.rb (Time.w3cdtf): Use Time.force_zone!.
+
+Sun May 4 10:22:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * math.c (math_atan2): return values like as expected by C99 if
+ both two arguments are infinity. based on the patch by cremno
+ phobia <cremno AT mail.ru> in [ruby-core:62310]. [Feature #9799]
+
+Sun May 4 03:46:42 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.httpdate): Always return a UTC Time object.
+
+Sun May 4 03:26:39 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.make_time): Refactored.
+
+Sun May 4 02:53:17 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.rfc2822): Fix year completion.
+ Produce fixed-offset time object if appropriate.
+ (Time.xmlschema): Produce fixed-offset time object if appropriate.
+
+Sat May 3 23:52:20 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (make_time): Produce fixed-offset time object if
+ appropriate.
+ (Time.strptime): Use d[:zone] instead of d[:offset].
+
+ * lib/rss/rss.rb (Time.w3cdtf): Produce fixed-offset time object if
+ appropriate.
+
+Sat May 3 20:21:38 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (Time.strptime): Use d[:offset] if d[:seconds] is not
+ given.
+ Reported by tadayoshi funaba. [ruby-core:62322]
+
+Sat May 3 04:04:16 2014 Eric Wong <e@80x24.org>
+
+ * complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
+ [Bug #9608]
+ * rational.c (read_digits): ditto
+
+Sat May 3 00:06:30 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * file.c (HAVE_STRUCT_STATVFS_F_BASETYPE): File::Statfs#fstypename
+ is supported on AIX, HP-UX, and Solaris, by using the value of
+ struct statvfs.f_basetype.
+
+ * configure.in (HAVE_STRUCT_STATVFS_F_BASETYPE): check struct
+ statvfs.f_basetype which is available on AIX, HP-UX, and Solaris.
+
+Fri May 2 21:04:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (next_id): no reason to set ID_STATIC_SYM here, as ID
+ returned by rb_intern3 can be a dynamic symbol and the static
+ symbol flag is set otherwise. [Bug #9787]
+
+Fri May 2 11:32:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_io.rb (test_seek, test_seek_symwhence): defer
+ File::Statfs#type call which may not be implemented, to mitigate
+ errors on platforms where SEEK_DATA is available but f_type in
+ struct statfs is not. [ruby-dev:48154] [Bug #9789]
+
+Fri May 2 10:37:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_id_attrset): turn dynamically interned Symbol into
+ an ID, since rb_str_dynamic_intern returns a Symbol but not an
+ ID. [ruby-core:62226] [Bug #9787]
+
+Thu May 1 22:19:34 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * file.c: Change AND condition to nested condition.
+
+Thu May 1 00:36:26 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * file.c (FSTATFS): check availability of struct statfs and
+ struct statvfs in addition to fstatfs(2) and fstatvfs(2).
+ This fixes error in Solaris. [Bug #9788] [ruby-dev:48145]
+
+Wed Apr 30 19:46:23 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
+ Tomb heap pages are freed pages here, so expanding heap is
+ not required.
+
+Wed Apr 30 17:58:40 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (invoke_block_from_c): add VM_FRAME_FLAG_BMETHOD to record
+ it is bmethod frame.
+
+ * vm.c (vm_exec): invoke RUBY_EVENT_RETURN event if rollbacked frame
+ is VM_FRAME_FLAG_BMETHOD.
+ [Bug #9759]
+
+ * test/ruby/test_settracefunc.rb: add a test for TracePoint/set_trace_func.
+
+ * vm_core.h: rename rb_thread_t::passed_me to
+ rb_thread_t::passed_bmethod_me to clarify the usage.
+
+ * vm_insnhelper.c (vm_call_bmethod_body): use renamed member.
+
+Wed Apr 30 17:06:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_id_attrset): pin down dynamic symbol only. it is
+ possible that attrset ID can be registered as a static symbol
+ after the corresponding attrget ID has been registered as a
+ dynamic, and then the latter may be collected.
+ [ruby-core:62226] [Bug #9787]
+
+Tue Apr 29 14:17:57 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/tmpdir.rb: Rescue LoadError on etc.so for miniruby.
+ Revert r45707, r45711, r45717.
+
+Tue Apr 29 12:50:02 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/fileutils.rb: Don't need to define fu_get_gid and fu_get_gid in
+ rescue LoadError on 'etc'.
+
+Tue Apr 29 10:21:38 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * parse.y (symbols_i): like r45492, call rb_gc_resurrect().
+
+Tue Apr 29 04:29:05 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * file.c (HAVE_STRUCT_STATFS_T_F_FSTYPENAME): Add new macro for
+ statfs_t.
+ * file.c (HAVE_STRUCT_STATFS_T_F_TYPE): ditto.
+
+ * file.c (rb_io_statfs): check FSTATFS macro only instead of
+ HAVE_FSTATFS and HAVE_FSTATVFS.
+
+ * file.c (statfs_type): use new macro.
+ * file.c (statfs_fstypename): ditto.
+ * file.c (statfs_inspect): ditto.
+
+Tue Apr 29 00:20:26 2014 Rajarshi Das <rajarshid@cybage.com>
+
+ * bootstraptest/test_literal.rb: fix typo of "dynamic". [ci skip]
+
+ * regexp.rdoc: fix typo of "organized". [ci skip]
+
+ * lib/session.rb: fix typo of "recognized". [ci skip]
+
+Mon Apr 28 21:40:27 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (HAVE_STRUCT_STATFS_F_TYPE): check struct statfs.f_type
+ to support OpenBSD.
+
+ * file.c (statfs_type): use above macro to switch.
+
+ * file.c (statfs_inspect): ditto.
+
+Mon Apr 28 18:06:08 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: check struct statvfs and struct statvfs.f_fstypename.
+
+ * configure.in: on NetBSD fstatfs is obsoleted.
+
+ * file.c: support NetBSD for File::Statfs.
+
+Mon Apr 28 17:42:42 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: This argument must be a pointer.
+
+Mon Apr 28 17:40:15 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: Fix typos. These are undefined variables.
+
+Sun Apr 27 19:39:42 2014 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strptime.c (date__strptime_internal): do not
+ overwrite century.
+
+Sat Apr 26 11:50:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_enum.rb (test_flat_map): Added test for flat_map.
+ Contribute from @igaiga. [fix GH-598]
+
+Sat Apr 26 10:55:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (compile_array_): make copy a first hash not to modify
+ the argument itself. keyword splat should be non-destructive.
+ [ruby-core:62161] [Bug #9776]
+
+Sat Apr 26 08:05:36 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_process.rb (test_rlimit_nofile): Don't limit
+ RLIMIT_NOFILE too small.
+ This fix sporadic "[ASYNC BUG] thread_timer: select" on GNU/Linux.
+
+Fri Apr 25 22:54:34 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
+ ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the
+ directory is not an empty directory, rmdir() shall fail and set
+ errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST.
+ [Bug #9571] [ruby-dev:48017]
+
+Fri Apr 25 19:16:30 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension.
+
+Fri Apr 25 14:55:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_func___builtin_unreachable): try with an
+ external variable not only by a warning, which might not be
+ shown due to the optimization. [ruby-core:61647] [Bug #9665]
+
+Fri Apr 25 13:11:49 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: NetBSD's ksh, used by configure, needs escapes.
+
+Fri Apr 25 12:51:08 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: correct pthread_setname_np's prototype on NetBSD.
+ [Bug #9586]
+
+Thu Apr 24 23:17:25 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/fileutils.rb (fu_get_uid, fu_get_gid): Etc.getpwnam/getgrnam may
+ returns nil.
+
+ * lib/webrick/utils.rb (su): ditto.
+
+Thu Apr 24 22:55:22 2014 Tanaka Akira <akr@fsij.org>
+
+ * bootstraptest/test_io.rb: Add etc.so to $" before require 'tmpdir'.
+
+Thu Apr 24 21:09:55 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * man/ruby.1: fix broken link.
+
+Thu Apr 24 20:53:02 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/tmpdir.rb: Don't need to rescue LoadError for etc.so.
+
+Thu Apr 24 17:39:53 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (statfs_inspect): suppress warnings.
+ assume those values won't be larger than LONG_LONG_MAX.
+
+Thu Apr 24 11:53:28 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_initialize): SYMID on a value
+ other than Symbol is an undefined behavior. fix up r31699.
+ [ruby-core:62142] [Bug #9771]
+
+Thu Apr 24 11:21:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_sym2id, rb_sym2id_without_pindown): return 0 for
+ non-symbol values, for the time being.
+
+Thu Apr 24 05:50:13 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect().
+
+Wed Apr 23 20:36:22 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/etc/extconf.rb: Build ext/etc unconditionally.
+
+Wed Apr 23 14:10:50 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (statfs_fsid): remove statfs.f_fsid because it doesn't return
+ meaningful value portably. http://togetter.com/li/658517
+
+Wed Apr 23 11:03:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_write): use rb_str_append to
+ reuse coderange bits other than ASCII-8BIT, and keep
+ taintedness. [ruby-dev:48118] [Bug #9769]
+
+Wed Apr 23 00:43:00 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, include/ruby/win32.h (ustatfs): implementation of
+ statfs(2) clone. [EXPERIMENTAL]
+
+ * file.c (rb_io_statfs): use above function.
+
+ * configure.in, win32/Makefile.sub (struct statfs): available.
+
+Tue Apr 22 23:56:24 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * file.c (rb_io_stafs): use statfs(2) if fstatfs(2) is unavailable.
+
+ * configure.in (fstatfs): check it.
+
+Tue Apr 22 22:15:51 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * file.c (rb_io_statfs): need to define even if the system doesn't have
+ fstatfs(2).
+
+ * test/ruby/test_file.rb (TestFile#test_statfs): skip if IO#stafs is not
+ implemented.
+
+Tue Apr 22 19:32:48 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c: newly added a class File::Statfs. (experimental)
+
+Tue Apr 22 08:22:33 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_malloc_increase): don't cause GC by malloc_increase
+ when memop type is MEMOP_TYPE_REALLOC.
+
+ GC at realloc is not well maintained.
+ We need a time to make it safe.
+ [ruby-dev:48117]
+
+Tue Apr 22 06:54:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (objspace_malloc_increase): run full mark if 0x04 bit is
+ set in ruby_gc_stress. [ruby-core:62103] [Feature #9761]
+
+ * gc.c (objspace_malloc_increase): run GC after realloc not only
+ malloc and calloc by GC.stress. [ruby-core:62103] [Feature #9761]
+
+Mon Apr 21 19:12:20 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_coderange_scan_restartable): coderange is always
+ ENC_CODERANGE_VALID if the string is ASCII-8BIT and already has a non
+ ASCII character.
+
+Mon Apr 21 19:02:44 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (coderange_scan): remove useless condition `p < e` after
+ search_nonascii.
+
+ * string.c (rb_str_coderange_scan_restartable): ditto.
+
+Mon Apr 21 18:55:21 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/-test-/string/coderange.c: add Bug::String.new#coderange_scan
+ to explicitly scan coderange.
+
+Mon Apr 21 18:19:35 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (coderange_scan): remove unused logic.
+
+ * string.c (rb_str_coderange_scan_restartable): ditto.
+
+Mon Apr 21 14:11:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_putc): fix for non-ascii
+ encoding, like as IO#putc. [ruby-dev:48114] [Bug #9765]
+
+Sun Apr 20 12:57:15 2014 Masaya Tarui <tarui@ruby-lang.org>
+
+ * st.c (st_foreach_check): change start point of search at check
+ from top to current. [ruby-dev:48047] [Bug #9646]
+
+Sun Apr 20 08:41:33 2014 Andrew DeMaria <ademariad@gmail.com>
+
+ * lib/mkmf.rb (link_command, libpathflag, create_makefile): prefer
+ user specified `$LIBPATH` than `$DEFLIBPATH`. [ruby-core:62100]
+ [ruby-trunk - Bug #9760]
+
+Sun Apr 20 06:01:18 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (rb_gc_writebarrier): drop special case for big hash/array
+ [Bug #9518]
+
+Sat Apr 19 15:38:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (primary): flush cmdarg flags inside left-paren in a
+ command argument, to allow parenthesed do-block as an argument
+ without arguments parentheses. [ruby-core:61950] [Bug #9726]
+
+Sat Apr 19 10:07:24 2014 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (struct RBignum): Use size_t for len.
+
+ * include/ruby/intern.h (rb_big_new): Use size_t instead of long to
+ specify the size of bignum.
+ (rb_big_resize): Ditto.
+
+ * bignum.c: Follow above changes.
+
+ * rational.c: Follow above changes.
+
+ * marshal.c: Follow above changes.
+
+Sat Apr 19 00:32:07 2014 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (rb_num2long): Returns a long.
+ (rb_num2ulong): Returns a unsigned long.
+
+ * bignum.c (rb_big2long): Returns a long.
+ (rb_big2ulong): Returns a unsigned long.
+
+ * include/ruby/intern.h: Follow above changes.
+
+ * include/ruby/ruby.h: Follow above changes.
+ (rb_num2long_inline): No need to cast.
+ (rb_num2ulong_inline): Ditto.
+
+Sat Apr 19 00:17:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (SHARABLE_SUBSTRING_P): predicate if substring can be
+ shared with the original string. true if just at the end of the
+ original string, for the time being. all substring will be able to
+ be shared in the future.
+
+Fri Apr 18 21:48:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_new_frozen): consider the shared string at
+ middle.
+
+ * string.c (rb_str_subseq, rb_str_substr, str_byte_substr): share
+ middle of a string.
+
+Fri Apr 18 15:40:05 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c: use uintptr_t instead of VALUE because they are not ruby
+ object.
+
+Fri Apr 18 14:51:42 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c: check str_strlen's argument, and add comment or
+ use NULL if simply it uses str's enc.
+
+Fri Apr 18 14:32:40 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (str_strlen): use enc_strlen if the coderange is known.
+
+Fri Apr 18 14:21:21 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (enc_strlen): move UTF-8 optimization from str_strlen to
+ enc_strlen.
+
+Fri Apr 18 08:50:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_getcwd_malloc): check if getcwd allocates
+ buffer if NULL is given [ruby-core:62072] [Bug #9752]
+
+Thu Apr 17 16:28:10 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * prelude.rb: [DOC] Update Thread::exclusive docs by @stevenharman.
+
+Thu Apr 17 10:03:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/fileutils.rb (FileUtils#copy_entry): update rdoc about
+ preserve option and permissions, following r31123.
+ [ruby-core:62065] [Bug #9748]
+
+Wed Apr 16 23:47:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (dont_recycle_block_arg): fix condition to recycle block
+ argument. lambda with rest can get internal array directly.
+ [ruby-core:62060] [Bug #9749]
+
+Wed Apr 16 09:51:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/ossl_pkey.c (ossl_pkey_verify): as EVP_VerifyFinal()
+ finalizes only a copy of the digest context, the context must be
+ cleaned up after initialization by EVP_MD_CTX_cleanup() or a
+ memory leak will occur. [ruby-core:62038] [Bug #9743]
+
+Tue Apr 15 19:36:42 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/win32.h (rb_w32_cmdvector): removed.
+
+ * win32/win32.c (rb_w32_sysinit): use WCHAR version of GetCommandLine()
+ internally.
+
+ * win32/win32.c (w32_cmdvector): renamed from rb_w32_cmdvector. use
+ WCHAR* instead of char* internally.
+
+ these changes are expected to not changing the behavior yet.
+
+Tue Apr 15 19:26:05 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/extmk.rb: Re-generate extmk.mk and dummy makefiles only if
+ really required.
+ This fixes a problem to run multiple test-all concurrently as:
+ make test-all & make test-all & make test-all & ...
+
+Tue Apr 15 12:49:53 2014 Sam Rawlins <sam.rawlins@gmail.com>
+
+ * enum.c (enum_each_slice, enum_each_cons): make more efficient by
+ allocating less and recycling block argument arrays if possible.
+ [Fixes GH-596]
+
+Mon Apr 14 18:44:45 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): get base addrs in fill_lines to use it
+ with dladdr_fbases introduced at r45563.
+ it didn't get before if the executable is not pie.
+
+Mon Apr 14 18:05:48 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (main_exe_path): support FreeBSD.
+ At least sh, csh, tcsh, bash, and zsh sets realpath of the main
+ executable for dladdr, but gdb doesn't.
+
+Mon Apr 14 17:20:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (umethod_bind): use the ancestor iclass instead of new
+ iclass to get rid of infinite recursion, if the defined module
+ is already included. [ruby-core:62014] [Bug #9721]
+
+Sun Apr 13 12:46:58 2014 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (SIZEOF_BDIGIT): Renamed from SIZEOF_BDIGITS.
+
+ * internal.h: Ditto.
+
+ * marshal.c: Ditto.
+
+ * rational.c: Ditto.
+
+Sun Apr 13 10:18:09 2014 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: Unused target, $(MKMAIN_CMD), removed.
+
+ * Makefile.in (MKMAIN_CMD): Unused macro removed.
+
+ * win32/Makefile.sub (MKMAIN_CMD): Ditto.
+
+Sat Apr 12 22:11:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (sym_to_proc), proc.c (rb_block_clear_env_self): clear
+ caller's self which is useless, so that it can get collected.
+ [Fixes GH-592]
+
+Sat Apr 12 09:26:48 2014 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_ocsp.c: [DOC] Document OpenSSL::OCSP.
+
+Fri Apr 11 18:52:38 2014 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (ARY_SET): added.
+
+ ARY_SET() is same functionality of RARRAY_ASET(), but
+ it has an assertion (`ary' doesn't have shared array).
+
+Fri Apr 11 16:54:26 2014 Koichi Sasada <ko1@atdot.net>
+
+ * array.c: make shared arrays WB-protected objects.
+
+ Shared arrays were WB-unprotected object because
+ sharing array can modify shared array's buffer
+ if it occupied shared array.
+
+ [sharing array (ary)] -> [shared array (shared)] -> <buff>
+ | A
+ +---------------------------------------+
+ write `buff' with WB(ary, &buff[i], obj)
+ -> if `ary' and `shared' are old, then only `ary'
+ will be remembered.
+ -> traverse from `ary'. But `shared' is old, so
+ that written `obj' is not marked.
+
+ It cause WB miss so that shared arrays were WB-unprotected.
+ (WB-unprotected objects are marked everytime if it is living)
+
+ This patch insert WB() for `shared' if it is needed.
+
+Fri Apr 11 15:05:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_method_call_with_block, umethod_bind): call with
+ IClass including the module for a module instance method.
+ [ruby-core:61936] [Bug #9721]
+
+ * vm_insnhelper.c (vm_search_super_method): allow bound
+ UnboundMethod case.
+
+Fri Apr 11 12:02:30 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (rb_dump_backtrace_with_lines): set base address
+ which is retrieved from dladdr to dladdr_fbases, to skip already
+ parsed objects.
+
+Fri Apr 11 12:44:50 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (ary_reject): may be turned into a shared array during
+ the given block. [ruby-dev:48101] [Bug #9727]
+
+Thu Apr 10 23:41:21 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/net/ftp.rb (Net::FTP#login): [DOC] The default password for
+ anonymous login was changed to "anonymous@" in r25313.
+
+Thu Apr 10 19:22:58 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_array.rb: remove useless `assert'.
+
+Thu Apr 10 19:11:11 2014 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_modify): remember shared array owner if a shared
+ array owner is promoted and a shared array is not promoted.
+
+ Now, shared array is WB-unprotected so that shared arrays are not
+ promoted. All objects referred from shared array should be marked
+ correctly.
+
+ [ruby-core:61919] [ruby-trunk - Bug #9718]
+
+ * test/ruby/test_array.rb: add a test for above.
+
+Thu Apr 10 18:57:12 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_verify_internal_consistency): move lines and enable
+ allrefs_dump() on RGENGC_CHECK_MODE >= 4.
+
+Thu Apr 10 15:01:06 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (append_obj): clear allocated memory.
+
+ * addr2line.c (rb_dump_backtrace_with_lines): free `base_addrs'.
+
+Thu Apr 10 14:40:18 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_writebarrier_unprotect_promoted): disable to dump debug
+ message when RGENGC_CHECK_MODE == 0.
+
+Thu Apr 10 08:13:47 2014 Tanaka Akira <akr@fsij.org>
+
+ * signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.h
+ is not available.
+ Fixes build on Android (x86).
+
+Wed Apr 9 23:22:44 2014 Tanaka Akira <akr@fsij.org>
+
+ * gc.c (mark_current_machine_context): Call SET_STACK_END.
+ This reverts a hunk of r40703 by ko1.
+ This fixes [ruby-dev:48098] [Bug #9717].
+
+Wed Apr 9 21:02:04 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (OBJ2UID1): Defined even if getpwnam_r is not usable.
+ (OBJ2GID1): Defined even if getgrnam_r is not usable.
+ This fixes compilation error on Android.
+
+Wed Apr 9 15:16:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_default_internal): fix rdoc. `__FILE__` is
+ in filesystem encoding but not `default_internal`.
+ [ruby-core:61894] [Bug #9713]
+
+Wed Apr 9 14:43:00 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb: more long timeout.
+ This test failed under RGENGC_CHECK_MODE >= 2.
+
+Wed Apr 9 13:07:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: get rid of __builtin_setjmp/__builtin_longjmp on
+ x64-mingw, which causes SEGV with callcc.
+ [ruby-core:61887] [Bug #9710]
+
+Wed Apr 9 12:44:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (str_buf_cat): should round up the capacity by 4KiB,
+ but not number of rooms. [ruby-core:61886] [Bug #9709]
+
+Tue Apr 8 22:55:32 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/mkmf.rb (MakeMakefile#dir_config): [DOC] Improve
+ documentation.
+
+Tue Apr 8 22:31:44 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: rename `RGENGC_THREEGEN' to `RGENGC_AGE2_PROMOTION'.
+
+ * gc.c (rgengc_rememberset_mark): don't promote, but remain in
+ remember set for infant objects.
+
+ * gc.c (RVALUE_PROMOTE_INFANT, RVALUE_PROMOTE_YOUNG): count numbers
+ in these functions.
+
+Mon Apr 7 21:11:49 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (sock_s_getnameinfo): Save errno for EAI_SYSTEM.
+ Reported by Saravana kumar. [ruby-core:61820] [Bug #9697]
+ Fixed by Heesob Park. [ruby-core:61868]
+
+Mon Apr 7 07:20:23 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/xmlrpc/client.rb (do_rpc): don't check body length.
+ If HTTP content-encoding is used, the length may be different.
+ [Bug #8182] [ruby-core:53811]
+
+Mon Apr 7 02:39:48 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Matrix#cofactor [fix GH-568]
+ Add first_minor [fix GH-568]
+ Handle empty diagonal matrix case [fix GH-576]
+ Patches by gogotanaka
+
+Sun Apr 6 08:52:50 2014 Bugra Barin <bugrabarin@hotmail.com>
+
+ * dln.c (dln_load): use wchar version to load a library in
+ non-ascii path on Windows. based on the patch by Bugra Barin
+ <bugrabarin AT hotmail.com> in [ruby-core:61845]. [Bug #9699]
+
+Sat Apr 5 19:36:33 2014 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (d_lite_cmp): should compare with #<.
+
+Sat Apr 5 00:31:21 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/readline/extconf.rb (rl_hook_func_t): check pointer type.
+ [ruby-dev:48089] [Bug #9702]
+
+Fri Apr 4 07:13:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (ac_cv_func___builtin_setjmp): should not skip
+ flags restoration in RUBY_WERROR_FLAG by `break`.
+ [ruby-dev:48086] [Bug #9698]
+
+Wed Apr 2 21:50:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp()
+ in Apple LLVM 5.1 (LLVM 3.4svn) uses `void**`, not `jmp_buf`.
+ [Bug #9692]
+
+Wed Apr 2 20:57:15 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, gc.h (rb_objspace_each_objects_without_setup):
+ Add a new (hidden) C-API to iterate objspace snapshot.
+
+ This API is not safe to call any C-APIs in a given callback
+ function. Be careful to use this C-API.
+
+Wed Apr 2 17:43:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (ac_cv_func___builtin_setjmp): gcc 4.9 disallows a
+ variable as the second argument of __builtin_longjmp().
+ [ruby-core:61800] [Bug #9692]
+
+Wed Apr 2 15:12:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * common.mk: Use redmine-2.x url for DeveloperHowto wiki.
+ [ruby-core:60657] [Bug #9511]
+
+Wed Apr 2 11:46:29 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * ext/pathname/lib/pathname.rb (Pathname#join): Fix error with
+ empty args. Reported by ko1 via IRC.
+
+ * test/pathname/test_pathname.rb (TestPathname#test_join): Add the
+ test for above case.
+
+Tue Apr 1 11:39:57 2014 James Edward Gray II <james@graysoftinc.com>
+
+ * lib/csv.rb: Symbol HeaderConverter: strip leading/trailing space.
+ Reported by Skye Shaw
+ [Fixes GH-575]
+
+Tue Apr 1 11:34:04 2014 James Edward Gray II <james@graysoftinc.com>
+
+ * lib/csv.rb: Don't attempt to convert nil headers.
+ Reported by Skye Shaw
+
+Tue Apr 1 17:29:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/config_files.rb (ConfigFiles.download): show failed URI.
+ [ruby-core:61792] [Bug #9690]
+
+Tue Apr 1 12:06:49 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (rb_dump_backtrace_with_lines): don't depend hard coded
+ symbol '_start'.
+
+ * addr2line.c (fill_lines): instead of above, get a dynamic symbol
+ in the main executable and use it to know the base address.
+
+ * addr2line.c (follow_debuglink0): use obj_info_t instead of
+ line_info_t to handle object related data.
+
+ * addr2line.c (main_exe_path): defined for Linux.
+
+Tue Apr 1 08:58:39 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * parse.y (rb_str_dynamic_intern): set mark bit if dynamic symbol
+ is before sweeping.
+
+Tue Apr 1 07:37:00 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): use dynsym, which is used for dynamic
+ linking and always exists, if there's no symtab.
+
+Tue Apr 1 07:27:15 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_dump.c (rb_print_backtrace): current implementation
+ uses dladdr to get the path of objects.
+
+Mon Mar 31 23:57:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/readline/extconf.rb: fix typo, `$defs` not `$DEFS`.
+ [ruby-core:61756] [Bug #9578]
+
+Mon Mar 31 17:23:50 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/memory_status.rb: require envutil before accessing EnvUtil
+ module. reported by ko1 via twitter.
+
+Mon Mar 31 10:28:01 2014 Eric Wong <e@80x24.org>
+
+ * st.c (st_init_table_with_size): update comment
+ [Feature #9425]
+
+Sun Mar 30 23:39:26 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_accept, open_ifs_socket, socketpair_internal):
+ reset inherit flag of socket to avoid unintentional inheritance of
+ socket. note that the return value of SetHandleInformation() is not
+ verified intentionally because old Windows may return an error.
+ [Bug #9688] [ruby-core:61754]
+
+Sat Mar 29 13:04:22 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_before_sweep): cap `malloc_limit' to
+ gc_params.malloc_limit_max. It can grow and grow with such case:
+ `loop{"a" * (1024 ** 2)}'
+ [Bug #9687]
+
+ This issue is pointed by Tim Robertson.
+ http://www.omniref.com/blog/blog/2014/03/27/ruby-garbage-collection-still-not-ready-for-production/
+
+Fri Mar 28 19:32:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (not_a_member): extract name error and use same error
+ messages. based on the patch by Marcus Stollsteimer <sto.mar AT
+ web.de> at [ruby-core:61721]. [Bug #9684]
+
+Fri Mar 28 09:21:54 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/psych/psych.gemspec: update gemspec for psych-2.0.5
+
+Fri Mar 28 09:11:06 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/psych/lib/psych.rb: Merge psych-2.0.5. bump version to
+ libyaml-0.1.6 for CVE-2014-2525.
+ * ext/psych/yaml/config.h: ditto.
+ * ext/psych/yaml/scanner.c: ditto.
+ * ext/psych/yaml/yaml_private.h: ditto.
+
+Thu Mar 27 18:58:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (match_regexp): set regexp for MatchData from string.
+
+ * re.c (rb_backref_set_string): create MatchData from string and
+ set backref.
+
+ * string.c (rb_pat_search, rb_str_sub, rb_str_sub_bang, str_gsub),
+ (scan_once, rb_str_scan, rb_str_partition): use rb_str_index
+ instead of rb_reg_search() when pattern is a String. based on
+ the patch by Sam Rawlins <sam.rawlins@gmail.com> [Fixes GH-579]
+
+Thu Mar 27 11:58:55 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): check shdr[i].sh_type because even if
+ .symtab section exists, the section's type can be SHT_NOBITS and
+ actual data doesn't exist in the file.
+ revert r45441.
+
+Wed Mar 26 14:57:35 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * parse.y: inline must be static (for mswin).
+ fixed build error introduced at r45426.
+
+Wed Mar 26 14:33:00 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * internal.h (USE_SYMBOL_GC): enable Symbol GC by default (USE_SYMBOL_GC == 1).
+
+Tue Mar 25 22:57:11 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * parse.y: support Symbol GC. [ruby-trunk Feature #9634]
+ See this ticket about Symbol GC.
+
+ * include/ruby/ruby.h:
+ Declare few functions.
+ * rb_sym2id: almost same as old SYM2ID but support dynamic symbols.
+ * rb_id2sym: almost same as old ID2SYM but support dynamic symbols.
+ * rb_sym2str: almost same as `rb_id2str(SYM2ID(sym))` but not
+ pin down a dynamic symbol.
+ Declare a new struct.
+ * struct RSymbol: represents a dynamic symbol as object in
+ Ruby's heaps.
+ Add few macros.
+ * STATIC_SYM_P: check a static symbol.
+ * DYNAMIC_SYM_P: check a dynamic symbol.
+ * RSYMBOL: cast to RSymbol
+
+ * gc.c: declare RSymbol. support T_SYMBOL.
+
+ * internal.h: Declare few functions.
+ * rb_gc_free_dsymbol: free up a dynamic symbol. GC call this
+ function at a sweep phase.
+ * rb_str_dynamic_intern: convert a string to a dynamic symbol.
+ * rb_check_id_without_pindown: not pinning function.
+ * rb_sym2id_without_pindown: ditto.
+ * rb_check_id_cstr_without_pindown: ditto.
+
+ * string.c (Init_String): String#intern and String#to_sym use
+ rb_str_dynamic_intern.
+
+ * template/id.h.tmpl: use LSB of ID as a flag for determining a
+ static symbol, so we shift left other ruby_id_types.
+
+ * string.c: use rb_sym2str instead `rb_id2str(SYM2ID(sym))` to
+ avoid pinning.
+
+ * load.c: use xx_without_pindown function at creating temporary ID
+ to avoid pinning.
+
+ * object.c: ditto.
+
+ * sprintf.c: ditto.
+
+ * struct.c: ditto.
+
+ * thread.c: ditto.
+
+ * variable.c: ditto.
+
+ * vm_method.c: ditto.
+
+Wed Mar 26 13:25:54 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): loop reverse order not to overwrite
+ the basis of base addresses comparison.
+
+ * addr2line.c: use uintptr_t instead of intptr_t for pointers.
+
+ * addr2line.c (rb_dump_backtrace_with_lines): don't use syms.
+
+ * vm_dump.c (rb_print_backtrace): ditto.
+
+ * addr2line.h: ditto.
+
+Wed Mar 26 11:20:50 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_object): internal objects are not dumpable.
+ [ruby-core:61677] [Bug #9674]
+
+ * ext/thread/thread.c (undumpable): ConditionVariable and Queue
+ are not dumpable. [ruby-core:61677] [Bug #9674]
+
+Wed Mar 26 10:36:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (follow_debuglink): show message if it closes opened
+ (and maybe used) elf binary.
+
+Wed Mar 26 10:34:25 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_line): pass and use offset instead of
+ curobj_baseaddr.
+
+Wed Mar 26 09:07:48 2014 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+
+ * configure.in: add --disable-pie. [Feature #9673]
+
+Wed Mar 26 08:47:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): don't run fill_lines multiple times.
+
+Wed Mar 26 08:45:00 2014 Sam Rawlins <sam.rawlins@gmail.com>
+
+ * internal.h: add prototype for rb_reg_search0
+
+ * re.c: rename rb_reg_search to rb_reg_search0, add set_backref_str
+ argument to allow callers to indicate that they don't require the
+ backref string to be allocated.
+
+ * string.c: don't allocate backref str if replacement string is provided
+
+ [GH-578] [Bug #9676] [ruby-core:61682]
+
+Wed Mar 26 08:29:43 2014 mo khan <mo@mokhan.ca>
+
+ * lib/rubygems.rb: fix spelling of Jim Weirich. [Fixes GH-577]
+
+Wed Mar 26 01:55:45 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (rb_dump_backtrace_with_lines): a function to get must
+ be a function in the main executable, whose absolute path is not
+ available by dladdr, and ruby get it by /proc/self/exe on Linux.
+
+Wed Mar 26 01:34:50 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): skip if path is NULL.
+
+Tue Mar 25 23:57:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): only a newline after label should be
+ significant. [ruby-core:61658] [Bug #9669]
+
+Tue Mar 25 23:32:25 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * ext/pathname/lib/pathname.rb (Pathname#join): remove unnecessary
+ unshift.
+
+ * test/pathname/test_pathname.rb (TestPathname#test_join): add tests.
+
+Tue Mar 25 16:47:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (lex_state_e, parser_params, f_arglist, parser_yylex):
+ separate EXPR_LABELARG from EXPR_BEG and let newline significant,
+ so that required keyword argument can place at the end of
+ argument list without parentheses. [ruby-core:61658] [Bug #9669]
+
+Mon Mar 24 22:19:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (ripper_initialize): filename can not be modified.
+
+Mon Mar 24 15:19:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (rb_dump_backtrace_with_lines): fetch path of the
+ executable from /proc/self/exe on Linux.
+
+Mon Mar 24 14:14:37 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * gc.c: Fix up default GC params by @csfrancis [fix GH-556]
+
+Mon Mar 24 13:13:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (parse_debug_line_cu): explicitly specify signed char
+ because DWARF's line_Base is signed char and char maybe unsigned.
+ patched by Rei Odaira. [ruby-dev:48068] [Bug #9654]
+
+Sun Mar 23 11:03:50 2014 Kohei Suzuki <eagletmt@gmail.com>
+
+ * vm_method.c (rb_method_entry_get_without_cache): me->klass is 0
+ for a method aliased in a module. [ruby-core:61636] [Bug #9663]
+
+Sun Mar 23 08:12:27 2014 Eric Wong <e@80x24.org>
+
+ * st.c (hash_pos): use bitwise AND to avoid slow modulo op
+ (new_size): power-of-two sizes for hash_pos change
+ (st_numhash): adjust for common keys due to lack of prime modulo
+ [Feature #9425]
+ * hash.c (rb_any_hash): right shift for symbols
+ * benchmark/bm_hash_aref_miss.rb: added to show improvement
+ * benchmark/bm_hash_aref_sym_long.rb: ditto
+ * benchmark/bm_hash_aref_str.rb: ditto
+ * benchmark/bm_hash_aref_sym.rb: ditto
+ * benchmark/bm_hash_ident_num.rb: added to prevent regression
+ * benchmark/bm_hash_ident_obj.rb: ditto
+ * benchmark/bm_hash_ident_str.rb: ditto
+ * benchmark/bm_hash_ident_sym.rb: ditto
+
+Sat Mar 22 22:56:45 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): compare the file names of object in which
+ symbols exist. [Bug #9654] [ruby-dev:48058]
+
+Sat Mar 22 06:46:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/cgi/util.rb (escape_html, unescape_html): make synonyms
+ aliases instead of wrapper methods.
+
+ * lib/cgi/util.rb (escape_element, unescape_element): ditto.
+ [Fixes GH-573]
+
+Fri Mar 21 21:57:34 2014 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in: Fix a build problem with clang and --with-opt-dir.
+ If ruby is configured with --with-opt-dir=dir when using clang
+ as compiler, a warning `clang: warning: argument unused during
+ compilation: '-I dir'` is emitted almost every time clang
+ compiles a file. Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
+ any output from the compiler as fatal error, and the check thus
+ fails due to the warning. This is an attempt to fix the problem
+ by adding a flag -Qunused-arguments to CFLAGS locally in the
+ function to suppress the warning. [ruby-dev:48062] [Bug #9658]
+ [Fixes GH-571] https://github.com/ruby/ruby/pull/571
+
+Fri Mar 21 16:31:56 2014 Zachary Scott <e@zzak.io>
+
+ * gc.c: [DOC] Fix call-seq for GC.start by @jasonrclark [Fixes GH-572]
+ https://github.com/ruby/ruby/pull/572
+
+Thu Mar 20 11:37:28 2014 James Edward Gray II <james@graysoftinc.com>
+
+ * lib/csv.rb: Fixed a broken regular expression that was causing
+ CSV to miss escaping some special meaning characters when used
+ in parsing.
+ Reported by David Unric
+ [ruby-core:54986] [Bug #8405]
+
+Thu Mar 20 16:53:07 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_malloc_increase): should not invoke
+ garbage_collect_with_gvl() here on non-ruby threads.
+
+ Should just ignore the malloc_increase.
+
+ This issue is pointed by Eric Wong [ruby-core:61519].
+
+Thu Mar 20 13:05:16 2014 Koichi Sasada <ko1@atdot.net>
+
+ * struct.c (rb_struct_alloc): use RARRAY_CONST_PTR() instead of
+ RARRAY_PTR().
+
+Thu Mar 20 12:59:39 2014 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/intern.h (rb_obj_call_init, rb_class_new_instance):
+ constify a parameter (VALUE *).
+ I believe this incompatibility doesn't break any code.
+ However, if you have trouble, please tell us.
+
+ * eval.c, object.c: ditto.
+
+Thu Mar 20 12:31:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_method_entry_get_without_cache): get rid of
+ infinite recursion at aliases in a subclass and a superclass.
+ return actually defined class for other than singleton class.
+ [ruby-core:60431] [Bug #9475]
+
+Wed Mar 19 17:13:06 2014 Eric Wong <e@80x24.org>
+
+ * time.c (time_mload): freeze and preserve marshal-loaded time zone
+ * test/ruby/test_time.rb: add test for GC on loaded object
+ [Bug #9652]
+
+Tue Mar 18 23:20:12 2014 Shota Fukumori <her@sorah.jp>
+
+ * vm_eval.c (eval_string_with_cref): Unify to use NIL_P.
+
+Tue Mar 18 22:03:41 2014 Shota Fukumori <her@sorah.jp>
+
+ * vm_eval.c (eval_string_with_cref): Use file path even if scope is
+ given. Related to [ruby-core:56099] [Bug #8662] and r42103.
+
+Mon Mar 17 13:17:47 2014 Koichi Sasada <ko1@atdot.net>
+
+ * enumerator.c (enumerator_block_call): use RARRAY_CONST_PTR()
+ instead of RARRAY_PTR().
+
+ * io.c (rb_io_s_popen): ditto.
+
+ * numeric.c (num_step_size): ditto.
+
+ * vm_eval.c (rb_apply): ditto.
+
+ * vm_eval.c (rb_eval_cmd): ditto.
+
+Mon Mar 17 10:11:59 2014 Eric Wong <e@80x24.org>
+
+ * variable.c (rb_const_set): delete existing entry on redefinition
+ [Bug #9645]
+ * test/ruby/test_const.rb (test_redefinition): test for leak
+
+Sun Mar 16 21:33:01 2014 Zachary Scott <e@zzak.io>
+
+ * lib/time.rb: [DOC] Fix timezone in example of Time.parse [Bug #9521]
+ Based on patch by @stomar
+
+Sun Mar 16 13:21:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (DLDFLAGS): insert a space between option and its
+ argument for non-GCC compilers. [ruby-core:61429] [Bug #9624]
+
+Sun Mar 16 08:05:06 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (objspace_xcalloc): fix GC accounting
+
+Sun Mar 16 06:33:35 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): return address is just after calling
+ address. Therefore noreturn function with tail call's return
+ address may be in another function.
+
+Sun Mar 16 05:51:55 2014 Zachary Scott <e@zzak.io>
+
+ * lib/gserver.rb: [DOC] Fixed typo in example by @stomar [Bug #9543]
+
+Sat Mar 15 18:54:03 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/.document: remove refinement from documentable directories.
+
+Sat Mar 15 11:02:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (DLDFLAGS): check for each options to control
+ symbol resolution. [ruby-core:61429] [Bug #9624]
+
+Sat Mar 15 07:02:35 2014 Eric Wong <e@80x24.org>
+
+ * st.c (st_update): remove unnecessary assignment
+
+Fri Mar 14 14:58:38 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (fill_lines): fetch symbol names from ELF binary's
+ symbol table if it is built with cc -g and not stripped.
+ Now ruby can show static symbols on Linux though glibc's
+ backtrace_symbols(3) don't show them.
+
+ * addr2line.c (rb_dump_backtrace_with_lines): use dladdr(3) to
+ detect what object file declares the symbol because
+ dl_iterate_phdr can't detect the main executable file
+ and codes on the stack.
+ NOTE: signal trampolines sometimes on the user stack. (FreeBSD)
+
+ * addr2line.c (rb_dump_backtrace_with_lines): stop showing
+ backtrace if the function's name is main.
+ NOTE: FreeBSD's backtrace (libexecinfo) shows _start and
+ an additional address. Why it doesn't remove them on dladdr phase
+ is, dladdr may fail to detect the main function but detect
+ as _start function. Therefore it must be after scanning
+ the symbol table and getting correct name.
+
+
+Fri Mar 14 12:07:46 2014 Zachary Scott <e@zzak.io>
+
+ * doc/syntax/literals.rdoc: [DOC] Single quote strings allows escape
+ of backslash as well, patch by @idupree [Fixes GH-553]
+ https://github.com/ruby/ruby/pull/553
+
+Fri Mar 14 01:18:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (invoke_block_from_c): add splattable argument.
+
+ * vm.c (vm_invoke_proc): disallow to splat when directly invoked.
+
+ * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_callee_setup_arg):
+ relax arity check of yielded lambda. [ruby-core:61340] [Bug #9605]
+
+ * test/ruby/test_yield.rb (TestRubyYieldGen#emu_bind_params): no
+ longer raise ArgumentError when splatting to lambda.
+
+Thu Mar 13 23:51:02 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/-test-/win32/dln/libdlntest.c (dlntest_ordinal): no need to
+ specify export in the source file because .def file do it.
+ get rid of warning on linking.
+
+Wed Mar 12 11:19:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_callee_setup_arg): disable fastpath if splat
+ argument, since argc may differ for each calls.
+ [ruby-core:61422] [Bug #9622]
+
+ * vm_insnhelper.c (vm_callee_setup_arg): turn a macro into an
+ inline function.
+
+Wed Mar 12 07:26:05 2014 Eric Wong <e@80x24.org>
+
+ * insns.def (opt_regexpmatch2): respect redefined match op
+ Thanks to Sam Rawlins for the fix.
+ * test/ruby/test_string.rb: test based on Tsuyoshi Sawada's report
+ [Bug #9581]
+
+Tue Mar 11 22:31:25 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/.document: add objspace/objspace_dump.c to document file.
+
+Tue Mar 11 22:22:38 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * test/objspace/test_objspace.rb (TestObjSpace#test_dump_uninitialized_file):
+ remove dependency on json library.
+
+Tue Mar 11 10:55:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * README.EXT{,.ja} (Appendix B): update contents of `ruby_options`
+ and replace `ruby_run` with `ruby_run_node`. based on the patch
+ by Kaneko Yuichiro at [ruby-dev:48030] [Bug #9619].
+
+Tue Mar 11 06:54:00 2014 Scott Francis <scott.francis@shopify.com>
+
+ * ext/objspace/objspace_dump.c: Check fptr before trying to dump RFILE
+ object fd. [GH-562]
+
+ * test/objspace/test_objspace.rb: add test
+
+Tue Mar 11 02:04:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_dump.c (rb_vm_bugreport): show vm maps on FreeBSD.
+
+ * vm_dump.c (procstat_vm): copied from FreeBSD.
+ http://svnweb.freebsd.org/base/head/usr.bin/procstat/procstat_vm.c?revision=261780
+
+Mon Mar 10 12:14:26 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: always check dladdr(1).
+
+ * addr2line.c (fill_lines): show the line number in C backtrace if
+ ruby is built without --enable-shared (PIE) on Linux.
+ patch is originally by Shinichiro Hamaji
+ https://twitter.com/shinh/status/441957774264504321
+ NOTE: ld doesn't insert __executable_start for PIE.
+ dladdr(3)'s argument must be a function pointer.
+
+Mon Mar 10 10:51:17 2014 ksss <co000ri@gmail.com>
+
+ * test/ruby/test_enumerator.rb (test_iterators): fix test for hash
+ iterators. [Fixes GH-558]
+
+Sun Mar 9 14:14:49 2014 Eric Wong <e@80x24.org>
+
+ * class.c (rb_class_subclass_add): use xmalloc
+ * class.c (rb_module_add_to_subclasses_list): ditto
+ * class.c (rb_class_remove_from_super_subclasses): use xfree
+ * class.c (rb_class_remove_from_module_subclasses): ditto
+ [Bug #9616]
+
+Sun Mar 9 13:51:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/fiddle/function.c (function_call): fix memory leak when an
+ exception occurs at argument conversion or the function call.
+
+Sun Mar 9 06:42:40 2014 Eric Wong <e@80x24.org>
+
+ * variable.c (struct global_variable): shrink by 8 bytes on 64-bit
+
+Sat Mar 8 17:42:51 2014 Eric Wong <e@80x24.org>
+
+ * vm.c (add_opt_method): cleanup to use rb_method_entry_at
+
+Sat Mar 8 13:46:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
+ ext/fiddle/handle.c (fiddle_handle_free),
+ ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
+ based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].
+
+Sat Mar 8 13:30:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (obj2uid, obj2gid): now getpwnam_r() and getgrnam_r()
+ may need larger buffers than sysconf values, so retry with
+ expanding the buffer when ERANGE is returned.
+ [ruby-core:61325] [Bug #9600]
+
+Fri Mar 7 19:29:13 2014 Eric Wong <e@80x24.org>
+
+ * vm_eval.c (vm_call0_body): use RARRAY_CONST_PTR
+ (check_funcall_exec): ditto
+ [ruby-core:61360]
+
+Fri Mar 7 19:14:11 2014 Eric Wong <e@80x24.org>
+
+ * vm_eval.c (vm_call0_body): fix RB_GC_GUARD location
+ (check_funcall_exec): ditto
+ [Bug #9609]
+
+Fri Mar 7 14:48:17 2014 Narihiro Nakamura <authornari@gmail.com>
+
+ * parse.y (ENC_SINGLE): Unused macro removed.
+
+Fri Mar 7 12:06:19 2014 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * test/openssl/test_ssl.rb: Reuse TLS default options from
+ OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.
+
+Thu Mar 6 15:15:24 2014 Zachary Scott <e@zzak.io>
+
+ * doc/syntax/assignment.rdoc: [DOC] Fix assignment directions
+ By @idupree [Fixes GH-555] https://github.com/ruby/ruby/pull/555
+
+Thu Mar 6 15:07:18 2014 Zachary Scott <e@zzak.io>
+
+ * doc/syntax/methods.rdoc: [DOC] Fix example for block arguments
+ By @idupree [Fixes GH-554] https://github.com/ruby/ruby/pull/554
+
+Thu Mar 6 10:33:31 2014 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * lib/openssl/ssl.rb: Explicitly whitelist the default
+ SSL/TLS ciphers. Forbid SSLv2 and SSLv3, disable
+ compression by default.
+ Reported by Jeff Hodges.
+ [ruby-core:59829] [Bug #9424]
+
+Wed Mar 5 15:56:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (f_arg_asgn): define optional arguments as argument
+ variables in the rhs default expressions.
+ [ruby-core:61299] [Bug #9593]
+
+Wed Mar 5 11:58:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/ossl.c (ossl_make_error): check NULL for unknown
+ error reasons with old OpenSSL, and insert a colon iff formatted
+ message is not empty.
+
+Wed Mar 5 00:42:00 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/pathname/lib/pathname.rb (Pathname#find): add "ignore_error"
+ keyword argument defaulted to true as well as Find#find.
+
+Tue Mar 4 23:00:18 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_eval.rb (TestEval#make_test_binding): renamed.
+ it's not test method.
+
+Tue Mar 4 20:50:59 2014 Masaya Tarui <tarui@ruby-lang.org>
+
+ * st.c (st_foreach): fix type of hash. not st_data_t but st_index_t.
+
+Tue Mar 4 19:41:40 2014 Tanaka Akira <akr@fsij.org>
+
+ * Makefile.in: ".DEFAULT" target removed because it is not for
+ specifying default target.
+
+Tue Mar 4 00:25:35 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * lib/find.rb (Find#find): should pass ignore_error option to enumerators.
+
+Mon Mar 3 13:27:35 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/test_find.rb (TestFind#test_unsearchable_dir): ruby cannot make
+ directory unreachable by owner on Windows.
+
+Mon Mar 3 08:10:04 2014 Eric Wong <e@80x24.org>
+
+ * vm_method.c (rb_method_entry_get_without_cache): disable GMC
+ writing if GMC is disabled.
+ [ruby-core:61218]
+
+Mon Mar 3 07:47:17 2014 Eric Wong <e@80x24.org>
+
+ * README.EXT: wrap GetDBM with do/while(0)
+ * README.EXT.ja: ditto
+ * ext/dbm/dbm.c: ditto, likewise for GetDBM2
+ * ext/gdbm/gdbm.c: ditto
+ * ext/sdbm/init.c: ditto
+ [ruby-core:61217]
+
+Mon Mar 3 07:17:31 2014 Zachary Scott <e@zzak.io>
+
+ * NEWS: [DOC] Update doc regarding filesystem load when flushing IO
+
+Mon Mar 3 04:37:50 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_io_fsync): need to fsync even if on Windows. fixed mistake
+ of r45254 and r45256.
+
+Mon Mar 3 04:21:34 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/win32ole: get rid of warnings (unused variable).
+
+Mon Mar 3 02:53:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_io_flush_raw): [EXPERIMENTAL] remove force syncing for Win32
+ to speed up IO. this may break some tests, and they'll be fixed
+ later.
+ [ruby-core:58570] [Bug #9153]
+
+Mon Mar 3 00:17:43 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_backtrace.rb: get rid of warnings. unused variable,
+ shadowing.
+
+Sun Mar 2 11:15:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/find.rb (Find#find): add "ignore_error" keyword argument
+ defaulted to true. [ruby-core:51025] [Feature #7596]
+
+Sun Mar 2 11:13:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/readline/extconf.rb (rl_hook_func_t): define as Function for
+ very old readline versions. [ruby-core:61209] [Bug #9578]
+
+Sun Mar 2 10:47:58 2014 Eric Wong <e@80x24.org>
+
+ * load.c (ruby_init_ext): make idempotent to suppress warnings
+
+Sat Mar 1 19:51:42 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/open3.rb (Open3.capture3): Ignore Errno::EPIPE for writing
+ stdin_data.
+ (Open3.capture2): Ditto.
+ (Open3.capture2e): Ditto.
+
+Sat Mar 1 19:06:47 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (ruby_gc_set_params): simplify condition
+
+Sat Mar 1 16:18:40 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/readline/readline.c (Init_readline): Use rl_hook_func_t instead
+ of Function to support readline-6.3. (rl_hook_func_t is available
+ since readline-4.2.)
+ Reported by Dmitry Medvinsky. [ruby-core:61141] [Bug #9578]
+
+Sat Mar 1 16:05:58 2014 Eric Wong <e@80x24.org>
+
+ * gc.c (ruby_gc_set_params): fix building without RGenGC
+
+Sat Mar 1 11:08:00 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: support dumping Encoding
+ objects.
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: support loading Encoding
+ objects.
+
+ * test/psych/test_encoding.rb: add test
+
+ * ext/psych/lib/psych.rb: add version
+
+Sat Mar 1 10:52:34 2014 Zachary Scott <e@zzak.io>
+
+ * README.EXT.ja: [DOC] Fix typo "macro macro" @utenmiki [Fixes GH-551]
+ https://github.com/ruby/ruby/pull/551
+
+Fri Feb 28 11:16:55 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * numeric.c: Fix Numeric#step with 0 unit [Bug #9575]
+
+Thu Feb 27 17:59:01 2014 Zachary Scott <e@zzak.io>
+
+ * lib/optparse.rb: [DOC] Add example of generating help with optparse.
+ Patch by @joelmccracken documenting-ruby/ruby#19
+ https://github.com/documenting-ruby/ruby/pull/19
+
+Thu Feb 27 12:10:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (ruby_num_interval_step_size): check signs and get rid
+ of implementation dependent behavior of negative division.
+ [ruby-core:61106] [Bug #9570]
+
+Thu Feb 27 03:55:45 2014 Zachary Scott <e@zzak.io>
+
+ * thread.c: [DOC] Typo in comment for _FORTIFY_SOURCE [Fixes GH-548]
+ Patch by @qnet-herwin https://github.com/ruby/ruby/pull/548
+
+Wed Feb 26 18:43:43 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_pages_free_unused_pages): check tomb page availability
+ at first.
+ And return immediately if we don't touch sorted list any more.
+
+Wed Feb 26 14:10:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (setup_exception): preserve exception class name encoding
+ in debug mode messages.
+
+ * eval.c (setup_exception): preserve errinfo across calling #to_s
+ method on the exception. [ruby-core:61091] [Bug #9568]
+
+Wed Feb 26 01:29:27 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (sym_find): Add Symbol.find(str), which returns whether given
+ string is defined as symbol or not. [Feature #7854]
+
+Tue Feb 25 22:52:02 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * ext/dl/dl.c (rb_dl_realloc): use NUM2SIZET instead of NUM2INT.
+
+ * ext/fiddle/fiddle.c (rb_fiddle_realloc): ditto.
+
+Tue Feb 25 22:49:30 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * ext/dl/dl.c (rb_dl_malloc): use NUM2SIZET instead of NUM2INT.
+ Coverity Scan found this bug.
+
+ * ext/fiddle/fiddle.c (rb_fiddle_malloc): ditto.
+
+Tue Feb 25 12:06:13 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * win32/Makefile.sub: define PACKED_STRUCT.
+
+Mon Feb 24 21:41:56 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * README.md, README.ja.md: removed (wrong) mode setting for emacs.
+
+Mon Feb 24 20:05:41 2014 Eric Wong <e@80x24.org>
+
+ * configure.in: define PACKED_STRUCT_UNALIGNED for x86*
+ * timev.h (struct vtm): use PACKED_STRUCT_UNALIGNED
+ * time.c (struct time_object): ditto
+ [Bug #9558] non-x86 cannot safely access unaligned addresses
+
+Mon Feb 24 18:10:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/fiddle/test_function.rb: remove unused variables.
+ * test/fileutils/test_fileutils.rb: ditto.
+ * test/io/console/test_io_console.rb: ditto.
+
+Mon Feb 24 12:37:51 2014 Eric Wong <e@80x24.org>
+
+ * configure.in: use -Wno-packed-bitfield-compat for GCC 4.4+
+ use __attribute__((packed)) if available
+ * timev.h: shrink and pack struct vtm
+ * time.c: pack struct time_object and adjust/introduce helpers
+ [ruby-core:60794]
+
+Sun Feb 23 17:55:50 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/xmltokens.rb: Add missing non ASCII valid characters
+ to element name characters. Now, REXML name tokens exactly
+ match "[5] Name" in the XML spec and "[4] NCName" in the
+ Namespaces in XML spec. See comment about the details.
+ [Bug #9539] [ruby-core:60901]
+ Reported by Mario Barcala. Thanks!!!
+
+ * test/rexml/xpath/test_node.rb: Add tests for the above case.
+
+Sun Feb 23 12:18:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/raddrinfo.c (inet_pton): use rb_w32_inet_pton, instead of
+ inet_pton directly, which is unavailable on older version Windows.
+
+ * include/ruby/win32.h, win32/win32.c (rb_w32_inet_pton): add a
+ wrapper function for inet_pton minimum supported client is
+ Vista, as well as inet_ntop.
+
+Sun Feb 23 11:33:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/net/imap/test_imap.rb: remove unused variables.
+ * test/net/imap/test_imap_response_parser.rb: ditto.
+ * test/net/pop/test_pop.rb: ditto.
+
+Sun Feb 23 02:19:51 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (bind_random_port): Rescue EPERM for FreeBSD which
+ security.mac.portacl.port_high is changed.
+ See mac_portacl(4) for details.
+ Reported by Jakub Szafranski. [ruby-core:60917] [Bug #9544]
+
+Sat Feb 22 23:17:01 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/xpath_parser.rb: Fix indent.
+
+Sat Feb 22 23:15:35 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/xpath/test_attribute.rb: Simplify.
+
+Sat Feb 22 20:28:47 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/redmine-backporter.rb: more friendly.
+
+Sat Feb 22 20:24:43 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_xpath*.rb: Move to ...
+ * test/rexml/xpath/*.rb: ... here.
+
+Sat Feb 22 20:04:41 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/listener.rb: Untabify.
+
+Sat Feb 22 19:07:31 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/io/console/console.c (console_dev): need read access for conout$
+ because some functions need it. [Bug#9554]
+
+Sat Feb 22 18:40:58 2014 Eric Wong <e@80x24.org>
+
+ * .gitignore: ignore benchmark files
+
+Sat Feb 22 01:22:24 2014 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * bignum.c (bary_mul_precheck): fix a copy-paste error.
+ Coverity Scan found this bug.
+
+Sat Feb 22 00:58:51 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * ext/socket/raddrinfo.c (rb_getaddrinfo): second argument of
+ MEMZERO is type. Coverity Scan found this bug.
+
+Fri Feb 21 23:47:24 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/socket/init.c (wait_connectable): break if the socket is
+ writable to avoid infinite loops on FreeBSD and other platforms
+ which conforms to SUSv3. This problem cannot be reproduced with
+ loopback interfaces, so it's hard to write test code.
+ rsock_connect() and wait_connectable() are overly complicated, so
+ they should be refactored, but I commit this fix as a workaround
+ for the release of Ruby 1.9.3 scheduled on Feb 24.
+ [ruby-core:60940] [Bug #9547]
+
+Fri Feb 21 23:03:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/redmine-backporter.rb: added to handle redmine tickets.
+
+Fri Feb 21 20:42:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_mod_init_copy): do nothing if copying self.
+ [ruby-dev:47989] [Bug #9535]
+
+ * hash.c (rb_hash_initialize_copy): ditto.
+
+Fri Feb 21 16:45:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/logger.rb (next_rotate_time, previous_period_end): consider
+ DST change.
+
+ * lib/logger.rb (Logger::LogDevice#check_shift_log): compare the
+ current time with the time for the next rotation to fix rotation
+ miss when date changed between the comparison and log writing.
+ based on the patch by megayu <yuhg2310 AT gmail.com>.
+ [Fixes GH-539]
+
+Fri Feb 21 10:39:33 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/monitor/test_monitor.rb: remove unused variables.
+ * test/resolv/test_dns.rb: ditto.
+ * test/rexml/test_functions.rb: ditto.
+ * test/rss/test_setup_maker_itunes.rb: ditto.
+
+Fri Feb 21 09:48:56 2014 Eric Wong <e@80x24.org>
+
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): only retry on error
+ (bsock_recvmsg_internal): ditto
+ * test/socket/test_unix.rb: test above for infinite loop
+
+Fri Feb 21 08:27:19 2014 Eric Wong <e@80x24.org>
+
+ * include/ruby/ruby.h (RB_GC_GUARD):
+ use rb_gc_guarded_ptr_val on non-GCC/MSC
+ * gc.c (rb_gc_guarded_ptr_val): rename and adjust argument.
+ RB_GC_GUARD should be robust enough for any compiler.
+ [ruby-core:60816] [Bug #7805]
+
+Thu Feb 20 22:21:26 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (numeric_getaddrinfo): Use xcalloc.
+ Suggested by Eric Wong.
+ https://bugs.ruby-lang.org/issues/9525#note-14
+
+Thu Feb 20 11:21:13 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_flatten): fix behavior of flatten(-1).
+ [ruby-dev:47988] [Bug #9533]
+
+ * test/ruby/test_array.rb: test for above.
+
+Wed Feb 19 18:57:02 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: Bypass getaddrinfo() if node and serv are numeric.
+ Reporeted by Naotoshi Seo. [ruby-core:60801] [Bug #9525]
+
+ * ext/socket/extconf.rb: Detect struct sockaddr_in6.sin6_len.
+
+ * ext/socket/sockport.h (SET_SIN6_LEN): New macro.
+ (INIT_SOCKADDR_IN6): Ditto.
+
+ * ext/socket/rubysocket.h (struct rb_addrinfo): Add
+ allocated_by_malloc field.
+
+ * ext/socket/raddrinfo.c (numeric_getaddrinfo): New function.
+ (rb_getaddrinfo): Call numeric_getaddrinfo at first.
+ (rb_freeaddrinfo): Free struct addrinfo properly when it is
+ allocated by numeric_getaddrinfo.
+
+Wed Feb 19 18:31:48 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: Wrap struct addrinfo by struct rb_addrinfo.
+
+Wed Feb 19 17:47:01 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c (ip_s_getaddress): Don't access freed memory.
+
+Wed Feb 19 11:39:41 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: it must see rb_cv_broken_memmem not rb_cv_func_memmem.
+
+Tue Feb 18 23:18:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/socket/test_socket.rb: unix socket is required by test case.
+
+Tue Feb 18 20:48:38 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/socket/test_addrinfo.rb: remove unused variables.
+ * test/socket/test_nonblock.rb: ditto.
+ * test/socket/test_socket.rb: ditto.
+ * test/socket/test_unix.rb: ditto.
+ * test/testunit/test_parallel.rb: ditto.
+ * test/webrick/test_filehandler.rb: ditto.
+ * test/xmlrpc/test_features.rb: ditto.
+ * test/zlib/test_zlib.rb: ditto.
+
+Tue Feb 18 14:27:18 2014 Shota Fukumori <her@sorah.jp>
+
+ * lib/test/unit.rb: Requires minitest < 5.0.0 if Gem is available.
+
+Tue Feb 18 14:24:07 2014 Shota Fukumori <her@sorah.jp>
+
+ * lib/test/unit/test-unit.gemspec: Add minitest < 5.0.0 dependency
+
+ * tool/rbinstall.rb: Add empty implementations for `add_dependency`,
+ `add_runtime_dependency`, `add_development_dependency` for
+ Gem::Specification.
+
+Tue Feb 18 12:06:39 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in (FILE_COUNT): Removed. (win32.c defines it in itself.)
+ (FILE_READPTR): Ditto.
+
+Tue Feb 18 09:35:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test/psych/test_string.rb: remove unused variables.
+ * test/test/psych/test_yaml.rb: ditto.
+
+Mon Feb 17 21:31:31 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_gc.rb: ignore warning messages for running with -w
+ option such as chkbuild.
+
+Mon Feb 17 20:00:27 2014 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: Move BDIGIT and related definitions from
+ include/ruby/defines.h.
+
+Mon Feb 17 17:41:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (marshal_dump, marshal_load): do not recycle wrapper
+ objects, to prevent from segfault with continuation.
+ [ruby-dev:47970] [Bug #9523]
+
+Mon Feb 17 15:43:59 2014 Zachary Scott <e@zzak.io>
+
+ * doc/keywords.rdoc: [DOC] Add keywords doc by documenting-ruby/ruby#29
+ https://github.com/documenting-ruby/ruby/pull/29
+
+Mon Feb 17 12:31:31 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (get_envparam_double): fix a warning message.
+
+Mon Feb 17 12:09:52 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c: introduce new environment variable
+ "RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR" to control major/minor GC
+ frequency.
+
+ Do full GC when the number of old objects is more than R * N
+ where R is this factor and
+ N is the number of old objects just after last full GC.
+
+ * test/ruby/test_gc.rb: add a test.
+
+Mon Feb 17 11:28:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_pty.rb: ignore warnings to unused variables.
+
+Mon Feb 17 11:27:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_find.rb: remove unused variables.
+
+Sun Feb 17 02:12:00 2014 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_initialize): Insert GC guard.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): ditto.
+
+Sun Feb 16 15:53:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/test_securerandom.rb: File.exists? is deprecated. use File.exist?
+
+Sun Feb 16 15:05:00 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/pathname/test_pathname.rb: File.exists? is deprecated. use File.exist?
+
+Sun Feb 16 15:00:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/net/ftp/test_ftp.rb: remove unused variables.
+ * test/logger/test_logger.rb: ditto.
+
+Sun Feb 16 14:52:46 2014 Eric Wong <e@80x24.org>
+
+ * dir.c (dir_s_glob): RB_GC_GUARD instead of volatile
+
+Sun Feb 16 14:33:52 2014 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h (RBIGNUM_SIGN): Defined for compatibility.
+ (RBIGNUM_POSITIVE_P): Ditto.
+ (RBIGNUM_NEGATIVE_P): Ditto.
+
+Sun Feb 16 12:46:47 2014 Eric Wong <e@80x24.org>
+
+ * io.c (rb_f_backquote): trade volatile for manual recycle
+ rb_gc_force_recycle ensures object is visible until recycle
+
+Sun Feb 16 11:55:14 2014 Eric Wong <e@80x24.org>
+
+ * marshal.c (marshal_dump): use rb_gc_force_recycle for GC-safety
+ (marshal_load): ditto
+ [ruby-core:60730] [Bug #7805]
+
+Sun Feb 16 08:11:23 2014 Zachary Scott <e@zzak.io>
+
+ * README.EXT.ja: [DOC] Fix typo by @utenmiki [Fixes GH-534]
+ https://github.com/ruby/ruby/pull/534
+
+Sun Feb 16 07:48:20 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/bigdecimal/bigdecimal.c (BIGNUM_ZERO_P): Unused macro removed.
+
+Sun Feb 16 06:12:23 2014 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.
+ (BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS.
+ (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX.
+ (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT.
+ (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN.
+ (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN.
+ (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P.
+ (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P.
+ (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG.
+ (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK.
+ (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT.
+ (BIGNUM_LEN): Renamed from RBIGNUM_LEN.
+ (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS.
+ (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT.
+
+ * bignum.c: Follow the above change.
+
+ * gc.c: Ditto.
+
+ * marshal.c: Ditto.
+
+ * math.c: Ditto.
+
+ * numeric.c: Ditto.
+
+ * random.c: Ditto.
+
+ * rational.c: Ditto.
+
+ * sprintf.c: Ditto.
+
+ * ext/-test-/bignum/bigzero.c: Ditto.
+
+ * ext/-test-/bignum/intpack.c: Ditto.
+
+ * ext/bigdecimal/bigdecimal.c: Ditto.
+
+Sat Feb 15 20:48:49 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in (FILE_READEND): Don't detect it because it is not used.
+
+Sat Feb 15 13:22:28 2014 Eric Wong <e@80x24.org>
+
+ * probes_helper.h (RUBY_DTRACE_HOOK): correct type for _id
+
+Sat Feb 15 11:47:47 2014 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_cmp): Avoid bignum allocation for comparison
+ between bignum and fixnum.
+
+Sat Feb 15 10:55:12 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * ext/-test-/win32/fd_setsize/depend: fix wrong dependencies.
+ [ruby-dev:47253]
+
+Sat Feb 15 00:38:54 2014 Tanaka Akira <akr@fsij.org>
+
+ * enum.c: Enumerable#{min,min_by,max,max_by} extended to take an
+ optional argument.
+ (nmin_cmp): New function.
+ (nmin_block_cmp): Ditto
+ (nmin_filter): Ditto.
+ (nmin_i): Ditto.
+ (nmin_run): Ditto.
+ (enum_min): Call nmin_run if the optional argument is given.
+ (nmin_max): Ditto.
+ (nmin_min_by): Ditto.
+ (nmin_max_by): Ditto.
+
+ * range.c: Range#{min,max} extended to take an optional argument.
+ (range_min): Call range_first if the optional argument is given.
+ (range_max): Call rb_call_super if the optional argument is given.
+
+ [ruby-core:57111] [Feature #8887]
+
+Sat Feb 15 00:27:46 2014 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h,
+ internal.h,
+ ext/-test-/bignum/bigzero.c: Hide a Bignum definition.
+ [ruby-core:42891] [Feature #6083]
+
+Sat Feb 15 00:13:14 2014 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h,
+ include/ruby/io.h,
+ include/ruby/ruby.h,
+ include/ruby/win32.h,
+ include/ruby/backward/rubysig.h,
+ bignum.c,
+ gc.c,
+ io.c,
+ process.c,
+ safe.c,
+ struct.c,
+ thread.c,
+ ext/socket/rubysocket.h,
+ ext/-test-/old_thread_select: Remove deprecated definitions
+ [ruby-core:60581] [Feature #9502]
+
+Fri Feb 14 18:38:46 2014 Eric Wong <e@80x24.org>
+
+ * string.c (rb_str_format_m): trade volatile for RB_GC_GUARD
+ RB_GC_GUARD meaning is clear and has better code generation.
+ [ruby-core:60688]
+
+Thu Feb 13 23:30:30 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): should check ci->me->flag of
+ a refining method in case the method is private.
+ [ruby-core:60111] [Bug #9452]
+
+ * vm_method.c (make_method_entry_refined): set me->flag of a refined
+ method entry to NOEX_PUBLIC in case the original method is private
+ and it is refined as a public method. The original flag is stored
+ in me->def->body.orig_me, so it's OK to make a refined method
+ entry public. [ruby-core:60111] [Bug #9452]
+
+ * test/ruby/test_refinement.rb: related tests.
+
+Thu Feb 13 18:38:15 2014 Eric Wong <e@80x24.org>
+
+ * re.c (rb_reg_raise): remove volatile
+ Unnecessary since r41597
+
+Thu Feb 13 18:28:51 2014 Eric Wong <e@80x24.org>
+
+ * re.c (rb_reg_regcomp): remove volatile
+ Unnecessary since r13261
+
+Thu Feb 13 16:54:32 2014 Zachary Scott <e@zzak.io>
+
+ * test/ruby/test_array.rb: Ensure flatten! is used for test_flatten
+ Patch by @ksss [Fixes GH-530] https://github.com/ruby/ruby/pull/530
+
+Thu Feb 13 15:43:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (IDSET_ATTRSET_FOR_INTERN): fix off-by-one bug.
+
+ * parse.y (rb_enc_symname_type): junk ID succeeded by '=' is also
+ attrset ID. [ruby-core:60668] [Bug #8756]
+
+Thu Feb 13 11:06:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: check if pthread_setname_np is available.
+
+ * thread_pthread.c: pthread_setname_np is not available on old
+ Darwins. [ruby-core:60524] [Bug #9492]
+
+Thu Feb 13 00:56:59 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * configure.in: revert r44922. I should have used AC_CHECK_FUNCS()
+ to just define a symbol if the function is available.
+
+Thu Feb 13 00:20:58 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * configure.in: use AC_CHECK_FUNC instead of AC_CHECK_FUNCS
+ if available.
+
+Thu Feb 13 00:15:10 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * configure.in: fix to undefine HAVE_MEMMEM correctly if it is broken.
+
+Tue Feb 11 23:54:40 2014 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_cmp): Specialize a comparison to zero.
+
+ * ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of
+ RBIGNUM_NEGATIVE_P.
+ (BigMath_s_log): Ditto.
+
+Tue Feb 11 22:59:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use rb_integer_pack.
+ Fix SEGV by OpenSSL::BN.new(1 << (2**34)).
+
+Tue Feb 11 17:00:38 2014 Zachary Scott <e@zzak.io>
+
+ * ext/tk/README.tcltklib: [DOC] Fix typo by @xta [Fixes GH-532]
+
+Sun Feb 9 13:59:29 2014 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: Fix compilation error.
+ https://bugs.ruby-lang.org/issues/8358#note-16
+
+Sun Feb 9 05:20:24 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (rb_cv_gnu_qsort_r): use compile error "conflicting
+ types for 'qsort_r'" instead of AC_RUN_IFELSE.
+
+Sun Feb 9 04:07:34 2014 Zachary Scott <e@zzak.io>
+
+ * lib/yaml.rb: [DOC] Add links to syck and psych on github [Bug #9501]
+ Based on a patch by Giorgos Tsiftsis
+
+Sun Feb 9 02:13:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (OBJ_TAINTABLE, OBJ_TAINT, OBJ_INFECT),
+ marshal.c (r_entry0): all Numerics never be tainted now.
+ [ruby-core:57346] [Bug #8945]
+
+Sat Feb 8 23:40:35 2014 Vit Ondruch <vondruch@redhat.com>
+
+ * configure.in: add quoting brackets and append wildcard for the
+ rest after target_cpu, to properly detect platform for SSE2
+ instructions. [ruby-core:60576] [Bug #8358]
+
+Sat Feb 8 21:44:07 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * configure.in: check qsort_r(3) and whether it is GNU version.
+ BSD version has different prototype.
+
+ * util.h: use qsort_r() as ruby_qsort() if it is GNU version.
+
+ * util.c: define ruby_qsort() if needed.
+
+Sat Feb 8 16:34:36 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder#get_labels):
+ Make it iterative.
+
+Sat Feb 8 15:54:12 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, gc.h (rb_objspace_marked_object_p): added.
+ This function *ONLY* works just after marking phase,
+ before any sweeping.
+ This function is highly depending current GC implementation
+ and can be removed future version.
+
+Sat Feb 8 15:41:37 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: Don't set CLOEXEC flag explicitly. (Ruby set it by
+ default.)
+
+Sat Feb 8 15:27:02 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder): Raise
+ DecodeError if no data before the limit.
+ Reported by Will Bryant. [ruby-core:60557] [Bug #9498]
+
+Sat Feb 8 15:11:21 2014 Tanaka Akira <akr@fsij.org>
+
+ * io.c (SMALLBUF): Unused macro removed.
+
+Fri Feb 7 23:37:49 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: Ignore name servers which cause EAFNOSUPPORT on
+ socket creation.
+ Reported by Bjoern Rennhak. [ruby-core:60442] [Bug #9477]
+
+Fri Feb 7 21:58:48 2014 Zachary Scott <e@zzak.io>
+
+ * lib/open-uri.rb: [DOC] use lower case version of core classes, same
+ as commit r44878, based on patch by Jonathan Jackson [Bug #9483]
+
+Fri Feb 7 21:54:53 2014 Zachary Scott <e@zzak.io>
+
+ * ext/ripper/lib/ripper/lexer.rb: [DOC] use lower case version of core
+ classes when referring to return value, since we aren't directly
+ talking about the class. Patch by Jonathan Jackson [Bug #9483]
+
+Fri Feb 7 05:28:38 2014 Eric Wong <e@80x24.org>
+
+ * constant.h: reduce rb_const_entry_t size on 64-bit
+ Patch by Adam Avilla [ruby-core:60542] [Feature #9496]
+
+Thu Feb 6 15:27:46 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (get_envparam_int): correct warning messages.
+
+ * gc.c (get_envparam_double): ditto.
+
+Thu Feb 6 15:17:30 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (get_envparam_int): don't accept a value equals to lowerbound
+ (changed by last commit) because "" or "foo" (not a number) strings
+ are parsed as 0. They should be rejected.
+
+ * gc.c (get_envparam_double): ditto.
+
+Thu Feb 6 09:00:35 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided,
+ then set objspace->rgengc.oldmalloc_increase_limit.
+ Without this fix, the env variable RUBY_GC_OLDMALLOC_LIMIT
+ does not work.
+
+ * gc.c (get_envparam_int): accept a value equals to lowerbound.
+
+ * gc.c (get_envparam_double): ditto.
+
+Thu Feb 6 08:23:28 2014 Eric Wong <e@80x24.org>
+
+ * ext/thread/thread.c (rb_szqueue_max_set): use correct queue and
+ limit wakeups. [Bug #9343][ruby-core:60517]
+ * test/thread/test_queue.rb (test_sized_queue_assign_max):
+ test for bug
+
+Thu Feb 6 07:18:01 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.2.2. Complete history at:
+
+ http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.2.2+%2F+2014-02-05
+
+ * test/rubygems: ditto.
+
+Wed Feb 5 20:56:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (to_be_skipped_id): ignore anonymous attributes.
+
+ * pack.c (Init_pack): use anonymous ID so that associated objects
+ do not appear in the packed result.
+
+ * parse.y (rb_make_internal_id): return an anonymous ID for
+ internal use.
+
+Wed Feb 5 14:41:56 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vsnprintf.c: remove duplicated def of `UNINITIALIZED_VAR()'.
+
+Wed Feb 5 14:40:16 2014 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace_dump.c (dump_object): use STR_SHARED_P()
+ instead of removed STR_NOCAPA_P() macro.
+
+Wed Feb 5 13:51:33 2014 Koichi Sasada <ko1@atdot.net>
+
+ * internal.h, vm_core.h: move LIKELY/UNLIKELY/UNINITIALIZED_VAR()
+ macros from vm_core.h to internal.h.
+
+ * string.c: remove dependency to "vm_core.h".
+
+ * common.mk: ditto.
+
+Wed Feb 5 13:29:01 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (rb_str_free): use FL_TEST(str, STR_SHARED) directly
+ because str is not embed.
+
+ * string.c (str_replace): remove `FL_SET(str, STR_SHARED)' line
+ because STR_SET_SHARED() set STR_SHARED.
+
+Wed Feb 5 13:18:08 2014 Koichi Sasada <ko1@atdot.net>
+
+ * internal.h: remove macros STR_NOCAPA and STR_NOCAPA_P().
+
+ * string.c (rb_str_resize): remove `STR_SET_NOEMBED(str)' because
+ str_make_independent_expand() set NOEMBED flag.
+
+ * string.c (rb_str_resize): remove `STR_NOCAPA_P(str)' check because
+ `str' is independent (not shared).
+
+Wed Feb 5 12:54:25 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c: refactoring, especially about string flags.
+
+ * string.c (STR_UNSET_NOCAPA): removed.
+ Use FL_UNSET() with STR_SHARED.
+
+ * string.c (rb_str_capacity): check STR_SHARED directly
+ because it is not a embed string.
+
+ * string.c (rb_str_modify_expand): ditto.
+
+ * string.c (rb_str_shared_replace): use STR_SET_SHARED().
+
+ * string.c (str_make_independent_expand): remove STR_UNSET_NOCAPA()
+ because `str' is not shared string.
+
+Wed Feb 5 12:11:04 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (RESIZE_CAPA): should not resize shared string.
+
+Wed Feb 5 11:46:42 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_mark_children): STR_ASSOC is no longer available.
+ Reported by @nagachika.
+ http://d.hatena.ne.jp/nagachika/20140204
+
+Wed Feb 5 11:27:22 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c (rb_str_new_frozen): refactoring code.
+ * Move code from str_new_frozen_with_klass() (and remove it)
+ * `aux.shared' should not be 0 for STR_SHARED strings.
+
+Wed Feb 5 04:23:41 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: New release of psych.
+ * ext/psych/psych.gemspec: ditto
+
+Wed Feb 5 04:16:41 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/yaml/emitter.c: merge libyaml 0.1.5
+ * 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_private.h: ditto
+
+Tue Feb 4 19:10:29 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c: use long allocator names instead of numbered
+ allocator names.
+ * rb_str_new2 -> rb_str_new_cstr
+ * rb_str_new4 -> rb_str_new_frozen
+ * rb_str_new5 -> rb_str_new_with_class
+ * str_new3 -> str_new_shared
+ * str_new4 -> str_new_frozen_with_klass
+
+Tue Feb 4 17:20:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): return the filename with actual cases on
+ the filesystem if it is case-insensitive. [ruby-core:42469]
+ [Feature #5994]
+
+Tue Feb 4 16:16:58 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c: use STR_SHARED instead of ELTS_SHARED.
+ (same value, but more clear meaning)
+
+Tue Feb 4 16:09:14 2014 Koichi Sasada <ko1@atdot.net>
+
+ * string.c: remove STR_ASSOC related code.
+ By r44804, string objects can not have STR_ASSOC flag.
+
+ * internal.h: ditto.
+
+ * ext/objspace/objspace_dump.c (dump_object): ditto.
+
+Tue Feb 4 14:07:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (str_associate, str_associated): keep associated objects
+ in an instance variables, instead of in the internal structure.
+
+ * string.c (rb_str_associate, rb_str_associated): deprecate.
+
+Tue Feb 4 12:55:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_modify_expand): enable capacity and disable
+ association with packed objects when setting capa, so that
+ pack("p") string fails to unpack properly after modified.
+
+Tue Feb 4 12:45:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_make_pattern): all alphabets are magic characters on
+ case-insensitive filesystems. [ruby-core:42469] [Feature #5994]
+
+Tue Feb 4 09:47:57 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 2.2.2 prerelease to check fixes to
+ CI.
+ * test/rubygems: ditto.
+
+Mon Feb 3 12:04:47 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * error.c: [DOC] Exception#cause may return nil. [ci skip]
+
+Sun Feb 2 05:48:42 2014 Eric Wong <e@80x24.org>
+
+ * io.c (rb_io_syswrite): add RB_GC_GUARD
+ [Bug #9472][ruby-core:60407]
+
+Sat Feb 1 15:09:16 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_typedesc2val): add VT_RECORD case.
+
+Sat Feb 1 06:38:51 2014 Zachary Scott <e@zzak.io>
+
+ * lib/drb/drb.rb: [DOC] Add note about start_service for each process
+ Based on a patch by @rosenfeld [Fixes GH-514] [ci skip]
+ https://github.com/ruby/ruby/pull/514
+
+Sat Feb 1 06:30:20 2014 Zachary Scott <e@zzak.io>
+
+ * error.c: [DOC] Document Exception#cause by @jasonrclark [ci skip]
+ [Fixes GH-519] https://github.com/ruby/ruby/pull/519
+
+Sat Feb 1 06:10:49 2014 Zachary Scott <e@zzak.io>
+
+ * lib/securerandom.rb: [DOC] Add note on require for examples
+ Based on a patch by @schneems [Fixes GH-518] [ci skip]
+ https://github.com/ruby/ruby/pull/518
+
+Sat Feb 1 06:04:56 2014 Zachary Scott <e@zzak.io>
+
+ * numeric.c: [DOC] Fix typo in example for #step [ci skip]
+ Patch by @ksss [Fixes GH-522] https://github.com/ruby/ruby/pull/522
+
+Fri Jan 31 17:01:47 2014 Eric Wong <e@80x24.org>
+
+ * ext/socket/init.c (rsock_socket0): split out SOCK_CLOEXEC version
+ * ext/socket/socket.c (rsock_socketpair0): ditto
+ [ruby-core:60377]
+
+Fri Jan 31 03:48:40 2014 Eric Wong <e@80x24.org>
+
+ * benchmark/driver: avoid large alloc in driver process
+ [ruby-core:59869] [Bug #9430]
+
+Thu Jan 30 14:45:49 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * configure.in: use $@ instead of $(.TARGET) because .TARGET is not
+ supported by GNU make.
+
+Thu Jan 30 08:26:21 2014 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
+ [ruby-core:57599] [Bug #8978].
+
+Wed Jan 29 20:08:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (nogvl_copy_stream_sendfile): check socket on other than
+ linux, as sendfile(2) on non-socket fd works only on linux.
+ [Feature #9427]
+
+Wed Jan 29 18:09:48 2014 Eric Wong <e@80x24.org>
+
+ * io.c (nogvl_copy_stream_sendfile): remove socket check
+ [ruby-core:59856][Feature #9427]
+
+Wed Jan 29 04:29:54 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/openssl/ossl_ssl.c: pass read_nonblock options to underlying IO
+ when SSL session has not been started.
+
+ * test/openssl/test_ssl.rb: test for change.
+
+Wed Jan 29 03:49:36 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
+ [ruby-core:57599] [Bug #8978]. Thanks mame!
+
+Wed Jan 29 03:36:42 2014 Eric Wong <e@80x24.org>
+
+ * doc/contributing.rdoc: allow/encourage other git hosts
+ [ruby-core:59807][misc #9421]
+
+Tue Jan 28 23:36:01 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: Avoid redundant fcntl/fstat syscalls for cloexec
+ sockets.
+ Patch by Eric Wong. [ruby-core:59429] [Feature #9330]
+
+Tue Jan 28 20:51:07 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c (READ_FROM_CHILD): Apply the last hunk of
+ 0001-process.c-avoid-EINTR-from-Process.spawn.patch written by
+ Eric Wong in [Bug #8770].
+
+Tue Jan 28 16:31:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (ruby_init_stack, ruby_stack_overflowed_p):
+ place get_stack above others to get stack boundary information.
+ [ruby-core:60113] [Bug #9454]
+
+Tue Jan 28 15:27:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread_pthread.c: rlimit is only available on Linux.
+ At least r44712 breaks FreeBSD.
+ [ruby-core:60113] [Bug #9454]
+
+Tue Jan 28 15:17:59 2014 Zachary Scott <e@zzak.io>
+
+ * lib/set.rb: [DOC] Add examples for Set#intersect? and Set#disjoint?
+ Patch by xavier nayrac [Bug #9331] [ci skip]
+
+Tue Jan 28 15:12:22 2014 Zachary Scott <e@zzak.io>
+
+ * ext/zlib/zlib.c (rb_zlib_adler32): [DOC] Add example for adler32
+ Patch by Vajrasky Kok [Bug #9307] [ci skip]
+
+Tue Jan 28 08:56:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * compile.c (iseq_build_from_ary_body): Use :blockptr instead of :block
+ as hash key when loading serialized instruction sequences from arrays.
+ [Bug #9455] [ruby-core:60146]
+
+Mon Jan 27 21:52:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c: get current main thread stack size, which may
+ be expanded than allocated size at initialization, by rlimit().
+ [ruby-core:60113] [Bug #9454]
+
+Sat Jan 25 22:17:02 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * README.ja.md, README.md: update the controller address of
+ mailing lists.
+
+Sat Jan 25 14:50:42 2014 Eric Wong <normalperson@yhbt.net>
+
+ * process.c (send_child_error): retry write on EINTR to fix
+ occasional Errno::EINTR from Process.spawn.
+
+ * process.c (recv_child_error): retry read on EINTR to fix
+ occasional Errno::EINTR from Process.spawn.
+
+Sat Jan 25 14:21:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): result of assignment should be
+ its rhs instead of returned value from a method.
+ [ruby-core:60071] [Bug #9448]
+
+Sat Jan 25 11:16:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_extract_keywords): treat nil keyword_hash same as 0,
+ for the case rb_scan_args returns nil if no keyword hash.
+
+Fri Jan 24 15:13:20 2014 Zachary Scott <e@zzak.io>
+
+ * lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos
+ Patch by Giorgos Tsiftsis [Bug #9429] [ci skip]
+
+Thu Jan 23 20:20:17 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/envutil.rb: try to wait a bit (0.1sec) when ruby process
+ exits by signals because some SEGV tests fail because of not enough
+ error output.
+
+Thu Jan 23 20:06:27 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_settracefunc.rb: check the target thread.
+
+Thu Jan 23 19:59:16 2014 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_settracefunc.rb: check the target thread.
+
+Thu Jan 23 14:26:44 2014 Zachary Scott <e@zzak.io>
+
+ * lib/fileutils.rb: [DOC] Fix typo in options_of() example [Bug #9392]
+ Patch by Giorgos Tsiftsis
+
+Thu Jan 23 13:56:16 2014 Zachary Scott <e@zzak.io>
+
+ * README -> README.md: [DOC] Format README with Markdown [Bug #9255]
+ * README.ja -> README.ja.md: ditto
+
+Wed Jan 22 15:59:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/thread/thread.c (Init_thread): ConditionVariable and Queue
+ are not able to copy. [ruby-core:59961] [Bug #9440]
+
+Tue Jan 21 20:14:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
+ where PTHREAD_STACK_MIN is a dynamic value and not a compile-time
+ constant. [ruby-dev:47911] [Bug #9436]
+
+Tue Jan 21 17:55:09 2014 Zachary Scott <e@zzak.io>
+
+ * lib/uri/common.rb: [DOC] Use static w3.org uri [ci skip]
+ Patch by @ykzts [Fix GH-484] https://github.com/ruby/ruby/pull/484
+
+Tue Jan 21 16:43:22 2014 Zachary Scott <e@zzak.io>
+
+ * enum.c: [DOC] Add simple example of Enumerable#zip [ci skip]
+ Patch by @nruth on documenting-ruby/ruby#22
+ https://github.com/documenting-ruby/ruby/pull/22
+
+Tue Jan 21 16:26:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (rb_thread_create_timer_thread): expand timer
+ thread stack size to get rid of segfault on FreeBSD/powerpc64.
+ based on the patch by Steve Wills at [ruby-core:59923].
+ [ruby-core:56590] [Bug #8783]
+
+Tue Jan 21 04:31:23 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP and
+ IP_MULTICAST_TTL on Mac OS X and Windows.
+
+Tue Jan 21 00:39:15 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c: Use "byte" as default argument for
+ IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket option to follow
+ the original multicast implementation.
+
+Mon Jan 20 20:20:27 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c: Use preprocessor macros to avoid repeated
+ conditionals.
+
+Mon Jan 20 13:55:03 2014 Zachary Scott <e@zzak.io>
+
+ * lib/rubygems/version.rb: [DOC] Use gender-neutral pronouns [ci skip]
+ * lib/rubygems/security.rb: ditto
+
+Sun Jan 19 06:38:48 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * compar.c (cmp_equal): warn for this release and still rescue
+ standard exceptions for a nicer transition. See #7688.
+ Partly reverts r44502.
+
+ * test/ruby/test_comparable.rb: adapt assertion to match new behavior.
+
+Sun Jan 19 06:27:18 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * test/ruby/test_comparable.rb: specify behavior for the different
+ kind of exceptions rescued (or not) by Comparable#==.
+
+Sat Jan 18 23:12:19 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket: Avoid unnecessary ppoll/select on Linux.
+ Patch by Eric Wong. [ruby-core:57950] [Bug #9039]
+
+Sat Jan 18 22:57:44 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (Resolv::DNS::Resource::TXT#data): Return concatenated
+ string.
+ Patch by Ryan Brunner. [ruby-core:58220] [Bug #9093]
+
+Sat Jan 18 22:35:15 2014 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_update_max_fd): Return immediately if the given fd is small
+ enough.
+
+Sat Jan 18 22:25:53 2014 Tanaka Akira <akr@fsij.org>
+
+ * io.c: Test O_CLOEXEC only once.
+ Patch by Eric Wong. [ruby-core:59419] [Feature #9328]
+
+Sat Jan 18 21:24:49 2014 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket
+ option takes a byte on OpenBSD.
+ Fixed by Jeremy Evans. [ruby-core:59496] [Bug #9350]
+
+Sat Jan 18 21:19:04 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb: Make proxy disabling working again.
+ Fixed by Christophe Philemotte. [ruby-core:59650] [Bug #9385]
+
+Fri Jan 17 20:05:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/delegate.rb (Delegator): keep source information methods
+ which start and end with '__'. [ruby-core:59718] [Bug #9403]
+
+Fri Jan 17 17:58:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_mod_s_constants): return its own constants for other
+ than Module itself. [ruby-core:59763] [Bug #9413]
+
+Tue Jan 16 00:17:00 2014 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.5.
+
+Wed Jan 15 20:30:31 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * io.c (io_binwrite): use writev(2) to avoid double write if available.
+
+ * configure.in: check writev(2)
+
+Wed Jan 15 14:04:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (get_encoding): respect BOM on pseudo encodings.
+ [ruby-dev:47895] [Bug #9415]
+
+Wed Jan 15 14:03:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (get_actual_encoding): get actual encoding according to
+ the BOM if exists.
+
+ * string.c (rb_str_inspect): use according encoding, instead of
+ pseudo encodings, UTF-{16,32}. [ruby-core:59757] [Bug #8940]
+
+Tue Jan 14 21:07:22 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * ext/thread/thread.c (rb_szqueue_clear): notify SZQUEUE_WAITERS
+ on SizedQueue#clear. [ruby-core:59462] [Bug #9342]
+
+ * test/thread/test_queue.rb: add test. the patch is from
+ Justin Collins.
+
+Tue Jan 14 15:58:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (CLASS_NAME): macro to wrap
+ depending on PRIsVALUE for 1.9. [Backport #9406]
+
+ * ext/bigdecimal/bigdecimal.c (DECIMAL_SIZE_OF_BITS): fallback
+ definition for 2.1 or older. [ruby-core:59750] [Backport #9406]
+
+Tue Jan 14 11:28:44 2014 Yuki Yugui Sonoda <yugui@google.com>
+
+ * vm_exec.c (cfp): Fixes a SEGV issue in r44554.
+ r11 can be broken by subroutine and sometimes causes SEGV at
+ runtime. Use r13 instead.
+
+Tue Jan 14 02:20:00 2014 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additional
+ digit for the quotient to be compatible with bigdecimal 1.2.1 and
+ the former. [ruby-core:59365] [#9316] [#9305]
+
+ * test/bigdecimal/test_bigdecimal.rb: tests for the above change.
+
+ * ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.4.
+
+Mon Jan 13 14:55:31 2014 Zachary Scott <e@zzak.io>
+
+ * lib/xmlrpc/client.rb: [DOC] Remove note about SSL package on RAA
+ Since RAA has been deprecated, and the SSL package has been replaced
+ with net/https this statement is entirely false and should be
+ deleted. [Bug #9152]
+
+Mon Jan 13 14:47:07 2014 Zachary Scott <e@zzak.io>
+
+ * lib/net/smtp.rb: [DOC] Remove dead link to RAA by Giorgos Tsiftsis
+ Fixes the following bugs: [Bug #9152] [Bug #9268] [Bug #9394]
+ * lib/open-uri.rb: ditto
+
+Mon Jan 13 14:25:55 2014 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_pkey_dh.c: Fixed typo by Sandor Szuecs [Bug #9243]
+
+Mon Jan 13 12:03:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
+ instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
+ [Bug #9302] [ruby-core:59324]
+
+ * test/thread/test_queue.rb: add test
+
+Sun Jan 12 16:41:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * iseq.c (iseq_load): keep type_map to get rid of memory leak.
+ based on a patch by Eric Wong at [ruby-core:59699]. [Bug #9399]
+
+Sun Jan 12 09:21:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/util.h (DECIMAL_SIZE_OF_BITS): a preprocessor
+ constant macro to approximate decimal representation size of n-bits
+ integer.
+
+ * iseq.c (register_label): use DECIMAL_SIZE_OF_BITS for better
+ approximation.
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto.
+
+ * common.mk (iseq.o), ext/bigdecimal/depend (bigdecimal.o): add
+ dependency to ruby/util.h for DECIMAL_SIZE_OF_BITS.
+
+Fri Jan 10 16:27:20 2014 Yuki Yugui Sonoda <yugui@google.com>
+
+ * vm_exec.c (cfp): Avoid generating invalid binary for
+ NativeClient.
+ r15 on x86_64 is reserved by NativeClient. So r15 to cfp used to
+ generate invalid binary under some combinations of compiler
+ optimization flags.
+
+Fri Jan 10 18:01:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_search_super_method): allow bound method from a
+ module, yet another method transplanting.
+
+Fri Jan 10 13:34:04 2014 Aman Gupta <ruby@tmm1.net>
+
+ * insns.def (opt_aref_with): new instruction to optimize Hash#[],
+ removing any allocation overhead when used with a string literal
+ key. Patch by normalperson (Eric Wong). [ruby-core:59640] [Bug #9382]
+ * insns.def (opt_aset_with): new instruction to optimize Hash#[]=
+ * compile.c (iseq_compile_each): compiler shortcuts for new
+ instructions
+ * hash.c (static VALUE rb_hash_compare_by_id_p): fix documentation for
+ Hash#compare_by_identity to reflect frozen string sharing
+ * test/ruby/test_hash.rb (class TestHash): test for new behavior
+
+Fri Jan 10 06:23:21 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * range.c (Range#size): [DOC] improve description and add examples.
+ Patch by @skade. [Fixes GH-501]
+
+Fri Jan 10 00:47:52 2014 Josef Stribny <strzibny@gmail.com>
+
+ * ext/tk/extconf.rb: fix to pass arrays instead of strings to
+ libpathflag. patch at [ruby-core:59665]. [Bug #9386]
+
+Thu Jan 9 20:49:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: -mstackrealign is necessary for -msse2 working.
+ [ruby-core:54716] [Bug #8349]
+
+ * configure.in: use SSE2 instructions to drop unexpected precisions on
+ other than mingw. [ruby-core:59472] [Bug #8358]
+
+Thu Jan 9 20:31:10 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * hash.c (rb_objid_hash): should return `long'. brushup r44534.
+
+ * object.c (rb_obj_hash): follow above change.
+
+Thu Jan 9 19:12:37 2014 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (rb_vm_pop_cfunc_frame): added. It cares c_return event.
+ The patch base by drkaes (Stefan Kaes).
+ [Bug #9321]
+
+ * variable.c (rb_mod_const_missing): use rb_vm_pop_cfunc_frame()
+ instead of rb_frame_pop().
+
+ * vm_eval.c (raise_method_missing): ditto.
+
+ * vm_eval.c (rb_iterate): ditto.
+
+ * internal.h (rb_vm_pop_cfunc_frame): add decl.
+
+ * test/ruby/test_settracefunc.rb: add tests.
+ provided by drkaes (Stefan Kaes).
+
+ * vm.c, eval.c, include/ruby/intern.h (rb_frame_pop):
+ move definition of rb_frame_pop() and deprecate it.
+ It doesn't care about `return' events.
+
+Thu Jan 9 17:40:28 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * hash.c (rb_any_hash): should treat the return value of rb_objid_hash()
+ as `long', because ruby assumes the hash value of the object id of
+ an object is `long'.
+ this fixes test failures on mswin64 introduced at r44525.
+
+Thu Jan 9 09:55:20 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with
+ quotes should not have changed. [ruby-core:59316] [Bug #9300]
+
+ * ext/psych/lib/psych.rb: fixed missing require.
+
+ * test/psych/test_string.rb: test
+
+Thu Jan 9 09:51:00 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: anonymous structs
+ should be able to roundtrip. Thanks @splattael!
+
+ * test/psych/test_object_references.rb: test for change
+
+Wed Jan 8 22:53:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_search_super_method): when super called in a
+ bound UnboundMethod generated from a module, no superclass is
+ found since the current defined class is the module, then call
+ method_missing in that case. [ruby-core:59619] [Bug #9377]
+
+Wed Jan 8 15:55:21 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_objid_hash): return hash value from object ID with a
+ salt, extract from rb_any_hash().
+
+ * object.c (rb_obj_hash): return same value as rb_any_hash().
+ fix r44125. [ruby-core:59638] [Bug #9381]
+
+Wed Jan 8 13:12:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/timeout.rb (Timeout::ExitException.catch): pass arguments
+ for new instance.
+
+ * lib/timeout.rb (Timeout::ExitException#exception): fallback to
+ Timeout::Error if couldn't throw. [ruby-dev:47872] [Bug #9380]
+
+ * lib/timeout.rb (Timeout#timeout): initialize ExitException with
+ message for the fallback case.
+
+Tue Jan 7 12:43:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/timeout.rb (Timeout#timeout): should not rescue ordinarily
+ raised ExitException, which should not be thrown.
+
+ * lib/timeout.rb (Timeout::ExitException.catch): set @thread only if
+ it ought to be caught.
+
+ * lib/timeout.rb (Timeout#timeout): when a custom exception is given,
+ no instance is needed to be caught, so defer creating new instance
+ until it is raised. [ruby-core:59511] [Bug #9354]
+
+Tue Jan 7 10:16:02 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems master 21e409d / RubyGems 2.2.1.
+
+ See http://rubygems.rubyforge.org/rubygems-update/History_txt.html
+ for a list of bug fixes.
+
+ * test/rubygems: ditto.
+
+Tue Jan 7 10:10:46 2014 Eric Wong <e@80x24.org>
+
+ * ext/json/generator/depend: add build dependencies for json extension
+ [Bug #9374] [ruby-core:59609]
+ * ext/json/parser/depend: ditto
+
+Tue Jan 7 04:35:46 2014 Aman Gupta <ruby@tmm1.net>
+
+ * array.c (ary_add_hash): Fix consistency issue between Array#uniq and
+ Array#uniq! [Bug #9340] [ruby-core:59457]
+ * test/ruby/test_array.rb (class TestArray): regression test for above.
+
+Mon Jan 6 21:28:48 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * .gitignore: ignore *-fake.rb generated even when CROSS_COMPILING = no
+ since r42862.
+
+Sun Jan 5 20:14:14 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * compar.c (cmp_equal): remove error hiding in Comparable#==.
+ Comparable#== no longer rescues exceptions silently.
+ This was the cause of quite a couple bugs. See #7688. [EXPERIMENTAL]
+
+ * test/ruby/test_comparable.rb: adapt assertion to match new behavior.
+
+ * lib/rdoc/method_attr.rb: fix bugs discovered by this change.
+
+ * test/rdoc/test_rdoc_normal_class.rb: fix bugs in tests.
+
+Sat Jan 4 22:44:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * struct.c (rb_struct_set): return assigned value from setter method
+ rather than struct object. [Bug #9353] [ruby-core:59509]
+
+ * test/ruby/test_struct.rb (test_setter_method_returns_value): add test
+
+Sat Jan 4 21:44:31 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/test_gc.rb (TestGc#test_latest_gc_info): use
+ GC.stat(:key) instead of GC.stat.
+
+Sat Jan 4 19:15:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/socket.c (rsock_syserr_fail_host_port): use format flags,
+ '+' to inspect, ' ' to quote unprintables.
+
+ * ext/socket/socket.c (rsock_syserr_fail_path): ditto.
+
+ * ext/socket/socket.c (rsock_syserr_fail_raddrinfo): ditto.
+
+ * ext/socket/socket.c (rsock_syserr_fail_host_port): add errno
+ argument version and use rb_syserr_fail_str() instead of
+ rb_sys_fail_str() with restoring errno.
+
+ * ext/socket/socket.c (rsock_syserr_fail_path): ditto, and
+ rb_syserr_fail().
+
+ * ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto, use
+ rsock_syserr_fail_raddrinfo().
+
+ * ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto.
+
+ * ext/socket/socket.c (setup_domain_and_type): ditto.
+
+Sat Jan 4 17:18:58 2014 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (RubyVM::OPTS): get rid of a garbage character.
+
+Sat Jan 4 10:17:54 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rinda/ring.rb (Rinda::RingFinger#make_socket): Use
+ ipv4_multicast_ttl option for portability.
+
+Sat Jan 4 10:15:47 2014 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rinda/ring.rb (Rinda::RingFinger#make_socket): Use
+ ipv4_multicast_loop option for portability. Patch by Jeremy Evans.
+ [ruby-trunk - Bug #9351]
+
+Fri Jan 3 19:09:00 2014 Eric Wong <normalperson@yhbt.net>
+
+ * ext/socket/socket.c (rsock_sys_fail_host_port): save and restore errno
+ before calling rb_sys_fail_str to prevent [BUG] errno == 0.
+ Patch by Eric Wong. [ruby-core:59498] [Bug #9352]
+
+ * ext/socket/socket.c (rsock_sys_fail_path): ditto
+ * ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto
+ * ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto
+ * ext/socket/socket.c (rsock_sys_fail_raddrinfo_or_sockaddr): ditto
+
+Fri Jan 3 10:43:57 2014 Aman Gupta <ruby@tmm1.net>
+
+ * test/net/imap/cacert.pem: generate new CA cert, since the last one
+ expired. [Bug #9341] [ruby-core:59459]
+ * test/net/imap/server.crt: new server cert signed with updated CA.
+ * test/net/imap/Makefile: add `make regen_certs` to automate this
+ process.
+
+Fri Jan 3 00:09:54 2014 Benoit Daloze <eregontp@gmail.com>
+
+ * ext/bigdecimal: update class method call style from :: to .
+ in documentation and usage.
+
+ * ext/bigdecimal/lib/bigdecimal/math.rb: [DOC] fix examples values.
+ Computations were made using ruby 2.0.0p247 to ensure
+ no effect of the recent BigDecimal bug.
+
+ * ext/bigdecimal/sample/nlsolve.rb: fix indent.
+
+Thu Jan 2 16:07:21 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * io.c (io_fwrite): freeze converted str.
+
+Thu Jan 2 04:15:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_longjmp): remove an extra modifier from the forward
+ declaration to match the actual definition. [ruby-core:59451]
+ [Bug #9338]
+
+Thu Jan 2 01:23:30 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * vm_eval.c (method_missing): use ALLOCV_N() instead of
+ ALLOCA_N() and rb_ary_tmp_new().
+
+Thu Jan 2 00:53:16 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (rb_ary_zip): use ALLOCV_N() instead of ALLOCA_N().
+
+Thu Jan 2 00:04:29 2014 Masaki Matsushita <glass.saga@gmail.com>
+
+ * hash.c (rb_hash_keys): make rb_hash_keys() static.
+ it is no longer used from array.c since r43969.
+ the patch is from normalperson (Eric Wong).
+ [ruby-core:59449] [Feature #9336]
+
+ * internal.h: remove definition of rb_hash_keys().
+
+Wed Jan 1 18:19:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: reset LDFLAGS and DLDFLAGS for opt-dir again after
+ LIBPATHFLAG and RPATHFLAG are set. [ruby-dev:47868] [Bug #9317]
+
+Wed Jan 1 11:12:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: use SSE2 instructions for drop unexpected
+ precisions. [ruby-core:54738] [Bug #8358]
+
+Tue Dec 31 23:49:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_f_raise): add cause: optional keyword argument.
+ [ruby-core:58610] [Feature #8257] [EXPERIMENTAL]
+
+Tue Dec 31 21:44:17 2013 Akio Tajima <artonx@yahoo.co.jp>
+
+ * win32/Makefile.sub: remove HAVE_FSEEKO because fseeko removed from win32/win32.c
+ Fixed [Bug #9333].
+
+Tue Dec 31 21:02:27 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * io.c (io_fwrite): allocate frozen str only when str is not converted.
+
+Tue Dec 31 15:44:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (RbConfig): expand RUBY_SO_NAME for extensions
+ backward compatibility. [ruby-core:59426] [Bug #9329]
+
+Mon Dec 30 23:33:07 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * variable.c: [DOC] adding extra example in docs.
+ patched by Steve Klabnik. [Bug #9210]
+
+Mon Dec 30 18:34:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (must_encindex, rb_enc_from_index, rb_obj_encoding): mask
+ encoding index and ignore dummy flags. [ruby-core:59354] [Bug #9314]
+
+Mon Dec 30 16:11:52 2013 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * tool/make-snapshot: needs CXXFLAGS. [ruby-core:59393][Bug #9320]
+
+Sun Dec 29 18:36:54 2013 Shota Fukumori <her@sorah.jp>
+
+ * lib/mkmf.rb (configuration): Make CXXFLAGS customizable.
+ Patch by Kohei Suzuki (eagletmt). [Fixes GH-492]
+
+Sun Dec 29 12:11:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (mnew_from_me): keep iclass as-is, to make inheritance
+ chain consistent. [ruby-core:59358] [Bug #9315]
+
+ * proc.c (method_owner): return the original defined_class from
+ prepended iclass, instead.
+
+Sun Dec 29 08:47:24 2013 Lucas Allan Amorim <lucas.allan@gmail.com>
+
+ * test/ruby/test_sprintf.rb (test_hash): Added tests for sprintf
+ with a hash as parameter. [Fixes GH-491]
+
+Sun Dec 29 07:27:51 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * compar.c (cmp_eq_recursive): Fix the return value, the value for
+ failed #<=> should be nil. It was raising a NoMethodError for
+ the test case TestComparable#test_no_cmp (undefined method `>'
+ for false:FalseClass). Yet one more reason for #7688.
+
+Sat Dec 28 22:21:59 2013 Benoit Daloze <eregontp@gmail.com>
+
+ * object.c (Kernel#<=>) surround Comparable operators with <code> tags.
+ The #== method was hidden in ri/rdoc's output and was highlighting
+ the line instead.
+
+Sat Dec 28 17:24:00 2013 DV Suresh <e@dvsuresh.me>
+
+ * benchmark/bm_so_meteor_contest.rb: [DOC] Fix a few typos
+ * ext/fiddle/lib/fiddle/import.rb: ditto
+ * ext/psych/lib/psych.rb: ditto
+ * ext/psych/lib/psych/nodes/sequence.rb: ditto
+ * ext/tk/lib/multi-tk.rb: ditto
+ * ext/tk/lib/tcltk.rb: ditto
+
+Sat Dec 28 00:42:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
+ isolate command argument state from outer scope.
+ [ruby-core:59342] [Bug #9308]
+
+Fri Dec 27 13:25:03 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/{setup.mak,Makefile.sub}: update fake.rb like
+ template/fake.rb.in.
+
+Thu Dec 26 16:10:41 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (fake.rb): should depend on version.h because
+ if RUBY_VERSION is updated, fake.rb need to say the new version
+ to avoid install error in rbconfig.rb.
+
+Thu Dec 26 14:25:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (HASH_REJECT_COPY_EXTRA_STATES): turn off the old
+ behavior, copying extra states by accident.
+
+Thu Dec 26 10:49:14 2013 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * version.h (RUBY_VERSION): 2.2.0 development has started.
+
+Thu Dec 26 10:27:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/merger.rb (tag): support 2.1.1 semi-automatic tagging and 2.2.0
+ explicit tagging.
+
+Thu Dec 26 06:35:25 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * proc.c: Having any mandatory keyword argument increases min arity
+ [#9299]
+
+Thu Dec 26 06:27:08 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * proc.c: Having optional keyword arguments makes maximum arity +1,
+ not unlimited [#8072]
+
+Thu Dec 26 01:09:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/release.sh: make symbolic links.
+
+Thu Dec 26 00:45:33 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/make-snapshot: support new version scheme.
+
+Wed Dec 25 22:44:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_set_arguments): set arg_keyword_check from
+ nd_cflag, which is set by parser. internal ID is used for
+ unnamed keyword rest argument, which should be separated from no
+ keyword check.
+
+ * iseq.c (rb_iseq_parameters): if no keyword check, keyword rest is
+ present.
+
+ * parse.y (new_args_tail_gen): set keywords check to nd_cflag, which
+ equals to that keyword rest is not present.
+
+Wed Dec 25 22:32:19 2013 Zachary Scott <e@zzak.io>
+
+ * lib/abbrev.rb: [DOC] rdoc format patch by Giorgos Tsiftsis [Bug #9146]
+
+Wed Dec 25 20:30:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * iseq.c (rb_iseq_parameters): push argument type symbol only for
+ unnamed rest keywords argument.
+
+Wed Dec 25 20:28:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_iseq_min_max_arity): maximum argument is unlimited if
+ having rest keywords argument. [ruby-core:53298] [Bug #8072]
+
+Wed Dec 25 18:29:22 2013 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (argument_error): insert dummy frame to make
+ a backtrace object intead of modify backtrace string array.
+ [Bug #9295]
+
+ * test/ruby/test_backtrace.rb: add a test for this patch.
+ fix test to compare a result of Exception#backtrace with
+ a result of Exception#backtrace_locations.
+
+Wed Dec 25 13:00:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: let mingw do something black-magic, and check if
+ _gmtime64_s() is available actually.
+
+ * win32/win32.c (gmtime_s, localtime_s): use _gmtime64_s() and
+ _localtime64_s() if available, not depending on very confusing
+ mingw variants macros. based on the patch by phasis68 (Heesob
+ Park) at [ruby-core:58764]. [ruby-core:58391] [Bug #9119]
+
+Wed Dec 25 12:33:41 2013 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * sample/trick2013/: added the award-winning entries of TRICK 2013.
+ See https://github.com/tric/trick2013 for the contest outline.
+ (Matz has approved the attachment.)
+
+Wed Dec 25 10:42:02 2013 Yamashita Yuu <yamashita@geishatokyo.com>
+
+ * ext/openssl/ossl_ssl.c (Init_ossl_ssl): Declare a constant
+ `OP_MSIE_SSLV2_RSA_PADDING` only if the macro is defined. The
+ `SSL_OP_MSIE_SSLV2_RSA_PADDING` has been removed from latest
+ snapshot of OpenSSL 1.0.1. [Fixes GH-488]
+
+Wed Dec 25 01:03:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (bind_local_variables): allowing binding to list its
+ local variables. patch by Jack Danger Canty <jackdanger AT
+ squareup.com> at [ruby-core:56543]. [Feature #8773]
+
+Tue Dec 24 23:20:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/fileutils/fileasserts.rb (assert_ownership_user): new
+ assertion for user ownership.
+
+ * test/fileutils/test_fileutils.rb (test_chown_error),
+ (test_chown_without_permission, test_chown_with_root):
+ based on the patch by vajrasky (Vajrasky Kok) at
+ [ruby-core:59298]. [Feature #9292]
+
+Tue Dec 24 16:28:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_mod_define_method): consider visibility only if self
+ in the caller is same as the receiver, otherwise make public as
+ well as old behavior. [ruby-core:57747] [Bug #9005]
+ [ruby-core:58497] [Bug #9141]
+
+ * vm.c (rb_vm_cref_in_context): return ruby level cref if self is
+ same.
+
+Tue Dec 24 14:13:14 2013 Koichi Sasada <ko1@atdot.net>
+
+ * README.EXT: add a refer to URL.
+
+Tue Dec 24 13:48:45 2013 Koichi Sasada <ko1@atdot.net>
+
+ * README.EXT: add a document about RGenGC.
+ Reviewed by havenwood.
+ [misc #8962]
+
+ * README.EXT.ja: ditto.
+
+Tue Dec 24 12:11:43 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h (RARRAY_ASET): try to avoid compiler warning.
+ [Bug #9287]
+
+Tue Dec 24 05:04:56 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/fileutils/test_fileutils.rb (setup): should not call
+ Process.groups for Windows. get rid of many errors introduced by
+ r44364.
+
+Mon Dec 23 18:37:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/fileutils/fileasserts.rb (assert_ownership_group): new
+ assertion for group ownership.
+
+ * test/fileutils/test_fileutils.rb (test_chown{,_verbose,_noop}):
+ based on the patch by vajrasky (Vajrasky Kok) at
+ [ruby-core:59281]. [Feature #9286]
+
+Mon Dec 23 15:53:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (HAS_EXTRA_STATES): warn extra states only when something
+ differ. [ruby-core:59254] [Bug #9275]
+
+Mon Dec 23 12:42:13 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * array.c: Have to_h raise on elements that are not key-value pairs
+ [#9239]
+
+ * enum.c: ditto
+
+Mon Dec 23 05:01:55 2013 Zachary Scott <e@zzak.io>
+
+ * doc/syntax/methods.rdoc: [DOC] Added example for underscore
+ conventions in method names. Also added doc to clarify encoding
+ character set support for Ruby programs and elaborated on defining
+ predicate and bang methods. Based on a patch by @gaurish
+ [Fixes GH-477] https://github.com/ruby/ruby/pull/477
+
+Mon Dec 23 03:18:09 2013 Zachary Scott <e@zzak.io>
+
+ * doc/ChangeLog-1.9.3: [DOC] Fix typos by @dvsuresh
+ [Fixes GH-485] https://github.com/ruby/ruby/pull/485
+ * ext/openssl/ossl_config.c: ditto
+ * lib/rss/utils.rb, lib/time.rb: ditto
+ * test/ruby/envutil.rb: ditto
+
+Sun Dec 22 23:56:56 2013 Zachary Scott <e@zzak.io>
+
+ * lib/{rake,rdoc,rss}/*, test/rexml/test_listener.rb: [DOC] Fix typos
+ by @dvsuresh [Fixes GH-486] https://github.com/ruby/ruby/pull/486
+
+Sun Dec 22 11:08:47 2013 Eric Hodel <drbrain@segment7.net>
+
+ * test/rubygems/test_gem_ext_builder.rb: Fix warning due to ambiguous
+ expression.
+
+Sun Dec 22 11:05:53 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/install_command.rb: Restore gem install
+ --ignore-dependencies for remote gems
+ * test/rubygems/test_gem_commands_install_command.rb: Test for the
+ above.
+
+Sun Dec 22 10:23:40 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc.rb: Set RDoc to release version.
+
+Sun Dec 22 10:19:07 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Set RubyGems to release version.
+
+Sun Dec 22 10:16:08 2013 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb (module Gem): Fix comment for
+ Gem::load_path_insert_index.
+
+Sun Dec 22 04:07:55 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (ruby_gc_set_params): don't show obsolete warnings for
+ RUBY_FREE_MIN/RUBY_HEAP_MIN_SLOTS if
+ RUBY_GC_HEAP_FREE_SLOTS/RUBY_GC_HEAP_INIT_SLOTS are given.
+ [Bug #9276]
+
+Sat Dec 21 13:00:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c: remove unnecessary the source path from EEXIST error
+ messages and show the destination path only. [ruby-core:59202]
+ [Feature #9263]
+
+Sat Dec 21 12:37:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not
+ consider encodings in hosts file. [ruby-core:59239] [Bug #9273]
+
+ * lib/resolv.rb (Resolv::Config.parse_resolv_conf): ditto.
+
+Sat Dec 21 05:43:27 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/make-snapshot: replace RUBY_PATCHLEVEL_STR in version.h to
+ show users that this ruby is a preview/rc version.
+
+Sat Dec 21 05:03:49 2013 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (fake.rb): fixed wrong RUBY_PLATFORM, to correctly
+ install win32.h.
+ [ruby-core:58801][Bug #9199] reported by arton.
+
+For the changes before 2.1.0, see doc/ChangeLog-2.1.0
+For the changes before 2.0.0, see doc/ChangeLog-2.0.0
+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
+
+Local variables:
+coding: us-ascii
+add-log-time-format: (lambda ()
+ (let* ((time (current-time))
+ (system-time-locale "C")
+ (diff (+ (cadr time) 32400))
+ (lo (% diff 65536))
+ (hi (+ (car time) (/ diff 65536))))
+ (format-time-string "%a %b %e %H:%M:%S %Y" (list hi lo) t)))
+indent-tabs-mode: t
+tab-width: 8
+change-log-indent-text: 2
+end:
+vim: tabstop=8 shiftwidth=2
diff --git a/doc/ChangeLog-YARV b/doc/ChangeLog-YARV
index 529854586c..6a6cfbd0c9 100644
--- a/doc/ChangeLog-YARV
+++ b/doc/ChangeLog-YARV
@@ -2428,7 +2428,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
2006-02-14(Tue) 05:53:56 +0900 Minero Aoki <aamine@loveruby.net>
* eval.c (ruby_cleanup): th->errinfo contains a NODE while
- break'ing, check it before refering klass.
+ break'ing, check it before referring klass.
2006-02-14(Tue) 05:45:07 +0900 Koichi Sasada <ko1@atdot.net>
@@ -2461,7 +2461,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
2006-02-14(Tue) 01:42:11 +0900 Koichi Sasada <ko1@atdot.net>
- * error.c : fix include file positon
+ * error.c : fix include file position
* test/ruby/test_signal.rb : skip test_exit_action on cygwin
@@ -6168,7 +6168,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
* test.rb : restore $" after evaluation with ruby
- * rb/insns2vm.rb : remove unnecesary each
+ * rb/insns2vm.rb : remove unnecessary each
2004-12-17(Fri) 18:56:38 +0900 Koichi Sasada <ko1@atdot.net>
@@ -6397,7 +6397,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
* vm.c : fix stack dump routine
- * vm.c : impliment thread_funcall (temporarily)
+ * vm.c : implement thread_funcall (temporarily)
* yarv.h : add IS_YARV_WORKING(), SET_YARV_START(), SET_YARV_STOP()
@@ -6590,7 +6590,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
* yarvcore.h, yarvcore.c : add idThrow*
* insns.def, compile.c, vm.c : support retry, break,
- next, redo, return(imcomplete)
+ next, redo, return(incomplete)
2004-09-03(Fri) 13:40:08 +0900 Koichi Sasada <ko1@atdot.net>
diff --git a/doc/NEWS-1.8.7 b/doc/NEWS-1.8.7
index 51fb5f1c6a..38571fe103 100644
--- a/doc/NEWS-1.8.7
+++ b/doc/NEWS-1.8.7
@@ -230,7 +230,7 @@ with all sufficient information, see the ChangeLog file.
* ARGF.lines
* ARGF.readbyte
- New methods.
+ New methods.
* Method#name
* Method#owner
@@ -638,7 +638,7 @@ with all sufficient information, see the ChangeLog file.
md = Digest::MD5.new("string")
# After (works with any version)
md = Digest::MD5.new.update("string")
-
+
# Before
hd = Digest::MD5.new("string").hexdigest
# After (works with any version)
diff --git a/doc/NEWS-2.0.0 b/doc/NEWS-2.0.0
index f99ba3e882..9ad7254317 100644
--- a/doc/NEWS-2.0.0
+++ b/doc/NEWS-2.0.0
@@ -168,7 +168,7 @@ with all sufficient information, see the ChangeLog file.
* RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
default: 64KB or 128KB.
* RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
- creation. default: 256KB or 256KB.
+ creation. default: 256KB or 512KB.
These variables are checked only at launched time.
* added constant DEFAULT_PARAMS to get above default parameters.
diff --git a/doc/NEWS-2.1.0 b/doc/NEWS-2.1.0
new file mode 100644
index 0000000000..5d4152b8dc
--- /dev/null
+++ b/doc/NEWS-2.1.0
@@ -0,0 +1,376 @@
+# -*- rdoc -*-
+
+= NEWS for Ruby 2.1.0
+
+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 2.0.0 release
+
+=== Language changes
+
+* Now the default values of keyword arguments can be omitted. Those
+ "required keyword arguments" need giving explicitly at the call time.
+
+* Added suffixes for integer and float literals: 'r', 'i', and 'ri'.
+ * "42r" and "3.14r" are evaluated as Rational(42, 1) and 3.14.rationalize,
+ respectively. But exponential form with 'r' suffix like "6.022e+23r" is
+ not accepted because it is misleading.
+ * "42i" and "3.14i" are evaluated as Complex(0, 42) and Complex(0, 3.14),
+ respectively.
+ * "42ri" and "3.14ri" are evaluated as Complex(0, 42r) and Complex(0, 3.14r),
+ respectively.
+
+* def-expr now returns the symbol of its name instead of nil.
+
+=== Core classes updates (outstanding ones only)
+
+* Array
+ * New methods
+ * Array#to_h converts an array of key-value pairs into a Hash.
+
+* Binding
+ * New methods
+ * Binding#local_variable_get(symbol)
+ * Binding#local_variable_set(symbol, obj)
+ * Binding#local_variable_defined?(symbol)
+
+* Enumerable
+ * New methods
+ * Enumerable#to_h converts a list of key-value pairs into a Hash.
+
+* Exception
+ * New methods
+ * Exception#cause provides the previous exception which has been caught
+ at where raising the new exception.
+
+* GC
+ * improvements:
+ * introduced the generational GC a.k.a RGenGC.
+ * added environment variables:
+ * RUBY_GC_HEAP_INIT_SLOTS
+ * RUBY_GC_HEAP_FREE_SLOTS
+ * RUBY_GC_HEAP_GROWTH_FACTOR
+ * RUBY_GC_HEAP_GROWTH_MAX_SLOTS
+ * RUBY_GC_MALLOC_LIMIT_MAX
+ * RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR
+ * RUBY_GC_OLDMALLOC_LIMIT
+ * RUBY_GC_OLDMALLOC_LIMIT_MAX
+ * RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR
+ * obsoleted environment variables:
+ * RUBY_FREE_MIN (Use RUBY_GC_HEAP_FREE_SLOTS instead)
+ * RUBY_HEAP_MIN_SLOTS (Use RUBY_GC_HEAP_INIT_SLOTS instead)
+
+* Integer
+ * New methods
+ * Fixnum#bit_length
+ * Bignum#bit_length
+ * Bignum performance improvement
+ * Use GMP if available.
+ GMP is used only for several operations:
+ multiplication, division, radix conversion, GCD
+
+* IO
+ * extended methods:
+ * IO#seek supports SEEK_DATA and SEEK_HOLE as whence.
+ * IO#seek accepts symbols (:CUR, :END, :SET, :DATA, :HOLE) for 2nd argument.
+ * IO#read_nonblock accepts optional `exception: false` to return symbols
+ * IO#write_nonblock accepts optional `exception: false` to return symbols
+
+* Kernel
+ * New methods:
+ * Kernel#singleton_method
+
+* Module
+ * New methods:
+ * Module#using, which activates refinements of the specified module only
+ in the current class or module definition.
+ * Module#singleton_class? returns true if the receiver is a singleton class
+ or false if it is an ordinary class or module.
+ * extended methods:
+ * Module#refine is no longer experimental.
+ * Module#include and Module#prepend are now public methods.
+
+* Mutex
+ * misc
+ * Mutex#owned? is no longer experimental.
+
+* Numeric
+ * extended methods:
+ * Numeric#step allows the limit argument to be omitted, in which
+ case an infinite sequence of numbers is generated. Keyword
+ arguments `to` and `by` are introduced for ease of use.
+ `by` can be 0, in which case the same value will be generated
+ indefinitely.
+
+* Process
+ * New methods:
+ * alternative methods to $0/$0=:
+ * Process.argv0() returns the original value of $0.
+ * Process.setproctitle() sets the process title without affecting $0.
+ * Process.clock_gettime
+ * Process.clock_getres
+
+* String
+ * "literal".freeze is now optimized to return the same object
+ * New methods:
+ * String#scrub and String#scrub! verify and fix invalid byte sequence.
+ If you want to use this function with older Ruby,
+ consider to use string-scrub.gem.
+
+* Symbol
+ * All symbols are now frozen.
+
+* pack/unpack (Array/String)
+ * Q! and q! directives for long long type if platform has the type.
+
+* toplevel
+ * extended methods:
+ * main.using is no longer experimental. The method activates refinements
+ in the ancestors of the argument module to support refinement
+ inheritance by Module#include.
+
+=== Core classes compatibility issues (excluding feature bug fixes)
+
+* Hash
+ * incompatible changes:
+ * Hash#reject will return plain Hash object in the future versions, that
+ is the original object's subclass, instance variables, default value,
+ and taintedness will be no longer copied, so now warnings are emitted
+ when called with such Hash.
+
+* IO
+ * incompatible changes:
+ * open ignore internal encoding if external encoding is ASCII-8BIT.
+
+* Kernel#eval, Kernel#instance_eval, and Module#module_eval.
+ * Copies the scope information of the original environment, which means
+ that private, protected, public, and module_function without arguments
+ do not affect the environment outside the eval string.
+ For example, `class Foo; eval "private"; def foo; end; end' doesn't make
+ Foo#foo private.
+
+* Kernel#untrusted?, untrust, and trust
+ * These methods are deprecated and their behavior is same as tainted?,
+ taint, and untaint, respectively. If $VERBOSE is true, they show warnings.
+
+* Module#ancestors
+ * The ancestors of a singleton class now include singleton classes,
+ in particular itself.
+
+* Module#define_method and Object#define_singleton_method
+ * Now they return the symbols of the defined methods, not the methods/procs
+ themselves.
+
+* Numeric#quo
+ * Raises TypeError instead of ArgumentError if the receiver doesn't have
+ to_r method.
+
+* Proc
+ * Returning from lambda proc now always exits from the Proc, not from the
+ method where the lambda is created. Returning from non-lambda proc exits
+ from the method, same as the former behavior.
+
+String
+ * If invalid: :replace is specified for String#encode, replace
+ invalid byte sequence even if the destination encoding equals to
+ the source encoding.
+
+=== Stdlib updates (outstanding ones only)
+
+* CGI::Util
+ * All class methods modulized.
+
+* Digest
+ * extended methods:
+ * Digest::Class.file takes optional arguments for its constructor
+
+* Matrix
+ * Added Vector#cross_product.
+
+* Net::SMTP
+ * Added Net::SMTP#rset to implement the RSET command
+
+* objspace
+ * new method:
+ * ObjectSpace.trace_object_allocations
+ * ObjectSpace.trace_object_allocations_start
+ * ObjectSpace.trace_object_allocations_stop
+ * ObjectSpace.trace_object_allocations_clear
+ * ObjectSpace.allocation_sourcefile
+ * ObjectSpace.allocation_sourceline
+ * ObjectSpace.allocation_class_path
+ * ObjectSpace.allocation_method_id
+ * ObjectSpace.allocation_generation
+ * ObjectSpace.reachable_objects_from_root
+ * ObjectSpace.dump
+ * ObjectSpace.dump_all
+
+* OpenSSL::BN
+ * extended methods:
+ * OpenSSL::BN.new allows Fixnum/Bignum argument.
+
+* open-uri
+ * Support multiple fields with same field name (like Set-Cookie).
+
+* Pathname
+ * New methods:
+ * Pathname#write
+ * Pathname#binwrite
+
+* rake
+ * Updated to 10.1.0. Major changes include removal of the class namespace,
+ Rake::DSL to hold the rake DSL methods and removal of support for legacy
+ rake features.
+
+ For a complete list of changes since rake 0.9.6 see:
+
+ http://rake.rubyforge.org/doc/release_notes/rake-10_1_0_rdoc.html
+
+ http://rake.rubyforge.org/doc/release_notes/rake-10_0_3_rdoc.html
+
+* RbConfig
+ * New constants:
+ * RbConfig::SIZEOF is added to provide the size of C types.
+
+* RDoc
+ * Updated to 4.1.0. Major enhancements include a modified default template
+ * and accessibility enhancements.
+
+ For a list of minor enhancements and bug fixes see:
+ https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc
+
+* Resolv
+ * New methods:
+ * Resolv::DNS.fetch_resource
+ * One-shot multicast DNS support
+ * Support LOC resources
+
+* REXML::Parsers::SAX2Parser
+ * Fixes wrong number of arguments of entitydecl event. Document of the event
+ says "an array of the entity declaration" but implementation passes two
+ or more arguments. It is an implementation bug but it breaks backward
+ compatibility.
+
+* REXML::Parsers::StreamParser
+ * Supports "entity" event.
+
+* REXML::Text
+ * REXML::Text#<< supports method chain like 'text << "XXX" << "YYY"'.
+ * REXML::Text#<< supports not "raw" mode.
+
+* Rinda::RingServer, Rinda::RingFinger
+ * Rinda now supports multicast sockets. See Rinda::RingServer and
+ Rinda::RingFinger for details.
+
+* RubyGems
+ * Updated to 2.2.0. Notable new features include:
+
+ * Gemfile or gem.deps.rb support including Gem.file.lock (experimental)
+ * Improved, iterative resolver (compared to RubyGems 2.1 and earlier)
+ * Support for a sharing a GEM_HOME across ruby platforms and versions
+
+ For a complete list of enhancements and bug fixes see:
+ https://github.com/rubygems/rubygems/tree/master/History.txt
+
+* Set
+ * New methods:
+ * Set#intersect?
+ * Set#disjoint?
+
+* Socket
+ * New methods:
+ * Socket.getifaddrs
+
+* StringScanner
+ * extended methods:
+ * StringScanner#[] supports named captures.
+
+* Syslog::Logger
+ * Added facility.
+
+* Tempfile
+ * New methods:
+ * Tempfile.create
+
+* Timeout
+ * The exception to terminate the given block can no longer be rescued
+ inside the block, by default, unless the exception class is given
+ explicitly.
+
+* TSort
+ * New methods:
+ * TSort.tsort
+ * TSort.tsort_each
+ * TSort.strongly_connected_components
+ * TSort.each_strongly_connected_component
+ * TSort.each_strongly_connected_component_from
+
+* WEBrick
+ * The body of a response may now be a StringIO or other IO-like that responds
+ to #readpartial and #read.
+
+* XMLRPC::Client
+ * New methods:
+ * XMLRPC::Client#http. It returns Net::HTTP for the client. Normally,
+ it is not needed. It is useful when you want to change minor HTTP client
+ options. You can change major HTTP client options by XMLRPC::Client
+ methods. You should use XMLRPC::Client methods for changing major
+ HTTP client options instead of XMLRPC::Client#http.
+
+=== Stdlib compatibility issues (excluding feature bug fixes)
+
+* Set
+ * incompatible changes:
+ * Set#to_set now returns self instead of generating a copy.
+
+* URI
+ * incompatible changes:
+ * URI.decode_www_form follows current WHATWG URL Standard.
+ It gets encoding argument to specify the character encoding.
+ It now allows loose percent encoded strings, but denies ;-separator.
+ * URI.encode_www_form follows current WHATWG URL Standard.
+ It gets encoding argument to convert before percent encode.
+ UTF-16 strings aren't converted to UTF-8 before percent encode by default.
+
+* curses
+ * Removed.
+ curses is now available as a gem.
+ See https://rubygems.org/gems/curses for details.
+
+=== Built-in global variables compatibility issues
+
+* $SAFE
+ * $SAFE=4 is obsolete. If $SAFE is set to 4 or larger, an ArgumentError
+ is raised.
+
+=== C API updates
+
+* rb_gc_set_params() is deprecated. This is only used in Ruby internal.
+
+* rb_gc_count() added. This returns the number of times GC occurred.
+
+* rb_gc_stat() added. This allows access to specific GC.stat() values from C
+ without any allocation overhead.
+
+* rb_gc_latest_gc_info() added. This allows access to GC.latest_gc_info().
+
+* rb_postponed_job_register() added. Takes a function callback which is invoked
+ when the VM is in a consistent state, i.e. to perform work from a C signal
+ handler.
+
+* rb_profile_frames() added. Provides low-cost access to the current ruby stack
+ for callstack profiling.
+
+* rb_tracepoint_new() supports new internal events accessible only from C:
+ * RUBY_INTERNAL_EVENT_NEWOBJ
+ * RUBY_INTERNAL_EVENT_FREEOBJ
+ * RUBY_INTERNAL_EVENT_GC_START
+ * RUBY_INTERNAL_EVENT_GC_END_MARK
+ * RUBY_INTERNAL_EVENT_GC_END_SWEEP
+ * Note that you *can not* specify "internal events" with normal events
+ (such as RUBY_EVENT_CALL, RUBY_EVENT_RETURN) simultaneously.
diff --git a/doc/NEWS-2.2.0 b/doc/NEWS-2.2.0
new file mode 100644
index 0000000000..70ccddf32d
--- /dev/null
+++ b/doc/NEWS-2.2.0
@@ -0,0 +1,361 @@
+# -*- rdoc -*-
+
+= NEWS for Ruby 2.2.0
+
+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 2.1.0 release
+
+=== Language changes
+
+* nil/true/false
+ * nil/true/false objects are frozen. [Feature #8923]
+
+* Hash literal
+ * Symbol key followed by a colon can be quoted. [Feature #4276]
+
+* default argument
+ fixed a very longstanding bug that an optional argument was not
+ accessible in its default value expression. [Bug #9593]
+
+=== Core classes updates (outstanding ones only)
+
+* Binding
+ * New methods:
+ * Binding#local_variables
+ * Binding#receiver
+
+* Dir
+ * New methods:
+ * Dir#fileno
+
+* Enumerable
+ * New methods:
+ * Enumerable#slice_after
+ * Enumerable#slice_when
+ * Extended methods:
+ * min, min_by, max and max_by supports optional argument to return
+ multiple elements.
+
+* Float
+ * New methods:
+ * Float#next_float
+ * Float#prev_float
+
+* File
+ * New methods:
+ * File.birthtime
+ * File#birthtime
+
+* File::Stat
+ * New methods:
+ * File::Stat#birthtime
+
+* GC
+ * GC.latest_gc_info returns :state to represent current GC status.
+ * Improvements
+ * Introduce incremental marking for major GC. [Feature #10137]
+
+* IO
+ * Improvements
+ * IO#nonblock_read and IO#nonblock_write for pipes on Windows are supported.
+
+* Kernel
+ * New methods:
+ * Kernel#itself
+ * Improvements
+ * Kernel#throw raises UncaughtThrowError, subclass of ArgumentError when
+ there is no corresponding catch block, instead of ArgumentError.
+
+* Process
+ * Extended method:
+ * Process execution methods such as Process.spawn opens the file in write
+ mode for redirect from [:out, :err].
+
+* String
+ * New methods:
+ * String#unicode_normalize
+ * String#unicode_normalize!
+ * String#unicode_normalized?
+
+* Symbol
+ * Improvements
+ * Most symbols which are returned by String#to_sym and
+ String#intern are GC-able.
+
+* Method
+ * New methods:
+ * Method#curry([arity]) returns a curried Proc.
+ * Method#super_method returns a Method of superclass, which would be called
+ when super is used.
+
+=== Core classes compatibility issues (excluding feature bug fixes)
+
+* Enumerable
+ * Enumerable#slice_before's state management deprecated.
+ * Enumerable#chunk's state management deprecated.
+
+* GC
+ * incompatible changes:
+ * Rename GC.stat entries. [Feature #9924]
+ See https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
+
+* Hash
+ * incompatible changes:
+ * Change overriding policy for duplicated key. [Bug #10315]
+ { **hash1, **hash2 } contains values of hash2 for duplicated keys.
+
+* IO
+ * incompatible changes:
+ * When flushing file IO with IO#flush, you cannot assume that the metadata
+ of the file is updated immediately. On some platforms (especially
+ Windows), it is delayed until the filesystem load is decreased.
+ Use IO#fsync if you want to guarantee updating metadata.
+
+* Math
+ * incompatible changes:
+ * Math.log now raises Math::DomainError instead of returning NaN if the
+ base is less than 0, and returns NaN instead of -infinity if both of
+ two arguments are 0.
+ * Math.atan2 now returns values like as expected by C99 if both two
+ arguments are infinity.
+
+* Proc
+ * incompatible changes:
+ * ArgumentError is no longer raised when lambda Proc is passed as a
+ block, and the number of yielded arguments does not match the formal
+ arguments of the lambda, if just an array is yielded and its length
+ matches.
+
+* Process
+ * Process execution methods such as Process.spawn opens the file in write
+ mode for redirect from [:out, :err].
+ Before Ruby 2.2, it was opened in read mode.
+
+=== Stdlib updates (outstanding ones only)
+
+* Continuation
+ * callcc is obsolete. use Fiber instead.
+
+* Digest
+
+ * Digest() should now be thread-safe. If you have a problem with
+ regard to on-demand loading under a multi-threaded environment,
+ preload "digest/*" modules on boot or use this method instead of
+ directly referencing Digest::*.
+ * Digest::HMAC has been removed just as previously noticed.
+
+* DL
+ * DL has been removed from stdlib. Please use Fiddle instead!
+
+* Etc
+ * New methods:
+ * Etc.uname
+ * Etc.sysconf
+ * Etc.confstr
+ * IO#pathconf
+ * Etc.nprocessors
+
+* Find, Pathname
+ * Extended methods:
+ * find method accepts "ignore_error" keyword argument.
+
+* Matrix
+ * New methods:
+ * Matrix#first_minor(row, column) returns the submatrix obtained
+ by deleting the specified row and column.
+ * Matrix#cofactor(row, column) returns the (row, column) cofactor
+ which is obtained by multiplying the first minor by (-1)**(row + column).
+ * Matrix#adjugate returns the adjugate of the matrix.
+ * hstack and vstack are new instance and class methods to stack matrices
+ horizontally and vertically.
+ * Matrix#laplace_expansion(row_or_column: num) returns the laplace_expansion
+ along the +num+ -th row or column.
+ * Vector.basis(size:, index:) returns the specified basis vector.
+ * Unary - and + added for Vector and Matrix.
+ * Vector#cross_product generalized to arbitrary dimensions.
+ * Vector#dot and #cross are aliases for #inner_product and #cross_product.
+ * Vector#angle_with returns the angle with its argument
+ * New instance and class method independent? to test linear independence.
+
+* Pathname
+ * Pathname#/ is aliased to Pathname#+.
+ * New methods:
+ * Pathname#birthtime
+
+* Rake
+ * Updated to Rake 10.4.0. For full release notes see:
+
+ http://docs.seattlerb.org/rake/History_rdoc.html#label-10.4.0
+
+* RubyGems
+ * Updated to RubyGems 2.4.2. For full release notes see:
+
+ http://docs.seattlerb.org/rubygems/History_txt.html#label-2.4.2+%2F+2014-10-01
+
+* TSort
+ * TSort.tsort_each, TSort.each_strongly_connected_component and
+ TSort.each_strongly_connected_component_from returns an enumerator if
+ no block given.
+
+* XMLRPC
+ * Added new parser class named LibXMLStreamParser.
+
+=== Stdlib compatibility issues (excluding feature bug fixes)
+
+* lib/mathn.rb
+ * Show deprecated warning [Feature #10169]
+
+* ext/date/lib/date/format.rb
+ * Removed because it's empty file.
+
+* Digest
+ * Digest::HMAC has finally ceased to exist. Use OpenSSL::HMAC or an external gem instead.
+
+* time.rb
+ * Time.parse, Time.strptime, Time.rfc2822, Time.xmlschema may produce
+ fixed-offset Time objects.
+ It is happen when usual localtime doesn't preserve the offset from UTC.
+ * Time.httpdate produces always UTC Time object.
+ * Time.strptime raises ArgumentError when no date information.
+
+* lib/rational.rb
+ * Removed because it is deprecated from 2009.
+
+* lib/complex.rb
+ * Removed because it is deprecated from 2009.
+
+* lib/prettyprint.rb
+ * Removed PrettyPrint#first?
+
+* lib/minitest/*.rb
+ * Removed because it conflicts to minitest 5. [Feature #9711]
+
+* lib/test/**/*.rb
+ * Removed because it conflicts to minitest 5, and it was just an wrapper
+ of minitest 4. [Feature #9711]
+
+* lib/uri
+ * support RFC 3986. [Feature #2542]
+
+* GServer
+ * GServer is extracted to gserver gem. It's unmaintain code.
+
+* Logger
+ * Logger::Application is extracted to logger-application gem. It's unmaintain code.
+
+* ObjectSpace (after requiring "objspace")
+ * ObjectSpace.memsize_of(obj) returns a size includes sizeof(RVALUE).
+ [Bug #8984]
+
+* Prime
+ * incompatible changes:
+ * Prime.prime? now returns false for negative numbers. This method
+ should not be used to know the number is composite or not. [Bug #7395]
+
+* Psych
+ * Removed Psych::EngineManager [Bug #8344]
+
+=== Built-in global variables compatibility issues
+
+=== C API updates
+
+* Deprecated APIs removed. [Feature #9502]
+
+ Check_SafeStr -> SafeStringValue
+ rb_check_safe_str -> SafeStringValue
+ rb_quad_pack -> rb_integer_pack
+ rb_quad_unpack -> rb_integer_unpack
+ rb_read_check : access struct FILE internal. no replacement.
+ rb_struct_iv_get : internal function. no replacement.
+ struct rb_blocking_region_buffer : internal type. no replacement.
+ rb_thread_blocking_region_begin -> rb_thread_call_without_gvl family
+ rb_thread_blocking_region_end -> rb_thread_call_without_gvl family
+ TRAP_BEG -> rb_thread_call_without_gvl family
+ TRAP_END -> rb_thread_call_without_gvl family
+ rb_thread_select -> rb_thread_fd_select
+ struct rb_exec_arg : internal type. no replacement.
+ rb_exec : internal function. no replacement.
+ rb_exec_arg_addopt : internal function. no replacement.
+ rb_exec_arg_fixup : internal function. no replacement.
+ rb_exec_arg_init : internal function. no replacement.
+ rb_exec_err : internal function. no replacement.
+ rb_fork : internal function. no replacement.
+ rb_fork_err : internal function. no replacement.
+ rb_proc_exec_n : internal function. no replacement.
+ rb_run_exec_options : internal function. no replacement.
+ rb_run_exec_options_err : internal function. no replacement.
+ rb_thread_blocking_region -> rb_thread_call_without_gvl family
+ rb_thread_polling -> rb_thread_wait_for
+ rb_big2str0 : internal function. no replacement.
+ rb_big2ulong_pack -> rb_integer_pack
+ rb_gc_set_params : internal function. no replacement.
+ rb_io_mode_flags -> rb_io_modestr_fmode
+ rb_io_modenum_flags -> rb_io_oflags_fmode
+
+* struct RBignum is hidden. [Feature #6083]
+ Use rb_integer_pack and rb_integer_unpack instead.
+
+* struct RRational is hidden. [Feature #9513]
+ Use rb_rational_num and rb_rational_den instead.
+
+* rb_big_new and rb_big_resize takes a size_t instead of long.
+
+* rb_num2long returns a long instead of SIGNED_VALUE.
+
+* rb_num2ulong returns an unsigned long instead of VALUE.
+
+* st hash table uses power-of-two sizes for speed [Feature #9425].
+ Lookups are 10-25% faster if using appropriate hash functions.
+ However, weaknesses in hash distribution can no longer be masked
+ by prime number-sized tables, so extensions may need to tweak
+ hash functions to ensure good distribution.
+
+* rb_sym2str() added. This is almost same as `rb_id2str(SYM2ID(sym))`
+ but not pinning a dynamic symbol.
+
+* rb_str_cat_cstr() added. This is same as `rb_str_cat2()`.
+
+* `rb_str_substr()` and `rb_str_subseq()` will share middle of a string,
+ but not only the end of a string, in the future. Therefore, result
+ strings may not be NUL-terminated, `StringValueCStr()` is needed
+ calling to obtain a NUL-terminated C string.
+
+* rb_tracepoint_new() supports new internal events accessible only from C:
+ * RUBY_INTERNAL_EVENT_GC_ENTER
+ * RUBY_INTERNAL_EVENT_GC_EXIT
+ r47528
+
+* rb_hash_delete() now does not call the block given to the current method.
+
+* rb_extract_keywords() and rb_get_kwargs() exported. See README.EXT
+ for details.
+
+=== Build system updates
+
+* jemalloc is optionally supported via `./configure --with-jemalloc`
+ jemalloc may be suitable when system malloc is slow or prone
+ to fragmentation. [Feature #9113]
+
+=== Implementation changes
+
+* GC
+ * Most symbols which are returned by String#to_sym and
+ String#intern are GC-able [Feature #9634]
+ * Introduce incremental marking for major GC. [Feature #10137]
+ * Enable lazy sweep on GC caused by malloc().
+
+* VM
+ * Use frozen string literals for Hash#[] and Hash#[]=
+ * Fast keyword arguments passing [Feature #10440]
+ * Allow to receive huge splatted array by a rest argument
+ [Feature #10440]
+
+* Process
+ * Process creation methods, such as spawn(), uses vfork() system call.
+ vfork() is faster than fork() when the parent process uses huge memory.
diff --git a/doc/contributing.rdoc b/doc/contributing.rdoc
index 9d9fbdf2da..898f1174eb 100644
--- a/doc/contributing.rdoc
+++ b/doc/contributing.rdoc
@@ -51,7 +51,7 @@ on your ticket.
=== Reporting to downstream distributions
-You can reports downstream issues for the following distributions via their bugtracker:
+You can report downstream issues for the following distributions via their bug tracker:
* {debian}[http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=ruby-defaults]
* {freebsd}[http://www.freebsd.org/cgi/query-pr-summary.cgi?text=ruby]
@@ -61,7 +61,7 @@ You can reports downstream issues for the following distributions via their bugt
=== Platform Maintainers
-For platform specific bugs in Ruby, you can assign your ticket the current
+For platform specific bugs in Ruby, you can assign your ticket to the current
maintainer for a specific platform.
The current active platform maintainers are as follows:
@@ -113,12 +113,12 @@ You can also report issues with the ruby-lang.org website on the issue tracker:
As a next step beyond reporting issues you can help the core team resolve
existing issues. If you check the Everyone's Issues list in GitHub Issues,
-you'll find lots of issues already requiring attention. What can you do for
+you will find a lot of issues already requiring attention. What can you do for
these? Quite a bit, actually:
When a bug report goes for a while without any feedback, it goes to the bug
graveyard which is unfortunate. If you check the {issues
-list}[https://bugs.ruby-lang.org/projects/ruby-trunk/issues] you'll find lots
+list}[https://bugs.ruby-lang.org/projects/ruby-trunk/issues] you will find lots
of delinquent bugs that require attention.
You can help by verifying the existing tickets, try to reproduce the reported
@@ -154,7 +154,7 @@ patch.
== How To Request Features
-If there's a new feature that you want to see added to Ruby, you'll need to
+If there's a new feature that you want to see added to Ruby, you will need to
write a convincing proposal and patch to implement the feature.
For new features in CRuby, use the {'Feature'
@@ -174,7 +174,7 @@ requests can seem like an alluring way to contribute to Ruby, often these
discussions can lead nowhere and exhaust time and energy that could be better
spent fixing bugs. Choose your battles.
-A good template for feature proposal should look something like this:
+A good template for a feature proposal should look something like this:
[Abstract]
Summary of your feature
@@ -199,7 +199,8 @@ A good template for feature proposal should look something like this:
=== Slideshow
-On Ruby Developer Meeting Japan, committers discuss about Feature Proposals together at Tokyo. We'll judge proposals accept, reject, or feedback. If you have a stalled proposal, making a slide to submit is good way to get feedback.
+At the Ruby Developer Meeting in Japan, committers discuss Feature Proposals together in Tokyo. We will judge proposals and then accept, reject, or give feedback for them.
+If you have a stalled proposal, making a slide to submit is good way to get feedback.
Slides should be:
@@ -217,8 +218,8 @@ Please note:
== Backport Requests
-When a new version of Ruby is released it starts at patch level 0 (p0), and
-bugs will be fixed first on the trunk branch. If its determined that a bug
+When a new version of Ruby is released, it starts at patch level 0 (p0), and
+bugs will be fixed first on the trunk branch. If it's determined that a bug
exists in a previous version of Ruby that is still in the bug fix stage of
maintenance, then a patch will be backported. After the maintenance stage of a
particular Ruby version ends, it goes into "security fix only" mode which
@@ -246,11 +247,13 @@ version 1.8.7. The current branch maintainers are as follows:
[trunk]
unnecessary
-[ruby_2_0_0]
+[ruby_2_2]
Chikanaga Tomoyuki (nagachika)
-[ruby_1_9_3]
+[ruby_2_1]
+ NAKAMURA Usaku (usa)
+[ruby_2_0_0]
NAKAMURA Usaku (usa)
-[ruby_1_9_2, ruby_1_9_1]
+[ruby_1_9_3, ruby_1_9_2, ruby_1_9_1]
_unmaintained_
[ruby_1_8]
_unmaintained_
@@ -310,7 +313,7 @@ Now let's build CRuby:
autoconf
mkdir build && cd build # its good practice to build outside of source dir
mkdir ~/.rubies # we will install to .rubies/ruby-trunk in our home dir
- ../configure --prefix=~/.rubies/ruby-trunk
+ ../configure --prefix="${HOME}/.rubies/ruby-trunk"
make && make install
After adding Ruby to your PATH, you should be ready to run the test suite:
@@ -326,7 +329,7 @@ This is also how you can run a specific test from our build dir:
make test-all TESTS=drb/test_drb.rb
-For older versions of Ruby you'll need to run the build setup again after
+For older versions of Ruby you will need to run the build setup again after
checking out the associated branch in git, for example if you wanted to
checkout 1.9.3:
@@ -436,7 +439,8 @@ your working branch:
Now that you've got some code you want to contribute, let's get set up to
generate a patch. Start by forking the github mirror, check the {github docs on
forking}[https://help.github.com/articles/fork-a-repo] if you get stuck here.
-here. You will also need a github account if you don't yet have one.
+You will only need a github account if you intend to host your repository
+on github.
Next copy the writable url for your fork and add it as a git remote, replace
"my_username" with your github account name:
@@ -454,6 +458,11 @@ the patch for you, save the file to your computer and upload it to the bug
tracker. Alternatively you can submit a pull request, but for the best chances
to receive feedback add it is recommended you add it to redmine.
-
-
-
+Since git is a distributed system, you are welcome to host your git repository
+on any {publicly accessible hosting
+site}[https://git.wiki.kernel.org/index.php/GitHosting], including {hosting your
+own}[https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#public-repositories]
+You may use the {'git format-patch'}[http://git-scm.com/docs/git-format-patch]
+command to generate patch files to upload to redmine. You may also use
+the {'git request-pull'}[http://git-scm.com/docs/git-request-pull] command for
+formatting pull request messages to redmine.
diff --git a/doc/contributors.rdoc b/doc/contributors.rdoc
index 96fe887e4e..ced4eb1cd0 100644
--- a/doc/contributors.rdoc
+++ b/doc/contributors.rdoc
@@ -1,6 +1,6 @@
= Contributors to Ruby
-The following list might be imcomplete. Feel free to add your name if your
+The following list might be incomplete. Feel free to add your name if your
patch was accepted into Ruby.
== A
diff --git a/doc/dtrace_probes.rdoc b/doc/dtrace_probes.rdoc
index a1e0fff3b0..d2cdd56902 100644
--- a/doc/dtrace_probes.rdoc
+++ b/doc/dtrace_probes.rdoc
@@ -9,10 +9,10 @@ specified. Probe definitions are in the format of:
Since module and function cannot be specified, they will be blank. An example
probe definition for Ruby would then be:
- ruby:::function-entry(class name, method name, file name, line number)
+ ruby:::method-entry(class name, method name, file name, line number)
Where "ruby" is the provider name, module and function names are blank, the
-probe name is "function-entry", and the probe takes four arguments:
+probe name is "method-entry", and the probe takes four arguments:
* class name
* method name
@@ -59,15 +59,15 @@ with when they are fired and the arguments they take:
[ruby:::method-return(classname, methodname, filename, lineno);]
This probe is fired just after a method has returned. The arguments are the
- same as "ruby:::function-entry".
+ same as "ruby:::method-entry".
[ruby:::cmethod-entry(classname, methodname, filename, lineno);]
This probe is fired just before a C method is entered. The arguments are the
- same as "ruby:::function-entry".
+ same as "ruby:::method-entry".
[ruby:::cmethod-return(classname, methodname, filename, lineno);]
This probe is fired just before a C method returns. The arguments are the
- same as "ruby:::function-entry".
+ same as "ruby:::method-entry".
[ruby:::require-entry(requiredfile, filename, lineno);]
This probe is fired on calls to rb_require_safe (when a file is required).
diff --git a/doc/etc.rd.ja b/doc/etc.rd.ja
index b36e05c994..b4ff6ed04e 100644
--- a/doc/etc.rd.ja
+++ b/doc/etc.rd.ja
@@ -1,4 +1,4 @@
-# etc.rd.ja - -*- mode: rd; coding: euc-jp; -*- created at: Fri Jul 14 00:47:15 JST 1995
+# etc.rd.ja - -*- mode: rd; coding: utf-8; -*- created at: Fri Jul 14 00:47:15 JST 1995
=begin
= Etc(モジュール)
@@ -33,7 +33,7 @@
age # エージ(整数)
class # ユーザアクセスクラス(文字列)
comment # コメント(文字列)
- expire # アカウント有効期é™(æ•´æ•°)
+ expire # アカウント有効期é™(æ•´æ•°)
end
詳細ã¯getpwnam(3)ã‚’å‚ç…§ã®ã“ã¨ï¼Ž
diff --git a/doc/extension.ja.rdoc b/doc/extension.ja.rdoc
new file mode 100644
index 0000000000..7a9729eb41
--- /dev/null
+++ b/doc/extension.ja.rdoc
@@ -0,0 +1,1799 @@
+# README.EXT.ja - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
+
+Rubyã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã®ä½œã‚Šæ–¹ã‚’説明ã—ã¾ã™ï¼Ž
+
+= 基礎知識
+
+Cã®å¤‰æ•°ã«ã¯åž‹ãŒã‚り,データã«ã¯åž‹ãŒã‚りã¾ã›ã‚“.ã§ã™ã‹ã‚‰ï¼ŒãŸ
+ã¨ãˆã°ãƒã‚¤ãƒ³ã‚¿ã‚’intã®å¤‰æ•°ã«ä»£å…¥ã™ã‚‹ã¨ï¼Œãã®å€¤ã¯æ•´æ•°ã¨ã—ã¦å–
+り扱ã‚れã¾ã™ï¼Žé€†ã«Rubyã®å¤‰æ•°ã«ã¯åž‹ãŒãªã,データã«åž‹ãŒã‚りã¾
+ã™ï¼Žã“ã®é•ã„ã®ãŸã‚,Cã¨Rubyã¯ç›¸äº’ã«å¤‰æ›ã—ãªã‘れã°ï¼ŒãŠäº’ã„ã®
+データをアクセスã§ãã¾ã›ã‚“.
+
+Rubyã®ãƒ‡ãƒ¼ã‚¿ã¯VALUEã¨ã„ã†Cã®åž‹ã§è¡¨ç¾ã•れã¾ã™ï¼ŽVALUEåž‹ã®ãƒ‡ãƒ¼
+ã‚¿ã¯ãã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を自分ã§çŸ¥ã£ã¦ã„ã¾ã™ï¼Žã“ã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã¨
+ã„ã†ã®ã¯ãƒ‡ãƒ¼ã‚¿(オブジェクト)ã®å®Ÿéš›ã®æ§‹é€ ã‚’æ„味ã—ã¦ã„ã¦ï¼ŒRuby
+ã®ã‚¯ãƒ©ã‚¹ã¨ã¯ã¾ãŸé•ã£ãŸã‚‚ã®ã§ã™ï¼Ž
+
+VALUEã‹ã‚‰Cã«ã¨ã£ã¦æ„味ã®ã‚るデータをå–り出ã™ãŸã‚ã«ã¯
+
+1. VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を知る
+2. VALUEã‚’Cã®ãƒ‡ãƒ¼ã‚¿ã«å¤‰æ›ã™ã‚‹
+
+ã®ä¸¡æ–¹ãŒå¿…è¦ã§ã™ï¼Ž(1)を忘れるã¨é–“é•ã£ãŸãƒ‡ãƒ¼ã‚¿ã®å¤‰æ›ãŒè¡Œã‚れ
+ã¦ï¼Œæœ€æ‚ªãƒ—ログラムãŒcore dumpã—ã¾ã™ï¼Ž
+
+== データタイプ
+
+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_ICLASS
+ T_MATCH
+ T_UNDEF
+ T_NODE
+ T_ZOMBIE
+
+ã»ã¨ã‚“ã©ã®ã‚¿ã‚¤ãƒ—ã¯Cã®æ§‹é€ ä½“ã§å®Ÿè£…ã•れã¦ã„ã¾ã™ï¼Ž
+
+== VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹
+
+ruby.hã§ã¯TYPE()ã¨ã„ã†ãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„ã¦ï¼ŒVALUEã®ãƒ‡ãƒ¼ã‚¿
+タイプを知るã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼ŽTYPE()マクロã¯ä¸Šã§ç´¹ä»‹ã—ãŸT_XXXX
+ã®å½¢å¼ã®å®šæ•°ã‚’è¿”ã—ã¾ã™ï¼ŽVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã«å¿œã˜ã¦å‡¦ç†ã™ã‚‹
+å ´åˆã«ã¯ï¼ŒTYPE()ã®å€¤ã§åˆ†å²ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
+
+ switch (TYPE(obj)) {
+ case T_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)
+
+ã“ã®é–¢æ•°ã¯valueãŒtypeã§ç„¡ã‘れã°ï¼Œä¾‹å¤–を発生ã•ã›ã¾ã™ï¼Žå¼•æ•°ã¨
+ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ãŒæ­£ã—ã„ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™
+ã‚‹ãŸã‚ã«ã¯ï¼Œã“ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+FIXNUMã¨NILã«é–¢ã—ã¦ã¯ã‚ˆã‚Šé«˜é€Ÿãªåˆ¤åˆ¥ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„ã¾ã™ï¼Ž
+
+ FIXNUM_P(obj)
+ NIL_P(obj)
+
+== 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()).ãŸ
+ã ã—ã€æ§‹é€ ä½“ã¸ã®ç›´æŽ¥ã®ã‚¢ã‚¯ã‚»ã‚¹ã¯ã§ãã‚‹ã ã‘é¿ã‘,対応ã™ã‚‹
+rb_xxxx() ã¨ã„ã£ãŸé–¢æ•°ã‚’使ã†ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.例ãˆã°ï¼Œé…列ã®
+è¦ç´ ã¸ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹å ´åˆã¯ï¼Œrb_ary_entry(ary, offset),
+rb_ary_store(ary, offset, obj) を利用ã™ã‚‹ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.
+
+構造体ã‹ã‚‰ãƒ‡ãƒ¼ã‚¿ã‚’å–り出ã™ãƒžã‚¯ãƒ­ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Žæ–‡å­—列
+strã®é•·ã•ã‚’å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_LEN(str)ã€ã¨ã—,文字列strã‚’
+char*ã¨ã—ã¦å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_PTR(str)ã€ã¨ã—ã¾ã™ï¼Ž
+
+Rubyã®æ§‹é€ ä½“を直接アクセスã™ã‚‹æ™‚ã«æ°—ã‚’ã¤ã‘ãªã‘れã°ãªã‚‰ãªã„ã“
+ã¨ã¯ï¼Œé…åˆ—ã‚„æ–‡å­—åˆ—ã®æ§‹é€ ä½“ã®ä¸­èº«ã¯å‚ç…§ã™ã‚‹ã ã‘ã§ï¼Œç›´æŽ¥å¤‰æ›´ã—
+ãªã„ã“ã¨ã§ã™ï¼Žç›´æŽ¥å¤‰æ›´ã—ãŸå ´åˆï¼Œã‚ªãƒ–ジェクトã®å†…å®¹ã®æ•´åˆæ€§ãŒ
+ã¨ã‚Œãªããªã£ã¦ï¼Œæ€ã‚ã¬ãƒã‚°ã®åŽŸå› ã«ãªã‚Šã¾ã™ï¼Ž
+
+== 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ã«å¤‰æ›
+ã—ã¦ãれã¾ã™(ãŒï¼Œå°‘ã—é…ã„).
+
+== Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹
+
+先程も述ã¹ãŸé€šã‚Šï¼ŒRubyã®æ§‹é€ ä½“をアクセスã™ã‚‹æ™‚ã«å†…å®¹ã®æ›´æ–°ã‚’
+行ã†ã“ã¨ã¯å‹§ã‚られã¾ã›ã‚“.ã§ï¼ŒRubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹æ™‚ã«ã¯
+RubyãŒç”¨æ„ã—ã¦ã„る関数を用ã„ã¦ãã ã•ã„.
+
+ã“ã“ã§ã¯ã‚‚ã£ã¨ã‚‚使ã‚れるã§ã‚ã‚ã†æ–‡å­—列ã¨é…列ã®ç”Ÿæˆ/æ“作を行
+ã†é–¢æ•°ã‚’ã‚ã’ã¾ã™(全部ã§ã¯ãªã„ã§ã™).
+
+=== 文字列ã«å¯¾ã™ã‚‹é–¢æ•°
+
+rb_str_new(const char *ptr, long len) ::
+
+ æ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_str_new2(const char *ptr) ::
+rb_str_new_cstr(const char *ptr) ::
+
+ Cã®æ–‡å­—列ã‹ã‚‰Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯
+ rb_str_new(ptr, strlen(ptr))ã¨åŒç­‰ã§ã‚る.
+
+rb_str_new_literal(const char *ptr) ::
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_tainted_str_new(const char *ptr, long len) ::
+
+ 汚染マークãŒä»˜åŠ ã•ã‚ŒãŸæ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žå¤–部
+ ã‹ã‚‰ã®ãƒ‡ãƒ¼ã‚¿ã«åŸºã¥ã文字列ã«ã¯æ±šæŸ“マークãŒä»˜åŠ ã•れるã¹ã
+ ã§ã‚る.
+
+rb_tainted_str_new2(const char *ptr) ::
+rb_tainted_str_new_cstr(const char *ptr) ::
+
+ Cã®æ–‡å­—列ã‹ã‚‰æ±šæŸ“マークãŒä»˜åŠ ã•れãŸRubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_sprintf(const char *format, ...) ::
+rb_vsprintf(const char *format, va_list ap) ::
+
+ Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
+ æ•´å½¢ã—,Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+ 注æ„: "%"PRIsVALUEãŒObject#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹
+ ã¨ãã¯Object#inspect)を使ã£ãŸVALUEã®å‡ºåŠ›ã«åˆ©ç”¨ã§ãる.ã“れ
+ ã¯"%i"ã¨è¡çªã™ã‚‹ãŸã‚,整数ã«ã¯"%d"を使用ã™ã‚‹ã“ã¨ï¼Ž
+
+rb_str_cat(VALUE str, const char *ptr, long len) ::
+
+ Rubyã®æ–‡å­—列strã«lenãƒã‚¤ãƒˆã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Ž
+
+rb_str_cat2(VALUE str, const char* ptr) ::
+rb_str_cat_cstr(VALUE str, const char* 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)) ã¨åŒç­‰ã§ã‚る.
+
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) ::
+rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc) ::
+
+ 指定ã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
+
+rb_enc_str_new_literal(const char *ptr) ::
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰æŒ‡å®šã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_usascii_str_new(const char *ptr, long len) ::
+rb_usascii_str_new_cstr(const char *ptr) ::
+
+ エンコーディングãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
+
+rb_usascii_str_new_literal(const char *ptr) ::
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_utf8_str_new(const char *ptr, long len) ::
+rb_utf8_str_new_cstr(const char *ptr) ::
+
+ エンコーディングãŒUTF-8ã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
+
+rb_utf8_str_new_literal(const char *ptr) ::
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ãŒUTF-8ã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_str_resize(VALUE str, long len) ::
+
+ Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«å¤‰æ›´ã™ã‚‹ï¼Žstrã®é•·ã•ã¯å‰
+ 以ã¦ã‚»ãƒƒãƒˆã•れã¦ã„ãªã‘れã°ãªã‚‰ãªã„.lenãŒå…ƒã®é•·ã•よりも短
+ ã„æ™‚ã¯ï¼Œlenãƒã‚¤ãƒˆã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…å®¹ã¯æ¨ã¦ã‚‰ã‚Œã‚‹ï¼ŽlenãŒå…ƒ
+ ã®é•·ã•ã‚ˆã‚Šã‚‚é•·ã„æ™‚ã¯ï¼Œå…ƒã®é•·ã•ã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…容ã¯ä¿å­˜ã•
+ れãªã„ã§ã‚´ãƒŸã«ãªã‚‹ã ã‚ã†ï¼Žã“ã®é–¢æ•°ã®å‘¼ã³å‡ºã—ã«ã‚ˆã£ã¦
+ RSTRING_PTR(str)ãŒå¤‰æ›´ã•れるã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„.
+
+rb_str_set_len(VALUE str, long len) ::
+
+ Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼ŽstrãŒå¤‰æ›´å¯
+ 能ã§ãªã‘れã°ä¾‹å¤–ãŒç™ºç”Ÿã™ã‚‹ï¼ŽRSTRING_LEN(str)ã¨ã¯ç„¡é–¢ä¿‚ã«ï¼Œ
+ lenãƒã‚¤ãƒˆã¾ã§ã®å†…容ã¯ä¿å­˜ã•れる.lenã¯strã®å®¹é‡ã‚’è¶Šãˆã¦ã„
+ ã¦ã¯ãªã‚‰ãªã„.
+
+=== é…列ã«å¯¾ã™ã‚‹é–¢æ•°
+
+rb_ary_new() ::
+
+ è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_new2(long len) ::
+rb_ary_new_capa(long len) ::
+
+ è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Žlenè¦ç´ åˆ†ã®é ˜åŸŸã‚’ã‚らã‹ã˜ã‚割り
+ 当ã¦ã¦ãŠã.
+
+rb_ary_new3(long n, ...) ::
+rb_ary_new_from_args(long n, ...) ::
+
+ å¼•æ•°ã§æŒ‡å®šã—ãŸnè¦ç´ ã‚’å«ã‚€é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_new4(long n, VALUE *elts) ::
+rb_ary_new_from_values(long n, VALUE *elts) ::
+
+ é…列ã§ä¸ŽãˆãŸnè¦ç´ ã®é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_to_ary(VALUE obj) ::
+
+ オブジェクトをé…列ã«å¤‰æ›ã™ã‚‹.
+ Object#to_aryã¨åŒç­‰ã§ã‚ã‚‹.
+
+ä»–ã«ã‚‚é…列をæ“作ã™ã‚‹é–¢æ•°ãŒå¤šæ•°ã‚ã‚‹. ã“れらã¯
+引数aryã«é…列を渡ã•ãªã‘れã°ãªã‚‰ãªã„. ã•ã‚‚ãªã„ã¨
+コアをåã.
+
+rb_ary_aref(argc, VALUE *argv, VALUE ary) ::
+
+ Array#[]ã¨åŒç­‰.
+
+rb_ary_entry(VALUE ary, long offset) ::
+
+ \ary[offset]
+
+rb_ary_store(VALUE ary, long offset, VALUE obj) ::
+
+ \ary[offset] = obj
+
+rb_ary_subseq(VALUE ary, long beg, long len) ::
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val) ::
+rb_ary_pop(VALUE ary) ::
+rb_ary_shift(VALUE ary) ::
+rb_ary_unshift(VALUE ary, VALUE val) ::
+
+ ary.push, ary.pop, ary.shift, ary.unshift
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len) ::
+
+ é…列aryã«ptrã‹ã‚‰len個ã®ã‚ªãƒ–ジェクトを追加ã™ã‚‹ï¼Ž
+
+= Rubyã®æ©Ÿèƒ½ã‚’使ã†
+
+原ç†çš„ã«Rubyã§æ›¸ã‘ã‚‹ã“ã¨ã¯Cã§ã‚‚書ã‘ã¾ã™ï¼ŽRubyãã®ã‚‚ã®ãŒCã§è¨˜
+è¿°ã•れã¦ã„ã‚‹ã‚“ã§ã™ã‹ã‚‰ï¼Œå½“ç„¶ã¨ã„ãˆã°å½“ç„¶ãªã‚“ã§ã™ã‘ã©ï¼Žã“ã“ã§
+ã¯Rubyã®æ‹¡å¼µã«ä½¿ã†ã“ã¨ãŒå¤šã„ã ã‚ã†ã¨äºˆæ¸¬ã•れる機能を中心ã«ç´¹
+介ã—ã¾ã™ï¼Ž
+
+== Rubyã«æ©Ÿèƒ½ã‚’追加ã™ã‚‹
+
+Rubyã§æä¾›ã•れã¦ã„る関数を使ãˆã°Rubyã‚¤ãƒ³ã‚¿ãƒ—ãƒªã‚¿ã«æ–°ã—ã„æ©Ÿèƒ½
+を追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼ŽRubyã§ã¯ä»¥ä¸‹ã®æ©Ÿèƒ½ã‚’追加ã™ã‚‹é–¢æ•°ãŒ
+æä¾›ã•れã¦ã„ã¾ã™ï¼Ž
+
+- クラス,モジュール
+- メソッド,特異メソッドãªã©
+- 定数
+
+ã§ã¯é †ã«ç´¹ä»‹ã—ã¾ã™ï¼Ž
+
+=== クラス/モジュール定義
+
+クラスやモジュールを定義ã™ã‚‹ãŸã‚ã«ã¯ï¼Œä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ 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)
+
+=== メソッド/特異メソッド定義
+
+メソッドや特異メソッドを定義ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ void rb_define_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+ void rb_define_singleton_method(VALUE object, const char *name,
+ VALUE (*func)(), int argc)
+
+念ã®ãŸã‚説明ã™ã‚‹ã¨ã€Œç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã€ã¨ã¯ï¼Œãã®ç‰¹å®šã®ã‚ªãƒ–ジェク
+トã«å¯¾ã—ã¦ã ã‘有効ãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã™ï¼ŽRubyã§ã¯ã‚ˆãSmalltalkã«ãŠ
+ã‘るクラスメソッドã¨ã—ã¦ï¼Œã‚¯ãƒ©ã‚¹ã«å¯¾ã™ã‚‹ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ãŒä½¿ã‚れ
+ã¾ã™ï¼Ž
+
+ã“れらã®é–¢æ•°ã® argcã¨ã„ã†å¼•æ•°ã¯Cã®é–¢æ•°ã¸æ¸¡ã•ã‚Œã‚‹å¼•æ•°ã®æ•°(ã¨
+å½¢å¼)を決ã‚ã¾ã™ï¼ŽargcãŒ0ä»¥ä¸Šã®æ™‚ã¯é–¢æ•°ã«å¼•ãæ¸¡ã™å¼•æ•°ã®æ•°ã‚’æ„
+味ã—ã¾ã™ï¼Ž16個以上ã®å¼•æ•°ã¯ä½¿ãˆã¾ã›ã‚“(ãŒï¼Œè¦ã‚Šã¾ã›ã‚“よã­ï¼Œã
+ã‚“ãªã«).実際ã®é–¢æ•°ã«ã¯å…ˆé ­ã®å¼•æ•°ã¨ã—ã¦selfãŒä¸Žãˆã‚‰ã‚Œã¾ã™ã®
+ã§ï¼ŒæŒ‡å®šã—ãŸæ•°ã‚ˆã‚Š1多ã„引数をæŒã¤ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
+
+argcãŒè² ã®æ™‚ã¯å¼•æ•°ã®æ•°ã§ã¯ãªã,形å¼ã‚’指定ã—ãŸã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
+argcãŒ-1ã®æ™‚ã¯å¼•æ•°ã‚’é…列ã«å…¥ã‚Œã¦æ¸¡ã•れã¾ã™ï¼ŽargcãŒ-2ã®æ™‚ã¯å¼•
+æ•°ã¯Rubyã®é…列ã¨ã—ã¦æ¸¡ã•れã¾ã™ï¼Ž
+
+メソッドを定義ã™ã‚‹é–¢æ•°ã¯ã¾ã ã„ãã¤ã‹ã‚りã¾ã™. ã²ã¨ã¤ã¯ãƒ¡ã‚½ãƒƒãƒ‰
+åã¨ã—ã¦IDã‚’å–りã¾ã™. IDã«ã¤ã„ã¦ã¯2.2.2ã‚’å‚ç…§.
+
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
+
+private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã‚’定義ã™ã‚‹ãµãŸã¤ã®é–¢æ•°ãŒã‚りã¾ã™.
+
+ void rb_define_private_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+privateメソッドã¨ã¯é–¢æ•°å½¢å¼ã§ã—ã‹å‘¼ã³å‡ºã™ã“ã¨ã®å‡ºæ¥ãªã„メソッ
+ドã§ã™ï¼Ž
+
+最後ã«ï¼Œ rb_define_module関数ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã—ã¾ã™ï¼Ž
+モジュール関数ã¨ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚Šï¼ŒåŒæ™‚ã«
+privateメソッドã§ã‚‚ã‚ã‚‹ã‚‚ã®ã§ã™ï¼Žä¾‹ã‚’ã‚ã’ã‚‹ã¨Mathモジュール
+ã®sqrt()ãªã©ãŒã‚ã’られã¾ã™ï¼Žã“ã®ãƒ¡ã‚½ãƒƒãƒ‰ã¯
+
+ Math.sqrt(4)
+
+ã¨ã„ã†å½¢å¼ã§ã‚‚
+
+ include Math
+ sqrt(4)
+
+ã¨ã„ã†å½¢å¼ã§ã‚‚使ãˆã¾ã™ï¼Žãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®
+通りã§ã™ï¼Ž
+
+ void rb_define_module_function(VALUE module, const char *name,
+ VALUE (*func)(), int argc)
+
+関数的メソッド(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を定義ã—ãŸã‚Šå‰Šé™¤ã—ãŸã‚Šã™ã‚‹ãŸã‚ã®é–¢æ•°ã¯
+以下ã®é€šã‚Šã§ã™ï¼Ž
+
+ void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
+ void rb_undef_alloc_func(VALUE klass);
+
+funcã¯ã‚¯ãƒ©ã‚¹ã‚’引数ã¨ã—ã¦å—ã‘å–ã£ã¦ï¼Œæ–°ã—ã割り当ã¦ã‚‰ã‚ŒãŸã‚¤ãƒ³
+スタンスを返ã•ãªãã¦ã¯ãªã‚Šã¾ã›ã‚“.ã“ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã¯ï¼Œå¤–部リ
+ソースãªã©ã‚’å«ã¾ãªã„,ã§ãã‚‹ã ã‘「空ã€ã®ã¾ã¾ã«ã—ã¦ãŠã„ãŸã»ã†
+ãŒã‚ˆã„ã§ã—ょã†ï¼Ž
+
+継承ã—ãŸã‚¯ãƒ©ã‚¹ã«ã‚る既存ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã—ã¦ã„ã‚‹ãª
+ら,オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使
+ã„ã¾ã™ï¼Ž
+
+ VALUE rb_call_super(int argc, const VALUE *argv)
+
+ç¾åœ¨ã®ã‚¹ã‚³ãƒ¼ãƒ—ã®ãƒ¬ã‚·ãƒ¼ãƒã¯(ä»–ã«æ–¹æ³•ãŒãªã‘れã°),以下ã®é–¢æ•°ã§
+å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼Ž
+
+ VALUE rb_current_receiver(void)
+
+=== 定数定義
+
+拡張ライブラリãŒå¿…è¦ãªå®šæ•°ã¯ã‚らã‹ã˜ã‚定義ã—ã¦ãŠã„ãŸæ–¹ãŒè‰¯ã„
+ã§ã—ょã†ï¼Žå®šæ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯äºŒã¤ã‚りã¾ã™ï¼Ž
+
+ void rb_define_const(VALUE klass, const char *name, VALUE val)
+ void rb_define_global_const(const char *name, VALUE val)
+
+å‰è€…ã¯ç‰¹å®šã®ã‚¯ãƒ©ã‚¹/モジュールã«å±žã™ã‚‹å®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ï¼Œå¾Œ
+者ã¯ã‚°ãƒ­ãƒ¼ãƒãƒ«ãªå®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ã§ã™ï¼Ž
+
+== Rubyã®æ©Ÿèƒ½ã‚’Cã‹ã‚‰å‘¼ã³å‡ºã™
+
+æ—¢ã«ã€Ž1.5 Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹ã€ã§ä¸€éƒ¨ç´¹ä»‹ã—ãŸã‚ˆã†ãªé–¢æ•°ã‚’
+使ãˆã°ï¼ŒRubyã®æ©Ÿèƒ½ã‚’実ç¾ã—ã¦ã„る関数を直接呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥
+ã¾ã™ï¼Ž
+
+# ã“ã®ã‚ˆã†ãªé–¢æ•°ã®ä¸€è¦§è¡¨ã¯ã„ã¾ã®ã¨ã“ã‚ã‚りã¾ã›ã‚“.ソースを見
+# ã‚‹ã—ã‹ãªã„ã§ã™ã­ï¼Ž
+
+ãれ以外ã«ã‚‚Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™æ–¹æ³•ã¯ã„ãã¤ã‹ã‚りã¾ã™ï¼Ž
+
+=== Rubyã®ãƒ—ログラムをevalã™ã‚‹
+
+Cã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™ã‚‚ã£ã¨ã‚‚ç°¡å˜ãªæ–¹æ³•ã¨ã—ã¦ï¼Œæ–‡å­—列ã§
+与ãˆã‚‰ã‚ŒãŸRubyã®ãƒ—ログラムを評価ã™ã‚‹ä»¥ä¸‹ã®é–¢æ•°ãŒã‚りã¾ã™ï¼Ž
+
+ VALUE rb_eval_string(const char *str)
+
+ã“ã®è©•価ã¯ç¾åœ¨ã®ç’°å¢ƒã§è¡Œã‚れã¾ã™ï¼Žã¤ã¾ã‚Šï¼Œç¾åœ¨ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°
+ãªã©ã‚’å—ã‘ç¶™ãŽã¾ã™ï¼Ž
+
+評価ã¯ä¾‹å¤–を発生ã™ã‚‹ã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„ã—ã¾ã—ょã†. より安全
+ãªé–¢æ•°ã‚‚ã‚りã¾ã™.
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
+
+ã“ã®é–¢æ•°ã¯ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã™ã‚‹ã¨nilã‚’è¿”ã—ã¾ã™ï¼Žãã—ã¦ï¼ŒæˆåŠŸæ™‚ã«ã¯
+*stateã¯ã‚¼ãƒ­ã«ï¼Œã•ã‚‚ãªãã°éžã‚¼ãƒ­ã«ãªã‚Šã¾ã™ï¼Ž
+
+=== IDã¾ãŸã¯ã‚·ãƒ³ãƒœãƒ«
+
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã“ã¨ã‚‚ã§ãã¾
+ã™ï¼Žãã®å‰ã«ï¼ŒRubyインタプリタ内ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚„変数åを指定ã™ã‚‹
+時ã«ä½¿ã‚れã¦ã„ã‚‹IDã«ã¤ã„ã¦èª¬æ˜Žã—ã¦ãŠãã¾ã—ょã†ï¼Ž
+
+IDã¨ã¯å¤‰æ•°å,メソッドåã‚’è¡¨ã™æ•´æ•°ã§ã™ï¼ŽRubyã®ä¸­ã§ã¯
+
+ :識別å­
+
+ã¾ãŸã¯
+
+ :"ä»»æ„ã®æ–‡å­—列"
+
+ã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã™ï¼ŽCã‹ã‚‰ã“ã®æ•´æ•°ã‚’å¾—ã‚‹ãŸã‚ã«ã¯é–¢æ•°
+
+ rb_intern(const char *name)
+ rb_intern_str(VALUE name)
+
+を使ã„ã¾ã™ï¼Ž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ã®æ–‡å­—列を使ã„ã¾ã™ï¼Ž
+
+Rubyã‹ã‚‰å¼•æ•°ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸã‚·ãƒ³ãƒœãƒ«(ã¾ãŸã¯æ–‡å­—列)をシンボル
+ã«å¤‰æ›ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ rb_to_symbol(VALUE name)
+ rb_check_symbol(volatile VALUE *namep)
+ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc)
+
+ã“れらã®é–¢æ•°ã¯ï¼ŒIDã®ä»£ã‚りã«ã‚·ãƒ³ãƒœãƒ«ã‚’è¿”ã™ã“ã¨ã‚’除ã‘ã°ä¸Šè¨˜ã®
+関数ã¨åŒã˜ã§ã™ï¼Ž
+
+=== Cã‹ã‚‰Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™
+
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ãŸã‚ã«ã¯ä»¥ä¸‹
+ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
+
+ã“ã®é–¢æ•°ã¯ã‚ªãƒ–ジェクトrecvã®midã§æŒ‡å®šã•れるメソッドを呼ã³å‡º
+ã—ã¾ã™ï¼Žãã®ä»–ã«å¼•æ•°ã®æŒ‡å®šã®ä»•æ–¹ãŒé•ã†ä»¥ä¸‹ã®é–¢æ•°ã‚‚ã‚りã¾ã™ï¼Ž
+
+ VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+ VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv)
+ VALUE rb_apply(VALUE recv, ID mid, VALUE args)
+
+applyã«ã¯å¼•æ•°ã¨ã—ã¦Rubyã®é…列を与ãˆã¾ã™ï¼Ž
+
+=== 変数/定数をå‚ç…§/æ›´æ–°ã™ã‚‹
+
+Cã‹ã‚‰é–¢æ•°ã‚’使ã£ã¦å‚照・更新ã§ãã‚‹ã®ã¯ï¼Œå®šæ•°ï¼Œã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰
+æ•°ã§ã™ï¼Žå¤§åŸŸå¤‰æ•°ã¯ä¸€éƒ¨ã®ã‚‚ã®ã¯Cã®å¤§åŸŸå¤‰æ•°ã¨ã—ã¦ã‚¢ã‚¯ã‚»ã‚¹ã§ã
+ã¾ã™ï¼Žãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã‚’å‚ç…§ã™ã‚‹æ–¹æ³•ã¯å…¬é–‹ã—ã¦ã„ã¾ã›ã‚“.
+
+オブジェクトã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’å‚照・更新ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®é€š
+りã§ã™ï¼Ž
+
+ VALUE rb_ivar_get(VALUE obj, ID id)
+ VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
+
+idã¯rb_intern()ã§å¾—られるもã®ã‚’使ã£ã¦ãã ã•ã„.
+
+定数をå‚ç…§ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦ãã ã•ã„.
+
+ VALUE rb_const_get(VALUE obj, ID id)
+
+定数を新ã—ã定義ã™ã‚‹ãŸã‚ã«ã¯ã€Ž2.1.3 定数定義ã€ã§ç´¹ä»‹ã•
+れã¦ã„る関数を使ã£ã¦ãã ã•ã„.
+
+= Rubyã¨Cã¨ã®æƒ…報共有
+
+C言語ã¨Rubyã®é–“ã§æƒ…報を共有ã™ã‚‹æ–¹æ³•ã«ã¤ã„ã¦è§£èª¬ã—ã¾ã™ï¼Ž
+
+== Cã‹ã‚‰å‚ç…§ã§ãã‚‹Rubyã®å®šæ•°
+
+以下ã®Rubyã®å®šæ•°ã¯Cã®ãƒ¬ãƒ™ãƒ«ã‹ã‚‰å‚ç…§ã§ãã¾ã™ï¼Ž
+
+Qtrue ::
+Qfalse ::
+
+ 真å½å€¤ï¼ŽQfalseã¯C言語ã§ã‚‚å½ã¨ã¿ãªã•れã¾ã™(ã¤ã¾ã‚Š0).
+
+Qnil ::
+
+ C言語ã‹ã‚‰è¦‹ãŸã€Œnilã€ï¼Ž
+
+== Cã¨Rubyã§å…±æœ‰ã•れる大域変数
+
+Cã¨Rubyã§å¤§åŸŸå¤‰æ•°ã‚’使ã£ã¦æƒ…報を共有ã§ãã¾ã™ï¼Žå…±æœ‰ã§ãる大域
+変数ã«ã¯ã„ãã¤ã‹ã®ç¨®é¡žãŒã‚りã¾ã™ï¼Žãã®ãªã‹ã§ã‚‚ã£ã¨ã‚‚良ã使ã‚
+ã‚Œã‚‹ã¨æ€ã‚れるã®ã¯rb_define_variable()ã§ã™ï¼Ž
+
+ void rb_define_variable(const char *name, VALUE *var)
+
+ã“ã®é–¢æ•°ã¯Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹å¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾ã™ï¼Žå¤‰æ•°åãŒ
+`$'ã§å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®å€¤ã‚’変
+æ›´ã™ã‚‹ã¨è‡ªå‹•çš„ã«Rubyã®å¯¾å¿œã™ã‚‹å¤‰æ•°ã®å€¤ã‚‚変ã‚りã¾ã™ï¼Ž
+
+ã¾ãŸRubyå´ã‹ã‚‰ã¯æ›´æ–°ã§ããªã„変数もã‚りã¾ã™ï¼Žã“ã®read onlyã®
+変数ã¯ä»¥ä¸‹ã®é–¢æ•°ã§å®šç¾©ã—ã¾ã™ï¼Ž
+
+ void rb_define_readonly_variable(const char *name, VALUE *var)
+
+ã“れら変数ã®ä»–ã«hookã‚’ã¤ã‘ãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã§ãã¾ã™ï¼Žhook付ã
+ã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’用ã„ã¦å®šç¾©ã—ã¾ã™ï¼Žhook付ã大域変数ã®
+値ã®å‚照や設定ã¯hookã§è¡Œã†å¿…è¦ãŒã‚りã¾ã™ï¼Ž
+
+ void rb_define_hooked_variable(const char *name, VALUE *var,
+ VALUE (*getter)(), void (*setter)())
+
+ã“ã®é–¢æ•°ã¯Cã®é–¢æ•°ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾
+ã™ï¼Žå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯é–¢æ•°getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•れ
+ãŸæ™‚ã«ã¯é–¢æ•°setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žhookを指定ã—ãªã„å ´åˆã¯getterã‚„
+setterã«0を指定ã—ã¾ã™ï¼Ž
+--
+getterã‚‚setterã‚‚0ãªã‚‰ã°rb_define_variable()ã¨åŒã˜ã«ãªã‚‹ï¼Ž
+++
+
+getterã¨setterã®ä»•æ§˜ã¯æ¬¡ã®é€šã‚Šã§ã™ï¼Ž
+
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
+
+ãれã‹ã‚‰ï¼Œå¯¾å¿œã™ã‚‹Cã®å¤‰æ•°ã‚’æŒãŸãªã„Rubyã®å¤§åŸŸå¤‰æ•°ã‚’定義ã™ã‚‹
+ã“ã¨ã‚‚ã§ãã¾ã™. ãã®å¤‰æ•°ã®å€¤ã¯ãƒ•ック関数ã®ã¿ã«ã‚ˆã£ã¦å–得・設定
+ã•れã¾ã™.
+
+ void rb_define_virtual_variable(const char *name,
+ VALUE (*getter)(), void (*setter)())
+
+ã“ã®é–¢æ•°ã«ã‚ˆã£ã¦å®šç¾©ã•れãŸRubyã®å¤§åŸŸå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯
+getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œã¾ã™ï¼Ž
+
+getterã¨setterã®ä»•様ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
+
+ (*getter)(ID id);
+ (*setter)(VALUE val, ID id);
+
+== Cã®ãƒ‡ãƒ¼ã‚¿ã‚’Rubyオブジェクトã«ã™ã‚‹
+
+Cã®ä¸–界ã§å®šç¾©ã•れãŸãƒ‡ãƒ¼ã‚¿(構造体)ã‚’Rubyã®ã‚ªãƒ–ジェクトã¨ã—ã¦
+å–り扱ã„ãŸã„å ´åˆãŒã‚りãˆã¾ã™ï¼Žã“ã®ã‚ˆã†ãªå ´åˆã¯TypedData_XXX
+マクロ群を用ã„ã¦æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã¨Rubyã®ã‚ªãƒ–ジェクトã¨ã‚’互
+ã„ã«å¤‰æ›ã§ãã¾ã™ï¼Ž
+
+--
+å¤ã„(éžTypedãª)Data_XXXマクロ群ã¯éžæŽ¨å¥¨ã«ãªã‚Šã¾ã—ãŸï¼Ž
+å°†æ¥ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®Rubyã§ã¯å¤ã„マクロã¯å‹•作ã—ãªããªã‚‹å¯èƒ½æ€§
+ãŒã‚りã¾ã™ï¼Ž
+++
+
+=== 構造体ã‹ã‚‰ã‚ªãƒ–ジェクトã¸
+
+構造体ã¸ã®ãƒã‚¤ãƒ³ã‚¿svalã‚’Rubyオブジェクトã«å¤‰æ›ã™ã‚‹ã«ã¯æ¬¡ã®ãƒž
+クロを使ã„ã¾ã™ã€‚
+
+ TypedData_Wrap_Struct(klass, data_type, sval)
+
+ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸã‚ªãƒ–ジェクトを表ã™VALUE値ã§ã™ï¼Ž
+
+klassã¯ã“ã®ã‚ªãƒ–ジェクトã®ã‚¯ãƒ©ã‚¹ã§ã™ï¼Ždata_typeã¯ã“ã®æ§‹é€ ä½“ã‚’
+RubyãŒç®¡ç†ã™ã‚‹ãŸã‚ã®æƒ…報を記述ã—ãŸconst rb_data_type_tåž‹ã¸ã®
+ãƒã‚¤ãƒ³ã‚¿ã§ã™ï¼Ž
+
+ãªãŠ, klassã¯, Objectã‚„ä»–ã®ã‚¯ãƒ©ã‚¹ã§ã¯ãªãData (rb_cData)ã¨ã„
+ã†ç‰¹åˆ¥ãªã‚¯ãƒ©ã‚¹ã‹ã‚‰æ´¾ç”Ÿã™ã‚‹ã“ã¨ãŒæŽ¨å¥¨ã•れã¾ã™ï¼Ž
+Dataã‹ã‚‰æ´¾ç”Ÿã—ãªã„å ´åˆã«ã¯, å¿…ãšrb_undef_alloc_func(klass)
+を呼ã³å‡ºã—ã¦ãã ã•ã„.
+
+rb_data_type_tã¯æ¬¡ã®ã‚ˆã†ã«å®šç¾©ã•れã¦ã„ã¾ã™ï¼Ž
+
+ struct rb_data_type_struct {
+ const char *wrap_struct_name;
+ struct {
+ void (*dmark)(void*);
+ void (*dfree)(void*);
+ size_t (*dsize)(const void *);
+ void *reserved[2];
+ } function;
+ const rb_data_type_t *parent;
+ void *data;
+ VALUE flags;
+ };
+
+wrap_struct_nameã¯ã“ã®æ§‹é€ ä½“を識別ã™ã‚‹åå‰ã§ã™ï¼Žä¸»ã«çµ±è¨ˆæƒ…å ±
+ã®åŽé›†ã¨å‡ºåŠ›ã«ç”¨ã„られã¾ã™ï¼Žãƒ—ロセス内ã§ä¸€æ„ã§ã‚れã°ç‰¹ã«Cã‚„
+Rubyã®è­˜åˆ¥å­ã¨ã—ã¦æœ‰åйã§ã‚ã‚‹å¿…è¦ã¯ã‚りã¾ã›ã‚“.
+
+dmarkãŠã‚ˆã³dfree関数ã¯GC実行中ã«å‘¼ã³å‡ºã•れã¾ã™.
+ãªãŠ, GC実行中ã¯Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã¯ç¦æ­¢ã•れã¾
+ã™. よã£ã¦, dmarkãŠã‚ˆã³dfree関数ã§Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼
+ションã¯è¡Œã‚ãªã„ã§ãã ã•ã„.
+
+dmarkã¯ã‚¬ãƒ¼ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚¿ãŒã‚ªãƒ–ジェクトã¸ã®å‚照をマークã™ã‚‹
+ã¨ãã«ç”¨ã„る関数ã§ã™ï¼Žã“ã®æ§‹é€ ä½“ãŒRubyã®ã‚ªãƒ–ジェクトã¸ã®å‚ç…§
+ã‚’ä¿æŒã™ã‚‹ã¨ãã«ã¯, dmarkã§ã¯rb_gc_markãªã©ã‚’用ã„ã¦æ§‹é€ ä½“内
+ã®ã™ã¹ã¦ã®å‚照をマークã—ãªã‘れã°ãªã‚Šã¾ã›ã‚“.
+ãã®ã‚ˆã†ãªå‚ç…§ã‚’å«ã¾ãªã„時ã«ã¯0を指定ã—ã¾ã™ï¼Ž
+
+--
+ãã®ã‚ˆã†ãªå‚ç…§ã¯å‹§ã‚られã¾ã›ã‚“.
+++
+
+dfreeã¯ã“ã®æ§‹é€ ä½“ãŒã‚‚ã†ä¸è¦ã«ãªã£ãŸæ™‚ã«å‘¼ã°ã‚Œã‚‹é–¢æ•°ã§ã™ï¼Žã“
+ã®é–¢æ•°ãŒã‚¬ãƒ¼ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚¿ã‹ã‚‰å‘¼ã°ã‚Œã¾ã™ï¼Žã“れãŒ-1ã®å ´åˆã¯ï¼Œ
+å˜ç´”ã«æ§‹é€ ä½“ãŒè§£æ”¾ã•れã¾ã™ï¼Ž
+
+dsizeã¯æ§‹é€ ä½“ãŒæ¶ˆè²»ã—ã¦ã„るメモリã®ãƒã‚¤ãƒˆæ•°ã‚’è¿”ã™é–¢æ•°ã§ã™ï¼Ž
+引数ã¨ã—ã¦æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ãŒæ¸¡ã•れã¾ã™ï¼Žå®Ÿè£…困難ã§ã‚れã°0
+を渡ã—ã¦ã‚‚å·®ã—æ”¯ãˆã‚りã¾ã›ã‚“ãŒ, ã§ãã‚‹ã ã‘指定ã™ã‚‹ã‚ˆã†ã«ã—ã¦
+ãã ã•ã„.
+
+reservedã¨parentã¯0ã§åŸ‹ã‚ãªã‘れã°ãªã‚Šã¾ã›ã‚“.
+
+dataã«ã¯ãƒ¦ãƒ¼ã‚¶ãƒ¼å®šç¾©ã®ä»»æ„ã®å€¤ã‚’指定ã§ãã¾ã™ï¼ŽRubyã¯ã“ã®å€¤ã«
+ã¯é–¢çŸ¥ã—ãªã„ã®ã§ï¼Œå¥½ãã«ä½¿ã£ã¦ãã ã•ã„.
+
+flagsã«ã¯æ¬¡ã®ãƒ•ラグã®ã†ã¡å½“ã¦ã¯ã¾ã‚‹ã‚‚ã®ã®ãƒ“ット和を指定ã—ã¾
+ã™ï¼Žã„ãšã‚Œã‚‚Rubyã®ã‚¬ãƒ¼ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚¿ã«ã¤ã„ã¦ã®æ·±ã„ç†è§£ã‚’å¿…è¦
+ã¨ã—ã¾ã™ã®ã§ï¼Œè‰¯ãã‚ã‹ã‚‰ãªã„å ´åˆã«ã¯0を指定ã™ã‚‹ã¨è‰¯ã„ã§ã—ょ
+ã†ï¼Ž
+
+RUBY_TYPED_FREE_IMMEDIATELY ::
+
+ ã“ã®ãƒ•ラグを指定ã™ã‚‹ã¨ï¼Œã‚¬ãƒ¼ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚¿ã¯ã“ã®æ§‹é€ ä½“ãŒä¸
+ è¦ã«ãªã£ãŸå ´åˆã«ã¯GC中ã«ç›´ã¡ã«dfreeを呼ã³å‡ºã—ã¾ã™ï¼Ž
+ dfreeãŒRuby内部ã®ãƒ­ãƒƒã‚¯(GVL)を解放ã™ã‚‹å¯èƒ½æ€§ãŒãªã„å ´åˆã¯ã“
+ ã®ãƒ•ラグを指定ã§ãã¾ã™ï¼Ž
+
+ 指定ã—ãªã„å ´åˆã¯dfree呼ã³å‡ºã—ã¯é…å»¶ã•れ, ファイナライザã¨
+ åŒã˜ã‚¿ã‚¤ãƒŸãƒ³ã‚°ã§å®Ÿè¡Œã•れã¾ã™ï¼Ž
+
+RUBY_TYPED_WB_PROTECTED ::
+
+ オブジェクトã®å®Ÿè£…ãŒãƒ©ã‚¤ãƒˆãƒãƒªã‚¢ã‚’サãƒãƒ¼ãƒˆã—ã¦ã„ã‚‹ã“ã¨ã‚’示
+ ã—ã¾ã™ï¼Žã“ã®ãƒ•ラグを指定ã™ã‚‹ã¨Rubyã¯ãã®ã‚ªãƒ–ジェクトã«å¯¾ã—
+ ã¦GCをより効率的ã«å®Ÿè¡Œã§ãã¾ã™ï¼Ž
+ ãŸã ã—,指定ã™ã‚‹å ´åˆã¯ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¯ãã®ã‚ªãƒ–ジェクトã®ã™ã¹ã¦ã®
+ メソッドã®å®Ÿè£…ã«é©åˆ‡ã«ãƒ©ã‚¤ãƒˆãƒãƒªã‚¢ã‚’挿入ã™ã‚‹è²¬ä»»ãŒã‚りã¾ã™ï¼Ž
+ ã•ã‚‚ãªãã°Rubyã¯å®Ÿè¡Œæ™‚ã«ã‚¯ãƒ©ãƒƒã‚·ãƒ¥ã™ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ï¼Ž
+
+ ライトãƒãƒªã‚¢ã«ã¤ã„ã¦ã¯doc/extension.rdocã®Appendix D
+ "Generational GC"ã‚‚å‚ç…§ã—ã¦ãã ã•ã„.
+
+
+Cã®æ§‹é€ ä½“ã®å‰²å½“ã¨å¯¾å¿œã™ã‚‹ã‚ªãƒ–ジェクトã®ç”Ÿæˆã‚’åŒæ™‚ã«è¡Œã†ãƒžã‚¯
+ロã¨ã—ã¦ä»¥ä¸‹ã®ã‚‚ã®ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Ž
+
+ TypedData_Make_Struct(klass, type, data_type, sval)
+
+ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸã‚ªãƒ–ジェクトã®VALUE値
+ã§ã™ï¼Žã“ã®ãƒžã‚¯ãƒ­ã¯ä»¥ä¸‹ã®å¼ã®ã‚ˆã†ã«åƒãã¾ã™:
+
+ (sval = ZALLOC(type), TypedData_Wrap_Struct(klass, data_type, sval))
+
+klass, data_typeã¯Data_Wrap_Structã¨åŒã˜åƒãã‚’ã—ã¾ã™ï¼Žtype
+ã¯å‰²ã‚Šå½“ã¦ã‚‹C構造体ã®åž‹ã§ã™ï¼Žå‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸæ§‹é€ ä½“ã¯å¤‰æ•°sval
+ã«ä»£å…¥ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®åž‹ã¯ (type*) ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
+
+=== オブジェクトã‹ã‚‰æ§‹é€ ä½“ã¸
+
+TypedData_Wrap_Structã‚„TypedData_Make_Structã§ç”Ÿæˆã—ãŸã‚ªãƒ–ジェ
+クトã‹ã‚‰æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã‚’復元ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’用ã„ã¾
+ã™ï¼Ž
+
+ TypedData_Get_Struct(obj, type, &data_type, sval)
+
+Cã®æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã¯å¤‰æ•°svalã«ä»£å…¥ã•れã¾ã™ï¼Ž
+
+ã“れらã®ãƒžã‚¯ãƒ­ã®ä½¿ã„æ–¹ã¯ã¡ã‚‡ã£ã¨åˆ†ã‹ã‚Šã«ãã„ã®ã§ï¼Œå¾Œã§èª¬æ˜Žã™
+る例題をå‚ç…§ã—ã¦ãã ã•ã„.
+
+== ディレクトリを作る
+
+ % mkdir ext/dbm
+
+Ruby 1.1ã‹ã‚‰ã¯ä»»æ„ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ãƒ©ã‚¤ãƒ–ラリを作
+ã‚‹ã“ã¨ãŒã§ãるよã†ã«ãªã‚Šã¾ã—ãŸï¼ŽRubyã«é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹å ´åˆã«
+ã¯Rubyを展開ã—ãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ï¼Œextディレクトリã®ä¸­ã«æ‹¡å¼µ
+ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’作る必è¦ãŒã‚りã¾ã™ï¼Žåå‰ã¯é©å½“ã«
+é¸ã‚“ã§æ§‹ã„ã¾ã›ã‚“.
+
+== 設計ã™ã‚‹
+
+ã¾ã‚,当然ãªã‚“ã§ã™ã‘ã©ï¼Œã©ã†ã„ã†æ©Ÿèƒ½ã‚’実ç¾ã™ã‚‹ã‹ã©ã†ã‹ã¾ãšè¨­
+計ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Žã©ã‚“ãªã‚¯ãƒ©ã‚¹ã‚’ã¤ãã‚‹ã‹ï¼Œãã®ã‚¯ãƒ©ã‚¹ã«ã¯
+ã©ã‚“ãªãƒ¡ã‚½ãƒƒãƒ‰ãŒã‚ã‚‹ã‹ï¼Œã‚¯ãƒ©ã‚¹ãŒæä¾›ã™ã‚‹å®šæ•°ãªã©ã«ã¤ã„ã¦è¨­è¨ˆ
+ã—ã¾ã™ï¼Ž
+
+== Cコードを書ã
+
+拡張ライブラリ本体ã¨ãªã‚‹C言語ã®ã‚½ãƒ¼ã‚¹ã‚’書ãã¾ã™ï¼ŽC言語ã®ã‚½ãƒ¼
+スãŒã²ã¨ã¤ã®æ™‚ã«ã¯ã€Œãƒ©ã‚¤ãƒ–ラリå.cã€ã‚’é¸ã¶ã¨è‰¯ã„ã§ã—ょã†ï¼ŽC
+言語ã®ã‚½ãƒ¼ã‚¹ãŒè¤‡æ•°ã®å ´åˆã«ã¯é€†ã«ã€Œãƒ©ã‚¤ãƒ–ラリå.cã€ã¨ã„ã†ãƒ•ã‚¡
+イルåã¯é¿ã‘ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Žã‚ªãƒ–ジェクトファイルã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼
+ãƒ«ç”Ÿæˆæ™‚ã«ä¸­é–“çš„ã«ç”Ÿæˆã•れる「ライブラリå.oã€ã¨ã„ã†ãƒ•ァイル
+ã¨ãŒè¡çªã™ã‚‹ã‹ã‚‰ã§ã™ï¼Žã¾ãŸï¼Œå¾Œè¿°ã™ã‚‹ mkmf ライブラリã®ã„ãã¤
+ã‹ã®é–¢æ•°ãŒã‚³ãƒ³ãƒ‘イルをè¦ã™ã‚‹ãƒ†ã‚¹ãƒˆã®ãŸã‚ã«ã€Œconftest.cã€ã¨ã„
+ã†ãƒ•ァイルåを使用ã™ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„.ソースファイル
+åã¨ã—ã¦ã€Œconftest.cã€ã‚’使用ã—ã¦ã¯ãªã‚Šã¾ã›ã‚“.
+
+Rubyã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリをロードã™ã‚‹æ™‚ã«ã€ŒInit_ライブラリåã€ã¨
+ã„ã†é–¢æ•°ã‚’自動的ã«å®Ÿè¡Œã—ã¾ã™ï¼Ždbmライブラリã®å ´åˆã€ŒInit_dbmã€
+ã§ã™ï¼Žã“ã®é–¢æ•°ã®ä¸­ã§ã‚¯ãƒ©ã‚¹ï¼Œãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ï¼Œãƒ¡ã‚½ãƒƒãƒ‰ï¼Œå®šæ•°ãªã©ã®
+定義を行ã„ã¾ã™ï¼Ždbm.cã‹ã‚‰ä¸€éƒ¨å¼•用ã—ã¾ã™ï¼Ž
+
+ void
+ Init_dbm(void)
+ {
+ /* DBMクラスを定義ã™ã‚‹ */
+ VALUE cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBMã¯Enumerableモジュールをインクルードã™ã‚‹ */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBMクラスã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰open(): 引数ã¯Cã®é…列ã§å—ã‘ã‚‹ */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰close(): 引数ã¯ãªã— */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰[]: 引数ã¯1個 */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
+
+ /* DBMデータを格ç´ã™ã‚‹ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°åã®ãŸã‚ã®ID */
+ id_dbm = rb_intern("dbm");
+ }
+
+DBMライブラリã¯dbmã®ãƒ‡ãƒ¼ã‚¿ã¨å¯¾å¿œã™ã‚‹ã‚ªãƒ–ジェクトã«ãªã‚‹ã¯ãšã§
+ã™ã‹ã‚‰ï¼ŒCã®ä¸–界ã®dbmã‚’Rubyã®ä¸–界ã«å–り込む必è¦ãŒã‚りã¾ã™ï¼Ž
+
+dbm.cã§ã¯Data_Make_Structを以下ã®ã‚ˆã†ã«ä½¿ã£ã¦ã„ã¾ã™ï¼Ž
+
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
+
+ static const rb_data_type_t dbm_type = {
+ "dbm",
+ {0, free_dbm, memsize_dbm,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+ };
+
+ obj = TypedData_Make_Struct(klass, struct dbmdata, &dbm_type, dbmp);
+
+ã“ã“ã§ã¯dbmdata構造体ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã‚’Dataã«ã‚«ãƒ—セル化ã—ã¦ã„
+ã¾ã™ï¼ŽDBM*を直接カプセル化ã—ãªã„ã®ã¯close()ã—ãŸæ™‚ã®å‡¦ç†ã‚’考
+ãˆã¦ã®ã“ã¨ã§ã™ï¼Ž
+
+Dataオブジェクトã‹ã‚‰dbmstruct構造体ã®ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã™ãŸã‚
+ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’使ã£ã¦ã„ã¾ã™ï¼Ž
+
+ #define GetDBM(obj, dbmp) do {\
+ TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
+ if ((dbmp) == 0) closed_dbm();\
+ if ((dbmp)->di_dbm == 0) closed_dbm();\
+ } while (0)
+
+ã¡ã‚‡ã£ã¨è¤‡é›‘ãªãƒžã‚¯ãƒ­ã§ã™ãŒï¼Œè¦ã™ã‚‹ã«dbmdata構造体ã®ãƒã‚¤ãƒ³ã‚¿
+ã®å–り出ã—ã¨ï¼Œcloseã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ã®ãƒã‚§ãƒƒã‚¯ã‚’ã¾ã¨ã‚ã¦ã„
+ã‚‹ã ã‘ã§ã™ï¼Ž
+
+DBMクラスã«ã¯ãŸãã•んメソッドãŒã‚りã¾ã™ãŒï¼Œåˆ†é¡žã™ã‚‹ã¨3種類ã®
+引数ã®å—ã‘æ–¹ãŒã‚りã¾ã™ï¼Žã²ã¨ã¤ã¯å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚‚ã®ã§ï¼Œä¾‹ã¨
+ã—ã¦ã¯deleteメソッドãŒã‚りã¾ã™ï¼Ždeleteメソッドを実装ã—ã¦ã„ã‚‹
+fdbm_delete()ã¯ã“ã®ã‚ˆã†ã«ãªã£ã¦ã„ã¾ã™ï¼Ž
+
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
+
+å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚¿ã‚¤ãƒ—ã¯ç¬¬1引数ãŒself,第2引数以é™ãŒãƒ¡ã‚½ãƒƒãƒ‰
+ã®å¼•æ•°ã¨ãªã‚Šã¾ã™ï¼Ž
+
+å¼•æ•°ã®æ•°ãŒä¸å®šã®ã‚‚ã®ã¯Cã®é…列ã§å—ã‘ã‚‹ã‚‚ã®ã¨Rubyã®é…列ã§å—ã‘
+ã‚‹ã‚‚ã®ã¨ãŒã‚りã¾ã™ï¼Ždbmライブラリã®ä¸­ã§ï¼ŒCã®é…列ã§å—ã‘ã‚‹ã‚‚ã®
+ã¯DBMã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚‹open()ã§ã™ï¼Žã“れを実装ã—ã¦ã„ã‚‹é–¢
+æ•°fdbm_s_open()ã¯ã“ã†ãªã£ã¦ã„ã¾ã™ï¼Ž
+
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+
+ /* ... */
+ }
+
+ã“ã®ã‚¿ã‚¤ãƒ—ã®é–¢æ•°ã¯ç¬¬1引数ãŒä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ï¼Œç¬¬2引数ãŒä¸Žãˆ
+られãŸå¼•æ•°ã®å…¥ã£ã¦ã„ã‚‹é…列ã«ãªã‚Šã¾ã™ï¼Žselfã¯ç¬¬3引数ã¨ã—ã¦ä¸Ž
+ãˆã‚‰ã‚Œã¾ã™ï¼Ž
+
+ã“ã®é…列ã§ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã‚’è§£æžã™ã‚‹ãŸã‚ã®é–¢æ•°ãŒopen()ã§ã‚‚使ã‚
+れã¦ã„ã‚‹rb_scan_args()ã§ã™ï¼Žç¬¬3å¼•æ•°ã«æŒ‡å®šã—ãŸãƒ•ォーマットã«å¾“
+ã„,第4変数以é™ã«æŒ‡å®šã—ãŸVALUEã¸ã®å‚ç…§ã«å€¤ã‚’代入ã—ã¦ãれã¾
+ã™ï¼Ž
+
+引数をRubyã®é…列ã¨ã—ã¦å—ã‘å–るメソッドã®ä¾‹ã«ã¯
+Thread#initializeãŒã‚りã¾ã™ï¼Žå®Ÿè£…ã¯ã“ã†ã§ã™ï¼Ž
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
+
+第1引数ã¯self,第2引数ã¯Rubyã®é…列ã§ã™ï¼Ž
+
+*注æ„事項*
+
+Rubyã¨å…±æœ‰ã¯ã—ãªã„ãŒRubyã®ã‚ªãƒ–ジェクトを格ç´ã™ã‚‹å¯èƒ½æ€§ã®ã‚ã‚‹
+Cã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦Rubyインタプリタã«å¤‰æ•°ã®å­˜åœ¨
+ã‚’æ•™ãˆã¦ã‚ã’ã¦ãã ã•ã„.ã§ãªã„ã¨GCã§ãƒˆãƒ©ãƒ–ルを起ã“ã—ã¾ã™ï¼Ž
+
+ void rb_global_variable(VALUE *var)
+
+== extconf.rbを用æ„ã™ã‚‹
+
+Makefileを作る場åˆã®é››åž‹ã«ãªã‚‹extconf.rbã¨ã„ã†ãƒ•ァイルを作り
+ã¾ã™ï¼Žextconf.rbã¯ãƒ©ã‚¤ãƒ–ラリã®ã‚³ãƒ³ãƒ‘イルã«å¿…è¦ãªæ¡ä»¶ã®ãƒã‚§ãƒƒ
+クãªã©ã‚’行ã†ã“ã¨ãŒç›®çš„ã§ã™ï¼Žã¾ãšï¼Œ
+
+ require 'mkmf'
+
+ã‚’extconf.rbã®å…ˆé ­ã«ç½®ãã¾ã™ï¼Žextconf.rbã®ä¸­ã§ã¯ä»¥ä¸‹ã®Rubyé–¢
+数を使ã†ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Ž
+
+ 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: リンクã•れるオブジェクトファイルåã®ãƒªã‚¹ãƒˆ
+
+オブジェクトファイルã®ãƒªã‚¹ãƒˆã¯ï¼Œé€šå¸¸ã¯ã‚½ãƒ¼ã‚¹ãƒ•ァイルを検索ã—
+ã¦è‡ªå‹•çš„ã«ç”Ÿæˆã•れã¾ã™ãŒï¼Œmakeã®é€”中ã§ã‚½ãƒ¼ã‚¹ã‚’生æˆã™ã‚‹ã‚ˆã†ãª
+å ´åˆã¯æ˜Žç¤ºçš„ã«æŒ‡å®šã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
+
+ライブラリをコンパイルã™ã‚‹æ¡ä»¶ãŒæƒã‚ãšï¼Œãã®ãƒ©ã‚¤ãƒ–ラリをコン
+パイルã—ãªã„時ã«ã¯create_makefileを呼ã°ãªã‘れã°Makefileã¯ç”Ÿ
+æˆã•れãšï¼Œã‚³ãƒ³ãƒ‘イルも行ã‚れã¾ã›ã‚“.
+
+== dependを用æ„ã™ã‚‹
+
+ã‚‚ã—,ディレクトリã«dependã¨ã„ã†ãƒ•ァイルãŒå­˜åœ¨ã™ã‚Œã°ï¼Œ
+MakefileãŒä¾å­˜é–¢ä¿‚ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¦ãれã¾ã™ï¼Ž
+
+ % gcc -MM *.c > depend
+
+ãªã©ã§ä½œã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã‚ã£ã¦æã¯ç„¡ã„ã§ã—ょã†ï¼Ž
+
+== Makefileを生æˆã™ã‚‹
+
+Makefileを実際ã«ç”Ÿæˆã™ã‚‹ãŸã‚ã«ã¯
+
+ ruby extconf.rb
+
+ã¨ã—ã¾ã™ï¼Žextconf.rbã« require 'mkmf' ã®è¡ŒãŒãªã„å ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼
+ã«ãªã‚Šã¾ã™ã®ã§ï¼Œå¼•数を追加ã—ã¦
+
+ ruby -r mkmf extconf.rb
+
+ã¨ã—ã¦ãã ã•ã„.
+
+site_ruby ディレクトリã§ãªã,
+vendor_ruby ディレクトリã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã™ã‚‹å ´åˆã«ã¯
+以下ã®ã‚ˆã†ã« --vendor オプションを加ãˆã¦ãã ã•ã„.
+
+ ruby extconf.rb --vendor
+
+ディレクトリをext以下ã«ç”¨æ„ã—ãŸå ´åˆã«ã¯Ruby全体ã®makeã®æ™‚ã«
+自動的ã«MakefileãŒç”Ÿæˆã•れã¾ã™ã®ã§ï¼Œã“ã®ã‚¹ãƒ†ãƒƒãƒ—ã¯ä¸è¦ã§ã™ï¼Ž
+
+== makeã™ã‚‹
+
+動的リンクライブラリを生æˆã™ã‚‹å ´åˆã«ã¯ãã®å ´ã§makeã—ã¦ãã ã•
+ã„.必è¦ã§ã‚れ㰠make install ã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¾ã™ï¼Ž
+
+ext以下ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’用æ„ã—ãŸå ´åˆã¯ï¼ŒRubyã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§
+makeを実行ã™ã‚‹ã¨Makefileを生æˆã‹ã‚‰make,必è¦ã«ã‚ˆã£ã¦ã¯ãã®ãƒ¢
+ジュールã®Rubyã¸ã®ãƒªãƒ³ã‚¯ã¾ã§è‡ªå‹•çš„ã«å®Ÿè¡Œã—ã¦ãれã¾ã™ï¼Ž
+extconf.rbã‚’æ›¸ãæ›ãˆã‚‹ãªã©ã—ã¦Makefileã®å†ç”ŸæˆãŒå¿…è¦ãªæ™‚ã¯ã¾
+ãŸRubyディレクトリã§makeã—ã¦ãã ã•ã„.
+
+拡張ライブラリã¯make installã§Rubyライブラリã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®
+下ã«ã‚³ãƒ”ーã•れã¾ã™ï¼Žã‚‚ã—æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨å”調ã—ã¦ä½¿ã†Rubyã§è¨˜
+è¿°ã•れãŸãƒ—ログラムãŒã‚り,Rubyライブラリã«ç½®ããŸã„å ´åˆã«ã¯ï¼Œ
+拡張ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ã« lib ã¨ã„ã†ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª
+を作り,ãã“ã« æ‹¡å¼µå­ .rb ã®ãƒ•ァイルを置ã„ã¦ãŠã‘ã°åŒæ™‚ã«ã‚¤ãƒ³
+ストールã•れã¾ã™ï¼Ž
+
+== デãƒãƒƒã‚°
+
+ã¾ã‚,デãƒãƒƒã‚°ã—ãªã„ã¨å‹•ã‹ãªã„ã§ã—ょã†ã­ï¼Žext/Setupã«ãƒ‡ã‚£ãƒ¬
+クトリåを書ãã¨é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹ã®ã§ãƒ‡ãƒãƒƒã‚¬ãŒä½¿ãˆã‚‹ã‚ˆã†ã«ãª
+りã¾ã™ï¼Žãã®åˆ†ã‚³ãƒ³ãƒ‘イルãŒé…ããªã‚Šã¾ã™ã‘ã©ï¼Ž
+
+== ã§ãã‚ãŒã‚Š
+
+後ã¯ã“ã£ãり使ã†ãªã‚Šï¼Œåºƒã公開ã™ã‚‹ãªã‚Šï¼Œå£²ã‚‹ãªã‚Šï¼Œã”自由ã«ãŠ
+使ã„ãã ã•ã„.Rubyã®ä½œè€…ã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«é–¢ã—ã¦ä¸€åˆ‡ã®æ¨©åˆ©ã‚’
+主張ã—ã¾ã›ã‚“.
+
+= Appendix A. Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®åˆ†é¡ž
+
+Rubyã®ã‚½ãƒ¼ã‚¹ã¯ã„ãã¤ã‹ã«åˆ†é¡žã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã“ã®ã†ã¡ã‚¯ãƒ©
+スライブラリã®éƒ¨åˆ†ã¯åŸºæœ¬çš„ã«æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨åŒã˜ä½œã‚Šæ–¹ã«ãªã£
+ã¦ã„ã¾ã™ï¼Žã“れらã®ã‚½ãƒ¼ã‚¹ã¯ä»Šã¾ã§ã®èª¬æ˜Žã§ã»ã¨ã‚“ã©ç†è§£ã§ãã‚‹ã¨
+æ€ã„ã¾ã™ï¼Ž
+
+== Ruby言語ã®ã‚³ã‚¢
+
+class.c :: クラスã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«
+error.c :: 例外クラスã¨ä¾‹å¤–機構
+gc.c :: 記憶領域管ç†
+load.c :: ライブラリã®ãƒ­ãƒ¼ãƒ‰
+object.c :: オブジェクト
+variable.c :: 変数ã¨å®šæ•°
+
+== Rubyã®æ§‹æ–‡è§£æžå™¨
+
+parse.y :: å­—å¥è§£æžå™¨ã¨æ§‹æ–‡å®šç¾©
+parse.c :: 自動生æˆ
+defs/keywords :: 予約語
+lex.c :: 自動生æˆ
+
+== 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 : åŒä¸Š
+ vm.c
+ vm_dump.c
+ vm_eval.c
+ vm_exec.c
+ vm_insnhelper.c
+ vm_method.c
+
+ defs/opt_insns_unif.def : 命令èžåˆ
+ defs/opt_operand.def : 最é©åŒ–ã®ãŸã‚ã®å®šç¾©
+
+ -> insn*.inc : 自動生æˆ
+ -> opt*.inc : 自動生æˆ
+ -> vm.inc : 自動生æˆ
+
+== æ­£è¦è¡¨ç¾ã‚¨ãƒ³ã‚¸ãƒ³ (鬼車)
+
+ regex.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== ユーティリティ関数
+
+debug.c :: Cデãƒãƒƒã‚¬ç”¨ã®ãƒ‡ãƒãƒƒã‚°ã‚·ãƒ³ãƒœãƒ«
+dln.c :: 動的ローディング
+st.c :: 汎用ãƒãƒƒã‚·ãƒ¥è¡¨
+strftime.c :: 時刻整形
+util.c :: ãã®ä»–ã®ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£
+
+== Rubyコマンドã®å®Ÿè£…
+
+ dmyext.c
+ dmydln.c
+ dmyencoding.c
+ id.c
+ inits.c
+ main.c
+ ruby.c
+ version.c
+
+ gem_prelude.rb
+ prelude.rb
+
+== クラスライブラリ
+
+array.c :: Array
+bignum.c :: Bignum
+compar.c :: Comparable
+complex.c :: Complex
+cont.c :: Fiber, Continuation
+dir.c :: Dir
+enum.c :: Enumerable
+enumerator.c :: Enumerator
+file.c :: File
+hash.c :: Hash
+io.c :: IO
+marshal.c :: Marshal
+math.c :: Math
+numeric.c :: Numeric, Integer, Fixnum, Float
+pack.c :: Array#pack, String#unpack
+proc.c :: Binding, Proc
+process.c :: Process
+random.c :: 乱数
+range.c :: Range
+rational.c :: Rational
+re.c :: Regexp, MatchData
+signal.c :: Signal
+sprintf.c :: String#sprintf
+string.c :: String
+struct.c :: Struct
+time.c :: Time
+
+defs/known_errors.def :: 例外クラス Errno::*
+-> known_errors.inc :: 自動生æˆ
+
+== 多言語化
+
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: エンコーディングクラス群
+enc/trans/* :: コードãƒã‚¤ãƒ³ãƒˆå¯¾å¿œè¡¨
+
+== gorubyコマンドã®å®Ÿè£…
+
+ goruby.c
+ golf_prelude.rb : goruby固有ã®ãƒ©ã‚¤ãƒ–ラリ
+ -> golf_prelude.c : 自動生æˆ
+
+= Appendix B. 拡張用関数リファレンス
+
+C言語ã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’利用ã™ã‚‹APIã¯ä»¥ä¸‹ã®é€šã‚Šã§ã‚る.
+
+== åž‹
+
+VALUE ::
+
+ Rubyオブジェクトを表ç¾ã™ã‚‹åž‹ï¼Žå¿…è¦ã«å¿œã˜ã¦ã‚­ãƒ£ã‚¹ãƒˆã—ã¦ç”¨ã„る.
+ 組ã¿è¾¼ã¿åž‹ã‚’表ç¾ã™ã‚‹Cã®åž‹ã¯ruby.hã«è¨˜è¿°ã—ã¦ã‚ã‚‹Rã§å§‹ã¾ã‚‹æ§‹é€ 
+ 体ã§ã‚る.VALUE型をã“れらã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ãŸã‚ã«Rã§å§‹ã¾ã‚‹æ§‹é€ ä½“
+ åã‚’å…¨ã¦å¤§æ–‡å­—ã«ã—ãŸåå‰ã®ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„る.
+
+== 変数・定数
+
+Qnil ::
+
+ 定数: nilオブジェクト
+
+Qtrue ::
+
+ 定数: trueオブジェクト(真ã®ãƒ‡ãƒ•ォルト値)
+
+Qfalse ::
+
+ 定数: falseオブジェクト
+
+== Cデータã®ã‚«ãƒ—セル化
+
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
+
+ Cã®ä»»æ„ã®ãƒã‚¤ãƒ³ã‚¿ã‚’カプセル化ã—ãŸRubyオブジェクトを返ã™ï¼Žã“
+ ã®ãƒã‚¤ãƒ³ã‚¿ãŒRubyã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã•れãªããªã£ãŸæ™‚,freeã§æŒ‡å®šã—ãŸ
+ 関数ãŒå‘¼ã°ã‚Œã‚‹ï¼Žã¾ãŸï¼Œã“ã®ãƒã‚¤ãƒ³ã‚¿ã®æŒ‡ã™ãƒ‡ãƒ¼ã‚¿ãŒä»–ã®Rubyオブ
+ ジェクトを指ã—ã¦ã„ã‚‹å ´åˆï¼Œmarkã«æŒ‡å®šã™ã‚‹é–¢æ•°ã§ãƒžãƒ¼ã‚¯ã™ã‚‹å¿…è¦
+ ãŒã‚る.
+
+Data_Make_Struct(klass, type, mark, free, sval) ::
+
+ typeåž‹ã®ãƒ¡ãƒ¢ãƒªã‚’mallocã—,変数svalã«ä»£å…¥ã—ãŸå¾Œï¼Œãれをカプセ
+ ル化ã—ãŸãƒ‡ãƒ¼ã‚¿ã‚’è¿”ã™ãƒžã‚¯ãƒ­ï¼Ž
+
+Data_Get_Struct(data, type, sval) ::
+
+ dataã‹ã‚‰typeåž‹ã®ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã—変数svalã«ä»£å…¥ã™ã‚‹ãƒžã‚¯ãƒ­ï¼Ž
+
+== åž‹ãƒã‚§ãƒƒã‚¯
+
+ TYPE(value)
+ FIXNUM_P(value)
+ NIL_P(value)
+ void Check_Type(VALUE value, int type)
+ SafeStringValue(value)
+
+== 型変æ›
+
+ FIX2INT(value), INT2FIX(i)
+ FIX2LONG(value), LONG2FIX(l)
+ NUM2INT(value), INT2NUM(i)
+ NUM2UINT(value), UINT2NUM(ui)
+ NUM2LONG(value), LONG2NUM(l)
+ NUM2ULONG(value), ULONG2NUM(ul)
+ NUM2LL(value), LL2NUM(ll)
+ NUM2ULL(value), ULL2NUM(ull)
+ NUM2OFFT(value), OFFT2NUM(off)
+ NUM2SIZET(value), SIZET2NUM(size)
+ NUM2SSIZET(value), SSIZET2NUM(ssize)
+ rb_integer_pack(value, words, numwords, wordsize, nails, flags), rb_integer_unpack(words, numwords, wordsize, nails, flags)
+ NUM2DBL(value)
+ rb_float_new(f)
+ RSTRING_LEN(str)
+ RSTRING_PTR(str)
+ StringValue(value)
+ StringValuePtr(value)
+ StringValueCStr(value)
+ rb_str_new2(s)
+
+== クラス/モジュール定義
+
+VALUE rb_define_class(const char *name, VALUE super) ::
+
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã™ã‚‹ï¼Ž
+
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
+
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã—,moduleã®
+ 定数ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
+
+VALUE rb_define_module(const char *name) ::
+
+ æ–°ã—ã„Rubyモジュールを定義ã™ã‚‹ï¼Ž
+
+VALUE rb_define_module_under(VALUE module, const char *name) ::
+
+ æ–°ã—ã„Rubyモジュールを定義ã—,moduleã®å®šæ•°ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
+
+void rb_include_module(VALUE klass, VALUE module) ::
+
+ モジュールをインクルードã™ã‚‹ï¼ŽclassãŒã™ã§ã«moduleをインク
+ ルードã—ã¦ã„る時ã«ã¯ä½•ã‚‚ã—ãªã„(多é‡ã‚¤ãƒ³ã‚¯ãƒ«ãƒ¼ãƒ‰ã®ç¦æ­¢).
+
+void rb_extend_object(VALUE object, VALUE module) ::
+
+ オブジェクトをモジュール(ã§å®šç¾©ã•れã¦ã„るメソッド)ã§æ‹¡å¼µã™ã‚‹ï¼Ž
+
+== 大域変数定義
+
+void rb_define_variable(const char *name, VALUE *var) ::
+
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°åãŒ`$'ã§
+ å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れる.nameã¨ã—ã¦Rubyã®è­˜åˆ¥å­
+ ã¨ã—ã¦è¨±ã•れãªã„文字(例ãˆã°` ')ã‚’å«ã‚€å ´åˆã«ã¯Rubyプログラ
+ ムã‹ã‚‰ã¯è¦‹ãˆãªããªã‚‹ï¼Ž
+
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
+
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹read onlyã®ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Ž
+ read onlyã§ã‚ã‚‹ã“ã¨ä»¥å¤–ã¯rb_define_variable()ã¨åŒã˜ï¼Ž
+
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
+
+ 関数ã«ã‚ˆã£ã¦å®Ÿç¾ã•れるRuby変数を定義ã™ã‚‹ï¼Žå¤‰æ•°ãŒå‚ç…§ã•れãŸ
+ 時ã«ã¯getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œ
+ る.
+
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
+
+ 関数ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°
+ ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯getterãŒï¼Œé–¢æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯
+ setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žgetterã‚„setterã«0を指定ã—ãŸæ™‚ã«ã¯hookã‚’
+ 指定ã—ãªã„ã®ã¨åŒã˜äº‹ã«ãªã‚‹ï¼Ž
+
+void rb_global_variable(VALUE *var) ::
+
+ 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) ::
+
+ メソッドを定義ã™ã‚‹ï¼Ž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()ã¨åŒã˜ï¼Ž
+
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ 特異メソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
+
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
+
+ argc, argvå½¢å¼ã§ä¸Žãˆã‚‰ã‚ŒãŸæŒ‡å®šã•れãŸãƒ•ォーマットã«å¾“ã£ã¦å¼•
+ 数を分解ã—,続ãVALUEã¸ã®å‚ç…§ã«ã‚»ãƒƒãƒˆã—ã¾ã™ï¼Žã“ã®ãƒ•ォーマッ
+ トã¯ï¼ŒABNFã§è¨˜è¿°ã™ã‚‹ã¨ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
+
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
+
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ 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 := "&" ; イテレータブロックをå–å¾—ã™ã‚‹ãŸã‚ã®
+ ; 指定
+
+ フォーマットãŒ"12"ã®å ´åˆï¼Œå¼•æ•°ã¯æœ€ä½Ž1ã¤ã§ï¼Œ3ã¤(1+2)ã¾ã§è¨±ã•
+ れるã¨ã„ã†æ„味ã«ãªã‚Šã¾ã™ï¼Žå¾“ã£ã¦ï¼Œãƒ•ォーマット文字列ã«ç¶šã„
+ ã¦3ã¤ã®VALUEã¸ã®å‚ç…§ã‚’ç½®ãå¿…è¦ãŒã‚りã¾ã™ï¼Žãれらã«ã¯å–å¾—ã—ãŸ
+ 変数ãŒã‚»ãƒƒãƒˆã•れã¾ã™ï¼Žå¤‰æ•°ã¸ã®å‚ç…§ã®ä»£ã‚りã«NULLを指定ã™ã‚‹
+ ã“ã¨ã‚‚ã§ã,ãã®å ´åˆã¯å–å¾—ã—ãŸå¼•æ•°ã®å€¤ã¯æ¨ã¦ã‚‰ã‚Œã¾ã™ï¼ŽãªãŠï¼Œ
+ çœç•¥å¯èƒ½å¼•æ•°ãŒçœç•¥ã•ã‚ŒãŸæ™‚ã®å¤‰æ•°ã®å€¤ã¯nil(C言語ã®ãƒ¬ãƒ™ãƒ«ã§ã¯
+ Qnil)ã«ãªã‚Šã¾ã™ï¼Ž
+
+ 返り値ã¯ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ã§ã™ï¼Žã‚ªãƒ—ションãƒãƒƒã‚·ãƒ¥ãŠã‚ˆã³ã‚¤
+ ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯ã¯æ•°ãˆã¾ã›ã‚“.
+
+int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values) ::
+
+ ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã§æŒ‡å®šã•れãŸå€¤ã‚’tableã«ã—ãŸãŒã£ã¦å–り出ã—ã¾ã™ï¼Ž
+ tableã®æœ€åˆã®required個ã®IDã¯å¿…須キーワードを表ã—,続ã
+ optional (optionalãŒè² ã®å ´åˆã¯-optional-1) 個ã®IDã¯çœç•¥å¯èƒ½
+ キーワードã§ã™ï¼Žå¿…須キーワードãŒkeyword_hash中ã«ãªã„å ´åˆï¼Œ
+ "missing keyword"ArgumentErrorãŒç™ºç”Ÿã—ã¾ã™ï¼Žçœç•¥å¯èƒ½ã‚­ãƒ¼ãƒ¯ãƒ¼
+ ドãŒãªã„å ´åˆã¯ï¼Œvalues中ã®å¯¾å¿œã™ã‚‹è¦ç´ ã«ã¯QundefãŒã‚»ãƒƒãƒˆã•れ
+ ã¾ã™ï¼Žkeyword_hashã«ä½¿ç”¨ã•れãªã„è¦ç´ ãŒã‚ã‚‹å ´åˆã¯ï¼ŒoptionalãŒ
+ è² ãªã‚‰ç„¡è¦–ã•れã¾ã™ãŒï¼Œãã†ã§ãªã‘れã°"unknown keyword"
+ ArgumentErrorãŒç™ºç”Ÿã—ã¾ã™ï¼Ž
+
+VALUE rb_extract_keywords(VALUE *original_hash) ::
+
+ original_hashã§å‚ç…§ã•れるHashオブジェクトã‹ã‚‰ï¼ŒSymbolã§ã‚ã‚‹
+ キーã¨ãã®å€¤ã‚’æ–°ã—ã„Hashã«å–り出ã—ã¾ã™ï¼Žoriginal_hashã®æŒ‡ã™
+ å…ˆã«ã¯ï¼Œå…ƒã®HashãŒSymbol以外ã®ã‚­ãƒ¼ã‚’å«ã‚“ã§ã„ãŸå ´åˆã¯ãれらãŒ
+ コピーã•れãŸåˆ¥ã®æ–°ã—ã„Hash,ãã†ã§ãªã‘れã°0ãŒä¿å­˜ã•れã¾ã™ï¼Ž
+
+== Rubyメソッド呼ã³å‡ºã—
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ メソッド呼ã³å‡ºã—.文字列ã‹ã‚‰midã‚’å¾—ã‚‹ãŸã‚ã«ã¯rb_intern()ã‚’
+ 使ã†ï¼Ž
+ private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼ã³å‡ºã—.引数をargc, argvå½¢å¼ã§æ¸¡ã™ï¼Ž
+ private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
+
+VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼ã³å‡ºã—.
+ publicãªãƒ¡ã‚½ãƒƒãƒ‰ã—ã‹å‘¼ã¹ãªã„.
+
+VALUE rb_eval_string(const char *str) ::
+
+ 文字列をRubyスクリプトã¨ã—ã¦ã‚³ãƒ³ãƒ‘イル・実行ã™ã‚‹ï¼Ž
+
+ID rb_intern(const char *name) ::
+
+ 文字列ã«å¯¾å¿œã™ã‚‹IDã‚’è¿”ã™ï¼Ž
+
+char *rb_id2name(ID id) ::
+
+ IDã«å¯¾å¿œã™ã‚‹æ–‡å­—列を返ã™(デãƒãƒƒã‚°ç”¨).
+
+char *rb_class2name(VALUE klass) ::
+
+ クラスã®åå‰ã‚’è¿”ã™(デãƒãƒƒã‚°ç”¨).クラスãŒåå‰ã‚’æŒãŸãªã„時ã«
+ ã¯, 祖先をé¡ã£ã¦åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹ã®åå‰ã‚’è¿”ã™ï¼Ž
+
+int rb_respond_to(VALUE obj, ID id) ::
+
+ objãŒidã§ç¤ºã•れるメソッドをæŒã¤ã‹ã©ã†ã‹ã‚’è¿”ã™ï¼Ž
+
+== インスタンス変数
+
+VALUE rb_iv_get(VALUE obj, const char *name) ::
+
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã®å€¤ã‚’得る.`@'ã§å§‹ã¾ã‚‰ãªã„インスタン
+ ス変数㯠Rubyプログラムã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã„「隠れãŸã€ã‚¤ãƒ³
+ スタンス変数ã«ãªã‚‹ï¼Žå®šæ•°ã¯å¤§æ–‡å­—ã®åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹(ã¾ãŸã¯
+ モジュール)ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã¨ã—ã¦å®Ÿè£…ã•れã¦ã„る.
+
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
+
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’valã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼Ž
+
+== 制御構造
+
+VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
+
+ 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引数ã«ã‚¤ãƒ†ãƒ¬ãƒ¼
+ ã‚¿ã‹ã‚‰ä¸Žãˆã‚‰ã‚ŒãŸå€¤, 第2引数ã«arg2ãŒæ¸¡ã•れる.
+
+ 1.9ã§rb_iterateを使ã†å ´åˆã¯, func1ã®ä¸­ã§Rubyレベルã®ãƒ¡ã‚½ãƒƒãƒ‰
+ を呼ã³å‡ºã•ãªã‘れã°ãªã‚‰ãªã„.
+ 1.9ã§obsoleteã¨ãªã£ãŸ. 代ã‚りã«rb_block_callãŒç”¨æ„ã•れãŸ.
+
+VALUE rb_yield(VALUE val) ::
+
+ valを値ã¨ã—ã¦ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ロックを呼ã³å‡ºã™ï¼Ž
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1ã‚’arg1を引数ã«å‘¼ã³å‡ºã™ï¼Žfunc1ã®å®Ÿè¡Œä¸­ã«ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãŸæ™‚ã«ã¯ func2ã‚’arg2を引数ã¨ã—ã¦å‘¼ã¶ï¼Žæˆ»ã‚Šå€¤ã¯ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãªã‹ã£ãŸæ™‚ã¯func1ã®æˆ»ã‚Šå€¤, 例外ãŒç™ºç”Ÿã—ãŸæ™‚ã«ã¯func2ã®æˆ»
+ り値ã§ã‚る.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1ã‚’arg1を引数ã¨ã—ã¦å®Ÿè¡Œã—, 実行終了後(ãŸã¨ãˆä¾‹å¤–ãŒ
+ 発生ã—ã¦ã‚‚) func2ã‚’arg2を引数ã¨ã—ã¦å®Ÿè¡Œã™ã‚‹ï¼Žæˆ»ã‚Šå€¤ã¯func1
+ ã®æˆ»ã‚Šå€¤ã§ã‚ã‚‹(例外ãŒç™ºç”Ÿã—ãŸæ™‚ã¯æˆ»ã‚‰ãªã„).
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ 関数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ã¯ãれらã®é–¢æ•°ã‹ã‚‰è¿”ã•れãŸå€¤ã§ãªã‘れã°ãªã‚‰ãªã„.
+ ã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+void rb_iter_break() ::
+
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックを終了ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡º
+ ã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+void rb_iter_break_value(VALUE value) ::
+
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックをvalueã§çµ‚了ã™ã‚‹ï¼Žãƒ–ロックã¯å¼•æ•°ã§
+ 与ãˆã‚‰ã‚ŒãŸvalueã‚’è¿”ã™ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+== 例外・エラー
+
+void rb_warning(const char *fmt, ...) ::
+
+ rb_verboseæ™‚ã«æ¨™æº–エラー出力ã«è­¦å‘Šæƒ…報を表示ã™ã‚‹ï¼Žå¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
+
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
+
+ RuntimeError例外を発生ã•ã›ã‚‹ï¼Žå¼•æ•°ã¯printf()ã¨åŒã˜ï¼Ž
+
+void rb_raise(VALUE exception, const char *fmt, ...) ::
+
+ exceptionã§æŒ‡å®šã—ãŸä¾‹å¤–を発生ã•ã›ã‚‹ï¼Žfmt以下ã®å¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
+
+void rb_fatal(const char *fmt, ...) ::
+
+ 致命的例外を発生ã•ã›ã‚‹ï¼Žé€šå¸¸ã®ä¾‹å¤–処ç†ã¯è¡Œãªã‚れãš, インター
+ プリタãŒçµ‚了ã™ã‚‹(ãŸã ã—ensureã§æŒ‡å®šã•れãŸã‚³ãƒ¼ãƒ‰ã¯çµ‚了å‰ã«
+ 実行ã•れる).
+
+void rb_bug(const char *fmt, ...) ::
+
+ インタープリタãªã©ãƒ—ログラムã®ãƒã‚°ã§ã—ã‹ç™ºç”Ÿã™ã‚‹ã¯ãšã®ãªã„
+ 状æ³ã®æ™‚呼ã¶ï¼Žã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã¯ã‚³ã‚¢ãƒ€ãƒ³ãƒ—ã—ç›´ã¡ã«çµ‚了ã™ã‚‹ï¼Ž
+ 例外処ç†ã¯ä¸€åˆ‡è¡Œãªã‚れãªã„.
+
+注æ„: "%"PRIsVALUEãŒObject#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã¨
+ãã¯Object#inspect)を使ã£ãŸVALUEã®å‡ºåŠ›ã«åˆ©ç”¨ã§ãる.ã“れã¯
+"%i"ã¨è¡çªã™ã‚‹ãŸã‚,整数ã«ã¯"%d"を使用ã™ã‚‹ã“ã¨ï¼Ž
+
+== Rubyã®åˆæœŸåŒ–・実行
+
+Rubyをアプリケーションã«åŸ‹ã‚込む場åˆã«ã¯ä»¥ä¸‹ã®ã‚¤ãƒ³ã‚¿ãƒ•ェース
+を使ã†ï¼Žé€šå¸¸ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¯å¿…è¦ãªã„.
+
+void ruby_init() ::
+
+ Rubyインタプリタã®åˆæœŸåŒ–を行ãªã†ï¼Ž
+
+void *ruby_options(int argc, char **argv) ::
+
+ Rubyインタプリタã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³å¼•æ•°ã®å‡¦ç†ã‚’行ãªã„,
+ Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’コンパイルã™ã‚‹ï¼Ž
+ コンパイルã•れãŸã‚½ãƒ¼ã‚¹ã¸ã®ãƒã‚¤ãƒ³ã‚¿ï¼Œã‚‚ã—ãã¯ç‰¹æ®Šå€¤ã‚’è¿”ã™.
+
+int ruby_run_node(void *n) ::
+
+ コンパイルã•れãŸã‚³ãƒ¼ãƒ‰ã‚’実行ã™ã‚‹ï¼Ž
+ å®Ÿè¡Œã«æˆåŠŸã—ãŸå ´åˆã¯EXIT_SUCCESSを,エラーãŒèµ·ã“ã£ãŸã¨ãã¯ãれ以外を返ã™ï¼Ž
+
+void ruby_script(char *name) ::
+
+ Rubyã®ã‚¹ã‚¯ãƒªãƒ—トå($0)を設定ã™ã‚‹ï¼Ž
+
+== インタプリタã®ã‚¤ãƒ™ãƒ³ãƒˆã®ãƒ•ック
+
+void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data) ::
+
+ 指定ã•れãŸã‚¤ãƒ³ã‚¿ãƒ—リタã®ã‚¤ãƒ™ãƒ³ãƒˆã«å¯¾ã™ã‚‹ãƒ•ック関数を追加ã—ã¾ã™ï¼Ž
+ eventsã¯ä»¥ä¸‹ã®å€¤ã®orã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“:
+
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
+
+ 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 ã‚‚å‚ç…§ã—ã¦ãã ã•ã„.
+
+int rb_remove_event_hook(rb_event_hook_func_t func) ::
+
+ 指定ã•れãŸãƒ•ック関数を削除ã—ã¾ã™ï¼Ž
+
+== äº’æ›æ€§ã®ãŸã‚ã®ãƒžã‚¯ãƒ­
+
+APIã®äº’æ›æ€§ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ãŸã‚ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ãŒãƒ‡ãƒ•ォルトã§å®šç¾©ã•れã¦ã„ã¾ã™ï¼Ž
+
+NORETURN_STYLE_NEW ::
+
+ NORETURN マクロãŒé–¢æ•°åž‹ãƒžã‚¯ãƒ­ã¨ã—ã¦å®šç¾©ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+HAVE_RB_DEFINE_ALLOC_FUNC ::
+
+ 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() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+ have_func("rb_reg_new_str", "ruby.h").
+ ã®çµæžœã¨åŒã˜ï¼Ž
+
+HAVE_RB_IO_T ::
+
+ rb_io_t åž‹ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+USE_SYMBOL_AS_METHOD_NAME ::
+
+ メソッドåã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼ŒModule#methods, \#singleton_methods
+ ãªã©ãŒSymbolã‚’è¿”ã™ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+HAVE_RUBY_*_H ::
+
+ ruby.h ã§å®šç¾©ã•れã¦ã„る.対応ã™ã‚‹ãƒ˜ãƒƒãƒ€ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨
+ ã‚’æ„味ã™ã‚‹ï¼ŽãŸã¨ãˆã°ï¼ŒHAVE_RUBY_ST_H ãŒå®šç¾©ã•れã¦ã„ã‚‹å ´åˆã¯
+ å˜ãªã‚‹ st.h ã§ã¯ãªã ruby/st.h を使用ã™ã‚‹ï¼Ž
+
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
+
+ rb_add_event_hook() ãŒãƒ•ãƒƒã‚¯é–¢æ•°ã«æ¸¡ã™ data を第3引数ã¨ã—ã¦
+ å—ã‘å–ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+= Appendix C. extconf.rbã§ä½¿ãˆã‚‹é–¢æ•°ãŸã¡
+
+extconf.rbã®ä¸­ã§ã¯åˆ©ç”¨å¯èƒ½ãªã‚³ãƒ³ãƒ‘イルæ¡ä»¶ãƒã‚§ãƒƒã‚¯ã®é–¢æ•°ã¯ä»¥
+下ã®é€šã‚Šã§ã‚る.
+
+have_macro(macro, headers) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦ãƒžã‚¯ãƒ­macroãŒå®šç¾©ã•
+ れã¦ã„ã‚‹ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„る時true
+ ã‚’è¿”ã™ï¼Ž
+
+have_library(lib, func) ::
+
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Ž
+ ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«è¿½åŠ ã—,trueã‚’è¿”ã™ï¼Ž
+
+find_library(lib, func, path...) ::
+
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ -Lpath を追加
+ ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«
+ 追加ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_func(func, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦é–¢æ•°funcã®å­˜åœ¨ã‚’ãƒã‚§
+ ックã™ã‚‹ï¼ŽfuncãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§
+ ã‚る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠ
+ ã事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{FUNC}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_var(var, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦å¤‰æ•°varã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒ
+ クã™ã‚‹ï¼ŽvarãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§ã‚
+ る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠã
+ 事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{VAR}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_header(header) ::
+
+ ヘッダファイルã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ
+ プリプロセッサマクロ `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+ (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
+
+find_header(header, path...) ::
+
+ ヘッダファイルheaderã®å­˜åœ¨ã‚’ -Ipath を追加ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯
+ ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+ (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
+
+have_struct_member(type, member[, header[, opt]]) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå®šç¾©ã•れ,
+ ãªãŠã‹ã¤ãƒ¡ãƒ³ãƒmemberãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«
+ æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ `HAVE_{TYPE}_{MEMBER}` ã‚’
+ 定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_type(type, header, opt) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’
+ ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_TYPE_{TYPE}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+check_sizeof(type, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeã®charå˜ä½ã‚µã‚¤
+ ズを調ã¹ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `SIZEOF_{TYPE}` を定義ã—,ãã®ã‚µã‚¤ã‚ºã‚’è¿”ã™ï¼Žå®šç¾©ã•れã¦ã„ãª
+ ã„ã¨ãã¯nilã‚’è¿”ã™ï¼Ž
+
+create_makefile(target[, target_prefix]) ::
+
+ 拡張ライブラリ用ã®Makefileを生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã‚’呼ã°ãªã‘れ
+ ã°ãã®ãƒ©ã‚¤ãƒ–ラリã¯ã‚³ãƒ³ãƒ‘イルã•れãªã„.targetã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«å
+ を表ã™ï¼Ž
+
+find_executable(command, path) ::
+
+ コマンドcommandã‚’File::PATH_SEPARATORã§åŒºåˆ‡ã‚‰ã‚ŒãŸãƒ‘スåã®
+ リストpathã‹ã‚‰æŽ¢ã™ï¼ŽpathãŒnilã¾ãŸã¯çœç•¥ã•れãŸå ´åˆã¯ï¼Œç’°å¢ƒ
+ 変数PATHã®å€¤ã‚’使用ã™ã‚‹ï¼Žå®Ÿè¡Œå¯èƒ½ãªã‚³ãƒžãƒ³ãƒ‰ãŒè¦‹ã¤ã‹ã£ãŸå ´åˆ
+ ã¯ãƒ‘スをå«ã‚€ãƒ•ァイルå,見ã¤ã‹ã‚‰ãªã‹ã£ãŸå ´åˆã¯nilã‚’è¿”ã™ï¼Ž
+
+with_config(withval[, default=nil]) ::
+
+ コマンドライン上ã®--with-<withval>ã§æŒ‡å®šã•れãŸã‚ªãƒ—ション値
+ を得る.
+
+enable_config(config, *defaults) ::
+disable_config(config, *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>-include=/path/include --with-<target>-lib=/path/lib
+ ã¨ç­‰ä¾¡ã§ã‚る.追加ã•れ㟠include ディレクトリ㨠lib ディレ
+ クトリã®é…列を返ã™ï¼Ž ([include_dir, lib_dir])
+
+pkg_config(pkg, option=nil) ::
+
+ pkg-configコマンドã‹ã‚‰ãƒ‘ッケージpkgã®æƒ…報を [cflags, ldflags, libs]
+ ã®é…列ã¨ã—ã¦å¾—る.$CFLAGS, $LDFLAGS, $libs ã«ã¯ãれãžã‚Œã®å€¤ãŒ
+ 追加ã•れる.
+
+ pkg-configã®å®Ÿéš›ã®ã‚³ãƒžãƒ³ãƒ‰ã¯ï¼Œä»¥ä¸‹ã®é †ã§è©¦ã•れる.
+
+ 1. コマンドラインã§--with-{pkg}-config={command}オプションãŒ
+ 指定ã•れãŸå ´åˆ: {command} {option}
+ 2. {pkg}-config {option}
+ 3. pkg-config {option} {pkg}
+
+ optionãŒæŒ‡å®šã•れãŸå ´åˆã¯ï¼Œä¸Šè¨˜ã®é…列ã®ä»£ã‚りã«ãã®ã‚ªãƒ—ションを
+ 指定ã—ã¦å¾—られãŸå‡ºåŠ›ã‚’stripã—ãŸã‚‚ã®ã‚’è¿”ã™ï¼Ž
+
+= Appendix D. 世代別GC
+
+Ruby 2.1ã‹ã‚‰ä¸–代別GCã«å¯¾å¿œã—ã¾ã—ãŸï¼Žæˆ‘々ã¯ã“れをRGenGCã¨å‘¼ã‚“ã§ã„ã¾ã™ï¼Ž
+RGenGCã¯ï¼ŒéŽåŽ»ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ï¼ˆã»ã¼ï¼‰äº’æ›æ€§ã‚’ä¿ã¤ã‚ˆã†ã«é–‹ç™ºã•れã¦ã„ã‚‹
+ãŸã‚,拡張ライブラリå´ã®å¯¾å¿œã¯ã»ã¼ä¸è¦ã§ã™ï¼Ž
+
+ãŸã ã—,対応をã™ã‚‹ã“ã¨ã§æ€§èƒ½ã‚’å‘上ã™ã‚‹ã“ã¨ãŒã§ãã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ï¼Žã‚‚ã—
+拡張ライブラリã«é«˜ã„性能ãŒå¿…è¦ã§ã‚ã‚‹å ´åˆã¯å¯¾å¿œã‚’検討ã—ã¦ä¸‹ã•ã„.
+
+ã¨ãã«RARRAY_PTR()/RHASH_TBL()ã®ã‚ˆã†ãªãƒžã‚¯ãƒ­ã‚’用ã„ã¦ãƒã‚¤ãƒ³ã‚¿ã«ç›´æŽ¥ã‚¢ã‚¯ã‚»
+スã™ã‚‹ã‚ˆã†ãªã‚³ãƒ¼ãƒ‰ã¯æ›¸ã‹ãªã„よã†ã«ã—ã¦ä¸‹ã•ã„.代ã‚りã«ï¼Œrb_ary_aref(),
+rb_ary_store() ãªã©ã®ï¼Œé©åˆ‡ãª API 関数を利用ã™ã‚‹ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.
+
+ãã®ã»ã‹ï¼Œå¯¾å¿œã«ã¤ã„ã¦ã®è©³ç´°ã¯ README.EXT ã®ã€ŒAppendix D. Generational
+GCã€ã‚’å‚ç…§ã—ã¦ä¸‹ã•ã„.
+
+:enddoc: Local variables:
+:enddoc: fill-column: 60
+:enddoc: end:
diff --git a/doc/extension.rdoc b/doc/extension.rdoc
new file mode 100644
index 0000000000..40f83bf0d8
--- /dev/null
+++ b/doc/extension.rdoc
@@ -0,0 +1,1828 @@
+# README.EXT - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
+
+This document explains how to make extension libraries for Ruby.
+
+= Basic Knowledge
+
+In C, variables have types and data do not have types. In contrast,
+Ruby variables do not have a static type, and data themselves have
+types, so data will need to be converted between the languages.
+
+Data in Ruby are represented by the C type `VALUE'. Each VALUE data
+has its data type.
+
+To retrieve C data from a VALUE, you need to:
+
+1. Identify the VALUE's data type
+2. Convert the VALUE into C data
+
+Converting to the wrong data type may cause serious problems.
+
+== Data Types
+
+The Ruby interpreter has the following data types:
+
+T_NIL :: nil
+T_OBJECT :: ordinary object
+T_CLASS :: class
+T_MODULE :: module
+T_FLOAT :: floating point number
+T_STRING :: string
+T_REGEXP :: regular expression
+T_ARRAY :: array
+T_HASH :: associative array
+T_STRUCT :: (Ruby) structure
+T_BIGNUM :: multi precision integer
+T_FIXNUM :: Fixnum(31bit or 63bit integer)
+T_COMPLEX :: complex number
+T_RATIONAL :: rational number
+T_FILE :: IO
+T_TRUE :: true
+T_FALSE :: false
+T_DATA :: data
+T_SYMBOL :: symbol
+
+In addition, there are several other types used internally:
+
+T_ICLASS :: included module
+T_MATCH :: MatchData object
+T_UNDEF :: undefined
+T_NODE :: syntax tree node
+T_ZOMBIE :: object awaiting finalization
+
+Most of the types are represented by C structures.
+
+== Check Data Type of the VALUE
+
+The macro TYPE() defined in ruby.h shows the data type of the VALUE.
+TYPE() returns the constant number T_XXXX described above. To handle
+data types, your code will look something like this:
+
+ switch (TYPE(obj)) {
+ case T_FIXNUM:
+ /* process Fixnum */
+ break;
+ case T_STRING:
+ /* process String */
+ break;
+ case T_ARRAY:
+ /* process Array */
+ break;
+ default:
+ /* raise exception */
+ rb_raise(rb_eTypeError, "not valid value");
+ break;
+ }
+
+There is the data type check function
+
+ void Check_Type(VALUE value, int type)
+
+which raises an exception if the VALUE does not have the type
+specified.
+
+There are also faster check macros for fixnums and nil.
+
+ FIXNUM_P(obj)
+ NIL_P(obj)
+
+== Convert VALUE into C Data
+
+The data for type T_NIL, T_FALSE, T_TRUE are nil, false, true
+respectively. They are singletons for the data type.
+The equivalent C constants are: Qnil, Qfalse, Qtrue.
+Note that Qfalse is false in C also (i.e. 0), but not Qnil.
+
+The T_FIXNUM data is a 31bit or 63bit length fixed integer.
+This size depends on the size of long: if long is 32bit then
+T_FIXNUM is 31bit, if long is 64bit then T_FIXNUM is 63bit.
+T_FIXNUM can be converted to a C integer by using the
+FIX2INT() macro or FIX2LONG(). Though you have to check that the
+data is really FIXNUM before using them, they are faster. FIX2LONG()
+never raises exceptions, but FIX2INT() raises RangeError if the
+result is bigger or smaller than the size of int.
+There are also NUM2INT() and NUM2LONG() which converts any Ruby
+numbers into C integers. These macros include a type check,
+so an exception will be raised if the conversion failed. NUM2DBL()
+can be used to retrieve the double float value in the same way.
+
+You can use the macros
+StringValue() and StringValuePtr() to get a char* from a VALUE.
+StringValue(var) replaces var's value with the result of "var.to_str()".
+StringValuePtr(var) does the same replacement and returns the char*
+representation of var. These macros will skip the replacement if var
+is a String. Notice that the macros take only the lvalue as their
+argument, to change the value of var in place.
+
+You can also use the macro named StringValueCStr(). This is just
+like StringValuePtr(), but always adds a NUL character at the end of
+the result. If the result contains a NUL character, this macro causes
+the ArgumentError exception.
+StringValuePtr() doesn't guarantee the existence of a NUL at the end
+of the result, and the result may contain NUL.
+
+Other data types have corresponding C structures, e.g. struct RArray
+for T_ARRAY etc. The VALUE of the type which has the corresponding
+structure can be cast to retrieve the pointer to the struct. The
+casting macro will be of the form RXXXX for each data type; for
+instance, RARRAY(obj). See "ruby.h". However, we do not recommend
+to access RXXXX data directly because these data structures are complex.
+Use corresponding rb_xxx() functions to access the internal struct.
+For example, to access an entry of array, use rb_ary_entry(ary, offset)
+and rb_ary_store(ary, offset, obj).
+
+There are some accessing macros for structure members, for example
+`RSTRING_LEN(str)' to get the size of the Ruby String object. The
+allocated region can be accessed by `RSTRING_PTR(str)'.
+
+Notice: Do not change the value of the structure directly, unless you
+are responsible for the result. This ends up being the cause of
+interesting bugs.
+
+== Convert C Data into VALUE
+
+To convert C data to Ruby values:
+
+FIXNUM ::
+
+ left shift 1 bit, and turn on its least significant bit (LSB).
+
+Other pointer values ::
+
+ cast to VALUE.
+
+You can determine whether a VALUE is a 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
+structures are defined in <ruby.h>.
+
+To convert C numbers to Ruby values, use these macros:
+
+INT2FIX() :: for integers within 31bits.
+INT2NUM() :: for arbitrary sized integers.
+
+INT2NUM() converts an integer into a Bignum if it is out of the FIXNUM
+range, but is a bit slower.
+
+== Manipulating Ruby Data
+
+As I already mentioned, it is not recommended to modify an object's
+internal structure. To manipulate objects, use the functions supplied
+by the Ruby interpreter. Some (not all) of the useful functions are
+listed below:
+
+=== String Functions
+
+rb_str_new(const char *ptr, long len) ::
+
+ Creates a new Ruby string.
+
+rb_str_new2(const char *ptr) ::
+rb_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string from a C string. This is equivalent to
+ rb_str_new(ptr, strlen(ptr)).
+
+rb_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal.
+
+rb_tainted_str_new(const char *ptr, long len) ::
+
+ Creates a new tainted Ruby string. Strings from external data
+ sources should be tainted.
+
+rb_tainted_str_new2(const char *ptr) ::
+rb_tainted_str_new_cstr(const char *ptr) ::
+
+ Creates a new tainted Ruby string from a C string.
+
+rb_sprintf(const char *format, ...) ::
+rb_vsprintf(const char *format, va_list ap) ::
+
+ Creates a new Ruby string with printf(3) format.
+
+ Note: In the format string, "%"PRIsVALUE can be used for Object#to_s
+ (or Object#inspect if '+' flag is set) output (and related argument
+ must be a VALUE). Since it conflicts with "%i", for integers in
+ format strings, use "%d".
+
+rb_str_cat(VALUE str, const char *ptr, long len) ::
+
+ Appends len bytes of data from ptr to the Ruby string.
+
+rb_str_cat2(VALUE str, const char* ptr) ::
+rb_str_cat_cstr(VALUE str, const char* ptr) ::
+
+ Appends C string ptr to Ruby string str. This function is
+ equivalent to 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) ::
+
+ Appends C string format and successive arguments to Ruby string
+ str according to a printf-like format. These functions are
+ equivalent to rb_str_cat2(str, rb_sprintf(format, ...)) and
+ rb_str_cat2(str, rb_vsprintf(format, ap)), respectively.
+
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) ::
+rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc) ::
+
+ Creates a new Ruby string with the specified encoding.
+
+rb_enc_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal with the specified
+ encoding.
+
+rb_usascii_str_new(const char *ptr, long len) ::
+rb_usascii_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string with encoding US-ASCII.
+
+rb_usascii_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal with encoding
+ US-ASCII.
+
+rb_utf8_str_new(const char *ptr, long len) ::
+rb_utf8_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string with encoding UTF-8.
+
+rb_utf8_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal with encoding
+ UTF-8.
+
+rb_str_resize(VALUE str, long len) ::
+
+ Resizes a Ruby string to len bytes. If str is not modifiable, this
+ function raises an exception. The length of str must be set in
+ advance. If len is less than the old length the content beyond
+ len bytes is discarded, else if len is greater than the old length
+ the content beyond the old length bytes will not be preserved but
+ will be garbage. Note that RSTRING_PTR(str) may change by calling
+ this function.
+
+rb_str_set_len(VALUE str, long len) ::
+
+ Sets the length of a Ruby string. If str is not modifiable, this
+ function raises an exception. This function preserves the content
+ up to len bytes, regardless RSTRING_LEN(str). len must not exceed
+ the capacity of str.
+
+=== Array Functions
+
+rb_ary_new() ::
+
+ Creates an array with no elements.
+
+rb_ary_new2(long len) ::
+rb_ary_new_capa(long len) ::
+
+ Creates an array with no elements, allocating internal buffer
+ for len elements.
+
+rb_ary_new3(long n, ...) ::
+rb_ary_new_from_args(long n, ...) ::
+
+ Creates an n-element array from the arguments.
+
+rb_ary_new4(long n, VALUE *elts) ::
+rb_ary_new_from_values(long n, VALUE *elts) ::
+
+ Creates an n-element array from a C array.
+
+rb_ary_to_ary(VALUE obj) ::
+
+ Converts the object into an array.
+ Equivalent to Object#to_ary.
+
+There are many functions to operate an array. They may dump core if other
+types are given.
+
+rb_ary_aref(argc, VALUE *argv, VALUE ary) ::
+
+ Equivalent to Array#[].
+
+rb_ary_entry(VALUE ary, long offset) ::
+
+ \ary[offset]
+
+rb_ary_store(VALUE ary, long offset, VALUE obj) ::
+
+ \ary[offset] = obj
+
+rb_ary_subseq(VALUE ary, long beg, long len) ::
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val) ::
+rb_ary_pop(VALUE ary) ::
+rb_ary_shift(VALUE ary) ::
+rb_ary_unshift(VALUE ary, VALUE val) ::
+
+ ary.push, ary.pop, ary.shift, ary.unshift
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len) ::
+
+ Appends len elements of objects from ptr to the array.
+
+= Extending Ruby with C
+
+== Adding New Features to Ruby
+
+You can add new features (classes, methods, etc.) to the Ruby
+interpreter. Ruby provides APIs for defining the following things:
+
+- Classes, Modules
+- Methods, Singleton Methods
+- Constants
+
+=== Class and Module Definition
+
+To define a class or module, use the functions below:
+
+ VALUE rb_define_class(const char *name, VALUE super)
+ VALUE rb_define_module(const char *name)
+
+These functions return the newly created class or module. You may
+want to save this reference into a variable to use later.
+
+To define nested classes or modules, use the functions below:
+
+ VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
+ VALUE rb_define_module_under(VALUE outer, const char *name)
+
+=== Method and Singleton Method Definition
+
+To define methods or singleton methods, use these functions:
+
+ void rb_define_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+ 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.
+
+If argc is -1, the function will be called as:
+
+ VALUE func(int argc, VALUE *argv, VALUE obj)
+
+where argc is the actual number of arguments, argv is the C array of
+the arguments, and obj is the receiver.
+
+If argc is -2, the arguments are passed in a Ruby array. The function
+will be called like:
+
+ VALUE func(VALUE obj, VALUE args)
+
+where obj is the receiver, and args is the Ruby array containing
+actual arguments.
+
+There are some more functions to define methods. One takes an ID
+as the name of method to be defined. See also ID or Symbol below.
+
+ 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,
+ VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+At last, rb_define_module_function defines a module function,
+which are private AND singleton methods of the module.
+For example, sqrt is a module function defined in the Math module.
+It can be called in the following way:
+
+ Math.sqrt(4)
+
+or
+
+ include Math
+ sqrt(4)
+
+To define module functions, use:
+
+ void rb_define_module_function(VALUE module, const char *name,
+ VALUE (*func)(), int argc)
+
+In addition, function-like methods, which are private methods defined
+in the Kernel module, can be defined using:
+
+ void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
+
+To define an alias for the method,
+
+ void rb_define_alias(VALUE module, const char* new, const char* old);
+
+To define a reader/writer for an attribute,
+
+ void rb_define_attr(VALUE klass, const char *name, int read, int write)
+
+To define and undefine the `allocate' class method,
+
+ void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
+ void rb_undef_alloc_func(VALUE klass);
+
+func has to take the klass as the argument and return a newly
+allocated instance. This instance should be as empty as possible,
+without any expensive (including external) resources.
+
+If you are overriding an existing method of any ancestor of your class,
+you may rely on:
+
+ VALUE rb_call_super(int argc, const VALUE *argv)
+
+To achieve the receiver of the current scope (if no other way is
+available), you can use:
+
+ VALUE rb_current_receiver(void)
+
+=== Constant Definition
+
+We have 2 functions to define constants:
+
+ void rb_define_const(VALUE klass, const char *name, VALUE val)
+ void rb_define_global_const(const char *name, VALUE val)
+
+The former is to define a constant under specified class/module. The
+latter is to define a global constant.
+
+== Use Ruby Features from C
+
+There are several ways to invoke Ruby's features from C code.
+
+=== Evaluate Ruby Programs in a String
+
+The easiest way to use Ruby's functionality from a C program is to
+evaluate the string as Ruby program. This function will do the job:
+
+ VALUE rb_eval_string(const char *str)
+
+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
+function:
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
+
+It returns nil when an error occurred. Moreover, *state is zero if str was
+successfully evaluated, or nonzero otherwise.
+
+=== ID or Symbol
+
+You can invoke methods directly, without parsing the string. First I
+need to explain about ID. ID is the integer number to represent
+Ruby's identifiers such as variable names. The Ruby data type
+corresponding to ID is Symbol. It can be accessed from Ruby in the
+form:
+
+ :Identifier
+
+or
+
+ :"any kind of string"
+
+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 retrieve Symbol from Ruby object (Symbol or String) given as
+an argument by using
+
+ rb_to_symbol(VALUE name)
+ rb_check_symbol(volatile VALUE *namep)
+ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc)
+
+These functions are similar to above functions except that these
+return a Symbol instead of an ID.
+
+You can convert C ID to Ruby Symbol by using
+
+ VALUE ID2SYM(ID id)
+
+and to convert Ruby Symbol object to ID, use
+
+ ID SYM2ID(VALUE symbol)
+
+=== Invoke Ruby Method from C
+
+To invoke methods directly, you can use the function below
+
+ VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
+
+This function invokes a method on the recv, with the method name
+specified by the symbol mid.
+
+=== Accessing the Variables and Constants
+
+You can access class variables and instance variables using access
+functions. Also, global variables can be shared between both
+environments. There's no way to access Ruby's local variables.
+
+The functions to access/modify instance variables are below:
+
+ VALUE rb_ivar_get(VALUE obj, ID id)
+ VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
+
+id must be the symbol, which can be retrieved by rb_intern().
+
+To access the constants of the class/module:
+
+ VALUE rb_const_get(VALUE obj, ID id)
+
+See also Constant Definition above.
+
+= Information Sharing Between Ruby and C
+
+=== Ruby Constants That Can Be Accessed From C
+
+As stated in section 1.3,
+the following Ruby constants can be referred from C.
+
+Qtrue ::
+Qfalse ::
+
+ Boolean values. Qfalse is false in C also (i.e. 0).
+
+Qnil ::
+
+ Ruby nil in C scope.
+
+== Global Variables Shared Between C and Ruby
+
+Information can be shared between the two environments using shared global
+variables. To define them, you can use functions listed below:
+
+ void rb_define_variable(const char *name, VALUE *var)
+
+This function defines the variable which is shared by both environments.
+The value of the global variable pointed to by `var' can be accessed
+through Ruby's global variable named `name'.
+
+You can define read-only (from Ruby, of course) variables using the
+function below.
+
+ void rb_define_readonly_variable(const char *name, VALUE *var)
+
+You can defined hooked variables. The accessor functions (getter and
+setter) are called on access to the hooked variables.
+
+ void rb_define_hooked_variable(const char *name, VALUE *var,
+ VALUE (*getter)(), void (*setter)())
+
+If you need to supply either setter or getter, just supply 0 for the
+hook you don't need. If both hooks are 0, rb_define_hooked_variable()
+works just like rb_define_variable().
+
+The prototypes of the getter and setter functions are as follows:
+
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
+
+Also you can define a Ruby global variable without a corresponding C
+variable. The value of the variable will be set/get only by hooks.
+
+ void rb_define_virtual_variable(const char *name,
+ VALUE (*getter)(), void (*setter)())
+
+The prototypes of the getter and setter functions are as follows:
+
+ VALUE (*getter)(ID id);
+ void (*setter)(VALUE val, ID id);
+
+== Encapsulate C Data into a Ruby Object
+
+Sometimes you need to expose your struct in the C world as a Ruby
+object.
+In a situation like this, making use of the TypedData_XXX macro
+family, the pointer to the struct and the Ruby object can be mutually
+converted.
+
+--
+The old (non-Typed) Data_XXX macro family has been deprecated.
+In the future version of Ruby, it is possible old macros will not
+work.
+++
+
+=== C struct to Ruby object
+
+You can convert sval, a pointer to your struct, into a Ruby object
+with the next macro.
+
+ TypedData_Wrap_Struct(klass, data_type, sval)
+
+TypedData_Wrap_Struct() returns a created Ruby object as a VALUE.
+
+The klass argument is the class for the object.
+data_type is a pointer to a const rb_data_type_t which describes
+how Ruby should manage the struct.
+
+It is recommended that klass derives from a special class called
+Data (rb_cData) but not from Object or other ordinal classes.
+If it doesn't, you have to call rb_undef_alloc_func(klass).
+
+rb_data_type_t is defined like this. Let's take a look at each
+member of the struct.
+
+ struct rb_data_type_struct {
+ const char *wrap_struct_name;
+ struct {
+ void (*dmark)(void*);
+ void (*dfree)(void*);
+ size_t (*dsize)(const void *);
+ void *reserved[2];
+ } function;
+ const rb_data_type_t *parent;
+ void *data;
+ VALUE flags;
+ };
+
+wrap_struct_name is an identifier of this instance of the struct.
+It is basically used for collecting and emitting statistics.
+So the identifier must be unique in the process, but doesn't need
+to be valid as a C or Ruby identifier.
+
+These dmark / dfree functions are invoked during GC execution. No
+object allocations are allowed during it, so do not allocate ruby
+objects inside them.
+
+dmark is a function to mark Ruby objects referred from your struct.
+It must mark all references from your struct with rb_gc_mark or
+its family if your struct keeps such references.
+
+--
+Note that it is recommended to avoid such a reference.
+++
+
+dfree is a function to free the pointer allocation.
+If this is -1, the pointer will be just freed.
+
+dsize calculates memory consumption in bytes by the struct.
+Its parameter is a pointer to your struct.
+You can pass 0 as dsize if it is hard to implement such a function.
+But it is still recommended to avoid 0.
+
+You have to fill reserved and parent with 0.
+
+You can fill "data" with an arbitrary value for your use.
+Ruby does nothing with the member.
+
+flags is a bitwise-OR of the following flag values.
+Since they require deep understanding of garbage collector in Ruby,
+you can just set 0 to flags if you are not sure.
+
+RUBY_TYPED_FREE_IMMEDIATELY ::
+
+ This flag makes the garbage collector immediately invoke dfree()
+ during GC when it need to free your struct.
+ You can specify this flag if the dfree never unlocks Ruby's
+ internal lock (GVL).
+
+ If this flag is not set, Ruby defers invokation of dfree()
+ and invokes dfree() at the same time as finalizers.
+
+RUBY_TYPED_WB_PROTECTED ::
+
+ It shows that implementation of the object supports write barriers.
+ If this flag is set, Ruby is better able to do garbage collection
+ of the object.
+
+ When it is set, however, you are responsible for putting write
+ barriers in all implementations of methods of that object as
+ appropriate. Otherwise Ruby might crash while running.
+
+ More about write barriers can be found in "Generational GC" in
+ Appendix D.
+
+You can allocate and wrap the structure in one step.
+
+ TypedData_Make_Struct(klass, type, data_type, sval)
+
+This macro returns an allocated Data object, wrapping the pointer to
+the structure, which is also allocated. This macro works like:
+
+ (sval = ZALLOC(type), TypedData_Wrap_Struct(klass, data_type, sval))
+
+Arguments klass and data_type work like their counterparts in
+TypedData_Wrap_Struct(). A pointer to the allocated structure will
+be assigned to sval, which should be a pointer of the type specified.
+
+=== Ruby object to C struct
+
+To retrieve the C pointer from the Data object, use the macro
+Data_Get_Struct().
+
+ TypedData_Get_Struct(obj, type, &data_type, sval)
+
+A pointer to the structure will be assigned to the variable sval.
+
+See the example below for details.
+
+= Example - Creating the dbm Extension
+
+OK, here's the example of making an extension library. This is the
+extension to access DBMs. The full source is included in the ext/
+directory in the Ruby's source tree.
+
+== Make the Directory
+
+ % mkdir ext/dbm
+
+Make a directory for the extension library under ext directory.
+
+== Design the Library
+
+You need to design the library features, before making it.
+
+== Write the C Code
+
+You need to write C code for your extension library. If your library
+has only one source file, choosing ``LIBRARY.c'' as a file name is
+preferred. On the other hand, in case your library has multiple source
+files, avoid choosing ``LIBRARY.c'' for a file name. It may conflict
+with an intermediate file ``LIBRARY.o'' on some platforms.
+Note that some functions in mkmf library described below generate
+a file ``conftest.c'' for checking with compilation. You shouldn't
+choose ``conftest.c'' as a name of a source file.
+
+Ruby will execute the initializing function named ``Init_LIBRARY'' in
+the library. For example, ``Init_dbm()'' will be executed when loading
+the library.
+
+Here's the example of an initializing function.
+
+ void
+ Init_dbm(void)
+ {
+ /* define DBM class */
+ VALUE cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBM includes Enumerable module */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBM has class method open(): arguments are received as C array */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBM instance method close(): no args */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBM instance method []: 1 argument */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
+
+ /* ID for a instance variable to store DBM data */
+ id_dbm = rb_intern("dbm");
+ }
+
+The dbm extension wraps the dbm struct in the C environment using
+Data_Make_Struct.
+
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
+
+ static const rb_data_type_t dbm_type = {
+ "dbm",
+ {0, free_dbm, memsize_dbm,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+ };
+
+ obj = TypedData_Make_Struct(klass, struct dbmdata, &dbm_type, dbmp);
+
+This code wraps the dbmdata structure into a Ruby object. We avoid
+wrapping DBM* directly, because we want to cache size information.
+
+To retrieve the dbmdata structure from a Ruby object, we define the
+following macro:
+
+ #define GetDBM(obj, dbmp) do {\
+ TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
+ if ((dbmp) == 0) closed_dbm();\
+ if ((dbmp)->di_dbm == 0) closed_dbm();\
+ } while (0)
+
+This sort of complicated macro does the retrieving and close checking
+for the DBM.
+
+There are three kinds of way to receive method arguments. First,
+methods with a fixed number of arguments receive arguments like this:
+
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
+
+The first argument of the C function is the self, the rest are the
+arguments to the method.
+
+Second, methods with an arbitrary number of arguments receive
+arguments like this:
+
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+ /* ... */
+ }
+
+The first argument is the number of method arguments, the second
+argument is the C array of the method arguments, and the third
+argument is the receiver of the method.
+
+You can use the function rb_scan_args() to check and retrieve the
+arguments. The third argument is a string that specifies how to
+capture method arguments and assign them to the following VALUE
+references.
+
+The following is an example of a method that takes arguments by Ruby's
+array:
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
+
+The first argument is the receiver, the second one is the Ruby array
+which contains the arguments to the method.
+
+<b>Notice</b>: GC should know about global variables which refer to Ruby's objects,
+but are not exported to the Ruby world. You need to protect them by
+
+ void rb_global_variable(VALUE *var)
+
+== Prepare extconf.rb
+
+If the file named extconf.rb exists, it will be executed to generate
+Makefile.
+
+extconf.rb is the file for checking compilation conditions etc. You
+need to put
+
+ require 'mkmf'
+
+at the top of the file. You can use the functions below to check
+various conditions.
+
+ 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 executable 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.
+
+ $CFLAGS: included in CFLAGS make variable (such as -O)
+ $CPPFLAGS: included in CPPFLAGS make variable (such as -I, -D)
+ $LDFLAGS: included in LDFLAGS make variable (such as -L)
+ $objs: list of object file names
+
+Normally, the object files list is automatically generated by searching
+source files, but you must define them explicitly if any sources will
+be generated while building.
+
+If a compilation condition is not fulfilled, you should not call
+``create_makefile''. The Makefile will not be generated, compilation will
+not be done.
+
+== Prepare Depend (Optional)
+
+If the file named depend exists, Makefile will include that file to
+check dependencies. You can make this file by invoking
+
+ % gcc -MM *.c > depend
+
+It's harmless. Prepare it.
+
+== Generate Makefile
+
+Try generating the Makefile by:
+
+ ruby extconf.rb
+
+If the library should be installed under vendor_ruby directory
+instead of site_ruby directory, use --vendor option as follows.
+
+ ruby extconf.rb --vendor
+
+You don't need this step if you put the extension library under the ext
+directory of the ruby source tree. In that case, compilation of the
+interpreter will do this step for you.
+
+== Run make
+
+Type
+
+ make
+
+to compile your extension. You don't need this step either if you have
+put the extension library under the ext directory of the ruby source tree.
+
+== Debug
+
+You may need to rb_debug the extension. Extensions can be linked
+statically by adding the directory name in the ext/Setup file so that
+you can inspect the extension with the debugger.
+
+== Done! Now You Have the Extension Library
+
+You can do anything you want with your library. The author of Ruby
+will not claim any restrictions on your code depending on the Ruby API.
+Feel free to use, modify, distribute or sell your program.
+
+= Appendix A. Ruby Source Files Overview
+
+== Ruby Language Core
+
+class.c :: classes and modules
+error.c :: exception classes and exception mechanism
+gc.c :: memory management
+load.c :: library loading
+object.c :: objects
+variable.c :: variables and constants
+
+== Ruby Syntax Parser
+
+parse.y :: grammar definition
+parse.c :: automatically generated from parse.y
+keywords :: reserved keywords
+lex.c :: automatically generated from keywords
+
+== Ruby Evaluator (a.k.a. YARV)
+
+ compile.c
+ eval.c
+ eval_error.c
+ eval_jump.c
+ eval_safe.c
+ insns.def : definition of VM instructions
+ iseq.c : implementation of VM::ISeq
+ thread.c : thread management and context switching
+ thread_win32.c : thread implementation
+ thread_pthread.c : ditto
+ vm.c
+ vm_dump.c
+ vm_eval.c
+ vm_exec.c
+ vm_insnhelper.c
+ vm_method.c
+
+ opt_insns_unif.def : instruction unification
+ opt_operand.def : definitions for optimization
+
+ -> insn*.inc : automatically generated
+ -> opt*.inc : automatically generated
+ -> vm.inc : automatically generated
+
+== Regular Expression Engine (Oniguruma)
+
+ regex.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== Utility Functions
+
+debug.c :: debug symbols for C debugger
+dln.c :: dynamic loading
+st.c :: general purpose hash table
+strftime.c :: formatting times
+util.c :: misc utilities
+
+== Ruby Interpreter Implementation
+
+ dmyext.c
+ dmydln.c
+ dmyencoding.c
+ id.c
+ inits.c
+ main.c
+ ruby.c
+ version.c
+
+ gem_prelude.rb
+ prelude.rb
+
+== Class Library
+
+array.c :: Array
+bignum.c :: Bignum
+compar.c :: Comparable
+complex.c :: Complex
+cont.c :: Fiber, Continuation
+dir.c :: Dir
+enum.c :: Enumerable
+enumerator.c :: Enumerator
+file.c :: File
+hash.c :: Hash
+io.c :: IO
+marshal.c :: Marshal
+math.c :: Math
+numeric.c :: Numeric, Integer, Fixnum, Float
+pack.c :: Array#pack, String#unpack
+proc.c :: Binding, Proc
+process.c :: Process
+random.c :: random number
+range.c :: Range
+rational.c :: Rational
+re.c :: Regexp, MatchData
+signal.c :: Signal
+sprintf.c :: String#sprintf
+string.c :: String
+struct.c :: Struct
+time.c :: Time
+
+defs/known_errors.def :: Errno::* exception classes
+-> known_errors.inc :: automatically generated
+
+== Multilingualization
+
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: encoding classes
+enc/trans/* :: codepoint mapping tables
+
+== goruby Interpreter Implementation
+
+ goruby.c
+ golf_prelude.rb : goruby specific libraries.
+ -> golf_prelude.c : automatically generated
+
+= Appendix B. Ruby Extension API Reference
+
+== Types
+
+VALUE ::
+
+ The type for the Ruby object. Actual structures are defined in ruby.h,
+ such as struct RString, etc. To refer the values in structures, use
+ casting macros like RSTRING(obj).
+
+== Variables and Constants
+
+Qnil ::
+
+ nil object
+
+Qtrue ::
+
+ true object (default true value)
+
+Qfalse ::
+
+ false object
+
+== C Pointer Wrapping
+
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
+
+ Wrap a C pointer into a Ruby object. If object has references to other
+ Ruby objects, they should be marked by using the mark function during
+ the GC process. Otherwise, mark should be 0. When this object is no
+ longer referred by anywhere, the pointer will be discarded by free
+ function.
+
+Data_Make_Struct(klass, type, mark, free, sval) ::
+
+ This macro allocates memory using malloc(), assigns it to the variable
+ 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.
+
+== Checking Data Types
+
+TYPE(value) ::
+
+ Internal type (T_NIL, T_FIXNUM, etc.)
+
+FIXNUM_P(value) ::
+
+ Is +value+ a Fixnum?
+
+NIL_P(value) ::
+
+ Is +value+ nil?
+
+void Check_Type(VALUE value, int type) ::
+
+ Ensures +value+ is of the given internal +type+ or raises a TypeError
+
+SaveStringValue(value) ::
+
+ Checks that +value+ is a String and is not tainted
+
+== Data Type Conversion
+
+FIX2INT(value), INT2FIX(i) ::
+
+ Fixnum <-> integer
+
+FIX2LONG(value), LONG2FIX(l) ::
+
+ Fixnum <-> long
+
+NUM2INT(value), INT2NUM(i) ::
+
+ Numeric <-> integer
+
+NUM2UINT(value), UINT2NUM(ui) ::
+
+ Numeric <-> unsigned integer
+
+NUM2LONG(value), LONG2NUM(l) ::
+
+ Numeric <-> long
+
+NUM2ULONG(value), ULONG2NUM(ul) ::
+
+ Numeric <-> unsigned long
+
+NUM2LL(value), LL2NUM(ll) ::
+
+ Numeric <-> long long
+
+NUM2ULL(value), ULL2NUM(ull) ::
+
+ Numeric <-> unsigned long long
+
+NUM2OFFT(value), OFFT2NUM(off) ::
+
+ Numeric <-> off_t
+
+NUM2SIZET(value), SIZET2NUM(size) ::
+
+ Numeric <-> size_t
+
+NUM2SSIZET(value), SSIZET2NUM(ssize) ::
+
+ Numeric <-> ssize_t
+
+rb_integer_pack(value, words, numwords, wordsize, nails, flags), rb_integer_unpack(words, numwords, wordsize, nails, flags) ::
+
+ Numeric <-> Arbitrary size integer buffer
+
+NUM2DBL(value) ::
+
+ Numeric -> double
+
+rb_float_new(f) ::
+
+ double -> Float
+
+RSTRING_LEN(str) ::
+
+ String -> length of String data in bytes
+
+RSTRING_PTR(str) ::
+
+ String -> pointer to String data
+ Note that the result pointer may not be NUL-terminated
+
+StringValue(value) ::
+
+ Object with \#to_str -> String
+
+StringValuePtr(value) ::
+
+ Object with \#to_str -> pointer to String data
+
+StringValueCStr(value) ::
+
+ Object with \#to_str -> pointer to String data without NUL bytes
+ It is guaranteed that the result data is NUL-terminated
+
+rb_str_new2(s) ::
+
+ char * -> String
+
+== Defining Classes and Modules
+
+VALUE rb_define_class(const char *name, VALUE super) ::
+
+ Defines a new Ruby class as a subclass of super.
+
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
+
+ Creates a new Ruby class as a subclass of super, under the module's
+ namespace.
+
+VALUE rb_define_module(const char *name) ::
+
+ Defines a new Ruby module.
+
+VALUE rb_define_module_under(VALUE module, const char *name) ::
+
+ Defines a new Ruby module under the module's namespace.
+
+void rb_include_module(VALUE klass, VALUE module) ::
+
+ Includes module into class. If class already includes it, just ignored.
+
+void rb_extend_object(VALUE object, VALUE module) ::
+
+ Extend the object with the module's attributes.
+
+== Defining Global Variables
+
+void rb_define_variable(const char *name, VALUE *var) ::
+
+ Defines a global variable which is shared between C and Ruby. If name
+ contains a character which is not allowed to be part of the symbol,
+ it can't be seen from Ruby programs.
+
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
+
+ Defines a read-only global variable. Works just like
+ rb_define_variable(), except the defined variable is read-only.
+
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
+
+ Defines a virtual variable, whose behavior is defined by a pair of C
+ functions. The getter function is called when the variable is
+ referenced. The setter function is called when the variable is set to a
+ value. The prototype for getter/setter functions are:
+
+ VALUE getter(ID id)
+ void setter(VALUE val, ID id)
+
+ The getter function must return the value for the access.
+
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
+
+ Defines hooked variable. It's a virtual variable with a C variable.
+ The getter is called as
+
+ VALUE getter(ID id, VALUE *var)
+
+ returning a new value. The setter is called as
+
+ void setter(VALUE val, ID id, VALUE *var)
+
+void rb_global_variable(VALUE *var) ::
+
+ GC requires C global variables which hold Ruby values to be marked.
+ rb_global_variable tells GC to protect these variables.
+
+== Constant Definition
+
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
+
+ Defines a new constant under the class/module.
+
+void rb_define_global_const(const char *name, VALUE val) ::
+
+ Defines a global constant. This is just the same as
+
+ rb_define_const(rb_cObject, name, val)
+
+== Method Definition
+
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a method for the class. func is the function pointer. argc
+ is the number of arguments. if argc is -1, the function will receive
+ 3 arguments: argc, argv, and self. if argc is -2, the function will
+ receive 2 arguments, self and args, where args is a Ruby array of
+ the method arguments.
+
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a private method for the class. Arguments are same as
+ rb_define_method().
+
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a singleton method. Arguments are same as rb_define_method().
+
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
+
+ Retrieve argument from argc and argv to given VALUE references
+ according to the format string. The format can be described in ABNF
+ as follows:
+
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
+
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ option-hash-arg-spec := sym-for-option-hash-arg
+ block-arg-spec := sym-for-block-arg
+
+ num-of-leading-mandatory-args := DIGIT ; The number of leading
+ ; mandatory arguments
+ num-of-optional-args := DIGIT ; The number of optional
+ ; arguments
+ sym-for-variable-length-args := "*" ; Indicates that variable
+ ; length arguments are
+ ; captured as a ruby array
+ num-of-trailing-mandatory-args := DIGIT ; The number of trailing
+ ; mandatory arguments
+ sym-for-option-hash-arg := ":" ; Indicates that an option
+ ; hash is captured if the last
+ ; argument is a hash or can be
+ ; converted to a hash with
+ ; #to_hash. When the last
+ ; argument is nil, it is
+ ; captured if it is not
+ ; ambiguous to take it as
+ ; empty option hash; i.e. '*'
+ ; is not specified and
+ ; arguments are given more
+ ; than sufficient.
+ sym-for-block-arg := "&" ; Indicates that an iterator
+ ; block should be captured if
+ ; given
+
+ For example, "12" means that the method requires at least one
+ argument, and at most receives three (1+2) arguments. So, the format
+ string must be followed by three variable references, which are to be
+ assigned to captured arguments. For omitted arguments, variables are
+ set to Qnil. NULL can be put in place of a variable reference, which
+ means the corresponding captured argument(s) should be just dropped.
+
+ The number of given arguments, excluding an option hash or iterator
+ block, is returned.
+
+int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values) ::
+
+ Retrieves argument VALUEs bound to keywords, which directed by +table+
+ into +values+, deleting retrieved entries from +keyword_hash+ along
+ the way. First +required+ number of IDs referred by +table+ are
+ mandatory, and succeeding +optional+ (- +optional+ - 1 if
+ +optional+ is negative) number of IDs are optional. If a
+ mandatory key is not contained in +keyword_hash+, raises "missing
+ keyword" +ArgumentError+. If an optional key is not present in
+ +keyword_hash+, the corresponding element in +values+ is set to +Qundef+.
+ If +optional+ is negative, rest of +keyword_hash+ are ignored, otherwise
+ raises "unknown keyword" +ArgumentError+.
+
+ Be warned, handling keyword arguments in the C API is less efficient
+ than handling them in Ruby. Consider using a Ruby wrapper method
+ around a non-keyword C function.
+ ref: https://bugs.ruby-lang.org/issues/11339
+
+VALUE rb_extract_keywords(VALUE *original_hash) ::
+
+ Extracts pairs whose key is a symbol into a new hash from a hash
+ object referred by +original_hash+. If the original hash contains
+ non-symbol keys, then they are copied to another hash and the new hash
+ is stored through +original_hash+, else 0 is stored.
+
+== Invoking Ruby method
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ Invokes a method. To retrieve mid from a method name, use rb_intern().
+ Able to call even private/protected methods.
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments as an array of values.
+ Able to call even private/protected methods.
+
+VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments as an array of values.
+ Able to call only public methods.
+
+VALUE rb_eval_string(const char *str) ::
+
+ Compiles and executes the string as a Ruby program.
+
+ID rb_intern(const char *name) ::
+
+ Returns ID corresponding to the name.
+
+char *rb_id2name(ID id) ::
+
+ Returns the name corresponding ID.
+
+char *rb_class2name(VALUE klass) ::
+
+ Returns the name of the class.
+
+int rb_respond_to(VALUE obj, ID id) ::
+
+ Returns true if the object responds to the message specified by id.
+
+== Instance Variables
+
+VALUE rb_iv_get(VALUE obj, const char *name) ::
+
+ Retrieve the value of the instance variable. If the name is not
+ prefixed by `@', that variable shall be inaccessible from Ruby.
+
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
+
+ Sets the value of the instance variable.
+
+== Control Structure
+
+VALUE rb_block_call(VALUE recv, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
+
+ Calls a method on the recv, with the method name specified by the
+ symbol mid, with argc arguments in argv, supplying func as the
+ block. When func is called as the block, it will receive the value
+ from yield as the first argument, and data2 as the second argument.
+ When yielded with multiple values (in C, rb_yield_values(),
+ rb_yield_values2() and rb_yield_splat()), data2 is packed as an Array,
+ whereas yielded values can be gotten via argc/argv of the third/fourth
+ arguments.
+
+\[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 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.
+
+VALUE rb_yield(VALUE val) ::
+
+ Evaluates the block with value val.
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1, with arg1 as the argument. If an exception
+ occurs during func1, it calls func2 with arg2 as the argument. The
+ return value of rb_rescue() is the return value from func1 if no
+ exception occurs, from func2 otherwise.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1 with arg1 as the argument, then calls func2
+ with arg2 if execution terminated. The return value from
+ rb_ensure() is that of func1 when no exception occurred.
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ Calls the function func with arg as the argument. If no exception
+ occurred 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) ::
+
+ 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, ...) ::
+
+ Prints a warning message according to a printf-like format.
+
+void rb_warning(const char *fmt, ...) ::
+
+ Prints a warning message according to a printf-like format, if
+ $VERBOSE is true.
+
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
+
+ Raises RuntimeError. The fmt is a format string just like printf().
+
+void rb_raise(VALUE exception, const char *fmt, ...) ::
+
+ Raises a class exception. The fmt is a format string just like printf().
+
+void rb_fatal(const char *fmt, ...) ::
+
+ Raises a fatal error, terminates the interpreter. No exception handling
+ will be done for fatal errors, but ensure blocks will be executed.
+
+void rb_bug(const char *fmt, ...) ::
+
+ Terminates the interpreter immediately. This function should be
+ called under the situation caused by the bug in the interpreter. No
+ exception handling nor ensure execution will be done.
+
+Note: In the format string, "%"PRIsVALUE can be used for Object#to_s
+(or Object#inspect if '+' flag is set) output (and related argument
+must be a VALUE). Since it conflicts with "%i", for integers in
+format strings, use "%d".
+
+== Initialize and Start the Interpreter
+
+The embedding API functions are below (not needed for extension libraries):
+
+void ruby_init() ::
+
+ Initializes the interpreter.
+
+void *ruby_options(int argc, char **argv) ::
+
+ Process command line arguments for the interpreter.
+ And compiles the Ruby source to execute.
+ It returns an opaque pointer to the compiled source
+ or an internal special value.
+
+int ruby_run_node(void *n) ::
+
+ Runs the given compiled source and exits this process.
+ It returns EXIT_SUCCESS if successfully runs the source.
+ Otherwise, it returns other value.
+
+void ruby_script(char *name) ::
+
+ Specifies the name of the script ($0).
+
+== Hooks for the Interpreter Events
+
+void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data) ::
+
+ Adds a hook function for the specified interpreter events.
+ events should be OR'ed value of:
+
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
+
+ The definition of rb_event_hook_func_t is below:
+
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
+
+ The third argument `data' to rb_add_event_hook() is passed to the hook
+ function as the second argument, which was the pointer to the current
+ NODE in 1.8. See RB_EVENT_HOOKS_HAVE_CALLBACK_DATA below.
+
+int rb_remove_event_hook(rb_event_hook_func_t func) ::
+
+ Removes the specified hook function.
+
+== Macros for Compatibility
+
+Some macros to check API compatibilities are available by default.
+
+NORETURN_STYLE_NEW ::
+
+ Means that NORETURN macro is functional style instead of prefix.
+
+HAVE_RB_DEFINE_ALLOC_FUNC ::
+
+ Means that function rb_define_alloc_func() is provided, that means the
+ allocation framework is used. This is same as the result of
+ have_func("rb_define_alloc_func", "ruby.h").
+
+HAVE_RB_REG_NEW_STR ::
+
+ Means that function rb_reg_new_str() is provided, that creates Regexp
+ object from String object. This is same as the result of
+ have_func("rb_reg_new_str", "ruby.h").
+
+HAVE_RB_IO_T ::
+
+ Means that type rb_io_t is provided.
+
+USE_SYMBOL_AS_METHOD_NAME ::
+
+ Means that Symbols will be returned as method names, e.g.,
+ Module#methods, \#singleton_methods and so on.
+
+HAVE_RUBY_*_H ::
+
+ Defined in ruby.h and means corresponding header is available. For
+ instance, when HAVE_RUBY_ST_H is defined you should use ruby/st.h not
+ mere st.h.
+
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
+
+ Means that rb_add_event_hook() takes the third argument `data', to be
+ passed to the given event hook function.
+
+= Appendix C. Functions available for use in extconf.rb
+
+See documentation for {mkmf}[rdoc-ref:MakeMakefile].
+
+= Appendix D. Generational GC
+
+Ruby 2.1 introduced a generational garbage collector (called RGenGC).
+RGenGC (mostly) keeps compatibility.
+
+Generally, the use of the technique called write barriers is required in
+extension libraries for generational GC
+(http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29).
+RGenGC works fine without write barriers in extension libraries.
+
+If your library adheres to the following tips, performance can
+be further improved. Especially, the "Don't touch pointers directly" section is
+important.
+
+== Incompatibility
+
+You can't write RBASIC(obj)->klass field directly because it is const
+value now.
+
+Basically you should not write this field because MRI expects it to be
+an immutable field, but if you want to do it in your extension you can
+use the following functions:
+
+VALUE rb_obj_hide(VALUE obj) ::
+
+ Clear RBasic::klass field. The object will be an internal object.
+ ObjectSpace::each_object can't find this object.
+
+VALUE rb_obj_reveal(VALUE obj, VALUE klass) ::
+
+ Reset RBasic::klass to be klass.
+ We expect the `klass' is hidden class by rb_obj_hide().
+
+== Write barriers
+
+RGenGC doesn't require write barriers to support generational GC.
+However, caring about write barrier can improve the performance of
+RGenGC. Please check the following tips.
+
+=== Don't touch pointers directly
+
+In MRI (include/ruby/ruby.h), some macros to acquire pointers to the
+internal data structures are supported such as RARRAY_PTR(),
+RSTRUCT_PTR() and so on.
+
+DO NOT USE THESE MACROS and instead use the corresponding C-APIs such as
+rb_ary_aref(), rb_ary_store() and so on.
+
+=== Consider whether to insert write barriers
+
+You don't need to care about write barriers if you only use built-in
+types.
+
+If you support T_DATA objects, you may consider using write barriers.
+
+Inserting write barriers into T_DATA objects only works with the
+following type objects: (a) long-lived objects, (b) when a huge number
+of objects are generated and \(c) container-type objects that have
+references to other objects. If your extension provides such a type of
+T_DATA objects, consider inserting write barriers.
+
+(a): short-lived objects don't become old generation objects.
+(b): only a few oldgen objects don't have performance impact.
+\(c): only a few references don't have performance impact.
+
+Inserting write barriers is a very difficult hack, it is easy to
+introduce critical bugs. And inserting write barriers has several areas
+of overhead. Basically we don't recommend you insert write barriers.
+Please carefully consider the risks.
+
+=== Combine with built-in types
+
+Please consider utilizing built-in types. Most built-in types support
+write barrier, so you can use them to avoid manually inserting write
+barriers.
+
+For example, if your T_DATA has references to other objects, then you
+can move these references to Array. A T_DATA object only has a reference
+to an array object. Or you can also use a Struct object to gather a
+T_DATA object (without any references) and an that Array contains
+references.
+
+With use of such techniques, you don't need to insert write barriers
+anymore.
+
+=== Insert write barriers
+
+\[AGAIN] Inserting write barriers is a very difficult hack, and it is
+easy to introduce critical bugs. And inserting write barriers has
+several areas of overhead. Basically we don't recommend you insert write
+barriers. Please carefully consider the risks.
+
+Before inserting write barriers, you need to know about RGenGC algorithm
+(gc.c will help you). Macros and functions to insert write barriers are
+available in include/ruby/ruby.h. An example is available in iseq.c.
+
+For a complete guide for RGenGC and write barriers, please refer to
+<https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RGenGC>.
+
+= Appendix E. RB_GC_GUARD to protect from premature GC
+
+C Ruby currently uses conservative garbage collection, thus VALUE
+variables must remain visible on the stack or registers to ensure any
+associated data remains usable. Optimizing C compilers are not designed
+with conservative garbage collection in mind, so they may optimize away
+the original VALUE even if the code depends on data associated with that
+VALUE.
+
+The following example illustrates the use of RB_GC_GUARD to ensure
+the contents of sptr remain valid while the second invocation of
+rb_str_new_cstr is running.
+
+ VALUE s, w;
+ const char *sptr;
+
+ s = rb_str_new_cstr("hello world!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+ sptr = RSTRING_PTR(s);
+ w = rb_str_new_cstr(sptr + 6); /* Possible GC invocation */
+
+ RB_GC_GUARD(s); /* ensure s (and thus sptr) do not get GC-ed */
+
+In the above example, RB_GC_GUARD must be placed _after_ the last use of
+sptr. Placing RB_GC_GUARD before dereferencing sptr would be of no use.
+RB_GC_GUARD is only effective on the VALUE data type, not converted C
+data types.
+
+RB_GC_GUARD would not be necessary at all in the above example if
+non-inlined function calls are made on the `s' VALUE after sptr is
+dereferenced. Thus, in the above example, calling any un-inlined
+function on `s' such as:
+
+ rb_str_modify(s);
+
+Will ensure `s' stays on the stack or register to prevent a
+GC invocation from prematurely freeing it.
+
+Using the RB_GC_GUARD macro is preferable to using the "volatile"
+keyword in C. RB_GC_GUARD has the following advantages:
+
+1. the intent of the macro use is clear
+
+2. RB_GC_GUARD only affects its call site, "volatile" generates some
+ extra code every time the variable is used, hurting optimization.
+
+3. "volatile" implementations may be buggy/inconsistent in some
+ compilers and architectures. RB_GC_GUARD is customizable for broken
+ systems/compilers without those without negatively affecting other
+ systems.
+
+:enddoc: Local variables:
+:enddoc: fill-column: 70
+:enddoc: end:
diff --git a/doc/forwardable.rd.ja b/doc/forwardable.rd.ja
index 6a5ff2e236..171724b2e5 100644
--- a/doc/forwardable.rd.ja
+++ b/doc/forwardable.rd.ja
@@ -9,8 +9,8 @@
== ä½¿ã„æ–¹
-クラスã«å¯¾ã—ã¦extendã—ã¦ä½¿ã„ã¾ã™.
-
+クラスã«å¯¾ã—ã¦extendã—ã¦ä½¿ã„ã¾ã™.
+
class Foo
extend Forwardable
@@ -50,7 +50,7 @@
== ä½¿ã„æ–¹
-オブジェクトã«å¯¾ã—ã¦((|extend|))ã—ã¦ä½¿ã„ã¾ã™.
+オブジェクトã«å¯¾ã—ã¦((|extend|))ã—ã¦ä½¿ã„ã¾ã™.
g = Goo.new
g.extend SingleForwardable
diff --git a/doc/globals.rdoc b/doc/globals.rdoc
index f82b6f8796..3bc7e05623 100644
--- a/doc/globals.rdoc
+++ b/doc/globals.rdoc
@@ -31,6 +31,7 @@ $DEBUG:: The debug flag, which is set by the -d switch. Enabling debug
backtrace). Setting this to a true value enables debug output as
if -d were given on the command line. Setting this to a false
value disables debug output.
+$LOADED_FEATURES:: The alias to the $".
$FILENAME:: Current input file from $<. Same as $<.filename.
$LOAD_PATH:: The alias to the $:.
$stderr:: The current standard error output.
diff --git a/doc/irb/irb-tools.rd.ja b/doc/irb/irb-tools.rd.ja
index 3c95faeb8a..b997f0edea 100644
--- a/doc/irb/irb-tools.rd.ja
+++ b/doc/irb/irb-tools.rd.ja
@@ -112,7 +112,7 @@ XMPメソッド群ã®ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆã¯, 呼ã³å‡ºã™å‰ã®ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆ
マルãƒã‚¹ãƒ¬ãƒƒãƒ‰ã«ã¯å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“.
= frame.rb
-ç¾åœ¨å®Ÿè¡Œä¸­ã®ãƒ•レーム情報をå–り扱ã†ãŸã‚ã®ã‚¯ãƒ©ã‚¹ã§ã™.
+ç¾åœ¨å®Ÿè¡Œä¸­ã®ãƒ•レーム情報をå–り扱ã†ãŸã‚ã®ã‚¯ãƒ©ã‚¹ã§ã™.
* IRB::Frame.top(n = 0)
上ã‹ã‚‰n番目ã®ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆã‚’å–り出ã—ã¾ã™. nã¯0ãŒæœ€ä¸Šä½ã«ãªã‚Šã¾ã™.
@@ -127,7 +127,7 @@ set_trace_funcを用ã„ã¦Rubyã®å®Ÿè¡Œã‚’トレースã—ã¦ã„ã¾ã™. マルãƒ
ã¯å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“.
= completion.rb
-irbã®completion機能をæä¾›ã™ã‚‹ã‚‚ã®ã§ã™.
+irbã®completion機能をæä¾›ã™ã‚‹ã‚‚ã®ã§ã™.
== ä½¿ã„æ–¹
@@ -144,7 +144,7 @@ irb実行中㫠(TAB) を押ã™ã¨ã‚³ãƒ³ãƒ—レーションã—ã¾ã™.
トップレベルã§(TAB)を押ã™ã¨ã™ã¹ã¦ã®æ§‹æ–‡è¦ç´ , クラス, メソッドã®å€™è£œãŒã§
ã¾ã™. 候補ãŒå”¯ä¸€ãªã‚‰ã°å®Œå…¨ã«è£œå®Œã—ã¾ã™.
- irb(main):001:0> in
+ irb(main):001:0> in
in inspect instance_eval
include install_alias_method instance_of?
initialize install_aliases instance_variables
@@ -168,8 +168,8 @@ irb実行中㫠(TAB) を押ã™ã¨ã‚³ãƒ³ãƒ—レーションã—ã¾ã™.
foo.dup foo.kind_of? foo.to_s
foo.eql? foo.method foo.type
foo.equal? foo.methods foo.untaint
- foo.extend foo.nil?
- foo.freeze foo.private_methods
+ foo.extend foo.nil?
+ foo.freeze foo.private_methods
=end
diff --git a/doc/keywords.rdoc b/doc/keywords.rdoc
new file mode 100644
index 0000000000..98bbd5e864
--- /dev/null
+++ b/doc/keywords.rdoc
@@ -0,0 +1,158 @@
+== Keywords
+
+The following keywords are used by Ruby.
+
+__ENCODING__::
+ The script encoding of the current file. See Encoding.
+
+__LINE__::
+ The line number of this keyword in the current file.
+
+__FILE__::
+ The path to the current file.
+
+BEGIN::
+ Runs before any other code in the current file. See {miscellaneous
+ syntax}[rdoc-ref:syntax/miscellaneous.rdoc]
+
+END::
+ Runs after any other code in the current file. See {miscellaneous
+ syntax}[rdoc-ref:syntax/miscellaneous.rdoc]
+
+alias::
+ Creates an alias between two methods (and other things). See {modules and
+ classes syntax}[rdoc-ref:syntax/modules_and_classes.rdoc]
+
+and::
+ Short-circuit Boolean and with lower precedence than <code>&&</code>
+
+begin::
+ Starts an exception handling block. See {exceptions
+ syntax}[rdoc-ref:syntax/exceptions.rdoc]
+
+break::
+ Leaves a block early. See {control expressions
+ syntax}[rdoc-ref:syntax/control_expressions.rdoc]
+
+case::
+ Starts a +case+ expression. See {control expressions
+ syntax}[rdoc-ref:syntax/control_expressions.rdoc]
+
+class::
+ Creates or opens a class. See {modules and classes
+ syntax}[rdoc-ref:syntax/modules_and_classes.rdoc]
+
+def::
+ Defines a method. See {methods syntax}[rdoc-ref:syntax/methods.rdoc]
+
+defined?::
+ Returns a string describing its argument. See {miscellaneous
+ syntax}[rdoc-ref:syntax/miscellaneous.rdoc]
+
+do::
+ Starts a block.
+
+else::
+ The unhandled condition in +case+, +if+ and +unless+ expressions. See
+ {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+elsif::
+ An alternate condition for an +if+ expression. See {control
+ expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+end::
+ The end of a syntax block. Used by classes, modules, methods, exception
+ handling and control expressions.
+
+ensure::
+ Starts a section of code that is always run when an exception is raised.
+ See {exception handling}[rdoc-ref:syntax/exceptions.rdoc]
+
+false::
+ Boolean false. See {literals}[rdoc-ref:syntax/literals.rdoc]
+
+for::
+ A loop that is similar to using the +each+ method. See {control
+ expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+if::
+ Used for +if+ and modifier +if+ expressions. See {control
+ expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+in::
+ Used to separate the iterable object and iterator variable in a +for+ loop.
+ See {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+module::
+ Creates or opens a module. See {modules and classes
+ syntax}[rdoc-ref:syntax/modules_and_classes.rdoc]
+
+next::
+ Skips the rest of the block. See {control
+ expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+nil::
+ A false value usually indicating "no value" or "unknown". See
+ {literals}[rdoc-ref:syntax/literals.rdoc]
+
+not::
+ Inverts the following boolean expression. Has a lower precedence than
+ <code>!</code>
+
+or::
+ Boolean or with lower precedence than <code>||</code>
+
+redo::
+ Restarts execution in the current block. See {control
+ expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+rescue::
+ Starts an exception section of code in a +begin+ block. See {exception
+ handling}[rdoc-ref:syntax/exceptions.rdoc]
+
+retry::
+ Retries an exception block. See {exception
+ handling}[rdoc-ref:syntax/exceptions.rdoc]
+
+return::
+ Exits a method. See {methods}[rdoc-ref:syntax/methods.rdoc]
+
+self::
+ The object the current method is attached to. See
+ {methods}[rdoc-ref:syntax/methods.rdoc]
+
+super::
+ Calls the current method in a superclass. See
+ {methods}[rdoc-ref:syntax/methods.rdoc]
+
+then::
+ Indicates the end of conditional blocks in control structures. See
+ {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+true::
+ Boolean true. See {literals}[rdoc-ref:syntax/literals.rdoc]
+
+undef::
+ Prevents a class or module from responding to a method call.
+ See {modules and classes}[rdoc-ref:syntax/modules_and_classes.rdoc]
+
+unless::
+ Used for +unless+ and modifier +unless+ expressions. See {control
+ expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+until::
+ Creates a loop that executes until the condition is true. See
+ {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+when::
+ A condition in a +case+ expression. See
+ {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+while::
+ Creates a loop that executes while the condition is true. See
+ {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
+
+yield::
+ Starts execution of the block sent to the current method. See
+ {methods}[rdoc-ref:syntax/methods.rdoc]
+
diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc
index 82b8004662..d657626e30 100644
--- a/doc/maintainers.rdoc
+++ b/doc/maintainers.rdoc
@@ -98,7 +98,7 @@ Zachary Scott (zzak)
* 1.8: _unmaintained_
* 1.9: _deprecated_
[lib/logger.rb]
- Hiroshi Nakamura (nahi)
+ Naotoshi Seo (sonots)
[lib/mathn.rb]
Keiju ISHITSUKA (keiju)
[lib/matrix.rb]
@@ -116,8 +116,6 @@ Zachary Scott (zzak)
Shugo Maeda (shugo)
[lib/net/imap.rb]
Shugo Maeda (shugo)
-[lib/net/telnet.rb]
- _unmaintained_
[lib/net/http.rb, lib/net/https]
NARUSE, Yui (naruse)
[lib/net/pop.rb]
diff --git a/doc/pty/README.ja b/doc/pty/README.ja
index 9b9d306bf7..2d83ffa033 100644
--- a/doc/pty/README.ja
+++ b/doc/pty/README.ja
@@ -34,7 +34,7 @@ pty 拡張モジュール version 0.3 by A.ito
æ•°ãŒãƒ–ロックパラメータ付ãã§å‘¼ã°ã‚ŒãŸå ´åˆã«ã¯ï¼Œãã®ãƒ–ロックã®ä¸­ã§
ã®ã¿ä¾‹å¤–ãŒç™ºç”Ÿã—ã¾ã™ï¼Žå­ãƒ—ロセスをモニターã—ã¦ã„るスレッドã¯ãƒ–ロッ
クを抜ã‘ã‚‹ã¨ãã«çµ‚了ã—ã¾ã™ï¼Ž
-
+
protect_signal
reset_signal
diff --git a/doc/regexp.rdoc b/doc/regexp.rdoc
index 3c13b6683f..7384670557 100644
--- a/doc/regexp.rdoc
+++ b/doc/regexp.rdoc
@@ -128,8 +128,8 @@ The following metacharacters also behave like character classes:
* <tt>/\D/</tt> - A non-digit character (<tt>[^0-9]</tt>)
* <tt>/\h/</tt> - A hexdigit character (<tt>[0-9a-fA-F]</tt>)
* <tt>/\H/</tt> - A non-hexdigit character (<tt>[^0-9a-fA-F]</tt>)
-* <tt>/\s/</tt> - A whitespace character: <tt>/[ \t\r\n\f]/</tt>
-* <tt>/\S/</tt> - A non-whitespace character: <tt>/[^ \t\r\n\f]/</tt>
+* <tt>/\s/</tt> - A whitespace character: <tt>/[ \t\r\n\f\v]/</tt>
+* <tt>/\S/</tt> - A non-whitespace character: <tt>/[^ \t\r\n\f\v]/</tt>
POSIX <i>bracket expressions</i> are also similar to character classes.
They provide a portable alternative to the above, with the added benefit
@@ -545,7 +545,7 @@ Options may also be used with <tt>Regexp.new</tt>:
As mentioned above, the <tt>x</tt> option enables <i>free-spacing</i>
mode. Literal white space inside the pattern is ignored, and the
octothorpe (<tt>#</tt>) character introduces a comment until the end of
-the line. This allows the components of the pattern to be organised in a
+the line. This allows the components of the pattern to be organized in a
potentially more readable fashion.
A contrived pattern to match a number with optional decimal places:
@@ -558,13 +558,19 @@ A contrived pattern to match a number with optional decimal places:
\Z/x
float_pat.match('3.14') #=> #<MatchData "3.14" 1:".14">
-*Note*: To match whitespace in an <tt>x</tt> pattern use an escape such as
-<tt>\s</tt> or <tt>\p{Space}</tt>.
+There are a number of strategies for matching whitespace:
+
+* Use a pattern such as <tt>\s</tt> or <tt>\p{Space}</tt>.
+* Use escaped whitespace such as <tt>\ </tt>, i.e. a space preceded by a backslash.
+* Use a character class such as <tt>[ ]</tt>.
Comments can be included in a non-<tt>x</tt> pattern with the
<tt>(?#</tt><i>comment</i><tt>)</tt> construct, where <i>comment</i> is
arbitrary text ignored by the regexp engine.
+Comments in regexp literals cannot include unescaped terminator
+characters.
+
== Encoding
Regular expressions are assumed to use the source encoding. This can be
diff --git a/doc/security.rdoc b/doc/security.rdoc
index d8efca0042..378699fb15 100644
--- a/doc/security.rdoc
+++ b/doc/security.rdoc
@@ -66,20 +66,28 @@ method, variable and constant names. The reason for this is that symbols are
simply integers with names attached to them, so they are faster to look up in
hashtables.
-Once a symbol is created, the memory used by it is never freed. If you convert
-user input to symbols with +to_sym+ or +intern+, it is possible for an attacker
-to mount a denial of service attack against your application by flooding it
-with unique strings. Because each string is kept in memory until the Ruby
-process exits, this will cause memory consumption to grow and grow until Ruby
-runs out of memory and crashes.
-
-Be careful with passing user input to methods such as +send+,
-+instance_variable_get+ or +_set+, +const_get+ or +_set+, etc. as these methods
-will convert string parameters to symbols internally and pose the same DoS
-potential as direct conversion through +to_sym+/+intern+.
-
-The workaround to this is simple - don't convert user input to symbols. You
-should attempt to leave user input in string form instead.
+Starting in version 2.2, most symbols can be garbage collected; these are
+called <i>mortal</i> symbols. Most symbols you create (e.g. by calling
++to_sym+) are mortal.
+
+<i>Immortal</i> symbols on the other hand will never be garbage collected.
+They are created when modifying code:
+* defining a method (e.g. with +define_method+),
+* setting an instance variable (e.g. with +instance_variable_set+),
+* creating a variable or constant (e.g. with +const_set+)
+C extensions that have not been updated and are still calling `SYM2ID`
+will create immortal symbols.
+Bugs in 2.2.0: +send+ and +__send__+ also created immortal symbols,
+and calling methods with keyword arguments could also create some.
+
+Don't create immortal symbols from user inputs. Otherwise, this would
+allow a user to mount a denial of service attack against your application by
+flooding it with unique strings, which will cause memory to grow indefinitely
+until the Ruby process is killed or causes the system to slow to a halt.
+
+While it might not be a good idea to call these with user inputs, methods that
+used to be vulnerable such as +to_sym+, +respond_to?+,
++method+, +instance_variable_get+, +const_get+, etc. are no longer a threat.
== Regular expressions
diff --git a/doc/shell.rd.ja b/doc/shell.rd.ja
index 053b11fb99..a9507fe92a 100644
--- a/doc/shell.rd.ja
+++ b/doc/shell.rd.ja
@@ -47,7 +47,7 @@ OS上ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ã«ã¯ã¾ãš, Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦å®
--- Shell.def_system_command(command, path = command)
- Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦commandを登録ã—ã¾ã™.
+ Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦commandを登録ã—ã¾ã™.
例)
Shell.def_system_command "ls"
@@ -62,7 +62,7 @@ OS上ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ã«ã¯ã¾ãš, Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦å®
--- Shell.alias_command(ali, command, *opts) {...}
- commandã®aliasã‚’ã—ã¾ã™.
+ commandã®aliasã‚’ã—ã¾ã™.
例)
Shell.alias_command "lsC", "ls", "-CBF", "--show-control-chars"
@@ -139,7 +139,7 @@ OS上ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ã«ã¯ã¾ãš, Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦å®
--- Shell#test(command, file1, file2)
--- Shell#[command, file1, file2]
- ファイルテスト関数testã¨åŒã˜.
+ ファイルテスト関数testã¨åŒã˜.
例)
sh[?e, "foo"]
sh[:e, "foo"]
@@ -185,7 +185,7 @@ OS上ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ã«ã¯ã¾ãš, Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦å®
--- Shell#glob(patten)
--- Shell#tee(file)
- ã“れらã¯å®Ÿè¡Œã™ã‚‹ã¨, ãれらを内容ã¨ã™ã‚‹Filterオブジェクトを返ã—ã¾ã™.
+ ã“れらã¯å®Ÿè¡Œã™ã‚‹ã¨, ãれらを内容ã¨ã™ã‚‹Filterオブジェクトを返ã—ã¾ã™.
--- Filter#each &block
diff --git a/doc/standard_library.rdoc b/doc/standard_library.rdoc
index 448635758b..bd15c2ea9a 100644
--- a/doc/standard_library.rdoc
+++ b/doc/standard_library.rdoc
@@ -13,7 +13,6 @@ Base64:: Support for encoding and decoding binary data using a Base64 representa
Benchmark:: Provides methods to measure and report the time used to execute code
CGI:: Support for the Common Gateway Interface protocol
CMath:: Provides Trigonometric and Transcendental functions for complex numbers
-complex.rb:: Deprecated library replaced by C implementation in core
ConditionVariable:: Augments the Mutex class, provided by thread.rb
CSV:: Provides an interface to read and write CSV files and data
DEBUGGER__:: Debugging functionality for Ruby
@@ -26,14 +25,12 @@ FileUtils:: Several file utility methods for copying, moving, removing, etc
Find:: This module supports top-down traversal of a set of file paths
Forwardable:: Provides delegation of specified methods to a designated object
GetoptLong:: Parse command line options similar to the GNU C getopt_long()
-GServer:: HTTP server with logging, thread pooling and multi-server management
IPAddr:: Provides methods to manipulate IPv4 and IPv6 IP addresses
IRB:: Interactive Ruby command-line tool for REPL (Read Eval Print Loop)
Logger:: Provides a simple logging utility for outputing messages
mathn.rb:: Deprecated library that extends math operations
MakeMakefile:: Module used to generate a Makefile for C extensions
Matrix:: Represents a mathematical matrix.
-MiniTest:: A test suite with TDD, BDD, mocking and benchmarking
Monitor:: Provides an object or module to use safely by more than one thread
Mutex_m:: Mixin to extend objects to be handled like a Mutex
Net::FTP:: Support for the File Transfer Protocol
@@ -56,7 +53,6 @@ PStore:: Implements a file based persistence mechanism based on a Hash
Queue:: Synchronized communication between threads, provided by thread.rb
Racc:: A LALR(1) parser generator written in Ruby.
Rake:: Ruby build program with capabilities similar to make
-rational.rb:: Deprecated library replaced by C implementation in core
RbConfig:: Information of your configure and build of Ruby
RDoc:: Produces HTML and command-line documentation for Ruby
resolv-replace.rb:: Replace Socket DNS with Resolv
@@ -73,8 +69,6 @@ Shellwords:: Manipulates strings with word parsing rules of UNIX Bourne shell
Singleton:: Implementation of the Singleton pattern for Ruby
Synchronizer:: A module that provides a two-phase lock with a counter
Tempfile:: A utility class for managing temporary files
-Test::Unit:: A compatibility layer for MiniTest
-Thread:: Provides support classes for threaded programs
ThreadsWait:: Watches for termination of multiple threads
Time:: Extends the Time class with methods for parsing and conversion
Timeout:: Auto-terminate potentially long-running operations in Ruby
@@ -96,7 +90,6 @@ Date:: A subclass of Object includes Comparable module for handling dates
DateTime:: Subclass of Date to handling dates, hours, minutes, seconds, offsets
DBM:: Provides a wrapper for the UNIX-style Database Manager Library
Digest:: Provides a framework for message digest libraries
-DL:: Provides a wrapper for the UNIX dlopen() library
Etc:: Provides access to information typically stored in UNIX /etc directory
Fcntl:: Loads constants defined in the OS fcntl.h C header file
Fiddle:: A libffi wrapper for Ruby
@@ -116,10 +109,7 @@ Socket:: Access underlying OS socket implementations
StringIO:: Pseudo I/O on String objects
StringScanner:: Provides lexical scanning operations on a String
Syslog:: Ruby interface for the POSIX system logging facility
+Thread:: Provides support classes for threaded programs
Tk:: Provides a framework for building a Graphical User Interface (GUI)
WIN32OLE:: Provides an interface for OLE Automation in Ruby
Zlib:: Ruby interface for the zlib compression/decompression library
-
-
-
-
diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc
index 7424d4885f..83300cbece 100644
--- a/doc/syntax/assignment.rdoc
+++ b/doc/syntax/assignment.rdoc
@@ -1,6 +1,6 @@
= Assignment
-In Ruby assignment uses the <code>=</code> (equals sign) character. This
+In Ruby, assignment uses the <code>=</code> (equals sign) character. This
example assigns the number five to the local variable +v+:
v = 5
@@ -137,7 +137,7 @@ Here is an example of instance variable usage:
p object2.value # prints "other value"
An uninitialized instance variable has a value of +nil+. If you run Ruby with
-warnings enabled you will get a warning when accessing an uninitialized
+warnings enabled, you will get a warning when accessing an uninitialized
instance variable.
The +value+ method has access to the value set by the +initialize+ method, but
@@ -279,7 +279,7 @@ to an instance variable most people use Module#attr_accessor:
end
When using method assignment you must always have a receiver. If you do not
-have a receiver Ruby assumes you are assigning to a local variable:
+have a receiver, Ruby assumes you are assigning to a local variable:
class C
attr_accessor :value
@@ -354,7 +354,7 @@ Here is an example:
p a # prints 1
-Note that these two operators behave more like <code>a || a = 0<code> than
+Note that these two operators behave more like <code>a || a = 0</code> than
<code>a = a || 0</code>.
== Implicit Array Assignment
@@ -374,7 +374,7 @@ assigning. This is similar to multiple assignment:
p a # prints [1, 2, 3]
-You can splat anywhere in the left-hand side of the assignment:
+You can splat anywhere in the right-hand side of the assignment:
a = 1, *[2, 3]
@@ -382,7 +382,7 @@ You can splat anywhere in the left-hand side of the assignment:
== Multiple Assignment
-You can assign multiple values on the left-hand side to multiple variables:
+You can assign multiple values on the right-hand side to multiple variables:
a, b = 1, 2
@@ -408,8 +408,8 @@ You can use multiple assignment to swap two values in-place:
p new_value: new_value, old_value: old_value
# prints {:new_value=>1, :old_value=>2}
-If you have more values on the left hand side of the assignment than variables
-on the right hand side the extra values are ignored:
+If you have more values on the right hand side of the assignment than variables
+on the left hand side, the extra values are ignored:
a, b = 1, 2, 3
@@ -422,7 +422,7 @@ the assignment.
p a: a, b: b # prints {:a=>1, :b=>[2, 3]}
-The <code>*</code> can appear anywhere on the right-hand side:
+The <code>*</code> can appear anywhere on the left-hand side:
*a, b = 1, 2, 3
@@ -452,4 +452,3 @@ Since each decomposition is considered its own multiple assignment you can use
p a: a, b: b, c: c, d: d
# prints {:a=>1, :b=>2, :c=>[3, 4], :d=>[5, 6]}
-
diff --git a/doc/syntax/calling_methods.rdoc b/doc/syntax/calling_methods.rdoc
index 79c0de59dc..ec86ef05ee 100644
--- a/doc/syntax/calling_methods.rdoc
+++ b/doc/syntax/calling_methods.rdoc
@@ -27,6 +27,10 @@ This sends the +my_method+ message to +my_object+. Any object can be a
receiver but depending on the method's visibility sending a message may raise a
NoMethodError.
+You may use <code>&.</code> to designate a receiver, then +my_method+ is not
+invoked and the result is +nil+ when the receiver is +nil+. In that case, the
+arguments of +my_method+ are not evaluated.
+
You may also use <code>::</code> to designate a receiver, but this is rarely
used due to the potential for confusion with <code>::</code> for namespaces.
@@ -62,7 +66,7 @@ The positional arguments for the message follow the method name:
my_method(argument1, argument2)
-In many cases parenthesis are not necessary when sending a message:
+In many cases, parenthesis are not necessary when sending a message:
my_method argument1, argument2
@@ -84,7 +88,7 @@ hash-type arguments are assigned as a single hash to the last argument:
my_method('a' => 1, b: 2) # prints: {'a'=>1, :b=>2}
-If too many positional arguments are given an ArgumentError is raised.
+If too many positional arguments are given, an ArgumentError is raised.
=== Default Positional Arguments
@@ -246,8 +250,8 @@ Both are equivalent to:
my_method(1, 2, 3)
-If the method accepts keyword arguments the splat operator will convert a hash
-at the end of the array into keyword arguments:
+If the method accepts keyword arguments, the splat operator will convert a
+hash at the end of the array into keyword arguments:
def my_method(a, b, c: 3)
end
@@ -259,7 +263,7 @@ You may also use the <code>**</code> (described next) to convert a Hash into
keyword arguments.
If the number of objects in the Array do not match the number of arguments for
-the method an ArgumentError will be raised.
+the method, an ArgumentError will be raised.
If the splat operator comes first in the call, parentheses must be used to
avoid a warning.
@@ -286,7 +290,7 @@ Both are equivalent to:
my_method(first: 3, second: 4, third: 5)
If the method definition uses <code>**</code> to gather arbitrary keyword
-arguments they will not be gathered by <code>*</code>:
+arguments, they will not be gathered by <code>*</code>:
def my_method(*a, **kw)
p arguments: a, keywords: kw
@@ -296,9 +300,9 @@ arguments they will not be gathered by <code>*</code>:
Prints:
- {:arguments=>[1, 2], :keywords=>{"3"=>4, :five=>6}}
+ {:arguments=>[1, 2, {"3"=>4}], :keywords=>{:five=>6}}
-Unlike the splat operator described above the <code>**</code> operator has no
+Unlike the splat operator described above, the <code>**</code> operator has no
commonly recognized name.
=== Proc to Block Conversion
@@ -319,12 +323,12 @@ operator:
If the splat operator comes first in the call, parenthesis must be used to
avoid a warning.
-Unlike the splat operator described above the <code>&</code> operator has no
+Unlike the splat operator described above, the <code>&</code> operator has no
commonly recognized name.
== Method Lookup
-When you send a message Ruby looks up the method that matches the name of the
+When you send a message, Ruby looks up the method that matches the name of the
message for the receiver. Methods are stored in classes and modules so method
lookup walks these, not the objects themselves.
@@ -343,7 +347,6 @@ If no match is found this repeats from the beginning, but looking for
+method_missing+. The default +method_missing+ is BasicObject#method_missing
which raises a NameError when invoked.
-If refinements (an experimental feature) are active the method lookup changes.
+If refinements (an experimental feature) are active, the method lookup changes.
See the {refinements documentation}[rdoc-ref:syntax/refinements.rdoc] for
details.
-
diff --git a/doc/syntax/control_expressions.rdoc b/doc/syntax/control_expressions.rdoc
index 0efc1668ad..123b48b6b9 100644
--- a/doc/syntax/control_expressions.rdoc
+++ b/doc/syntax/control_expressions.rdoc
@@ -110,7 +110,7 @@ expression as this can be confusing.
== +unless+ Expression
The +unless+ expression is the opposite of the +if+ expression. If the value
-is false the "then" expression is executed:
+is false, the "then" expression is executed:
unless true
puts "the value is a false-value"
@@ -204,10 +204,10 @@ Here is an example of using +case+ to compare a String against a pattern:
Here the string <code>"12345"</code> is compared with <code>/^1/</code> by
calling <code>/^1/ === "12345"</code> which returns +true+. Like the +if+
-expression the first +when+ that matches is executed and all other matches are
+expression, the first +when+ that matches is executed and all other matches are
ignored.
-If no matches are found the +else+ is executed.
+If no matches are found, the +else+ is executed.
The +else+ and +then+ are optional, this +case+ expression gives the same
result as the one above:
@@ -300,9 +300,9 @@ This prints the numbers 0 through 11. Like a while loop the condition <code>a
> 10</code> is checked when entering the loop and each time the loop body
executes. If the condition is false the loop will continue to execute.
-Like a +while+ loop the +do+ is optional.
+Like a +while+ loop, the +do+ is optional.
-Like a +while+ loop the result of an +until+ loop is nil unless +break+ is
+Like a +while+ loop, the result of an +until+ loop is nil unless +break+ is
used.
== +for+ Loop
@@ -356,7 +356,7 @@ before the condition:
p a # prints 10
-If you don't use +rescue+ or +ensure+ Ruby optimizes away any exception
+If you don't use +rescue+ or +ensure+, Ruby optimizes away any exception
handling overhead.
== +break+ Statement
@@ -434,14 +434,14 @@ Use +redo+ to redo the current iteration:
This prints [0, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11]
-In Ruby 1.8 you could also use +retry+ where you used +redo+. This is no
+In Ruby 1.8, you could also use +retry+ where you used +redo+. This is no
longer true, now you will receive a SyntaxError when you use +retry+ outside
of a +rescue+ block. See {Exceptions}[rdoc-ref:syntax/exceptions.rdoc]
for proper usage of +retry+.
== Flip-Flop
-The flip-flop is rarely seen conditional expression. It's primary use is
+The flip-flop is a rarely seen conditional expression. It's primary use is
for processing text from ruby one-line programs used with <code>ruby -n</code>
or <code>ruby -p</code>.
@@ -461,14 +461,14 @@ Here is an example:
p selected # prints [2, 3, 4, 5, 6, 7, 8]
-In the above example the on condition is <code>n==2</code>. The flip-flop
+In the above example, the on condition is <code>n==2</code>. The flip-flop
is initially off (false) for 0 and 1, but becomes on (true) for 2 and remains
on through 8. After 8 it turns off and remains off for 9 and 10.
The flip-flop must be used inside a conditional such as +if+, +while+,
+unless+, +until+ etc. including the modifier forms.
-When you use an inclusive range (<code>..</code>) the off condition is
+When you use an inclusive range (<code>..</code>), the off condition is
evaluated when the on condition changes:
selected = []
@@ -479,11 +479,11 @@ evaluated when the on condition changes:
p selected # prints [2]
-Here both sides of the flip-flop are evaluated so the flip-flop turns on and
+Here, both sides of the flip-flop are evaluated so the flip-flop turns on and
off only when +value+ equals 2. Since the flip-flop turned on in the
iteration it returns true.
-When you use an exclusive range (<code>...</code>) the off condition is
+When you use an exclusive range (<code>...</code>), the off condition is
evaluated on the following iteration:
selected = []
@@ -494,7 +494,6 @@ evaluated on the following iteration:
p selected # prints [2, 3, 4, 5]
-Here the flip-flop turns on when +value+ equals 2 but doesn't turn off on the
+Here, the flip-flop turns on when +value+ equals 2, but doesn't turn off on the
same iteration. The off condition isn't evaluated until the following
iteration and +value+ will never be two again.
-
diff --git a/doc/syntax/exceptions.rdoc b/doc/syntax/exceptions.rdoc
index 0efc35a59f..a2e75616fb 100644
--- a/doc/syntax/exceptions.rdoc
+++ b/doc/syntax/exceptions.rdoc
@@ -8,7 +8,7 @@ Exceptions are rescued in a +begin+/+end+ block:
# handle exception
end
-If you are inside a method you do not need to use +begin+ or +end+ unless you
+If you are inside a method, you do not need to use +begin+ or +end+ unless you
wish to limit the scope of rescued exceptions:
def my_method
@@ -29,7 +29,7 @@ variable_name</tt> at the end of the +rescue+ line:
raise # re-raise the current exception
end
-By default StandardError and its subclasses are rescued. You can rescue a
+By default, StandardError and its subclasses are rescued. You can rescue a
specific set of exception classes (and their subclasses) by listing them after
+rescue+:
@@ -52,7 +52,7 @@ You may rescue different types of exceptions in different ways:
end
The exception is matched to the rescue section starting at the top, and matches
-only once. If an ArgumentError is raised in the begin section it will not be
+only once. If an ArgumentError is raised in the begin section, it will not be
handled in the StandardError section.
You may retry rescued exceptions:
@@ -93,4 +93,3 @@ You may also run some code when an exception is not raised:
ensure
# ...
end
-
diff --git a/doc/syntax/literals.rdoc b/doc/syntax/literals.rdoc
index e01b6875d4..b8ed7f7c54 100644
--- a/doc/syntax/literals.rdoc
+++ b/doc/syntax/literals.rdoc
@@ -83,8 +83,33 @@ Any internal <tt>"</tt> must be escaped:
"This string has a quote: \". As you can see, it is escaped"
-Double-quote strings allow escaped characters such as <tt>\n</tt> for newline,
-<tt>\t</tt> for tab, etc.
+Double-quote strings allow escaped characters such as <tt>\n</tt> for
+newline, <tt>\t</tt> for tab, etc. The full list of supported escape
+sequences are as follows:
+
+ \a bell, ASCII 07h (BEL)
+ \b backspace, ASCII 08h (BS)
+ \t horizontal tab, ASCII 09h (TAB)
+ \n newline (line feed), ASCII 0Ah (LF)
+ \v vertical tab, ASCII 0Bh (VT)
+ \f form feed, ASCII 0Ch (FF)
+ \r carriage return, ASCII 0Dh (CR)
+ \e escape, ASCII 1Bh (ESC)
+ \s space, ASCII 20h (SPC)
+ \\ backslash, \
+ \nnn octal bit pattern, where nnn is 1-3 octal digits ([0-7])
+ \xnn hexadecimal bit pattern, where nn is 1-2 hexadecimal digits ([0-9a-fA-F])
+ \unnnn Unicode character, where nnnn is exactly 4 hexadecimal digits ([0-9a-fA-F])
+ \u{nnnn ...} Unicode character(s), where each nnnn is 1-6 hexadecimal digits ([0-9a-fA-F])
+ \cx or \C-x control character, where x is an ASCII printable character
+ \M-x meta character, where x is an ASCII printable character
+ \M-\C-x meta control character, where x is an ASCII printable character
+ \M-\cx same as above
+ \c\M-x same as above
+ \c? or \C-? delete, ASCII 7Fh (DEL)
+
+Any other character following a backslash is interpreted as the
+character itself.
Double-quote strings allow interpolation of other values using
<tt>#{...}</tt>:
@@ -100,14 +125,15 @@ single-quote strings:
'#{1 + 1}' #=> "\#{1 + 1}"
In addition to disabling interpolation, single-quoted strings also disable all
-escape sequences except for the single-quote (<tt>\'</tt>).
+escape sequences except for the single-quote (<tt>\'</tt>) and backslash
+(<tt>\\\\</tt>).
You may also create strings using <tt>%</tt>:
%(1 + 1 is #{1 + 1}) #=> "1 + 1 is 2"
There are two different types of <tt>%</tt> strings <tt>%q(...)</tt> behaves
-like a single-quote string (no interpolation or character escaping) while
+like a single-quote string (no interpolation or character escaping), while
<tt>%Q</tt> behaves as a double-quote string. See Percent Strings below for
more discussion of the syntax of percent strings.
@@ -123,6 +149,23 @@ be concatenated as long as a percent-string is not last.
%q{a} 'b' "c" #=> "abc"
"a" 'b' %q{c} #=> NameError: uninitialized constant q
+There is also a character literal notation to represent single
+character strings, which syntax is a question mark (<tt>?</tt>)
+followed by a single character or escape sequence that corresponds to
+a single codepoint in the script encoding:
+
+ ?a #=> "a"
+ ?abc #=> SyntaxError
+ ?\n #=> "\n"
+ ?\s #=> " "
+ ?\\ #=> "\\"
+ ?\u{41} #=> "A"
+ ?\C-a #=> "\x01"
+ ?\M-a #=> "\xE1"
+ ?\M-\C-a #=> "\x81"
+ ?\C-\M-a #=> "\x81", same as above
+ ?ã‚ #=> "ã‚"
+
=== Here Documents
If you are writing a large block of text you may use a "here document" or
@@ -153,6 +196,20 @@ Note that the while the closing identifier may be indented, the content is
always treated as if it is flush left. If you indent the content those spaces
will appear in the output.
+To have indented content as well as an indented closing identifier, you can use
+a "squiggly" heredoc, which uses a "~" instead of a "-" after <tt><<</tt>:
+
+ expected_result = <<~SQUIGGLY_HEREDOC
+ This would contain specially formatted text.
+
+ That might span many lines
+ SQUIGGLY_HEREDOC
+
+The indentation of the least-indented line will be removed from each line of
+the content. Note that empty lines and lines consisting solely of literal tabs
+and spaces will be ignored for the purposes of determining indentation, but
+escaped tabs and spaces are considered non-indentation characters.
+
A heredoc allows interpolation and escaped characters. You may disable
interpolation and escaping by surrounding the opening identifier with single
quotes:
@@ -198,14 +255,11 @@ You may also create symbols by interpolation:
:"my_symbol1"
:"my_symbol#{1 + 1}"
-Note that symbols are never garbage collected so be careful when referencing
-symbols using interpolation.
-
Like strings, a single-quote may be used to disable interpolation:
:'my_symbol#{1 + 1}' #=> :"my_symbol\#{1 + 1}"
-When creating a Hash there is a special syntax for referencing a Symbol as
+When creating a Hash, there is a special syntax for referencing a Symbol as
well.
== Arrays
@@ -235,6 +289,14 @@ You can create a hash using symbol keys with the following syntax:
This same syntax is used for keyword arguments for a method.
+Like Symbol literals, you can quote symbol keys.
+
+ { "a 1": 1, "b #{1 + 1}": 2 }
+
+is equal to
+
+ { :"a 1" => 1, :"b 2" => 2 }
+
See Hash for the methods you may use with a hash.
== Ranges
@@ -282,7 +344,7 @@ This proc will add one to its argument.
== Percent Strings
-Besides <tt>%(...)</tt> which creates a String, The <tt>%</tt> may create
+Besides <tt>%(...)</tt> which creates a String, the <tt>%</tt> may create
other types of object. As with strings, an uppercase letter allows
interpolation and escaped characters while a lowercase letter disables them.
@@ -304,4 +366,3 @@ one of the array entries you must escape it with a "\\" character:
If you are using "(", "[", "{", "<" you must close it with ")", "]", "}", ">"
respectively. You may use most other non-alphanumeric characters for percent
string delimiters such as "%", "|", "^", etc.
-
diff --git a/doc/syntax/methods.rdoc b/doc/syntax/methods.rdoc
index 7fd69983f3..0ee2a08367 100644
--- a/doc/syntax/methods.rdoc
+++ b/doc/syntax/methods.rdoc
@@ -8,8 +8,8 @@ definition:
end
A method definition consists of the +def+ keyword, a method name, the body of
-the method, then the +end+ keyword. When called the method will execute the
-body of the method. This method returns +2+.
+the method, +return+ value and the +end+ keyword. When called the method will
+execute the body of the method. This method returns +2+.
This section only covers defining methods. See also the {syntax documentation
on calling methods}[rdoc-ref:syntax/calling_methods.rdoc].
@@ -17,30 +17,53 @@ on calling methods}[rdoc-ref:syntax/calling_methods.rdoc].
== Method Names
Method names may be one of the operators or must start a letter or a character
-with the eight bit set. Typically method names are US-ASCII compatible since
-the keys to type them exist on all keyboards.
+with the eight bit set. It may contain letters, numbers, an <code>_</code>
+(underscore or low line) or a character with the eight bit set. The convention
+is to use underscores to separate words in a multiword method name:
-(Ruby programs must be written in a US-ASCII-compatible character set. In
-such character sets if the eight bit is set it indicates an extended
-character. Ruby allows method names and other identifiers to contain such
-characters.)
+ def method_name
+ puts "use underscores to separate words"
+ end
+
+Ruby programs must be written in a US-ASCII-compatible character set such as
+UTF-8, ISO-8859-1 etc. In such character sets if the eight bit is set it
+indicates an extended character. Ruby allows method names and other identifiers
+to contain such characters. Ruby programs cannot contain some characters like
+ASCII NUL (<code>\x00<code>).
+
+The following are the examples of valid ruby methods:
+
+ def hello
+ "hello"
+ end
-Method names may contain letters, numbers, an <code>_</code> (underscore or
-low line) or a character with the eight bit set.
+ def ã“ã‚“ã«ã¡ã¯
+ puts "means hello in Japanese"
+ end
+
+Typically method names are US-ASCII compatible since the keys to type them
+exist on all keyboards.
Method names may end with a <code>!</code> (bang or exclamation mark), a
<code>?</code> (question mark) or <code>=</code> equals sign.
-In the ruby core library when a method ends with a bang it indicates there is
-a non-bang method that has does not modify the receiver. This is typically
-true for the standard library but does not hold true for other ruby libraries.
-
-Methods that end with a question mark do not always return just +true+ or
-+false+. Often they will may return an object to indicate a true value (or
-"truthy" value).
+The bang methods (<code>!</code> at the end of method name) are called and
+executed just like any other method. However, by convention, a method with an
+exclamation point or bang is considered dangerous. In ruby core library the
+dangerous method implies that when a method ends with a bang (<code>!</code>),
+it indicates that unlike its non-bang equivalent, permanently modifies its
+receiver. Almost always, ruby core library will have a non-bang
+counterpart (method name which does NOT end with <code>!</code>) of every bang
+method (method name which does end with <code>!</code>) that does not modify
+the receiver. This convention is typically true for ruby core library but
+may or may not hold true for other ruby libraries.
+
+Methods that end with a question mark by convention return boolean, but they
+may not always return just +true+ or +false+. Often, they will return an
+object to indicate a true value (or "truthy" value).
Methods that end with an equals sign indicate an assignment method. For
-assignment methods the return value is ignored, the arguments are returned
+assignment methods, the return value is ignored and the arguments are returned
instead.
These are method names for the various ruby operators. Each of these
@@ -86,6 +109,25 @@ operator with an <code>@</code> as in <code>+@</code> or <code>!@</code>:
Unary methods accept zero arguments.
+Additionally, methods for element reference and assignment may be defined:
+<code>[]</code> and <code>[]=</code> respectively. Both can take one or more
+arguments, and element reference can take none.
+
+ class C
+ def [](a, b)
+ puts a + b
+ end
+
+ def []=(a, b, c)
+ puts a * b + c
+ end
+ end
+
+ obj = C.new
+
+ obj[2, 3] # prints "5"
+ obj[2, 3] = 4 # prints "10"
+
== Return Values
By default, a method returns the last expression that was evaluated in the body
@@ -106,7 +148,7 @@ evaluated.
end
Note that for assignment methods the return value will always be ignored.
-Instead the argument will be returned:
+Instead, the argument will be returned:
def a=(value)
return 1 + value
@@ -360,7 +402,7 @@ arguments must appear before any keyword arguments.
The block argument is indicated by <code>&</code> and must come last:
def my_method(&my_block)
- my_method.call(self)
+ my_block.call(self)
end
Most frequently the block argument is used to pass a block to another method:
@@ -408,7 +450,6 @@ May be written as:
# handle exception
end
-If you wish to rescue an exception for only part of your method use +begin+ and
+If you wish to rescue an exception for only part of your method, use +begin+ and
+end+. For more details see the page on {exception
handling}[rdoc-ref:syntax/exceptions.rdoc].
-
diff --git a/doc/syntax/miscellaneous.rdoc b/doc/syntax/miscellaneous.rdoc
index 8f424f019f..d5691f8d60 100644
--- a/doc/syntax/miscellaneous.rdoc
+++ b/doc/syntax/miscellaneous.rdoc
@@ -10,16 +10,16 @@ most frequently used with <code>ruby -e</code>.
== Indentation
-Ruby does not require any indentation. Typically ruby programs are indented
+Ruby does not require any indentation. Typically, ruby programs are indented
two spaces.
-If you run ruby with warnings enabled and have an indentation mis-match you
+If you run ruby with warnings enabled and have an indentation mis-match, you
will receive a warning.
== +alias+
The +alias+ keyword is most frequently used to alias methods. When aliasing a
-method you can use either its name or a symbol:
+method, you can use either its name or a symbol:
alias new_name old_name
alias :new_name :old_name
@@ -61,7 +61,7 @@ You may use +undef+ in any scope. See also Module#undef_method
p defined?(RUBY_VERSION) # prints "constant"
p defined?(1 + 1) # prints "method"
-You don't need to use parenthesis with +defined?+ but they are recommended due
+You don't need to use parenthesis with +defined?+, but they are recommended due
to the {low precedence}[rdoc-ref:syntax/precedence.rdoc] of +defined?+.
For example, if you wish to check if an instance variable exists and that the
@@ -69,7 +69,7 @@ instance variable is zero:
defined? @instance_variable && @instance_variable.zero?
-This returns <code>"expression"</code> which is not what you want if the
+This returns <code>"expression"</code>, which is not what you want if the
instance variable is not defined.
@instance_variable = 1
@@ -104,4 +104,3 @@ Here is an example one-liner that adds numbers from standard input or any files
in the argument list:
ruby -ne 'BEGIN { count = 0 }; END { puts count }; count += gets.to_i'
-
diff --git a/doc/syntax/modules_and_classes.rdoc b/doc/syntax/modules_and_classes.rdoc
index a82a6f27ed..dd70d4ac21 100644
--- a/doc/syntax/modules_and_classes.rdoc
+++ b/doc/syntax/modules_and_classes.rdoc
@@ -94,7 +94,7 @@ nesting:
end
However, if you use <code>::</code> to define <code>A::B</code> without
-nesting it inside +A+ a NameError exception will be raised because the nesting
+nesting it inside +A+, a NameError exception will be raised because the nesting
does not include +A+:
module A
@@ -129,7 +129,7 @@ method on a module is often called a "class method" instead of a "module
method". See also Module#module_function which can convert an instance method
into a class method.)
-When a class method references a constant it uses the same rules as referencing
+When a class method references a constant, it uses the same rules as referencing
it outside the method as the scope is the same.
Instance methods defined in a module are only callable when included. These
@@ -342,4 +342,3 @@ is equivalent to this code block:
end
Both objects will have a +my_method+ that returns +2+.
-
diff --git a/doc/syntax/refinements.rdoc b/doc/syntax/refinements.rdoc
index 1a516ed8b2..4cba61d396 100644
--- a/doc/syntax/refinements.rdoc
+++ b/doc/syntax/refinements.rdoc
@@ -9,11 +9,6 @@ Refinements are designed to reduce the impact of monkey patching on other
users of the monkey-patched class. Refinements provide a way to extend a
class locally.
-Refinements are an experimental feature in Ruby 2.0. At the time of writing,
-refinements are expected to exist in future versions of Ruby but the
-specification of refinements may change. You will receive a warning the first
-time you define or activate a refinement.
-
Here is a basic refinement:
class C
@@ -42,21 +37,27 @@ Activate the refinement with #using:
using M
- x = C.new
+ c = C.new
c.foo # prints "C#foo in M"
== Scope
-You may only activate refinements at top-level, not inside any class, module
-or method scope. You may activate refinements in a string passed to
-Kernel#eval that is evaluated at top-level. Refinements are active until the
-end of the file or the end of the eval string, respectively.
+You may activate refinements at top-level, and inside classes and modules.
+You may not activate refinements in method scope. Refinements are activated
+until the end of the current class or module definition, or until the end of
+the current file if used at the top-level.
+
+You may activate refinements in a string passed to Kernel#eval. Refinements
+are active the end of the eval string.
-Refinements are lexical in scope. When control is transferred outside the
-scope the refinement is deactivated. This means that if you require or load a
-file or call a method that is defined outside the current scope the refinement
-will be deactivated:
+Refinements are lexical in scope. Refinements are only active within a scope
+after the call to using. Any code before the using statement will not have the
+refinement activated.
+
+When control is transferred outside the scope the refinement is deactivated.
+This means that if you require or load a file or call a method that is defined
+outside the current scope the refinement will be deactivated:
class C
end
@@ -141,6 +142,26 @@ In a file:
end
# activated here
+In a class:
+
+ # not activated here
+ class Foo
+ # not activated here
+ def foo
+ # not activated here
+ end
+ using M
+ # activated here
+ def bar
+ # activated here
+ end
+ # activated here
+ end
+ # not activated here
+
+Note that the refinements in M are not activated automatically if the class
+Foo is reopened later.
+
In eval:
# not activated here
@@ -187,24 +208,6 @@ called:
p [{1=>2}, {3=>4}].to_json # prints "[{\"1\":2},{\"3\":4}]"
-You may also activate refinements in a class or module definition, in which
-case the refinements are activated from the point where using is called to
-the end of the class or module definition:
-
- # not activated here
- class Foo
- # not activated here
- using M
- # activated here
- def foo
- # activated here
- end
- # activated here
- end
- # not activated here
-
-Note that the refinements in M are not activated automatically even if the class
-Foo is reopened later.
== Method Lookup
@@ -252,15 +255,8 @@ method lookup.
This behavior may be changed in the future.
-== Refinements and module inclusion
-
-Refinements are inherited by module inclusion. That is, using activates all
-refinements in the ancestors of the specified module. Refinements in a
-descendant have priority over refinements in an ancestor.
-
== Further Reading
See http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RefinementsSpec for the
current specification for implementing refinements. The specification also
contains more details.
-
diff --git a/enc/Makefile.in b/enc/Makefile.in
index a64785d1c5..ac9cee9a40 100644
--- a/enc/Makefile.in
+++ b/enc/Makefile.in
@@ -22,10 +22,10 @@ DLEXT = @DLEXT@
OBJEXT = @OBJEXT@
LIBEXT = @LIBEXT@
-BUILTIN_ENCS = ascii.c us_ascii.c\
- unicode.c utf_8.c
+BUILTIN_ENCS = enc/ascii.c enc/us_ascii.c\
+ enc/unicode.c enc/utf_8.c
-BUILTIN_TRANSES = newline.trans
+BUILTIN_TRANSES = enc/trans/newline.trans
RUBY_SO_NAME = @RUBY_SO_NAME@
LIBRUBY = @LIBRUBY@
diff --git a/enc/ascii.c b/enc/ascii.c
index 72150c037c..4fdc976e12 100644
--- a/enc/ascii.c
+++ b/enc/ascii.c
@@ -29,6 +29,10 @@
*/
#include "regenc.h"
+#include "encindex.h"
+#ifndef ENCINDEX_ASCII
+#define ENCINDEX_ASCII 0
+#endif
OnigEncodingDefine(ascii, ASCII) = {
onigenc_single_byte_mbc_enc_len,
@@ -47,7 +51,7 @@ OnigEncodingDefine(ascii, ASCII) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- 0,
+ ENCINDEX_ASCII,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("BINARY", "ASCII-8BIT")
diff --git a/enc/big5.c b/enc/big5.c
index 9d7738d8f9..27315c4ba9 100644
--- a/enc/big5.c
+++ b/enc/big5.c
@@ -167,19 +167,19 @@ big5_mbc_enc_len0(const UChar* p, const UChar* e, int tridx, const int tbl[])
static int
big5_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
{
- return big5_mbc_enc_len0(p, e, 0, EncLen_BIG5);
+ return big5_mbc_enc_len0(p, e, 0, EncLen_BIG5);
}
static int
big5_hkscs_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
{
- return big5_mbc_enc_len0(p, e, 2, EncLen_BIG5_HKSCS);
+ return big5_mbc_enc_len0(p, e, 2, EncLen_BIG5_HKSCS);
}
static int
big5_uao_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
{
- return big5_mbc_enc_len0(p, e, 2, EncLen_BIG5_UAO);
+ return big5_mbc_enc_len0(p, e, 2, EncLen_BIG5_UAO);
}
static OnigCodePoint
diff --git a/enc/depend b/enc/depend
index 5750a0dc49..39a26a7b76 100644
--- a/enc/depend
+++ b/enc/depend
@@ -82,15 +82,9 @@ srcs: $(TRANSCSRCS)
% unless ENCS.empty? or TRANS.empty?
-% unless ENCS.empty?
-$(ENCOBJS): $(hdrdir)/ruby.h regenc.h oniguruma.h config.h defines.h ruby.h missing.h subst.h intern.h st.h encoding.h
-% end
% ENC_DEPS.each do |e, deps|
enc/<%=e%>.$(OBJEXT): <%=deps.map {|n| rule_subst % n}.join(' ')%>
% end
-% unless TRANS.empty?
-$(TRANSOBJS): $(hdrdir)/ruby.h ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.h st.h transcode_data.h subst.h encoding.h
-% end
% ATRANS.each do |e|
% src = "#{e}.trans"
@@ -138,12 +132,13 @@ enc/encdb.$(OBJEXT): encdb.h
enc/trans/transdb.$(OBJEXT): transdb.h
clean:
-% %w[$(ENCSOS) $(LIBENC) $(ENCOBJS) $(ENCCLEANOBJS) $(ENCCLEANLIBS) $(TRANSSOS) $(LIBTRANS) $(TRANSOBJS) $(TRANSCLEANOBJS) $(TRANSCLEANLIBS)].each do |clean|
+% %w[$(ENCSOS) $(LIBENC) $(ENCOBJS) $(ENCCLEANOBJS) $(ENCCLEANLIBS) $(TRANSSOS) $(LIBTRANS) $(TRANSOBJS) $(TRANSCLEANOBJS) $(TRANSCLEANLIBS) enc/trans/.time].each do |clean|
$(Q)$(RM) <%=pathrep[clean]%>
% end
% @ignore_error = $nmake ? '' : ' 2> /dev/null || true'
% unless inplace
$(Q)$(RM) enc/unicode/name2ctype.h
+ $(Q)$(RM) enc/jis/props.h
-$(Q)$(RMDIR) enc/unicode<%=@ignore_error%>
% end
% workdirs.reverse_each do|d|
@@ -154,7 +149,460 @@ clean-srcs:
$(Q)$(RM) <%=pathrep['$(TRANSCSRCS)']%>
-$(Q)$(RMDIR) <%=pathrep['enc/trans']%><%=@ignore_error%>
$(Q)$(RM) enc/unicode/name2ctype.h
+ $(Q)$(RM) enc/jis/props.h
-$(Q)$(RMDIR) <%=pathrep['enc/unicode']%><%=@ignore_error%>
+ -$(Q)$(RMDIR) <%=pathrep['enc/props']%><%=@ignore_error%>
-$(Q)$(RMDIR) <%=pathrep['enc']%><%=@ignore_error%>
<%# vim: set ft=eruby noexpandtab ts=8 sw=2 : -%>
+
+# AUTOGENERATED DEPENDENCIES START
+enc/ascii.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/ascii.$(OBJEXT): config.h
+enc/ascii.$(OBJEXT): defines.h
+enc/ascii.$(OBJEXT): enc/ascii.c
+enc/ascii.$(OBJEXT): missing.h
+enc/ascii.$(OBJEXT): oniguruma.h
+enc/big5.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/big5.$(OBJEXT): config.h
+enc/big5.$(OBJEXT): defines.h
+enc/big5.$(OBJEXT): enc/big5.c
+enc/big5.$(OBJEXT): missing.h
+enc/big5.$(OBJEXT): oniguruma.h
+enc/cp949.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/cp949.$(OBJEXT): config.h
+enc/cp949.$(OBJEXT): defines.h
+enc/cp949.$(OBJEXT): enc/cp949.c
+enc/cp949.$(OBJEXT): missing.h
+enc/cp949.$(OBJEXT): oniguruma.h
+enc/emacs_mule.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/emacs_mule.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/emacs_mule.$(OBJEXT): $(top_srcdir)/regint.h
+enc/emacs_mule.$(OBJEXT): config.h
+enc/emacs_mule.$(OBJEXT): defines.h
+enc/emacs_mule.$(OBJEXT): enc/emacs_mule.c
+enc/emacs_mule.$(OBJEXT): intern.h
+enc/emacs_mule.$(OBJEXT): missing.h
+enc/emacs_mule.$(OBJEXT): oniguruma.h
+enc/emacs_mule.$(OBJEXT): st.h
+enc/emacs_mule.$(OBJEXT): subst.h
+enc/encdb.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/encdb.$(OBJEXT): $(top_srcdir)/include/ruby.h
+enc/encdb.$(OBJEXT): $(top_srcdir)/internal.h
+enc/encdb.$(OBJEXT): config.h
+enc/encdb.$(OBJEXT): defines.h
+enc/encdb.$(OBJEXT): enc/encdb.c
+enc/encdb.$(OBJEXT): encdb.h
+enc/encdb.$(OBJEXT): encoding.h
+enc/encdb.$(OBJEXT): intern.h
+enc/encdb.$(OBJEXT): io.h
+enc/encdb.$(OBJEXT): missing.h
+enc/encdb.$(OBJEXT): oniguruma.h
+enc/encdb.$(OBJEXT): st.h
+enc/encdb.$(OBJEXT): subst.h
+enc/euc_jp.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/euc_jp.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/euc_jp.$(OBJEXT): $(top_srcdir)/regint.h
+enc/euc_jp.$(OBJEXT): config.h
+enc/euc_jp.$(OBJEXT): defines.h
+enc/euc_jp.$(OBJEXT): enc/euc_jp.c
+enc/euc_jp.$(OBJEXT): enc/jis/props.h
+enc/euc_jp.$(OBJEXT): enc/jis/props.kwd
+enc/euc_jp.$(OBJEXT): intern.h
+enc/euc_jp.$(OBJEXT): missing.h
+enc/euc_jp.$(OBJEXT): oniguruma.h
+enc/euc_jp.$(OBJEXT): st.h
+enc/euc_jp.$(OBJEXT): subst.h
+enc/euc_kr.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/euc_kr.$(OBJEXT): config.h
+enc/euc_kr.$(OBJEXT): defines.h
+enc/euc_kr.$(OBJEXT): enc/euc_kr.c
+enc/euc_kr.$(OBJEXT): missing.h
+enc/euc_kr.$(OBJEXT): oniguruma.h
+enc/euc_tw.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/euc_tw.$(OBJEXT): config.h
+enc/euc_tw.$(OBJEXT): defines.h
+enc/euc_tw.$(OBJEXT): enc/euc_tw.c
+enc/euc_tw.$(OBJEXT): missing.h
+enc/euc_tw.$(OBJEXT): oniguruma.h
+enc/gb18030.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/gb18030.$(OBJEXT): config.h
+enc/gb18030.$(OBJEXT): defines.h
+enc/gb18030.$(OBJEXT): enc/gb18030.c
+enc/gb18030.$(OBJEXT): missing.h
+enc/gb18030.$(OBJEXT): oniguruma.h
+enc/gb2312.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/gb2312.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/gb2312.$(OBJEXT): config.h
+enc/gb2312.$(OBJEXT): defines.h
+enc/gb2312.$(OBJEXT): enc/gb2312.c
+enc/gb2312.$(OBJEXT): encoding.h
+enc/gb2312.$(OBJEXT): intern.h
+enc/gb2312.$(OBJEXT): missing.h
+enc/gb2312.$(OBJEXT): oniguruma.h
+enc/gb2312.$(OBJEXT): st.h
+enc/gb2312.$(OBJEXT): subst.h
+enc/gbk.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/gbk.$(OBJEXT): config.h
+enc/gbk.$(OBJEXT): defines.h
+enc/gbk.$(OBJEXT): enc/gbk.c
+enc/gbk.$(OBJEXT): missing.h
+enc/gbk.$(OBJEXT): oniguruma.h
+enc/iso_8859_1.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_1.$(OBJEXT): config.h
+enc/iso_8859_1.$(OBJEXT): defines.h
+enc/iso_8859_1.$(OBJEXT): enc/iso_8859_1.c
+enc/iso_8859_1.$(OBJEXT): missing.h
+enc/iso_8859_1.$(OBJEXT): oniguruma.h
+enc/iso_8859_10.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_10.$(OBJEXT): config.h
+enc/iso_8859_10.$(OBJEXT): defines.h
+enc/iso_8859_10.$(OBJEXT): enc/iso_8859_10.c
+enc/iso_8859_10.$(OBJEXT): missing.h
+enc/iso_8859_10.$(OBJEXT): oniguruma.h
+enc/iso_8859_11.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_11.$(OBJEXT): config.h
+enc/iso_8859_11.$(OBJEXT): defines.h
+enc/iso_8859_11.$(OBJEXT): enc/iso_8859_11.c
+enc/iso_8859_11.$(OBJEXT): missing.h
+enc/iso_8859_11.$(OBJEXT): oniguruma.h
+enc/iso_8859_13.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_13.$(OBJEXT): config.h
+enc/iso_8859_13.$(OBJEXT): defines.h
+enc/iso_8859_13.$(OBJEXT): enc/iso_8859_13.c
+enc/iso_8859_13.$(OBJEXT): missing.h
+enc/iso_8859_13.$(OBJEXT): oniguruma.h
+enc/iso_8859_14.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_14.$(OBJEXT): config.h
+enc/iso_8859_14.$(OBJEXT): defines.h
+enc/iso_8859_14.$(OBJEXT): enc/iso_8859_14.c
+enc/iso_8859_14.$(OBJEXT): missing.h
+enc/iso_8859_14.$(OBJEXT): oniguruma.h
+enc/iso_8859_15.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_15.$(OBJEXT): config.h
+enc/iso_8859_15.$(OBJEXT): defines.h
+enc/iso_8859_15.$(OBJEXT): enc/iso_8859_15.c
+enc/iso_8859_15.$(OBJEXT): missing.h
+enc/iso_8859_15.$(OBJEXT): oniguruma.h
+enc/iso_8859_16.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_16.$(OBJEXT): config.h
+enc/iso_8859_16.$(OBJEXT): defines.h
+enc/iso_8859_16.$(OBJEXT): enc/iso_8859_16.c
+enc/iso_8859_16.$(OBJEXT): missing.h
+enc/iso_8859_16.$(OBJEXT): oniguruma.h
+enc/iso_8859_2.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_2.$(OBJEXT): config.h
+enc/iso_8859_2.$(OBJEXT): defines.h
+enc/iso_8859_2.$(OBJEXT): enc/iso_8859_2.c
+enc/iso_8859_2.$(OBJEXT): missing.h
+enc/iso_8859_2.$(OBJEXT): oniguruma.h
+enc/iso_8859_3.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_3.$(OBJEXT): config.h
+enc/iso_8859_3.$(OBJEXT): defines.h
+enc/iso_8859_3.$(OBJEXT): enc/iso_8859_3.c
+enc/iso_8859_3.$(OBJEXT): missing.h
+enc/iso_8859_3.$(OBJEXT): oniguruma.h
+enc/iso_8859_4.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_4.$(OBJEXT): config.h
+enc/iso_8859_4.$(OBJEXT): defines.h
+enc/iso_8859_4.$(OBJEXT): enc/iso_8859_4.c
+enc/iso_8859_4.$(OBJEXT): missing.h
+enc/iso_8859_4.$(OBJEXT): oniguruma.h
+enc/iso_8859_5.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_5.$(OBJEXT): config.h
+enc/iso_8859_5.$(OBJEXT): defines.h
+enc/iso_8859_5.$(OBJEXT): enc/iso_8859_5.c
+enc/iso_8859_5.$(OBJEXT): missing.h
+enc/iso_8859_5.$(OBJEXT): oniguruma.h
+enc/iso_8859_6.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_6.$(OBJEXT): config.h
+enc/iso_8859_6.$(OBJEXT): defines.h
+enc/iso_8859_6.$(OBJEXT): enc/iso_8859_6.c
+enc/iso_8859_6.$(OBJEXT): missing.h
+enc/iso_8859_6.$(OBJEXT): oniguruma.h
+enc/iso_8859_7.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_7.$(OBJEXT): config.h
+enc/iso_8859_7.$(OBJEXT): defines.h
+enc/iso_8859_7.$(OBJEXT): enc/iso_8859_7.c
+enc/iso_8859_7.$(OBJEXT): missing.h
+enc/iso_8859_7.$(OBJEXT): oniguruma.h
+enc/iso_8859_8.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_8.$(OBJEXT): config.h
+enc/iso_8859_8.$(OBJEXT): defines.h
+enc/iso_8859_8.$(OBJEXT): enc/iso_8859_8.c
+enc/iso_8859_8.$(OBJEXT): missing.h
+enc/iso_8859_8.$(OBJEXT): oniguruma.h
+enc/iso_8859_9.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_9.$(OBJEXT): config.h
+enc/iso_8859_9.$(OBJEXT): defines.h
+enc/iso_8859_9.$(OBJEXT): enc/iso_8859_9.c
+enc/iso_8859_9.$(OBJEXT): missing.h
+enc/iso_8859_9.$(OBJEXT): oniguruma.h
+enc/koi8_r.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/koi8_r.$(OBJEXT): config.h
+enc/koi8_r.$(OBJEXT): defines.h
+enc/koi8_r.$(OBJEXT): enc/koi8_r.c
+enc/koi8_r.$(OBJEXT): missing.h
+enc/koi8_r.$(OBJEXT): oniguruma.h
+enc/koi8_u.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/koi8_u.$(OBJEXT): config.h
+enc/koi8_u.$(OBJEXT): defines.h
+enc/koi8_u.$(OBJEXT): enc/koi8_u.c
+enc/koi8_u.$(OBJEXT): missing.h
+enc/koi8_u.$(OBJEXT): oniguruma.h
+enc/shift_jis.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/shift_jis.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/shift_jis.$(OBJEXT): $(top_srcdir)/regint.h
+enc/shift_jis.$(OBJEXT): config.h
+enc/shift_jis.$(OBJEXT): defines.h
+enc/shift_jis.$(OBJEXT): enc/jis/props.h
+enc/shift_jis.$(OBJEXT): enc/jis/props.kwd
+enc/shift_jis.$(OBJEXT): enc/shift_jis.c
+enc/shift_jis.$(OBJEXT): intern.h
+enc/shift_jis.$(OBJEXT): missing.h
+enc/shift_jis.$(OBJEXT): oniguruma.h
+enc/shift_jis.$(OBJEXT): st.h
+enc/shift_jis.$(OBJEXT): subst.h
+enc/trans/big5.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/big5.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/big5.$(OBJEXT): config.h
+enc/trans/big5.$(OBJEXT): defines.h
+enc/trans/big5.$(OBJEXT): enc/trans/big5.c
+enc/trans/big5.$(OBJEXT): intern.h
+enc/trans/big5.$(OBJEXT): missing.h
+enc/trans/big5.$(OBJEXT): st.h
+enc/trans/big5.$(OBJEXT): subst.h
+enc/trans/chinese.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/chinese.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/chinese.$(OBJEXT): config.h
+enc/trans/chinese.$(OBJEXT): defines.h
+enc/trans/chinese.$(OBJEXT): enc/trans/chinese.c
+enc/trans/chinese.$(OBJEXT): intern.h
+enc/trans/chinese.$(OBJEXT): missing.h
+enc/trans/chinese.$(OBJEXT): st.h
+enc/trans/chinese.$(OBJEXT): subst.h
+enc/trans/emoji.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/emoji.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji.$(OBJEXT): config.h
+enc/trans/emoji.$(OBJEXT): defines.h
+enc/trans/emoji.$(OBJEXT): enc/trans/emoji.c
+enc/trans/emoji.$(OBJEXT): intern.h
+enc/trans/emoji.$(OBJEXT): missing.h
+enc/trans/emoji.$(OBJEXT): st.h
+enc/trans/emoji.$(OBJEXT): subst.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): config.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): defines.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): enc/trans/emoji_iso2022_kddi.c
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): intern.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): missing.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): st.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): subst.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): config.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): defines.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): enc/trans/emoji_sjis_docomo.c
+enc/trans/emoji_sjis_docomo.$(OBJEXT): intern.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): missing.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): st.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): subst.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): config.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): defines.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): enc/trans/emoji_sjis_kddi.c
+enc/trans/emoji_sjis_kddi.$(OBJEXT): intern.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): missing.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): st.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): subst.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): config.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): defines.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): enc/trans/emoji_sjis_softbank.c
+enc/trans/emoji_sjis_softbank.$(OBJEXT): intern.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): missing.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): st.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): subst.h
+enc/trans/escape.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/escape.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/escape.$(OBJEXT): config.h
+enc/trans/escape.$(OBJEXT): defines.h
+enc/trans/escape.$(OBJEXT): enc/trans/escape.c
+enc/trans/escape.$(OBJEXT): intern.h
+enc/trans/escape.$(OBJEXT): missing.h
+enc/trans/escape.$(OBJEXT): st.h
+enc/trans/escape.$(OBJEXT): subst.h
+enc/trans/gb18030.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/gb18030.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/gb18030.$(OBJEXT): config.h
+enc/trans/gb18030.$(OBJEXT): defines.h
+enc/trans/gb18030.$(OBJEXT): enc/trans/gb18030.c
+enc/trans/gb18030.$(OBJEXT): intern.h
+enc/trans/gb18030.$(OBJEXT): missing.h
+enc/trans/gb18030.$(OBJEXT): st.h
+enc/trans/gb18030.$(OBJEXT): subst.h
+enc/trans/gbk.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/gbk.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/gbk.$(OBJEXT): config.h
+enc/trans/gbk.$(OBJEXT): defines.h
+enc/trans/gbk.$(OBJEXT): enc/trans/gbk.c
+enc/trans/gbk.$(OBJEXT): intern.h
+enc/trans/gbk.$(OBJEXT): missing.h
+enc/trans/gbk.$(OBJEXT): st.h
+enc/trans/gbk.$(OBJEXT): subst.h
+enc/trans/iso2022.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/iso2022.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/iso2022.$(OBJEXT): config.h
+enc/trans/iso2022.$(OBJEXT): defines.h
+enc/trans/iso2022.$(OBJEXT): enc/trans/iso2022.c
+enc/trans/iso2022.$(OBJEXT): intern.h
+enc/trans/iso2022.$(OBJEXT): missing.h
+enc/trans/iso2022.$(OBJEXT): st.h
+enc/trans/iso2022.$(OBJEXT): subst.h
+enc/trans/japanese.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/japanese.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/japanese.$(OBJEXT): config.h
+enc/trans/japanese.$(OBJEXT): defines.h
+enc/trans/japanese.$(OBJEXT): enc/trans/japanese.c
+enc/trans/japanese.$(OBJEXT): intern.h
+enc/trans/japanese.$(OBJEXT): missing.h
+enc/trans/japanese.$(OBJEXT): st.h
+enc/trans/japanese.$(OBJEXT): subst.h
+enc/trans/japanese_euc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/japanese_euc.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/japanese_euc.$(OBJEXT): config.h
+enc/trans/japanese_euc.$(OBJEXT): defines.h
+enc/trans/japanese_euc.$(OBJEXT): enc/trans/japanese_euc.c
+enc/trans/japanese_euc.$(OBJEXT): intern.h
+enc/trans/japanese_euc.$(OBJEXT): missing.h
+enc/trans/japanese_euc.$(OBJEXT): st.h
+enc/trans/japanese_euc.$(OBJEXT): subst.h
+enc/trans/japanese_sjis.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/japanese_sjis.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/japanese_sjis.$(OBJEXT): config.h
+enc/trans/japanese_sjis.$(OBJEXT): defines.h
+enc/trans/japanese_sjis.$(OBJEXT): enc/trans/japanese_sjis.c
+enc/trans/japanese_sjis.$(OBJEXT): intern.h
+enc/trans/japanese_sjis.$(OBJEXT): missing.h
+enc/trans/japanese_sjis.$(OBJEXT): st.h
+enc/trans/japanese_sjis.$(OBJEXT): subst.h
+enc/trans/korean.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/korean.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/korean.$(OBJEXT): config.h
+enc/trans/korean.$(OBJEXT): defines.h
+enc/trans/korean.$(OBJEXT): enc/trans/korean.c
+enc/trans/korean.$(OBJEXT): intern.h
+enc/trans/korean.$(OBJEXT): missing.h
+enc/trans/korean.$(OBJEXT): st.h
+enc/trans/korean.$(OBJEXT): subst.h
+enc/trans/newline.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/newline.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/newline.$(OBJEXT): config.h
+enc/trans/newline.$(OBJEXT): defines.h
+enc/trans/newline.$(OBJEXT): enc/trans/newline.c
+enc/trans/newline.$(OBJEXT): intern.h
+enc/trans/newline.$(OBJEXT): missing.h
+enc/trans/newline.$(OBJEXT): st.h
+enc/trans/newline.$(OBJEXT): subst.h
+enc/trans/single_byte.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/single_byte.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/single_byte.$(OBJEXT): config.h
+enc/trans/single_byte.$(OBJEXT): defines.h
+enc/trans/single_byte.$(OBJEXT): enc/trans/single_byte.c
+enc/trans/single_byte.$(OBJEXT): intern.h
+enc/trans/single_byte.$(OBJEXT): missing.h
+enc/trans/single_byte.$(OBJEXT): st.h
+enc/trans/single_byte.$(OBJEXT): subst.h
+enc/trans/transdb.$(OBJEXT): enc/trans/transdb.c
+enc/trans/transdb.$(OBJEXT): transdb.h
+enc/trans/utf8_mac.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/utf8_mac.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/utf8_mac.$(OBJEXT): config.h
+enc/trans/utf8_mac.$(OBJEXT): defines.h
+enc/trans/utf8_mac.$(OBJEXT): enc/trans/utf8_mac.c
+enc/trans/utf8_mac.$(OBJEXT): intern.h
+enc/trans/utf8_mac.$(OBJEXT): missing.h
+enc/trans/utf8_mac.$(OBJEXT): st.h
+enc/trans/utf8_mac.$(OBJEXT): subst.h
+enc/trans/utf_16_32.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/trans/utf_16_32.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/utf_16_32.$(OBJEXT): config.h
+enc/trans/utf_16_32.$(OBJEXT): defines.h
+enc/trans/utf_16_32.$(OBJEXT): enc/trans/utf_16_32.c
+enc/trans/utf_16_32.$(OBJEXT): intern.h
+enc/trans/utf_16_32.$(OBJEXT): missing.h
+enc/trans/utf_16_32.$(OBJEXT): st.h
+enc/trans/utf_16_32.$(OBJEXT): subst.h
+enc/unicode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/unicode.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/unicode.$(OBJEXT): $(top_srcdir)/regint.h
+enc/unicode.$(OBJEXT): config.h
+enc/unicode.$(OBJEXT): defines.h
+enc/unicode.$(OBJEXT): enc/unicode.c
+enc/unicode.$(OBJEXT): enc/unicode/casefold.h
+enc/unicode.$(OBJEXT): enc/unicode/name2ctype.h
+enc/unicode.$(OBJEXT): intern.h
+enc/unicode.$(OBJEXT): missing.h
+enc/unicode.$(OBJEXT): oniguruma.h
+enc/unicode.$(OBJEXT): st.h
+enc/unicode.$(OBJEXT): subst.h
+enc/us_ascii.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/us_ascii.$(OBJEXT): config.h
+enc/us_ascii.$(OBJEXT): defines.h
+enc/us_ascii.$(OBJEXT): enc/us_ascii.c
+enc/us_ascii.$(OBJEXT): missing.h
+enc/us_ascii.$(OBJEXT): oniguruma.h
+enc/utf_16be.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/utf_16be.$(OBJEXT): config.h
+enc/utf_16be.$(OBJEXT): defines.h
+enc/utf_16be.$(OBJEXT): enc/utf_16be.c
+enc/utf_16be.$(OBJEXT): missing.h
+enc/utf_16be.$(OBJEXT): oniguruma.h
+enc/utf_16le.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/utf_16le.$(OBJEXT): config.h
+enc/utf_16le.$(OBJEXT): defines.h
+enc/utf_16le.$(OBJEXT): enc/utf_16le.c
+enc/utf_16le.$(OBJEXT): missing.h
+enc/utf_16le.$(OBJEXT): oniguruma.h
+enc/utf_32be.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/utf_32be.$(OBJEXT): config.h
+enc/utf_32be.$(OBJEXT): defines.h
+enc/utf_32be.$(OBJEXT): enc/utf_32be.c
+enc/utf_32be.$(OBJEXT): missing.h
+enc/utf_32be.$(OBJEXT): oniguruma.h
+enc/utf_32le.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/utf_32le.$(OBJEXT): config.h
+enc/utf_32le.$(OBJEXT): defines.h
+enc/utf_32le.$(OBJEXT): enc/utf_32le.c
+enc/utf_32le.$(OBJEXT): missing.h
+enc/utf_32le.$(OBJEXT): oniguruma.h
+enc/utf_8.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/utf_8.$(OBJEXT): config.h
+enc/utf_8.$(OBJEXT): defines.h
+enc/utf_8.$(OBJEXT): enc/utf_8.c
+enc/utf_8.$(OBJEXT): missing.h
+enc/utf_8.$(OBJEXT): oniguruma.h
+enc/windows_1251.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/windows_1251.$(OBJEXT): config.h
+enc/windows_1251.$(OBJEXT): defines.h
+enc/windows_1251.$(OBJEXT): enc/windows_1251.c
+enc/windows_1251.$(OBJEXT): missing.h
+enc/windows_1251.$(OBJEXT): oniguruma.h
+enc/windows_31j.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+enc/windows_31j.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/windows_31j.$(OBJEXT): $(top_srcdir)/regint.h
+enc/windows_31j.$(OBJEXT): config.h
+enc/windows_31j.$(OBJEXT): defines.h
+enc/windows_31j.$(OBJEXT): enc/jis/props.h
+enc/windows_31j.$(OBJEXT): enc/jis/props.kwd
+enc/windows_31j.$(OBJEXT): enc/shift_jis.c
+enc/windows_31j.$(OBJEXT): enc/windows_31j.c
+enc/windows_31j.$(OBJEXT): intern.h
+enc/windows_31j.$(OBJEXT): missing.h
+enc/windows_31j.$(OBJEXT): oniguruma.h
+enc/windows_31j.$(OBJEXT): st.h
+enc/windows_31j.$(OBJEXT): subst.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/enc/ebcdic.h b/enc/ebcdic.h
new file mode 100644
index 0000000000..a3b380a327
--- /dev/null
+++ b/enc/ebcdic.h
@@ -0,0 +1,11 @@
+#include "regenc.h"
+/* dummy for unsupported, non-ascii-based encoding */
+ENC_DUMMY("IBM037");
+ENC_ALIAS("ebcdic-cp-us", "IBM037");
+
+/* we start with just defining a single EBCDIC encoding,
+ * hopefully the most widely used one.
+ *
+ * See http://www.iana.org/assignments/character-sets/character-sets.xhtml
+ * http://tools.ietf.org/html/rfc1345
+ */
diff --git a/enc/encdb.c b/enc/encdb.c
index fa04a5f7f6..a41e4edc6d 100644
--- a/enc/encdb.c
+++ b/enc/encdb.c
@@ -9,13 +9,8 @@
**********************************************************************/
-int rb_encdb_replicate(const char *alias, const char *orig);
-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);
-int rb_enc_set_dummy(int index);
-void rb_encdb_set_unicode(int index);
+#include "internal.h"
+
#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)
diff --git a/enc/encinit.c.erb b/enc/encinit.c.erb
index fd3ade0c4b..70c2a1934c 100644
--- a/enc/encinit.c.erb
+++ b/enc/encinit.c.erb
@@ -8,19 +8,30 @@
ruby_init_ext(name, func); \
}
+#define init_enc(name) init(Init_##name, "enc/"#name".so")
+#define init_trans(name) init(Init_trans_##name, "enc/trans/"#name".so")
+#define provide(func, name) { \
+ extern void Init_##func(void); \
+ Init_##func(); \
+ rb_provide(name".so"); \
+}
+
void ruby_init_ext(const char *name, void (*init)(void));
+void rb_provide(const char *feature);
void
Init_enc(void)
{
+ provide(encdb, "encdb");
% ENCS.each do |enc|
- init(Init_<%= enc %>, "enc/<%= enc %>.so");
+% next if enc == 'encdb'
+ init_enc(<%= enc %>);
% end
- init(Init_transdb, "enc/trans/transdb.so");
+ provide(transdb, "trans/transdb");
% TRANS.each do |trans|
% next if trans == 'trans/transdb'
- init(Init_trans_<%= File.basename trans %>, "enc/<%= trans %>.so");
+ init_trans(<%= File.basename trans %>);
% end
}
<%# vim: set ft=eruby sw=2 : -%>
diff --git a/enc/euc_jp.c b/enc/euc_jp.c
index d7af1abaee..7922aac150 100644
--- a/enc/euc_jp.c
+++ b/enc/euc_jp.c
@@ -293,7 +293,7 @@ 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,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, f, arg);
}
@@ -381,8 +381,10 @@ mbc_case_fold(OnigCaseFoldType flag,
OnigCodePoint code;
int len;
+ len = mbc_enc_len(p, end, enc);
code = get_lower_case(mbc_to_code(p, end, enc));
len = code_to_mbc(code, lower, enc);
+ if (len == ONIGERR_INVALID_CODE_POINT_VALUE) len = 1;
(*pp) += len;
return len; /* return byte length of converted char to lower */
}
@@ -418,12 +420,6 @@ is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc ARG_
}
-static int PropertyInited = 0;
-static const OnigCodePoint** PropertyList;
-static int PropertyListNum;
-static int PropertyListSize;
-static hash_table_type* PropertyNameTable;
-
static const OnigCodePoint CR_Hiragana[] = {
1,
#ifdef ENC_EUC_JIS_2004
@@ -504,41 +500,20 @@ static const OnigCodePoint CR_Cyrillic[] = {
/* TODO: add JIS X 0212 row 7 */
}; /* CR_Cyrillic */
-static int
-init_property_list(void)
-{
- int r;
-
- 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:
- return r;
-}
+#include "enc/jis/props.h"
static int
-property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
+property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
{
- st_data_t ctype;
- UChar *s, *e;
-
- PROPERTY_LIST_INIT_CHECK;
+ const UChar *s = p, *e = end;
+ const struct enc_property *prop =
+ onig_jis_property((const char* )s, (unsigned int )(e - s));
- s = e = ALLOCA_N(UChar, end-p+1);
- for (; p < end; p++) {
- *e++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- }
-
- if (onig_st_lookup_strend(PropertyNameTable, s, e, &ctype) == 0) {
+ if (!prop) {
return onigenc_minimum_property_name_to_ctype(enc, s, e);
}
- return (int )ctype;
+ return (int )prop->ctype;
}
static int
@@ -554,8 +529,6 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE
}
}
else {
- PROPERTY_LIST_INIT_CHECK;
-
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (unsigned int )PropertyListNum)
return ONIGERR_TYPE_BUG;
@@ -576,8 +549,6 @@ get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
else {
*sb_out = 0x80;
- PROPERTY_LIST_INIT_CHECK;
-
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (OnigCtype )PropertyListNum)
return ONIGERR_TYPE_BUG;
diff --git a/enc/iso_2022_jp.h b/enc/iso_2022_jp.h
index 399c2f56a5..9240130166 100644
--- a/enc/iso_2022_jp.h
+++ b/enc/iso_2022_jp.h
@@ -1,5 +1,5 @@
#include "regenc.h"
-/* dummy for unsupported, statefull encoding */
+/* dummy for unsupported, stateful encoding */
ENC_DUMMY("ISO-2022-JP");
ENC_ALIAS("ISO2022-JP", "ISO-2022-JP");
ENC_REPLICATE("ISO-2022-JP-2", "ISO-2022-JP");
diff --git a/enc/iso_8859_1.c b/enc/iso_8859_1.c
index 92dc14f978..e3315876cd 100644
--- a/enc/iso_8859_1.c
+++ b/enc/iso_8859_1.c
@@ -29,8 +29,6 @@
#include "regenc.h"
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-
#define ENC_IS_ISO_8859_1_CTYPE(code,ctype) \
((EncISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
@@ -277,13 +275,3 @@ OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-1", "ISO-8859-1")
-
-/*
- * Name: windows-1252
- * MIBenum: 2252
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1252
- */
-ENC_REPLICATE("Windows-1252", "ISO-8859-1")
-ENC_ALIAS("CP1252", "Windows-1252")
diff --git a/enc/iso_8859_10.c b/enc/iso_8859_10.c
index ec20a15baa..ab71a5adcf 100644
--- a/enc/iso_8859_10.c
+++ b/enc/iso_8859_10.c
@@ -208,7 +208,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -219,7 +219,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/iso_8859_13.c b/enc/iso_8859_13.c
index 4d7b328818..4ecf15678f 100644
--- a/enc/iso_8859_13.c
+++ b/enc/iso_8859_13.c
@@ -158,6 +158,10 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE
}
static const OnigPairCaseFoldCodes CaseFoldMap[] = {
+ { 0xa8, 0xb8 },
+ { 0xaa, 0xba },
+ { 0xaf, 0xbf },
+
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
{ 0xc2, 0xe2 },
@@ -197,7 +201,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -208,7 +212,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/iso_8859_14.c b/enc/iso_8859_14.c
index 1271c8a7a6..2939e89b7b 100644
--- a/enc/iso_8859_14.c
+++ b/enc/iso_8859_14.c
@@ -210,7 +210,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -221,7 +221,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/iso_8859_15.c b/enc/iso_8859_15.c
index 451033e158..fdb7ca12d7 100644
--- a/enc/iso_8859_15.c
+++ b/enc/iso_8859_15.c
@@ -204,7 +204,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -215,7 +215,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/iso_8859_16.c b/enc/iso_8859_16.c
index 5234cf0e7f..5e53f3b6d0 100644
--- a/enc/iso_8859_16.c
+++ b/enc/iso_8859_16.c
@@ -206,7 +206,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -217,7 +217,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/iso_8859_2.c b/enc/iso_8859_2.c
index f4cb9100df..9302e62fc1 100644
--- a/enc/iso_8859_2.c
+++ b/enc/iso_8859_2.c
@@ -29,8 +29,6 @@
#include "regenc.h"
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-
#define ENC_ISO_8859_2_TO_LOWER_CASE(c) EncISO_8859_2_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_2_CTYPE(code,ctype) \
((EncISO_8859_2_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
@@ -242,13 +240,3 @@ OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-2", "ISO-8859-2")
-
-/*
- * Name: windows-1250
- * MIBenum: 2250
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1250.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1250
- */
-ENC_REPLICATE("Windows-1250", "ISO-8859-2")
-ENC_ALIAS("CP1250", "Windows-1250")
diff --git a/enc/iso_8859_3.c b/enc/iso_8859_3.c
index 85572574b8..863a575020 100644
--- a/enc/iso_8859_3.c
+++ b/enc/iso_8859_3.c
@@ -204,7 +204,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -215,7 +215,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/iso_8859_4.c b/enc/iso_8859_4.c
index 771a2cf6e7..6a74406303 100644
--- a/enc/iso_8859_4.c
+++ b/enc/iso_8859_4.c
@@ -166,6 +166,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
{ 0xab, 0xbb },
{ 0xac, 0xbc },
{ 0xae, 0xbe },
+ { 0xbd, 0xbf },
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
@@ -206,7 +207,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -217,7 +218,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/iso_8859_5.c b/enc/iso_8859_5.c
index 4ee27b10d8..e71a488c4c 100644
--- a/enc/iso_8859_5.c
+++ b/enc/iso_8859_5.c
@@ -194,7 +194,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, f, arg);
}
@@ -205,7 +205,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, p, end, items);
}
diff --git a/enc/iso_8859_7.c b/enc/iso_8859_7.c
index aa82f880f9..8d07cb6310 100644
--- a/enc/iso_8859_7.c
+++ b/enc/iso_8859_7.c
@@ -190,7 +190,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, f, arg);
}
@@ -201,7 +201,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, p, end, items);
}
diff --git a/enc/iso_8859_9.c b/enc/iso_8859_9.c
index 0adafa3ed4..211ba3b2f3 100644
--- a/enc/iso_8859_9.c
+++ b/enc/iso_8859_9.c
@@ -197,7 +197,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, f, arg);
}
@@ -208,7 +208,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
diff --git a/enc/jis/props.h b/enc/jis/props.h
new file mode 100644
index 0000000000..4ae2e1fd23
--- /dev/null
+++ b/enc/jis/props.h
@@ -0,0 +1,227 @@
+/* C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property enc/jis/props.kwd */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "enc/jis/props.kwd"
+/* -*- c -*- */
+#define GPERF_DOWNCASE 1
+#define GPERF_CASE_STRNCMP 1
+
+static inline int
+gperf_case_strncmp(const char *s1, const char *s2, unsigned int n)
+{
+ const UChar *str = (const UChar *)s1;
+ const UChar *s = (const UChar *)s2;
+ return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n);
+}
+
+enum onigenc_jis_ctype {
+ onigenc_jis_min = ONIGENC_MAX_STD_CTYPE,
+ onigenc_jis_hiragana,
+ onigenc_jis_katakana,
+ onigenc_jis_han,
+ onigenc_jis_latin,
+ onigenc_jis_greek,
+ onigenc_jis_cyrillic,
+ onigenc_jis_max
+};
+
+enum {PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1};
+
+static const OnigCodePoint* const PropertyList[PropertyListNum] = {
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Han,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+};
+
+struct enc_property {
+ signed char name;
+ unsigned char ctype;
+};
+
+static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
+#line 43 "enc/jis/props.kwd"
+struct enc_property;
+
+#define TOTAL_KEYWORDS 6
+#define MIN_WORD_LENGTH 3
+#define MAX_WORD_LENGTH 8
+#define MIN_HASH_VALUE 5
+#define MAX_HASH_VALUE 12
+/* maximum key range = 8, duplicates = 0 */
+
+#ifndef GPERF_DOWNCASE
+#define GPERF_DOWNCASE 1
+static unsigned char gperf_downcase[256] =
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
+ 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
+ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
+ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
+ 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
+ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
+ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
+ 255
+ };
+#endif
+
+#ifndef GPERF_CASE_STRNCMP
+#define GPERF_CASE_STRNCMP 1
+static int
+gperf_case_strncmp (s1, s2, n)
+ register const char *s1;
+ register const char *s2;
+ register unsigned int n;
+{
+ for (; n > 0;)
+ {
+ unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
+ unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
+ if (c1 != 0 && c1 == c2)
+ {
+ n--;
+ continue;
+ }
+ return (int)c1 - (int)c2;
+ }
+ return 0;
+}
+#endif
+
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__)
+inline
+#elif defined(__GNUC__)
+__inline
+#endif
+static unsigned int
+onig_jis_property_hash (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const unsigned char asso_values[] =
+ {
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 3, 13, 2,
+ 13, 1, 1, 13, 13, 2, 1, 13, 1, 13,
+ 13, 13, 1, 13, 1, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 3,
+ 13, 2, 13, 1, 1, 13, 13, 2, 1, 13,
+ 1, 13, 13, 13, 1, 13, 1, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13
+ };
+ return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
+}
+
+struct onig_jis_property_pool_t
+ {
+ char onig_jis_property_pool_str5[sizeof("han")];
+ char onig_jis_property_pool_str7[sizeof("latin")];
+ char onig_jis_property_pool_str8[sizeof("greek")];
+ char onig_jis_property_pool_str10[sizeof("hiragana")];
+ char onig_jis_property_pool_str11[sizeof("katakana")];
+ char onig_jis_property_pool_str12[sizeof("cyrillic")];
+ };
+static const struct onig_jis_property_pool_t onig_jis_property_pool_contents =
+ {
+ "han",
+ "latin",
+ "greek",
+ "hiragana",
+ "katakana",
+ "cyrillic"
+ };
+#define onig_jis_property_pool ((const char *) &onig_jis_property_pool_contents)
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct enc_property *
+onig_jis_property (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const struct enc_property wordlist[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1},
+#line 48 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str5), onigenc_jis_han},
+ {-1},
+#line 49 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str7), onigenc_jis_latin},
+#line 50 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str8), onigenc_jis_greek},
+ {-1},
+#line 46 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str10), onigenc_jis_hiragana},
+#line 47 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str11), onigenc_jis_katakana},
+#line 51 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str12), onigenc_jis_cyrillic}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = onig_jis_property_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = wordlist[key].name;
+ if (o >= 0)
+ {
+ register const char *s = o + onig_jis_property_pool;
+
+ if ((((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strncmp (str, s, len) && s[len] == '\0')
+ return &wordlist[key];
+ }
+ }
+ }
+ return 0;
+}
+#line 52 "enc/jis/props.kwd"
+
diff --git a/enc/jis/props.h.blt b/enc/jis/props.h.blt
new file mode 100644
index 0000000000..4ae2e1fd23
--- /dev/null
+++ b/enc/jis/props.h.blt
@@ -0,0 +1,227 @@
+/* C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property enc/jis/props.kwd */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "enc/jis/props.kwd"
+/* -*- c -*- */
+#define GPERF_DOWNCASE 1
+#define GPERF_CASE_STRNCMP 1
+
+static inline int
+gperf_case_strncmp(const char *s1, const char *s2, unsigned int n)
+{
+ const UChar *str = (const UChar *)s1;
+ const UChar *s = (const UChar *)s2;
+ return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n);
+}
+
+enum onigenc_jis_ctype {
+ onigenc_jis_min = ONIGENC_MAX_STD_CTYPE,
+ onigenc_jis_hiragana,
+ onigenc_jis_katakana,
+ onigenc_jis_han,
+ onigenc_jis_latin,
+ onigenc_jis_greek,
+ onigenc_jis_cyrillic,
+ onigenc_jis_max
+};
+
+enum {PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1};
+
+static const OnigCodePoint* const PropertyList[PropertyListNum] = {
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Han,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+};
+
+struct enc_property {
+ signed char name;
+ unsigned char ctype;
+};
+
+static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
+#line 43 "enc/jis/props.kwd"
+struct enc_property;
+
+#define TOTAL_KEYWORDS 6
+#define MIN_WORD_LENGTH 3
+#define MAX_WORD_LENGTH 8
+#define MIN_HASH_VALUE 5
+#define MAX_HASH_VALUE 12
+/* maximum key range = 8, duplicates = 0 */
+
+#ifndef GPERF_DOWNCASE
+#define GPERF_DOWNCASE 1
+static unsigned char gperf_downcase[256] =
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
+ 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
+ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
+ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
+ 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
+ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
+ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
+ 255
+ };
+#endif
+
+#ifndef GPERF_CASE_STRNCMP
+#define GPERF_CASE_STRNCMP 1
+static int
+gperf_case_strncmp (s1, s2, n)
+ register const char *s1;
+ register const char *s2;
+ register unsigned int n;
+{
+ for (; n > 0;)
+ {
+ unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
+ unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
+ if (c1 != 0 && c1 == c2)
+ {
+ n--;
+ continue;
+ }
+ return (int)c1 - (int)c2;
+ }
+ return 0;
+}
+#endif
+
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__)
+inline
+#elif defined(__GNUC__)
+__inline
+#endif
+static unsigned int
+onig_jis_property_hash (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const unsigned char asso_values[] =
+ {
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 3, 13, 2,
+ 13, 1, 1, 13, 13, 2, 1, 13, 1, 13,
+ 13, 13, 1, 13, 1, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 3,
+ 13, 2, 13, 1, 1, 13, 13, 2, 1, 13,
+ 1, 13, 13, 13, 1, 13, 1, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13
+ };
+ return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
+}
+
+struct onig_jis_property_pool_t
+ {
+ char onig_jis_property_pool_str5[sizeof("han")];
+ char onig_jis_property_pool_str7[sizeof("latin")];
+ char onig_jis_property_pool_str8[sizeof("greek")];
+ char onig_jis_property_pool_str10[sizeof("hiragana")];
+ char onig_jis_property_pool_str11[sizeof("katakana")];
+ char onig_jis_property_pool_str12[sizeof("cyrillic")];
+ };
+static const struct onig_jis_property_pool_t onig_jis_property_pool_contents =
+ {
+ "han",
+ "latin",
+ "greek",
+ "hiragana",
+ "katakana",
+ "cyrillic"
+ };
+#define onig_jis_property_pool ((const char *) &onig_jis_property_pool_contents)
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct enc_property *
+onig_jis_property (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const struct enc_property wordlist[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1},
+#line 48 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str5), onigenc_jis_han},
+ {-1},
+#line 49 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str7), onigenc_jis_latin},
+#line 50 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str8), onigenc_jis_greek},
+ {-1},
+#line 46 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str10), onigenc_jis_hiragana},
+#line 47 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str11), onigenc_jis_katakana},
+#line 51 "enc/jis/props.kwd"
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str12), onigenc_jis_cyrillic}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = onig_jis_property_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = wordlist[key].name;
+ if (o >= 0)
+ {
+ register const char *s = o + onig_jis_property_pool;
+
+ if ((((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strncmp (str, s, len) && s[len] == '\0')
+ return &wordlist[key];
+ }
+ }
+ }
+ return 0;
+}
+#line 52 "enc/jis/props.kwd"
+
diff --git a/enc/jis/props.kwd b/enc/jis/props.kwd
new file mode 100644
index 0000000000..f3235c0100
--- /dev/null
+++ b/enc/jis/props.kwd
@@ -0,0 +1,52 @@
+%{/* -*- c -*- */
+#define GPERF_DOWNCASE 1
+#define GPERF_CASE_STRNCMP 1
+
+static inline int
+gperf_case_strncmp(const char *s1, const char *s2, unsigned int n)
+{
+ const UChar *str = (const UChar *)s1;
+ const UChar *s = (const UChar *)s2;
+ return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n);
+}
+
+enum onigenc_jis_ctype {
+ onigenc_jis_min = ONIGENC_MAX_STD_CTYPE,
+ onigenc_jis_hiragana,
+ onigenc_jis_katakana,
+ onigenc_jis_han,
+ onigenc_jis_latin,
+ onigenc_jis_greek,
+ onigenc_jis_cyrillic,
+ onigenc_jis_max
+};
+
+enum {PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1};
+
+static const OnigCodePoint* const PropertyList[PropertyListNum] = {
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Han,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+};
+
+struct enc_property {
+ signed char name;
+ unsigned char ctype;
+};
+
+static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
+%}
+
+struct enc_property;
+
+%%
+hiragana, onigenc_jis_hiragana
+katakana, onigenc_jis_katakana
+han, onigenc_jis_han
+latin, onigenc_jis_latin
+greek, onigenc_jis_greek
+cyrillic, onigenc_jis_cyrillic
+%%
diff --git a/enc/jis/props.src b/enc/jis/props.src
new file mode 100644
index 0000000000..f3235c0100
--- /dev/null
+++ b/enc/jis/props.src
@@ -0,0 +1,52 @@
+%{/* -*- c -*- */
+#define GPERF_DOWNCASE 1
+#define GPERF_CASE_STRNCMP 1
+
+static inline int
+gperf_case_strncmp(const char *s1, const char *s2, unsigned int n)
+{
+ const UChar *str = (const UChar *)s1;
+ const UChar *s = (const UChar *)s2;
+ return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n);
+}
+
+enum onigenc_jis_ctype {
+ onigenc_jis_min = ONIGENC_MAX_STD_CTYPE,
+ onigenc_jis_hiragana,
+ onigenc_jis_katakana,
+ onigenc_jis_han,
+ onigenc_jis_latin,
+ onigenc_jis_greek,
+ onigenc_jis_cyrillic,
+ onigenc_jis_max
+};
+
+enum {PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1};
+
+static const OnigCodePoint* const PropertyList[PropertyListNum] = {
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Han,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+};
+
+struct enc_property {
+ signed char name;
+ unsigned char ctype;
+};
+
+static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
+%}
+
+struct enc_property;
+
+%%
+hiragana, onigenc_jis_hiragana
+katakana, onigenc_jis_katakana
+han, onigenc_jis_han
+latin, onigenc_jis_latin
+greek, onigenc_jis_greek
+cyrillic, onigenc_jis_cyrillic
+%%
diff --git a/enc/koi8_r.c b/enc/koi8_r.c
index 8ec48747f8..85fa72287e 100644
--- a/enc/koi8_r.c
+++ b/enc/koi8_r.c
@@ -183,7 +183,7 @@ koi8_r_apply_all_case_fold(OnigCaseFoldType flag,
void* arg, OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, f, arg);
}
@@ -193,7 +193,7 @@ koi8_r_get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, p, end, items);
}
diff --git a/enc/koi8_u.c b/enc/koi8_u.c
index 0e51b6eb80..0ae449ca21 100644
--- a/enc/koi8_u.c
+++ b/enc/koi8_u.c
@@ -187,7 +187,7 @@ koi8_u_apply_all_case_fold(OnigCaseFoldType flag,
void* arg, OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, f, arg);
}
@@ -197,7 +197,7 @@ koi8_u_get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, p, end, items);
}
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
index b917eca0bd..4ab85f36e3 100755
--- a/enc/make_encmake.rb
+++ b/enc/make_encmake.rb
@@ -9,12 +9,15 @@ if $".grep(/mkmf/).empty?
end
require 'erb'
+CONFIG['srcdir'] = RbConfig::CONFIG['srcdir']
CONFIG["MAKEDIRS"] ||= '$(MINIRUBY) -run -e mkdir -- -p'
BUILTIN_ENCS = []
BUILTIN_TRANSES = []
ENC_PATTERNS = []
NOENC_PATTERNS = []
+TRANS_PATTERNS = []
+NOTRANS_PATTERNS = []
module_type = :dynamic
until ARGV.empty?
@@ -31,6 +34,12 @@ until ARGV.empty?
when /\A--no-encs=/
NOENC_PATTERNS.concat $'.split
ARGV.shift
+ when /\A--transes=/
+ TRANS_PATTERNS.concat $'.split
+ ARGV.shift
+ when /\A--no-transes=/
+ NOTRANS_PATTERNS.concat $'.split
+ ARGV.shift
when /\A--module$/
ARGV.shift
when /\A--modulestatic$/
@@ -43,7 +52,7 @@ 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 = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS - ["mktable.c", "encinit.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)}}
@@ -51,7 +60,7 @@ def target_encodings
deps = Hash.new {[]}
inc_srcs = Hash.new {[]}
default_deps = %w[regenc.h oniguruma.h config.h defines.h]
- db = encs.delete("encdb")
+ encs.delete(db = "encdb")
encs.each do |e|
File.foreach("#$srcdir/#{e}.c") do |l|
if /^\s*#\s*include\s+(?:"([^\"]+)"|<(ruby\/\sw+.h)>)/ =~ l
@@ -91,9 +100,14 @@ def target_transcoders
trans -= BUILTIN_TRANSES
atrans -= BUILTIN_TRANSES
trans.uniq!
+ atrans.reject! {|e| !TRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !TRANS_PATTERNS.empty?
+ atrans.reject! {|e| NOTRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
+ trans.reject! {|e| !TRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !TRANS_PATTERNS.empty?
+ trans.reject! {|e| NOTRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
atrans = atrans.sort_by(&ALPHANUMERIC_ORDER)
trans = trans.sort_by(&ALPHANUMERIC_ORDER)
- trans.unshift(trans.delete("transdb"))
+ trans.delete(db = "transdb")
+ trans.unshift(db)
trans.compact!
trans |= atrans
trans.map! {|e| "trans/#{e}"}
@@ -120,8 +134,9 @@ 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"
+ filename = "encinit.c.erb"
+ erb = ERB.new(File.read(File.join($srcdir, filename)), nil, '%-')
+ erb.filename = "enc/#{filename}"
tmp = erb.result(binding)
begin
Dir.mkdir 'enc'
diff --git a/enc/prelude.rb b/enc/prelude.rb
index 8ce59f957a..be7c0c9445 100644
--- a/enc/prelude.rb
+++ b/enc/prelude.rb
@@ -1,6 +1,4 @@
-%w'enc/encdb.so enc/trans/transdb.so'.each do |init|
- begin
- require(init)
- rescue LoadError
- end
+begin
+ require 'unicode_normalize'
+rescue LoadError
end
diff --git a/enc/shift_jis.c b/enc/shift_jis.c
index 5f5a802874..165592c905 100644
--- a/enc/shift_jis.c
+++ b/enc/shift_jis.c
@@ -278,7 +278,7 @@ 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,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, f, arg);
}
@@ -433,12 +433,6 @@ is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc ARG_
}
-static int PropertyInited = 0;
-static const OnigCodePoint** PropertyList;
-static int PropertyListNum;
-static int PropertyListSize;
-static hash_table_type* PropertyNameTable;
-
static const OnigCodePoint CR_Hiragana[] = {
1,
0x829f, 0x82f1
@@ -493,41 +487,20 @@ static const OnigCodePoint CR_Cyrillic[] = {
0x8480, 0x8491,
}; /* CR_Cyrillic */
-static int
-init_property_list(void)
-{
- int r;
-
- 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:
- return r;
-}
+#include "enc/jis/props.h"
static int
-property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
+property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
{
- hash_data_type ctype;
- UChar *s, *e;
-
- PROPERTY_LIST_INIT_CHECK;
+ const UChar *s = p, *e = end;
+ const struct enc_property *prop =
+ onig_jis_property((const char* )s, (unsigned int )(e - s));
- s = e = ALLOCA_N(UChar, end-p+1);
- for (; p < end; p++) {
- *e++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- }
-
- if (onig_st_lookup_strend(PropertyNameTable, s, e, &ctype) == 0) {
+ if (!prop) {
return onigenc_minimum_property_name_to_ctype(enc, s, e);
}
- return (int )ctype;
+ return (int )prop->ctype;
}
static int
@@ -543,8 +516,6 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
}
}
else {
- PROPERTY_LIST_INIT_CHECK;
-
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (unsigned int )PropertyListNum)
return ONIGERR_TYPE_BUG;
@@ -565,8 +536,6 @@ get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
else {
*sb_out = 0x80;
- PROPERTY_LIST_INIT_CHECK;
-
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
if (ctype >= (OnigCtype )PropertyListNum)
return ONIGERR_TYPE_BUG;
diff --git a/enc/trans/JIS/JISX0201-KANA%UCS.src b/enc/trans/JIS/JISX0201-KANA%UCS.src
index d25b580fed..d56b97f7cc 100644
--- a/enc/trans/JIS/JISX0201-KANA%UCS.src
+++ b/enc/trans/JIS/JISX0201-KANA%UCS.src
@@ -12,27 +12,16 @@ BEGIN_MAP
# This mapping data is made from the mapping data provided by Unicode, Inc.
# Original notice:
#
+# JIS0201.TXT
+# Date: 2015-12-02 23:49:00 GMT [KW]
+# © 2015 Unicode®, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+#
# Name: JIS X 0201 (1976) to Unicode 1.1 Table
# Unicode version: 1.1
-# Table version: 0.9
+# Table version: 2.0
# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
+# Date: 2011 October 14 (header updated: 2015 December 02)
#
# General notes:
#
@@ -42,15 +31,7 @@ BEGIN_MAP
# same as those used by actual products, nor may they be the best suited
# for all uses. For more information on the mappings between various code
# pages incorporating the repertoire of JIS X 0201 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0201 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0201 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
+# VENDORS mapping data.
#
#
# Format: Three tab-separated columns
@@ -60,6 +41,22 @@ BEGIN_MAP
#
# The entries are in JIS order
#
+# Revision History:
+#
+# [v2.0, 2015 December 02]
+# updates to copyright notice and terms of use
+# no changes to character mappings
+#
+# [v1.0, 2011 October 14]
+# Updated terms of use to current wording.
+# Updated contact information.
+# No changes to the mapping data.
+#
+# [v0.9, 8 March 1994]
+# First release.
+#
+# Use the Unicode reporting form <http://www.unicode.org/reporting.html>
+# for any questions or comments or to report errors in the data.
#
0x21 = 0xFF61
0x22 = 0xFF62
diff --git a/enc/trans/JIS/JISX0208@1990%UCS.src b/enc/trans/JIS/JISX0208@1990%UCS.src
index c2cacd422e..7875969b95 100644
--- a/enc/trans/JIS/JISX0208@1990%UCS.src
+++ b/enc/trans/JIS/JISX0208@1990%UCS.src
@@ -12,27 +12,17 @@ BEGIN_MAP
# This mapping data is made from the mapping data provided by Unicode, Inc.
# Original notice:
#
+#
+# JIS0208.TXT
+# Date: 2015-12-02 23:50:00 GMT [KW]
+# © 2015 Unicode®, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+#
# Name: JIS X 0208 (1990) to Unicode
# Unicode version: 1.1
-# Table version: 0.9
+# Table version: 2.0
# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
+# Date: 2011 October 14 (header updated: 2015 December 02)
#
# General notes:
#
@@ -42,15 +32,7 @@ BEGIN_MAP
# same as those used by actual products, nor may they be the best suited
# for all uses. For more information on the mappings between various code
# pages incorporating the repertoire of JIS X 0208 (1990) and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0208 (1990) and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0208 (1990)
-# and Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
+# VENDORS mapping data.
#
#
# Format: Four tab-separated columns
@@ -77,12 +59,22 @@ BEGIN_MAP
# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
# 0x7426 -> 0x5406 -> 8406
#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
+# Revision History:
+#
+# [v2.0, 2015 December 02]
+# updates to copyright notice and terms of use
+# no changes to character mappings
+#
+# [v1.0, 2011 October 14]
+# Updated terms of use to current wording.
+# Updated contact information.
+# No changes to the mapping data.
#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
+# [v0.9, 8 March 1994]
+# First release.
#
+# Use the Unicode reporting form <http://www.unicode.org/reporting.html>
+# for any questions or comments or to report errors in the data.
#
# NetBSD specific modification:
# 2003-08-18 : change the conversion for reverse solidus (0x2140).
diff --git a/enc/trans/JIS/JISX0212%UCS.src b/enc/trans/JIS/JISX0212%UCS.src
index cf4e7ecf62..aa51257b99 100644
--- a/enc/trans/JIS/JISX0212%UCS.src
+++ b/enc/trans/JIS/JISX0212%UCS.src
@@ -12,27 +12,16 @@ BEGIN_MAP
# This mapping data is made from the mapping data provided by Unicode, Inc.
# Original notice:
#
+# JIS0212.TXT
+# Date: 2015-12-02 23:51:00 GMT [KW]
+# © 2015 Unicode®, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+#
# Name: JIS X 0212 (1990) to Unicode
# Unicode version: 1.1
-# Table version: 0.9
+# Table version: 2.0
# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
+# Date: 2011 October 14 (header updated: 2015 December 02)
#
# General notes:
#
@@ -42,15 +31,7 @@ BEGIN_MAP
# same as those used by actual products, nor may they be the best suited
# for all uses. For more information on the mappings between various code
# pages incorporating the repertoire of JIS X 0212 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0212 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0212 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
+# VENDORS mapping data.
#
#
# Format: Three tab-separated columns
@@ -76,17 +57,11 @@ BEGIN_MAP
# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
# 0x6D63 -> 0x4D43 -> 7767
#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
-#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
-#
# Notes:
#
# 1. JIS X 0212 apparently unified the following two symbols
# into a single character at 0x2922:
-#
+#
# LATIN CAPITAL LETTER D WITH STROKE
# LATIN CAPITAL LETTER ETH
#
@@ -96,7 +71,24 @@ BEGIN_MAP
# 0x2922 and 0x2942 are intended to be a capital/small pair.
# Consequently, in the Unicode mapping, 0x2922 is treated as
# LATIN CAPITAL LETTER D WITH STROKE.
-#
+#
+# Revision History:
+#
+# [v2.0, 2015 December 02]
+# updates to copyright notice and terms of use
+# no changes to character mappings
+#
+# [v1.0, 2011 October 14]
+# Updated terms of use to current wording.
+# Updated contact information.
+# No changes to the mapping data.
+#
+# [v0.9, 8 March 1994]
+# First release.
+#
+# Use the Unicode reporting form <http://www.unicode.org/reporting.html>
+# for any questions or comments or to report errors in the data.
+#
0x222F = 0x02D8
0x2230 = 0x02C7
0x2231 = 0x00B8
diff --git a/enc/trans/JIS/UCS%JISX0201-KANA.src b/enc/trans/JIS/UCS%JISX0201-KANA.src
index 57ae00f23b..fac6ae8afe 100644
--- a/enc/trans/JIS/UCS%JISX0201-KANA.src
+++ b/enc/trans/JIS/UCS%JISX0201-KANA.src
@@ -12,27 +12,16 @@ BEGIN_MAP
# This mapping data is made from the mapping data provided by Unicode, Inc.
# Original notice:
#
+# JIS0201.TXT
+# Date: 2015-12-02 23:49:00 GMT [KW]
+# © 2015 Unicode®, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+#
# Name: JIS X 0201 (1976) to Unicode 1.1 Table
# Unicode version: 1.1
-# Table version: 0.9
+# Table version: 2.0
# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
+# Date: 2011 October 14 (header updated: 2015 December 02)
#
# General notes:
#
@@ -42,15 +31,7 @@ BEGIN_MAP
# same as those used by actual products, nor may they be the best suited
# for all uses. For more information on the mappings between various code
# pages incorporating the repertoire of JIS X 0201 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0201 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0201 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
+# VENDORS mapping data.
#
#
# Format: Three tab-separated columns
@@ -60,6 +41,23 @@ BEGIN_MAP
#
# The entries are in JIS order
#
+# Revision History:
+#
+# [v2.0, 2015 December 02]
+# updates to copyright notice and terms of use
+# no changes to character mappings
+#
+# [v1.0, 2011 October 14]
+# Updated terms of use to current wording.
+# Updated contact information.
+# No changes to the mapping data.
+#
+# [v0.9, 8 March 1994]
+# First release.
+#
+# Use the Unicode reporting form <http://www.unicode.org/reporting.html>
+# for any questions or comments or to report errors in the data.
+#
#
0xFF61 = 0x21
0xFF62 = 0x22
diff --git a/enc/trans/JIS/UCS%JISX0208@1990.src b/enc/trans/JIS/UCS%JISX0208@1990.src
index 977171ccda..b06e6de231 100644
--- a/enc/trans/JIS/UCS%JISX0208@1990.src
+++ b/enc/trans/JIS/UCS%JISX0208@1990.src
@@ -12,27 +12,16 @@ BEGIN_MAP
# This mapping data is made from the mapping data provided by Unicode, Inc.
# Original notice:
#
+# JIS0208.TXT
+# Date: 2015-12-02 23:50:00 GMT [KW]
+# © 2015 Unicode®, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+#
# Name: JIS X 0208 (1990) to Unicode
# Unicode version: 1.1
-# Table version: 0.9
+# Table version: 2.0
# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
+# Date: 2011 October 14 (header updated: 2015 December 02)
#
# General notes:
#
@@ -42,15 +31,7 @@ BEGIN_MAP
# same as those used by actual products, nor may they be the best suited
# for all uses. For more information on the mappings between various code
# pages incorporating the repertoire of JIS X 0208 (1990) and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0208 (1990) and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0208 (1990)
-# and Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
+# VENDORS mapping data.
#
#
# Format: Four tab-separated columns
@@ -77,12 +58,22 @@ BEGIN_MAP
# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
# 0x7426 -> 0x5406 -> 8406
#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
+# Revision History:
+#
+# [v2.0, 2015 December 02]
+# updates to copyright notice and terms of use
+# no changes to character mappings
+#
+# [v1.0, 2011 October 14]
+# Updated terms of use to current wording.
+# Updated contact information.
+# No changes to the mapping data.
#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
+# [v0.9, 8 March 1994]
+# First release.
#
+# Use the Unicode reporting form <http://www.unicode.org/reporting.html>
+# for any questions or comments or to report errors in the data.
#
# NetBSD specific modification:
# 2003-08-18 : add U+FF3C -> 0x2140 conversion.
diff --git a/enc/trans/JIS/UCS%JISX0212.src b/enc/trans/JIS/UCS%JISX0212.src
index f3b2e7089b..65383a1c9f 100644
--- a/enc/trans/JIS/UCS%JISX0212.src
+++ b/enc/trans/JIS/UCS%JISX0212.src
@@ -12,27 +12,16 @@ BEGIN_MAP
# This mapping data is made from the mapping data provided by Unicode, Inc.
# Original notice:
#
+# JIS0212.TXT
+# Date: 2015-12-02 23:51:00 GMT [KW]
+# © 2015 Unicode®, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+#
# Name: JIS X 0212 (1990) to Unicode
# Unicode version: 1.1
-# Table version: 0.9
+# Table version: 2.0
# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
+# Date: 2011 October 14 (header updated: 2015 December 02)
#
# General notes:
#
@@ -42,15 +31,7 @@ BEGIN_MAP
# same as those used by actual products, nor may they be the best suited
# for all uses. For more information on the mappings between various code
# pages incorporating the repertoire of JIS X 0212 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0212 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0212 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
+# VENDORS mapping data.
#
#
# Format: Three tab-separated columns
@@ -76,17 +57,11 @@ BEGIN_MAP
# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
# 0x6D63 -> 0x4D43 -> 7767
#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
-#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
-#
# Notes:
#
# 1. JIS X 0212 apparently unified the following two symbols
# into a single character at 0x2922:
-#
+#
# LATIN CAPITAL LETTER D WITH STROKE
# LATIN CAPITAL LETTER ETH
#
@@ -97,6 +72,24 @@ BEGIN_MAP
# Consequently, in the Unicode mapping, 0x2922 is treated as
# LATIN CAPITAL LETTER D WITH STROKE.
#
+# Revision History:
+#
+# [v2.0, 2015 December 02]
+# updates to copyright notice and terms of use
+# no changes to character mappings
+#
+# [v1.0, 2011 October 14]
+# Updated terms of use to current wording.
+# Updated contact information.
+# No changes to the mapping data.
+#
+# [v0.9, 8 March 1994]
+# First release.
+#
+# Use the Unicode reporting form <http://www.unicode.org/reporting.html>
+# for any questions or comments or to report errors in the data.
+#
+#
# Ruby specific modification:
# remove 0x007E to 0x2237 conversion.
#
diff --git a/enc/trans/ebcdic.trans b/enc/trans/ebcdic.trans
new file mode 100644
index 0000000000..c5b5dfec87
--- /dev/null
+++ b/enc/trans/ebcdic.trans
@@ -0,0 +1,278 @@
+#include "transcode_data.h"
+
+<%
+ us_ebcdic_map = [
+ ["00", "00"],
+ ["01", "01"],
+ ["02", "02"],
+ ["03", "03"],
+ ["37", "04"],
+ ["2D", "05"],
+ ["2E", "06"],
+ ["2F", "07"],
+ ["16", "08"],
+ ["05", "09"],
+ ["25", "0A"],
+ ["0B", "0B"],
+ ["0C", "0C"],
+ ["0D", "0D"],
+ ["0E", "0E"],
+ ["0F", "0F"],
+ ["10", "10"],
+ ["11", "11"],
+ ["12", "12"],
+ ["13", "13"],
+ ["3C", "14"],
+ ["3D", "15"],
+ ["32", "16"],
+ ["26", "17"],
+ ["18", "18"],
+ ["19", "19"],
+ ["3F", "1A"],
+ ["27", "1B"],
+ ["1C", "1C"],
+ ["1D", "1D"],
+ ["1E", "1E"],
+ ["1F", "1F"],
+ ["40", "20"],
+ ["5A", "21"],
+ ["7F", "22"],
+ ["7B", "23"],
+ ["5B", "24"],
+ ["6C", "25"],
+ ["50", "26"],
+ ["7D", "27"],
+ ["4D", "28"],
+ ["5D", "29"],
+ ["5C", "2A"],
+ ["4E", "2B"],
+ ["6B", "2C"],
+ ["60", "2D"],
+ ["4B", "2E"],
+ ["61", "2F"],
+ ["F0", "30"],
+ ["F1", "31"],
+ ["F2", "32"],
+ ["F3", "33"],
+ ["F4", "34"],
+ ["F5", "35"],
+ ["F6", "36"],
+ ["F7", "37"],
+ ["F8", "38"],
+ ["F9", "39"],
+ ["7A", "3A"],
+ ["5E", "3B"],
+ ["4C", "3C"],
+ ["7E", "3D"],
+ ["6E", "3E"],
+ ["6F", "3F"],
+ ["7C", "40"],
+ ["C1", "41"],
+ ["C2", "42"],
+ ["C3", "43"],
+ ["C4", "44"],
+ ["C5", "45"],
+ ["C6", "46"],
+ ["C7", "47"],
+ ["C8", "48"],
+ ["C9", "49"],
+ ["D1", "4A"],
+ ["D2", "4B"],
+ ["D3", "4C"],
+ ["D4", "4D"],
+ ["D5", "4E"],
+ ["D6", "4F"],
+ ["D7", "50"],
+ ["D8", "51"],
+ ["D9", "52"],
+ ["E2", "53"],
+ ["E3", "54"],
+ ["E4", "55"],
+ ["E5", "56"],
+ ["E6", "57"],
+ ["E7", "58"],
+ ["E8", "59"],
+ ["E9", "5A"],
+ ["BA", "5B"],
+ ["E0", "5C"],
+ ["BB", "5D"],
+ ["B0", "5E"],
+ ["6D", "5F"],
+ ["79", "60"],
+ ["81", "61"],
+ ["82", "62"],
+ ["83", "63"],
+ ["84", "64"],
+ ["85", "65"],
+ ["86", "66"],
+ ["87", "67"],
+ ["88", "68"],
+ ["89", "69"],
+ ["91", "6A"],
+ ["92", "6B"],
+ ["93", "6C"],
+ ["94", "6D"],
+ ["95", "6E"],
+ ["96", "6F"],
+ ["97", "70"],
+ ["98", "71"],
+ ["99", "72"],
+ ["A2", "73"],
+ ["A3", "74"],
+ ["A4", "75"],
+ ["A5", "76"],
+ ["A6", "77"],
+ ["A7", "78"],
+ ["A8", "79"],
+ ["A9", "7A"],
+ ["C0", "7B"],
+ ["4F", "7C"],
+ ["D0", "7D"],
+ ["A1", "7E"],
+ ["07", "7F"],
+ ["20", "80"],
+ ["21", "81"],
+ ["22", "82"],
+ ["23", "83"],
+ ["24", "84"],
+ ["15", "85"],
+ ["06", "86"],
+ ["17", "87"],
+ ["28", "88"],
+ ["29", "89"],
+ ["2A", "8A"],
+ ["2B", "8B"],
+ ["2C", "8C"],
+ ["09", "8D"],
+ ["0A", "8E"],
+ ["1B", "8F"],
+ ["30", "90"],
+ ["31", "91"],
+ ["1A", "92"],
+ ["33", "93"],
+ ["34", "94"],
+ ["35", "95"],
+ ["36", "96"],
+ ["08", "97"],
+ ["38", "98"],
+ ["39", "99"],
+ ["3A", "9A"],
+ ["3B", "9B"],
+ ["04", "9C"],
+ ["14", "9D"],
+ ["3E", "9E"],
+ ["FF", "9F"],
+ ["41", "A0"],
+ ["AA", "A1"],
+ ["4A", "A2"],
+ ["B1", "A3"],
+ ["9F", "A4"],
+ ["B2", "A5"],
+ ["6A", "A6"],
+ ["B5", "A7"],
+ ["BD", "A8"],
+ ["B4", "A9"],
+ ["9A", "AA"],
+ ["8A", "AB"],
+ ["5F", "AC"],
+ ["CA", "AD"],
+ ["AF", "AE"],
+ ["BC", "AF"],
+ ["90", "B0"],
+ ["8F", "B1"],
+ ["EA", "B2"],
+ ["FA", "B3"],
+ ["BE", "B4"],
+ ["A0", "B5"],
+ ["B6", "B6"],
+ ["B3", "B7"],
+ ["9D", "B8"],
+ ["DA", "B9"],
+ ["9B", "BA"],
+ ["8B", "BB"],
+ ["B7", "BC"],
+ ["B8", "BD"],
+ ["B9", "BE"],
+ ["AB", "BF"],
+ ["64", "C0"],
+ ["65", "C1"],
+ ["62", "C2"],
+ ["66", "C3"],
+ ["63", "C4"],
+ ["67", "C5"],
+ ["9E", "C6"],
+ ["68", "C7"],
+ ["74", "C8"],
+ ["71", "C9"],
+ ["72", "CA"],
+ ["73", "CB"],
+ ["78", "CC"],
+ ["75", "CD"],
+ ["76", "CE"],
+ ["77", "CF"],
+ ["AC", "D0"],
+ ["69", "D1"],
+ ["ED", "D2"],
+ ["EE", "D3"],
+ ["EB", "D4"],
+ ["EF", "D5"],
+ ["EC", "D6"],
+ ["BF", "D7"],
+ ["80", "D8"],
+ ["FD", "D9"],
+ ["FE", "DA"],
+ ["FB", "DB"],
+ ["FC", "DC"],
+ ["AD", "DD"],
+ ["AE", "DE"],
+ ["59", "DF"],
+ ["44", "E0"],
+ ["45", "E1"],
+ ["42", "E2"],
+ ["46", "E3"],
+ ["43", "E4"],
+ ["47", "E5"],
+ ["9C", "E6"],
+ ["48", "E7"],
+ ["54", "E8"],
+ ["51", "E9"],
+ ["52", "EA"],
+ ["53", "EB"],
+ ["58", "EC"],
+ ["55", "ED"],
+ ["56", "EE"],
+ ["57", "EF"],
+ ["8C", "F0"],
+ ["49", "F1"],
+ ["CD", "F2"],
+ ["CE", "F3"],
+ ["CB", "F4"],
+ ["CF", "F5"],
+ ["CC", "F6"],
+ ["E1", "F7"],
+ ["70", "F8"],
+ ["DD", "F9"],
+ ["DE", "FA"],
+ ["DB", "FB"],
+ ["DC", "FC"],
+ ["8D", "FD"],
+ ["8E", "FE"],
+ ["DF", "FF"]
+]
+
+def to_nomap (map)
+ map.collect do |from, to|
+ from == to ? [from, :nomap] : [from, to]
+ end
+end
+
+transcode_tblgen "IBM037", "ISO-8859-1", to_nomap(us_ebcdic_map), '{00-ff}', 'asciicompat_decoder'
+transcode_tblgen "ISO-8859-1", "IBM037", to_nomap(us_ebcdic_map.map {|a,b| [b,a] }), '{00-ff}', 'asciicompat_encoder'
+%>
+
+<%= transcode_generated_code %>
+
+TRANS_INIT(ebcdic)
+{
+<%= transcode_register_code %>
+}
diff --git a/enc/trans/escape.trans b/enc/trans/escape.trans
index 550e4ac767..c76ffa0e06 100644
--- a/enc/trans/escape.trans
+++ b/enc/trans/escape.trans
@@ -6,19 +6,19 @@
end
transcode_tblgen("", "amp_escape", [
- ["{00-25,27-FF}", :nomap],
+ ["{00-25,27-FF}", :nomap],
["26", hexstr("&amp;")]
], nil)
transcode_tblgen("", "xml_text_escape", [
- ["{00-25,27-3B,3D,3F-FF}", :nomap],
+ ["{00-25,27-3B,3D,3F-FF}", :nomap],
["26", hexstr("&amp;")],
["3C", hexstr("&lt;")],
["3E", hexstr("&gt;")]
], nil)
transcode_tblgen("", "xml_attr_content_escape", [
- ["{00-21,23-25,27-3B,3D,3F-FF}", :nomap],
+ ["{00-21,23-25,27-3B,3D,3F-FF}", :nomap],
["22", hexstr("&quot;")],
["26", hexstr("&amp;")],
["3C", hexstr("&lt;")],
diff --git a/enc/trans/euckr-tbl.rb b/enc/trans/euckr-tbl.rb
index 773cd90122..4ce8521a8a 100644
--- a/enc/trans/euckr-tbl.rb
+++ b/enc/trans/euckr-tbl.rb
@@ -162,6 +162,8 @@ EUCKR_TO_UCS_TBL = [
["A2E3",0x33C2],
["A2E4",0x33D8],
["A2E5",0x2121],
+ ["A2E6",0x20AC],
+ ["A2E7",0x00AE],
["A3A1",0xFF01],
["A3A2",0xFF02],
["A3A3",0xFF03],
diff --git a/enc/trans/gb18030.trans b/enc/trans/gb18030.trans
index 94c866eb39..f42f8fd2d5 100644
--- a/enc/trans/gb18030.trans
+++ b/enc/trans/gb18030.trans
@@ -2,9 +2,9 @@
<%
require "gb18030-tbl"
-
+
def linear(code)
- bytes = [code].pack('H8').unpack 'C4'
+ bytes = [code].pack('H8').unpack 'C4'
((bytes[0]*10+bytes[1])*126+bytes[2])*10+bytes[3]
end
@@ -31,7 +31,7 @@
code
end
end
-
+
def calculate_differences_utf_gb(table)
table_rev = table.map{|a,b| [b,a]}
table_rev.collect do |code|
@@ -123,7 +123,7 @@ fun_sio_to_gb18030(void *statep, const unsigned char *s, size_t l, VALUE info, u
{
unsigned int diff = (unsigned int)(info >> 8);
unsigned int u; /* Unicode Scalar Value */
-
+
u = ((s[0]&0x0F)<<12) | ((s[1]&0x3F)<<6) | (s[2]&0x3F);
if (diff & 0x20000) { /* GB18030 4 bytes */
diff --git a/enc/unicode.c b/enc/unicode.c
index 20990c1e54..9c0b326d0b 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -2,7 +2,7 @@
unicode.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -71,8 +71,6 @@ static const unsigned short EncUNICODE_ISO_8859_1_CtypeTable[256] = {
0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2
};
-#include "enc/unicode/name2ctype.h"
-
typedef struct {
int n;
OnigCodePoint code[3];
@@ -103,10 +101,46 @@ typedef struct {
CodePointList2 to;
} CaseUnfold_13_Type;
+static inline int
+bits_of(const OnigCodePoint c, const int n)
+{
+ return (c >> (2 - n) * 7) & 127;
+}
+
+static inline int
+bits_at(const OnigCodePoint *c, const int n)
+{
+ return bits_of(c[n / 3], n % 3);
+}
+
+static int
+code1_equal(const OnigCodePoint x, const OnigCodePoint y)
+{
+ if (x != y) return 0;
+ return 1;
+}
+
+static int
+code2_equal(const OnigCodePoint *x, const OnigCodePoint *y)
+{
+ if (x[0] != y[0]) return 0;
+ if (x[1] != y[1]) return 0;
+ return 1;
+}
+
+static int
+code3_equal(const OnigCodePoint *x, const OnigCodePoint *y)
+{
+ if (x[0] != y[0]) return 0;
+ if (x[1] != y[1]) return 0;
+ if (x[2] != y[2]) return 0;
+ return 1;
+}
+
#include "enc/unicode/casefold.h"
+#include "enc/unicode/name2ctype.h"
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
#define CODE_RANGES_NUM numberof(CodeRanges)
extern int
@@ -143,23 +177,21 @@ onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[])
extern int
onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
const OnigCodePoint* ranges[],
- struct OnigEncodingTypeST* enc ARG_UNUSED)
+ OnigEncoding enc ARG_UNUSED)
{
*sb_out = 0x00;
return onigenc_unicode_ctype_code_range(ctype, ranges);
}
-#include "ruby/st.h"
-
#define PROPERTY_NAME_MAX_SIZE (MAX_WORD_LENGTH + 1)
extern int
-onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end)
+onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* name, const UChar* end)
{
int len;
int ctype;
UChar buf[PROPERTY_NAME_MAX_SIZE];
- UChar *p;
+ const UChar *p;
OnigCodePoint code;
len = 0;
@@ -184,120 +216,21 @@ onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end
return ctype;
}
-
-static int
-code2_cmp(OnigCodePoint* x, OnigCodePoint* y)
-{
- if (x[0] == y[0] && x[1] == y[1]) return 0;
- return 1;
-}
-
-static st_index_t
-code2_hash(OnigCodePoint* x)
-{
- return (st_index_t )(x[0] + x[1]);
-}
-
-static const struct st_hash_type type_code2_hash = {
- code2_cmp,
- code2_hash,
-};
-
-static int
-code3_cmp(OnigCodePoint* x, OnigCodePoint* y)
-{
- if (x[0] == y[0] && x[1] == y[1] && x[2] == y[2]) return 0;
- return 1;
-}
-
-static st_index_t
-code3_hash(OnigCodePoint* x)
-{
- return (st_index_t )(x[0] + x[1] + x[2]);
-}
-
-static const struct st_hash_type type_code3_hash = {
- code3_cmp,
- code3_hash,
-};
-
-
-static st_table* FoldTable; /* fold-1, fold-2, fold-3 */
-static st_table* Unfold1Table;
-static st_table* Unfold2Table;
-static st_table* Unfold3Table;
-static int CaseFoldInited = 0;
-
-static int init_case_fold_table(void)
-{
- const CaseFold_11_Type *p;
- const CaseUnfold_11_Type *p1;
- const CaseUnfold_12_Type *p2;
- const CaseUnfold_13_Type *p3;
- int i;
-
- THREAD_ATOMIC_START;
-
- 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];
- st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));
- }
- for (i = 0; i < numberof(CaseFold_Locale); i++) {
- p = &CaseFold_Locale[i];
- st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));
- }
-
- 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++) {
- p1 = &CaseUnfold_11[i];
- st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));
- }
- for (i = 0; i < numberof(CaseUnfold_11_Locale); i++) {
- p1 = &CaseUnfold_11_Locale[i];
- st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));
- }
-
- 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++) {
- p2 = &CaseUnfold_12[i];
- st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));
- }
- for (i = 0; i < numberof(CaseUnfold_12_Locale); i++) {
- p2 = &CaseUnfold_12_Locale[i];
- st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));
- }
-
- 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++) {
- p3 = &CaseUnfold_13[i];
- st_add_direct(Unfold3Table, (st_data_t )p3->from, (st_data_t )(&p3->to));
- }
-
- CaseFoldInited = 1;
- THREAD_ATOMIC_END;
- return 0;
-}
+#define onigenc_unicode_fold_lookup onigenc_unicode_CaseFold_11_lookup
+#define onigenc_unicode_unfold1_lookup onigenc_unicode_CaseUnfold_11_lookup
+#define onigenc_unicode_unfold2_lookup onigenc_unicode_CaseUnfold_12_lookup
+#define onigenc_unicode_unfold3_lookup onigenc_unicode_CaseUnfold_13_lookup
extern int
onigenc_unicode_mbc_case_fold(OnigEncoding enc,
OnigCaseFoldType flag ARG_UNUSED, const UChar** pp, const UChar* end,
UChar* fold)
{
- CodePointList3 *to;
+ const CodePointList3 *to;
OnigCodePoint code;
int i, len, rlen;
const UChar *p = *pp;
- if (CaseFoldInited == 0) init_case_fold_table();
-
code = ONIGENC_MBC_TO_CODE(enc, p, end);
len = enclen(enc, p, end);
*pp += len;
@@ -313,7 +246,7 @@ onigenc_unicode_mbc_case_fold(OnigEncoding enc,
}
#endif
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) {
+ if ((to = onigenc_unicode_fold_lookup(code)) != 0) {
if (to->n == 1) {
return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold);
}
@@ -349,8 +282,6 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
OnigCodePoint code;
int i, j, k, r;
- /* if (CaseFoldInited == 0) init_case_fold_table(); */
-
for (i = 0; i < numberof(CaseUnfold_11); i++) {
p11 = &CaseUnfold_11[i];
for (j = 0; j < p11->to.n; j++) {
@@ -483,10 +414,8 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
{
int n, i, j, k, len;
OnigCodePoint code, codes[3];
- CodePointList3 *to, *z3;
- CodePointList2 *z2;
-
- if (CaseFoldInited == 0) init_case_fold_table();
+ const CodePointList3 *to, *z3;
+ const CodePointList2 *z2;
n = 0;
@@ -522,7 +451,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
#endif
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) {
+ if ((to = onigenc_unicode_fold_lookup(code)) != 0) {
if (to->n == 1) {
OnigCodePoint orig_code = code;
@@ -532,7 +461,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
n++;
code = to->code[0];
- if (onig_st_lookup(Unfold1Table, (st_data_t )code, (void* )&to) != 0) {
+ if ((to = onigenc_unicode_unfold1_lookup(code)) != 0) {
for (i = 0; i < to->n; i++) {
if (to->code[i] != orig_code) {
items[n].byte_len = len;
@@ -549,8 +478,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
for (fn = 0; fn < to->n; fn++) {
cs[fn][0] = to->code[fn];
- if (onig_st_lookup(Unfold1Table, (st_data_t )cs[fn][0],
- (void* )&z3) != 0) {
+ if ((z3 = onigenc_unicode_unfold1_lookup(cs[fn][0])) != 0) {
for (i = 0; i < z3->n; i++) {
cs[fn][i+1] = z3->code[i];
}
@@ -571,8 +499,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
}
- if (onig_st_lookup(Unfold2Table, (st_data_t )to->code,
- (void* )&z2) != 0) {
+ if ((z2 = onigenc_unicode_unfold2_lookup(to->code)) != 0) {
for (i = 0; i < z2->n; i++) {
if (z2->code[i] == code) continue;
@@ -597,8 +524,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
}
- if (onig_st_lookup(Unfold3Table, (st_data_t )to->code,
- (void* )&z2) != 0) {
+ if ((z2 = onigenc_unicode_unfold3_lookup(to->code)) != 0) {
for (i = 0; i < z2->n; i++) {
if (z2->code[i] == code) continue;
@@ -615,7 +541,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
}
else {
- if (onig_st_lookup(Unfold1Table, (st_data_t )code, (void* )&to) != 0) {
+ if ((to = onigenc_unicode_unfold1_lookup(code)) != 0) {
for (i = 0; i < to->n; i++) {
items[n].byte_len = len;
items[n].code_len = 1;
@@ -633,7 +559,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
codes[0] = code;
code = ONIGENC_MBC_TO_CODE(enc, p, end);
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0
+ if ((to = onigenc_unicode_fold_lookup(code)) != 0
&& to->n == 1) {
codes[1] = to->code[0];
}
@@ -642,7 +568,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
clen = enclen(enc, p, end);
len += clen;
- if (onig_st_lookup(Unfold2Table, (st_data_t )codes, (void* )&z2) != 0) {
+ if ((z2 = onigenc_unicode_unfold2_lookup(codes)) != 0) {
for (i = 0; i < z2->n; i++) {
items[n].byte_len = len;
items[n].code_len = 1;
@@ -654,7 +580,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
p += clen;
if (p < end) {
code = ONIGENC_MBC_TO_CODE(enc, p, end);
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0
+ if ((to = onigenc_unicode_fold_lookup(code)) != 0
&& to->n == 1) {
codes[2] = to->code[0];
}
@@ -663,8 +589,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
clen = enclen(enc, p, end);
len += clen;
- if (onig_st_lookup(Unfold3Table, (st_data_t )codes,
- (void* )&z2) != 0) {
+ if ((z2 = onigenc_unicode_unfold3_lookup(codes)) != 0) {
for (i = 0; i < z2->n; i++) {
items[n].byte_len = len;
items[n].code_len = 1;
diff --git a/enc/unicode/case-folding.rb b/enc/unicode/case-folding.rb
new file mode 100755
index 0000000000..d93de6581b
--- /dev/null
+++ b/enc/unicode/case-folding.rb
@@ -0,0 +1,196 @@
+#!/usr/bin/ruby
+
+# Usage:
+# $ wget http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
+# $ ruby case-folding.rb CaseFolding.txt -o casefold.h
+
+class CaseFolding
+ module Util
+ module_function
+
+ def hex_seq(v)
+ v.map {|i| "0x%04x" % i}.join(", ")
+ end
+
+ def print_table_1(dest, data)
+ for k, v in data = data.sort
+ sk = (Array === k and k.length > 1) ? "{#{hex_seq(k)}}" : ("0x%04x" % k)
+ dest.print(" {#{sk}, {#{v.length}, {#{hex_seq(v)}}}},\n")
+ end
+ data
+ end
+
+ def print_table(dest, type, data)
+ dest.print("static const #{type}_Type #{type}_Table[] = {\n")
+ i = 0
+ ret = data.inject([]) do |a, (n, d)|
+ dest.print("#define #{n} (*(#{type}_Type (*)[#{d.size}])(#{type}_Table+#{i}))\n")
+ i += d.size
+ a.concat(print_table_1(dest, d))
+ end
+ dest.print("};\n\n")
+ ret
+ end
+ end
+
+ include Util
+
+ attr_reader :fold, :fold_locale, :unfold, :unfold_locale
+
+ def load(filename)
+ pattern = /([0-9A-F]{4,6}); ([CFT]); ([0-9A-F]{4,6})(?: ([0-9A-F]{4,6}))?(?: ([0-9A-F]{4,6}))?;/
+
+ @fold = fold = {}
+ @unfold = unfold = [{}, {}, {}]
+ turkic = []
+
+ IO.foreach(filename) do |line|
+ next unless res = pattern.match(line)
+ ch_from = res[1].to_i(16)
+
+ if res[2] == 'T'
+ # Turkic case folding
+ turkic << ch_from
+ next
+ end
+
+ # store folding data
+ ch_to = res[3..6].inject([]) do |a, i|
+ break a unless i
+ a << i.to_i(16)
+ end
+ fold[ch_from] = ch_to
+
+ # store unfolding data
+ i = ch_to.length - 1
+ (unfold[i][ch_to] ||= []) << ch_from
+ end
+
+ # move locale dependent data to (un)fold_locale
+ @fold_locale = fold_locale = {}
+ @unfold_locale = unfold_locale = [{}, {}]
+ for ch_from in turkic
+ key = fold[ch_from]
+ i = key.length - 1
+ unfold_locale[i][i == 0 ? key[0] : key] = unfold[i].delete(key)
+ fold_locale[ch_from] = fold.delete(ch_from)
+ end
+ self
+ end
+
+ def range_check(code)
+ "#{code} <= MAX_CODE_VALUE && #{code} >= MIN_CODE_VALUE"
+ end
+
+ def lookup_hash(key, type, data)
+ hash = "onigenc_unicode_#{key}_hash"
+ lookup = "onigenc_unicode_#{key}_lookup"
+ arity = Array(data[0][0]).size
+ gperf = %W"gperf -7 -k#{[*1..(arity*3)].join(",")} -F,-1 -c -j1 -i1 -t -T -E -C -H #{hash} -N #{lookup} -n"
+ argname = arity > 1 ? "codes" : "code"
+ argdecl = "const OnigCodePoint #{arity > 1 ? "*": ""}#{argname}"
+ n = 7
+ m = (1 << n) - 1
+ min, max = data.map {|c, *|c}.flatten.minmax
+ src = IO.popen(gperf, "r+") {|f|
+ f << "short\n%%\n"
+ data.each_with_index {|(k, _), i|
+ k = Array(k)
+ ks = k.map {|j| [(j >> n*2) & m, (j >> n) & m, (j) & m]}.flatten.map {|c| "\\x%.2x" % c}.join("")
+ f.printf "\"%s\", ::::/*%s*/ %d\n", ks, k.map {|c| "0x%.4x" % c}.join(","), i
+ }
+ f << "%%\n"
+ f.close_write
+ f.read
+ }
+ src.sub!(/^(#{hash})\s*\(.*?\).*?\n\{\n(.*)^\}/m) {
+ name = $1
+ body = $2
+ body.gsub!(/\(unsigned char\)str\[(\d+)\]/, "bits_#{arity > 1 ? 'at' : 'of'}(#{argname}, \\1)")
+ "#{name}(#{argdecl})\n{\n#{body}}"
+ }
+ src.sub!(/const short *\*\n^(#{lookup})\s*\(.*?\).*?\n\{\n(.*)^\}/m) {
+ name = $1
+ body = $2
+ body.sub!(/\benum\s+\{(\n[ \t]+)/, "\\&MIN_CODE_VALUE = 0x#{min.to_s(16)},\\1""MAX_CODE_VALUE = 0x#{max.to_s(16)},\\1")
+ body.gsub!(/(#{hash})\s*\(.*?\)/, "\\1(#{argname})")
+ body.gsub!(/\{"",-1}/, "-1")
+ body.gsub!(/\{"(?:[^"]|\\")+", *::::(.*)\}/, '\1')
+ body.sub!(/(\s+if\s)\(len\b.*\)/) do
+ "#$1(" <<
+ (arity > 1 ? (0...arity).map {|i| range_check("#{argname}[#{i}]")}.join(" &&\n ") : range_check(argname)) <<
+ ")"
+ end
+ v = nil
+ body.sub!(/(if\s*\(.*MAX_HASH_VALUE.*\)\n([ \t]*))\{(.*?)\n\2\}/m) {
+ pre = $1
+ indent = $2
+ s = $3
+ s.sub!(/const char *\* *(\w+)( *= *wordlist\[\w+\]).\w+/, 'short \1 = wordlist[key]')
+ v = $1
+ s.sub!(/\bif *\(.*\)/, "if (#{v} >= 0 && code#{arity}_equal(#{argname}, #{key}_Table[#{v}].from))")
+ "#{pre}{#{s}\n#{indent}}"
+ }
+ body.sub!(/\b(return\s+&)([^;]+);/, '\1'"#{key}_Table[#{v}].to;")
+ "static const #{type} *\n#{name}(#{argdecl})\n{\n#{body}}"
+ }
+ src
+ end
+
+ def display(dest)
+ # print the header
+ dest.print("/* DO NOT EDIT THIS FILE. */\n")
+ dest.print("/* Generated by enc/unicode/case-folding.rb */\n\n")
+
+ # print folding data
+
+ # CaseFold + CaseFold_Locale
+ name = "CaseFold_11"
+ data = print_table(dest, name, "CaseFold"=>fold, "CaseFold_Locale"=>fold_locale)
+ dest.print lookup_hash(name, "CodePointList3", data)
+
+ # print unfolding data
+
+ # CaseUnfold_11 + CaseUnfold_11_Locale
+ name = "CaseUnfold_11"
+ data = print_table(dest, name, name=>unfold[0], "#{name}_Locale"=>unfold_locale[0])
+ dest.print lookup_hash(name, "CodePointList3", data)
+
+ # CaseUnfold_12 + CaseUnfold_12_Locale
+ name = "CaseUnfold_12"
+ data = print_table(dest, name, name=>unfold[1], "#{name}_Locale"=>unfold_locale[1])
+ dest.print lookup_hash(name, "CodePointList2", data)
+
+ # CaseUnfold_13
+ name = "CaseUnfold_13"
+ data = print_table(dest, name, name=>unfold[2])
+ dest.print lookup_hash(name, "CodePointList2", data)
+ end
+
+ def self.load(*args)
+ new.load(*args)
+ end
+end
+
+if $0 == __FILE__
+ require 'optparse'
+ dest = nil
+ fold_1 = false
+ ARGV.options do |opt|
+ opt.banner << " [INPUT]"
+ opt.on("--output-file=FILE", "-o", "output to the FILE instead of STDOUT") {|output|
+ dest = (output unless output == '-')
+ }
+ opt.parse!
+ abort(opt.to_s) if ARGV.size > 1
+ end
+ filename = ARGV[0] || 'CaseFolding.txt'
+ data = CaseFolding.load(filename)
+ if dest
+ open(dest, "wb") do |f|
+ data.display(f)
+ end
+ else
+ data.display(STDOUT)
+ end
+end
diff --git a/enc/unicode/casefold.h b/enc/unicode/casefold.h
index b9559de4a3..f29f404f0a 100644
--- a/enc/unicode/casefold.h
+++ b/enc/unicode/casefold.h
@@ -1,2238 +1,6248 @@
/* DO NOT EDIT THIS FILE. */
-/* Generated by tool/CaseFolding.py */
+/* Generated by enc/unicode/case-folding.rb */
-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_11_Table[] = {
+#define CaseFold (*(CaseFold_11_Type (*)[1319])(CaseFold_11_Table+0))
+ {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}}},
+ {0x037f, {1, {0x03f3}}},
+ {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}}},
+ {0x0528, {1, {0x0529}}},
+ {0x052a, {1, {0x052b}}},
+ {0x052c, {1, {0x052d}}},
+ {0x052e, {1, {0x052f}}},
+ {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}}},
+ {0x13f8, {1, {0x13f0}}},
+ {0x13f9, {1, {0x13f1}}},
+ {0x13fa, {1, {0x13f2}}},
+ {0x13fb, {1, {0x13f3}}},
+ {0x13fc, {1, {0x13f4}}},
+ {0x13fd, {1, {0x13f5}}},
+ {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}}},
+ {0xa698, {1, {0xa699}}},
+ {0xa69a, {1, {0xa69b}}},
+ {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}}},
+ {0xa796, {1, {0xa797}}},
+ {0xa798, {1, {0xa799}}},
+ {0xa79a, {1, {0xa79b}}},
+ {0xa79c, {1, {0xa79d}}},
+ {0xa79e, {1, {0xa79f}}},
+ {0xa7a0, {1, {0xa7a1}}},
+ {0xa7a2, {1, {0xa7a3}}},
+ {0xa7a4, {1, {0xa7a5}}},
+ {0xa7a6, {1, {0xa7a7}}},
+ {0xa7a8, {1, {0xa7a9}}},
+ {0xa7aa, {1, {0x0266}}},
+ {0xa7ab, {1, {0x025c}}},
+ {0xa7ac, {1, {0x0261}}},
+ {0xa7ad, {1, {0x026c}}},
+ {0xa7b0, {1, {0x029e}}},
+ {0xa7b1, {1, {0x0287}}},
+ {0xa7b2, {1, {0x029d}}},
+ {0xa7b3, {1, {0xab53}}},
+ {0xa7b4, {1, {0xa7b5}}},
+ {0xa7b6, {1, {0xa7b7}}},
+ {0xab70, {1, {0x13a0}}},
+ {0xab71, {1, {0x13a1}}},
+ {0xab72, {1, {0x13a2}}},
+ {0xab73, {1, {0x13a3}}},
+ {0xab74, {1, {0x13a4}}},
+ {0xab75, {1, {0x13a5}}},
+ {0xab76, {1, {0x13a6}}},
+ {0xab77, {1, {0x13a7}}},
+ {0xab78, {1, {0x13a8}}},
+ {0xab79, {1, {0x13a9}}},
+ {0xab7a, {1, {0x13aa}}},
+ {0xab7b, {1, {0x13ab}}},
+ {0xab7c, {1, {0x13ac}}},
+ {0xab7d, {1, {0x13ad}}},
+ {0xab7e, {1, {0x13ae}}},
+ {0xab7f, {1, {0x13af}}},
+ {0xab80, {1, {0x13b0}}},
+ {0xab81, {1, {0x13b1}}},
+ {0xab82, {1, {0x13b2}}},
+ {0xab83, {1, {0x13b3}}},
+ {0xab84, {1, {0x13b4}}},
+ {0xab85, {1, {0x13b5}}},
+ {0xab86, {1, {0x13b6}}},
+ {0xab87, {1, {0x13b7}}},
+ {0xab88, {1, {0x13b8}}},
+ {0xab89, {1, {0x13b9}}},
+ {0xab8a, {1, {0x13ba}}},
+ {0xab8b, {1, {0x13bb}}},
+ {0xab8c, {1, {0x13bc}}},
+ {0xab8d, {1, {0x13bd}}},
+ {0xab8e, {1, {0x13be}}},
+ {0xab8f, {1, {0x13bf}}},
+ {0xab90, {1, {0x13c0}}},
+ {0xab91, {1, {0x13c1}}},
+ {0xab92, {1, {0x13c2}}},
+ {0xab93, {1, {0x13c3}}},
+ {0xab94, {1, {0x13c4}}},
+ {0xab95, {1, {0x13c5}}},
+ {0xab96, {1, {0x13c6}}},
+ {0xab97, {1, {0x13c7}}},
+ {0xab98, {1, {0x13c8}}},
+ {0xab99, {1, {0x13c9}}},
+ {0xab9a, {1, {0x13ca}}},
+ {0xab9b, {1, {0x13cb}}},
+ {0xab9c, {1, {0x13cc}}},
+ {0xab9d, {1, {0x13cd}}},
+ {0xab9e, {1, {0x13ce}}},
+ {0xab9f, {1, {0x13cf}}},
+ {0xaba0, {1, {0x13d0}}},
+ {0xaba1, {1, {0x13d1}}},
+ {0xaba2, {1, {0x13d2}}},
+ {0xaba3, {1, {0x13d3}}},
+ {0xaba4, {1, {0x13d4}}},
+ {0xaba5, {1, {0x13d5}}},
+ {0xaba6, {1, {0x13d6}}},
+ {0xaba7, {1, {0x13d7}}},
+ {0xaba8, {1, {0x13d8}}},
+ {0xaba9, {1, {0x13d9}}},
+ {0xabaa, {1, {0x13da}}},
+ {0xabab, {1, {0x13db}}},
+ {0xabac, {1, {0x13dc}}},
+ {0xabad, {1, {0x13dd}}},
+ {0xabae, {1, {0x13de}}},
+ {0xabaf, {1, {0x13df}}},
+ {0xabb0, {1, {0x13e0}}},
+ {0xabb1, {1, {0x13e1}}},
+ {0xabb2, {1, {0x13e2}}},
+ {0xabb3, {1, {0x13e3}}},
+ {0xabb4, {1, {0x13e4}}},
+ {0xabb5, {1, {0x13e5}}},
+ {0xabb6, {1, {0x13e6}}},
+ {0xabb7, {1, {0x13e7}}},
+ {0xabb8, {1, {0x13e8}}},
+ {0xabb9, {1, {0x13e9}}},
+ {0xabba, {1, {0x13ea}}},
+ {0xabbb, {1, {0x13eb}}},
+ {0xabbc, {1, {0x13ec}}},
+ {0xabbd, {1, {0x13ed}}},
+ {0xabbe, {1, {0x13ee}}},
+ {0xabbf, {1, {0x13ef}}},
+ {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}}},
+ {0x10c80, {1, {0x10cc0}}},
+ {0x10c81, {1, {0x10cc1}}},
+ {0x10c82, {1, {0x10cc2}}},
+ {0x10c83, {1, {0x10cc3}}},
+ {0x10c84, {1, {0x10cc4}}},
+ {0x10c85, {1, {0x10cc5}}},
+ {0x10c86, {1, {0x10cc6}}},
+ {0x10c87, {1, {0x10cc7}}},
+ {0x10c88, {1, {0x10cc8}}},
+ {0x10c89, {1, {0x10cc9}}},
+ {0x10c8a, {1, {0x10cca}}},
+ {0x10c8b, {1, {0x10ccb}}},
+ {0x10c8c, {1, {0x10ccc}}},
+ {0x10c8d, {1, {0x10ccd}}},
+ {0x10c8e, {1, {0x10cce}}},
+ {0x10c8f, {1, {0x10ccf}}},
+ {0x10c90, {1, {0x10cd0}}},
+ {0x10c91, {1, {0x10cd1}}},
+ {0x10c92, {1, {0x10cd2}}},
+ {0x10c93, {1, {0x10cd3}}},
+ {0x10c94, {1, {0x10cd4}}},
+ {0x10c95, {1, {0x10cd5}}},
+ {0x10c96, {1, {0x10cd6}}},
+ {0x10c97, {1, {0x10cd7}}},
+ {0x10c98, {1, {0x10cd8}}},
+ {0x10c99, {1, {0x10cd9}}},
+ {0x10c9a, {1, {0x10cda}}},
+ {0x10c9b, {1, {0x10cdb}}},
+ {0x10c9c, {1, {0x10cdc}}},
+ {0x10c9d, {1, {0x10cdd}}},
+ {0x10c9e, {1, {0x10cde}}},
+ {0x10c9f, {1, {0x10cdf}}},
+ {0x10ca0, {1, {0x10ce0}}},
+ {0x10ca1, {1, {0x10ce1}}},
+ {0x10ca2, {1, {0x10ce2}}},
+ {0x10ca3, {1, {0x10ce3}}},
+ {0x10ca4, {1, {0x10ce4}}},
+ {0x10ca5, {1, {0x10ce5}}},
+ {0x10ca6, {1, {0x10ce6}}},
+ {0x10ca7, {1, {0x10ce7}}},
+ {0x10ca8, {1, {0x10ce8}}},
+ {0x10ca9, {1, {0x10ce9}}},
+ {0x10caa, {1, {0x10cea}}},
+ {0x10cab, {1, {0x10ceb}}},
+ {0x10cac, {1, {0x10cec}}},
+ {0x10cad, {1, {0x10ced}}},
+ {0x10cae, {1, {0x10cee}}},
+ {0x10caf, {1, {0x10cef}}},
+ {0x10cb0, {1, {0x10cf0}}},
+ {0x10cb1, {1, {0x10cf1}}},
+ {0x10cb2, {1, {0x10cf2}}},
+ {0x118a0, {1, {0x118c0}}},
+ {0x118a1, {1, {0x118c1}}},
+ {0x118a2, {1, {0x118c2}}},
+ {0x118a3, {1, {0x118c3}}},
+ {0x118a4, {1, {0x118c4}}},
+ {0x118a5, {1, {0x118c5}}},
+ {0x118a6, {1, {0x118c6}}},
+ {0x118a7, {1, {0x118c7}}},
+ {0x118a8, {1, {0x118c8}}},
+ {0x118a9, {1, {0x118c9}}},
+ {0x118aa, {1, {0x118ca}}},
+ {0x118ab, {1, {0x118cb}}},
+ {0x118ac, {1, {0x118cc}}},
+ {0x118ad, {1, {0x118cd}}},
+ {0x118ae, {1, {0x118ce}}},
+ {0x118af, {1, {0x118cf}}},
+ {0x118b0, {1, {0x118d0}}},
+ {0x118b1, {1, {0x118d1}}},
+ {0x118b2, {1, {0x118d2}}},
+ {0x118b3, {1, {0x118d3}}},
+ {0x118b4, {1, {0x118d4}}},
+ {0x118b5, {1, {0x118d5}}},
+ {0x118b6, {1, {0x118d6}}},
+ {0x118b7, {1, {0x118d7}}},
+ {0x118b8, {1, {0x118d8}}},
+ {0x118b9, {1, {0x118d9}}},
+ {0x118ba, {1, {0x118da}}},
+ {0x118bb, {1, {0x118db}}},
+ {0x118bc, {1, {0x118dc}}},
+ {0x118bd, {1, {0x118dd}}},
+ {0x118be, {1, {0x118de}}},
+ {0x118bf, {1, {0x118df}}},
+#define CaseFold_Locale (*(CaseFold_11_Type (*)[2])(CaseFold_11_Table+1319))
+ {0x0049, {1, {0x0069}}},
+ {0x0130, {2, {0x0069, 0x0307}}},
};
-static const CaseFold_11_Type CaseFold_Locale[] = {
- { 0x0049, {1, {0x0069}}},
- { 0x0130, {2, {0x0069, 0x0307}}},
-};
+/* C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -7 -k1,2,3 -F,-1 -c -j1 -i1 -t -T -E -C -H onigenc_unicode_CaseFold_11_hash -N onigenc_unicode_CaseFold_11_lookup -n */
-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 }}},
-};
+/* maximum key range = 2294, duplicates = 0 */
-static const CaseUnfold_11_Type CaseUnfold_11_Locale[] = {
- { 0x0069, {1, {0x0049 }}},
-};
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+/*ARGSUSED*/
+static unsigned int
+onigenc_unicode_CaseFold_11_hash(const OnigCodePoint code)
+{
+ static const unsigned short asso_values[] =
+ {
+ 5, 207, 4, 313, 3, 2304, 97, 155, 2, 208,
+ 137, 4, 2304, 2304, 2304, 2304, 2304, 2304, 2304, 2304,
+ 2304, 2304, 2304, 2304, 2304, 11, 2304, 2304, 2304, 2304,
+ 2304, 2304, 2304, 204, 2304, 2304, 2304, 2304, 2304, 17,
+ 2304, 2304, 2304, 2304, 2304, 2304, 2304, 2304, 2304, 308,
+ 2304, 2304, 2304, 2304, 2304, 2304, 2304, 2304, 2304, 2304,
+ 13, 10, 290, 1, 2304, 2304, 275, 3, 2304, 2304,
+ 2304, 2304, 2304, 458, 2304, 2304, 163, 595, 210, 39,
+ 1658, 461, 1716, 421, 1686, 317, 685, 6, 12, 25,
+ 1581, 592, 1645, 241, 1544, 115, 1621, 191, 1530, 272,
+ 1605, 70, 1388, 53, 1474, 146, 1454, 367, 1448, 210,
+ 1587, 132, 1360, 348, 1347, 101, 1312, 84, 177, 561,
+ 1199, 504, 1080, 534, 438, 578, 197, 635, 1371, 611,
+ 1363, 758, 670, 726, 1069, 694, 1421, 671, 1440, 736,
+ 1519, 788, 556, 1310, 949, 1137, 1433, 926, 546, 1290,
+ 1321, 913, 713, 813, 1505, 884, 87, 1273, 651, 515,
+ 942, 1043, 1536, 1262, 767, 851, 182, 1223, 168, 1212,
+ 97, 1404, 24, 1284, 23, 1006, 11, 832, 332, 989,
+ 5, 1098, 259, 969, 225, 955, 278, 868, 237, 1102,
+ 142, 1208, 26, 1326, 4, 1330, 100, 624, 208, 1559,
+ 19, 1494, 1178, 1614, 674, 1392, 296
+ };
+ return asso_values[bits_of(code, 2)+79] + asso_values[bits_of(code, 1)] + asso_values[bits_of(code, 0)];
+}
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+static const CodePointList3 *
+onigenc_unicode_CaseFold_11_lookup(const OnigCodePoint code)
+{
+ enum
+ {
+ MIN_CODE_VALUE = 0x41,
+ MAX_CODE_VALUE = 0x118bf,
+ TOTAL_KEYWORDS = 1321,
+ MIN_WORD_LENGTH = 3,
+ MAX_WORD_LENGTH = 3,
+ MIN_HASH_VALUE = 10,
+ MAX_HASH_VALUE = 2303
+ };
+
+ static const short wordlist[] =
+ {
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ /*0x1ff3*/ 800,
+ /*0x10408*/ 1204,
+ /*0x1f88*/ 720,
+ /*0x0408*/ 305,
+ /*0x0208*/ 194,
+ /*0x0108*/ 61,
+ /*0xab88*/ 1102,
+ /*0x10409*/ 1205,
+ /*0x1f89*/ 721,
+ /*0x0409*/ 306,
+ /*0x10c88*/ 1244,
+ /*0x1e88*/ 598,
+ /*0xab89*/ 1103,
+ /*0x2c08*/ 864,
+ /*0x1e08*/ 534,
+ /*0x1ff9*/ 805,
+ /*0x10c89*/ 1245,
+ -1,
+ /*0x0179*/ 117,
+ /*0x2c09*/ 865,
+ /*0x1040a*/ 1206,
+ /*0x1f8a*/ 722,
+ /*0x040a*/ 307,
+ /*0x020a*/ 195,
+ /*0x010a*/ 62,
+ /*0xab8a*/ 1104,
+ /*0x2c88*/ 922,
+ -1, -1,
+ /*0x10c8a*/ 1246,
+ /*0x1e8a*/ 599,
+ /*0x13f9*/ 525,
+ /*0x2c0a*/ 866,
+ /*0x1e0a*/ 535,
+ /*0x10400*/ 1196,
+ /*0x1f80*/ 712,
+ /*0x0400*/ 297,
+ /*0x0200*/ 190,
+ /*0x0100*/ 57,
+ /*0xab80*/ 1094,
+ -1, -1, -1,
+ /*0x10c80*/ 1236,
+ /*0x1e80*/ 594,
+ /*0x2c8a*/ 923,
+ /*0x2c00*/ 856,
+ /*0x1e00*/ 530,
+ /*0x10418*/ 1220,
+ /*0x1f98*/ 736,
+ /*0x0418*/ 321,
+ /*0x0218*/ 202,
+ /*0x0118*/ 69,
+ /*0xab98*/ 1118,
+ -1, -1, -1,
+ /*0x10c98*/ 1260,
+ /*0x1e98*/ 607,
+ /*0x2c80*/ 918,
+ /*0x2c18*/ 880,
+ /*0x1e18*/ 542,
+ -1, -1, -1,
+ /*0x10416*/ 1218,
+ /*0x1f96*/ 734,
+ /*0x0416*/ 319,
+ /*0x0216*/ 201,
+ /*0x0116*/ 68,
+ /*0xab96*/ 1116,
+ -1,
+ /*0xa780*/ 1050,
+ /*0x2c98*/ 930,
+ /*0x10c96*/ 1258,
+ /*0x1e96*/ 605,
+ -1,
+ /*0x2c16*/ 878,
+ /*0x1e16*/ 541,
+ /*0x10426*/ 1234,
+ /*0x1fa6*/ 750,
+ /*0x0426*/ 335,
+ /*0x0226*/ 209,
+ /*0x0126*/ 76,
+ /*0xaba6*/ 1132,
+ -1,
+ /*0xa798*/ 1059,
+ /*0x004d*/ 11,
+ /*0x10ca6*/ 1274,
+ /*0x1ea6*/ 615,
+ /*0x2c96*/ 929,
+ /*0x2c26*/ 894,
+ /*0x1e26*/ 549,
+ /*0x1fdb*/ 788,
+ -1, -1,
+ /*0x10424*/ 1232,
+ /*0x1fa4*/ 748,
+ /*0x0424*/ 333,
+ /*0x0224*/ 208,
+ /*0x0124*/ 75,
+ /*0xaba4*/ 1130,
+ -1,
+ /*0xa796*/ 1058,
+ /*0x2ca6*/ 937,
+ /*0x10ca4*/ 1272,
+ /*0x1ea4*/ 614,
+ /*0x2c75*/ 915,
+ /*0x2c24*/ 892,
+ /*0x1e24*/ 548,
+ /*0x10410*/ 1212,
+ /*0x1f90*/ 728,
+ /*0x0410*/ 313,
+ /*0x0210*/ 198,
+ /*0x0110*/ 65,
+ /*0xab90*/ 1110,
+ -1,
+ /*0xa7a6*/ 1066,
+ -1,
+ /*0x10c90*/ 1252,
+ /*0x1e90*/ 602,
+ /*0x2ca4*/ 936,
+ /*0x2c10*/ 872,
+ /*0x1e10*/ 538,
+ -1, -1, -1,
+ /*0x10420*/ 1228,
+ /*0x1fa0*/ 744,
+ /*0x0420*/ 329,
+ /*0x0220*/ 206,
+ /*0x0120*/ 73,
+ /*0xaba0*/ 1126,
+ -1,
+ /*0xa7a4*/ 1065,
+ /*0x2c90*/ 926,
+ /*0x10ca0*/ 1268,
+ /*0x1ea0*/ 612,
+ /*0x0508*/ 425,
+ /*0x2c20*/ 888,
+ /*0x1e20*/ 546,
+ /*0x1041a*/ 1222,
+ /*0x1f9a*/ 738,
+ /*0x041a*/ 323,
+ /*0x021a*/ 203,
+ /*0x011a*/ 70,
+ /*0xab9a*/ 1120,
+ -1,
+ /*0xa790*/ 1056,
+ /*0x2c6f*/ 912,
+ /*0x10c9a*/ 1262,
+ /*0x1e9a*/ 609,
+ /*0x2ca0*/ 934,
+ /*0x2c1a*/ 882,
+ /*0x1e1a*/ 543,
+ -1,
+ /*0x0388*/ 235,
+ /*0x050a*/ 426,
+ -1, -1, -1, -1,
+ /*0x0389*/ 236,
+ -1,
+ /*0x1fd9*/ 786,
+ /*0xa7a0*/ 1063,
+ /*0x2c9a*/ 931,
+ -1,
+ /*0x0059*/ 23,
+ /*0x03f9*/ 292,
+ -1,
+ /*0x0500*/ 421,
+ /*0x10427*/ 1235,
+ /*0x1fa7*/ 751,
+ /*0x0427*/ 336,
+ /*0x038a*/ 237,
+ /*0x03f1*/ 288,
+ /*0xaba7*/ 1133,
+ /*0x1fd7*/ 784,
+ /*0xa79a*/ 1060,
+ -1,
+ /*0x10ca7*/ 1275,
+ /*0x0057*/ 21,
+ -1,
+ /*0x2c27*/ 895,
+ /*0x0518*/ 433,
+ /*0x10412*/ 1214,
+ /*0x1f92*/ 730,
+ /*0x0412*/ 315,
+ /*0x0212*/ 199,
+ /*0x0112*/ 66,
+ /*0xab92*/ 1112,
+ -1,
+ /*0x1faf*/ 759,
+ /*0x042f*/ 344,
+ /*0x10c92*/ 1254,
+ /*0x1e92*/ 603,
+ /*0xabaf*/ 1141,
+ /*0x2c12*/ 874,
+ /*0x1e12*/ 539,
+ -1,
+ /*0x10caf*/ 1283,
+ /*0x0516*/ 432,
+ /*0x0398*/ 249,
+ /*0x1ff7*/ 803,
+ /*0x1041e*/ 1226,
+ /*0x1f9e*/ 742,
+ /*0x041e*/ 327,
+ /*0x021e*/ 205,
+ /*0x011e*/ 72,
+ /*0xab9e*/ 1124,
+ /*0x2c92*/ 927,
+ -1, -1,
+ /*0x10c9e*/ 1266,
+ /*0x1e9e*/ 611,
+ /*0x0526*/ 440,
+ /*0x2c1e*/ 886,
+ /*0x1e1e*/ 545,
+ /*0x054d*/ 473,
+ /*0x0396*/ 247,
+ /*0x1fe9*/ 795,
+ -1,
+ /*0xa779*/ 1046,
+ /*0xa792*/ 1057,
+ /*0x00df*/ 56,
+ /*0x00dd*/ 54,
+ -1,
+ /*0x048a*/ 362,
+ -1,
+ /*0x2c9e*/ 933,
+ -1,
+ /*0x2c69*/ 908,
+ /*0x0524*/ 439,
+ /*0x03a6*/ 262,
+ -1,
+ /*0x1040e*/ 1210,
+ /*0x1f8e*/ 726,
+ /*0x040e*/ 311,
+ /*0x020e*/ 197,
+ /*0x010e*/ 64,
+ /*0xab8e*/ 1108,
+ /*0x0480*/ 361,
+ /*0xa79e*/ 1062,
+ /*0x2c6d*/ 910,
+ /*0x10c8e*/ 1250,
+ /*0x1e8e*/ 601,
+ /*0x0510*/ 429,
+ /*0x2c0e*/ 870,
+ /*0x1e0e*/ 537,
+ /*0x03f5*/ 290,
+ /*0x03a4*/ 260,
+ -1, -1, -1,
+ /*0x1fe7*/ 793,
+ /*0x0498*/ 369,
+ /*0x2ced*/ 969,
+ -1, -1, -1,
+ /*0x2c8e*/ 925,
+ -1, -1,
+ /*0x0520*/ 437,
+ /*0x0390*/ 241,
+ /*0x2c67*/ 907,
+ /*0x10414*/ 1216,
+ /*0x1f94*/ 732,
+ /*0x0414*/ 317,
+ /*0x0214*/ 200,
+ /*0x0114*/ 67,
+ /*0xab94*/ 1114,
+ /*0x0496*/ 368,
+ /*0x1feb*/ 797,
+ /*0x2165*/ 818,
+ /*0x10c94*/ 1256,
+ /*0x1e94*/ 604,
+ /*0x051a*/ 434,
+ /*0x2c14*/ 876,
+ /*0x1e14*/ 540,
+ /*0x2161*/ 814,
+ /*0x03a0*/ 257,
+ /*0x10a6*/ 490,
+ -1,
+ /*0x2c6b*/ 909,
+ /*0x10cd*/ 523,
+ /*0x04a6*/ 376,
+ /*0xa726*/ 1010,
+ /*0x00cd*/ 39,
+ /*0x04cd*/ 396,
+ /*0x1f08*/ 660,
+ /*0x2c94*/ 928,
+ -1, -1,
+ /*0x017f*/ 120,
+ /*0x039a*/ 251,
+ /*0x1f09*/ 661,
+ /*0x2ceb*/ 968,
+ /*0x00db*/ 52,
+ /*0x10a4*/ 488,
+ -1, -1,
+ /*0x2c7f*/ 917,
+ /*0x04a4*/ 375,
+ /*0xa724*/ 1009,
+ -1, -1,
+ /*0x1f5f*/ 703,
+ /*0x1f5d*/ 702,
+ /*0x1f0a*/ 662,
+ -1,
+ /*0x10406*/ 1202,
+ /*0x1f86*/ 718,
+ /*0x0406*/ 303,
+ /*0x0206*/ 193,
+ /*0x0106*/ 60,
+ /*0xab86*/ 1100,
+ /*0x0490*/ 365,
+ -1,
+ /*0x0189*/ 126,
+ /*0x10c86*/ 1242,
+ /*0x1e86*/ 597,
+ /*0x0512*/ 430,
+ /*0x2c06*/ 862,
+ /*0x1e06*/ 533,
+ -1,
+ /*0x03a7*/ 263,
+ /*0x1fe3*/ 790,
+ -1, -1,
+ /*0x10a0*/ 484,
+ -1,
+ /*0x018a*/ 127,
+ /*0x01f1*/ 181,
+ /*0x04a0*/ 373,
+ -1,
+ /*0x2c86*/ 921,
+ /*0x1f18*/ 668,
+ /*0x2c63*/ 905,
+ -1,
+ /*0x0392*/ 243,
+ /*0x051e*/ 436,
+ /*0x10422*/ 1230,
+ /*0x1fa2*/ 746,
+ /*0x0422*/ 331,
+ /*0x0222*/ 207,
+ /*0x0122*/ 74,
+ /*0xaba2*/ 1128,
+ /*0x049a*/ 370,
+ /*0xa786*/ 1053,
+ -1,
+ /*0x10ca2*/ 1270,
+ /*0x1ea2*/ 613,
+ /*0x2126*/ 809,
+ /*0x2c22*/ 890,
+ /*0x1e22*/ 547,
+ -1,
+ /*0x03f7*/ 291,
+ -1,
+ /*0x039e*/ 255,
+ /*0x0198*/ 137,
+ /*0x1041c*/ 1224,
+ /*0x1f9c*/ 740,
+ /*0x041c*/ 325,
+ /*0x021c*/ 204,
+ /*0x011c*/ 71,
+ /*0xab9c*/ 1122,
+ /*0x2ca2*/ 935,
+ -1,
+ /*0x00d9*/ 50,
+ /*0x10c9c*/ 1264,
+ /*0x1f4d*/ 695,
+ /*0x050e*/ 428,
+ /*0x2c1c*/ 884,
+ /*0x1e1c*/ 544,
+ /*0x10a7*/ 491,
+ -1,
+ /*0x0196*/ 135,
+ -1, -1,
+ /*0xa7a2*/ 1064,
+ /*0x1f5b*/ 701,
+ -1, -1,
+ /*0x118a6*/ 1293,
+ -1,
+ /*0x2c9c*/ 932,
+ /*0x037f*/ 233,
+ -1, -1,
+ /*0x038e*/ 239,
+ /*0x01a6*/ 144,
+ -1,
+ /*0x0492*/ 366,
+ /*0x01cd*/ 163,
+ /*0x10af*/ 499,
+ -1, -1, -1,
+ /*0xa79c*/ 1061,
+ -1,
+ /*0x118a4*/ 1291,
+ -1,
+ /*0x0514*/ 431,
+ /*0x01db*/ 170,
+ -1, -1, -1,
+ /*0x01a4*/ 143,
+ -1, -1,
+ /*0x216f*/ 828,
+ /*0x049e*/ 372,
+ -1, -1,
+ /*0x10404*/ 1200,
+ /*0x1f84*/ 716,
+ /*0x0404*/ 301,
+ /*0x0204*/ 192,
+ /*0x0104*/ 59,
+ /*0xab84*/ 1098,
+ /*0x0394*/ 245,
+ /*0x0190*/ 131,
+ -1,
+ /*0x10c84*/ 1240,
+ /*0x1e84*/ 596,
+ /*0x1f6f*/ 711,
+ /*0x2c04*/ 860,
+ /*0x1e04*/ 532,
+ -1,
+ /*0x1f1a*/ 670,
+ -1,
+ /*0x118a0*/ 1287,
+ /*0x1fad*/ 757,
+ /*0x042d*/ 342,
+ -1, -1,
+ /*0xabad*/ 1139,
+ -1,
+ /*0x01a0*/ 141,
+ /*0x2c84*/ 920,
+ /*0x10cad*/ 1281,
+ -1,
+ /*0x048e*/ 364,
+ /*0x2c2d*/ 901,
+ /*0x03ff*/ 296,
+ -1, -1,
+ /*0x0506*/ 424,
+ -1, -1, -1,
+ /*0x1f59*/ 700,
+ /*0xa784*/ 1052,
+ -1,
+ /*0x10402*/ 1198,
+ /*0x1f82*/ 714,
+ /*0x0402*/ 299,
+ /*0x0202*/ 191,
+ /*0x0102*/ 58,
+ /*0xab82*/ 1096,
+ -1, -1, -1,
+ /*0x10c82*/ 1238,
+ /*0x1e82*/ 595,
+ /*0x0386*/ 234,
+ /*0x2c02*/ 858,
+ /*0x1e02*/ 531,
+ -1,
+ /*0xa7ad*/ 1071,
+ -1, -1, -1,
+ /*0x0494*/ 367,
+ /*0x01d9*/ 169,
+ -1,
+ /*0x118a7*/ 1294,
+ -1,
+ /*0x0522*/ 438,
+ /*0x2c82*/ 919,
+ /*0x1f2f*/ 681,
+ -1, -1,
+ /*0x01a7*/ 145,
+ -1, -1, -1, -1,
+ /*0x01d7*/ 168,
+ -1, -1, -1,
+ /*0xa782*/ 1051,
+ /*0x2169*/ 822,
+ -1, -1,
+ /*0x118af*/ 1302,
+ /*0x051c*/ 435,
+ /*0x1faa*/ 754,
+ /*0x042a*/ 339,
+ /*0x022a*/ 211,
+ /*0x012a*/ 78,
+ /*0xabaa*/ 1136,
+ /*0x01af*/ 149,
+ -1,
+ /*0x216d*/ 826,
+ /*0x10caa*/ 1278,
+ /*0x1eaa*/ 617,
+ /*0x1f69*/ 705,
+ /*0x2c2a*/ 898,
+ /*0x1e2a*/ 551,
+ -1,
+ /*0x0150*/ 96,
+ /*0x0050*/ 14,
+ /*0x01f7*/ 185,
+ /*0x039c*/ 253,
+ -1,
+ /*0xfb00*/ 1158,
+ /*0x1ed0*/ 636,
+ -1,
+ /*0x1f6d*/ 709,
+ /*0x1e50*/ 570,
+ /*0x2caa*/ 939,
+ -1,
+ /*0x1f0e*/ 666,
+ -1, -1,
+ /*0x2167*/ 820,
+ /*0x1fac*/ 756,
+ /*0x042c*/ 341,
+ /*0x022c*/ 212,
+ /*0x012c*/ 79,
+ /*0xabac*/ 1138,
+ /*0x2cd0*/ 958,
+ -1,
+ /*0xa7aa*/ 1068,
+ /*0x10cac*/ 1280,
+ /*0x1eac*/ 618,
+ /*0x24cd*/ 853,
+ /*0x2c2c*/ 900,
+ /*0x1e2c*/ 552,
+ -1,
+ /*0x0245*/ 223,
+ /*0x0145*/ 90,
+ /*0x0045*/ 4,
+ /*0x10a2*/ 486,
+ /*0x216b*/ 824,
+ /*0x018e*/ 129,
+ /*0xfb16*/ 1168,
+ /*0x04a2*/ 374,
+ /*0xa722*/ 1008,
+ /*0x0504*/ 423,
+ /*0x2cac*/ 940,
+ /*0x013f*/ 87,
+ /*0xabbf*/ 1157,
+ /*0x1fa8*/ 752,
+ /*0x0428*/ 337,
+ /*0x0228*/ 210,
+ /*0x0128*/ 77,
+ /*0xaba8*/ 1134,
+ -1,
+ /*0x1f6b*/ 707,
+ -1,
+ /*0x10ca8*/ 1276,
+ /*0x1ea8*/ 616,
+ /*0xa7ac*/ 1070,
+ /*0x2c28*/ 896,
+ /*0x1e28*/ 550,
+ /*0x049c*/ 371,
+ -1, -1, -1,
+ /*0x1fae*/ 758,
+ /*0x042e*/ 343,
+ /*0x022e*/ 213,
+ /*0x012e*/ 80,
+ /*0xabae*/ 1140,
+ -1,
+ /*0x0194*/ 134,
+ /*0x2ca8*/ 938,
+ /*0x10cae*/ 1282,
+ /*0x1eae*/ 619,
+ /*0xff26*/ 1175,
+ /*0x2c2e*/ 902,
+ /*0x1e2e*/ 553,
+ /*0x1040c*/ 1208,
+ /*0x1f8c*/ 724,
+ /*0x040c*/ 309,
+ /*0x020c*/ 196,
+ /*0x010c*/ 63,
+ /*0xab8c*/ 1106,
+ /*0x0502*/ 422,
+ /*0xa7a8*/ 1067,
+ /*0xa688*/ 998,
+ /*0x10c8c*/ 1248,
+ /*0x1e8c*/ 600,
+ /*0x2cae*/ 941,
+ /*0x2c0c*/ 868,
+ /*0x1e0c*/ 536,
+ /*0xff24*/ 1173,
+ /*0x2163*/ 816,
+ -1, -1, -1, -1,
+ /*0x1fb2*/ 760,
+ -1,
+ /*0x0232*/ 215,
+ /*0x0132*/ 81,
+ /*0xabb2*/ 1144,
+ /*0x2c8c*/ 924,
+ -1,
+ /*0xa68a*/ 999,
+ /*0x10cb2*/ 1286,
+ /*0x1eb2*/ 621,
+ -1, -1,
+ /*0x1e32*/ 555,
+ /*0x1ff6*/ 802,
+ /*0x0476*/ 356,
+ -1,
+ /*0x0176*/ 115,
+ -1,
+ /*0x0186*/ 124,
+ -1, -1,
+ /*0xa680*/ 994,
+ /*0x1ef6*/ 655,
+ -1,
+ /*0x2cb2*/ 943,
+ /*0x1e76*/ 589,
+ /*0x0230*/ 214,
+ /*0x0130*/ 1320,
+ /*0xabb0*/ 1142,
+ /*0x052a*/ 442,
+ /*0x10ad*/ 497,
+ /*0x0345*/ 229,
+ /*0x10cb0*/ 1284,
+ /*0x1eb0*/ 620,
+ -1,
+ /*0xa698*/ 1006,
+ /*0x1e30*/ 554,
+ /*0xa7b2*/ 1074,
+ -1, -1,
+ /*0x0550*/ 476,
+ -1,
+ /*0x118a2*/ 1289,
+ -1,
+ /*0x004f*/ 13,
+ /*0x1f1c*/ 672,
+ -1,
+ /*0x03aa*/ 266,
+ /*0x2cb0*/ 942,
+ /*0x01a2*/ 142,
+ -1, -1,
+ /*0xa696*/ 1005,
+ -1, -1, -1, -1, -1,
+ /*0x03d0*/ 271,
+ /*0x052c*/ 443,
+ /*0x1fba*/ 767,
+ /*0xa7b0*/ 1072,
+ /*0x023a*/ 216,
+ /*0xabb5*/ 1147,
+ /*0xabba*/ 1152,
+ /*0xa650*/ 979,
+ /*0x017d*/ 119,
+ -1,
+ /*0x019c*/ 138,
+ /*0x1eba*/ 625,
+ /*0xff27*/ 1176,
+ /*0x0545*/ 465,
+ /*0x1e3a*/ 559,
+ /*0x10407*/ 1203,
+ /*0x1f87*/ 719,
+ /*0x0407*/ 304,
+ /*0xab73*/ 1081,
+ /*0x0587*/ 483,
+ /*0xab87*/ 1101,
+ /*0x13fd*/ 529,
+ -1,
+ /*0x053f*/ 459,
+ /*0x10c87*/ 1243,
+ /*0x1fb8*/ 765,
+ /*0x2cba*/ 947,
+ /*0x2c07*/ 863,
+ /*0x0528*/ 441,
+ /*0xabb8*/ 1150,
+ -1, -1,
+ /*0xff2f*/ 1184,
+ /*0xab79*/ 1087,
+ /*0x1eb8*/ 624,
+ -1, -1,
+ /*0x1e38*/ 558,
+ /*0x10aa*/ 494,
+ /*0xa690*/ 1002,
+ /*0xab71*/ 1079,
+ -1,
+ /*0x04aa*/ 378,
+ /*0xa72a*/ 1012,
+ /*0x1fc9*/ 777,
+ /*0x052e*/ 444,
+ /*0x03a8*/ 264,
+ /*0x0149*/ 92,
+ /*0x0049*/ 1319,
+ /*0x2cb8*/ 946,
+ -1,
+ /*0x0376*/ 232,
+ /*0x00d0*/ 42,
+ /*0x04d0*/ 397,
+ /*0xa750*/ 1030,
+ -1, -1,
+ /*0x1fb6*/ 763,
+ /*0x1f2d*/ 679,
+ /*0x050c*/ 427,
+ /*0x0136*/ 83,
+ /*0xabb6*/ 1148,
+ -1, -1,
+ /*0x0184*/ 123,
+ -1,
+ /*0x1eb6*/ 623,
+ /*0x1fbc*/ 769,
+ /*0x10ac*/ 496,
+ /*0x1e36*/ 557,
+ /*0xa69a*/ 1007,
+ /*0xabbc*/ 1154,
+ /*0x04ac*/ 379,
+ /*0xa72c*/ 1013,
+ /*0x118ad*/ 1300,
+ -1,
+ /*0x1ebc*/ 626,
+ /*0x038c*/ 238,
+ /*0x0532*/ 446,
+ /*0x1e3c*/ 560,
+ /*0x10c5*/ 521,
+ /*0x2cb6*/ 945,
+ -1,
+ /*0x00c5*/ 31,
+ /*0x04c5*/ 392,
+ -1, -1,
+ /*0xfb14*/ 1166,
+ -1,
+ /*0x1fb4*/ 762,
+ /*0x10bf*/ 515,
+ /*0x2cbc*/ 948,
+ /*0x0134*/ 82,
+ /*0xabb4*/ 1146,
+ /*0xa7b6*/ 1077,
+ /*0x10a8*/ 492,
+ -1, -1,
+ /*0x1eb4*/ 622,
+ /*0x04a8*/ 377,
+ /*0xa728*/ 1011,
+ /*0x1e34*/ 556,
+ /*0x0055*/ 19,
+ -1,
+ /*0x0182*/ 122,
+ -1, -1, -1, -1,
+ /*0x212a*/ 810,
+ -1, -1,
+ /*0x10ae*/ 498,
+ /*0x2cb4*/ 944,
+ /*0xab75*/ 1083,
+ /*0xa692*/ 1003,
+ /*0x04ae*/ 380,
+ /*0xa72e*/ 1014,
+ /*0x054f*/ 475,
+ /*0x1fbe*/ 770,
+ /*0x03b0*/ 268,
+ /*0x023e*/ 219,
+ -1,
+ /*0xabbe*/ 1156,
+ /*0x1f2a*/ 676,
+ -1,
+ /*0xa7b4*/ 1076,
+ -1,
+ /*0x1ebe*/ 627,
+ -1,
+ /*0x048c*/ 363,
+ /*0x1e3e*/ 561,
+ /*0xfb06*/ 1164,
+ -1, -1,
+ /*0x1f50*/ 696,
+ /*0x03cf*/ 270,
+ /*0x0535*/ 449,
+ /*0x053a*/ 454,
+ -1,
+ /*0x118aa*/ 1297,
+ -1, -1,
+ /*0x2cbe*/ 949,
+ /*0x1fca*/ 778,
+ /*0x10b2*/ 502,
+ /*0x024a*/ 226,
+ /*0x014a*/ 93,
+ /*0x004a*/ 8,
+ /*0x04b2*/ 382,
+ /*0xa732*/ 1015,
+ -1, -1,
+ /*0x1eca*/ 633,
+ /*0x1f2c*/ 678,
+ -1,
+ /*0x1e4a*/ 567,
+ -1, -1,
+ /*0x03fd*/ 294,
+ -1,
+ /*0x0538*/ 452,
+ /*0x04f6*/ 416,
+ /*0x1fe2*/ 789,
+ /*0x0462*/ 346,
+ /*0xa68e*/ 1001,
+ /*0x0162*/ 105,
+ -1,
+ /*0x2cca*/ 955,
+ /*0x10b0*/ 500,
+ /*0x118ac*/ 1299,
+ -1,
+ /*0x1ee2*/ 645,
+ /*0x04b0*/ 381,
+ /*0x2c62*/ 904,
+ /*0x1e62*/ 579,
+ /*0x1f3f*/ 689,
+ /*0x01ac*/ 147,
+ -1, -1,
+ /*0x0549*/ 469,
+ /*0x1f28*/ 674,
+ /*0x1fd6*/ 783,
+ /*0xff22*/ 1171,
+ -1,
+ /*0x0156*/ 99,
+ /*0x0056*/ 20,
+ /*0x2ce2*/ 967,
+ /*0x00cf*/ 41,
+ /*0x01c5*/ 158,
+ -1,
+ /*0x1ed6*/ 639,
+ /*0x118bf*/ 1318,
+ /*0x0536*/ 450,
+ /*0x1e56*/ 573,
+ -1,
+ /*0xa694*/ 1004,
+ /*0x118a8*/ 1295,
+ /*0x1f2e*/ 680,
+ /*0x1fec*/ 798,
+ /*0x046c*/ 351,
+ -1,
+ /*0x016c*/ 110,
+ /*0x053c*/ 456,
+ /*0x10b5*/ 505,
+ /*0x10ba*/ 510,
+ /*0x2cd6*/ 961,
+ /*0x00b5*/ 25,
+ /*0x1eec*/ 650,
+ /*0x04ba*/ 386,
+ /*0xa73a*/ 1019,
+ /*0x1e6c*/ 584,
+ /*0x1f0c*/ 664,
+ /*0xa77d*/ 1048,
+ /*0x118ae*/ 1301,
+ /*0x1fcc*/ 780,
+ /*0x2132*/ 812,
+ /*0x024c*/ 227,
+ /*0x014c*/ 94,
+ /*0x004c*/ 10,
+ -1,
+ /*0x01ae*/ 148,
+ /*0xab77*/ 1085,
+ -1,
+ /*0x1ecc*/ 634,
+ /*0x0534*/ 448,
+ -1,
+ /*0x1e4c*/ 568,
+ /*0x10b8*/ 508,
+ -1, -1, -1,
+ /*0x04b8*/ 385,
+ /*0xa738*/ 1018,
+ /*0x0555*/ 481,
+ -1,
+ /*0xfb04*/ 1162,
+ -1, -1,
+ /*0x2ccc*/ 956,
+ -1,
+ /*0xa686*/ 997,
+ -1, -1,
+ /*0x1fc8*/ 776,
+ -1,
+ /*0x0248*/ 225,
+ /*0x118b2*/ 1305,
+ /*0x0048*/ 7,
+ -1,
+ /*0x00c9*/ 35,
+ /*0x04c9*/ 394,
+ /*0x03d5*/ 273,
+ /*0x1ec8*/ 632,
+ /*0x01b2*/ 151,
+ /*0x053e*/ 458,
+ /*0x1e48*/ 566,
+ /*0x1fc4*/ 773,
+ -1,
+ /*0x0244*/ 222,
+ /*0x10b6*/ 506,
+ /*0x0044*/ 3,
+ -1, -1,
+ /*0x04b6*/ 384,
+ /*0xa736*/ 1017,
+ /*0x1ec4*/ 630,
+ /*0x01f6*/ 184,
+ /*0x2cc8*/ 954,
+ /*0x1e44*/ 564,
+ /*0x10bc*/ 512,
+ /*0x118b0*/ 1303,
+ -1,
+ /*0xff2d*/ 1182,
+ /*0x04bc*/ 387,
+ /*0xa73c*/ 1020,
+ /*0xfb02*/ 1160,
+ /*0x0051*/ 15,
+ -1, -1,
+ /*0x054a*/ 470,
+ /*0x2cc4*/ 952,
+ /*0x0241*/ 220,
+ /*0x0141*/ 88,
+ /*0x0041*/ 0,
+ -1,
+ /*0x1fea*/ 796,
+ /*0x046a*/ 350,
+ -1,
+ /*0x016a*/ 109,
+ -1,
+ /*0x1f3a*/ 684,
+ /*0x10b4*/ 504,
+ -1,
+ /*0x01cf*/ 164,
+ /*0x1eea*/ 649,
+ /*0x04b4*/ 383,
+ /*0xa734*/ 1016,
+ /*0x1e6a*/ 583,
+ -1,
+ /*0x1fe8*/ 794,
+ /*0x0468*/ 349,
+ -1,
+ /*0x0168*/ 108,
+ /*0x00d5*/ 47,
+ /*0xa64a*/ 976,
+ /*0x118b5*/ 1308,
+ /*0x118ba*/ 1313,
+ -1,
+ /*0x1ee8*/ 648,
+ /*0xab7f*/ 1093,
+ -1,
+ /*0x1e68*/ 582,
+ /*0x01b5*/ 153,
+ /*0x1f38*/ 682,
+ -1, -1,
+ /*0x03e2*/ 280,
+ /*0x0556*/ 482,
+ -1,
+ /*0x1fe4*/ 791,
+ /*0x0464*/ 347,
+ /*0x10be*/ 514,
+ /*0x0164*/ 106,
+ /*0xa662*/ 988,
+ -1,
+ /*0x04be*/ 388,
+ /*0xa73e*/ 1021,
+ /*0x0187*/ 125,
+ /*0x1ee4*/ 646,
+ /*0x118b8*/ 1311,
+ /*0x2c64*/ 906,
+ /*0x1e64*/ 580,
+ /*0x1f49*/ 691,
+ /*0x24c5*/ 845,
+ -1,
+ /*0x03d6*/ 274,
+ /*0x01b8*/ 155,
+ /*0x0460*/ 345,
+ /*0xff2a*/ 1179,
+ /*0x0160*/ 104,
+ -1, -1,
+ /*0xa656*/ 982,
+ /*0x24bf*/ 839,
+ /*0xa684*/ 996,
+ /*0x1ee0*/ 644,
+ -1,
+ /*0x2c60*/ 903,
+ /*0x1e60*/ 578,
+ /*0x00ca*/ 36,
+ /*0x054c*/ 472,
+ /*0xa74a*/ 1027,
+ /*0x03ec*/ 285,
+ -1, -1,
+ /*0x1f3c*/ 686,
+ -1, -1, -1,
+ /*0xa66c*/ 993,
+ /*0x2ce0*/ 966,
+ /*0x118b6*/ 1309,
+ -1, -1, -1, -1, -1, -1,
+ /*0xff2c*/ 1181,
+ /*0x04e2*/ 406,
+ /*0xa762*/ 1039,
+ /*0x118bc*/ 1315,
+ -1,
+ /*0x1fd2*/ 781,
+ -1,
+ /*0xa64c*/ 977,
+ /*0x0152*/ 97,
+ /*0x0052*/ 16,
+ /*0x01bc*/ 156,
+ /*0x0548*/ 468,
+ -1, -1,
+ /*0x1ed2*/ 637,
+ -1,
+ /*0xa682*/ 995,
+ /*0x1e52*/ 571,
+ -1,
+ /*0x00d6*/ 48,
+ /*0x04d6*/ 400,
+ /*0xa756*/ 1033,
+ -1, -1,
+ /*0x0544*/ 464,
+ /*0x118b4*/ 1307,
+ -1,
+ /*0xff28*/ 1177,
+ -1,
+ /*0x2cd2*/ 959,
+ -1,
+ /*0x1fb7*/ 764,
+ -1, -1, -1,
+ /*0xabb7*/ 1149,
+ /*0xa648*/ 975,
+ /*0x04ec*/ 411,
+ /*0xa76c*/ 1044,
+ /*0x1f3e*/ 688,
+ /*0x0551*/ 477,
+ /*0x01d5*/ 167,
+ /*0x1fab*/ 755,
+ /*0x042b*/ 340,
+ /*0xff2e*/ 1183,
+ -1,
+ /*0xabab*/ 1137,
+ /*0x0541*/ 461,
+ -1,
+ /*0xa644*/ 973,
+ /*0x10cab*/ 1279,
+ -1,
+ /*0x00cc*/ 38,
+ /*0x2c2b*/ 899,
+ /*0xa74c*/ 1028,
+ /*0x118be*/ 1317,
+ -1, -1,
+ /*0x03d1*/ 272,
+ -1,
+ /*0x1fe6*/ 792,
+ /*0x0466*/ 348,
+ -1,
+ /*0x0166*/ 107,
+ /*0x1f4a*/ 692,
+ /*0x046e*/ 352,
+ -1,
+ /*0x016e*/ 111,
+ /*0x2162*/ 815,
+ /*0x1ee6*/ 647,
+ /*0x24cf*/ 855,
+ /*0x03ea*/ 284,
+ /*0x1e66*/ 581,
+ /*0x1eee*/ 651,
+ -1,
+ /*0x2c6e*/ 911,
+ /*0x1e6e*/ 585,
+ /*0xff32*/ 1187,
+ /*0xa66a*/ 992,
+ /*0xa7ab*/ 1069,
+ -1,
+ /*0x00c8*/ 34,
+ -1,
+ /*0xa748*/ 1026,
+ -1,
+ /*0x03e8*/ 283,
+ -1,
+ /*0x01ca*/ 161,
+ -1, -1,
+ /*0x24ba*/ 834,
+ /*0x10c4*/ 520,
+ /*0xa668*/ 991,
+ -1,
+ /*0x00c4*/ 30,
+ -1,
+ /*0xa744*/ 1024,
+ -1, -1,
+ /*0x1fc2*/ 771,
+ -1,
+ /*0xff30*/ 1185,
+ /*0x1f56*/ 699,
+ /*0x0042*/ 1,
+ /*0x216c*/ 825,
+ /*0x03e4*/ 281,
+ /*0x01e2*/ 173,
+ -1,
+ /*0x1ec2*/ 629,
+ -1,
+ /*0x00d1*/ 43,
+ /*0x1e42*/ 563,
+ /*0xa664*/ 989,
+ /*0x24b8*/ 832,
+ /*0x10c1*/ 517,
+ -1, -1,
+ /*0x00c1*/ 27,
+ /*0x04c1*/ 390,
+ /*0x1f6c*/ 708,
+ -1, -1,
+ /*0x03e0*/ 279,
+ /*0x2cc2*/ 951,
+ /*0x04ea*/ 410,
+ /*0xa76a*/ 1043,
+ -1, -1, -1,
+ /*0xa660*/ 987,
+ -1, -1,
+ /*0x24c9*/ 849,
+ -1, -1,
+ /*0x1f4c*/ 694,
+ /*0xff35*/ 1190,
+ /*0xff3a*/ 1195,
+ /*0x04e8*/ 409,
+ /*0xa768*/ 1042,
+ /*0x1ffb*/ 807,
+ /*0x0552*/ 478,
+ /*0x01ec*/ 178,
+ /*0x017b*/ 118,
+ -1,
+ /*0x24b6*/ 830,
+ -1,
+ /*0xa68c*/ 1000,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x24bc*/ 836,
+ /*0x13fb*/ 527,
+ -1,
+ /*0x04e4*/ 407,
+ /*0xa764*/ 1040,
+ /*0xff38*/ 1193,
+ /*0x1fa9*/ 753,
+ /*0x0429*/ 338,
+ -1,
+ /*0x1f48*/ 690,
+ /*0xaba9*/ 1135,
+ /*0xa652*/ 980,
+ /*0x0537*/ 451,
+ -1,
+ /*0x10ca9*/ 1277,
+ -1,
+ /*0x0470*/ 353,
+ /*0x2c29*/ 897,
+ /*0x0170*/ 112,
+ /*0x1fda*/ 787,
+ /*0x04e0*/ 405,
+ /*0xa760*/ 1038,
+ /*0x015a*/ 101,
+ /*0x005a*/ 24,
+ /*0x1ef0*/ 652,
+ -1,
+ /*0x2c70*/ 913,
+ /*0x1e70*/ 586,
+ /*0x1eda*/ 641,
+ -1,
+ /*0x1fd8*/ 785,
+ /*0x1e5a*/ 575,
+ /*0x01c8*/ 160,
+ /*0x0158*/ 100,
+ /*0x0058*/ 22,
+ -1,
+ /*0x216a*/ 823,
+ /*0xff36*/ 1191,
+ -1,
+ /*0x1ed8*/ 640,
+ -1,
+ /*0x03ab*/ 267,
+ /*0x1e58*/ 574,
+ /*0x2cda*/ 963,
+ -1,
+ /*0x01c4*/ 157,
+ -1, -1, -1, -1,
+ /*0x2168*/ 821,
+ /*0x1f6a*/ 706,
+ /*0x24be*/ 838,
+ -1,
+ /*0x2cd8*/ 962,
+ -1,
+ /*0x00d2*/ 44,
+ /*0x04d2*/ 398,
+ /*0xa752*/ 1031,
+ /*0x03e6*/ 282,
+ -1,
+ /*0x01d1*/ 165,
+ -1,
+ /*0x03ee*/ 286,
+ -1,
+ /*0x1f68*/ 704,
+ /*0xa666*/ 990,
+ -1, -1,
+ /*0xff34*/ 1189,
+ /*0x2164*/ 817,
+ -1,
+ /*0x0154*/ 98,
+ /*0x0054*/ 18,
+ /*0x01ea*/ 177,
+ -1, -1,
+ /*0x24ca*/ 850,
+ /*0x1ed4*/ 638,
+ /*0x10b7*/ 507,
+ /*0x0542*/ 462,
+ /*0x1e54*/ 572,
+ /*0x024e*/ 228,
+ /*0x014e*/ 95,
+ /*0x004e*/ 12,
+ -1, -1,
+ /*0x2160*/ 813,
+ /*0x01e8*/ 176,
+ /*0x1ece*/ 635,
+ /*0x10ab*/ 495,
+ -1,
+ /*0x1e4e*/ 569,
+ /*0x2cd4*/ 960,
+ /*0x015e*/ 103,
+ -1, -1,
+ /*0x1fc6*/ 774,
+ /*0x03c2*/ 269,
+ /*0x0246*/ 224,
+ /*0x1ede*/ 643,
+ /*0x0046*/ 5,
+ -1,
+ /*0x1e5e*/ 577,
+ /*0x2cce*/ 957,
+ /*0xa642*/ 972,
+ /*0x1ec6*/ 631,
+ -1,
+ /*0x01e4*/ 174,
+ /*0x1e46*/ 565,
+ -1,
+ /*0x0370*/ 230,
+ /*0x04e6*/ 408,
+ /*0xa766*/ 1041,
+ /*0xab76*/ 1084,
+ /*0x2cde*/ 965,
+ /*0x04ee*/ 412,
+ /*0xa76e*/ 1045,
+ /*0x10425*/ 1233,
+ /*0x1fa5*/ 749,
+ /*0x0425*/ 334,
+ /*0x2cc6*/ 953,
+ -1,
+ /*0xaba5*/ 1131,
+ -1,
+ /*0x01e0*/ 172,
+ /*0x1ec0*/ 628,
+ /*0x10ca5*/ 1273,
+ /*0x1fc7*/ 775,
+ /*0x1e40*/ 562,
+ /*0x2c25*/ 893,
+ /*0x0147*/ 91,
+ /*0x0047*/ 6,
+ /*0x1ff2*/ 799,
+ /*0x0472*/ 354,
+ -1,
+ /*0x0172*/ 113,
+ /*0x1ff4*/ 801,
+ /*0x0474*/ 355,
+ /*0x1f52*/ 697,
+ /*0x0174*/ 114,
+ /*0x2cc0*/ 950,
+ /*0x1ef2*/ 653,
+ -1,
+ /*0x2c72*/ 914,
+ /*0x1e72*/ 587,
+ /*0x1ef4*/ 654,
+ /*0x10c2*/ 518,
+ /*0x24cc*/ 852,
+ /*0x1e74*/ 588,
+ /*0x00c2*/ 28,
+ -1,
+ /*0xa742*/ 1023,
+ /*0x10423*/ 1231,
+ /*0x1fa3*/ 747,
+ /*0x0423*/ 332,
+ -1,
+ /*0x2cf2*/ 970,
+ /*0xaba3*/ 1129,
+ -1,
+ /*0x03a9*/ 265,
+ /*0x212b*/ 811,
+ /*0x10ca3*/ 1271,
+ -1,
+ /*0xab7d*/ 1091,
+ /*0x2c23*/ 891,
+ /*0x10421*/ 1229,
+ /*0x1fa1*/ 745,
+ /*0x0421*/ 330,
+ /*0x03f0*/ 287,
+ /*0x1fb3*/ 761,
+ /*0xaba1*/ 1127,
+ -1,
+ /*0x03da*/ 276,
+ /*0xabb3*/ 1145,
+ /*0x10ca1*/ 1269,
+ /*0x1f2b*/ 677,
+ /*0x24c8*/ 848,
+ /*0x2c21*/ 889,
+ /*0x2166*/ 819,
+ /*0xa65a*/ 984,
+ /*0x118b7*/ 1310,
+ /*0xabb1*/ 1143,
+ /*0x216e*/ 827,
+ /*0x03d8*/ 275,
+ -1,
+ /*0x10cb1*/ 1285,
+ -1,
+ /*0x01b7*/ 154,
+ -1,
+ /*0x24c4*/ 844,
+ /*0xa658*/ 983,
+ /*0x118ab*/ 1298,
+ /*0xa77b*/ 1047,
+ /*0x10417*/ 1219,
+ /*0x1f97*/ 735,
+ /*0x0417*/ 320,
+ -1,
+ /*0x1f6e*/ 710,
+ /*0xab97*/ 1117,
+ /*0x047e*/ 360,
+ -1, -1,
+ /*0x10c97*/ 1259,
+ /*0x1e97*/ 606,
+ /*0x0554*/ 480,
+ /*0x2c17*/ 879,
+ /*0xa7b3*/ 1075,
+ /*0x1efe*/ 659,
+ /*0x10a9*/ 493,
+ /*0x2c7e*/ 916,
+ /*0x1e7e*/ 593,
+ -1,
+ /*0x24c1*/ 841,
+ /*0x015c*/ 102,
+ /*0xa7b1*/ 1073,
+ /*0x054e*/ 474,
+ /*0x01e6*/ 175,
+ -1, -1,
+ /*0x1edc*/ 642,
+ /*0x01ee*/ 179,
+ /*0x04f0*/ 413,
+ /*0x1e5c*/ 576,
+ -1,
+ /*0x00da*/ 51,
+ /*0x04da*/ 402,
+ /*0xa75a*/ 1035,
+ /*0x1fb9*/ 766,
+ /*0x0372*/ 231,
+ /*0xa654*/ 981,
+ /*0x0139*/ 84,
+ /*0xabb9*/ 1151,
+ /*0x0546*/ 466,
+ -1,
+ /*0x2cdc*/ 964,
+ /*0x00d8*/ 49,
+ /*0x04d8*/ 401,
+ /*0xa758*/ 1034,
+ -1,
+ /*0x1fc3*/ 772,
+ /*0xa64e*/ 978,
+ /*0x0243*/ 221,
+ /*0x0143*/ 89,
+ /*0x0043*/ 2,
+ /*0x03de*/ 278,
+ -1,
+ /*0x1fbb*/ 768,
+ -1,
+ /*0x023b*/ 217,
+ /*0x013b*/ 85,
+ /*0xabbb*/ 1153,
+ /*0xa65e*/ 986,
+ /*0x0540*/ 460,
+ /*0x1041d*/ 1225,
+ /*0x1f9d*/ 741,
+ /*0x041d*/ 326,
+ -1,
+ /*0xa646*/ 974,
+ /*0xab9d*/ 1123,
+ /*0x1041b*/ 1223,
+ /*0x1f9b*/ 739,
+ /*0x041b*/ 324,
+ /*0x10c9d*/ 1265,
+ /*0x0547*/ 467,
+ /*0xab9b*/ 1121,
+ /*0x2c1d*/ 885,
+ -1, -1,
+ /*0x10c9b*/ 1263,
+ /*0x1e9b*/ 610,
+ -1,
+ /*0x2c1b*/ 883,
+ /*0x03a5*/ 261,
+ -1,
+ /*0x00d4*/ 46,
+ /*0x04d4*/ 399,
+ /*0xa754*/ 1032,
+ /*0xa640*/ 971,
+ -1,
+ /*0x10419*/ 1221,
+ /*0x1f99*/ 737,
+ /*0x0419*/ 322,
+ -1, -1,
+ /*0xab99*/ 1119,
+ /*0x00ce*/ 40,
+ -1,
+ /*0xa74e*/ 1029,
+ /*0x10c99*/ 1261,
+ /*0x1e99*/ 608,
+ /*0x03f4*/ 289,
+ /*0x2c19*/ 881,
+ -1, -1,
+ /*0x1f29*/ 675,
+ -1,
+ /*0x00de*/ 55,
+ /*0x04de*/ 404,
+ /*0xa75e*/ 1037,
+ -1,
+ /*0x1ffa*/ 806,
+ /*0x047a*/ 358,
+ /*0x00c6*/ 32,
+ -1,
+ /*0xa746*/ 1025,
+ /*0x0533*/ 447,
+ -1,
+ /*0x03a3*/ 259,
+ -1,
+ /*0x1efa*/ 657,
+ /*0x118a9*/ 1296,
+ /*0x1fcb*/ 779,
+ /*0x1e7a*/ 591,
+ /*0x0531*/ 445,
+ -1,
+ /*0x004b*/ 9,
+ /*0x13fa*/ 526,
+ /*0x01a9*/ 146,
+ -1,
+ /*0x10c0*/ 516,
+ /*0x03a1*/ 258,
+ /*0x10a5*/ 489,
+ /*0x00c0*/ 26,
+ /*0x04c0*/ 389,
+ /*0xa740*/ 1022,
+ -1,
+ /*0x01f0*/ 180,
+ /*0x023d*/ 218,
+ /*0x013d*/ 86,
+ /*0xabbd*/ 1155,
+ /*0x10c7*/ 522,
+ -1,
+ /*0x24b7*/ 831,
+ /*0x00c7*/ 33,
+ /*0x04c7*/ 393,
+ /*0x10413*/ 1215,
+ /*0x1f93*/ 731,
+ /*0x0413*/ 316,
+ -1,
+ /*0x04f2*/ 414,
+ /*0xab93*/ 1113,
+ -1,
+ /*0x1fd3*/ 782,
+ /*0x04f4*/ 415,
+ /*0x10c93*/ 1255,
+ -1,
+ /*0x0053*/ 17,
+ /*0x2c13*/ 875,
+ /*0x0397*/ 248,
+ /*0x1040f*/ 1211,
+ /*0x1f8f*/ 727,
+ /*0x040f*/ 312,
+ /*0x03fe*/ 295,
+ -1,
+ /*0xab8f*/ 1109,
+ -1,
+ /*0x10a3*/ 487,
+ /*0x1f54*/ 698,
+ /*0x10c8f*/ 1251,
+ -1, -1,
+ /*0x2c0f*/ 871,
+ -1,
+ /*0x0539*/ 453,
+ /*0x03dc*/ 277,
+ /*0x1ff8*/ 804,
+ /*0x0478*/ 357,
+ -1,
+ /*0x0178*/ 116,
+ /*0x10a1*/ 485,
+ -1,
+ /*0xa65c*/ 985,
+ /*0x10b3*/ 503,
+ -1,
+ /*0x1ef8*/ 656,
+ /*0x0543*/ 463,
+ -1,
+ /*0x1e78*/ 590,
+ -1,
+ /*0xff37*/ 1192,
+ /*0x10b1*/ 501,
+ /*0x13f8*/ 524,
+ /*0x053b*/ 455,
+ -1, -1, -1,
+ /*0x1040b*/ 1207,
+ /*0x1f8b*/ 723,
+ /*0x040b*/ 308,
+ -1,
+ /*0xff2b*/ 1180,
+ /*0xab8b*/ 1105,
+ /*0x1041f*/ 1227,
+ /*0x1f9f*/ 743,
+ /*0x041f*/ 328,
+ /*0x10c8b*/ 1247,
+ -1,
+ /*0xab9f*/ 1125,
+ /*0x2c0b*/ 867,
+ -1,
+ /*0x24c2*/ 842,
+ /*0x10c9f*/ 1267,
+ /*0x01de*/ 171,
+ -1,
+ /*0x2c1f*/ 887,
+ /*0x04fe*/ 420,
+ /*0xa77e*/ 1049,
+ -1,
+ /*0x039d*/ 254,
+ -1,
+ /*0x10415*/ 1217,
+ /*0x1f95*/ 733,
+ /*0x0415*/ 318,
+ -1,
+ /*0x039b*/ 252,
+ /*0xab95*/ 1115,
+ /*0x00dc*/ 53,
+ /*0x04dc*/ 403,
+ /*0xa75c*/ 1036,
+ /*0x10c95*/ 1257,
+ /*0x1ffc*/ 808,
+ /*0x047c*/ 359,
+ /*0x2c15*/ 877,
+ /*0x118a5*/ 1292,
+ /*0xa78b*/ 1054,
+ -1,
+ /*0x10411*/ 1213,
+ /*0x1f91*/ 729,
+ /*0x0411*/ 314,
+ /*0x1efc*/ 658,
+ /*0x10b9*/ 509,
+ /*0xab91*/ 1111,
+ /*0x1e7c*/ 592,
+ -1,
+ /*0x0399*/ 250,
+ /*0x10c91*/ 1253,
+ /*0x13fc*/ 528,
+ -1,
+ /*0x2c11*/ 873,
+ /*0x01c7*/ 159,
+ -1, -1,
+ /*0x10c3*/ 519,
+ -1,
+ /*0x01f2*/ 182,
+ /*0x00c3*/ 29,
+ /*0x04c3*/ 391,
+ /*0x054b*/ 471,
+ /*0x01f4*/ 183,
+ /*0x10bb*/ 511,
+ /*0x1040d*/ 1209,
+ /*0x1f8d*/ 725,
+ /*0x040d*/ 310,
+ -1,
+ /*0x03fa*/ 293,
+ /*0xab8d*/ 1107,
+ -1, -1,
+ /*0x118a3*/ 1290,
+ /*0x10c8d*/ 1249,
+ -1,
+ /*0x053d*/ 457,
+ /*0x2c0d*/ 869,
+ /*0x10401*/ 1197,
+ /*0x1f81*/ 713,
+ /*0x0401*/ 298,
+ -1, -1,
+ /*0xab81*/ 1095,
+ -1, -1,
+ /*0x118a1*/ 1288,
+ /*0x10c81*/ 1237,
+ -1,
+ /*0x118b3*/ 1306,
+ /*0x2c01*/ 857,
+ -1, -1,
+ /*0x0553*/ 479,
+ -1, -1,
+ /*0x01b3*/ 152,
+ /*0x118b1*/ 1304,
+ -1, -1, -1, -1, -1,
+ /*0xa78d*/ 1055,
+ /*0x01b1*/ 150,
+ /*0x0393*/ 244,
+ /*0x10405*/ 1201,
+ /*0x1f85*/ 717,
+ /*0x0405*/ 302,
+ -1, -1,
+ /*0xab85*/ 1099,
+ -1, -1, -1,
+ /*0x10c85*/ 1241,
+ -1, -1,
+ /*0x2c05*/ 861,
+ /*0x038f*/ 240,
+ -1,
+ /*0x0197*/ 136,
+ /*0x04fa*/ 418,
+ -1,
+ /*0xff29*/ 1178,
+ /*0x01fe*/ 189,
+ -1, -1, -1, -1, -1,
+ /*0x1f39*/ 683,
+ /*0x00cb*/ 37,
+ /*0x04cb*/ 395,
+ -1, -1,
+ /*0x10403*/ 1199,
+ /*0x1f83*/ 715,
+ /*0x0403*/ 300,
+ /*0x2183*/ 829,
+ -1,
+ /*0xab83*/ 1097,
+ -1,
+ /*0x10bd*/ 513,
+ -1,
+ /*0x10c83*/ 1239,
+ -1,
+ /*0x118b9*/ 1312,
+ /*0x2c03*/ 859,
+ -1,
+ /*0x1f3b*/ 685,
+ /*0x24ce*/ 854,
+ -1, -1, -1, -1, -1, -1,
+ /*0x1f1d*/ 673,
+ -1, -1, -1,
+ /*0x039f*/ 256,
+ /*0x00d3*/ 45,
+ /*0x1f1b*/ 671,
+ -1,
+ /*0x118bb*/ 1314,
+ -1,
+ /*0x24c6*/ 846,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0x0395*/ 246,
+ /*0x019d*/ 139,
+ -1, -1,
+ /*0x1f19*/ 669,
+ -1, -1,
+ /*0x04f8*/ 417,
+ /*0x24c0*/ 840,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x0391*/ 242,
+ -1, -1,
+ /*0x24c7*/ 847,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x1f4b*/ 693,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0x01fa*/ 187,
+ -1,
+ /*0x1f3d*/ 687,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0xff25*/ 1174,
+ /*0x01cb*/ 162,
+ -1, -1, -1,
+ /*0x04fc*/ 419,
+ -1, -1,
+ /*0x118bd*/ 1316,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x1f0f*/ 667,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x0193*/ 133,
+ -1, -1, -1, -1, -1,
+ /*0x01d3*/ 166,
+ -1, -1,
+ /*0xff23*/ 1172,
+ -1, -1, -1, -1,
+ /*0x018f*/ 130,
+ -1, -1, -1, -1,
+ /*0xab7b*/ 1089,
+ -1, -1,
+ /*0xff21*/ 1170,
+ -1, -1,
+ /*0xff33*/ 1188,
+ -1, -1,
+ /*0x1f0b*/ 663,
+ /*0x01f8*/ 186,
+ /*0xfb17*/ 1169,
+ -1, -1,
+ /*0xff31*/ 1186,
+ -1, -1,
+ /*0x24b9*/ 833,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0x24c3*/ 843,
+ /*0xab70*/ 1078,
+ -1,
+ /*0x018b*/ 128,
+ -1, -1, -1,
+ /*0x24bb*/ 835,
+ -1,
+ /*0x019f*/ 140,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0xff39*/ 1194,
+ /*0x01fc*/ 188,
+ -1, -1, -1, -1, -1, -1,
+ /*0x0191*/ 132,
+ /*0x1f0d*/ 665,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x24cb*/ 851,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x0181*/ 121,
+ -1, -1, -1, -1, -1,
+ /*0x24bd*/ 837,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0xab72*/ 1080,
+ -1, -1, -1,
+ /*0xab74*/ 1082,
+ /*0xfb13*/ 1165,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0xab7e*/ 1092,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0xfb15*/ 1167,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ /*0xfb01*/ 1159,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0xfb05*/ 1163,
+ -1, -1, -1, -1, -1, -1,
+ /*0xab7a*/ 1088,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ /*0xfb03*/ 1161,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0xab78*/ 1086,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0xab7c*/ 1090
+ };
+
+ if (code <= MAX_CODE_VALUE && code >= MIN_CODE_VALUE)
+ {
+ register int key = onigenc_unicode_CaseFold_11_hash(code);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register short s = wordlist[key];
+
+ if (s >= 0 && code1_equal(code, CaseFold_11_Table[s].from))
+ return &CaseFold_11_Table[s].to;
+ }
+ }
+ return 0;
+}
-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_11_Type CaseUnfold_11_Table[] = {
+#define CaseUnfold_11 (*(CaseUnfold_11_Type (*)[1195])(CaseUnfold_11_Table+0))
+ {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}}},
+ {0x025c, {1, {0xa7ab}}},
+ {0x0260, {1, {0x0193}}},
+ {0x0261, {1, {0xa7ac}}},
+ {0x0263, {1, {0x0194}}},
+ {0x0265, {1, {0xa78d}}},
+ {0x0266, {1, {0xa7aa}}},
+ {0x0268, {1, {0x0197}}},
+ {0x0269, {1, {0x0196}}},
+ {0x026b, {1, {0x2c62}}},
+ {0x026c, {1, {0xa7ad}}},
+ {0x026f, {1, {0x019c}}},
+ {0x0271, {1, {0x2c6e}}},
+ {0x0272, {1, {0x019d}}},
+ {0x0275, {1, {0x019f}}},
+ {0x027d, {1, {0x2c64}}},
+ {0x0280, {1, {0x01a6}}},
+ {0x0283, {1, {0x01a9}}},
+ {0x0287, {1, {0xa7b1}}},
+ {0x0288, {1, {0x01ae}}},
+ {0x0289, {1, {0x0244}}},
+ {0x028a, {1, {0x01b1}}},
+ {0x028b, {1, {0x01b2}}},
+ {0x028c, {1, {0x0245}}},
+ {0x0292, {1, {0x01b7}}},
+ {0x029d, {1, {0xa7b2}}},
+ {0x029e, {1, {0xa7b0}}},
+ {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}}},
+ {0x03f3, {1, {0x037f}}},
+ {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}}},
+ {0x0529, {1, {0x0528}}},
+ {0x052b, {1, {0x052a}}},
+ {0x052d, {1, {0x052c}}},
+ {0x052f, {1, {0x052e}}},
+ {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}}},
+ {0x13a0, {1, {0xab70}}},
+ {0x13a1, {1, {0xab71}}},
+ {0x13a2, {1, {0xab72}}},
+ {0x13a3, {1, {0xab73}}},
+ {0x13a4, {1, {0xab74}}},
+ {0x13a5, {1, {0xab75}}},
+ {0x13a6, {1, {0xab76}}},
+ {0x13a7, {1, {0xab77}}},
+ {0x13a8, {1, {0xab78}}},
+ {0x13a9, {1, {0xab79}}},
+ {0x13aa, {1, {0xab7a}}},
+ {0x13ab, {1, {0xab7b}}},
+ {0x13ac, {1, {0xab7c}}},
+ {0x13ad, {1, {0xab7d}}},
+ {0x13ae, {1, {0xab7e}}},
+ {0x13af, {1, {0xab7f}}},
+ {0x13b0, {1, {0xab80}}},
+ {0x13b1, {1, {0xab81}}},
+ {0x13b2, {1, {0xab82}}},
+ {0x13b3, {1, {0xab83}}},
+ {0x13b4, {1, {0xab84}}},
+ {0x13b5, {1, {0xab85}}},
+ {0x13b6, {1, {0xab86}}},
+ {0x13b7, {1, {0xab87}}},
+ {0x13b8, {1, {0xab88}}},
+ {0x13b9, {1, {0xab89}}},
+ {0x13ba, {1, {0xab8a}}},
+ {0x13bb, {1, {0xab8b}}},
+ {0x13bc, {1, {0xab8c}}},
+ {0x13bd, {1, {0xab8d}}},
+ {0x13be, {1, {0xab8e}}},
+ {0x13bf, {1, {0xab8f}}},
+ {0x13c0, {1, {0xab90}}},
+ {0x13c1, {1, {0xab91}}},
+ {0x13c2, {1, {0xab92}}},
+ {0x13c3, {1, {0xab93}}},
+ {0x13c4, {1, {0xab94}}},
+ {0x13c5, {1, {0xab95}}},
+ {0x13c6, {1, {0xab96}}},
+ {0x13c7, {1, {0xab97}}},
+ {0x13c8, {1, {0xab98}}},
+ {0x13c9, {1, {0xab99}}},
+ {0x13ca, {1, {0xab9a}}},
+ {0x13cb, {1, {0xab9b}}},
+ {0x13cc, {1, {0xab9c}}},
+ {0x13cd, {1, {0xab9d}}},
+ {0x13ce, {1, {0xab9e}}},
+ {0x13cf, {1, {0xab9f}}},
+ {0x13d0, {1, {0xaba0}}},
+ {0x13d1, {1, {0xaba1}}},
+ {0x13d2, {1, {0xaba2}}},
+ {0x13d3, {1, {0xaba3}}},
+ {0x13d4, {1, {0xaba4}}},
+ {0x13d5, {1, {0xaba5}}},
+ {0x13d6, {1, {0xaba6}}},
+ {0x13d7, {1, {0xaba7}}},
+ {0x13d8, {1, {0xaba8}}},
+ {0x13d9, {1, {0xaba9}}},
+ {0x13da, {1, {0xabaa}}},
+ {0x13db, {1, {0xabab}}},
+ {0x13dc, {1, {0xabac}}},
+ {0x13dd, {1, {0xabad}}},
+ {0x13de, {1, {0xabae}}},
+ {0x13df, {1, {0xabaf}}},
+ {0x13e0, {1, {0xabb0}}},
+ {0x13e1, {1, {0xabb1}}},
+ {0x13e2, {1, {0xabb2}}},
+ {0x13e3, {1, {0xabb3}}},
+ {0x13e4, {1, {0xabb4}}},
+ {0x13e5, {1, {0xabb5}}},
+ {0x13e6, {1, {0xabb6}}},
+ {0x13e7, {1, {0xabb7}}},
+ {0x13e8, {1, {0xabb8}}},
+ {0x13e9, {1, {0xabb9}}},
+ {0x13ea, {1, {0xabba}}},
+ {0x13eb, {1, {0xabbb}}},
+ {0x13ec, {1, {0xabbc}}},
+ {0x13ed, {1, {0xabbd}}},
+ {0x13ee, {1, {0xabbe}}},
+ {0x13ef, {1, {0xabbf}}},
+ {0x13f0, {1, {0x13f8}}},
+ {0x13f1, {1, {0x13f9}}},
+ {0x13f2, {1, {0x13fa}}},
+ {0x13f3, {1, {0x13fb}}},
+ {0x13f4, {1, {0x13fc}}},
+ {0x13f5, {1, {0x13fd}}},
+ {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}}},
+ {0xa699, {1, {0xa698}}},
+ {0xa69b, {1, {0xa69a}}},
+ {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}}},
+ {0xa797, {1, {0xa796}}},
+ {0xa799, {1, {0xa798}}},
+ {0xa79b, {1, {0xa79a}}},
+ {0xa79d, {1, {0xa79c}}},
+ {0xa79f, {1, {0xa79e}}},
+ {0xa7a1, {1, {0xa7a0}}},
+ {0xa7a3, {1, {0xa7a2}}},
+ {0xa7a5, {1, {0xa7a4}}},
+ {0xa7a7, {1, {0xa7a6}}},
+ {0xa7a9, {1, {0xa7a8}}},
+ {0xa7b5, {1, {0xa7b4}}},
+ {0xa7b7, {1, {0xa7b6}}},
+ {0xab53, {1, {0xa7b3}}},
+ {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}}},
+ {0x10cc0, {1, {0x10c80}}},
+ {0x10cc1, {1, {0x10c81}}},
+ {0x10cc2, {1, {0x10c82}}},
+ {0x10cc3, {1, {0x10c83}}},
+ {0x10cc4, {1, {0x10c84}}},
+ {0x10cc5, {1, {0x10c85}}},
+ {0x10cc6, {1, {0x10c86}}},
+ {0x10cc7, {1, {0x10c87}}},
+ {0x10cc8, {1, {0x10c88}}},
+ {0x10cc9, {1, {0x10c89}}},
+ {0x10cca, {1, {0x10c8a}}},
+ {0x10ccb, {1, {0x10c8b}}},
+ {0x10ccc, {1, {0x10c8c}}},
+ {0x10ccd, {1, {0x10c8d}}},
+ {0x10cce, {1, {0x10c8e}}},
+ {0x10ccf, {1, {0x10c8f}}},
+ {0x10cd0, {1, {0x10c90}}},
+ {0x10cd1, {1, {0x10c91}}},
+ {0x10cd2, {1, {0x10c92}}},
+ {0x10cd3, {1, {0x10c93}}},
+ {0x10cd4, {1, {0x10c94}}},
+ {0x10cd5, {1, {0x10c95}}},
+ {0x10cd6, {1, {0x10c96}}},
+ {0x10cd7, {1, {0x10c97}}},
+ {0x10cd8, {1, {0x10c98}}},
+ {0x10cd9, {1, {0x10c99}}},
+ {0x10cda, {1, {0x10c9a}}},
+ {0x10cdb, {1, {0x10c9b}}},
+ {0x10cdc, {1, {0x10c9c}}},
+ {0x10cdd, {1, {0x10c9d}}},
+ {0x10cde, {1, {0x10c9e}}},
+ {0x10cdf, {1, {0x10c9f}}},
+ {0x10ce0, {1, {0x10ca0}}},
+ {0x10ce1, {1, {0x10ca1}}},
+ {0x10ce2, {1, {0x10ca2}}},
+ {0x10ce3, {1, {0x10ca3}}},
+ {0x10ce4, {1, {0x10ca4}}},
+ {0x10ce5, {1, {0x10ca5}}},
+ {0x10ce6, {1, {0x10ca6}}},
+ {0x10ce7, {1, {0x10ca7}}},
+ {0x10ce8, {1, {0x10ca8}}},
+ {0x10ce9, {1, {0x10ca9}}},
+ {0x10cea, {1, {0x10caa}}},
+ {0x10ceb, {1, {0x10cab}}},
+ {0x10cec, {1, {0x10cac}}},
+ {0x10ced, {1, {0x10cad}}},
+ {0x10cee, {1, {0x10cae}}},
+ {0x10cef, {1, {0x10caf}}},
+ {0x10cf0, {1, {0x10cb0}}},
+ {0x10cf1, {1, {0x10cb1}}},
+ {0x10cf2, {1, {0x10cb2}}},
+ {0x118c0, {1, {0x118a0}}},
+ {0x118c1, {1, {0x118a1}}},
+ {0x118c2, {1, {0x118a2}}},
+ {0x118c3, {1, {0x118a3}}},
+ {0x118c4, {1, {0x118a4}}},
+ {0x118c5, {1, {0x118a5}}},
+ {0x118c6, {1, {0x118a6}}},
+ {0x118c7, {1, {0x118a7}}},
+ {0x118c8, {1, {0x118a8}}},
+ {0x118c9, {1, {0x118a9}}},
+ {0x118ca, {1, {0x118aa}}},
+ {0x118cb, {1, {0x118ab}}},
+ {0x118cc, {1, {0x118ac}}},
+ {0x118cd, {1, {0x118ad}}},
+ {0x118ce, {1, {0x118ae}}},
+ {0x118cf, {1, {0x118af}}},
+ {0x118d0, {1, {0x118b0}}},
+ {0x118d1, {1, {0x118b1}}},
+ {0x118d2, {1, {0x118b2}}},
+ {0x118d3, {1, {0x118b3}}},
+ {0x118d4, {1, {0x118b4}}},
+ {0x118d5, {1, {0x118b5}}},
+ {0x118d6, {1, {0x118b6}}},
+ {0x118d7, {1, {0x118b7}}},
+ {0x118d8, {1, {0x118b8}}},
+ {0x118d9, {1, {0x118b9}}},
+ {0x118da, {1, {0x118ba}}},
+ {0x118db, {1, {0x118bb}}},
+ {0x118dc, {1, {0x118bc}}},
+ {0x118dd, {1, {0x118bd}}},
+ {0x118de, {1, {0x118be}}},
+ {0x118df, {1, {0x118bf}}},
+#define CaseUnfold_11_Locale (*(CaseUnfold_11_Type (*)[1])(CaseUnfold_11_Table+1195))
+ {0x0069, {1, {0x0049}}},
};
-static const CaseUnfold_12_Type CaseUnfold_12_Locale[] = {
- { {0x0069, 0x0307}, {1, {0x0130 }}},
+/* C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -7 -k1,2,3 -F,-1 -c -j1 -i1 -t -T -E -C -H onigenc_unicode_CaseUnfold_11_hash -N onigenc_unicode_CaseUnfold_11_lookup -n */
+
+/* maximum key range = 1827, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+/*ARGSUSED*/
+static unsigned int
+onigenc_unicode_CaseUnfold_11_hash(const OnigCodePoint code)
+{
+ static const unsigned short asso_values[] =
+ {
+ 1, 1835, 2, 3, 10, 394, 4, 366, 7, 116,
+ 606, 172, 8, 3, 427, 383, 1835, 1835, 1835, 1835,
+ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 2,
+ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
+ 1835, 1835, 1835, 6, 1835, 1835, 1835, 1835, 1835, 1835,
+ 1835, 1835, 1835, 99, 1835, 1835, 1835, 1835, 1835, 1835,
+ 1835, 1835, 17, 1835, 2, 1, 247, 534, 98, 649,
+ 515, 641, 50, 852, 359, 1213, 51, 12, 636, 1194,
+ 134, 459, 8, 386, 441, 708, 1, 680, 7, 976,
+ 40, 899, 70, 5, 433, 1006, 116, 1273, 227, 773,
+ 128, 660, 59, 618, 35, 698, 622, 968, 121, 1055,
+ 305, 598, 129, 934, 1138, 669, 1398, 397, 1329, 589,
+ 1283, 542, 1384, 825, 1364, 1032, 579, 815, 1341, 689,
+ 327, 307, 797, 287, 782, 259, 752, 235, 995, 211,
+ 1176, 175, 623, 151, 565, 115, 984, 31, 1163, 67,
+ 1151, 139, 1108, 55, 1258, 79, 1226, 91, 1217, 192,
+ 199, 350, 1299, 19, 1292, 43, 1239, 103, 1141, 370,
+ 1250, 417, 1166, 446, 1237, 517, 1333, 506, 1011, 716,
+ 903, 485, 947, 739, 983, 1126, 1122, 874, 1069, 847,
+ 408, 861, 220, 957
+ };
+ return asso_values[bits_of(code, 2)+66] + asso_values[bits_of(code, 1)+4] + asso_values[bits_of(code, 0)];
+}
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+static const CodePointList3 *
+onigenc_unicode_CaseUnfold_11_lookup(const OnigCodePoint code)
+{
+ enum
+ {
+ MIN_CODE_VALUE = 0x61,
+ MAX_CODE_VALUE = 0x118df,
+ TOTAL_KEYWORDS = 1196,
+ MIN_WORD_LENGTH = 3,
+ MAX_WORD_LENGTH = 3,
+ MIN_HASH_VALUE = 8,
+ MAX_HASH_VALUE = 1834
+ };
+
+ static const short wordlist[] =
+ {
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x1e1b*/ 577,
+ /*0x049b*/ 363,
+ /*0x011b*/ 69,
+ /*0x2c9b*/ 868,
+ -1,
+ /*0x021b*/ 178,
+ /*0x1e8b*/ 633,
+ /*0x1e0b*/ 569,
+ /*0x048b*/ 355,
+ /*0x010b*/ 61,
+ /*0x2c8b*/ 860,
+ -1,
+ /*0x020b*/ 170,
+ /*0x1ee1*/ 671,
+ /*0x1e61*/ 612,
+ /*0x04e1*/ 398,
+ /*0x0161*/ 102,
+ /*0x2ce1*/ 903,
+ /*0x13e1*/ 541,
+ /*0x0261*/ 210,
+ /*0x0461*/ 338,
+ /*0xa761*/ 1015,
+ /*0x0061*/ 0,
+ /*0x10ce1*/ 1145,
+ /*0x24e1*/ 791,
+ /*0x1ed1*/ 663,
+ /*0x1e51*/ 604,
+ /*0x04d1*/ 390,
+ /*0x0151*/ 94,
+ /*0x2cd1*/ 895,
+ /*0x13d1*/ 525,
+ /*0x0251*/ 200,
+ /*0x0451*/ 323,
+ /*0xa751*/ 1007,
+ /*0x13a6*/ 482,
+ /*0x10cd1*/ 1129,
+ /*0x24d1*/ 775,
+ /*0x1ee3*/ 672,
+ /*0x1e63*/ 613,
+ /*0x04e3*/ 399,
+ /*0x0163*/ 103,
+ /*0x2ce3*/ 904,
+ /*0x13e3*/ 543,
+ /*0x0263*/ 211,
+ /*0x0463*/ 339,
+ /*0xa763*/ 1016,
+ /*0x0063*/ 2,
+ /*0x10ce3*/ 1147,
+ /*0x24e3*/ 793,
+ /*0x1ed7*/ 666,
+ /*0x1e57*/ 607,
+ /*0x04d7*/ 393,
+ /*0x0157*/ 97,
+ /*0x2cd7*/ 898,
+ /*0x13d7*/ 531,
+ /*0x0257*/ 205,
+ /*0x0457*/ 329,
+ /*0xa757*/ 1010,
+ /*0x13a4*/ 480,
+ /*0x10cd7*/ 1135,
+ /*0x24d7*/ 781,
+ /*0x1ed3*/ 664,
+ /*0x1e53*/ 605,
+ /*0x04d3*/ 391,
+ /*0x0153*/ 95,
+ /*0x2cd3*/ 896,
+ /*0x13d3*/ 527,
+ /*0x0253*/ 202,
+ /*0x0453*/ 325,
+ /*0xa753*/ 1008,
+ -1,
+ /*0x10cd3*/ 1131,
+ /*0x24d3*/ 777,
+ /*0x1ed9*/ 667,
+ /*0x1e59*/ 608,
+ /*0x04d9*/ 394,
+ /*0x0159*/ 98,
+ /*0x2cd9*/ 899,
+ /*0x13d9*/ 533,
+ /*0x0259*/ 206,
+ /*0x0459*/ 331,
+ /*0xa759*/ 1011,
+ /*0x2c61*/ 847,
+ /*0x10cd9*/ 1137,
+ /*0x24d9*/ 783,
+ /*0x1edb*/ 668,
+ /*0x1e5b*/ 609,
+ /*0x04db*/ 395,
+ /*0x015b*/ 99,
+ /*0x2cdb*/ 900,
+ /*0x13db*/ 535,
+ /*0x025b*/ 207,
+ /*0x045b*/ 333,
+ /*0xa75b*/ 1012,
+ /*0x2c51*/ 833,
+ /*0x10cdb*/ 1139,
+ /*0x24db*/ 785,
+ /*0x1ee5*/ 673,
+ /*0x1e65*/ 614,
+ /*0x04e5*/ 400,
+ /*0x0165*/ 104,
+ /*0xab53*/ 1045,
+ /*0x13e5*/ 545,
+ /*0x0265*/ 212,
+ /*0x0465*/ 340,
+ /*0xa765*/ 1017,
+ /*0x0065*/ 4,
+ /*0x10ce5*/ 1149,
+ /*0x24e5*/ 795,
+ /*0x1ecf*/ 662,
+ /*0x1e4f*/ 603,
+ /*0x04cf*/ 389,
+ /*0x014f*/ 93,
+ /*0x2ccf*/ 894,
+ /*0x13cf*/ 523,
+ /*0x024f*/ 198,
+ /*0x044f*/ 321,
+ /*0xa74f*/ 1006,
+ /*0x2c57*/ 839,
+ /*0x10ccf*/ 1127,
+ /*0x13aa*/ 486,
+ /*0x028b*/ 229,
+ -1, -1, -1,
+ /*0x1044f*/ 1111,
+ -1,
+ /*0x13a2*/ 478,
+ /*0x13ae*/ 490,
+ -1,
+ /*0x2c53*/ 835,
+ /*0x1042a*/ 1074,
+ /*0x118d1*/ 1180,
+ /*0x1ed5*/ 665,
+ /*0x1e55*/ 606,
+ /*0x04d5*/ 392,
+ /*0x0155*/ 96,
+ /*0x2cd5*/ 897,
+ /*0x13d5*/ 529,
+ /*0x1042e*/ 1078,
+ /*0x0455*/ 327,
+ /*0xa755*/ 1009,
+ /*0x2c59*/ 841,
+ /*0x10cd5*/ 1133,
+ /*0x24d5*/ 779,
+ /*0x1ecd*/ 661,
+ /*0x1e4d*/ 602,
+ /*0xa661*/ 964,
+ /*0x014d*/ 92,
+ /*0x2ccd*/ 893,
+ /*0x13cd*/ 521,
+ /*0x024d*/ 197,
+ /*0x044d*/ 319,
+ /*0xa74d*/ 1005,
+ /*0x2c5b*/ 843,
+ /*0x10ccd*/ 1125,
+ /*0x118d7*/ 1186,
+ -1, -1,
+ /*0xa651*/ 956,
+ /*0x028a*/ 228,
+ /*0x1044d*/ 1109,
+ -1, -1, -1, -1,
+ /*0x2c65*/ 848,
+ -1,
+ /*0x118d3*/ 1182,
+ /*0x1ecb*/ 660,
+ /*0x1e4b*/ 601,
+ /*0xa663*/ 965,
+ /*0x014b*/ 91,
+ /*0x2ccb*/ 892,
+ /*0x13cb*/ 519,
+ /*0x024b*/ 196,
+ /*0x044b*/ 317,
+ /*0xa74b*/ 1004,
+ /*0x2c4f*/ 831,
+ /*0x10ccb*/ 1123,
+ /*0x118d9*/ 1188,
+ -1, -1,
+ /*0xa657*/ 959,
+ /*0x03e1*/ 278,
+ /*0x1044b*/ 1107,
+ /*0x1edd*/ 669,
+ /*0x1e5d*/ 610,
+ /*0x04dd*/ 396,
+ /*0x015d*/ 100,
+ /*0x2cdd*/ 901,
+ /*0x13dd*/ 537,
+ /*0x118db*/ 1190,
+ /*0x045d*/ 335,
+ /*0xa75d*/ 1013,
+ /*0xa653*/ 957,
+ /*0x10cdd*/ 1141,
+ /*0x24dd*/ 787,
+ /*0x13de*/ 538,
+ -1,
+ /*0x045e*/ 336,
+ -1,
+ /*0x2c55*/ 837,
+ /*0x10cde*/ 1142,
+ /*0x24de*/ 788,
+ /*0x1ec9*/ 659,
+ /*0x1e49*/ 600,
+ /*0xa659*/ 960,
+ /*0x03e3*/ 279,
+ /*0x2cc9*/ 891,
+ /*0x13c9*/ 517,
+ /*0x0249*/ 195,
+ /*0x0449*/ 315,
+ /*0xa749*/ 1003,
+ /*0x2c4d*/ 829,
+ /*0x10cc9*/ 1121,
+ /*0x118cf*/ 1178,
+ /*0x017e*/ 116,
+ -1,
+ /*0xa65b*/ 961,
+ /*0x03d7*/ 273,
+ /*0x10449*/ 1105,
+ -1, -1, -1,
+ /*0x029e*/ 233,
+ /*0x13a0*/ 476,
+ -1, -1,
+ /*0x1ec7*/ 658,
+ /*0x1e47*/ 599,
+ /*0xa665*/ 966,
+ -1,
+ /*0x2cc7*/ 890,
+ /*0x13c7*/ 515,
+ /*0x0247*/ 194,
+ /*0x0447*/ 313,
+ /*0xa747*/ 1002,
+ /*0x2c4b*/ 827,
+ /*0x10cc7*/ 1119,
+ /*0x118d5*/ 1184,
+ /*0x1f14*/ 699,
+ -1,
+ /*0xa64f*/ 955,
+ /*0x03d9*/ 274,
+ /*0x10447*/ 1103,
+ -1, -1,
+ /*0x1f10*/ 695,
+ -1, -1, -1,
+ /*0x118cd*/ 1176,
+ /*0x1ec5*/ 657,
+ /*0x1e45*/ 598,
+ /*0x2c5d*/ 845,
+ /*0x03db*/ 275,
+ /*0x2cc5*/ 889,
+ /*0x13c5*/ 513,
+ /*0x1f61*/ 728,
+ /*0x0445*/ 311,
+ /*0xa745*/ 1001,
+ /*0x2c5e*/ 846,
+ /*0x10cc5*/ 1117,
+ -1, -1, -1,
+ /*0xa655*/ 958,
+ /*0x03e5*/ 280,
+ /*0x10445*/ 1101,
+ -1,
+ /*0x1f51*/ 723,
+ -1, -1,
+ /*0x2c49*/ 825,
+ /*0x1f26*/ 707,
+ /*0x118cb*/ 1174,
+ -1, -1,
+ /*0xa64d*/ 954,
+ -1,
+ /*0x1ec3*/ 656,
+ /*0x1e43*/ 597,
+ /*0x1f63*/ 730,
+ -1,
+ /*0x2cc3*/ 888,
+ /*0x13c3*/ 511,
+ -1,
+ /*0x0443*/ 309,
+ /*0xa743*/ 1000,
+ /*0x1f06*/ 693,
+ /*0x10cc3*/ 1115,
+ -1,
+ /*0x118dd*/ 1192,
+ /*0x03ae*/ 242,
+ /*0x1f57*/ 726,
+ -1,
+ /*0x10443*/ 1099,
+ /*0x2c47*/ 823,
+ /*0x1f24*/ 705,
+ /*0x118de*/ 1193,
+ /*0x1ec1*/ 655,
+ /*0x1e41*/ 596,
+ /*0xa64b*/ 953,
+ /*0x13ac*/ 488,
+ /*0x2cc1*/ 887,
+ /*0x13c1*/ 509,
+ /*0x1f53*/ 724,
+ /*0x0441*/ 307,
+ /*0xa741*/ 999,
+ -1,
+ /*0x10cc1*/ 1113,
+ /*0x118c9*/ 1172,
+ -1, -1,
+ /*0x1042c*/ 1076,
+ /*0x03cd*/ 271,
+ /*0x10441*/ 1097,
+ -1, -1,
+ /*0xa65d*/ 962,
+ -1,
+ /*0x2c45*/ 821,
+ -1,
+ /*0x0140*/ 86,
+ -1,
+ /*0x13c0*/ 508,
+ /*0x0240*/ 192,
+ /*0x0440*/ 306,
+ -1, -1,
+ /*0x10cc0*/ 1112,
+ -1, -1, -1, -1,
+ /*0x118c7*/ 1170,
+ /*0x10440*/ 1096,
+ /*0x1f02*/ 689,
+ /*0xa649*/ 952,
+ /*0x03cb*/ 269,
+ -1, -1,
+ /*0x1f65*/ 732,
+ /*0x1edf*/ 670,
+ /*0x1e5f*/ 611,
+ /*0x04df*/ 397,
+ /*0x015f*/ 101,
+ /*0x2cdf*/ 902,
+ /*0x13df*/ 539,
+ /*0x2c43*/ 819,
+ /*0x045f*/ 337,
+ /*0xa75f*/ 1014,
+ /*0xff51*/ 1062,
+ /*0x10cdf*/ 1143,
+ /*0x24df*/ 789,
+ /*0x0280*/ 223,
+ /*0x03dd*/ 276,
+ -1, -1,
+ /*0x118c5*/ 1168,
+ -1, -1,
+ /*0xa647*/ 951,
+ /*0x1ee7*/ 674,
+ /*0x1e67*/ 615,
+ /*0x04e7*/ 401,
+ /*0x0167*/ 105,
+ /*0x1f22*/ 703,
+ /*0x13e7*/ 547,
+ /*0x2c41*/ 817,
+ /*0x0467*/ 341,
+ /*0xa767*/ 1018,
+ /*0x0067*/ 6,
+ /*0x10ce7*/ 1151,
+ /*0x24e7*/ 797,
+ /*0x03c9*/ 267,
+ /*0xff57*/ 1068,
+ /*0x01e1*/ 151,
+ /*0x1f55*/ 725,
+ /*0x1e91*/ 636,
+ /*0x1e11*/ 572,
+ /*0x0491*/ 358,
+ /*0x0111*/ 64,
+ /*0x2c91*/ 863,
+ /*0xa79b*/ 1035,
+ /*0x0211*/ 173,
+ /*0xa645*/ 950,
+ /*0x118c3*/ 1166,
+ /*0xff53*/ 1064,
+ /*0x2c40*/ 816,
+ /*0x1eb3*/ 648,
+ /*0x1e33*/ 589,
+ /*0x04b3*/ 375,
+ /*0x0133*/ 80,
+ /*0x2cb3*/ 880,
+ /*0x13b3*/ 495,
+ /*0x0233*/ 189,
+ /*0x0433*/ 293,
+ /*0xa733*/ 992,
+ /*0x03c7*/ 265,
+ /*0xff59*/ 1070,
+ /*0x01e3*/ 152,
+ -1, -1,
+ /*0x017c*/ 115,
+ /*0x00e1*/ 26,
+ /*0x10433*/ 1083,
+ /*0x118c1*/ 1164,
+ -1,
+ /*0xa77c*/ 1024,
+ /*0x1ee9*/ 675,
+ /*0x1e69*/ 616,
+ /*0x04e9*/ 402,
+ /*0x0169*/ 106,
+ /*0xa643*/ 949,
+ /*0x13e9*/ 549,
+ /*0x0269*/ 215,
+ /*0x0469*/ 342,
+ /*0xa769*/ 1019,
+ /*0x0069*/ 1195,
+ /*0x10ce9*/ 1153,
+ /*0x24e9*/ 799,
+ -1,
+ /*0x03c5*/ 263,
+ /*0x051b*/ 427,
+ /*0x0586*/ 475,
+ /*0x2d14*/ 928,
+ /*0x118c0*/ 1163,
+ /*0x019a*/ 125,
+ /*0x00e3*/ 28,
+ /*0x2d1b*/ 935,
+ /*0x050b*/ 419,
+ /*0x2d16*/ 930,
+ /*0x2d10*/ 924,
+ /*0xa641*/ 948,
+ -1,
+ /*0xff4f*/ 1060,
+ /*0x2d0b*/ 919,
+ /*0x0561*/ 438,
+ /*0x1eeb*/ 676,
+ /*0x1e6b*/ 617,
+ /*0x04eb*/ 403,
+ /*0x016b*/ 107,
+ -1,
+ /*0x13eb*/ 551,
+ /*0x026b*/ 216,
+ /*0x046b*/ 343,
+ /*0xa76b*/ 1020,
+ /*0x006b*/ 9,
+ /*0x10ceb*/ 1155,
+ /*0x118df*/ 1194,
+ /*0x03c3*/ 261,
+ /*0x1e8f*/ 635,
+ /*0x1e0f*/ 571,
+ /*0x048f*/ 357,
+ /*0x010f*/ 63,
+ /*0x2c8f*/ 862,
+ /*0xa69b*/ 984,
+ /*0x020f*/ 172,
+ /*0x2c33*/ 803,
+ /*0xff55*/ 1066,
+ /*0x01e5*/ 153,
+ /*0x0563*/ 440,
+ -1,
+ /*0xa68b*/ 976,
+ /*0x2d18*/ 932,
+ /*0x1f20*/ 701,
+ /*0x0288*/ 226,
+ -1,
+ /*0x03ac*/ 240,
+ -1,
+ /*0x03c1*/ 260,
+ /*0xff4d*/ 1058,
+ /*0x0582*/ 471,
+ /*0x019e*/ 126,
+ /*0x2d06*/ 914,
+ /*0x2d0a*/ 918,
+ /*0xa65f*/ 963,
+ /*0x1ef3*/ 680,
+ /*0x1e73*/ 621,
+ /*0x04f3*/ 407,
+ /*0x0173*/ 111,
+ /*0x2cf3*/ 907,
+ /*0x13f3*/ 559,
+ /*0x2d24*/ 944,
+ /*0x0473*/ 347,
+ /*0x1f00*/ 687,
+ /*0x0073*/ 17,
+ -1,
+ /*0x00e5*/ 30,
+ -1,
+ /*0x03c0*/ 259,
+ -1, -1, -1,
+ /*0x2d1a*/ 934,
+ /*0xff4b*/ 1056,
+ /*0xa667*/ 967,
+ /*0x1f45*/ 722,
+ /*0x1eef*/ 678,
+ /*0x1e6f*/ 619,
+ /*0x04ef*/ 405,
+ /*0x016f*/ 109,
+ -1,
+ /*0x13ef*/ 555,
+ /*0x026f*/ 218,
+ /*0x046f*/ 345,
+ /*0xa76f*/ 1022,
+ /*0x006f*/ 13,
+ /*0x10cef*/ 1159,
+ /*0x1eed*/ 677,
+ /*0x1e6d*/ 618,
+ /*0x04ed*/ 404,
+ /*0x016d*/ 108,
+ /*0x03df*/ 277,
+ /*0x13ed*/ 553,
+ -1,
+ /*0x046d*/ 344,
+ /*0xa76d*/ 1021,
+ /*0x006d*/ 11,
+ /*0x10ced*/ 1157,
+ -1,
+ /*0x0565*/ 442,
+ /*0x2d02*/ 910,
+ -1, -1,
+ /*0x1f43*/ 720,
+ /*0x1e81*/ 628,
+ /*0x1e01*/ 564,
+ /*0x0481*/ 354,
+ /*0x0101*/ 56,
+ /*0x2c81*/ 855,
+ /*0xff49*/ 1054,
+ /*0x0201*/ 165,
+ /*0x03e7*/ 281,
+ /*0x1eb7*/ 650,
+ /*0x1e37*/ 591,
+ /*0x04b7*/ 377,
+ /*0x0137*/ 82,
+ /*0x2cb7*/ 882,
+ /*0x13b7*/ 499,
+ /*0x2d1e*/ 938,
+ /*0x0437*/ 297,
+ /*0xa737*/ 994,
+ /*0xa669*/ 968,
+ /*0x1fe1*/ 754,
+ /*0x1f41*/ 718,
+ /*0x2c73*/ 853,
+ -1,
+ /*0x0292*/ 231,
+ /*0x01dd*/ 149,
+ /*0x10437*/ 1087,
+ -1,
+ /*0x2d22*/ 942,
+ -1, -1,
+ /*0xff47*/ 1052,
+ /*0x1fd1*/ 752,
+ -1,
+ /*0x2d0e*/ 922,
+ /*0x04ce*/ 388,
+ /*0x03b3*/ 246,
+ -1,
+ /*0x13ce*/ 522,
+ -1,
+ /*0x044e*/ 320,
+ /*0x1f40*/ 717,
+ -1,
+ /*0x10cce*/ 1126,
+ /*0x01c9*/ 139,
+ -1, -1, -1,
+ /*0xa66b*/ 969,
+ /*0x1044e*/ 1110,
+ /*0x013c*/ 84,
+ -1,
+ /*0x13bc*/ 504,
+ /*0x023c*/ 190,
+ /*0x043c*/ 302,
+ /*0xff45*/ 1050,
+ /*0x03e9*/ 282,
+ /*0x1eb5*/ 649,
+ /*0x1e35*/ 590,
+ /*0x04b5*/ 376,
+ /*0x0135*/ 81,
+ /*0x2cb5*/ 881,
+ /*0x13b5*/ 497,
+ /*0x1043c*/ 1092,
+ /*0x0435*/ 295,
+ /*0xa735*/ 993,
+ /*0x1ead*/ 645,
+ /*0x1e2d*/ 586,
+ /*0x04ad*/ 372,
+ /*0x012d*/ 78,
+ /*0x2cad*/ 877,
+ /*0x13ad*/ 489,
+ /*0x022d*/ 186,
+ /*0x10435*/ 1085,
+ /*0xa72d*/ 990,
+ -1, -1, -1, -1,
+ /*0x2c37*/ 807,
+ /*0x0180*/ 117,
+ /*0x00fe*/ 54,
+ /*0x1042d*/ 1077,
+ /*0xff43*/ 1048,
+ /*0x1f67*/ 734,
+ /*0x03eb*/ 283,
+ /*0x1ea5*/ 641,
+ /*0x1e25*/ 582,
+ /*0x04a5*/ 368,
+ /*0x0125*/ 74,
+ /*0x2ca5*/ 873,
+ /*0x13a5*/ 481,
+ /*0x0225*/ 182,
+ /*0x04cc*/ 387,
+ /*0xa725*/ 986,
+ /*0x13a8*/ 484,
+ /*0x13cc*/ 520,
+ /*0x0580*/ 469,
+ /*0x044c*/ 318,
+ -1,
+ /*0x1f11*/ 696,
+ /*0x10ccc*/ 1124,
+ /*0x2c4e*/ 830,
+ /*0xff41*/ 1046,
+ /*0x1fe5*/ 755,
+ -1,
+ /*0x10428*/ 1072,
+ /*0x1044c*/ 1108,
+ -1,
+ /*0x1e85*/ 630,
+ /*0x1e05*/ 566,
+ /*0x1f33*/ 712,
+ /*0x0105*/ 58,
+ /*0x2c85*/ 857,
+ /*0x057e*/ 467,
+ /*0x0205*/ 167,
+ /*0x2c3c*/ 812,
+ /*0x1e83*/ 629,
+ /*0x1e03*/ 565,
+ /*0xa66d*/ 970,
+ /*0x0103*/ 57,
+ /*0x2c83*/ 856,
+ /*0x1f7c*/ 747,
+ /*0x0203*/ 166,
+ /*0x03f3*/ 287,
+ -1,
+ /*0x2c35*/ 805,
+ /*0x2d20*/ 940,
+ /*0x1ea3*/ 640,
+ /*0x1e23*/ 581,
+ /*0x04a3*/ 367,
+ /*0x0123*/ 73,
+ /*0x2ca3*/ 872,
+ /*0x13a3*/ 479,
+ /*0x0223*/ 181,
+ -1,
+ /*0xa723*/ 985,
+ /*0x1eb1*/ 647,
+ /*0x1e31*/ 588,
+ /*0x04b1*/ 374,
+ /*0x118ce*/ 1177,
+ /*0x2cb1*/ 879,
+ /*0x13b1*/ 493,
+ /*0x0231*/ 188,
+ /*0x0431*/ 291,
+ /*0x03ef*/ 285,
+ -1,
+ /*0x2d00*/ 908,
+ /*0x1e95*/ 638,
+ /*0x1e15*/ 574,
+ /*0x0495*/ 360,
+ /*0x0115*/ 66,
+ /*0x2c95*/ 865,
+ /*0x10431*/ 1081,
+ /*0x0215*/ 175,
+ /*0x1f12*/ 697,
+ /*0x03ed*/ 284,
+ /*0x1ebf*/ 654,
+ /*0x1e3f*/ 595,
+ /*0x04bf*/ 381,
+ /*0x2c4c*/ 828,
+ /*0x2cbf*/ 886,
+ /*0x13bf*/ 507,
+ /*0x023f*/ 191,
+ /*0x043f*/ 305,
+ /*0xa73f*/ 998,
+ /*0x1ea7*/ 642,
+ /*0x1e27*/ 583,
+ /*0x04a7*/ 369,
+ /*0x0127*/ 75,
+ /*0x2ca7*/ 874,
+ /*0x13a7*/ 483,
+ /*0x0227*/ 183,
+ /*0x1043f*/ 1095,
+ /*0xa727*/ 987,
+ -1,
+ /*0x1e93*/ 637,
+ /*0x1e13*/ 573,
+ /*0x0493*/ 359,
+ /*0x0113*/ 65,
+ /*0x2c93*/ 864,
+ /*0x03b7*/ 250,
+ /*0x0213*/ 174,
+ /*0x01df*/ 150,
+ /*0x1ef1*/ 679,
+ /*0x1e71*/ 620,
+ /*0x04f1*/ 406,
+ /*0x0171*/ 110,
+ -1,
+ /*0x13f1*/ 557,
+ /*0x0271*/ 219,
+ /*0x0471*/ 346,
+ /*0x0188*/ 120,
+ /*0x0071*/ 15,
+ /*0x10cf1*/ 1161,
+ -1, -1, -1,
+ /*0x118cc*/ 1175,
+ /*0x1f73*/ 738,
+ -1, -1,
+ /*0x217e*/ 771,
+ /*0x01e7*/ 154,
+ /*0x03ce*/ 272,
+ -1,
+ /*0x2c31*/ 801,
+ /*0x1ef5*/ 681,
+ /*0x1e75*/ 622,
+ /*0x04f5*/ 408,
+ /*0x0175*/ 112,
+ -1,
+ /*0x13f5*/ 561,
+ /*0x0275*/ 221,
+ /*0x0475*/ 348,
+ -1,
+ /*0x0075*/ 19,
+ -1,
+ /*0x03bc*/ 255,
+ /*0x028c*/ 230,
+ -1, -1,
+ /*0x04c6*/ 384,
+ /*0x0146*/ 89,
+ -1,
+ /*0x13c6*/ 514,
+ /*0x2c3f*/ 815,
+ /*0x0446*/ 312,
+ /*0x03b5*/ 248,
+ /*0x1f04*/ 691,
+ /*0x10cc6*/ 1118,
+ /*0x00e7*/ 32,
+ /*0x0283*/ 224,
+ -1, -1, -1,
+ /*0x10446*/ 1102,
+ /*0x03ad*/ 241,
+ -1, -1,
+ /*0xa791*/ 1031,
+ /*0x1ea1*/ 639,
+ /*0x1e21*/ 580,
+ /*0x04a1*/ 366,
+ /*0x0121*/ 72,
+ /*0x2ca1*/ 871,
+ /*0x13a1*/ 477,
+ -1,
+ /*0x1f01*/ 688,
+ -1,
+ /*0x01e9*/ 155,
+ -1,
+ /*0x04c4*/ 383,
+ /*0x0144*/ 88,
+ -1,
+ /*0x13c4*/ 512,
+ /*0x1f37*/ 716,
+ /*0x0444*/ 310,
+ -1,
+ /*0x2d08*/ 916,
+ /*0x10cc4*/ 1116,
+ -1,
+ /*0x03cc*/ 270,
+ -1,
+ /*0x0567*/ 444,
+ -1,
+ /*0x10444*/ 1100,
+ /*0x04c2*/ 382,
+ /*0x0142*/ 87,
+ /*0x00fc*/ 52,
+ /*0x13c2*/ 510,
+ /*0x0242*/ 193,
+ /*0x0442*/ 308,
+ -1,
+ /*0x0192*/ 122,
+ /*0x10cc2*/ 1114,
+ -1, -1,
+ /*0x00e9*/ 34,
+ /*0x01eb*/ 156,
+ /*0x0511*/ 422,
+ /*0x10442*/ 1098,
+ -1,
+ /*0x1ebd*/ 653,
+ /*0x1e3d*/ 594,
+ /*0x04bd*/ 380,
+ /*0x2d11*/ 925,
+ /*0x2cbd*/ 885,
+ /*0x13bd*/ 505,
+ /*0x2c46*/ 822,
+ /*0x043d*/ 303,
+ /*0xa73d*/ 997,
+ -1,
+ /*0x1eb9*/ 651,
+ /*0x1e39*/ 592,
+ /*0x04b9*/ 378,
+ -1,
+ /*0x2cb9*/ 883,
+ /*0x13b9*/ 501,
+ /*0x1043d*/ 1093,
+ /*0x0439*/ 299,
+ /*0xa739*/ 995,
+ /*0x057c*/ 465,
+ /*0x1f35*/ 714,
+ -1, -1, -1,
+ /*0x00eb*/ 36,
+ /*0x03b1*/ 244,
+ /*0x10439*/ 1089,
+ -1,
+ /*0x0569*/ 446,
+ -1,
+ /*0xa691*/ 979,
+ -1,
+ /*0x1efb*/ 684,
+ /*0x1e7b*/ 625,
+ /*0x04fb*/ 411,
+ /*0x01f3*/ 159,
+ /*0x2c44*/ 820,
+ /*0x1e87*/ 631,
+ /*0x1e07*/ 567,
+ /*0x047b*/ 351,
+ /*0x0107*/ 59,
+ /*0x2c87*/ 858,
+ -1,
+ /*0x0207*/ 168,
+ /*0x118c6*/ 1169,
+ /*0x03bf*/ 258,
+ /*0x1efd*/ 685,
+ /*0x1e7d*/ 626,
+ /*0x04fd*/ 412,
+ /*0x1f25*/ 706,
+ /*0x2d1c*/ 936,
+ /*0x2c42*/ 818,
+ /*0x027d*/ 222,
+ /*0x047d*/ 352,
+ -1, -1,
+ /*0x01ef*/ 158,
+ /*0x056b*/ 448,
+ /*0x2d12*/ 926,
+ /*0x1ef9*/ 683,
+ /*0x1e79*/ 624,
+ /*0x04f9*/ 410,
+ /*0x1d7d*/ 563,
+ /*0x00f3*/ 44,
+ -1, -1,
+ /*0x0479*/ 350,
+ /*0x01ed*/ 157,
+ /*0x0079*/ 23,
+ /*0x2c3d*/ 813,
+ /*0x050f*/ 421,
+ -1,
+ /*0x1f05*/ 692,
+ -1,
+ /*0x118c4*/ 1167,
+ /*0x1d79*/ 562,
+ /*0x2d0f*/ 923,
+ -1,
+ /*0xff4e*/ 1059,
+ /*0x2c39*/ 809,
+ /*0x1f03*/ 690,
+ -1,
+ /*0x0584*/ 473,
+ -1,
+ /*0x00ef*/ 40,
+ /*0x1e19*/ 576,
+ /*0x0499*/ 362,
+ /*0x0119*/ 68,
+ /*0x2c99*/ 867,
+ /*0x118c2*/ 1165,
+ /*0x0219*/ 177,
+ /*0x1f23*/ 704,
+ -1,
+ /*0x13f2*/ 558,
+ /*0x0272*/ 220,
+ /*0x00ed*/ 38,
+ /*0x0573*/ 456,
+ /*0x0072*/ 16,
+ /*0x10cf2*/ 1162,
+ -1,
+ /*0x1f31*/ 710,
+ /*0x0581*/ 470,
+ -1,
+ /*0xa68f*/ 978,
+ -1,
+ /*0xa781*/ 1026,
+ -1,
+ /*0x217c*/ 769,
+ /*0x03c6*/ 264,
+ -1, -1,
+ /*0x1f15*/ 700,
+ -1,
+ /*0xa7b7*/ 1044,
+ -1,
+ /*0x01ce*/ 141,
+ -1,
+ /*0x056f*/ 452,
+ -1,
+ /*0x1eaf*/ 646,
+ /*0x1e2f*/ 587,
+ /*0x04af*/ 373,
+ /*0x012f*/ 79,
+ /*0x2caf*/ 878,
+ /*0x13af*/ 491,
+ /*0x022f*/ 187,
+ -1,
+ /*0xa72f*/ 991,
+ /*0x056d*/ 450,
+ /*0x1f27*/ 708,
+ -1, -1,
+ /*0x2d04*/ 912,
+ -1, -1,
+ /*0x1042f*/ 1079,
+ /*0xff4c*/ 1057,
+ /*0x13f4*/ 560,
+ /*0x03c4*/ 262,
+ /*0x1f13*/ 698,
+ -1,
+ /*0x0074*/ 18,
+ /*0x1eff*/ 686,
+ /*0x1e7f*/ 627,
+ /*0x04ff*/ 413,
+ /*0x0501*/ 414,
+ -1,
+ /*0x1f71*/ 736,
+ /*0x01ad*/ 131,
+ /*0x047f*/ 353,
+ /*0xa77f*/ 1025,
+ /*0x2d01*/ 909,
+ /*0x0287*/ 225,
+ /*0x1ea9*/ 643,
+ /*0x1e29*/ 584,
+ /*0x04a9*/ 370,
+ /*0x0129*/ 76,
+ /*0x2ca9*/ 875,
+ /*0x13a9*/ 485,
+ /*0x0229*/ 184,
+ /*0xa7b5*/ 1043,
+ /*0xa729*/ 988,
+ /*0x1e17*/ 575,
+ /*0x0497*/ 361,
+ /*0x0117*/ 67,
+ /*0x2c97*/ 866,
+ -1,
+ /*0x0217*/ 176,
+ /*0x01a5*/ 129,
+ /*0x10429*/ 1073,
+ /*0x1f75*/ 740,
+ /*0x03bd*/ 256,
+ /*0x01a8*/ 130,
+ /*0x01cc*/ 140,
+ /*0x13d0*/ 524,
+ /*0x0250*/ 199,
+ /*0x0450*/ 322,
+ /*0x0076*/ 20,
+ /*0xa681*/ 971,
+ /*0x10cd0*/ 1128,
+ /*0x24d0*/ 774,
+ /*0x03b9*/ 252,
+ /*0x04c8*/ 385,
+ /*0x0148*/ 90,
+ /*0x2173*/ 760,
+ /*0x13c8*/ 516,
+ /*0x018c*/ 121,
+ /*0x0448*/ 314,
+ -1,
+ /*0xa7a5*/ 1040,
+ /*0x10cc8*/ 1120,
+ /*0x0185*/ 119,
+ /*0x1e1d*/ 578,
+ /*0x049d*/ 364,
+ /*0x011d*/ 70,
+ /*0x2c9d*/ 869,
+ /*0x10448*/ 1104,
+ /*0x021d*/ 179,
+ /*0x037c*/ 238,
+ /*0x0183*/ 118,
+ -1,
+ /*0x13f0*/ 556,
+ -1,
+ /*0x03fb*/ 289,
+ /*0x1f21*/ 702,
+ /*0x0070*/ 14,
+ /*0x10cf0*/ 1160,
+ /*0xa78c*/ 1030,
+ /*0x0585*/ 474,
+ /*0x052d*/ 436,
+ /*0x01a3*/ 128,
+ -1,
+ /*0xa785*/ 1028,
+ /*0x1f44*/ 721,
+ -1,
+ /*0x2d2d*/ 947,
+ /*0x0583*/ 472,
+ /*0x1ebb*/ 652,
+ /*0x1e3b*/ 593,
+ /*0x04bb*/ 379,
+ /*0xa783*/ 1027,
+ /*0x2cbb*/ 884,
+ /*0x13bb*/ 503,
+ -1,
+ /*0x043b*/ 301,
+ /*0xa73b*/ 996,
+ -1, -1,
+ /*0x1f42*/ 719,
+ /*0x0525*/ 432,
+ /*0x0195*/ 123,
+ /*0xa7a3*/ 1039,
+ -1,
+ /*0x1043b*/ 1091,
+ -1,
+ /*0x2d25*/ 945,
+ -1,
+ /*0x2c76*/ 854,
+ /*0x2c50*/ 832,
+ /*0x01bf*/ 137,
+ /*0x1eab*/ 644,
+ /*0x1e2b*/ 585,
+ /*0x04ab*/ 371,
+ /*0x012b*/ 77,
+ /*0x2cab*/ 876,
+ /*0x13ab*/ 487,
+ /*0x022b*/ 185,
+ -1,
+ /*0xa72b*/ 989,
+ /*0x2c48*/ 824,
+ -1, -1,
+ /*0x0505*/ 416,
+ /*0x2d0c*/ 920,
+ -1, -1,
+ /*0x1042b*/ 1075,
+ /*0x017a*/ 114,
+ /*0x2d05*/ 913,
+ /*0x03f2*/ 286,
+ /*0x0503*/ 415,
+ -1,
+ /*0xa77a*/ 1023,
+ /*0x007a*/ 24,
+ /*0x214e*/ 756,
+ /*0xff46*/ 1051,
+ /*0x2d03*/ 911,
+ -1, -1,
+ /*0xa7a7*/ 1041,
+ -1,
+ /*0x0523*/ 431,
+ -1, -1, -1,
+ /*0x0373*/ 235,
+ /*0x118d0*/ 1179,
+ /*0x2d23*/ 943,
+ /*0x1f7b*/ 746,
+ /*0xa793*/ 1032,
+ -1, -1, -1,
+ /*0x1f07*/ 694,
+ -1,
+ /*0xa685*/ 973,
+ /*0x2c3b*/ 811,
+ /*0x118c8*/ 1171,
+ -1,
+ /*0x01f5*/ 160,
+ /*0x03af*/ 243,
+ /*0x0515*/ 424,
+ /*0x1f7d*/ 748,
+ /*0xa683*/ 972,
+ /*0x00f1*/ 42,
+ /*0xff44*/ 1049,
+ -1,
+ /*0x2d15*/ 929,
+ /*0x13d6*/ 530,
+ /*0x0256*/ 204,
+ /*0x0456*/ 328,
+ -1,
+ /*0x01c6*/ 138,
+ /*0x10cd6*/ 1134,
+ /*0x24d6*/ 780,
+ /*0x1f79*/ 744,
+ /*0x029d*/ 232,
+ -1, -1,
+ /*0x0527*/ 433,
+ /*0xff42*/ 1047,
+ /*0x1ef7*/ 682,
+ /*0x1e77*/ 623,
+ /*0x04f7*/ 409,
+ /*0x0177*/ 113,
+ /*0x2d27*/ 946,
+ /*0x0078*/ 22,
+ /*0x00f5*/ 46,
+ /*0x0477*/ 349,
+ /*0x0513*/ 423,
+ /*0x0077*/ 21,
+ -1, -1,
+ /*0x01a1*/ 127,
+ /*0xa695*/ 981,
+ /*0x2d13*/ 927,
+ -1,
+ /*0x0571*/ 454,
+ /*0x13b0*/ 492,
+ -1,
+ /*0x0430*/ 290,
+ /*0x13e6*/ 546,
+ /*0x0266*/ 213,
+ -1,
+ /*0x1f72*/ 737,
+ /*0x0066*/ 5,
+ /*0x10ce6*/ 1150,
+ /*0x24e6*/ 796,
+ -1,
+ /*0x10430*/ 1080,
+ /*0x2184*/ 773,
+ /*0x13d4*/ 528,
+ /*0x0254*/ 203,
+ /*0x0454*/ 326,
+ /*0xa7a1*/ 1038,
+ -1,
+ /*0x10cd4*/ 1132,
+ /*0x24d4*/ 778,
+ -1, -1,
+ /*0x0575*/ 458,
+ /*0x03c8*/ 266,
+ /*0xa693*/ 980,
+ /*0x13d2*/ 526,
+ /*0x0252*/ 201,
+ /*0x0452*/ 324,
+ /*0x13ea*/ 550,
+ -1,
+ /*0x10cd2*/ 1130,
+ /*0x24d2*/ 776,
+ /*0x006a*/ 8,
+ /*0x10cea*/ 1154,
+ /*0x2c56*/ 838,
+ /*0x04ca*/ 386,
+ -1,
+ /*0x01bd*/ 136,
+ /*0x13ca*/ 518,
+ -1,
+ /*0x044a*/ 316,
+ -1, -1,
+ /*0x10cca*/ 1122,
+ -1, -1, -1,
+ /*0x01b9*/ 135,
+ -1,
+ /*0x1044a*/ 1106,
+ /*0x1f74*/ 739,
+ /*0x1e8d*/ 634,
+ /*0x1e0d*/ 570,
+ /*0x048d*/ 356,
+ /*0x010d*/ 62,
+ /*0x2c8d*/ 861,
+ /*0x0521*/ 430,
+ /*0x020d*/ 171,
+ -1,
+ /*0x1fb1*/ 750,
+ /*0x03bb*/ 254,
+ -1,
+ /*0x2d21*/ 941,
+ -1,
+ /*0x2c30*/ 800,
+ -1, -1,
+ /*0x2c66*/ 849,
+ -1,
+ /*0x01fb*/ 162,
+ /*0x1e89*/ 632,
+ /*0x1e09*/ 568,
+ /*0x118d6*/ 1185,
+ /*0x0109*/ 60,
+ /*0x2c89*/ 859,
+ -1,
+ /*0x0209*/ 169,
+ /*0x2c54*/ 836,
+ -1,
+ /*0x13dc*/ 536,
+ /*0x025c*/ 208,
+ /*0x045c*/ 334,
+ -1,
+ /*0x01fd*/ 163,
+ /*0x10cdc*/ 1140,
+ /*0x24dc*/ 786,
+ /*0x1f76*/ 741,
+ /*0x2171*/ 758,
+ /*0x13da*/ 534,
+ /*0x2c52*/ 834,
+ /*0x045a*/ 332,
+ -1,
+ /*0x2c6a*/ 851,
+ /*0x10cda*/ 1138,
+ /*0x24da*/ 784,
+ /*0xa787*/ 1029,
+ /*0x01f9*/ 161,
+ /*0x00fb*/ 51,
+ /*0x2cec*/ 905,
+ /*0x13ec*/ 552,
+ /*0x026c*/ 217,
+ /*0x13e4*/ 544,
+ /*0x2c4a*/ 826,
+ /*0x006c*/ 10,
+ /*0x10cec*/ 1156,
+ /*0x0064*/ 3,
+ /*0x10ce4*/ 1148,
+ /*0x24e4*/ 794,
+ -1, -1,
+ /*0x2175*/ 762,
+ /*0x00fd*/ 53,
+ /*0x13e8*/ 548,
+ /*0x0268*/ 214,
+ /*0x1f70*/ 735,
+ /*0x118d4*/ 1183,
+ /*0x0068*/ 7,
+ /*0x10ce8*/ 1152,
+ /*0x24e8*/ 798,
+ -1,
+ /*0x13d8*/ 532,
+ /*0x0199*/ 124,
+ /*0x0458*/ 330,
+ -1,
+ /*0x00f9*/ 49,
+ /*0x10cd8*/ 1136,
+ /*0x24d8*/ 782,
+ /*0x118d2*/ 1181,
+ -1, -1,
+ /*0x057b*/ 464,
+ /*0x1e1f*/ 579,
+ /*0x049f*/ 365,
+ /*0x011f*/ 71,
+ /*0x2c9f*/ 870,
+ /*0x0507*/ 417,
+ /*0x021f*/ 180,
+ -1, -1, -1,
+ /*0x118ca*/ 1173,
+ /*0x2d07*/ 915,
+ /*0xa799*/ 1034,
+ /*0x2c5c*/ 844,
+ /*0x057d*/ 466,
+ /*0x13b6*/ 498,
+ -1,
+ /*0x0436*/ 296,
+ -1, -1,
+ /*0x03f8*/ 288,
+ -1,
+ /*0x2c5a*/ 842,
+ /*0x00f2*/ 43,
+ /*0x13e2*/ 542,
+ -1,
+ /*0x10436*/ 1086,
+ /*0x0579*/ 462,
+ /*0x0062*/ 1,
+ /*0x10ce2*/ 1146,
+ /*0x24e2*/ 792,
+ /*0x13e0*/ 540,
+ /*0x0260*/ 209,
+ /*0x2c6c*/ 852,
+ -1, -1,
+ /*0x10ce0*/ 1144,
+ /*0x24e0*/ 790,
+ /*0xa687*/ 974,
+ /*0xff50*/ 1061,
+ -1, -1,
+ /*0x1f7a*/ 745,
+ -1, -1, -1,
+ /*0x2c68*/ 850,
+ -1,
+ /*0x0371*/ 234,
+ /*0x01ff*/ 164,
+ /*0xff48*/ 1053,
+ /*0x118dc*/ 1191,
+ /*0x0519*/ 426,
+ -1,
+ /*0x2c58*/ 840,
+ /*0x0289*/ 227,
+ /*0x0572*/ 455,
+ -1,
+ /*0x2d19*/ 933,
+ -1,
+ /*0x118da*/ 1189,
+ /*0x13b4*/ 496,
+ -1,
+ /*0x0434*/ 294,
+ /*0x2cee*/ 906,
+ /*0x13ee*/ 554,
+ -1,
+ /*0x00f4*/ 45,
+ -1,
+ /*0x006e*/ 12,
+ /*0x10cee*/ 1158,
+ /*0x013e*/ 85,
+ /*0x10434*/ 1084,
+ /*0x13be*/ 506,
+ /*0x03ca*/ 268,
+ /*0x043e*/ 304,
+ /*0x01d0*/ 142,
+ /*0x00ff*/ 55,
+ -1,
+ /*0x2c36*/ 806,
+ -1,
+ /*0xa7a9*/ 1042,
+ -1, -1,
+ /*0x1043e*/ 1094,
+ /*0xa699*/ 983,
+ -1,
+ /*0x052f*/ 437,
+ /*0x217b*/ 768,
+ /*0xa797*/ 1033,
+ -1, -1,
+ /*0x118d8*/ 1187,
+ -1,
+ /*0x013a*/ 83,
+ /*0x1f78*/ 743,
+ /*0x13ba*/ 502,
+ -1,
+ /*0x043a*/ 300,
+ /*0x1f77*/ 742,
+ /*0x0574*/ 457,
+ -1,
+ /*0x217d*/ 770,
+ /*0x00f6*/ 47,
+ -1, -1, -1,
+ /*0x1043a*/ 1090,
+ -1, -1,
+ /*0x057f*/ 468,
+ /*0x1f30*/ 709,
+ -1, -1,
+ /*0x1f66*/ 733,
+ /*0x2179*/ 766,
+ /*0x13b8*/ 500,
+ -1,
+ /*0x0438*/ 298,
+ /*0xa79d*/ 1036,
+ -1,
+ /*0x0529*/ 434,
+ -1, -1, -1,
+ /*0x2c34*/ 804,
+ -1,
+ /*0x10438*/ 1088,
+ -1,
+ /*0x0517*/ 425,
+ /*0x13b2*/ 494,
+ /*0x00f0*/ 41,
+ /*0x0432*/ 292,
+ -1, -1,
+ /*0x2d17*/ 931,
+ /*0x0576*/ 459,
+ /*0x2c3e*/ 814,
+ -1, -1, -1,
+ /*0x10432*/ 1082,
+ -1, -1,
+ /*0x2172*/ 759,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x051d*/ 428,
+ /*0x2c3a*/ 810,
+ -1,
+ /*0xa697*/ 982,
+ /*0xff56*/ 1067,
+ /*0x0570*/ 453,
+ /*0x2d1d*/ 937,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x037b*/ 237,
+ /*0x2c38*/ 808,
+ /*0x03b6*/ 249,
+ -1, -1, -1, -1, -1, -1,
+ /*0x2174*/ 761,
+ /*0x00fa*/ 50,
+ -1, -1, -1,
+ /*0x037d*/ 239,
+ /*0x2c32*/ 802,
+ -1, -1, -1,
+ /*0x217f*/ 772,
+ -1,
+ /*0x01d6*/ 145,
+ -1, -1, -1, -1, -1,
+ /*0xff54*/ 1065,
+ -1,
+ /*0x052b*/ 435,
+ -1, -1, -1,
+ /*0x1f64*/ 731,
+ -1, -1, -1, -1, -1,
+ /*0xff52*/ 1063,
+ -1, -1, -1,
+ /*0x057a*/ 463,
+ -1,
+ /*0x2176*/ 763,
+ -1, -1,
+ /*0x03b4*/ 247,
+ -1, -1,
+ /*0x01b0*/ 132,
+ /*0xff4a*/ 1055,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x03be*/ 257,
+ -1, -1,
+ /*0x00f8*/ 48,
+ /*0x01d4*/ 144,
+ /*0x1fd0*/ 751,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x2170*/ 757,
+ -1, -1,
+ /*0x01d2*/ 143,
+ /*0x1f36*/ 715,
+ -1, -1, -1, -1,
+ /*0x00e6*/ 31,
+ /*0x03ba*/ 253,
+ -1, -1,
+ /*0x1f62*/ 729,
+ -1, -1, -1, -1, -1, -1,
+ /*0x1f60*/ 727,
+ -1, -1,
+ /*0x0578*/ 461,
+ -1, -1, -1,
+ /*0x0577*/ 460,
+ -1,
+ /*0xff5a*/ 1071,
+ /*0x03b8*/ 251,
+ -1, -1, -1,
+ /*0x00ea*/ 35,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x0566*/ 443,
+ -1,
+ /*0x03b2*/ 245,
+ -1, -1, -1, -1, -1,
+ /*0x1f34*/ 713,
+ -1, -1, -1, -1, -1, -1,
+ /*0x01dc*/ 148,
+ /*0x217a*/ 767,
+ -1, -1,
+ /*0xff58*/ 1069,
+ -1, -1, -1, -1,
+ /*0x01da*/ 147,
+ /*0x056a*/ 447,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x050d*/ 420,
+ -1, -1,
+ /*0x01d8*/ 146,
+ -1, -1,
+ /*0x2d0d*/ 921,
+ -1, -1, -1,
+ /*0x00ec*/ 37,
+ -1,
+ /*0x00e4*/ 29,
+ -1, -1, -1,
+ /*0x2178*/ 765,
+ -1, -1,
+ /*0x0509*/ 418,
+ /*0x2177*/ 764,
+ -1, -1,
+ /*0x00e8*/ 33,
+ /*0x1f32*/ 711,
+ /*0x2d09*/ 917,
+ -1, -1,
+ /*0x01b6*/ 134,
+ -1, -1, -1, -1,
+ /*0xa68d*/ 977,
+ -1, -1, -1, -1, -1,
+ /*0xa79f*/ 1037,
+ -1, -1, -1,
+ /*0x056c*/ 449,
+ -1,
+ /*0x0564*/ 441,
+ -1, -1, -1, -1, -1,
+ /*0x1fb0*/ 749,
+ /*0xa689*/ 975,
+ -1, -1, -1,
+ /*0x0568*/ 445,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x00e2*/ 27,
+ -1, -1, -1, -1, -1, -1,
+ /*0x00e0*/ 25,
+ -1,
+ /*0x01b4*/ 133,
+ -1, -1, -1, -1,
+ /*0x051f*/ 429,
+ -1, -1, -1, -1, -1,
+ /*0x2d1f*/ 939,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0x0562*/ 439,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x00ee*/ 39,
+ -1, -1, -1, -1,
+ /*0x0377*/ 236,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x056e*/ 451,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0x1fe0*/ 753
+ };
+
+ if (code <= MAX_CODE_VALUE && code >= MIN_CODE_VALUE)
+ {
+ register int key = onigenc_unicode_CaseUnfold_11_hash(code);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register short s = wordlist[key];
+
+ if (s >= 0 && code1_equal(code, CaseUnfold_11_Table[s].from))
+ return &CaseUnfold_11_Table[s].to;
+ }
+ }
+ return 0;
+}
+
+static const CaseUnfold_12_Type CaseUnfold_12_Table[] = {
+#define CaseUnfold_12 (*(CaseUnfold_12_Type (*)[58])(CaseUnfold_12_Table+0))
+ {{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}}},
+#define CaseUnfold_12_Locale (*(CaseUnfold_12_Type (*)[1])(CaseUnfold_12_Table+58))
+ {{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 }}},
+/* C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -7 -k1,2,3,4,5,6 -F,-1 -c -j1 -i1 -t -T -E -C -H onigenc_unicode_CaseUnfold_12_hash -N onigenc_unicode_CaseUnfold_12_lookup -n */
+
+/* maximum key range = 71, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+/*ARGSUSED*/
+static unsigned int
+onigenc_unicode_CaseUnfold_12_hash(const OnigCodePoint *codes)
+{
+ static const unsigned char asso_values[] =
+ {
+ 3, 58, 54, 57, 56, 16, 8, 2, 43, 82,
+ 3, 1, 23, 82, 82, 82, 82, 82, 82, 4,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 52, 51, 50, 49, 48, 47, 46, 45,
+ 82, 82, 82, 82, 43, 82, 42, 82, 82, 13,
+ 82, 82, 82, 82, 82, 11, 82, 1, 82, 82,
+ 14, 82, 1, 82, 82, 31, 3, 82, 82, 30,
+ 82, 82, 82, 10, 82, 82, 82, 82, 37, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 37, 15, 36, 35,
+ 34, 17, 1, 33, 12, 4, 23, 23, 26, 21,
+ 13, 82, 27, 82, 82, 2, 5, 82, 11, 16,
+ 82, 15, 82, 82, 23, 82, 8, 82
+ };
+ return asso_values[bits_at(codes, 5)] + asso_values[bits_at(codes, 4)] + asso_values[bits_at(codes, 3)] + asso_values[bits_at(codes, 2)] + asso_values[bits_at(codes, 1)] + asso_values[bits_at(codes, 0)];
+}
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+static const CodePointList2 *
+onigenc_unicode_CaseUnfold_12_lookup(const OnigCodePoint *codes)
+{
+ enum
+ {
+ MIN_CODE_VALUE = 0x61,
+ MAX_CODE_VALUE = 0x1f7c,
+ TOTAL_KEYWORDS = 59,
+ MIN_WORD_LENGTH = 6,
+ MAX_WORD_LENGTH = 6,
+ MIN_HASH_VALUE = 11,
+ MAX_HASH_VALUE = 81
+ };
+
+ static const short wordlist[] =
+ {
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0x1f66,0x03b9*/ 53,
+ /*0x1f07,0x03b9*/ 38,
+ /*0x1f00,0x03b9*/ 31,
+ /*0x0066,0x0066*/ 1,
+ /*0x1f74,0x03b9*/ 56,
+ /*0x0073,0x0073*/ 6,
+ /*0x0066,0x0069*/ 2,
+ /*0x1f06,0x03b9*/ 37,
+ /*0x0073,0x0074*/ 7,
+ /*0x03b9,0x0342*/ 18,
+ /*0x03c9,0x03b9*/ 23,
+ /*0x03b7,0x03b9*/ 17,
+ /*0x0069,0x0307*/ 58,
+ /*0x03b1,0x03b9*/ 15,
+ /*0x1f61,0x03b9*/ 48,
+ /*0x1f05,0x03b9*/ 36,
+ /*0x1f65,0x03b9*/ 52,
+ /*0x0574,0x0576*/ 29,
+ /*0x03c9,0x0342*/ 22,
+ /*0x03b7,0x0342*/ 16,
+ /*0x057e,0x0576*/ 30,
+ /*0x03b1,0x0342*/ 14,
+ /*0x1f7c,0x03b9*/ 57,
+ /*0x0574,0x0565*/ 26,
+ /*0x0079,0x030a*/ 10,
+ /*0x0077,0x030a*/ 9,
+ /*0x1f70,0x03b9*/ 55,
+ /*0x0574,0x056d*/ 28,
+ /*0x0066,0x006c*/ 3,
+ /*0x0574,0x056b*/ 27,
+ /*0x0061,0x02be*/ 0,
+ /*0x0068,0x0331*/ 4,
+ /*0x1f67,0x03b9*/ 54,
+ /*0x1f64,0x03b9*/ 51,
+ /*0x1f63,0x03b9*/ 50,
+ /*0x1f62,0x03b9*/ 49,
+ /*0x1f60,0x03b9*/ 47,
+ /*0x03ce,0x03b9*/ 24,
+ /*0x03c5,0x0342*/ 21,
+ /*0x03c5,0x0313*/ 20,
+ /*0x03c1,0x0313*/ 19,
+ /*0x02bc,0x006e*/ 11,
+ /*0x03ae,0x03b9*/ 13,
+ /*0x03ac,0x03b9*/ 12,
+ /*0x1f27,0x03b9*/ 46,
+ /*0x1f26,0x03b9*/ 45,
+ /*0x1f25,0x03b9*/ 44,
+ /*0x1f24,0x03b9*/ 43,
+ /*0x1f23,0x03b9*/ 42,
+ /*0x1f22,0x03b9*/ 41,
+ /*0x1f21,0x03b9*/ 40,
+ /*0x1f20,0x03b9*/ 39,
+ /*0x006a,0x030c*/ 5,
+ /*0x1f02,0x03b9*/ 33,
+ /*0x0074,0x0308*/ 8,
+ /*0x1f04,0x03b9*/ 35,
+ /*0x1f03,0x03b9*/ 34,
+ /*0x1f01,0x03b9*/ 32,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0x0565,0x0582*/ 25
+ };
+
+ if (codes[0] <= MAX_CODE_VALUE && codes[0] >= MIN_CODE_VALUE &&
+ codes[1] <= MAX_CODE_VALUE && codes[1] >= MIN_CODE_VALUE)
+ {
+ register int key = onigenc_unicode_CaseUnfold_12_hash(codes);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register short s = wordlist[key];
+
+ if (s >= 0 && code2_equal(codes, CaseUnfold_12_Table[s].from))
+ return &CaseUnfold_12_Table[s].to;
+ }
+ }
+ return 0;
+}
+
+static const CaseUnfold_13_Type CaseUnfold_13_Table[] = {
+#define CaseUnfold_13 (*(CaseUnfold_13_Type (*)[14])(CaseUnfold_13_Table+0))
+ {{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
+/* C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -7 -k1,2,3,4,5,6,7,8,9 -F,-1 -c -j1 -i1 -t -T -E -C -H onigenc_unicode_CaseUnfold_13_hash -N onigenc_unicode_CaseUnfold_13_lookup -n */
+
+/* maximum key range = 20, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+/*ARGSUSED*/
+static unsigned int
+onigenc_unicode_CaseUnfold_13_hash(const OnigCodePoint *codes)
+{
+ static const unsigned char asso_values[] =
+ {
+ 7, 4, 47, 47, 47, 47, 1, 1, 2, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 1,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 11,
+ 47, 47, 47, 47, 47, 10, 47, 2, 47, 47,
+ 47, 47, 47, 47, 47, 47, 1, 47, 47, 1,
+ 47, 47, 47, 9, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 1, 47, 47, 2, 47, 47, 1, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47
+ };
+ return asso_values[bits_at(codes, 8)] + asso_values[bits_at(codes, 7)] + asso_values[bits_at(codes, 6)] + asso_values[bits_at(codes, 5)] + asso_values[bits_at(codes, 4)] + asso_values[bits_at(codes, 3)] + asso_values[bits_at(codes, 2)] + asso_values[bits_at(codes, 1)] + asso_values[bits_at(codes, 0)];
+}
+
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+static const CodePointList2 *
+onigenc_unicode_CaseUnfold_13_lookup(const OnigCodePoint *codes)
+{
+ enum
+ {
+ MIN_CODE_VALUE = 0x66,
+ MAX_CODE_VALUE = 0x3c9,
+ TOTAL_KEYWORDS = 14,
+ MIN_WORD_LENGTH = 9,
+ MAX_WORD_LENGTH = 9,
+ MIN_HASH_VALUE = 27,
+ MAX_HASH_VALUE = 46
+ };
+
+ static const short wordlist[] =
+ {
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x03c5,0x0313,0x0342*/ 12,
+ /*0x03c5,0x0308,0x0342*/ 9,
+ /*0x03b9,0x0308,0x0342*/ 6,
+ /*0x03c5,0x0313,0x0301*/ 11,
+ /*0x03c5,0x0308,0x0301*/ 8,
+ /*0x03b9,0x0308,0x0301*/ 5,
+ /*0x03c5,0x0313,0x0300*/ 10,
+ /*0x03c5,0x0308,0x0300*/ 7,
+ /*0x03b9,0x0308,0x0300*/ 4,
+ /*0x03c9,0x0342,0x03b9*/ 13,
+ /*0x03b7,0x0342,0x03b9*/ 3,
+ /*0x03b1,0x0342,0x03b9*/ 2,
+ -1, -1, -1, -1, -1, -1,
+ /*0x0066,0x0066,0x006c*/ 1,
+ /*0x0066,0x0066,0x0069*/ 0
+ };
+
+ if (codes[0] <= MAX_CODE_VALUE && codes[0] >= MIN_CODE_VALUE &&
+ codes[1] <= MAX_CODE_VALUE && codes[1] >= MIN_CODE_VALUE &&
+ codes[2] <= MAX_CODE_VALUE && codes[2] >= MIN_CODE_VALUE)
+ {
+ register int key = onigenc_unicode_CaseUnfold_13_hash(codes);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register short s = wordlist[key];
+
+ if (s >= 0 && code3_equal(codes, CaseUnfold_13_Table[s].from))
+ return &CaseUnfold_13_Table[s].to;
+ }
+ }
+ return 0;
+}
+
diff --git a/enc/unicode/name2ctype.h b/enc/unicode/name2ctype.h
index 2e80edf525..8c193dc4a1 100644
--- a/enc/unicode/name2ctype.h
+++ b/enc/unicode/name2ctype.h
@@ -1,4 +1,4 @@
-/* C code produced by gperf version 3.0.3 */
+/* C code produced by gperf version 3.0.4 */
/* Command-line: gperf -7 -c -j1 -i1 -t -C -P -T -H uniname2ctype_hash -Q uniname2ctype_pool -N uniname2ctype_p */
#ifndef USE_UNICODE_PROPERTIES
/* Computed positions: -k'1,3' */
@@ -44,7 +44,7 @@ static const OnigCodePoint CR_NEWLINE[] = {
/* 'Alpha': [[:Alpha:]] */
static const OnigCodePoint CR_Alpha[] = {
- 540,
+ 617,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -61,13 +61,14 @@ static const OnigCodePoint CR_Alpha[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -95,17 +96,13 @@ static const OnigCodePoint CR_Alpha[] = {
0x0800, 0x0817,
0x081a, 0x082c,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08e9,
- 0x08f0, 0x08fe,
- 0x0900, 0x093b,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x08e9,
+ 0x08f0, 0x093b,
0x093d, 0x094c,
0x094e, 0x0950,
0x0955, 0x0963,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -147,6 +144,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x0acb, 0x0acc,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -176,19 +174,18 @@ static const OnigCodePoint CR_Alpha[] = {
0x0bca, 0x0bcc,
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4c,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -201,7 +198,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x0cde, 0x0cde,
0x0ce0, 0x0ce3,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -210,7 +207,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x0d4a, 0x0d4c,
0x0d4e, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d7a, 0x0d7f,
0x0d82, 0x0d83,
0x0d85, 0x0d96,
@@ -278,12 +275,13 @@ static const OnigCodePoint CR_Alpha[] = {
0x1318, 0x135a,
0x135f, 0x135f,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1713,
0x1720, 0x1733,
@@ -298,7 +296,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x1938,
0x1950, 0x196d,
@@ -323,6 +321,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x1cee, 0x1cf3,
0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
+ 0x1de7, 0x1df4,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -394,7 +393,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -402,14 +401,12 @@ static const OnigCodePoint CR_Alpha[] = {
0xa62a, 0xa62b,
0xa640, 0xa66e,
0xa674, 0xa67b,
- 0xa67f, 0xa697,
- 0xa69f, 0xa6ef,
+ 0xa67f, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa827,
@@ -417,17 +414,21 @@ static const OnigCodePoint CR_Alpha[] = {
0xa880, 0xa8c3,
0xa8f2, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa90a, 0xa92a,
0xa930, 0xa952,
0xa960, 0xa97c,
0xa980, 0xa9b2,
0xa9b4, 0xa9bf,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
+ 0xaa7e, 0xaabe,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
@@ -438,7 +439,9 @@ static const OnigCodePoint CR_Alpha[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabea,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabea,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
@@ -476,19 +479,29 @@ static const OnigCodePoint CR_Alpha[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -499,25 +512,84 @@ static const OnigCodePoint CR_Alpha[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11000, 0x11045,
0x11082, 0x110b8,
0x110d0, 0x110e8,
0x11100, 0x11132,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11180, 0x111bf,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x11234,
+ 0x11237, 0x11237,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112e8,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134c,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11480, 0x114c1,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115be,
+ 0x115d8, 0x115dd,
+ 0x11600, 0x1163e,
+ 0x11640, 0x11640,
+ 0x11644, 0x11644,
0x11680, 0x116b5,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172a,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9e, 0x1bc9e,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -548,6 +620,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -581,20 +654,23 @@ static const OnigCodePoint CR_Alpha[] = {
0x1eea1, 0x1eea3,
0x1eea5, 0x1eea9,
0x1eeab, 0x1eebb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_Alpha */
/* 'Blank': [[:Blank:]] */
static const OnigCodePoint CR_Blank[] = {
- 9,
+ 8,
0x0009, 0x0009,
0x0020, 0x0020,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x202f, 0x202f,
0x205f, 0x205f,
@@ -610,7 +686,7 @@ static const OnigCodePoint CR_Cntrl[] = {
/* 'Digit': [[:Digit:]] */
static const OnigCodePoint CR_Digit[] = {
- 42,
+ 51,
0x0030, 0x0039,
0x0660, 0x0669,
0x06f0, 0x06f9,
@@ -624,6 +700,7 @@ static const OnigCodePoint CR_Digit[] = {
0x0c66, 0x0c6f,
0x0ce6, 0x0cef,
0x0d66, 0x0d6f,
+ 0x0de6, 0x0def,
0x0e50, 0x0e59,
0x0ed0, 0x0ed9,
0x0f20, 0x0f29,
@@ -643,6 +720,7 @@ static const OnigCodePoint CR_Digit[] = {
0xa8d0, 0xa8d9,
0xa900, 0xa909,
0xa9d0, 0xa9d9,
+ 0xa9f0, 0xa9f9,
0xaa50, 0xaa59,
0xabf0, 0xabf9,
0xff10, 0xff19,
@@ -651,30 +729,36 @@ static const OnigCodePoint CR_Digit[] = {
0x110f0, 0x110f9,
0x11136, 0x1113f,
0x111d0, 0x111d9,
+ 0x112f0, 0x112f9,
+ 0x114d0, 0x114d9,
+ 0x11650, 0x11659,
0x116c0, 0x116c9,
+ 0x11730, 0x11739,
+ 0x118e0, 0x118e9,
+ 0x16a60, 0x16a69,
+ 0x16b50, 0x16b59,
0x1d7ce, 0x1d7ff,
}; /* CR_Digit */
/* 'Graph': [[:Graph:]] */
static const OnigCodePoint CR_Graph[] = {
- 544,
+ 618,
0x0021, 0x007e,
0x00a1, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
- 0x03a3, 0x0527,
+ 0x03a3, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0604,
- 0x0606, 0x061b,
+ 0x0600, 0x061c,
0x061e, 0x070d,
0x070f, 0x074a,
0x074d, 0x07b1,
@@ -683,12 +767,8 @@ static const OnigCodePoint CR_Graph[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -731,6 +811,7 @@ static const OnigCodePoint CR_Graph[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0af1,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -761,21 +842,20 @@ static const OnigCodePoint CR_Graph[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -789,7 +869,7 @@ static const OnigCodePoint CR_Graph[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -797,7 +877,7 @@ static const OnigCodePoint CR_Graph[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d75,
0x0d79, 0x0d7f,
0x0d82, 0x0d83,
@@ -810,6 +890,7 @@ static const OnigCodePoint CR_Graph[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e3a,
0x0e3f, 0x0e5b,
@@ -858,10 +939,11 @@ static const OnigCodePoint CR_Graph[] = {
0x1318, 0x135a,
0x135d, 0x137c,
0x1380, 0x1399,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1400, 0x167f,
0x1681, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1736,
@@ -872,12 +954,12 @@ static const OnigCodePoint CR_Graph[] = {
0x1780, 0x17dd,
0x17e0, 0x17e9,
0x17f0, 0x17f9,
- 0x1800, 0x180d,
+ 0x1800, 0x180e,
0x1810, 0x1819,
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -892,6 +974,7 @@ static const OnigCodePoint CR_Graph[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa0, 0x1aad,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
0x1b80, 0x1bf3,
@@ -900,7 +983,8 @@ static const OnigCodePoint CR_Graph[] = {
0x1c4d, 0x1c7f,
0x1cc0, 0x1cc7,
0x1cd0, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -921,18 +1005,21 @@ static const OnigCodePoint CR_Graph[] = {
0x202a, 0x202e,
0x2030, 0x205e,
0x2060, 0x2064,
- 0x206a, 0x2071,
+ 0x2066, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20be,
0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x2100, 0x218b,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cf3,
@@ -950,7 +1037,7 @@ static const OnigCodePoint CR_Graph[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
+ 0x2de0, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -965,38 +1052,36 @@ static const OnigCodePoint CR_Graph[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
+ 0x4dc0, 0x9fd5,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa697,
- 0xa69f, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
+ 0xa640, 0xa6f7,
+ 0xa700, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
+ 0xa8e0, 0xa8fd,
0xa900, 0xa953,
0xa95f, 0xa97c,
0xa980, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa5c, 0xaac2,
0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabed,
+ 0xab30, 0xab65,
+ 0xab70, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -1016,8 +1101,7 @@ static const OnigCodePoint CR_Graph[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfd,
0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
+ 0xfe20, 0xfe52,
0xfe54, 0xfe66,
0xfe68, 0xfe6b,
0xfe70, 0xfe74,
@@ -1040,32 +1124,43 @@ static const OnigCodePoint CR_Graph[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
+ 0x108fb, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
0x10980, 0x109b7,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
+ 0x109bc, 0x109cf,
+ 0x109d2, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
0x10a15, 0x10a17,
@@ -1073,36 +1168,98 @@ static const OnigCodePoint CR_Graph[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x10cfa, 0x10cff,
0x10e60, 0x10e7e,
0x11000, 0x1104d,
0x11052, 0x1106f,
- 0x11080, 0x110c1,
+ 0x1107f, 0x110c1,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x11143,
- 0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x11150, 0x11176,
+ 0x11180, 0x111cd,
+ 0x111d0, 0x111df,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a9,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115dd,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x1173f,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
+ 0x1d129, 0x1d1e8,
0x1d200, 0x1d245,
0x1d300, 0x1d356,
0x1d360, 0x1d371,
@@ -1126,7 +1283,11 @@ static const OnigCodePoint CR_Graph[] = {
0x1d54a, 0x1d550,
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
+ 0x1d7ce, 0x1da8b,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -1164,10 +1325,10 @@ static const OnigCodePoint CR_Graph[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -1175,27 +1336,25 @@ static const OnigCodePoint CR_Graph[] = {
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,
+ 0x1f300, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
@@ -1206,7 +1365,7 @@ static const OnigCodePoint CR_Graph[] = {
/* 'Lower': [[:Lower:]] */
static const OnigCodePoint CR_Lower[] = {
- 618,
+ 637,
0x0061, 0x007a,
0x00aa, 0x00aa,
0x00b5, 0x00b5,
@@ -1477,7 +1636,12 @@ static const OnigCodePoint CR_Lower[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
+ 0x13f8, 0x13fd,
0x1d00, 0x1dbf,
0x1e01, 0x1e01,
0x1e03, 0x1e03,
@@ -1738,6 +1902,8 @@ static const OnigCodePoint CR_Lower[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69d,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -1786,17 +1952,29 @@ static const OnigCodePoint CR_Lower[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
- 0xa793, 0xa793,
+ 0xa793, 0xa795,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
0xa7a7, 0xa7a7,
0xa7a9, 0xa7a9,
+ 0xa7b5, 0xa7b5,
+ 0xa7b7, 0xa7b7,
0xa7f8, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x10cc0, 0x10cf2,
+ 0x118c0, 0x118df,
0x1d41a, 0x1d433,
0x1d44e, 0x1d454,
0x1d456, 0x1d467,
@@ -1829,24 +2007,23 @@ static const OnigCodePoint CR_Lower[] = {
/* 'Print': [[:Print:]] */
static const OnigCodePoint CR_Print[] = {
- 541,
+ 615,
0x0020, 0x007e,
0x00a0, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
- 0x03a3, 0x0527,
+ 0x03a3, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0604,
- 0x0606, 0x061b,
+ 0x0600, 0x061c,
0x061e, 0x070d,
0x070f, 0x074a,
0x074d, 0x07b1,
@@ -1855,12 +2032,8 @@ static const OnigCodePoint CR_Print[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -1903,6 +2076,7 @@ static const OnigCodePoint CR_Print[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0af1,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -1933,21 +2107,20 @@ static const OnigCodePoint CR_Print[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -1961,7 +2134,7 @@ static const OnigCodePoint CR_Print[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -1969,7 +2142,7 @@ static const OnigCodePoint CR_Print[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d75,
0x0d79, 0x0d7f,
0x0d82, 0x0d83,
@@ -1982,6 +2155,7 @@ static const OnigCodePoint CR_Print[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e3a,
0x0e3f, 0x0e5b,
@@ -2030,9 +2204,10 @@ static const OnigCodePoint CR_Print[] = {
0x1318, 0x135a,
0x135d, 0x137c,
0x1380, 0x1399,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1400, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1736,
@@ -2048,7 +2223,7 @@ static const OnigCodePoint CR_Print[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -2063,6 +2238,7 @@ static const OnigCodePoint CR_Print[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa0, 0x1aad,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
0x1b80, 0x1bf3,
@@ -2071,7 +2247,8 @@ static const OnigCodePoint CR_Print[] = {
0x1c4d, 0x1c7f,
0x1cc0, 0x1cc7,
0x1cd0, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -2090,18 +2267,21 @@ static const OnigCodePoint CR_Print[] = {
0x1ff6, 0x1ffe,
0x2000, 0x2027,
0x202a, 0x2064,
- 0x206a, 0x2071,
+ 0x2066, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20be,
0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x2100, 0x218b,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cf3,
@@ -2119,7 +2299,7 @@ static const OnigCodePoint CR_Print[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
+ 0x2de0, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -2134,38 +2314,36 @@ static const OnigCodePoint CR_Print[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
+ 0x4dc0, 0x9fd5,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa697,
- 0xa69f, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
+ 0xa640, 0xa6f7,
+ 0xa700, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
+ 0xa8e0, 0xa8fd,
0xa900, 0xa953,
0xa95f, 0xa97c,
0xa980, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa5c, 0xaac2,
0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabed,
+ 0xab30, 0xab65,
+ 0xab70, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -2185,8 +2363,7 @@ static const OnigCodePoint CR_Print[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfd,
0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
+ 0xfe20, 0xfe52,
0xfe54, 0xfe66,
0xfe68, 0xfe6b,
0xfe70, 0xfe74,
@@ -2209,32 +2386,43 @@ static const OnigCodePoint CR_Print[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
+ 0x108fb, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
0x10980, 0x109b7,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
+ 0x109bc, 0x109cf,
+ 0x109d2, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
0x10a15, 0x10a17,
@@ -2242,36 +2430,98 @@ static const OnigCodePoint CR_Print[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x10cfa, 0x10cff,
0x10e60, 0x10e7e,
0x11000, 0x1104d,
0x11052, 0x1106f,
- 0x11080, 0x110c1,
+ 0x1107f, 0x110c1,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x11143,
- 0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x11150, 0x11176,
+ 0x11180, 0x111cd,
+ 0x111d0, 0x111df,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a9,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115dd,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x1173f,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
+ 0x1d129, 0x1d1e8,
0x1d200, 0x1d245,
0x1d300, 0x1d356,
0x1d360, 0x1d371,
@@ -2295,7 +2545,11 @@ static const OnigCodePoint CR_Print[] = {
0x1d54a, 0x1d550,
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
+ 0x1d7ce, 0x1da8b,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -2333,10 +2587,10 @@ static const OnigCodePoint CR_Print[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -2344,27 +2598,25 @@ static const OnigCodePoint CR_Print[] = {
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,
+ 0x1f300, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
@@ -2375,7 +2627,7 @@ static const OnigCodePoint CR_Print[] = {
/* 'Punct': [[:Punct:]] */
static const OnigCodePoint CR_Punct[] = {
- 140,
+ 161,
0x0021, 0x0023,
0x0025, 0x002a,
0x002c, 0x002f,
@@ -2449,6 +2701,7 @@ static const OnigCodePoint CR_Punct[] = {
0x2053, 0x205e,
0x207d, 0x207e,
0x208d, 0x208e,
+ 0x2308, 0x230b,
0x2329, 0x232a,
0x2768, 0x2775,
0x27c5, 0x27c6,
@@ -2460,7 +2713,7 @@ static const OnigCodePoint CR_Punct[] = {
0x2cfe, 0x2cff,
0x2d70, 0x2d70,
0x2e00, 0x2e2e,
- 0x2e30, 0x2e3b,
+ 0x2e30, 0x2e42,
0x3001, 0x3003,
0x3008, 0x3011,
0x3014, 0x301f,
@@ -2476,6 +2729,7 @@ static const OnigCodePoint CR_Punct[] = {
0xa874, 0xa877,
0xa8ce, 0xa8cf,
0xa8f8, 0xa8fa,
+ 0xa8fc, 0xa8fc,
0xa92e, 0xa92f,
0xa95f, 0xa95f,
0xa9c1, 0xa9cd,
@@ -2504,29 +2758,47 @@ static const OnigCodePoint CR_Punct[] = {
0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
+ 0x1056f, 0x1056f,
0x10857, 0x10857,
0x1091f, 0x1091f,
0x1093f, 0x1093f,
0x10a50, 0x10a58,
0x10a7f, 0x10a7f,
+ 0x10af0, 0x10af6,
0x10b39, 0x10b3f,
+ 0x10b99, 0x10b9c,
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
0x11140, 0x11143,
- 0x111c5, 0x111c8,
- 0x12470, 0x12473,
+ 0x11174, 0x11175,
+ 0x111c5, 0x111c9,
+ 0x111cd, 0x111cd,
+ 0x111db, 0x111db,
+ 0x111dd, 0x111df,
+ 0x11238, 0x1123d,
+ 0x112a9, 0x112a9,
+ 0x114c6, 0x114c6,
+ 0x115c1, 0x115d7,
+ 0x11641, 0x11643,
+ 0x1173c, 0x1173e,
+ 0x12470, 0x12474,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b3b,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
+ 0x1da87, 0x1da8b,
}; /* CR_Punct */
/* 'Space': [[:Space:]] */
static const OnigCodePoint CR_Space[] = {
- 11,
+ 10,
0x0009, 0x000d,
0x0020, 0x0020,
0x0085, 0x0085,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x2028, 0x2029,
0x202f, 0x202f,
@@ -2536,7 +2808,7 @@ static const OnigCodePoint CR_Space[] = {
/* 'Upper': [[:Upper:]] */
static const OnigCodePoint CR_Upper[] = {
- 610,
+ 630,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -2684,6 +2956,7 @@ static const OnigCodePoint CR_Upper[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -2803,10 +3076,15 @@ static const OnigCodePoint CR_Upper[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
0x10cd, 0x10cd,
+ 0x13a0, 0x13f5,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -3059,6 +3337,8 @@ static const OnigCodePoint CR_Upper[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -3108,14 +3388,23 @@ static const OnigCodePoint CR_Upper[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b4,
+ 0xa7b6, 0xa7b6,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x10c80, 0x10cb2,
+ 0x118a0, 0x118bf,
0x1d400, 0x1d419,
0x1d434, 0x1d44d,
0x1d468, 0x1d481,
@@ -3147,6 +3436,9 @@ static const OnigCodePoint CR_Upper[] = {
0x1d756, 0x1d76e,
0x1d790, 0x1d7a8,
0x1d7ca, 0x1d7ca,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Upper */
/* 'XDigit': [[:XDigit:]] */
@@ -3159,7 +3451,7 @@ static const OnigCodePoint CR_XDigit[] = {
/* 'Word': [[:Word:]] */
static const OnigCodePoint CR_Word[] = {
- 564,
+ 654,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -3177,13 +3469,14 @@ static const OnigCodePoint CR_Word[] = {
0x0300, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x0483, 0x0527,
+ 0x0483, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -3207,14 +3500,10 @@ static const OnigCodePoint CR_Word[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0963,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -3257,6 +3546,7 @@ static const OnigCodePoint CR_Word[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0aef,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -3288,20 +3578,19 @@ static const OnigCodePoint CR_Word[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -3315,7 +3604,7 @@ static const OnigCodePoint CR_Word[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -3323,7 +3612,7 @@ static const OnigCodePoint CR_Word[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d6f,
0x0d7a, 0x0d7f,
0x0d82, 0x0d83,
@@ -3336,6 +3625,7 @@ static const OnigCodePoint CR_Word[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e4e,
@@ -3394,12 +3684,13 @@ static const OnigCodePoint CR_Word[] = {
0x1318, 0x135a,
0x135d, 0x135f,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1734,
@@ -3416,7 +3707,7 @@ static const OnigCodePoint CR_Word[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1946, 0x196d,
@@ -3430,6 +3721,7 @@ static const OnigCodePoint CR_Word[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
@@ -3439,7 +3731,8 @@ static const OnigCodePoint CR_Word[] = {
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
0x1cd4, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -3514,37 +3807,36 @@ static const OnigCodePoint CR_Word[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa672,
0xa674, 0xa67d,
- 0xa67f, 0xa697,
- 0xa69f, 0xa6f1,
+ 0xa67f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa827,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
0xa8e0, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa900, 0xa92d,
0xa930, 0xa953,
0xa960, 0xa97c,
0xa980, 0xa9c0,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa7a, 0xaac2,
0xaadb, 0xaadd,
0xaae0, 0xaaef,
0xaaf2, 0xaaf6,
@@ -3553,7 +3845,9 @@ static const OnigCodePoint CR_Word[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabea,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabea,
0xabec, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
@@ -3575,7 +3869,7 @@ static const OnigCodePoint CR_Word[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfb,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0xfe33, 0xfe34,
0xfe4d, 0xfe4f,
0xfe70, 0xfe74,
@@ -3600,20 +3894,31 @@ static const OnigCodePoint CR_Word[] = {
0x101fd, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x102e0, 0x102e0,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -3626,29 +3931,94 @@ static const OnigCodePoint CR_Word[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae6,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11000, 0x11046,
0x11066, 0x1106f,
- 0x11080, 0x110ba,
+ 0x1107f, 0x110ba,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
0x11180, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111ca, 0x111cc,
+ 0x111d0, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x11237,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x115d8, 0x115dd,
+ 0x11600, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x11739,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af4,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -3686,6 +4056,14 @@ static const OnigCodePoint CR_Word[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1da00, 0x1da36,
+ 0x1da3b, 0x1da6c,
+ 0x1da75, 0x1da75,
+ 0x1da84, 0x1da84,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e800, 0x1e8c4,
+ 0x1e8d0, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -3719,16 +4097,20 @@ static const OnigCodePoint CR_Word[] = {
0x1eea1, 0x1eea3,
0x1eea5, 0x1eea9,
0x1eeab, 0x1eebb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
0xe0100, 0xe01ef,
}; /* CR_Word */
/* 'Alnum': [[:Alnum:]] */
static const OnigCodePoint CR_Alnum[] = {
- 566,
+ 648,
0x0030, 0x0039,
0x0041, 0x005a,
0x0061, 0x007a,
@@ -3746,13 +4128,14 @@ static const OnigCodePoint CR_Alnum[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -3779,18 +4162,14 @@ static const OnigCodePoint CR_Alnum[] = {
0x0800, 0x0817,
0x081a, 0x082c,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08e9,
- 0x08f0, 0x08fe,
- 0x0900, 0x093b,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x08e9,
+ 0x08f0, 0x093b,
0x093d, 0x094c,
0x094e, 0x0950,
0x0955, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -3833,6 +4212,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0aef,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -3864,20 +4244,19 @@ static const OnigCodePoint CR_Alnum[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4c,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -3891,7 +4270,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -3900,7 +4279,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x0d4a, 0x0d4c,
0x0d4e, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d6f,
0x0d7a, 0x0d7f,
0x0d82, 0x0d83,
@@ -3912,6 +4291,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e46,
@@ -3973,12 +4353,13 @@ static const OnigCodePoint CR_Alnum[] = {
0x1318, 0x135a,
0x135f, 0x135f,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1713,
0x1720, 0x1733,
@@ -3995,7 +4376,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x1938,
0x1946, 0x196d,
@@ -4023,6 +4404,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x1cee, 0x1cf3,
0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
+ 0x1de7, 0x1df4,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -4094,21 +4476,19 @@ static const OnigCodePoint CR_Alnum[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66e,
0xa674, 0xa67b,
- 0xa67f, 0xa697,
- 0xa69f, 0xa6ef,
+ 0xa67f, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa827,
@@ -4117,18 +4497,21 @@ static const OnigCodePoint CR_Alnum[] = {
0xa8d0, 0xa8d9,
0xa8f2, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa900, 0xa92a,
0xa930, 0xa952,
0xa960, 0xa97c,
0xa980, 0xa9b2,
0xa9b4, 0xa9bf,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
+ 0xaa7e, 0xaabe,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
@@ -4139,7 +4522,9 @@ static const OnigCodePoint CR_Alnum[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabea,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabea,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -4179,20 +4564,30 @@ static const OnigCodePoint CR_Alnum[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -4203,10 +4598,16 @@ static const OnigCodePoint CR_Alnum[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11000, 0x11045,
0x11066, 0x1106f,
0x11082, 0x110b8,
@@ -4214,19 +4615,77 @@ static const OnigCodePoint CR_Alnum[] = {
0x110f0, 0x110f9,
0x11100, 0x11132,
0x11136, 0x1113f,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11180, 0x111bf,
0x111c1, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111d0, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x11234,
+ 0x11237, 0x11237,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112e8,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134c,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11480, 0x114c1,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115be,
+ 0x115d8, 0x115dd,
+ 0x11600, 0x1163e,
+ 0x11640, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b5,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172a,
+ 0x11730, 0x11739,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9e, 0x1bc9e,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -4258,6 +4717,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -4291,9 +4751,13 @@ static const OnigCodePoint CR_Alnum[] = {
0x1eea1, 0x1eea3,
0x1eea5, 0x1eea9,
0x1eeab, 0x1eebb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_Alnum */
@@ -4312,23 +4776,22 @@ static const OnigCodePoint CR_Any[] = {
/* 'Assigned': - */
static const OnigCodePoint CR_Assigned[] = {
- 539,
+ 613,
0x0000, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
- 0x03a3, 0x0527,
+ 0x03a3, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0604,
- 0x0606, 0x061b,
+ 0x0600, 0x061c,
0x061e, 0x070d,
0x070f, 0x074a,
0x074d, 0x07b1,
@@ -4337,12 +4800,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -4385,6 +4844,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0af1,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -4415,21 +4875,20 @@ static const OnigCodePoint CR_Assigned[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -4443,7 +4902,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -4451,7 +4910,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d75,
0x0d79, 0x0d7f,
0x0d82, 0x0d83,
@@ -4464,6 +4923,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e3a,
0x0e3f, 0x0e5b,
@@ -4512,9 +4972,10 @@ static const OnigCodePoint CR_Assigned[] = {
0x1318, 0x135a,
0x135d, 0x137c,
0x1380, 0x1399,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1400, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1736,
@@ -4530,7 +4991,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -4545,6 +5006,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa0, 0x1aad,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
0x1b80, 0x1bf3,
@@ -4553,7 +5015,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x1c4d, 0x1c7f,
0x1cc0, 0x1cc7,
0x1cd0, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -4571,18 +5034,21 @@ static const OnigCodePoint CR_Assigned[] = {
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
0x2000, 0x2064,
- 0x206a, 0x2071,
+ 0x2066, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20be,
0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x2100, 0x218b,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cf3,
@@ -4600,7 +5066,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
+ 0x2de0, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -4615,38 +5081,36 @@ static const OnigCodePoint CR_Assigned[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
+ 0x4dc0, 0x9fd5,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa697,
- 0xa69f, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
+ 0xa640, 0xa6f7,
+ 0xa700, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
+ 0xa8e0, 0xa8fd,
0xa900, 0xa953,
0xa95f, 0xa97c,
0xa980, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa5c, 0xaac2,
0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabed,
+ 0xab30, 0xab65,
+ 0xab70, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -4666,8 +5130,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfd,
0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
+ 0xfe20, 0xfe52,
0xfe54, 0xfe66,
0xfe68, 0xfe6b,
0xfe70, 0xfe74,
@@ -4690,32 +5153,43 @@ static const OnigCodePoint CR_Assigned[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
+ 0x108fb, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
0x10980, 0x109b7,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
+ 0x109bc, 0x109cf,
+ 0x109d2, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
0x10a15, 0x10a17,
@@ -4723,36 +5197,98 @@ static const OnigCodePoint CR_Assigned[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x10cfa, 0x10cff,
0x10e60, 0x10e7e,
0x11000, 0x1104d,
0x11052, 0x1106f,
- 0x11080, 0x110c1,
+ 0x1107f, 0x110c1,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x11143,
- 0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x11150, 0x11176,
+ 0x11180, 0x111cd,
+ 0x111d0, 0x111df,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a9,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115dd,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x1173f,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
+ 0x1d129, 0x1d1e8,
0x1d200, 0x1d245,
0x1d300, 0x1d356,
0x1d360, 0x1d371,
@@ -4776,7 +5312,11 @@ static const OnigCodePoint CR_Assigned[] = {
0x1d54a, 0x1d550,
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
+ 0x1d7ce, 0x1da8b,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -4814,10 +5354,10 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -4825,27 +5365,25 @@ static const OnigCodePoint CR_Assigned[] = {
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,
+ 0x1f300, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
@@ -4856,20 +5394,20 @@ static const OnigCodePoint CR_Assigned[] = {
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
- 541,
+ 616,
0x0000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
0x0378, 0x0379,
- 0x037f, 0x0383,
+ 0x0380, 0x0383,
0x038b, 0x038b,
0x038d, 0x038d,
0x03a2, 0x03a2,
- 0x0528, 0x0530,
+ 0x0530, 0x0530,
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x058e,
+ 0x058b, 0x058c,
0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
@@ -4884,11 +5422,7 @@ static const OnigCodePoint CR_C[] = {
0x083f, 0x083f,
0x085c, 0x085d,
0x085f, 0x089f,
- 0x08a1, 0x08a1,
- 0x08ad, 0x08e3,
- 0x08ff, 0x08ff,
- 0x0978, 0x0978,
- 0x0980, 0x0980,
+ 0x08b5, 0x08e2,
0x0984, 0x0984,
0x098d, 0x098e,
0x0991, 0x0992,
@@ -4931,7 +5465,8 @@ static const OnigCodePoint CR_C[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af2, 0x0b00,
+ 0x0af2, 0x0af8,
+ 0x0afa, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
0x0b11, 0x0b12,
@@ -4961,21 +5496,20 @@ static const OnigCodePoint CR_C[] = {
0x0bce, 0x0bcf,
0x0bd1, 0x0bd6,
0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
+ 0x0bfb, 0x0bff,
0x0c04, 0x0c04,
0x0c0d, 0x0c0d,
0x0c11, 0x0c11,
0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
0x0c3a, 0x0c3c,
0x0c45, 0x0c45,
0x0c49, 0x0c49,
0x0c4e, 0x0c54,
0x0c57, 0x0c57,
- 0x0c5a, 0x0c5f,
+ 0x0c5b, 0x0c5f,
0x0c64, 0x0c65,
0x0c70, 0x0c77,
- 0x0c80, 0x0c81,
+ 0x0c80, 0x0c80,
0x0c84, 0x0c84,
0x0c8d, 0x0c8d,
0x0c91, 0x0c91,
@@ -4989,7 +5523,7 @@ static const OnigCodePoint CR_C[] = {
0x0cdf, 0x0cdf,
0x0ce4, 0x0ce5,
0x0cf0, 0x0cf0,
- 0x0cf3, 0x0d01,
+ 0x0cf3, 0x0d00,
0x0d04, 0x0d04,
0x0d0d, 0x0d0d,
0x0d11, 0x0d11,
@@ -4997,7 +5531,7 @@ static const OnigCodePoint CR_C[] = {
0x0d45, 0x0d45,
0x0d49, 0x0d49,
0x0d4f, 0x0d56,
- 0x0d58, 0x0d5f,
+ 0x0d58, 0x0d5e,
0x0d64, 0x0d65,
0x0d76, 0x0d78,
0x0d80, 0x0d81,
@@ -5010,7 +5544,8 @@ static const OnigCodePoint CR_C[] = {
0x0dcb, 0x0dce,
0x0dd5, 0x0dd5,
0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
+ 0x0de0, 0x0de5,
+ 0x0df0, 0x0df1,
0x0df5, 0x0e00,
0x0e3b, 0x0e3e,
0x0e5c, 0x0e80,
@@ -5059,9 +5594,10 @@ static const OnigCodePoint CR_C[] = {
0x135b, 0x135c,
0x137d, 0x137f,
0x139a, 0x139f,
- 0x13f5, 0x13ff,
+ 0x13f6, 0x13f7,
+ 0x13fe, 0x13ff,
0x169d, 0x169f,
- 0x16f1, 0x16ff,
+ 0x16f9, 0x16ff,
0x170d, 0x170d,
0x1715, 0x171f,
0x1737, 0x173f,
@@ -5072,12 +5608,12 @@ static const OnigCodePoint CR_C[] = {
0x17de, 0x17df,
0x17ea, 0x17ef,
0x17fa, 0x17ff,
- 0x180f, 0x180f,
+ 0x180e, 0x180f,
0x181a, 0x181f,
0x1878, 0x187f,
0x18ab, 0x18af,
0x18f6, 0x18ff,
- 0x191d, 0x191f,
+ 0x191f, 0x191f,
0x192c, 0x192f,
0x193c, 0x193f,
0x1941, 0x1943,
@@ -5091,7 +5627,8 @@ static const OnigCodePoint CR_C[] = {
0x1a7d, 0x1a7e,
0x1a8a, 0x1a8f,
0x1a9a, 0x1a9f,
- 0x1aae, 0x1aff,
+ 0x1aae, 0x1aaf,
+ 0x1abf, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
0x1bf4, 0x1bfb,
@@ -5099,8 +5636,9 @@ static const OnigCodePoint CR_C[] = {
0x1c4a, 0x1c4c,
0x1c80, 0x1cbf,
0x1cc8, 0x1ccf,
- 0x1cf7, 0x1cff,
- 0x1de7, 0x1dfb,
+ 0x1cf7, 0x1cf7,
+ 0x1cfa, 0x1cff,
+ 0x1df6, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
0x1f46, 0x1f47,
@@ -5123,15 +5661,18 @@ static const OnigCodePoint CR_C[] = {
0x2072, 0x2073,
0x208f, 0x208f,
0x209d, 0x209f,
- 0x20ba, 0x20cf,
+ 0x20bf, 0x20cf,
0x20f1, 0x20ff,
- 0x218a, 0x218f,
- 0x23f4, 0x23ff,
+ 0x218c, 0x218f,
+ 0x23fb, 0x23ff,
0x2427, 0x243f,
0x244b, 0x245f,
- 0x2700, 0x2700,
- 0x2b4d, 0x2b4f,
- 0x2b5a, 0x2bff,
+ 0x2b74, 0x2b75,
+ 0x2b96, 0x2b97,
+ 0x2bba, 0x2bbc,
+ 0x2bc9, 0x2bc9,
+ 0x2bd2, 0x2beb,
+ 0x2bf0, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
0x2cf4, 0x2cf8,
@@ -5149,7 +5690,7 @@ static const OnigCodePoint CR_C[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e3c, 0x2e7f,
+ 0x2e43, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -5164,37 +5705,35 @@ static const OnigCodePoint CR_C[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcd, 0x9fff,
+ 0x9fd6, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
- 0xa78f, 0xa78f,
- 0xa794, 0xa79f,
- 0xa7ab, 0xa7f7,
+ 0xa7ae, 0xa7af,
+ 0xa7b8, 0xa7f6,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
0xa8c5, 0xa8cd,
0xa8da, 0xa8df,
- 0xa8fc, 0xa8ff,
+ 0xa8fe, 0xa8ff,
0xa954, 0xa95e,
0xa97d, 0xa97f,
0xa9ce, 0xa9ce,
0xa9da, 0xa9dd,
- 0xa9e0, 0xa9ff,
+ 0xa9ff, 0xa9ff,
0xaa37, 0xaa3f,
0xaa4e, 0xaa4f,
0xaa5a, 0xaa5b,
- 0xaa7c, 0xaa7f,
0xaac3, 0xaada,
0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
0xab27, 0xab27,
- 0xab2f, 0xabbf,
+ 0xab2f, 0xab2f,
+ 0xab66, 0xab6f,
0xabee, 0xabef,
0xabfa, 0xabff,
0xd7a4, 0xd7af,
@@ -5215,7 +5754,6 @@ static const OnigCodePoint CR_C[] = {
0xfdc8, 0xfdef,
0xfdfe, 0xfdff,
0xfe1a, 0xfe1f,
- 0xfe27, 0xfe2f,
0xfe53, 0xfe53,
0xfe67, 0xfe67,
0xfe6c, 0xfe6f,
@@ -5238,31 +5776,42 @@ static const OnigCodePoint CR_C[] = {
0x100fb, 0x100ff,
0x10103, 0x10106,
0x10134, 0x10136,
- 0x1018b, 0x1018f,
- 0x1019c, 0x101cf,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
0x101fe, 0x1027f,
0x1029d, 0x1029f,
- 0x102d1, 0x102ff,
- 0x1031f, 0x1031f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
0x10324, 0x1032f,
- 0x1034b, 0x1037f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
0x1039e, 0x1039e,
0x103c4, 0x103c7,
0x103d6, 0x103ff,
0x1049e, 0x1049f,
- 0x104aa, 0x107ff,
+ 0x104aa, 0x104ff,
+ 0x10528, 0x1052f,
+ 0x10564, 0x1056e,
+ 0x10570, 0x105ff,
+ 0x10737, 0x1073f,
+ 0x10756, 0x1075f,
+ 0x10768, 0x107ff,
0x10806, 0x10807,
0x10809, 0x10809,
0x10836, 0x10836,
0x10839, 0x1083b,
0x1083d, 0x1083e,
0x10856, 0x10856,
- 0x10860, 0x108ff,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108df,
+ 0x108f3, 0x108f3,
+ 0x108f6, 0x108fa,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
0x10940, 0x1097f,
- 0x109b8, 0x109bd,
- 0x109c0, 0x109ff,
+ 0x109b8, 0x109bb,
+ 0x109d0, 0x109d1,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -5271,38 +5820,100 @@ static const OnigCodePoint CR_C[] = {
0x10a3b, 0x10a3e,
0x10a48, 0x10a4f,
0x10a59, 0x10a5f,
- 0x10a80, 0x10aff,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
0x10b36, 0x10b38,
0x10b56, 0x10b57,
0x10b73, 0x10b77,
- 0x10b80, 0x10bff,
- 0x10c49, 0x10e5f,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
+ 0x10c49, 0x10c7f,
+ 0x10cb3, 0x10cbf,
+ 0x10cf3, 0x10cf9,
+ 0x10d00, 0x10e5f,
0x10e7f, 0x10fff,
0x1104e, 0x11051,
- 0x11070, 0x1107f,
+ 0x11070, 0x1107e,
0x110bd, 0x110bd,
0x110c2, 0x110cf,
0x110e9, 0x110ef,
0x110fa, 0x110ff,
0x11135, 0x11135,
- 0x11144, 0x1117f,
- 0x111c9, 0x111cf,
- 0x111da, 0x1167f,
+ 0x11144, 0x1114f,
+ 0x11177, 0x1117f,
+ 0x111ce, 0x111cf,
+ 0x111e0, 0x111e0,
+ 0x111f5, 0x111ff,
+ 0x11212, 0x11212,
+ 0x1123e, 0x1127f,
+ 0x11287, 0x11287,
+ 0x11289, 0x11289,
+ 0x1128e, 0x1128e,
+ 0x1129e, 0x1129e,
+ 0x112aa, 0x112af,
+ 0x112eb, 0x112ef,
+ 0x112fa, 0x112ff,
+ 0x11304, 0x11304,
+ 0x1130d, 0x1130e,
+ 0x11311, 0x11312,
+ 0x11329, 0x11329,
+ 0x11331, 0x11331,
+ 0x11334, 0x11334,
+ 0x1133a, 0x1133b,
+ 0x11345, 0x11346,
+ 0x11349, 0x1134a,
+ 0x1134e, 0x1134f,
+ 0x11351, 0x11356,
+ 0x11358, 0x1135c,
+ 0x11364, 0x11365,
+ 0x1136d, 0x1136f,
+ 0x11375, 0x1147f,
+ 0x114c8, 0x114cf,
+ 0x114da, 0x1157f,
+ 0x115b6, 0x115b7,
+ 0x115de, 0x115ff,
+ 0x11645, 0x1164f,
+ 0x1165a, 0x1167f,
0x116b8, 0x116bf,
- 0x116ca, 0x11fff,
- 0x1236f, 0x123ff,
- 0x12463, 0x1246f,
- 0x12474, 0x12fff,
- 0x1342f, 0x167ff,
- 0x16a39, 0x16eff,
+ 0x116ca, 0x116ff,
+ 0x1171a, 0x1171c,
+ 0x1172c, 0x1172f,
+ 0x11740, 0x1189f,
+ 0x118f3, 0x118fe,
+ 0x11900, 0x11abf,
+ 0x11af9, 0x11fff,
+ 0x1239a, 0x123ff,
+ 0x1246f, 0x1246f,
+ 0x12475, 0x1247f,
+ 0x12544, 0x12fff,
+ 0x1342f, 0x143ff,
+ 0x14647, 0x167ff,
+ 0x16a39, 0x16a3f,
+ 0x16a5f, 0x16a5f,
+ 0x16a6a, 0x16a6d,
+ 0x16a70, 0x16acf,
+ 0x16aee, 0x16aef,
+ 0x16af6, 0x16aff,
+ 0x16b46, 0x16b4f,
+ 0x16b5a, 0x16b5a,
+ 0x16b62, 0x16b62,
+ 0x16b78, 0x16b7c,
+ 0x16b90, 0x16eff,
0x16f45, 0x16f4f,
0x16f7f, 0x16f8e,
0x16fa0, 0x1afff,
- 0x1b002, 0x1cfff,
+ 0x1b002, 0x1bbff,
+ 0x1bc6b, 0x1bc6f,
+ 0x1bc7d, 0x1bc7f,
+ 0x1bc89, 0x1bc8f,
+ 0x1bc9a, 0x1bc9b,
+ 0x1bca0, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
0x1d173, 0x1d17a,
- 0x1d1de, 0x1d1ff,
+ 0x1d1e9, 0x1d1ff,
0x1d246, 0x1d2ff,
0x1d357, 0x1d35f,
0x1d372, 0x1d3ff,
@@ -5326,7 +5937,11 @@ static const OnigCodePoint CR_C[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1edff,
+ 0x1da8c, 0x1da9a,
+ 0x1daa0, 0x1daa0,
+ 0x1dab0, 0x1e7ff,
+ 0x1e8c5, 0x1e8c6,
+ 0x1e8d7, 0x1edff,
0x1ee04, 0x1ee04,
0x1ee20, 0x1ee20,
0x1ee23, 0x1ee23,
@@ -5364,10 +5979,10 @@ static const OnigCodePoint CR_C[] = {
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
- 0x1f0bf, 0x1f0c0,
+ 0x1f0c0, 0x1f0c0,
0x1f0d0, 0x1f0d0,
- 0x1f0e0, 0x1f0ff,
- 0x1f10b, 0x1f10f,
+ 0x1f0f6, 0x1f0ff,
+ 0x1f10d, 0x1f10f,
0x1f12f, 0x1f12f,
0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
@@ -5375,27 +5990,25 @@ static const OnigCodePoint CR_C[] = {
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,
+ 0x1f57a, 0x1f57a,
+ 0x1f5a4, 0x1f5a4,
+ 0x1f6d1, 0x1f6df,
+ 0x1f6ed, 0x1f6ef,
+ 0x1f6f4, 0x1f6ff,
+ 0x1f774, 0x1f77f,
+ 0x1f7d5, 0x1f7ff,
+ 0x1f80c, 0x1f80f,
+ 0x1f848, 0x1f84f,
+ 0x1f85a, 0x1f85f,
+ 0x1f888, 0x1f88f,
+ 0x1f8ae, 0x1f90f,
+ 0x1f919, 0x1f97f,
+ 0x1f985, 0x1f9bf,
+ 0x1f9c1, 0x1ffff,
0x2a6d7, 0x2a6ff,
0x2b735, 0x2b73f,
- 0x2b81e, 0x2f7ff,
+ 0x2b81e, 0x2b81f,
+ 0x2cea2, 0x2f7ff,
0x2fa1e, 0xe00ff,
0xe01f0, 0x10ffff,
}; /* CR_C */
@@ -5405,18 +6018,21 @@ static const OnigCodePoint CR_C[] = {
/* 'Cf': General Category */
static const OnigCodePoint CR_Cf[] = {
- 14,
+ 17,
0x00ad, 0x00ad,
- 0x0600, 0x0604,
+ 0x0600, 0x0605,
+ 0x061c, 0x061c,
0x06dd, 0x06dd,
0x070f, 0x070f,
+ 0x180e, 0x180e,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x2064,
- 0x206a, 0x206f,
+ 0x2066, 0x206f,
0xfeff, 0xfeff,
0xfff9, 0xfffb,
0x110bd, 0x110bd,
+ 0x1bca0, 0x1bca3,
0x1d173, 0x1d17a,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
@@ -5424,23 +6040,22 @@ static const OnigCodePoint CR_Cf[] = {
/* 'Cn': General Category */
static const OnigCodePoint CR_Cn[] = {
- 539,
+ 613,
0x0378, 0x0379,
- 0x037f, 0x0383,
+ 0x0380, 0x0383,
0x038b, 0x038b,
0x038d, 0x038d,
0x03a2, 0x03a2,
- 0x0528, 0x0530,
+ 0x0530, 0x0530,
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x058e,
+ 0x058b, 0x058c,
0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0605, 0x0605,
- 0x061c, 0x061d,
+ 0x061d, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
0x07b2, 0x07bf,
@@ -5449,11 +6064,7 @@ static const OnigCodePoint CR_Cn[] = {
0x083f, 0x083f,
0x085c, 0x085d,
0x085f, 0x089f,
- 0x08a1, 0x08a1,
- 0x08ad, 0x08e3,
- 0x08ff, 0x08ff,
- 0x0978, 0x0978,
- 0x0980, 0x0980,
+ 0x08b5, 0x08e2,
0x0984, 0x0984,
0x098d, 0x098e,
0x0991, 0x0992,
@@ -5496,7 +6107,8 @@ static const OnigCodePoint CR_Cn[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af2, 0x0b00,
+ 0x0af2, 0x0af8,
+ 0x0afa, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
0x0b11, 0x0b12,
@@ -5526,21 +6138,20 @@ static const OnigCodePoint CR_Cn[] = {
0x0bce, 0x0bcf,
0x0bd1, 0x0bd6,
0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
+ 0x0bfb, 0x0bff,
0x0c04, 0x0c04,
0x0c0d, 0x0c0d,
0x0c11, 0x0c11,
0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
0x0c3a, 0x0c3c,
0x0c45, 0x0c45,
0x0c49, 0x0c49,
0x0c4e, 0x0c54,
0x0c57, 0x0c57,
- 0x0c5a, 0x0c5f,
+ 0x0c5b, 0x0c5f,
0x0c64, 0x0c65,
0x0c70, 0x0c77,
- 0x0c80, 0x0c81,
+ 0x0c80, 0x0c80,
0x0c84, 0x0c84,
0x0c8d, 0x0c8d,
0x0c91, 0x0c91,
@@ -5554,7 +6165,7 @@ static const OnigCodePoint CR_Cn[] = {
0x0cdf, 0x0cdf,
0x0ce4, 0x0ce5,
0x0cf0, 0x0cf0,
- 0x0cf3, 0x0d01,
+ 0x0cf3, 0x0d00,
0x0d04, 0x0d04,
0x0d0d, 0x0d0d,
0x0d11, 0x0d11,
@@ -5562,7 +6173,7 @@ static const OnigCodePoint CR_Cn[] = {
0x0d45, 0x0d45,
0x0d49, 0x0d49,
0x0d4f, 0x0d56,
- 0x0d58, 0x0d5f,
+ 0x0d58, 0x0d5e,
0x0d64, 0x0d65,
0x0d76, 0x0d78,
0x0d80, 0x0d81,
@@ -5575,7 +6186,8 @@ static const OnigCodePoint CR_Cn[] = {
0x0dcb, 0x0dce,
0x0dd5, 0x0dd5,
0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
+ 0x0de0, 0x0de5,
+ 0x0df0, 0x0df1,
0x0df5, 0x0e00,
0x0e3b, 0x0e3e,
0x0e5c, 0x0e80,
@@ -5624,9 +6236,10 @@ static const OnigCodePoint CR_Cn[] = {
0x135b, 0x135c,
0x137d, 0x137f,
0x139a, 0x139f,
- 0x13f5, 0x13ff,
+ 0x13f6, 0x13f7,
+ 0x13fe, 0x13ff,
0x169d, 0x169f,
- 0x16f1, 0x16ff,
+ 0x16f9, 0x16ff,
0x170d, 0x170d,
0x1715, 0x171f,
0x1737, 0x173f,
@@ -5642,7 +6255,7 @@ static const OnigCodePoint CR_Cn[] = {
0x1878, 0x187f,
0x18ab, 0x18af,
0x18f6, 0x18ff,
- 0x191d, 0x191f,
+ 0x191f, 0x191f,
0x192c, 0x192f,
0x193c, 0x193f,
0x1941, 0x1943,
@@ -5656,7 +6269,8 @@ static const OnigCodePoint CR_Cn[] = {
0x1a7d, 0x1a7e,
0x1a8a, 0x1a8f,
0x1a9a, 0x1a9f,
- 0x1aae, 0x1aff,
+ 0x1aae, 0x1aaf,
+ 0x1abf, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
0x1bf4, 0x1bfb,
@@ -5664,8 +6278,9 @@ static const OnigCodePoint CR_Cn[] = {
0x1c4a, 0x1c4c,
0x1c80, 0x1cbf,
0x1cc8, 0x1ccf,
- 0x1cf7, 0x1cff,
- 0x1de7, 0x1dfb,
+ 0x1cf7, 0x1cf7,
+ 0x1cfa, 0x1cff,
+ 0x1df6, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
0x1f46, 0x1f47,
@@ -5682,19 +6297,22 @@ static const OnigCodePoint CR_Cn[] = {
0x1ff0, 0x1ff1,
0x1ff5, 0x1ff5,
0x1fff, 0x1fff,
- 0x2065, 0x2069,
+ 0x2065, 0x2065,
0x2072, 0x2073,
0x208f, 0x208f,
0x209d, 0x209f,
- 0x20ba, 0x20cf,
+ 0x20bf, 0x20cf,
0x20f1, 0x20ff,
- 0x218a, 0x218f,
- 0x23f4, 0x23ff,
+ 0x218c, 0x218f,
+ 0x23fb, 0x23ff,
0x2427, 0x243f,
0x244b, 0x245f,
- 0x2700, 0x2700,
- 0x2b4d, 0x2b4f,
- 0x2b5a, 0x2bff,
+ 0x2b74, 0x2b75,
+ 0x2b96, 0x2b97,
+ 0x2bba, 0x2bbc,
+ 0x2bc9, 0x2bc9,
+ 0x2bd2, 0x2beb,
+ 0x2bf0, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
0x2cf4, 0x2cf8,
@@ -5712,7 +6330,7 @@ static const OnigCodePoint CR_Cn[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e3c, 0x2e7f,
+ 0x2e43, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -5727,37 +6345,35 @@ static const OnigCodePoint CR_Cn[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcd, 0x9fff,
+ 0x9fd6, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
- 0xa78f, 0xa78f,
- 0xa794, 0xa79f,
- 0xa7ab, 0xa7f7,
+ 0xa7ae, 0xa7af,
+ 0xa7b8, 0xa7f6,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
0xa8c5, 0xa8cd,
0xa8da, 0xa8df,
- 0xa8fc, 0xa8ff,
+ 0xa8fe, 0xa8ff,
0xa954, 0xa95e,
0xa97d, 0xa97f,
0xa9ce, 0xa9ce,
0xa9da, 0xa9dd,
- 0xa9e0, 0xa9ff,
+ 0xa9ff, 0xa9ff,
0xaa37, 0xaa3f,
0xaa4e, 0xaa4f,
0xaa5a, 0xaa5b,
- 0xaa7c, 0xaa7f,
0xaac3, 0xaada,
0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
0xab27, 0xab27,
- 0xab2f, 0xabbf,
+ 0xab2f, 0xab2f,
+ 0xab66, 0xab6f,
0xabee, 0xabef,
0xabfa, 0xabff,
0xd7a4, 0xd7af,
@@ -5778,7 +6394,6 @@ static const OnigCodePoint CR_Cn[] = {
0xfdc8, 0xfdef,
0xfdfe, 0xfdff,
0xfe1a, 0xfe1f,
- 0xfe27, 0xfe2f,
0xfe53, 0xfe53,
0xfe67, 0xfe67,
0xfe6c, 0xfe6f,
@@ -5802,31 +6417,42 @@ static const OnigCodePoint CR_Cn[] = {
0x100fb, 0x100ff,
0x10103, 0x10106,
0x10134, 0x10136,
- 0x1018b, 0x1018f,
- 0x1019c, 0x101cf,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
0x101fe, 0x1027f,
0x1029d, 0x1029f,
- 0x102d1, 0x102ff,
- 0x1031f, 0x1031f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
0x10324, 0x1032f,
- 0x1034b, 0x1037f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
0x1039e, 0x1039e,
0x103c4, 0x103c7,
0x103d6, 0x103ff,
0x1049e, 0x1049f,
- 0x104aa, 0x107ff,
+ 0x104aa, 0x104ff,
+ 0x10528, 0x1052f,
+ 0x10564, 0x1056e,
+ 0x10570, 0x105ff,
+ 0x10737, 0x1073f,
+ 0x10756, 0x1075f,
+ 0x10768, 0x107ff,
0x10806, 0x10807,
0x10809, 0x10809,
0x10836, 0x10836,
0x10839, 0x1083b,
0x1083d, 0x1083e,
0x10856, 0x10856,
- 0x10860, 0x108ff,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108df,
+ 0x108f3, 0x108f3,
+ 0x108f6, 0x108fa,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
0x10940, 0x1097f,
- 0x109b8, 0x109bd,
- 0x109c0, 0x109ff,
+ 0x109b8, 0x109bb,
+ 0x109d0, 0x109d1,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -5835,36 +6461,98 @@ static const OnigCodePoint CR_Cn[] = {
0x10a3b, 0x10a3e,
0x10a48, 0x10a4f,
0x10a59, 0x10a5f,
- 0x10a80, 0x10aff,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
0x10b36, 0x10b38,
0x10b56, 0x10b57,
0x10b73, 0x10b77,
- 0x10b80, 0x10bff,
- 0x10c49, 0x10e5f,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
+ 0x10c49, 0x10c7f,
+ 0x10cb3, 0x10cbf,
+ 0x10cf3, 0x10cf9,
+ 0x10d00, 0x10e5f,
0x10e7f, 0x10fff,
0x1104e, 0x11051,
- 0x11070, 0x1107f,
+ 0x11070, 0x1107e,
0x110c2, 0x110cf,
0x110e9, 0x110ef,
0x110fa, 0x110ff,
0x11135, 0x11135,
- 0x11144, 0x1117f,
- 0x111c9, 0x111cf,
- 0x111da, 0x1167f,
+ 0x11144, 0x1114f,
+ 0x11177, 0x1117f,
+ 0x111ce, 0x111cf,
+ 0x111e0, 0x111e0,
+ 0x111f5, 0x111ff,
+ 0x11212, 0x11212,
+ 0x1123e, 0x1127f,
+ 0x11287, 0x11287,
+ 0x11289, 0x11289,
+ 0x1128e, 0x1128e,
+ 0x1129e, 0x1129e,
+ 0x112aa, 0x112af,
+ 0x112eb, 0x112ef,
+ 0x112fa, 0x112ff,
+ 0x11304, 0x11304,
+ 0x1130d, 0x1130e,
+ 0x11311, 0x11312,
+ 0x11329, 0x11329,
+ 0x11331, 0x11331,
+ 0x11334, 0x11334,
+ 0x1133a, 0x1133b,
+ 0x11345, 0x11346,
+ 0x11349, 0x1134a,
+ 0x1134e, 0x1134f,
+ 0x11351, 0x11356,
+ 0x11358, 0x1135c,
+ 0x11364, 0x11365,
+ 0x1136d, 0x1136f,
+ 0x11375, 0x1147f,
+ 0x114c8, 0x114cf,
+ 0x114da, 0x1157f,
+ 0x115b6, 0x115b7,
+ 0x115de, 0x115ff,
+ 0x11645, 0x1164f,
+ 0x1165a, 0x1167f,
0x116b8, 0x116bf,
- 0x116ca, 0x11fff,
- 0x1236f, 0x123ff,
- 0x12463, 0x1246f,
- 0x12474, 0x12fff,
- 0x1342f, 0x167ff,
- 0x16a39, 0x16eff,
+ 0x116ca, 0x116ff,
+ 0x1171a, 0x1171c,
+ 0x1172c, 0x1172f,
+ 0x11740, 0x1189f,
+ 0x118f3, 0x118fe,
+ 0x11900, 0x11abf,
+ 0x11af9, 0x11fff,
+ 0x1239a, 0x123ff,
+ 0x1246f, 0x1246f,
+ 0x12475, 0x1247f,
+ 0x12544, 0x12fff,
+ 0x1342f, 0x143ff,
+ 0x14647, 0x167ff,
+ 0x16a39, 0x16a3f,
+ 0x16a5f, 0x16a5f,
+ 0x16a6a, 0x16a6d,
+ 0x16a70, 0x16acf,
+ 0x16aee, 0x16aef,
+ 0x16af6, 0x16aff,
+ 0x16b46, 0x16b4f,
+ 0x16b5a, 0x16b5a,
+ 0x16b62, 0x16b62,
+ 0x16b78, 0x16b7c,
+ 0x16b90, 0x16eff,
0x16f45, 0x16f4f,
0x16f7f, 0x16f8e,
0x16fa0, 0x1afff,
- 0x1b002, 0x1cfff,
+ 0x1b002, 0x1bbff,
+ 0x1bc6b, 0x1bc6f,
+ 0x1bc7d, 0x1bc7f,
+ 0x1bc89, 0x1bc8f,
+ 0x1bc9a, 0x1bc9b,
+ 0x1bca4, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
- 0x1d1de, 0x1d1ff,
+ 0x1d1e9, 0x1d1ff,
0x1d246, 0x1d2ff,
0x1d357, 0x1d35f,
0x1d372, 0x1d3ff,
@@ -5888,7 +6576,11 @@ static const OnigCodePoint CR_Cn[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1edff,
+ 0x1da8c, 0x1da9a,
+ 0x1daa0, 0x1daa0,
+ 0x1dab0, 0x1e7ff,
+ 0x1e8c5, 0x1e8c6,
+ 0x1e8d7, 0x1edff,
0x1ee04, 0x1ee04,
0x1ee20, 0x1ee20,
0x1ee23, 0x1ee23,
@@ -5926,10 +6618,10 @@ static const OnigCodePoint CR_Cn[] = {
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
- 0x1f0bf, 0x1f0c0,
+ 0x1f0c0, 0x1f0c0,
0x1f0d0, 0x1f0d0,
- 0x1f0e0, 0x1f0ff,
- 0x1f10b, 0x1f10f,
+ 0x1f0f6, 0x1f0ff,
+ 0x1f10d, 0x1f10f,
0x1f12f, 0x1f12f,
0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
@@ -5937,27 +6629,25 @@ static const OnigCodePoint CR_Cn[] = {
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,
+ 0x1f57a, 0x1f57a,
+ 0x1f5a4, 0x1f5a4,
+ 0x1f6d1, 0x1f6df,
+ 0x1f6ed, 0x1f6ef,
+ 0x1f6f4, 0x1f6ff,
+ 0x1f774, 0x1f77f,
+ 0x1f7d5, 0x1f7ff,
+ 0x1f80c, 0x1f80f,
+ 0x1f848, 0x1f84f,
+ 0x1f85a, 0x1f85f,
+ 0x1f888, 0x1f88f,
+ 0x1f8ae, 0x1f90f,
+ 0x1f919, 0x1f97f,
+ 0x1f985, 0x1f9bf,
+ 0x1f9c1, 0x1ffff,
0x2a6d7, 0x2a6ff,
0x2b735, 0x2b73f,
- 0x2b81e, 0x2f7ff,
+ 0x2b81e, 0x2b81f,
+ 0x2cea2, 0x2f7ff,
0x2fa1e, 0xe0000,
0xe0002, 0xe001f,
0xe0080, 0xe00ff,
@@ -5982,7 +6672,7 @@ static const OnigCodePoint CR_Cs[] = {
/* 'L': Major Category */
static const OnigCodePoint CR_L[] = {
- 486,
+ 554,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -5998,13 +6688,14 @@ static const OnigCodePoint CR_L[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -6030,14 +6721,12 @@ static const OnigCodePoint CR_L[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b4,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
+ 0x0971, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -6068,6 +6757,7 @@ static const OnigCodePoint CR_L[] = {
0x0abd, 0x0abd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
+ 0x0af9, 0x0af9,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
0x0b13, 0x0b28,
@@ -6092,10 +6782,9 @@ static const OnigCodePoint CR_L[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c61,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
@@ -6111,7 +6800,7 @@ static const OnigCodePoint CR_L[] = {
0x0d12, 0x0d3a,
0x0d3d, 0x0d3d,
0x0d4e, 0x0d4e,
- 0x0d60, 0x0d61,
+ 0x0d5f, 0x0d61,
0x0d7a, 0x0d7f,
0x0d85, 0x0d96,
0x0d9a, 0x0db1,
@@ -6172,11 +6861,13 @@ static const OnigCodePoint CR_L[] = {
0x1312, 0x1315,
0x1318, 0x135a,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
+ 0x16f1, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -6190,11 +6881,11 @@ static const OnigCodePoint CR_L[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
- 0x19c1, 0x19c7,
+ 0x19b0, 0x19c9,
0x1a00, 0x1a16,
0x1a20, 0x1a54,
0x1aa7, 0x1aa7,
@@ -6278,21 +6969,20 @@ static const OnigCodePoint CR_L[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa61f,
0xa62a, 0xa62b,
0xa640, 0xa66e,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa6a0, 0xa6e5,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -6300,17 +6990,21 @@ static const OnigCodePoint CR_L[] = {
0xa882, 0xa8b3,
0xa8f2, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa90a, 0xa925,
0xa930, 0xa946,
0xa960, 0xa97c,
0xa984, 0xa9b2,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -6324,7 +7018,9 @@ static const OnigCodePoint CR_L[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabe2,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabe2,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
@@ -6362,19 +7058,29 @@ static const OnigCodePoint CR_L[] = {
0x10080, 0x100fa,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x10340,
0x10342, 0x10349,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -6384,24 +7090,74 @@ static const OnigCodePoint CR_L[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x11350, 0x11350,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x115d8, 0x115db,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
+ 0x11700, 0x11719,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -6432,6 +7188,7 @@ static const OnigCodePoint CR_L[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -6468,12 +7225,13 @@ static const OnigCodePoint CR_L[] = {
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_L */
/* 'LC': General Category */
static const OnigCodePoint CR_LC[] = {
- 113,
+ 122,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -6486,18 +7244,21 @@ static const OnigCodePoint CR_LC[] = {
0x0370, 0x0373,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
0x10cd, 0x10cd,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1d00, 0x1d2b,
0x1d6b, 0x1d77,
0x1d79, 0x1d9a,
@@ -6545,18 +7306,24 @@ static const OnigCodePoint CR_LC[] = {
0x2d27, 0x2d27,
0x2d2d, 0x2d2d,
0xa640, 0xa66d,
- 0xa680, 0xa697,
+ 0xa680, 0xa69b,
0xa722, 0xa76f,
0xa771, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b7,
0xa7fa, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab60, 0xab65,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0xff41, 0xff5a,
0x10400, 0x1044f,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x118a0, 0x118df,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -6591,7 +7358,7 @@ static const OnigCodePoint CR_LC[] = {
/* 'Ll': General Category */
static const OnigCodePoint CR_Ll[] = {
- 611,
+ 630,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -6857,7 +7624,12 @@ static const OnigCodePoint CR_Ll[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
+ 0x13f8, 0x13fd,
0x1d00, 0x1d2b,
0x1d6b, 0x1d77,
0x1d79, 0x1d9a,
@@ -7115,6 +7887,8 @@ static const OnigCodePoint CR_Ll[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -7164,17 +7938,29 @@ static const OnigCodePoint CR_Ll[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
- 0xa793, 0xa793,
+ 0xa793, 0xa795,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
0xa7a7, 0xa7a7,
0xa7a9, 0xa7a9,
+ 0xa7b5, 0xa7b5,
+ 0xa7b7, 0xa7b7,
0xa7fa, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab60, 0xab65,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x10cc0, 0x10cf2,
+ 0x118c0, 0x118df,
0x1d41a, 0x1d433,
0x1d44e, 0x1d454,
0x1d456, 0x1d467,
@@ -7207,7 +7993,7 @@ static const OnigCodePoint CR_Ll[] = {
/* 'Lm': General Category */
static const OnigCodePoint CR_Lm[] = {
- 52,
+ 56,
0x02b0, 0x02c1,
0x02c6, 0x02d1,
0x02e0, 0x02e4,
@@ -7249,22 +8035,26 @@ static const OnigCodePoint CR_Lm[] = {
0xa4f8, 0xa4fd,
0xa60c, 0xa60c,
0xa67f, 0xa67f,
+ 0xa69c, 0xa69d,
0xa717, 0xa71f,
0xa770, 0xa770,
0xa788, 0xa788,
0xa7f8, 0xa7f9,
0xa9cf, 0xa9cf,
+ 0xa9e6, 0xa9e6,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
0xaaf3, 0xaaf4,
+ 0xab5c, 0xab5f,
0xff70, 0xff70,
0xff9e, 0xff9f,
+ 0x16b40, 0x16b43,
0x16f93, 0x16f9f,
}; /* CR_Lm */
/* 'Lo': General Category */
static const OnigCodePoint CR_Lo[] = {
- 371,
+ 433,
0x00aa, 0x00aa,
0x00ba, 0x00ba,
0x01bb, 0x01bb,
@@ -7287,14 +8077,12 @@ static const OnigCodePoint CR_Lo[] = {
0x07ca, 0x07ea,
0x0800, 0x0815,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b4,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0972, 0x0977,
- 0x0979, 0x097f,
+ 0x0972, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -7325,6 +8113,7 @@ static const OnigCodePoint CR_Lo[] = {
0x0abd, 0x0abd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
+ 0x0af9, 0x0af9,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
0x0b13, 0x0b28,
@@ -7349,10 +8138,9 @@ static const OnigCodePoint CR_Lo[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c61,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
@@ -7368,7 +8156,7 @@ static const OnigCodePoint CR_Lo[] = {
0x0d12, 0x0d3a,
0x0d3d, 0x0d3d,
0x0d4e, 0x0d4e,
- 0x0d60, 0x0d61,
+ 0x0d5f, 0x0d61,
0x0d7a, 0x0d7f,
0x0d85, 0x0d96,
0x0d9a, 0x0db1,
@@ -7425,11 +8213,11 @@ static const OnigCodePoint CR_Lo[] = {
0x1312, 0x1315,
0x1318, 0x135a,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
+ 0x16f1, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -7443,11 +8231,11 @@ static const OnigCodePoint CR_Lo[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
- 0x19c1, 0x19c7,
+ 0x19b0, 0x19c9,
0x1a00, 0x1a16,
0x1a20, 0x1a54,
0x1b05, 0x1b33,
@@ -7483,7 +8271,7 @@ static const OnigCodePoint CR_Lo[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa014,
0xa016, 0xa48c,
0xa4d0, 0xa4f7,
@@ -7492,6 +8280,8 @@ static const OnigCodePoint CR_Lo[] = {
0xa62a, 0xa62b,
0xa66e, 0xa66e,
0xa6a0, 0xa6e5,
+ 0xa78f, 0xa78f,
+ 0xa7f7, 0xa7f7,
0xa7fb, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
@@ -7500,17 +8290,21 @@ static const OnigCodePoint CR_Lo[] = {
0xa882, 0xa8b3,
0xa8f2, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa90a, 0xa925,
0xa930, 0xa946,
0xa960, 0xa97c,
0xa984, 0xa9b2,
+ 0xa9e0, 0xa9e4,
+ 0xa9e7, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa6f,
0xaa71, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -7560,19 +8354,29 @@ static const OnigCodePoint CR_Lo[] = {
0x10080, 0x100fa,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x10340,
0x10342, 0x10349,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x10450, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -7582,23 +8386,70 @@ static const OnigCodePoint CR_Lo[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x11350, 0x11350,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x115d8, 0x115db,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
+ 0x11700, 0x11719,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -7635,6 +8486,7 @@ static const OnigCodePoint CR_Lo[] = {
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_Lo */
@@ -7655,7 +8507,7 @@ static const OnigCodePoint CR_Lt[] = {
/* 'Lu': General Category */
static const OnigCodePoint CR_Lu[] = {
- 608,
+ 625,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -7803,6 +8655,7 @@ static const OnigCodePoint CR_Lu[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -7922,10 +8775,15 @@ static const OnigCodePoint CR_Lu[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
0x10cd, 0x10cd,
+ 0x13a0, 0x13f5,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -8176,6 +9034,8 @@ static const OnigCodePoint CR_Lu[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -8225,14 +9085,23 @@ static const OnigCodePoint CR_Lu[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b4,
+ 0xa7b6, 0xa7b6,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x10c80, 0x10cb2,
+ 0x118a0, 0x118bf,
0x1d400, 0x1d419,
0x1d434, 0x1d44d,
0x1d468, 0x1d481,
@@ -8268,7 +9137,7 @@ static const OnigCodePoint CR_Lu[] = {
/* 'M': Major Category */
static const OnigCodePoint CR_M[] = {
- 204,
+ 236,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -8292,8 +9161,7 @@ static const OnigCodePoint CR_M[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0903,
+ 0x08e3, 0x0903,
0x093a, 0x093c,
0x093e, 0x094f,
0x0951, 0x0957,
@@ -8331,20 +9199,20 @@ static const OnigCodePoint CR_M[] = {
0x0bc6, 0x0bc8,
0x0bca, 0x0bcd,
0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c3e, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0cbc, 0x0cbc,
0x0cbe, 0x0cc4,
0x0cc6, 0x0cc8,
0x0cca, 0x0ccd,
0x0cd5, 0x0cd6,
0x0ce2, 0x0ce3,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d3e, 0x0d44,
0x0d46, 0x0d48,
0x0d4a, 0x0d4d,
@@ -8393,12 +9261,11 @@ static const OnigCodePoint CR_M[] = {
0x18a9, 0x18a9,
0x1920, 0x192b,
0x1930, 0x193b,
- 0x19b0, 0x19c0,
- 0x19c8, 0x19c9,
0x1a17, 0x1a1b,
0x1a55, 0x1a5e,
0x1a60, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b04,
0x1b34, 0x1b44,
0x1b6b, 0x1b73,
@@ -8410,7 +9277,8 @@ static const OnigCodePoint CR_M[] = {
0x1cd4, 0x1ce8,
0x1ced, 0x1ced,
0x1cf2, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x20d0, 0x20f0,
0x2cef, 0x2cf1,
@@ -8420,7 +9288,7 @@ static const OnigCodePoint CR_M[] = {
0x3099, 0x309a,
0xa66f, 0xa672,
0xa674, 0xa67d,
- 0xa69f, 0xa69f,
+ 0xa69e, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -8433,10 +9301,11 @@ static const OnigCodePoint CR_M[] = {
0xa947, 0xa953,
0xa980, 0xa983,
0xa9b3, 0xa9c0,
+ 0xa9e5, 0xa9e5,
0xaa29, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4d,
- 0xaa7b, 0xaa7b,
+ 0xaa7b, 0xaa7d,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -8448,36 +9317,68 @@ static const OnigCodePoint CR_M[] = {
0xabec, 0xabed,
0xfb1e, 0xfb1e,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11000, 0x11002,
0x11038, 0x11046,
- 0x11080, 0x11082,
+ 0x1107f, 0x11082,
0x110b0, 0x110ba,
0x11100, 0x11102,
0x11127, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11182,
0x111b3, 0x111c0,
+ 0x111ca, 0x111cc,
+ 0x1122c, 0x11237,
+ 0x112df, 0x112ea,
+ 0x11300, 0x11303,
+ 0x1133c, 0x1133c,
+ 0x1133e, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x11362, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b0, 0x114c3,
+ 0x115af, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x115dc, 0x115dd,
+ 0x11630, 0x11640,
0x116ab, 0x116b7,
+ 0x1171d, 0x1172b,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
0x16f51, 0x16f7e,
0x16f8f, 0x16f92,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1da00, 0x1da36,
+ 0x1da3b, 0x1da6c,
+ 0x1da75, 0x1da75,
+ 0x1da84, 0x1da84,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e8d0, 0x1e8d6,
0xe0100, 0xe01ef,
}; /* CR_M */
/* 'Mc': General Category */
static const OnigCodePoint CR_Mc[] = {
- 126,
+ 147,
0x0903, 0x0903,
0x093b, 0x093b,
0x093e, 0x0940,
@@ -8542,9 +9443,7 @@ static const OnigCodePoint CR_Mc[] = {
0x1929, 0x192b,
0x1930, 0x1931,
0x1933, 0x1938,
- 0x19b0, 0x19c0,
- 0x19c8, 0x19c9,
- 0x1a19, 0x1a1b,
+ 0x1a19, 0x1a1a,
0x1a55, 0x1a55,
0x1a57, 0x1a57,
0x1a61, 0x1a61,
@@ -8559,7 +9458,6 @@ static const OnigCodePoint CR_Mc[] = {
0x1ba1, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bac, 0x1bad,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -8582,6 +9480,7 @@ static const OnigCodePoint CR_Mc[] = {
0xaa33, 0xaa34,
0xaa4d, 0xaa4d,
0xaa7b, 0xaa7b,
+ 0xaa7d, 0xaa7d,
0xaaeb, 0xaaeb,
0xaaee, 0xaaef,
0xaaf5, 0xaaf5,
@@ -8598,9 +9497,32 @@ static const OnigCodePoint CR_Mc[] = {
0x11182, 0x11182,
0x111b3, 0x111b5,
0x111bf, 0x111c0,
+ 0x1122c, 0x1122e,
+ 0x11232, 0x11233,
+ 0x11235, 0x11235,
+ 0x112e0, 0x112e2,
+ 0x11302, 0x11303,
+ 0x1133e, 0x1133f,
+ 0x11341, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x11362, 0x11363,
+ 0x114b0, 0x114b2,
+ 0x114b9, 0x114b9,
+ 0x114bb, 0x114be,
+ 0x114c1, 0x114c1,
+ 0x115af, 0x115b1,
+ 0x115b8, 0x115bb,
+ 0x115be, 0x115be,
+ 0x11630, 0x11632,
+ 0x1163b, 0x1163c,
+ 0x1163e, 0x1163e,
0x116ac, 0x116ac,
0x116ae, 0x116af,
0x116b6, 0x116b6,
+ 0x11720, 0x11721,
+ 0x11726, 0x11726,
0x16f51, 0x16f7e,
0x1d165, 0x1d166,
0x1d16d, 0x1d172,
@@ -8608,8 +9530,9 @@ static const OnigCodePoint CR_Mc[] = {
/* 'Me': General Category */
static const OnigCodePoint CR_Me[] = {
- 4,
+ 5,
0x0488, 0x0489,
+ 0x1abe, 0x1abe,
0x20dd, 0x20e0,
0x20e2, 0x20e4,
0xa670, 0xa672,
@@ -8617,7 +9540,7 @@ static const OnigCodePoint CR_Me[] = {
/* 'Mn': General Category */
static const OnigCodePoint CR_Mn[] = {
- 220,
+ 266,
0x0300, 0x036f,
0x0483, 0x0487,
0x0591, 0x05bd,
@@ -8641,8 +9564,7 @@ static const OnigCodePoint CR_Mn[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0902,
+ 0x08e3, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
0x0941, 0x0948,
@@ -8678,16 +9600,19 @@ static const OnigCodePoint CR_Mn[] = {
0x0b82, 0x0b82,
0x0bc0, 0x0bc0,
0x0bcd, 0x0bcd,
+ 0x0c00, 0x0c00,
0x0c3e, 0x0c40,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
+ 0x0c81, 0x0c81,
0x0cbc, 0x0cbc,
0x0cbf, 0x0cbf,
0x0cc6, 0x0cc6,
0x0ccc, 0x0ccd,
0x0ce2, 0x0ce3,
+ 0x0d01, 0x0d01,
0x0d41, 0x0d44,
0x0d4d, 0x0d4d,
0x0d62, 0x0d63,
@@ -8739,6 +9664,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1932, 0x1932,
0x1939, 0x193b,
0x1a17, 0x1a18,
+ 0x1a1b, 0x1a1b,
0x1a56, 0x1a56,
0x1a58, 0x1a5e,
0x1a60, 0x1a60,
@@ -8746,6 +9672,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1a65, 0x1a6c,
0x1a73, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abd,
0x1b00, 0x1b03,
0x1b34, 0x1b34,
0x1b36, 0x1b3a,
@@ -8755,7 +9682,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
- 0x1bab, 0x1bab,
+ 0x1bab, 0x1bad,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -8767,7 +9694,8 @@ static const OnigCodePoint CR_Mn[] = {
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x20d0, 0x20dc,
0x20e1, 0x20e1,
@@ -8779,7 +9707,7 @@ static const OnigCodePoint CR_Mn[] = {
0x3099, 0x309a,
0xa66f, 0xa66f,
0xa674, 0xa67d,
- 0xa69f, 0xa69f,
+ 0xa69e, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -8793,11 +9721,13 @@ static const OnigCodePoint CR_Mn[] = {
0xa9b3, 0xa9b3,
0xa9b6, 0xa9b9,
0xa9bc, 0xa9bc,
+ 0xa9e5, 0xa9e5,
0xaa29, 0xaa2e,
0xaa31, 0xaa32,
0xaa35, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4c,
+ 0xaa7c, 0xaa7c,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -8810,39 +9740,78 @@ static const OnigCodePoint CR_Mn[] = {
0xabed, 0xabed,
0xfb1e, 0xfb1e,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11001, 0x11001,
0x11038, 0x11046,
- 0x11080, 0x11081,
+ 0x1107f, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x11100, 0x11102,
0x11127, 0x1112b,
0x1112d, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11181,
0x111b6, 0x111be,
+ 0x111ca, 0x111cc,
+ 0x1122f, 0x11231,
+ 0x11234, 0x11234,
+ 0x11236, 0x11237,
+ 0x112df, 0x112df,
+ 0x112e3, 0x112ea,
+ 0x11300, 0x11301,
+ 0x1133c, 0x1133c,
+ 0x11340, 0x11340,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b3, 0x114b8,
+ 0x114ba, 0x114ba,
+ 0x114bf, 0x114c0,
+ 0x114c2, 0x114c3,
+ 0x115b2, 0x115b5,
+ 0x115bc, 0x115bd,
+ 0x115bf, 0x115c0,
+ 0x115dc, 0x115dd,
+ 0x11633, 0x1163a,
+ 0x1163d, 0x1163d,
+ 0x1163f, 0x11640,
0x116ab, 0x116ab,
0x116ad, 0x116ad,
0x116b0, 0x116b5,
0x116b7, 0x116b7,
+ 0x1171d, 0x1171f,
+ 0x11722, 0x11725,
+ 0x11727, 0x1172b,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
0x16f8f, 0x16f92,
+ 0x1bc9d, 0x1bc9e,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1da00, 0x1da36,
+ 0x1da3b, 0x1da6c,
+ 0x1da75, 0x1da75,
+ 0x1da84, 0x1da84,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e8d0, 0x1e8d6,
0xe0100, 0xe01ef,
}; /* CR_Mn */
/* 'N': Major Category */
static const OnigCodePoint CR_N[] = {
- 88,
+ 111,
0x0030, 0x0039,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
@@ -8862,6 +9831,7 @@ static const OnigCodePoint CR_N[] = {
0x0c78, 0x0c7e,
0x0ce6, 0x0cef,
0x0d66, 0x0d75,
+ 0x0de6, 0x0def,
0x0e50, 0x0e59,
0x0ed0, 0x0ed9,
0x0f20, 0x0f33,
@@ -8904,33 +9874,55 @@ static const OnigCodePoint CR_N[] = {
0xa8d0, 0xa8d9,
0xa900, 0xa909,
0xa9d0, 0xa9d9,
+ 0xa9f0, 0xa9f9,
0xaa50, 0xaa59,
0xabf0, 0xabf9,
0xff10, 0xff19,
0x10107, 0x10133,
0x10140, 0x10178,
- 0x1018a, 0x1018a,
+ 0x1018a, 0x1018b,
+ 0x102e1, 0x102fb,
0x10320, 0x10323,
0x10341, 0x10341,
0x1034a, 0x1034a,
0x103d1, 0x103d5,
0x104a0, 0x104a9,
0x10858, 0x1085f,
+ 0x10879, 0x1087f,
+ 0x108a7, 0x108af,
+ 0x108fb, 0x108ff,
0x10916, 0x1091b,
+ 0x109bc, 0x109bd,
+ 0x109c0, 0x109cf,
+ 0x109d2, 0x109ff,
0x10a40, 0x10a47,
0x10a7d, 0x10a7e,
+ 0x10a9d, 0x10a9f,
+ 0x10aeb, 0x10aef,
0x10b58, 0x10b5f,
0x10b78, 0x10b7f,
+ 0x10ba9, 0x10baf,
+ 0x10cfa, 0x10cff,
0x10e60, 0x10e7e,
0x11052, 0x1106f,
0x110f0, 0x110f9,
0x11136, 0x1113f,
0x111d0, 0x111d9,
+ 0x111e1, 0x111f4,
+ 0x112f0, 0x112f9,
+ 0x114d0, 0x114d9,
+ 0x11650, 0x11659,
0x116c0, 0x116c9,
- 0x12400, 0x12462,
+ 0x11730, 0x1173b,
+ 0x118e0, 0x118f2,
+ 0x12400, 0x1246e,
+ 0x16a60, 0x16a69,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
0x1d360, 0x1d371,
0x1d7ce, 0x1d7ff,
- 0x1f100, 0x1f10a,
+ 0x1e8c7, 0x1e8cf,
+ 0x1f100, 0x1f10c,
}; /* CR_N */
/* 'Nd': General Category */
@@ -8950,12 +9942,12 @@ static const OnigCodePoint CR_Nl[] = {
0x10341, 0x10341,
0x1034a, 0x1034a,
0x103d1, 0x103d5,
- 0x12400, 0x12462,
+ 0x12400, 0x1246e,
}; /* CR_Nl */
/* 'No': General Category */
static const OnigCodePoint CR_No[] = {
- 42,
+ 58,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
0x00bc, 0x00be,
@@ -8986,18 +9978,34 @@ static const OnigCodePoint CR_No[] = {
0xa830, 0xa835,
0x10107, 0x10133,
0x10175, 0x10178,
- 0x1018a, 0x1018a,
+ 0x1018a, 0x1018b,
+ 0x102e1, 0x102fb,
0x10320, 0x10323,
0x10858, 0x1085f,
+ 0x10879, 0x1087f,
+ 0x108a7, 0x108af,
+ 0x108fb, 0x108ff,
0x10916, 0x1091b,
+ 0x109bc, 0x109bd,
+ 0x109c0, 0x109cf,
+ 0x109d2, 0x109ff,
0x10a40, 0x10a47,
0x10a7d, 0x10a7e,
+ 0x10a9d, 0x10a9f,
+ 0x10aeb, 0x10aef,
0x10b58, 0x10b5f,
0x10b78, 0x10b7f,
+ 0x10ba9, 0x10baf,
+ 0x10cfa, 0x10cff,
0x10e60, 0x10e7e,
0x11052, 0x11065,
+ 0x111e1, 0x111f4,
+ 0x1173a, 0x1173b,
+ 0x118ea, 0x118f2,
+ 0x16b5b, 0x16b61,
0x1d360, 0x1d371,
- 0x1f100, 0x1f10a,
+ 0x1e8c7, 0x1e8cf,
+ 0x1f100, 0x1f10c,
}; /* CR_No */
/* 'P': Major Category */
@@ -9016,7 +10024,7 @@ static const OnigCodePoint CR_Pc[] = {
/* 'Pd': General Category */
static const OnigCodePoint CR_Pd[] = {
- 16,
+ 17,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -9026,6 +10034,7 @@ static const OnigCodePoint CR_Pd[] = {
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
0x2e3a, 0x2e3b,
+ 0x2e40, 0x2e40,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -9037,7 +10046,7 @@ static const OnigCodePoint CR_Pd[] = {
/* 'Pe': General Category */
static const OnigCodePoint CR_Pe[] = {
- 70,
+ 72,
0x0029, 0x0029,
0x005d, 0x005d,
0x007d, 0x007d,
@@ -9047,6 +10056,8 @@ static const OnigCodePoint CR_Pe[] = {
0x2046, 0x2046,
0x207e, 0x207e,
0x208e, 0x208e,
+ 0x2309, 0x2309,
+ 0x230b, 0x230b,
0x232a, 0x232a,
0x2769, 0x2769,
0x276b, 0x276b,
@@ -9089,7 +10100,7 @@ static const OnigCodePoint CR_Pe[] = {
0x3019, 0x3019,
0x301b, 0x301b,
0x301e, 0x301f,
- 0xfd3f, 0xfd3f,
+ 0xfd3e, 0xfd3e,
0xfe18, 0xfe18,
0xfe36, 0xfe36,
0xfe38, 0xfe38,
@@ -9143,7 +10154,7 @@ static const OnigCodePoint CR_Pi[] = {
/* 'Po': General Category */
static const OnigCodePoint CR_Po[] = {
- 135,
+ 157,
0x0021, 0x0023,
0x0025, 0x0027,
0x002a, 0x002a,
@@ -9225,6 +10236,8 @@ static const OnigCodePoint CR_Po[] = {
0x2e1e, 0x2e1f,
0x2e2a, 0x2e2e,
0x2e30, 0x2e39,
+ 0x2e3c, 0x2e3f,
+ 0x2e41, 0x2e41,
0x3001, 0x3003,
0x303d, 0x303d,
0x30fb, 0x30fb,
@@ -9236,6 +10249,7 @@ static const OnigCodePoint CR_Po[] = {
0xa874, 0xa877,
0xa8ce, 0xa8cf,
0xa8f8, 0xa8fa,
+ 0xa8fc, 0xa8fc,
0xa92e, 0xa92f,
0xa95f, 0xa95f,
0xa9c1, 0xa9cd,
@@ -9267,23 +10281,42 @@ static const OnigCodePoint CR_Po[] = {
0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
+ 0x1056f, 0x1056f,
0x10857, 0x10857,
0x1091f, 0x1091f,
0x1093f, 0x1093f,
0x10a50, 0x10a58,
0x10a7f, 0x10a7f,
+ 0x10af0, 0x10af6,
0x10b39, 0x10b3f,
+ 0x10b99, 0x10b9c,
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
0x11140, 0x11143,
- 0x111c5, 0x111c8,
- 0x12470, 0x12473,
+ 0x11174, 0x11175,
+ 0x111c5, 0x111c9,
+ 0x111cd, 0x111cd,
+ 0x111db, 0x111db,
+ 0x111dd, 0x111df,
+ 0x11238, 0x1123d,
+ 0x112a9, 0x112a9,
+ 0x114c6, 0x114c6,
+ 0x115c1, 0x115d7,
+ 0x11641, 0x11643,
+ 0x1173c, 0x1173e,
+ 0x12470, 0x12474,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b3b,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
+ 0x1da87, 0x1da8b,
}; /* CR_Po */
/* 'Ps': General Category */
static const OnigCodePoint CR_Ps[] = {
- 72,
+ 75,
0x0028, 0x0028,
0x005b, 0x005b,
0x007b, 0x007b,
@@ -9295,6 +10328,8 @@ static const OnigCodePoint CR_Ps[] = {
0x2045, 0x2045,
0x207d, 0x207d,
0x208d, 0x208d,
+ 0x2308, 0x2308,
+ 0x230a, 0x230a,
0x2329, 0x2329,
0x2768, 0x2768,
0x276a, 0x276a,
@@ -9327,6 +10362,7 @@ static const OnigCodePoint CR_Ps[] = {
0x2e24, 0x2e24,
0x2e26, 0x2e26,
0x2e28, 0x2e28,
+ 0x2e42, 0x2e42,
0x3008, 0x3008,
0x300a, 0x300a,
0x300c, 0x300c,
@@ -9337,7 +10373,7 @@ static const OnigCodePoint CR_Ps[] = {
0x3018, 0x3018,
0x301a, 0x301a,
0x301d, 0x301d,
- 0xfd3e, 0xfd3e,
+ 0xfd3f, 0xfd3f,
0xfe17, 0xfe17,
0xfe35, 0xfe35,
0xfe37, 0xfe37,
@@ -9360,7 +10396,7 @@ static const OnigCodePoint CR_Ps[] = {
/* 'S': Major Category */
static const OnigCodePoint CR_S[] = {
- 198,
+ 214,
0x0024, 0x0024,
0x002b, 0x002b,
0x003c, 0x003e,
@@ -9385,7 +10421,7 @@ static const OnigCodePoint CR_S[] = {
0x0384, 0x0385,
0x03f6, 0x03f6,
0x0482, 0x0482,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0606, 0x0608,
0x060b, 0x060b,
0x060e, 0x060f,
@@ -9429,7 +10465,7 @@ static const OnigCodePoint CR_S[] = {
0x2052, 0x2052,
0x207a, 0x207c,
0x208a, 0x208c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20be,
0x2100, 0x2101,
0x2103, 0x2106,
0x2108, 0x2109,
@@ -9444,20 +10480,25 @@ static const OnigCodePoint CR_S[] = {
0x2140, 0x2144,
0x214a, 0x214d,
0x214f, 0x214f,
- 0x2190, 0x2328,
- 0x232b, 0x23f3,
+ 0x218a, 0x218b,
+ 0x2190, 0x2307,
+ 0x230c, 0x2328,
+ 0x232b, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
0x249c, 0x24e9,
- 0x2500, 0x26ff,
- 0x2701, 0x2767,
+ 0x2500, 0x2767,
0x2794, 0x27c4,
0x27c7, 0x27e5,
0x27f0, 0x2982,
0x2999, 0x29d7,
0x29dc, 0x29fb,
- 0x29fe, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x29fe, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
0x2ce5, 0x2cea,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
@@ -9487,6 +10528,7 @@ static const OnigCodePoint CR_S[] = {
0xa828, 0xa82b,
0xa836, 0xa839,
0xaa77, 0xaa79,
+ 0xab5b, 0xab5b,
0xfb29, 0xfb29,
0xfbb2, 0xfbc1,
0xfdfc, 0xfdfd,
@@ -9505,15 +10547,23 @@ static const OnigCodePoint CR_S[] = {
0xfffc, 0xfffd,
0x10137, 0x1013f,
0x10179, 0x10189,
+ 0x1018c, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fc,
+ 0x10877, 0x10878,
+ 0x10ac8, 0x10ac8,
+ 0x1173f, 0x1173f,
+ 0x16b3c, 0x16b3f,
+ 0x16b45, 0x16b45,
+ 0x1bc9c, 0x1bc9c,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d164,
0x1d16a, 0x1d16c,
0x1d183, 0x1d184,
0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1dd,
+ 0x1d1ae, 0x1d1e8,
0x1d200, 0x1d241,
0x1d245, 0x1d245,
0x1d300, 0x1d356,
@@ -9527,13 +10577,18 @@ static const OnigCodePoint CR_S[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1d800, 0x1d9ff,
+ 0x1da37, 0x1da3a,
+ 0x1da6d, 0x1da74,
+ 0x1da76, 0x1da83,
+ 0x1da85, 0x1da86,
0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
+ 0x1f0d1, 0x1f0f5,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -9541,24 +10596,21 @@ static const OnigCodePoint CR_S[] = {
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,
+ 0x1f300, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
}; /* CR_S */
/* 'Sc': General Category */
@@ -9574,7 +10626,7 @@ static const OnigCodePoint CR_Sc[] = {
0x0bf9, 0x0bf9,
0x0e3f, 0x0e3f,
0x17db, 0x17db,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20be,
0xa838, 0xa838,
0xfdfc, 0xfdfc,
0xfe69, 0xfe69,
@@ -9585,7 +10637,7 @@ static const OnigCodePoint CR_Sc[] = {
/* 'Sk': General Category */
static const OnigCodePoint CR_Sk[] = {
- 27,
+ 29,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -9609,15 +10661,17 @@ static const OnigCodePoint CR_Sk[] = {
0xa700, 0xa716,
0xa720, 0xa721,
0xa789, 0xa78a,
+ 0xab5b, 0xab5b,
0xfbb2, 0xfbc1,
0xff3e, 0xff3e,
0xff40, 0xff40,
0xffe3, 0xffe3,
+ 0x1f3fb, 0x1f3ff,
}; /* CR_Sk */
/* 'Sm': General Category */
static const OnigCodePoint CR_Sm[] = {
- 65,
+ 64,
0x002b, 0x002b,
0x003c, 0x003e,
0x007c, 0x007c,
@@ -9645,7 +10699,6 @@ static const OnigCodePoint CR_Sm[] = {
0x21d2, 0x21d2,
0x21d4, 0x21d4,
0x21f4, 0x22ff,
- 0x2308, 0x230b,
0x2320, 0x2321,
0x237c, 0x237c,
0x239b, 0x23b3,
@@ -9687,12 +10740,13 @@ static const OnigCodePoint CR_Sm[] = {
/* 'So': General Category */
static const OnigCodePoint CR_So[] = {
- 153,
+ 170,
0x00a6, 0x00a6,
0x00a9, 0x00a9,
0x00ae, 0x00ae,
0x00b0, 0x00b0,
0x0482, 0x0482,
+ 0x058d, 0x058e,
0x060e, 0x060f,
0x06de, 0x06de,
0x06e9, 0x06e9,
@@ -9735,6 +10789,7 @@ static const OnigCodePoint CR_So[] = {
0x214a, 0x214a,
0x214c, 0x214d,
0x214f, 0x214f,
+ 0x218a, 0x218b,
0x2195, 0x2199,
0x219c, 0x219f,
0x21a1, 0x21a2,
@@ -9750,7 +10805,7 @@ static const OnigCodePoint CR_So[] = {
0x232b, 0x237b,
0x237d, 0x239a,
0x23b4, 0x23db,
- 0x23e2, 0x23f3,
+ 0x23e2, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
0x249c, 0x24e9,
@@ -9758,13 +10813,17 @@ static const OnigCodePoint CR_So[] = {
0x25b8, 0x25c0,
0x25c2, 0x25f7,
0x2600, 0x266e,
- 0x2670, 0x26ff,
- 0x2701, 0x2767,
+ 0x2670, 0x2767,
0x2794, 0x27bf,
0x2800, 0x28ff,
0x2b00, 0x2b2f,
0x2b45, 0x2b46,
- 0x2b50, 0x2b59,
+ 0x2b4d, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
0x2ce5, 0x2cea,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
@@ -9798,24 +10857,37 @@ static const OnigCodePoint CR_So[] = {
0xfffc, 0xfffd,
0x10137, 0x1013f,
0x10179, 0x10189,
+ 0x1018c, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fc,
+ 0x10877, 0x10878,
+ 0x10ac8, 0x10ac8,
+ 0x1173f, 0x1173f,
+ 0x16b3c, 0x16b3f,
+ 0x16b45, 0x16b45,
+ 0x1bc9c, 0x1bc9c,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d164,
0x1d16a, 0x1d16c,
0x1d183, 0x1d184,
0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1dd,
+ 0x1d1ae, 0x1d1e8,
0x1d200, 0x1d241,
0x1d245, 0x1d245,
0x1d300, 0x1d356,
+ 0x1d800, 0x1d9ff,
+ 0x1da37, 0x1da3a,
+ 0x1da6d, 0x1da74,
+ 0x1da76, 0x1da83,
+ 0x1da85, 0x1da86,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
+ 0x1f0d1, 0x1f0f5,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -9823,33 +10895,30 @@ static const OnigCodePoint CR_So[] = {
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,
+ 0x1f300, 0x1f3fa,
+ 0x1f400, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
}; /* CR_So */
/* 'Z': Major Category */
static const OnigCodePoint CR_Z[] = {
- 9,
+ 8,
0x0020, 0x0020,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x2028, 0x2029,
0x202f, 0x202f,
@@ -9871,11 +10940,10 @@ static const OnigCodePoint CR_Zp[] = {
/* 'Zs': General Category */
static const OnigCodePoint CR_Zs[] = {
- 8,
+ 7,
0x0020, 0x0020,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x202f, 0x202f,
0x205f, 0x205f,
@@ -10036,7 +11104,7 @@ static const OnigCodePoint CR_Math[] = {
/* 'Cased': Derived Property */
static const OnigCodePoint CR_Cased[] = {
- 119,
+ 131,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -10054,18 +11122,21 @@ static const OnigCodePoint CR_Cased[] = {
0x0370, 0x0373,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
0x10cd, 0x10cd,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -10115,17 +11186,23 @@ static const OnigCodePoint CR_Cased[] = {
0x2d27, 0x2d27,
0x2d2d, 0x2d2d,
0xa640, 0xa66d,
- 0xa680, 0xa697,
+ 0xa680, 0xa69d,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b7,
0xa7f8, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0xff41, 0xff5a,
0x10400, 0x1044f,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x118a0, 0x118df,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -10156,11 +11233,14 @@ static const OnigCodePoint CR_Cased[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Cased */
/* 'Case_Ignorable': Derived Property */
static const OnigCodePoint CR_Case_Ignorable[] = {
- 295,
+ 346,
0x0027, 0x0027,
0x002e, 0x002e,
0x003a, 0x003a,
@@ -10184,8 +11264,9 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x05c4, 0x05c5,
0x05c7, 0x05c7,
0x05f4, 0x05f4,
- 0x0600, 0x0604,
+ 0x0600, 0x0605,
0x0610, 0x061a,
+ 0x061c, 0x061c,
0x0640, 0x0640,
0x064b, 0x065f,
0x0670, 0x0670,
@@ -10200,8 +11281,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x07fa, 0x07fa,
0x0816, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0902,
+ 0x08e3, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
0x0941, 0x0948,
@@ -10238,16 +11318,19 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x0b82, 0x0b82,
0x0bc0, 0x0bc0,
0x0bcd, 0x0bcd,
+ 0x0c00, 0x0c00,
0x0c3e, 0x0c40,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
+ 0x0c81, 0x0c81,
0x0cbc, 0x0cbc,
0x0cbf, 0x0cbf,
0x0cc6, 0x0cc6,
0x0ccc, 0x0ccd,
0x0ce2, 0x0ce3,
+ 0x0d01, 0x0d01,
0x0d41, 0x0d44,
0x0d4d, 0x0d4d,
0x0d62, 0x0d63,
@@ -10295,7 +11378,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x17c9, 0x17d3,
0x17d7, 0x17d7,
0x17dd, 0x17dd,
- 0x180b, 0x180d,
+ 0x180b, 0x180e,
0x1843, 0x1843,
0x18a9, 0x18a9,
0x1920, 0x1922,
@@ -10303,6 +11386,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1932, 0x1932,
0x1939, 0x193b,
0x1a17, 0x1a18,
+ 0x1a1b, 0x1a1b,
0x1a56, 0x1a56,
0x1a58, 0x1a5e,
0x1a60, 0x1a60,
@@ -10311,6 +11395,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1a73, 0x1a7c,
0x1a7f, 0x1a7f,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b03,
0x1b34, 0x1b34,
0x1b36, 0x1b3a,
@@ -10320,7 +11405,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
- 0x1bab, 0x1bab,
+ 0x1bab, 0x1bad,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -10333,9 +11418,10 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
+ 0x1cf8, 0x1cf9,
0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
- 0x1d9b, 0x1de6,
+ 0x1d9b, 0x1df5,
0x1dfc, 0x1dff,
0x1fbd, 0x1fbd,
0x1fbf, 0x1fc1,
@@ -10349,7 +11435,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x2027, 0x2027,
0x202a, 0x202e,
0x2060, 0x2064,
- 0x206a, 0x206f,
+ 0x2066, 0x206f,
0x2071, 0x2071,
0x207f, 0x207f,
0x2090, 0x209c,
@@ -10372,7 +11458,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa66f, 0xa672,
0xa674, 0xa67d,
0xa67f, 0xa67f,
- 0xa69f, 0xa69f,
+ 0xa69c, 0xa69f,
0xa6f0, 0xa6f1,
0xa700, 0xa721,
0xa770, 0xa770,
@@ -10391,12 +11477,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa9b6, 0xa9b9,
0xa9bc, 0xa9bc,
0xa9cf, 0xa9cf,
+ 0xa9e5, 0xa9e6,
0xaa29, 0xaa2e,
0xaa31, 0xaa32,
0xaa35, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4c,
0xaa70, 0xaa70,
+ 0xaa7c, 0xaa7c,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -10406,6 +11494,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xaaec, 0xaaed,
0xaaf3, 0xaaf4,
0xaaf6, 0xaaf6,
+ 0xab5b, 0xab5f,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -10413,7 +11502,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xfbb2, 0xfbc1,
0xfe00, 0xfe0f,
0xfe13, 0xfe13,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0xfe52, 0xfe52,
0xfe55, 0xfe55,
0xfeff, 0xfeff,
@@ -10427,32 +11516,74 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xffe3, 0xffe3,
0xfff9, 0xfffb,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11001, 0x11001,
0x11038, 0x11046,
- 0x11080, 0x11081,
+ 0x1107f, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x110bd, 0x110bd,
0x11100, 0x11102,
0x11127, 0x1112b,
0x1112d, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11181,
0x111b6, 0x111be,
+ 0x111ca, 0x111cc,
+ 0x1122f, 0x11231,
+ 0x11234, 0x11234,
+ 0x11236, 0x11237,
+ 0x112df, 0x112df,
+ 0x112e3, 0x112ea,
+ 0x11300, 0x11301,
+ 0x1133c, 0x1133c,
+ 0x11340, 0x11340,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b3, 0x114b8,
+ 0x114ba, 0x114ba,
+ 0x114bf, 0x114c0,
+ 0x114c2, 0x114c3,
+ 0x115b2, 0x115b5,
+ 0x115bc, 0x115bd,
+ 0x115bf, 0x115c0,
+ 0x115dc, 0x115dd,
+ 0x11633, 0x1163a,
+ 0x1163d, 0x1163d,
+ 0x1163f, 0x11640,
0x116ab, 0x116ab,
0x116ad, 0x116ad,
0x116b0, 0x116b5,
0x116b7, 0x116b7,
+ 0x1171d, 0x1171f,
+ 0x11722, 0x11725,
+ 0x11727, 0x1172b,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
+ 0x16b40, 0x16b43,
0x16f8f, 0x16f9f,
+ 0x1bc9d, 0x1bc9e,
+ 0x1bca0, 0x1bca3,
0x1d167, 0x1d169,
0x1d173, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1da00, 0x1da36,
+ 0x1da3b, 0x1da6c,
+ 0x1da75, 0x1da75,
+ 0x1da84, 0x1da84,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e8d0, 0x1e8d6,
+ 0x1f3fb, 0x1f3ff,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
0xe0100, 0xe01ef,
@@ -10460,7 +11591,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
/* 'Changes_When_Lowercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 571,
+ 588,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -10608,6 +11739,7 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -10726,10 +11858,15 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
0x10cd, 0x10cd,
+ 0x13a0, 0x13f5,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -10975,6 +12112,8 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -11024,19 +12163,28 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b4,
+ 0xa7b6, 0xa7b6,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x10c80, 0x10cb2,
+ 0x118a0, 0x118bf,
}; /* CR_Changes_When_Lowercased */
/* 'Changes_When_Uppercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 586,
+ 605,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -11183,20 +12331,21 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x024f, 0x0254,
0x0256, 0x0257,
0x0259, 0x0259,
- 0x025b, 0x025b,
- 0x0260, 0x0260,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
0x0263, 0x0263,
0x0265, 0x0266,
0x0268, 0x0269,
- 0x026b, 0x026b,
+ 0x026b, 0x026c,
0x026f, 0x026f,
0x0271, 0x0272,
0x0275, 0x0275,
0x027d, 0x027d,
0x0280, 0x0280,
0x0283, 0x0283,
- 0x0288, 0x028c,
+ 0x0287, 0x028c,
0x0292, 0x0292,
+ 0x029d, 0x029e,
0x0345, 0x0345,
0x0371, 0x0371,
0x0373, 0x0373,
@@ -11217,7 +12366,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x03e9, 0x03e9,
0x03eb, 0x03eb,
0x03ed, 0x03ed,
- 0x03ef, 0x03f2,
+ 0x03ef, 0x03f3,
0x03f5, 0x03f5,
0x03f8, 0x03f8,
0x03fb, 0x03fb,
@@ -11317,7 +12466,12 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
+ 0x13f8, 0x13fd,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
0x1e01, 0x1e01,
@@ -11566,6 +12720,8 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -11614,20 +12770,31 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa78c, 0xa78c,
0xa791, 0xa791,
0xa793, 0xa793,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
0xa7a7, 0xa7a7,
0xa7a9, 0xa7a9,
+ 0xa7b5, 0xa7b5,
+ 0xa7b7, 0xa7b7,
+ 0xab53, 0xab53,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x10cc0, 0x10cf2,
+ 0x118c0, 0x118df,
}; /* CR_Changes_When_Uppercased */
/* 'Changes_When_Titlecased': Derived Property */
static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 587,
+ 606,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -11775,20 +12942,21 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x024f, 0x0254,
0x0256, 0x0257,
0x0259, 0x0259,
- 0x025b, 0x025b,
- 0x0260, 0x0260,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
0x0263, 0x0263,
0x0265, 0x0266,
0x0268, 0x0269,
- 0x026b, 0x026b,
+ 0x026b, 0x026c,
0x026f, 0x026f,
0x0271, 0x0272,
0x0275, 0x0275,
0x027d, 0x027d,
0x0280, 0x0280,
0x0283, 0x0283,
- 0x0288, 0x028c,
+ 0x0287, 0x028c,
0x0292, 0x0292,
+ 0x029d, 0x029e,
0x0345, 0x0345,
0x0371, 0x0371,
0x0373, 0x0373,
@@ -11809,7 +12977,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x03e9, 0x03e9,
0x03eb, 0x03eb,
0x03ed, 0x03ed,
- 0x03ef, 0x03f2,
+ 0x03ef, 0x03f3,
0x03f5, 0x03f5,
0x03f8, 0x03f8,
0x03fb, 0x03fb,
@@ -11909,7 +13077,12 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
+ 0x13f8, 0x13fd,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
0x1e01, 0x1e01,
@@ -12158,6 +13331,8 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -12206,20 +13381,31 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa78c, 0xa78c,
0xa791, 0xa791,
0xa793, 0xa793,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
0xa7a7, 0xa7a7,
0xa7a9, 0xa7a9,
+ 0xa7b5, 0xa7b5,
+ 0xa7b7, 0xa7b7,
+ 0xab53, 0xab53,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x10cc0, 0x10cf2,
+ 0x118c0, 0x118df,
}; /* CR_Changes_When_Titlecased */
/* 'Changes_When_Casefolded': Derived Property */
static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 582,
+ 600,
0x0041, 0x005a,
0x00b5, 0x00b5,
0x00c0, 0x00d6,
@@ -12370,6 +13556,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -12491,11 +13678,16 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x0587, 0x0587,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
0x10cd, 0x10cd,
+ 0x13f8, 0x13fd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -12743,6 +13935,8 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -12792,21 +13986,31 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b4,
+ 0xa7b6, 0xa7b6,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x10c80, 0x10cb2,
+ 0x118a0, 0x118bf,
}; /* CR_Changes_When_Casefolded */
/* 'Changes_When_Casemapped': Derived Property */
static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 104,
+ 113,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -12824,39 +14028,42 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x023a, 0x0254,
0x0256, 0x0257,
0x0259, 0x0259,
- 0x025b, 0x025b,
- 0x0260, 0x0260,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
0x0263, 0x0263,
0x0265, 0x0266,
0x0268, 0x0269,
- 0x026b, 0x026b,
+ 0x026b, 0x026c,
0x026f, 0x026f,
0x0271, 0x0272,
0x0275, 0x0275,
0x027d, 0x027d,
0x0280, 0x0280,
0x0283, 0x0283,
- 0x0288, 0x028c,
+ 0x0287, 0x028c,
0x0292, 0x0292,
+ 0x029d, 0x029e,
0x0345, 0x0345,
0x0370, 0x0373,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03d1,
- 0x03d5, 0x03f2,
- 0x03f4, 0x03f5,
+ 0x03d5, 0x03f5,
0x03f7, 0x03fb,
0x03fd, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
0x10cd, 0x10cd,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
0x1e00, 0x1e9b,
@@ -12899,23 +14106,29 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x2d27, 0x2d27,
0x2d2d, 0x2d2d,
0xa640, 0xa66d,
- 0xa680, 0xa697,
+ 0xa680, 0xa69b,
0xa722, 0xa72f,
0xa732, 0xa76f,
0xa779, 0xa787,
0xa78b, 0xa78d,
0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
+ 0xa796, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xab53, 0xab53,
+ 0xab70, 0xabbf,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0xff41, 0xff5a,
0x10400, 0x1044f,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x118a0, 0x118df,
}; /* CR_Changes_When_Casemapped */
/* 'ID_Start': Derived Property */
static const OnigCodePoint CR_ID_Start[] = {
- 488,
+ 555,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -12931,13 +14144,14 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -12963,14 +14177,12 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b4,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
+ 0x0971, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -13001,6 +14213,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0abd, 0x0abd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
+ 0x0af9, 0x0af9,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
0x0b13, 0x0b28,
@@ -13025,10 +14238,9 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c61,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
@@ -13044,7 +14256,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0d12, 0x0d3a,
0x0d3d, 0x0d3d,
0x0d4e, 0x0d4e,
- 0x0d60, 0x0d61,
+ 0x0d5f, 0x0d61,
0x0d7a, 0x0d7f,
0x0d85, 0x0d96,
0x0d9a, 0x0db1,
@@ -13105,12 +14317,13 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1312, 0x1315,
0x1318, 0x135a,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -13124,11 +14337,11 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
- 0x19c1, 0x19c7,
+ 0x19b0, 0x19c9,
0x1a00, 0x1a16,
0x1a20, 0x1a54,
0x1aa7, 0x1aa7,
@@ -13211,21 +14424,20 @@ static const OnigCodePoint CR_ID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa61f,
0xa62a, 0xa62b,
0xa640, 0xa66e,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa6a0, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -13233,17 +14445,21 @@ static const OnigCodePoint CR_ID_Start[] = {
0xa882, 0xa8b3,
0xa8f2, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa90a, 0xa925,
0xa930, 0xa946,
0xa960, 0xa97c,
0xa984, 0xa9b2,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -13257,7 +14473,9 @@ static const OnigCodePoint CR_ID_Start[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabe2,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabe2,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
@@ -13296,19 +14514,29 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -13318,25 +14546,75 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x11350, 0x11350,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x115d8, 0x115db,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x11700, 0x11719,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -13367,6 +14645,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -13403,12 +14682,13 @@ static const OnigCodePoint CR_ID_Start[] = {
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_ID_Start */
/* 'ID_Continue': Derived Property */
static const OnigCodePoint CR_ID_Continue[] = {
- 564,
+ 651,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -13427,13 +14707,14 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0300, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
0x0483, 0x0487,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -13457,14 +14738,10 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0963,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -13507,6 +14784,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0aef,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -13538,20 +14816,19 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -13565,7 +14842,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -13573,7 +14850,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d6f,
0x0d7a, 0x0d7f,
0x0d82, 0x0d83,
@@ -13586,6 +14863,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e4e,
@@ -13645,12 +14923,13 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x135d, 0x135f,
0x1369, 0x1371,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1734,
@@ -13667,7 +14946,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1946, 0x196d,
@@ -13681,6 +14960,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abd,
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
@@ -13690,7 +14970,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
0x1cd4, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -13763,37 +15044,36 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
0xa674, 0xa67d,
- 0xa67f, 0xa697,
- 0xa69f, 0xa6f1,
+ 0xa67f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa827,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
0xa8e0, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa900, 0xa92d,
0xa930, 0xa953,
0xa960, 0xa97c,
0xa980, 0xa9c0,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa7a, 0xaac2,
0xaadb, 0xaadd,
0xaae0, 0xaaef,
0xaaf2, 0xaaf6,
@@ -13802,7 +15082,9 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabea,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabea,
0xabec, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
@@ -13824,7 +15106,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfb,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0xfe33, 0xfe34,
0xfe4d, 0xfe4f,
0xfe70, 0xfe74,
@@ -13849,20 +15131,31 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x101fd, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x102e0, 0x102e0,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -13875,29 +15168,94 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae6,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11000, 0x11046,
0x11066, 0x1106f,
- 0x11080, 0x110ba,
+ 0x1107f, 0x110ba,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
0x11180, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111ca, 0x111cc,
+ 0x111d0, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x11237,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x115d8, 0x115dd,
+ 0x11600, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x11739,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af4,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -13935,6 +15293,14 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1da00, 0x1da36,
+ 0x1da3b, 0x1da6c,
+ 0x1da75, 0x1da75,
+ 0x1da84, 0x1da84,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e800, 0x1e8c4,
+ 0x1e8d0, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -13971,13 +15337,14 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
0xe0100, 0xe01ef,
}; /* CR_ID_Continue */
/* 'XID_Start': Derived Property */
static const OnigCodePoint CR_XID_Start[] = {
- 495,
+ 562,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -13993,13 +15360,14 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -14025,14 +15393,12 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b4,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
+ 0x0971, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -14063,6 +15429,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0abd, 0x0abd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
+ 0x0af9, 0x0af9,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
0x0b13, 0x0b28,
@@ -14087,10 +15454,9 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c61,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
@@ -14106,7 +15472,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0d12, 0x0d3a,
0x0d3d, 0x0d3d,
0x0d4e, 0x0d4e,
- 0x0d60, 0x0d61,
+ 0x0d5f, 0x0d61,
0x0d7a, 0x0d7f,
0x0d85, 0x0d96,
0x0d9a, 0x0db1,
@@ -14167,12 +15533,13 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1312, 0x1315,
0x1318, 0x135a,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -14186,11 +15553,11 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
- 0x19c1, 0x19c7,
+ 0x19b0, 0x19c9,
0x1a00, 0x1a16,
0x1a20, 0x1a54,
0x1aa7, 0x1aa7,
@@ -14273,21 +15640,20 @@ static const OnigCodePoint CR_XID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa61f,
0xa62a, 0xa62b,
0xa640, 0xa66e,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa6a0, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -14295,17 +15661,21 @@ static const OnigCodePoint CR_XID_Start[] = {
0xa882, 0xa8b3,
0xa8f2, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa90a, 0xa925,
0xa930, 0xa946,
0xa960, 0xa97c,
0xa984, 0xa9b2,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -14319,7 +15689,9 @@ static const OnigCodePoint CR_XID_Start[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabe2,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabe2,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
@@ -14365,19 +15737,29 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -14387,25 +15769,75 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x11350, 0x11350,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x115d8, 0x115db,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x11700, 0x11719,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -14436,6 +15868,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -14472,12 +15905,13 @@ static const OnigCodePoint CR_XID_Start[] = {
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_XID_Start */
/* 'XID_Continue': Derived Property */
static const OnigCodePoint CR_XID_Continue[] = {
- 571,
+ 658,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -14496,13 +15930,14 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0300, 0x0374,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
0x0483, 0x0487,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -14526,14 +15961,10 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0963,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -14576,6 +16007,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0aef,
+ 0x0af9, 0x0af9,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -14607,20 +16039,19 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -14634,7 +16065,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -14642,7 +16073,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d6f,
0x0d7a, 0x0d7f,
0x0d82, 0x0d83,
@@ -14655,6 +16086,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e4e,
@@ -14714,12 +16146,13 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x135d, 0x135f,
0x1369, 0x1371,
0x1380, 0x138f,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1401, 0x166c,
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1734,
@@ -14736,7 +16169,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1946, 0x196d,
@@ -14750,6 +16183,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abd,
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
@@ -14759,7 +16193,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
0x1cd4, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -14833,37 +16268,36 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
0xa674, 0xa67d,
- 0xa67f, 0xa697,
- 0xa69f, 0xa6f1,
+ 0xa67f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa827,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
0xa8e0, 0xa8f7,
0xa8fb, 0xa8fb,
+ 0xa8fd, 0xa8fd,
0xa900, 0xa92d,
0xa930, 0xa953,
0xa960, 0xa97c,
0xa980, 0xa9c0,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa7a, 0xaac2,
0xaadb, 0xaadd,
0xaae0, 0xaaef,
0xaaf2, 0xaaf6,
@@ -14872,7 +16306,9 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabea,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab65,
+ 0xab70, 0xabea,
0xabec, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
@@ -14895,7 +16331,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdf9,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0xfe33, 0xfe34,
0xfe4d, 0xfe4f,
0xfe71, 0xfe71,
@@ -14925,20 +16361,31 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x101fd, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x102e0, 0x102e0,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -14951,29 +16398,94 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae6,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
0x11000, 0x11046,
0x11066, 0x1106f,
- 0x11080, 0x110ba,
+ 0x1107f, 0x110ba,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
0x11180, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111ca, 0x111cc,
+ 0x111d0, 0x111da,
+ 0x111dc, 0x111dc,
+ 0x11200, 0x11211,
+ 0x11213, 0x11237,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a8,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x115d8, 0x115dd,
+ 0x11600, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x11739,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af4,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -15011,6 +16523,14 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1da00, 0x1da36,
+ 0x1da3b, 0x1da6c,
+ 0x1da75, 0x1da75,
+ 0x1da84, 0x1da84,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e800, 0x1e8c4,
+ 0x1e8d0, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -15047,18 +16567,20 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
0xe0100, 0xe01ef,
}; /* CR_XID_Continue */
/* 'Default_Ignorable_Code_Point': Derived Property */
static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
- 15,
+ 17,
0x00ad, 0x00ad,
0x034f, 0x034f,
+ 0x061c, 0x061c,
0x115f, 0x1160,
0x17b4, 0x17b5,
- 0x180b, 0x180d,
+ 0x180b, 0x180e,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x206f,
@@ -15067,13 +16589,14 @@ static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
0xfeff, 0xfeff,
0xffa0, 0xffa0,
0xfff0, 0xfff8,
+ 0x1bca0, 0x1bca3,
0x1d173, 0x1d17a,
0xe0000, 0xe0fff,
}; /* CR_Default_Ignorable_Code_Point */
/* 'Grapheme_Extend': Derived Property */
static const OnigCodePoint CR_Grapheme_Extend[] = {
- 232,
+ 283,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -15097,8 +16620,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0902,
+ 0x08e3, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
0x0941, 0x0948,
@@ -15138,11 +16660,13 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0bc0, 0x0bc0,
0x0bcd, 0x0bcd,
0x0bd7, 0x0bd7,
+ 0x0c00, 0x0c00,
0x0c3e, 0x0c40,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
+ 0x0c81, 0x0c81,
0x0cbc, 0x0cbc,
0x0cbf, 0x0cbf,
0x0cc2, 0x0cc2,
@@ -15150,6 +16674,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0ccc, 0x0ccd,
0x0cd5, 0x0cd6,
0x0ce2, 0x0ce3,
+ 0x0d01, 0x0d01,
0x0d3e, 0x0d3e,
0x0d41, 0x0d44,
0x0d4d, 0x0d4d,
@@ -15205,6 +16730,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1932, 0x1932,
0x1939, 0x193b,
0x1a17, 0x1a18,
+ 0x1a1b, 0x1a1b,
0x1a56, 0x1a56,
0x1a58, 0x1a5e,
0x1a60, 0x1a60,
@@ -15212,6 +16738,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1a65, 0x1a6c,
0x1a73, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b03,
0x1b34, 0x1b34,
0x1b36, 0x1b3a,
@@ -15221,7 +16748,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
- 0x1bab, 0x1bab,
+ 0x1bab, 0x1bad,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -15233,7 +16760,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x200c, 0x200d,
0x20d0, 0x20f0,
@@ -15244,7 +16772,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x3099, 0x309a,
0xa66f, 0xa672,
0xa674, 0xa67d,
- 0xa69f, 0xa69f,
+ 0xa69e, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -15258,11 +16786,13 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xa9b3, 0xa9b3,
0xa9b6, 0xa9b9,
0xa9bc, 0xa9bc,
+ 0xa9e5, 0xa9e5,
0xaa29, 0xaa2e,
0xaa31, 0xaa32,
0xaa35, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4c,
+ 0xaa7c, 0xaa7c,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -15275,29 +16805,66 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xabed, 0xabed,
0xfb1e, 0xfb1e,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0xff9e, 0xff9f,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11001, 0x11001,
0x11038, 0x11046,
- 0x11080, 0x11081,
+ 0x1107f, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x11100, 0x11102,
0x11127, 0x1112b,
0x1112d, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11181,
0x111b6, 0x111be,
+ 0x111ca, 0x111cc,
+ 0x1122f, 0x11231,
+ 0x11234, 0x11234,
+ 0x11236, 0x11237,
+ 0x112df, 0x112df,
+ 0x112e3, 0x112ea,
+ 0x11300, 0x11301,
+ 0x1133c, 0x1133c,
+ 0x1133e, 0x1133e,
+ 0x11340, 0x11340,
+ 0x11357, 0x11357,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b0, 0x114b0,
+ 0x114b3, 0x114b8,
+ 0x114ba, 0x114ba,
+ 0x114bd, 0x114bd,
+ 0x114bf, 0x114c0,
+ 0x114c2, 0x114c3,
+ 0x115af, 0x115af,
+ 0x115b2, 0x115b5,
+ 0x115bc, 0x115bd,
+ 0x115bf, 0x115c0,
+ 0x115dc, 0x115dd,
+ 0x11633, 0x1163a,
+ 0x1163d, 0x1163d,
+ 0x1163f, 0x11640,
0x116ab, 0x116ab,
0x116ad, 0x116ad,
0x116b0, 0x116b5,
0x116b7, 0x116b7,
+ 0x1171d, 0x1171f,
+ 0x11722, 0x11725,
+ 0x11727, 0x1172b,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
0x16f8f, 0x16f92,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d165,
0x1d167, 0x1d169,
0x1d16e, 0x1d172,
@@ -15305,27 +16872,34 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1da00, 0x1da36,
+ 0x1da3b, 0x1da6c,
+ 0x1da75, 0x1da75,
+ 0x1da84, 0x1da84,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e8d0, 0x1e8d6,
0xe0100, 0xe01ef,
}; /* CR_Grapheme_Extend */
/* 'Grapheme_Base': Derived Property */
static const OnigCodePoint CR_Grapheme_Base[] = {
- 643,
+ 743,
0x0020, 0x007e,
0x00a0, 0x00ac,
0x00ae, 0x02ff,
0x0370, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x0482,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x05be, 0x05be,
0x05c0, 0x05c0,
0x05c3, 0x05c3,
@@ -15354,16 +16928,14 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0830, 0x083e,
0x0840, 0x0858,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b4,
0x0903, 0x0939,
0x093b, 0x093b,
0x093d, 0x0940,
0x0949, 0x094c,
0x094e, 0x0950,
0x0958, 0x0961,
- 0x0964, 0x0977,
- 0x0979, 0x097f,
+ 0x0964, 0x0980,
0x0982, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
@@ -15405,6 +16977,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
0x0ae6, 0x0af1,
+ 0x0af9, 0x0af9,
0x0b02, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -15439,11 +17012,10 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
0x0c41, 0x0c44,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c61,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
@@ -15471,7 +17043,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4c,
0x0d4e, 0x0d4e,
- 0x0d60, 0x0d61,
+ 0x0d5f, 0x0d61,
0x0d66, 0x0d75,
0x0d79, 0x0d7f,
0x0d82, 0x0d83,
@@ -15482,6 +17054,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0dc0, 0x0dc6,
0x0dd0, 0x0dd1,
0x0dd8, 0x0dde,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e30,
0x0e32, 0x0e33,
@@ -15549,9 +17122,10 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1318, 0x135a,
0x1360, 0x137c,
0x1380, 0x1399,
- 0x13a0, 0x13f4,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
0x1400, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -15567,13 +17141,12 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x17e0, 0x17e9,
0x17f0, 0x17f9,
0x1800, 0x180a,
- 0x180e, 0x180e,
0x1810, 0x1819,
0x1820, 0x1877,
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1923, 0x1926,
0x1929, 0x192b,
0x1930, 0x1931,
@@ -15585,7 +17158,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x19b0, 0x19c9,
0x19d0, 0x19da,
0x19de, 0x1a16,
- 0x1a19, 0x1a1b,
+ 0x1a19, 0x1a1a,
0x1a1e, 0x1a55,
0x1a57, 0x1a57,
0x1a61, 0x1a61,
@@ -15604,7 +17177,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1b82, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bac, 0x1be5,
+ 0x1bae, 0x1be5,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -15642,14 +17215,17 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2070, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x20a0, 0x20be,
+ 0x2100, 0x218b,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cee,
@@ -15668,7 +17244,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2e00, 0x2e3b,
+ 0x2e00, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -15684,19 +17260,18 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
+ 0x4dc0, 0x9fd5,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
0xa640, 0xa66e,
0xa673, 0xa673,
- 0xa67e, 0xa697,
+ 0xa67e, 0xa69d,
0xa6a0, 0xa6ef,
0xa6f2, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa700, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa824,
@@ -15705,7 +17280,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa840, 0xa877,
0xa880, 0xa8c3,
0xa8ce, 0xa8d9,
- 0xa8f2, 0xa8fb,
+ 0xa8f2, 0xa8fd,
0xa900, 0xa925,
0xa92e, 0xa946,
0xa952, 0xa953,
@@ -15715,7 +17290,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa9ba, 0xa9bb,
0xa9bd, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9e4,
+ 0xa9e6, 0xa9fe,
0xaa00, 0xaa28,
0xaa2f, 0xaa30,
0xaa33, 0xaa34,
@@ -15724,7 +17300,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xaa4d, 0xaa4d,
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
- 0xaa80, 0xaaaf,
+ 0xaa7d, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -15737,7 +17313,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
- 0xabc0, 0xabe4,
+ 0xab30, 0xab65,
+ 0xab70, 0xabe4,
0xabe6, 0xabe7,
0xabe9, 0xabec,
0xabf0, 0xabf9,
@@ -15783,43 +17360,61 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fc,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e1, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
+ 0x108fb, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
0x10980, 0x109b7,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a00,
+ 0x109bc, 0x109cf,
+ 0x109d2, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a40, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae4,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x10cfa, 0x10cff,
0x10e60, 0x10e7e,
0x11000, 0x11000,
0x11002, 0x11037,
@@ -15834,23 +17429,98 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x11103, 0x11126,
0x1112c, 0x1112c,
0x11136, 0x11143,
+ 0x11150, 0x11172,
+ 0x11174, 0x11176,
0x11182, 0x111b5,
- 0x111bf, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x111bf, 0x111c9,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111df,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122e,
+ 0x11232, 0x11233,
+ 0x11235, 0x11235,
+ 0x11238, 0x1123d,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a9,
+ 0x112b0, 0x112de,
+ 0x112e0, 0x112e2,
+ 0x112f0, 0x112f9,
+ 0x11302, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x1133f, 0x1133f,
+ 0x11341, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x1135d, 0x11363,
+ 0x11480, 0x114af,
+ 0x114b1, 0x114b2,
+ 0x114b9, 0x114b9,
+ 0x114bb, 0x114bc,
+ 0x114be, 0x114be,
+ 0x114c1, 0x114c1,
+ 0x114c4, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115ae,
+ 0x115b0, 0x115b1,
+ 0x115b8, 0x115bb,
+ 0x115be, 0x115be,
+ 0x115c1, 0x115db,
+ 0x11600, 0x11632,
+ 0x1163b, 0x1163c,
+ 0x1163e, 0x1163e,
+ 0x11641, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116aa,
0x116ac, 0x116ac,
0x116ae, 0x116af,
0x116b6, 0x116b6,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x11700, 0x11719,
+ 0x11720, 0x11721,
+ 0x11726, 0x11726,
+ 0x11730, 0x1173f,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x12480, 0x12543,
0x13000, 0x1342e,
+ 0x14400, 0x14646,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af5, 0x16af5,
+ 0x16b00, 0x16b2f,
+ 0x16b37, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bc9c,
+ 0x1bc9f, 0x1bc9f,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d164,
@@ -15858,7 +17528,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1d16a, 0x1d16d,
0x1d183, 0x1d184,
0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1dd,
+ 0x1d1ae, 0x1d1e8,
0x1d200, 0x1d241,
0x1d245, 0x1d245,
0x1d300, 0x1d356,
@@ -15883,7 +17553,13 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1d54a, 0x1d550,
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
+ 0x1d7ce, 0x1d9ff,
+ 0x1da37, 0x1da3a,
+ 0x1da6d, 0x1da74,
+ 0x1da76, 0x1da83,
+ 0x1da85, 0x1da8b,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8cf,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -15921,10 +17597,10 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -15932,33 +17608,31 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
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,
+ 0x1f300, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_Grapheme_Base */
/* 'Grapheme_Link': Derived Property */
static const OnigCodePoint CR_Grapheme_Link[] = {
- 33,
+ 41,
0x094d, 0x094d,
0x09cd, 0x09cd,
0x0a4d, 0x0a4d,
@@ -15988,15 +17662,23 @@ static const OnigCodePoint CR_Grapheme_Link[] = {
0xabed, 0xabed,
0x10a3f, 0x10a3f,
0x11046, 0x11046,
+ 0x1107f, 0x1107f,
0x110b9, 0x110b9,
0x11133, 0x11134,
0x111c0, 0x111c0,
+ 0x11235, 0x11235,
+ 0x112ea, 0x112ea,
+ 0x1134d, 0x1134d,
+ 0x114c2, 0x114c2,
+ 0x115bf, 0x115bf,
+ 0x1163f, 0x1163f,
0x116b6, 0x116b6,
+ 0x1172b, 0x1172b,
}; /* CR_Grapheme_Link */
/* 'Common': Script */
static const OnigCodePoint CR_Common[] = {
- 157,
+ 161,
0x0000, 0x0040,
0x005b, 0x0060,
0x007b, 0x00a9,
@@ -16012,11 +17694,11 @@ static const OnigCodePoint CR_Common[] = {
0x0385, 0x0385,
0x0387, 0x0387,
0x0589, 0x0589,
+ 0x0605, 0x0605,
0x060c, 0x060c,
- 0x061b, 0x061b,
+ 0x061b, 0x061c,
0x061f, 0x061f,
0x0640, 0x0640,
- 0x0660, 0x0669,
0x06dd, 0x06dd,
0x0964, 0x0965,
0x0e3f, 0x0e3f,
@@ -16033,24 +17715,27 @@ static const OnigCodePoint CR_Common[] = {
0x1cf5, 0x1cf6,
0x2000, 0x200b,
0x200e, 0x2064,
- 0x206a, 0x2070,
+ 0x2066, 0x2070,
0x2074, 0x207e,
0x2080, 0x208e,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20be,
0x2100, 0x2125,
0x2127, 0x2129,
0x212c, 0x2131,
0x2133, 0x214d,
0x214f, 0x215f,
- 0x2189, 0x2189,
- 0x2190, 0x23f3,
+ 0x2189, 0x218b,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x27ff,
- 0x2900, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2e00, 0x2e3b,
+ 0x2460, 0x27ff,
+ 0x2900, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
+ 0x2e00, 0x2e42,
0x2ff0, 0x2ffb,
0x3000, 0x3004,
0x3006, 0x3006,
@@ -16069,8 +17754,10 @@ static const OnigCodePoint CR_Common[] = {
0xa700, 0xa721,
0xa788, 0xa78a,
0xa830, 0xa839,
+ 0xa92e, 0xa92e,
+ 0xa9cf, 0xa9cf,
+ 0xab5b, 0xab5b,
0xfd3e, 0xfd3f,
- 0xfdfd, 0xfdfd,
0xfe10, 0xfe19,
0xfe30, 0xfe52,
0xfe54, 0xfe66,
@@ -16089,13 +17776,15 @@ static const OnigCodePoint CR_Common[] = {
0x10137, 0x1013f,
0x10190, 0x1019b,
0x101d0, 0x101fc,
+ 0x102e1, 0x102fb,
+ 0x1bca0, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d166,
0x1d16a, 0x1d17a,
0x1d183, 0x1d184,
0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1dd,
+ 0x1d1ae, 0x1d1e8,
0x1d300, 0x1d356,
0x1d360, 0x1d371,
0x1d400, 0x1d454,
@@ -16122,10 +17811,10 @@ static const OnigCodePoint CR_Common[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -16134,31 +17823,28 @@ static const OnigCodePoint CR_Common[] = {
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,
+ 0x1f300, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
}; /* CR_Common */
/* 'Latin': Script */
static const OnigCodePoint CR_Latin[] = {
- 30,
+ 31,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -16182,10 +17868,11 @@ static const OnigCodePoint CR_Latin[] = {
0x2160, 0x2188,
0x2c60, 0x2c7f,
0xa722, 0xa787,
- 0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa7ff,
+ 0xa78b, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa7ff,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab64,
0xfb00, 0xfb06,
0xff21, 0xff3a,
0xff41, 0xff5a,
@@ -16193,10 +17880,11 @@ static const OnigCodePoint CR_Latin[] = {
/* 'Greek': Script */
static const OnigCodePoint CR_Greek[] = {
- 33,
+ 36,
0x0370, 0x0373,
0x0375, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0384, 0x0384,
0x0386, 0x0386,
0x0388, 0x038a,
@@ -16225,7 +17913,9 @@ static const OnigCodePoint CR_Greek[] = {
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
0x2126, 0x2126,
- 0x10140, 0x1018a,
+ 0xab65, 0xab65,
+ 0x10140, 0x1018c,
+ 0x101a0, 0x101a0,
0x1d200, 0x1d245,
}; /* CR_Greek */
@@ -16233,12 +17923,12 @@ static const OnigCodePoint CR_Greek[] = {
static const OnigCodePoint CR_Cyrillic[] = {
7,
0x0400, 0x0484,
- 0x0487, 0x0527,
+ 0x0487, 0x052f,
0x1d2b, 0x1d2b,
0x1d78, 0x1d78,
0x2de0, 0x2dff,
- 0xa640, 0xa697,
- 0xa69f, 0xa69f,
+ 0xa640, 0xa69f,
+ 0xfe2e, 0xfe2f,
}; /* CR_Cyrillic */
/* 'Armenian': Script */
@@ -16248,7 +17938,7 @@ static const OnigCodePoint CR_Armenian[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x058a, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0xfb13, 0xfb17,
}; /* CR_Armenian */
@@ -16268,26 +17958,24 @@ static const OnigCodePoint CR_Hebrew[] = {
/* 'Arabic': Script */
static const OnigCodePoint CR_Arabic[] = {
- 56,
+ 54,
0x0600, 0x0604,
0x0606, 0x060b,
0x060d, 0x061a,
0x061e, 0x061e,
0x0620, 0x063f,
0x0641, 0x064a,
- 0x0656, 0x065e,
- 0x066a, 0x066f,
+ 0x0656, 0x066f,
0x0671, 0x06dc,
0x06de, 0x06ff,
0x0750, 0x077f,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
+ 0x08a0, 0x08b4,
+ 0x08e3, 0x08ff,
0xfb50, 0xfbc1,
0xfbd3, 0xfd3d,
0xfd50, 0xfd8f,
0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfc,
+ 0xfdf0, 0xfdfd,
0xfe70, 0xfe74,
0xfe76, 0xfefc,
0x10e60, 0x10e7e,
@@ -16343,18 +18031,17 @@ static const OnigCodePoint CR_Thaana[] = {
/* 'Devanagari': Script */
static const OnigCodePoint CR_Devanagari[] = {
- 5,
+ 4,
0x0900, 0x0950,
0x0953, 0x0963,
- 0x0966, 0x0977,
- 0x0979, 0x097f,
- 0xa8e0, 0xa8fb,
+ 0x0966, 0x097f,
+ 0xa8e0, 0xa8fd,
}; /* CR_Devanagari */
/* 'Bengali': Script */
static const OnigCodePoint CR_Bengali[] = {
14,
- 0x0981, 0x0983,
+ 0x0980, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -16393,7 +18080,7 @@ static const OnigCodePoint CR_Gurmukhi[] = {
/* 'Gujarati': Script */
static const OnigCodePoint CR_Gujarati[] = {
- 13,
+ 14,
0x0a81, 0x0a83,
0x0a85, 0x0a8d,
0x0a8f, 0x0a91,
@@ -16407,6 +18094,7 @@ static const OnigCodePoint CR_Gujarati[] = {
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
0x0ae6, 0x0af1,
+ 0x0af9, 0x0af9,
}; /* CR_Gujarati */
/* 'Oriya': Script */
@@ -16451,18 +18139,17 @@ static const OnigCodePoint CR_Tamil[] = {
/* 'Telugu': Script */
static const OnigCodePoint CR_Telugu[] = {
- 14,
- 0x0c01, 0x0c03,
+ 13,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
+ 0x0c58, 0x0c5a,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
@@ -16471,7 +18158,7 @@ static const OnigCodePoint CR_Telugu[] = {
/* 'Kannada': Script */
static const OnigCodePoint CR_Kannada[] = {
14,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -16490,7 +18177,7 @@ static const OnigCodePoint CR_Kannada[] = {
/* 'Malayalam': Script */
static const OnigCodePoint CR_Malayalam[] = {
11,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -16498,14 +18185,14 @@ static const OnigCodePoint CR_Malayalam[] = {
0x0d46, 0x0d48,
0x0d4a, 0x0d4e,
0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
+ 0x0d5f, 0x0d63,
0x0d66, 0x0d75,
0x0d79, 0x0d7f,
}; /* CR_Malayalam */
/* 'Sinhala': Script */
static const OnigCodePoint CR_Sinhala[] = {
- 11,
+ 13,
0x0d82, 0x0d83,
0x0d85, 0x0d96,
0x0d9a, 0x0db1,
@@ -16516,7 +18203,9 @@ static const OnigCodePoint CR_Sinhala[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
+ 0x111e1, 0x111f4,
}; /* CR_Sinhala */
/* 'Thai': Script */
@@ -16563,9 +18252,10 @@ static const OnigCodePoint CR_Tibetan[] = {
/* 'Myanmar': Script */
static const OnigCodePoint CR_Myanmar[] = {
- 2,
+ 3,
0x1000, 0x109f,
- 0xaa60, 0xaa7b,
+ 0xa9e0, 0xa9fe,
+ 0xaa60, 0xaa7f,
}; /* CR_Myanmar */
/* 'Georgian': Script */
@@ -16639,8 +18329,10 @@ static const OnigCodePoint CR_Ethiopic[] = {
/* 'Cherokee': Script */
static const OnigCodePoint CR_Cherokee[] = {
- 1,
- 0x13a0, 0x13f4,
+ 3,
+ 0x13a0, 0x13f5,
+ 0x13f8, 0x13fd,
+ 0xab70, 0xabbf,
}; /* CR_Cherokee */
/* 'Canadian_Aboriginal': Script */
@@ -16660,7 +18352,7 @@ static const OnigCodePoint CR_Ogham[] = {
static const OnigCodePoint CR_Runic[] = {
2,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
}; /* CR_Runic */
/* 'Khmer': Script */
@@ -16715,7 +18407,7 @@ static const OnigCodePoint CR_Bopomofo[] = {
/* 'Han': Script */
static const OnigCodePoint CR_Han[] = {
- 15,
+ 16,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -16724,12 +18416,13 @@ static const OnigCodePoint CR_Han[] = {
0x3021, 0x3029,
0x3038, 0x303b,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_Han */
@@ -16742,9 +18435,8 @@ static const OnigCodePoint CR_Yi[] = {
/* 'Old_Italic': Script */
static const OnigCodePoint CR_Old_Italic[] = {
- 2,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 1,
+ 0x10300, 0x10323,
}; /* CR_Old_Italic */
/* 'Gothic': Script */
@@ -16761,27 +18453,29 @@ static const OnigCodePoint CR_Deseret[] = {
/* 'Inherited': Script */
static const OnigCodePoint CR_Inherited[] = {
- 25,
+ 27,
0x0300, 0x036f,
0x0485, 0x0486,
0x064b, 0x0655,
- 0x065f, 0x065f,
0x0670, 0x0670,
0x0951, 0x0952,
+ 0x1ab0, 0x1abe,
0x1cd0, 0x1cd2,
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x200c, 0x200d,
0x20d0, 0x20f0,
0x302a, 0x302d,
0x3099, 0x309a,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
@@ -16819,7 +18513,7 @@ static const OnigCodePoint CR_Tagbanwa[] = {
/* 'Limbu': Script */
static const OnigCodePoint CR_Limbu[] = {
5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -16956,10 +18650,11 @@ static const OnigCodePoint CR_Balinese[] = {
/* 'Cuneiform': Script */
static const OnigCodePoint CR_Cuneiform[] = {
- 3,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 4,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x12480, 0x12543,
}; /* CR_Cuneiform */
/* 'Phoenician': Script */
@@ -17017,8 +18712,9 @@ static const OnigCodePoint CR_Saurashtra[] = {
/* 'Kayah_Li': Script */
static const OnigCodePoint CR_Kayah_Li[] = {
- 1,
- 0xa900, 0xa92f,
+ 2,
+ 0xa900, 0xa92d,
+ 0xa92f, 0xa92f,
}; /* CR_Kayah_Li */
/* 'Rejang': Script */
@@ -17110,7 +18806,7 @@ static const OnigCodePoint CR_Bamum[] = {
static const OnigCodePoint CR_Javanese[] = {
3,
0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
+ 0xa9d0, 0xa9d9,
0xa9de, 0xa9df,
}; /* CR_Javanese */
@@ -17170,9 +18866,10 @@ static const OnigCodePoint CR_Batak[] = {
/* 'Brahmi': Script */
static const OnigCodePoint CR_Brahmi[] = {
- 2,
+ 3,
0x11000, 0x1104d,
0x11052, 0x1106f,
+ 0x1107f, 0x1107f,
}; /* CR_Brahmi */
/* 'Mandaic': Script */
@@ -17191,9 +18888,10 @@ static const OnigCodePoint CR_Chakma[] = {
/* 'Meroitic_Cursive': Script */
static const OnigCodePoint CR_Meroitic_Cursive[] = {
- 2,
+ 3,
0x109a0, 0x109b7,
- 0x109be, 0x109bf,
+ 0x109bc, 0x109cf,
+ 0x109d2, 0x109ff,
}; /* CR_Meroitic_Cursive */
/* 'Meroitic_Hieroglyphs': Script */
@@ -17213,8 +18911,8 @@ static const OnigCodePoint CR_Miao[] = {
/* 'Sharada': Script */
static const OnigCodePoint CR_Sharada[] = {
2,
- 0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x11180, 0x111cd,
+ 0x111d0, 0x111df,
}; /* CR_Sharada */
/* 'Sora_Sompeng': Script */
@@ -17231,14 +18929,241 @@ static const OnigCodePoint CR_Takri[] = {
0x116c0, 0x116c9,
}; /* CR_Takri */
+/* 'Caucasian_Albanian': Script */
+static const OnigCodePoint CR_Caucasian_Albanian[] = {
+ 2,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+}; /* CR_Caucasian_Albanian */
+
+/* 'Bassa_Vah': Script */
+static const OnigCodePoint CR_Bassa_Vah[] = {
+ 2,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+}; /* CR_Bassa_Vah */
+
+/* 'Duployan': Script */
+static const OnigCodePoint CR_Duployan[] = {
+ 5,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bc9f,
+}; /* CR_Duployan */
+
+/* 'Elbasan': Script */
+static const OnigCodePoint CR_Elbasan[] = {
+ 1,
+ 0x10500, 0x10527,
+}; /* CR_Elbasan */
+
+/* 'Grantha': Script */
+static const OnigCodePoint CR_Grantha[] = {
+ 15,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+}; /* CR_Grantha */
+
+/* 'Pahawh_Hmong': Script */
+static const OnigCodePoint CR_Pahawh_Hmong[] = {
+ 5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
+}; /* CR_Pahawh_Hmong */
+
+/* 'Khojki': Script */
+static const OnigCodePoint CR_Khojki[] = {
+ 2,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+}; /* CR_Khojki */
+
+/* 'Linear_A': Script */
+static const OnigCodePoint CR_Linear_A[] = {
+ 3,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
+}; /* CR_Linear_A */
+
+/* 'Mahajani': Script */
+static const OnigCodePoint CR_Mahajani[] = {
+ 1,
+ 0x11150, 0x11176,
+}; /* CR_Mahajani */
+
+/* 'Manichaean': Script */
+static const OnigCodePoint CR_Manichaean[] = {
+ 2,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
+}; /* CR_Manichaean */
+
+/* 'Mende_Kikakui': Script */
+static const OnigCodePoint CR_Mende_Kikakui[] = {
+ 2,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
+}; /* CR_Mende_Kikakui */
+
+/* 'Modi': Script */
+static const OnigCodePoint CR_Modi[] = {
+ 2,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
+}; /* CR_Modi */
+
+/* 'Mro': Script */
+static const OnigCodePoint CR_Mro[] = {
+ 3,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+}; /* CR_Mro */
+
+/* 'Old_North_Arabian': Script */
+static const OnigCodePoint CR_Old_North_Arabian[] = {
+ 1,
+ 0x10a80, 0x10a9f,
+}; /* CR_Old_North_Arabian */
+
+/* 'Nabataean': Script */
+static const OnigCodePoint CR_Nabataean[] = {
+ 2,
+ 0x10880, 0x1089e,
+ 0x108a7, 0x108af,
+}; /* CR_Nabataean */
+
+/* 'Palmyrene': Script */
+static const OnigCodePoint CR_Palmyrene[] = {
+ 1,
+ 0x10860, 0x1087f,
+}; /* CR_Palmyrene */
+
+/* 'Pau_Cin_Hau': Script */
+static const OnigCodePoint CR_Pau_Cin_Hau[] = {
+ 1,
+ 0x11ac0, 0x11af8,
+}; /* CR_Pau_Cin_Hau */
+
+/* 'Old_Permic': Script */
+static const OnigCodePoint CR_Old_Permic[] = {
+ 1,
+ 0x10350, 0x1037a,
+}; /* CR_Old_Permic */
+
+/* 'Psalter_Pahlavi': Script */
+static const OnigCodePoint CR_Psalter_Pahlavi[] = {
+ 3,
+ 0x10b80, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
+}; /* CR_Psalter_Pahlavi */
+
+/* 'Siddham': Script */
+static const OnigCodePoint CR_Siddham[] = {
+ 2,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115dd,
+}; /* CR_Siddham */
+
+/* 'Khudawadi': Script */
+static const OnigCodePoint CR_Khudawadi[] = {
+ 2,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+}; /* CR_Khudawadi */
+
+/* 'Tirhuta': Script */
+static const OnigCodePoint CR_Tirhuta[] = {
+ 2,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+}; /* CR_Tirhuta */
+
+/* 'Warang_Citi': Script */
+static const OnigCodePoint CR_Warang_Citi[] = {
+ 2,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+}; /* CR_Warang_Citi */
+
+/* 'Ahom': Script */
+static const OnigCodePoint CR_Ahom[] = {
+ 3,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x1173f,
+}; /* CR_Ahom */
+
+/* 'Anatolian_Hieroglyphs': Script */
+static const OnigCodePoint CR_Anatolian_Hieroglyphs[] = {
+ 1,
+ 0x14400, 0x14646,
+}; /* CR_Anatolian_Hieroglyphs */
+
+/* 'Hatran': Script */
+static const OnigCodePoint CR_Hatran[] = {
+ 3,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
+ 0x108fb, 0x108ff,
+}; /* CR_Hatran */
+
+/* 'Multani': Script */
+static const OnigCodePoint CR_Multani[] = {
+ 5,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a9,
+}; /* CR_Multani */
+
+/* 'Old_Hungarian': Script */
+static const OnigCodePoint CR_Old_Hungarian[] = {
+ 3,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x10cfa, 0x10cff,
+}; /* CR_Old_Hungarian */
+
+/* 'SignWriting': Script */
+static const OnigCodePoint CR_SignWriting[] = {
+ 3,
+ 0x1d800, 0x1da8b,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+}; /* CR_SignWriting */
+
/* 'White_Space': Binary Property */
#define CR_White_Space CR_Space
/* 'Bidi_Control': Binary Property */
static const OnigCodePoint CR_Bidi_Control[] = {
- 2,
+ 4,
+ 0x061c, 0x061c,
0x200e, 0x200f,
0x202a, 0x202e,
+ 0x2066, 0x2069,
}; /* CR_Bidi_Control */
/* 'Join_Control': Binary Property */
@@ -17249,7 +19174,7 @@ static const OnigCodePoint CR_Join_Control[] = {
/* 'Dash': Binary Property */
static const OnigCodePoint CR_Dash[] = {
- 20,
+ 21,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -17263,6 +19188,7 @@ static const OnigCodePoint CR_Dash[] = {
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
0x2e3a, 0x2e3b,
+ 0x2e40, 0x2e40,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -17289,13 +19215,14 @@ static const OnigCodePoint CR_Hyphen[] = {
/* 'Quotation_Mark': Binary Property */
static const OnigCodePoint CR_Quotation_Mark[] = {
- 12,
+ 13,
0x0022, 0x0022,
0x0027, 0x0027,
0x00ab, 0x00ab,
0x00bb, 0x00bb,
0x2018, 0x201f,
0x2039, 0x203a,
+ 0x2e42, 0x2e42,
0x300c, 0x300f,
0x301d, 0x301f,
0xfe41, 0xfe44,
@@ -17306,7 +19233,7 @@ static const OnigCodePoint CR_Quotation_Mark[] = {
/* 'Terminal_Punctuation': Binary Property */
static const OnigCodePoint CR_Terminal_Punctuation[] = {
- 70,
+ 90,
0x0021, 0x0021,
0x002c, 0x002c,
0x002e, 0x002e,
@@ -17333,6 +19260,7 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x1361, 0x1368,
0x166d, 0x166e,
0x16eb, 0x16ed,
+ 0x1735, 0x1736,
0x17d4, 0x17d6,
0x17da, 0x17da,
0x1802, 0x1805,
@@ -17346,6 +19274,8 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x203c, 0x203d,
0x2047, 0x2049,
0x2e2e, 0x2e2e,
+ 0x2e3c, 0x2e3c,
+ 0x2e41, 0x2e41,
0x3001, 0x3002,
0xa4fe, 0xa4ff,
0xa60d, 0xa60f,
@@ -17371,17 +19301,34 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x103d0, 0x103d0,
0x10857, 0x10857,
0x1091f, 0x1091f,
+ 0x10a56, 0x10a57,
+ 0x10af0, 0x10af5,
0x10b3a, 0x10b3f,
+ 0x10b99, 0x10b9c,
0x11047, 0x1104d,
0x110be, 0x110c1,
0x11141, 0x11143,
0x111c5, 0x111c6,
- 0x12470, 0x12473,
+ 0x111cd, 0x111cd,
+ 0x111de, 0x111df,
+ 0x11238, 0x1123c,
+ 0x112a9, 0x112a9,
+ 0x115c2, 0x115c5,
+ 0x115c9, 0x115d7,
+ 0x11641, 0x11642,
+ 0x1173c, 0x1173e,
+ 0x12470, 0x12474,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b39,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
+ 0x1da87, 0x1da8a,
}; /* CR_Terminal_Punctuation */
/* 'Other_Math': Binary Property */
static const OnigCodePoint CR_Other_Math[] = {
- 133,
+ 134,
0x005e, 0x005e,
0x03d0, 0x03d2,
0x03d5, 0x03d5,
@@ -17423,6 +19370,7 @@ static const OnigCodePoint CR_Other_Math[] = {
0x21d5, 0x21db,
0x21dd, 0x21dd,
0x21e4, 0x21e5,
+ 0x2308, 0x230b,
0x23b4, 0x23b5,
0x23b7, 0x23b7,
0x23d0, 0x23d0,
@@ -17533,7 +19481,7 @@ static const OnigCodePoint CR_Hex_Digit[] = {
/* 'Other_Alphabetic': Binary Property */
static const OnigCodePoint CR_Other_Alphabetic[] = {
- 158,
+ 178,
0x0345, 0x0345,
0x05b0, 0x05bd,
0x05bf, 0x05bf,
@@ -17555,9 +19503,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x081b, 0x0823,
0x0825, 0x0827,
0x0829, 0x082c,
- 0x08e4, 0x08e9,
- 0x08f0, 0x08fe,
- 0x0900, 0x0903,
+ 0x08e3, 0x08e9,
+ 0x08f0, 0x0903,
0x093a, 0x093b,
0x093e, 0x094c,
0x094e, 0x094f,
@@ -17592,19 +19539,19 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x0bc6, 0x0bc8,
0x0bca, 0x0bcc,
0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c3e, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4c,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0cbe, 0x0cc4,
0x0cc6, 0x0cc8,
0x0cca, 0x0ccc,
0x0cd5, 0x0cd6,
0x0ce2, 0x0ce3,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d3e, 0x0d44,
0x0d46, 0x0d48,
0x0d4a, 0x0d4c,
@@ -17644,8 +19591,6 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x18a9, 0x18a9,
0x1920, 0x192b,
0x1930, 0x1938,
- 0x19b0, 0x19c0,
- 0x19c8, 0x19c9,
0x1a17, 0x1a1b,
0x1a55, 0x1a5e,
0x1a61, 0x1a74,
@@ -17657,10 +19602,11 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x1be7, 0x1bf1,
0x1c24, 0x1c35,
0x1cf2, 0x1cf3,
+ 0x1de7, 0x1df4,
0x24b6, 0x24e9,
0x2de0, 0x2dff,
0xa674, 0xa67b,
- 0xa69f, 0xa69f,
+ 0xa69e, 0xa69f,
0xa823, 0xa827,
0xa880, 0xa881,
0xa8b4, 0xa8c3,
@@ -17679,6 +19625,7 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0xaaf5, 0xaaf5,
0xabe3, 0xabea,
0xfb1e, 0xfb1e,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
@@ -17690,29 +19637,51 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x11127, 0x11132,
0x11180, 0x11182,
0x111b3, 0x111bf,
+ 0x1122c, 0x11234,
+ 0x11237, 0x11237,
+ 0x112df, 0x112e8,
+ 0x11300, 0x11303,
+ 0x1133e, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134c,
+ 0x11357, 0x11357,
+ 0x11362, 0x11363,
+ 0x114b0, 0x114c1,
+ 0x115af, 0x115b5,
+ 0x115b8, 0x115be,
+ 0x115dc, 0x115dd,
+ 0x11630, 0x1163e,
+ 0x11640, 0x11640,
0x116ab, 0x116b5,
+ 0x1171d, 0x1172a,
+ 0x16b30, 0x16b36,
0x16f51, 0x16f7e,
+ 0x1bc9e, 0x1bc9e,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Other_Alphabetic */
/* 'Ideographic': Binary Property */
static const OnigCodePoint CR_Ideographic[] = {
- 11,
+ 12,
0x3006, 0x3007,
0x3021, 0x3029,
0x3038, 0x303a,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
0x2f800, 0x2fa1d,
}; /* CR_Ideographic */
/* 'Diacritic': Binary Property */
static const OnigCodePoint CR_Diacritic[] = {
- 125,
+ 147,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -17741,7 +19710,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0x07a6, 0x07b0,
0x07eb, 0x07f5,
0x0818, 0x0819,
- 0x08e4, 0x08fe,
+ 0x08e3, 0x08fe,
0x093c, 0x093c,
0x094d, 0x094d,
0x0951, 0x0954,
@@ -17781,6 +19750,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1939, 0x193b,
0x1a75, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abd,
0x1b34, 0x1b34,
0x1b44, 0x1b44,
0x1b6b, 0x1b73,
@@ -17790,8 +19760,10 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1cd0, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
+ 0x1cf8, 0x1cf9,
0x1d2c, 0x1d6a,
0x1dc4, 0x1dcf,
+ 0x1df5, 0x1df5,
0x1dfd, 0x1dff,
0x1fbd, 0x1fbd,
0x1fbf, 0x1fc1,
@@ -17807,6 +19779,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa66f, 0xa66f,
0xa67c, 0xa67d,
0xa67f, 0xa67f,
+ 0xa69c, 0xa69d,
0xa6f0, 0xa6f1,
0xa717, 0xa721,
0xa788, 0xa788,
@@ -17817,32 +19790,50 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa953, 0xa953,
0xa9b3, 0xa9b3,
0xa9c0, 0xa9c0,
- 0xaa7b, 0xaa7b,
+ 0xa9e5, 0xa9e5,
+ 0xaa7b, 0xaa7d,
0xaabf, 0xaac2,
0xaaf6, 0xaaf6,
+ 0xab5b, 0xab5f,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2f,
0xff3e, 0xff3e,
0xff40, 0xff40,
0xff70, 0xff70,
0xff9e, 0xff9f,
0xffe3, 0xffe3,
+ 0x102e0, 0x102e0,
+ 0x10ae5, 0x10ae6,
0x110b9, 0x110ba,
0x11133, 0x11134,
+ 0x11173, 0x11173,
0x111c0, 0x111c0,
+ 0x111ca, 0x111cc,
+ 0x11235, 0x11236,
+ 0x112e9, 0x112ea,
+ 0x1133c, 0x1133c,
+ 0x1134d, 0x1134d,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114c2, 0x114c3,
+ 0x115bf, 0x115c0,
+ 0x1163f, 0x1163f,
0x116b6, 0x116b7,
+ 0x1172b, 0x1172b,
+ 0x16af0, 0x16af4,
0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
+ 0x1e8d0, 0x1e8d6,
}; /* CR_Diacritic */
/* 'Extender': Binary Property */
static const OnigCodePoint CR_Extender[] = {
- 22,
+ 26,
0x00b7, 0x00b7,
0x02d0, 0x02d1,
0x0640, 0x0640,
@@ -17861,15 +19852,19 @@ static const OnigCodePoint CR_Extender[] = {
0xa015, 0xa015,
0xa60c, 0xa60c,
0xa9cf, 0xa9cf,
+ 0xa9e6, 0xa9e6,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
0xaaf3, 0xaaf4,
0xff70, 0xff70,
+ 0x1135d, 0x1135d,
+ 0x115c6, 0x115c8,
+ 0x16b42, 0x16b43,
}; /* CR_Extender */
/* 'Other_Lowercase': Binary Property */
static const OnigCodePoint CR_Other_Lowercase[] = {
- 18,
+ 20,
0x00aa, 0x00aa,
0x00ba, 0x00ba,
0x02b0, 0x02b8,
@@ -17886,15 +19881,20 @@ static const OnigCodePoint CR_Other_Lowercase[] = {
0x2170, 0x217f,
0x24d0, 0x24e9,
0x2c7c, 0x2c7d,
+ 0xa69c, 0xa69d,
0xa770, 0xa770,
0xa7f8, 0xa7f9,
+ 0xab5c, 0xab5f,
}; /* CR_Other_Lowercase */
/* 'Other_Uppercase': Binary Property */
static const OnigCodePoint CR_Other_Uppercase[] = {
- 2,
+ 5,
0x2160, 0x216f,
0x24b6, 0x24cf,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Other_Uppercase */
/* 'Noncharacter_Code_Point': Binary Property */
@@ -17922,7 +19922,7 @@ static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
/* 'Other_Grapheme_Extend': Binary Property */
static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
- 17,
+ 22,
0x09be, 0x09be,
0x09d7, 0x09d7,
0x0b3e, 0x0b3e,
@@ -17938,6 +19938,11 @@ static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
0x200c, 0x200d,
0x302e, 0x302f,
0xff9e, 0xff9f,
+ 0x1133e, 0x1133e,
+ 0x11357, 0x11357,
+ 0x114b0, 0x114b0,
+ 0x114bd, 0x114bd,
+ 0x115af, 0x115af,
0x1d165, 0x1d165,
0x1d16e, 0x1d172,
}; /* CR_Other_Grapheme_Extend */
@@ -17965,9 +19970,9 @@ static const OnigCodePoint CR_Radical[] = {
/* 'Unified_Ideograph': Binary Property */
static const OnigCodePoint CR_Unified_Ideograph[] = {
- 12,
+ 13,
0x3400, 0x4db5,
- 0x4e00, 0x9fcc,
+ 0x4e00, 0x9fd5,
0xfa0e, 0xfa0f,
0xfa11, 0xfa11,
0xfa13, 0xfa14,
@@ -17978,6 +19983,7 @@ static const OnigCodePoint CR_Unified_Ideograph[] = {
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
}; /* CR_Unified_Ideograph */
/* 'Other_Default_Ignorable_Code_Point': Binary Property */
@@ -17986,7 +19992,7 @@ static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
0x034f, 0x034f,
0x115f, 0x1160,
0x17b4, 0x17b5,
- 0x2065, 0x2069,
+ 0x2065, 0x2065,
0x3164, 0x3164,
0xffa0, 0xffa0,
0xfff0, 0xfff8,
@@ -18007,7 +20013,7 @@ static const OnigCodePoint CR_Deprecated[] = {
0x206a, 0x206f,
0x2329, 0x232a,
0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
+ 0xe007f, 0xe007f,
}; /* CR_Deprecated */
/* 'Soft_Dotted': Binary Property */
@@ -18048,9 +20054,11 @@ static const OnigCodePoint CR_Soft_Dotted[] = {
/* 'Logical_Order_Exception': Binary Property */
static const OnigCodePoint CR_Logical_Order_Exception[] = {
- 5,
+ 7,
0x0e40, 0x0e44,
0x0ec0, 0x0ec4,
+ 0x19b5, 0x19b7,
+ 0x19ba, 0x19ba,
0xaab5, 0xaab6,
0xaab9, 0xaab9,
0xaabb, 0xaabc,
@@ -18075,12 +20083,10 @@ static const OnigCodePoint CR_Other_ID_Continue[] = {
/* 'STerm': Binary Property */
static const OnigCodePoint CR_STerm[] = {
- 50,
+ 64,
0x0021, 0x0021,
0x002e, 0x002e,
0x003f, 0x003f,
- 0x055c, 0x055c,
- 0x055e, 0x055e,
0x0589, 0x0589,
0x061f, 0x061f,
0x06d4, 0x06d4,
@@ -18103,6 +20109,7 @@ static const OnigCodePoint CR_STerm[] = {
0x203c, 0x203d,
0x2047, 0x2049,
0x2e2e, 0x2e2e,
+ 0x2e3c, 0x2e3c,
0x3002, 0x3002,
0xa4ff, 0xa4ff,
0xa60e, 0xa60f,
@@ -18126,6 +20133,21 @@ static const OnigCodePoint CR_STerm[] = {
0x110be, 0x110c1,
0x11141, 0x11143,
0x111c5, 0x111c6,
+ 0x111cd, 0x111cd,
+ 0x111de, 0x111df,
+ 0x11238, 0x11239,
+ 0x1123b, 0x1123c,
+ 0x112a9, 0x112a9,
+ 0x115c2, 0x115c3,
+ 0x115c9, 0x115d7,
+ 0x11641, 0x11642,
+ 0x1173c, 0x1173e,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b38,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
+ 0x1da88, 0x1da88,
}; /* CR_STerm */
/* 'Variation_Selector': Binary Property */
@@ -18181,23 +20203,22 @@ static const OnigCodePoint CR_Pattern_Syntax[] = {
/* 'Unknown': Script */
static const OnigCodePoint CR_Unknown[] = {
- 537,
+ 611,
0x0378, 0x0379,
- 0x037f, 0x0383,
+ 0x0380, 0x0383,
0x038b, 0x038b,
0x038d, 0x038d,
0x03a2, 0x03a2,
- 0x0528, 0x0530,
+ 0x0530, 0x0530,
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x058e,
+ 0x058b, 0x058c,
0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0605, 0x0605,
- 0x061c, 0x061d,
+ 0x061d, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
0x07b2, 0x07bf,
@@ -18206,11 +20227,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x083f, 0x083f,
0x085c, 0x085d,
0x085f, 0x089f,
- 0x08a1, 0x08a1,
- 0x08ad, 0x08e3,
- 0x08ff, 0x08ff,
- 0x0978, 0x0978,
- 0x0980, 0x0980,
+ 0x08b5, 0x08e2,
0x0984, 0x0984,
0x098d, 0x098e,
0x0991, 0x0992,
@@ -18253,7 +20270,8 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af2, 0x0b00,
+ 0x0af2, 0x0af8,
+ 0x0afa, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
0x0b11, 0x0b12,
@@ -18283,21 +20301,20 @@ static const OnigCodePoint CR_Unknown[] = {
0x0bce, 0x0bcf,
0x0bd1, 0x0bd6,
0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
+ 0x0bfb, 0x0bff,
0x0c04, 0x0c04,
0x0c0d, 0x0c0d,
0x0c11, 0x0c11,
0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
0x0c3a, 0x0c3c,
0x0c45, 0x0c45,
0x0c49, 0x0c49,
0x0c4e, 0x0c54,
0x0c57, 0x0c57,
- 0x0c5a, 0x0c5f,
+ 0x0c5b, 0x0c5f,
0x0c64, 0x0c65,
0x0c70, 0x0c77,
- 0x0c80, 0x0c81,
+ 0x0c80, 0x0c80,
0x0c84, 0x0c84,
0x0c8d, 0x0c8d,
0x0c91, 0x0c91,
@@ -18311,7 +20328,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x0cdf, 0x0cdf,
0x0ce4, 0x0ce5,
0x0cf0, 0x0cf0,
- 0x0cf3, 0x0d01,
+ 0x0cf3, 0x0d00,
0x0d04, 0x0d04,
0x0d0d, 0x0d0d,
0x0d11, 0x0d11,
@@ -18319,7 +20336,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x0d45, 0x0d45,
0x0d49, 0x0d49,
0x0d4f, 0x0d56,
- 0x0d58, 0x0d5f,
+ 0x0d58, 0x0d5e,
0x0d64, 0x0d65,
0x0d76, 0x0d78,
0x0d80, 0x0d81,
@@ -18332,7 +20349,8 @@ static const OnigCodePoint CR_Unknown[] = {
0x0dcb, 0x0dce,
0x0dd5, 0x0dd5,
0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
+ 0x0de0, 0x0de5,
+ 0x0df0, 0x0df1,
0x0df5, 0x0e00,
0x0e3b, 0x0e3e,
0x0e5c, 0x0e80,
@@ -18381,9 +20399,10 @@ static const OnigCodePoint CR_Unknown[] = {
0x135b, 0x135c,
0x137d, 0x137f,
0x139a, 0x139f,
- 0x13f5, 0x13ff,
+ 0x13f6, 0x13f7,
+ 0x13fe, 0x13ff,
0x169d, 0x169f,
- 0x16f1, 0x16ff,
+ 0x16f9, 0x16ff,
0x170d, 0x170d,
0x1715, 0x171f,
0x1737, 0x173f,
@@ -18399,7 +20418,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x1878, 0x187f,
0x18ab, 0x18af,
0x18f6, 0x18ff,
- 0x191d, 0x191f,
+ 0x191f, 0x191f,
0x192c, 0x192f,
0x193c, 0x193f,
0x1941, 0x1943,
@@ -18413,7 +20432,8 @@ static const OnigCodePoint CR_Unknown[] = {
0x1a7d, 0x1a7e,
0x1a8a, 0x1a8f,
0x1a9a, 0x1a9f,
- 0x1aae, 0x1aff,
+ 0x1aae, 0x1aaf,
+ 0x1abf, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
0x1bf4, 0x1bfb,
@@ -18421,8 +20441,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x1c4a, 0x1c4c,
0x1c80, 0x1cbf,
0x1cc8, 0x1ccf,
- 0x1cf7, 0x1cff,
- 0x1de7, 0x1dfb,
+ 0x1cf7, 0x1cf7,
+ 0x1cfa, 0x1cff,
+ 0x1df6, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
0x1f46, 0x1f47,
@@ -18439,19 +20460,22 @@ static const OnigCodePoint CR_Unknown[] = {
0x1ff0, 0x1ff1,
0x1ff5, 0x1ff5,
0x1fff, 0x1fff,
- 0x2065, 0x2069,
+ 0x2065, 0x2065,
0x2072, 0x2073,
0x208f, 0x208f,
0x209d, 0x209f,
- 0x20ba, 0x20cf,
+ 0x20bf, 0x20cf,
0x20f1, 0x20ff,
- 0x218a, 0x218f,
- 0x23f4, 0x23ff,
+ 0x218c, 0x218f,
+ 0x23fb, 0x23ff,
0x2427, 0x243f,
0x244b, 0x245f,
- 0x2700, 0x2700,
- 0x2b4d, 0x2b4f,
- 0x2b5a, 0x2bff,
+ 0x2b74, 0x2b75,
+ 0x2b96, 0x2b97,
+ 0x2bba, 0x2bbc,
+ 0x2bc9, 0x2bc9,
+ 0x2bd2, 0x2beb,
+ 0x2bf0, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
0x2cf4, 0x2cf8,
@@ -18469,7 +20493,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e3c, 0x2e7f,
+ 0x2e43, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -18484,37 +20508,35 @@ static const OnigCodePoint CR_Unknown[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcd, 0x9fff,
+ 0x9fd6, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
- 0xa78f, 0xa78f,
- 0xa794, 0xa79f,
- 0xa7ab, 0xa7f7,
+ 0xa7ae, 0xa7af,
+ 0xa7b8, 0xa7f6,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
0xa8c5, 0xa8cd,
0xa8da, 0xa8df,
- 0xa8fc, 0xa8ff,
+ 0xa8fe, 0xa8ff,
0xa954, 0xa95e,
0xa97d, 0xa97f,
0xa9ce, 0xa9ce,
0xa9da, 0xa9dd,
- 0xa9e0, 0xa9ff,
+ 0xa9ff, 0xa9ff,
0xaa37, 0xaa3f,
0xaa4e, 0xaa4f,
0xaa5a, 0xaa5b,
- 0xaa7c, 0xaa7f,
0xaac3, 0xaada,
0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
0xab27, 0xab27,
- 0xab2f, 0xabbf,
+ 0xab2f, 0xab2f,
+ 0xab66, 0xab6f,
0xabee, 0xabef,
0xabfa, 0xabff,
0xd7a4, 0xd7af,
@@ -18535,7 +20557,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xfdc8, 0xfdef,
0xfdfe, 0xfdff,
0xfe1a, 0xfe1f,
- 0xfe27, 0xfe2f,
0xfe53, 0xfe53,
0xfe67, 0xfe67,
0xfe6c, 0xfe6f,
@@ -18559,31 +20580,42 @@ static const OnigCodePoint CR_Unknown[] = {
0x100fb, 0x100ff,
0x10103, 0x10106,
0x10134, 0x10136,
- 0x1018b, 0x1018f,
- 0x1019c, 0x101cf,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
0x101fe, 0x1027f,
0x1029d, 0x1029f,
- 0x102d1, 0x102ff,
- 0x1031f, 0x1031f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
0x10324, 0x1032f,
- 0x1034b, 0x1037f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
0x1039e, 0x1039e,
0x103c4, 0x103c7,
0x103d6, 0x103ff,
0x1049e, 0x1049f,
- 0x104aa, 0x107ff,
+ 0x104aa, 0x104ff,
+ 0x10528, 0x1052f,
+ 0x10564, 0x1056e,
+ 0x10570, 0x105ff,
+ 0x10737, 0x1073f,
+ 0x10756, 0x1075f,
+ 0x10768, 0x107ff,
0x10806, 0x10807,
0x10809, 0x10809,
0x10836, 0x10836,
0x10839, 0x1083b,
0x1083d, 0x1083e,
0x10856, 0x10856,
- 0x10860, 0x108ff,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108df,
+ 0x108f3, 0x108f3,
+ 0x108f6, 0x108fa,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
0x10940, 0x1097f,
- 0x109b8, 0x109bd,
- 0x109c0, 0x109ff,
+ 0x109b8, 0x109bb,
+ 0x109d0, 0x109d1,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -18592,36 +20624,98 @@ static const OnigCodePoint CR_Unknown[] = {
0x10a3b, 0x10a3e,
0x10a48, 0x10a4f,
0x10a59, 0x10a5f,
- 0x10a80, 0x10aff,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
0x10b36, 0x10b38,
0x10b56, 0x10b57,
0x10b73, 0x10b77,
- 0x10b80, 0x10bff,
- 0x10c49, 0x10e5f,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
+ 0x10c49, 0x10c7f,
+ 0x10cb3, 0x10cbf,
+ 0x10cf3, 0x10cf9,
+ 0x10d00, 0x10e5f,
0x10e7f, 0x10fff,
0x1104e, 0x11051,
- 0x11070, 0x1107f,
+ 0x11070, 0x1107e,
0x110c2, 0x110cf,
0x110e9, 0x110ef,
0x110fa, 0x110ff,
0x11135, 0x11135,
- 0x11144, 0x1117f,
- 0x111c9, 0x111cf,
- 0x111da, 0x1167f,
+ 0x11144, 0x1114f,
+ 0x11177, 0x1117f,
+ 0x111ce, 0x111cf,
+ 0x111e0, 0x111e0,
+ 0x111f5, 0x111ff,
+ 0x11212, 0x11212,
+ 0x1123e, 0x1127f,
+ 0x11287, 0x11287,
+ 0x11289, 0x11289,
+ 0x1128e, 0x1128e,
+ 0x1129e, 0x1129e,
+ 0x112aa, 0x112af,
+ 0x112eb, 0x112ef,
+ 0x112fa, 0x112ff,
+ 0x11304, 0x11304,
+ 0x1130d, 0x1130e,
+ 0x11311, 0x11312,
+ 0x11329, 0x11329,
+ 0x11331, 0x11331,
+ 0x11334, 0x11334,
+ 0x1133a, 0x1133b,
+ 0x11345, 0x11346,
+ 0x11349, 0x1134a,
+ 0x1134e, 0x1134f,
+ 0x11351, 0x11356,
+ 0x11358, 0x1135c,
+ 0x11364, 0x11365,
+ 0x1136d, 0x1136f,
+ 0x11375, 0x1147f,
+ 0x114c8, 0x114cf,
+ 0x114da, 0x1157f,
+ 0x115b6, 0x115b7,
+ 0x115de, 0x115ff,
+ 0x11645, 0x1164f,
+ 0x1165a, 0x1167f,
0x116b8, 0x116bf,
- 0x116ca, 0x11fff,
- 0x1236f, 0x123ff,
- 0x12463, 0x1246f,
- 0x12474, 0x12fff,
- 0x1342f, 0x167ff,
- 0x16a39, 0x16eff,
+ 0x116ca, 0x116ff,
+ 0x1171a, 0x1171c,
+ 0x1172c, 0x1172f,
+ 0x11740, 0x1189f,
+ 0x118f3, 0x118fe,
+ 0x11900, 0x11abf,
+ 0x11af9, 0x11fff,
+ 0x1239a, 0x123ff,
+ 0x1246f, 0x1246f,
+ 0x12475, 0x1247f,
+ 0x12544, 0x12fff,
+ 0x1342f, 0x143ff,
+ 0x14647, 0x167ff,
+ 0x16a39, 0x16a3f,
+ 0x16a5f, 0x16a5f,
+ 0x16a6a, 0x16a6d,
+ 0x16a70, 0x16acf,
+ 0x16aee, 0x16aef,
+ 0x16af6, 0x16aff,
+ 0x16b46, 0x16b4f,
+ 0x16b5a, 0x16b5a,
+ 0x16b62, 0x16b62,
+ 0x16b78, 0x16b7c,
+ 0x16b90, 0x16eff,
0x16f45, 0x16f4f,
0x16f7f, 0x16f8e,
0x16fa0, 0x1afff,
- 0x1b002, 0x1cfff,
+ 0x1b002, 0x1bbff,
+ 0x1bc6b, 0x1bc6f,
+ 0x1bc7d, 0x1bc7f,
+ 0x1bc89, 0x1bc8f,
+ 0x1bc9a, 0x1bc9b,
+ 0x1bca4, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
- 0x1d1de, 0x1d1ff,
+ 0x1d1e9, 0x1d1ff,
0x1d246, 0x1d2ff,
0x1d357, 0x1d35f,
0x1d372, 0x1d3ff,
@@ -18645,7 +20739,11 @@ static const OnigCodePoint CR_Unknown[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1edff,
+ 0x1da8c, 0x1da9a,
+ 0x1daa0, 0x1daa0,
+ 0x1dab0, 0x1e7ff,
+ 0x1e8c5, 0x1e8c6,
+ 0x1e8d7, 0x1edff,
0x1ee04, 0x1ee04,
0x1ee20, 0x1ee20,
0x1ee23, 0x1ee23,
@@ -18683,10 +20781,10 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
- 0x1f0bf, 0x1f0c0,
+ 0x1f0c0, 0x1f0c0,
0x1f0d0, 0x1f0d0,
- 0x1f0e0, 0x1f0ff,
- 0x1f10b, 0x1f10f,
+ 0x1f0f6, 0x1f0ff,
+ 0x1f10d, 0x1f10f,
0x1f12f, 0x1f12f,
0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
@@ -18694,33 +20792,32 @@ static const OnigCodePoint CR_Unknown[] = {
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,
+ 0x1f57a, 0x1f57a,
+ 0x1f5a4, 0x1f5a4,
+ 0x1f6d1, 0x1f6df,
+ 0x1f6ed, 0x1f6ef,
+ 0x1f6f4, 0x1f6ff,
+ 0x1f774, 0x1f77f,
+ 0x1f7d5, 0x1f7ff,
+ 0x1f80c, 0x1f80f,
+ 0x1f848, 0x1f84f,
+ 0x1f85a, 0x1f85f,
+ 0x1f888, 0x1f88f,
+ 0x1f8ae, 0x1f90f,
+ 0x1f919, 0x1f97f,
+ 0x1f985, 0x1f9bf,
+ 0x1f9c1, 0x1ffff,
0x2a6d7, 0x2a6ff,
0x2b735, 0x2b73f,
- 0x2b81e, 0x2f7ff,
+ 0x2b81e, 0x2b81f,
+ 0x2cea2, 0x2f7ff,
0x2fa1e, 0xe0000,
0xe0002, 0xe001f,
0xe0080, 0xe00ff,
0xe01f0, 0x10ffff,
}; /* CR_Unknown */
+#ifdef USE_UNICODE_AGE_PROPERTIES
/* 'Age_1_1': Derived Age 1.1 */
static const OnigCodePoint CR_Age_1_1[] = {
288,
@@ -24158,6 +26255,2358 @@ static const OnigCodePoint CR_Age_6_1[] = {
0xefffe, 0x10ffff,
}; /* CR_Age_6_1 */
+/* 'Age_6_2': Derived Age 6.2 */
+static const OnigCodePoint CR_Age_6_2[] = {
+ 549,
+ 0x0000, 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, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20ba,
+ 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,
+ 0xd800, 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,
+ 0xfdd0, 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, 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,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_2 */
+
+/* 'Age_6_3': Derived Age 6.3 */
+static const OnigCodePoint CR_Age_6_3[] = {
+ 549,
+ 0x0000, 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, 0x061c,
+ 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, 0x2064,
+ 0x2066, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20ba,
+ 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,
+ 0xd800, 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,
+ 0xfdd0, 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, 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,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_3 */
+
+/* 'Age_7_0': Derived Age 7.0 */
+static const OnigCodePoint CR_Age_7_0[] = {
+ 610,
+ 0x0000, 0x0377,
+ 0x037a, 0x037f,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058d, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x061c,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08b2,
+ 0x08e4, 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,
+ 0x0c00, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c81, 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,
+ 0x0d01, 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,
+ 0x0de6, 0x0def,
+ 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, 0x16f8,
+ 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, 0x191e,
+ 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,
+ 0x1ab0, 0x1abe,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
+ 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, 0x2064,
+ 0x2066, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20bd,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23fa,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 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, 0x2e42,
+ 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, 0xa69d,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9fe,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xab30, 0xab5f,
+ 0xab64, 0xab65,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xd800, 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,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe2d,
+ 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, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018c,
+ 0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10350, 0x1037a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
+ 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, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x1107f, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11150, 0x11176,
+ 0x11180, 0x111c8,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c9,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
+ 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,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
+ 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, 0x1f0bf,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
+ 0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_7_0 */
+
+/* 'Age_8_0': Derived Age 8.0 */
+static const OnigCodePoint CR_Age_8_0[] = {
+ 623,
+ 0x0000, 0x0377,
+ 0x037a, 0x037f,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058d, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x061c,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08b4,
+ 0x08e3, 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,
+ 0x0af9, 0x0af9,
+ 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,
+ 0x0c00, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c5a,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c81, 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,
+ 0x0d01, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d5f, 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,
+ 0x0de6, 0x0def,
+ 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, 0x13f5,
+ 0x13f8, 0x13fd,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f8,
+ 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, 0x191e,
+ 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,
+ 0x1ab0, 0x1abe,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
+ 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, 0x2064,
+ 0x2066, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20be,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x218b,
+ 0x2190, 0x23fa,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2bec, 0x2bef,
+ 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, 0x2e42,
+ 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, 0x9fd5,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa6f7,
+ 0xa700, 0xa7ad,
+ 0xa7b0, 0xa7b7,
+ 0xa7f7, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fd,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9fe,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xab30, 0xab65,
+ 0xab70, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xd800, 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,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 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, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018c,
+ 0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10350, 0x1037a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
+ 0x108e0, 0x108f2,
+ 0x108f4, 0x108f5,
+ 0x108fb, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109bc, 0x109cf,
+ 0x109d2, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
+ 0x10c00, 0x10c48,
+ 0x10c80, 0x10cb2,
+ 0x10cc0, 0x10cf2,
+ 0x10cfa, 0x10cff,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x1107f, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11150, 0x11176,
+ 0x11180, 0x111cd,
+ 0x111d0, 0x111df,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x11280, 0x11286,
+ 0x11288, 0x11288,
+ 0x1128a, 0x1128d,
+ 0x1128f, 0x1129d,
+ 0x1129f, 0x112a9,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11300, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11350, 0x11350,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115dd,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x11700, 0x11719,
+ 0x1171d, 0x1172b,
+ 0x11730, 0x1173f,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12399,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x12480, 0x12543,
+ 0x13000, 0x1342e,
+ 0x14400, 0x14646,
+ 0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1e8,
+ 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, 0x1da8b,
+ 0x1da9b, 0x1da9f,
+ 0x1daa1, 0x1daaf,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
+ 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, 0x1f0bf,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f6d0,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
+ 0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0x1f910, 0x1f918,
+ 0x1f980, 0x1f984,
+ 0x1f9c0, 0x1f9c0,
+ 0x1fffe, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2b820, 0x2cea1,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_8_0 */
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+
/* 'In_Basic_Latin': Block */
#define CR_In_Basic_Latin CR_ASCII
@@ -24485,6 +28934,12 @@ static const OnigCodePoint CR_In_Tai_Tham[] = {
0x1a20, 0x1aaf,
}; /* CR_In_Tai_Tham */
+/* 'In_Combining_Diacritical_Marks_Extended': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Extended[] = {
+ 1,
+ 0x1ab0, 0x1aff,
+}; /* CR_In_Combining_Diacritical_Marks_Extended */
+
/* 'In_Balinese': Block */
static const OnigCodePoint CR_In_Balinese[] = {
1,
@@ -24921,7 +29376,10 @@ static const OnigCodePoint CR_In_Devanagari_Extended[] = {
}; /* CR_In_Devanagari_Extended */
/* 'In_Kayah_Li': Block */
-#define CR_In_Kayah_Li CR_Kayah_Li
+static const OnigCodePoint CR_In_Kayah_Li[] = {
+ 1,
+ 0xa900, 0xa92f,
+}; /* CR_In_Kayah_Li */
/* 'In_Rejang': Block */
static const OnigCodePoint CR_In_Rejang[] = {
@@ -24941,6 +29399,12 @@ static const OnigCodePoint CR_In_Javanese[] = {
0xa980, 0xa9df,
}; /* CR_In_Javanese */
+/* 'In_Myanmar_Extended_B': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_B[] = {
+ 1,
+ 0xa9e0, 0xa9ff,
+}; /* CR_In_Myanmar_Extended_B */
+
/* 'In_Cham': Block */
static const OnigCodePoint CR_In_Cham[] = {
1,
@@ -24971,6 +29435,18 @@ static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
0xab00, 0xab2f,
}; /* CR_In_Ethiopic_Extended_A */
+/* 'In_Latin_Extended_E': Block */
+static const OnigCodePoint CR_In_Latin_Extended_E[] = {
+ 1,
+ 0xab30, 0xab6f,
+}; /* CR_In_Latin_Extended_E */
+
+/* 'In_Cherokee_Supplement': Block */
+static const OnigCodePoint CR_In_Cherokee_Supplement[] = {
+ 1,
+ 0xab70, 0xabbf,
+}; /* CR_In_Cherokee_Supplement */
+
/* 'In_Meetei_Mayek': Block */
static const OnigCodePoint CR_In_Meetei_Mayek[] = {
1,
@@ -25127,6 +29603,12 @@ static const OnigCodePoint CR_In_Carian[] = {
0x102a0, 0x102df,
}; /* CR_In_Carian */
+/* 'In_Coptic_Epact_Numbers': Block */
+static const OnigCodePoint CR_In_Coptic_Epact_Numbers[] = {
+ 1,
+ 0x102e0, 0x102ff,
+}; /* CR_In_Coptic_Epact_Numbers */
+
/* 'In_Old_Italic': Block */
static const OnigCodePoint CR_In_Old_Italic[] = {
1,
@@ -25139,6 +29621,12 @@ static const OnigCodePoint CR_In_Gothic[] = {
0x10330, 0x1034f,
}; /* CR_In_Gothic */
+/* 'In_Old_Permic': Block */
+static const OnigCodePoint CR_In_Old_Permic[] = {
+ 1,
+ 0x10350, 0x1037f,
+}; /* CR_In_Old_Permic */
+
/* 'In_Ugaritic': Block */
static const OnigCodePoint CR_In_Ugaritic[] = {
1,
@@ -25163,6 +29651,24 @@ static const OnigCodePoint CR_In_Osmanya[] = {
0x10480, 0x104af,
}; /* CR_In_Osmanya */
+/* 'In_Elbasan': Block */
+static const OnigCodePoint CR_In_Elbasan[] = {
+ 1,
+ 0x10500, 0x1052f,
+}; /* CR_In_Elbasan */
+
+/* 'In_Caucasian_Albanian': Block */
+static const OnigCodePoint CR_In_Caucasian_Albanian[] = {
+ 1,
+ 0x10530, 0x1056f,
+}; /* CR_In_Caucasian_Albanian */
+
+/* 'In_Linear_A': Block */
+static const OnigCodePoint CR_In_Linear_A[] = {
+ 1,
+ 0x10600, 0x1077f,
+}; /* CR_In_Linear_A */
+
/* 'In_Cypriot_Syllabary': Block */
static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
1,
@@ -25175,6 +29681,21 @@ static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
0x10840, 0x1085f,
}; /* CR_In_Imperial_Aramaic */
+/* 'In_Palmyrene': Block */
+#define CR_In_Palmyrene CR_Palmyrene
+
+/* 'In_Nabataean': Block */
+static const OnigCodePoint CR_In_Nabataean[] = {
+ 1,
+ 0x10880, 0x108af,
+}; /* CR_In_Nabataean */
+
+/* 'In_Hatran': Block */
+static const OnigCodePoint CR_In_Hatran[] = {
+ 1,
+ 0x108e0, 0x108ff,
+}; /* CR_In_Hatran */
+
/* 'In_Phoenician': Block */
static const OnigCodePoint CR_In_Phoenician[] = {
1,
@@ -25205,6 +29726,15 @@ static const OnigCodePoint CR_In_Kharoshthi[] = {
/* 'In_Old_South_Arabian': Block */
#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+/* 'In_Old_North_Arabian': Block */
+#define CR_In_Old_North_Arabian CR_Old_North_Arabian
+
+/* 'In_Manichaean': Block */
+static const OnigCodePoint CR_In_Manichaean[] = {
+ 1,
+ 0x10ac0, 0x10aff,
+}; /* CR_In_Manichaean */
+
/* 'In_Avestan': Block */
static const OnigCodePoint CR_In_Avestan[] = {
1,
@@ -25223,12 +29753,24 @@ static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
0x10b60, 0x10b7f,
}; /* CR_In_Inscriptional_Pahlavi */
+/* 'In_Psalter_Pahlavi': Block */
+static const OnigCodePoint CR_In_Psalter_Pahlavi[] = {
+ 1,
+ 0x10b80, 0x10baf,
+}; /* CR_In_Psalter_Pahlavi */
+
/* 'In_Old_Turkic': Block */
static const OnigCodePoint CR_In_Old_Turkic[] = {
1,
0x10c00, 0x10c4f,
}; /* CR_In_Old_Turkic */
+/* 'In_Old_Hungarian': Block */
+static const OnigCodePoint CR_In_Old_Hungarian[] = {
+ 1,
+ 0x10c80, 0x10cff,
+}; /* CR_In_Old_Hungarian */
+
/* 'In_Rumi_Numeral_Symbols': Block */
static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
1,
@@ -25259,18 +29801,90 @@ static const OnigCodePoint CR_In_Chakma[] = {
0x11100, 0x1114f,
}; /* CR_In_Chakma */
+/* 'In_Mahajani': Block */
+static const OnigCodePoint CR_In_Mahajani[] = {
+ 1,
+ 0x11150, 0x1117f,
+}; /* CR_In_Mahajani */
+
/* 'In_Sharada': Block */
static const OnigCodePoint CR_In_Sharada[] = {
1,
0x11180, 0x111df,
}; /* CR_In_Sharada */
+/* 'In_Sinhala_Archaic_Numbers': Block */
+static const OnigCodePoint CR_In_Sinhala_Archaic_Numbers[] = {
+ 1,
+ 0x111e0, 0x111ff,
+}; /* CR_In_Sinhala_Archaic_Numbers */
+
+/* 'In_Khojki': Block */
+static const OnigCodePoint CR_In_Khojki[] = {
+ 1,
+ 0x11200, 0x1124f,
+}; /* CR_In_Khojki */
+
+/* 'In_Multani': Block */
+static const OnigCodePoint CR_In_Multani[] = {
+ 1,
+ 0x11280, 0x112af,
+}; /* CR_In_Multani */
+
+/* 'In_Khudawadi': Block */
+static const OnigCodePoint CR_In_Khudawadi[] = {
+ 1,
+ 0x112b0, 0x112ff,
+}; /* CR_In_Khudawadi */
+
+/* 'In_Grantha': Block */
+static const OnigCodePoint CR_In_Grantha[] = {
+ 1,
+ 0x11300, 0x1137f,
+}; /* CR_In_Grantha */
+
+/* 'In_Tirhuta': Block */
+static const OnigCodePoint CR_In_Tirhuta[] = {
+ 1,
+ 0x11480, 0x114df,
+}; /* CR_In_Tirhuta */
+
+/* 'In_Siddham': Block */
+static const OnigCodePoint CR_In_Siddham[] = {
+ 1,
+ 0x11580, 0x115ff,
+}; /* CR_In_Siddham */
+
+/* 'In_Modi': Block */
+static const OnigCodePoint CR_In_Modi[] = {
+ 1,
+ 0x11600, 0x1165f,
+}; /* CR_In_Modi */
+
/* 'In_Takri': Block */
static const OnigCodePoint CR_In_Takri[] = {
1,
0x11680, 0x116cf,
}; /* CR_In_Takri */
+/* 'In_Ahom': Block */
+static const OnigCodePoint CR_In_Ahom[] = {
+ 1,
+ 0x11700, 0x1173f,
+}; /* CR_In_Ahom */
+
+/* 'In_Warang_Citi': Block */
+static const OnigCodePoint CR_In_Warang_Citi[] = {
+ 1,
+ 0x118a0, 0x118ff,
+}; /* CR_In_Warang_Citi */
+
+/* 'In_Pau_Cin_Hau': Block */
+static const OnigCodePoint CR_In_Pau_Cin_Hau[] = {
+ 1,
+ 0x11ac0, 0x11aff,
+}; /* CR_In_Pau_Cin_Hau */
+
/* 'In_Cuneiform': Block */
static const OnigCodePoint CR_In_Cuneiform[] = {
1,
@@ -25283,18 +29897,48 @@ static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
0x12400, 0x1247f,
}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+/* 'In_Early_Dynastic_Cuneiform': Block */
+static const OnigCodePoint CR_In_Early_Dynastic_Cuneiform[] = {
+ 1,
+ 0x12480, 0x1254f,
+}; /* CR_In_Early_Dynastic_Cuneiform */
+
/* 'In_Egyptian_Hieroglyphs': Block */
static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
1,
0x13000, 0x1342f,
}; /* CR_In_Egyptian_Hieroglyphs */
+/* 'In_Anatolian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Anatolian_Hieroglyphs[] = {
+ 1,
+ 0x14400, 0x1467f,
+}; /* CR_In_Anatolian_Hieroglyphs */
+
/* 'In_Bamum_Supplement': Block */
static const OnigCodePoint CR_In_Bamum_Supplement[] = {
1,
0x16800, 0x16a3f,
}; /* CR_In_Bamum_Supplement */
+/* 'In_Mro': Block */
+static const OnigCodePoint CR_In_Mro[] = {
+ 1,
+ 0x16a40, 0x16a6f,
+}; /* CR_In_Mro */
+
+/* 'In_Bassa_Vah': Block */
+static const OnigCodePoint CR_In_Bassa_Vah[] = {
+ 1,
+ 0x16ad0, 0x16aff,
+}; /* CR_In_Bassa_Vah */
+
+/* 'In_Pahawh_Hmong': Block */
+static const OnigCodePoint CR_In_Pahawh_Hmong[] = {
+ 1,
+ 0x16b00, 0x16b8f,
+}; /* CR_In_Pahawh_Hmong */
+
/* 'In_Miao': Block */
static const OnigCodePoint CR_In_Miao[] = {
1,
@@ -25307,6 +29951,18 @@ static const OnigCodePoint CR_In_Kana_Supplement[] = {
0x1b000, 0x1b0ff,
}; /* CR_In_Kana_Supplement */
+/* 'In_Duployan': Block */
+static const OnigCodePoint CR_In_Duployan[] = {
+ 1,
+ 0x1bc00, 0x1bc9f,
+}; /* CR_In_Duployan */
+
+/* 'In_Shorthand_Format_Controls': Block */
+static const OnigCodePoint CR_In_Shorthand_Format_Controls[] = {
+ 1,
+ 0x1bca0, 0x1bcaf,
+}; /* CR_In_Shorthand_Format_Controls */
+
/* 'In_Byzantine_Musical_Symbols': Block */
static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
1,
@@ -25343,6 +29999,18 @@ static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
0x1d400, 0x1d7ff,
}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+/* 'In_Sutton_SignWriting': Block */
+static const OnigCodePoint CR_In_Sutton_SignWriting[] = {
+ 1,
+ 0x1d800, 0x1daaf,
+}; /* CR_In_Sutton_SignWriting */
+
+/* 'In_Mende_Kikakui': Block */
+static const OnigCodePoint CR_In_Mende_Kikakui[] = {
+ 1,
+ 0x1e800, 0x1e8df,
+}; /* CR_In_Mende_Kikakui */
+
/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
1,
@@ -25379,11 +30047,11 @@ static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
0x1f200, 0x1f2ff,
}; /* CR_In_Enclosed_Ideographic_Supplement */
-/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+/* 'In_Miscellaneous_Symbols_and_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Pictographs[] = {
1,
0x1f300, 0x1f5ff,
-}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+}; /* CR_In_Miscellaneous_Symbols_and_Pictographs */
/* 'In_Emoticons': Block */
static const OnigCodePoint CR_In_Emoticons[] = {
@@ -25391,11 +30059,17 @@ static const OnigCodePoint CR_In_Emoticons[] = {
0x1f600, 0x1f64f,
}; /* CR_In_Emoticons */
-/* 'In_Transport_And_Map_Symbols': Block */
-static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+/* 'In_Ornamental_Dingbats': Block */
+static const OnigCodePoint CR_In_Ornamental_Dingbats[] = {
+ 1,
+ 0x1f650, 0x1f67f,
+}; /* CR_In_Ornamental_Dingbats */
+
+/* 'In_Transport_and_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_and_Map_Symbols[] = {
1,
0x1f680, 0x1f6ff,
-}; /* CR_In_Transport_And_Map_Symbols */
+}; /* CR_In_Transport_and_Map_Symbols */
/* 'In_Alchemical_Symbols': Block */
static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
@@ -25403,6 +30077,24 @@ static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
0x1f700, 0x1f77f,
}; /* CR_In_Alchemical_Symbols */
+/* 'In_Geometric_Shapes_Extended': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes_Extended[] = {
+ 1,
+ 0x1f780, 0x1f7ff,
+}; /* CR_In_Geometric_Shapes_Extended */
+
+/* 'In_Supplemental_Arrows_C': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_C[] = {
+ 1,
+ 0x1f800, 0x1f8ff,
+}; /* CR_In_Supplemental_Arrows_C */
+
+/* 'In_Supplemental_Symbols_and_Pictographs': Block */
+static const OnigCodePoint CR_In_Supplemental_Symbols_and_Pictographs[] = {
+ 1,
+ 0x1f900, 0x1f9ff,
+}; /* CR_In_Supplemental_Symbols_and_Pictographs */
+
/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
1,
@@ -25421,6 +30113,12 @@ static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
0x2b740, 0x2b81f,
}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+/* 'In_CJK_Unified_Ideographs_Extension_E': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_E[] = {
+ 1,
+ 0x2b820, 0x2ceaf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_E */
+
/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
1,
@@ -25453,40 +30151,46 @@ static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
/* 'In_No_Block': Block */
static const OnigCodePoint CR_In_No_Block[] = {
- 36,
+ 42,
0x0860, 0x089f,
- 0x1ab0, 0x1aff,
0x1c80, 0x1cbf,
0x2fe0, 0x2fef,
- 0xa9e0, 0xa9ff,
- 0xab30, 0xabbf,
0x10200, 0x1027f,
- 0x102e0, 0x102ff,
- 0x10350, 0x1037f,
0x103e0, 0x103ff,
- 0x104b0, 0x107ff,
- 0x10860, 0x108ff,
+ 0x104b0, 0x104ff,
+ 0x10570, 0x105ff,
+ 0x10780, 0x107ff,
+ 0x108b0, 0x108df,
0x10940, 0x1097f,
- 0x10a80, 0x10aff,
- 0x10b80, 0x10bff,
- 0x10c50, 0x10e5f,
+ 0x10aa0, 0x10abf,
+ 0x10bb0, 0x10bff,
+ 0x10c50, 0x10c7f,
+ 0x10d00, 0x10e5f,
0x10e80, 0x10fff,
- 0x11150, 0x1117f,
- 0x111e0, 0x1167f,
- 0x116d0, 0x11fff,
- 0x12480, 0x12fff,
- 0x13430, 0x167ff,
- 0x16a40, 0x16eff,
+ 0x11250, 0x1127f,
+ 0x11380, 0x1147f,
+ 0x114e0, 0x1157f,
+ 0x11660, 0x1167f,
+ 0x116d0, 0x116ff,
+ 0x11740, 0x1189f,
+ 0x11900, 0x11abf,
+ 0x11b00, 0x11fff,
+ 0x12550, 0x12fff,
+ 0x13430, 0x143ff,
+ 0x14680, 0x167ff,
+ 0x16a70, 0x16acf,
+ 0x16b90, 0x16eff,
0x16fa0, 0x1afff,
- 0x1b100, 0x1cfff,
+ 0x1b100, 0x1bbff,
+ 0x1bcb0, 0x1cfff,
0x1d250, 0x1d2ff,
0x1d380, 0x1d3ff,
- 0x1d800, 0x1edff,
+ 0x1dab0, 0x1e7ff,
+ 0x1e8e0, 0x1edff,
0x1ef00, 0x1efff,
- 0x1f650, 0x1f67f,
- 0x1f780, 0x1ffff,
+ 0x1fa00, 0x1ffff,
0x2a6e0, 0x2a6ff,
- 0x2b820, 0x2f7ff,
+ 0x2ceb0, 0x2f7ff,
0x2fa20, 0xdffff,
0xe0080, 0xe00ff,
0xe01f0, 0xeffff,
@@ -25671,6 +30375,35 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Sharada,
CR_Sora_Sompeng,
CR_Takri,
+ CR_Caucasian_Albanian,
+ CR_Bassa_Vah,
+ CR_Duployan,
+ CR_Elbasan,
+ CR_Grantha,
+ CR_Pahawh_Hmong,
+ CR_Khojki,
+ CR_Linear_A,
+ CR_Mahajani,
+ CR_Manichaean,
+ CR_Mende_Kikakui,
+ CR_Modi,
+ CR_Mro,
+ CR_Old_North_Arabian,
+ CR_Nabataean,
+ CR_Palmyrene,
+ CR_Pau_Cin_Hau,
+ CR_Old_Permic,
+ CR_Psalter_Pahlavi,
+ CR_Siddham,
+ CR_Khudawadi,
+ CR_Tirhuta,
+ CR_Warang_Citi,
+ CR_Ahom,
+ CR_Anatolian_Hieroglyphs,
+ CR_Hatran,
+ CR_Multani,
+ CR_Old_Hungarian,
+ CR_SignWriting,
CR_White_Space,
CR_Bidi_Control,
CR_Join_Control,
@@ -25704,6 +30437,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Pattern_White_Space,
CR_Pattern_Syntax,
CR_Unknown,
+#ifdef USE_UNICODE_AGE_PROPERTIES
CR_Age_1_1,
CR_Age_2_0,
CR_Age_2_1,
@@ -25717,6 +30451,11 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Age_5_2,
CR_Age_6_0,
CR_Age_6_1,
+ CR_Age_6_2,
+ CR_Age_6_3,
+ CR_Age_7_0,
+ CR_Age_8_0,
+#endif /* USE_UNICODE_AGE_PROPERTIES */
CR_In_Basic_Latin,
CR_In_Latin_1_Supplement,
CR_In_Latin_Extended_A,
@@ -25772,6 +30511,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_In_Khmer_Symbols,
CR_In_Buginese,
CR_In_Tai_Tham,
+ CR_In_Combining_Diacritical_Marks_Extended,
CR_In_Balinese,
CR_In_Sundanese,
CR_In_Batak,
@@ -25850,11 +30590,14 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_In_Rejang,
CR_In_Hangul_Jamo_Extended_A,
CR_In_Javanese,
+ CR_In_Myanmar_Extended_B,
CR_In_Cham,
CR_In_Myanmar_Extended_A,
CR_In_Tai_Viet,
CR_In_Meetei_Mayek_Extensions,
CR_In_Ethiopic_Extended_A,
+ CR_In_Latin_Extended_E,
+ CR_In_Cherokee_Supplement,
CR_In_Meetei_Mayek,
CR_In_Hangul_Syllables,
CR_In_Hangul_Jamo_Extended_B,
@@ -25881,57 +30624,95 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_In_Phaistos_Disc,
CR_In_Lycian,
CR_In_Carian,
+ CR_In_Coptic_Epact_Numbers,
CR_In_Old_Italic,
CR_In_Gothic,
+ CR_In_Old_Permic,
CR_In_Ugaritic,
CR_In_Old_Persian,
CR_In_Deseret,
CR_In_Shavian,
CR_In_Osmanya,
+ CR_In_Elbasan,
+ CR_In_Caucasian_Albanian,
+ CR_In_Linear_A,
CR_In_Cypriot_Syllabary,
CR_In_Imperial_Aramaic,
+ CR_In_Palmyrene,
+ CR_In_Nabataean,
+ CR_In_Hatran,
CR_In_Phoenician,
CR_In_Lydian,
CR_In_Meroitic_Hieroglyphs,
CR_In_Meroitic_Cursive,
CR_In_Kharoshthi,
CR_In_Old_South_Arabian,
+ CR_In_Old_North_Arabian,
+ CR_In_Manichaean,
CR_In_Avestan,
CR_In_Inscriptional_Parthian,
CR_In_Inscriptional_Pahlavi,
+ CR_In_Psalter_Pahlavi,
CR_In_Old_Turkic,
+ CR_In_Old_Hungarian,
CR_In_Rumi_Numeral_Symbols,
CR_In_Brahmi,
CR_In_Kaithi,
CR_In_Sora_Sompeng,
CR_In_Chakma,
+ CR_In_Mahajani,
CR_In_Sharada,
+ CR_In_Sinhala_Archaic_Numbers,
+ CR_In_Khojki,
+ CR_In_Multani,
+ CR_In_Khudawadi,
+ CR_In_Grantha,
+ CR_In_Tirhuta,
+ CR_In_Siddham,
+ CR_In_Modi,
CR_In_Takri,
+ CR_In_Ahom,
+ CR_In_Warang_Citi,
+ CR_In_Pau_Cin_Hau,
CR_In_Cuneiform,
CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Early_Dynastic_Cuneiform,
CR_In_Egyptian_Hieroglyphs,
+ CR_In_Anatolian_Hieroglyphs,
CR_In_Bamum_Supplement,
+ CR_In_Mro,
+ CR_In_Bassa_Vah,
+ CR_In_Pahawh_Hmong,
CR_In_Miao,
CR_In_Kana_Supplement,
+ CR_In_Duployan,
+ CR_In_Shorthand_Format_Controls,
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_Sutton_SignWriting,
+ CR_In_Mende_Kikakui,
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_Miscellaneous_Symbols_and_Pictographs,
CR_In_Emoticons,
- CR_In_Transport_And_Map_Symbols,
+ CR_In_Ornamental_Dingbats,
+ CR_In_Transport_and_Map_Symbols,
CR_In_Alchemical_Symbols,
+ CR_In_Geometric_Shapes_Extended,
+ CR_In_Supplemental_Arrows_C,
+ CR_In_Supplemental_Symbols_and_Pictographs,
CR_In_CJK_Unified_Ideographs_Extension_B,
CR_In_CJK_Unified_Ideographs_Extension_C,
CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Unified_Ideographs_Extension_E,
CR_In_CJK_Compatibility_Ideographs_Supplement,
CR_In_Tags,
CR_In_Variation_Selectors_Supplement,
@@ -25954,12 +30735,16 @@ static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned
#define MAX_HASH_VALUE 19
/* maximum key range = 14, duplicates = 0 */
#else /* USE_UNICODE_PROPERTIES */
-#define TOTAL_KEYWORDS 625
+#ifndef USE_UNICODE_AGE_PROPERTIES
+#define TOTAL_KEYWORDS 710
+#else /* USE_UNICODE_AGE_PROPERTIES */
+#define TOTAL_KEYWORDS 727
+#endif /* USE_UNICODE_AGE_PROPERTIES */
#define MIN_WORD_LENGTH 1
#define MAX_WORD_LENGTH 44
#define MIN_HASH_VALUE 3
-#define MAX_HASH_VALUE 4167
-/* maximum key range = 4165, duplicates = 0 */
+#define MAX_HASH_VALUE 5326
+/* maximum key range = 5324, duplicates = 0 */
#endif /* USE_UNICODE_PROPERTIES */
#ifdef __GNUC__
@@ -25995,19 +30780,24 @@ uniname2ctype_hash (str, len)
2, 20, 1, 20, 1, 7, 4, 6, 20, 1,
4, 20, 20, 20, 20, 20, 20, 20
#else /* USE_UNICODE_PROPERTIES */
- 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
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ 5327, 5327, 5327, 5327, 5327, 5327, 2, 5327, 14, 1,
+ 2, 11, 14, 20, 6, 9, 4, 5327, 5327, 5327,
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327, 5327,
+ 5327, 5327, 5327, 5327, 5327, 5327, 5327, 13, 1192, 20,
+ 536, 25, 166, 1004, 345, 4, 194, 1391, 147, 7,
+ 1, 302, 760, 3, 265, 40, 92, 1327, 124, 78,
+ 110, 1040, 8, 5327, 5327, 5327, 5327, 5327
#endif /* USE_UNICODE_PROPERTIES */
};
#ifndef USE_UNICODE_PROPERTIES
@@ -26071,630 +30861,748 @@ struct uniname2ctype_pool_t
char uniname2ctype_pool_str19[sizeof("blank")];
#else /* USE_UNICODE_PROPERTIES */
char uniname2ctype_pool_str3[sizeof("n")];
- 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")];
+ char uniname2ctype_pool_str11[sizeof("mn")];
+ char uniname2ctype_pool_str15[sizeof("m")];
+ char uniname2ctype_pool_str17[sizeof("z")];
+ char uniname2ctype_pool_str24[sizeof("cn")];
+ char uniname2ctype_pool_str29[sizeof("mani")];
+ char uniname2ctype_pool_str30[sizeof("ci")];
+ char uniname2ctype_pool_str31[sizeof("inmanichaean")];
+ char uniname2ctype_pool_str36[sizeof("zzzz")];
+ char uniname2ctype_pool_str37[sizeof("qaai")];
+ char uniname2ctype_pool_str41[sizeof("c")];
+ char uniname2ctype_pool_str49[sizeof("mc")];
+ char uniname2ctype_pool_str53[sizeof("qaac")];
+ char uniname2ctype_pool_str56[sizeof("sm")];
+ char uniname2ctype_pool_str58[sizeof("incham")];
+ char uniname2ctype_pool_str59[sizeof("me")];
+ char uniname2ctype_pool_str61[sizeof("inarmenian")];
+ char uniname2ctype_pool_str62[sizeof("cc")];
+ char uniname2ctype_pool_str65[sizeof("mandaic")];
+ char uniname2ctype_pool_str69[sizeof("incuneiform")];
+ char uniname2ctype_pool_str77[sizeof("insamaritan")];
+ char uniname2ctype_pool_str78[sizeof("cans")];
+ char uniname2ctype_pool_str81[sizeof("s")];
+ char uniname2ctype_pool_str82[sizeof("sc")];
+ char uniname2ctype_pool_str86[sizeof("ascii")];
+ char uniname2ctype_pool_str90[sizeof("zs")];
+ char uniname2ctype_pool_str93[sizeof("inavestan")];
+ char uniname2ctype_pool_str102[sizeof("cs")];
+ char uniname2ctype_pool_str106[sizeof("inipaextensions")];
+ char uniname2ctype_pool_str110[sizeof("incuneiformnumbersandpunctuation")];
+ char uniname2ctype_pool_str114[sizeof("incommonindicnumberforms")];
+ char uniname2ctype_pool_str124[sizeof("inthai")];
+ char uniname2ctype_pool_str129[sizeof("cwcm")];
+ char uniname2ctype_pool_str132[sizeof("mtei")];
+ char uniname2ctype_pool_str140[sizeof("inspecials")];
+ char uniname2ctype_pool_str141[sizeof("initialpunctuation")];
+ char uniname2ctype_pool_str142[sizeof("invai")];
+ char uniname2ctype_pool_str144[sizeof("inthaana")];
+ char uniname2ctype_pool_str145[sizeof("inancientsymbols")];
+ char uniname2ctype_pool_str148[sizeof("vai")];
+ char uniname2ctype_pool_str149[sizeof("vaii")];
+ char uniname2ctype_pool_str152[sizeof("inmiscellaneousmathematicalsymbolsa")];
+ char uniname2ctype_pool_str155[sizeof("newtailue")];
+ char uniname2ctype_pool_str159[sizeof("inmusicalsymbols")];
+ char uniname2ctype_pool_str163[sizeof("lm")];
+ char uniname2ctype_pool_str164[sizeof("taile")];
+ char uniname2ctype_pool_str169[sizeof("lina")];
+ char uniname2ctype_pool_str174[sizeof("inmyanmarextendeda")];
+ char uniname2ctype_pool_str176[sizeof("sterm")];
+ char uniname2ctype_pool_str178[sizeof("lana")];
+ char uniname2ctype_pool_str180[sizeof("alnum")];
+ char uniname2ctype_pool_str185[sizeof("inlycian")];
+ char uniname2ctype_pool_str189[sizeof("lc")];
+ char uniname2ctype_pool_str190[sizeof("inmalayalam")];
+ char uniname2ctype_pool_str192[sizeof("inshavian")];
+ char uniname2ctype_pool_str199[sizeof("inmiscellaneoussymbols")];
+ char uniname2ctype_pool_str200[sizeof("inlineara")];
+ char uniname2ctype_pool_str201[sizeof("intransportandmapsymbols")];
+ char uniname2ctype_pool_str206[sizeof("vs")];
+ char uniname2ctype_pool_str208[sizeof("inmiscellaneoussymbolsandarrows")];
+ char uniname2ctype_pool_str209[sizeof("intaitham")];
+ char uniname2ctype_pool_str212[sizeof("innewtailue")];
+ char uniname2ctype_pool_str213[sizeof("inmiscellaneoussymbolsandpictographs")];
+ char uniname2ctype_pool_str220[sizeof("incontrolpictures")];
+ char uniname2ctype_pool_str225[sizeof("sinhala")];
+ char uniname2ctype_pool_str237[sizeof("taiviet")];
+ char uniname2ctype_pool_str257[sizeof("latn")];
+ char uniname2ctype_pool_str259[sizeof("latin")];
+ char uniname2ctype_pool_str260[sizeof("ital")];
+ char uniname2ctype_pool_str262[sizeof("intamil")];
+ char uniname2ctype_pool_str263[sizeof("taml")];
+ char uniname2ctype_pool_str264[sizeof("inmultani")];
+ char uniname2ctype_pool_str273[sizeof("avst")];
+ char uniname2ctype_pool_str274[sizeof("inlinearbideograms")];
+ char uniname2ctype_pool_str275[sizeof("avestan")];
+ char uniname2ctype_pool_str279[sizeof("intaixuanjingsymbols")];
+ char uniname2ctype_pool_str280[sizeof("intaile")];
+ char uniname2ctype_pool_str281[sizeof("tale")];
+ char uniname2ctype_pool_str285[sizeof("cwt")];
+ char uniname2ctype_pool_str288[sizeof("cwcf")];
+ char uniname2ctype_pool_str290[sizeof("armn")];
+ char uniname2ctype_pool_str291[sizeof("inlatinextendeda")];
+ char uniname2ctype_pool_str293[sizeof("armi")];
+ char uniname2ctype_pool_str295[sizeof("l")];
+ char uniname2ctype_pool_str297[sizeof("nl")];
+ char uniname2ctype_pool_str299[sizeof("armenian")];
+ char uniname2ctype_pool_str300[sizeof("inmyanmar")];
+ char uniname2ctype_pool_str302[sizeof("inrunic")];
+ char uniname2ctype_pool_str303[sizeof("incarian")];
+ char uniname2ctype_pool_str304[sizeof("zl")];
+ char uniname2ctype_pool_str305[sizeof("inlatinextendedc")];
+ char uniname2ctype_pool_str306[sizeof("cari")];
+ char uniname2ctype_pool_str309[sizeof("inmeeteimayekextensions")];
+ char uniname2ctype_pool_str315[sizeof("inlatinextendede")];
+ char uniname2ctype_pool_str319[sizeof("carian")];
+ char uniname2ctype_pool_str321[sizeof("merc")];
+ char uniname2ctype_pool_str322[sizeof("ext")];
+ char uniname2ctype_pool_str324[sizeof("incyrillic")];
+ char uniname2ctype_pool_str325[sizeof("tavt")];
+ char uniname2ctype_pool_str326[sizeof("intaiviet")];
+ char uniname2ctype_pool_str329[sizeof("samr")];
+ char uniname2ctype_pool_str330[sizeof("miao")];
+ char uniname2ctype_pool_str333[sizeof("lt")];
+ char uniname2ctype_pool_str338[sizeof("inlowsurrogates")];
+ char uniname2ctype_pool_str339[sizeof("samaritan")];
+ char uniname2ctype_pool_str340[sizeof("inahom")];
+ char uniname2ctype_pool_str341[sizeof("arabic")];
+ char uniname2ctype_pool_str342[sizeof("insyriac")];
+ char uniname2ctype_pool_str345[sizeof("insharada")];
+ char uniname2ctype_pool_str348[sizeof("java")];
+ char uniname2ctype_pool_str349[sizeof("inosmanya")];
+ char uniname2ctype_pool_str350[sizeof("incherokee")];
+ char uniname2ctype_pool_str354[sizeof("cf")];
+ char uniname2ctype_pool_str360[sizeof("inmiscellaneoustechnical")];
+ char uniname2ctype_pool_str361[sizeof("inruminumeralsymbols")];
+ char uniname2ctype_pool_str362[sizeof("zinh")];
+ char uniname2ctype_pool_str363[sizeof("han")];
+ char uniname2ctype_pool_str366[sizeof("osma")];
+ char uniname2ctype_pool_str367[sizeof("hani")];
+ char uniname2ctype_pool_str371[sizeof("injavanese")];
+ char uniname2ctype_pool_str373[sizeof("wara")];
+ char uniname2ctype_pool_str381[sizeof("inwarangciti")];
+ char uniname2ctype_pool_str384[sizeof("inmahajani")];
+ char uniname2ctype_pool_str389[sizeof("cham")];
+ char uniname2ctype_pool_str390[sizeof("javanese")];
+ char uniname2ctype_pool_str393[sizeof("term")];
+ char uniname2ctype_pool_str394[sizeof("sinh")];
+ char uniname2ctype_pool_str395[sizeof("cwl")];
+ char uniname2ctype_pool_str397[sizeof("manichaean")];
+ char uniname2ctype_pool_str401[sizeof("insmallformvariants")];
+ char uniname2ctype_pool_str403[sizeof("connectorpunctuation")];
+ char uniname2ctype_pool_str408[sizeof("inenclosedalphanumerics")];
+ char uniname2ctype_pool_str409[sizeof("inethiopic")];
+ char uniname2ctype_pool_str411[sizeof("tamil")];
+ char uniname2ctype_pool_str412[sizeof("cntrl")];
+ char uniname2ctype_pool_str413[sizeof("insinhala")];
+ char uniname2ctype_pool_str417[sizeof("chakma")];
+ char uniname2ctype_pool_str423[sizeof("shavian")];
+ char uniname2ctype_pool_str434[sizeof("inlatinextendedadditional")];
+ char uniname2ctype_pool_str443[sizeof("ll")];
+ char uniname2ctype_pool_str450[sizeof("lineara")];
+ char uniname2ctype_pool_str454[sizeof("inideographicdescriptioncharacters")];
+ char uniname2ctype_pool_str458[sizeof("thai")];
+ char uniname2ctype_pool_str461[sizeof("math")];
+ char uniname2ctype_pool_str467[sizeof("thaa")];
+ char uniname2ctype_pool_str469[sizeof("inenclosedalphanumericsupplement")];
+ char uniname2ctype_pool_str470[sizeof("ethi")];
+ char uniname2ctype_pool_str471[sizeof("hatran")];
+ char uniname2ctype_pool_str473[sizeof("meroiticcursive")];
+ char uniname2ctype_pool_str475[sizeof("inemoticons")];
+ char uniname2ctype_pool_str480[sizeof("shaw")];
+ char uniname2ctype_pool_str481[sizeof("taitham")];
+ char uniname2ctype_pool_str483[sizeof("thaana")];
+ char uniname2ctype_pool_str494[sizeof("insinhalaarchaicnumbers")];
+ char uniname2ctype_pool_str497[sizeof("ahex")];
+ char uniname2ctype_pool_str502[sizeof("loe")];
+ char uniname2ctype_pool_str518[sizeof("invariationselectors")];
+ char uniname2ctype_pool_str519[sizeof("terminalpunctuation")];
+ char uniname2ctype_pool_str527[sizeof("whitespace")];
+ char uniname2ctype_pool_str531[sizeof("asciihexdigit")];
+ char uniname2ctype_pool_str533[sizeof("inearlydynasticcuneiform")];
+ char uniname2ctype_pool_str538[sizeof("inopticalcharacterrecognition")];
+ char uniname2ctype_pool_str545[sizeof("joinc")];
+ char uniname2ctype_pool_str546[sizeof("di")];
+ char uniname2ctype_pool_str552[sizeof("inenclosedcjklettersandmonths")];
+ char uniname2ctype_pool_str561[sizeof("mand")];
+ char uniname2ctype_pool_str562[sizeof("inmodi")];
+ char uniname2ctype_pool_str563[sizeof("mahj")];
+ char uniname2ctype_pool_str569[sizeof("dia")];
+ char uniname2ctype_pool_str573[sizeof("mend")];
+ char uniname2ctype_pool_str578[sizeof("inmandaic")];
+ char uniname2ctype_pool_str580[sizeof("invariationselectorssupplement")];
+ char uniname2ctype_pool_str583[sizeof("idc")];
+ char uniname2ctype_pool_str584[sizeof("mahajani")];
+ char uniname2ctype_pool_str585[sizeof("sind")];
+ char uniname2ctype_pool_str593[sizeof("hex")];
+ char uniname2ctype_pool_str602[sizeof("oriya")];
+ char uniname2ctype_pool_str603[sizeof("mero")];
+ char uniname2ctype_pool_str605[sizeof("titlecaseletter")];
+ char uniname2ctype_pool_str607[sizeof("no")];
+ char uniname2ctype_pool_str614[sizeof("inscriptionalparthian")];
+ char uniname2ctype_pool_str615[sizeof("innko")];
+ char uniname2ctype_pool_str618[sizeof("insundanese")];
+ char uniname2ctype_pool_str621[sizeof("inmro")];
+ char uniname2ctype_pool_str622[sizeof("intifinagh")];
+ char uniname2ctype_pool_str623[sizeof("ids")];
+ char uniname2ctype_pool_str624[sizeof("sora")];
+ char uniname2ctype_pool_str626[sizeof("co")];
+ char uniname2ctype_pool_str629[sizeof("tifinagh")];
+ char uniname2ctype_pool_str630[sizeof("indominotiles")];
+ char uniname2ctype_pool_str631[sizeof("hira")];
+ char uniname2ctype_pool_str633[sizeof("inarrows")];
+ char uniname2ctype_pool_str635[sizeof("inmiao")];
+ char uniname2ctype_pool_str639[sizeof("common")];
+ char uniname2ctype_pool_str646[sizeof("so")];
+ char uniname2ctype_pool_str651[sizeof("inhiragana")];
+ char uniname2ctype_pool_str659[sizeof("cher")];
+ char uniname2ctype_pool_str665[sizeof("hano")];
+ char uniname2ctype_pool_str671[sizeof("ahom")];
+ char uniname2ctype_pool_str674[sizeof("xidc")];
+ char uniname2ctype_pool_str676[sizeof("idst")];
+ char uniname2ctype_pool_str679[sizeof("inogham")];
+ char uniname2ctype_pool_str685[sizeof("inolchiki")];
+ char uniname2ctype_pool_str688[sizeof("idcontinue")];
+ char uniname2ctype_pool_str689[sizeof("inmathematicalalphanumericsymbols")];
+ char uniname2ctype_pool_str694[sizeof("xids")];
+ char uniname2ctype_pool_str696[sizeof("inscriptionalpahlavi")];
+ char uniname2ctype_pool_str698[sizeof("indevanagari")];
+ char uniname2ctype_pool_str701[sizeof("inlydian")];
+ char uniname2ctype_pool_str702[sizeof("deva")];
+ char uniname2ctype_pool_str703[sizeof("inspacingmodifierletters")];
+ char uniname2ctype_pool_str707[sizeof("indeseret")];
+ char uniname2ctype_pool_str708[sizeof("anatolianhieroglyphs")];
+ char uniname2ctype_pool_str710[sizeof("tirh")];
+ char uniname2ctype_pool_str713[sizeof("devanagari")];
+ char uniname2ctype_pool_str716[sizeof("inhatran")];
+ char uniname2ctype_pool_str719[sizeof("hatr")];
+ char uniname2ctype_pool_str728[sizeof("invedicextensions")];
+ char uniname2ctype_pool_str729[sizeof("intirhuta")];
+ char uniname2ctype_pool_str752[sizeof("inmahjongtiles")];
+ char uniname2ctype_pool_str753[sizeof("lo")];
+ char uniname2ctype_pool_str761[sizeof("inlao")];
+ char uniname2ctype_pool_str767[sizeof("lao")];
+ char uniname2ctype_pool_str768[sizeof("laoo")];
+ char uniname2ctype_pool_str769[sizeof("mongolian")];
+ char uniname2ctype_pool_str770[sizeof("pi")];
+ char uniname2ctype_pool_str776[sizeof("insylotinagri")];
+ char uniname2ctype_pool_str797[sizeof("lineseparator")];
+ char uniname2ctype_pool_str802[sizeof("pc")];
+ char uniname2ctype_pool_str812[sizeof("pe")];
+ char uniname2ctype_pool_str820[sizeof("inphaistosdisc")];
+ char uniname2ctype_pool_str825[sizeof("letter")];
+ char uniname2ctype_pool_str832[sizeof("inanatolianhieroglyphs")];
+ char uniname2ctype_pool_str839[sizeof("oalpha")];
+ char uniname2ctype_pool_str842[sizeof("ps")];
+ char uniname2ctype_pool_str843[sizeof("inverticalforms")];
+ char uniname2ctype_pool_str844[sizeof("xdigit")];
+ char uniname2ctype_pool_str846[sizeof("lowercase")];
+ char uniname2ctype_pool_str849[sizeof("odi")];
+ char uniname2ctype_pool_str851[sizeof("diacritic")];
+ char uniname2ctype_pool_str853[sizeof("modi")];
+ char uniname2ctype_pool_str855[sizeof("xidstart")];
+ char uniname2ctype_pool_str856[sizeof("inshorthandformatcontrols")];
+ char uniname2ctype_pool_str866[sizeof("oidc")];
+ char uniname2ctype_pool_str868[sizeof("space")];
+ char uniname2ctype_pool_str871[sizeof("ideo")];
+ char uniname2ctype_pool_str878[sizeof("inolditalic")];
+ char uniname2ctype_pool_str879[sizeof("mro")];
+ char uniname2ctype_pool_str880[sizeof("mroo")];
+ char uniname2ctype_pool_str882[sizeof("insundanesesupplement")];
+ char uniname2ctype_pool_str886[sizeof("oids")];
+ char uniname2ctype_pool_str901[sizeof("nchar")];
+ char uniname2ctype_pool_str904[sizeof("decimalnumber")];
+ char uniname2ctype_pool_str905[sizeof("incoptic")];
+ char uniname2ctype_pool_str931[sizeof("palm")];
+ char uniname2ctype_pool_str936[sizeof("format")];
+ char uniname2ctype_pool_str937[sizeof("dsrt")];
+ char uniname2ctype_pool_str938[sizeof("dash")];
+ char uniname2ctype_pool_str940[sizeof("inmodifiertoneletters")];
+ char uniname2ctype_pool_str950[sizeof("patws")];
+ char uniname2ctype_pool_str951[sizeof("alpha")];
+ char uniname2ctype_pool_str952[sizeof("siddham")];
+ char uniname2ctype_pool_str953[sizeof("inlepcha")];
+ char uniname2ctype_pool_str954[sizeof("wspace")];
+ char uniname2ctype_pool_str955[sizeof("inpalmyrene")];
+ char uniname2ctype_pool_str956[sizeof("lepc")];
+ char uniname2ctype_pool_str957[sizeof("idstart")];
+ char uniname2ctype_pool_str960[sizeof("inprivateusearea")];
+ char uniname2ctype_pool_str961[sizeof("psalterpahlavi")];
+ char uniname2ctype_pool_str964[sizeof("incopticepactnumbers")];
+ char uniname2ctype_pool_str966[sizeof("inoldturkic")];
+ char uniname2ctype_pool_str967[sizeof("sharada")];
+ char uniname2ctype_pool_str971[sizeof("hanunoo")];
+ char uniname2ctype_pool_str972[sizeof("incyrillicextendeda")];
+ char uniname2ctype_pool_str980[sizeof("joincontrol")];
+ char uniname2ctype_pool_str989[sizeof("xidcontinue")];
+ char uniname2ctype_pool_str990[sizeof("deseret")];
+ char uniname2ctype_pool_str1001[sizeof("radical")];
+ char uniname2ctype_pool_str1005[sizeof("canadianaboriginal")];
+ char uniname2ctype_pool_str1017[sizeof("omath")];
+ char uniname2ctype_pool_str1029[sizeof("inmongolian")];
+ char uniname2ctype_pool_str1032[sizeof("casedletter")];
+ char uniname2ctype_pool_str1037[sizeof("extender")];
+ char uniname2ctype_pool_str1044[sizeof("control")];
+ char uniname2ctype_pool_str1045[sizeof("ingrantha")];
+ char uniname2ctype_pool_str1050[sizeof("yi")];
+ char uniname2ctype_pool_str1052[sizeof("otheridcontinue")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1053[sizeof("age=1.1")];
+ char uniname2ctype_pool_str1054[sizeof("age=2.1")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1056[sizeof("yiii")];
+ char uniname2ctype_pool_str1057[sizeof("inethiopicextendeda")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1058[sizeof("age=6.1")];
+ char uniname2ctype_pool_str1059[sizeof("age=6.2")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1061[sizeof("perm")];
+ char uniname2ctype_pool_str1062[sizeof("lower")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1063[sizeof("age=3.1")];
+ char uniname2ctype_pool_str1064[sizeof("age=3.2")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1065[sizeof("noncharactercodepoint")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1066[sizeof("age=4.1")];
+ char uniname2ctype_pool_str1067[sizeof("age=2.0")];
+ char uniname2ctype_pool_str1068[sizeof("age=6.3")];
+ char uniname2ctype_pool_str1069[sizeof("age=8.0")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1070[sizeof("ingeneralpunctuation")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1071[sizeof("age=6.0")];
+ char uniname2ctype_pool_str1072[sizeof("age=5.1")];
+ char uniname2ctype_pool_str1073[sizeof("age=5.2")];
+ char uniname2ctype_pool_str1074[sizeof("age=7.0")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1075[sizeof("nd")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1076[sizeof("age=3.0")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1077[sizeof("otheralphabetic")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1079[sizeof("age=4.0")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1082[sizeof("imperialaramaic")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str1085[sizeof("age=5.0")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str1094[sizeof("pf")];
+ char uniname2ctype_pool_str1096[sizeof("letternumber")];
+ char uniname2ctype_pool_str1100[sizeof("inimperialaramaic")];
+ char uniname2ctype_pool_str1106[sizeof("inphoenician")];
+ char uniname2ctype_pool_str1109[sizeof("finalpunctuation")];
+ char uniname2ctype_pool_str1114[sizeof("sd")];
+ char uniname2ctype_pool_str1119[sizeof("olditalic")];
+ char uniname2ctype_pool_str1120[sizeof("sidd")];
+ char uniname2ctype_pool_str1121[sizeof("inenclosedideographicsupplement")];
+ char uniname2ctype_pool_str1125[sizeof("prti")];
+ char uniname2ctype_pool_str1127[sizeof("sgnw")];
+ char uniname2ctype_pool_str1132[sizeof("coptic")];
+ char uniname2ctype_pool_str1133[sizeof("insiddham")];
+ char uniname2ctype_pool_str1140[sizeof("inoldnortharabian")];
+ char uniname2ctype_pool_str1141[sizeof("cprt")];
+ char uniname2ctype_pool_str1143[sizeof("inlatin1supplement")];
+ char uniname2ctype_pool_str1144[sizeof("tagbanwa")];
+ char uniname2ctype_pool_str1150[sizeof("cased")];
+ char uniname2ctype_pool_str1155[sizeof("ininscriptionalparthian")];
+ char uniname2ctype_pool_str1157[sizeof("ininscriptionalpahlavi")];
+ char uniname2ctype_pool_str1164[sizeof("inherited")];
+ char uniname2ctype_pool_str1169[sizeof("privateuse")];
+ char uniname2ctype_pool_str1178[sizeof("copt")];
+ char uniname2ctype_pool_str1179[sizeof("inoldsoutharabian")];
+ char uniname2ctype_pool_str1184[sizeof("lowercaseletter")];
+ char uniname2ctype_pool_str1185[sizeof("word")];
+ char uniname2ctype_pool_str1187[sizeof("intags")];
+ char uniname2ctype_pool_str1190[sizeof("shrd")];
+ char uniname2ctype_pool_str1194[sizeof("idsbinaryoperator")];
+ char uniname2ctype_pool_str1201[sizeof("xpeo")];
+ char uniname2ctype_pool_str1202[sizeof("othersymbol")];
+ char uniname2ctype_pool_str1203[sizeof("otherlowercase")];
+ char uniname2ctype_pool_str1204[sizeof("otheridstart")];
+ char uniname2ctype_pool_str1205[sizeof("mlym")];
+ char uniname2ctype_pool_str1207[sizeof("inoldhungarian")];
+ char uniname2ctype_pool_str1215[sizeof("lyci")];
+ char uniname2ctype_pool_str1218[sizeof("print")];
+ char uniname2ctype_pool_str1220[sizeof("phnx")];
+ char uniname2ctype_pool_str1223[sizeof("innabataean")];
+ char uniname2ctype_pool_str1228[sizeof("lycian")];
+ char uniname2ctype_pool_str1230[sizeof("ingujarati")];
+ char uniname2ctype_pool_str1231[sizeof("bamum")];
+ char uniname2ctype_pool_str1236[sizeof("malayalam")];
+ char uniname2ctype_pool_str1238[sizeof("variationselector")];
+ char uniname2ctype_pool_str1242[sizeof("patternwhitespace")];
+ char uniname2ctype_pool_str1245[sizeof("inelbasan")];
+ char uniname2ctype_pool_str1249[sizeof("spaceseparator")];
+ char uniname2ctype_pool_str1251[sizeof("inarabic")];
+ char uniname2ctype_pool_str1252[sizeof("inalphabeticpresentationforms")];
+ char uniname2ctype_pool_str1255[sizeof("inbasiclatin")];
+ char uniname2ctype_pool_str1260[sizeof("phli")];
+ char uniname2ctype_pool_str1263[sizeof("indevanagariextended")];
+ char uniname2ctype_pool_str1265[sizeof("innumberforms")];
+ char uniname2ctype_pool_str1266[sizeof("caseignorable")];
+ char uniname2ctype_pool_str1267[sizeof("tfng")];
+ char uniname2ctype_pool_str1274[sizeof("other")];
+ char uniname2ctype_pool_str1278[sizeof("inphoneticextensions")];
+ char uniname2ctype_pool_str1281[sizeof("othernumber")];
+ char uniname2ctype_pool_str1285[sizeof("closepunctuation")];
+ char uniname2ctype_pool_str1286[sizeof("oldpersian")];
+ char uniname2ctype_pool_str1287[sizeof("gran")];
+ char uniname2ctype_pool_str1289[sizeof("bass")];
+ char uniname2ctype_pool_str1291[sizeof("patternsyntax")];
+ char uniname2ctype_pool_str1292[sizeof("inmathematicaloperators")];
+ char uniname2ctype_pool_str1294[sizeof("inpsalterpahlavi")];
+ char uniname2ctype_pool_str1295[sizeof("ingurmukhi")];
+ char uniname2ctype_pool_str1302[sizeof("nbat")];
+ char uniname2ctype_pool_str1304[sizeof("oldpermic")];
+ char uniname2ctype_pool_str1309[sizeof("lepcha")];
+ char uniname2ctype_pool_str1310[sizeof("inbyzantinemusicalsymbols")];
+ char uniname2ctype_pool_str1312[sizeof("olower")];
+ char uniname2ctype_pool_str1315[sizeof("inarabicpresentationformsa")];
+ char uniname2ctype_pool_str1318[sizeof("mong")];
+ char uniname2ctype_pool_str1321[sizeof("nabataean")];
+ char uniname2ctype_pool_str1323[sizeof("mymr")];
+ char uniname2ctype_pool_str1324[sizeof("intibetan")];
+ char uniname2ctype_pool_str1326[sizeof("inyijinghexagramsymbols")];
+ char uniname2ctype_pool_str1330[sizeof("ogam")];
+ char uniname2ctype_pool_str1331[sizeof("inmiscellaneousmathematicalsymbolsb")];
+ char uniname2ctype_pool_str1337[sizeof("inlatinextendedd")];
+ char uniname2ctype_pool_str1338[sizeof("sylotinagri")];
+ char uniname2ctype_pool_str1340[sizeof("inphoneticextensionssupplement")];
+ char uniname2ctype_pool_str1341[sizeof("insorasompeng")];
+ char uniname2ctype_pool_str1345[sizeof("insuttonsignwriting")];
+ char uniname2ctype_pool_str1348[sizeof("linb")];
+ char uniname2ctype_pool_str1349[sizeof("mathsymbol")];
+ char uniname2ctype_pool_str1352[sizeof("myanmar")];
+ char uniname2ctype_pool_str1353[sizeof("inmyanmarextendedb")];
+ char uniname2ctype_pool_str1354[sizeof("limb")];
+ char uniname2ctype_pool_str1360[sizeof("bali")];
+ char uniname2ctype_pool_str1361[sizeof("hmng")];
+ char uniname2ctype_pool_str1364[sizeof("inbraillepatterns")];
+ char uniname2ctype_pool_str1365[sizeof("othermath")];
+ char uniname2ctype_pool_str1366[sizeof("po")];
+ char uniname2ctype_pool_str1367[sizeof("hang")];
+ char uniname2ctype_pool_str1369[sizeof("syrc")];
+ char uniname2ctype_pool_str1371[sizeof("inoriya")];
+ char uniname2ctype_pool_str1375[sizeof("warangciti")];
+ char uniname2ctype_pool_str1377[sizeof("separator")];
+ char uniname2ctype_pool_str1381[sizeof("elba")];
+ char uniname2ctype_pool_str1383[sizeof("inbalinese")];
+ char uniname2ctype_pool_str1384[sizeof("tibt")];
+ char uniname2ctype_pool_str1386[sizeof("modifierletter")];
+ char uniname2ctype_pool_str1389[sizeof("bengali")];
+ char uniname2ctype_pool_str1396[sizeof("inlinearbsyllabary")];
+ char uniname2ctype_pool_str1401[sizeof("tibetan")];
+ char uniname2ctype_pool_str1404[sizeof("syriac")];
+ char uniname2ctype_pool_str1406[sizeof("incaucasianalbanian")];
+ char uniname2ctype_pool_str1410[sizeof("osmanya")];
+ char uniname2ctype_pool_str1411[sizeof("balinese")];
+ char uniname2ctype_pool_str1415[sizeof("inyiradicals")];
+ char uniname2ctype_pool_str1416[sizeof("sundanese")];
+ char uniname2ctype_pool_str1417[sizeof("ingreekandcoptic")];
+ char uniname2ctype_pool_str1420[sizeof("inkannada")];
+ char uniname2ctype_pool_str1422[sizeof("kana")];
+ char uniname2ctype_pool_str1423[sizeof("phoenician")];
+ char uniname2ctype_pool_str1424[sizeof("inancientgreekmusicalnotation")];
+ char uniname2ctype_pool_str1425[sizeof("elbasan")];
+ char uniname2ctype_pool_str1427[sizeof("otherletter")];
+ char uniname2ctype_pool_str1435[sizeof("cakm")];
+ char uniname2ctype_pool_str1440[sizeof("ingeometricshapes")];
+ char uniname2ctype_pool_str1448[sizeof("gothic")];
+ char uniname2ctype_pool_str1450[sizeof("inchakma")];
+ char uniname2ctype_pool_str1455[sizeof("inancientgreeknumbers")];
+ char uniname2ctype_pool_str1456[sizeof("saurashtra")];
+ char uniname2ctype_pool_str1459[sizeof("induployan")];
+ char uniname2ctype_pool_str1468[sizeof("rjng")];
+ char uniname2ctype_pool_str1469[sizeof("mendekikakui")];
+ char uniname2ctype_pool_str1474[sizeof("ingothic")];
+ char uniname2ctype_pool_str1475[sizeof("narb")];
+ char uniname2ctype_pool_str1476[sizeof("cyrl")];
+ char uniname2ctype_pool_str1478[sizeof("brai")];
+ char uniname2ctype_pool_str1483[sizeof("grext")];
+ char uniname2ctype_pool_str1487[sizeof("arab")];
+ char uniname2ctype_pool_str1488[sizeof("meeteimayek")];
+ char uniname2ctype_pool_str1489[sizeof("inrejang")];
+ char uniname2ctype_pool_str1491[sizeof("brahmi")];
+ char uniname2ctype_pool_str1504[sizeof("inkaithi")];
+ char uniname2ctype_pool_str1506[sizeof("multani")];
+ char uniname2ctype_pool_str1507[sizeof("incjkcompatibilityforms")];
+ char uniname2ctype_pool_str1509[sizeof("takri")];
+ char uniname2ctype_pool_str1512[sizeof("incjkcompatibilityideographs")];
+ char uniname2ctype_pool_str1514[sizeof("sarb")];
+ char uniname2ctype_pool_str1521[sizeof("p")];
+ char uniname2ctype_pool_str1522[sizeof("lisu")];
+ char uniname2ctype_pool_str1524[sizeof("inkatakana")];
+ char uniname2ctype_pool_str1530[sizeof("zp")];
+ char uniname2ctype_pool_str1532[sizeof("inornamentaldingbats")];
+ char uniname2ctype_pool_str1533[sizeof("sylo")];
+ char uniname2ctype_pool_str1534[sizeof("cuneiform")];
+ char uniname2ctype_pool_str1548[sizeof("incjkstrokes")];
+ char uniname2ctype_pool_str1552[sizeof("ethiopic")];
+ char uniname2ctype_pool_str1558[sizeof("inmeeteimayek")];
+ char uniname2ctype_pool_str1559[sizeof("kali")];
+ char uniname2ctype_pool_str1567[sizeof("inbrahmi")];
+ char uniname2ctype_pool_str1574[sizeof("incjkcompatibilityideographssupplement")];
+ char uniname2ctype_pool_str1577[sizeof("mult")];
+ char uniname2ctype_pool_str1579[sizeof("inethiopicextended")];
+ char uniname2ctype_pool_str1583[sizeof("talu")];
+ char uniname2ctype_pool_str1584[sizeof("inhangulsyllables")];
+ char uniname2ctype_pool_str1587[sizeof("ingeorgian")];
+ char uniname2ctype_pool_str1588[sizeof("hexdigit")];
+ char uniname2ctype_pool_str1591[sizeof("xsux")];
+ char uniname2ctype_pool_str1592[sizeof("inunifiedcanadianaboriginalsyllabics")];
+ char uniname2ctype_pool_str1595[sizeof("telu")];
+ char uniname2ctype_pool_str1596[sizeof("indingbats")];
+ char uniname2ctype_pool_str1599[sizeof("inblockelements")];
+ char uniname2ctype_pool_str1600[sizeof("geor")];
+ char uniname2ctype_pool_str1611[sizeof("ingreekextended")];
+ char uniname2ctype_pool_str1612[sizeof("inletterlikesymbols")];
+ char uniname2ctype_pool_str1617[sizeof("inoldpersian")];
+ char uniname2ctype_pool_str1624[sizeof("orya")];
+ char uniname2ctype_pool_str1629[sizeof("linearb")];
+ char uniname2ctype_pool_str1632[sizeof("inbassavah")];
+ char uniname2ctype_pool_str1634[sizeof("inoldpermic")];
+ char uniname2ctype_pool_str1635[sizeof("inkanasupplement")];
+ char uniname2ctype_pool_str1636[sizeof("incombininghalfmarks")];
+ char uniname2ctype_pool_str1638[sizeof("runic")];
+ char uniname2ctype_pool_str1640[sizeof("inugaritic")];
+ char uniname2ctype_pool_str1642[sizeof("assigned")];
+ char uniname2ctype_pool_str1643[sizeof("glagolitic")];
+ char uniname2ctype_pool_str1647[sizeof("cyrillic")];
+ char uniname2ctype_pool_str1648[sizeof("inmeroitichieroglyphs")];
+ char uniname2ctype_pool_str1649[sizeof("saur")];
+ char uniname2ctype_pool_str1652[sizeof("hiragana")];
+ char uniname2ctype_pool_str1658[sizeof("insuperscriptsandsubscripts")];
+ char uniname2ctype_pool_str1670[sizeof("ogham")];
+ char uniname2ctype_pool_str1675[sizeof("insaurashtra")];
+ char uniname2ctype_pool_str1680[sizeof("mark")];
+ char uniname2ctype_pool_str1689[sizeof("symbol")];
+ char uniname2ctype_pool_str1694[sizeof("inkharoshthi")];
+ char uniname2ctype_pool_str1700[sizeof("inkhmer")];
+ char uniname2ctype_pool_str1712[sizeof("plrd")];
+ char uniname2ctype_pool_str1714[sizeof("graphemebase")];
+ char uniname2ctype_pool_str1716[sizeof("inhanguljamoextendeda")];
+ char uniname2ctype_pool_str1723[sizeof("incountingrodnumerals")];
+ char uniname2ctype_pool_str1731[sizeof("lydi")];
+ char uniname2ctype_pool_str1733[sizeof("digit")];
+ char uniname2ctype_pool_str1735[sizeof("bassavah")];
+ char uniname2ctype_pool_str1737[sizeof("inarabicmathematicalalphabeticsymbols")];
+ char uniname2ctype_pool_str1739[sizeof("grantha")];
+ char uniname2ctype_pool_str1744[sizeof("lydian")];
+ char uniname2ctype_pool_str1745[sizeof("insupplementalmathematicaloperators")];
+ char uniname2ctype_pool_str1747[sizeof("goth")];
+ char uniname2ctype_pool_str1749[sizeof("hebrew")];
+ char uniname2ctype_pool_str1757[sizeof("meroitichieroglyphs")];
+ char uniname2ctype_pool_str1758[sizeof("incyrillicsupplement")];
+ char uniname2ctype_pool_str1764[sizeof("intakri")];
+ char uniname2ctype_pool_str1765[sizeof("takr")];
+ char uniname2ctype_pool_str1767[sizeof("kaithi")];
+ char uniname2ctype_pool_str1776[sizeof("idsb")];
+ char uniname2ctype_pool_str1777[sizeof("bidic")];
+ char uniname2ctype_pool_str1779[sizeof("incherokeesupplement")];
+ char uniname2ctype_pool_str1781[sizeof("inalchemicalsymbols")];
+ char uniname2ctype_pool_str1784[sizeof("inkhmersymbols")];
+ char uniname2ctype_pool_str1795[sizeof("otherpunctuation")];
+ char uniname2ctype_pool_str1796[sizeof("braille")];
+ char uniname2ctype_pool_str1798[sizeof("logicalorderexception")];
+ char uniname2ctype_pool_str1799[sizeof("incurrencysymbols")];
+ char uniname2ctype_pool_str1800[sizeof("tirhuta")];
+ char uniname2ctype_pool_str1804[sizeof("inphagspa")];
+ char uniname2ctype_pool_str1814[sizeof("inarabicextendeda")];
+ char uniname2ctype_pool_str1819[sizeof("brah")];
+ char uniname2ctype_pool_str1831[sizeof("hebr")];
+ char uniname2ctype_pool_str1834[sizeof("pd")];
+ char uniname2ctype_pool_str1836[sizeof("kthi")];
+ char uniname2ctype_pool_str1843[sizeof("inethiopicsupplement")];
+ char uniname2ctype_pool_str1862[sizeof("runr")];
+ char uniname2ctype_pool_str1864[sizeof("olck")];
+ char uniname2ctype_pool_str1865[sizeof("ideographic")];
+ char uniname2ctype_pool_str1871[sizeof("ogrext")];
+ char uniname2ctype_pool_str1875[sizeof("olchiki")];
+ char uniname2ctype_pool_str1882[sizeof("inhighprivateusesurrogates")];
+ char uniname2ctype_pool_str1892[sizeof("softdotted")];
+ char uniname2ctype_pool_str1893[sizeof("inhebrew")];
+ char uniname2ctype_pool_str1896[sizeof("number")];
+ char uniname2ctype_pool_str1901[sizeof("hluw")];
+ char uniname2ctype_pool_str1904[sizeof("inkhojki")];
+ char uniname2ctype_pool_str1908[sizeof("sund")];
+ char uniname2ctype_pool_str1912[sizeof("deprecated")];
+ char uniname2ctype_pool_str1913[sizeof("patsyn")];
+ char uniname2ctype_pool_str1931[sizeof("unassigned")];
+ char uniname2ctype_pool_str1938[sizeof("phagspa")];
+ char uniname2ctype_pool_str1944[sizeof("ingeometricshapesextended")];
+ char uniname2ctype_pool_str1945[sizeof("knda")];
+ char uniname2ctype_pool_str1956[sizeof("insupplementalarrowsa")];
+ char uniname2ctype_pool_str1958[sizeof("inmendekikakui")];
+ char uniname2ctype_pool_str1963[sizeof("insupplementalarrowsc")];
+ char uniname2ctype_pool_str1964[sizeof("sorasompeng")];
+ char uniname2ctype_pool_str1971[sizeof("inhanguljamo")];
+ char uniname2ctype_pool_str1974[sizeof("kannada")];
+ char uniname2ctype_pool_str1977[sizeof("graph")];
+ char uniname2ctype_pool_str1984[sizeof("idstrinaryoperator")];
+ char uniname2ctype_pool_str1986[sizeof("hangul")];
+ char uniname2ctype_pool_str1989[sizeof("inhanunoo")];
+ char uniname2ctype_pool_str1991[sizeof("changeswhencasemapped")];
+ char uniname2ctype_pool_str1999[sizeof("nko")];
+ char uniname2ctype_pool_str2000[sizeof("nkoo")];
+ char uniname2ctype_pool_str2003[sizeof("combiningmark")];
+ char uniname2ctype_pool_str2006[sizeof("inkatakanaphoneticextensions")];
+ char uniname2ctype_pool_str2012[sizeof("khmr")];
+ char uniname2ctype_pool_str2016[sizeof("phlp")];
+ char uniname2ctype_pool_str2018[sizeof("khar")];
+ char uniname2ctype_pool_str2056[sizeof("otherdefaultignorablecodepoint")];
+ char uniname2ctype_pool_str2057[sizeof("enclosingmark")];
+ char uniname2ctype_pool_str2071[sizeof("inhalfwidthandfullwidthforms")];
+ char uniname2ctype_pool_str2072[sizeof("inmeroiticcursive")];
+ char uniname2ctype_pool_str2078[sizeof("inglagolitic")];
+ char uniname2ctype_pool_str2081[sizeof("changeswhentitlecased")];
+ char uniname2ctype_pool_str2084[sizeof("dep")];
+ char uniname2ctype_pool_str2089[sizeof("inbuhid")];
+ char uniname2ctype_pool_str2092[sizeof("incombiningdiacriticalmarks")];
+ char uniname2ctype_pool_str2096[sizeof("inunifiedcanadianaboriginalsyllabicsextended")];
+ char uniname2ctype_pool_str2097[sizeof("any")];
+ char uniname2ctype_pool_str2102[sizeof("incombiningdiacriticalmarksforsymbols")];
+ char uniname2ctype_pool_str2105[sizeof("kharoshthi")];
+ char uniname2ctype_pool_str2116[sizeof("cherokee")];
+ char uniname2ctype_pool_str2118[sizeof("inarabicsupplement")];
+ char uniname2ctype_pool_str2124[sizeof("pauc")];
+ char uniname2ctype_pool_str2126[sizeof("phag")];
+ char uniname2ctype_pool_str2127[sizeof("intagalog")];
+ char uniname2ctype_pool_str2137[sizeof("inplayingcards")];
+ char uniname2ctype_pool_str2141[sizeof("inpahawhhmong")];
+ char uniname2ctype_pool_str2150[sizeof("changeswhencasefolded")];
+ char uniname2ctype_pool_str2151[sizeof("incyrillicextendedb")];
+ char uniname2ctype_pool_str2154[sizeof("incombiningdiacriticalmarkssupplement")];
+ char uniname2ctype_pool_str2155[sizeof("alphabetic")];
+ char uniname2ctype_pool_str2172[sizeof("glag")];
+ char uniname2ctype_pool_str2178[sizeof("hyphen")];
+ char uniname2ctype_pool_str2203[sizeof("inyisyllables")];
+ char uniname2ctype_pool_str2212[sizeof("bidicontrol")];
+ char uniname2ctype_pool_str2215[sizeof("inbengali")];
+ char uniname2ctype_pool_str2220[sizeof("spacingmark")];
+ char uniname2ctype_pool_str2225[sizeof("cypriot")];
+ char uniname2ctype_pool_str2226[sizeof("beng")];
+ char uniname2ctype_pool_str2227[sizeof("graphemeextend")];
+ char uniname2ctype_pool_str2236[sizeof("khoj")];
+ char uniname2ctype_pool_str2240[sizeof("inbuginese")];
+ char uniname2ctype_pool_str2251[sizeof("tglg")];
+ char uniname2ctype_pool_str2259[sizeof("palmyrene")];
+ char uniname2ctype_pool_str2268[sizeof("incypriotsyllabary")];
+ char uniname2ctype_pool_str2277[sizeof("punct")];
+ char uniname2ctype_pool_str2278[sizeof("khmer")];
+ char uniname2ctype_pool_str2283[sizeof("incjksymbolsandpunctuation")];
+ char uniname2ctype_pool_str2294[sizeof("inaegeannumbers")];
+ char uniname2ctype_pool_str2305[sizeof("tagb")];
+ char uniname2ctype_pool_str2307[sizeof("orkh")];
+ char uniname2ctype_pool_str2316[sizeof("intagbanwa")];
+ char uniname2ctype_pool_str2327[sizeof("oldhungarian")];
+ char uniname2ctype_pool_str2348[sizeof("georgian")];
+ char uniname2ctype_pool_str2368[sizeof("modifiersymbol")];
+ char uniname2ctype_pool_str2376[sizeof("changeswhenlowercased")];
+ char uniname2ctype_pool_str2383[sizeof("otheruppercase")];
+ char uniname2ctype_pool_str2406[sizeof("signwriting")];
+ char uniname2ctype_pool_str2460[sizeof("insupplementaryprivateuseareaa")];
+ char uniname2ctype_pool_str2462[sizeof("inkayahli")];
+ char uniname2ctype_pool_str2468[sizeof("ugaritic")];
+ char uniname2ctype_pool_str2476[sizeof("uideo")];
+ char uniname2ctype_pool_str2494[sizeof("inarabicpresentationformsb")];
+ char uniname2ctype_pool_str2495[sizeof("nonspacingmark")];
+ char uniname2ctype_pool_str2499[sizeof("rejang")];
+ char uniname2ctype_pool_str2501[sizeof("inkangxiradicals")];
+ char uniname2ctype_pool_str2502[sizeof("incjkcompatibility")];
+ char uniname2ctype_pool_str2543[sizeof("bamu")];
+ char uniname2ctype_pool_str2545[sizeof("inbamum")];
+ char uniname2ctype_pool_str2556[sizeof("pahawhhmong")];
+ char uniname2ctype_pool_str2557[sizeof("grbase")];
+ char uniname2ctype_pool_str2558[sizeof("aghb")];
+ char uniname2ctype_pool_str2560[sizeof("bopo")];
+ char uniname2ctype_pool_str2569[sizeof("tagalog")];
+ char uniname2ctype_pool_str2571[sizeof("inbopomofo")];
+ char uniname2ctype_pool_str2596[sizeof("incombiningdiacriticalmarksextended")];
+ char uniname2ctype_pool_str2598[sizeof("inkanbun")];
+ char uniname2ctype_pool_str2606[sizeof("oldturkic")];
+ char uniname2ctype_pool_str2608[sizeof("defaultignorablecodepoint")];
+ char uniname2ctype_pool_str2613[sizeof("ugar")];
+ char uniname2ctype_pool_str2636[sizeof("caucasianalbanian")];
+ char uniname2ctype_pool_str2649[sizeof("inlatinextendedb")];
+ char uniname2ctype_pool_str2662[sizeof("othergraphemeextend")];
+ char uniname2ctype_pool_str2681[sizeof("hung")];
+ char uniname2ctype_pool_str2685[sizeof("inlimbu")];
+ char uniname2ctype_pool_str2689[sizeof("grek")];
+ char uniname2ctype_pool_str2692[sizeof("batk")];
+ char uniname2ctype_pool_str2700[sizeof("inbatak")];
+ char uniname2ctype_pool_str2703[sizeof("incjkradicalssupplement")];
+ char uniname2ctype_pool_str2745[sizeof("innoblock")];
+ char uniname2ctype_pool_str2755[sizeof("cwu")];
+ char uniname2ctype_pool_str2760[sizeof("oldnortharabian")];
+ char uniname2ctype_pool_str2772[sizeof("insupplementalsymbolsandpictographs")];
+ char uniname2ctype_pool_str2774[sizeof("dupl")];
+ char uniname2ctype_pool_str2784[sizeof("dashpunctuation")];
+ char uniname2ctype_pool_str2788[sizeof("inbamumsupplement")];
+ char uniname2ctype_pool_str2794[sizeof("gujr")];
+ char uniname2ctype_pool_str2799[sizeof("inhighsurrogates")];
+ char uniname2ctype_pool_str2803[sizeof("lu")];
+ char uniname2ctype_pool_str2810[sizeof("qmark")];
+ char uniname2ctype_pool_str2815[sizeof("gujarati")];
+ char uniname2ctype_pool_str2817[sizeof("limbu")];
+ char uniname2ctype_pool_str2824[sizeof("sk")];
+ char uniname2ctype_pool_str2833[sizeof("egyp")];
+ char uniname2ctype_pool_str2852[sizeof("inlisu")];
+ char uniname2ctype_pool_str2873[sizeof("bopomofo")];
+ char uniname2ctype_pool_str2895[sizeof("inhanguljamoextendedb")];
+ char uniname2ctype_pool_str2899[sizeof("inegyptianhieroglyphs")];
+ char uniname2ctype_pool_str2906[sizeof("intelugu")];
+ char uniname2ctype_pool_str2921[sizeof("katakana")];
+ char uniname2ctype_pool_str2947[sizeof("kayahli")];
+ char uniname2ctype_pool_str2950[sizeof("oupper")];
+ char uniname2ctype_pool_str2972[sizeof("surrogate")];
+ char uniname2ctype_pool_str2991[sizeof("currencysymbol")];
+ char uniname2ctype_pool_str3010[sizeof("insupplementalpunctuation")];
+ char uniname2ctype_pool_str3040[sizeof("ingeorgiansupplement")];
+ char uniname2ctype_pool_str3071[sizeof("unifiedideograph")];
+ char uniname2ctype_pool_str3107[sizeof("unknown")];
+ char uniname2ctype_pool_str3132[sizeof("zyyy")];
+ char uniname2ctype_pool_str3135[sizeof("insupplementalarrowsb")];
+ char uniname2ctype_pool_str3166[sizeof("uppercase")];
+ char uniname2ctype_pool_str3167[sizeof("khudawadi")];
+ char uniname2ctype_pool_str3274[sizeof("inkhudawadi")];
+ char uniname2ctype_pool_str3282[sizeof("openpunctuation")];
+ char uniname2ctype_pool_str3382[sizeof("upper")];
+ char uniname2ctype_pool_str3404[sizeof("buhd")];
+ char uniname2ctype_pool_str3406[sizeof("quotationmark")];
+ char uniname2ctype_pool_str3441[sizeof("paucinhau")];
+ char uniname2ctype_pool_str3442[sizeof("paragraphseparator")];
+ char uniname2ctype_pool_str3443[sizeof("khojki")];
+ char uniname2ctype_pool_str3450[sizeof("inpaucinhau")];
+ char uniname2ctype_pool_str3459[sizeof("inbopomofoextended")];
+ char uniname2ctype_pool_str3504[sizeof("uppercaseletter")];
+ char uniname2ctype_pool_str3519[sizeof("punctuation")];
+ char uniname2ctype_pool_str3529[sizeof("egyptianhieroglyphs")];
+ char uniname2ctype_pool_str3531[sizeof("bugi")];
+ char uniname2ctype_pool_str3556[sizeof("changeswhenuppercased")];
+ char uniname2ctype_pool_str3582[sizeof("buginese")];
+ char uniname2ctype_pool_str3626[sizeof("incjkunifiedideographsextensiona")];
+ char uniname2ctype_pool_str3633[sizeof("incjkunifiedideographsextensionc")];
+ char uniname2ctype_pool_str3634[sizeof("inhangulcompatibilityjamo")];
+ char uniname2ctype_pool_str3638[sizeof("incjkunifiedideographsextensione")];
+ char uniname2ctype_pool_str3639[sizeof("insupplementaryprivateuseareab")];
+ char uniname2ctype_pool_str3643[sizeof("incjkunifiedideographs")];
+ char uniname2ctype_pool_str3822[sizeof("oldsoutharabian")];
+ char uniname2ctype_pool_str3863[sizeof("inboxdrawing")];
+ char uniname2ctype_pool_str3927[sizeof("guru")];
+ char uniname2ctype_pool_str3928[sizeof("telugu")];
+ char uniname2ctype_pool_str3941[sizeof("buhid")];
+ char uniname2ctype_pool_str3974[sizeof("duployan")];
+ char uniname2ctype_pool_str4081[sizeof("greek")];
+ char uniname2ctype_pool_str4084[sizeof("batak")];
+ char uniname2ctype_pool_str4139[sizeof("blank")];
+ char uniname2ctype_pool_str4149[sizeof("incjkunifiedideographsextensiond")];
+ char uniname2ctype_pool_str4205[sizeof("grlink")];
+ char uniname2ctype_pool_str4446[sizeof("graphemelink")];
+ char uniname2ctype_pool_str4805[sizeof("incjkunifiedideographsextensionb")];
+ char uniname2ctype_pool_str5326[sizeof("gurmukhi")];
#endif /* USE_UNICODE_PROPERTIES */
};
static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
@@ -26709,650 +31617,768 @@ static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
"upper",
#else /* USE_UNICODE_PROPERTIES */
"n",
- "s",
+ "mn",
+ "m",
"z",
- "zs",
- "zzzz",
"cn",
- "cs",
+ "mani",
"ci",
+ "inmanichaean",
+ "zzzz",
+ "qaai",
"c",
- "cf",
- "sc",
+ "mc",
+ "qaac",
+ "sm",
+ "incham",
+ "me",
+ "inarmenian",
+ "cc",
+ "mandaic",
+ "incuneiform",
+ "insamaritan",
"cans",
- "qaai",
- "mn",
+ "s",
+ "sc",
#endif /* USE_UNICODE_PROPERTIES */
"ascii",
#ifdef USE_UNICODE_PROPERTIES
- "cc",
- "qaac",
+ "zs",
"inavestan",
- "inspecials",
+ "cs",
"inipaextensions",
- "mc",
- "insamaritan",
- "m",
- "sm",
- "me",
- "inarmenian",
- "incuneiform",
- "mandaic",
- "inancientsymbols",
"incuneiformnumbersandpunctuation",
+ "incommonindicnumberforms",
"inthai",
- "inmusicalsymbols",
- "inmiscellaneoussymbols",
- "incham",
- "inmiscellaneoussymbolsandarrows",
+ "cwcm",
+ "mtei",
+ "inspecials",
"initialpunctuation",
- "inmiscellaneoussymbolsandpictographs",
+ "invai",
"inthaana",
+ "inancientsymbols",
+ "vai",
+ "vaii",
+ "inmiscellaneousmathematicalsymbolsa",
+ "newtailue",
+ "inmusicalsymbols",
+ "lm",
"taile",
- "mtei",
- "lc",
+ "lina",
+ "inmyanmarextendeda",
+ "sterm",
"lana",
+ "alnum",
"inlycian",
+ "lc",
+ "inmalayalam",
+ "inshavian",
+ "inmiscellaneoussymbols",
+ "inlineara",
"intransportandmapsymbols",
+ "vs",
+ "inmiscellaneoussymbolsandarrows",
+ "intaitham",
+ "innewtailue",
+ "inmiscellaneoussymbolsandpictographs",
"incontrolpictures",
"sinhala",
- "incommonindicnumberforms",
- "inmiscellaneousmathematicalsymbolsa",
- "sterm",
- "inmyanmarextendeda",
- "lm",
"taiviet",
- "inlinearbideograms",
- "intaitham",
"latn",
"latin",
"ital",
- "alnum",
- "inmalayalam",
+ "intamil",
+ "taml",
+ "inmultani",
+ "avst",
+ "inlinearbideograms",
+ "avestan",
+ "intaixuanjingsymbols",
"intaile",
"tale",
+ "cwt",
+ "cwcf",
+ "armn",
+ "inlatinextendeda",
+ "armi",
"l",
"nl",
- "zl",
- "intamil",
- "taml",
- "inlatinextendeda",
- "inlatinextendedc",
+ "armenian",
+ "inmyanmar",
"inrunic",
"incarian",
- "insyriac",
+ "zl",
+ "inlatinextendedc",
"cari",
"inmeeteimayekextensions",
- "osma",
- "lt",
- "miao",
- "insharada",
- "incyrillic",
+ "inlatinextendede",
"carian",
- "armn",
+ "merc",
+ "ext",
+ "incyrillic",
+ "tavt",
+ "intaiviet",
"samr",
- "armi",
- "inideographicdescriptioncharacters",
- "inosmanya",
- "armenian",
- "inmyanmar",
+ "miao",
+ "lt",
+ "inlowsurrogates",
"samaritan",
+ "inahom",
"arabic",
+ "insyriac",
+ "insharada",
+ "java",
+ "inosmanya",
"incherokee",
- "connectorpunctuation",
- "merc",
+ "cf",
"inmiscellaneoustechnical",
+ "inruminumeralsymbols",
+ "zinh",
+ "han",
+ "osma",
+ "hani",
+ "injavanese",
+ "wara",
+ "inwarangciti",
+ "inmahajani",
+ "cham",
+ "javanese",
+ "term",
+ "sinh",
+ "cwl",
+ "manichaean",
+ "insmallformvariants",
+ "connectorpunctuation",
"inenclosedalphanumerics",
- "inemoticons",
- "joinc",
+ "inethiopic",
+ "tamil",
#endif /* USE_UNICODE_PROPERTIES */
"cntrl",
#ifdef USE_UNICODE_PROPERTIES
- "inenclosedcjklettersandmonths",
- "cwcf",
- "inruminumeralsymbols",
- "ll",
- "term",
+ "insinhala",
+ "chakma",
+ "shavian",
"inlatinextendedadditional",
- "tamil",
- "loe",
- "newtailue",
- "cwcm",
+ "ll",
+ "lineara",
+ "inideographicdescriptioncharacters",
+ "thai",
+ "math",
+ "thaa",
"inenclosedalphanumericsupplement",
- "sinh",
- "zinh",
+ "ethi",
+ "hatran",
"meroiticcursive",
- "han",
- "hani",
+ "inemoticons",
+ "shaw",
+ "taitham",
+ "thaana",
+ "insinhalaarchaicnumbers",
+ "ahex",
+ "loe",
+ "invariationselectors",
+ "terminalpunctuation",
+ "whitespace",
+ "asciihexdigit",
+ "inearlydynasticcuneiform",
"inopticalcharacterrecognition",
+ "joinc",
+ "di",
+ "inenclosedcjklettersandmonths",
+ "mand",
+ "inmodi",
+ "mahj",
+ "dia",
+ "mend",
+ "inmandaic",
+ "invariationselectorssupplement",
+ "idc",
+ "mahajani",
+ "sind",
+ "hex",
+ "oriya",
+ "mero",
+ "titlecaseletter",
"no",
- "so",
- "innewtailue",
- "insinhala",
+ "inscriptionalparthian",
"innko",
- "co",
- "shavian",
- "terminalpunctuation",
- "intaixuanjingsymbols",
- "inethiopic",
+ "insundanese",
+ "inmro",
+ "intifinagh",
+ "ids",
"sora",
+ "co",
+ "tifinagh",
+ "indominotiles",
+ "hira",
"inarrows",
- "cham",
- "inlowsurrogates",
- "oriya",
- "ext",
- "cwt",
- "common",
"inmiao",
- "thai",
- "intifinagh",
- "ethi",
- "mero",
- "chakma",
- "thaa",
- "inscriptionalparthian",
- "tifinagh",
- "titlecaseletter",
- "thaana",
- "asciihexdigit",
- "math",
- "di",
- "ids",
+ "common",
+ "so",
+ "inhiragana",
+ "cher",
+ "hano",
+ "ahom",
+ "xidc",
+ "idst",
+ "inogham",
+ "inolchiki",
+ "idcontinue",
+ "inmathematicalalphanumericsymbols",
+ "xids",
+ "inscriptionalpahlavi",
+ "indevanagari",
+ "inlydian",
+ "deva",
+ "inspacingmodifierletters",
+ "indeseret",
+ "anatolianhieroglyphs",
+ "tirh",
+ "devanagari",
+ "inhatran",
+ "hatr",
+ "invedicextensions",
+ "intirhuta",
+ "inmahjongtiles",
"lo",
"inlao",
- "taitham",
"lao",
"laoo",
- "dia",
- "idc",
- "ps",
- "insundanese",
+ "mongolian",
"pi",
- "cwl",
- "pf",
- "mand",
"insylotinagri",
- "vs",
- "mongolian",
- "pc",
- "inmandaic",
- "invai",
"lineseparator",
+ "pc",
"pe",
- "vai",
- "vaii",
- "idst",
- "indominotiles",
- "inshavian",
- "inspacingmodifierletters",
- "format",
"inphaistosdisc",
- "hano",
+ "letter",
+ "inanatolianhieroglyphs",
+ "oalpha",
+ "ps",
+ "inverticalforms",
+ "xdigit",
+ "lowercase",
+ "odi",
+ "diacritic",
+ "modi",
+ "xidstart",
+ "inshorthandformatcontrols",
+ "oidc",
#endif /* USE_UNICODE_PROPERTIES */
"space",
#ifdef USE_UNICODE_PROPERTIES
- "indeseret",
- "inolchiki",
- "hira",
- "joincontrol",
- "idcontinue",
- "inmahjongtiles",
- "patws",
- "inlydian",
- "cher",
- "inhiragana",
- "inogham",
- "avst",
- "inscriptionalpahlavi",
+ "ideo",
+ "inolditalic",
+ "mro",
+ "mroo",
+ "insundanesesupplement",
+ "oids",
+ "nchar",
+ "decimalnumber",
"incoptic",
- "java",
- "inmathematicalalphanumericsymbols",
- "letter",
- "injavanese",
- "avestan",
- "age=1.1",
- "lepc",
- "age=2.1",
- "inlepcha",
- "javanese",
- "shaw",
- "finalpunctuation",
+ "palm",
+ "format",
+ "dsrt",
+ "dash",
+ "inmodifiertoneletters",
+ "patws",
"alpha",
- "age=5.1",
+ "siddham",
+ "inlepcha",
+ "wspace",
+ "inpalmyrene",
+ "lepc",
+ "idstart",
+ "inprivateusearea",
+ "psalterpahlavi",
+ "incopticepactnumbers",
+ "inoldturkic",
+ "sharada",
+ "hanunoo",
+ "incyrillicextendeda",
+ "joincontrol",
+ "xidcontinue",
+ "deseret",
+ "radical",
+ "canadianaboriginal",
+ "omath",
"inmongolian",
- "age=5.2",
- "age=2.0",
- "ahex",
- "ingeneralpunctuation",
- "oids",
- "odi",
- "age=5.0",
- "tavt",
- "intaiviet",
+ "casedletter",
+ "extender",
+ "control",
+ "ingrantha",
+ "yi",
+ "otheridcontinue",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=1.1",
+ "age=2.1",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "yiii",
+ "inethiopicextendeda",
+#ifdef USE_UNICODE_AGE_PROPERTIES
"age=6.1",
+ "age=6.2",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "perm",
+#endif /* USE_UNICODE_PROPERTIES */
+ "lower",
+#ifndef USE_UNICODE_PROPERTIES
+ "graph",
+#else /* USE_UNICODE_PROPERTIES */
+#ifdef USE_UNICODE_AGE_PROPERTIES
"age=3.1",
- "insundanesesupplement",
"age=3.2",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "noncharactercodepoint",
+#ifdef USE_UNICODE_AGE_PROPERTIES
"age=4.1",
- "oidc",
- "tfng",
- "insmallformvariants",
- "ideo",
- "intags",
+ "age=2.0",
+ "age=6.3",
+ "age=8.0",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "ingeneralpunctuation",
+#ifdef USE_UNICODE_AGE_PROPERTIES
"age=6.0",
+ "age=5.1",
+ "age=5.2",
+ "age=7.0",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "nd",
+#ifdef USE_UNICODE_AGE_PROPERTIES
"age=3.0",
- "whitespace",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "otheralphabetic",
+#ifdef USE_UNICODE_AGE_PROPERTIES
"age=4.0",
- "inolditalic",
- "oalpha",
- "ingujarati",
- "control",
- "diacritic",
- "tagbanwa",
- "inphoenician",
- "ininscriptionalparthian",
- "ininscriptionalpahlavi",
- "coptic",
- "dsrt",
- "inmodifiertoneletters",
- "xids",
- "hanunoo",
- "inoldturkic",
- "xidc",
- "idstart",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "imperialaramaic",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=5.0",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "pf",
+ "letternumber",
"inimperialaramaic",
- "invariationselectors",
- "copt",
- "caseignorable",
+ "inphoenician",
+ "finalpunctuation",
+ "sd",
+ "olditalic",
+ "sidd",
+ "inenclosedideographicsupplement",
"prti",
- "nchar",
- "deseret",
- "decimalnumber",
+ "sgnw",
+ "coptic",
+ "insiddham",
+ "inoldnortharabian",
"cprt",
"inlatin1supplement",
- "imperialaramaic",
+ "tagbanwa",
+ "cased",
+ "ininscriptionalparthian",
+ "ininscriptionalpahlavi",
+ "inherited",
"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",
- "gothic",
+ "copt",
"inoldsoutharabian",
- "xidstart",
- "inrejang",
+ "lowercaseletter",
+ "word",
+ "intags",
+ "shrd",
"idsbinaryoperator",
- "olower",
- "hex",
- "inenclosedideographicsupplement",
- "inalphabeticpresentationforms",
- "inbasiclatin",
+ "xpeo",
"othersymbol",
- "nd",
- "sd",
- "omath",
- "separator",
- "inarabic",
- "xidcontinue",
- "otheridstart",
- "grext",
"otherlowercase",
+ "otheridstart",
+ "mlym",
+ "inoldhungarian",
+ "lyci",
+ "print",
+ "phnx",
+ "innabataean",
+ "lycian",
+ "ingujarati",
+ "bamum",
+ "malayalam",
+ "variationselector",
+ "patternwhitespace",
+ "inelbasan",
+ "spaceseparator",
+ "inarabic",
+ "inalphabeticpresentationforms",
+ "inbasiclatin",
"phli",
- "cased",
- "hang",
- "xpeo",
-#endif /* USE_UNICODE_PROPERTIES */
- "lower",
-#ifndef USE_UNICODE_PROPERTIES
- "graph",
-#else /* USE_UNICODE_PROPERTIES */
- "modifierletter",
- "inphoneticextensions",
- "inarabicpresentationformsa",
+ "indevanagariextended",
"innumberforms",
+ "caseignorable",
+ "tfng",
+ "other",
+ "inphoneticextensions",
+ "othernumber",
+ "closepunctuation",
"oldpersian",
- "incyrillicextendeda",
- "inverticalforms",
- "p",
- "inbyzantinemusicalsymbols",
+ "gran",
+ "bass",
+ "patternsyntax",
"inmathematicaloperators",
- "intibetan",
- "zp",
- "ingeorgian",
- "inbraillepatterns",
+ "inpsalterpahlavi",
+ "ingurmukhi",
+ "nbat",
+ "oldpermic",
"lepcha",
- "geor",
- "invedicextensions",
+ "inbyzantinemusicalsymbols",
+ "olower",
+ "inarabicpresentationformsa",
+ "mong",
+ "nabataean",
+ "mymr",
+ "intibetan",
+ "inyijinghexagramsymbols",
+ "ogam",
+ "inmiscellaneousmathematicalsymbolsb",
+ "inlatinextendedd",
+ "sylotinagri",
+ "inphoneticextensionssupplement",
+ "insorasompeng",
+ "insuttonsignwriting",
"linb",
- "other",
- "deva",
- "indevanagari",
- "othernumber",
- "bamum",
- "shrd",
+ "mathsymbol",
+ "myanmar",
+ "inmyanmarextendedb",
+ "limb",
"bali",
- "devanagari",
- "extender",
- "inherited",
- "glagolitic",
- "tibt",
+ "hmng",
+ "inbraillepatterns",
+ "othermath",
+ "po",
+ "hang",
+ "syrc",
+ "inoriya",
+ "warangciti",
+ "separator",
+ "elba",
"inbalinese",
- "ingothic",
- "inmiscellaneousmathematicalsymbolsb",
- "limb",
+ "tibt",
+ "modifierletter",
"bengali",
- "phoenician",
- "insuperscriptsandsubscripts",
- "inmeroitichieroglyphs",
+ "inlinearbsyllabary",
"tibetan",
- "inphoneticextensionssupplement",
+ "syriac",
+ "incaucasianalbanian",
+ "osmanya",
"balinese",
- "lowercaseletter",
- "indingbats",
- "inprivateusearea",
- "assigned",
- "patternsyntax",
- "inhangulsyllables",
- "sarb",
- "brai",
- "insupplementalmathematicaloperators",
- "phnx",
- "ingreekextended",
- "otherletter",
- "arab",
- "inlatinextendedd",
- "word",
- "inphagspa",
- "inblockelements",
- "ethiopic",
- "inethiopicextendeda",
- "brahmi",
- "logicalorderexception",
- "inoldpersian",
- "inletterlikesymbols",
- "sorasompeng",
- "hiragana",
- "inhanguljamoextendeda",
- "othermath",
-#endif /* USE_UNICODE_PROPERTIES */
- "digit",
-#ifndef USE_UNICODE_PROPERTIES
- "blank"
-#else /* USE_UNICODE_PROPERTIES */
- "goth",
- "ogham",
+ "inyiradicals",
"sundanese",
- "saurashtra",
- "linearb",
- "graphemebase",
- "inunifiedcanadianaboriginalsyllabics",
- "cuneiform",
+ "ingreekandcoptic",
"inkannada",
"kana",
- "inancientgreeknumbers",
- "incjkstrokes",
- "inglagolitic",
+ "phoenician",
"inancientgreekmusicalnotation",
- "inchakma",
- "plrd",
- "inbrahmi",
+ "elbasan",
+ "otherletter",
"cakm",
- "incjkcompatibilityforms",
- "lisu",
- "incjkcompatibilityideographs",
- "intagalog",
+ "ingeometricshapes",
+ "gothic",
+ "inchakma",
+ "inancientgreeknumbers",
+ "saurashtra",
+ "induployan",
+ "rjng",
+ "mendekikakui",
+ "ingothic",
+ "narb",
+ "cyrl",
+ "brai",
+ "grext",
+ "arab",
+ "meeteimayek",
+ "inrejang",
+ "brahmi",
"inkaithi",
- "insupplementalarrowsa",
+ "multani",
+ "incjkcompatibilityforms",
"takri",
- "ideographic",
- "hexdigit",
- "glag",
- "softdotted",
- "variationselector",
+ "incjkcompatibilityideographs",
+ "sarb",
+ "p",
+ "lisu",
"inkatakana",
- "meeteimayek",
- "otherpunctuation",
- "inhanguljamo",
+ "zp",
+ "inornamentaldingbats",
+ "sylo",
+ "cuneiform",
+ "incjkstrokes",
+ "ethiopic",
+ "inmeeteimayek",
"kali",
- "braille",
- "incombininghalfmarks",
- "talu",
+ "inbrahmi",
"incjkcompatibilityideographssupplement",
+ "mult",
+ "inethiopicextended",
+ "talu",
+ "inhangulsyllables",
+ "ingeorgian",
+ "hexdigit",
+ "xsux",
+ "inunifiedcanadianaboriginalsyllabics",
"telu",
- "idsb",
- "tglg",
- "inmeeteimayek",
- "yi",
- "phagspa",
- "yiii",
- "inarabicmathematicalalphabeticsymbols",
- "saur",
- "ogrext",
- "bidic",
+ "indingbats",
+ "inblockelements",
+ "geor",
+ "ingreekextended",
+ "inletterlikesymbols",
+ "inoldpersian",
+ "orya",
+ "linearb",
+ "inbassavah",
+ "inoldpermic",
"inkanasupplement",
+ "incombininghalfmarks",
"runic",
- "inalchemicalsymbols",
- "georgian",
"inugaritic",
+ "assigned",
+ "glagolitic",
+ "cyrillic",
+ "inmeroitichieroglyphs",
+ "saur",
+ "hiragana",
+ "insuperscriptsandsubscripts",
+ "ogham",
"insaurashtra",
- "inhighprivateusesurrogates",
- "pd",
+ "mark",
+ "symbol",
+ "inkharoshthi",
+ "inkhmer",
+ "plrd",
+ "graphemebase",
+ "inhanguljamoextendeda",
"incountingrodnumerals",
+ "lydi",
+#endif /* USE_UNICODE_PROPERTIES */
+ "digit",
+#ifndef USE_UNICODE_PROPERTIES
+ "blank"
+#else /* USE_UNICODE_PROPERTIES */
+ "bassavah",
+ "inarabicmathematicalalphabeticsymbols",
+ "grantha",
+ "lydian",
+ "insupplementalmathematicaloperators",
+ "goth",
+ "hebrew",
+ "meroitichieroglyphs",
+ "incyrillicsupplement",
+ "intakri",
+ "takr",
+ "kaithi",
+ "idsb",
+ "bidic",
+ "incherokeesupplement",
+ "inalchemicalsymbols",
+ "inkhmersymbols",
+ "otherpunctuation",
+ "braille",
+ "logicalorderexception",
+ "incurrencysymbols",
+ "tirhuta",
+ "inphagspa",
"inarabicextendeda",
- "inkharoshthi",
- "idstrinaryoperator",
- "phag",
"brah",
- "mark",
"hebr",
- "inkhmersymbols",
- "dep",
- "inkhmer",
+ "pd",
+ "kthi",
+ "inethiopicsupplement",
+ "runr",
+ "olck",
+ "ideographic",
+ "ogrext",
+ "olchiki",
+ "inhighprivateusesurrogates",
+ "softdotted",
+ "inhebrew",
+ "number",
+ "hluw",
+ "inkhojki",
+ "sund",
"deprecated",
- "rejang",
- "lyci",
- "intakri",
- "takr",
- "incyrillicsupplement",
- "changeswhencasefolded",
- "indevanagariextended",
- "lycian",
- "inbengali",
- "beng",
+ "patsyn",
+ "unassigned",
+ "phagspa",
+ "ingeometricshapesextended",
+ "knda",
+ "insupplementalarrowsa",
+ "inmendekikakui",
+ "insupplementalarrowsc",
+ "sorasompeng",
+ "inhanguljamo",
+ "kannada",
"graph",
- "inyijinghexagramsymbols",
- "olck",
- "inarabicsupplement",
- "inbuginese",
+ "idstrinaryoperator",
+ "hangul",
+ "inhanunoo",
"changeswhencasemapped",
- "olchiki",
- "inaegeannumbers",
- "mlym",
- "alphabetic",
- "sylotinagri",
- "changeswhentitlecased",
- "tagalog",
- "tagb",
- "runr",
- "malayalam",
- "inoriya",
- "intagbanwa",
- "syrc",
"nko",
"nkoo",
- "inethiopicextended",
- "kaithi",
- "mathsymbol",
- "inyiradicals",
- "insupplementaryprivateuseareaa",
- "osmanya",
- "syriac",
+ "combiningmark",
+ "inkatakanaphoneticextensions",
+ "khmr",
+ "phlp",
+ "khar",
"otherdefaultignorablecodepoint",
- "number",
- "inlinearbsyllabary",
- "kthi",
- "sund",
- "mymr",
- "incombiningdiacriticalmarks",
"enclosingmark",
- "incombiningdiacriticalmarksforsymbols",
- "inethiopicsupplement",
- "unassigned",
- "sylo",
- "combiningmark",
- "myanmar",
- "graphemeextend",
- "bidicontrol",
"inhalfwidthandfullwidthforms",
- "cyrl",
- "knda",
+ "inmeroiticcursive",
+ "inglagolitic",
+ "changeswhentitlecased",
+ "dep",
+ "inbuhid",
+ "incombiningdiacriticalmarks",
"inunifiedcanadianaboriginalsyllabicsextended",
- "xsux",
- "modifiersymbol",
+ "any",
+ "incombiningdiacriticalmarksforsymbols",
+ "kharoshthi",
+ "cherokee",
+ "inarabicsupplement",
+ "pauc",
+ "phag",
+ "intagalog",
+ "inplayingcards",
+ "inpahawhhmong",
+ "changeswhencasefolded",
+ "incyrillicextendedb",
"incombiningdiacriticalmarkssupplement",
- "inhanunoo",
- "inbuhid",
- "kannada",
- "inhebrew",
- "grbase",
+ "alphabetic",
+ "glag",
+ "hyphen",
+ "inyisyllables",
+ "bidicontrol",
+ "inbengali",
"spacingmark",
- "inkatakanaphoneticextensions",
- "hangul",
+ "cypriot",
+ "beng",
+ "graphemeextend",
+ "khoj",
+ "inbuginese",
+ "tglg",
+ "palmyrene",
+ "incypriotsyllabary",
+ "punct",
+ "khmer",
"incjksymbolsandpunctuation",
- "bopo",
- "orya",
- "inbopomofo",
- "kharoshthi",
- "khar",
+ "inaegeannumbers",
+ "tagb",
+ "orkh",
+ "intagbanwa",
+ "oldhungarian",
+ "georgian",
+ "modifiersymbol",
"changeswhenlowercased",
- "khmr",
- "punct",
- "symbol",
- "cherokee",
- "cyrillic",
- "inkangxiradicals",
- "hebrew",
- "inarabicpresentationformsb",
- "incyrillicextendedb",
+ "otheruppercase",
+ "signwriting",
+ "insupplementaryprivateuseareaa",
+ "inkayahli",
"ugaritic",
- "incurrencysymbols",
- "meroitichieroglyphs",
- "inhighsurrogates",
- "nonspacingmark",
- "lydi",
- "patsyn",
- "orkh",
- "lydian",
- "ugar",
- "othergraphemeextend",
- "inlatinextendedb",
- "bopomofo",
- "khmer",
"uideo",
- "otheruppercase",
- "grek",
- "gujr",
- "gujarati",
- "inhanguljamoextendedb",
- "defaultignorablecodepoint",
- "inplayingcards",
+ "inarabicpresentationformsb",
+ "nonspacingmark",
+ "rejang",
+ "inkangxiradicals",
+ "incjkcompatibility",
"bamu",
- "inkanbun",
- "incjkradicalssupplement",
- "cypriot",
"inbamum",
- "inmeroiticcursive",
+ "pahawhhmong",
+ "grbase",
+ "aghb",
+ "bopo",
+ "tagalog",
+ "inbopomofo",
+ "incombiningdiacriticalmarksextended",
+ "inkanbun",
"oldturkic",
- "insupplementalarrowsb",
- "surrogate",
+ "defaultignorablecodepoint",
+ "ugar",
+ "caucasianalbanian",
+ "inlatinextendedb",
+ "othergraphemeextend",
+ "hung",
+ "inlimbu",
+ "grek",
"batk",
"inbatak",
- "inlimbu",
- "incypriotsyllabary",
- "dashpunctuation",
+ "incjkradicalssupplement",
"innoblock",
- "hyphen",
- "insupplementalpunctuation",
- "ingeorgiansupplement",
- "oupper",
- "paragraphseparator",
+ "cwu",
+ "oldnortharabian",
+ "insupplementalsymbolsandpictographs",
+ "dupl",
+ "dashpunctuation",
"inbamumsupplement",
- "uppercase",
- "currencysymbol",
- "sk",
+ "gujr",
+ "inhighsurrogates",
"lu",
- "openpunctuation",
- "inlisu",
"qmark",
- "egyp",
- "insupplementaryprivateuseareab",
+ "gujarati",
"limbu",
+ "sk",
+ "egyp",
+ "inlisu",
+ "bopomofo",
+ "inhanguljamoextendedb",
"inegyptianhieroglyphs",
- "unifiedideograph",
"intelugu",
"katakana",
- "inhangulcompatibilityjamo",
+ "kayahli",
+ "oupper",
+ "surrogate",
+ "currencysymbol",
+ "insupplementalpunctuation",
+ "ingeorgiansupplement",
+ "unifiedideograph",
+ "unknown",
+ "zyyy",
+ "insupplementalarrowsb",
+ "uppercase",
+ "khudawadi",
+ "inkhudawadi",
+ "openpunctuation",
"upper",
- "inkayahli",
- "cwu",
- "incjkcompatibility",
+ "buhd",
+ "quotationmark",
+ "paucinhau",
+ "paragraphseparator",
+ "khojki",
+ "inpaucinhau",
+ "inbopomofoextended",
"uppercaseletter",
+ "punctuation",
+ "egyptianhieroglyphs",
"bugi",
- "buginese",
- "any",
- "inyisyllables",
- "inbopomofoextended",
- "inboxdrawing",
"changeswhenuppercased",
- "unknown",
- "quotationmark",
- "buhd",
- "punctuation",
- "oldsoutharabian",
- "kayahli",
- "incjkunifiedideographs",
+ "buginese",
"incjkunifiedideographsextensiona",
"incjkunifiedideographsextensionc",
- "telugu",
+ "inhangulcompatibilityjamo",
+ "incjkunifiedideographsextensione",
+ "insupplementaryprivateuseareab",
+ "incjkunifiedideographs",
+ "oldsoutharabian",
+ "inboxdrawing",
"guru",
- "greek",
- "grlink",
+ "telugu",
"buhid",
+ "duployan",
+ "greek",
"batak",
"blank",
"incjkunifiedideographsextensiond",
+ "grlink",
"graphemelink",
- "egyptianhieroglyphs",
"incjkunifiedideographsextensionb",
- "zyyy",
"gurmukhi"
#endif /* USE_UNICODE_PROPERTIES */
};
#define uniname2ctype_pool ((const char *) &uniname2ctype_pool_contents)
#ifdef __GNUC__
__inline
-#ifdef __GNUC_STDC_INLINE__
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
@@ -27366,1135 +32392,1326 @@ uniname2ctype_p (str, len)
#ifdef USE_UNICODE_PROPERTIES
{-1}, {-1}, {-1},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3, 34},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str11, 33},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str15, 30},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str5, 46},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 51},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str9, 54},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str17, 51},
{-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_str24, 60},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str24, 20},
{-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_str38, 33},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str29, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str30, 60},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str31, 447},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str36, 237},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str37, 114},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str41, 17},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str49, 31},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str49, 401},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str53, 128},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str56, 49},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str64, 31},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str58, 390},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str59, 32},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str66, 239},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str61, 265},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str62, 18},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str72, 49},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str74, 32},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str65, 168},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 473},
{-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_str84, 412},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str86, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str77, 272},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str78, 101},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str81, 46},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str82, 47},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str90, 382},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str92, 413},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str86, 14},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str96, 252},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str90, 54},
{-1}, {-1},
- {(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_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_str116, 237},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str93, 448},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str151, 347},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str102, 22},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str106, 259},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str110, 474},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str114, 381},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str124, 285},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str156, 306},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str129, 65},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str132, 159},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str140, 414},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str141, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str142, 375},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str144, 270},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str145, 419},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str148, 143},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str149, 143},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str152, 340},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str155, 129},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str179, 379},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 276},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str159, 487},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str184, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str163, 26},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str164, 120},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str169, 183},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str174, 391},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str186, 75},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str187, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str176, 233},
{-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_str205, 23},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str178, 151},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str207, 36},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 13},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str185, 421},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str189, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str190, 283},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 52},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str192, 430},
{-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str199, 338},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str200, 434},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str201, 503},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str206, 234},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 148},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str208, 346},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 309},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str212, 306},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str213, 500},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str220, 332},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str225, 92},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str237, 152},
+ {-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_str257, 75},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str259, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str260, 111},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str247, 160},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str248, 323},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str262, 280},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str263, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str264, 463},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str273, 153},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str274, 416},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str275, 153},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str279, 489},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str280, 305},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str281, 120},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str285, 63},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str259, 260},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str288, 64},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 39},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str290, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str291, 257},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str293, 160},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str279, 431},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str295, 23},
{-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_str301, 333},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str297, 36},
{-1},
- {(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_str313, 182},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str299, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str300, 288},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str302, 296},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str303, 422},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str304, 52},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str305, 348},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str306, 148},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str316, 287},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str309, 393},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str315, 395},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str319, 148},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str321, 170},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str322, 218},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str367, 238},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str324, 263},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str325, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str326, 392},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str329, 155},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str330, 172},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str333, 28},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str372, 21},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str338, 402},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str339, 155},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str340, 470},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str341, 80},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str342, 268},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str345, 460},
{-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str348, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str349, 431},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str350, 293},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str354, 19},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str360, 331},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str361, 454},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str362, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str363, 109},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str403, 365},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str366, 124},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str367, 109},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str371, 388},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str405, 87},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str406, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str373, 198},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str381, 471},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str409, 63},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str384, 459},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str389, 150},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str390, 158},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str412, 74},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str393, 211},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str394, 92},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str395, 61},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str397, 185},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str401, 411},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str403, 39},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str408, 334},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str409, 291},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str432, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str411, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str412, 3},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str413, 284},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str436, 28},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str417, 169},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str423, 123},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str434, 321},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str445, 82},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str443, 25},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str450, 183},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str454, 357},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str449, 185},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str450, 55},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str458, 93},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str453, 70},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str454, 66},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str461, 55},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str467, 82},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str469, 498},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str470, 99},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str471, 201},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str473, 170},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str475, 501},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str481, 151},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str478, 67},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str483, 82},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 45},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str481, 278},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str494, 461},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str484, 43},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str485, 61},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str497, 214},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str490, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str502, 230},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str518, 407},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str519, 211},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str527, 205},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str531, 214},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str533, 475},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str538, 333},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str545, 207},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str546, 70},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str552, 367},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str561, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str562, 468},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str563, 184},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str569, 217},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str573, 186},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str578, 273},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str506, 240},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str580, 514},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str509, 341},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str583, 67},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str584, 184},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str585, 196},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str593, 213},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str602, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str603, 171},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str511, 52},
- {-1}, {-1},
- {(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_str520, 426},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str521, 391},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str522, 227},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str605, 28},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str607, 37},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str614, 162},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str615, 271},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str545, 281},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str618, 312},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str621, 479},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str622, 351},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str623, 66},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str624, 174},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str555, 67},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str626, 21},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str558, 425},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str629, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str630, 496},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str631, 106},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str633, 329},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str574, 153},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str575, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str635, 482},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str579, 315},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str639, 74},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str646, 50},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str651, 359},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str587, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str659, 100},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str665, 116},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str671, 199},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str674, 69},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str589, 423},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str676, 224},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str679, 295},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str685, 315},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str688, 67},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str689, 491},
{-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str694, 68},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str696, 163},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str698, 275},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str701, 441},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str702, 83},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str703, 260},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str707, 429},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str708, 200},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str710, 197},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str626, 210},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str627, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str713, 83},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str716, 439},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str719, 201},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str728, 317},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str729, 466},
+ {-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_str752, 495},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str753, 27},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str761, 286},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str767, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str768, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str769, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str770, 43},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str776, 380},
+ {-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str797, 52},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str660, 186},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str802, 39},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str812, 41},
{-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_str672, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str820, 420},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str825, 23},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str832, 477},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str679, 188},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str839, 215},
{-1}, {-1},
- {(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_str690, 395},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str701, 402},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str842, 45},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str843, 408},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str844, 11},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str846, 57},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str849, 227},
{-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str851, 217},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str750, 223},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str853, 187},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str855, 68},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str856, 485},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str866, 232},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str868, 9},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str871, 216},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str878, 424},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str879, 188},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str880, 188},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str882, 316},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str886, 231},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str901, 221},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str802, 439},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str803, 7},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str904, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str905, 349},
+ {-1}, {-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_str811, 203},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str815, 244},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str818, 41},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str931, 191},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str823, 111},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str824, 192},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str936, 19},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str937, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str938, 208},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str826, 173},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str827, 303},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str940, 378},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str950, 235},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str951, 1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str952, 195},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str953, 314},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str954, 205},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str955, 437},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str956, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str957, 66},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str960, 403},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str961, 194},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str964, 423},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str966, 452},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str967, 173},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str971, 116},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str972, 353},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str980, 207},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str989, 69},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str990, 113},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(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_str860, 194},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1001, 225},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1005, 101},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1017, 212},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1029, 302},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1032, 24},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1037, 218},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str867, 190},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1044, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1045, 465},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1050, 110},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str869, 184},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str870, 429},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1052, 232},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-1}, {-1}, {-1},
- {(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},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1053, 238},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1054, 240},
+ {-1},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1056, 110},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1057, 394},
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ {-1}, {-1}, {-1},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1058, 250},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1059, 251},
+ {-1},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1061, 193},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1062, 6},
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ {-1}, {-1},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1063, 242},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1064, 243},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1065, 221},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str884, 50},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1066, 245},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1067, 239},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1068, 252},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1069, 254},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1070, 323},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-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},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1071, 249},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1072, 247},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1073, 248},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1074, 253},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1075, 35},
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ {-1},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1076, 241},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1077, 215},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-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_str917, 190},
+#else /* USE_UNICODE_AGE_PROPERTIES */
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str919, 163},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str920, 59},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1079, 244},
{-1}, {-1},
- {(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},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1082, 160},
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#endif /* ! USE_UNICODE_AGE_PROPERTIES */
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str936, 26},
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1085, 246},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1094, 42},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str938, 284},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str939, 369},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1096, 36},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1100, 436},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1106, 440},
{-1}, {-1},
- {(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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1109, 42},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1114, 229},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1119, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1120, 195},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1121, 499},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str970, 83},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1125, 162},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1127, 204},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1132, 128},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1133, 467},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1140, 446},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1141, 125},
{-1},
- {(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_str981, 83},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1143, 256},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1144, 118},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1150, 59},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1155, 449},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str983, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1157, 450},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1164, 114},
{-1}, {-1}, {-1}, {-1},
- {(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_str994, 277},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1169, 21},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1178, 128},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1179, 445},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1184, 25},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1185, 12},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1187, 513},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1190, 173},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1194, 223},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1201, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1202, 50},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1203, 219},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1204, 231},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1205, 91},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1000, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1207, 453},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1215, 147},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1003, 137},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1004, 290},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1218, 7},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1006, 397},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1007, 95},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1220, 137},
{-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_str1016, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1223, 438},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1228, 147},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1230, 278},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1231, 157},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1236, 91},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1238, 234},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1035, 366},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1242, 235},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1245, 432},
{-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1249, 54},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1251, 267},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1252, 405},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1255, 255},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1065, 161},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1260, 163},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1263, 384},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1067, 126},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1265, 328},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1266, 60},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1267, 131},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1274, 17},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1278, 318},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1281, 37},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1285, 41},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1286, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1287, 180},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1069, 311},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1070, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1289, 177},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1072, 288},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1291, 236},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1292, 330},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1074, 27},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1294, 451},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1295, 277},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1302, 190},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1076, 80},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1304, 193},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1309, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1310, 486},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1078, 345},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1312, 219},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1081, 12},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1315, 406},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1084, 348},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 105},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1321, 190},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1094, 359},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1323, 96},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1324, 287},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1326, 370},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1107, 167},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1110, 201},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1330, 102},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1331, 344},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1337, 379},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1338, 132},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1340, 319},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1341, 457},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1114, 389},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1345, 492},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1348, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1349, 49},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1352, 96},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1353, 389},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1354, 119},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1129, 293},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1360, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1361, 181},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1364, 342},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1365, 212},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1366, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1367, 98},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1369, 81},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1371, 279},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1375, 198},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1377, 51},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1133, 174},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1381, 179},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1135, 106},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1383, 311},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1384, 95},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1386, 26},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1389, 84},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1142, 353},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1396, 415},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1147, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1401, 95},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1404, 81},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1406, 433},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1410, 124},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1411, 135},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1415, 373},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1416, 140},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1417, 262},
{-1}, {-1},
- {(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_str1185, 261},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1186, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1420, 282},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1188, 249},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1422, 107},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1423, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1424, 488},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1425, 179},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1190, 107},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1427, 27},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1435, 169},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1440, 337},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1448, 112},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1450, 458},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1455, 418},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1456, 144},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1459, 484},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1468, 146},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1469, 186},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1474, 425},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1475, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1476, 77},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1478, 126},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1483, 71},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1487, 80},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1488, 159},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1489, 386},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1491, 167},
{-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_str1256, 184},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1259, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1504, 456},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1261, 200},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1262, 205},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1506, 202},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1507, 410},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1509, 175},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1282, 145},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1512, 404},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1514, 161},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1521, 38},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1522, 156},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1300, 129},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1524, 360},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1530, 53},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1302, 437},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1532, 502},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1533, 132},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1534, 136},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1548, 365},
{-1}, {-1}, {-1},
- {(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_str1310, 115},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1552, 99},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1558, 397},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1559, 145},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1567, 455},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1574, 512},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1313, 360},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1577, 202},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1315, 110},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1579, 352},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1583, 129},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1584, 398},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1587, 289},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1588, 213},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1591, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1592, 294},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 138},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1595, 89},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1596, 339},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1321, 110},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1599, 336},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1600, 97},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1323, 424},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1611, 322},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1612, 327},
{-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_str1334, 177},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1617, 428},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1624, 87},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1629, 121},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1354, 349},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1632, 480},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1356, 364},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1634, 426},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1635, 483},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1636, 409},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1638, 103},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1640, 427},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1642, 16},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1643, 130},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1647, 77},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1648, 442},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1649, 144},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1652, 106},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1362, 40},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1658, 324},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1372, 422},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1670, 102},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1675, 383},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1680, 30},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1689, 46},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1377, 241},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1694, 444},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1700, 301},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1712, 172},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1714, 72},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1404, 79},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1716, 387},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1411, 274},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1723, 490},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1731, 149},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1413, 199},
- {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1733, 4},
{-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_str1429, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1735, 177},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1737, 494},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1438, 350},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1442, 147},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1443, 243},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1739, 180},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1448, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1744, 149},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1745, 345},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1450, 5},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1747, 112},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1749, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1757, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1758, 264},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1764, 469},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1765, 175},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1767, 165},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1776, 223},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1777, 206},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1779, 396},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1781, 504},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1460, 236},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1784, 307},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1795, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1796, 126},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1798, 230},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1799, 325},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1800, 197},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1804, 382},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1814, 274},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1819, 167},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1831, 79},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1834, 40},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1512, 246},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1516, 267},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1517, 81},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1836, 165},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1843, 292},
+ {-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_str1862, 103},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1519, 139},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1520, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1864, 142},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1865, 216},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1871, 222},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1875, 142},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1882, 401},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1892, 229},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1893, 266},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1523, 318},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1525, 165},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1896, 34},
{-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1901, 200},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1904, 462},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1908, 140},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1540, 124},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1912, 228},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1913, 236},
+ {-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_str1931, 20},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1938, 138},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1944, 505},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1945, 90},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1956, 341},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1571, 228},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1958, 493},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1963, 506},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1964, 174},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1578, 32},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1971, 290},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1581, 292},
- {-1},
- {(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_str1595, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1974, 90},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1598, 96},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1977, 5},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1984, 224},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1986, 98},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1609, 376},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1989, 298},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1991, 65},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1617, 77},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1999, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2000, 139},
{-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2003, 30},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2006, 366},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2012, 104},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1662, 72},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2016, 194},
{-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_str1670, 332},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2018, 134},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-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_str2056, 227},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2057, 32},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2071, 413},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2072, 443},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2078, 347},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2081, 63},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2084, 228},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1688, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2089, 299},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2092, 261},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2096, 303},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2097, 15},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2102, 326},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2105, 134},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1701, 134},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2116, 100},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1703, 134},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2118, 269},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1709, 61},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2124, 192},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2126, 138},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2127, 297},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2137, 497},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1729, 46},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2141, 481},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2150, 64},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2151, 376},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2154, 320},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2155, 56},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1759, 322},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1761, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2172, 130},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2178, 209},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2203, 372},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2212, 206},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1790, 122},
- {-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_str2215, 276},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2220, 31},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2225, 125},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2226, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2227, 71},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2236, 182},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2240, 308},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2251, 115},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2259, 191},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2268, 435},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2277, 8},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2278, 104},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2283, 358},
{-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_str1831, 171},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1835, 363},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2294, 417},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2305, 118},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2307, 164},
{-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_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_str1868, 164},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1871, 149},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2316, 300},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2327, 203},
{-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_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_str1904, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2348, 97},
{-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}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2368, 48},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1925, 197},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2376, 61},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1932, 191},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2383, 220},
+ {-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_str1944, 76},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1949, 86},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2406, 204},
{-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_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}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2460, 515},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2462, 385},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2468, 122},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2476, 226},
{-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_str2494, 412},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2495, 33},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2499, 146},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2501, 356},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2502, 368},
{-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_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}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2543, 157},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2141, 180},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2545, 377},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2556, 181},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2557, 72},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2558, 176},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2560, 108},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2569, 115},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2571, 361},
{-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}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2596, 310},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2598, 363},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2606, 164},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2189, 53},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2608, 70},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2194, 415},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2613, 122},
{-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_str2636, 176},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2649, 258},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2662, 222},
{-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_str2681, 203},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2685, 304},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2689, 76},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2692, 166},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2700, 313},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2703, 355},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2745, 517},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2755, 62},
{-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_str2342, 45},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2349, 340},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2760, 189},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2772, 507},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2774, 178},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2784, 40},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2788, 478},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2794, 86},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2799, 400},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2803, 29},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2810, 210},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2377, 441},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2815, 86},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2379, 119},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2817, 119},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2824, 48},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2833, 154},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2852, 374},
+ {-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_str2413, 248},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2873, 108},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(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_str2442, 328},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2895, 399},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2899, 476},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2906, 281},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2921, 107},
{-1}, {-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_str2947, 145},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2454, 10},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2950, 220},
{-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_str2972, 22},
{-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_str2495, 351},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2991, 47},
{-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_str2523, 334},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3010, 354},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3040, 350},
{-1}, {-1}, {-1}, {-1}, {-1}, {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3071, 226},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-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_str3107, 237},
{-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_str3132, 74},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2627, 15},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3135, 343},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3166, 58},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3167, 196},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3274, 464},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3282, 45},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
@@ -28505,33 +33722,59 @@ 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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3382, 10},
+ {-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_str2888, 161},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3404, 117},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3406, 210},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-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_str3441, 192},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3442, 53},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3443, 182},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3450, 472},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3459, 364},
{-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}, {-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_str3504, 29},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2940, 337},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3519, 38},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3529, 154},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3531, 127},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3556, 62},
{-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_str2995, 89},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3000, 85},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3582, 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}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3626, 369},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3633, 509},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3634, 362},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3638, 511},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3639, 516},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3643, 371},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
@@ -28539,8 +33782,6 @@ 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_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},
@@ -28550,36 +33791,36 @@ 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},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3822, 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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3254, 166},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3863, 335},
{-1}, {-1}, {-1}, {-1}, {-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3927, 85},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3928, 89},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3941, 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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3974, 178},
{-1}, {-1}, {-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},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
@@ -28587,21 +33828,29 @@ 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_str3459, 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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4081, 76},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3480, 154},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4084, 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}, {-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_str4139, 2},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4149, 510},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-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_str4205, 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},
@@ -28646,7 +33895,7 @@ uniname2ctype_p (str, len)
{(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_str3802, 434},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4446, 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},
@@ -28660,8 +33909,6 @@ 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_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},
@@ -28688,9 +33935,67 @@ 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}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4805, 508},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4167, 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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-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_str5326, 85}
#endif /* USE_UNICODE_PROPERTIES */
};
diff --git a/enc/unicode/name2ctype.h.blt b/enc/unicode/name2ctype.h.blt
index 2e80edf525..80b79abc3e 100644
--- a/enc/unicode/name2ctype.h.blt
+++ b/enc/unicode/name2ctype.h.blt
@@ -44,7 +44,7 @@ static const OnigCodePoint CR_NEWLINE[] = {
/* 'Alpha': [[:Alpha:]] */
static const OnigCodePoint CR_Alpha[] = {
- 540,
+ 600,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -61,13 +61,14 @@ static const OnigCodePoint CR_Alpha[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -95,17 +96,13 @@ static const OnigCodePoint CR_Alpha[] = {
0x0800, 0x0817,
0x081a, 0x082c,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b2,
0x08e4, 0x08e9,
- 0x08f0, 0x08fe,
- 0x0900, 0x093b,
+ 0x08f0, 0x093b,
0x093d, 0x094c,
0x094e, 0x0950,
0x0955, 0x0963,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -176,19 +173,18 @@ static const OnigCodePoint CR_Alpha[] = {
0x0bca, 0x0bcc,
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4c,
0x0c55, 0x0c56,
0x0c58, 0x0c59,
0x0c60, 0x0c63,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -201,7 +197,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x0cde, 0x0cde,
0x0ce0, 0x0ce3,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -283,7 +279,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1713,
0x1720, 0x1733,
@@ -298,7 +294,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x1938,
0x1950, 0x196d,
@@ -323,6 +319,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x1cee, 0x1cf3,
0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
+ 0x1de7, 0x1df4,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -402,14 +399,14 @@ static const OnigCodePoint CR_Alpha[] = {
0xa62a, 0xa62b,
0xa640, 0xa66e,
0xa674, 0xa67b,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa69f, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa827,
@@ -423,11 +420,14 @@ static const OnigCodePoint CR_Alpha[] = {
0xa980, 0xa9b2,
0xa9b4, 0xa9bf,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
+ 0xaa7e, 0xaabe,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
@@ -438,6 +438,9 @@ static const OnigCodePoint CR_Alpha[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabea,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -476,19 +479,27 @@ static const OnigCodePoint CR_Alpha[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -499,25 +510,70 @@ static const OnigCodePoint CR_Alpha[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11000, 0x11045,
0x11082, 0x110b8,
0x110d0, 0x110e8,
0x11100, 0x11132,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11180, 0x111bf,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x11234,
+ 0x11237, 0x11237,
+ 0x112b0, 0x112e8,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134c,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11480, 0x114c1,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115be,
+ 0x11600, 0x1163e,
+ 0x11640, 0x11640,
+ 0x11644, 0x11644,
0x11680, 0x116b5,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9e, 0x1bc9e,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -548,6 +604,7 @@ static const OnigCodePoint CR_Alpha[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -581,6 +638,9 @@ static const OnigCodePoint CR_Alpha[] = {
0x1eea1, 0x1eea3,
0x1eea5, 0x1eea9,
0x1eeab, 0x1eebb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -589,12 +649,11 @@ static const OnigCodePoint CR_Alpha[] = {
/* 'Blank': [[:Blank:]] */
static const OnigCodePoint CR_Blank[] = {
- 9,
+ 8,
0x0009, 0x0009,
0x0020, 0x0020,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x202f, 0x202f,
0x205f, 0x205f,
@@ -610,7 +669,7 @@ static const OnigCodePoint CR_Cntrl[] = {
/* 'Digit': [[:Digit:]] */
static const OnigCodePoint CR_Digit[] = {
- 42,
+ 50,
0x0030, 0x0039,
0x0660, 0x0669,
0x06f0, 0x06f9,
@@ -624,6 +683,7 @@ static const OnigCodePoint CR_Digit[] = {
0x0c66, 0x0c6f,
0x0ce6, 0x0cef,
0x0d66, 0x0d6f,
+ 0x0de6, 0x0def,
0x0e50, 0x0e59,
0x0ed0, 0x0ed9,
0x0f20, 0x0f29,
@@ -643,6 +703,7 @@ static const OnigCodePoint CR_Digit[] = {
0xa8d0, 0xa8d9,
0xa900, 0xa909,
0xa9d0, 0xa9d9,
+ 0xa9f0, 0xa9f9,
0xaa50, 0xaa59,
0xabf0, 0xabf9,
0xff10, 0xff19,
@@ -651,30 +712,35 @@ static const OnigCodePoint CR_Digit[] = {
0x110f0, 0x110f9,
0x11136, 0x1113f,
0x111d0, 0x111d9,
+ 0x112f0, 0x112f9,
+ 0x114d0, 0x114d9,
+ 0x11650, 0x11659,
0x116c0, 0x116c9,
+ 0x118e0, 0x118e9,
+ 0x16a60, 0x16a69,
+ 0x16b50, 0x16b59,
0x1d7ce, 0x1d7ff,
}; /* CR_Digit */
/* 'Graph': [[:Graph:]] */
static const OnigCodePoint CR_Graph[] = {
- 544,
+ 605,
0x0021, 0x007e,
0x00a1, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
- 0x03a3, 0x0527,
+ 0x03a3, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0604,
- 0x0606, 0x061b,
+ 0x0600, 0x061c,
0x061e, 0x070d,
0x070f, 0x074a,
0x074d, 0x07b1,
@@ -683,12 +749,8 @@ static const OnigCodePoint CR_Graph[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -761,12 +823,11 @@ static const OnigCodePoint CR_Graph[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
@@ -775,7 +836,7 @@ static const OnigCodePoint CR_Graph[] = {
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -789,7 +850,7 @@ static const OnigCodePoint CR_Graph[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -810,6 +871,7 @@ static const OnigCodePoint CR_Graph[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e3a,
0x0e3f, 0x0e5b,
@@ -861,7 +923,7 @@ static const OnigCodePoint CR_Graph[] = {
0x13a0, 0x13f4,
0x1400, 0x167f,
0x1681, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1736,
@@ -872,12 +934,12 @@ static const OnigCodePoint CR_Graph[] = {
0x1780, 0x17dd,
0x17e0, 0x17e9,
0x17f0, 0x17f9,
- 0x1800, 0x180d,
+ 0x1800, 0x180e,
0x1810, 0x1819,
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -892,6 +954,7 @@ static const OnigCodePoint CR_Graph[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa0, 0x1aad,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
0x1b80, 0x1bf3,
@@ -900,7 +963,8 @@ static const OnigCodePoint CR_Graph[] = {
0x1c4d, 0x1c7f,
0x1cc0, 0x1cc7,
0x1cd0, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -921,18 +985,20 @@ static const OnigCodePoint CR_Graph[] = {
0x202a, 0x202e,
0x2030, 0x205e,
0x2060, 0x2064,
- 0x206a, 0x2071,
+ 0x2066, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20bd,
0x20d0, 0x20f0,
0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cf3,
@@ -950,7 +1016,7 @@ static const OnigCodePoint CR_Graph[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
+ 0x2de0, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -969,12 +1035,12 @@ static const OnigCodePoint CR_Graph[] = {
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa697,
+ 0xa640, 0xa69d,
0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -984,18 +1050,19 @@ static const OnigCodePoint CR_Graph[] = {
0xa95f, 0xa97c,
0xa980, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa5c, 0xaac2,
0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
@@ -1016,7 +1083,7 @@ static const OnigCodePoint CR_Graph[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfd,
0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xfe30, 0xfe52,
0xfe54, 0xfe66,
0xfe68, 0xfe6b,
@@ -1040,26 +1107,35 @@ static const OnigCodePoint CR_Graph[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
@@ -1073,33 +1149,82 @@ static const OnigCodePoint CR_Graph[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
0x10e60, 0x10e7e,
0x11000, 0x1104d,
0x11052, 0x1106f,
- 0x11080, 0x110c1,
+ 0x1107f, 0x110c1,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x11143,
+ 0x11150, 0x11176,
0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c9,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d1dd,
@@ -1127,6 +1252,8 @@ static const OnigCodePoint CR_Graph[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -1164,10 +1291,10 @@ static const OnigCodePoint CR_Graph[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -1175,24 +1302,25 @@ static const OnigCodePoint CR_Graph[] = {
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,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -1206,7 +1334,7 @@ static const OnigCodePoint CR_Graph[] = {
/* 'Lower': [[:Lower:]] */
static const OnigCodePoint CR_Lower[] = {
- 618,
+ 633,
0x0061, 0x007a,
0x00aa, 0x00aa,
0x00b5, 0x00b5,
@@ -1477,6 +1605,10 @@ static const OnigCodePoint CR_Lower[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
0x1d00, 0x1dbf,
0x1e01, 0x1e01,
@@ -1738,6 +1870,8 @@ static const OnigCodePoint CR_Lower[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69d,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -1786,17 +1920,26 @@ static const OnigCodePoint CR_Lower[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
- 0xa793, 0xa793,
+ 0xa793, 0xa795,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
0xa7a7, 0xa7a7,
0xa7a9, 0xa7a9,
0xa7f8, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x118c0, 0x118df,
0x1d41a, 0x1d433,
0x1d44e, 0x1d454,
0x1d456, 0x1d467,
@@ -1829,24 +1972,23 @@ static const OnigCodePoint CR_Lower[] = {
/* 'Print': [[:Print:]] */
static const OnigCodePoint CR_Print[] = {
- 541,
+ 602,
0x0020, 0x007e,
0x00a0, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
- 0x03a3, 0x0527,
+ 0x03a3, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0604,
- 0x0606, 0x061b,
+ 0x0600, 0x061c,
0x061e, 0x070d,
0x070f, 0x074a,
0x074d, 0x07b1,
@@ -1855,12 +1997,8 @@ static const OnigCodePoint CR_Print[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -1933,12 +2071,11 @@ static const OnigCodePoint CR_Print[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
@@ -1947,7 +2084,7 @@ static const OnigCodePoint CR_Print[] = {
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -1961,7 +2098,7 @@ static const OnigCodePoint CR_Print[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -1982,6 +2119,7 @@ static const OnigCodePoint CR_Print[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e3a,
0x0e3f, 0x0e5b,
@@ -2032,7 +2170,7 @@ static const OnigCodePoint CR_Print[] = {
0x1380, 0x1399,
0x13a0, 0x13f4,
0x1400, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1736,
@@ -2048,7 +2186,7 @@ static const OnigCodePoint CR_Print[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -2063,6 +2201,7 @@ static const OnigCodePoint CR_Print[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa0, 0x1aad,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
0x1b80, 0x1bf3,
@@ -2071,7 +2210,8 @@ static const OnigCodePoint CR_Print[] = {
0x1c4d, 0x1c7f,
0x1cc0, 0x1cc7,
0x1cd0, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -2090,18 +2230,20 @@ static const OnigCodePoint CR_Print[] = {
0x1ff6, 0x1ffe,
0x2000, 0x2027,
0x202a, 0x2064,
- 0x206a, 0x2071,
+ 0x2066, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20bd,
0x20d0, 0x20f0,
0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cf3,
@@ -2119,7 +2261,7 @@ static const OnigCodePoint CR_Print[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
+ 0x2de0, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -2138,12 +2280,12 @@ static const OnigCodePoint CR_Print[] = {
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa697,
+ 0xa640, 0xa69d,
0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -2153,18 +2295,19 @@ static const OnigCodePoint CR_Print[] = {
0xa95f, 0xa97c,
0xa980, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa5c, 0xaac2,
0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
@@ -2185,7 +2328,7 @@ static const OnigCodePoint CR_Print[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfd,
0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xfe30, 0xfe52,
0xfe54, 0xfe66,
0xfe68, 0xfe6b,
@@ -2209,26 +2352,35 @@ static const OnigCodePoint CR_Print[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
@@ -2242,33 +2394,82 @@ static const OnigCodePoint CR_Print[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
0x10e60, 0x10e7e,
0x11000, 0x1104d,
0x11052, 0x1106f,
- 0x11080, 0x110c1,
+ 0x1107f, 0x110c1,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x11143,
+ 0x11150, 0x11176,
0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c9,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d1dd,
@@ -2296,6 +2497,8 @@ static const OnigCodePoint CR_Print[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -2333,10 +2536,10 @@ static const OnigCodePoint CR_Print[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -2344,24 +2547,25 @@ static const OnigCodePoint CR_Print[] = {
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,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -2375,7 +2579,7 @@ static const OnigCodePoint CR_Print[] = {
/* 'Punct': [[:Punct:]] */
static const OnigCodePoint CR_Punct[] = {
- 140,
+ 155,
0x0021, 0x0023,
0x0025, 0x002a,
0x002c, 0x002f,
@@ -2449,6 +2653,7 @@ static const OnigCodePoint CR_Punct[] = {
0x2053, 0x205e,
0x207d, 0x207e,
0x208d, 0x208e,
+ 0x2308, 0x230b,
0x2329, 0x232a,
0x2768, 0x2775,
0x27c5, 0x27c6,
@@ -2460,7 +2665,7 @@ static const OnigCodePoint CR_Punct[] = {
0x2cfe, 0x2cff,
0x2d70, 0x2d70,
0x2e00, 0x2e2e,
- 0x2e30, 0x2e3b,
+ 0x2e30, 0x2e42,
0x3001, 0x3003,
0x3008, 0x3011,
0x3014, 0x301f,
@@ -2504,29 +2709,42 @@ static const OnigCodePoint CR_Punct[] = {
0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
+ 0x1056f, 0x1056f,
0x10857, 0x10857,
0x1091f, 0x1091f,
0x1093f, 0x1093f,
0x10a50, 0x10a58,
0x10a7f, 0x10a7f,
+ 0x10af0, 0x10af6,
0x10b39, 0x10b3f,
+ 0x10b99, 0x10b9c,
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
0x11140, 0x11143,
+ 0x11174, 0x11175,
0x111c5, 0x111c8,
- 0x12470, 0x12473,
+ 0x111cd, 0x111cd,
+ 0x11238, 0x1123d,
+ 0x114c6, 0x114c6,
+ 0x115c1, 0x115c9,
+ 0x11641, 0x11643,
+ 0x12470, 0x12474,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b3b,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
}; /* CR_Punct */
/* 'Space': [[:Space:]] */
static const OnigCodePoint CR_Space[] = {
- 11,
+ 10,
0x0009, 0x000d,
0x0020, 0x0020,
0x0085, 0x0085,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x2028, 0x2029,
0x202f, 0x202f,
@@ -2536,7 +2754,7 @@ static const OnigCodePoint CR_Space[] = {
/* 'Upper': [[:Upper:]] */
static const OnigCodePoint CR_Upper[] = {
- 610,
+ 627,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -2684,6 +2902,7 @@ static const OnigCodePoint CR_Upper[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -2803,6 +3022,10 @@ static const OnigCodePoint CR_Upper[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
@@ -3059,6 +3282,8 @@ static const OnigCodePoint CR_Upper[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -3108,14 +3333,21 @@ static const OnigCodePoint CR_Upper[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b1,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x118a0, 0x118bf,
0x1d400, 0x1d419,
0x1d434, 0x1d44d,
0x1d468, 0x1d481,
@@ -3147,6 +3379,9 @@ static const OnigCodePoint CR_Upper[] = {
0x1d756, 0x1d76e,
0x1d790, 0x1d7a8,
0x1d7ca, 0x1d7ca,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Upper */
/* 'XDigit': [[:XDigit:]] */
@@ -3159,7 +3394,7 @@ static const OnigCodePoint CR_XDigit[] = {
/* 'Word': [[:Word:]] */
static const OnigCodePoint CR_Word[] = {
- 564,
+ 629,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -3177,13 +3412,14 @@ static const OnigCodePoint CR_Word[] = {
0x0300, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x0483, 0x0527,
+ 0x0483, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -3207,14 +3443,10 @@ static const OnigCodePoint CR_Word[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0963,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -3288,12 +3520,11 @@ static const OnigCodePoint CR_Word[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
@@ -3301,7 +3532,7 @@ static const OnigCodePoint CR_Word[] = {
0x0c58, 0x0c59,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -3315,7 +3546,7 @@ static const OnigCodePoint CR_Word[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -3336,6 +3567,7 @@ static const OnigCodePoint CR_Word[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e4e,
@@ -3399,7 +3631,7 @@ static const OnigCodePoint CR_Word[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1734,
@@ -3416,7 +3648,7 @@ static const OnigCodePoint CR_Word[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1946, 0x196d,
@@ -3430,6 +3662,7 @@ static const OnigCodePoint CR_Word[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
@@ -3439,7 +3672,8 @@ static const OnigCodePoint CR_Word[] = {
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
0x1cd4, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -3521,14 +3755,14 @@ static const OnigCodePoint CR_Word[] = {
0xa610, 0xa62b,
0xa640, 0xa672,
0xa674, 0xa67d,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa827,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -3539,12 +3773,12 @@ static const OnigCodePoint CR_Word[] = {
0xa960, 0xa97c,
0xa980, 0xa9c0,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa7a, 0xaac2,
0xaadb, 0xaadd,
0xaae0, 0xaaef,
0xaaf2, 0xaaf6,
@@ -3553,6 +3787,9 @@ static const OnigCodePoint CR_Word[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabea,
0xabec, 0xabed,
0xabf0, 0xabf9,
@@ -3575,7 +3812,7 @@ static const OnigCodePoint CR_Word[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfb,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xfe33, 0xfe34,
0xfe4d, 0xfe4f,
0xfe70, 0xfe74,
@@ -3600,20 +3837,29 @@ static const OnigCodePoint CR_Word[] = {
0x101fd, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x102e0, 0x102e0,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -3626,29 +3872,78 @@ static const OnigCodePoint CR_Word[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae6,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11000, 0x11046,
0x11066, 0x1106f,
- 0x11080, 0x110ba,
+ 0x1107f, 0x110ba,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
0x11180, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111d0, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x11237,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x11600, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af4,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -3686,6 +3981,8 @@ static const OnigCodePoint CR_Word[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
+ 0x1e8d0, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -3719,6 +4016,9 @@ static const OnigCodePoint CR_Word[] = {
0x1eea1, 0x1eea3,
0x1eea5, 0x1eea9,
0x1eeab, 0x1eebb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -3728,7 +4028,7 @@ static const OnigCodePoint CR_Word[] = {
/* 'Alnum': [[:Alnum:]] */
static const OnigCodePoint CR_Alnum[] = {
- 566,
+ 630,
0x0030, 0x0039,
0x0041, 0x005a,
0x0061, 0x007a,
@@ -3746,13 +4046,14 @@ static const OnigCodePoint CR_Alnum[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -3779,18 +4080,14 @@ static const OnigCodePoint CR_Alnum[] = {
0x0800, 0x0817,
0x081a, 0x082c,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b2,
0x08e4, 0x08e9,
- 0x08f0, 0x08fe,
- 0x0900, 0x093b,
+ 0x08f0, 0x093b,
0x093d, 0x094c,
0x094e, 0x0950,
0x0955, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -3864,12 +4161,11 @@ static const OnigCodePoint CR_Alnum[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4c,
@@ -3877,7 +4173,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x0c58, 0x0c59,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -3891,7 +4187,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -3912,6 +4208,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e46,
@@ -3978,7 +4275,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1713,
0x1720, 0x1733,
@@ -3995,7 +4292,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x1938,
0x1946, 0x196d,
@@ -4023,6 +4320,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x1cee, 0x1cf3,
0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
+ 0x1de7, 0x1df4,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -4101,14 +4399,14 @@ static const OnigCodePoint CR_Alnum[] = {
0xa610, 0xa62b,
0xa640, 0xa66e,
0xa674, 0xa67b,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa69f, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa827,
@@ -4123,12 +4421,14 @@ static const OnigCodePoint CR_Alnum[] = {
0xa980, 0xa9b2,
0xa9b4, 0xa9bf,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
+ 0xaa7e, 0xaabe,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
@@ -4139,6 +4439,9 @@ static const OnigCodePoint CR_Alnum[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabea,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
@@ -4179,20 +4482,28 @@ static const OnigCodePoint CR_Alnum[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -4203,9 +4514,13 @@ static const OnigCodePoint CR_Alnum[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11000, 0x11045,
0x11066, 0x1106f,
@@ -4214,19 +4529,64 @@ static const OnigCodePoint CR_Alnum[] = {
0x110f0, 0x110f9,
0x11100, 0x11132,
0x11136, 0x1113f,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11180, 0x111bf,
0x111c1, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111d0, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x11234,
+ 0x11237, 0x11237,
+ 0x112b0, 0x112e8,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134c,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11480, 0x114c1,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115be,
+ 0x11600, 0x1163e,
+ 0x11640, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b5,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9e, 0x1bc9e,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -4258,6 +4618,7 @@ static const OnigCodePoint CR_Alnum[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -4291,6 +4652,9 @@ static const OnigCodePoint CR_Alnum[] = {
0x1eea1, 0x1eea3,
0x1eea5, 0x1eea9,
0x1eeab, 0x1eebb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -4312,23 +4676,22 @@ static const OnigCodePoint CR_Any[] = {
/* 'Assigned': - */
static const OnigCodePoint CR_Assigned[] = {
- 539,
+ 600,
0x0000, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
- 0x03a3, 0x0527,
+ 0x03a3, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0604,
- 0x0606, 0x061b,
+ 0x0600, 0x061c,
0x061e, 0x070d,
0x070f, 0x074a,
0x074d, 0x07b1,
@@ -4337,12 +4700,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -4415,12 +4774,11 @@ static const OnigCodePoint CR_Assigned[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
@@ -4429,7 +4787,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -4443,7 +4801,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -4464,6 +4822,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e3a,
0x0e3f, 0x0e5b,
@@ -4514,7 +4873,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1380, 0x1399,
0x13a0, 0x13f4,
0x1400, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1736,
@@ -4530,7 +4889,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -4545,6 +4904,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa0, 0x1aad,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
0x1b80, 0x1bf3,
@@ -4553,7 +4913,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x1c4d, 0x1c7f,
0x1cc0, 0x1cc7,
0x1cd0, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -4571,18 +4932,20 @@ static const OnigCodePoint CR_Assigned[] = {
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
0x2000, 0x2064,
- 0x206a, 0x2071,
+ 0x2066, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20bd,
0x20d0, 0x20f0,
0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cf3,
@@ -4600,7 +4963,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
+ 0x2de0, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -4619,12 +4982,12 @@ static const OnigCodePoint CR_Assigned[] = {
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa697,
+ 0xa640, 0xa69d,
0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -4634,18 +4997,19 @@ static const OnigCodePoint CR_Assigned[] = {
0xa95f, 0xa97c,
0xa980, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa5c, 0xaac2,
0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabed,
0xabf0, 0xabf9,
0xac00, 0xd7a3,
@@ -4666,7 +5030,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfd,
0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xfe30, 0xfe52,
0xfe54, 0xfe66,
0xfe68, 0xfe6b,
@@ -4690,26 +5054,35 @@ static const OnigCodePoint CR_Assigned[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
@@ -4723,33 +5096,82 @@ static const OnigCodePoint CR_Assigned[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
0x10e60, 0x10e7e,
0x11000, 0x1104d,
0x11052, 0x1106f,
- 0x11080, 0x110c1,
+ 0x1107f, 0x110c1,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x11143,
+ 0x11150, 0x11176,
0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c9,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d1dd,
@@ -4777,6 +5199,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -4814,10 +5238,10 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -4825,24 +5249,25 @@ static const OnigCodePoint CR_Assigned[] = {
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,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -4856,20 +5281,20 @@ static const OnigCodePoint CR_Assigned[] = {
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
- 541,
+ 603,
0x0000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
0x0378, 0x0379,
- 0x037f, 0x0383,
+ 0x0380, 0x0383,
0x038b, 0x038b,
0x038d, 0x038d,
0x03a2, 0x03a2,
- 0x0528, 0x0530,
+ 0x0530, 0x0530,
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x058e,
+ 0x058b, 0x058c,
0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
@@ -4884,11 +5309,7 @@ static const OnigCodePoint CR_C[] = {
0x083f, 0x083f,
0x085c, 0x085d,
0x085f, 0x089f,
- 0x08a1, 0x08a1,
- 0x08ad, 0x08e3,
- 0x08ff, 0x08ff,
- 0x0978, 0x0978,
- 0x0980, 0x0980,
+ 0x08b3, 0x08e3,
0x0984, 0x0984,
0x098d, 0x098e,
0x0991, 0x0992,
@@ -4961,12 +5382,11 @@ static const OnigCodePoint CR_C[] = {
0x0bce, 0x0bcf,
0x0bd1, 0x0bd6,
0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
+ 0x0bfb, 0x0bff,
0x0c04, 0x0c04,
0x0c0d, 0x0c0d,
0x0c11, 0x0c11,
0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
0x0c3a, 0x0c3c,
0x0c45, 0x0c45,
0x0c49, 0x0c49,
@@ -4975,7 +5395,7 @@ static const OnigCodePoint CR_C[] = {
0x0c5a, 0x0c5f,
0x0c64, 0x0c65,
0x0c70, 0x0c77,
- 0x0c80, 0x0c81,
+ 0x0c80, 0x0c80,
0x0c84, 0x0c84,
0x0c8d, 0x0c8d,
0x0c91, 0x0c91,
@@ -4989,7 +5409,7 @@ static const OnigCodePoint CR_C[] = {
0x0cdf, 0x0cdf,
0x0ce4, 0x0ce5,
0x0cf0, 0x0cf0,
- 0x0cf3, 0x0d01,
+ 0x0cf3, 0x0d00,
0x0d04, 0x0d04,
0x0d0d, 0x0d0d,
0x0d11, 0x0d11,
@@ -5010,7 +5430,8 @@ static const OnigCodePoint CR_C[] = {
0x0dcb, 0x0dce,
0x0dd5, 0x0dd5,
0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
+ 0x0de0, 0x0de5,
+ 0x0df0, 0x0df1,
0x0df5, 0x0e00,
0x0e3b, 0x0e3e,
0x0e5c, 0x0e80,
@@ -5061,7 +5482,7 @@ static const OnigCodePoint CR_C[] = {
0x139a, 0x139f,
0x13f5, 0x13ff,
0x169d, 0x169f,
- 0x16f1, 0x16ff,
+ 0x16f9, 0x16ff,
0x170d, 0x170d,
0x1715, 0x171f,
0x1737, 0x173f,
@@ -5072,12 +5493,12 @@ static const OnigCodePoint CR_C[] = {
0x17de, 0x17df,
0x17ea, 0x17ef,
0x17fa, 0x17ff,
- 0x180f, 0x180f,
+ 0x180e, 0x180f,
0x181a, 0x181f,
0x1878, 0x187f,
0x18ab, 0x18af,
0x18f6, 0x18ff,
- 0x191d, 0x191f,
+ 0x191f, 0x191f,
0x192c, 0x192f,
0x193c, 0x193f,
0x1941, 0x1943,
@@ -5091,7 +5512,8 @@ static const OnigCodePoint CR_C[] = {
0x1a7d, 0x1a7e,
0x1a8a, 0x1a8f,
0x1a9a, 0x1a9f,
- 0x1aae, 0x1aff,
+ 0x1aae, 0x1aaf,
+ 0x1abf, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
0x1bf4, 0x1bfb,
@@ -5099,8 +5521,9 @@ static const OnigCodePoint CR_C[] = {
0x1c4a, 0x1c4c,
0x1c80, 0x1cbf,
0x1cc8, 0x1ccf,
- 0x1cf7, 0x1cff,
- 0x1de7, 0x1dfb,
+ 0x1cf7, 0x1cf7,
+ 0x1cfa, 0x1cff,
+ 0x1df6, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
0x1f46, 0x1f47,
@@ -5123,15 +5546,17 @@ static const OnigCodePoint CR_C[] = {
0x2072, 0x2073,
0x208f, 0x208f,
0x209d, 0x209f,
- 0x20ba, 0x20cf,
+ 0x20be, 0x20cf,
0x20f1, 0x20ff,
0x218a, 0x218f,
- 0x23f4, 0x23ff,
+ 0x23fb, 0x23ff,
0x2427, 0x243f,
0x244b, 0x245f,
- 0x2700, 0x2700,
- 0x2b4d, 0x2b4f,
- 0x2b5a, 0x2bff,
+ 0x2b74, 0x2b75,
+ 0x2b96, 0x2b97,
+ 0x2bba, 0x2bbc,
+ 0x2bc9, 0x2bc9,
+ 0x2bd2, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
0x2cf4, 0x2cf8,
@@ -5149,7 +5574,7 @@ static const OnigCodePoint CR_C[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e3c, 0x2e7f,
+ 0x2e43, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -5168,11 +5593,11 @@ static const OnigCodePoint CR_C[] = {
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa698, 0xa69e,
+ 0xa69e, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa794, 0xa79f,
- 0xa7ab, 0xa7f7,
+ 0xa7ae, 0xa7af,
+ 0xa7b2, 0xa7f6,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -5183,18 +5608,19 @@ static const OnigCodePoint CR_C[] = {
0xa97d, 0xa97f,
0xa9ce, 0xa9ce,
0xa9da, 0xa9dd,
- 0xa9e0, 0xa9ff,
+ 0xa9ff, 0xa9ff,
0xaa37, 0xaa3f,
0xaa4e, 0xaa4f,
0xaa5a, 0xaa5b,
- 0xaa7c, 0xaa7f,
0xaac3, 0xaada,
0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
0xab27, 0xab27,
- 0xab2f, 0xabbf,
+ 0xab2f, 0xab2f,
+ 0xab60, 0xab63,
+ 0xab66, 0xabbf,
0xabee, 0xabef,
0xabfa, 0xabff,
0xd7a4, 0xd7af,
@@ -5215,7 +5641,7 @@ static const OnigCodePoint CR_C[] = {
0xfdc8, 0xfdef,
0xfdfe, 0xfdff,
0xfe1a, 0xfe1f,
- 0xfe27, 0xfe2f,
+ 0xfe2e, 0xfe2f,
0xfe53, 0xfe53,
0xfe67, 0xfe67,
0xfe6c, 0xfe6f,
@@ -5238,26 +5664,35 @@ static const OnigCodePoint CR_C[] = {
0x100fb, 0x100ff,
0x10103, 0x10106,
0x10134, 0x10136,
- 0x1018b, 0x1018f,
- 0x1019c, 0x101cf,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
0x101fe, 0x1027f,
0x1029d, 0x1029f,
- 0x102d1, 0x102ff,
- 0x1031f, 0x1031f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
0x10324, 0x1032f,
- 0x1034b, 0x1037f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
0x1039e, 0x1039e,
0x103c4, 0x103c7,
0x103d6, 0x103ff,
0x1049e, 0x1049f,
- 0x104aa, 0x107ff,
+ 0x104aa, 0x104ff,
+ 0x10528, 0x1052f,
+ 0x10564, 0x1056e,
+ 0x10570, 0x105ff,
+ 0x10737, 0x1073f,
+ 0x10756, 0x1075f,
+ 0x10768, 0x107ff,
0x10806, 0x10807,
0x10809, 0x10809,
0x10836, 0x10836,
0x10839, 0x1083b,
0x1083d, 0x1083e,
0x10856, 0x10856,
- 0x10860, 0x108ff,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
0x10940, 0x1097f,
@@ -5271,34 +5706,83 @@ static const OnigCodePoint CR_C[] = {
0x10a3b, 0x10a3e,
0x10a48, 0x10a4f,
0x10a59, 0x10a5f,
- 0x10a80, 0x10aff,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
0x10b36, 0x10b38,
0x10b56, 0x10b57,
0x10b73, 0x10b77,
- 0x10b80, 0x10bff,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
0x10c49, 0x10e5f,
0x10e7f, 0x10fff,
0x1104e, 0x11051,
- 0x11070, 0x1107f,
+ 0x11070, 0x1107e,
0x110bd, 0x110bd,
0x110c2, 0x110cf,
0x110e9, 0x110ef,
0x110fa, 0x110ff,
0x11135, 0x11135,
- 0x11144, 0x1117f,
- 0x111c9, 0x111cf,
- 0x111da, 0x1167f,
+ 0x11144, 0x1114f,
+ 0x11177, 0x1117f,
+ 0x111c9, 0x111cc,
+ 0x111ce, 0x111cf,
+ 0x111db, 0x111e0,
+ 0x111f5, 0x111ff,
+ 0x11212, 0x11212,
+ 0x1123e, 0x112af,
+ 0x112eb, 0x112ef,
+ 0x112fa, 0x11300,
+ 0x11304, 0x11304,
+ 0x1130d, 0x1130e,
+ 0x11311, 0x11312,
+ 0x11329, 0x11329,
+ 0x11331, 0x11331,
+ 0x11334, 0x11334,
+ 0x1133a, 0x1133b,
+ 0x11345, 0x11346,
+ 0x11349, 0x1134a,
+ 0x1134e, 0x11356,
+ 0x11358, 0x1135c,
+ 0x11364, 0x11365,
+ 0x1136d, 0x1136f,
+ 0x11375, 0x1147f,
+ 0x114c8, 0x114cf,
+ 0x114da, 0x1157f,
+ 0x115b6, 0x115b7,
+ 0x115ca, 0x115ff,
+ 0x11645, 0x1164f,
+ 0x1165a, 0x1167f,
0x116b8, 0x116bf,
- 0x116ca, 0x11fff,
- 0x1236f, 0x123ff,
- 0x12463, 0x1246f,
- 0x12474, 0x12fff,
+ 0x116ca, 0x1189f,
+ 0x118f3, 0x118fe,
+ 0x11900, 0x11abf,
+ 0x11af9, 0x11fff,
+ 0x12399, 0x123ff,
+ 0x1246f, 0x1246f,
+ 0x12475, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x16eff,
+ 0x16a39, 0x16a3f,
+ 0x16a5f, 0x16a5f,
+ 0x16a6a, 0x16a6d,
+ 0x16a70, 0x16acf,
+ 0x16aee, 0x16aef,
+ 0x16af6, 0x16aff,
+ 0x16b46, 0x16b4f,
+ 0x16b5a, 0x16b5a,
+ 0x16b62, 0x16b62,
+ 0x16b78, 0x16b7c,
+ 0x16b90, 0x16eff,
0x16f45, 0x16f4f,
0x16f7f, 0x16f8e,
0x16fa0, 0x1afff,
- 0x1b002, 0x1cfff,
+ 0x1b002, 0x1bbff,
+ 0x1bc6b, 0x1bc6f,
+ 0x1bc7d, 0x1bc7f,
+ 0x1bc89, 0x1bc8f,
+ 0x1bc9a, 0x1bc9b,
+ 0x1bca0, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
0x1d173, 0x1d17a,
@@ -5326,7 +5810,9 @@ static const OnigCodePoint CR_C[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1edff,
+ 0x1d800, 0x1e7ff,
+ 0x1e8c5, 0x1e8c6,
+ 0x1e8d7, 0x1edff,
0x1ee04, 0x1ee04,
0x1ee20, 0x1ee20,
0x1ee23, 0x1ee23,
@@ -5364,10 +5850,10 @@ static const OnigCodePoint CR_C[] = {
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
- 0x1f0bf, 0x1f0c0,
+ 0x1f0c0, 0x1f0c0,
0x1f0d0, 0x1f0d0,
- 0x1f0e0, 0x1f0ff,
- 0x1f10b, 0x1f10f,
+ 0x1f0f6, 0x1f0ff,
+ 0x1f10d, 0x1f10f,
0x1f12f, 0x1f12f,
0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
@@ -5375,24 +5861,25 @@ static const OnigCodePoint CR_C[] = {
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,
+ 0x1f32d, 0x1f32f,
+ 0x1f37e, 0x1f37f,
+ 0x1f3cf, 0x1f3d3,
+ 0x1f3f8, 0x1f3ff,
+ 0x1f4ff, 0x1f4ff,
+ 0x1f54b, 0x1f54f,
+ 0x1f57a, 0x1f57a,
+ 0x1f5a4, 0x1f5a4,
+ 0x1f643, 0x1f644,
+ 0x1f6d0, 0x1f6df,
+ 0x1f6ed, 0x1f6ef,
+ 0x1f6f4, 0x1f6ff,
+ 0x1f774, 0x1f77f,
+ 0x1f7d5, 0x1f7ff,
+ 0x1f80c, 0x1f80f,
+ 0x1f848, 0x1f84f,
+ 0x1f85a, 0x1f85f,
+ 0x1f888, 0x1f88f,
+ 0x1f8ae, 0x1ffff,
0x2a6d7, 0x2a6ff,
0x2b735, 0x2b73f,
0x2b81e, 0x2f7ff,
@@ -5405,18 +5892,21 @@ static const OnigCodePoint CR_C[] = {
/* 'Cf': General Category */
static const OnigCodePoint CR_Cf[] = {
- 14,
+ 17,
0x00ad, 0x00ad,
- 0x0600, 0x0604,
+ 0x0600, 0x0605,
+ 0x061c, 0x061c,
0x06dd, 0x06dd,
0x070f, 0x070f,
+ 0x180e, 0x180e,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x2064,
- 0x206a, 0x206f,
+ 0x2066, 0x206f,
0xfeff, 0xfeff,
0xfff9, 0xfffb,
0x110bd, 0x110bd,
+ 0x1bca0, 0x1bca3,
0x1d173, 0x1d17a,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
@@ -5424,23 +5914,22 @@ static const OnigCodePoint CR_Cf[] = {
/* 'Cn': General Category */
static const OnigCodePoint CR_Cn[] = {
- 539,
+ 600,
0x0378, 0x0379,
- 0x037f, 0x0383,
+ 0x0380, 0x0383,
0x038b, 0x038b,
0x038d, 0x038d,
0x03a2, 0x03a2,
- 0x0528, 0x0530,
+ 0x0530, 0x0530,
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x058e,
+ 0x058b, 0x058c,
0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0605, 0x0605,
- 0x061c, 0x061d,
+ 0x061d, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
0x07b2, 0x07bf,
@@ -5449,11 +5938,7 @@ static const OnigCodePoint CR_Cn[] = {
0x083f, 0x083f,
0x085c, 0x085d,
0x085f, 0x089f,
- 0x08a1, 0x08a1,
- 0x08ad, 0x08e3,
- 0x08ff, 0x08ff,
- 0x0978, 0x0978,
- 0x0980, 0x0980,
+ 0x08b3, 0x08e3,
0x0984, 0x0984,
0x098d, 0x098e,
0x0991, 0x0992,
@@ -5526,12 +6011,11 @@ static const OnigCodePoint CR_Cn[] = {
0x0bce, 0x0bcf,
0x0bd1, 0x0bd6,
0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
+ 0x0bfb, 0x0bff,
0x0c04, 0x0c04,
0x0c0d, 0x0c0d,
0x0c11, 0x0c11,
0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
0x0c3a, 0x0c3c,
0x0c45, 0x0c45,
0x0c49, 0x0c49,
@@ -5540,7 +6024,7 @@ static const OnigCodePoint CR_Cn[] = {
0x0c5a, 0x0c5f,
0x0c64, 0x0c65,
0x0c70, 0x0c77,
- 0x0c80, 0x0c81,
+ 0x0c80, 0x0c80,
0x0c84, 0x0c84,
0x0c8d, 0x0c8d,
0x0c91, 0x0c91,
@@ -5554,7 +6038,7 @@ static const OnigCodePoint CR_Cn[] = {
0x0cdf, 0x0cdf,
0x0ce4, 0x0ce5,
0x0cf0, 0x0cf0,
- 0x0cf3, 0x0d01,
+ 0x0cf3, 0x0d00,
0x0d04, 0x0d04,
0x0d0d, 0x0d0d,
0x0d11, 0x0d11,
@@ -5575,7 +6059,8 @@ static const OnigCodePoint CR_Cn[] = {
0x0dcb, 0x0dce,
0x0dd5, 0x0dd5,
0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
+ 0x0de0, 0x0de5,
+ 0x0df0, 0x0df1,
0x0df5, 0x0e00,
0x0e3b, 0x0e3e,
0x0e5c, 0x0e80,
@@ -5626,7 +6111,7 @@ static const OnigCodePoint CR_Cn[] = {
0x139a, 0x139f,
0x13f5, 0x13ff,
0x169d, 0x169f,
- 0x16f1, 0x16ff,
+ 0x16f9, 0x16ff,
0x170d, 0x170d,
0x1715, 0x171f,
0x1737, 0x173f,
@@ -5642,7 +6127,7 @@ static const OnigCodePoint CR_Cn[] = {
0x1878, 0x187f,
0x18ab, 0x18af,
0x18f6, 0x18ff,
- 0x191d, 0x191f,
+ 0x191f, 0x191f,
0x192c, 0x192f,
0x193c, 0x193f,
0x1941, 0x1943,
@@ -5656,7 +6141,8 @@ static const OnigCodePoint CR_Cn[] = {
0x1a7d, 0x1a7e,
0x1a8a, 0x1a8f,
0x1a9a, 0x1a9f,
- 0x1aae, 0x1aff,
+ 0x1aae, 0x1aaf,
+ 0x1abf, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
0x1bf4, 0x1bfb,
@@ -5664,8 +6150,9 @@ static const OnigCodePoint CR_Cn[] = {
0x1c4a, 0x1c4c,
0x1c80, 0x1cbf,
0x1cc8, 0x1ccf,
- 0x1cf7, 0x1cff,
- 0x1de7, 0x1dfb,
+ 0x1cf7, 0x1cf7,
+ 0x1cfa, 0x1cff,
+ 0x1df6, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
0x1f46, 0x1f47,
@@ -5682,19 +6169,21 @@ static const OnigCodePoint CR_Cn[] = {
0x1ff0, 0x1ff1,
0x1ff5, 0x1ff5,
0x1fff, 0x1fff,
- 0x2065, 0x2069,
+ 0x2065, 0x2065,
0x2072, 0x2073,
0x208f, 0x208f,
0x209d, 0x209f,
- 0x20ba, 0x20cf,
+ 0x20be, 0x20cf,
0x20f1, 0x20ff,
0x218a, 0x218f,
- 0x23f4, 0x23ff,
+ 0x23fb, 0x23ff,
0x2427, 0x243f,
0x244b, 0x245f,
- 0x2700, 0x2700,
- 0x2b4d, 0x2b4f,
- 0x2b5a, 0x2bff,
+ 0x2b74, 0x2b75,
+ 0x2b96, 0x2b97,
+ 0x2bba, 0x2bbc,
+ 0x2bc9, 0x2bc9,
+ 0x2bd2, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
0x2cf4, 0x2cf8,
@@ -5712,7 +6201,7 @@ static const OnigCodePoint CR_Cn[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e3c, 0x2e7f,
+ 0x2e43, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -5731,11 +6220,11 @@ static const OnigCodePoint CR_Cn[] = {
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa698, 0xa69e,
+ 0xa69e, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa794, 0xa79f,
- 0xa7ab, 0xa7f7,
+ 0xa7ae, 0xa7af,
+ 0xa7b2, 0xa7f6,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -5746,18 +6235,19 @@ static const OnigCodePoint CR_Cn[] = {
0xa97d, 0xa97f,
0xa9ce, 0xa9ce,
0xa9da, 0xa9dd,
- 0xa9e0, 0xa9ff,
+ 0xa9ff, 0xa9ff,
0xaa37, 0xaa3f,
0xaa4e, 0xaa4f,
0xaa5a, 0xaa5b,
- 0xaa7c, 0xaa7f,
0xaac3, 0xaada,
0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
0xab27, 0xab27,
- 0xab2f, 0xabbf,
+ 0xab2f, 0xab2f,
+ 0xab60, 0xab63,
+ 0xab66, 0xabbf,
0xabee, 0xabef,
0xabfa, 0xabff,
0xd7a4, 0xd7af,
@@ -5778,7 +6268,7 @@ static const OnigCodePoint CR_Cn[] = {
0xfdc8, 0xfdef,
0xfdfe, 0xfdff,
0xfe1a, 0xfe1f,
- 0xfe27, 0xfe2f,
+ 0xfe2e, 0xfe2f,
0xfe53, 0xfe53,
0xfe67, 0xfe67,
0xfe6c, 0xfe6f,
@@ -5802,26 +6292,35 @@ static const OnigCodePoint CR_Cn[] = {
0x100fb, 0x100ff,
0x10103, 0x10106,
0x10134, 0x10136,
- 0x1018b, 0x1018f,
- 0x1019c, 0x101cf,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
0x101fe, 0x1027f,
0x1029d, 0x1029f,
- 0x102d1, 0x102ff,
- 0x1031f, 0x1031f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
0x10324, 0x1032f,
- 0x1034b, 0x1037f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
0x1039e, 0x1039e,
0x103c4, 0x103c7,
0x103d6, 0x103ff,
0x1049e, 0x1049f,
- 0x104aa, 0x107ff,
+ 0x104aa, 0x104ff,
+ 0x10528, 0x1052f,
+ 0x10564, 0x1056e,
+ 0x10570, 0x105ff,
+ 0x10737, 0x1073f,
+ 0x10756, 0x1075f,
+ 0x10768, 0x107ff,
0x10806, 0x10807,
0x10809, 0x10809,
0x10836, 0x10836,
0x10839, 0x1083b,
0x1083d, 0x1083e,
0x10856, 0x10856,
- 0x10860, 0x108ff,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
0x10940, 0x1097f,
@@ -5835,33 +6334,82 @@ static const OnigCodePoint CR_Cn[] = {
0x10a3b, 0x10a3e,
0x10a48, 0x10a4f,
0x10a59, 0x10a5f,
- 0x10a80, 0x10aff,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
0x10b36, 0x10b38,
0x10b56, 0x10b57,
0x10b73, 0x10b77,
- 0x10b80, 0x10bff,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
0x10c49, 0x10e5f,
0x10e7f, 0x10fff,
0x1104e, 0x11051,
- 0x11070, 0x1107f,
+ 0x11070, 0x1107e,
0x110c2, 0x110cf,
0x110e9, 0x110ef,
0x110fa, 0x110ff,
0x11135, 0x11135,
- 0x11144, 0x1117f,
- 0x111c9, 0x111cf,
- 0x111da, 0x1167f,
+ 0x11144, 0x1114f,
+ 0x11177, 0x1117f,
+ 0x111c9, 0x111cc,
+ 0x111ce, 0x111cf,
+ 0x111db, 0x111e0,
+ 0x111f5, 0x111ff,
+ 0x11212, 0x11212,
+ 0x1123e, 0x112af,
+ 0x112eb, 0x112ef,
+ 0x112fa, 0x11300,
+ 0x11304, 0x11304,
+ 0x1130d, 0x1130e,
+ 0x11311, 0x11312,
+ 0x11329, 0x11329,
+ 0x11331, 0x11331,
+ 0x11334, 0x11334,
+ 0x1133a, 0x1133b,
+ 0x11345, 0x11346,
+ 0x11349, 0x1134a,
+ 0x1134e, 0x11356,
+ 0x11358, 0x1135c,
+ 0x11364, 0x11365,
+ 0x1136d, 0x1136f,
+ 0x11375, 0x1147f,
+ 0x114c8, 0x114cf,
+ 0x114da, 0x1157f,
+ 0x115b6, 0x115b7,
+ 0x115ca, 0x115ff,
+ 0x11645, 0x1164f,
+ 0x1165a, 0x1167f,
0x116b8, 0x116bf,
- 0x116ca, 0x11fff,
- 0x1236f, 0x123ff,
- 0x12463, 0x1246f,
- 0x12474, 0x12fff,
+ 0x116ca, 0x1189f,
+ 0x118f3, 0x118fe,
+ 0x11900, 0x11abf,
+ 0x11af9, 0x11fff,
+ 0x12399, 0x123ff,
+ 0x1246f, 0x1246f,
+ 0x12475, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x16eff,
+ 0x16a39, 0x16a3f,
+ 0x16a5f, 0x16a5f,
+ 0x16a6a, 0x16a6d,
+ 0x16a70, 0x16acf,
+ 0x16aee, 0x16aef,
+ 0x16af6, 0x16aff,
+ 0x16b46, 0x16b4f,
+ 0x16b5a, 0x16b5a,
+ 0x16b62, 0x16b62,
+ 0x16b78, 0x16b7c,
+ 0x16b90, 0x16eff,
0x16f45, 0x16f4f,
0x16f7f, 0x16f8e,
0x16fa0, 0x1afff,
- 0x1b002, 0x1cfff,
+ 0x1b002, 0x1bbff,
+ 0x1bc6b, 0x1bc6f,
+ 0x1bc7d, 0x1bc7f,
+ 0x1bc89, 0x1bc8f,
+ 0x1bc9a, 0x1bc9b,
+ 0x1bca4, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
0x1d1de, 0x1d1ff,
@@ -5888,7 +6436,9 @@ static const OnigCodePoint CR_Cn[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1edff,
+ 0x1d800, 0x1e7ff,
+ 0x1e8c5, 0x1e8c6,
+ 0x1e8d7, 0x1edff,
0x1ee04, 0x1ee04,
0x1ee20, 0x1ee20,
0x1ee23, 0x1ee23,
@@ -5926,10 +6476,10 @@ static const OnigCodePoint CR_Cn[] = {
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
- 0x1f0bf, 0x1f0c0,
+ 0x1f0c0, 0x1f0c0,
0x1f0d0, 0x1f0d0,
- 0x1f0e0, 0x1f0ff,
- 0x1f10b, 0x1f10f,
+ 0x1f0f6, 0x1f0ff,
+ 0x1f10d, 0x1f10f,
0x1f12f, 0x1f12f,
0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
@@ -5937,24 +6487,25 @@ static const OnigCodePoint CR_Cn[] = {
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,
+ 0x1f32d, 0x1f32f,
+ 0x1f37e, 0x1f37f,
+ 0x1f3cf, 0x1f3d3,
+ 0x1f3f8, 0x1f3ff,
+ 0x1f4ff, 0x1f4ff,
+ 0x1f54b, 0x1f54f,
+ 0x1f57a, 0x1f57a,
+ 0x1f5a4, 0x1f5a4,
+ 0x1f643, 0x1f644,
+ 0x1f6d0, 0x1f6df,
+ 0x1f6ed, 0x1f6ef,
+ 0x1f6f4, 0x1f6ff,
+ 0x1f774, 0x1f77f,
+ 0x1f7d5, 0x1f7ff,
+ 0x1f80c, 0x1f80f,
+ 0x1f848, 0x1f84f,
+ 0x1f85a, 0x1f85f,
+ 0x1f888, 0x1f88f,
+ 0x1f8ae, 0x1ffff,
0x2a6d7, 0x2a6ff,
0x2b735, 0x2b73f,
0x2b81e, 0x2f7ff,
@@ -5982,7 +6533,7 @@ static const OnigCodePoint CR_Cs[] = {
/* 'L': Major Category */
static const OnigCodePoint CR_L[] = {
- 486,
+ 537,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -5998,13 +6549,14 @@ static const OnigCodePoint CR_L[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -6030,14 +6582,12 @@ static const OnigCodePoint CR_L[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b2,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
+ 0x0971, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -6092,8 +6642,7 @@ static const OnigCodePoint CR_L[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
0x0c58, 0x0c59,
0x0c60, 0x0c61,
@@ -6177,6 +6726,7 @@ static const OnigCodePoint CR_L[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
+ 0x16f1, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -6190,7 +6740,7 @@ static const OnigCodePoint CR_L[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
@@ -6285,14 +6835,14 @@ static const OnigCodePoint CR_L[] = {
0xa610, 0xa61f,
0xa62a, 0xa62b,
0xa640, 0xa66e,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa6a0, 0xa6e5,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -6305,12 +6855,15 @@ static const OnigCodePoint CR_L[] = {
0xa960, 0xa97c,
0xa984, 0xa9b2,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -6324,6 +6877,9 @@ static const OnigCodePoint CR_L[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabe2,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -6362,19 +6918,27 @@ static const OnigCodePoint CR_L[] = {
0x10080, 0x100fa,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x10340,
0x10342, 0x10349,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -6384,24 +6948,61 @@ static const OnigCodePoint CR_L[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -6432,6 +7033,7 @@ static const OnigCodePoint CR_L[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -6473,7 +7075,7 @@ static const OnigCodePoint CR_L[] = {
/* 'LC': General Category */
static const OnigCodePoint CR_LC[] = {
- 113,
+ 117,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -6486,13 +7088,14 @@ static const OnigCodePoint CR_LC[] = {
0x0370, 0x0373,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
@@ -6545,18 +7148,21 @@ static const OnigCodePoint CR_LC[] = {
0x2d27, 0x2d27,
0x2d2d, 0x2d2d,
0xa640, 0xa66d,
- 0xa680, 0xa697,
+ 0xa680, 0xa69b,
0xa722, 0xa76f,
0xa771, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
0xa7fa, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab64, 0xab65,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0xff41, 0xff5a,
0x10400, 0x1044f,
+ 0x118a0, 0x118df,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -6591,7 +7197,7 @@ static const OnigCodePoint CR_LC[] = {
/* 'Ll': General Category */
static const OnigCodePoint CR_Ll[] = {
- 611,
+ 625,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -6857,6 +7463,10 @@ static const OnigCodePoint CR_Ll[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
0x1d00, 0x1d2b,
0x1d6b, 0x1d77,
@@ -7115,6 +7725,8 @@ static const OnigCodePoint CR_Ll[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -7164,17 +7776,25 @@ static const OnigCodePoint CR_Ll[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
- 0xa793, 0xa793,
+ 0xa793, 0xa795,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
0xa7a7, 0xa7a7,
0xa7a9, 0xa7a9,
0xa7fa, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab64, 0xab65,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x118c0, 0x118df,
0x1d41a, 0x1d433,
0x1d44e, 0x1d454,
0x1d456, 0x1d467,
@@ -7207,7 +7827,7 @@ static const OnigCodePoint CR_Ll[] = {
/* 'Lm': General Category */
static const OnigCodePoint CR_Lm[] = {
- 52,
+ 56,
0x02b0, 0x02c1,
0x02c6, 0x02d1,
0x02e0, 0x02e4,
@@ -7249,22 +7869,26 @@ static const OnigCodePoint CR_Lm[] = {
0xa4f8, 0xa4fd,
0xa60c, 0xa60c,
0xa67f, 0xa67f,
+ 0xa69c, 0xa69d,
0xa717, 0xa71f,
0xa770, 0xa770,
0xa788, 0xa788,
0xa7f8, 0xa7f9,
0xa9cf, 0xa9cf,
+ 0xa9e6, 0xa9e6,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
0xaaf3, 0xaaf4,
+ 0xab5c, 0xab5f,
0xff70, 0xff70,
0xff9e, 0xff9f,
+ 0x16b40, 0x16b43,
0x16f93, 0x16f9f,
}; /* CR_Lm */
/* 'Lo': General Category */
static const OnigCodePoint CR_Lo[] = {
- 371,
+ 417,
0x00aa, 0x00aa,
0x00ba, 0x00ba,
0x01bb, 0x01bb,
@@ -7287,14 +7911,12 @@ static const OnigCodePoint CR_Lo[] = {
0x07ca, 0x07ea,
0x0800, 0x0815,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b2,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0972, 0x0977,
- 0x0979, 0x097f,
+ 0x0972, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -7349,8 +7971,7 @@ static const OnigCodePoint CR_Lo[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
0x0c58, 0x0c59,
0x0c60, 0x0c61,
@@ -7430,6 +8051,7 @@ static const OnigCodePoint CR_Lo[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
+ 0x16f1, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -7443,7 +8065,7 @@ static const OnigCodePoint CR_Lo[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
@@ -7492,6 +8114,7 @@ static const OnigCodePoint CR_Lo[] = {
0xa62a, 0xa62b,
0xa66e, 0xa66e,
0xa6a0, 0xa6e5,
+ 0xa7f7, 0xa7f7,
0xa7fb, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
@@ -7504,13 +8127,16 @@ static const OnigCodePoint CR_Lo[] = {
0xa930, 0xa946,
0xa960, 0xa97c,
0xa984, 0xa9b2,
+ 0xa9e0, 0xa9e4,
+ 0xa9e7, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa6f,
0xaa71, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -7560,19 +8186,27 @@ static const OnigCodePoint CR_Lo[] = {
0x10080, 0x100fa,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x10340,
0x10342, 0x10349,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x10450, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -7582,23 +8216,59 @@ static const OnigCodePoint CR_Lo[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -7655,7 +8325,7 @@ static const OnigCodePoint CR_Lt[] = {
/* 'Lu': General Category */
static const OnigCodePoint CR_Lu[] = {
- 608,
+ 622,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -7803,6 +8473,7 @@ static const OnigCodePoint CR_Lu[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -7922,6 +8593,10 @@ static const OnigCodePoint CR_Lu[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
@@ -8176,6 +8851,8 @@ static const OnigCodePoint CR_Lu[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -8225,14 +8902,21 @@ static const OnigCodePoint CR_Lu[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b1,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x118a0, 0x118bf,
0x1d400, 0x1d419,
0x1d434, 0x1d44d,
0x1d468, 0x1d481,
@@ -8268,7 +8952,7 @@ static const OnigCodePoint CR_Lu[] = {
/* 'M': Major Category */
static const OnigCodePoint CR_M[] = {
- 204,
+ 229,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -8292,8 +8976,7 @@ static const OnigCodePoint CR_M[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0903,
+ 0x08e4, 0x0903,
0x093a, 0x093c,
0x093e, 0x094f,
0x0951, 0x0957,
@@ -8331,20 +9014,20 @@ static const OnigCodePoint CR_M[] = {
0x0bc6, 0x0bc8,
0x0bca, 0x0bcd,
0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c3e, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0cbc, 0x0cbc,
0x0cbe, 0x0cc4,
0x0cc6, 0x0cc8,
0x0cca, 0x0ccd,
0x0cd5, 0x0cd6,
0x0ce2, 0x0ce3,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d3e, 0x0d44,
0x0d46, 0x0d48,
0x0d4a, 0x0d4d,
@@ -8399,6 +9082,7 @@ static const OnigCodePoint CR_M[] = {
0x1a55, 0x1a5e,
0x1a60, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b04,
0x1b34, 0x1b44,
0x1b6b, 0x1b73,
@@ -8410,7 +9094,8 @@ static const OnigCodePoint CR_M[] = {
0x1cd4, 0x1ce8,
0x1ced, 0x1ced,
0x1cf2, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x20d0, 0x20f0,
0x2cef, 0x2cf1,
@@ -8433,10 +9118,11 @@ static const OnigCodePoint CR_M[] = {
0xa947, 0xa953,
0xa980, 0xa983,
0xa9b3, 0xa9c0,
+ 0xa9e5, 0xa9e5,
0xaa29, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4d,
- 0xaa7b, 0xaa7b,
+ 0xaa7b, 0xaa7d,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -8448,36 +9134,59 @@ static const OnigCodePoint CR_M[] = {
0xabec, 0xabed,
0xfb1e, 0xfb1e,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11000, 0x11002,
0x11038, 0x11046,
- 0x11080, 0x11082,
+ 0x1107f, 0x11082,
0x110b0, 0x110ba,
0x11100, 0x11102,
0x11127, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11182,
0x111b3, 0x111c0,
+ 0x1122c, 0x11237,
+ 0x112df, 0x112ea,
+ 0x11301, 0x11303,
+ 0x1133c, 0x1133c,
+ 0x1133e, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x11362, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b0, 0x114c3,
+ 0x115af, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x11630, 0x11640,
0x116ab, 0x116b7,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
0x16f51, 0x16f7e,
0x16f8f, 0x16f92,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1e8d0, 0x1e8d6,
0xe0100, 0xe01ef,
}; /* CR_M */
/* 'Mc': General Category */
static const OnigCodePoint CR_Mc[] = {
- 126,
+ 147,
0x0903, 0x0903,
0x093b, 0x093b,
0x093e, 0x0940,
@@ -8544,7 +9253,7 @@ static const OnigCodePoint CR_Mc[] = {
0x1933, 0x1938,
0x19b0, 0x19c0,
0x19c8, 0x19c9,
- 0x1a19, 0x1a1b,
+ 0x1a19, 0x1a1a,
0x1a55, 0x1a55,
0x1a57, 0x1a57,
0x1a61, 0x1a61,
@@ -8559,7 +9268,6 @@ static const OnigCodePoint CR_Mc[] = {
0x1ba1, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bac, 0x1bad,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -8582,6 +9290,7 @@ static const OnigCodePoint CR_Mc[] = {
0xaa33, 0xaa34,
0xaa4d, 0xaa4d,
0xaa7b, 0xaa7b,
+ 0xaa7d, 0xaa7d,
0xaaeb, 0xaaeb,
0xaaee, 0xaaef,
0xaaf5, 0xaaf5,
@@ -8598,6 +9307,27 @@ static const OnigCodePoint CR_Mc[] = {
0x11182, 0x11182,
0x111b3, 0x111b5,
0x111bf, 0x111c0,
+ 0x1122c, 0x1122e,
+ 0x11232, 0x11233,
+ 0x11235, 0x11235,
+ 0x112e0, 0x112e2,
+ 0x11302, 0x11303,
+ 0x1133e, 0x1133f,
+ 0x11341, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x11362, 0x11363,
+ 0x114b0, 0x114b2,
+ 0x114b9, 0x114b9,
+ 0x114bb, 0x114be,
+ 0x114c1, 0x114c1,
+ 0x115af, 0x115b1,
+ 0x115b8, 0x115bb,
+ 0x115be, 0x115be,
+ 0x11630, 0x11632,
+ 0x1163b, 0x1163c,
+ 0x1163e, 0x1163e,
0x116ac, 0x116ac,
0x116ae, 0x116af,
0x116b6, 0x116b6,
@@ -8608,8 +9338,9 @@ static const OnigCodePoint CR_Mc[] = {
/* 'Me': General Category */
static const OnigCodePoint CR_Me[] = {
- 4,
+ 5,
0x0488, 0x0489,
+ 0x1abe, 0x1abe,
0x20dd, 0x20e0,
0x20e2, 0x20e4,
0xa670, 0xa672,
@@ -8617,7 +9348,7 @@ static const OnigCodePoint CR_Me[] = {
/* 'Mn': General Category */
static const OnigCodePoint CR_Mn[] = {
- 220,
+ 255,
0x0300, 0x036f,
0x0483, 0x0487,
0x0591, 0x05bd,
@@ -8641,8 +9372,7 @@ static const OnigCodePoint CR_Mn[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0902,
+ 0x08e4, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
0x0941, 0x0948,
@@ -8678,16 +9408,19 @@ static const OnigCodePoint CR_Mn[] = {
0x0b82, 0x0b82,
0x0bc0, 0x0bc0,
0x0bcd, 0x0bcd,
+ 0x0c00, 0x0c00,
0x0c3e, 0x0c40,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
+ 0x0c81, 0x0c81,
0x0cbc, 0x0cbc,
0x0cbf, 0x0cbf,
0x0cc6, 0x0cc6,
0x0ccc, 0x0ccd,
0x0ce2, 0x0ce3,
+ 0x0d01, 0x0d01,
0x0d41, 0x0d44,
0x0d4d, 0x0d4d,
0x0d62, 0x0d63,
@@ -8739,6 +9472,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1932, 0x1932,
0x1939, 0x193b,
0x1a17, 0x1a18,
+ 0x1a1b, 0x1a1b,
0x1a56, 0x1a56,
0x1a58, 0x1a5e,
0x1a60, 0x1a60,
@@ -8746,6 +9480,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1a65, 0x1a6c,
0x1a73, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abd,
0x1b00, 0x1b03,
0x1b34, 0x1b34,
0x1b36, 0x1b3a,
@@ -8755,7 +9490,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
- 0x1bab, 0x1bab,
+ 0x1bab, 0x1bad,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -8767,7 +9502,8 @@ static const OnigCodePoint CR_Mn[] = {
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x20d0, 0x20dc,
0x20e1, 0x20e1,
@@ -8793,11 +9529,13 @@ static const OnigCodePoint CR_Mn[] = {
0xa9b3, 0xa9b3,
0xa9b6, 0xa9b9,
0xa9bc, 0xa9bc,
+ 0xa9e5, 0xa9e5,
0xaa29, 0xaa2e,
0xaa31, 0xaa32,
0xaa35, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4c,
+ 0xaa7c, 0xaa7c,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -8810,39 +9548,67 @@ static const OnigCodePoint CR_Mn[] = {
0xabed, 0xabed,
0xfb1e, 0xfb1e,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11001, 0x11001,
0x11038, 0x11046,
- 0x11080, 0x11081,
+ 0x1107f, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x11100, 0x11102,
0x11127, 0x1112b,
0x1112d, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11181,
0x111b6, 0x111be,
+ 0x1122f, 0x11231,
+ 0x11234, 0x11234,
+ 0x11236, 0x11237,
+ 0x112df, 0x112df,
+ 0x112e3, 0x112ea,
+ 0x11301, 0x11301,
+ 0x1133c, 0x1133c,
+ 0x11340, 0x11340,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b3, 0x114b8,
+ 0x114ba, 0x114ba,
+ 0x114bf, 0x114c0,
+ 0x114c2, 0x114c3,
+ 0x115b2, 0x115b5,
+ 0x115bc, 0x115bd,
+ 0x115bf, 0x115c0,
+ 0x11633, 0x1163a,
+ 0x1163d, 0x1163d,
+ 0x1163f, 0x11640,
0x116ab, 0x116ab,
0x116ad, 0x116ad,
0x116b0, 0x116b5,
0x116b7, 0x116b7,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
0x16f8f, 0x16f92,
+ 0x1bc9d, 0x1bc9e,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1e8d0, 0x1e8d6,
0xe0100, 0xe01ef,
}; /* CR_Mn */
/* 'N': Major Category */
static const OnigCodePoint CR_N[] = {
- 88,
+ 105,
0x0030, 0x0039,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
@@ -8862,6 +9628,7 @@ static const OnigCodePoint CR_N[] = {
0x0c78, 0x0c7e,
0x0ce6, 0x0cef,
0x0d66, 0x0d75,
+ 0x0de6, 0x0def,
0x0e50, 0x0e59,
0x0ed0, 0x0ed9,
0x0f20, 0x0f33,
@@ -8904,33 +9671,49 @@ static const OnigCodePoint CR_N[] = {
0xa8d0, 0xa8d9,
0xa900, 0xa909,
0xa9d0, 0xa9d9,
+ 0xa9f0, 0xa9f9,
0xaa50, 0xaa59,
0xabf0, 0xabf9,
0xff10, 0xff19,
0x10107, 0x10133,
0x10140, 0x10178,
- 0x1018a, 0x1018a,
+ 0x1018a, 0x1018b,
+ 0x102e1, 0x102fb,
0x10320, 0x10323,
0x10341, 0x10341,
0x1034a, 0x1034a,
0x103d1, 0x103d5,
0x104a0, 0x104a9,
0x10858, 0x1085f,
+ 0x10879, 0x1087f,
+ 0x108a7, 0x108af,
0x10916, 0x1091b,
0x10a40, 0x10a47,
0x10a7d, 0x10a7e,
+ 0x10a9d, 0x10a9f,
+ 0x10aeb, 0x10aef,
0x10b58, 0x10b5f,
0x10b78, 0x10b7f,
+ 0x10ba9, 0x10baf,
0x10e60, 0x10e7e,
0x11052, 0x1106f,
0x110f0, 0x110f9,
0x11136, 0x1113f,
0x111d0, 0x111d9,
+ 0x111e1, 0x111f4,
+ 0x112f0, 0x112f9,
+ 0x114d0, 0x114d9,
+ 0x11650, 0x11659,
0x116c0, 0x116c9,
- 0x12400, 0x12462,
+ 0x118e0, 0x118f2,
+ 0x12400, 0x1246e,
+ 0x16a60, 0x16a69,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
0x1d360, 0x1d371,
0x1d7ce, 0x1d7ff,
- 0x1f100, 0x1f10a,
+ 0x1e8c7, 0x1e8cf,
+ 0x1f100, 0x1f10c,
}; /* CR_N */
/* 'Nd': General Category */
@@ -8950,12 +9733,12 @@ static const OnigCodePoint CR_Nl[] = {
0x10341, 0x10341,
0x1034a, 0x1034a,
0x103d1, 0x103d5,
- 0x12400, 0x12462,
+ 0x12400, 0x1246e,
}; /* CR_Nl */
/* 'No': General Category */
static const OnigCodePoint CR_No[] = {
- 42,
+ 52,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
0x00bc, 0x00be,
@@ -8986,18 +9769,28 @@ static const OnigCodePoint CR_No[] = {
0xa830, 0xa835,
0x10107, 0x10133,
0x10175, 0x10178,
- 0x1018a, 0x1018a,
+ 0x1018a, 0x1018b,
+ 0x102e1, 0x102fb,
0x10320, 0x10323,
0x10858, 0x1085f,
+ 0x10879, 0x1087f,
+ 0x108a7, 0x108af,
0x10916, 0x1091b,
0x10a40, 0x10a47,
0x10a7d, 0x10a7e,
+ 0x10a9d, 0x10a9f,
+ 0x10aeb, 0x10aef,
0x10b58, 0x10b5f,
0x10b78, 0x10b7f,
+ 0x10ba9, 0x10baf,
0x10e60, 0x10e7e,
0x11052, 0x11065,
+ 0x111e1, 0x111f4,
+ 0x118ea, 0x118f2,
+ 0x16b5b, 0x16b61,
0x1d360, 0x1d371,
- 0x1f100, 0x1f10a,
+ 0x1e8c7, 0x1e8cf,
+ 0x1f100, 0x1f10c,
}; /* CR_No */
/* 'P': Major Category */
@@ -9016,7 +9809,7 @@ static const OnigCodePoint CR_Pc[] = {
/* 'Pd': General Category */
static const OnigCodePoint CR_Pd[] = {
- 16,
+ 17,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -9026,6 +9819,7 @@ static const OnigCodePoint CR_Pd[] = {
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
0x2e3a, 0x2e3b,
+ 0x2e40, 0x2e40,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -9037,7 +9831,7 @@ static const OnigCodePoint CR_Pd[] = {
/* 'Pe': General Category */
static const OnigCodePoint CR_Pe[] = {
- 70,
+ 72,
0x0029, 0x0029,
0x005d, 0x005d,
0x007d, 0x007d,
@@ -9047,6 +9841,8 @@ static const OnigCodePoint CR_Pe[] = {
0x2046, 0x2046,
0x207e, 0x207e,
0x208e, 0x208e,
+ 0x2309, 0x2309,
+ 0x230b, 0x230b,
0x232a, 0x232a,
0x2769, 0x2769,
0x276b, 0x276b,
@@ -9089,7 +9885,7 @@ static const OnigCodePoint CR_Pe[] = {
0x3019, 0x3019,
0x301b, 0x301b,
0x301e, 0x301f,
- 0xfd3f, 0xfd3f,
+ 0xfd3e, 0xfd3e,
0xfe18, 0xfe18,
0xfe36, 0xfe36,
0xfe38, 0xfe38,
@@ -9143,7 +9939,7 @@ static const OnigCodePoint CR_Pi[] = {
/* 'Po': General Category */
static const OnigCodePoint CR_Po[] = {
- 135,
+ 151,
0x0021, 0x0023,
0x0025, 0x0027,
0x002a, 0x002a,
@@ -9225,6 +10021,8 @@ static const OnigCodePoint CR_Po[] = {
0x2e1e, 0x2e1f,
0x2e2a, 0x2e2e,
0x2e30, 0x2e39,
+ 0x2e3c, 0x2e3f,
+ 0x2e41, 0x2e41,
0x3001, 0x3003,
0x303d, 0x303d,
0x30fb, 0x30fb,
@@ -9267,23 +10065,37 @@ static const OnigCodePoint CR_Po[] = {
0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
+ 0x1056f, 0x1056f,
0x10857, 0x10857,
0x1091f, 0x1091f,
0x1093f, 0x1093f,
0x10a50, 0x10a58,
0x10a7f, 0x10a7f,
+ 0x10af0, 0x10af6,
0x10b39, 0x10b3f,
+ 0x10b99, 0x10b9c,
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
0x11140, 0x11143,
+ 0x11174, 0x11175,
0x111c5, 0x111c8,
- 0x12470, 0x12473,
+ 0x111cd, 0x111cd,
+ 0x11238, 0x1123d,
+ 0x114c6, 0x114c6,
+ 0x115c1, 0x115c9,
+ 0x11641, 0x11643,
+ 0x12470, 0x12474,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b3b,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
}; /* CR_Po */
/* 'Ps': General Category */
static const OnigCodePoint CR_Ps[] = {
- 72,
+ 75,
0x0028, 0x0028,
0x005b, 0x005b,
0x007b, 0x007b,
@@ -9295,6 +10107,8 @@ static const OnigCodePoint CR_Ps[] = {
0x2045, 0x2045,
0x207d, 0x207d,
0x208d, 0x208d,
+ 0x2308, 0x2308,
+ 0x230a, 0x230a,
0x2329, 0x2329,
0x2768, 0x2768,
0x276a, 0x276a,
@@ -9327,6 +10141,7 @@ static const OnigCodePoint CR_Ps[] = {
0x2e24, 0x2e24,
0x2e26, 0x2e26,
0x2e28, 0x2e28,
+ 0x2e42, 0x2e42,
0x3008, 0x3008,
0x300a, 0x300a,
0x300c, 0x300c,
@@ -9337,7 +10152,7 @@ static const OnigCodePoint CR_Ps[] = {
0x3018, 0x3018,
0x301a, 0x301a,
0x301d, 0x301d,
- 0xfd3e, 0xfd3e,
+ 0xfd3f, 0xfd3f,
0xfe17, 0xfe17,
0xfe35, 0xfe35,
0xfe37, 0xfe37,
@@ -9360,7 +10175,7 @@ static const OnigCodePoint CR_Ps[] = {
/* 'S': Major Category */
static const OnigCodePoint CR_S[] = {
- 198,
+ 210,
0x0024, 0x0024,
0x002b, 0x002b,
0x003c, 0x003e,
@@ -9385,7 +10200,7 @@ static const OnigCodePoint CR_S[] = {
0x0384, 0x0385,
0x03f6, 0x03f6,
0x0482, 0x0482,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x0606, 0x0608,
0x060b, 0x060b,
0x060e, 0x060f,
@@ -9429,7 +10244,7 @@ static const OnigCodePoint CR_S[] = {
0x2052, 0x2052,
0x207a, 0x207c,
0x208a, 0x208c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20bd,
0x2100, 0x2101,
0x2103, 0x2106,
0x2108, 0x2109,
@@ -9444,20 +10259,23 @@ static const OnigCodePoint CR_S[] = {
0x2140, 0x2144,
0x214a, 0x214d,
0x214f, 0x214f,
- 0x2190, 0x2328,
- 0x232b, 0x23f3,
+ 0x2190, 0x2307,
+ 0x230c, 0x2328,
+ 0x232b, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
0x249c, 0x24e9,
- 0x2500, 0x26ff,
- 0x2701, 0x2767,
+ 0x2500, 0x2767,
0x2794, 0x27c4,
0x27c7, 0x27e5,
0x27f0, 0x2982,
0x2999, 0x29d7,
0x29dc, 0x29fb,
- 0x29fe, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x29fe, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
0x2ce5, 0x2cea,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
@@ -9487,6 +10305,7 @@ static const OnigCodePoint CR_S[] = {
0xa828, 0xa82b,
0xa836, 0xa839,
0xaa77, 0xaa79,
+ 0xab5b, 0xab5b,
0xfb29, 0xfb29,
0xfbb2, 0xfbc1,
0xfdfc, 0xfdfd,
@@ -9505,8 +10324,15 @@ static const OnigCodePoint CR_S[] = {
0xfffc, 0xfffd,
0x10137, 0x1013f,
0x10179, 0x10189,
+ 0x1018c, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fc,
+ 0x10877, 0x10878,
+ 0x10ac8, 0x10ac8,
+ 0x16b3c, 0x16b3f,
+ 0x16b45, 0x16b45,
+ 0x1bc9c, 0x1bc9c,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d164,
@@ -9531,9 +10357,9 @@ static const OnigCodePoint CR_S[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
+ 0x1f0d1, 0x1f0f5,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -9541,24 +10367,25 @@ static const OnigCodePoint CR_S[] = {
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,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
}; /* CR_S */
/* 'Sc': General Category */
@@ -9574,7 +10401,7 @@ static const OnigCodePoint CR_Sc[] = {
0x0bf9, 0x0bf9,
0x0e3f, 0x0e3f,
0x17db, 0x17db,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20bd,
0xa838, 0xa838,
0xfdfc, 0xfdfc,
0xfe69, 0xfe69,
@@ -9585,7 +10412,7 @@ static const OnigCodePoint CR_Sc[] = {
/* 'Sk': General Category */
static const OnigCodePoint CR_Sk[] = {
- 27,
+ 28,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -9609,6 +10436,7 @@ static const OnigCodePoint CR_Sk[] = {
0xa700, 0xa716,
0xa720, 0xa721,
0xa789, 0xa78a,
+ 0xab5b, 0xab5b,
0xfbb2, 0xfbc1,
0xff3e, 0xff3e,
0xff40, 0xff40,
@@ -9617,7 +10445,7 @@ static const OnigCodePoint CR_Sk[] = {
/* 'Sm': General Category */
static const OnigCodePoint CR_Sm[] = {
- 65,
+ 64,
0x002b, 0x002b,
0x003c, 0x003e,
0x007c, 0x007c,
@@ -9645,7 +10473,6 @@ static const OnigCodePoint CR_Sm[] = {
0x21d2, 0x21d2,
0x21d4, 0x21d4,
0x21f4, 0x22ff,
- 0x2308, 0x230b,
0x2320, 0x2321,
0x237c, 0x237c,
0x239b, 0x23b3,
@@ -9687,12 +10514,13 @@ static const OnigCodePoint CR_Sm[] = {
/* 'So': General Category */
static const OnigCodePoint CR_So[] = {
- 153,
+ 165,
0x00a6, 0x00a6,
0x00a9, 0x00a9,
0x00ae, 0x00ae,
0x00b0, 0x00b0,
0x0482, 0x0482,
+ 0x058d, 0x058e,
0x060e, 0x060f,
0x06de, 0x06de,
0x06e9, 0x06e9,
@@ -9750,7 +10578,7 @@ static const OnigCodePoint CR_So[] = {
0x232b, 0x237b,
0x237d, 0x239a,
0x23b4, 0x23db,
- 0x23e2, 0x23f3,
+ 0x23e2, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
0x249c, 0x24e9,
@@ -9758,13 +10586,16 @@ static const OnigCodePoint CR_So[] = {
0x25b8, 0x25c0,
0x25c2, 0x25f7,
0x2600, 0x266e,
- 0x2670, 0x26ff,
- 0x2701, 0x2767,
+ 0x2670, 0x2767,
0x2794, 0x27bf,
0x2800, 0x28ff,
0x2b00, 0x2b2f,
0x2b45, 0x2b46,
- 0x2b50, 0x2b59,
+ 0x2b4d, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
0x2ce5, 0x2cea,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
@@ -9798,8 +10629,15 @@ static const OnigCodePoint CR_So[] = {
0xfffc, 0xfffd,
0x10137, 0x1013f,
0x10179, 0x10189,
+ 0x1018c, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fc,
+ 0x10877, 0x10878,
+ 0x10ac8, 0x10ac8,
+ 0x16b3c, 0x16b3f,
+ 0x16b45, 0x16b45,
+ 0x1bc9c, 0x1bc9c,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d164,
@@ -9813,9 +10651,9 @@ static const OnigCodePoint CR_So[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
+ 0x1f0d1, 0x1f0f5,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -9823,33 +10661,33 @@ static const OnigCodePoint CR_So[] = {
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,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
}; /* CR_So */
/* 'Z': Major Category */
static const OnigCodePoint CR_Z[] = {
- 9,
+ 8,
0x0020, 0x0020,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x2028, 0x2029,
0x202f, 0x202f,
@@ -9871,11 +10709,10 @@ static const OnigCodePoint CR_Zp[] = {
/* 'Zs': General Category */
static const OnigCodePoint CR_Zs[] = {
- 8,
+ 7,
0x0020, 0x0020,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x202f, 0x202f,
0x205f, 0x205f,
@@ -10036,7 +10873,7 @@ static const OnigCodePoint CR_Math[] = {
/* 'Cased': Derived Property */
static const OnigCodePoint CR_Cased[] = {
- 119,
+ 127,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -10054,13 +10891,14 @@ static const OnigCodePoint CR_Cased[] = {
0x0370, 0x0373,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
@@ -10115,17 +10953,21 @@ static const OnigCodePoint CR_Cased[] = {
0x2d27, 0x2d27,
0x2d2d, 0x2d2d,
0xa640, 0xa66d,
- 0xa680, 0xa697,
+ 0xa680, 0xa69d,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
0xa7f8, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0xff41, 0xff5a,
0x10400, 0x1044f,
+ 0x118a0, 0x118df,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -10156,11 +10998,14 @@ static const OnigCodePoint CR_Cased[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Cased */
/* 'Case_Ignorable': Derived Property */
static const OnigCodePoint CR_Case_Ignorable[] = {
- 295,
+ 335,
0x0027, 0x0027,
0x002e, 0x002e,
0x003a, 0x003a,
@@ -10184,8 +11029,9 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x05c4, 0x05c5,
0x05c7, 0x05c7,
0x05f4, 0x05f4,
- 0x0600, 0x0604,
+ 0x0600, 0x0605,
0x0610, 0x061a,
+ 0x061c, 0x061c,
0x0640, 0x0640,
0x064b, 0x065f,
0x0670, 0x0670,
@@ -10200,8 +11046,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x07fa, 0x07fa,
0x0816, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0902,
+ 0x08e4, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
0x0941, 0x0948,
@@ -10238,16 +11083,19 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x0b82, 0x0b82,
0x0bc0, 0x0bc0,
0x0bcd, 0x0bcd,
+ 0x0c00, 0x0c00,
0x0c3e, 0x0c40,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
+ 0x0c81, 0x0c81,
0x0cbc, 0x0cbc,
0x0cbf, 0x0cbf,
0x0cc6, 0x0cc6,
0x0ccc, 0x0ccd,
0x0ce2, 0x0ce3,
+ 0x0d01, 0x0d01,
0x0d41, 0x0d44,
0x0d4d, 0x0d4d,
0x0d62, 0x0d63,
@@ -10295,7 +11143,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x17c9, 0x17d3,
0x17d7, 0x17d7,
0x17dd, 0x17dd,
- 0x180b, 0x180d,
+ 0x180b, 0x180e,
0x1843, 0x1843,
0x18a9, 0x18a9,
0x1920, 0x1922,
@@ -10303,6 +11151,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1932, 0x1932,
0x1939, 0x193b,
0x1a17, 0x1a18,
+ 0x1a1b, 0x1a1b,
0x1a56, 0x1a56,
0x1a58, 0x1a5e,
0x1a60, 0x1a60,
@@ -10311,6 +11160,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1a73, 0x1a7c,
0x1a7f, 0x1a7f,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b03,
0x1b34, 0x1b34,
0x1b36, 0x1b3a,
@@ -10320,7 +11170,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
- 0x1bab, 0x1bab,
+ 0x1bab, 0x1bad,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -10333,9 +11183,10 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
+ 0x1cf8, 0x1cf9,
0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
- 0x1d9b, 0x1de6,
+ 0x1d9b, 0x1df5,
0x1dfc, 0x1dff,
0x1fbd, 0x1fbd,
0x1fbf, 0x1fc1,
@@ -10349,7 +11200,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x2027, 0x2027,
0x202a, 0x202e,
0x2060, 0x2064,
- 0x206a, 0x206f,
+ 0x2066, 0x206f,
0x2071, 0x2071,
0x207f, 0x207f,
0x2090, 0x209c,
@@ -10372,6 +11223,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa66f, 0xa672,
0xa674, 0xa67d,
0xa67f, 0xa67f,
+ 0xa69c, 0xa69d,
0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa700, 0xa721,
@@ -10391,12 +11243,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa9b6, 0xa9b9,
0xa9bc, 0xa9bc,
0xa9cf, 0xa9cf,
+ 0xa9e5, 0xa9e6,
0xaa29, 0xaa2e,
0xaa31, 0xaa32,
0xaa35, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4c,
0xaa70, 0xaa70,
+ 0xaa7c, 0xaa7c,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -10406,6 +11260,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xaaec, 0xaaed,
0xaaf3, 0xaaf4,
0xaaf6, 0xaaf6,
+ 0xab5b, 0xab5f,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -10413,7 +11268,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xfbb2, 0xfbc1,
0xfe00, 0xfe0f,
0xfe13, 0xfe13,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xfe52, 0xfe52,
0xfe55, 0xfe55,
0xfeff, 0xfeff,
@@ -10427,32 +11282,62 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xffe3, 0xffe3,
0xfff9, 0xfffb,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11001, 0x11001,
0x11038, 0x11046,
- 0x11080, 0x11081,
+ 0x1107f, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x110bd, 0x110bd,
0x11100, 0x11102,
0x11127, 0x1112b,
0x1112d, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11181,
0x111b6, 0x111be,
+ 0x1122f, 0x11231,
+ 0x11234, 0x11234,
+ 0x11236, 0x11237,
+ 0x112df, 0x112df,
+ 0x112e3, 0x112ea,
+ 0x11301, 0x11301,
+ 0x1133c, 0x1133c,
+ 0x11340, 0x11340,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b3, 0x114b8,
+ 0x114ba, 0x114ba,
+ 0x114bf, 0x114c0,
+ 0x114c2, 0x114c3,
+ 0x115b2, 0x115b5,
+ 0x115bc, 0x115bd,
+ 0x115bf, 0x115c0,
+ 0x11633, 0x1163a,
+ 0x1163d, 0x1163d,
+ 0x1163f, 0x11640,
0x116ab, 0x116ab,
0x116ad, 0x116ad,
0x116b0, 0x116b5,
0x116b7, 0x116b7,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
+ 0x16b40, 0x16b43,
0x16f8f, 0x16f9f,
+ 0x1bc9d, 0x1bc9e,
+ 0x1bca0, 0x1bca3,
0x1d167, 0x1d169,
0x1d173, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1e8d0, 0x1e8d6,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
0xe0100, 0xe01ef,
@@ -10460,7 +11345,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
/* 'Changes_When_Lowercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 571,
+ 585,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -10608,6 +11493,7 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -10726,6 +11612,10 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x10a0, 0x10c5,
0x10c7, 0x10c7,
@@ -10975,6 +11865,8 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -11024,19 +11916,26 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b1,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x118a0, 0x118bf,
}; /* CR_Changes_When_Lowercased */
/* 'Changes_When_Uppercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 586,
+ 599,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -11183,20 +12082,21 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x024f, 0x0254,
0x0256, 0x0257,
0x0259, 0x0259,
- 0x025b, 0x025b,
- 0x0260, 0x0260,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
0x0263, 0x0263,
0x0265, 0x0266,
0x0268, 0x0269,
- 0x026b, 0x026b,
+ 0x026b, 0x026c,
0x026f, 0x026f,
0x0271, 0x0272,
0x0275, 0x0275,
0x027d, 0x027d,
0x0280, 0x0280,
0x0283, 0x0283,
- 0x0288, 0x028c,
+ 0x0287, 0x028c,
0x0292, 0x0292,
+ 0x029e, 0x029e,
0x0345, 0x0345,
0x0371, 0x0371,
0x0373, 0x0373,
@@ -11217,7 +12117,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x03e9, 0x03e9,
0x03eb, 0x03eb,
0x03ed, 0x03ed,
- 0x03ef, 0x03f2,
+ 0x03ef, 0x03f3,
0x03f5, 0x03f5,
0x03f8, 0x03f8,
0x03fb, 0x03fb,
@@ -11317,6 +12217,10 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
@@ -11566,6 +12470,8 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -11614,6 +12520,11 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa78c, 0xa78c,
0xa791, 0xa791,
0xa793, 0xa793,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -11623,11 +12534,12 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x118c0, 0x118df,
}; /* CR_Changes_When_Uppercased */
/* 'Changes_When_Titlecased': Derived Property */
static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 587,
+ 600,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -11775,20 +12687,21 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x024f, 0x0254,
0x0256, 0x0257,
0x0259, 0x0259,
- 0x025b, 0x025b,
- 0x0260, 0x0260,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
0x0263, 0x0263,
0x0265, 0x0266,
0x0268, 0x0269,
- 0x026b, 0x026b,
+ 0x026b, 0x026c,
0x026f, 0x026f,
0x0271, 0x0272,
0x0275, 0x0275,
0x027d, 0x027d,
0x0280, 0x0280,
0x0283, 0x0283,
- 0x0288, 0x028c,
+ 0x0287, 0x028c,
0x0292, 0x0292,
+ 0x029e, 0x029e,
0x0345, 0x0345,
0x0371, 0x0371,
0x0373, 0x0373,
@@ -11809,7 +12722,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x03e9, 0x03e9,
0x03eb, 0x03eb,
0x03ed, 0x03ed,
- 0x03ef, 0x03f2,
+ 0x03ef, 0x03f3,
0x03f5, 0x03f5,
0x03f8, 0x03f8,
0x03fb, 0x03fb,
@@ -11909,6 +12822,10 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x0523, 0x0523,
0x0525, 0x0525,
0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
0x0561, 0x0587,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
@@ -12158,6 +13075,8 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa693, 0xa693,
0xa695, 0xa695,
0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
0xa723, 0xa723,
0xa725, 0xa725,
0xa727, 0xa727,
@@ -12206,6 +13125,11 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa78c, 0xa78c,
0xa791, 0xa791,
0xa793, 0xa793,
+ 0xa797, 0xa797,
+ 0xa799, 0xa799,
+ 0xa79b, 0xa79b,
+ 0xa79d, 0xa79d,
+ 0xa79f, 0xa79f,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -12215,11 +13139,12 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xfb13, 0xfb17,
0xff41, 0xff5a,
0x10428, 0x1044f,
+ 0x118c0, 0x118df,
}; /* CR_Changes_When_Titlecased */
/* 'Changes_When_Casefolded': Derived Property */
static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 582,
+ 596,
0x0041, 0x005a,
0x00b5, 0x00b5,
0x00c0, 0x00d6,
@@ -12370,6 +13295,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0370, 0x0370,
0x0372, 0x0372,
0x0376, 0x0376,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
@@ -12491,6 +13417,10 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0522, 0x0522,
0x0524, 0x0524,
0x0526, 0x0526,
+ 0x0528, 0x0528,
+ 0x052a, 0x052a,
+ 0x052c, 0x052c,
+ 0x052e, 0x052e,
0x0531, 0x0556,
0x0587, 0x0587,
0x10a0, 0x10c5,
@@ -12743,6 +13673,8 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa692, 0xa692,
0xa694, 0xa694,
0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
0xa722, 0xa722,
0xa724, 0xa724,
0xa726, 0xa726,
@@ -12792,21 +13724,28 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa78d, 0xa78d,
0xa790, 0xa790,
0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7aa,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b1,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0x10400, 0x10427,
+ 0x118a0, 0x118bf,
}; /* CR_Changes_When_Casefolded */
/* 'Changes_When_Casemapped': Derived Property */
static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 104,
+ 107,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -12824,34 +13763,35 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x023a, 0x0254,
0x0256, 0x0257,
0x0259, 0x0259,
- 0x025b, 0x025b,
- 0x0260, 0x0260,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
0x0263, 0x0263,
0x0265, 0x0266,
0x0268, 0x0269,
- 0x026b, 0x026b,
+ 0x026b, 0x026c,
0x026f, 0x026f,
0x0271, 0x0272,
0x0275, 0x0275,
0x027d, 0x027d,
0x0280, 0x0280,
0x0283, 0x0283,
- 0x0288, 0x028c,
+ 0x0287, 0x028c,
0x0292, 0x0292,
+ 0x029e, 0x029e,
0x0345, 0x0345,
0x0370, 0x0373,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03d1,
- 0x03d5, 0x03f2,
- 0x03f4, 0x03f5,
+ 0x03d5, 0x03f5,
0x03f7, 0x03fb,
0x03fd, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
@@ -12899,23 +13839,25 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x2d27, 0x2d27,
0x2d2d, 0x2d2d,
0xa640, 0xa66d,
- 0xa680, 0xa697,
+ 0xa680, 0xa69b,
0xa722, 0xa72f,
0xa732, 0xa76f,
0xa779, 0xa787,
0xa78b, 0xa78d,
0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
+ 0xa796, 0xa7ad,
+ 0xa7b0, 0xa7b1,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
0xff41, 0xff5a,
0x10400, 0x1044f,
+ 0x118a0, 0x118df,
}; /* CR_Changes_When_Casemapped */
/* 'ID_Start': Derived Property */
static const OnigCodePoint CR_ID_Start[] = {
- 488,
+ 538,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -12931,13 +13873,14 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -12963,14 +13906,12 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b2,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
+ 0x0971, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -13025,8 +13966,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
0x0c58, 0x0c59,
0x0c60, 0x0c61,
@@ -13110,7 +14050,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -13124,7 +14064,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
@@ -13218,14 +14158,14 @@ static const OnigCodePoint CR_ID_Start[] = {
0xa610, 0xa61f,
0xa62a, 0xa62b,
0xa640, 0xa66e,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa6a0, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -13238,12 +14178,15 @@ static const OnigCodePoint CR_ID_Start[] = {
0xa960, 0xa97c,
0xa984, 0xa9b2,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -13257,6 +14200,9 @@ static const OnigCodePoint CR_ID_Start[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabe2,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -13296,19 +14242,27 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -13318,25 +14272,62 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -13367,6 +14358,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -13408,7 +14400,7 @@ static const OnigCodePoint CR_ID_Start[] = {
/* 'ID_Continue': Derived Property */
static const OnigCodePoint CR_ID_Continue[] = {
- 564,
+ 626,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -13427,13 +14419,14 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0300, 0x0374,
0x0376, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
0x0483, 0x0487,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -13457,14 +14450,10 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0963,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -13538,12 +14527,11 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
@@ -13551,7 +14539,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0c58, 0x0c59,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -13565,7 +14553,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -13586,6 +14574,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e4e,
@@ -13650,7 +14639,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1734,
@@ -13667,7 +14656,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1946, 0x196d,
@@ -13681,6 +14670,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abd,
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
@@ -13690,7 +14680,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
0x1cd4, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -13770,14 +14761,14 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xa610, 0xa62b,
0xa640, 0xa66f,
0xa674, 0xa67d,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa827,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -13788,12 +14779,12 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xa960, 0xa97c,
0xa980, 0xa9c0,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa7a, 0xaac2,
0xaadb, 0xaadd,
0xaae0, 0xaaef,
0xaaf2, 0xaaf6,
@@ -13802,6 +14793,9 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabea,
0xabec, 0xabed,
0xabf0, 0xabf9,
@@ -13824,7 +14818,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdfb,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xfe33, 0xfe34,
0xfe4d, 0xfe4f,
0xfe70, 0xfe74,
@@ -13849,20 +14843,29 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x101fd, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x102e0, 0x102e0,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -13875,29 +14878,78 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae6,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11000, 0x11046,
0x11066, 0x1106f,
- 0x11080, 0x110ba,
+ 0x1107f, 0x110ba,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
0x11180, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111d0, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x11237,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x11600, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af4,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -13935,6 +14987,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
+ 0x1e8d0, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -13977,7 +15031,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
/* 'XID_Start': Derived Property */
static const OnigCodePoint CR_XID_Start[] = {
- 495,
+ 545,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -13993,13 +15047,14 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0370, 0x0374,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x0386,
0x0388, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -14025,14 +15080,12 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b2,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
0x0958, 0x0961,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
+ 0x0971, 0x0980,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -14087,8 +15140,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
0x0c58, 0x0c59,
0x0c60, 0x0c61,
@@ -14172,7 +15224,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -14186,7 +15238,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1950, 0x196d,
0x1970, 0x1974,
0x1980, 0x19ab,
@@ -14280,14 +15332,14 @@ static const OnigCodePoint CR_XID_Start[] = {
0xa610, 0xa61f,
0xa62a, 0xa62b,
0xa640, 0xa66e,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa6a0, 0xa6ef,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -14300,12 +15352,15 @@ static const OnigCodePoint CR_XID_Start[] = {
0xa960, 0xa97c,
0xa984, 0xa9b2,
0xa9cf, 0xa9cf,
+ 0xa9e0, 0xa9e4,
+ 0xa9e6, 0xa9ef,
+ 0xa9fa, 0xa9fe,
0xaa00, 0xaa28,
0xaa40, 0xaa42,
0xaa44, 0xaa4b,
0xaa60, 0xaa76,
0xaa7a, 0xaa7a,
- 0xaa80, 0xaaaf,
+ 0xaa7e, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -14319,6 +15374,9 @@ static const OnigCodePoint CR_XID_Start[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabe2,
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
@@ -14365,19 +15423,27 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10140, 0x10174,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -14387,25 +15453,62 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10a15, 0x10a17,
0x10a19, 0x10a33,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae4,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
0x110d0, 0x110e8,
0x11103, 0x11126,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
0x11183, 0x111b2,
0x111c1, 0x111c4,
+ 0x111da, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122b,
+ 0x112b0, 0x112de,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x1135d, 0x11361,
+ 0x11480, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
0x11680, 0x116aa,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f50,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
0x1d49e, 0x1d49f,
@@ -14436,6 +15539,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1e800, 0x1e8c4,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -14477,7 +15581,7 @@ static const OnigCodePoint CR_XID_Start[] = {
/* 'XID_Continue': Derived Property */
static const OnigCodePoint CR_XID_Continue[] = {
- 571,
+ 633,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -14496,13 +15600,14 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0300, 0x0374,
0x0376, 0x0377,
0x037b, 0x037d,
+ 0x037f, 0x037f,
0x0386, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x03f5,
0x03f7, 0x0481,
0x0483, 0x0487,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x0559,
0x0561, 0x0587,
@@ -14526,14 +15631,10 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0963,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0963,
0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
+ 0x0971, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -14607,12 +15708,11 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0bd0, 0x0bd0,
0x0bd7, 0x0bd7,
0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
@@ -14620,7 +15720,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0c58, 0x0c59,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -14634,7 +15734,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0ce0, 0x0ce3,
0x0ce6, 0x0cef,
0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -14655,6 +15755,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df3,
0x0e01, 0x0e3a,
0x0e40, 0x0e4e,
@@ -14719,7 +15820,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x166f, 0x167f,
0x1681, 0x169a,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1714,
0x1720, 0x1734,
@@ -14736,7 +15837,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1820, 0x1877,
0x1880, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1946, 0x196d,
@@ -14750,6 +15851,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abd,
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
@@ -14759,7 +15861,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
0x1cd4, 0x1cf6,
- 0x1d00, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
0x1f20, 0x1f45,
@@ -14840,14 +15943,14 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xa610, 0xa62b,
0xa640, 0xa66f,
0xa674, 0xa67d,
- 0xa67f, 0xa697,
+ 0xa67f, 0xa69d,
0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa827,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -14858,12 +15961,12 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xa960, 0xa97c,
0xa980, 0xa9c0,
0xa9cf, 0xa9d9,
+ 0xa9e0, 0xa9fe,
0xaa00, 0xaa36,
0xaa40, 0xaa4d,
0xaa50, 0xaa59,
0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
+ 0xaa7a, 0xaac2,
0xaadb, 0xaadd,
0xaae0, 0xaaef,
0xaaf2, 0xaaf6,
@@ -14872,6 +15975,9 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabea,
0xabec, 0xabed,
0xabf0, 0xabf9,
@@ -14895,7 +16001,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xfd92, 0xfdc7,
0xfdf0, 0xfdf9,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xfe33, 0xfe34,
0xfe4d, 0xfe4f,
0xfe71, 0xfe71,
@@ -14925,20 +16031,29 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x101fd, 0x101fd,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
+ 0x102e0, 0x102e0,
+ 0x10300, 0x1031f,
0x10330, 0x1034a,
+ 0x10350, 0x1037a,
0x10380, 0x1039d,
0x103a0, 0x103c3,
0x103c8, 0x103cf,
0x103d1, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
0x10900, 0x10915,
0x10920, 0x10939,
0x10980, 0x109b7,
@@ -14951,29 +16066,78 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
0x10a60, 0x10a7c,
+ 0x10a80, 0x10a9c,
+ 0x10ac0, 0x10ac7,
+ 0x10ac9, 0x10ae6,
0x10b00, 0x10b35,
0x10b40, 0x10b55,
0x10b60, 0x10b72,
+ 0x10b80, 0x10b91,
0x10c00, 0x10c48,
0x11000, 0x11046,
0x11066, 0x1106f,
- 0x11080, 0x110ba,
+ 0x1107f, 0x110ba,
0x110d0, 0x110e8,
0x110f0, 0x110f9,
0x11100, 0x11134,
0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
0x11180, 0x111c4,
- 0x111d0, 0x111d9,
+ 0x111d0, 0x111da,
+ 0x11200, 0x11211,
+ 0x11213, 0x11237,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c0,
+ 0x11600, 0x11640,
+ 0x11644, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116b7,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
+ 0x118a0, 0x118e9,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af4,
+ 0x16b00, 0x16b36,
+ 0x16b40, 0x16b43,
+ 0x16b50, 0x16b59,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -15011,6 +16175,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
+ 0x1e8d0, 0x1e8d6,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -15053,12 +16219,13 @@ static const OnigCodePoint CR_XID_Continue[] = {
/* 'Default_Ignorable_Code_Point': Derived Property */
static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
- 15,
+ 17,
0x00ad, 0x00ad,
0x034f, 0x034f,
+ 0x061c, 0x061c,
0x115f, 0x1160,
0x17b4, 0x17b5,
- 0x180b, 0x180d,
+ 0x180b, 0x180e,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x206f,
@@ -15067,13 +16234,14 @@ static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
0xfeff, 0xfeff,
0xffa0, 0xffa0,
0xfff0, 0xfff8,
+ 0x1bca0, 0x1bca3,
0x1d173, 0x1d17a,
0xe0000, 0xe0fff,
}; /* CR_Default_Ignorable_Code_Point */
/* 'Grapheme_Extend': Derived Property */
static const OnigCodePoint CR_Grapheme_Extend[] = {
- 232,
+ 272,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -15097,8 +16265,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
- 0x08e4, 0x08fe,
- 0x0900, 0x0902,
+ 0x08e4, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
0x0941, 0x0948,
@@ -15138,11 +16305,13 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0bc0, 0x0bc0,
0x0bcd, 0x0bcd,
0x0bd7, 0x0bd7,
+ 0x0c00, 0x0c00,
0x0c3e, 0x0c40,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
+ 0x0c81, 0x0c81,
0x0cbc, 0x0cbc,
0x0cbf, 0x0cbf,
0x0cc2, 0x0cc2,
@@ -15150,6 +16319,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0ccc, 0x0ccd,
0x0cd5, 0x0cd6,
0x0ce2, 0x0ce3,
+ 0x0d01, 0x0d01,
0x0d3e, 0x0d3e,
0x0d41, 0x0d44,
0x0d4d, 0x0d4d,
@@ -15205,6 +16375,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1932, 0x1932,
0x1939, 0x193b,
0x1a17, 0x1a18,
+ 0x1a1b, 0x1a1b,
0x1a56, 0x1a56,
0x1a58, 0x1a5e,
0x1a60, 0x1a60,
@@ -15212,6 +16383,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1a65, 0x1a6c,
0x1a73, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abe,
0x1b00, 0x1b03,
0x1b34, 0x1b34,
0x1b36, 0x1b3a,
@@ -15221,7 +16393,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
- 0x1bab, 0x1bab,
+ 0x1bab, 0x1bad,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -15233,7 +16405,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x200c, 0x200d,
0x20d0, 0x20f0,
@@ -15258,11 +16431,13 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xa9b3, 0xa9b3,
0xa9b6, 0xa9b9,
0xa9bc, 0xa9bc,
+ 0xa9e5, 0xa9e5,
0xaa29, 0xaa2e,
0xaa31, 0xaa32,
0xaa35, 0xaa36,
0xaa43, 0xaa43,
0xaa4c, 0xaa4c,
+ 0xaa7c, 0xaa7c,
0xaab0, 0xaab0,
0xaab2, 0xaab4,
0xaab7, 0xaab8,
@@ -15275,29 +16450,61 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xabed, 0xabed,
0xfb1e, 0xfb1e,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xff9e, 0xff9f,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
0x10a38, 0x10a3a,
0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
0x11001, 0x11001,
0x11038, 0x11046,
- 0x11080, 0x11081,
+ 0x1107f, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x11100, 0x11102,
0x11127, 0x1112b,
0x1112d, 0x11134,
+ 0x11173, 0x11173,
0x11180, 0x11181,
0x111b6, 0x111be,
+ 0x1122f, 0x11231,
+ 0x11234, 0x11234,
+ 0x11236, 0x11237,
+ 0x112df, 0x112df,
+ 0x112e3, 0x112ea,
+ 0x11301, 0x11301,
+ 0x1133c, 0x1133c,
+ 0x1133e, 0x1133e,
+ 0x11340, 0x11340,
+ 0x11357, 0x11357,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114b0, 0x114b0,
+ 0x114b3, 0x114b8,
+ 0x114ba, 0x114ba,
+ 0x114bd, 0x114bd,
+ 0x114bf, 0x114c0,
+ 0x114c2, 0x114c3,
+ 0x115af, 0x115af,
+ 0x115b2, 0x115b5,
+ 0x115bc, 0x115bd,
+ 0x115bf, 0x115c0,
+ 0x11633, 0x1163a,
+ 0x1163d, 0x1163d,
+ 0x1163f, 0x11640,
0x116ab, 0x116ab,
0x116ad, 0x116ad,
0x116b0, 0x116b5,
0x116b7, 0x116b7,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
0x16f8f, 0x16f92,
+ 0x1bc9d, 0x1bc9e,
0x1d165, 0x1d165,
0x1d167, 0x1d169,
0x1d16e, 0x1d172,
@@ -15305,27 +16512,28 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
0x1d242, 0x1d244,
+ 0x1e8d0, 0x1e8d6,
0xe0100, 0xe01ef,
}; /* CR_Grapheme_Extend */
/* 'Grapheme_Base': Derived Property */
static const OnigCodePoint CR_Grapheme_Base[] = {
- 643,
+ 724,
0x0020, 0x007e,
0x00a0, 0x00ac,
0x00ae, 0x02ff,
0x0370, 0x0377,
- 0x037a, 0x037e,
+ 0x037a, 0x037f,
0x0384, 0x038a,
0x038c, 0x038c,
0x038e, 0x03a1,
0x03a3, 0x0482,
- 0x048a, 0x0527,
+ 0x048a, 0x052f,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0x05be, 0x05be,
0x05c0, 0x05c0,
0x05c3, 0x05c3,
@@ -15354,16 +16562,14 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0830, 0x083e,
0x0840, 0x0858,
0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
+ 0x08a0, 0x08b2,
0x0903, 0x0939,
0x093b, 0x093b,
0x093d, 0x0940,
0x0949, 0x094c,
0x094e, 0x0950,
0x0958, 0x0961,
- 0x0964, 0x0977,
- 0x0979, 0x097f,
+ 0x0964, 0x0980,
0x0982, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
@@ -15439,8 +16645,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c3d,
0x0c41, 0x0c44,
0x0c58, 0x0c59,
@@ -15482,6 +16687,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0dc0, 0x0dc6,
0x0dd0, 0x0dd1,
0x0dd8, 0x0dde,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
0x0e01, 0x0e30,
0x0e32, 0x0e33,
@@ -15551,7 +16757,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1380, 0x1399,
0x13a0, 0x13f4,
0x1400, 0x169c,
- 0x16a0, 0x16f0,
+ 0x16a0, 0x16f8,
0x1700, 0x170c,
0x170e, 0x1711,
0x1720, 0x1731,
@@ -15567,13 +16773,12 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x17e0, 0x17e9,
0x17f0, 0x17f9,
0x1800, 0x180a,
- 0x180e, 0x180e,
0x1810, 0x1819,
0x1820, 0x1877,
0x1880, 0x18a8,
0x18aa, 0x18aa,
0x18b0, 0x18f5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1923, 0x1926,
0x1929, 0x192b,
0x1930, 0x1931,
@@ -15585,7 +16790,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x19b0, 0x19c9,
0x19d0, 0x19da,
0x19de, 0x1a16,
- 0x1a19, 0x1a1b,
+ 0x1a19, 0x1a1a,
0x1a1e, 0x1a55,
0x1a57, 0x1a57,
0x1a61, 0x1a61,
@@ -15604,7 +16809,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1b82, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bac, 0x1be5,
+ 0x1bae, 0x1be5,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -15642,14 +16847,16 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2070, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20bd,
0x2100, 0x2189,
- 0x2190, 0x23f3,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cee,
@@ -15668,7 +16875,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2e00, 0x2e3b,
+ 0x2e00, 0x2e42,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -15690,13 +16897,13 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa4d0, 0xa62b,
0xa640, 0xa66e,
0xa673, 0xa673,
- 0xa67e, 0xa697,
+ 0xa67e, 0xa69d,
0xa6a0, 0xa6ef,
0xa6f2, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa801,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa824,
@@ -15715,7 +16922,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa9ba, 0xa9bb,
0xa9bd, 0xa9cd,
0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
+ 0xa9de, 0xa9e4,
+ 0xa9e6, 0xa9fe,
0xaa00, 0xaa28,
0xaa2f, 0xaa30,
0xaa33, 0xaa34,
@@ -15724,7 +16932,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xaa4d, 0xaa4d,
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
- 0xaa80, 0xaaaf,
+ 0xaa7d, 0xaaaf,
0xaab1, 0xaab1,
0xaab5, 0xaab6,
0xaab9, 0xaabd,
@@ -15737,6 +16945,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xab11, 0xab16,
0xab20, 0xab26,
0xab28, 0xab2e,
+ 0xab30, 0xab5f,
+ 0xab64, 0xab65,
0xabc0, 0xabe4,
0xabe6, 0xabe7,
0xabe9, 0xabec,
@@ -15783,26 +16993,35 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x10080, 0x100fa,
0x10100, 0x10102,
0x10107, 0x10133,
- 0x10137, 0x1018a,
+ 0x10137, 0x1018c,
0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
0x101d0, 0x101fc,
0x10280, 0x1029c,
0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 0x102e1, 0x102fb,
+ 0x10300, 0x10323,
0x10330, 0x1034a,
+ 0x10350, 0x10375,
0x10380, 0x1039d,
0x1039f, 0x103c3,
0x103c8, 0x103d5,
0x10400, 0x1049d,
0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
0x10800, 0x10805,
0x10808, 0x10808,
0x1080a, 0x10835,
0x10837, 0x10838,
0x1083c, 0x1083c,
0x1083f, 0x10855,
- 0x10857, 0x1085f,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
@@ -15814,11 +17033,15 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x10a19, 0x10a33,
0x10a40, 0x10a47,
0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae4,
+ 0x10aeb, 0x10af6,
0x10b00, 0x10b35,
0x10b39, 0x10b55,
0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
0x10c00, 0x10c48,
0x10e60, 0x10e7e,
0x11000, 0x11000,
@@ -15834,23 +17057,86 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x11103, 0x11126,
0x1112c, 0x1112c,
0x11136, 0x11143,
+ 0x11150, 0x11172,
+ 0x11174, 0x11176,
0x11182, 0x111b5,
0x111bf, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1122e,
+ 0x11232, 0x11233,
+ 0x11235, 0x11235,
+ 0x11238, 0x1123d,
+ 0x112b0, 0x112de,
+ 0x112e0, 0x112e2,
+ 0x112f0, 0x112f9,
+ 0x11302, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133d, 0x1133d,
+ 0x1133f, 0x1133f,
+ 0x11341, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x1135d, 0x11363,
+ 0x11480, 0x114af,
+ 0x114b1, 0x114b2,
+ 0x114b9, 0x114b9,
+ 0x114bb, 0x114bc,
+ 0x114be, 0x114be,
+ 0x114c1, 0x114c1,
+ 0x114c4, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115ae,
+ 0x115b0, 0x115b1,
+ 0x115b8, 0x115bb,
+ 0x115be, 0x115be,
+ 0x115c1, 0x115c9,
+ 0x11600, 0x11632,
+ 0x1163b, 0x1163c,
+ 0x1163e, 0x1163e,
+ 0x11641, 0x11644,
+ 0x11650, 0x11659,
0x11680, 0x116aa,
0x116ac, 0x116ac,
0x116ae, 0x116af,
0x116b6, 0x116b6,
0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af5, 0x16af5,
+ 0x16b00, 0x16b2f,
+ 0x16b37, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
0x16f00, 0x16f44,
0x16f50, 0x16f7e,
0x16f93, 0x16f9f,
0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bc9c,
+ 0x1bc9f, 0x1bc9f,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d164,
@@ -15884,6 +17170,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8cf,
0x1ee00, 0x1ee03,
0x1ee05, 0x1ee1f,
0x1ee21, 0x1ee22,
@@ -15921,10 +17209,10 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -15932,24 +17220,25 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
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,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -15958,7 +17247,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
/* 'Grapheme_Link': Derived Property */
static const OnigCodePoint CR_Grapheme_Link[] = {
- 33,
+ 40,
0x094d, 0x094d,
0x09cd, 0x09cd,
0x0a4d, 0x0a4d,
@@ -15988,15 +17277,22 @@ static const OnigCodePoint CR_Grapheme_Link[] = {
0xabed, 0xabed,
0x10a3f, 0x10a3f,
0x11046, 0x11046,
+ 0x1107f, 0x1107f,
0x110b9, 0x110b9,
0x11133, 0x11134,
0x111c0, 0x111c0,
+ 0x11235, 0x11235,
+ 0x112ea, 0x112ea,
+ 0x1134d, 0x1134d,
+ 0x114c2, 0x114c2,
+ 0x115bf, 0x115bf,
+ 0x1163f, 0x1163f,
0x116b6, 0x116b6,
}; /* CR_Grapheme_Link */
/* 'Common': Script */
static const OnigCodePoint CR_Common[] = {
- 157,
+ 165,
0x0000, 0x0040,
0x005b, 0x0060,
0x007b, 0x00a9,
@@ -16012,8 +17308,9 @@ static const OnigCodePoint CR_Common[] = {
0x0385, 0x0385,
0x0387, 0x0387,
0x0589, 0x0589,
+ 0x0605, 0x0605,
0x060c, 0x060c,
- 0x061b, 0x061b,
+ 0x061b, 0x061c,
0x061f, 0x061f,
0x0640, 0x0640,
0x0660, 0x0669,
@@ -16033,24 +17330,26 @@ static const OnigCodePoint CR_Common[] = {
0x1cf5, 0x1cf6,
0x2000, 0x200b,
0x200e, 0x2064,
- 0x206a, 0x2070,
+ 0x2066, 0x2070,
0x2074, 0x207e,
0x2080, 0x208e,
- 0x20a0, 0x20b9,
+ 0x20a0, 0x20bd,
0x2100, 0x2125,
0x2127, 0x2129,
0x212c, 0x2131,
0x2133, 0x214d,
0x214f, 0x215f,
0x2189, 0x2189,
- 0x2190, 0x23f3,
+ 0x2190, 0x23fa,
0x2400, 0x2426,
0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x27ff,
- 0x2900, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2e00, 0x2e3b,
+ 0x2460, 0x27ff,
+ 0x2900, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2e00, 0x2e42,
0x2ff0, 0x2ffb,
0x3000, 0x3004,
0x3006, 0x3006,
@@ -16069,8 +17368,10 @@ static const OnigCodePoint CR_Common[] = {
0xa700, 0xa721,
0xa788, 0xa78a,
0xa830, 0xa839,
+ 0xa92e, 0xa92e,
+ 0xa9cf, 0xa9cf,
+ 0xab5b, 0xab5b,
0xfd3e, 0xfd3f,
- 0xfdfd, 0xfdfd,
0xfe10, 0xfe19,
0xfe30, 0xfe52,
0xfe54, 0xfe66,
@@ -16089,6 +17390,8 @@ static const OnigCodePoint CR_Common[] = {
0x10137, 0x1013f,
0x10190, 0x1019b,
0x101d0, 0x101fc,
+ 0x102e1, 0x102fb,
+ 0x1bca0, 0x1bca3,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
0x1d129, 0x1d166,
@@ -16122,10 +17425,10 @@ static const OnigCodePoint CR_Common[] = {
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
+ 0x1f0b1, 0x1f0bf,
0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
0x1f110, 0x1f12e,
0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
@@ -16134,31 +17437,32 @@ static const OnigCodePoint CR_Common[] = {
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,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
}; /* CR_Common */
/* 'Latin': Script */
static const OnigCodePoint CR_Latin[] = {
- 30,
+ 33,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -16183,9 +17487,12 @@ static const OnigCodePoint CR_Latin[] = {
0x2c60, 0x2c7f,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa7ff,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa7ff,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab64,
0xfb00, 0xfb06,
0xff21, 0xff3a,
0xff41, 0xff5a,
@@ -16193,10 +17500,11 @@ static const OnigCodePoint CR_Latin[] = {
/* 'Greek': Script */
static const OnigCodePoint CR_Greek[] = {
- 33,
+ 36,
0x0370, 0x0373,
0x0375, 0x0377,
0x037a, 0x037d,
+ 0x037f, 0x037f,
0x0384, 0x0384,
0x0386, 0x0386,
0x0388, 0x038a,
@@ -16225,7 +17533,9 @@ static const OnigCodePoint CR_Greek[] = {
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
0x2126, 0x2126,
- 0x10140, 0x1018a,
+ 0xab65, 0xab65,
+ 0x10140, 0x1018c,
+ 0x101a0, 0x101a0,
0x1d200, 0x1d245,
}; /* CR_Greek */
@@ -16233,11 +17543,11 @@ static const OnigCodePoint CR_Greek[] = {
static const OnigCodePoint CR_Cyrillic[] = {
7,
0x0400, 0x0484,
- 0x0487, 0x0527,
+ 0x0487, 0x052f,
0x1d2b, 0x1d2b,
0x1d78, 0x1d78,
0x2de0, 0x2dff,
- 0xa640, 0xa697,
+ 0xa640, 0xa69d,
0xa69f, 0xa69f,
}; /* CR_Cyrillic */
@@ -16248,7 +17558,7 @@ static const OnigCodePoint CR_Armenian[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x058a, 0x058a,
- 0x058f, 0x058f,
+ 0x058d, 0x058f,
0xfb13, 0xfb17,
}; /* CR_Armenian */
@@ -16268,26 +17578,25 @@ static const OnigCodePoint CR_Hebrew[] = {
/* 'Arabic': Script */
static const OnigCodePoint CR_Arabic[] = {
- 56,
+ 55,
0x0600, 0x0604,
0x0606, 0x060b,
0x060d, 0x061a,
0x061e, 0x061e,
0x0620, 0x063f,
0x0641, 0x064a,
- 0x0656, 0x065e,
+ 0x0656, 0x065f,
0x066a, 0x066f,
0x0671, 0x06dc,
0x06de, 0x06ff,
0x0750, 0x077f,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x08ff,
0xfb50, 0xfbc1,
0xfbd3, 0xfd3d,
0xfd50, 0xfd8f,
0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfc,
+ 0xfdf0, 0xfdfd,
0xfe70, 0xfe74,
0xfe76, 0xfefc,
0x10e60, 0x10e7e,
@@ -16343,18 +17652,17 @@ static const OnigCodePoint CR_Thaana[] = {
/* 'Devanagari': Script */
static const OnigCodePoint CR_Devanagari[] = {
- 5,
+ 4,
0x0900, 0x0950,
0x0953, 0x0963,
- 0x0966, 0x0977,
- 0x0979, 0x097f,
+ 0x0966, 0x097f,
0xa8e0, 0xa8fb,
}; /* CR_Devanagari */
/* 'Bengali': Script */
static const OnigCodePoint CR_Bengali[] = {
14,
- 0x0981, 0x0983,
+ 0x0980, 0x0983,
0x0985, 0x098c,
0x098f, 0x0990,
0x0993, 0x09a8,
@@ -16451,13 +17759,12 @@ static const OnigCodePoint CR_Tamil[] = {
/* 'Telugu': Script */
static const OnigCodePoint CR_Telugu[] = {
- 14,
- 0x0c01, 0x0c03,
+ 13,
+ 0x0c00, 0x0c03,
0x0c05, 0x0c0c,
0x0c0e, 0x0c10,
0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
+ 0x0c2a, 0x0c39,
0x0c3d, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4d,
@@ -16471,7 +17778,7 @@ static const OnigCodePoint CR_Telugu[] = {
/* 'Kannada': Script */
static const OnigCodePoint CR_Kannada[] = {
14,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0c85, 0x0c8c,
0x0c8e, 0x0c90,
0x0c92, 0x0ca8,
@@ -16490,7 +17797,7 @@ static const OnigCodePoint CR_Kannada[] = {
/* 'Malayalam': Script */
static const OnigCodePoint CR_Malayalam[] = {
11,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d05, 0x0d0c,
0x0d0e, 0x0d10,
0x0d12, 0x0d3a,
@@ -16505,7 +17812,7 @@ static const OnigCodePoint CR_Malayalam[] = {
/* 'Sinhala': Script */
static const OnigCodePoint CR_Sinhala[] = {
- 11,
+ 13,
0x0d82, 0x0d83,
0x0d85, 0x0d96,
0x0d9a, 0x0db1,
@@ -16516,7 +17823,9 @@ static const OnigCodePoint CR_Sinhala[] = {
0x0dcf, 0x0dd4,
0x0dd6, 0x0dd6,
0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
0x0df2, 0x0df4,
+ 0x111e1, 0x111f4,
}; /* CR_Sinhala */
/* 'Thai': Script */
@@ -16563,9 +17872,10 @@ static const OnigCodePoint CR_Tibetan[] = {
/* 'Myanmar': Script */
static const OnigCodePoint CR_Myanmar[] = {
- 2,
+ 3,
0x1000, 0x109f,
- 0xaa60, 0xaa7b,
+ 0xa9e0, 0xa9fe,
+ 0xaa60, 0xaa7f,
}; /* CR_Myanmar */
/* 'Georgian': Script */
@@ -16660,7 +17970,7 @@ static const OnigCodePoint CR_Ogham[] = {
static const OnigCodePoint CR_Runic[] = {
2,
0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
+ 0x16ee, 0x16f8,
}; /* CR_Runic */
/* 'Khmer': Script */
@@ -16742,9 +18052,8 @@ static const OnigCodePoint CR_Yi[] = {
/* 'Old_Italic': Script */
static const OnigCodePoint CR_Old_Italic[] = {
- 2,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
+ 1,
+ 0x10300, 0x10323,
}; /* CR_Old_Italic */
/* 'Gothic': Script */
@@ -16761,27 +18070,29 @@ static const OnigCodePoint CR_Deseret[] = {
/* 'Inherited': Script */
static const OnigCodePoint CR_Inherited[] = {
- 25,
+ 27,
0x0300, 0x036f,
0x0485, 0x0486,
0x064b, 0x0655,
- 0x065f, 0x065f,
0x0670, 0x0670,
0x0951, 0x0952,
+ 0x1ab0, 0x1abe,
0x1cd0, 0x1cd2,
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
- 0x1dc0, 0x1de6,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
0x1dfc, 0x1dff,
0x200c, 0x200d,
0x20d0, 0x20f0,
0x302a, 0x302d,
0x3099, 0x309a,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
@@ -16819,7 +18130,7 @@ static const OnigCodePoint CR_Tagbanwa[] = {
/* 'Limbu': Script */
static const OnigCodePoint CR_Limbu[] = {
5,
- 0x1900, 0x191c,
+ 0x1900, 0x191e,
0x1920, 0x192b,
0x1930, 0x193b,
0x1940, 0x1940,
@@ -16957,9 +18268,9 @@ static const OnigCodePoint CR_Balinese[] = {
/* 'Cuneiform': Script */
static const OnigCodePoint CR_Cuneiform[] = {
3,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
}; /* CR_Cuneiform */
/* 'Phoenician': Script */
@@ -17017,8 +18328,9 @@ static const OnigCodePoint CR_Saurashtra[] = {
/* 'Kayah_Li': Script */
static const OnigCodePoint CR_Kayah_Li[] = {
- 1,
- 0xa900, 0xa92f,
+ 2,
+ 0xa900, 0xa92d,
+ 0xa92f, 0xa92f,
}; /* CR_Kayah_Li */
/* 'Rejang': Script */
@@ -17110,7 +18422,7 @@ static const OnigCodePoint CR_Bamum[] = {
static const OnigCodePoint CR_Javanese[] = {
3,
0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
+ 0xa9d0, 0xa9d9,
0xa9de, 0xa9df,
}; /* CR_Javanese */
@@ -17170,9 +18482,10 @@ static const OnigCodePoint CR_Batak[] = {
/* 'Brahmi': Script */
static const OnigCodePoint CR_Brahmi[] = {
- 2,
+ 3,
0x11000, 0x1104d,
0x11052, 0x1106f,
+ 0x1107f, 0x1107f,
}; /* CR_Brahmi */
/* 'Mandaic': Script */
@@ -17212,9 +18525,10 @@ static const OnigCodePoint CR_Miao[] = {
/* 'Sharada': Script */
static const OnigCodePoint CR_Sharada[] = {
- 2,
+ 3,
0x11180, 0x111c8,
- 0x111d0, 0x111d9,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
}; /* CR_Sharada */
/* 'Sora_Sompeng': Script */
@@ -17231,14 +18545,192 @@ static const OnigCodePoint CR_Takri[] = {
0x116c0, 0x116c9,
}; /* CR_Takri */
+/* 'Caucasian_Albanian': Script */
+static const OnigCodePoint CR_Caucasian_Albanian[] = {
+ 2,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+}; /* CR_Caucasian_Albanian */
+
+/* 'Bassa_Vah': Script */
+static const OnigCodePoint CR_Bassa_Vah[] = {
+ 2,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+}; /* CR_Bassa_Vah */
+
+/* 'Duployan': Script */
+static const OnigCodePoint CR_Duployan[] = {
+ 5,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bc9f,
+}; /* CR_Duployan */
+
+/* 'Elbasan': Script */
+static const OnigCodePoint CR_Elbasan[] = {
+ 1,
+ 0x10500, 0x10527,
+}; /* CR_Elbasan */
+
+/* 'Grantha': Script */
+static const OnigCodePoint CR_Grantha[] = {
+ 14,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+}; /* CR_Grantha */
+
+/* 'Pahawh_Hmong': Script */
+static const OnigCodePoint CR_Pahawh_Hmong[] = {
+ 5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
+}; /* CR_Pahawh_Hmong */
+
+/* 'Khojki': Script */
+static const OnigCodePoint CR_Khojki[] = {
+ 2,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+}; /* CR_Khojki */
+
+/* 'Linear_A': Script */
+static const OnigCodePoint CR_Linear_A[] = {
+ 3,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
+}; /* CR_Linear_A */
+
+/* 'Mahajani': Script */
+static const OnigCodePoint CR_Mahajani[] = {
+ 1,
+ 0x11150, 0x11176,
+}; /* CR_Mahajani */
+
+/* 'Manichaean': Script */
+static const OnigCodePoint CR_Manichaean[] = {
+ 2,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
+}; /* CR_Manichaean */
+
+/* 'Mende_Kikakui': Script */
+static const OnigCodePoint CR_Mende_Kikakui[] = {
+ 2,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
+}; /* CR_Mende_Kikakui */
+
+/* 'Modi': Script */
+static const OnigCodePoint CR_Modi[] = {
+ 2,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
+}; /* CR_Modi */
+
+/* 'Mro': Script */
+static const OnigCodePoint CR_Mro[] = {
+ 3,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+}; /* CR_Mro */
+
+/* 'Old_North_Arabian': Script */
+static const OnigCodePoint CR_Old_North_Arabian[] = {
+ 1,
+ 0x10a80, 0x10a9f,
+}; /* CR_Old_North_Arabian */
+
+/* 'Nabataean': Script */
+static const OnigCodePoint CR_Nabataean[] = {
+ 2,
+ 0x10880, 0x1089e,
+ 0x108a7, 0x108af,
+}; /* CR_Nabataean */
+
+/* 'Palmyrene': Script */
+static const OnigCodePoint CR_Palmyrene[] = {
+ 1,
+ 0x10860, 0x1087f,
+}; /* CR_Palmyrene */
+
+/* 'Pau_Cin_Hau': Script */
+static const OnigCodePoint CR_Pau_Cin_Hau[] = {
+ 1,
+ 0x11ac0, 0x11af8,
+}; /* CR_Pau_Cin_Hau */
+
+/* 'Old_Permic': Script */
+static const OnigCodePoint CR_Old_Permic[] = {
+ 1,
+ 0x10350, 0x1037a,
+}; /* CR_Old_Permic */
+
+/* 'Psalter_Pahlavi': Script */
+static const OnigCodePoint CR_Psalter_Pahlavi[] = {
+ 3,
+ 0x10b80, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
+}; /* CR_Psalter_Pahlavi */
+
+/* 'Siddham': Script */
+static const OnigCodePoint CR_Siddham[] = {
+ 2,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c9,
+}; /* CR_Siddham */
+
+/* 'Khudawadi': Script */
+static const OnigCodePoint CR_Khudawadi[] = {
+ 2,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+}; /* CR_Khudawadi */
+
+/* 'Tirhuta': Script */
+static const OnigCodePoint CR_Tirhuta[] = {
+ 2,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+}; /* CR_Tirhuta */
+
+/* 'Warang_Citi': Script */
+static const OnigCodePoint CR_Warang_Citi[] = {
+ 2,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+}; /* CR_Warang_Citi */
+
/* 'White_Space': Binary Property */
#define CR_White_Space CR_Space
/* 'Bidi_Control': Binary Property */
static const OnigCodePoint CR_Bidi_Control[] = {
- 2,
+ 4,
+ 0x061c, 0x061c,
0x200e, 0x200f,
0x202a, 0x202e,
+ 0x2066, 0x2069,
}; /* CR_Bidi_Control */
/* 'Join_Control': Binary Property */
@@ -17249,7 +18741,7 @@ static const OnigCodePoint CR_Join_Control[] = {
/* 'Dash': Binary Property */
static const OnigCodePoint CR_Dash[] = {
- 20,
+ 21,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -17263,6 +18755,7 @@ static const OnigCodePoint CR_Dash[] = {
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
0x2e3a, 0x2e3b,
+ 0x2e40, 0x2e40,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -17289,13 +18782,14 @@ static const OnigCodePoint CR_Hyphen[] = {
/* 'Quotation_Mark': Binary Property */
static const OnigCodePoint CR_Quotation_Mark[] = {
- 12,
+ 13,
0x0022, 0x0022,
0x0027, 0x0027,
0x00ab, 0x00ab,
0x00bb, 0x00bb,
0x2018, 0x201f,
0x2039, 0x203a,
+ 0x2e42, 0x2e42,
0x300c, 0x300f,
0x301d, 0x301f,
0xfe41, 0xfe44,
@@ -17306,7 +18800,7 @@ static const OnigCodePoint CR_Quotation_Mark[] = {
/* 'Terminal_Punctuation': Binary Property */
static const OnigCodePoint CR_Terminal_Punctuation[] = {
- 70,
+ 86,
0x0021, 0x0021,
0x002c, 0x002c,
0x002e, 0x002e,
@@ -17333,6 +18827,7 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x1361, 0x1368,
0x166d, 0x166e,
0x16eb, 0x16ed,
+ 0x1735, 0x1736,
0x17d4, 0x17d6,
0x17da, 0x17da,
0x1802, 0x1805,
@@ -17346,6 +18841,8 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x203c, 0x203d,
0x2047, 0x2049,
0x2e2e, 0x2e2e,
+ 0x2e3c, 0x2e3c,
+ 0x2e41, 0x2e41,
0x3001, 0x3002,
0xa4fe, 0xa4ff,
0xa60d, 0xa60f,
@@ -17371,17 +18868,30 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x103d0, 0x103d0,
0x10857, 0x10857,
0x1091f, 0x1091f,
+ 0x10a56, 0x10a57,
+ 0x10af0, 0x10af5,
0x10b3a, 0x10b3f,
+ 0x10b99, 0x10b9c,
0x11047, 0x1104d,
0x110be, 0x110c1,
0x11141, 0x11143,
0x111c5, 0x111c6,
- 0x12470, 0x12473,
+ 0x111cd, 0x111cd,
+ 0x11238, 0x1123c,
+ 0x115c2, 0x115c5,
+ 0x115c9, 0x115c9,
+ 0x11641, 0x11642,
+ 0x12470, 0x12474,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b39,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
}; /* CR_Terminal_Punctuation */
/* 'Other_Math': Binary Property */
static const OnigCodePoint CR_Other_Math[] = {
- 133,
+ 134,
0x005e, 0x005e,
0x03d0, 0x03d2,
0x03d5, 0x03d5,
@@ -17423,6 +18933,7 @@ static const OnigCodePoint CR_Other_Math[] = {
0x21d5, 0x21db,
0x21dd, 0x21dd,
0x21e4, 0x21e5,
+ 0x2308, 0x230b,
0x23b4, 0x23b5,
0x23b7, 0x23b7,
0x23d0, 0x23d0,
@@ -17533,7 +19044,7 @@ static const OnigCodePoint CR_Hex_Digit[] = {
/* 'Other_Alphabetic': Binary Property */
static const OnigCodePoint CR_Other_Alphabetic[] = {
- 158,
+ 178,
0x0345, 0x0345,
0x05b0, 0x05bd,
0x05bf, 0x05bf,
@@ -17556,8 +19067,7 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x0825, 0x0827,
0x0829, 0x082c,
0x08e4, 0x08e9,
- 0x08f0, 0x08fe,
- 0x0900, 0x0903,
+ 0x08f0, 0x0903,
0x093a, 0x093b,
0x093e, 0x094c,
0x094e, 0x094f,
@@ -17592,19 +19102,19 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x0bc6, 0x0bc8,
0x0bca, 0x0bcc,
0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
+ 0x0c00, 0x0c03,
0x0c3e, 0x0c44,
0x0c46, 0x0c48,
0x0c4a, 0x0c4c,
0x0c55, 0x0c56,
0x0c62, 0x0c63,
- 0x0c82, 0x0c83,
+ 0x0c81, 0x0c83,
0x0cbe, 0x0cc4,
0x0cc6, 0x0cc8,
0x0cca, 0x0ccc,
0x0cd5, 0x0cd6,
0x0ce2, 0x0ce3,
- 0x0d02, 0x0d03,
+ 0x0d01, 0x0d03,
0x0d3e, 0x0d44,
0x0d46, 0x0d48,
0x0d4a, 0x0d4c,
@@ -17657,6 +19167,7 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x1be7, 0x1bf1,
0x1c24, 0x1c35,
0x1cf2, 0x1cf3,
+ 0x1de7, 0x1df4,
0x24b6, 0x24e9,
0x2de0, 0x2dff,
0xa674, 0xa67b,
@@ -17679,6 +19190,7 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0xaaf5, 0xaaf5,
0xabe3, 0xabea,
0xfb1e, 0xfb1e,
+ 0x10376, 0x1037a,
0x10a01, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a0f,
@@ -17690,8 +19202,27 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x11127, 0x11132,
0x11180, 0x11182,
0x111b3, 0x111bf,
+ 0x1122c, 0x11234,
+ 0x11237, 0x11237,
+ 0x112df, 0x112e8,
+ 0x11301, 0x11303,
+ 0x1133e, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134c,
+ 0x11357, 0x11357,
+ 0x11362, 0x11363,
+ 0x114b0, 0x114c1,
+ 0x115af, 0x115b5,
+ 0x115b8, 0x115be,
+ 0x11630, 0x1163e,
+ 0x11640, 0x11640,
0x116ab, 0x116b5,
+ 0x16b30, 0x16b36,
0x16f51, 0x16f7e,
+ 0x1bc9e, 0x1bc9e,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Other_Alphabetic */
/* 'Ideographic': Binary Property */
@@ -17712,7 +19243,7 @@ static const OnigCodePoint CR_Ideographic[] = {
/* 'Diacritic': Binary Property */
static const OnigCodePoint CR_Diacritic[] = {
- 125,
+ 145,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -17781,6 +19312,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1939, 0x193b,
0x1a75, 0x1a7c,
0x1a7f, 0x1a7f,
+ 0x1ab0, 0x1abd,
0x1b34, 0x1b34,
0x1b44, 0x1b44,
0x1b6b, 0x1b73,
@@ -17790,8 +19322,10 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1cd0, 0x1ce8,
0x1ced, 0x1ced,
0x1cf4, 0x1cf4,
+ 0x1cf8, 0x1cf9,
0x1d2c, 0x1d6a,
0x1dc4, 0x1dcf,
+ 0x1df5, 0x1df5,
0x1dfd, 0x1dff,
0x1fbd, 0x1fbd,
0x1fbf, 0x1fc1,
@@ -17807,6 +19341,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa66f, 0xa66f,
0xa67c, 0xa67d,
0xa67f, 0xa67f,
+ 0xa69c, 0xa69d,
0xa6f0, 0xa6f1,
0xa717, 0xa721,
0xa788, 0xa788,
@@ -17817,32 +19352,48 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa953, 0xa953,
0xa9b3, 0xa9b3,
0xa9c0, 0xa9c0,
- 0xaa7b, 0xaa7b,
+ 0xa9e5, 0xa9e5,
+ 0xaa7b, 0xaa7d,
0xaabf, 0xaac2,
0xaaf6, 0xaaf6,
+ 0xab5b, 0xab5f,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
- 0xfe20, 0xfe26,
+ 0xfe20, 0xfe2d,
0xff3e, 0xff3e,
0xff40, 0xff40,
0xff70, 0xff70,
0xff9e, 0xff9f,
0xffe3, 0xffe3,
+ 0x102e0, 0x102e0,
+ 0x10ae5, 0x10ae6,
0x110b9, 0x110ba,
0x11133, 0x11134,
+ 0x11173, 0x11173,
0x111c0, 0x111c0,
+ 0x11235, 0x11236,
+ 0x112e9, 0x112ea,
+ 0x1133c, 0x1133c,
+ 0x1134d, 0x1134d,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x114c2, 0x114c3,
+ 0x115bf, 0x115c0,
+ 0x1163f, 0x1163f,
0x116b6, 0x116b7,
+ 0x16af0, 0x16af4,
0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
0x1d1aa, 0x1d1ad,
+ 0x1e8d0, 0x1e8d6,
}; /* CR_Diacritic */
/* 'Extender': Binary Property */
static const OnigCodePoint CR_Extender[] = {
- 22,
+ 26,
0x00b7, 0x00b7,
0x02d0, 0x02d1,
0x0640, 0x0640,
@@ -17861,15 +19412,19 @@ static const OnigCodePoint CR_Extender[] = {
0xa015, 0xa015,
0xa60c, 0xa60c,
0xa9cf, 0xa9cf,
+ 0xa9e6, 0xa9e6,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
0xaaf3, 0xaaf4,
0xff70, 0xff70,
+ 0x1135d, 0x1135d,
+ 0x115c6, 0x115c8,
+ 0x16b42, 0x16b43,
}; /* CR_Extender */
/* 'Other_Lowercase': Binary Property */
static const OnigCodePoint CR_Other_Lowercase[] = {
- 18,
+ 20,
0x00aa, 0x00aa,
0x00ba, 0x00ba,
0x02b0, 0x02b8,
@@ -17886,15 +19441,20 @@ static const OnigCodePoint CR_Other_Lowercase[] = {
0x2170, 0x217f,
0x24d0, 0x24e9,
0x2c7c, 0x2c7d,
+ 0xa69c, 0xa69d,
0xa770, 0xa770,
0xa7f8, 0xa7f9,
+ 0xab5c, 0xab5f,
}; /* CR_Other_Lowercase */
/* 'Other_Uppercase': Binary Property */
static const OnigCodePoint CR_Other_Uppercase[] = {
- 2,
+ 5,
0x2160, 0x216f,
0x24b6, 0x24cf,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
}; /* CR_Other_Uppercase */
/* 'Noncharacter_Code_Point': Binary Property */
@@ -17922,7 +19482,7 @@ static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
/* 'Other_Grapheme_Extend': Binary Property */
static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
- 17,
+ 22,
0x09be, 0x09be,
0x09d7, 0x09d7,
0x0b3e, 0x0b3e,
@@ -17938,6 +19498,11 @@ static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
0x200c, 0x200d,
0x302e, 0x302f,
0xff9e, 0xff9f,
+ 0x1133e, 0x1133e,
+ 0x11357, 0x11357,
+ 0x114b0, 0x114b0,
+ 0x114bd, 0x114bd,
+ 0x115af, 0x115af,
0x1d165, 0x1d165,
0x1d16e, 0x1d172,
}; /* CR_Other_Grapheme_Extend */
@@ -17986,7 +19551,7 @@ static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
0x034f, 0x034f,
0x115f, 0x1160,
0x17b4, 0x17b5,
- 0x2065, 0x2069,
+ 0x2065, 0x2065,
0x3164, 0x3164,
0xffa0, 0xffa0,
0xfff0, 0xfff8,
@@ -18075,12 +19640,10 @@ static const OnigCodePoint CR_Other_ID_Continue[] = {
/* 'STerm': Binary Property */
static const OnigCodePoint CR_STerm[] = {
- 50,
+ 60,
0x0021, 0x0021,
0x002e, 0x002e,
0x003f, 0x003f,
- 0x055c, 0x055c,
- 0x055e, 0x055e,
0x0589, 0x0589,
0x061f, 0x061f,
0x06d4, 0x06d4,
@@ -18103,6 +19666,7 @@ static const OnigCodePoint CR_STerm[] = {
0x203c, 0x203d,
0x2047, 0x2049,
0x2e2e, 0x2e2e,
+ 0x2e3c, 0x2e3c,
0x3002, 0x3002,
0xa4ff, 0xa4ff,
0xa60e, 0xa60f,
@@ -18126,6 +19690,17 @@ static const OnigCodePoint CR_STerm[] = {
0x110be, 0x110c1,
0x11141, 0x11143,
0x111c5, 0x111c6,
+ 0x111cd, 0x111cd,
+ 0x11238, 0x11239,
+ 0x1123b, 0x1123c,
+ 0x115c2, 0x115c3,
+ 0x115c9, 0x115c9,
+ 0x11641, 0x11642,
+ 0x16a6e, 0x16a6f,
+ 0x16af5, 0x16af5,
+ 0x16b37, 0x16b38,
+ 0x16b44, 0x16b44,
+ 0x1bc9f, 0x1bc9f,
}; /* CR_STerm */
/* 'Variation_Selector': Binary Property */
@@ -18181,23 +19756,22 @@ static const OnigCodePoint CR_Pattern_Syntax[] = {
/* 'Unknown': Script */
static const OnigCodePoint CR_Unknown[] = {
- 537,
+ 598,
0x0378, 0x0379,
- 0x037f, 0x0383,
+ 0x0380, 0x0383,
0x038b, 0x038b,
0x038d, 0x038d,
0x03a2, 0x03a2,
- 0x0528, 0x0530,
+ 0x0530, 0x0530,
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x058e,
+ 0x058b, 0x058c,
0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0605, 0x0605,
- 0x061c, 0x061d,
+ 0x061d, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
0x07b2, 0x07bf,
@@ -18206,11 +19780,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x083f, 0x083f,
0x085c, 0x085d,
0x085f, 0x089f,
- 0x08a1, 0x08a1,
- 0x08ad, 0x08e3,
- 0x08ff, 0x08ff,
- 0x0978, 0x0978,
- 0x0980, 0x0980,
+ 0x08b3, 0x08e3,
0x0984, 0x0984,
0x098d, 0x098e,
0x0991, 0x0992,
@@ -18283,12 +19853,11 @@ static const OnigCodePoint CR_Unknown[] = {
0x0bce, 0x0bcf,
0x0bd1, 0x0bd6,
0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
+ 0x0bfb, 0x0bff,
0x0c04, 0x0c04,
0x0c0d, 0x0c0d,
0x0c11, 0x0c11,
0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
0x0c3a, 0x0c3c,
0x0c45, 0x0c45,
0x0c49, 0x0c49,
@@ -18297,7 +19866,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x0c5a, 0x0c5f,
0x0c64, 0x0c65,
0x0c70, 0x0c77,
- 0x0c80, 0x0c81,
+ 0x0c80, 0x0c80,
0x0c84, 0x0c84,
0x0c8d, 0x0c8d,
0x0c91, 0x0c91,
@@ -18311,7 +19880,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x0cdf, 0x0cdf,
0x0ce4, 0x0ce5,
0x0cf0, 0x0cf0,
- 0x0cf3, 0x0d01,
+ 0x0cf3, 0x0d00,
0x0d04, 0x0d04,
0x0d0d, 0x0d0d,
0x0d11, 0x0d11,
@@ -18332,7 +19901,8 @@ static const OnigCodePoint CR_Unknown[] = {
0x0dcb, 0x0dce,
0x0dd5, 0x0dd5,
0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
+ 0x0de0, 0x0de5,
+ 0x0df0, 0x0df1,
0x0df5, 0x0e00,
0x0e3b, 0x0e3e,
0x0e5c, 0x0e80,
@@ -18383,7 +19953,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x139a, 0x139f,
0x13f5, 0x13ff,
0x169d, 0x169f,
- 0x16f1, 0x16ff,
+ 0x16f9, 0x16ff,
0x170d, 0x170d,
0x1715, 0x171f,
0x1737, 0x173f,
@@ -18399,7 +19969,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x1878, 0x187f,
0x18ab, 0x18af,
0x18f6, 0x18ff,
- 0x191d, 0x191f,
+ 0x191f, 0x191f,
0x192c, 0x192f,
0x193c, 0x193f,
0x1941, 0x1943,
@@ -18413,7 +19983,8 @@ static const OnigCodePoint CR_Unknown[] = {
0x1a7d, 0x1a7e,
0x1a8a, 0x1a8f,
0x1a9a, 0x1a9f,
- 0x1aae, 0x1aff,
+ 0x1aae, 0x1aaf,
+ 0x1abf, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
0x1bf4, 0x1bfb,
@@ -18421,8 +19992,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x1c4a, 0x1c4c,
0x1c80, 0x1cbf,
0x1cc8, 0x1ccf,
- 0x1cf7, 0x1cff,
- 0x1de7, 0x1dfb,
+ 0x1cf7, 0x1cf7,
+ 0x1cfa, 0x1cff,
+ 0x1df6, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
0x1f46, 0x1f47,
@@ -18439,19 +20011,21 @@ static const OnigCodePoint CR_Unknown[] = {
0x1ff0, 0x1ff1,
0x1ff5, 0x1ff5,
0x1fff, 0x1fff,
- 0x2065, 0x2069,
+ 0x2065, 0x2065,
0x2072, 0x2073,
0x208f, 0x208f,
0x209d, 0x209f,
- 0x20ba, 0x20cf,
+ 0x20be, 0x20cf,
0x20f1, 0x20ff,
0x218a, 0x218f,
- 0x23f4, 0x23ff,
+ 0x23fb, 0x23ff,
0x2427, 0x243f,
0x244b, 0x245f,
- 0x2700, 0x2700,
- 0x2b4d, 0x2b4f,
- 0x2b5a, 0x2bff,
+ 0x2b74, 0x2b75,
+ 0x2b96, 0x2b97,
+ 0x2bba, 0x2bbc,
+ 0x2bc9, 0x2bc9,
+ 0x2bd2, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
0x2cf4, 0x2cf8,
@@ -18469,7 +20043,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e3c, 0x2e7f,
+ 0x2e43, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -18488,11 +20062,11 @@ static const OnigCodePoint CR_Unknown[] = {
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa698, 0xa69e,
+ 0xa69e, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa794, 0xa79f,
- 0xa7ab, 0xa7f7,
+ 0xa7ae, 0xa7af,
+ 0xa7b2, 0xa7f6,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -18503,18 +20077,19 @@ static const OnigCodePoint CR_Unknown[] = {
0xa97d, 0xa97f,
0xa9ce, 0xa9ce,
0xa9da, 0xa9dd,
- 0xa9e0, 0xa9ff,
+ 0xa9ff, 0xa9ff,
0xaa37, 0xaa3f,
0xaa4e, 0xaa4f,
0xaa5a, 0xaa5b,
- 0xaa7c, 0xaa7f,
0xaac3, 0xaada,
0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
0xab27, 0xab27,
- 0xab2f, 0xabbf,
+ 0xab2f, 0xab2f,
+ 0xab60, 0xab63,
+ 0xab66, 0xabbf,
0xabee, 0xabef,
0xabfa, 0xabff,
0xd7a4, 0xd7af,
@@ -18535,7 +20110,7 @@ static const OnigCodePoint CR_Unknown[] = {
0xfdc8, 0xfdef,
0xfdfe, 0xfdff,
0xfe1a, 0xfe1f,
- 0xfe27, 0xfe2f,
+ 0xfe2e, 0xfe2f,
0xfe53, 0xfe53,
0xfe67, 0xfe67,
0xfe6c, 0xfe6f,
@@ -18559,26 +20134,35 @@ static const OnigCodePoint CR_Unknown[] = {
0x100fb, 0x100ff,
0x10103, 0x10106,
0x10134, 0x10136,
- 0x1018b, 0x1018f,
- 0x1019c, 0x101cf,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
0x101fe, 0x1027f,
0x1029d, 0x1029f,
- 0x102d1, 0x102ff,
- 0x1031f, 0x1031f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
0x10324, 0x1032f,
- 0x1034b, 0x1037f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
0x1039e, 0x1039e,
0x103c4, 0x103c7,
0x103d6, 0x103ff,
0x1049e, 0x1049f,
- 0x104aa, 0x107ff,
+ 0x104aa, 0x104ff,
+ 0x10528, 0x1052f,
+ 0x10564, 0x1056e,
+ 0x10570, 0x105ff,
+ 0x10737, 0x1073f,
+ 0x10756, 0x1075f,
+ 0x10768, 0x107ff,
0x10806, 0x10807,
0x10809, 0x10809,
0x10836, 0x10836,
0x10839, 0x1083b,
0x1083d, 0x1083e,
0x10856, 0x10856,
- 0x10860, 0x108ff,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
0x10940, 0x1097f,
@@ -18592,33 +20176,82 @@ static const OnigCodePoint CR_Unknown[] = {
0x10a3b, 0x10a3e,
0x10a48, 0x10a4f,
0x10a59, 0x10a5f,
- 0x10a80, 0x10aff,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
0x10b36, 0x10b38,
0x10b56, 0x10b57,
0x10b73, 0x10b77,
- 0x10b80, 0x10bff,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
0x10c49, 0x10e5f,
0x10e7f, 0x10fff,
0x1104e, 0x11051,
- 0x11070, 0x1107f,
+ 0x11070, 0x1107e,
0x110c2, 0x110cf,
0x110e9, 0x110ef,
0x110fa, 0x110ff,
0x11135, 0x11135,
- 0x11144, 0x1117f,
- 0x111c9, 0x111cf,
- 0x111da, 0x1167f,
+ 0x11144, 0x1114f,
+ 0x11177, 0x1117f,
+ 0x111c9, 0x111cc,
+ 0x111ce, 0x111cf,
+ 0x111db, 0x111e0,
+ 0x111f5, 0x111ff,
+ 0x11212, 0x11212,
+ 0x1123e, 0x112af,
+ 0x112eb, 0x112ef,
+ 0x112fa, 0x11300,
+ 0x11304, 0x11304,
+ 0x1130d, 0x1130e,
+ 0x11311, 0x11312,
+ 0x11329, 0x11329,
+ 0x11331, 0x11331,
+ 0x11334, 0x11334,
+ 0x1133a, 0x1133b,
+ 0x11345, 0x11346,
+ 0x11349, 0x1134a,
+ 0x1134e, 0x11356,
+ 0x11358, 0x1135c,
+ 0x11364, 0x11365,
+ 0x1136d, 0x1136f,
+ 0x11375, 0x1147f,
+ 0x114c8, 0x114cf,
+ 0x114da, 0x1157f,
+ 0x115b6, 0x115b7,
+ 0x115ca, 0x115ff,
+ 0x11645, 0x1164f,
+ 0x1165a, 0x1167f,
0x116b8, 0x116bf,
- 0x116ca, 0x11fff,
- 0x1236f, 0x123ff,
- 0x12463, 0x1246f,
- 0x12474, 0x12fff,
+ 0x116ca, 0x1189f,
+ 0x118f3, 0x118fe,
+ 0x11900, 0x11abf,
+ 0x11af9, 0x11fff,
+ 0x12399, 0x123ff,
+ 0x1246f, 0x1246f,
+ 0x12475, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x16eff,
+ 0x16a39, 0x16a3f,
+ 0x16a5f, 0x16a5f,
+ 0x16a6a, 0x16a6d,
+ 0x16a70, 0x16acf,
+ 0x16aee, 0x16aef,
+ 0x16af6, 0x16aff,
+ 0x16b46, 0x16b4f,
+ 0x16b5a, 0x16b5a,
+ 0x16b62, 0x16b62,
+ 0x16b78, 0x16b7c,
+ 0x16b90, 0x16eff,
0x16f45, 0x16f4f,
0x16f7f, 0x16f8e,
0x16fa0, 0x1afff,
- 0x1b002, 0x1cfff,
+ 0x1b002, 0x1bbff,
+ 0x1bc6b, 0x1bc6f,
+ 0x1bc7d, 0x1bc7f,
+ 0x1bc89, 0x1bc8f,
+ 0x1bc9a, 0x1bc9b,
+ 0x1bca4, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
0x1d1de, 0x1d1ff,
@@ -18645,7 +20278,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1edff,
+ 0x1d800, 0x1e7ff,
+ 0x1e8c5, 0x1e8c6,
+ 0x1e8d7, 0x1edff,
0x1ee04, 0x1ee04,
0x1ee20, 0x1ee20,
0x1ee23, 0x1ee23,
@@ -18683,10 +20318,10 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
- 0x1f0bf, 0x1f0c0,
+ 0x1f0c0, 0x1f0c0,
0x1f0d0, 0x1f0d0,
- 0x1f0e0, 0x1f0ff,
- 0x1f10b, 0x1f10f,
+ 0x1f0f6, 0x1f0ff,
+ 0x1f10d, 0x1f10f,
0x1f12f, 0x1f12f,
0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
@@ -18694,24 +20329,25 @@ static const OnigCodePoint CR_Unknown[] = {
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,
+ 0x1f32d, 0x1f32f,
+ 0x1f37e, 0x1f37f,
+ 0x1f3cf, 0x1f3d3,
+ 0x1f3f8, 0x1f3ff,
+ 0x1f4ff, 0x1f4ff,
+ 0x1f54b, 0x1f54f,
+ 0x1f57a, 0x1f57a,
+ 0x1f5a4, 0x1f5a4,
+ 0x1f643, 0x1f644,
+ 0x1f6d0, 0x1f6df,
+ 0x1f6ed, 0x1f6ef,
+ 0x1f6f4, 0x1f6ff,
+ 0x1f774, 0x1f77f,
+ 0x1f7d5, 0x1f7ff,
+ 0x1f80c, 0x1f80f,
+ 0x1f848, 0x1f84f,
+ 0x1f85a, 0x1f85f,
+ 0x1f888, 0x1f88f,
+ 0x1f8ae, 0x1ffff,
0x2a6d7, 0x2a6ff,
0x2b735, 0x2b73f,
0x2b81e, 0x2f7ff,
@@ -18721,6 +20357,7 @@ static const OnigCodePoint CR_Unknown[] = {
0xe01f0, 0x10ffff,
}; /* CR_Unknown */
+#ifdef USE_UNICODE_AGE_PROPERTIES
/* 'Age_1_1': Derived Age 1.1 */
static const OnigCodePoint CR_Age_1_1[] = {
288,
@@ -24158,6 +25795,1730 @@ static const OnigCodePoint CR_Age_6_1[] = {
0xefffe, 0x10ffff,
}; /* CR_Age_6_1 */
+/* 'Age_6_2': Derived Age 6.2 */
+static const OnigCodePoint CR_Age_6_2[] = {
+ 549,
+ 0x0000, 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, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20ba,
+ 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,
+ 0xd800, 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,
+ 0xfdd0, 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, 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,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_2 */
+
+/* 'Age_6_3': Derived Age 6.3 */
+static const OnigCodePoint CR_Age_6_3[] = {
+ 549,
+ 0x0000, 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, 0x061c,
+ 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, 0x2064,
+ 0x2066, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20ba,
+ 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,
+ 0xd800, 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,
+ 0xfdd0, 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, 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,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_3 */
+
+/* 'Age_7_0': Derived Age 7.0 */
+static const OnigCodePoint CR_Age_7_0[] = {
+ 610,
+ 0x0000, 0x0377,
+ 0x037a, 0x037f,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058d, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x061c,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08b2,
+ 0x08e4, 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,
+ 0x0c00, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c81, 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,
+ 0x0d01, 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,
+ 0x0de6, 0x0def,
+ 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, 0x16f8,
+ 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, 0x191e,
+ 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,
+ 0x1ab0, 0x1abe,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1cf8, 0x1cf9,
+ 0x1d00, 0x1df5,
+ 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, 0x2064,
+ 0x2066, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20bd,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23fa,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 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, 0x2e42,
+ 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, 0xa69d,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9fe,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xab30, 0xab5f,
+ 0xab64, 0xab65,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xd800, 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,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe2d,
+ 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, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018c,
+ 0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x102e0, 0x102fb,
+ 0x10300, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10350, 0x1037a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x1056f, 0x1056f,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1089e,
+ 0x108a7, 0x108af,
+ 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, 0x10a9f,
+ 0x10ac0, 0x10ae6,
+ 0x10aeb, 0x10af6,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x1107f, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11150, 0x11176,
+ 0x11180, 0x111c8,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
+ 0x111e1, 0x111f4,
+ 0x11200, 0x11211,
+ 0x11213, 0x1123d,
+ 0x112b0, 0x112ea,
+ 0x112f0, 0x112f9,
+ 0x11301, 0x11303,
+ 0x11305, 0x1130c,
+ 0x1130f, 0x11310,
+ 0x11313, 0x11328,
+ 0x1132a, 0x11330,
+ 0x11332, 0x11333,
+ 0x11335, 0x11339,
+ 0x1133c, 0x11344,
+ 0x11347, 0x11348,
+ 0x1134b, 0x1134d,
+ 0x11357, 0x11357,
+ 0x1135d, 0x11363,
+ 0x11366, 0x1136c,
+ 0x11370, 0x11374,
+ 0x11480, 0x114c7,
+ 0x114d0, 0x114d9,
+ 0x11580, 0x115b5,
+ 0x115b8, 0x115c9,
+ 0x11600, 0x11644,
+ 0x11650, 0x11659,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x118a0, 0x118f2,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16a60, 0x16a69,
+ 0x16a6e, 0x16a6f,
+ 0x16ad0, 0x16aed,
+ 0x16af0, 0x16af5,
+ 0x16b00, 0x16b45,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1bc9c, 0x1bca3,
+ 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,
+ 0x1e800, 0x1e8c4,
+ 0x1e8c7, 0x1e8d6,
+ 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, 0x1f0bf,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0f5,
+ 0x1f100, 0x1f10c,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f32c,
+ 0x1f330, 0x1f37d,
+ 0x1f380, 0x1f3ce,
+ 0x1f3d4, 0x1f3f7,
+ 0x1f400, 0x1f4fe,
+ 0x1f500, 0x1f54a,
+ 0x1f550, 0x1f579,
+ 0x1f57b, 0x1f5a3,
+ 0x1f5a5, 0x1f642,
+ 0x1f645, 0x1f6cf,
+ 0x1f6e0, 0x1f6ec,
+ 0x1f6f0, 0x1f6f3,
+ 0x1f700, 0x1f773,
+ 0x1f780, 0x1f7d4,
+ 0x1f800, 0x1f80b,
+ 0x1f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_7_0 */
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+
/* 'In_Basic_Latin': Block */
#define CR_In_Basic_Latin CR_ASCII
@@ -24485,6 +27846,12 @@ static const OnigCodePoint CR_In_Tai_Tham[] = {
0x1a20, 0x1aaf,
}; /* CR_In_Tai_Tham */
+/* 'In_Combining_Diacritical_Marks_Extended': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Extended[] = {
+ 1,
+ 0x1ab0, 0x1aff,
+}; /* CR_In_Combining_Diacritical_Marks_Extended */
+
/* 'In_Balinese': Block */
static const OnigCodePoint CR_In_Balinese[] = {
1,
@@ -24921,7 +28288,10 @@ static const OnigCodePoint CR_In_Devanagari_Extended[] = {
}; /* CR_In_Devanagari_Extended */
/* 'In_Kayah_Li': Block */
-#define CR_In_Kayah_Li CR_Kayah_Li
+static const OnigCodePoint CR_In_Kayah_Li[] = {
+ 1,
+ 0xa900, 0xa92f,
+}; /* CR_In_Kayah_Li */
/* 'In_Rejang': Block */
static const OnigCodePoint CR_In_Rejang[] = {
@@ -24941,6 +28311,12 @@ static const OnigCodePoint CR_In_Javanese[] = {
0xa980, 0xa9df,
}; /* CR_In_Javanese */
+/* 'In_Myanmar_Extended_B': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_B[] = {
+ 1,
+ 0xa9e0, 0xa9ff,
+}; /* CR_In_Myanmar_Extended_B */
+
/* 'In_Cham': Block */
static const OnigCodePoint CR_In_Cham[] = {
1,
@@ -24971,6 +28347,12 @@ static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
0xab00, 0xab2f,
}; /* CR_In_Ethiopic_Extended_A */
+/* 'In_Latin_Extended_E': Block */
+static const OnigCodePoint CR_In_Latin_Extended_E[] = {
+ 1,
+ 0xab30, 0xab6f,
+}; /* CR_In_Latin_Extended_E */
+
/* 'In_Meetei_Mayek': Block */
static const OnigCodePoint CR_In_Meetei_Mayek[] = {
1,
@@ -25127,6 +28509,12 @@ static const OnigCodePoint CR_In_Carian[] = {
0x102a0, 0x102df,
}; /* CR_In_Carian */
+/* 'In_Coptic_Epact_Numbers': Block */
+static const OnigCodePoint CR_In_Coptic_Epact_Numbers[] = {
+ 1,
+ 0x102e0, 0x102ff,
+}; /* CR_In_Coptic_Epact_Numbers */
+
/* 'In_Old_Italic': Block */
static const OnigCodePoint CR_In_Old_Italic[] = {
1,
@@ -25139,6 +28527,12 @@ static const OnigCodePoint CR_In_Gothic[] = {
0x10330, 0x1034f,
}; /* CR_In_Gothic */
+/* 'In_Old_Permic': Block */
+static const OnigCodePoint CR_In_Old_Permic[] = {
+ 1,
+ 0x10350, 0x1037f,
+}; /* CR_In_Old_Permic */
+
/* 'In_Ugaritic': Block */
static const OnigCodePoint CR_In_Ugaritic[] = {
1,
@@ -25163,6 +28557,24 @@ static const OnigCodePoint CR_In_Osmanya[] = {
0x10480, 0x104af,
}; /* CR_In_Osmanya */
+/* 'In_Elbasan': Block */
+static const OnigCodePoint CR_In_Elbasan[] = {
+ 1,
+ 0x10500, 0x1052f,
+}; /* CR_In_Elbasan */
+
+/* 'In_Caucasian_Albanian': Block */
+static const OnigCodePoint CR_In_Caucasian_Albanian[] = {
+ 1,
+ 0x10530, 0x1056f,
+}; /* CR_In_Caucasian_Albanian */
+
+/* 'In_Linear_A': Block */
+static const OnigCodePoint CR_In_Linear_A[] = {
+ 1,
+ 0x10600, 0x1077f,
+}; /* CR_In_Linear_A */
+
/* 'In_Cypriot_Syllabary': Block */
static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
1,
@@ -25175,6 +28587,15 @@ static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
0x10840, 0x1085f,
}; /* CR_In_Imperial_Aramaic */
+/* 'In_Palmyrene': Block */
+#define CR_In_Palmyrene CR_Palmyrene
+
+/* 'In_Nabataean': Block */
+static const OnigCodePoint CR_In_Nabataean[] = {
+ 1,
+ 0x10880, 0x108af,
+}; /* CR_In_Nabataean */
+
/* 'In_Phoenician': Block */
static const OnigCodePoint CR_In_Phoenician[] = {
1,
@@ -25205,6 +28626,15 @@ static const OnigCodePoint CR_In_Kharoshthi[] = {
/* 'In_Old_South_Arabian': Block */
#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+/* 'In_Old_North_Arabian': Block */
+#define CR_In_Old_North_Arabian CR_Old_North_Arabian
+
+/* 'In_Manichaean': Block */
+static const OnigCodePoint CR_In_Manichaean[] = {
+ 1,
+ 0x10ac0, 0x10aff,
+}; /* CR_In_Manichaean */
+
/* 'In_Avestan': Block */
static const OnigCodePoint CR_In_Avestan[] = {
1,
@@ -25223,6 +28653,12 @@ static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
0x10b60, 0x10b7f,
}; /* CR_In_Inscriptional_Pahlavi */
+/* 'In_Psalter_Pahlavi': Block */
+static const OnigCodePoint CR_In_Psalter_Pahlavi[] = {
+ 1,
+ 0x10b80, 0x10baf,
+}; /* CR_In_Psalter_Pahlavi */
+
/* 'In_Old_Turkic': Block */
static const OnigCodePoint CR_In_Old_Turkic[] = {
1,
@@ -25259,18 +28695,78 @@ static const OnigCodePoint CR_In_Chakma[] = {
0x11100, 0x1114f,
}; /* CR_In_Chakma */
+/* 'In_Mahajani': Block */
+static const OnigCodePoint CR_In_Mahajani[] = {
+ 1,
+ 0x11150, 0x1117f,
+}; /* CR_In_Mahajani */
+
/* 'In_Sharada': Block */
static const OnigCodePoint CR_In_Sharada[] = {
1,
0x11180, 0x111df,
}; /* CR_In_Sharada */
+/* 'In_Sinhala_Archaic_Numbers': Block */
+static const OnigCodePoint CR_In_Sinhala_Archaic_Numbers[] = {
+ 1,
+ 0x111e0, 0x111ff,
+}; /* CR_In_Sinhala_Archaic_Numbers */
+
+/* 'In_Khojki': Block */
+static const OnigCodePoint CR_In_Khojki[] = {
+ 1,
+ 0x11200, 0x1124f,
+}; /* CR_In_Khojki */
+
+/* 'In_Khudawadi': Block */
+static const OnigCodePoint CR_In_Khudawadi[] = {
+ 1,
+ 0x112b0, 0x112ff,
+}; /* CR_In_Khudawadi */
+
+/* 'In_Grantha': Block */
+static const OnigCodePoint CR_In_Grantha[] = {
+ 1,
+ 0x11300, 0x1137f,
+}; /* CR_In_Grantha */
+
+/* 'In_Tirhuta': Block */
+static const OnigCodePoint CR_In_Tirhuta[] = {
+ 1,
+ 0x11480, 0x114df,
+}; /* CR_In_Tirhuta */
+
+/* 'In_Siddham': Block */
+static const OnigCodePoint CR_In_Siddham[] = {
+ 1,
+ 0x11580, 0x115ff,
+}; /* CR_In_Siddham */
+
+/* 'In_Modi': Block */
+static const OnigCodePoint CR_In_Modi[] = {
+ 1,
+ 0x11600, 0x1165f,
+}; /* CR_In_Modi */
+
/* 'In_Takri': Block */
static const OnigCodePoint CR_In_Takri[] = {
1,
0x11680, 0x116cf,
}; /* CR_In_Takri */
+/* 'In_Warang_Citi': Block */
+static const OnigCodePoint CR_In_Warang_Citi[] = {
+ 1,
+ 0x118a0, 0x118ff,
+}; /* CR_In_Warang_Citi */
+
+/* 'In_Pau_Cin_Hau': Block */
+static const OnigCodePoint CR_In_Pau_Cin_Hau[] = {
+ 1,
+ 0x11ac0, 0x11aff,
+}; /* CR_In_Pau_Cin_Hau */
+
/* 'In_Cuneiform': Block */
static const OnigCodePoint CR_In_Cuneiform[] = {
1,
@@ -25295,6 +28791,24 @@ static const OnigCodePoint CR_In_Bamum_Supplement[] = {
0x16800, 0x16a3f,
}; /* CR_In_Bamum_Supplement */
+/* 'In_Mro': Block */
+static const OnigCodePoint CR_In_Mro[] = {
+ 1,
+ 0x16a40, 0x16a6f,
+}; /* CR_In_Mro */
+
+/* 'In_Bassa_Vah': Block */
+static const OnigCodePoint CR_In_Bassa_Vah[] = {
+ 1,
+ 0x16ad0, 0x16aff,
+}; /* CR_In_Bassa_Vah */
+
+/* 'In_Pahawh_Hmong': Block */
+static const OnigCodePoint CR_In_Pahawh_Hmong[] = {
+ 1,
+ 0x16b00, 0x16b8f,
+}; /* CR_In_Pahawh_Hmong */
+
/* 'In_Miao': Block */
static const OnigCodePoint CR_In_Miao[] = {
1,
@@ -25307,6 +28821,18 @@ static const OnigCodePoint CR_In_Kana_Supplement[] = {
0x1b000, 0x1b0ff,
}; /* CR_In_Kana_Supplement */
+/* 'In_Duployan': Block */
+static const OnigCodePoint CR_In_Duployan[] = {
+ 1,
+ 0x1bc00, 0x1bc9f,
+}; /* CR_In_Duployan */
+
+/* 'In_Shorthand_Format_Controls': Block */
+static const OnigCodePoint CR_In_Shorthand_Format_Controls[] = {
+ 1,
+ 0x1bca0, 0x1bcaf,
+}; /* CR_In_Shorthand_Format_Controls */
+
/* 'In_Byzantine_Musical_Symbols': Block */
static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
1,
@@ -25343,6 +28869,12 @@ static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
0x1d400, 0x1d7ff,
}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+/* 'In_Mende_Kikakui': Block */
+static const OnigCodePoint CR_In_Mende_Kikakui[] = {
+ 1,
+ 0x1e800, 0x1e8df,
+}; /* CR_In_Mende_Kikakui */
+
/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
1,
@@ -25379,11 +28911,11 @@ static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
0x1f200, 0x1f2ff,
}; /* CR_In_Enclosed_Ideographic_Supplement */
-/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+/* 'In_Miscellaneous_Symbols_and_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Pictographs[] = {
1,
0x1f300, 0x1f5ff,
-}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+}; /* CR_In_Miscellaneous_Symbols_and_Pictographs */
/* 'In_Emoticons': Block */
static const OnigCodePoint CR_In_Emoticons[] = {
@@ -25391,11 +28923,17 @@ static const OnigCodePoint CR_In_Emoticons[] = {
0x1f600, 0x1f64f,
}; /* CR_In_Emoticons */
-/* 'In_Transport_And_Map_Symbols': Block */
-static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+/* 'In_Ornamental_Dingbats': Block */
+static const OnigCodePoint CR_In_Ornamental_Dingbats[] = {
+ 1,
+ 0x1f650, 0x1f67f,
+}; /* CR_In_Ornamental_Dingbats */
+
+/* 'In_Transport_and_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_and_Map_Symbols[] = {
1,
0x1f680, 0x1f6ff,
-}; /* CR_In_Transport_And_Map_Symbols */
+}; /* CR_In_Transport_and_Map_Symbols */
/* 'In_Alchemical_Symbols': Block */
static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
@@ -25403,6 +28941,18 @@ static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
0x1f700, 0x1f77f,
}; /* CR_In_Alchemical_Symbols */
+/* 'In_Geometric_Shapes_Extended': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes_Extended[] = {
+ 1,
+ 0x1f780, 0x1f7ff,
+}; /* CR_In_Geometric_Shapes_Extended */
+
+/* 'In_Supplemental_Arrows_C': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_C[] = {
+ 1,
+ 0x1f800, 0x1f8ff,
+}; /* CR_In_Supplemental_Arrows_C */
+
/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
1,
@@ -25453,38 +29003,42 @@ static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
/* 'In_No_Block': Block */
static const OnigCodePoint CR_In_No_Block[] = {
- 36,
+ 40,
0x0860, 0x089f,
- 0x1ab0, 0x1aff,
0x1c80, 0x1cbf,
0x2fe0, 0x2fef,
- 0xa9e0, 0xa9ff,
- 0xab30, 0xabbf,
+ 0xab70, 0xabbf,
0x10200, 0x1027f,
- 0x102e0, 0x102ff,
- 0x10350, 0x1037f,
0x103e0, 0x103ff,
- 0x104b0, 0x107ff,
- 0x10860, 0x108ff,
+ 0x104b0, 0x104ff,
+ 0x10570, 0x105ff,
+ 0x10780, 0x107ff,
+ 0x108b0, 0x108ff,
0x10940, 0x1097f,
- 0x10a80, 0x10aff,
- 0x10b80, 0x10bff,
+ 0x10aa0, 0x10abf,
+ 0x10bb0, 0x10bff,
0x10c50, 0x10e5f,
0x10e80, 0x10fff,
- 0x11150, 0x1117f,
- 0x111e0, 0x1167f,
- 0x116d0, 0x11fff,
+ 0x11250, 0x112af,
+ 0x11380, 0x1147f,
+ 0x114e0, 0x1157f,
+ 0x11660, 0x1167f,
+ 0x116d0, 0x1189f,
+ 0x11900, 0x11abf,
+ 0x11b00, 0x11fff,
0x12480, 0x12fff,
0x13430, 0x167ff,
- 0x16a40, 0x16eff,
+ 0x16a70, 0x16acf,
+ 0x16b90, 0x16eff,
0x16fa0, 0x1afff,
- 0x1b100, 0x1cfff,
+ 0x1b100, 0x1bbff,
+ 0x1bcb0, 0x1cfff,
0x1d250, 0x1d2ff,
0x1d380, 0x1d3ff,
- 0x1d800, 0x1edff,
+ 0x1d800, 0x1e7ff,
+ 0x1e8e0, 0x1edff,
0x1ef00, 0x1efff,
- 0x1f650, 0x1f67f,
- 0x1f780, 0x1ffff,
+ 0x1f900, 0x1ffff,
0x2a6e0, 0x2a6ff,
0x2b820, 0x2f7ff,
0x2fa20, 0xdffff,
@@ -25671,6 +29225,29 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Sharada,
CR_Sora_Sompeng,
CR_Takri,
+ CR_Caucasian_Albanian,
+ CR_Bassa_Vah,
+ CR_Duployan,
+ CR_Elbasan,
+ CR_Grantha,
+ CR_Pahawh_Hmong,
+ CR_Khojki,
+ CR_Linear_A,
+ CR_Mahajani,
+ CR_Manichaean,
+ CR_Mende_Kikakui,
+ CR_Modi,
+ CR_Mro,
+ CR_Old_North_Arabian,
+ CR_Nabataean,
+ CR_Palmyrene,
+ CR_Pau_Cin_Hau,
+ CR_Old_Permic,
+ CR_Psalter_Pahlavi,
+ CR_Siddham,
+ CR_Khudawadi,
+ CR_Tirhuta,
+ CR_Warang_Citi,
CR_White_Space,
CR_Bidi_Control,
CR_Join_Control,
@@ -25704,6 +29281,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Pattern_White_Space,
CR_Pattern_Syntax,
CR_Unknown,
+#ifdef USE_UNICODE_AGE_PROPERTIES
CR_Age_1_1,
CR_Age_2_0,
CR_Age_2_1,
@@ -25717,6 +29295,10 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Age_5_2,
CR_Age_6_0,
CR_Age_6_1,
+ CR_Age_6_2,
+ CR_Age_6_3,
+ CR_Age_7_0,
+#endif /* USE_UNICODE_AGE_PROPERTIES */
CR_In_Basic_Latin,
CR_In_Latin_1_Supplement,
CR_In_Latin_Extended_A,
@@ -25772,6 +29354,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_In_Khmer_Symbols,
CR_In_Buginese,
CR_In_Tai_Tham,
+ CR_In_Combining_Diacritical_Marks_Extended,
CR_In_Balinese,
CR_In_Sundanese,
CR_In_Batak,
@@ -25850,11 +29433,13 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_In_Rejang,
CR_In_Hangul_Jamo_Extended_A,
CR_In_Javanese,
+ CR_In_Myanmar_Extended_B,
CR_In_Cham,
CR_In_Myanmar_Extended_A,
CR_In_Tai_Viet,
CR_In_Meetei_Mayek_Extensions,
CR_In_Ethiopic_Extended_A,
+ CR_In_Latin_Extended_E,
CR_In_Meetei_Mayek,
CR_In_Hangul_Syllables,
CR_In_Hangul_Jamo_Extended_B,
@@ -25881,54 +29466,83 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_In_Phaistos_Disc,
CR_In_Lycian,
CR_In_Carian,
+ CR_In_Coptic_Epact_Numbers,
CR_In_Old_Italic,
CR_In_Gothic,
+ CR_In_Old_Permic,
CR_In_Ugaritic,
CR_In_Old_Persian,
CR_In_Deseret,
CR_In_Shavian,
CR_In_Osmanya,
+ CR_In_Elbasan,
+ CR_In_Caucasian_Albanian,
+ CR_In_Linear_A,
CR_In_Cypriot_Syllabary,
CR_In_Imperial_Aramaic,
+ CR_In_Palmyrene,
+ CR_In_Nabataean,
CR_In_Phoenician,
CR_In_Lydian,
CR_In_Meroitic_Hieroglyphs,
CR_In_Meroitic_Cursive,
CR_In_Kharoshthi,
CR_In_Old_South_Arabian,
+ CR_In_Old_North_Arabian,
+ CR_In_Manichaean,
CR_In_Avestan,
CR_In_Inscriptional_Parthian,
CR_In_Inscriptional_Pahlavi,
+ CR_In_Psalter_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_Mahajani,
CR_In_Sharada,
+ CR_In_Sinhala_Archaic_Numbers,
+ CR_In_Khojki,
+ CR_In_Khudawadi,
+ CR_In_Grantha,
+ CR_In_Tirhuta,
+ CR_In_Siddham,
+ CR_In_Modi,
CR_In_Takri,
+ CR_In_Warang_Citi,
+ CR_In_Pau_Cin_Hau,
CR_In_Cuneiform,
CR_In_Cuneiform_Numbers_and_Punctuation,
CR_In_Egyptian_Hieroglyphs,
CR_In_Bamum_Supplement,
+ CR_In_Mro,
+ CR_In_Bassa_Vah,
+ CR_In_Pahawh_Hmong,
CR_In_Miao,
CR_In_Kana_Supplement,
+ CR_In_Duployan,
+ CR_In_Shorthand_Format_Controls,
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_Mende_Kikakui,
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_Miscellaneous_Symbols_and_Pictographs,
CR_In_Emoticons,
- CR_In_Transport_And_Map_Symbols,
+ CR_In_Ornamental_Dingbats,
+ CR_In_Transport_and_Map_Symbols,
CR_In_Alchemical_Symbols,
+ CR_In_Geometric_Shapes_Extended,
+ CR_In_Supplemental_Arrows_C,
CR_In_CJK_Unified_Ideographs_Extension_B,
CR_In_CJK_Unified_Ideographs_Extension_C,
CR_In_CJK_Unified_Ideographs_Extension_D,
@@ -25954,12 +29568,16 @@ static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned
#define MAX_HASH_VALUE 19
/* maximum key range = 14, duplicates = 0 */
#else /* USE_UNICODE_PROPERTIES */
-#define TOTAL_KEYWORDS 625
+#ifndef USE_UNICODE_AGE_PROPERTIES
+#define TOTAL_KEYWORDS 689
+#else /* USE_UNICODE_AGE_PROPERTIES */
+#define TOTAL_KEYWORDS 705
+#endif /* USE_UNICODE_AGE_PROPERTIES */
#define MIN_WORD_LENGTH 1
#define MAX_WORD_LENGTH 44
#define MIN_HASH_VALUE 3
-#define MAX_HASH_VALUE 4167
-/* maximum key range = 4165, duplicates = 0 */
+#define MAX_HASH_VALUE 4322
+/* maximum key range = 4320, duplicates = 0 */
#endif /* USE_UNICODE_PROPERTIES */
#ifdef __GNUC__
@@ -25995,19 +29613,24 @@ uniname2ctype_hash (str, len)
2, 20, 1, 20, 1, 7, 4, 6, 20, 1,
4, 20, 20, 20, 20, 20, 20, 20
#else /* USE_UNICODE_PROPERTIES */
- 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
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ 4323, 4323, 4323, 4323, 4323, 4323, 1, 4323, 12, 1,
+ 2, 9, 18, 11, 6, 10, 4323, 4323, 4323, 4323,
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323, 4323,
+ 4323, 4323, 4323, 4323, 4323, 4323, 4323, 13, 931, 6,
+ 382, 25, 311, 891, 277, 4, 272, 1436, 120, 7,
+ 1, 303, 456, 1, 232, 32, 65, 732, 1411, 163,
+ 883, 1255, 8, 4323, 4323, 4323, 4323, 4323
#endif /* USE_UNICODE_PROPERTIES */
};
#ifndef USE_UNICODE_PROPERTIES
@@ -26071,630 +29694,722 @@ struct uniname2ctype_pool_t
char uniname2ctype_pool_str19[sizeof("blank")];
#else /* USE_UNICODE_PROPERTIES */
char uniname2ctype_pool_str3[sizeof("n")];
- 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_str10[sizeof("cn")];
+ char uniname2ctype_pool_str11[sizeof("mn")];
+ char uniname2ctype_pool_str13[sizeof("c")];
+ char uniname2ctype_pool_str15[sizeof("m")];
+ char uniname2ctype_pool_str16[sizeof("ci")];
+ char uniname2ctype_pool_str17[sizeof("z")];
+ char uniname2ctype_pool_str20[sizeof("cc")];
+ char uniname2ctype_pool_str21[sizeof("mc")];
+ char uniname2ctype_pool_str29[sizeof("mani")];
+ char uniname2ctype_pool_str31[sizeof("inmanichaean")];
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_str36[sizeof("zzzz")];
+ char uniname2ctype_pool_str37[sizeof("qaac")];
+ char uniname2ctype_pool_str44[sizeof("incham")];
+ char uniname2ctype_pool_str46[sizeof("sc")];
+ char uniname2ctype_pool_str48[sizeof("sm")];
+ char uniname2ctype_pool_str51[sizeof("mandaic")];
+ char uniname2ctype_pool_str55[sizeof("incuneiform")];
+ char uniname2ctype_pool_str56[sizeof("cans")];
+ char uniname2ctype_pool_str59[sizeof("me")];
+ char uniname2ctype_pool_str61[sizeof("inarmenian")];
+ char uniname2ctype_pool_str64[sizeof("ascii")];
+ char uniname2ctype_pool_str65[sizeof("s")];
+ char uniname2ctype_pool_str69[sizeof("insamaritan")];
+ char uniname2ctype_pool_str72[sizeof("cs")];
+ char uniname2ctype_pool_str74[sizeof("zs")];
+ char uniname2ctype_pool_str85[sizeof("inavestan")];
+ char uniname2ctype_pool_str92[sizeof("incommonindicnumberforms")];
+ char uniname2ctype_pool_str96[sizeof("incuneiformnumbersandpunctuation")];
+ char uniname2ctype_pool_str97[sizeof("inthai")];
+ char uniname2ctype_pool_str98[sizeof("inipaextensions")];
+ char uniname2ctype_pool_str105[sizeof("mtei")];
+ char uniname2ctype_pool_str110[sizeof("inspecials")];
+ char uniname2ctype_pool_str114[sizeof("initialpunctuation")];
+ char uniname2ctype_pool_str115[sizeof("inancientsymbols")];
+ char uniname2ctype_pool_str117[sizeof("inthaana")];
+ char uniname2ctype_pool_str130[sizeof("inmiscellaneousmathematicalsymbolsa")];
+ char uniname2ctype_pool_str134[sizeof("lc")];
+ char uniname2ctype_pool_str135[sizeof("inmusicalsymbols")];
+ char uniname2ctype_pool_str136[sizeof("lm")];
+ char uniname2ctype_pool_str137[sizeof("taile")];
+ char uniname2ctype_pool_str141[sizeof("sterm")];
+ char uniname2ctype_pool_str142[sizeof("lina")];
+ char uniname2ctype_pool_str144[sizeof("inlycian")];
+ char uniname2ctype_pool_str147[sizeof("inmyanmarextendeda")];
+ char uniname2ctype_pool_str151[sizeof("lana")];
+ char uniname2ctype_pool_str153[sizeof("alnum")];
+ char uniname2ctype_pool_str155[sizeof("intaitham")];
+ char uniname2ctype_pool_str157[sizeof("incontrolpictures")];
+ char uniname2ctype_pool_str161[sizeof("inmiscellaneoussymbols")];
+ char uniname2ctype_pool_str163[sizeof("inmalayalam")];
+ char uniname2ctype_pool_str166[sizeof("intransportandmapsymbols")];
+ char uniname2ctype_pool_str170[sizeof("inmiscellaneoussymbolsandarrows")];
+ char uniname2ctype_pool_str173[sizeof("inlineara")];
+ char uniname2ctype_pool_str175[sizeof("inmiscellaneoussymbolsandpictographs")];
+ char uniname2ctype_pool_str183[sizeof("taiviet")];
+ char uniname2ctype_pool_str186[sizeof("cwcm")];
+ char uniname2ctype_pool_str190[sizeof("sinhala")];
+ char uniname2ctype_pool_str203[sizeof("latn")];
+ char uniname2ctype_pool_str205[sizeof("latin")];
+ char uniname2ctype_pool_str206[sizeof("ital")];
+ char uniname2ctype_pool_str208[sizeof("intamil")];
+ char uniname2ctype_pool_str209[sizeof("taml")];
+ char uniname2ctype_pool_str223[sizeof("inlatinextendedc")];
+ char uniname2ctype_pool_str226[sizeof("intaile")];
+ char uniname2ctype_pool_str227[sizeof("tale")];
+ char uniname2ctype_pool_str237[sizeof("inlatinextendeda")];
+ char uniname2ctype_pool_str239[sizeof("inlinearbideograms")];
+ char uniname2ctype_pool_str240[sizeof("newtailue")];
+ char uniname2ctype_pool_str241[sizeof("l")];
+ char uniname2ctype_pool_str243[sizeof("nl")];
+ char uniname2ctype_pool_str247[sizeof("inmeeteimayekextensions")];
+ char uniname2ctype_pool_str250[sizeof("zl")];
+ char uniname2ctype_pool_str252[sizeof("lt")];
+ char uniname2ctype_pool_str255[sizeof("inrunic")];
+ char uniname2ctype_pool_str256[sizeof("incarian")];
+ char uniname2ctype_pool_str257[sizeof("armn")];
+ char uniname2ctype_pool_str259[sizeof("cari")];
+ char uniname2ctype_pool_str260[sizeof("armi")];
+ char uniname2ctype_pool_str261[sizeof("inlatinextendede")];
+ char uniname2ctype_pool_str263[sizeof("incyrillic")];
+ char uniname2ctype_pool_str266[sizeof("armenian")];
+ char uniname2ctype_pool_str267[sizeof("inmyanmar")];
+ char uniname2ctype_pool_str270[sizeof("innewtailue")];
+ char uniname2ctype_pool_str272[sizeof("carian")];
+ char uniname2ctype_pool_str274[sizeof("merc")];
+ char uniname2ctype_pool_str280[sizeof("arabic")];
+ char uniname2ctype_pool_str284[sizeof("inmiscellaneoustechnical")];
+ char uniname2ctype_pool_str287[sizeof("insyriac")];
+ char uniname2ctype_pool_str288[sizeof("samr")];
+ char uniname2ctype_pool_str294[sizeof("zinh")];
+ char uniname2ctype_pool_str295[sizeof("han")];
+ char uniname2ctype_pool_str298[sizeof("samaritan")];
+ char uniname2ctype_pool_str299[sizeof("hani")];
+ char uniname2ctype_pool_str302[sizeof("cwt")];
+ char uniname2ctype_pool_str303[sizeof("incherokee")];
+ char uniname2ctype_pool_str304[sizeof("insharada")];
+ char uniname2ctype_pool_str307[sizeof("cham")];
+ char uniname2ctype_pool_str315[sizeof("manichaean")];
+ char uniname2ctype_pool_str316[sizeof("inmahajani")];
+ char uniname2ctype_pool_str317[sizeof("cntrl")];
+ char uniname2ctype_pool_str318[sizeof("sinh")];
+ char uniname2ctype_pool_str320[sizeof("inruminumeralsymbols")];
+ char uniname2ctype_pool_str327[sizeof("inethiopic")];
+ char uniname2ctype_pool_str330[sizeof("tamil")];
+ char uniname2ctype_pool_str331[sizeof("miao")];
+ char uniname2ctype_pool_str332[sizeof("inenclosedalphanumerics")];
+ char uniname2ctype_pool_str333[sizeof("term")];
+ char uniname2ctype_pool_str335[sizeof("chakma")];
+ char uniname2ctype_pool_str337[sizeof("insinhala")];
+ char uniname2ctype_pool_str347[sizeof("shavian")];
+ char uniname2ctype_pool_str350[sizeof("inosmanya")];
+ char uniname2ctype_pool_str353[sizeof("inlatinextendedadditional")];
+ char uniname2ctype_pool_str359[sizeof("osma")];
+ char uniname2ctype_pool_str362[sizeof("ll")];
+ char uniname2ctype_pool_str363[sizeof("thai")];
+ char uniname2ctype_pool_str366[sizeof("math")];
+ char uniname2ctype_pool_str372[sizeof("thaa")];
+ char uniname2ctype_pool_str374[sizeof("inenclosedalphanumericsupplement")];
+ char uniname2ctype_pool_str375[sizeof("ethi")];
+ char uniname2ctype_pool_str376[sizeof("connectorpunctuation")];
+ char uniname2ctype_pool_str380[sizeof("inlowsurrogates")];
+ char uniname2ctype_pool_str382[sizeof("insinhalaarchaicnumbers")];
+ char uniname2ctype_pool_str386[sizeof("taitham")];
+ char uniname2ctype_pool_str388[sizeof("thaana")];
+ char uniname2ctype_pool_str390[sizeof("lineara")];
+ char uniname2ctype_pool_str392[sizeof("di")];
+ char uniname2ctype_pool_str401[sizeof("idc")];
+ char uniname2ctype_pool_str405[sizeof("meroiticcursive")];
+ char uniname2ctype_pool_str407[sizeof("mand")];
+ char uniname2ctype_pool_str408[sizeof("inmodi")];
+ char uniname2ctype_pool_str410[sizeof("inmandaic")];
+ char uniname2ctype_pool_str412[sizeof("cwl")];
+ char uniname2ctype_pool_str414[sizeof("asciihexdigit")];
+ char uniname2ctype_pool_str415[sizeof("dia")];
+ char uniname2ctype_pool_str418[sizeof("terminalpunctuation")];
+ char uniname2ctype_pool_str419[sizeof("mend")];
+ char uniname2ctype_pool_str423[sizeof("sind")];
+ char uniname2ctype_pool_str425[sizeof("wara")];
+ char uniname2ctype_pool_str433[sizeof("inwarangciti")];
+ char uniname2ctype_pool_str439[sizeof("inideographicdescriptioncharacters")];
+ char uniname2ctype_pool_str441[sizeof("inemoticons")];
+ char uniname2ctype_pool_str453[sizeof("ids")];
+ char uniname2ctype_pool_str456[sizeof("insundanese")];
+ char uniname2ctype_pool_str466[sizeof("pi")];
+ char uniname2ctype_pool_str468[sizeof("indominotiles")];
+ char uniname2ctype_pool_str470[sizeof("pc")];
+ char uniname2ctype_pool_str476[sizeof("loe")];
+ char uniname2ctype_pool_str477[sizeof("titlecaseletter")];
+ char uniname2ctype_pool_str485[sizeof("inopticalcharacterrecognition")];
+ char uniname2ctype_pool_str487[sizeof("idst")];
+ char uniname2ctype_pool_str489[sizeof("shaw")];
+ char uniname2ctype_pool_str490[sizeof("cwcf")];
+ char uniname2ctype_pool_str493[sizeof("idcontinue")];
+ char uniname2ctype_pool_str502[sizeof("inphaistosdisc")];
+ char uniname2ctype_pool_str508[sizeof("pe")];
+ char uniname2ctype_pool_str518[sizeof("indeseret")];
+ char uniname2ctype_pool_str519[sizeof("inspacingmodifierletters")];
+ char uniname2ctype_pool_str520[sizeof("inlydian")];
+ char uniname2ctype_pool_str522[sizeof("ps")];
+ char uniname2ctype_pool_str530[sizeof("hira")];
+ char uniname2ctype_pool_str536[sizeof("whitespace")];
+ char uniname2ctype_pool_str540[sizeof("inscriptionalparthian")];
+ char uniname2ctype_pool_str544[sizeof("cher")];
+ char uniname2ctype_pool_str545[sizeof("inmathematicalalphanumericsymbols")];
+ char uniname2ctype_pool_str546[sizeof("incoptic")];
+ char uniname2ctype_pool_str550[sizeof("inhiragana")];
+ char uniname2ctype_pool_str554[sizeof("inenclosedcjklettersandmonths")];
+ char uniname2ctype_pool_str556[sizeof("space")];
+ char uniname2ctype_pool_str570[sizeof("oriya")];
+ char uniname2ctype_pool_str571[sizeof("mero")];
+ char uniname2ctype_pool_str573[sizeof("mahj")];
+ char uniname2ctype_pool_str582[sizeof("tirh")];
+ char uniname2ctype_pool_str584[sizeof("sora")];
+ char uniname2ctype_pool_str587[sizeof("inscriptionalpahlavi")];
+ char uniname2ctype_pool_str593[sizeof("inarrows")];
+ char uniname2ctype_pool_str594[sizeof("mahajani")];
+ char uniname2ctype_pool_str596[sizeof("joinc")];
+ char uniname2ctype_pool_str597[sizeof("incopticepactnumbers")];
+ char uniname2ctype_pool_str598[sizeof("hano")];
+ char uniname2ctype_pool_str600[sizeof("palm")];
+ char uniname2ctype_pool_str601[sizeof("intirhuta")];
+ char uniname2ctype_pool_str603[sizeof("patws")];
+ char uniname2ctype_pool_str604[sizeof("inolchiki")];
+ char uniname2ctype_pool_str608[sizeof("inlepcha")];
+ char uniname2ctype_pool_str609[sizeof("no")];
+ char uniname2ctype_pool_str611[sizeof("lepc")];
+ char uniname2ctype_pool_str612[sizeof("inogham")];
+ char uniname2ctype_pool_str614[sizeof("co")];
+ char uniname2ctype_pool_str617[sizeof("innko")];
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_str622[sizeof("psalterpahlavi")];
+ char uniname2ctype_pool_str623[sizeof("inmro")];
+ char uniname2ctype_pool_str624[sizeof("inpalmyrene")];
+ char uniname2ctype_pool_str627[sizeof("common")];
+ char uniname2ctype_pool_str630[sizeof("cf")];
+ char uniname2ctype_pool_str637[sizeof("inmiao")];
+ char uniname2ctype_pool_str640[sizeof("so")];
+ char uniname2ctype_pool_str650[sizeof("diacritic")];
+ char uniname2ctype_pool_str658[sizeof("insundanesesupplement")];
+ char uniname2ctype_pool_str672[sizeof("intifinagh")];
+ char uniname2ctype_pool_str679[sizeof("tifinagh")];
+ char uniname2ctype_pool_str696[sizeof("odi")];
+ char uniname2ctype_pool_str699[sizeof("oidc")];
+ char uniname2ctype_pool_str700[sizeof("modi")];
+ char uniname2ctype_pool_str703[sizeof("decimalnumber")];
+ char uniname2ctype_pool_str705[sizeof("letter")];
+ char uniname2ctype_pool_str708[sizeof("dash")];
+ char uniname2ctype_pool_str709[sizeof("insylotinagri")];
+ char uniname2ctype_pool_str711[sizeof("inolditalic")];
+ char uniname2ctype_pool_str713[sizeof("wspace")];
+ char uniname2ctype_pool_str715[sizeof("dsrt")];
+ char uniname2ctype_pool_str718[sizeof("ideo")];
+ char uniname2ctype_pool_str722[sizeof("siddham")];
+ char uniname2ctype_pool_str724[sizeof("perm")];
+ char uniname2ctype_pool_str725[sizeof("oids")];
+ char uniname2ctype_pool_str727[sizeof("inmahjongtiles")];
+ char uniname2ctype_pool_str728[sizeof("lo")];
+ char uniname2ctype_pool_str730[sizeof("lineseparator")];
+ char uniname2ctype_pool_str731[sizeof("imperialaramaic")];
+ char uniname2ctype_pool_str735[sizeof("idstart")];
+ char uniname2ctype_pool_str736[sizeof("inlao")];
+ char uniname2ctype_pool_str737[sizeof("sharada")];
+ char uniname2ctype_pool_str742[sizeof("lao")];
+ char uniname2ctype_pool_str743[sizeof("laoo")];
+ char uniname2ctype_pool_str744[sizeof("mongolian")];
+ char uniname2ctype_pool_str745[sizeof("oalpha")];
+ char uniname2ctype_pool_str749[sizeof("inimperialaramaic")];
+ char uniname2ctype_pool_str753[sizeof("nchar")];
+ char uniname2ctype_pool_str758[sizeof("inlatin1supplement")];
+ char uniname2ctype_pool_str761[sizeof("prti")];
+ char uniname2ctype_pool_str763[sizeof("cprt")];
+ char uniname2ctype_pool_str767[sizeof("nd")];
+ char uniname2ctype_pool_str768[sizeof("deseret")];
+ char uniname2ctype_pool_str772[sizeof("inoldturkic")];
+ char uniname2ctype_pool_str773[sizeof("radical")];
+ char uniname2ctype_pool_str777[sizeof("canadianaboriginal")];
+ char uniname2ctype_pool_str779[sizeof("inmodifiertoneletters")];
+ char uniname2ctype_pool_str783[sizeof("incaucasianalbanian")];
+ char uniname2ctype_pool_str787[sizeof("coptic")];
+ char uniname2ctype_pool_str796[sizeof("casedletter")];
+ char uniname2ctype_pool_str798[sizeof("sd")];
+ char uniname2ctype_pool_str803[sizeof("inphoenician")];
+ char uniname2ctype_pool_str804[sizeof("sidd")];
+ char uniname2ctype_pool_str805[sizeof("privateuse")];
+ char uniname2ctype_pool_str813[sizeof("sundanese")];
+ char uniname2ctype_pool_str815[sizeof("inancientgreekmusicalnotation")];
+ char uniname2ctype_pool_str817[sizeof("insiddham")];
+ char uniname2ctype_pool_str820[sizeof("cased")];
+ char uniname2ctype_pool_str827[sizeof("print")];
+ char uniname2ctype_pool_str830[sizeof("ininscriptionalparthian")];
+ char uniname2ctype_pool_str832[sizeof("ininscriptionalpahlavi")];
+ char uniname2ctype_pool_str834[sizeof("copt")];
+ char uniname2ctype_pool_str838[sizeof("inancientgreeknumbers")];
+ char uniname2ctype_pool_str845[sizeof("saurashtra")];
+ char uniname2ctype_pool_str848[sizeof("mro")];
+ char uniname2ctype_pool_str849[sizeof("mroo")];
+ char uniname2ctype_pool_str850[sizeof("inalphabeticpresentationforms")];
+ char uniname2ctype_pool_str858[sizeof("lowercase")];
+ char uniname2ctype_pool_str861[sizeof("phli")];
+ char uniname2ctype_pool_str864[sizeof("patternwhitespace")];
+ char uniname2ctype_pool_str866[sizeof("inenclosedideographicsupplement")];
+ char uniname2ctype_pool_str869[sizeof("spaceseparator")];
+ char uniname2ctype_pool_str871[sizeof("inmathematicaloperators")];
+ char uniname2ctype_pool_str882[sizeof("omath")];
+ char uniname2ctype_pool_str892[sizeof("lisu")];
+ char uniname2ctype_pool_str895[sizeof("inpsalterpahlavi")];
+ char uniname2ctype_pool_str898[sizeof("olditalic")];
+ char uniname2ctype_pool_str905[sizeof("hanunoo")];
+ char uniname2ctype_pool_str909[sizeof("inherited")];
+ char uniname2ctype_pool_str910[sizeof("lepcha")];
+ char uniname2ctype_pool_str913[sizeof("p")];
+ char uniname2ctype_pool_str916[sizeof("inmongolian")];
+ char uniname2ctype_pool_str922[sizeof("zp")];
+ char uniname2ctype_pool_str923[sizeof("finalpunctuation")];
+ char uniname2ctype_pool_str925[sizeof("otheridcontinue")];
+ char uniname2ctype_pool_str927[sizeof("shrd")];
+ char uniname2ctype_pool_str932[sizeof("ingrantha")];
+ char uniname2ctype_pool_str934[sizeof("talu")];
+ char uniname2ctype_pool_str936[sizeof("otheralphabetic")];
+ char uniname2ctype_pool_str938[sizeof("noncharactercodepoint")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str939[sizeof("age=1.1")];
+ char uniname2ctype_pool_str940[sizeof("age=2.1")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str941[sizeof("closepunctuation")];
+ char uniname2ctype_pool_str943[sizeof("letternumber")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str944[sizeof("age=6.1")];
+ char uniname2ctype_pool_str945[sizeof("age=6.2")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str946[sizeof("telu")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str947[sizeof("age=3.1")];
+ char uniname2ctype_pool_str948[sizeof("age=3.2")];
+ char uniname2ctype_pool_str949[sizeof("age=5.1")];
+ char uniname2ctype_pool_str950[sizeof("age=5.2")];
+ char uniname2ctype_pool_str951[sizeof("age=2.0")];
+ char uniname2ctype_pool_str952[sizeof("age=6.3")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str953[sizeof("inshorthandformatcontrols")];
+ char uniname2ctype_pool_str954[sizeof("inoldnortharabian")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str955[sizeof("age=6.0")];
+ char uniname2ctype_pool_str956[sizeof("age=4.1")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str957[sizeof("ingeneralpunctuation")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str958[sizeof("age=3.0")];
+ char uniname2ctype_pool_str959[sizeof("age=7.0")];
+ char uniname2ctype_pool_str960[sizeof("age=5.0")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str962[sizeof("innabataean")];
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ char uniname2ctype_pool_str967[sizeof("age=4.0")];
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ char uniname2ctype_pool_str970[sizeof("bamum")];
+ char uniname2ctype_pool_str972[sizeof("control")];
+ char uniname2ctype_pool_str974[sizeof("induployan")];
+ char uniname2ctype_pool_str975[sizeof("inlatinextendedd")];
+ char uniname2ctype_pool_str976[sizeof("inarabic")];
+ char uniname2ctype_pool_str982[sizeof("runic")];
+ char uniname2ctype_pool_str984[sizeof("inelbasan")];
+ char uniname2ctype_pool_str985[sizeof("inoldsoutharabian")];
+ char uniname2ctype_pool_str986[sizeof("inbasiclatin")];
+ char uniname2ctype_pool_str995[sizeof("format")];
+ char uniname2ctype_pool_str996[sizeof("innumberforms")];
+ char uniname2ctype_pool_str998[sizeof("inugaritic")];
+ char uniname2ctype_pool_str999[sizeof("separator")];
+ char uniname2ctype_pool_str1000[sizeof("idsbinaryoperator")];
+ char uniname2ctype_pool_str1004[sizeof("tagbanwa")];
+ char uniname2ctype_pool_str1012[sizeof("bass")];
+ char uniname2ctype_pool_str1013[sizeof("saur")];
+ char uniname2ctype_pool_str1014[sizeof("nbat")];
+ char uniname2ctype_pool_str1017[sizeof("intaixuanjingsymbols")];
+ char uniname2ctype_pool_str1019[sizeof("joincontrol")];
+ char uniname2ctype_pool_str1023[sizeof("otheridstart")];
+ char uniname2ctype_pool_str1027[sizeof("inbyzantinemusicalsymbols")];
+ char uniname2ctype_pool_str1031[sizeof("intags")];
+ char uniname2ctype_pool_str1033[sizeof("nabataean")];
+ char uniname2ctype_pool_str1034[sizeof("insuperscriptsandsubscripts")];
+ char uniname2ctype_pool_str1036[sizeof("intibetan")];
+ char uniname2ctype_pool_str1039[sizeof("insaurashtra")];
+ char uniname2ctype_pool_str1040[sizeof("othersymbol")];
+ char uniname2ctype_pool_str1041[sizeof("ext")];
+ char uniname2ctype_pool_str1046[sizeof("inarabicpresentationformsa")];
+ char uniname2ctype_pool_str1048[sizeof("inmiscellaneousmathematicalsymbolsb")];
+ char uniname2ctype_pool_str1049[sizeof("otherlowercase")];
+ char uniname2ctype_pool_str1052[sizeof("phoenician")];
+ char uniname2ctype_pool_str1055[sizeof("lower")];
+ char uniname2ctype_pool_str1060[sizeof("linb")];
+ char uniname2ctype_pool_str1064[sizeof("po")];
+ char uniname2ctype_pool_str1065[sizeof("inmyanmarextendedb")];
+ char uniname2ctype_pool_str1066[sizeof("limb")];
+ char uniname2ctype_pool_str1068[sizeof("inbraillepatterns")];
+ char uniname2ctype_pool_str1069[sizeof("tibt")];
+ char uniname2ctype_pool_str1070[sizeof("cuneiform")];
+ char uniname2ctype_pool_str1072[sizeof("bali")];
+ char uniname2ctype_pool_str1073[sizeof("oldpersian")];
+ char uniname2ctype_pool_str1077[sizeof("oldpermic")];
+ char uniname2ctype_pool_str1080[sizeof("pf")];
+ char uniname2ctype_pool_str1084[sizeof("word")];
+ char uniname2ctype_pool_str1086[sizeof("tibetan")];
+ char uniname2ctype_pool_str1089[sizeof("incyrillicsupplement")];
+ char uniname2ctype_pool_str1093[sizeof("elba")];
+ char uniname2ctype_pool_str1094[sizeof("insupplementalmathematicaloperators")];
+ char uniname2ctype_pool_str1095[sizeof("inbalinese")];
+ char uniname2ctype_pool_str1101[sizeof("bengali")];
+ char uniname2ctype_pool_str1104[sizeof("caseignorable")];
+ char uniname2ctype_pool_str1107[sizeof("incountingrodnumerals")];
+ char uniname2ctype_pool_str1114[sizeof("other")];
+ char uniname2ctype_pool_str1118[sizeof("tirhuta")];
+ char uniname2ctype_pool_str1121[sizeof("othernumber")];
+ char uniname2ctype_pool_str1123[sizeof("balinese")];
+ char uniname2ctype_pool_str1129[sizeof("elbasan")];
+ char uniname2ctype_pool_str1134[sizeof("inunifiedcanadianaboriginalsyllabics")];
+ char uniname2ctype_pool_str1136[sizeof("lowercaseletter")];
+ char uniname2ctype_pool_str1140[sizeof("ethiopic")];
+ char uniname2ctype_pool_str1141[sizeof("gran")];
+ char uniname2ctype_pool_str1149[sizeof("ingurmukhi")];
+ char uniname2ctype_pool_str1151[sizeof("sund")];
+ char uniname2ctype_pool_str1153[sizeof("inethiopicsupplement")];
+ char uniname2ctype_pool_str1160[sizeof("inoldpersian")];
+ char uniname2ctype_pool_str1163[sizeof("inoldpermic")];
+ char uniname2ctype_pool_str1170[sizeof("othermath")];
+ char uniname2ctype_pool_str1174[sizeof("unassigned")];
+ char uniname2ctype_pool_str1180[sizeof("hmng")];
+ char uniname2ctype_pool_str1181[sizeof("narb")];
+ char uniname2ctype_pool_str1184[sizeof("brai")];
+ char uniname2ctype_pool_str1186[sizeof("hang")];
+ char uniname2ctype_pool_str1187[sizeof("insorasompeng")];
+ char uniname2ctype_pool_str1193[sizeof("arab")];
+ char uniname2ctype_pool_str1194[sizeof("plrd")];
+ char uniname2ctype_pool_str1195[sizeof("ingujarati")];
+ char uniname2ctype_pool_str1197[sizeof("brahmi")];
+ char uniname2ctype_pool_str1201[sizeof("runr")];
+ char uniname2ctype_pool_str1202[sizeof("ahex")];
+ char uniname2ctype_pool_str1206[sizeof("mong")];
+ char uniname2ctype_pool_str1211[sizeof("pauc")];
+ char uniname2ctype_pool_str1212[sizeof("sarb")];
+ char uniname2ctype_pool_str1218[sizeof("ogam")];
+ char uniname2ctype_pool_str1221[sizeof("olower")];
+ char uniname2ctype_pool_str1222[sizeof("pd")];
+ char uniname2ctype_pool_str1235[sizeof("number")];
+ char uniname2ctype_pool_str1238[sizeof("inbrahmi")];
+ char uniname2ctype_pool_str1240[sizeof("otherletter")];
+ char uniname2ctype_pool_str1252[sizeof("ingothic")];
+ char uniname2ctype_pool_str1254[sizeof("phagspa")];
+ char uniname2ctype_pool_str1262[sizeof("inletterlikesymbols")];
+ char uniname2ctype_pool_str1265[sizeof("yi")];
+ char uniname2ctype_pool_str1269[sizeof("hangul")];
+ char uniname2ctype_pool_str1271[sizeof("yiii")];
+ char uniname2ctype_pool_str1272[sizeof("tfng")];
+ char uniname2ctype_pool_str1273[sizeof("insupplementalarrowsc")];
+ char uniname2ctype_pool_str1277[sizeof("ingreekandcoptic")];
+ char uniname2ctype_pool_str1279[sizeof("xidc")];
+ char uniname2ctype_pool_str1280[sizeof("insupplementalarrowsa")];
+ char uniname2ctype_pool_str1281[sizeof("gothic")];
+ char uniname2ctype_pool_str1283[sizeof("grext")];
+ char uniname2ctype_pool_str1285[sizeof("incombininghalfmarks")];
+ char uniname2ctype_pool_str1286[sizeof("deprecated")];
+ char uniname2ctype_pool_str1287[sizeof("inbassavah")];
+ char uniname2ctype_pool_str1305[sizeof("xids")];
+ char uniname2ctype_pool_str1308[sizeof("linearb")];
+ char uniname2ctype_pool_str1312[sizeof("ingeometricshapes")];
+ char uniname2ctype_pool_str1313[sizeof("phlp")];
+ char uniname2ctype_pool_str1314[sizeof("warangciti")];
+ char uniname2ctype_pool_str1317[sizeof("inblockelements")];
+ char uniname2ctype_pool_str1318[sizeof("modifierletter")];
+ char uniname2ctype_pool_str1321[sizeof("indingbats")];
+ char uniname2ctype_pool_str1322[sizeof("dep")];
+ char uniname2ctype_pool_str1324[sizeof("punct")];
+ char uniname2ctype_pool_str1327[sizeof("inhanunoo")];
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_str1344[sizeof("ingreekextended")];
+ char uniname2ctype_pool_str1353[sizeof("idsb")];
+ char uniname2ctype_pool_str1359[sizeof("assigned")];
+ char uniname2ctype_pool_str1364[sizeof("otherpunctuation")];
+ char uniname2ctype_pool_str1368[sizeof("inhangulsyllables")];
+ char uniname2ctype_pool_str1373[sizeof("inarabicmathematicalalphabeticsymbols")];
+ char uniname2ctype_pool_str1385[sizeof("inornamentaldingbats")];
+ char uniname2ctype_pool_str1387[sizeof("inphagspa")];
+ char uniname2ctype_pool_str1389[sizeof("lyci")];
+ char uniname2ctype_pool_str1393[sizeof("mlym")];
+ char uniname2ctype_pool_str1399[sizeof("inarabicextendeda")];
+ char uniname2ctype_pool_str1400[sizeof("rjng")];
+ char uniname2ctype_pool_str1402[sizeof("lycian")];
+ char uniname2ctype_pool_str1403[sizeof("inalchemicalsymbols")];
+ char uniname2ctype_pool_str1409[sizeof("xdigit")];
+ char uniname2ctype_pool_str1412[sizeof("digit")];
+ char uniname2ctype_pool_str1420[sizeof("xidstart")];
+ char uniname2ctype_pool_str1421[sizeof("inrejang")];
+ char uniname2ctype_pool_str1424[sizeof("malayalam")];
+ char uniname2ctype_pool_str1425[sizeof("idstrinaryoperator")];
+ char uniname2ctype_pool_str1429[sizeof("invai")];
+ char uniname2ctype_pool_str1435[sizeof("vai")];
+ char uniname2ctype_pool_str1436[sizeof("vaii")];
+ char uniname2ctype_pool_str1438[sizeof("hiragana")];
+ char uniname2ctype_pool_str1442[sizeof("ingeorgian")];
+ char uniname2ctype_pool_str1448[sizeof("braille")];
+ char uniname2ctype_pool_str1455[sizeof("geor")];
+ char uniname2ctype_pool_str1457[sizeof("brah")];
+ char uniname2ctype_pool_str1463[sizeof("glagolitic")];
+ char uniname2ctype_pool_str1465[sizeof("inkannada")];
+ char uniname2ctype_pool_str1466[sizeof("cakm")];
+ char uniname2ctype_pool_str1467[sizeof("kana")];
+ char uniname2ctype_pool_str1469[sizeof("hebr")];
+ char uniname2ctype_pool_str1471[sizeof("inshavian")];
+ char uniname2ctype_pool_str1477[sizeof("vs")];
+ char uniname2ctype_pool_str1481[sizeof("inchakma")];
+ char uniname2ctype_pool_str1490[sizeof("ogham")];
+ char uniname2ctype_pool_str1491[sizeof("sylotinagri")];
+ char uniname2ctype_pool_str1492[sizeof("inunifiedcanadianaboriginalsyllabicsextended")];
+ char uniname2ctype_pool_str1495[sizeof("inmeroitichieroglyphs")];
+ char uniname2ctype_pool_str1498[sizeof("grantha")];
+ char uniname2ctype_pool_str1500[sizeof("graphemebase")];
+ char uniname2ctype_pool_str1502[sizeof("mathsymbol")];
+ char uniname2ctype_pool_str1505[sizeof("mymr")];
+ char uniname2ctype_pool_str1513[sizeof("insupplementaryprivateuseareaa")];
+ char uniname2ctype_pool_str1514[sizeof("mendekikakui")];
+ char uniname2ctype_pool_str1516[sizeof("incjkcompatibilityforms")];
+ char uniname2ctype_pool_str1518[sizeof("inhalfwidthandfullwidthforms")];
+ char uniname2ctype_pool_str1521[sizeof("incjkcompatibilityideographs")];
+ char uniname2ctype_pool_str1522[sizeof("inkaithi")];
+ char uniname2ctype_pool_str1525[sizeof("avst")];
+ char uniname2ctype_pool_str1526[sizeof("inarabicsupplement")];
+ char uniname2ctype_pool_str1527[sizeof("takri")];
+ char uniname2ctype_pool_str1529[sizeof("syrc")];
+ char uniname2ctype_pool_str1533[sizeof("meeteimayek")];
+ char uniname2ctype_pool_str1534[sizeof("myanmar")];
+ char uniname2ctype_pool_str1535[sizeof("avestan")];
+ char uniname2ctype_pool_str1536[sizeof("inhanguljamoextendeda")];
+ char uniname2ctype_pool_str1540[sizeof("goth")];
+ char uniname2ctype_pool_str1542[sizeof("inkatakana")];
+ char uniname2ctype_pool_str1544[sizeof("incyrillicextendeda")];
+ char uniname2ctype_pool_str1549[sizeof("alphabetic")];
+ char uniname2ctype_pool_str1550[sizeof("syriac")];
+ char uniname2ctype_pool_str1551[sizeof("ideographic")];
+ char uniname2ctype_pool_str1555[sizeof("incjkstrokes")];
+ char uniname2ctype_pool_str1557[sizeof("inlinearbsyllabary")];
+ char uniname2ctype_pool_str1558[sizeof("tavt")];
+ char uniname2ctype_pool_str1559[sizeof("intaiviet")];
+ char uniname2ctype_pool_str1564[sizeof("incjkcompatibilityideographssupplement")];
+ char uniname2ctype_pool_str1576[sizeof("inmeeteimayek")];
+ char uniname2ctype_pool_str1577[sizeof("kali")];
+ char uniname2ctype_pool_str1581[sizeof("inyiradicals")];
+ char uniname2ctype_pool_str1586[sizeof("lu")];
+ char uniname2ctype_pool_str1587[sizeof("inoriya")];
+ char uniname2ctype_pool_str1590[sizeof("hebrew")];
+ char uniname2ctype_pool_str1596[sizeof("extender")];
+ char uniname2ctype_pool_str1598[sizeof("inhighprivateusesurrogates")];
+ char uniname2ctype_pool_str1600[sizeof("limbu")];
+ char uniname2ctype_pool_str1606[sizeof("inbuhid")];
+ char uniname2ctype_pool_str1608[sizeof("inethiopicextendeda")];
+ char uniname2ctype_pool_str1609[sizeof("xidcontinue")];
+ char uniname2ctype_pool_str1611[sizeof("inyijinghexagramsymbols")];
+ char uniname2ctype_pool_str1612[sizeof("logicalorderexception")];
+ char uniname2ctype_pool_str1616[sizeof("inhebrew")];
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")];
+ char uniname2ctype_pool_str1618[sizeof("osmanya")];
+ char uniname2ctype_pool_str1621[sizeof("phnx")];
+ char uniname2ctype_pool_str1622[sizeof("incombiningdiacriticalmarks")];
+ char uniname2ctype_pool_str1626[sizeof("inkanasupplement")];
+ char uniname2ctype_pool_str1627[sizeof("inlisu")];
+ char uniname2ctype_pool_str1628[sizeof("changeswhencasemapped")];
+ char uniname2ctype_pool_str1632[sizeof("incombiningdiacriticalmarksforsymbols")];
+ char uniname2ctype_pool_str1636[sizeof("cwu")];
+ char uniname2ctype_pool_str1641[sizeof("phag")];
+ char uniname2ctype_pool_str1645[sizeof("insmallformvariants")];
+ char uniname2ctype_pool_str1656[sizeof("inpahawhhmong")];
+ char uniname2ctype_pool_str1661[sizeof("otheruppercase")];
+ char uniname2ctype_pool_str1662[sizeof("intelugu")];
+ char uniname2ctype_pool_str1665[sizeof("incombiningdiacriticalmarkssupplement")];
+ char uniname2ctype_pool_str1670[sizeof("ingeometricshapesextended")];
+ char uniname2ctype_pool_str1671[sizeof("xpeo")];
+ char uniname2ctype_pool_str1687[sizeof("bamu")];
+ char uniname2ctype_pool_str1689[sizeof("inbamum")];
+ char uniname2ctype_pool_str1692[sizeof("mark")];
+ char uniname2ctype_pool_str1694[sizeof("dupl")];
+ char uniname2ctype_pool_str1695[sizeof("graph")];
+ char uniname2ctype_pool_str1696[sizeof("dashpunctuation")];
+ char uniname2ctype_pool_str1700[sizeof("patternsyntax")];
+ char uniname2ctype_pool_str1705[sizeof("changeswhentitlecased")];
+ char uniname2ctype_pool_str1706[sizeof("inkharoshthi")];
+ char uniname2ctype_pool_str1712[sizeof("inkhmer")];
+ char uniname2ctype_pool_str1713[sizeof("java")];
+ char uniname2ctype_pool_str1714[sizeof("sylo")];
+ char uniname2ctype_pool_str1719[sizeof("ugaritic")];
+ char uniname2ctype_pool_str1722[sizeof("otherdefaultignorablecodepoint")];
+ char uniname2ctype_pool_str1723[sizeof("softdotted")];
+ char uniname2ctype_pool_str1729[sizeof("uideo")];
+ char uniname2ctype_pool_str1732[sizeof("inphoneticextensions")];
+ char uniname2ctype_pool_str1736[sizeof("injavanese")];
+ char uniname2ctype_pool_str1742[sizeof("invariationselectors")];
+ char uniname2ctype_pool_str1744[sizeof("kaithi")];
+ char uniname2ctype_pool_str1747[sizeof("cyrillic")];
+ char uniname2ctype_pool_str1749[sizeof("intakri")];
+ char uniname2ctype_pool_str1750[sizeof("takr")];
+ char uniname2ctype_pool_str1755[sizeof("javanese")];
+ char uniname2ctype_pool_str1757[sizeof("bidicontrol")];
+ char uniname2ctype_pool_str1758[sizeof("caucasianalbanian")];
+ char uniname2ctype_pool_str1765[sizeof("lydi")];
+ char uniname2ctype_pool_str1772[sizeof("insupplementalpunctuation")];
+ char uniname2ctype_pool_str1775[sizeof("inphoneticextensionssupplement")];
+ char uniname2ctype_pool_str1778[sizeof("lydian")];
+ char uniname2ctype_pool_str1784[sizeof("oldturkic")];
+ char uniname2ctype_pool_str1785[sizeof("invariationselectorssupplement")];
+ char uniname2ctype_pool_str1786[sizeof("kthi")];
+ char uniname2ctype_pool_str1792[sizeof("inhanguljamo")];
+ char uniname2ctype_pool_str1797[sizeof("patsyn")];
+ char uniname2ctype_pool_str1802[sizeof("inlimbu")];
+ char uniname2ctype_pool_str1804[sizeof("sorasompeng")];
+ char uniname2ctype_pool_str1807[sizeof("orya")];
+ char uniname2ctype_pool_str1822[sizeof("inkhmersymbols")];
+ char uniname2ctype_pool_str1824[sizeof("inglagolitic")];
+ char uniname2ctype_pool_str1831[sizeof("indevanagari")];
+ char uniname2ctype_pool_str1835[sizeof("deva")];
+ char uniname2ctype_pool_str1836[sizeof("knda")];
+ char uniname2ctype_pool_str1841[sizeof("inbengali")];
+ char uniname2ctype_pool_str1843[sizeof("symbol")];
+ char uniname2ctype_pool_str1846[sizeof("devanagari")];
+ char uniname2ctype_pool_str1849[sizeof("inmendekikakui")];
+ char uniname2ctype_pool_str1852[sizeof("beng")];
+ char uniname2ctype_pool_str1853[sizeof("invedicextensions")];
+ char uniname2ctype_pool_str1859[sizeof("graphemeextend")];
+ char uniname2ctype_pool_str1865[sizeof("kannada")];
+ char uniname2ctype_pool_str1866[sizeof("inbuginese")];
+ char uniname2ctype_pool_str1869[sizeof("olck")];
+ char uniname2ctype_pool_str1871[sizeof("meroitichieroglyphs")];
+ char uniname2ctype_pool_str1872[sizeof("ugar")];
+ char uniname2ctype_pool_str1874[sizeof("intagalog")];
+ char uniname2ctype_pool_str1878[sizeof("inbamumsupplement")];
+ char uniname2ctype_pool_str1880[sizeof("olchiki")];
+ char uniname2ctype_pool_str1899[sizeof("incurrencysymbols")];
+ char uniname2ctype_pool_str1904[sizeof("tagb")];
+ char uniname2ctype_pool_str1912[sizeof("inaegeannumbers")];
+ char uniname2ctype_pool_str1915[sizeof("intagbanwa")];
+ char uniname2ctype_pool_str1916[sizeof("uppercase")];
+ char uniname2ctype_pool_str1917[sizeof("defaultignorablecodepoint")];
+ char uniname2ctype_pool_str1919[sizeof("glag")];
+ char uniname2ctype_pool_str1921[sizeof("inkatakanaphoneticextensions")];
+ char uniname2ctype_pool_str1932[sizeof("changeswhencasefolded")];
+ char uniname2ctype_pool_str1942[sizeof("inpaucinhau")];
+ char uniname2ctype_pool_str1943[sizeof("inprivateusearea")];
+ char uniname2ctype_pool_str1947[sizeof("paucinhau")];
+ char uniname2ctype_pool_str1953[sizeof("spacingmark")];
+ char uniname2ctype_pool_str1956[sizeof("khmr")];
+ char uniname2ctype_pool_str1962[sizeof("khar")];
+ char uniname2ctype_pool_str1964[sizeof("inarabicpresentationformsb")];
+ char uniname2ctype_pool_str1967[sizeof("changeswhenlowercased")];
+ char uniname2ctype_pool_str1971[sizeof("tglg")];
+ char uniname2ctype_pool_str1976[sizeof("inethiopicextended")];
+ char uniname2ctype_pool_str1980[sizeof("incombiningdiacriticalmarksextended")];
+ char uniname2ctype_pool_str1986[sizeof("oupper")];
+ char uniname2ctype_pool_str1994[sizeof("incjksymbolsandpunctuation")];
+ char uniname2ctype_pool_str1997[sizeof("bopo")];
+ char uniname2ctype_pool_str1998[sizeof("punctuation")];
+ char uniname2ctype_pool_str2002[sizeof("combiningmark")];
+ char uniname2ctype_pool_str2007[sizeof("inplayingcards")];
+ char uniname2ctype_pool_str2008[sizeof("inbopomofo")];
+ char uniname2ctype_pool_str2021[sizeof("hyphen")];
+ char uniname2ctype_pool_str2028[sizeof("inkhojki")];
+ char uniname2ctype_pool_str2046[sizeof("nko")];
+ char uniname2ctype_pool_str2047[sizeof("nkoo")];
+ char uniname2ctype_pool_str2048[sizeof("enclosingmark")];
+ char uniname2ctype_pool_str2053[sizeof("openpunctuation")];
+ char uniname2ctype_pool_str2061[sizeof("currencysymbol")];
+ char uniname2ctype_pool_str2063[sizeof("inverticalforms")];
+ char uniname2ctype_pool_str2071[sizeof("hex")];
+ char uniname2ctype_pool_str2072[sizeof("modifiersymbol")];
+ char uniname2ctype_pool_str2073[sizeof("inlatinextendedb")];
+ char uniname2ctype_pool_str2075[sizeof("kharoshthi")];
+ char uniname2ctype_pool_str2080[sizeof("cherokee")];
+ char uniname2ctype_pool_str2088[sizeof("pahawhhmong")];
+ char uniname2ctype_pool_str2096[sizeof("cypriot")];
+ char uniname2ctype_pool_str2105[sizeof("incypriotsyllabary")];
+ char uniname2ctype_pool_str2110[sizeof("palmyrene")];
+ char uniname2ctype_pool_str2113[sizeof("upper")];
+ char uniname2ctype_pool_str2116[sizeof("aghb")];
+ char uniname2ctype_pool_str2123[sizeof("georgian")];
+ char uniname2ctype_pool_str2131[sizeof("gujr")];
+ char uniname2ctype_pool_str2142[sizeof("grbase")];
+ char uniname2ctype_pool_str2152[sizeof("gujarati")];
+ char uniname2ctype_pool_str2153[sizeof("hexdigit")];
+ char uniname2ctype_pool_str2189[sizeof("khmer")];
+ char uniname2ctype_pool_str2194[sizeof("uppercaseletter")];
+ char uniname2ctype_pool_str2198[sizeof("insupplementalarrowsb")];
+ char uniname2ctype_pool_str2224[sizeof("surrogate")];
+ char uniname2ctype_pool_str2227[sizeof("unifiedideograph")];
+ char uniname2ctype_pool_str2237[sizeof("nonspacingmark")];
+ char uniname2ctype_pool_str2241[sizeof("othergraphemeextend")];
+ char uniname2ctype_pool_str2242[sizeof("indevanagariextended")];
+ char uniname2ctype_pool_str2252[sizeof("orkh")];
+ char uniname2ctype_pool_str2273[sizeof("ingeorgiansupplement")];
+ char uniname2ctype_pool_str2287[sizeof("oldnortharabian")];
+ char uniname2ctype_pool_str2290[sizeof("tagalog")];
+ char uniname2ctype_pool_str2292[sizeof("khoj")];
+ char uniname2ctype_pool_str2311[sizeof("bopomofo")];
+ char uniname2ctype_pool_str2318[sizeof("rejang")];
+ char uniname2ctype_pool_str2326[sizeof("buhd")];
+ char uniname2ctype_pool_str2343[sizeof("incjkradicalssupplement")];
+ char uniname2ctype_pool_str2382[sizeof("inkanbun")];
+ char uniname2ctype_pool_str2406[sizeof("variationselector")];
+ char uniname2ctype_pool_str2417[sizeof("inkangxiradicals")];
+ char uniname2ctype_pool_str2421[sizeof("inhighsurrogates")];
+ char uniname2ctype_pool_str2431[sizeof("insupplementaryprivateuseareab")];
+ char uniname2ctype_pool_str2445[sizeof("ogrext")];
+ char uniname2ctype_pool_str2449[sizeof("batk")];
+ char uniname2ctype_pool_str2454[sizeof("inhanguljamoextendedb")];
+ char uniname2ctype_pool_str2457[sizeof("inbatak")];
+ char uniname2ctype_pool_str2462[sizeof("incyrillicextendedb")];
+ char uniname2ctype_pool_str2502[sizeof("innoblock")];
+ char uniname2ctype_pool_str2527[sizeof("any")];
+ char uniname2ctype_pool_str2534[sizeof("xsux")];
+ char uniname2ctype_pool_str2562[sizeof("bugi")];
+ char uniname2ctype_pool_str2570[sizeof("inkhudawadi")];
+ char uniname2ctype_pool_str2571[sizeof("telugu")];
+ char uniname2ctype_pool_str2579[sizeof("changeswhenuppercased")];
+ char uniname2ctype_pool_str2588[sizeof("grek")];
+ char uniname2ctype_pool_str2591[sizeof("guru")];
+ char uniname2ctype_pool_str2595[sizeof("paragraphseparator")];
+ char uniname2ctype_pool_str2613[sizeof("buginese")];
+ char uniname2ctype_pool_str2617[sizeof("inyisyllables")];
+ char uniname2ctype_pool_str2631[sizeof("egyp")];
+ char uniname2ctype_pool_str2634[sizeof("khudawadi")];
+ char uniname2ctype_pool_str2643[sizeof("unknown")];
+ char uniname2ctype_pool_str2685[sizeof("bassavah")];
+ char uniname2ctype_pool_str2689[sizeof("inegyptianhieroglyphs")];
+ char uniname2ctype_pool_str2709[sizeof("buhid")];
+ char uniname2ctype_pool_str2722[sizeof("inkayahli")];
+ char uniname2ctype_pool_str2732[sizeof("inmeroiticcursive")];
+ char uniname2ctype_pool_str2734[sizeof("incjkcompatibility")];
+ char uniname2ctype_pool_str2787[sizeof("oldsoutharabian")];
+ char uniname2ctype_pool_str2795[sizeof("quotationmark")];
+ char uniname2ctype_pool_str2889[sizeof("inhangulcompatibilityjamo")];
+ char uniname2ctype_pool_str2898[sizeof("qmark")];
+ char uniname2ctype_pool_str2902[sizeof("incjkunifiedideographsextensionc")];
+ char uniname2ctype_pool_str2906[sizeof("sk")];
+ char uniname2ctype_pool_str2909[sizeof("incjkunifiedideographsextensiona")];
+ char uniname2ctype_pool_str2918[sizeof("incjkunifiedideographs")];
+ char uniname2ctype_pool_str2984[sizeof("katakana")];
+ char uniname2ctype_pool_str3112[sizeof("kayahli")];
+ char uniname2ctype_pool_str3137[sizeof("duployan")];
+ char uniname2ctype_pool_str3278[sizeof("incjkunifiedideographsextensiond")];
+ char uniname2ctype_pool_str3360[sizeof("inbopomofoextended")];
+ char uniname2ctype_pool_str3466[sizeof("khojki")];
+ char uniname2ctype_pool_str3777[sizeof("zyyy")];
+ char uniname2ctype_pool_str3778[sizeof("egyptianhieroglyphs")];
+ char uniname2ctype_pool_str3827[sizeof("incjkunifiedideographsextensionb")];
+ char uniname2ctype_pool_str3886[sizeof("batak")];
+ char uniname2ctype_pool_str3941[sizeof("blank")];
+ char uniname2ctype_pool_str3995[sizeof("inboxdrawing")];
+ char uniname2ctype_pool_str4025[sizeof("greek")];
+ char uniname2ctype_pool_str4035[sizeof("gurmukhi")];
+ char uniname2ctype_pool_str4122[sizeof("grlink")];
+ char uniname2ctype_pool_str4322[sizeof("graphemelink")];
#endif /* USE_UNICODE_PROPERTIES */
};
static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
@@ -26709,644 +30424,736 @@ static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
"upper",
#else /* USE_UNICODE_PROPERTIES */
"n",
- "s",
- "z",
- "zs",
- "zzzz",
"cn",
- "cs",
- "ci",
+ "mn",
"c",
- "cf",
+ "m",
+ "ci",
+ "z",
+ "cc",
+ "mc",
+ "mani",
+ "inmanichaean",
+ "qaai",
+ "zzzz",
+ "qaac",
+ "incham",
"sc",
+ "sm",
+ "mandaic",
+ "incuneiform",
"cans",
- "qaai",
- "mn",
+ "me",
+ "inarmenian",
#endif /* USE_UNICODE_PROPERTIES */
"ascii",
#ifdef USE_UNICODE_PROPERTIES
- "cc",
- "qaac",
- "inavestan",
- "inspecials",
- "inipaextensions",
- "mc",
+ "s",
"insamaritan",
- "m",
- "sm",
- "me",
- "inarmenian",
- "incuneiform",
- "mandaic",
- "inancientsymbols",
+ "cs",
+ "zs",
+ "inavestan",
+ "incommonindicnumberforms",
"incuneiformnumbersandpunctuation",
"inthai",
- "inmusicalsymbols",
- "inmiscellaneoussymbols",
- "incham",
- "inmiscellaneoussymbolsandarrows",
+ "inipaextensions",
+ "mtei",
+ "inspecials",
"initialpunctuation",
- "inmiscellaneoussymbolsandpictographs",
+ "inancientsymbols",
"inthaana",
- "taile",
- "mtei",
- "lc",
- "lana",
- "inlycian",
- "intransportandmapsymbols",
- "incontrolpictures",
- "sinhala",
- "incommonindicnumberforms",
"inmiscellaneousmathematicalsymbolsa",
+ "lc",
+ "inmusicalsymbols",
+ "lm",
+ "taile",
"sterm",
+ "lina",
+ "inlycian",
"inmyanmarextendeda",
- "lm",
- "taiviet",
- "inlinearbideograms",
+ "lana",
+ "alnum",
"intaitham",
+ "incontrolpictures",
+ "inmiscellaneoussymbols",
+ "inmalayalam",
+ "intransportandmapsymbols",
+ "inmiscellaneoussymbolsandarrows",
+ "inlineara",
+ "inmiscellaneoussymbolsandpictographs",
+ "taiviet",
+ "cwcm",
+ "sinhala",
"latn",
"latin",
"ital",
- "alnum",
- "inmalayalam",
+ "intamil",
+ "taml",
+ "inlatinextendedc",
"intaile",
"tale",
+ "inlatinextendeda",
+ "inlinearbideograms",
+ "newtailue",
"l",
"nl",
+ "inmeeteimayekextensions",
"zl",
- "intamil",
- "taml",
- "inlatinextendeda",
- "inlatinextendedc",
+ "lt",
"inrunic",
"incarian",
- "insyriac",
- "cari",
- "inmeeteimayekextensions",
- "osma",
- "lt",
- "miao",
- "insharada",
- "incyrillic",
- "carian",
"armn",
- "samr",
+ "cari",
"armi",
- "inideographicdescriptioncharacters",
- "inosmanya",
+ "inlatinextendede",
+ "incyrillic",
"armenian",
"inmyanmar",
- "samaritan",
- "arabic",
- "incherokee",
- "connectorpunctuation",
+ "innewtailue",
+ "carian",
"merc",
+ "arabic",
"inmiscellaneoustechnical",
- "inenclosedalphanumerics",
- "inemoticons",
- "joinc",
+ "insyriac",
+ "samr",
+ "zinh",
+ "han",
+ "samaritan",
+ "hani",
+ "cwt",
+ "incherokee",
+ "insharada",
+ "cham",
+ "manichaean",
+ "inmahajani",
#endif /* USE_UNICODE_PROPERTIES */
"cntrl",
#ifdef USE_UNICODE_PROPERTIES
- "inenclosedcjklettersandmonths",
- "cwcf",
+ "sinh",
"inruminumeralsymbols",
- "ll",
- "term",
- "inlatinextendedadditional",
+ "inethiopic",
"tamil",
- "loe",
- "newtailue",
- "cwcm",
- "inenclosedalphanumericsupplement",
- "sinh",
- "zinh",
- "meroiticcursive",
- "han",
- "hani",
- "inopticalcharacterrecognition",
- "no",
- "so",
- "innewtailue",
+ "miao",
+ "inenclosedalphanumerics",
+ "term",
+ "chakma",
"insinhala",
- "innko",
- "co",
"shavian",
- "terminalpunctuation",
- "intaixuanjingsymbols",
- "inethiopic",
- "sora",
- "inarrows",
- "cham",
- "inlowsurrogates",
- "oriya",
- "ext",
- "cwt",
- "common",
- "inmiao",
+ "inosmanya",
+ "inlatinextendedadditional",
+ "osma",
+ "ll",
"thai",
- "intifinagh",
- "ethi",
- "mero",
- "chakma",
+ "math",
"thaa",
- "inscriptionalparthian",
- "tifinagh",
- "titlecaseletter",
+ "inenclosedalphanumericsupplement",
+ "ethi",
+ "connectorpunctuation",
+ "inlowsurrogates",
+ "insinhalaarchaicnumbers",
+ "taitham",
"thaana",
- "asciihexdigit",
- "math",
+ "lineara",
"di",
- "ids",
- "lo",
- "inlao",
- "taitham",
- "lao",
- "laoo",
- "dia",
"idc",
- "ps",
+ "meroiticcursive",
+ "mand",
+ "inmodi",
+ "inmandaic",
+ "cwl",
+ "asciihexdigit",
+ "dia",
+ "terminalpunctuation",
+ "mend",
+ "sind",
+ "wara",
+ "inwarangciti",
+ "inideographicdescriptioncharacters",
+ "inemoticons",
+ "ids",
"insundanese",
"pi",
- "cwl",
- "pf",
- "mand",
- "insylotinagri",
- "vs",
- "mongolian",
+ "indominotiles",
"pc",
- "inmandaic",
- "invai",
- "lineseparator",
- "pe",
- "vai",
- "vaii",
+ "loe",
+ "titlecaseletter",
+ "inopticalcharacterrecognition",
"idst",
- "indominotiles",
- "inshavian",
- "inspacingmodifierletters",
- "format",
+ "shaw",
+ "cwcf",
+ "idcontinue",
"inphaistosdisc",
- "hano",
-#endif /* USE_UNICODE_PROPERTIES */
- "space",
-#ifdef USE_UNICODE_PROPERTIES
+ "pe",
"indeseret",
- "inolchiki",
- "hira",
- "joincontrol",
- "idcontinue",
- "inmahjongtiles",
- "patws",
+ "inspacingmodifierletters",
"inlydian",
+ "ps",
+ "hira",
+ "whitespace",
+ "inscriptionalparthian",
"cher",
+ "inmathematicalalphanumericsymbols",
+ "incoptic",
"inhiragana",
- "inogham",
- "avst",
+ "inenclosedcjklettersandmonths",
+#endif /* USE_UNICODE_PROPERTIES */
+ "space",
+#ifdef USE_UNICODE_PROPERTIES
+ "oriya",
+ "mero",
+ "mahj",
+ "tirh",
+ "sora",
"inscriptionalpahlavi",
- "incoptic",
- "java",
- "inmathematicalalphanumericsymbols",
- "letter",
- "injavanese",
- "avestan",
- "age=1.1",
- "lepc",
- "age=2.1",
+ "inarrows",
+ "mahajani",
+ "joinc",
+ "incopticepactnumbers",
+ "hano",
+ "palm",
+ "intirhuta",
+ "patws",
+ "inolchiki",
"inlepcha",
- "javanese",
- "shaw",
- "finalpunctuation",
+ "no",
+ "lepc",
+ "inogham",
+ "co",
+ "innko",
"alpha",
- "age=5.1",
- "inmongolian",
- "age=5.2",
- "age=2.0",
- "ahex",
- "ingeneralpunctuation",
- "oids",
- "odi",
- "age=5.0",
- "tavt",
- "intaiviet",
- "age=6.1",
- "age=3.1",
+ "psalterpahlavi",
+ "inmro",
+ "inpalmyrene",
+ "common",
+ "cf",
+ "inmiao",
+ "so",
+ "diacritic",
"insundanesesupplement",
- "age=3.2",
- "age=4.1",
+ "intifinagh",
+ "tifinagh",
+ "odi",
"oidc",
- "tfng",
- "insmallformvariants",
- "ideo",
- "intags",
- "age=6.0",
- "age=3.0",
- "whitespace",
- "age=4.0",
+ "modi",
+ "decimalnumber",
+ "letter",
+ "dash",
+ "insylotinagri",
"inolditalic",
- "oalpha",
- "ingujarati",
- "control",
- "diacritic",
- "tagbanwa",
- "inphoenician",
- "ininscriptionalparthian",
- "ininscriptionalpahlavi",
- "coptic",
+ "wspace",
"dsrt",
- "inmodifiertoneletters",
- "xids",
- "hanunoo",
- "inoldturkic",
- "xidc",
+ "ideo",
+ "siddham",
+ "perm",
+ "oids",
+ "inmahjongtiles",
+ "lo",
+ "lineseparator",
+ "imperialaramaic",
"idstart",
+ "inlao",
+ "sharada",
+ "lao",
+ "laoo",
+ "mongolian",
+ "oalpha",
"inimperialaramaic",
- "invariationselectors",
- "copt",
- "caseignorable",
- "prti",
"nchar",
- "deseret",
- "decimalnumber",
- "cprt",
"inlatin1supplement",
- "imperialaramaic",
- "privateuse",
- "casedletter",
- "lowercase",
- "spaceseparator",
+ "prti",
+ "cprt",
+ "nd",
+ "deseret",
+ "inoldturkic",
"radical",
- "mong",
"canadianaboriginal",
- "letternumber",
- "insorasompeng",
- "dash",
- "wspace",
- "ogam",
- "invariationselectorssupplement",
+ "inmodifiertoneletters",
+ "incaucasianalbanian",
+ "coptic",
+ "casedletter",
+ "sd",
+ "inphoenician",
+ "sidd",
+ "privateuse",
+ "sundanese",
+ "inancientgreekmusicalnotation",
+ "insiddham",
+ "cased",
"print",
- "otheridcontinue",
- "ingurmukhi",
- "closepunctuation",
+ "ininscriptionalparthian",
+ "ininscriptionalpahlavi",
+ "copt",
+ "inancientgreeknumbers",
+ "saurashtra",
+ "mro",
+ "mroo",
+ "inalphabeticpresentationforms",
+ "lowercase",
+ "phli",
+ "patternwhitespace",
+ "inenclosedideographicsupplement",
+ "spaceseparator",
+ "inmathematicaloperators",
+ "omath",
+ "lisu",
+ "inpsalterpahlavi",
"olditalic",
- "noncharactercodepoint",
- "sharada",
- "ingeometricshapes",
+ "hanunoo",
+ "inherited",
+ "lepcha",
+ "p",
+ "inmongolian",
+ "zp",
+ "finalpunctuation",
+ "otheridcontinue",
+ "shrd",
+ "ingrantha",
+ "talu",
"otheralphabetic",
- "patternwhitespace",
- "po",
- "rjng",
- "ingreekandcoptic",
- "xdigit",
- "gothic",
+ "noncharactercodepoint",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=1.1",
+ "age=2.1",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "closepunctuation",
+ "letternumber",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=6.1",
+ "age=6.2",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "telu",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=3.1",
+ "age=3.2",
+ "age=5.1",
+ "age=5.2",
+ "age=2.0",
+ "age=6.3",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "inshorthandformatcontrols",
+ "inoldnortharabian",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=6.0",
+ "age=4.1",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "ingeneralpunctuation",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=3.0",
+ "age=7.0",
+ "age=5.0",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "innabataean",
+#ifdef USE_UNICODE_AGE_PROPERTIES
+ "age=4.0",
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ "bamum",
+ "control",
+ "induployan",
+ "inlatinextendedd",
+ "inarabic",
+ "runic",
+ "inelbasan",
"inoldsoutharabian",
- "xidstart",
- "inrejang",
- "idsbinaryoperator",
- "olower",
- "hex",
- "inenclosedideographicsupplement",
- "inalphabeticpresentationforms",
"inbasiclatin",
- "othersymbol",
- "nd",
- "sd",
- "omath",
+ "format",
+ "innumberforms",
+ "inugaritic",
"separator",
- "inarabic",
- "xidcontinue",
+ "idsbinaryoperator",
+ "tagbanwa",
+ "bass",
+ "saur",
+ "nbat",
+ "intaixuanjingsymbols",
+ "joincontrol",
"otheridstart",
- "grext",
+ "inbyzantinemusicalsymbols",
+ "intags",
+ "nabataean",
+ "insuperscriptsandsubscripts",
+ "intibetan",
+ "insaurashtra",
+ "othersymbol",
+ "ext",
+ "inarabicpresentationformsa",
+ "inmiscellaneousmathematicalsymbolsb",
"otherlowercase",
- "phli",
- "cased",
- "hang",
- "xpeo",
+ "phoenician",
#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",
+ "po",
+ "inmyanmarextendedb",
+ "limb",
+ "inbraillepatterns",
"tibt",
+ "cuneiform",
+ "bali",
+ "oldpersian",
+ "oldpermic",
+ "pf",
+ "word",
+ "tibetan",
+ "incyrillicsupplement",
+ "elba",
+ "insupplementalmathematicaloperators",
"inbalinese",
- "ingothic",
- "inmiscellaneousmathematicalsymbolsb",
- "limb",
"bengali",
- "phoenician",
- "insuperscriptsandsubscripts",
- "inmeroitichieroglyphs",
- "tibetan",
- "inphoneticextensionssupplement",
+ "caseignorable",
+ "incountingrodnumerals",
+ "other",
+ "tirhuta",
+ "othernumber",
"balinese",
+ "elbasan",
+ "inunifiedcanadianaboriginalsyllabics",
"lowercaseletter",
- "indingbats",
- "inprivateusearea",
- "assigned",
- "patternsyntax",
- "inhangulsyllables",
- "sarb",
+ "ethiopic",
+ "gran",
+ "ingurmukhi",
+ "sund",
+ "inethiopicsupplement",
+ "inoldpersian",
+ "inoldpermic",
+ "othermath",
+ "unassigned",
+ "hmng",
+ "narb",
"brai",
- "insupplementalmathematicaloperators",
- "phnx",
- "ingreekextended",
- "otherletter",
+ "hang",
+ "insorasompeng",
"arab",
- "inlatinextendedd",
- "word",
- "inphagspa",
- "inblockelements",
- "ethiopic",
- "inethiopicextendeda",
+ "plrd",
+ "ingujarati",
"brahmi",
- "logicalorderexception",
- "inoldpersian",
+ "runr",
+ "ahex",
+ "mong",
+ "pauc",
+ "sarb",
+ "ogam",
+ "olower",
+ "pd",
+ "number",
+ "inbrahmi",
+ "otherletter",
+ "ingothic",
+ "phagspa",
"inletterlikesymbols",
- "sorasompeng",
- "hiragana",
- "inhanguljamoextendeda",
- "othermath",
+ "yi",
+ "hangul",
+ "yiii",
+ "tfng",
+ "insupplementalarrowsc",
+ "ingreekandcoptic",
+ "xidc",
+ "insupplementalarrowsa",
+ "gothic",
+ "grext",
+ "incombininghalfmarks",
+ "deprecated",
+ "inbassavah",
+ "xids",
+ "linearb",
+ "ingeometricshapes",
+ "phlp",
+ "warangciti",
+ "inblockelements",
+ "modifierletter",
+ "indingbats",
+ "dep",
+ "punct",
+ "inhanunoo",
+ "bidic",
+ "ingreekextended",
+ "idsb",
+ "assigned",
+ "otherpunctuation",
+ "inhangulsyllables",
+ "inarabicmathematicalalphabeticsymbols",
+ "inornamentaldingbats",
+ "inphagspa",
+ "lyci",
+ "mlym",
+ "inarabicextendeda",
+ "rjng",
+ "lycian",
+ "inalchemicalsymbols",
+ "xdigit",
#endif /* USE_UNICODE_PROPERTIES */
"digit",
#ifndef USE_UNICODE_PROPERTIES
"blank"
#else /* USE_UNICODE_PROPERTIES */
- "goth",
- "ogham",
- "sundanese",
- "saurashtra",
- "linearb",
- "graphemebase",
- "inunifiedcanadianaboriginalsyllabics",
- "cuneiform",
+ "xidstart",
+ "inrejang",
+ "malayalam",
+ "idstrinaryoperator",
+ "invai",
+ "vai",
+ "vaii",
+ "hiragana",
+ "ingeorgian",
+ "braille",
+ "geor",
+ "brah",
+ "glagolitic",
"inkannada",
+ "cakm",
"kana",
- "inancientgreeknumbers",
- "incjkstrokes",
- "inglagolitic",
- "inancientgreekmusicalnotation",
+ "hebr",
+ "inshavian",
+ "vs",
"inchakma",
- "plrd",
- "inbrahmi",
- "cakm",
+ "ogham",
+ "sylotinagri",
+ "inunifiedcanadianaboriginalsyllabicsextended",
+ "inmeroitichieroglyphs",
+ "grantha",
+ "graphemebase",
+ "mathsymbol",
+ "mymr",
+ "insupplementaryprivateuseareaa",
+ "mendekikakui",
"incjkcompatibilityforms",
- "lisu",
+ "inhalfwidthandfullwidthforms",
"incjkcompatibilityideographs",
- "intagalog",
"inkaithi",
- "insupplementalarrowsa",
+ "avst",
+ "inarabicsupplement",
"takri",
- "ideographic",
- "hexdigit",
- "glag",
- "softdotted",
- "variationselector",
- "inkatakana",
+ "syrc",
"meeteimayek",
- "otherpunctuation",
- "inhanguljamo",
- "kali",
- "braille",
- "incombininghalfmarks",
- "talu",
+ "myanmar",
+ "avestan",
+ "inhanguljamoextendeda",
+ "goth",
+ "inkatakana",
+ "incyrillicextendeda",
+ "alphabetic",
+ "syriac",
+ "ideographic",
+ "incjkstrokes",
+ "inlinearbsyllabary",
+ "tavt",
+ "intaiviet",
"incjkcompatibilityideographssupplement",
- "telu",
- "idsb",
- "tglg",
"inmeeteimayek",
- "yi",
- "phagspa",
- "yiii",
- "inarabicmathematicalalphabeticsymbols",
- "saur",
- "ogrext",
- "bidic",
- "inkanasupplement",
- "runic",
- "inalchemicalsymbols",
- "georgian",
- "inugaritic",
- "insaurashtra",
+ "kali",
+ "inyiradicals",
+ "lu",
+ "inoriya",
+ "hebrew",
+ "extender",
"inhighprivateusesurrogates",
- "pd",
- "incountingrodnumerals",
- "inarabicextendeda",
- "inkharoshthi",
- "idstrinaryoperator",
+ "limbu",
+ "inbuhid",
+ "inethiopicextendeda",
+ "xidcontinue",
+ "inyijinghexagramsymbols",
+ "logicalorderexception",
+ "inhebrew",
+ "cyrl",
+ "osmanya",
+ "phnx",
+ "incombiningdiacriticalmarks",
+ "inkanasupplement",
+ "inlisu",
+ "changeswhencasemapped",
+ "incombiningdiacriticalmarksforsymbols",
+ "cwu",
"phag",
- "brah",
+ "insmallformvariants",
+ "inpahawhhmong",
+ "otheruppercase",
+ "intelugu",
+ "incombiningdiacriticalmarkssupplement",
+ "ingeometricshapesextended",
+ "xpeo",
+ "bamu",
+ "inbamum",
"mark",
- "hebr",
- "inkhmersymbols",
- "dep",
+ "dupl",
+ "graph",
+ "dashpunctuation",
+ "patternsyntax",
+ "changeswhentitlecased",
+ "inkharoshthi",
"inkhmer",
- "deprecated",
- "rejang",
- "lyci",
+ "java",
+ "sylo",
+ "ugaritic",
+ "otherdefaultignorablecodepoint",
+ "softdotted",
+ "uideo",
+ "inphoneticextensions",
+ "injavanese",
+ "invariationselectors",
+ "kaithi",
+ "cyrillic",
"intakri",
"takr",
- "incyrillicsupplement",
- "changeswhencasefolded",
- "indevanagariextended",
- "lycian",
+ "javanese",
+ "bidicontrol",
+ "caucasianalbanian",
+ "lydi",
+ "insupplementalpunctuation",
+ "inphoneticextensionssupplement",
+ "lydian",
+ "oldturkic",
+ "invariationselectorssupplement",
+ "kthi",
+ "inhanguljamo",
+ "patsyn",
+ "inlimbu",
+ "sorasompeng",
+ "orya",
+ "inkhmersymbols",
+ "inglagolitic",
+ "indevanagari",
+ "deva",
+ "knda",
"inbengali",
+ "symbol",
+ "devanagari",
+ "inmendekikakui",
"beng",
- "graph",
- "inyijinghexagramsymbols",
- "olck",
- "inarabicsupplement",
+ "invedicextensions",
+ "graphemeextend",
+ "kannada",
"inbuginese",
- "changeswhencasemapped",
+ "olck",
+ "meroitichieroglyphs",
+ "ugar",
+ "intagalog",
+ "inbamumsupplement",
"olchiki",
- "inaegeannumbers",
- "mlym",
- "alphabetic",
- "sylotinagri",
- "changeswhentitlecased",
- "tagalog",
+ "incurrencysymbols",
"tagb",
- "runr",
- "malayalam",
- "inoriya",
+ "inaegeannumbers",
"intagbanwa",
- "syrc",
- "nko",
- "nkoo",
- "inethiopicextended",
- "kaithi",
- "mathsymbol",
- "inyiradicals",
- "insupplementaryprivateuseareaa",
- "osmanya",
- "syriac",
- "otherdefaultignorablecodepoint",
- "number",
- "inlinearbsyllabary",
- "kthi",
- "sund",
- "mymr",
- "incombiningdiacriticalmarks",
- "enclosingmark",
- "incombiningdiacriticalmarksforsymbols",
- "inethiopicsupplement",
- "unassigned",
- "sylo",
- "combiningmark",
- "myanmar",
- "graphemeextend",
- "bidicontrol",
- "inhalfwidthandfullwidthforms",
- "cyrl",
- "knda",
- "inunifiedcanadianaboriginalsyllabicsextended",
- "xsux",
- "modifiersymbol",
- "incombiningdiacriticalmarkssupplement",
- "inhanunoo",
- "inbuhid",
- "kannada",
- "inhebrew",
- "grbase",
- "spacingmark",
+ "uppercase",
+ "defaultignorablecodepoint",
+ "glag",
"inkatakanaphoneticextensions",
- "hangul",
+ "changeswhencasefolded",
+ "inpaucinhau",
+ "inprivateusearea",
+ "paucinhau",
+ "spacingmark",
+ "khmr",
+ "khar",
+ "inarabicpresentationformsb",
+ "changeswhenlowercased",
+ "tglg",
+ "inethiopicextended",
+ "incombiningdiacriticalmarksextended",
+ "oupper",
"incjksymbolsandpunctuation",
"bopo",
- "orya",
+ "punctuation",
+ "combiningmark",
+ "inplayingcards",
"inbopomofo",
+ "hyphen",
+ "inkhojki",
+ "nko",
+ "nkoo",
+ "enclosingmark",
+ "openpunctuation",
+ "currencysymbol",
+ "inverticalforms",
+ "hex",
+ "modifiersymbol",
+ "inlatinextendedb",
"kharoshthi",
- "khar",
- "changeswhenlowercased",
- "khmr",
- "punct",
- "symbol",
"cherokee",
- "cyrillic",
- "inkangxiradicals",
- "hebrew",
- "inarabicpresentationformsb",
- "incyrillicextendedb",
- "ugaritic",
- "incurrencysymbols",
- "meroitichieroglyphs",
- "inhighsurrogates",
- "nonspacingmark",
- "lydi",
- "patsyn",
- "orkh",
- "lydian",
- "ugar",
- "othergraphemeextend",
- "inlatinextendedb",
- "bopomofo",
- "khmer",
- "uideo",
- "otheruppercase",
- "grek",
+ "pahawhhmong",
+ "cypriot",
+ "incypriotsyllabary",
+ "palmyrene",
+ "upper",
+ "aghb",
+ "georgian",
"gujr",
+ "grbase",
"gujarati",
- "inhanguljamoextendedb",
- "defaultignorablecodepoint",
- "inplayingcards",
- "bamu",
- "inkanbun",
- "incjkradicalssupplement",
- "cypriot",
- "inbamum",
- "inmeroiticcursive",
- "oldturkic",
+ "hexdigit",
+ "khmer",
+ "uppercaseletter",
"insupplementalarrowsb",
"surrogate",
+ "unifiedideograph",
+ "nonspacingmark",
+ "othergraphemeextend",
+ "indevanagariextended",
+ "orkh",
+ "ingeorgiansupplement",
+ "oldnortharabian",
+ "tagalog",
+ "khoj",
+ "bopomofo",
+ "rejang",
+ "buhd",
+ "incjkradicalssupplement",
+ "inkanbun",
+ "variationselector",
+ "inkangxiradicals",
+ "inhighsurrogates",
+ "insupplementaryprivateuseareab",
+ "ogrext",
"batk",
+ "inhanguljamoextendedb",
"inbatak",
- "inlimbu",
- "incypriotsyllabary",
- "dashpunctuation",
+ "incyrillicextendedb",
"innoblock",
- "hyphen",
- "insupplementalpunctuation",
- "ingeorgiansupplement",
- "oupper",
+ "any",
+ "xsux",
+ "bugi",
+ "inkhudawadi",
+ "telugu",
+ "changeswhenuppercased",
+ "grek",
+ "guru",
"paragraphseparator",
- "inbamumsupplement",
- "uppercase",
- "currencysymbol",
- "sk",
- "lu",
- "openpunctuation",
- "inlisu",
- "qmark",
+ "buginese",
+ "inyisyllables",
"egyp",
- "insupplementaryprivateuseareab",
- "limbu",
+ "khudawadi",
+ "unknown",
+ "bassavah",
"inegyptianhieroglyphs",
- "unifiedideograph",
- "intelugu",
- "katakana",
- "inhangulcompatibilityjamo",
- "upper",
+ "buhid",
"inkayahli",
- "cwu",
+ "inmeroiticcursive",
"incjkcompatibility",
- "uppercaseletter",
- "bugi",
- "buginese",
- "any",
- "inyisyllables",
- "inbopomofoextended",
- "inboxdrawing",
- "changeswhenuppercased",
- "unknown",
- "quotationmark",
- "buhd",
- "punctuation",
"oldsoutharabian",
- "kayahli",
- "incjkunifiedideographs",
- "incjkunifiedideographsextensiona",
+ "quotationmark",
+ "inhangulcompatibilityjamo",
+ "qmark",
"incjkunifiedideographsextensionc",
- "telugu",
- "guru",
- "greek",
- "grlink",
- "buhid",
- "batak",
- "blank",
+ "sk",
+ "incjkunifiedideographsextensiona",
+ "incjkunifiedideographs",
+ "katakana",
+ "kayahli",
+ "duployan",
"incjkunifiedideographsextensiond",
- "graphemelink",
+ "inbopomofoextended",
+ "khojki",
+ "zyyy",
"egyptianhieroglyphs",
"incjkunifiedideographsextensionb",
- "zyyy",
- "gurmukhi"
+ "batak",
+ "blank",
+ "inboxdrawing",
+ "greek",
+ "gurmukhi",
+ "grlink",
+ "graphemelink"
#endif /* USE_UNICODE_PROPERTIES */
};
#define uniname2ctype_pool ((const char *) &uniname2ctype_pool_contents)
@@ -27366,1138 +31173,1296 @@ uniname2ctype_p (str, len)
#ifdef USE_UNICODE_PROPERTIES
{-1}, {-1}, {-1},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3, 34},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str5, 46},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 51},
- {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str10, 20},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str11, 33},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str18, 20},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str13, 17},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 22},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str15, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 60},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str17, 51},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str21, 31},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str29, 185},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str31, 438},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str35, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str36, 231},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str37, 128},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str44, 383},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str32, 47},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str46, 47},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str34, 101},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str35, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str48, 49},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str38, 33},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str51, 168},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str42, 14},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str55, 461},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str56, 101},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str59, 32},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str44, 18},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str45, 128},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str61, 258},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str64, 14},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str65, 46},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str49, 401},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 265},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str52, 377},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str72, 22},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str74, 54},
{-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_str64, 31},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str85, 439},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str92, 374},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str96, 462},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str97, 278},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str98, 252},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str105, 159},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str110, 406},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str114, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str115, 411},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str66, 239},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str117, 263},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str130, 333},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str134, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str135, 473},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str136, 26},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str137, 120},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str141, 227},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str142, 183},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str144, 413},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str72, 49},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str147, 384},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str151, 151},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str153, 13},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str84, 412},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str155, 302},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str86, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str157, 325},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str90, 382},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str161, 331},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str163, 276},
{-1}, {-1},
- {(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_str109, 312},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str166, 488},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str170, 339},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str173, 426},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str116, 237},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 485},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str183, 152},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str186, 65},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str179, 379},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 276},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str190, 92},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str184, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str203, 75},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str186, 75},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str187, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str205, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str206, 111},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str189, 13},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str208, 273},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 88},
{-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}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str223, 341},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str205, 23},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str226, 298},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 120},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str237, 250},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str207, 36},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str239, 408},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str240, 129},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str241, 23},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str243, 36},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str247, 386},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str250, 52},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str220, 314},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str252, 28},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str255, 289},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str256, 414},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str257, 78},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 148},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str259, 148},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str260, 160},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 388},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str263, 256},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str266, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str267, 281},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str270, 299},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str247, 160},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str248, 323},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str272, 148},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str274, 170},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str280, 80},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str284, 324},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str287, 261},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str288, 155},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str294, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str295, 109},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str298, 155},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str299, 109},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str302, 63},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str303, 286},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str304, 450},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str307, 150},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str315, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str316, 449},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str317, 3},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str318, 92},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str320, 444},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str327, 284},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str259, 260},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str330, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str331, 172},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str332, 327},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str333, 205},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 39},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str335, 169},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str337, 277},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str347, 123},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str350, 423},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str353, 314},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str359, 124},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str362, 25},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str363, 93},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str366, 55},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str372, 82},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str279, 431},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str374, 483},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 99},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str376, 39},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str380, 394},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str382, 451},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str301, 333},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str386, 151},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str388, 82},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str303, 64},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str304, 405},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str390, 183},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str392, 70},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str401, 67},
{-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_str313, 182},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str405, 170},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str407, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str408, 457},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str410, 266},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str412, 61},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str414, 208},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str415, 211},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str316, 287},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str418, 205},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str419, 186},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str423, 196},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str425, 198},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str433, 459},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str439, 350},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str441, 486},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str453, 66},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str456, 305},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str466, 43},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str468, 481},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str470, 39},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str476, 224},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str477, 28},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str485, 326},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str487, 218},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str489, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str490, 64},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str412, 74},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str493, 67},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str502, 412},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str508, 41},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str518, 421},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str519, 253},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str520, 432},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str414, 416},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str522, 45},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str530, 106},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str420, 93},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str536, 199},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str540, 162},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str544, 100},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str545, 477},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str546, 342},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str550, 352},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str554, 360},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str556, 9},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str570, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str571, 171},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str573, 184},
{-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_str449, 185},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str450, 55},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str582, 197},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str584, 174},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str453, 70},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str454, 66},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str587, 163},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str593, 322},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str594, 184},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str596, 201},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str597, 415},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str598, 116},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str470, 151},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str600, 191},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str601, 455},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str603, 229},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str604, 308},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str608, 307},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str609, 37},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str478, 67},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str611, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str612, 288},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 45},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str481, 278},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str614, 21},
{-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_str506, 240},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str617, 264},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str509, 341},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str620, 1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str511, 52},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str622, 194},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str623, 465},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str624, 429},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str627, 74},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str630, 19},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str637, 468},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str531, 116},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str532, 9},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str640, 50},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str542, 390},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str650, 211},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str658, 309},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str672, 344},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str679, 131},
+ {-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_str696, 221},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str545, 281},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str699, 226},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str700, 187},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str703, 35},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str555, 67},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str705, 23},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str558, 425},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str708, 202},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str709, 373},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str711, 416},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str560, 206},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str713, 199},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str715, 113},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str563, 396},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str564, 100},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str718, 210},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str722, 195},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str724, 193},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str725, 225},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str727, 480},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str728, 27},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str730, 52},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str731, 160},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str735, 66},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str736, 279},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str737, 173},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str742, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str743, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str744, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str745, 209},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str568, 325},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str749, 428},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str572, 262},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str753, 215},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str758, 249},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str761, 162},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str574, 153},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str575, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str763, 125},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str767, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str768, 113},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str772, 443},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str773, 219},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str777, 101},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str589, 423},
- {-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str779, 371},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str608, 153},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str783, 425},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str787, 128},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str796, 24},
{-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_str626, 210},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str627, 185},
- {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str798, 223},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str803, 431},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str804, 195},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str805, 21},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str813, 140},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str815, 474},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str817, 456},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str820, 59},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str827, 7},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str830, 440},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str832, 441},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str834, 128},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str672, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str838, 410},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str679, 188},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str845, 144},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str682, 118},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str848, 188},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str849, 188},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str850, 397},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(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_str701, 402},
- {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str858, 57},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str861, 163},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str864, 229},
{-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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str866, 484},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str869, 54},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str750, 223},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str871, 323},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str882, 206},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str892, 156},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str771, 160},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str895, 442},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str898, 111},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str905, 116},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str909, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str910, 141},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str913, 38},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str916, 295},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str922, 53},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str923, 42},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str925, 226},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str927, 173},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str932, 454},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str934, 129},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str936, 209},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str938, 215},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-1}, {-1},
- {(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},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str939, 232},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str940, 234},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str941, 41},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str943, 36},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-1}, {-1},
- {(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_str815, 244},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str944, 244},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str945, 245},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str946, 89},
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str947, 236},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str948, 237},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str949, 241},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str950, 242},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str951, 233},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str952, 246},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str953, 471},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str954, 437},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str818, 41},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str955, 243},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str956, 239},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str957, 316},
+#ifndef USE_UNICODE_AGE_PROPERTIES
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str823, 111},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str824, 192},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str958, 235},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str959, 247},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str960, 240},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str826, 173},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str827, 303},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str962, 430},
+#ifndef USE_UNICODE_AGE_PROPERTIES
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#else /* USE_UNICODE_AGE_PROPERTIES */
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str967, 238},
{-1}, {-1},
- {(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},
+#endif /* USE_UNICODE_AGE_PROPERTIES */
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str970, 157},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str972, 18},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str854, 352},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str974, 470},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str975, 372},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str976, 260},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str982, 103},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str869, 184},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str870, 429},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str984, 424},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str985, 436},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str986, 248},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str995, 19},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str996, 321},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str998, 419},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str999, 51},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1000, 217},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1004, 118},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1012, 177},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1013, 144},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1014, 190},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str917, 190},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1017, 475},
{-1},
- {(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_str923, 98},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str931, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1019, 201},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1023, 225},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1027, 472},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1031, 496},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str933, 6},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1033, 190},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1034, 317},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1036, 280},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str936, 26},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1039, 376},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1040, 50},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1041, 212},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1046, 398},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str938, 284},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str939, 369},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1048, 337},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1049, 213},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1052, 137},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1055, 6},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1060, 121},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str943, 294},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1064, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1065, 382},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1066, 119},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1068, 335},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1069, 95},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1070, 136},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1072, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1073, 133},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1077, 193},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str956, 256},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1080, 42},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str960, 308},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1084, 12},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1086, 95},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1089, 257},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str970, 83},
- {-1},
- {(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_str976, 173},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str977, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1093, 179},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1094, 338},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1095, 304},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1101, 84},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1104, 60},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1107, 476},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1114, 17},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str981, 83},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1118, 197},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1121, 37},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str983, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1123, 135},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1129, 179},
{-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1134, 287},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1136, 25},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str994, 277},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1140, 99},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1141, 180},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1149, 270},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1151, 140},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1000, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1153, 285},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1160, 420},
{-1}, {-1},
- {(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_str1006, 397},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1007, 95},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1163, 418},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1170, 206},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1174, 20},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1180, 181},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1181, 189},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1010, 285},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1184, 126},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1186, 98},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1187, 447},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1193, 80},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1194, 172},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1195, 271},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1197, 167},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1035, 366},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1201, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1202, 208},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1039, 16},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1206, 105},
{-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1211, 192},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1212, 161},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1218, 102},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1221, 213},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1222, 40},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1065, 161},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1235, 34},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1238, 445},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1067, 126},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1240, 27},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1252, 417},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1069, 311},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1070, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1254, 138},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1262, 320},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1265, 110},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1269, 98},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1072, 288},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1271, 110},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1272, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1273, 491},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1277, 255},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1074, 27},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1279, 69},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1280, 334},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1281, 112},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1076, 80},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1283, 71},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1078, 345},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1285, 401},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1286, 222},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1287, 466},
+ {-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_str1305, 68},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1081, 12},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1308, 121},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1312, 330},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1313, 194},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1314, 198},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1084, 348},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1317, 329},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 26},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1321, 332},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1322, 222},
{-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_str1107, 167},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1324, 8},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1327, 291},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1334, 200},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1344, 315},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1353, 217},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1129, 293},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1359, 16},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1364, 44},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1133, 174},
- {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1368, 390},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1147, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1373, 479},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1385, 487},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1387, 375},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1389, 147},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1393, 91},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1399, 267},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1400, 146},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1402, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1403, 489},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1162, 140},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1409, 11},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1412, 4},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1170, 144},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1420, 68},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1421, 379},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1173, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1424, 91},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1425, 218},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1429, 368},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1179, 72},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1435, 143},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1436, 143},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1438, 106},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1442, 282},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1185, 261},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1186, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1448, 126},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1455, 97},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1188, 249},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1457, 167},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1463, 130},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1465, 275},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1466, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1467, 107},
{-1},
- {(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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1469, 79},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1471, 422},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1477, 228},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1253, 187},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1481, 448},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1490, 102},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1491, 132},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1492, 296},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1256, 184},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1495, 433},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1259, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1498, 180},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1261, 200},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1262, 205},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1500, 72},
{-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1502, 49},
{-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1505, 96},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1513, 498},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1514, 186},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1300, 129},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1516, 402},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1302, 437},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1306, 89},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1307, 194},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1518, 405},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1310, 115},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1521, 396},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1522, 446},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1313, 360},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1525, 153},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1526, 262},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1527, 175},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1315, 110},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 138},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1321, 110},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1529, 81},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1533, 159},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1534, 96},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1535, 153},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1536, 380},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1540, 112},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1542, 353},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1330, 193},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1544, 346},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1549, 56},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1550, 81},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1551, 210},
{-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1555, 358},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1557, 407},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1558, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1559, 385},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1377, 241},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1564, 495},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1389, 399},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1576, 389},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1577, 145},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1393, 195},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1581, 366},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1586, 29},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1587, 272},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1396, 138},
- {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1590, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1596, 212},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1598, 393},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1413, 199},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1416, 268},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1600, 119},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1422, 199},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1606, 292},
{-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_str1429, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1608, 387},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1609, 69},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1431, 411},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1432, 175},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1611, 363},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1612, 224},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1616, 259},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1617, 77},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1618, 124},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1621, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1622, 254},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1626, 469},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1627, 367},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1628, 65},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1442, 147},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1443, 243},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1632, 319},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1636, 62},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1448, 84},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1450, 5},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1641, 138},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1645, 403},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1452, 336},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1656, 467},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1457, 142},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1661, 214},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1662, 274},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1460, 236},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1462, 275},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1463, 65},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1665, 313},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1670, 490},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1671, 133},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {(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_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_str1516, 267},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1517, 81},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1687, 157},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1519, 139},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1520, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1689, 370},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1523, 318},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1692, 30},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1525, 165},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1694, 178},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1695, 5},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1696, 40},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1700, 230},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1530, 49},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1531, 339},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1705, 63},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1706, 435},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1712, 294},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1713, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1714, 132},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1719, 122},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1722, 221},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1723, 223},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1729, 220},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1732, 311},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1736, 381},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1742, 399},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1744, 165},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1581, 292},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1747, 77},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1583, 259},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1749, 458},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1750, 175},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1755, 158},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1757, 200},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1758, 176},
{-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_str1595, 30},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1598, 96},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1765, 149},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1772, 347},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1775, 312},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1620, 90},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1778, 149},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1784, 164},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1785, 497},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1786, 165},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1792, 283},
{-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1797, 230},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1802, 297},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1645, 265},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1804, 174},
{-1}, {-1},
- {(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_str1670, 332},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1807, 87},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1676, 98},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1822, 300},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1824, 340},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1831, 268},
{-1}, {-1}, {-1},
- {(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_str1701, 134},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1835, 83},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1836, 90},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1841, 269},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1703, 134},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1843, 46},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1846, 83},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1849, 478},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1852, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1853, 310},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1859, 71},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1865, 90},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1866, 301},
{-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_str1869, 142},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1871, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1872, 122},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1874, 290},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1759, 322},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1878, 464},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1761, 79},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1880, 142},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1899, 318},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1904, 118},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1912, 409},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1790, 122},
- {-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_str1915, 293},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1916, 58},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1917, 70},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1919, 130},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1921, 359},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1932, 64},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1942, 460},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1943, 395},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1947, 192},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1953, 31},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1829, 291},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1956, 104},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1962, 134},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1831, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1964, 404},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1967, 61},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1971, 115},
{-1}, {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1976, 345},
{-1}, {-1}, {-1},
- {(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_str1896, 122},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1980, 303},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1986, 214},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1994, 351},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1899, 193},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1900, 225},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1997, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1998, 38},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1904, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2002, 30},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2007, 482},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2008, 354},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2021, 203},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1932, 191},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2028, 452},
{-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}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2046, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2047, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2048, 32},
{-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_str1983, 362},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2053, 45},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2061, 47},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2063, 400},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2071, 207},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2072, 48},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2073, 251},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2075, 134},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1988, 70},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2080, 100},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2088, 181},
{-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_str2028, 329},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2096, 125},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2105, 427},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2033, 321},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2110, 191},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2113, 10},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2116, 176},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2123, 97},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2131, 86},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2142, 72},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2152, 86},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2153, 207},
{-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_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}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2189, 104},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2194, 29},
{-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_str2141, 180},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2198, 336},
{-1}, {-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_str2224, 22},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2227, 220},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2237, 33},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2178, 191},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2241, 216},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2242, 377},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2252, 164},
{-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_str2194, 415},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2273, 343},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2287, 189},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2290, 115},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2292, 182},
{-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_str2311, 108},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2318, 146},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2326, 117},
{-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_str2343, 348},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-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_str2382, 356},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2406, 228},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2417, 349},
{-1}, {-1}, {-1},
- {(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_str2349, 340},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2421, 392},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2431, 499},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2445, 216},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2449, 166},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2454, 391},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2457, 306},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2462, 369},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2502, 500},
+ {-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_str2429, 107},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2527, 15},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2534, 136},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2442, 328},
{-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_str2562, 127},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2570, 453},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2571, 89},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2579, 62},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2588, 76},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2454, 10},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2591, 85},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2595, 53},
{-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_str2613, 127},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2617, 365},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2631, 154},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2634, 196},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2643, 231},
{-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_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_str2523, 334},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2685, 177},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2689, 463},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2709, 117},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2722, 378},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2732, 434},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2734, 361},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2787, 161},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2795, 204},
{-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}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2889, 355},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2898, 204},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2902, 493},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2906, 48},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2909, 362},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2918, 364},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2984, 107},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
@@ -28506,28 +32471,20 @@ 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},
- {(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_str2940, 337},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3112, 145},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3137, 178},
{-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_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},
@@ -28539,10 +32496,10 @@ 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_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3278, 494},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
@@ -28550,27 +32507,39 @@ 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},
- {(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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3360, 357},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-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_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},
+#endif /* USE_UNICODE_PROPERTIES */
+ {-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, 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_str3466, 182},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
@@ -28578,8 +32547,6 @@ 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}, {-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},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
@@ -28587,12 +32554,8 @@ 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_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_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},
@@ -28611,62 +32574,56 @@ 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_str3777, 74},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3778, 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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3827, 492},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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_str3886, 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}, {-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},
-#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, 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_str3802, 434},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3941, 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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3995, 328},
{-1}, {-1}, {-1}, {-1}, {-1}, {-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_str4025, 76},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4035, 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},
- {(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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4122, 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},
@@ -28690,7 +32647,7 @@ uniname2ctype_p (str, len)
{-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}
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4322, 73}
#endif /* USE_UNICODE_PROPERTIES */
};
diff --git a/enc/us_ascii.c b/enc/us_ascii.c
index 1b47778391..f28300ebc6 100644
--- a/enc/us_ascii.c
+++ b/enc/us_ascii.c
@@ -1,11 +1,15 @@
#include "regenc.h"
+#include "encindex.h"
+#ifndef ENCINDEX_US_ASCII
+#define ENCINDEX_US_ASCII 0
+#endif
static int
us_ascii_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
- if (*p & 0x80)
- return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
- return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1);
+ if (*p & 0x80)
+ return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
+ return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1);
}
OnigEncodingDefine(us_ascii, US_ASCII) = {
@@ -25,7 +29,7 @@ OnigEncodingDefine(us_ascii, US_ASCII) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- 0,
+ ENCINDEX_US_ASCII,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ASCII", "US-ASCII")
diff --git a/enc/utf_16_32.h b/enc/utf_16_32.h
index da58d1b23c..9f9216d8ff 100644
--- a/enc/utf_16_32.h
+++ b/enc/utf_16_32.h
@@ -1,5 +1,5 @@
#include "regenc.h"
-/* dummy for unsupported, statefull encoding */
+/* dummy for unsupported, stateful encoding */
#define ENC_DUMMY_UNICODE(name) ENC_REPLICATE(name, name "BE")
ENC_DUMMY_UNICODE("UTF-16");
ENC_DUMMY_UNICODE("UTF-32");
diff --git a/enc/utf_16be.c b/enc/utf_16be.c
index 8b25d473a7..a61ae00863 100644
--- a/enc/utf_16be.c
+++ b/enc/utf_16be.c
@@ -29,10 +29,7 @@
#include "regenc.h"
-#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)
-#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
-#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8)
-
+#if 0
static const int EncLen_UTF16[] = {
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,
@@ -51,6 +48,7 @@ static const int EncLen_UTF16[] = {
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
};
+#endif
static int
utf16be_mbc_enc_len(const UChar* p, const OnigUChar* e ARG_UNUSED,
diff --git a/enc/utf_16le.c b/enc/utf_16le.c
index 8feb7ad769..7d176e710e 100644
--- a/enc/utf_16le.c
+++ b/enc/utf_16le.c
@@ -29,10 +29,7 @@
#include "regenc.h"
-#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)
-#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
-#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8)
-
+#if 0
static const int EncLen_UTF16[] = {
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,
@@ -51,6 +48,7 @@ static const int EncLen_UTF16[] = {
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
};
+#endif
static int
utf16le_mbc_enc_len(const UChar* p, const OnigUChar* e,
diff --git a/enc/utf_32be.c b/enc/utf_32be.c
index 43c07e2e8f..99b1004e0c 100644
--- a/enc/utf_32be.c
+++ b/enc/utf_32be.c
@@ -29,11 +29,23 @@
#include "regenc.h"
+static OnigCodePoint utf32be_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc);
static int
-utf32be_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
+utf32be_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e,
+ OnigEncoding enc)
{
- return 4;
+ if (e < p) {
+ return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
+ }
+ else if (e-p < 4) {
+ return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4-(int)(e-p));
+ }
+ else {
+ OnigCodePoint c = utf32be_mbc_to_code(p, e, enc);
+ if (!UNICODE_VALID_CODEPOINT_P(c))
+ return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
+ return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4);
+ }
}
static int
diff --git a/enc/utf_32le.c b/enc/utf_32le.c
index 31693eed05..58fb3ce0aa 100644
--- a/enc/utf_32le.c
+++ b/enc/utf_32le.c
@@ -29,11 +29,23 @@
#include "regenc.h"
+static OnigCodePoint utf32le_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc);
static int
-utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
+utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e,
+ OnigEncoding enc)
{
- return 4;
+ if (e < p) {
+ return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
+ }
+ else if (e-p < 4) {
+ return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4-(int)(e-p));
+ }
+ else {
+ OnigCodePoint c = utf32le_mbc_to_code(p, e, enc);
+ if (!UNICODE_VALID_CODEPOINT_P(c))
+ return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
+ return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4);
+ }
}
static int
diff --git a/enc/utf_7.h b/enc/utf_7.h
index fa9f06b1b3..823b317740 100644
--- a/enc/utf_7.h
+++ b/enc/utf_7.h
@@ -1,5 +1,5 @@
#include "regenc.h"
-/* dummy for unsupported, statefull encoding */
+/* dummy for unsupported, stateful encoding */
ENC_DUMMY("UTF-7");
ENC_ALIAS("CP65000", "UTF-7");
diff --git a/enc/utf_8.c b/enc/utf_8.c
index dae1f3a1bc..ae5258dae2 100644
--- a/enc/utf_8.c
+++ b/enc/utf_8.c
@@ -28,6 +28,10 @@
*/
#include "regenc.h"
+#include "encindex.h"
+#ifndef ENCINDEX_UTF_8
+#define ENCINDEX_UTF_8 0
+#endif
#define USE_INVALID_CODE_SCHEME
@@ -35,8 +39,8 @@
/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */
#define INVALID_CODE_FE 0xfffffffe
#define INVALID_CODE_FF 0xffffffff
-#define VALID_CODE_LIMIT 0x7fffffff
#endif
+#define VALID_CODE_LIMIT 0x0010ffff
#define utf8_islead(c) ((UChar )((c) & 0xc0) != 0x80)
@@ -297,9 +301,7 @@ code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
if ((code & 0xffffff80) == 0) return 1;
else if ((code & 0xfffff800) == 0) return 2;
else if ((code & 0xffff0000) == 0) return 3;
- else if ((code & 0xffe00000) == 0) return 4;
- else if ((code & 0xfc000000) == 0) return 5;
- else if ((code & 0x80000000) == 0) return 6;
+ else if (code <= VALID_CODE_LIMIT) return 4;
#ifdef USE_INVALID_CODE_SCHEME
else if (code == INVALID_CODE_FE) return 1;
else if (code == INVALID_CODE_FF) return 1;
@@ -328,24 +330,11 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
*p++ = (UChar )(((code>>12) & 0x0f) | 0xe0);
*p++ = UTF8_TRAILS(code, 6);
}
- else if ((code & 0xffe00000) == 0) {
+ else if (code <= VALID_CODE_LIMIT) {
*p++ = (UChar )(((code>>18) & 0x07) | 0xf0);
*p++ = UTF8_TRAILS(code, 12);
*p++ = UTF8_TRAILS(code, 6);
}
- else if ((code & 0xfc000000) == 0) {
- *p++ = (UChar )(((code>>24) & 0x03) | 0xf8);
- *p++ = UTF8_TRAILS(code, 18);
- *p++ = UTF8_TRAILS(code, 12);
- *p++ = UTF8_TRAILS(code, 6);
- }
- else if ((code & 0x80000000) == 0) {
- *p++ = (UChar )(((code>>30) & 0x01) | 0xfc);
- *p++ = UTF8_TRAILS(code, 24);
- *p++ = UTF8_TRAILS(code, 18);
- *p++ = UTF8_TRAILS(code, 12);
- *p++ = UTF8_TRAILS(code, 6);
- }
#ifdef USE_INVALID_CODE_SCHEME
else if (code == INVALID_CODE_FE) {
*p = 0xfe;
@@ -367,7 +356,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
static int
mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
- const UChar* end, UChar* fold, OnigEncoding enc)
+ const UChar* end, UChar* fold, OnigEncoding enc)
{
const UChar* p = *pp;
@@ -395,7 +384,7 @@ mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
static int
get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out,
- const OnigCodePoint* ranges[], OnigEncoding enc ARG_UNUSED)
+ const OnigCodePoint* ranges[], OnigEncoding enc ARG_UNUSED)
{
*sb_out = 0x80;
return onigenc_unicode_ctype_code_range(ctype, ranges);
@@ -439,7 +428,7 @@ OnigEncodingDefine(utf_8, UTF_8) = {
get_ctype_code_range,
left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- 0,
+ ENCINDEX_UTF_8,
ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("CP65001", "UTF-8")
diff --git a/enc/windows_1250.c b/enc/windows_1250.c
new file mode 100644
index 0000000000..cb8e2233a2
--- /dev/null
+++ b/enc/windows_1250.c
@@ -0,0 +1,220 @@
+/**********************************************************************
+ cp1250.c - Oniguruma (regular expression library)
+**********************************************************************/
+/*-
+ * Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>
+ * 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 "regenc.h"
+
+#define ENC_CP1250_TO_LOWER_CASE(c) EncCP1250_ToLowerCaseTable[c]
+#define ENC_IS_CP1250_CTYPE(code,ctype) \
+ ((EncCP1250_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
+
+static const UChar EncCP1250_ToLowerCaseTable[256] = {
+ '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
+ '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
+ '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
+ '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
+ '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
+ '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
+ '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
+ '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
+ '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
+ '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
+ '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
+ '\210', '\211', '\232', '\213', '\234', '\235', '\236', '\237',
+ '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
+ '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
+ '\240', '\241', '\242', '\263', '\244', '\271', '\246', '\247',
+ '\250', '\251', '\272', '\253', '\254', '\255', '\256', '\277',
+ '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
+ '\270', '\271', '\272', '\273', '\276', '\275', '\276', '\277',
+ '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+ '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+ '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+ '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
+ '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+ '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+ '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+ '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+};
+
+static const unsigned short EncCP1250_CtypeTable[256] = {
+ 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 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,
+ 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
+ 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,
+ 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
+ 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,
+ 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
+ 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
+ 0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,
+ 0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,
+ 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
+ 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
+ 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,
+ 0x00a0, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,/* 8 */
+ 0x0008, 0x0008, 0x34a2, 0x0008, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
+ 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,/* 9 */
+ 0x0008, 0x0008, 0x30e2, 0x0008, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
+ 0x0284, 0x01a0, 0x00a0, 0x34a2, 0x00a0, 0x34a2, 0x00a0, 0x00a0,/* A */
+ 0x00a0, 0x00a0, 0x34a2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x34a2,
+ 0x00a0, 0x00a0, 0x10a0, 0x30e2, 0x00a0, 0x30e2, 0x00a0, 0x01a0,/* B */
+ 0x00a0, 0x30e2, 0x30e2, 0x01a0, 0x34a2, 0x10a0, 0x30e2, 0x30e2,
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,/* C */
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,/* D */
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,/* E */
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,/* F */
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
+};
+
+static int
+cp1250_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
+ const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower, OnigEncoding enc ARG_UNUSED)
+{
+ const UChar* p = *pp;
+
+ *lower = ENC_CP1250_TO_LOWER_CASE(*p);
+ (*pp)++;
+ return 1;
+}
+
+static int
+cp1250_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
+{
+ if (code < 256)
+ return ENC_IS_CP1250_CTYPE(code, ctype);
+ else
+ return FALSE;
+}
+
+static const OnigPairCaseFoldCodes CaseFoldMap[] = {
+ { 0x8a, 0x9a },
+ { 0x8c, 0x9c },
+ { 0x8d, 0x9d },
+ { 0x8e, 0x9e },
+ { 0x8f, 0x9f },
+
+ { 0xa3, 0xb3 },
+ { 0xa5, 0xb9 },
+ { 0xaa, 0xba },
+ { 0xaf, 0xbf },
+
+ { 0xbc, 0xbe },
+
+ { 0xc0, 0xe0 },
+ { 0xc1, 0xe1 },
+ { 0xc2, 0xe2 },
+ { 0xc3, 0xe3 },
+ { 0xc4, 0xe4 },
+ { 0xc5, 0xe5 },
+ { 0xc6, 0xe6 },
+ { 0xc7, 0xe7 },
+ { 0xc8, 0xe8 },
+ { 0xc9, 0xe9 },
+ { 0xca, 0xea },
+ { 0xcb, 0xeb },
+ { 0xcc, 0xec },
+ { 0xcd, 0xed },
+ { 0xce, 0xee },
+ { 0xcf, 0xef },
+
+ { 0xd0, 0xf0 },
+ { 0xd1, 0xf1 },
+ { 0xd2, 0xf2 },
+ { 0xd3, 0xf3 },
+ { 0xd4, 0xf4 },
+ { 0xd5, 0xf5 },
+ { 0xd6, 0xf6 },
+ { 0xd8, 0xf8 },
+ { 0xd9, 0xf9 },
+ { 0xda, 0xfa },
+ { 0xdb, 0xfb },
+ { 0xdc, 0xfc },
+ { 0xdd, 0xfd },
+ { 0xde, 0xfe },
+};
+
+static int
+cp1250_apply_all_case_fold(OnigCaseFoldType flag,
+ OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc ARG_UNUSED)
+{
+ return onigenc_apply_all_case_fold_with_map(
+ sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ flag, f, arg);
+}
+
+static int
+cp1250_get_case_fold_codes_by_str(OnigCaseFoldType flag,
+ const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
+{
+ return onigenc_get_case_fold_codes_by_str_with_map(
+ sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ flag, p, end, items);
+}
+
+OnigEncodingDefine(windows_1250, Windows_1250) = {
+ onigenc_single_byte_mbc_enc_len,
+ "Windows-1250", /* name */
+ 1, /* max enc length */
+ 1, /* min enc length */
+ onigenc_is_mbc_newline_0x0a,
+ onigenc_single_byte_mbc_to_code,
+ onigenc_single_byte_code_to_mbclen,
+ onigenc_single_byte_code_to_mbc,
+ cp1250_mbc_case_fold,
+ cp1250_apply_all_case_fold,
+ cp1250_get_case_fold_codes_by_str,
+ onigenc_minimum_property_name_to_ctype,
+ cp1250_is_code_ctype,
+ onigenc_not_support_get_ctype_code_range,
+ onigenc_single_byte_left_adjust_char_head,
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
+};
+/*
+ * Name: windows-1250
+ * MIBenum: 2251
+ * Link: http://www.iana.org/assignments/character-sets
+ * Link: http://www.microsoft.com/globaldev/reference/sbcs/1250.mspx
+ * Link: http://en.wikipedia.org/wiki/Windows-1250
+ */
+ENC_ALIAS("CP1250", "Windows-1250")
+
diff --git a/enc/windows_1251.c b/enc/windows_1251.c
index 73060962c3..191d631b88 100644
--- a/enc/windows_1251.c
+++ b/enc/windows_1251.c
@@ -167,7 +167,7 @@ cp1251_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc ARG_UNUSED)
{
return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, f, arg);
}
@@ -176,7 +176,7 @@ cp1251_get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ numberof(CaseFoldMap), CaseFoldMap, 0,
flag, p, end, items);
}
diff --git a/enc/windows_1252.c b/enc/windows_1252.c
new file mode 100644
index 0000000000..85f2cfbc25
--- /dev/null
+++ b/enc/windows_1252.c
@@ -0,0 +1,211 @@
+/**********************************************************************
+ cp1252.c - Oniguruma (regular expression library)
+**********************************************************************/
+/*-
+ * Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>
+ * 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 "regenc.h"
+
+#define ENC_CP1252_TO_LOWER_CASE(c) EncCP1252_ToLowerCaseTable[c]
+#define ENC_IS_CP1252_CTYPE(code,ctype) \
+ ((EncCP1252_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
+
+static const UChar EncCP1252_ToLowerCaseTable[256] = {
+ '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
+ '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
+ '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
+ '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
+ '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
+ '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
+ '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
+ '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
+ '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
+ '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
+ '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
+ '\210', '\211', '\232', '\213', '\234', '\215', '\236', '\217',
+ '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
+ '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\377',
+ '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
+ '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\277',
+ '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
+ '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
+ '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+ '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+ '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+ '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
+ '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+ '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+ '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+ '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+};
+
+static const unsigned short EncCP1252_CtypeTable[256] = {
+ 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 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,
+ 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
+ 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,
+ 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
+ 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,
+ 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
+ 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
+ 0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,
+ 0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,
+ 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
+ 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
+ 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,
+ 0x00a0, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
+ 0x0008, 0x0008, 0x34a2, 0x0008, 0x34a2, 0x0000, 0x34a2, 0x0000,
+ 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
+ 0x0008, 0x0008, 0x30e2, 0x0008, 0x30e2, 0x0000, 0x30e2, 0x34a2,
+ 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
+ 0x00a0, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,
+ 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,
+ 0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0,
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,
+ 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
+};
+
+static int
+cp1252_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
+ const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower, OnigEncoding enc ARG_UNUSED)
+{
+ const UChar* p = *pp;
+
+ *lower = ENC_CP1252_TO_LOWER_CASE(*p);
+ (*pp)++;
+ return 1;
+}
+
+static int
+cp1252_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
+{
+ if (code < 256)
+ return ENC_IS_CP1252_CTYPE(code, ctype);
+ else
+ return FALSE;
+}
+
+static const OnigPairCaseFoldCodes CaseFoldMap[] = {
+ { 0x8a, 0x9a },
+ { 0x8c, 0x9c },
+ { 0x8e, 0x9e },
+ { 0x9f, 0xff },
+
+ { 0xc0, 0xe0 },
+ { 0xc1, 0xe1 },
+ { 0xc2, 0xe2 },
+ { 0xc3, 0xe3 },
+ { 0xc4, 0xe4 },
+ { 0xc5, 0xe5 },
+ { 0xc6, 0xe6 },
+ { 0xc7, 0xe7 },
+ { 0xc8, 0xe8 },
+ { 0xc9, 0xe9 },
+ { 0xca, 0xea },
+ { 0xcb, 0xeb },
+ { 0xcc, 0xec },
+ { 0xcd, 0xed },
+ { 0xce, 0xee },
+ { 0xcf, 0xef },
+
+ { 0xd0, 0xf0 },
+ { 0xd1, 0xf1 },
+ { 0xd2, 0xf2 },
+ { 0xd3, 0xf3 },
+ { 0xd4, 0xf4 },
+ { 0xd5, 0xf5 },
+ { 0xd6, 0xf6 },
+ { 0xd8, 0xf8 },
+ { 0xd9, 0xf9 },
+ { 0xda, 0xfa },
+ { 0xdb, 0xfb },
+ { 0xdc, 0xfc },
+ { 0xdd, 0xfd },
+ { 0xde, 0xfe },
+};
+
+static int
+cp1252_apply_all_case_fold(OnigCaseFoldType flag,
+ OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc ARG_UNUSED)
+{
+ return onigenc_apply_all_case_fold_with_map(
+ sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ flag, f, arg);
+}
+
+static int
+cp1252_get_case_fold_codes_by_str(OnigCaseFoldType flag,
+ const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
+{
+ return onigenc_get_case_fold_codes_by_str_with_map(
+ sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
+ flag, p, end, items);
+}
+
+OnigEncodingDefine(windows_1252, Windows_1252) = {
+ onigenc_single_byte_mbc_enc_len,
+ "Windows-1252", /* name */
+ 1, /* max enc length */
+ 1, /* min enc length */
+ onigenc_is_mbc_newline_0x0a,
+ onigenc_single_byte_mbc_to_code,
+ onigenc_single_byte_code_to_mbclen,
+ onigenc_single_byte_code_to_mbc,
+ cp1252_mbc_case_fold,
+ cp1252_apply_all_case_fold,
+ cp1252_get_case_fold_codes_by_str,
+ onigenc_minimum_property_name_to_ctype,
+ cp1252_is_code_ctype,
+ onigenc_not_support_get_ctype_code_range,
+ onigenc_single_byte_left_adjust_char_head,
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
+};
+/*
+ * Name: windows-1252
+ * MIBenum: 2251
+ * Link: http://www.iana.org/assignments/character-sets
+ * Link: http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx
+ * Link: http://en.wikipedia.org/wiki/Windows-1252
+ */
+ENC_ALIAS("CP1252", "Windows-1252")
diff --git a/encindex.h b/encindex.h
new file mode 100644
index 0000000000..dcb1646f3a
--- /dev/null
+++ b/encindex.h
@@ -0,0 +1,67 @@
+/**********************************************************************
+
+ encindex.h -
+
+ $Author$
+ created at: Tue Sep 15 13:21:14 JST 2015
+
+ Copyright (C) 2015 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef RUBY_ENCINDEX_H
+#define RUBY_ENCINDEX_H 1
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
+enum ruby_preserved_encindex {
+ RUBY_ENCINDEX_ASCII,
+ RUBY_ENCINDEX_UTF_8,
+ RUBY_ENCINDEX_US_ASCII,
+
+ /* preserved indexes */
+ RUBY_ENCINDEX_UTF_16BE,
+ RUBY_ENCINDEX_UTF_16LE,
+ RUBY_ENCINDEX_UTF_32BE,
+ RUBY_ENCINDEX_UTF_32LE,
+ RUBY_ENCINDEX_UTF_16,
+ RUBY_ENCINDEX_UTF_32,
+ RUBY_ENCINDEX_UTF8_MAC,
+
+ /* for old options of regexp */
+ RUBY_ENCINDEX_EUC_JP,
+ RUBY_ENCINDEX_Windows_31J,
+
+ RUBY_ENCINDEX_BUILTIN_MAX
+};
+
+#define ENCINDEX_ASCII RUBY_ENCINDEX_ASCII
+#define ENCINDEX_UTF_8 RUBY_ENCINDEX_UTF_8
+#define ENCINDEX_US_ASCII RUBY_ENCINDEX_US_ASCII
+#define ENCINDEX_UTF_16BE RUBY_ENCINDEX_UTF_16BE
+#define ENCINDEX_UTF_16LE RUBY_ENCINDEX_UTF_16LE
+#define ENCINDEX_UTF_32BE RUBY_ENCINDEX_UTF_32BE
+#define ENCINDEX_UTF_32LE RUBY_ENCINDEX_UTF_32LE
+#define ENCINDEX_UTF_16 RUBY_ENCINDEX_UTF_16
+#define ENCINDEX_UTF_32 RUBY_ENCINDEX_UTF_32
+#define ENCINDEX_UTF8_MAC RUBY_ENCINDEX_UTF8_MAC
+#define ENCINDEX_EUC_JP RUBY_ENCINDEX_EUC_JP
+#define ENCINDEX_Windows_31J RUBY_ENCINDEX_Windows_31J
+#define ENCINDEX_BUILTIN_MAX RUBY_ENCINDEX_BUILTIN_MAX
+
+#define rb_ascii8bit_encindex() RUBY_ENCINDEX_ASCII
+#define rb_utf8_encindex() RUBY_ENCINDEX_UTF_8
+#define rb_usascii_encindex() RUBY_ENCINDEX_US_ASCII
+
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBY_ENCINDEX_H */
diff --git a/encoding.c b/encoding.c
index aede0fb08a..f2f2b55c6d 100644
--- a/encoding.c
+++ b/encoding.c
@@ -9,17 +9,25 @@
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
#include "internal.h"
+#include "encindex.h"
#include "regenc.h"
#include <ctype.h>
#include "ruby/util.h"
+#include <assert.h>
+#ifndef ENC_DEBUG
+#define ENC_DEBUG 0
+#endif
+#define ENC_ASSERT (!ENC_DEBUG)?(void)0:assert
+#define MUST_STRING(str) (ENC_ASSERT(RB_TYPE_P(str, T_STRING)), str)
+
#undef rb_ascii8bit_encindex
#undef rb_utf8_encindex
#undef rb_usascii_encindex
+typedef OnigEncodingType rb_raw_encoding;
+
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility push(default)
int rb_enc_register(const char *name, rb_encoding *encoding);
@@ -50,6 +58,13 @@ static struct {
st_table *names;
} enc_table;
+#define ENC_DUMMY_FLAG (1<<24)
+#define ENC_INDEX_MASK (~(~0U<<24))
+
+#define ENC_TO_ENCINDEX(enc) (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
+#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
+#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
+
void rb_enc_init(void);
#define ENCODING_COUNT ENCINDEX_BUILTIN_MAX
@@ -62,25 +77,25 @@ void rb_enc_init(void);
static int load_encoding(const char *name);
-static size_t
-enc_memsize(const void *p)
-{
- return 0;
-}
-
static const rb_data_type_t encoding_data_type = {
"encoding",
- {0, 0, enc_memsize,},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ {0, 0, 0,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
#define is_data_encoding(obj) (RTYPEDDATA_P(obj) && RTYPEDDATA_TYPE(obj) == &encoding_data_type)
#define is_obj_encoding(obj) (RB_TYPE_P((obj), T_DATA) && is_data_encoding(obj))
+int
+rb_data_is_encoding(VALUE obj)
+{
+ return is_data_encoding(obj);
+}
+
static VALUE
enc_new(rb_encoding *encoding)
{
- return TypedData_Wrap_Struct(rb_cEncoding, &encoding_data_type, encoding);
+ return TypedData_Wrap_Struct(rb_cEncoding, &encoding_data_type, (void *)encoding);
}
static VALUE
@@ -107,6 +122,18 @@ rb_enc_from_encoding(rb_encoding *encoding)
return rb_enc_from_encoding_index(idx);
}
+int
+rb_enc_to_index(rb_encoding *enc)
+{
+ return enc ? ENC_TO_ENCINDEX(enc) : 0;
+}
+
+int
+rb_enc_dummy_p(rb_encoding *enc)
+{
+ return ENC_DUMMY_P(enc) != 0;
+}
+
static int enc_autoload(rb_encoding *);
static int
@@ -156,7 +183,7 @@ must_encindex(int index)
rb_raise(rb_eEncodingError, "encoding index out of bound: %d",
index);
}
- if (ENC_TO_ENCINDEX(enc) != index) {
+ if (ENC_TO_ENCINDEX(enc) != (int)(index & ENC_INDEX_MASK)) {
rb_raise(rb_eEncodingError, "wrong encoding index %d for %s (expected %d)",
index, rb_enc_name(enc), ENC_TO_ENCINDEX(enc));
}
@@ -254,9 +281,10 @@ enc_table_expand(int newsize)
}
static int
-enc_register_at(int index, const char *name, rb_encoding *encoding)
+enc_register_at(int index, const char *name, rb_encoding *base_encoding)
{
struct rb_encoding_entry *ent = &enc_table.list[index];
+ rb_raw_encoding *encoding;
VALUE list;
if (!valid_encoding_name_p(name)) return -1;
@@ -266,18 +294,19 @@ enc_register_at(int index, const char *name, rb_encoding *encoding)
else if (STRCASECMP(name, ent->name)) {
return -1;
}
- if (!ent->enc) {
- ent->enc = xmalloc(sizeof(rb_encoding));
+ encoding = (rb_raw_encoding *)ent->enc;
+ if (!encoding) {
+ encoding = xmalloc(sizeof(rb_encoding));
}
- if (encoding) {
- *ent->enc = *encoding;
+ if (base_encoding) {
+ *encoding = *base_encoding;
}
else {
- memset(ent->enc, 0, sizeof(*ent->enc));
+ memset(encoding, 0, sizeof(*ent->enc));
}
- encoding = ent->enc;
encoding->name = name;
encoding->ruby_encoding_index = index;
+ ent->enc = encoding;
st_insert(enc_table.names, (st_data_t)name, (st_data_t)index);
list = rb_encoding_list;
if (list && NIL_P(rb_ary_entry(list, index))) {
@@ -348,7 +377,7 @@ set_base_encoding(int index, rb_encoding *base)
rb_encoding *enc = enc_table.list[index].enc;
enc_table.list[index].base = base;
- if (rb_enc_dummy_p(base)) ENC_SET_DUMMY(enc);
+ if (ENC_DUMMY_P(base)) ENC_SET_DUMMY((rb_raw_encoding *)enc);
return enc;
}
@@ -372,7 +401,7 @@ rb_enc_set_dummy(int index)
{
rb_encoding *enc = enc_table.list[index].enc;
- ENC_SET_DUMMY(enc);
+ ENC_SET_DUMMY((rb_raw_encoding *)enc);
return index;
}
@@ -439,7 +468,7 @@ rb_define_dummy_encoding(const char *name)
int index = rb_enc_replicate(name, rb_ascii8bit_encoding());
rb_encoding *enc = enc_table.list[index].enc;
- ENC_SET_DUMMY(enc);
+ ENC_SET_DUMMY((rb_raw_encoding *)enc);
return index;
}
@@ -450,7 +479,7 @@ rb_encdb_dummy(const char *name)
rb_enc_registered(name));
rb_encoding *enc = enc_table.list[index].enc;
- ENC_SET_DUMMY(enc);
+ ENC_SET_DUMMY((rb_raw_encoding *)enc);
return index;
}
@@ -490,7 +519,7 @@ enc_ascii_compatible_p(VALUE enc)
}
/*
- * Returns 1 when the encoding is Unicode series other than UTF-7 else 0.
+ * Returns non-zero when the encoding is Unicode series other than UTF-7 else 0.
*/
int
rb_enc_unicode_p(rb_encoding *enc)
@@ -553,12 +582,9 @@ rb_encdb_alias(const char *alias, const char *orig)
void
rb_encdb_set_unicode(int index)
{
- rb_enc_from_index(index)->flags |= ONIGENC_FLAG_UNICODE;
+ ((rb_raw_encoding *)rb_enc_from_index(index))->flags |= ONIGENC_FLAG_UNICODE;
}
-extern rb_encoding OnigEncodingUTF_8;
-extern rb_encoding OnigEncodingUS_ASCII;
-
void
rb_enc_init(void)
{
@@ -592,12 +618,18 @@ rb_enc_from_index(int index)
if (!enc_table.list) {
rb_enc_init();
}
- if (index < 0 || enc_table.count <= index) {
+ if (index < 0 || enc_table.count <= (index &= ENC_INDEX_MASK)) {
return 0;
}
return enc_table.list[index].enc;
}
+rb_encoding *
+rb_enc_get_from_index(int index)
+{
+ return must_encindex(index);
+}
+
int
rb_enc_registered(const char *name)
{
@@ -611,13 +643,6 @@ rb_enc_registered(const char *name)
return -1;
}
-static VALUE
-require_enc(VALUE enclib)
-{
- int safe = rb_safe_level();
- return rb_require_safe(enclib, safe > 3 ? 3 : safe);
-}
-
static int
load_encoding(const char *name)
{
@@ -625,8 +650,8 @@ load_encoding(const char *name)
VALUE verbose = ruby_verbose;
VALUE debug = ruby_debug;
VALUE errinfo;
- VALUE loaded;
char *s = RSTRING_PTR(enclib) + 4, *e = RSTRING_END(enclib) - 3;
+ int loaded;
int idx;
while (s < e) {
@@ -639,11 +664,11 @@ load_encoding(const char *name)
ruby_verbose = Qfalse;
ruby_debug = Qfalse;
errinfo = rb_errinfo();
- loaded = rb_protect(require_enc, enclib, 0);
+ loaded = rb_require_internal(enclib, rb_safe_level());
ruby_verbose = verbose;
ruby_debug = debug;
rb_set_errinfo(errinfo);
- if (NIL_P(loaded)) return -1;
+ if (loaded < 0 || 1 < loaded) return -1;
if ((idx = rb_enc_registered(name)) < 0) return -1;
if (enc_autoload_p(enc_table.list[idx].enc)) return -1;
return idx;
@@ -665,7 +690,8 @@ enc_autoload(rb_encoding *enc)
}
i = enc->ruby_encoding_index;
enc_register_at(i & ENC_INDEX_MASK, rb_enc_name(enc), base);
- enc->ruby_encoding_index = i;
+ ((rb_raw_encoding *)enc)->ruby_encoding_index = i;
+ i &= ENC_INDEX_MASK;
}
else {
i = load_encoding(rb_enc_name(enc));
@@ -714,6 +740,7 @@ enc_capable(VALUE obj)
case T_STRING:
case T_REGEXP:
case T_FILE:
+ case T_SYMBOL:
return TRUE;
case T_DATA:
if (is_data_encoding(obj)) return TRUE;
@@ -729,6 +756,19 @@ rb_id_encoding(void)
return id_encoding;
}
+static int
+enc_get_index_str(VALUE str)
+{
+ int i = ENCODING_GET_INLINED(str);
+ if (i == ENCODING_INLINE_MAX) {
+ VALUE iv;
+
+ iv = rb_ivar_get(str, rb_id_encoding());
+ i = NUM2INT(iv);
+ }
+ return i;
+}
+
int
rb_enc_get_index(VALUE obj)
{
@@ -737,24 +777,18 @@ rb_enc_get_index(VALUE obj)
if (SPECIAL_CONST_P(obj)) {
if (!SYMBOL_P(obj)) return -1;
- obj = rb_id2str(SYM2ID(obj));
+ obj = rb_sym2str(obj);
}
switch (BUILTIN_TYPE(obj)) {
as_default:
default:
case T_STRING:
case T_REGEXP:
- i = ENCODING_GET_INLINED(obj);
- if (i == ENCODING_INLINE_MAX) {
- VALUE iv;
-
- iv = rb_ivar_get(obj, rb_id_encoding());
- i = NUM2INT(iv);
- }
+ i = enc_get_index_str(obj);
break;
case T_FILE:
- tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0);
- if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0);
+ tmp = rb_funcallv(obj, rb_intern("internal_encoding"), 0, 0);
+ if (NIL_P(tmp)) obj = rb_funcallv(obj, rb_intern("external_encoding"), 0, 0);
else obj = tmp;
if (NIL_P(obj)) break;
case T_DATA:
@@ -809,8 +843,8 @@ rb_enc_associate_index(VALUE obj, int idx)
}
termlen = rb_enc_mbminlen(enc);
oldtermlen = rb_enc_mbminlen(rb_enc_from_index(oldidx));
- if (oldtermlen < termlen && RB_TYPE_P(obj, T_STRING)) {
- rb_str_fill_terminator(obj, termlen);
+ if (oldtermlen != termlen && RB_TYPE_P(obj, T_STRING)) {
+ rb_str_change_terminator_length(obj, oldtermlen, termlen);
}
enc_set_index(obj, idx);
return obj;
@@ -828,6 +862,19 @@ rb_enc_get(VALUE obj)
return rb_enc_from_index(rb_enc_get_index(obj));
}
+static rb_encoding* enc_compatible_str(VALUE str1, VALUE str2);
+
+rb_encoding*
+rb_enc_check_str(VALUE str1, VALUE str2)
+{
+ rb_encoding *enc = enc_compatible_str(MUST_STRING(str1), MUST_STRING(str2));
+ if (!enc)
+ rb_raise(rb_eEncCompatError, "incompatible character encodings: %s and %s",
+ rb_enc_name(rb_enc_get(str1)),
+ rb_enc_name(rb_enc_get(str2)));
+ return enc;
+}
+
rb_encoding*
rb_enc_check(VALUE str1, VALUE str2)
{
@@ -839,24 +886,12 @@ rb_enc_check(VALUE str1, VALUE str2)
return enc;
}
-rb_encoding*
-rb_enc_compatible(VALUE str1, VALUE str2)
+static rb_encoding*
+enc_compatible_latter(VALUE str1, VALUE str2, int idx1, int idx2)
{
- int idx1, idx2;
- rb_encoding *enc1, *enc2;
int isstr1, isstr2;
-
- idx1 = rb_enc_get_index(str1);
- idx2 = rb_enc_get_index(str2);
-
- if (idx1 < 0 || idx2 < 0)
- return 0;
-
- if (idx1 == idx2) {
- return rb_enc_from_index(idx1);
- }
- enc1 = rb_enc_from_index(idx1);
- enc2 = rb_enc_from_index(idx2);
+ rb_encoding *enc1 = rb_enc_from_index(idx1);
+ rb_encoding *enc2 = rb_enc_from_index(idx2);
isstr2 = RB_TYPE_P(str2, T_STRING);
if (isstr2 && RSTRING_LEN(str2) == 0)
@@ -906,6 +941,39 @@ rb_enc_compatible(VALUE str1, VALUE str2)
return 0;
}
+static rb_encoding*
+enc_compatible_str(VALUE str1, VALUE str2)
+{
+ int idx1 = enc_get_index_str(str1);
+ int idx2 = enc_get_index_str(str2);
+
+ if (idx1 < 0 || idx2 < 0)
+ return 0;
+
+ if (idx1 == idx2) {
+ return rb_enc_from_index(idx1);
+ }
+ else {
+ return enc_compatible_latter(str1, str2, idx1, idx2);
+ }
+}
+
+rb_encoding*
+rb_enc_compatible(VALUE str1, VALUE str2)
+{
+ int idx1 = rb_enc_get_index(str1);
+ int idx2 = rb_enc_get_index(str2);
+
+ if (idx1 < 0 || idx2 < 0)
+ return 0;
+
+ if (idx1 == idx2) {
+ return rb_enc_from_index(idx1);
+ }
+
+ return enc_compatible_latter(str1, str2, idx1, idx2);
+}
+
void
rb_enc_copy(VALUE obj1, VALUE obj2)
{
@@ -927,7 +995,7 @@ rb_obj_encoding(VALUE obj)
if (idx < 0) {
rb_raise(rb_eTypeError, "unknown encoding");
}
- return rb_enc_from_encoding_index(idx);
+ return rb_enc_from_encoding_index(idx & ENC_INDEX_MASK);
}
int
@@ -963,7 +1031,8 @@ rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
int
rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc)
{
- unsigned int c, l;
+ unsigned int c;
+ int l;
if (e <= p)
return -1;
if (rb_enc_asciicompat(enc)) {
@@ -1072,7 +1141,7 @@ enc_inspect(VALUE self)
static VALUE
enc_name(VALUE self)
{
- return rb_usascii_str_new2(rb_enc_name((rb_encoding*)DATA_PTR(self)));
+ return rb_fstring_cstr(rb_enc_name((rb_encoding*)DATA_PTR(self)));
}
static int
@@ -1136,13 +1205,11 @@ enc_list(VALUE klass)
/*
* call-seq:
* Encoding.find(string) -> enc
- * Encoding.find(symbol) -> enc
*
* Search the encoding with specified <i>name</i>.
- * <i>name</i> should be a string or symbol.
+ * <i>name</i> should be a string.
*
* Encoding.find("US-ASCII") #=> #<Encoding:US-ASCII>
- * Encoding.find(:Shift_JIS) #=> #<Encoding:Shift_JIS>
*
* Names which this method accept are encoding names and aliases
* including following special aliases
@@ -1206,9 +1273,17 @@ enc_compatible_p(VALUE klass, VALUE str1, VALUE str2)
/* :nodoc: */
static VALUE
+enc_s_alloc(VALUE klass)
+{
+ rb_undefined_alloc(klass);
+ return Qnil;
+}
+
+/* :nodoc: */
+static VALUE
enc_dump(int argc, VALUE *argv, VALUE self)
{
- rb_scan_args(argc, argv, "01", 0);
+ rb_check_arity(argc, 0, 1);
return enc_name(self);
}
@@ -1216,6 +1291,13 @@ enc_dump(int argc, VALUE *argv, VALUE self)
static VALUE
enc_load(VALUE klass, VALUE str)
{
+ return str;
+}
+
+/* :nodoc: */
+static VALUE
+enc_m_loader(VALUE klass, VALUE str)
+{
return enc_find(klass, str);
}
@@ -1264,16 +1346,14 @@ rb_usascii_encindex(void)
return ENCINDEX_US_ASCII;
}
+int rb_locale_charmap_index(void);
+
int
rb_locale_encindex(void)
{
- VALUE charmap = rb_locale_charmap(rb_cEncoding);
- int idx;
+ int idx = rb_locale_charmap_index();
- if (NIL_P(charmap))
- idx = ENCINDEX_US_ASCII;
- else if ((idx = rb_enc_find_index(StringValueCStr(charmap))) < 0)
- idx = ENCINDEX_ASCII;
+ if (idx < 0) idx = ENCINDEX_ASCII;
if (rb_enc_registered("locale") < 0) {
# if defined _WIN32
@@ -1314,8 +1394,6 @@ struct default_encoding {
static struct default_encoding default_external = {0};
-extern int Init_enc_set_filesystem_encoding(void);
-
static int
enc_set_default_encoding(struct default_encoding *def, VALUE encoding, const char *name)
{
@@ -1463,7 +1541,6 @@ rb_enc_default_internal(void)
* * Time#zone
* * Values from ENV
* * Values in ARGV including $PROGRAM_NAME
- * * __FILE__
*
* Additionally String#encode and String#encode! use the default internal
* encoding if no encoding is given.
@@ -1508,34 +1585,6 @@ set_default_internal(VALUE klass, VALUE encoding)
return encoding;
}
-/*
- * call-seq:
- * Encoding.locale_charmap -> string
- *
- * Returns the locale charmap name.
- * It returns nil if no appropriate information.
- *
- * Debian GNU/Linux
- * LANG=C
- * Encoding.locale_charmap #=> "ANSI_X3.4-1968"
- * LANG=ja_JP.EUC-JP
- * Encoding.locale_charmap #=> "EUC-JP"
- *
- * SunOS 5
- * LANG=C
- * Encoding.locale_charmap #=> "646"
- * LANG=ja
- * Encoding.locale_charmap #=> "eucJP"
- *
- * The result is highly platform dependent.
- * So Encoding.find(Encoding.locale_charmap) may cause an error.
- * If you need some encoding object even for unknown locale,
- * Encoding.find("locale") can be used.
- *
- */
-VALUE
-rb_locale_charmap(VALUE klass);
-
static void
set_encoding_const(const char *name, rb_encoding *enc)
{
@@ -1591,8 +1640,7 @@ static int
rb_enc_name_list_i(st_data_t name, st_data_t idx, st_data_t arg)
{
VALUE ary = (VALUE)arg;
- VALUE str = rb_usascii_str_new2((char *)name);
- OBJ_FREEZE(str);
+ VALUE str = rb_fstring_cstr((char *)name);
rb_ary_push(ary, str);
return ST_CONTINUE;
}
@@ -1634,8 +1682,7 @@ rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg)
if (STRCASECMP((char*)name, rb_enc_name(enc)) == 0) {
return ST_CONTINUE;
}
- str = rb_usascii_str_new2(rb_enc_name(enc));
- OBJ_FREEZE(str);
+ str = rb_fstring_cstr(rb_enc_name(enc));
rb_ary_store(ary, idx, str);
}
key = rb_usascii_str_new2((char *)name);
@@ -1672,7 +1719,7 @@ rb_enc_aliases(VALUE klass)
* optionally, aliases:
*
* Encoding::ISO_8859_1.name
- * #=> #<Encoding:ISO-8859-1>
+ * #=> "ISO-8859-1"
*
* Encoding::ISO_8859_1.names
* #=> ["ISO-8859-1", "ISO8859-1"]
@@ -1875,7 +1922,7 @@ Init_Encoding(void)
int i;
rb_cEncoding = rb_define_class("Encoding", rb_cObject);
- rb_undef_alloc_func(rb_cEncoding);
+ rb_define_alloc_func(rb_cEncoding, enc_s_alloc);
rb_undef_method(CLASS_OF(rb_cEncoding), "new");
rb_define_method(rb_cEncoding, "to_s", enc_name, 0);
rb_define_method(rb_cEncoding, "inspect", enc_inspect, 0);
@@ -1897,7 +1944,7 @@ Init_Encoding(void)
rb_define_singleton_method(rb_cEncoding, "default_external=", set_default_external, 1);
rb_define_singleton_method(rb_cEncoding, "default_internal", get_default_internal, 0);
rb_define_singleton_method(rb_cEncoding, "default_internal=", set_default_internal, 1);
- rb_define_singleton_method(rb_cEncoding, "locale_charmap", rb_locale_charmap, 0);
+ rb_define_singleton_method(rb_cEncoding, "locale_charmap", rb_locale_charmap, 0); /* in localeinit.c */
list = rb_ary_new2(enc_table.count);
RBASIC_CLEAR_CLASS(list);
@@ -1907,6 +1954,8 @@ Init_Encoding(void)
for (i = 0; i < enc_table.count; ++i) {
rb_ary_push(list, enc_new(enc_table.list[i].enc));
}
+
+ rb_marshal_define_compat(rb_cEncoding, Qnil, NULL, enc_m_loader);
}
/* locale insensitive ctype functions */
diff --git a/enum.c b/enum.c
index 6e40b50c4d..795aaf13a3 100644
--- a/enum.c
+++ b/enum.c
@@ -9,13 +9,9 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/util.h"
-#include "node.h"
#include "id.h"
-#include "internal.h"
-
-VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
VALUE rb_mEnumerable;
@@ -46,11 +42,11 @@ rb_enum_values_pack(int argc, const VALUE *argv)
static VALUE
grep_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
ENUM_WANT_SVALUE();
- if (RTEST(rb_funcall(memo->u1.value, id_eqq, 1, i))) {
- rb_ary_push(memo->u2.value, i);
+ if (RTEST(rb_funcall(memo->v1, id_eqq, 1, i)) == RTEST(memo->u3.value)) {
+ rb_ary_push(memo->v2, i);
}
return Qnil;
}
@@ -58,11 +54,11 @@ grep_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
grep_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
ENUM_WANT_SVALUE();
- if (RTEST(rb_funcall(memo->u1.value, id_eqq, 1, i))) {
- rb_ary_push(memo->u2.value, rb_yield(i));
+ if (RTEST(rb_funcall(memo->v1, id_eqq, 1, i)) == RTEST(memo->u3.value)) {
+ rb_ary_push(memo->v2, rb_yield(i));
}
return Qnil;
}
@@ -89,7 +85,33 @@ static VALUE
enum_grep(VALUE obj, VALUE pat)
{
VALUE ary = rb_ary_new();
- NODE *memo = NEW_MEMO(pat, ary, 0);
+ struct MEMO *memo = MEMO_NEW(pat, ary, Qtrue);
+
+ rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)memo);
+
+ return ary;
+}
+
+/*
+ * call-seq:
+ * enum.grep_v(pattern) -> array
+ * enum.grep_v(pattern) { |obj| block } -> array
+ *
+ * Inverted version of Enumerable#grep.
+ * Returns an array of every element in <i>enum</i> for which
+ * not <code>Pattern === element</code>.
+ *
+ * (1..10).grep_v 2..5 #=> [1, 6, 7, 8, 9, 10]
+ * res =(1..10).grep_v(2..5) { |v| v * 2 }
+ * res #=> [2, 12, 14, 16, 18, 20]
+ *
+ */
+
+static VALUE
+enum_grep_v(VALUE obj, VALUE pat)
+{
+ VALUE ary = rb_ary_new();
+ struct MEMO *memo = MEMO_NEW(pat, ary, Qfalse);
rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)memo);
@@ -99,11 +121,11 @@ enum_grep(VALUE obj, VALUE pat)
static VALUE
count_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- NODE *memo = RNODE(memop);
+ struct MEMO *memo = MEMO_CAST(memop);
ENUM_WANT_SVALUE();
- if (rb_equal(i, memo->u1.value)) {
+ if (rb_equal(i, memo->v1)) {
memo->u3.cnt++;
}
return Qnil;
@@ -112,7 +134,7 @@ count_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
count_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- NODE *memo = RNODE(memop);
+ struct MEMO *memo = MEMO_CAST(memop);
if (RTEST(enum_yield(argc, argv))) {
memo->u3.cnt++;
@@ -123,7 +145,7 @@ count_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
count_all_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- NODE *memo = RNODE(memop);
+ struct MEMO *memo = MEMO_CAST(memop);
memo->u3.cnt++;
return Qnil;
@@ -151,7 +173,7 @@ static VALUE
enum_count(int argc, VALUE *argv, VALUE obj)
{
VALUE item = Qnil;
- NODE *memo;
+ struct MEMO *memo;
rb_block_call_func *func;
if (argc == 0) {
@@ -170,7 +192,7 @@ enum_count(int argc, VALUE *argv, VALUE obj)
func = count_i;
}
- memo = NEW_MEMO(item, 0, 0);
+ memo = MEMO_NEW(item, 0, 0);
rb_block_call(obj, id_each, 0, 0, func, (VALUE)memo);
return INT2NUM(memo->u3.cnt);
}
@@ -181,8 +203,8 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
ENUM_WANT_SVALUE();
if (RTEST(rb_yield(i))) {
- NODE *memo = RNODE(memop);
- memo->u1.value = i;
+ struct MEMO *memo = MEMO_CAST(memop);
+ MEMO_V1_SET(memo, i);
memo->u3.cnt = 1;
rb_iter_break();
}
@@ -203,26 +225,26 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
*
* 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).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
*
*/
static VALUE
enum_find(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo;
+ struct MEMO *memo;
VALUE if_none;
rb_scan_args(argc, argv, "01", &if_none);
RETURN_ENUMERATOR(obj, argc, argv);
- memo = NEW_MEMO(Qundef, 0, 0);
+ memo = MEMO_NEW(Qundef, 0, 0);
rb_block_call(obj, id_each, 0, 0, find_i, (VALUE)memo);
if (memo->u3.cnt) {
- return memo->u1.value;
+ return memo->v1;
}
if (!NIL_P(if_none)) {
- return rb_funcall(if_none, id_call, 0, 0);
+ return rb_funcallv(if_none, id_call, 0, 0);
}
return Qnil;
}
@@ -230,12 +252,12 @@ enum_find(int argc, VALUE *argv, VALUE obj)
static VALUE
find_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- NODE *memo = RNODE(memop);
+ struct MEMO *memo = MEMO_CAST(memop);
ENUM_WANT_SVALUE();
- if (rb_equal(i, memo->u2.value)) {
- memo->u1.value = UINT2NUM(memo->u3.cnt);
+ if (rb_equal(i, memo->v2)) {
+ MEMO_V1_SET(memo, UINT2NUM(memo->u3.cnt));
rb_iter_break();
}
memo->u3.cnt++;
@@ -245,10 +267,10 @@ find_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
find_index_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- NODE *memo = RNODE(memop);
+ struct MEMO *memo = MEMO_CAST(memop);
if (RTEST(enum_yield(argc, argv))) {
- memo->u1.value = UINT2NUM(memo->u3.cnt);
+ MEMO_V1_SET(memo, UINT2NUM(memo->u3.cnt));
rb_iter_break();
}
memo->u3.cnt++;
@@ -277,7 +299,7 @@ find_index_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
enum_find_index(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo; /* [return value, current index, ] */
+ struct MEMO *memo; /* [return value, current index, ] */
VALUE condition_value = Qnil;
rb_block_call_func *func;
@@ -293,9 +315,9 @@ enum_find_index(int argc, VALUE *argv, VALUE obj)
func = find_index_i;
}
- memo = NEW_MEMO(Qnil, condition_value, 0);
+ memo = MEMO_NEW(Qnil, condition_value, 0);
rb_block_call(obj, id_each, 0, 0, func, (VALUE)memo);
- return memo->u1.value;
+ return memo->v1;
}
static VALUE
@@ -317,6 +339,24 @@ enum_size(VALUE self, VALUE args, VALUE eobj)
return (r == Qundef) ? Qnil : r;
}
+static long
+limit_by_enum_size(VALUE obj, long n)
+{
+ unsigned long limit;
+ VALUE size = rb_check_funcall(obj, id_size, 0, 0);
+ if (!FIXNUM_P(size)) return n;
+ limit = FIX2ULONG(size);
+ return ((unsigned long)n > limit) ? (long)limit : n;
+}
+
+static int
+enum_size_over_p(VALUE obj, long n)
+{
+ VALUE size = rb_check_funcall(obj, id_size, 0, 0);
+ if (!FIXNUM_P(size)) return 0;
+ return ((unsigned long)n > FIX2ULONG(size));
+}
+
/*
* call-seq:
* enum.find_all { |obj| block } -> array
@@ -512,12 +552,19 @@ enum_to_a(int argc, VALUE *argv, VALUE obj)
static VALUE
enum_to_h_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
{
+ VALUE key_value_pair;
ENUM_WANT_SVALUE();
rb_thread_check_ints();
- i = rb_check_array_type(i);
- if (!NIL_P(i) && RARRAY_LEN(i) == 2) {
- rb_hash_aset(hash, RARRAY_AREF(i, 0), RARRAY_AREF(i, 1));
+ key_value_pair = rb_check_array_type(i);
+ if (NIL_P(key_value_pair)) {
+ rb_raise(rb_eTypeError, "wrong element type %s (expected array)",
+ rb_builtin_class_name(i));
+ }
+ if (RARRAY_LEN(key_value_pair) != 2) {
+ rb_raise(rb_eArgError, "element has wrong array length (expected 2, was %ld)",
+ RARRAY_LEN(key_value_pair));
}
+ rb_hash_aset(hash, RARRAY_AREF(key_value_pair, 0), RARRAY_AREF(key_value_pair, 1));
return Qnil;
}
@@ -526,8 +573,7 @@ enum_to_h_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
* enum.to_h(*args) -> hash
*
* Returns the result of interpreting <i>enum</i> as a list of
- * <tt>[key, value]</tt> pairs. Elements other than pairs of
- * values are ignored.
+ * <tt>[key, value]</tt> pairs.
*
* %i[hello world].each_with_index.to_h
* # => {:hello => 0, :world => 1}
@@ -545,16 +591,15 @@ enum_to_h(int argc, VALUE *argv, VALUE obj)
static VALUE
inject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
- NODE *memo = RNODE(p);
+ struct MEMO *memo = MEMO_CAST(p);
ENUM_WANT_SVALUE();
- if (memo->u2.argc == 0) {
- memo->u2.argc = 1;
- memo->u1.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, i);
}
else {
- memo->u1.value = rb_yield_values(2, memo->u1.value, i);
+ MEMO_V1_SET(memo, rb_yield_values(2, memo->v1, i));
}
return Qnil;
}
@@ -562,23 +607,23 @@ inject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
static VALUE
inject_op_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
- NODE *memo = RNODE(p);
+ struct MEMO *memo = MEMO_CAST(p);
VALUE name;
ENUM_WANT_SVALUE();
- if (memo->u2.argc == 0) {
- memo->u2.argc = 1;
- memo->u1.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, i);
}
else if (SYMBOL_P(name = memo->u3.value)) {
- memo->u1.value = rb_funcall(memo->u1.value, SYM2ID(name), 1, i);
+ const ID mid = SYM2ID(name);
+ MEMO_V1_SET(memo, rb_funcall(memo->v1, mid, 1, i));
}
else {
VALUE args[2];
args[0] = name;
args[1] = i;
- memo->u1.value = rb_f_send(numberof(args), args, memo->u1.value);
+ MEMO_V1_SET(memo, rb_f_send(numberof(args), args, memo->v1));
}
return Qnil;
}
@@ -629,13 +674,14 @@ inject_op_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
static VALUE
enum_inject(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo;
+ struct MEMO *memo;
VALUE init, op;
rb_block_call_func *iter = inject_i;
ID id;
switch (rb_scan_args(argc, argv, "02", &init, &op)) {
case 0:
+ init = Qundef;
break;
case 1:
if (rb_block_given_p()) {
@@ -643,8 +689,7 @@ enum_inject(int argc, VALUE *argv, VALUE obj)
}
id = rb_check_id(&init);
op = id ? ID2SYM(id) : init;
- argc = 0;
- init = Qnil;
+ init = Qundef;
iter = inject_op_i;
break;
case 2:
@@ -656,23 +701,24 @@ enum_inject(int argc, VALUE *argv, VALUE obj)
iter = inject_op_i;
break;
}
- memo = NEW_MEMO(init, argc, op);
+ memo = MEMO_NEW(init, Qnil, op);
rb_block_call(obj, id_each, 0, 0, iter, (VALUE)memo);
- return memo->u1.value;
+ if (memo->v1 == Qundef) return Qnil;
+ return memo->v1;
}
static VALUE
partition_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arys))
{
- NODE *memo = RNODE(arys);
+ struct MEMO *memo = MEMO_CAST(arys);
VALUE ary;
ENUM_WANT_SVALUE();
if (RTEST(rb_yield(i))) {
- ary = memo->u1.value;
+ ary = memo->v1;
}
else {
- ary = memo->u2.value;
+ ary = memo->v2;
}
rb_ary_push(ary, i);
return Qnil;
@@ -696,14 +742,14 @@ partition_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arys))
static VALUE
enum_partition(VALUE obj)
{
- NODE *memo;
+ struct MEMO *memo;
RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
- memo = NEW_MEMO(rb_ary_new(), rb_ary_new(), 0);
+ memo = MEMO_NEW(rb_ary_new(), rb_ary_new(), 0);
rb_block_call(obj, id_each, 0, 0, partition_i, (VALUE)memo);
- return rb_assoc_new(memo->u1.value, memo->u2.value);
+ return rb_assoc_new(memo->v1, memo->v2);
}
static VALUE
@@ -758,10 +804,10 @@ enum_group_by(VALUE obj)
static VALUE
first_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, params))
{
- NODE *memo = RNODE(params);
+ struct MEMO *memo = MEMO_CAST(params);
ENUM_WANT_SVALUE();
- memo->u1.value = i;
+ MEMO_V1_SET(memo, i);
rb_iter_break();
UNREACHABLE;
@@ -782,21 +828,22 @@ static VALUE enum_take(VALUE obj, VALUE n);
* %w[foo bar baz].first(2) #=> ["foo", "bar"]
* %w[foo bar baz].first(10) #=> ["foo", "bar", "baz"]
* [].first #=> nil
+ * [].first(10) #=> []
*
*/
static VALUE
enum_first(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo;
+ struct MEMO *memo;
rb_check_arity(argc, 0, 1);
if (argc > 0) {
return enum_take(obj, argv[0]);
}
else {
- memo = NEW_MEMO(Qnil, 0, 0);
+ memo = MEMO_NEW(Qnil, 0, 0);
rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)memo);
- return memo->u1.value;
+ return memo->v1;
}
}
@@ -826,15 +873,15 @@ enum_sort(VALUE obj)
#define SORT_BY_BUFSIZE 16
struct sort_by_data {
- VALUE ary;
- VALUE buf;
+ const VALUE ary;
+ const VALUE buf;
long n;
};
static VALUE
sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _data))
{
- struct sort_by_data *data = (struct sort_by_data *)&RNODE(_data)->u1;
+ struct sort_by_data *data = (struct sort_by_data *)&MEMO_CAST(_data)->v1;
VALUE ary = data->ary;
VALUE v;
@@ -951,7 +998,7 @@ static VALUE
enum_sort_by(VALUE obj)
{
VALUE ary, buf;
- NODE *memo;
+ struct MEMO *memo;
long i;
struct sort_by_data *data;
@@ -966,11 +1013,11 @@ enum_sort_by(VALUE obj)
RBASIC_CLEAR_CLASS(ary);
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);
+ memo = MEMO_NEW(0, 0, 0);
OBJ_INFECT(memo, obj);
- data = (struct sort_by_data *)&memo->u1;
- data->ary = ary;
- data->buf = buf;
+ data = (struct sort_by_data *)&memo->v1;
+ RB_OBJ_WRITE(memo, &data->ary, ary);
+ RB_OBJ_WRITE(memo, &data->buf, buf);
data->n = 0;
rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)memo);
ary = data->ary;
@@ -1000,27 +1047,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, NODE *memo); \
+static VALUE enum_##name##_func(VALUE result, struct MEMO *memo); \
\
static VALUE \
name##_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
{ \
- return enum_##name##_func(rb_enum_values_pack(argc, argv), RNODE(memo)); \
+ return enum_##name##_func(rb_enum_values_pack(argc, argv), MEMO_CAST(memo)); \
} \
\
static VALUE \
name##_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
{ \
- return enum_##name##_func(enum_yield(argc, argv), RNODE(memo)); \
+ return enum_##name##_func(enum_yield(argc, argv), MEMO_CAST(memo)); \
} \
\
static VALUE \
-enum_##name##_func(VALUE result, NODE *memo)
+enum_##name##_func(VALUE result, struct MEMO *memo)
DEFINE_ENUMFUNCS(all)
{
if (!RTEST(result)) {
- memo->u1.value = Qfalse;
+ MEMO_V1_SET(memo, Qfalse);
rb_iter_break();
}
return Qnil;
@@ -1046,15 +1093,15 @@ DEFINE_ENUMFUNCS(all)
static VALUE
enum_all(VALUE obj)
{
- NODE *memo = NEW_MEMO(Qtrue, 0, 0);
+ struct MEMO *memo = MEMO_NEW(Qtrue, 0, 0);
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(all), (VALUE)memo);
- return memo->u1.value;
+ return memo->v1;
}
DEFINE_ENUMFUNCS(any)
{
if (RTEST(result)) {
- memo->u1.value = Qtrue;
+ MEMO_V1_SET(memo, Qtrue);
rb_iter_break();
}
return Qnil;
@@ -1080,25 +1127,229 @@ DEFINE_ENUMFUNCS(any)
static VALUE
enum_any(VALUE obj)
{
- NODE *memo = NEW_MEMO(Qfalse, 0, 0);
+ struct MEMO *memo = MEMO_NEW(Qfalse, 0, 0);
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(any), (VALUE)memo);
- return memo->u1.value;
+ return memo->v1;
}
DEFINE_ENUMFUNCS(one)
{
if (RTEST(result)) {
- if (memo->u1.value == Qundef) {
- memo->u1.value = Qtrue;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, Qtrue);
}
- else if (memo->u1.value == Qtrue) {
- memo->u1.value = Qfalse;
+ else if (memo->v1 == Qtrue) {
+ MEMO_V1_SET(memo, Qfalse);
rb_iter_break();
}
}
return Qnil;
}
+struct nmin_data {
+ long n;
+ long bufmax;
+ long curlen;
+ VALUE buf;
+ VALUE limit;
+ int (*cmpfunc)(const void *, const void *, void *);
+ int rev; /* max if 1 */
+ int by; /* min_by if 1 */
+ const char *method;
+};
+
+static int
+nmin_cmp(const void *ap, const void *bp, void *_data)
+{
+ struct nmin_data *data = (struct nmin_data *)_data;
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
+ VALUE cmp = rb_funcall(a, id_cmp, 1, b);
+ if (RBASIC(data->buf)->klass) {
+ rb_raise(rb_eRuntimeError, "%s reentered", data->method);
+ }
+ return rb_cmpint(cmp, a, b);
+}
+
+static int
+nmin_block_cmp(const void *ap, const void *bp, void *_data)
+{
+ struct nmin_data *data = (struct nmin_data *)_data;
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
+ VALUE cmp = rb_yield_values(2, a, b);
+ if (RBASIC(data->buf)->klass) {
+ rb_raise(rb_eRuntimeError, "%s reentered", data->method);
+ }
+ return rb_cmpint(cmp, a, b);
+}
+
+
+static void
+nmin_filter(struct nmin_data *data)
+{
+ long n;
+ VALUE *beg;
+ int eltsize;
+ long numelts;
+
+ long left, right;
+ long store_index;
+
+ long i, j;
+
+ if (data->curlen <= data->n)
+ return;
+
+ n = data->n;
+ beg = RARRAY_PTR(data->buf);
+ eltsize = data->by ? 2 : 1;
+ numelts = data->curlen;
+
+ left = 0;
+ right = numelts-1;
+
+#define GETPTR(i) (beg+(i)*eltsize)
+
+#define SWAP(i, j) do { \
+ VALUE tmp[2]; \
+ memcpy(tmp, GETPTR(i), sizeof(VALUE)*eltsize); \
+ memcpy(GETPTR(i), GETPTR(j), sizeof(VALUE)*eltsize); \
+ memcpy(GETPTR(j), tmp, sizeof(VALUE)*eltsize); \
+} while (0)
+
+ while (1) {
+ long pivot_index = left + (right-left)/2;
+ long num_pivots = 1;
+
+ SWAP(pivot_index, right);
+ pivot_index = right;
+
+ store_index = left;
+ i = left;
+ while (i <= right-num_pivots) {
+ int c = data->cmpfunc(GETPTR(i), GETPTR(pivot_index), data);
+ if (data->rev)
+ c = -c;
+ if (c == 0) {
+ SWAP(i, right-num_pivots);
+ num_pivots++;
+ continue;
+ }
+ if (c < 0) {
+ SWAP(i, store_index);
+ store_index++;
+ }
+ i++;
+ }
+ j = store_index;
+ for (i = right; right-num_pivots < i; i--) {
+ if (i <= j)
+ break;
+ SWAP(j, i);
+ j++;
+ }
+
+ if (store_index <= n && n <= store_index+num_pivots)
+ break;
+
+ if (n < store_index) {
+ right = store_index-1;
+ }
+ else {
+ left = store_index+num_pivots;
+ }
+ }
+#undef GETPTR
+#undef SWAP
+
+ data->limit = RARRAY_PTR(data->buf)[store_index*eltsize]; /* the last pivot */
+ data->curlen = data->n;
+ rb_ary_resize(data->buf, data->n * eltsize);
+}
+
+static VALUE
+nmin_i(VALUE i, VALUE *_data, int argc, VALUE *argv)
+{
+ struct nmin_data *data = (struct nmin_data *)_data;
+ VALUE cmpv;
+
+ ENUM_WANT_SVALUE();
+
+ if (data->by)
+ cmpv = rb_yield(i);
+ else
+ cmpv = i;
+
+ if (data->limit != Qundef) {
+ int c = data->cmpfunc(&cmpv, &data->limit, data);
+ if (data->rev)
+ c = -c;
+ if (c >= 0)
+ return Qnil;
+ }
+
+ if (data->by)
+ rb_ary_push(data->buf, cmpv);
+ rb_ary_push(data->buf, i);
+
+ data->curlen++;
+
+ if (data->curlen == data->bufmax) {
+ nmin_filter(data);
+ }
+
+ return Qnil;
+}
+
+static VALUE
+nmin_run(VALUE obj, VALUE num, int by, int rev)
+{
+ VALUE result;
+ struct nmin_data data;
+
+ data.n = NUM2LONG(num);
+ if (data.n < 0)
+ rb_raise(rb_eArgError, "negative size (%ld)", data.n);
+ if (data.n == 0)
+ return rb_ary_new2(0);
+ if (LONG_MAX/4/(by ? 2 : 1) < data.n)
+ rb_raise(rb_eArgError, "too big size");
+ data.bufmax = data.n * 4;
+ data.curlen = 0;
+ data.buf = rb_ary_tmp_new(data.bufmax * (by ? 2 : 1));
+ data.limit = Qundef;
+ data.cmpfunc = by ? nmin_cmp :
+ rb_block_given_p() ? nmin_block_cmp :
+ nmin_cmp;
+ data.rev = rev;
+ data.by = by;
+ data.method = rev ? (by ? "max_by" : "max")
+ : (by ? "min_by" : "min");
+ rb_block_call(obj, id_each, 0, 0, nmin_i, (VALUE)&data);
+ nmin_filter(&data);
+ result = data.buf;
+ if (by) {
+ long i;
+ ruby_qsort(RARRAY_PTR(result),
+ RARRAY_LEN(result)/2,
+ sizeof(VALUE)*2,
+ data.cmpfunc, (void *)&data);
+ for (i=1; i<RARRAY_LEN(result); i+=2) {
+ RARRAY_PTR(result)[i/2] = RARRAY_PTR(result)[i];
+ }
+ rb_ary_resize(result, RARRAY_LEN(result)/2);
+ }
+ else {
+ ruby_qsort(RARRAY_PTR(result), RARRAY_LEN(result), sizeof(VALUE),
+ data.cmpfunc, (void *)&data);
+ }
+ if (rev) {
+ rb_ary_reverse(result);
+ }
+ *((VALUE *)&RBASIC(result)->klass) = rb_cArray;
+ return result;
+
+}
+
/*
* call-seq:
* enum.one? [{ |obj| block }] -> true or false
@@ -1116,15 +1367,14 @@ DEFINE_ENUMFUNCS(one)
* [ nil, true, false ].one? #=> true
*
*/
-
static VALUE
enum_one(VALUE obj)
{
- NODE *memo = NEW_MEMO(Qundef, 0, 0);
+ struct MEMO *memo = MEMO_NEW(Qundef, 0, 0);
VALUE result;
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(one), (VALUE)memo);
- result = memo->u1.value;
+ result = memo->v1;
if (result == Qundef) return Qfalse;
return result;
}
@@ -1132,7 +1382,7 @@ enum_one(VALUE obj)
DEFINE_ENUMFUNCS(none)
{
if (RTEST(result)) {
- memo->u1.value = Qfalse;
+ MEMO_V1_SET(memo, Qfalse);
rb_iter_break();
}
return Qnil;
@@ -1152,30 +1402,31 @@ DEFINE_ENUMFUNCS(none)
* [].none? #=> true
* [nil].none? #=> true
* [nil, false].none? #=> true
+ * [nil, false, true].none? #=> false
*/
static VALUE
enum_none(VALUE obj)
{
- NODE *memo = NEW_MEMO(Qtrue, 0, 0);
+ struct MEMO *memo = MEMO_NEW(Qtrue, 0, 0);
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(none), (VALUE)memo);
- return memo->u1.value;
+ return memo->v1;
}
static VALUE
min_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
VALUE cmp;
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
ENUM_WANT_SVALUE();
- if (memo->u1.value == Qundef) {
- memo->u1.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, i);
}
else {
- cmp = rb_funcall(i, id_cmp, 1, memo->u1.value);
- if (rb_cmpint(cmp, i, memo->u1.value) < 0) {
- memo->u1.value = i;
+ cmp = rb_funcall(i, id_cmp, 1, memo->v1);
+ if (rb_cmpint(cmp, i, memo->v1) < 0) {
+ MEMO_V1_SET(memo, i);
}
}
return Qnil;
@@ -1185,17 +1436,17 @@ static VALUE
min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
VALUE cmp;
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
ENUM_WANT_SVALUE();
- if (memo->u1.value == Qundef) {
- memo->u1.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, i);
}
else {
- cmp = rb_yield_values(2, i, memo->u1.value);
- if (rb_cmpint(cmp, i, memo->u1.value) < 0) {
- memo->u1.value = i;
+ cmp = rb_yield_values(2, i, memo->v1);
+ if (rb_cmpint(cmp, i, memo->v1) < 0) {
+ MEMO_V1_SET(memo, i);
}
}
return Qnil;
@@ -1204,8 +1455,10 @@ min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
/*
* call-seq:
- * enum.min -> obj
- * enum.min { |a, b| block } -> obj
+ * enum.min -> obj
+ * enum.min {| a,b | block } -> obj
+ * enum.min(n) -> array
+ * enum.min(n) {| a,b | block } -> array
*
* Returns the object in <i>enum</i> with the minimum value. The
* first form assumes all objects implement <code>Comparable</code>;
@@ -1214,13 +1467,27 @@ min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
* a = %w(albatross dog horse)
* a.min #=> "albatross"
* a.min { |a, b| a.length <=> b.length } #=> "dog"
+ *
+ * If the +n+ argument is given, minimum +n+ elements are returned
+ * as a sorted array.
+ *
+ * a = %w[albatross dog horse]
+ * a.min(2) #=> ["albatross", "dog"]
+ * a.min(2) {|a, b| a.length <=> b.length } #=> ["dog", "horse"]
+ * [5, 1, 3, 4, 2].min(3) #=> [1, 2, 3]
*/
static VALUE
-enum_min(VALUE obj)
+enum_min(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo = NEW_MEMO(Qundef, 0, 0);
+ struct MEMO *memo = MEMO_NEW(Qundef, 0, 0);
VALUE result;
+ VALUE num;
+
+ rb_scan_args(argc, argv, "01", &num);
+
+ if (!NIL_P(num))
+ return nmin_run(obj, num, 0, 0);
if (rb_block_given_p()) {
rb_block_call(obj, id_each, 0, 0, min_ii, (VALUE)memo);
@@ -1228,7 +1495,7 @@ enum_min(VALUE obj)
else {
rb_block_call(obj, id_each, 0, 0, min_i, (VALUE)memo);
}
- result = memo->u1.value;
+ result = memo->v1;
if (result == Qundef) return Qnil;
return result;
}
@@ -1236,18 +1503,18 @@ enum_min(VALUE obj)
static VALUE
max_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
VALUE cmp;
ENUM_WANT_SVALUE();
- if (memo->u1.value == Qundef) {
- memo->u1.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, i);
}
else {
- cmp = rb_funcall(i, id_cmp, 1, memo->u1.value);
- if (rb_cmpint(cmp, i, memo->u1.value) > 0) {
- memo->u1.value = i;
+ cmp = rb_funcall(i, id_cmp, 1, memo->v1);
+ if (rb_cmpint(cmp, i, memo->v1) > 0) {
+ MEMO_V1_SET(memo, i);
}
}
return Qnil;
@@ -1256,18 +1523,18 @@ max_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
VALUE cmp;
ENUM_WANT_SVALUE();
- if (memo->u1.value == Qundef) {
- memo->u1.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, i);
}
else {
- cmp = rb_yield_values(2, i, memo->u1.value);
- if (rb_cmpint(cmp, i, memo->u1.value) > 0) {
- memo->u1.value = i;
+ cmp = rb_yield_values(2, i, memo->v1);
+ if (rb_cmpint(cmp, i, memo->v1) > 0) {
+ MEMO_V1_SET(memo, i);
}
}
return Qnil;
@@ -1275,8 +1542,10 @@ max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
/*
* call-seq:
- * enum.max -> obj
- * enum.max { |a, b| block } -> obj
+ * enum.max -> obj
+ * enum.max { |a, b| block } -> obj
+ * enum.max(n) -> obj
+ * enum.max(n) {|a,b| block } -> obj
*
* Returns the object in _enum_ with the maximum value. The
* first form assumes all objects implement <code>Comparable</code>;
@@ -1285,13 +1554,27 @@ max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
* a = %w(albatross dog horse)
* a.max #=> "horse"
* a.max { |a, b| a.length <=> b.length } #=> "albatross"
+ *
+ * If the +n+ argument is given, maximum +n+ elements are returned
+ * as an array, sorted in descending order.
+ *
+ * a = %w[albatross dog horse]
+ * a.max(2) #=> ["horse", "dog"]
+ * a.max(2) {|a, b| a.length <=> b.length } #=> ["albatross", "horse"]
+ * [5, 1, 3, 4, 2].max(3) #=> [5, 4, 3]
*/
static VALUE
-enum_max(VALUE obj)
+enum_max(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo = NEW_MEMO(Qundef, 0, 0);
+ struct MEMO *memo = MEMO_NEW(Qundef, 0, 0);
VALUE result;
+ VALUE num;
+
+ rb_scan_args(argc, argv, "01", &num);
+
+ if (!NIL_P(num))
+ return nmin_run(obj, num, 0, 1);
if (rb_block_given_p()) {
rb_block_call(obj, id_each, 0, 0, max_ii, (VALUE)memo);
@@ -1299,7 +1582,7 @@ enum_max(VALUE obj)
else {
rb_block_call(obj, id_each, 0, 0, max_i, (VALUE)memo);
}
- result = memo->u1.value;
+ result = memo->v1;
if (result == Qundef) return Qnil;
return result;
}
@@ -1310,7 +1593,7 @@ struct minmax_t {
VALUE last;
};
-STATIC_ASSERT(minmax_t, sizeof(struct minmax_t) <= sizeof(NODE) - offsetof(NODE, u1));
+STATIC_ASSERT(minmax_t, sizeof(struct minmax_t) <= sizeof(struct MEMO) - offsetof(struct MEMO, v1));
static void
minmax_i_update(VALUE i, VALUE j, struct minmax_t *memo)
@@ -1336,7 +1619,7 @@ minmax_i_update(VALUE i, VALUE j, struct minmax_t *memo)
static VALUE
minmax_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
{
- struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
+ struct minmax_t *memo = (struct minmax_t *)&MEMO_CAST(_memo)->v1;
int n;
VALUE j;
@@ -1388,7 +1671,7 @@ minmax_ii_update(VALUE i, VALUE j, struct minmax_t *memo)
static VALUE
minmax_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
{
- struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
+ struct minmax_t *memo = (struct minmax_t *)&MEMO_CAST(_memo)->v1;
int n;
VALUE j;
@@ -1421,7 +1704,7 @@ minmax_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
* enum.minmax -> [min, max]
* enum.minmax { |a, b| block } -> [min, max]
*
- * Returns two elements array which contains the minimum and the
+ * Returns a two element array which contains the minimum and the
* maximum value in the enumerable. The first form assumes all
* objects implement <code>Comparable</code>; the second uses the
* block to return <em>a <=> b</em>.
@@ -1434,9 +1717,8 @@ minmax_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
static VALUE
enum_minmax(VALUE obj)
{
- 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);
+ struct MEMO *memo = MEMO_NEW(Qundef, Qundef, Qundef);
+ struct minmax_t *m = (struct minmax_t *)&memo->v1;
m->min = Qundef;
m->last = Qundef;
@@ -1451,36 +1733,37 @@ enum_minmax(VALUE obj)
minmax_i_update(m->last, m->last, m);
}
if (m->min != Qundef) {
- rb_ary_store(ary, 0, m->min);
- rb_ary_store(ary, 1, m->max);
+ return rb_assoc_new(m->min, m->max);
}
- return ary;
+ return rb_assoc_new(Qnil, Qnil);
}
static VALUE
min_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
VALUE v;
ENUM_WANT_SVALUE();
v = rb_yield(i);
- if (memo->u1.value == Qundef) {
- memo->u1.value = v;
- memo->u2.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, v);
+ MEMO_V2_SET(memo, 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;
+ else if (rb_cmpint(rb_funcall(v, id_cmp, 1, memo->v1), v, memo->v1) < 0) {
+ MEMO_V1_SET(memo, v);
+ MEMO_V2_SET(memo, 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
+ * enum.min_by(n) {|obj| block } -> array
+ * enum.min_by(n) -> an_enumerator
*
* Returns the object in <i>enum</i> that gives the minimum
* value from the given block.
@@ -1489,44 +1772,59 @@ min_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
*
* a = %w(albatross dog horse)
* a.min_by { |x| x.length } #=> "dog"
+ *
+ * If the +n+ argument is given, minimum +n+ elements are returned
+ * as an array. These +n+ elements are sorted by the value from the
+ * given block.
+ *
+ * a = %w[albatross dog horse]
+ * p a.min_by(2) {|x| x.length } #=> ["dog", "horse"]
*/
static VALUE
-enum_min_by(VALUE obj)
+enum_min_by(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo;
+ struct MEMO *memo;
+ VALUE num;
- RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
+ rb_scan_args(argc, argv, "01", &num);
+
+ RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
+
+ if (!NIL_P(num))
+ return nmin_run(obj, num, 1, 0);
- memo = NEW_MEMO(Qundef, Qnil, 0);
+ memo = MEMO_NEW(Qundef, Qnil, 0);
rb_block_call(obj, id_each, 0, 0, min_by_i, (VALUE)memo);
- return memo->u2.value;
+ return memo->v2;
}
static VALUE
max_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
VALUE v;
ENUM_WANT_SVALUE();
v = rb_yield(i);
- if (memo->u1.value == Qundef) {
- memo->u1.value = v;
- memo->u2.value = i;
+ if (memo->v1 == Qundef) {
+ MEMO_V1_SET(memo, v);
+ MEMO_V2_SET(memo, 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;
+ else if (rb_cmpint(rb_funcall(v, id_cmp, 1, memo->v1), v, memo->v1) > 0) {
+ MEMO_V1_SET(memo, v);
+ MEMO_V2_SET(memo, 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
+ * enum.max_by(n) {|obj| block } -> obj
+ * enum.max_by(n) -> an_enumerator
*
* Returns the object in <i>enum</i> that gives the maximum
* value from the given block.
@@ -1535,18 +1833,76 @@ max_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
*
* a = %w(albatross dog horse)
* a.max_by { |x| x.length } #=> "albatross"
+ *
+ * If the +n+ argument is given, maximum +n+ elements are returned
+ * as an array. These +n+ elements are sorted by the value from the
+ * given block, in descending order.
+ *
+ * a = %w[albatross dog horse]
+ * a.max_by(2) {|x| x.length } #=> ["albatross", "horse"]
+ *
+ * enum.max_by(n) can be used to implement weighted random sampling.
+ * Following example implements and use Enumerable#wsample.
+ *
+ * module Enumerable
+ * # weighted random sampling.
+ * #
+ * # Pavlos S. Efraimidis, Paul G. Spirakis
+ * # Weighted random sampling with a reservoir
+ * # Information Processing Letters
+ * # Volume 97, Issue 5 (16 March 2006)
+ * def wsample(n)
+ * self.max_by(n) {|v| rand ** (1.0/yield(v)) }
+ * end
+ * end
+ * e = (-20..20).to_a*10000
+ * a = e.wsample(20000) {|x|
+ * Math.exp(-(x/5.0)**2) # normal distribution
+ * }
+ * # a is 20000 samples from e.
+ * p a.length #=> 20000
+ * h = a.group_by {|x| x }
+ * -10.upto(10) {|x| puts "*" * (h[x].length/30.0).to_i if h[x] }
+ * #=> *
+ * # ***
+ * # ******
+ * # ***********
+ * # ******************
+ * # *****************************
+ * # *****************************************
+ * # ****************************************************
+ * # ***************************************************************
+ * # ********************************************************************
+ * # ***********************************************************************
+ * # ***********************************************************************
+ * # **************************************************************
+ * # ****************************************************
+ * # ***************************************
+ * # ***************************
+ * # ******************
+ * # ***********
+ * # *******
+ * # ***
+ * # *
+ *
*/
static VALUE
-enum_max_by(VALUE obj)
+enum_max_by(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo;
+ struct MEMO *memo;
+ VALUE num;
- RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
+ rb_scan_args(argc, argv, "01", &num);
+
+ RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
- memo = NEW_MEMO(Qundef, Qnil, 0);
+ if (!NIL_P(num))
+ return nmin_run(obj, num, 1, 1);
+
+ memo = MEMO_NEW(Qundef, Qnil, 0);
rb_block_call(obj, id_each, 0, 0, max_by_i, (VALUE)memo);
- return memo->u2.value;
+ return memo->v2;
}
struct minmax_by_t {
@@ -1658,10 +2014,10 @@ enum_minmax_by(VALUE obj)
static VALUE
member_i(RB_BLOCK_CALL_FUNC_ARGLIST(iter, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
- if (rb_equal(rb_enum_values_pack(argc, argv), memo->u1.value)) {
- memo->u2.value = Qtrue;
+ if (rb_equal(rb_enum_values_pack(argc, argv), memo->v1)) {
+ MEMO_V2_SET(memo, Qtrue);
rb_iter_break();
}
return Qnil;
@@ -1677,22 +2033,24 @@ member_i(RB_BLOCK_CALL_FUNC_ARGLIST(iter, args))
*
* IO.constants.include? :SEEK_SET #=> true
* IO.constants.include? :SEEK_NO_FURTHER #=> false
+ * IO.constants.member? :SEEK_SET #=> true
+ * IO.constants.member? :SEEK_NO_FURTHER #=> false
*
*/
static VALUE
enum_member(VALUE obj, VALUE val)
{
- NODE *memo = NEW_MEMO(val, Qfalse, 0);
+ struct MEMO *memo = MEMO_NEW(val, Qfalse, 0);
rb_block_call(obj, id_each, 0, 0, member_i, (VALUE)memo);
- return memo->u2.value;
+ return memo->v2;
}
static VALUE
each_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
{
- long n = RNODE(memo)->u3.cnt++;
+ long n = MEMO_CAST(memo)->u3.cnt++;
return rb_yield_values(2, rb_enum_values_pack(argc, argv), INT2NUM(n));
}
@@ -1719,11 +2077,11 @@ each_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
static VALUE
enum_each_with_index(int argc, VALUE *argv, VALUE obj)
{
- NODE *memo;
+ struct MEMO *memo;
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
- memo = NEW_MEMO(0, 0, 0);
+ memo = MEMO_NEW(0, 0, 0);
rb_block_call(obj, id_each, argc, argv, each_with_index_i, (VALUE)memo);
return obj;
}
@@ -1810,11 +2168,13 @@ enum_each_entry(int argc, VALUE *argv, VALUE obj)
return obj;
}
+#define dont_recycle_block_arg(arity) ((arity) == 1 || (arity) < 0)
+
static VALUE
each_slice_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
{
- NODE *memo = RNODE(m);
- VALUE ary = memo->u1.value;
+ struct MEMO *memo = MEMO_CAST(m);
+ VALUE ary = memo->v1;
VALUE v = Qnil;
long size = memo->u3.cnt;
ENUM_WANT_SVALUE();
@@ -1823,7 +2183,13 @@ each_slice_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
if (RARRAY_LEN(ary) == size) {
v = rb_yield(ary);
- memo->u1.value = rb_ary_new2(size);
+
+ if (memo->v2) {
+ MEMO_V1_SET(memo, rb_ary_new2(size));
+ }
+ else {
+ rb_ary_clear(ary);
+ }
}
return v;
@@ -1864,14 +2230,17 @@ enum_each_slice(VALUE obj, VALUE n)
{
long size = NUM2LONG(n);
VALUE ary;
- NODE *memo;
+ struct MEMO *memo;
+ int arity;
if (size <= 0) rb_raise(rb_eArgError, "invalid slice size");
RETURN_SIZED_ENUMERATOR(obj, 1, &n, enum_each_slice_size);
+ size = limit_by_enum_size(obj, size);
ary = rb_ary_new2(size);
- memo = NEW_MEMO(ary, 0, size);
+ arity = rb_block_arity();
+ memo = MEMO_NEW(ary, dont_recycle_block_arg(arity), size);
rb_block_call(obj, id_each, 0, 0, each_slice_i, (VALUE)memo);
- ary = memo->u1.value;
+ ary = memo->v1;
if (RARRAY_LEN(ary) > 0) rb_yield(ary);
return Qnil;
@@ -1880,8 +2249,8 @@ enum_each_slice(VALUE obj, VALUE n)
static VALUE
each_cons_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
- VALUE ary = memo->u1.value;
+ struct MEMO *memo = MEMO_CAST(args);
+ VALUE ary = memo->v1;
VALUE v = Qnil;
long size = memo->u3.cnt;
ENUM_WANT_SVALUE();
@@ -1891,7 +2260,10 @@ each_cons_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
}
rb_ary_push(ary, i);
if (RARRAY_LEN(ary) == size) {
- v = rb_yield(rb_ary_dup(ary));
+ if (memo->v2) {
+ ary = rb_ary_dup(ary);
+ }
+ v = rb_yield(ary);
}
return v;
}
@@ -1935,11 +2307,14 @@ static VALUE
enum_each_cons(VALUE obj, VALUE n)
{
long size = NUM2LONG(n);
- NODE *memo;
+ struct MEMO *memo;
+ int arity;
if (size <= 0) rb_raise(rb_eArgError, "invalid size");
RETURN_SIZED_ENUMERATOR(obj, 1, &n, enum_each_cons_size);
- memo = NEW_MEMO(rb_ary_new2(size), 0, size);
+ arity = rb_block_arity();
+ if (enum_size_over_p(obj, size)) return Qnil;
+ memo = MEMO_NEW(rb_ary_new2(size), dont_recycle_block_arg(arity), size);
rb_block_call(obj, id_each, 0, 0, each_cons_i, (VALUE)memo);
return Qnil;
@@ -1979,11 +2354,11 @@ enum_each_with_object(VALUE obj, VALUE memo)
static VALUE
zip_ary(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
{
- NODE *memo = (NODE *)memoval;
- volatile VALUE result = memo->u1.value;
- volatile VALUE args = memo->u2.value;
+ struct MEMO *memo = (struct MEMO *)memoval;
+ VALUE result = memo->v1;
+ VALUE args = memo->v2;
long n = memo->u3.cnt++;
- volatile VALUE tmp;
+ VALUE tmp;
int i;
tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
@@ -2004,13 +2379,16 @@ zip_ary(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
else {
rb_ary_push(result, tmp);
}
+
+ RB_GC_GUARD(args);
+
return Qnil;
}
static VALUE
call_next(VALUE *v)
{
- return v[0] = rb_funcall(v[1], id_next, 0, 0);
+ return v[0] = rb_funcallv(v[1], id_next, 0, 0);
}
static VALUE
@@ -2022,10 +2400,10 @@ call_stop(VALUE *v)
static VALUE
zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
{
- NODE *memo = (NODE *)memoval;
- volatile VALUE result = memo->u1.value;
- volatile VALUE args = memo->u2.value;
- volatile VALUE tmp;
+ struct MEMO *memo = (struct MEMO *)memoval;
+ VALUE result = memo->v1;
+ VALUE args = memo->v2;
+ VALUE tmp;
int i;
tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
@@ -2052,6 +2430,9 @@ zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
else {
rb_ary_push(result, tmp);
}
+
+ RB_GC_GUARD(args);
+
return Qnil;
}
@@ -2072,10 +2453,15 @@ zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
*
+ * a.zip(b) #=> [[4, 7], [5, 8], [6, 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]]
*
+ * c = []
+ * a.zip(b) { |x, y| c << x + y } #=> nil
+ * c #=> [11, 13, 15]
+ *
*/
static VALUE
@@ -2083,7 +2469,7 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
{
int i;
ID conv;
- NODE *memo;
+ struct MEMO *memo;
VALUE result = Qnil;
VALUE args = rb_ary_new4(argc, argv);
int allary = TRUE;
@@ -2101,8 +2487,8 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
CONST_ID(conv, "to_enum");
for (i=0; i<argc; i++) {
if (!rb_respond_to(argv[i], id_each)) {
- rb_raise(rb_eTypeError, "wrong argument type %s (must respond to :each)",
- rb_obj_classname(argv[i]));
+ rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (must respond to :each)",
+ rb_obj_class(argv[i]));
}
argv[i] = rb_funcall(argv[i], conv, 1, ID2SYM(id_each));
}
@@ -2110,8 +2496,9 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
if (!rb_block_given_p()) {
result = rb_ary_new();
}
- /* use NODE_DOT2 as memo(v, v, -) */
- memo = rb_node_newnode(NODE_DOT2, result, args, 0);
+
+ /* TODO: use NODE_DOT2 as memo(v, v, -) */
+ memo = MEMO_NEW(result, args, 0);
rb_block_call(obj, id_each, 0, 0, allary ? zip_ary : zip_i, (VALUE)memo);
return result;
@@ -2120,8 +2507,8 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
static VALUE
take_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
- rb_ary_push(memo->u1.value, rb_enum_values_pack(argc, argv));
+ struct MEMO *memo = MEMO_CAST(args);
+ rb_ary_push(memo->v1, rb_enum_values_pack(argc, argv));
if (--memo->u3.cnt == 0) rb_iter_break();
return Qnil;
}
@@ -2134,13 +2521,14 @@ take_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
*
* a = [1, 2, 3, 4, 5, 0]
* a.take(3) #=> [1, 2, 3]
+ * a.take(30) #=> [1, 2, 3, 4, 5, 0]
*
*/
static VALUE
enum_take(VALUE obj, VALUE n)
{
- NODE *memo;
+ struct MEMO *memo;
VALUE result;
long len = NUM2LONG(n);
@@ -2150,7 +2538,7 @@ enum_take(VALUE obj, VALUE n)
if (len == 0) return rb_ary_new2(0);
result = rb_ary_new2(len);
- memo = NEW_MEMO(result, 0, len);
+ memo = MEMO_NEW(result, 0, len);
rb_block_call(obj, id_each, 0, 0, take_i, (VALUE)memo);
return result;
}
@@ -2193,9 +2581,9 @@ enum_take_while(VALUE obj)
static VALUE
drop_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
if (memo->u3.cnt == 0) {
- rb_ary_push(memo->u1.value, rb_enum_values_pack(argc, argv));
+ rb_ary_push(memo->v1, rb_enum_values_pack(argc, argv));
}
else {
memo->u3.cnt--;
@@ -2219,7 +2607,7 @@ static VALUE
enum_drop(VALUE obj, VALUE n)
{
VALUE result;
- NODE *memo;
+ struct MEMO *memo;
long len = NUM2LONG(n);
if (len < 0) {
@@ -2227,7 +2615,7 @@ enum_drop(VALUE obj, VALUE n)
}
result = rb_ary_new();
- memo = NEW_MEMO(result, 0, len);
+ memo = MEMO_NEW(result, 0, len);
rb_block_call(obj, id_each, 0, 0, drop_i, (VALUE)memo);
return result;
}
@@ -2236,14 +2624,14 @@ enum_drop(VALUE obj, VALUE n)
static VALUE
drop_while_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- NODE *memo = RNODE(args);
+ struct MEMO *memo = MEMO_CAST(args);
ENUM_WANT_SVALUE();
if (!memo->u3.state && !RTEST(rb_yield(i))) {
memo->u3.state = TRUE;
}
if (memo->u3.state) {
- rb_ary_push(memo->u1.value, i);
+ rb_ary_push(memo->v1, i);
}
return Qnil;
}
@@ -2268,11 +2656,11 @@ static VALUE
enum_drop_while(VALUE obj)
{
VALUE result;
- NODE *memo;
+ struct MEMO *memo;
RETURN_ENUMERATOR(obj, 0, 0);
result = rb_ary_new();
- memo = NEW_MEMO(result, 0, FALSE);
+ memo = MEMO_NEW(result, 0, FALSE);
rb_block_call(obj, id_each, 0, 0, drop_while_i, (VALUE)memo);
return result;
}
@@ -2358,7 +2746,6 @@ enum_cycle(int argc, VALUE *argv, VALUE obj)
struct chunk_arg {
VALUE categorize;
- VALUE state;
VALUE prev_value;
VALUE prev_elts;
VALUE yielder;
@@ -2368,16 +2755,13 @@ static VALUE
chunk_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
{
struct chunk_arg *argp = MEMO_FOR(struct chunk_arg, _argp);
- VALUE v;
+ VALUE v, s;
VALUE alone = ID2SYM(rb_intern("_alone"));
VALUE separator = ID2SYM(rb_intern("_separator"));
ENUM_WANT_SVALUE();
- if (NIL_P(argp->state))
- v = rb_funcall(argp->categorize, id_call, 1, i);
- else
- v = rb_funcall(argp->categorize, id_call, 2, i, argp->state);
+ v = rb_funcall(argp->categorize, id_call, 1, i);
if (v == alone) {
if (!NIL_P(argp->prev_value)) {
@@ -2392,7 +2776,7 @@ chunk_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
argp->prev_value = argp->prev_elts = Qnil;
}
}
- else if (SYMBOL_P(v) && rb_id2name(SYM2ID(v))[0] == '_') {
+ else if (SYMBOL_P(v) && (s = rb_sym2str(v), RSTRING_PTR(s)[0] == '_')) {
rb_raise(rb_eRuntimeError, "symbols beginning with an underscore are reserved");
}
else {
@@ -2423,14 +2807,10 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
enumerable = rb_ivar_get(enumerator, rb_intern("chunk_enumerable"));
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))
@@ -2441,7 +2821,6 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
/*
* call-seq:
* enum.chunk { |elt| ... } -> an_enumerator
- * enum.chunk(initial_state) { |elt, state| ... } -> an_enumerator
*
* Enumerates over the items, chunking them together based on the return
* value of the block.
@@ -2525,27 +2904,18 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* }
* }
*
- * If the block needs to maintain state over multiple elements,
- * an +initial_state+ argument can be used.
- * If a non-nil value is given,
- * a reference to it is passed as the 2nd argument of the block for the
- * +chunk+ method, so state-changes to it persist across block calls.
- *
*/
static VALUE
-enum_chunk(int argc, VALUE *argv, VALUE enumerable)
+enum_chunk(VALUE enumerable)
{
- VALUE initial_state;
VALUE enumerator;
if (!rb_block_given_p())
rb_raise(rb_eArgError, "no block given");
- rb_scan_args(argc, argv, "01", &initial_state);
enumerator = rb_obj_alloc(rb_cEnumerator);
rb_ivar_set(enumerator, rb_intern("chunk_enumerable"), enumerable);
rb_ivar_set(enumerator, rb_intern("chunk_categorize"), rb_block_proc());
- rb_ivar_set(enumerator, rb_intern("chunk_initial_state"), initial_state);
rb_block_call(enumerator, idInitialize, 0, 0, chunk_i, enumerator);
return enumerator;
}
@@ -2554,7 +2924,6 @@ enum_chunk(int argc, VALUE *argv, VALUE enumerable)
struct slicebefore_arg {
VALUE sep_pred;
VALUE sep_pat;
- VALUE state;
VALUE prev_elts;
VALUE yielder;
};
@@ -2569,10 +2938,8 @@ slicebefore_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
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, id_call, 1, i);
else
- header_p = rb_funcall(argp->sep_pred, id_call, 2, i, argp->state);
+ header_p = rb_funcall(argp->sep_pred, id_call, 1, i);
if (RTEST(header_p)) {
if (!NIL_P(argp->prev_elts))
rb_funcall(argp->yielder, id_lshift, 1, argp->prev_elts);
@@ -2598,13 +2965,9 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
enumerable = rb_ivar_get(enumerator, rb_intern("slicebefore_enumerable"));
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))
@@ -2616,7 +2979,6 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* 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
*
* Creates an enumerator for each chunked elements.
* The beginnings of chunks are defined by _pattern_ and the block.
@@ -2633,7 +2995,6 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
*
* 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 the Enumerator class and Enumerable module,
* such as map, etc., are also usable.
@@ -2679,33 +3040,34 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* }.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 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.
- * The duplicated object is passed to 2nd argument of the block for
- * +slice_before+ method.
+ * However local variables should be used carefully
+ * if the result enumerator is enumerated twice or more.
+ * The local variables should be initialized for each enumeration.
+ * Enumerator.new can be used to do it.
*
* # 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|
- * h[:cols] += 1 if h[:cols] != 0
- * h[:cols] += w.length
- * if maxwidth < h[:cols]
- * h[:cols] = w.length
- * true
- * else
- * false
- * end
+ * Enumerator.new {|y|
+ * # cols is initialized in Enumerator.new.
+ * cols = 0
+ * words.slice_before { |w|
+ * cols += 1 if cols != 0
+ * cols += w.length
+ * if maxwidth < cols
+ * cols = w.length
+ * true
+ * else
+ * false
+ * end
+ * }.each {|ws| y.yield ws }
* }
* end
* 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(" ") } # first enumeration.
+ * puts "-"*10
+ * enum.each { |ws| puts ws.join(" ") } # second enumeration generates same result as the first.
* puts "-"*10
* #=> ----------
* # 1 2 3 4 5
@@ -2715,6 +3077,13 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* # 17 18 19
* # 20
* # ----------
+ * # 1 2 3 4 5
+ * # 6 7 8 9 10
+ * # 11 12 13
+ * # 14 15 16
+ * # 17 18 19
+ * # 20
+ * # ----------
*
* mbox contains series of mails which start with Unix From line.
* So each mail can be extracted by slice before Unix From line.
@@ -2738,9 +3107,10 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
*
* # split mails in mbox (slice before Unix From line after an empty line)
* open("mbox") { |f|
- * f.slice_before(emp: true) { |line, h|
- * prevemp = h[:emp]
- * h[:emp] = line == "\n"
+ * emp = true
+ * f.slice_before { |line|
+ * prevemp = emp
+ * emp = line == "\n"
* prevemp && line.start_with?("From ")
* }.each { |mail|
* mail.pop if mail.last == "\n"
@@ -2755,11 +3125,10 @@ enum_slice_before(int argc, VALUE *argv, VALUE enumerable)
VALUE enumerator;
if (rb_block_given_p()) {
- VALUE initial_state;
- rb_scan_args(argc, argv, "01", &initial_state);
+ if (argc != 0)
+ rb_error_arity(argc, 0, 0);
enumerator = rb_obj_alloc(rb_cEnumerator);
rb_ivar_set(enumerator, rb_intern("slicebefore_sep_pred"), rb_block_proc());
- rb_ivar_set(enumerator, rb_intern("slicebefore_initial_state"), initial_state);
}
else {
VALUE sep_pat;
@@ -2772,6 +3141,338 @@ enum_slice_before(int argc, VALUE *argv, VALUE enumerable)
return enumerator;
}
+
+struct sliceafter_arg {
+ VALUE pat;
+ VALUE pred;
+ VALUE prev_elts;
+ VALUE yielder;
+};
+
+static VALUE
+sliceafter_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
+{
+#define UPDATE_MEMO ((void)(memo = MEMO_FOR(struct sliceafter_arg, _memo)))
+ struct sliceafter_arg *memo;
+ int split_p;
+ UPDATE_MEMO;
+
+ ENUM_WANT_SVALUE();
+
+ if (NIL_P(memo->prev_elts)) {
+ memo->prev_elts = rb_ary_new3(1, i);
+ }
+ else {
+ rb_ary_push(memo->prev_elts, i);
+ }
+
+ if (NIL_P(memo->pred)) {
+ split_p = RTEST(rb_funcall(memo->pat, id_eqq, 1, i));
+ UPDATE_MEMO;
+ }
+ else {
+ split_p = RTEST(rb_funcall(memo->pred, id_call, 1, i));
+ UPDATE_MEMO;
+ }
+
+ if (split_p) {
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
+ UPDATE_MEMO;
+ memo->prev_elts = Qnil;
+ }
+
+ return Qnil;
+#undef UPDATE_MEMO
+}
+
+static VALUE
+sliceafter_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
+{
+ VALUE enumerable;
+ VALUE arg;
+ struct sliceafter_arg *memo = NEW_MEMO_FOR(struct sliceafter_arg, arg);
+
+ enumerable = rb_ivar_get(enumerator, rb_intern("sliceafter_enum"));
+ memo->pat = rb_ivar_get(enumerator, rb_intern("sliceafter_pat"));
+ memo->pred = rb_attr_get(enumerator, rb_intern("sliceafter_pred"));
+ memo->prev_elts = Qnil;
+ memo->yielder = yielder;
+
+ rb_block_call(enumerable, id_each, 0, 0, sliceafter_ii, arg);
+ memo = MEMO_FOR(struct sliceafter_arg, arg);
+ if (!NIL_P(memo->prev_elts))
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * enum.slice_after(pattern) -> an_enumerator
+ * enum.slice_after { |elt| bool } -> an_enumerator
+ *
+ * Creates an enumerator for each chunked elements.
+ * The ends of chunks are defined by _pattern_ and the block.
+ *
+ * If <code>_pattern_ === _elt_</code> returns <code>true</code> or the block
+ * returns <code>true</code> for the element, the element is end of a
+ * chunk.
+ *
+ * The <code>===</code> and _block_ is called from the first element to the last
+ * element of _enum_.
+ *
+ * The result enumerator yields the chunked elements as an array.
+ * So +each+ method can be called as follows:
+ *
+ * enum.slice_after(pattern).each { |ary| ... }
+ * enum.slice_after { |elt| bool }.each { |ary| ... }
+ *
+ * Other methods of the Enumerator class and Enumerable module,
+ * such as +map+, etc., are also usable.
+ *
+ * For example, continuation lines (lines end with backslash) can be
+ * concatenated as follows:
+ *
+ * lines = ["foo\n", "bar\\\n", "baz\n", "\n", "qux\n"]
+ * e = lines.slice_after(/(?<!\\)\n\z/)
+ * p e.to_a
+ * #=> [["foo\n"], ["bar\\\n", "baz\n"], ["\n"], ["qux\n"]]
+ * p e.map {|ll| ll[0...-1].map {|l| l.sub(/\\\n\z/, "") }.join + ll.last }
+ * #=>["foo\n", "barbaz\n", "\n", "qux\n"]
+ *
+ */
+
+static VALUE
+enum_slice_after(int argc, VALUE *argv, VALUE enumerable)
+{
+ VALUE enumerator;
+ VALUE pat = Qnil, pred = Qnil;
+
+ if (rb_block_given_p()) {
+ if (0 < argc)
+ rb_raise(rb_eArgError, "both pattern and block are given");
+ pred = rb_block_proc();
+ }
+ else {
+ rb_scan_args(argc, argv, "1", &pat);
+ }
+
+ enumerator = rb_obj_alloc(rb_cEnumerator);
+ rb_ivar_set(enumerator, rb_intern("sliceafter_enum"), enumerable);
+ rb_ivar_set(enumerator, rb_intern("sliceafter_pat"), pat);
+ rb_ivar_set(enumerator, rb_intern("sliceafter_pred"), pred);
+
+ rb_block_call(enumerator, idInitialize, 0, 0, sliceafter_i, enumerator);
+ return enumerator;
+}
+
+struct slicewhen_arg {
+ VALUE pred;
+ VALUE prev_elt;
+ VALUE prev_elts;
+ VALUE yielder;
+ int inverted; /* 0 for slice_when and 1 for chunk_while. */
+};
+
+static VALUE
+slicewhen_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
+{
+#define UPDATE_MEMO ((void)(memo = MEMO_FOR(struct slicewhen_arg, _memo)))
+ struct slicewhen_arg *memo;
+ int split_p;
+ UPDATE_MEMO;
+
+ ENUM_WANT_SVALUE();
+
+ if (memo->prev_elt == Qundef) {
+ /* The first element */
+ memo->prev_elt = i;
+ memo->prev_elts = rb_ary_new3(1, i);
+ }
+ else {
+ split_p = RTEST(rb_funcall(memo->pred, id_call, 2, memo->prev_elt, i));
+ UPDATE_MEMO;
+
+ if (memo->inverted)
+ split_p = !split_p;
+
+ if (split_p) {
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
+ UPDATE_MEMO;
+ memo->prev_elts = rb_ary_new3(1, i);
+ }
+ else {
+ rb_ary_push(memo->prev_elts, i);
+ }
+
+ memo->prev_elt = i;
+ }
+
+ return Qnil;
+#undef UPDATE_MEMO
+}
+
+static VALUE
+slicewhen_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
+{
+ VALUE enumerable;
+ VALUE arg;
+ struct slicewhen_arg *memo = NEW_MEMO_FOR(struct slicewhen_arg, arg);
+
+ enumerable = rb_ivar_get(enumerator, rb_intern("slicewhen_enum"));
+ memo->pred = rb_attr_get(enumerator, rb_intern("slicewhen_pred"));
+ memo->prev_elt = Qundef;
+ memo->prev_elts = Qnil;
+ memo->yielder = yielder;
+ memo->inverted = RTEST(rb_attr_get(enumerator, rb_intern("slicewhen_inverted")));
+
+ rb_block_call(enumerable, id_each, 0, 0, slicewhen_ii, arg);
+ memo = MEMO_FOR(struct slicewhen_arg, arg);
+ if (!NIL_P(memo->prev_elts))
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * enum.slice_when {|elt_before, elt_after| bool } -> an_enumerator
+ *
+ * Creates an enumerator for each chunked elements.
+ * The beginnings of chunks are defined by the block.
+ *
+ * This method split each chunk using adjacent elements,
+ * _elt_before_ and _elt_after_,
+ * in the receiver enumerator.
+ * This method split chunks between _elt_before_ and _elt_after_ where
+ * the block returns true.
+ *
+ * The block is called the length of the receiver enumerator minus one.
+ *
+ * The result enumerator yields the chunked elements as an array.
+ * So +each+ method can be called as follows:
+ *
+ * enum.slice_when { |elt_before, elt_after| bool }.each { |ary| ... }
+ *
+ * Other methods of the Enumerator class and Enumerable module,
+ * such as +to_a+, +map+, etc., are also usable.
+ *
+ * For example, one-by-one increasing subsequence can be chunked as follows:
+ *
+ * a = [1,2,4,9,10,11,12,15,16,19,20,21]
+ * b = a.slice_when {|i, j| i+1 != j }
+ * p b.to_a #=> [[1, 2], [4], [9, 10, 11, 12], [15, 16], [19, 20, 21]]
+ * c = b.map {|a| a.length < 3 ? a : "#{a.first}-#{a.last}" }
+ * p c #=> [[1, 2], [4], "9-12", [15, 16], "19-21"]
+ * d = c.join(",")
+ * p d #=> "1,2,4,9-12,15,16,19-21"
+ *
+ * Near elements (threshold: 6) in sorted array can be chunked as follows:
+ *
+ * a = [3, 11, 14, 25, 28, 29, 29, 41, 55, 57]
+ * p a.slice_when {|i, j| 6 < j - i }.to_a
+ * #=> [[3], [11, 14], [25, 28, 29, 29], [41], [55, 57]]
+ *
+ * Increasing (non-decreasing) subsequence can be chunked as follows:
+ *
+ * a = [0, 9, 2, 2, 3, 2, 7, 5, 9, 5]
+ * p a.slice_when {|i, j| i > j }.to_a
+ * #=> [[0, 9], [2, 2, 3], [2, 7], [5, 9], [5]]
+ *
+ * Adjacent evens and odds can be chunked as follows:
+ * (Enumerable#chunk is another way to do it.)
+ *
+ * a = [7, 5, 9, 2, 0, 7, 9, 4, 2, 0]
+ * p a.slice_when {|i, j| i.even? != j.even? }.to_a
+ * #=> [[7, 5, 9], [2, 0], [7, 9], [4, 2, 0]]
+ *
+ * Paragraphs (non-empty lines with trailing empty lines) can be chunked as follows:
+ * (See Enumerable#chunk to ignore empty lines.)
+ *
+ * lines = ["foo\n", "bar\n", "\n", "baz\n", "qux\n"]
+ * p lines.slice_when {|l1, l2| /\A\s*\z/ =~ l1 && /\S/ =~ l2 }.to_a
+ * #=> [["foo\n", "bar\n", "\n"], ["baz\n", "qux\n"]]
+ *
+ */
+static VALUE
+enum_slice_when(VALUE enumerable)
+{
+ VALUE enumerator;
+ VALUE pred;
+
+ pred = rb_block_proc();
+
+ enumerator = rb_obj_alloc(rb_cEnumerator);
+ rb_ivar_set(enumerator, rb_intern("slicewhen_enum"), enumerable);
+ rb_ivar_set(enumerator, rb_intern("slicewhen_pred"), pred);
+ rb_ivar_set(enumerator, rb_intern("slicewhen_inverted"), Qfalse);
+
+ rb_block_call(enumerator, idInitialize, 0, 0, slicewhen_i, enumerator);
+ return enumerator;
+}
+
+/*
+ * call-seq:
+ * enum.chunk_while {|elt_before, elt_after| bool } -> an_enumerator
+ *
+ * Creates an enumerator for each chunked elements.
+ * The beginnings of chunks are defined by the block.
+ *
+ * This method split each chunk using adjacent elements,
+ * _elt_before_ and _elt_after_,
+ * in the receiver enumerator.
+ * This method split chunks between _elt_before_ and _elt_after_ where
+ * the block returns false.
+ *
+ * The block is called the length of the receiver enumerator minus one.
+ *
+ * The result enumerator yields the chunked elements as an array.
+ * So +each+ method can be called as follows:
+ *
+ * enum.chunk_while { |elt_before, elt_after| bool }.each { |ary| ... }
+ *
+ * Other methods of the Enumerator class and Enumerable module,
+ * such as +to_a+, +map+, etc., are also usable.
+ *
+ * For example, one-by-one increasing subsequence can be chunked as follows:
+ *
+ * a = [1,2,4,9,10,11,12,15,16,19,20,21]
+ * b = a.chunk_while {|i, j| i+1 == j }
+ * p b.to_a #=> [[1, 2], [4], [9, 10, 11, 12], [15, 16], [19, 20, 21]]
+ * c = b.map {|a| a.length < 3 ? a : "#{a.first}-#{a.last}" }
+ * p c #=> [[1, 2], [4], "9-12", [15, 16], "19-21"]
+ * d = c.join(",")
+ * p d #=> "1,2,4,9-12,15,16,19-21"
+ *
+ * Increasing (non-decreasing) subsequence can be chunked as follows:
+ *
+ * a = [0, 9, 2, 2, 3, 2, 7, 5, 9, 5]
+ * p a.chunk_while {|i, j| i <= j }.to_a
+ * #=> [[0, 9], [2, 2, 3], [2, 7], [5, 9], [5]]
+ *
+ * Adjacent evens and odds can be chunked as follows:
+ * (Enumerable#chunk is another way to do it.)
+ *
+ * a = [7, 5, 9, 2, 0, 7, 9, 4, 2, 0]
+ * p a.chunk_while {|i, j| i.even? == j.even? }.to_a
+ * #=> [[7, 5, 9], [2, 0], [7, 9], [4, 2, 0]]
+ *
+ */
+static VALUE
+enum_chunk_while(VALUE enumerable)
+{
+ VALUE enumerator;
+ VALUE pred;
+
+ pred = rb_block_proc();
+
+ enumerator = rb_obj_alloc(rb_cEnumerator);
+ rb_ivar_set(enumerator, rb_intern("slicewhen_enum"), enumerable);
+ rb_ivar_set(enumerator, rb_intern("slicewhen_pred"), pred);
+ rb_ivar_set(enumerator, rb_intern("slicewhen_inverted"), Qtrue);
+
+ rb_block_call(enumerator, idInitialize, 0, 0, slicewhen_i, enumerator);
+ return enumerator;
+}
+
/*
* The <code>Enumerable</code> mixin provides collection classes with
* several traversal and searching methods, and with the ability to
@@ -2798,6 +3499,7 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "sort", enum_sort, 0);
rb_define_method(rb_mEnumerable, "sort_by", enum_sort_by, 0);
rb_define_method(rb_mEnumerable, "grep", enum_grep, 1);
+ rb_define_method(rb_mEnumerable, "grep_v", enum_grep_v, 1);
rb_define_method(rb_mEnumerable, "count", enum_count, -1);
rb_define_method(rb_mEnumerable, "find", enum_find, -1);
rb_define_method(rb_mEnumerable, "detect", enum_find, -1);
@@ -2818,11 +3520,11 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "any?", enum_any, 0);
rb_define_method(rb_mEnumerable, "one?", enum_one, 0);
rb_define_method(rb_mEnumerable, "none?", enum_none, 0);
- rb_define_method(rb_mEnumerable, "min", enum_min, 0);
- rb_define_method(rb_mEnumerable, "max", enum_max, 0);
+ rb_define_method(rb_mEnumerable, "min", enum_min, -1);
+ rb_define_method(rb_mEnumerable, "max", enum_max, -1);
rb_define_method(rb_mEnumerable, "minmax", enum_minmax, 0);
- rb_define_method(rb_mEnumerable, "min_by", enum_min_by, 0);
- rb_define_method(rb_mEnumerable, "max_by", enum_max_by, 0);
+ rb_define_method(rb_mEnumerable, "min_by", enum_min_by, -1);
+ rb_define_method(rb_mEnumerable, "max_by", enum_max_by, -1);
rb_define_method(rb_mEnumerable, "minmax_by", enum_minmax_by, 0);
rb_define_method(rb_mEnumerable, "member?", enum_member, 1);
rb_define_method(rb_mEnumerable, "include?", enum_member, 1);
@@ -2838,8 +3540,11 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "drop", enum_drop, 1);
rb_define_method(rb_mEnumerable, "drop_while", enum_drop_while, 0);
rb_define_method(rb_mEnumerable, "cycle", enum_cycle, -1);
- rb_define_method(rb_mEnumerable, "chunk", enum_chunk, -1);
+ rb_define_method(rb_mEnumerable, "chunk", enum_chunk, 0);
rb_define_method(rb_mEnumerable, "slice_before", enum_slice_before, -1);
+ rb_define_method(rb_mEnumerable, "slice_after", enum_slice_after, -1);
+ rb_define_method(rb_mEnumerable, "slice_when", enum_slice_when, 0);
+ rb_define_method(rb_mEnumerable, "chunk_while", enum_chunk_while, 0);
id_next = rb_intern("next");
id_call = rb_intern("call");
diff --git a/enumerator.c b/enumerator.c
index 2e80580dea..a59473a88c 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -12,8 +12,6 @@
************************************************/
-#include "ruby/ruby.h"
-#include "node.h"
#include "internal.h"
/*
@@ -158,7 +156,7 @@ enumerator_mark(void *p)
static size_t
enumerator_memsize(const void *p)
{
- return p ? sizeof(struct enumerator) : 0;
+ return sizeof(struct enumerator);
}
static const rb_data_type_t enumerator_data_type = {
@@ -168,7 +166,7 @@ static const rb_data_type_t enumerator_data_type = {
enumerator_free,
enumerator_memsize,
},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct enumerator *
@@ -267,7 +265,7 @@ enumerator_allocate(VALUE klass)
}
static VALUE
-enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn, VALUE size)
+enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn, VALUE size)
{
struct enumerator *ptr;
@@ -398,16 +396,16 @@ enumerator_init_copy(VALUE obj, VALUE orig)
* For backwards compatibility; use rb_enumeratorize_with_size
*/
VALUE
-rb_enumeratorize(VALUE obj, VALUE meth, int argc, VALUE *argv)
+rb_enumeratorize(VALUE obj, VALUE meth, int argc, const VALUE *argv)
{
return rb_enumeratorize_with_size(obj, meth, argc, argv, 0);
}
static VALUE
-lazy_to_enum_i(VALUE self, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn);
+lazy_to_enum_i(VALUE self, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn);
VALUE
-rb_enumeratorize_with_size(VALUE obj, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn)
+rb_enumeratorize_with_size(VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn)
{
/* Similar effect as calling obj.to_enum, i.e. dispatching to either
Kernel#to_enum vs Lazy#to_enum */
@@ -422,13 +420,13 @@ static VALUE
enumerator_block_call(VALUE obj, rb_block_call_func *func, VALUE arg)
{
int argc = 0;
- VALUE *argv = 0;
+ const VALUE *argv = 0;
const struct enumerator *e = enumerator_ptr(obj);
ID meth = e->meth;
if (e->args) {
argc = RARRAY_LENINT(e->args);
- argv = RARRAY_PTR(e->args);
+ argv = RARRAY_CONST_PTR(e->args);
}
return rb_block_call(e->obj, meth, argc, argv, func, arg);
}
@@ -495,9 +493,9 @@ enumerator_each(int argc, VALUE *argv, VALUE obj)
static VALUE
enumerator_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- NODE *memo = (NODE *)m;
- VALUE idx = memo->u1.value;
- memo->u1.value = rb_int_succ(idx);
+ struct MEMO *memo = (struct MEMO *)m;
+ VALUE idx = memo->v1;
+ MEMO_V1_SET(memo, rb_int_succ(idx));
if (argc <= 1)
return rb_yield_values(2, val, idx);
@@ -537,7 +535,7 @@ enumerator_with_index(int argc, VALUE *argv, VALUE obj)
memo = INT2FIX(0);
else
memo = rb_to_int(memo);
- return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)NEW_MEMO(memo, 0, 0));
+ return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)MEMO_NEW(memo, 0, 0));
}
/*
@@ -838,7 +836,7 @@ enumerator_peek_values_m(VALUE obj)
* p e.peek #=> 2
* p e.next #=> 2
* p e.next #=> 3
- * p e.next #raises StopIteration
+ * p e.peek #raises StopIteration
*
*/
@@ -975,13 +973,15 @@ append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args)
method = rb_attr_get(obj, id_method);
if (method != Qfalse) {
- ID mid = default_method;
if (!NIL_P(method)) {
Check_Type(method, T_SYMBOL);
- mid = SYM2ID(method);
+ method = rb_sym2str(method);
+ }
+ else {
+ method = rb_id2str(default_method);
}
rb_str_buf_cat2(str, ":");
- rb_str_buf_append(str, rb_id2str(mid));
+ rb_str_buf_append(str, method);
}
eargs = rb_attr_get(obj, id_arguments);
@@ -1067,7 +1067,7 @@ yielder_mark(void *p)
static size_t
yielder_memsize(const void *p)
{
- return p ? sizeof(struct yielder) : 0;
+ return sizeof(struct yielder);
}
static const rb_data_type_t yielder_data_type = {
@@ -1077,7 +1077,7 @@ static const rb_data_type_t yielder_data_type = {
yielder_free,
yielder_memsize,
},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct yielder *
@@ -1140,7 +1140,8 @@ yielder_yield(VALUE obj, VALUE args)
}
/* :nodoc: */
-static VALUE yielder_yield_push(VALUE obj, VALUE args)
+static VALUE
+yielder_yield_push(VALUE obj, VALUE args)
{
yielder_yield(obj, args);
return obj;
@@ -1173,7 +1174,7 @@ generator_mark(void *p)
static size_t
generator_memsize(const void *p)
{
- return p ? sizeof(struct generator) : 0;
+ return sizeof(struct generator);
}
static const rb_data_type_t generator_data_type = {
@@ -1183,7 +1184,7 @@ static const rb_data_type_t generator_data_type = {
generator_free,
generator_memsize,
},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct generator *
@@ -1244,8 +1245,8 @@ generator_initialize(int argc, VALUE *argv, VALUE obj)
if (!rb_obj_is_proc(proc))
rb_raise(rb_eTypeError,
- "wrong argument type %s (expected Proc)",
- rb_obj_classname(proc));
+ "wrong argument type %"PRIsVALUE" (expected Proc)",
+ rb_obj_class(proc));
if (rb_block_given_p()) {
rb_warn("given block not used");
@@ -1330,14 +1331,14 @@ lazy_init_iterator(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
else {
VALUE args;
int len = rb_long2int((long)argc + 1);
+ VALUE *nargv = ALLOCV_N(VALUE, args, len);
- args = rb_ary_tmp_new(len);
- rb_ary_push(args, m);
+ nargv[0] = m;
if (argc > 0) {
- rb_ary_cat(args, argv, argc);
+ MEMCPY(nargv + 1, argv, VALUE, argc);
}
- result = rb_yield_values2(len, RARRAY_CONST_PTR(args));
- RB_GC_GUARD(args);
+ result = rb_yield_values2(len, nargv);
+ ALLOCV_END(args);
}
if (result == Qundef) rb_iter_break();
return Qnil;
@@ -1422,7 +1423,7 @@ lazy_set_method(VALUE lazy, VALUE args, rb_enumerator_size_func *size_fn)
* e.lazy -> lazy_enumerator
*
* Returns a lazy enumerator, whose methods map/collect,
- * flat_map/collect_concat, select/find_all, reject, grep, zip, take,
+ * flat_map/collect_concat, select/find_all, reject, grep, grep_v, zip, take,
* take_while, drop, and drop_while enumerate values only on an
* as-needed basis. However, if a block is given to zip, values
* are enumerated immediately.
@@ -1458,7 +1459,7 @@ enumerable_lazy(VALUE obj)
}
static VALUE
-lazy_to_enum_i(VALUE obj, VALUE meth, int argc, VALUE *argv, rb_enumerator_size_func *size_fn)
+lazy_to_enum_i(VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn)
{
return enumerator_init(enumerator_allocate(rb_cLazy),
obj, meth, argc, argv, size_fn, Qnil);
@@ -1690,6 +1691,40 @@ lazy_grep(VALUE obj, VALUE pattern)
}
static VALUE
+lazy_grep_v_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
+{
+ 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_v_iter(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
+{
+ 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_v(VALUE obj, VALUE pattern)
+{
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ rb_block_given_p() ?
+ lazy_grep_v_iter : lazy_grep_v_func,
+ pattern),
+ rb_ary_new3(1, pattern), 0);
+}
+
+static VALUE
call_next(VALUE obj)
{
return rb_funcall(obj, id_next, 0);
@@ -1770,8 +1805,8 @@ lazy_zip(int argc, VALUE *argv, VALUE obj)
if (NIL_P(v)) {
for (; i < argc; i++) {
if (!rb_respond_to(argv[i], id_each)) {
- rb_raise(rb_eTypeError, "wrong argument type %s (must respond to :each)",
- rb_obj_classname(argv[i]));
+ rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (must respond to :each)",
+ rb_obj_class(argv[i]));
}
}
ary = rb_ary_new4(argc, argv);
@@ -2028,6 +2063,7 @@ InitVM_Enumerator(void)
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, "grep_v", lazy_grep_v, 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);
@@ -2036,6 +2072,8 @@ InitVM_Enumerator(void)
rb_define_method(rb_cLazy, "lazy", lazy_lazy, 0);
rb_define_method(rb_cLazy, "chunk", lazy_super, -1);
rb_define_method(rb_cLazy, "slice_before", lazy_super, -1);
+ rb_define_method(rb_cLazy, "slice_after", lazy_super, -1);
+ rb_define_method(rb_cLazy, "slice_when", lazy_super, -1);
rb_define_alias(rb_cLazy, "force", "to_a");
@@ -2060,6 +2098,7 @@ InitVM_Enumerator(void)
rb_provide("enumerator.so"); /* for backward compatibility */
}
+#undef rb_intern
void
Init_Enumerator(void)
{
diff --git a/error.c b/error.c
index b9d8d52809..46ae322ebe 100644
--- a/error.c
+++ b/error.c
@@ -9,10 +9,8 @@
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/encoding.h"
#include "internal.h"
+#include "ruby/st.h"
#include "vm_core.h"
#include <stdio.h>
@@ -37,18 +35,23 @@
#define WEXITSTATUS(status) (status)
#endif
+VALUE rb_iseqw_local_variables(VALUE iseqval);
+VALUE rb_iseqw_new(const rb_iseq_t *);
+
VALUE rb_eEAGAIN;
VALUE rb_eEWOULDBLOCK;
VALUE rb_eEINPROGRESS;
extern const char ruby_description[];
-#define REPORTBUG_MSG \
+static const char REPORTBUG_MSG[] =
"[NOTE]\n" \
"You may have encountered a bug in the Ruby interpreter" \
" or extension libraries.\n" \
"Bug reports are welcome.\n" \
+ ""
"For details: http://www.ruby-lang.org/bugreport.html\n\n" \
+ ;
static const char *
rb_strerrno(int err)
@@ -149,6 +152,20 @@ rb_compile_error(const char *file, int line, const char *fmt, ...)
}
void
+rb_compile_error_str(VALUE file, int line, void *enc, const char *fmt, ...)
+{
+ va_list args;
+ VALUE str;
+
+ va_start(args, fmt);
+ str = compile_snprintf(enc, NULL,
+ NIL_P(file) ? NULL : RSTRING_PTR(file), line,
+ fmt, args);
+ va_end(args);
+ compile_err_append(str);
+}
+
+void
rb_compile_error_append(const char *fmt, ...)
{
va_list args;
@@ -195,14 +212,14 @@ rb_compile_warning(const char *file, int line, const char *fmt, ...)
va_end(args);
}
-static void
-warn_print(const char *fmt, va_list args)
+static VALUE
+warning_string(rb_encoding *enc, const char *fmt, va_list args)
{
- VALUE str = rb_str_new(0, 0);
- VALUE file = rb_sourcefilename();
+ VALUE str = rb_enc_str_new(0, 0, enc);
+ int line;
+ VALUE file = rb_source_location(&line);
if (!NIL_P(file)) {
- int line = rb_sourceline();
str = rb_str_append(str, file);
if (line) rb_str_catf(str, ":%d", line);
rb_str_cat2(str, ": ");
@@ -211,34 +228,68 @@ warn_print(const char *fmt, va_list args)
rb_str_cat2(str, "warning: ");
rb_str_vcatf(str, fmt, args);
rb_str_cat2(str, "\n");
- rb_write_error_str(str);
+ return str;
}
void
rb_warn(const char *fmt, ...)
{
+ VALUE mesg;
va_list args;
if (NIL_P(ruby_verbose)) return;
va_start(args, fmt);
- warn_print(fmt, args);
+ mesg = warning_string(0, fmt, args);
va_end(args);
+ rb_write_error_str(mesg);
+}
+
+void
+rb_enc_warn(rb_encoding *enc, const char *fmt, ...)
+{
+ VALUE mesg;
+ va_list args;
+
+ if (NIL_P(ruby_verbose)) return;
+
+ va_start(args, fmt);
+ mesg = warning_string(enc, fmt, args);
+ va_end(args);
+ rb_write_error_str(mesg);
}
/* rb_warning() reports only in verbose mode */
void
rb_warning(const char *fmt, ...)
{
+ VALUE mesg;
va_list args;
if (!RTEST(ruby_verbose)) return;
va_start(args, fmt);
- warn_print(fmt, args);
+ mesg = warning_string(0, fmt, args);
va_end(args);
+ rb_write_error_str(mesg);
}
+#if 0
+void
+rb_enc_warning(rb_encoding *enc, const char *fmt, ...)
+{
+ VALUE mesg;
+ va_list args;
+
+ if (!RTEST(ruby_verbose)) return;
+
+ va_start(args, fmt);
+ mesg = warning_string(enc, fmt, args);
+ va_end(args);
+ rb_write_error_str(mesg);
+}
+#endif
+
/*
* call-seq:
* warn(msg, ...) -> nil
@@ -287,60 +338,106 @@ rb_bug_reporter_add(void (*func)(FILE *, void *), void *data)
return 1;
}
-static void
-report_bug(const char *file, int line, const char *fmt, va_list args)
+/* SIGSEGV handler might have a very small stack. Thus we need to use it carefully. */
+#define REPORT_BUG_BUFSIZ 256
+static FILE *
+bug_report_file(const char *file, int line)
{
- /* SIGSEGV handler might have a very small stack. Thus we need to use it carefully. */
- char buf[256];
+ char buf[REPORT_BUG_BUFSIZ];
FILE *out = stderr;
- int len = err_position_0(buf, 256, file, line);
+ int len = err_position_0(buf, sizeof(buf), file, line);
if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
(ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {
+ return out;
+ }
+ return NULL;
+}
- fputs("[BUG] ", out);
- vsnprintf(buf, 256, fmt, args);
- fputs(buf, out);
- snprintf(buf, 256, "\n%s\n\n", ruby_description);
- fputs(buf, out);
+static void
+bug_report_begin(FILE *out, const char *fmt, va_list args)
+{
+ char buf[REPORT_BUG_BUFSIZ];
+
+ fputs("[BUG] ", out);
+ vsnprintf(buf, sizeof(buf), fmt, args);
+ fputs(buf, out);
+ snprintf(buf, sizeof(buf), "\n%s\n\n", ruby_description);
+ fputs(buf, out);
+}
- rb_vm_bugreport();
+#define bug_report_begin(out, fmt) do { \
+ va_list args; \
+ va_start(args, fmt); \
+ bug_report_begin(out, fmt, args); \
+ va_end(args); \
+} while (0)
- /* call additional bug reporters */
- {
- int i;
- for (i=0; i<bug_reporters_size; i++) {
- struct bug_reporters *reporter = &bug_reporters[i];
- (*reporter->func)(out, reporter->data);
- }
+static void
+bug_report_end(FILE *out)
+{
+ /* call additional bug reporters */
+ {
+ int i;
+ for (i=0; i<bug_reporters_size; i++) {
+ struct bug_reporters *reporter = &bug_reporters[i];
+ (*reporter->func)(out, reporter->data);
}
- fprintf(out, REPORTBUG_MSG);
}
+ fprintf(out, REPORTBUG_MSG);
+}
+
+#define report_bug(file, line, fmt, ctx) do { \
+ FILE *out = bug_report_file(file, line); \
+ if (out) { \
+ bug_report_begin(out, fmt); \
+ rb_vm_bugreport(ctx); \
+ bug_report_end(out); \
+ } \
+} while (0) \
+
+NORETURN(static void die(void));
+static void
+die(void)
+{
+#if defined(_WIN32) && defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 80
+ _set_abort_behavior( 0, _CALL_REPORTFAULT);
+#endif
+
+ abort();
}
void
rb_bug(const char *fmt, ...)
{
- va_list args;
const char *file = NULL;
int line = 0;
if (GET_THREAD()) {
- file = rb_sourcefile();
- line = rb_sourceline();
+ file = rb_source_loc(&line);
}
- va_start(args, fmt);
- report_bug(file, line, fmt, args);
- va_end(args);
+ report_bug(file, line, fmt, NULL);
-#if defined(_WIN32) && defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 80
- _set_abort_behavior( 0, _CALL_REPORTFAULT);
-#endif
+ die();
+}
- abort();
+void
+rb_bug_context(const void *ctx, const char *fmt, ...)
+{
+ const char *file = NULL;
+ int line = 0;
+
+ if (GET_THREAD()) {
+ file = rb_source_loc(&line);
+ }
+
+ report_bug(file, line, fmt, ctx);
+
+ die();
}
+
void
rb_bug_errno(const char *mesg, int errno_arg)
{
@@ -389,11 +486,15 @@ rb_async_bug_errno(const char *mesg, int errno_arg)
void
rb_compile_bug(const char *file, int line, const char *fmt, ...)
{
- va_list args;
+ report_bug(file, line, fmt, NULL);
- va_start(args, fmt);
- report_bug(file, line, fmt, args);
- va_end(args);
+ abort();
+}
+
+void
+rb_compile_bug_str(VALUE file, int line, const char *fmt, ...)
+{
+ report_bug(RSTRING_PTR(file), line, fmt, NULL);
abort();
}
@@ -421,12 +522,11 @@ static const char builtin_types[][10] = {
"false",
"Symbol", /* :symbol */
"Fixnum",
- "", /* 0x16 */
+ "undef", /* internal use: #undef; should not happen */
"", /* 0x17 */
"", /* 0x18 */
"", /* 0x19 */
- "", /* 0x1a */
- "undef", /* internal use: #undef; should not happen */
+ "Memo", /* internal use: general memo */
"Node", /* internal use: syntax tree node */
"iClass", /* internal use: mixed-in module holder */
};
@@ -441,9 +541,8 @@ rb_builtin_type_name(int t)
return 0;
}
-#define builtin_class_name rb_builtin_class_name
-const char *
-rb_builtin_class_name(VALUE x)
+static const char *
+builtin_class_name(VALUE x)
{
const char *etype;
@@ -463,6 +562,17 @@ rb_builtin_class_name(VALUE x)
etype = "false";
}
else {
+ etype = NULL;
+ }
+ return etype;
+}
+
+const char *
+rb_builtin_class_name(VALUE x)
+{
+ const char *etype = builtin_class_name(x);
+
+ if (!etype) {
etype = rb_obj_classname(x);
}
return etype;
@@ -481,8 +591,13 @@ rb_check_type(VALUE x, int t)
if (xt != t || (xt == T_DATA && RTYPEDDATA_P(x))) {
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);
+ const char *cname = builtin_class_name(x);
+ if (cname)
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
+ cname, tname);
+ else
+ rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (expected %s)",
+ rb_obj_class(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);
@@ -515,19 +630,23 @@ void *
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 (!RB_TYPE_P(obj, T_DATA)) {
+ wrong_type:
etype = builtin_class_name(obj);
- rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
+ if (!etype)
+ rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (expected %s)",
+ rb_obj_class(obj), data_type->wrap_struct_name);
+ wrong_datatype:
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
+ etype, data_type->wrap_struct_name);
}
if (!RTYPEDDATA_P(obj)) {
- etype = rb_obj_classname(obj);
- rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
+ goto wrong_type;
}
else if (!rb_typeddata_inherited_p(RTYPEDDATA_TYPE(obj), data_type)) {
etype = RTYPEDDATA_TYPE(obj)->wrap_struct_name;
- rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
+ goto wrong_datatype;
}
return DATA_PTR(obj);
}
@@ -562,12 +681,21 @@ VALUE rb_eSystemCallError;
VALUE rb_mErrno;
static VALUE rb_eNOERROR;
+static ID id_new, id_cause, id_message, id_backtrace;
+static ID id_name, id_args, id_Errno, id_errno, id_i_path;
+static ID id_receiver, id_iseq, id_local_variables;
+extern ID ruby_static_id_status;
+#define id_bt idBt
+#define id_bt_locations idBt_locations
+#define id_mesg idMesg
+#define id_status ruby_static_id_status
+
#undef rb_exc_new_cstr
VALUE
rb_exc_new(VALUE etype, const char *ptr, long len)
{
- return rb_funcall(etype, rb_intern("new"), 1, rb_str_new(ptr, len));
+ return rb_funcall(etype, id_new, 1, rb_str_new(ptr, len));
}
VALUE
@@ -580,7 +708,7 @@ VALUE
rb_exc_new_str(VALUE etype, VALUE str)
{
StringValue(str);
- return rb_funcall(etype, rb_intern("new"), 1, str);
+ return rb_funcall(etype, id_new, 1, str);
}
/*
@@ -597,8 +725,8 @@ exc_initialize(int argc, VALUE *argv, VALUE exc)
VALUE arg;
rb_scan_args(argc, argv, "01", &arg);
- rb_iv_set(exc, "mesg", arg);
- rb_iv_set(exc, "bt", Qnil);
+ rb_ivar_set(exc, id_mesg, arg);
+ rb_ivar_set(exc, id_bt, Qnil);
return exc;
}
@@ -640,7 +768,7 @@ exc_exception(int argc, VALUE *argv, VALUE self)
static VALUE
exc_to_s(VALUE exc)
{
- VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
+ VALUE mesg = rb_attr_get(exc, idMesg);
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
return rb_String(mesg);
@@ -659,7 +787,7 @@ exc_to_s(VALUE exc)
static VALUE
exc_message(VALUE exc)
{
- return rb_funcall(exc, rb_intern("to_s"), 0, 0);
+ return rb_funcallv(exc, idTo_s, 0, 0);
}
/*
@@ -722,20 +850,37 @@ exc_inspect(VALUE exc)
static VALUE
exc_backtrace(VALUE exc)
{
- ID bt;
VALUE obj;
- CONST_ID(bt, "bt");
- obj = rb_attr_get(exc, bt);
+ obj = rb_attr_get(exc, id_bt);
if (rb_backtrace_p(obj)) {
obj = rb_backtrace_to_str_ary(obj);
- /* rb_iv_set(exc, "bt", obj); */
+ /* rb_ivar_set(exc, id_bt, obj); */
}
return obj;
}
+VALUE
+rb_get_backtrace(VALUE exc)
+{
+ ID mid = id_backtrace;
+ if (rb_method_basic_definition_p(CLASS_OF(exc), id_backtrace)) {
+ VALUE info, klass = rb_eException;
+ rb_thread_t *th = GET_THREAD();
+ if (NIL_P(exc))
+ return Qnil;
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, exc, mid, klass, Qundef);
+ info = exc_backtrace(exc);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, exc, mid, klass, info);
+ if (NIL_P(info))
+ return Qnil;
+ return rb_check_backtrace(info);
+ }
+ return rb_funcall(exc, mid, 0, 0);
+}
+
/*
* call-seq:
* exception.backtrace_locations -> array
@@ -749,11 +894,9 @@ exc_backtrace(VALUE exc)
static VALUE
exc_backtrace_locations(VALUE exc)
{
- ID bt_locations;
VALUE obj;
- CONST_ID(bt_locations, "bt_locations");
- obj = rb_attr_get(exc, bt_locations);
+ obj = rb_attr_get(exc, id_bt_locations);
if (!NIL_P(obj)) {
obj = rb_backtrace_to_location_ary(obj);
}
@@ -795,7 +938,7 @@ rb_check_backtrace(VALUE bt)
static VALUE
exc_set_backtrace(VALUE exc, VALUE bt)
{
- return rb_iv_set(exc, "bt", rb_check_backtrace(bt));
+ return rb_ivar_set(exc, id_bt, rb_check_backtrace(bt));
}
VALUE
@@ -804,20 +947,25 @@ rb_exc_set_backtrace(VALUE exc, VALUE bt)
return exc_set_backtrace(exc, bt);
}
-VALUE
+/*
+ * call-seq:
+ * exception.cause -> an_exception or nil
+ *
+ * Returns the previous exception ($!) at the time this exception was raised.
+ * This is useful for wrapping exceptions and retaining the original exception
+ * information.
+ */
+
+static VALUE
exc_cause(VALUE exc)
{
- ID id_cause;
- CONST_ID(id_cause, "cause");
return rb_attr_get(exc, id_cause);
}
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);
+ return rb_check_funcall(obj, idException, 0, 0);
}
/*
@@ -833,16 +981,11 @@ static VALUE
exc_equal(VALUE exc, VALUE obj)
{
VALUE mesg, backtrace;
- ID id_mesg;
if (exc == obj) return Qtrue;
- 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) {
@@ -917,7 +1060,7 @@ exit_initialize(int argc, VALUE *argv, VALUE exc)
status = INT2FIX(EXIT_SUCCESS);
}
rb_call_super(argc, argv);
- rb_iv_set(exc, "status", status);
+ rb_ivar_set(exc, id_status, status);
return exc;
}
@@ -932,7 +1075,7 @@ exit_initialize(int argc, VALUE *argv, VALUE exc)
static VALUE
exit_status(VALUE exc)
{
- return rb_attr_get(exc, rb_intern("status"));
+ return rb_attr_get(exc, id_status);
}
@@ -946,7 +1089,7 @@ exit_status(VALUE exc)
static VALUE
exit_success_p(VALUE exc)
{
- VALUE status_val = rb_attr_get(exc, rb_intern("status"));
+ VALUE status_val = rb_attr_get(exc, id_status);
int status;
if (NIL_P(status_val))
@@ -1001,10 +1144,18 @@ static VALUE
name_err_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE name;
+ VALUE iseqw = Qnil;
name = (argc > 1) ? argv[--argc] : Qnil;
rb_call_super(argc, argv);
- rb_iv_set(self, "name", name);
+ rb_ivar_set(self, id_name, name);
+ {
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp =
+ rb_vm_get_ruby_level_next_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp));
+ if (cfp) iseqw = rb_iseqw_new(cfp->iseq);
+ }
+ rb_ivar_set(self, id_iseq, iseqw);
return self;
}
@@ -1018,7 +1169,31 @@ name_err_initialize(int argc, VALUE *argv, VALUE self)
static VALUE
name_err_name(VALUE self)
{
- return rb_attr_get(self, rb_intern("name"));
+ return rb_attr_get(self, id_name);
+}
+
+/*
+ * call-seq:
+ * name_error.local_variables -> array
+ *
+ * Return a list of the local variable names defined where this
+ * NameError exception was raised.
+ *
+ * Internal use only.
+ */
+
+static VALUE
+name_err_local_variables(VALUE self)
+{
+ VALUE vars = rb_attr_get(self, id_local_variables);
+
+ if (NIL_P(vars)) {
+ VALUE iseqw = rb_attr_get(self, id_iseq);
+ if (!NIL_P(iseqw)) vars = rb_iseqw_local_variables(iseqw);
+ if (NIL_P(vars)) vars = rb_ary_new();
+ rb_ivar_set(self, id_local_variables, vars);
+ }
+ return vars;
}
/*
@@ -1036,12 +1211,17 @@ nometh_err_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE args = (argc > 2) ? argv[--argc] : Qnil;
name_err_initialize(argc, argv, self);
- rb_iv_set(self, "args", args);
+ rb_ivar_set(self, id_args, args);
return self;
}
/* :nodoc: */
-#define NAME_ERR_MESG_COUNT 3
+enum {
+ NAME_ERR_MESG__MESG,
+ NAME_ERR_MESG__RECV,
+ NAME_ERR_MESG__NAME,
+ NAME_ERR_MESG_COUNT
+};
static void
name_err_mesg_mark(void *p)
@@ -1055,7 +1235,7 @@ name_err_mesg_mark(void *p)
static size_t
name_err_mesg_memsize(const void *p)
{
- return p ? (NAME_ERR_MESG_COUNT * sizeof(VALUE)) : 0;
+ return NAME_ERR_MESG_COUNT * sizeof(VALUE);
}
static const rb_data_type_t name_err_mesg_data_type = {
@@ -1065,26 +1245,34 @@ static const rb_data_type_t name_err_mesg_data_type = {
name_err_mesg_free,
name_err_mesg_memsize,
},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
/* :nodoc: */
VALUE
-rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method)
+rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method)
{
+ VALUE result = TypedData_Wrap_Struct(rb_cNameErrorMesg, &name_err_mesg_data_type, 0);
VALUE *ptr = ALLOC_N(VALUE, NAME_ERR_MESG_COUNT);
- VALUE result;
-
- ptr[0] = mesg;
- ptr[1] = recv;
- ptr[2] = method;
- result = TypedData_Wrap_Struct(rb_cNameErrorMesg, &name_err_mesg_data_type, ptr);
- RB_GC_GUARD(mesg);
- RB_GC_GUARD(recv);
- RB_GC_GUARD(method);
+
+ ptr[NAME_ERR_MESG__MESG] = mesg;
+ ptr[NAME_ERR_MESG__RECV] = recv;
+ ptr[NAME_ERR_MESG__NAME] = method;
+ RTYPEDDATA_DATA(result) = ptr;
return result;
}
+VALUE
+rb_name_err_new(VALUE mesg, VALUE recv, VALUE method)
+{
+ VALUE exc = rb_obj_alloc(rb_eNameError);
+ rb_ivar_set(exc, id_mesg, rb_name_err_mesg_new(mesg, recv, method));
+ rb_ivar_set(exc, id_bt, Qnil);
+ rb_ivar_set(exc, id_name, method);
+ rb_ivar_set(exc, id_receiver, recv);
+ return exc;
+}
+
/* :nodoc: */
static VALUE
name_err_mesg_equal(VALUE obj1, VALUE obj2)
@@ -1112,23 +1300,25 @@ name_err_mesg_to_str(VALUE obj)
VALUE *ptr, mesg;
TypedData_Get_Struct(obj, VALUE, &name_err_mesg_data_type, ptr);
- mesg = ptr[0];
+ mesg = ptr[NAME_ERR_MESG__MESG];
if (NIL_P(mesg)) return Qnil;
else {
- const char *desc = 0;
- VALUE d = 0, args[NAME_ERR_MESG_COUNT];
- int state = 0;
+ struct RString s_str, d_str;
+ VALUE c, s, d = 0, args[4];
+ int state = 0, singleton = 0;
+ rb_encoding *usascii = rb_usascii_encoding();
- obj = ptr[1];
+#define FAKE_CSTR(v, str) rb_setup_fake_str((v), (str), rb_strlen_lit(str), usascii)
+ obj = ptr[NAME_ERR_MESG__RECV];
switch (obj) {
case Qnil:
- desc = "nil";
+ d = FAKE_CSTR(&d_str, "nil");
break;
case Qtrue:
- desc = "true";
+ d = FAKE_CSTR(&d_str, "true");
break;
case Qfalse:
- desc = "false";
+ d = FAKE_CSTR(&d_str, "false");
break;
default:
d = rb_protect(rb_inspect, obj, &state);
@@ -1137,18 +1327,22 @@ name_err_mesg_to_str(VALUE obj)
if (NIL_P(d) || RSTRING_LEN(d) > 65) {
d = rb_any_to_s(obj);
}
- desc = RSTRING_PTR(d);
+ singleton = (RSTRING_LEN(d) > 0 && RSTRING_PTR(d)[0] == '#');
+ d = QUOTE(d);
break;
}
- if (desc && desc[0] != '#') {
- d = d ? rb_str_dup(d) : rb_str_new2(desc);
- rb_str_cat2(d, ":");
- rb_str_append(d, rb_class_name(CLASS_OF(obj)));
+ if (!singleton) {
+ s = FAKE_CSTR(&s_str, ":");
+ c = rb_class_name(CLASS_OF(obj));
+ }
+ else {
+ c = s = FAKE_CSTR(&s_str, "");
}
- args[0] = mesg;
- args[1] = ptr[2];
- args[2] = d;
- mesg = rb_f_sprintf(NAME_ERR_MESG_COUNT, args);
+ args[0] = QUOTE(rb_obj_as_string(ptr[NAME_ERR_MESG__NAME]));
+ args[1] = d;
+ args[2] = s;
+ args[3] = c;
+ mesg = rb_str_format(4, args, mesg);
}
return mesg;
}
@@ -1169,6 +1363,29 @@ name_err_mesg_load(VALUE klass, VALUE str)
/*
* call-seq:
+ * name_error.receiver -> object
+ *
+ * Return the receiver associated with this NameError exception.
+ */
+
+static VALUE
+name_err_receiver(VALUE self)
+{
+ VALUE *ptr, recv, mesg;
+
+ recv = rb_ivar_lookup(self, id_receiver, Qundef);
+ if (recv != Qundef) return recv;
+
+ mesg = rb_attr_get(self, id_mesg);
+ if (!rb_typeddata_is_kind_of(mesg, &name_err_mesg_data_type)) {
+ rb_raise(rb_eArgError, "no receiver is available");
+ }
+ ptr = DATA_PTR(mesg);
+ return ptr[NAME_ERR_MESG__RECV];
+}
+
+/*
+ * call-seq:
* no_method_error.args -> obj
*
* Return the arguments passed in as the third parameter to
@@ -1178,7 +1395,7 @@ name_err_mesg_load(VALUE klass, VALUE str)
static VALUE
nometh_err_args(VALUE self)
{
- return rb_attr_get(self, rb_intern("args"));
+ return rb_attr_get(self, id_args);
}
void
@@ -1232,19 +1449,19 @@ set_syserr(int n, const char *name)
/* capture nonblock errnos for WaitReadable/WaitWritable subclasses */
switch (n) {
- case EAGAIN:
- rb_eEAGAIN = error;
+ case EAGAIN:
+ rb_eEAGAIN = error;
-#if EAGAIN != EWOULDBLOCK
- break;
- case EWOULDBLOCK:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+ break;
+ case EWOULDBLOCK:
#endif
- rb_eEWOULDBLOCK = error;
- break;
- case EINPROGRESS:
- rb_eEINPROGRESS = error;
- break;
+ rb_eEWOULDBLOCK = error;
+ break;
+ case EINPROGRESS:
+ rb_eEINPROGRESS = error;
+ break;
}
rb_define_const(error, "Errno", INT2NUM(n));
@@ -1288,7 +1505,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
char *strerror();
#endif
const char *err;
- VALUE mesg, error, func;
+ VALUE mesg, error, func, errmsg;
VALUE klass = rb_obj_class(self);
if (klass == rb_eSystemCallError) {
@@ -1308,31 +1525,23 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
}
else {
rb_scan_args(argc, argv, "02", &mesg, &func);
- error = rb_const_get(klass, rb_intern("Errno"));
+ error = rb_const_get(klass, id_Errno);
}
if (!NIL_P(error)) err = strerror(NUM2INT(error));
else err = "unknown error";
+
+ errmsg = rb_enc_str_new_cstr(err, rb_locale_encoding());
if (!NIL_P(mesg)) {
- rb_encoding *le = rb_locale_encoding();
VALUE str = StringValue(mesg);
- rb_encoding *me = rb_enc_get(mesg);
-
- if (NIL_P(func))
- mesg = rb_sprintf("%s - %"PRIsVALUE, err, mesg);
- else
- mesg = rb_sprintf("%s @ %"PRIsVALUE" - %"PRIsVALUE, err, func, mesg);
- 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);
- }
- else {
- mesg = rb_str_new2(err);
- rb_enc_associate(mesg, rb_locale_encoding());
+
+ if (!NIL_P(func)) rb_str_catf(errmsg, " @ %"PRIsVALUE, func);
+ rb_str_catf(errmsg, " - %"PRIsVALUE, str);
+ OBJ_INFECT(errmsg, mesg);
}
+ mesg = errmsg;
+
rb_call_super(1, &mesg);
- rb_iv_set(self, "errno", error);
+ rb_ivar_set(self, id_errno, error);
return self;
}
@@ -1346,7 +1555,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
static VALUE
syserr_errno(VALUE self)
{
- return rb_attr_get(self, rb_intern("errno"));
+ return rb_attr_get(self, id_errno);
}
/*
@@ -1361,20 +1570,17 @@ static VALUE
syserr_eqq(VALUE self, VALUE exc)
{
VALUE num, e;
- ID en;
-
- CONST_ID(en, "errno");
if (!rb_obj_is_kind_of(exc, rb_eSystemCallError)) {
- if (!rb_respond_to(exc, en)) return Qfalse;
+ if (!rb_respond_to(exc, id_errno)) return Qfalse;
}
else if (self == rb_eSystemCallError) return Qtrue;
- num = rb_attr_get(exc, rb_intern("errno"));
+ num = rb_attr_get(exc, id_errno);
if (NIL_P(num)) {
- num = rb_funcall(exc, en, 0, 0);
+ num = rb_funcallv(exc, id_errno, 0, 0);
}
- e = rb_const_get(self, rb_intern("Errno"));
+ e = rb_const_get(self, id_Errno);
if (FIXNUM_P(num) ? num == e : rb_equal(num, e))
return Qtrue;
return Qfalse;
@@ -1474,7 +1680,7 @@ syserr_eqq(VALUE self, VALUE exc)
*
* <em>raises the exception:</em>
*
- * ArgumentError: wrong number of arguments (2 for 1)
+ * ArgumentError: wrong number of arguments (given 2, expected 1)
*
* Ex: passing an argument that is not acceptable:
*
@@ -1611,7 +1817,7 @@ syserr_eqq(VALUE self, VALUE exc)
*
* <em>raises the exception:</em>
*
- * RuntimeError: can't modify frozen array
+ * RuntimeError: can't modify frozen Array
*
* Kernel.raise will raise a RuntimeError if no Exception class is
* specified.
@@ -1735,14 +1941,19 @@ syserr_eqq(VALUE self, VALUE exc)
* * LoadError
* * NotImplementedError
* * SyntaxError
+ * * SecurityError
* * SignalException
* * Interrupt
* * StandardError -- default for +rescue+
* * ArgumentError
- * * IndexError
- * * StopIteration
+ * * UncaughtThrowError
+ * * EncodingError
+ * * FiberError
* * IOError
* * EOFError
+ * * IndexError
+ * * KeyError
+ * * StopIteration
* * LocalJumpError
* * NameError
* * NoMethodError
@@ -1750,14 +1961,13 @@ syserr_eqq(VALUE self, VALUE exc)
* * FloatDomainError
* * RegexpError
* * RuntimeError -- default for +raise+
- * * SecurityError
* * SystemCallError
* * Errno::*
- * * SystemStackError
* * ThreadError
* * TypeError
* * ZeroDivisionError
* * SystemExit
+ * * SystemStackError
* * fatal -- impossible to rescue
*/
@@ -1798,15 +2008,16 @@ Init_Exception(void)
rb_eLoadError = rb_define_class("LoadError", rb_eScriptError);
/* the path failed to load */
- rb_attr(rb_eLoadError, rb_intern("path"), 1, 0, Qfalse);
+ rb_attr(rb_eLoadError, rb_intern_const("path"), 1, 0, Qfalse);
rb_eNotImpError = rb_define_class("NotImplementedError", rb_eScriptError);
rb_eNameError = rb_define_class("NameError", rb_eStandardError);
rb_define_method(rb_eNameError, "initialize", name_err_initialize, -1);
rb_define_method(rb_eNameError, "name", name_err_name, 0);
+ rb_define_method(rb_eNameError, "receiver", name_err_receiver, 0);
+ rb_define_method(rb_eNameError, "local_variables", name_err_local_variables, 0);
rb_cNameErrorMesg = rb_define_class_under(rb_eNameError, "message", rb_cData);
- rb_define_singleton_method(rb_cNameErrorMesg, "!", rb_name_err_mesg_new, NAME_ERR_MESG_COUNT);
rb_define_method(rb_cNameErrorMesg, "==", name_err_mesg_equal, 1);
rb_define_method(rb_cNameErrorMesg, "to_str", name_err_mesg_to_str, 0);
rb_define_method(rb_cNameErrorMesg, "_dump", name_err_mesg_dump, 1);
@@ -1830,6 +2041,19 @@ Init_Exception(void)
rb_mErrno = rb_define_module("Errno");
rb_define_global_function("warn", rb_warn_m, -1);
+
+ id_new = rb_intern_const("new");
+ id_cause = rb_intern_const("cause");
+ id_message = rb_intern_const("message");
+ id_backtrace = rb_intern_const("backtrace");
+ id_name = rb_intern_const("name");
+ id_args = rb_intern_const("args");
+ id_receiver = rb_intern_const("receiver");
+ id_local_variables = rb_intern_const("local_variables");
+ id_Errno = rb_intern_const("Errno");
+ id_errno = rb_intern_const("errno");
+ id_i_path = rb_intern_const("@path");
+ id_iseq = rb_make_internal_id();
}
void
@@ -1863,7 +2087,7 @@ 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_ivar_set(err, id_i_path, path);
rb_exc_raise(err);
}
@@ -1895,8 +2119,8 @@ void
rb_notimplement(void)
{
rb_raise(rb_eNotImpError,
- "%s() function is unimplemented on this machine",
- rb_id2name(rb_frame_this_func()));
+ "%"PRIsVALUE"() function is unimplemented on this machine",
+ rb_id2str(rb_frame_this_func()));
}
void
@@ -2039,7 +2263,7 @@ rb_mod_syserr_fail_str(VALUE mod, int e, VALUE mesg)
void
rb_sys_warning(const char *fmt, ...)
{
- char buf[BUFSIZ];
+ VALUE mesg;
va_list args;
int errno_save;
@@ -2047,12 +2271,32 @@ rb_sys_warning(const char *fmt, ...)
if (!RTEST(ruby_verbose)) return;
- snprintf(buf, BUFSIZ, "warning: %s", fmt);
- snprintf(buf+strlen(buf), BUFSIZ-strlen(buf), ": %s", strerror(errno_save));
+ va_start(args, fmt);
+ mesg = warning_string(0, fmt, args);
+ va_end(args);
+ rb_str_set_len(mesg, RSTRING_LEN(mesg)-1);
+ rb_str_catf(mesg, ": %s\n", strerror(errno_save));
+ rb_write_error_str(mesg);
+ errno = errno_save;
+}
+
+void
+rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...)
+{
+ VALUE mesg;
+ va_list args;
+ int errno_save;
+
+ errno_save = errno;
+
+ if (!RTEST(ruby_verbose)) return;
va_start(args, fmt);
- warn_print(buf, args);
+ mesg = warning_string(enc, fmt, args);
va_end(args);
+ rb_str_set_len(mesg, RSTRING_LEN(mesg)-1);
+ rb_str_catf(mesg, ": %s\n", strerror(errno_save));
+ rb_write_error_str(mesg);
errno = errno_save;
}
@@ -2071,6 +2315,25 @@ rb_error_frozen(const char *what)
rb_raise(rb_eRuntimeError, "can't modify frozen %s", what);
}
+void
+rb_error_frozen_object(VALUE frozen_obj)
+{
+ VALUE debug_info;
+ const ID created_info = id_debug_created_info;
+
+ if (!NIL_P(debug_info = rb_attr_get(frozen_obj, created_info))) {
+ VALUE path = rb_ary_entry(debug_info, 0);
+ VALUE line = rb_ary_entry(debug_info, 1);
+
+ rb_raise(rb_eRuntimeError, "can't modify frozen %"PRIsVALUE", created at %"PRIsVALUE":%"PRIsVALUE,
+ CLASS_OF(frozen_obj), path, line);
+ }
+ else {
+ rb_raise(rb_eRuntimeError, "can't modify frozen %"PRIsVALUE,
+ CLASS_OF(frozen_obj));
+ }
+}
+
#undef rb_check_frozen
void
rb_check_frozen(VALUE obj)
diff --git a/eval.c b/eval.c
index 3a0206f24a..53609d1f7b 100644
--- a/eval.c
+++ b/eval.c
@@ -11,22 +11,24 @@
**********************************************************************/
+#include "internal.h"
#include "eval_intern.h"
#include "iseq.h"
#include "gc.h"
#include "ruby/vm.h"
-#include "ruby/encoding.h"
-#include "internal.h"
#include "vm_core.h"
#include "probes_helper.h"
-NORETURN(void rb_raise_jump(VALUE));
-
-NODE *rb_vm_get_cref(const rb_iseq_t *, const VALUE *);
+NORETURN(void rb_raise_jump(VALUE, VALUE));
VALUE rb_eLocalJumpError;
VALUE rb_eSysStackError;
+ID ruby_static_id_signo, ruby_static_id_status;
+static ID id_cause;
+#define id_signo ruby_static_id_signo
+#define id_status ruby_static_id_status
+
#define exception_error GET_VM()->special_exceptions[ruby_error_reenter]
#include "eval_error.c"
@@ -43,16 +45,15 @@ VALUE rb_eSysStackError;
int
ruby_setup(void)
{
- static int initialized = 0;
int state;
- if (initialized)
+ if (GET_VM())
return 0;
- initialized = 1;
ruby_init_stack((void *)&state);
Init_BareVM();
Init_heap();
+ Init_vm_objects();
PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {
@@ -74,7 +75,8 @@ ruby_init(void)
{
int state = ruby_setup();
if (state) {
- error_print();
+ if (RTEST(ruby_debug))
+ error_print();
exit(EXIT_FAILURE);
}
}
@@ -82,7 +84,7 @@ ruby_init(void)
/*! Processes command line arguments and compiles the Ruby source to execute.
*
* This function does:
- * \li Processes the given command line flags and arguments for ruby(1)
+ * \li Processes 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
*
@@ -160,30 +162,31 @@ ruby_cleanup(volatile int ex)
volatile VALUE errs[2];
rb_thread_t *th = GET_THREAD();
int nerr;
+ volatile int sysex = EXIT_SUCCESS;
rb_threadptr_interrupt(th);
rb_threadptr_check_signal(th);
- PUSH_TAG();
+ TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(th); });
}
- POP_TAG();
+ TH_POP_TAG();
errs[1] = th->errinfo;
th->safe_level = 0;
ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]);
- PUSH_TAG();
+ TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, ruby_finalize_0());
}
- POP_TAG();
+ TH_POP_TAG();
/* protect from Thread#raise */
th->status = THREAD_KILLED;
errs[0] = th->errinfo;
- PUSH_TAG();
+ TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, rb_thread_terminate_all());
}
@@ -191,39 +194,28 @@ ruby_cleanup(volatile int ex)
ex = state;
}
th->errinfo = errs[1];
- ex = error_handle(ex);
-
-#if EXIT_SUCCESS != 0 || EXIT_FAILURE != 1
- switch (ex) {
-#if EXIT_SUCCESS != 0
- case 0: ex = EXIT_SUCCESS; break;
-#endif
-#if EXIT_FAILURE != 1
- case 1: ex = EXIT_FAILURE; break;
-#endif
- }
-#endif
+ sysex = error_handle(ex);
state = 0;
for (nerr = 0; nerr < numberof(errs); ++nerr) {
- VALUE err = errs[nerr];
+ VALUE err = ATOMIC_VALUE_EXCHANGE(errs[nerr], Qnil);
if (!RTEST(err)) continue;
/* th->errinfo contains a NODE while break'ing */
- if (RB_TYPE_P(err, T_NODE)) continue;
+ if (THROW_DATA_P(err)) continue;
if (rb_obj_is_kind_of(err, rb_eSystemExit)) {
- ex = sysexit_status(err);
+ sysex = sysexit_status(err);
break;
}
else if (rb_obj_is_kind_of(err, rb_eSignal)) {
- VALUE sig = rb_iv_get(err, "signo");
+ VALUE sig = rb_ivar_get(err, id_signo);
state = NUM2INT(sig);
break;
}
- else if (ex == EXIT_SUCCESS) {
- ex = EXIT_FAILURE;
+ else if (sysex == EXIT_SUCCESS) {
+ sysex = EXIT_FAILURE;
}
}
@@ -231,31 +223,31 @@ ruby_cleanup(volatile int ex)
/* unlock again if finalizer took mutexes. */
rb_threadptr_unlock_all_locking_mutexes(GET_THREAD());
- POP_TAG();
- rb_thread_stop_timer_thread(1);
+ TH_POP_TAG();
+ rb_thread_stop_timer_thread();
ruby_vm_destruct(GET_VM());
if (state) ruby_default_signal(state);
- return ex;
+ return sysex;
}
static int
ruby_exec_internal(void *n)
{
volatile int state;
- VALUE iseq = (VALUE)n;
+ rb_iseq_t *iseq = (rb_iseq_t *)n;
rb_thread_t *th = GET_THREAD();
if (!n) return 0;
- PUSH_TAG();
+ TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, {
th->base_block = 0;
rb_iseq_eval_main(iseq);
});
}
- POP_TAG();
+ TH_POP_TAG();
return state;
}
@@ -337,15 +329,15 @@ static VALUE
rb_mod_nesting(void)
{
VALUE ary = rb_ary_new();
- const NODE *cref = rb_vm_cref();
+ const rb_cref_t *cref = rb_vm_cref();
- while (cref && cref->nd_next) {
- VALUE klass = cref->nd_clss;
- if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
+ while (cref && CREF_NEXT(cref)) {
+ VALUE klass = CREF_CLASS(cref);
+ if (!CREF_PUSHED_BY_EVAL(cref) &&
!NIL_P(klass)) {
rb_ary_push(ary, klass);
}
- cref = cref->nd_next;
+ cref = CREF_NEXT(cref);
}
return ary;
}
@@ -375,25 +367,25 @@ rb_mod_nesting(void)
static VALUE
rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
{
- const NODE *cref = rb_vm_cref();
+ const rb_cref_t *cref = rb_vm_cref();
VALUE klass;
VALUE cbase = 0;
void *data = 0;
- if (argc > 0) {
- return rb_mod_constants(argc, argv, rb_cModule);
+ if (argc > 0 || mod != rb_cModule) {
+ return rb_mod_constants(argc, argv, mod);
}
while (cref) {
- klass = cref->nd_clss;
- if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
+ klass = CREF_CLASS(cref);
+ if (!CREF_PUSHED_BY_EVAL(cref) &&
!NIL_P(klass)) {
- data = rb_mod_const_at(cref->nd_clss, data);
+ data = rb_mod_const_at(CREF_CLASS(cref), data);
if (!cbase) {
cbase = klass;
}
}
- cref = cref->nd_next;
+ cref = CREF_NEXT(cref);
}
if (cbase) {
@@ -412,8 +404,21 @@ rb_frozen_class_p(VALUE klass)
if (OBJ_FROZEN(klass)) {
const char *desc;
- if (FL_TEST(klass, FL_SINGLETON))
+ if (FL_TEST(klass, FL_SINGLETON)) {
desc = "object";
+ klass = rb_ivar_get(klass, id__attached__);
+ if (!SPECIAL_CONST_P(klass)) {
+ switch (BUILTIN_TYPE(klass)) {
+ case T_MODULE:
+ case T_ICLASS:
+ desc = "Module";
+ break;
+ case T_CLASS:
+ desc = "Class";
+ break;
+ }
+ }
+ }
else {
switch (BUILTIN_TYPE(klass)) {
case T_MODULE:
@@ -431,16 +436,13 @@ rb_frozen_class_p(VALUE klass)
}
}
-NORETURN(static void rb_longjmp(int, volatile VALUE));
+NORETURN(static void rb_longjmp(int, volatile VALUE, VALUE));
static VALUE get_errinfo(void);
static VALUE get_thread_errinfo(rb_thread_t *th);
static VALUE
exc_setup_cause(VALUE exc, VALUE cause)
{
- ID id_cause;
- CONST_ID(id_cause, "cause");
-
#if SUPPORT_JOKE
if (NIL_P(cause)) {
ID id_true_cause;
@@ -456,46 +458,89 @@ exc_setup_cause(VALUE exc, VALUE cause)
}
#endif
if (!NIL_P(cause) && cause != exc) {
+ if (OBJ_FROZEN(exc))
+ exc = rb_obj_dup(exc);
rb_ivar_set(exc, id_cause, cause);
}
return exc;
}
+static inline int
+sysstack_error_p(VALUE exc)
+{
+ return exc == sysstack_error || (!SPECIAL_CONST_P(exc) && RBASIC_CLASS(exc) == rb_eSysStackError);
+}
+
+static inline int
+special_exception_p(rb_thread_t *th, VALUE exc)
+{
+ enum ruby_special_exceptions i;
+ const VALUE *exceptions = th->vm->special_exceptions;
+ for (i = 0; i < ruby_special_error_count; ++i) {
+ if (exceptions[i] == exc) return TRUE;
+ }
+ return FALSE;
+}
+
static void
-setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
+setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause)
{
- VALUE at;
VALUE e;
- const char *file;
- volatile int line = 0;
+ const char *file = 0;
+ int line;
+ int nocause = 0;
if (NIL_P(mesg)) {
mesg = th->errinfo;
if (INTERNAL_EXCEPTION_P(mesg)) JUMP_TAG(TAG_FATAL);
+ nocause = 1;
}
if (NIL_P(mesg)) {
mesg = rb_exc_new(rb_eRuntimeError, 0, 0);
+ nocause = 0;
+ }
+ else if (special_exception_p(th, mesg)) {
+ mesg = ruby_vm_special_exception_copy(mesg);
+ }
+ if (cause != Qundef) {
+ mesg = exc_setup_cause(mesg, cause);
+ }
+ else if (nocause) {
+ mesg = exc_setup_cause(mesg, Qnil);
+ }
+ else if (!rb_ivar_defined(mesg, id_cause)) {
+ mesg = exc_setup_cause(mesg, get_thread_errinfo(th));
}
- exc_setup_cause(mesg, get_thread_errinfo(th));
- file = rb_sourcefile();
- if (file) line = rb_sourceline();
+ file = rb_source_loc(&line);
if (file && !NIL_P(mesg)) {
- if (mesg == sysstack_error) {
- at = rb_enc_sprintf(rb_usascii_encoding(), "%s:%d", file, line);
- at = rb_ary_new3(1, at);
- rb_iv_set(mesg, "bt", at);
+ VALUE at;
+ if (sysstack_error_p(mesg)) {
+ if (NIL_P(rb_attr_get(mesg, idBt))) {
+ at = rb_vm_backtrace_object();
+ rb_ivar_set(mesg, idBt, at);
+ rb_ivar_set(mesg, idBt_locations, at);
+ }
}
else {
- at = get_backtrace(mesg);
- if (NIL_P(at)) {
- at = rb_vm_backtrace_object();
- if (OBJ_FROZEN(mesg)) {
- mesg = rb_obj_dup(mesg);
+ int status;
+
+ TH_PUSH_TAG(th);
+ if ((status = EXEC_TAG()) == 0) {
+ VALUE bt;
+ if (rb_threadptr_set_raised(th)) goto fatal;
+ bt = rb_get_backtrace(mesg);
+ if (NIL_P(bt)) {
+ at = rb_vm_backtrace_object();
+ if (OBJ_FROZEN(mesg)) {
+ mesg = rb_obj_dup(mesg);
+ }
+ rb_ivar_set(mesg, idBt_locations, at);
+ set_backtrace(mesg, at);
}
- rb_iv_set(mesg, "bt_locations", at);
- set_backtrace(mesg, at);
+ rb_threadptr_reset_raised(th);
}
+ TH_POP_TAG();
}
}
@@ -507,23 +552,26 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
!rb_obj_is_kind_of(e, rb_eSystemExit)) {
int status;
- PUSH_TAG();
+ mesg = e;
+ TH_PUSH_TAG(th);
if ((status = EXEC_TAG()) == 0) {
- RB_GC_GUARD(e) = rb_obj_as_string(e);
+ th->errinfo = Qnil;
+ e = rb_obj_as_string(mesg);
+ th->errinfo = mesg;
if (file && line) {
- warn_printf("Exception `%s' at %s:%d - %"PRIsVALUE"\n",
- rb_obj_classname(th->errinfo), file, line, e);
+ warn_printf("Exception `%"PRIsVALUE"' at %s:%d - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), file, line, e);
}
else if (file) {
- warn_printf("Exception `%s' at %s - %"PRIsVALUE"\n",
- rb_obj_classname(th->errinfo), file, e);
+ warn_printf("Exception `%"PRIsVALUE"' at %s - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), file, e);
}
else {
- warn_printf("Exception `%s' - %"PRIsVALUE"\n",
- rb_obj_classname(th->errinfo), e);
+ warn_printf("Exception `%"PRIsVALUE"' - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), e);
}
}
- POP_TAG();
+ TH_POP_TAG();
if (status == TAG_FATAL && th->errinfo == exception_error) {
th->errinfo = mesg;
}
@@ -534,31 +582,39 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
}
if (rb_threadptr_set_raised(th)) {
+ fatal:
th->errinfo = exception_error;
rb_threadptr_reset_raised(th);
JUMP_TAG(TAG_FATAL);
}
if (tag != TAG_FATAL) {
- if (RUBY_DTRACE_RAISE_ENABLED()) {
- RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
- rb_sourcefile(),
- rb_sourceline());
- }
+ RUBY_DTRACE_HOOK(RAISE, rb_obj_classname(th->errinfo));
EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0, mesg);
}
}
+void
+rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause)
+{
+ if (cause == Qundef) {
+ cause = get_thread_errinfo(th);
+ }
+ if (cause != mesg) {
+ rb_ivar_set(mesg, id_cause, cause);
+ }
+}
+
static void
-rb_longjmp(int tag, volatile VALUE mesg)
+rb_longjmp(int tag, volatile VALUE mesg, VALUE cause)
{
rb_thread_t *th = GET_THREAD();
- setup_exception(th, tag, mesg);
+ setup_exception(th, tag, mesg, cause);
rb_thread_raised_clear(th);
JUMP_TAG(tag);
}
-static VALUE make_exception(int argc, VALUE *argv, int isstr);
+static VALUE make_exception(int argc, const VALUE *argv, int isstr);
void
rb_exc_raise(VALUE mesg)
@@ -566,7 +622,7 @@ rb_exc_raise(VALUE mesg)
if (!NIL_P(mesg)) {
mesg = make_exception(1, &mesg, FALSE);
}
- rb_longjmp(TAG_RAISE, mesg);
+ rb_longjmp(TAG_RAISE, mesg, Qundef);
}
void
@@ -575,7 +631,7 @@ rb_exc_fatal(VALUE mesg)
if (!NIL_P(mesg)) {
mesg = make_exception(1, &mesg, FALSE);
}
- rb_longjmp(TAG_FATAL, mesg);
+ rb_longjmp(TAG_FATAL, mesg, Qnil);
}
void
@@ -584,6 +640,30 @@ rb_interrupt(void)
rb_raise(rb_eInterrupt, "%s", "");
}
+enum {raise_opt_cause, raise_max_opt};
+
+static int
+extract_raise_opts(int argc, VALUE *argv, VALUE *opts)
+{
+ int i;
+ if (argc > 0) {
+ VALUE opt = argv[argc-1];
+ if (RB_TYPE_P(opt, T_HASH)) {
+ if (!RHASH_EMPTY_P(opt)) {
+ ID keywords[1];
+ CONST_ID(keywords[0], "cause");
+ rb_get_kwargs(opt, keywords, 0, -1-raise_max_opt, opts);
+ if (RHASH_EMPTY_P(opt)) --argc;
+ return argc;
+ }
+ }
+ }
+ for (i = 0; i < raise_max_opt; ++i) {
+ opts[i] = Qundef;
+ }
+ return argc;
+}
+
/*
* call-seq:
* raise
@@ -612,23 +692,28 @@ static VALUE
rb_f_raise(int argc, VALUE *argv)
{
VALUE err;
+ VALUE opts[raise_max_opt], *const cause = &opts[raise_opt_cause];
+
+ argc = extract_raise_opts(argc, argv, opts);
if (argc == 0) {
+ if (*cause != Qundef) {
+ rb_raise(rb_eArgError, "only cause is given with no arguments");
+ }
err = get_errinfo();
if (!NIL_P(err)) {
argc = 1;
argv = &err;
}
}
- rb_raise_jump(rb_make_exception(argc, argv));
+ rb_raise_jump(rb_make_exception(argc, argv), *cause);
UNREACHABLE;
}
static VALUE
-make_exception(int argc, VALUE *argv, int isstr)
+make_exception(int argc, const VALUE *argv, int isstr)
{
VALUE mesg, exc;
- ID exception;
int n;
mesg = Qnil;
@@ -654,9 +739,8 @@ make_exception(int argc, VALUE *argv, int isstr)
exc = argv[0];
n = 1;
exception_call:
- if (exc == sysstack_error) return exc;
- CONST_ID(exception, "exception");
- mesg = rb_check_funcall(exc, exception, n, argv+1);
+ if (sysstack_error_p(exc)) return exc;
+ mesg = rb_check_funcall(exc, idException, n, argv+1);
if (mesg == Qundef) {
rb_raise(rb_eTypeError, "exception class/object expected");
}
@@ -676,24 +760,25 @@ make_exception(int argc, VALUE *argv, int isstr)
}
VALUE
-rb_make_exception(int argc, VALUE *argv)
+rb_make_exception(int argc, const VALUE *argv)
{
return make_exception(argc, argv, TRUE);
}
void
-rb_raise_jump(VALUE mesg)
+rb_raise_jump(VALUE mesg, VALUE cause)
{
rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- VALUE klass = cfp->me->klass;
+ const rb_control_frame_t *cfp = th->cfp;
+ const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(cfp);
+ VALUE klass = me->owner;
VALUE self = cfp->self;
- ID mid = cfp->me->called_id;
+ ID mid = me->called_id;
th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
- EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, me->def->original_id, klass, Qnil);
- setup_exception(th, TAG_RAISE, mesg);
+ setup_exception(th, TAG_RAISE, mesg, cause);
rb_thread_raised_clear(th);
JUMP_TAG(TAG_RAISE);
@@ -702,6 +787,9 @@ rb_raise_jump(VALUE mesg)
void
rb_jump_tag(int tag)
{
+ if (UNLIKELY(tag < TAG_RETURN || tag > TAG_FATAL)) {
+ unknown_longjmp_status(tag);
+ }
JUMP_TAG(tag);
}
@@ -740,7 +828,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
{
int state;
rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
+ rb_control_frame_t *volatile cfp = th->cfp;
volatile VALUE result = Qfalse;
volatile VALUE e_info = th->errinfo;
va_list args;
@@ -760,7 +848,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
}
}
else {
- th->cfp = cfp; /* restore */
+ rb_vm_rewind_cfp(th, cfp);
if (state == TAG_RAISE) {
int handle = FALSE;
@@ -806,7 +894,7 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
volatile VALUE result = Qnil;
volatile int status;
rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
+ rb_control_frame_t *volatile cfp = th->cfp;
struct rb_vm_protect_tag protect_tag;
rb_jmpbuf_t org_jmpbuf;
@@ -819,7 +907,7 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
}
else {
- th->cfp = cfp;
+ rb_vm_rewind_cfp(th, cfp);
}
MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
th->protect_tag = protect_tag.prev;
@@ -845,13 +933,11 @@ rb_ensure(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*e_proc)(ANYARGS), VALUE
ensure_list.entry.data2 = data2;
ensure_list.next = th->ensure_list;
th->ensure_list = &ensure_list;
- PUSH_TAG();
+ TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
result = (*b_proc) (data1);
}
- POP_TAG();
- /* TODO: fix me */
- /* retval = prot_tag ? prot_tag->retval : Qnil; */ /* save retval */
+ TH_POP_TAG();
errinfo = th->errinfo;
th->ensure_list=ensure_list.next;
(*ensure_list.entry.e_proc)(ensure_list.entry.data2);
@@ -861,79 +947,30 @@ rb_ensure(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*e_proc)(ANYARGS), VALUE
return result;
}
-static const rb_method_entry_t *
-method_entry_of_iseq(rb_control_frame_t *cfp, rb_iseq_t *iseq)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp_limit;
-
- cfp_limit = (rb_control_frame_t *)(th->stack + th->stack_size);
- while (cfp_limit > cfp) {
- if (cfp->iseq == iseq)
- return cfp->me;
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
- return 0;
-}
-
static ID
frame_func_id(rb_control_frame_t *cfp)
{
- const rb_method_entry_t *me_local;
- rb_iseq_t *iseq = cfp->iseq;
- if (cfp->me) {
- return cfp->me->def->original_id;
+ const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(cfp);
+
+ if (me) {
+ return me->def->original_id;
}
- while (iseq) {
- if (RUBY_VM_IFUNC_P(iseq)) {
- NODE *ifunc = (NODE *)iseq;
- if (ifunc->nd_aid) return ifunc->nd_aid;
- return idIFUNC;
- }
- me_local = method_entry_of_iseq(cfp, iseq);
- if (me_local) {
- cfp->me = me_local;
- return me_local->def->original_id;
- }
- if (iseq->defined_method_id) {
- return iseq->defined_method_id;
- }
- if (iseq->local_iseq == iseq) {
- break;
- }
- iseq = iseq->parent_iseq;
+ else {
+ return 0;
}
- return 0;
}
static ID
frame_called_id(rb_control_frame_t *cfp)
{
- const rb_method_entry_t *me_local;
- rb_iseq_t *iseq = cfp->iseq;
- if (cfp->me) {
- return cfp->me->called_id;
+ const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(cfp);
+
+ if (me) {
+ return me->called_id;
}
- while (iseq) {
- if (RUBY_VM_IFUNC_P(iseq)) {
- NODE *ifunc = (NODE *)iseq;
- if (ifunc->nd_aid) return ifunc->nd_aid;
- return idIFUNC;
- }
- 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;
+ else {
+ return 0;
}
- return 0;
}
ID
@@ -975,11 +1012,17 @@ prev_frame_func(void)
return frame_func_id(prev_cfp);
}
-void
-rb_frame_pop(void)
+ID
+rb_frame_last_func(void)
{
rb_thread_t *th = GET_THREAD();
- th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
+ rb_control_frame_t *cfp = th->cfp;
+ ID mid;
+
+ while (!(mid = frame_func_id(cfp)) &&
+ (cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp),
+ !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)));
+ return mid;
}
/*
@@ -1078,31 +1121,30 @@ rb_mod_prepend(int argc, VALUE *argv, VALUE module)
}
static VALUE
-hidden_identity_hash_new()
+hidden_identity_hash_new(void)
{
- VALUE hash = rb_hash_new();
+ VALUE hash = rb_ident_hash_new();
- rb_funcall(hash, rb_intern("compare_by_identity"), 0);
RBASIC_CLEAR_CLASS(hash); /* hide from ObjectSpace */
return hash;
}
void
-rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
+rb_using_refinement(rb_cref_t *cref, VALUE klass, VALUE module)
{
VALUE iclass, c, superclass = klass;
Check_Type(klass, T_CLASS);
Check_Type(module, T_MODULE);
- if (NIL_P(cref->nd_refinements)) {
- cref->nd_refinements = hidden_identity_hash_new();
+ if (NIL_P(CREF_REFINEMENTS(cref))) {
+ CREF_REFINEMENTS_SET(cref, 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 (CREF_OMOD_SHARED(cref)) {
+ CREF_REFINEMENTS_SET(cref, rb_hash_dup(CREF_REFINEMENTS(cref)));
+ CREF_OMOD_SHARED_UNSET(cref);
}
- if (!NIL_P(c = rb_hash_lookup(cref->nd_refinements, klass))) {
+ if (!NIL_P(c = rb_hash_lookup(CREF_REFINEMENTS(cref), klass))) {
superclass = c;
while (c && RB_TYPE_P(c, T_ICLASS)) {
if (RBASIC(c)->klass == module) {
@@ -1117,8 +1159,8 @@ rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
c = iclass = rb_include_class_new(module, superclass);
RCLASS_REFINED_CLASS(c) = klass;
- RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(c)) =
- RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(module));
+ RCLASS_M_TBL(OBJ_WB_UNPROTECT(c)) =
+ RCLASS_M_TBL(OBJ_WB_UNPROTECT(module)); /* TODO: check unprotecting */
module = RCLASS_SUPER(module);
while (module && module != klass) {
@@ -1127,20 +1169,20 @@ rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
RCLASS_REFINED_CLASS(c) = klass;
module = RCLASS_SUPER(module);
}
- rb_hash_aset(cref->nd_refinements, klass, iclass);
+ rb_hash_aset(CREF_REFINEMENTS(cref), klass, iclass);
}
static int
using_refinement(VALUE klass, VALUE module, VALUE arg)
{
- NODE *cref = (NODE *) arg;
+ rb_cref_t *cref = (rb_cref_t *) arg;
rb_using_refinement(cref, klass, module);
return ST_CONTINUE;
}
static void
-using_module_recursive(NODE *cref, VALUE klass)
+using_module_recursive(const rb_cref_t *cref, VALUE klass)
{
ID id_refinements;
VALUE super, module, refinements;
@@ -1170,7 +1212,7 @@ using_module_recursive(NODE *cref, VALUE klass)
}
void
-rb_using_module(NODE *cref, VALUE module)
+rb_using_module(const rb_cref_t *cref, VALUE module)
{
Check_Type(module, T_MODULE);
using_module_recursive(cref, module);
@@ -1206,7 +1248,7 @@ add_activated_refinement(VALUE activated_refinements,
c = iclass = rb_include_class_new(refinement, superclass);
RCLASS_REFINED_CLASS(c) = klass;
refinement = RCLASS_SUPER(refinement);
- while (refinement) {
+ while (refinement && refinement != klass) {
FL_SET(refinement, RMODULE_IS_OVERLAID);
c = RCLASS_SET_SUPER(c, rb_include_class_new(refinement, RCLASS_SUPER(c)));
RCLASS_REFINED_CLASS(c) = klass;
@@ -1215,8 +1257,6 @@ add_activated_refinement(VALUE activated_refinements,
rb_hash_aset(activated_refinements, klass, iclass);
}
-VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
-
/*
* call-seq:
* refine(klass) { block } -> module
@@ -1284,7 +1324,6 @@ rb_mod_refine(VALUE module, VALUE klass)
static VALUE
mod_using(VALUE self, VALUE module)
{
- NODE *cref = rb_vm_cref();
rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
if (prev_frame_func()) {
@@ -1294,12 +1333,12 @@ mod_using(VALUE self, VALUE module)
if (prev_cfp && prev_cfp->self != self) {
rb_raise(rb_eRuntimeError, "Module#using is not called on self");
}
- rb_using_module(cref, module);
+ rb_using_module(rb_vm_cref_replace_with_duplicated_cref(), module);
return self;
}
void
-rb_obj_call_init(VALUE obj, int argc, VALUE *argv)
+rb_obj_call_init(VALUE obj, int argc, const VALUE *argv)
{
PASS_PASSED_BLOCK();
rb_funcall2(obj, idInitialize, argc, argv);
@@ -1421,14 +1460,13 @@ top_include(int argc, VALUE *argv, VALUE self)
static VALUE
top_using(VALUE self, VALUE module)
{
- NODE *cref = rb_vm_cref();
+ const rb_cref_t *cref = rb_vm_cref();
rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
- if (cref->nd_next || (prev_cfp && prev_cfp->me)) {
- rb_raise(rb_eRuntimeError,
- "main.using is permitted only at toplevel");
+ if (CREF_NEXT(cref) || (prev_cfp && rb_vm_frame_method_entry(prev_cfp))) {
+ rb_raise(rb_eRuntimeError, "main.using is permitted only at toplevel");
}
- rb_using_module(cref, module);
+ rb_using_module(rb_vm_cref_replace_with_duplicated_cref(), module);
return self;
}
@@ -1440,11 +1478,11 @@ 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) {
+ if (cfp->iseq->body->type == ISEQ_TYPE_RESCUE) {
return &cfp->ep[-2];
}
- else if (cfp->iseq->type == ISEQ_TYPE_ENSURE &&
- !RB_TYPE_P(cfp->ep[-2], T_NODE) &&
+ else if (cfp->iseq->body->type == ISEQ_TYPE_ENSURE &&
+ !THROW_DATA_P(cfp->ep[-2]) &&
!FIXNUM_P(cfp->ep[-2])) {
return &cfp->ep[-2];
}
@@ -1524,7 +1562,7 @@ errat_getter(ID id)
{
VALUE err = get_errinfo();
if (!NIL_P(err)) {
- return get_backtrace(err);
+ return rb_get_backtrace(err);
}
else {
return Qnil;
@@ -1650,8 +1688,9 @@ Init_eval(void)
rb_define_global_function("trace_var", rb_f_trace_var, -1); /* in variable.c */
rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */
- exception_error = rb_exc_new3(rb_eFatal,
- rb_obj_freeze(rb_str_new2("exception reentered")));
- OBJ_TAINT(exception_error);
- OBJ_FREEZE(exception_error);
+ rb_vm_register_special_exception(ruby_error_reenter, rb_eFatal, "exception reentered");
+
+ id_signo = rb_intern_const("signo");
+ id_status = rb_intern_const("status");
+ id_cause = rb_intern_const("cause");
}
diff --git a/eval_error.c b/eval_error.c
index 2ce661204c..6708559f31 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -22,41 +22,24 @@ warn_printf(const char *fmt, ...)
static void
error_pos(void)
{
- const char *sourcefile = rb_sourcefile();
- int sourceline = rb_sourceline();
+ int sourceline;
+ VALUE sourcefile = rb_source_location(&sourceline);
if (sourcefile) {
ID caller_name;
if (sourceline == 0) {
- warn_printf("%s", sourcefile);
+ warn_printf("%"PRIsVALUE, sourcefile);
}
else if ((caller_name = rb_frame_callee()) != 0) {
- warn_printf("%s:%d:in `%s'", sourcefile, sourceline,
- rb_id2name(caller_name));
+ warn_printf("%"PRIsVALUE":%d:in `%"PRIsVALUE"'", sourcefile, sourceline,
+ rb_id2str(caller_name));
}
else {
- warn_printf("%s:%d", sourcefile, sourceline);
+ warn_printf("%"PRIsVALUE":%d", sourcefile, sourceline);
}
}
}
-static VALUE
-get_backtrace(VALUE info)
-{
- if (NIL_P(info))
- return Qnil;
- info = rb_funcall(info, rb_intern("backtrace"), 0);
- if (NIL_P(info))
- return Qnil;
- return rb_check_backtrace(info);
-}
-
-VALUE
-rb_get_backtrace(VALUE info)
-{
- return get_backtrace(info);
-}
-
VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
static void
@@ -73,7 +56,7 @@ set_backtrace(VALUE info, VALUE bt)
bt = rb_backtrace_to_str_ary(bt);
}
}
- rb_funcall(info, rb_intern("set_backtrace"), 1, bt);
+ rb_check_funcall(info, set_backtrace, 1, &bt);
}
static void
@@ -82,7 +65,7 @@ error_print(void)
volatile VALUE errat = Qundef;
rb_thread_t *th = GET_THREAD();
VALUE errinfo = th->errinfo;
- int raised_flag = th->raised_flag;
+ volatile int raised_flag = th->raised_flag;
volatile VALUE eclass = Qundef, e = Qundef;
const char *volatile einfo;
volatile long elen;
@@ -93,7 +76,7 @@ error_print(void)
TH_PUSH_TAG(th);
if (TH_EXEC_TAG() == 0) {
- errat = get_backtrace(errinfo);
+ errat = rb_get_backtrace(errinfo);
}
else if (errat == Qundef) {
errat = Qnil;
@@ -105,8 +88,8 @@ error_print(void)
goto no_message;
}
if (NIL_P(errat)) {
- const char *file = rb_sourcefile();
- int line = rb_sourceline();
+ int line;
+ const char *file = rb_source_loc(&line);
if (!file)
warn_printf("%d", line);
else if (!line)
@@ -162,16 +145,16 @@ error_print(void)
tail++; /* skip newline */
}
warn_print(": ");
- warn_print2(einfo, len);
+ warn_print_str(tail ? rb_str_subseq(e, 0, len) : e);
if (epath) {
warn_print(" (");
warn_print_str(epath);
warn_print(")\n");
}
if (tail) {
- warn_print2(tail, elen - len - 1);
- if (einfo[elen-1] != '\n') warn_print2("\n", 1);
+ warn_print_str(rb_str_subseq(e, tail - einfo, elen - len - 1));
}
+ if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1);
}
}
@@ -208,39 +191,65 @@ ruby_error_print(void)
error_print();
}
+#define undef_mesg_for(v, k) rb_fstring_cstr("undefined"v" method `%1$s' for "k" `%2$s'")
+#define undef_mesg(v) ( \
+ is_mod ? \
+ undef_mesg_for(v, "module") : \
+ undef_mesg_for(v, "class"))
+
void
-rb_print_undef(VALUE klass, ID id, int scope)
+rb_print_undef(VALUE klass, ID id, int visi)
{
- const char *v;
-
- switch (scope) {
- default:
- case NOEX_PUBLIC: v = ""; break;
- case NOEX_PRIVATE: v = " private"; break;
- case NOEX_PROTECTED: v = " protected"; break;
+ const int is_mod = RB_TYPE_P(klass, T_MODULE);
+ VALUE mesg;
+ switch (visi & METHOD_VISI_MASK) {
+ case METHOD_VISI_UNDEF:
+ case METHOD_VISI_PUBLIC: mesg = undef_mesg(""); break;
+ case METHOD_VISI_PRIVATE: mesg = undef_mesg(" private"); break;
+ case METHOD_VISI_PROTECTED: mesg = undef_mesg(" protected"); break;
+ default: UNREACHABLE;
}
- rb_name_error(id, "undefined%s method `%"PRIsVALUE"' for %s `%"PRIsVALUE"'", v,
- QUOTE_ID(id),
- (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class",
- rb_class_name(klass));
+ rb_name_err_raise_str(mesg, klass, ID2SYM(id));
}
void
rb_print_undef_str(VALUE klass, VALUE name)
{
- rb_name_error_str(name, "undefined method `%"PRIsVALUE"' for %s `%"PRIsVALUE"'",
- QUOTE(name),
- (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class",
- rb_class_name(klass));
+ const int is_mod = RB_TYPE_P(klass, T_MODULE);
+ rb_name_err_raise_str(undef_mesg(""), klass, name);
+}
+
+#define inaccessible_mesg_for(v, k) rb_fstring_cstr("method `%1$s' for "k" `%2$s' is "v)
+#define inaccessible_mesg(v) ( \
+ is_mod ? \
+ inaccessible_mesg_for(v, "module") : \
+ inaccessible_mesg_for(v, "class"))
+
+void
+rb_print_inaccessible(VALUE klass, ID id, rb_method_visibility_t visi)
+{
+ const int is_mod = RB_TYPE_P(klass, T_MODULE);
+ VALUE mesg;
+ switch (visi & METHOD_VISI_MASK) {
+ case METHOD_VISI_UNDEF:
+ case METHOD_VISI_PUBLIC: mesg = inaccessible_mesg(""); break;
+ case METHOD_VISI_PRIVATE: mesg = inaccessible_mesg(" private"); break;
+ case METHOD_VISI_PROTECTED: mesg = inaccessible_mesg(" protected"); break;
+ default: UNREACHABLE;
+ }
+ rb_name_err_raise_str(mesg, klass, ID2SYM(id));
}
static int
sysexit_status(VALUE err)
{
- VALUE st = rb_iv_get(err, "status");
+ VALUE st = rb_ivar_get(err, id_status);
return NUM2INT(st);
}
+#define unknown_longjmp_status(status) \
+ rb_bug("Unknown longjmp status %d", status)
+
static int
error_handle(int ex)
{
@@ -284,7 +293,8 @@ error_handle(int ex)
if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
status = sysexit_status(errinfo);
}
- else if (rb_obj_is_instance_of(errinfo, rb_eSignal)) {
+ else if (rb_obj_is_instance_of(errinfo, rb_eSignal) &&
+ rb_ivar_get(errinfo, id_signo) != INT2FIX(SIGSEGV)) {
/* no message when exiting by signal */
}
else {
@@ -296,7 +306,7 @@ error_handle(int ex)
error_print();
break;
default:
- rb_bug("Unknown longjmp status %d", ex);
+ unknown_longjmp_status(ex);
break;
}
rb_threadptr_reset_raised(th);
diff --git a/eval_intern.h b/eval_intern.h
index a0ecb5086b..85c606ecb2 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -4,15 +4,14 @@
#include "ruby/ruby.h"
#include "vm_core.h"
-#define PASS_PASSED_BLOCK_TH(th) do { \
- (th)->passed_block = rb_vm_control_frame_block_ptr(th->cfp); \
- (th)->cfp->flag |= VM_FRAME_FLAG_PASSED; \
-} while (0)
-
-#define PASS_PASSED_BLOCK() do { \
- rb_thread_t * const __th__ = GET_THREAD(); \
- PASS_PASSED_BLOCK_TH(__th__); \
-} while (0)
+static inline void
+pass_passed_block(rb_thread_t *th)
+{
+ th->passed_block = rb_vm_control_frame_block_ptr(th->cfp);
+ th->cfp->flag |= VM_FRAME_FLAG_PASSED;
+}
+#define PASS_PASSED_BLOCK_TH(th) pass_passed_block(th)
+#define PASS_PASSED_BLOCK() pass_passed_block(GET_THREAD())
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -95,6 +94,15 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval
EXCEPTION_CONTINUE_SEARCH) { \
/* never reaches here */ \
}
+#elif defined(__MINGW32__)
+LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
+#define SAVE_ROOT_JMPBUF_BEFORE_STMT \
+ do { \
+ PVOID _handler = AddVectoredExceptionHandler(1, rb_w32_stack_overflow_handler);
+
+#define SAVE_ROOT_JMPBUF_AFTER_STMT \
+ RemoveVectoredExceptionHandler(_handler); \
+ } while (0);
#else
#define SAVE_ROOT_JMPBUF_BEFORE_STMT
#define SAVE_ROOT_JMPBUF_AFTER_STMT
@@ -113,25 +121,29 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval
#define TH_PUSH_TAG(th) do { \
rb_thread_t * const _th = (th); \
struct rb_vm_tag _tag; \
- _tag.tag = 0; \
+ _tag.tag = Qundef; \
_tag.prev = _th->tag;
#define TH_POP_TAG() \
_th->tag = _tag.prev; \
} while (0)
-#define TH_POP_TAG2() \
+#define TH_TMPPOP_TAG() \
_th->tag = _tag.prev
-#define TH_PUSH_TAG2() (_th->tag = &_tag, 0)
-
-#define TH_TMPPOP_TAG() TH_POP_TAG2()
-
-#define TH_REPUSH_TAG() TH_PUSH_TAG2()
+#define TH_REPUSH_TAG() (void)(_th->tag = &_tag)
#define PUSH_TAG() TH_PUSH_TAG(GET_THREAD())
#define POP_TAG() TH_POP_TAG()
+#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8)
+# define VAR_FROM_MEMORY(var) __extension__(*(__typeof__(var) volatile *)&(var))
+# define VAR_INITIALIZED(var) ((var) = VAR_FROM_MEMORY(var))
+#else
+# define VAR_FROM_MEMORY(var) (var)
+# define VAR_INITIALIZED(var) ((void)&(var))
+#endif
+
/* clear th->state, and return the value */
static inline int
rb_threadptr_tag_state(rb_thread_t *th)
@@ -145,7 +157,8 @@ NORETURN(static inline void rb_threadptr_tag_jump(rb_thread_t *, int));
static inline void
rb_threadptr_tag_jump(rb_thread_t *th, int st)
{
- ruby_longjmp(th->tag->buf, (th->state = st));
+ th->state = st;
+ ruby_longjmp(th->tag->buf, 1);
}
/*
@@ -153,7 +166,7 @@ rb_threadptr_tag_jump(rb_thread_t *th, int st)
[ISO/IEC 9899:1999] 7.13.1.1
*/
#define TH_EXEC_TAG() \
- (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(_th) : TH_PUSH_TAG2())
+ (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(VAR_FROM_MEMORY(_th)) : (TH_REPUSH_TAG(), 0))
#define EXEC_TAG() \
TH_EXEC_TAG()
@@ -164,41 +177,70 @@ rb_threadptr_tag_jump(rb_thread_t *th, int st)
#define INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc)
-enum ruby_tag_type {
- RUBY_TAG_RETURN = 0x1,
- RUBY_TAG_BREAK = 0x2,
- RUBY_TAG_NEXT = 0x3,
- RUBY_TAG_RETRY = 0x4,
- RUBY_TAG_REDO = 0x5,
- RUBY_TAG_RAISE = 0x6,
- RUBY_TAG_THROW = 0x7,
- RUBY_TAG_FATAL = 0x8,
- RUBY_TAG_MASK = 0xf
-};
-#define TAG_RETURN RUBY_TAG_RETURN
-#define TAG_BREAK RUBY_TAG_BREAK
-#define TAG_NEXT RUBY_TAG_NEXT
-#define TAG_RETRY RUBY_TAG_RETRY
-#define TAG_REDO RUBY_TAG_REDO
-#define TAG_RAISE RUBY_TAG_RAISE
-#define TAG_THROW RUBY_TAG_THROW
-#define TAG_FATAL RUBY_TAG_FATAL
-#define TAG_MASK RUBY_TAG_MASK
-
-#define NEW_THROW_OBJECT(val, pt, st) \
- ((VALUE)rb_node_newnode(NODE_LIT, (VALUE)(val), (VALUE)(pt), (VALUE)(st)))
-#define SET_THROWOBJ_CATCH_POINT(obj, val) \
- (RNODE((obj))->u2.value = (val))
-#define SET_THROWOBJ_STATE(obj, val) \
- (RNODE((obj))->u3.value = (val))
-
-#define GET_THROWOBJ_VAL(obj) ((VALUE)RNODE((obj))->u1.value)
-#define GET_THROWOBJ_CATCH_POINT(obj) ((VALUE*)RNODE((obj))->u2.value)
-#define GET_THROWOBJ_STATE(obj) ((int)RNODE((obj))->u3.value)
-
-#define SCOPE_TEST(f) (rb_vm_cref()->nd_visi & (f))
-#define SCOPE_CHECK(f) (rb_vm_cref()->nd_visi == (f))
-#define SCOPE_SET(f) (rb_vm_cref()->nd_visi = (f))
+/* CREF operators */
+
+#define CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1
+#define CREF_FL_OMOD_SHARED IMEMO_FL_USER2
+
+static inline VALUE
+CREF_CLASS(const rb_cref_t *cref)
+{
+ return cref->klass;
+}
+
+static inline rb_cref_t *
+CREF_NEXT(const rb_cref_t *cref)
+{
+ return cref->next;
+}
+
+static inline const rb_scope_visibility_t *
+CREF_SCOPE_VISI(const rb_cref_t *cref)
+{
+ return &cref->scope_visi;
+}
+
+static inline VALUE
+CREF_REFINEMENTS(const rb_cref_t *cref)
+{
+ return cref->refinements;
+}
+
+static inline void
+CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs)
+{
+ RB_OBJ_WRITE(cref, &cref->refinements, refs);
+}
+
+static inline int
+CREF_PUSHED_BY_EVAL(const rb_cref_t *cref)
+{
+ return cref->flags & CREF_FL_PUSHED_BY_EVAL;
+}
+
+static inline void
+CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref)
+{
+ cref->flags |= CREF_FL_PUSHED_BY_EVAL;
+}
+
+static inline int
+CREF_OMOD_SHARED(const rb_cref_t *cref)
+{
+ return cref->flags & CREF_FL_OMOD_SHARED;
+}
+
+static inline void
+CREF_OMOD_SHARED_SET(rb_cref_t *cref)
+{
+ cref->flags |= CREF_FL_OMOD_SHARED;
+}
+
+static inline void
+CREF_OMOD_SHARED_UNSET(rb_cref_t *cref)
+{
+ cref->flags &= ~CREF_FL_OMOD_SHARED;
+}
void rb_thread_cleanup(void);
void rb_thread_wait_other_threads(void);
@@ -215,8 +257,8 @@ int rb_threadptr_reset_raised(rb_thread_t *th);
#define rb_thread_raised_p(th, f) (((th)->raised_flag & (f)) != 0)
#define rb_thread_raised_clear(th) ((th)->raised_flag = 0)
-VALUE rb_f_eval(int argc, VALUE *argv, VALUE self);
-VALUE rb_make_exception(int argc, VALUE *argv);
+VALUE rb_f_eval(int argc, const VALUE *argv, VALUE self);
+VALUE rb_make_exception(int argc, const VALUE *argv);
NORETURN(void rb_method_name_error(VALUE, VALUE));
@@ -224,13 +266,15 @@ 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_print_inaccessible(VALUE, ID, rb_method_visibility_t));
NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
NORETURN(void rb_vm_jump_tag_but_local_jump(int));
-NORETURN(void rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv,
+NORETURN(void rb_raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv,
VALUE obj, int call_status));
VALUE rb_vm_make_jump_tag_but_local_jump(int state, VALUE val);
-NODE *rb_vm_cref(void);
+rb_cref_t *rb_vm_cref(void);
+rb_cref_t *rb_vm_cref_replace_with_duplicated_cref(void);
VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename);
void rb_vm_set_progname(VALUE filename);
void rb_thread_terminate_all(void);
diff --git a/eval_jump.c b/eval_jump.c
index 30094e9176..59dae109ce 100644
--- a/eval_jump.c
+++ b/eval_jump.c
@@ -94,10 +94,11 @@ rb_mark_end_proc(void)
}
static void
-exec_end_procs_chain(struct end_proc_data *volatile *procs)
+exec_end_procs_chain(struct end_proc_data *volatile *procs, VALUE *errp)
{
struct end_proc_data volatile endproc;
struct end_proc_data *link;
+ VALUE errinfo = *errp;
while ((link = *procs) != 0) {
*procs = link->next;
@@ -105,6 +106,7 @@ exec_end_procs_chain(struct end_proc_data *volatile *procs)
xfree(link);
rb_set_safe_level_force(endproc.safe);
(*endproc.func) (endproc.data);
+ *errp = errinfo;
}
}
@@ -116,20 +118,21 @@ rb_exec_end_proc(void)
rb_thread_t *th = GET_THREAD();
volatile VALUE errinfo = th->errinfo;
- PUSH_TAG();
+ TH_PUSH_TAG(th);
if ((status = EXEC_TAG()) == 0) {
again:
- exec_end_procs_chain(&ephemeral_end_procs);
- exec_end_procs_chain(&end_procs);
+ exec_end_procs_chain(&ephemeral_end_procs, &th->errinfo);
+ exec_end_procs_chain(&end_procs, &th->errinfo);
}
else {
+ VAR_INITIALIZED(th);
TH_TMPPOP_TAG();
error_handle(status);
if (!NIL_P(th->errinfo)) errinfo = th->errinfo;
TH_REPUSH_TAG();
goto again;
}
- POP_TAG();
+ TH_POP_TAG();
rb_set_safe_level_force(safe);
th->errinfo = errinfo;
diff --git a/ext/-test-/array/resize/extconf.rb b/ext/-test-/array/resize/extconf.rb
index 6500a878fc..bc827e1170 100644
--- a/ext/-test-/array/resize/extconf.rb
+++ b/ext/-test-/array/resize/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/array/resize")
diff --git a/ext/-test-/bignum/big2str.c b/ext/-test-/bignum/big2str.c
index ce71fe37e2..ec4bde2915 100644
--- a/ext/-test-/bignum/big2str.c
+++ b/ext/-test-/bignum/big2str.c
@@ -1,4 +1,3 @@
-#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bignum/bigzero.c b/ext/-test-/bignum/bigzero.c
index 2f7c272744..35117db7ae 100644
--- a/ext/-test-/bignum/bigzero.c
+++ b/ext/-test-/bignum/bigzero.c
@@ -1,11 +1,11 @@
-#include "ruby.h"
+#include "internal.h"
static VALUE
bug_big_zero(VALUE self, VALUE length)
{
long len = NUM2ULONG(length);
VALUE z = rb_big_new(len, 1);
- MEMZERO(RBIGNUM_DIGITS(z), BDIGIT, len);
+ MEMZERO(BIGNUM_DIGITS(z), BDIGIT, len);
return z;
}
@@ -14,7 +14,7 @@ bug_big_negzero(VALUE self, VALUE length)
{
long len = NUM2ULONG(length);
VALUE z = rb_big_new(len, 0);
- MEMZERO(RBIGNUM_DIGITS(z), BDIGIT, len);
+ MEMZERO(BIGNUM_DIGITS(z), BDIGIT, len);
return z;
}
diff --git a/ext/-test-/bignum/depend b/ext/-test-/bignum/depend
index c65482236a..26cb890dbf 100644
--- a/ext/-test-/bignum/depend
+++ b/ext/-test-/bignum/depend
@@ -1,7 +1,102 @@
-$(OBJS): $(HDRS) $(ruby_headers)
+big2str.o: big2str.c
+div.o: div.c
+intpack.o: intpack.c
+mul.o: mul.c
+str2big.o: str2big.c
-intpack.o: intpack.c $(top_srcdir)/internal.h
-mul.o: mul.c $(top_srcdir)/internal.h
-div.o: div.c $(top_srcdir)/internal.h
-big2str.o: big2str.c $(top_srcdir)/internal.h
-str2big.o: big2str.c $(top_srcdir)/internal.h
+# AUTOGENERATED DEPENDENCIES START
+big2str.o: $(RUBY_EXTCONF_H)
+big2str.o: $(arch_hdrdir)/ruby/config.h
+big2str.o: $(hdrdir)/ruby/defines.h
+big2str.o: $(hdrdir)/ruby/encoding.h
+big2str.o: $(hdrdir)/ruby/intern.h
+big2str.o: $(hdrdir)/ruby/io.h
+big2str.o: $(hdrdir)/ruby/missing.h
+big2str.o: $(hdrdir)/ruby/oniguruma.h
+big2str.o: $(hdrdir)/ruby/ruby.h
+big2str.o: $(hdrdir)/ruby/st.h
+big2str.o: $(hdrdir)/ruby/subst.h
+big2str.o: $(top_srcdir)/include/ruby.h
+big2str.o: $(top_srcdir)/internal.h
+big2str.o: big2str.c
+bigzero.o: $(RUBY_EXTCONF_H)
+bigzero.o: $(arch_hdrdir)/ruby/config.h
+bigzero.o: $(hdrdir)/ruby/defines.h
+bigzero.o: $(hdrdir)/ruby/encoding.h
+bigzero.o: $(hdrdir)/ruby/intern.h
+bigzero.o: $(hdrdir)/ruby/io.h
+bigzero.o: $(hdrdir)/ruby/missing.h
+bigzero.o: $(hdrdir)/ruby/oniguruma.h
+bigzero.o: $(hdrdir)/ruby/ruby.h
+bigzero.o: $(hdrdir)/ruby/st.h
+bigzero.o: $(hdrdir)/ruby/subst.h
+bigzero.o: $(top_srcdir)/include/ruby.h
+bigzero.o: $(top_srcdir)/internal.h
+bigzero.o: bigzero.c
+div.o: $(RUBY_EXTCONF_H)
+div.o: $(arch_hdrdir)/ruby/config.h
+div.o: $(hdrdir)/ruby/defines.h
+div.o: $(hdrdir)/ruby/encoding.h
+div.o: $(hdrdir)/ruby/intern.h
+div.o: $(hdrdir)/ruby/io.h
+div.o: $(hdrdir)/ruby/missing.h
+div.o: $(hdrdir)/ruby/oniguruma.h
+div.o: $(hdrdir)/ruby/ruby.h
+div.o: $(hdrdir)/ruby/st.h
+div.o: $(hdrdir)/ruby/subst.h
+div.o: $(top_srcdir)/include/ruby.h
+div.o: $(top_srcdir)/internal.h
+div.o: div.c
+init.o: $(RUBY_EXTCONF_H)
+init.o: $(arch_hdrdir)/ruby/config.h
+init.o: $(hdrdir)/ruby/defines.h
+init.o: $(hdrdir)/ruby/intern.h
+init.o: $(hdrdir)/ruby/missing.h
+init.o: $(hdrdir)/ruby/ruby.h
+init.o: $(hdrdir)/ruby/st.h
+init.o: $(hdrdir)/ruby/subst.h
+init.o: $(top_srcdir)/include/ruby.h
+init.o: init.c
+intpack.o: $(RUBY_EXTCONF_H)
+intpack.o: $(arch_hdrdir)/ruby/config.h
+intpack.o: $(hdrdir)/ruby/defines.h
+intpack.o: $(hdrdir)/ruby/encoding.h
+intpack.o: $(hdrdir)/ruby/intern.h
+intpack.o: $(hdrdir)/ruby/io.h
+intpack.o: $(hdrdir)/ruby/missing.h
+intpack.o: $(hdrdir)/ruby/oniguruma.h
+intpack.o: $(hdrdir)/ruby/ruby.h
+intpack.o: $(hdrdir)/ruby/st.h
+intpack.o: $(hdrdir)/ruby/subst.h
+intpack.o: $(top_srcdir)/include/ruby.h
+intpack.o: $(top_srcdir)/internal.h
+intpack.o: intpack.c
+mul.o: $(RUBY_EXTCONF_H)
+mul.o: $(arch_hdrdir)/ruby/config.h
+mul.o: $(hdrdir)/ruby/defines.h
+mul.o: $(hdrdir)/ruby/encoding.h
+mul.o: $(hdrdir)/ruby/intern.h
+mul.o: $(hdrdir)/ruby/io.h
+mul.o: $(hdrdir)/ruby/missing.h
+mul.o: $(hdrdir)/ruby/oniguruma.h
+mul.o: $(hdrdir)/ruby/ruby.h
+mul.o: $(hdrdir)/ruby/st.h
+mul.o: $(hdrdir)/ruby/subst.h
+mul.o: $(top_srcdir)/include/ruby.h
+mul.o: $(top_srcdir)/internal.h
+mul.o: mul.c
+str2big.o: $(RUBY_EXTCONF_H)
+str2big.o: $(arch_hdrdir)/ruby/config.h
+str2big.o: $(hdrdir)/ruby/defines.h
+str2big.o: $(hdrdir)/ruby/encoding.h
+str2big.o: $(hdrdir)/ruby/intern.h
+str2big.o: $(hdrdir)/ruby/io.h
+str2big.o: $(hdrdir)/ruby/missing.h
+str2big.o: $(hdrdir)/ruby/oniguruma.h
+str2big.o: $(hdrdir)/ruby/ruby.h
+str2big.o: $(hdrdir)/ruby/st.h
+str2big.o: $(hdrdir)/ruby/subst.h
+str2big.o: $(top_srcdir)/include/ruby.h
+str2big.o: $(top_srcdir)/internal.h
+str2big.o: str2big.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/bignum/div.c b/ext/-test-/bignum/div.c
index 2853ebef1c..a1db21dc30 100644
--- a/ext/-test-/bignum/div.c
+++ b/ext/-test-/bignum/div.c
@@ -1,4 +1,3 @@
-#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bignum/extconf.rb b/ext/-test-/bignum/extconf.rb
index e8c1febc82..34f503ca87 100644
--- a/ext/-test-/bignum/extconf.rb
+++ b/ext/-test-/bignum/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
diff --git a/ext/-test-/bignum/intpack.c b/ext/-test-/bignum/intpack.c
index 03023196e6..2d19442cf2 100644
--- a/ext/-test-/bignum/intpack.c
+++ b/ext/-test-/bignum/intpack.c
@@ -1,4 +1,3 @@
-#include "ruby.h"
#include "internal.h"
static VALUE
@@ -49,7 +48,7 @@ static VALUE
rb_integer_test_numbits_2comp_without_sign(VALUE val)
{
size_t size;
- int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : RBIGNUM_NEGATIVE_P(val);
+ int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : BIGNUM_NEGATIVE_P(val);
size = rb_absint_numwords(val, 1, NULL) - (neg && rb_absint_singlebit_p(val));
return SIZET2NUM(size);
}
@@ -57,7 +56,7 @@ rb_integer_test_numbits_2comp_without_sign(VALUE val)
static VALUE
rb_integer_test_numbytes_2comp_with_sign(VALUE val)
{
- int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : RBIGNUM_NEGATIVE_P(val);
+ int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : BIGNUM_NEGATIVE_P(val);
int nlz_bits;
size_t size = rb_absint_size(val, &nlz_bits);
if (nlz_bits == 0 && !(neg && rb_absint_singlebit_p(val)))
diff --git a/ext/-test-/bignum/mul.c b/ext/-test-/bignum/mul.c
index 758465b567..d34e98fabb 100644
--- a/ext/-test-/bignum/mul.c
+++ b/ext/-test-/bignum/mul.c
@@ -1,4 +1,3 @@
-#include "ruby.h"
#include "internal.h"
static VALUE
@@ -55,8 +54,8 @@ mul_gmp(VALUE x, VALUE y)
void
Init_mul(VALUE klass)
{
- rb_define_const(rb_cBignum, "SIZEOF_BDIGITS", INT2NUM(SIZEOF_BDIGITS));
- rb_define_const(rb_cBignum, "BITSPERDIG", INT2NUM(SIZEOF_BDIGITS * CHAR_BIT));
+ rb_define_const(rb_cBignum, "SIZEOF_BDIGIT", INT2NUM(SIZEOF_BDIGIT));
+ rb_define_const(rb_cBignum, "BITSPERDIG", INT2NUM(SIZEOF_BDIGIT * CHAR_BIT));
rb_define_method(rb_cInteger, "big_mul_normal", mul_normal, 1);
rb_define_method(rb_cInteger, "big_sq_fast", sq_fast, 0);
rb_define_method(rb_cInteger, "big_mul_balance", mul_balance, 1);
diff --git a/ext/-test-/bignum/str2big.c b/ext/-test-/bignum/str2big.c
index 0fdcb53290..bc79ef0329 100644
--- a/ext/-test-/bignum/str2big.c
+++ b/ext/-test-/bignum/str2big.c
@@ -1,4 +1,3 @@
-#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bug-3571/extconf.rb b/ext/-test-/bug-3571/extconf.rb
index 6390fce219..10b3bb304b 100644
--- a/ext/-test-/bug-3571/extconf.rb
+++ b/ext/-test-/bug-3571/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/bug-3571/bug")
diff --git a/ext/-test-/bug-3662/extconf.rb b/ext/-test-/bug-3662/extconf.rb
deleted file mode 100644
index 7a1b73023c..0000000000
--- a/ext/-test-/bug-3662/extconf.rb
+++ /dev/null
@@ -1 +0,0 @@
-create_makefile("-test-/bug-3662/bug")
diff --git a/ext/-test-/bug-5832/extconf.rb b/ext/-test-/bug-5832/extconf.rb
index 55a4b7d93f..948e7791b6 100644
--- a/ext/-test-/bug-5832/extconf.rb
+++ b/ext/-test-/bug-5832/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/bug-5832/bug")
diff --git a/ext/-test-/bug_reporter/extconf.rb b/ext/-test-/bug_reporter/extconf.rb
index 0fccd81a41..fb2ed40342 100644
--- a/ext/-test-/bug_reporter/extconf.rb
+++ b/ext/-test-/bug_reporter/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/bug_reporter/bug_reporter")
diff --git a/ext/-test-/class/extconf.rb b/ext/-test-/class/extconf.rb
index a07d660b87..1c7837d07a 100644
--- a/ext/-test-/class/extconf.rb
+++ b/ext/-test-/class/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
diff --git a/ext/-test-/debug/depend b/ext/-test-/debug/depend
index d5a2ef9a52..5178d85673 100644
--- a/ext/-test-/debug/depend
+++ b/ext/-test-/debug/depend
@@ -1,3 +1,32 @@
-init.o: $(HDRS) $(ruby_headers)
-inspector.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
-profile_frames.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
+# AUTOGENERATED DEPENDENCIES START
+init.o: $(RUBY_EXTCONF_H)
+init.o: $(arch_hdrdir)/ruby/config.h
+init.o: $(hdrdir)/ruby/defines.h
+init.o: $(hdrdir)/ruby/intern.h
+init.o: $(hdrdir)/ruby/missing.h
+init.o: $(hdrdir)/ruby/ruby.h
+init.o: $(hdrdir)/ruby/st.h
+init.o: $(hdrdir)/ruby/subst.h
+init.o: $(top_srcdir)/include/ruby.h
+init.o: init.c
+inspector.o: $(RUBY_EXTCONF_H)
+inspector.o: $(arch_hdrdir)/ruby/config.h
+inspector.o: $(hdrdir)/ruby/debug.h
+inspector.o: $(hdrdir)/ruby/defines.h
+inspector.o: $(hdrdir)/ruby/intern.h
+inspector.o: $(hdrdir)/ruby/missing.h
+inspector.o: $(hdrdir)/ruby/ruby.h
+inspector.o: $(hdrdir)/ruby/st.h
+inspector.o: $(hdrdir)/ruby/subst.h
+inspector.o: inspector.c
+profile_frames.o: $(RUBY_EXTCONF_H)
+profile_frames.o: $(arch_hdrdir)/ruby/config.h
+profile_frames.o: $(hdrdir)/ruby/debug.h
+profile_frames.o: $(hdrdir)/ruby/defines.h
+profile_frames.o: $(hdrdir)/ruby/intern.h
+profile_frames.o: $(hdrdir)/ruby/missing.h
+profile_frames.o: $(hdrdir)/ruby/ruby.h
+profile_frames.o: $(hdrdir)/ruby/st.h
+profile_frames.o: $(hdrdir)/ruby/subst.h
+profile_frames.o: profile_frames.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/debug/extconf.rb b/ext/-test-/debug/extconf.rb
index 8f7922e1a6..0f34383165 100644
--- a/ext/-test-/debug/extconf.rb
+++ b/ext/-test-/debug/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
inits.delete("init")
diff --git a/ext/-test-/dln/empty/empty.c b/ext/-test-/dln/empty/empty.c
new file mode 100644
index 0000000000..c4f94f1644
--- /dev/null
+++ b/ext/-test-/dln/empty/empty.c
@@ -0,0 +1,4 @@
+void
+Init_empty(void)
+{
+}
diff --git a/ext/-test-/dln/empty/extconf.rb b/ext/-test-/dln/empty/extconf.rb
new file mode 100644
index 0000000000..20310b6dde
--- /dev/null
+++ b/ext/-test-/dln/empty/extconf.rb
@@ -0,0 +1,2 @@
+# frozen_string_literal: false
+create_makefile("-test-/dln/empty")
diff --git a/ext/-test-/exception/depend b/ext/-test-/exception/depend
index 79b6c53f50..a89ecf7a4f 100644
--- a/ext/-test-/exception/depend
+++ b/ext/-test-/exception/depend
@@ -1,3 +1,43 @@
-$(OBJS): $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h
+# AUTOGENERATED DEPENDENCIES START
+dataerror.o: $(RUBY_EXTCONF_H)
+dataerror.o: $(arch_hdrdir)/ruby/config.h
+dataerror.o: $(hdrdir)/ruby/defines.h
+dataerror.o: $(hdrdir)/ruby/intern.h
+dataerror.o: $(hdrdir)/ruby/missing.h
+dataerror.o: $(hdrdir)/ruby/ruby.h
+dataerror.o: $(hdrdir)/ruby/st.h
+dataerror.o: $(hdrdir)/ruby/subst.h
+dataerror.o: dataerror.c
+enc_raise.o: $(RUBY_EXTCONF_H)
+enc_raise.o: $(arch_hdrdir)/ruby/config.h
+enc_raise.o: $(hdrdir)/ruby/defines.h
+enc_raise.o: $(hdrdir)/ruby/encoding.h
+enc_raise.o: $(hdrdir)/ruby/intern.h
+enc_raise.o: $(hdrdir)/ruby/missing.h
+enc_raise.o: $(hdrdir)/ruby/oniguruma.h
+enc_raise.o: $(hdrdir)/ruby/ruby.h
+enc_raise.o: $(hdrdir)/ruby/st.h
+enc_raise.o: $(hdrdir)/ruby/subst.h
+enc_raise.o: $(top_srcdir)/include/ruby.h
+enc_raise.o: enc_raise.c
+ensured.o: $(RUBY_EXTCONF_H)
+ensured.o: $(arch_hdrdir)/ruby/config.h
+ensured.o: $(hdrdir)/ruby/defines.h
+ensured.o: $(hdrdir)/ruby/intern.h
+ensured.o: $(hdrdir)/ruby/missing.h
+ensured.o: $(hdrdir)/ruby/ruby.h
+ensured.o: $(hdrdir)/ruby/st.h
+ensured.o: $(hdrdir)/ruby/subst.h
+ensured.o: $(top_srcdir)/include/ruby.h
+ensured.o: ensured.c
+init.o: $(RUBY_EXTCONF_H)
+init.o: $(arch_hdrdir)/ruby/config.h
+init.o: $(hdrdir)/ruby/defines.h
+init.o: $(hdrdir)/ruby/intern.h
+init.o: $(hdrdir)/ruby/missing.h
+init.o: $(hdrdir)/ruby/ruby.h
+init.o: $(hdrdir)/ruby/st.h
+init.o: $(hdrdir)/ruby/subst.h
+init.o: $(top_srcdir)/include/ruby.h
+init.o: init.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/exception/extconf.rb b/ext/-test-/exception/extconf.rb
index 0faf6d53ed..55bbb1fc3e 100644
--- a/ext/-test-/exception/extconf.rb
+++ b/ext/-test-/exception/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
inits.delete("init")
diff --git a/ext/-test-/fatal/extconf.rb b/ext/-test-/fatal/extconf.rb
index e0cfeb2095..d5849c0733 100644
--- a/ext/-test-/fatal/extconf.rb
+++ b/ext/-test-/fatal/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/fatal/rb_fatal")
diff --git a/ext/-test-/file/depend b/ext/-test-/file/depend
index 7555a235b5..a43b4275dc 100644
--- a/ext/-test-/file/depend
+++ b/ext/-test-/file/depend
@@ -1,2 +1,36 @@
-init.o: $(HDRS) $(ruby_headers)
-stat.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/io.h $(hdrdir)/ruby/encoding.h $(hdrdir)/oniguruma.h
+# AUTOGENERATED DEPENDENCIES START
+fs.o: $(RUBY_EXTCONF_H)
+fs.o: $(arch_hdrdir)/ruby/config.h
+fs.o: $(hdrdir)/ruby/defines.h
+fs.o: $(hdrdir)/ruby/encoding.h
+fs.o: $(hdrdir)/ruby/intern.h
+fs.o: $(hdrdir)/ruby/io.h
+fs.o: $(hdrdir)/ruby/missing.h
+fs.o: $(hdrdir)/ruby/oniguruma.h
+fs.o: $(hdrdir)/ruby/ruby.h
+fs.o: $(hdrdir)/ruby/st.h
+fs.o: $(hdrdir)/ruby/subst.h
+fs.o: fs.c
+init.o: $(RUBY_EXTCONF_H)
+init.o: $(arch_hdrdir)/ruby/config.h
+init.o: $(hdrdir)/ruby/defines.h
+init.o: $(hdrdir)/ruby/intern.h
+init.o: $(hdrdir)/ruby/missing.h
+init.o: $(hdrdir)/ruby/ruby.h
+init.o: $(hdrdir)/ruby/st.h
+init.o: $(hdrdir)/ruby/subst.h
+init.o: $(top_srcdir)/include/ruby.h
+init.o: init.c
+stat.o: $(RUBY_EXTCONF_H)
+stat.o: $(arch_hdrdir)/ruby/config.h
+stat.o: $(hdrdir)/ruby/defines.h
+stat.o: $(hdrdir)/ruby/encoding.h
+stat.o: $(hdrdir)/ruby/intern.h
+stat.o: $(hdrdir)/ruby/io.h
+stat.o: $(hdrdir)/ruby/missing.h
+stat.o: $(hdrdir)/ruby/oniguruma.h
+stat.o: $(hdrdir)/ruby/ruby.h
+stat.o: $(hdrdir)/ruby/st.h
+stat.o: $(hdrdir)/ruby/subst.h
+stat.o: stat.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/file/extconf.rb b/ext/-test-/file/extconf.rb
index 4e134dd1bf..c1c26f215d 100644
--- a/ext/-test-/file/extconf.rb
+++ b/ext/-test-/file/extconf.rb
@@ -1,4 +1,20 @@
+# frozen_string_literal: false
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+
+headers = %w[sys/param.h sys/mount.h sys/vfs.h].select {|h| have_header(h)}
+if have_type("struct statfs", headers)
+ have_struct_member("struct statfs", "f_fstypename", headers)
+ have_struct_member("struct statfs", "f_type", headers)
+ have_struct_member("struct statfs", "f_flags", headers)
+end
+
+headers = %w[sys/statvfs.h].select {|h| have_header(h)}
+if have_type("struct statvfs", headers)
+ have_struct_member("struct statvfs", "f_fstypename", headers)
+ have_struct_member("struct statvfs", "f_basetype", headers)
+ have_struct_member("struct statvfs", "f_type", headers)
+end
+
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
inits.delete("init")
diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c
new file mode 100644
index 0000000000..c9c3473257
--- /dev/null
+++ b/ext/-test-/file/fs.c
@@ -0,0 +1,108 @@
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+#if defined HAVE_STRUCT_STATFS_F_FSTYPENAME
+typedef struct statfs statfs_t;
+# define STATFS(f, s) statfs((f), (s))
+# define HAVE_STRUCT_STATFS_T_F_FSTYPENAME 1
+# if defined HAVE_STRUCT_STATFS_F_TYPE
+# define HAVE_STRUCT_STATFS_T_F_TYPE 1
+# endif
+#elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME) /* NetBSD */
+typedef struct statvfs statfs_t;
+# define STATFS(f, s) statvfs((f), (s))
+# define HAVE_STRUCT_STATFS_T_F_FSTYPENAME 1
+# if defined HAVE_STRUCT_STATVFS_F_TYPE
+# define HAVE_STRUCT_STATFS_T_F_TYPE 1
+# endif
+#elif defined(HAVE_STRUCT_STATVFS_F_BASETYPE) /* AIX, HP-UX, Solaris */
+typedef struct statvfs statfs_t;
+# define STATFS(f, s) statvfs((f), (s))
+# define HAVE_STRUCT_STATFS_T_F_FSTYPENAME 1
+# define f_fstypename f_basetype
+# if defined HAVE_STRUCT_STATVFS_F_TYPE
+# define HAVE_STRUCT_STATFS_T_F_TYPE 1
+# endif
+#elif defined(HAVE_STRUCT_STATFS_F_TYPE) /* Linux */
+typedef struct statfs statfs_t;
+# define STATFS(f, s) statfs((f), (s))
+# if defined HAVE_STRUCT_STATFS_F_TYPE
+# define HAVE_STRUCT_STATFS_T_F_TYPE 1
+# endif
+#endif
+
+VALUE
+get_fsname(VALUE self, VALUE str)
+{
+#ifdef STATFS
+ statfs_t st;
+# define CSTR(s) rb_str_new_cstr(s)
+
+ FilePathValue(str);
+ str = rb_str_encode_ospath(str);
+ if (STATFS(StringValueCStr(str), &st) == -1) {
+ rb_sys_fail_str(str);
+ }
+# ifdef HAVE_STRUCT_STATFS_T_F_FSTYPENAME
+ if (st.f_fstypename[0])
+ return CSTR(st.f_fstypename);
+# endif
+# ifdef HAVE_STRUCT_STATFS_T_F_TYPE
+ switch (st.f_type) {
+ case 0x9123683E: /* BTRFS_SUPER_MAGIC */
+ return CSTR("btrfs");
+ case 0x7461636f: /* OCFS2_SUPER_MAGIC */
+ return CSTR("ocfs");
+ case 0xEF53: /* EXT2_SUPER_MAGIC EXT3_SUPER_MAGIC EXT4_SUPER_MAGIC */
+ return CSTR("ext4");
+ case 0x58465342: /* XFS_SUPER_MAGIC */
+ return CSTR("xfs");
+ case 0x01021994: /* TMPFS_MAGIC */
+ return CSTR("tmpfs");
+ }
+# endif
+#endif
+ return Qnil;
+}
+
+VALUE
+get_noatime_p(VALUE self, VALUE str)
+{
+#ifdef STATFS
+ statfs_t st;
+ FilePathValue(str);
+ str = rb_str_encode_ospath(str);
+ if (STATFS(StringValueCStr(str), &st) == -1) {
+ rb_sys_fail_str(str);
+ }
+# ifdef HAVE_STRUCT_STATFS_F_FLAGS
+# ifdef MNT_NOATIME
+ return st.f_flags & MNT_NOATIME ? Qtrue : Qfalse;
+# elif defined(ST_NOATIME)
+ return st.f_flags & ST_NOATIME ? Qtrue : Qfalse;
+# endif
+# endif
+#endif
+ return Qnil;
+}
+
+void
+Init_fs(VALUE module)
+{
+ VALUE fs = rb_define_module_under(module, "Fs");
+ rb_define_module_function(fs, "fsname", get_fsname, 1);
+ rb_define_module_function(fs, "noatime?", get_noatime_p, 1);
+}
diff --git a/ext/-test-/float/depend b/ext/-test-/float/depend
new file mode 100644
index 0000000000..dff14550f7
--- /dev/null
+++ b/ext/-test-/float/depend
@@ -0,0 +1,3 @@
+$(OBJS): $(HDRS) $(ruby_headers)
+
+nextafter.o: nextafter.c $(top_srcdir)/missing/nextafter.c
diff --git a/ext/-test-/float/extconf.rb b/ext/-test-/float/extconf.rb
new file mode 100644
index 0000000000..15709a1def
--- /dev/null
+++ b/ext/-test-/float/extconf.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: false
+$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+$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-/float")
diff --git a/ext/-test-/float/init.c b/ext/-test-/float/init.c
new file mode 100644
index 0000000000..d962108e39
--- /dev/null
+++ b/ext/-test-/float/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_float(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Float", rb_cObject);
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/float/nextafter.c b/ext/-test-/float/nextafter.c
new file mode 100644
index 0000000000..30fb71f520
--- /dev/null
+++ b/ext/-test-/float/nextafter.c
@@ -0,0 +1,36 @@
+#include "ruby.h"
+
+static VALUE
+system_nextafter_m(VALUE klass, VALUE vx, VALUE vy)
+{
+ double x, y, z;
+
+ x = NUM2DBL(vx);
+ y = NUM2DBL(vy);
+ z = nextafter(x, y);
+
+ return DBL2NUM(z);
+}
+
+#define nextafter missing_nextafter
+#include "../../../missing/nextafter.c"
+#undef nextafter
+
+static VALUE
+missing_nextafter_m(VALUE klass, VALUE vx, VALUE vy)
+{
+ double x, y, z;
+
+ x = NUM2DBL(vx);
+ y = NUM2DBL(vy);
+ z = missing_nextafter(x, y);
+
+ return DBL2NUM(z);
+}
+
+void
+Init_nextafter(VALUE klass)
+{
+ rb_define_singleton_method(klass, "system_nextafter", system_nextafter_m, 2);
+ rb_define_singleton_method(klass, "missing_nextafter", missing_nextafter_m, 2);
+}
diff --git a/ext/-test-/funcall/extconf.rb b/ext/-test-/funcall/extconf.rb
index 8a9179ab2f..35c3078bf5 100644
--- a/ext/-test-/funcall/extconf.rb
+++ b/ext/-test-/funcall/extconf.rb
@@ -1,2 +1,3 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile("-test-/funcall/funcall")
diff --git a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c b/ext/-test-/gvl/call_without_gvl/call_without_gvl.c
new file mode 100644
index 0000000000..f3071d5768
--- /dev/null
+++ b/ext/-test-/gvl/call_without_gvl/call_without_gvl.c
@@ -0,0 +1,34 @@
+#include "ruby/ruby.h"
+#include "ruby/thread.h"
+
+static void*
+native_sleep_callback(void *data)
+{
+ struct timeval *timeval = data;
+ select(0, NULL, NULL, NULL, timeval);
+
+ return NULL;
+}
+
+
+static VALUE
+thread_runnable_sleep(VALUE thread, VALUE timeout)
+{
+ struct timeval timeval;
+
+ if (NIL_P(timeout)) {
+ rb_raise(rb_eArgError, "timeout must be non nil");
+ }
+
+ timeval = rb_time_interval(timeout);
+
+ rb_thread_call_without_gvl(native_sleep_callback, &timeval, RUBY_UBF_IO, NULL);
+
+ return thread;
+}
+
+void
+Init_call_without_gvl(void)
+{
+ rb_define_method(rb_cThread, "__runnable_sleep__", thread_runnable_sleep, 1);
+}
diff --git a/ext/-test-/gvl/call_without_gvl/extconf.rb b/ext/-test-/gvl/call_without_gvl/extconf.rb
new file mode 100644
index 0000000000..56181b6773
--- /dev/null
+++ b/ext/-test-/gvl/call_without_gvl/extconf.rb
@@ -0,0 +1,2 @@
+# frozen_string_literal: false
+create_makefile("-test-/gvl/call_without_gvl")
diff --git a/ext/-test-/hash/delete.c b/ext/-test-/hash/delete.c
new file mode 100644
index 0000000000..10d4aec6e7
--- /dev/null
+++ b/ext/-test-/hash/delete.c
@@ -0,0 +1,16 @@
+#include "ruby.h"
+
+extern VALUE rb_hash_delete_entry(VALUE hash, VALUE key);
+
+static VALUE
+hash_delete(VALUE hash, VALUE key)
+{
+ VALUE ret = rb_hash_delete_entry(hash, key);
+ return ret == Qundef ? Qnil : rb_ary_new_from_values(1, &ret);
+}
+
+void
+Init_delete(VALUE klass)
+{
+ rb_define_method(klass, "delete!", hash_delete, 1);
+}
diff --git a/ext/-test-/hash/extconf.rb b/ext/-test-/hash/extconf.rb
new file mode 100644
index 0000000000..c823cb95b2
--- /dev/null
+++ b/ext/-test-/hash/extconf.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: false
+$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+$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-/hash")
diff --git a/ext/-test-/hash/init.c b/ext/-test-/hash/init.c
new file mode 100644
index 0000000000..9f6cbde652
--- /dev/null
+++ b/ext/-test-/hash/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_hash(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Hash", rb_cHash);
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/iseq_load/extconf.rb b/ext/-test-/iseq_load/extconf.rb
new file mode 100644
index 0000000000..c5bd6c0569
--- /dev/null
+++ b/ext/-test-/iseq_load/extconf.rb
@@ -0,0 +1,2 @@
+# frozen_string_literal: false
+create_makefile("-test-/iseq_load/iseq_load")
diff --git a/ext/-test-/iseq_load/iseq_load.c b/ext/-test-/iseq_load/iseq_load.c
new file mode 100644
index 0000000000..b4b9a8aa3d
--- /dev/null
+++ b/ext/-test-/iseq_load/iseq_load.c
@@ -0,0 +1,21 @@
+#include <ruby.h>
+
+VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
+
+static VALUE
+iseq_load(int argc, VALUE *argv, VALUE self)
+{
+ VALUE data, opt = Qnil;
+
+ rb_scan_args(argc, argv, "11", &data, &opt);
+
+ return rb_iseq_load(data, 0, opt);
+}
+
+void
+Init_iseq_load(void)
+{
+ VALUE rb_cISeq = rb_path2class("RubyVM::InstructionSequence");
+
+ rb_define_singleton_method(rb_cISeq, "iseq_load", iseq_load, -1);
+}
diff --git a/ext/-test-/iter/extconf.rb b/ext/-test-/iter/extconf.rb
index 0ba99691bd..a0f03e23a9 100644
--- a/ext/-test-/iter/extconf.rb
+++ b/ext/-test-/iter/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
diff --git a/ext/-test-/load/dot.dot/extconf.rb b/ext/-test-/load/dot.dot/extconf.rb
index 6287db6bd8..b5292c77f0 100644
--- a/ext/-test-/load/dot.dot/extconf.rb
+++ b/ext/-test-/load/dot.dot/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/load/dot.dot/dot.dot")
diff --git a/ext/-test-/marshal/compat/extconf.rb b/ext/-test-/marshal/compat/extconf.rb
index bb11ebfb8c..9bf44b473a 100644
--- a/ext/-test-/marshal/compat/extconf.rb
+++ b/ext/-test-/marshal/compat/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/marshal/compat")
diff --git a/ext/-test-/marshal/internal_ivar/extconf.rb b/ext/-test-/marshal/internal_ivar/extconf.rb
new file mode 100644
index 0000000000..cb3f825dbd
--- /dev/null
+++ b/ext/-test-/marshal/internal_ivar/extconf.rb
@@ -0,0 +1,2 @@
+# frozen_string_literal: false
+create_makefile("-test-/marshal/internal_ivar")
diff --git a/ext/-test-/marshal/internal_ivar/internal_ivar.c b/ext/-test-/marshal/internal_ivar/internal_ivar.c
new file mode 100644
index 0000000000..299da27f23
--- /dev/null
+++ b/ext/-test-/marshal/internal_ivar/internal_ivar.c
@@ -0,0 +1,39 @@
+#include <ruby.h>
+
+static ID id_normal_ivar, id_internal_ivar;
+
+static VALUE
+init(VALUE self, VALUE arg1, VALUE arg2)
+{
+ rb_ivar_set(self, id_normal_ivar, arg1);
+ rb_ivar_set(self, id_internal_ivar, arg2);
+ return self;
+}
+
+static VALUE
+get_normal(VALUE self)
+{
+ return rb_attr_get(self, id_normal_ivar);
+}
+
+static VALUE
+get_internal(VALUE self)
+{
+ return rb_attr_get(self, id_internal_ivar);
+}
+
+void
+Init_internal_ivar(void)
+{
+ VALUE mMarshal = rb_define_module_under(rb_define_module("Bug"), "Marshal");
+ VALUE newclass = rb_define_class_under(mMarshal, "InternalIVar", rb_cObject);
+
+ id_normal_ivar = rb_intern_const("normal");
+#if 0
+ /* leave id_internal_ivar being 0 */
+ id_internal_ivar = rb_make_internal_id();
+#endif
+ rb_define_method(newclass, "initialize", init, 2);
+ rb_define_method(newclass, "normal", get_normal, 0);
+ rb_define_method(newclass, "internal", get_internal, 0);
+}
diff --git a/ext/-test-/marshal/usr/extconf.rb b/ext/-test-/marshal/usr/extconf.rb
index c662b23dd5..b7886b9eea 100644
--- a/ext/-test-/marshal/usr/extconf.rb
+++ b/ext/-test-/marshal/usr/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/marshal/usr")
diff --git a/ext/-test-/marshal/usr/usrmarshal.c b/ext/-test-/marshal/usr/usrmarshal.c
index b30bd52c13..0c9e079af2 100644
--- a/ext/-test-/marshal/usr/usrmarshal.c
+++ b/ext/-test-/marshal/usr/usrmarshal.c
@@ -1,23 +1,38 @@
#include <ruby.h>
+static size_t
+usr_size(const void *ptr)
+{
+ return sizeof(int);
+}
+
+static const rb_data_type_t usrmarshal_type = {
+ "UsrMarshal",
+ {0, RUBY_DEFAULT_FREE, usr_size,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED,
+};
+
static VALUE
usr_alloc(VALUE klass)
{
int *p;
- return Data_Make_Struct(klass, int, 0, RUBY_DEFAULT_FREE, p);
+ return TypedData_Make_Struct(klass, int, &usrmarshal_type, p);
}
static VALUE
usr_init(VALUE self, VALUE val)
{
- *(int *)DATA_PTR(self) = NUM2INT(val);
+ int *ptr = Check_TypedStruct(self, &usrmarshal_type);
+ *ptr = NUM2INT(val);
return self;
}
static VALUE
usr_value(VALUE self)
{
- int val = *(int *)DATA_PTR(self);
+ int *ptr = Check_TypedStruct(self, &usrmarshal_type);
+ int val = *ptr;
return INT2NUM(val);
}
diff --git a/ext/-test-/method/extconf.rb b/ext/-test-/method/extconf.rb
index 658b7af1f1..3a52c1a822 100644
--- a/ext/-test-/method/extconf.rb
+++ b/ext/-test-/method/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
inits.delete("init")
diff --git a/ext/-test-/bug-3662/bug.c b/ext/-test-/notimplement/bug.c
index 9375dace10..34731bc2e6 100644
--- a/ext/-test-/bug-3662/bug.c
+++ b/ext/-test-/notimplement/bug.c
@@ -8,7 +8,7 @@ bug_funcall(int argc, VALUE *argv, VALUE self)
}
void
-Init_bug(void)
+Init_notimplement(void)
{
VALUE mBug = rb_define_module("Bug");
rb_define_module_function(mBug, "funcall", bug_funcall, -1);
diff --git a/ext/-test-/notimplement/extconf.rb b/ext/-test-/notimplement/extconf.rb
new file mode 100644
index 0000000000..54403cd7ce
--- /dev/null
+++ b/ext/-test-/notimplement/extconf.rb
@@ -0,0 +1,2 @@
+# frozen_string_literal: false
+create_makefile("-test-/notimplement")
diff --git a/ext/-test-/num2int/extconf.rb b/ext/-test-/num2int/extconf.rb
index 2bc820e480..c585462921 100644
--- a/ext/-test-/num2int/extconf.rb
+++ b/ext/-test-/num2int/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/num2int/num2int")
diff --git a/ext/-test-/old_thread_select/depend b/ext/-test-/old_thread_select/depend
deleted file mode 100644
index e786dc71d2..0000000000
--- a/ext/-test-/old_thread_select/depend
+++ /dev/null
@@ -1,4 +0,0 @@
-$(OBJS): $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/-test-/old_thread_select/extconf.rb b/ext/-test-/old_thread_select/extconf.rb
deleted file mode 100644
index 730d9ec901..0000000000
--- a/ext/-test-/old_thread_select/extconf.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-$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
deleted file mode 100644
index e374f02355..0000000000
--- a/ext/-test-/old_thread_select/old_thread_select.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 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
index e1072b1443..8f05248d87 100644
--- a/ext/-test-/path_to_class/extconf.rb
+++ b/ext/-test-/path_to_class/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
inits.delete("init")
diff --git a/ext/-test-/popen_deadlock/extconf.rb b/ext/-test-/popen_deadlock/extconf.rb
new file mode 100644
index 0000000000..24a7d79931
--- /dev/null
+++ b/ext/-test-/popen_deadlock/extconf.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: false
+case RUBY_PLATFORM
+when /solaris/i, /linux/i
+ create_makefile("-test-/popen_deadlock/infinite_loop_dlsym")
+end
diff --git a/ext/-test-/popen_deadlock/infinite_loop_dlsym.c b/ext/-test-/popen_deadlock/infinite_loop_dlsym.c
new file mode 100644
index 0000000000..1d95a7cc9a
--- /dev/null
+++ b/ext/-test-/popen_deadlock/infinite_loop_dlsym.c
@@ -0,0 +1,50 @@
+#include "ruby/ruby.h"
+#include "ruby/thread.h"
+#include <dlfcn.h>
+
+struct data_for_loop_dlsym {
+ const char *name;
+ volatile int stop;
+};
+
+static void*
+native_loop_dlsym(void *data)
+{
+ struct data_for_loop_dlsym *s = data;
+
+ while (!(s->stop)) {
+ dlsym(RTLD_DEFAULT, s->name);
+ }
+
+ return NULL;
+}
+
+static void
+ubf_for_loop_dlsym(void *data)
+{
+ struct data_for_loop_dlsym *s = data;
+
+ s->stop = 1;
+
+ return;
+}
+
+static VALUE
+loop_dlsym(VALUE self, VALUE name)
+{
+ struct data_for_loop_dlsym d;
+
+ d.stop = 0;
+ d.name = StringValuePtr(name);
+
+ rb_thread_call_without_gvl(native_loop_dlsym, &d,
+ ubf_for_loop_dlsym, &d);
+
+ return self;
+}
+
+void
+Init_infinite_loop_dlsym(void)
+{
+ rb_define_method(rb_cThread, "__infinite_loop_dlsym__", loop_dlsym, 1);
+}
diff --git a/ext/-test-/postponed_job/extconf.rb b/ext/-test-/postponed_job/extconf.rb
index aa29b593f4..58fbd3b461 100644
--- a/ext/-test-/postponed_job/extconf.rb
+++ b/ext/-test-/postponed_job/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile('-test-/postponed_job')
diff --git a/ext/-test-/printf/extconf.rb b/ext/-test-/printf/extconf.rb
index 7b96da0c85..fb8fa8de36 100644
--- a/ext/-test-/printf/extconf.rb
+++ b/ext/-test-/printf/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/printf")
diff --git a/ext/-test-/printf/printf.c b/ext/-test-/printf/printf.c
index fd60b0f593..666f5592e5 100644
--- a/ext/-test-/printf/printf.c
+++ b/ext/-test-/printf/printf.c
@@ -2,14 +2,6 @@
#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);
@@ -28,7 +20,7 @@ printf_test_q(VALUE self, VALUE obj)
}
static char *
-utoa(char *p, char *e, unsigned int x)
+uint_to_str(char *p, char *e, unsigned int x)
{
char *e0 = e;
if (e <= p) return p;
@@ -42,18 +34,23 @@ utoa(char *p, char *e, unsigned int x)
static VALUE
printf_test_call(int argc, VALUE *argv, VALUE self)
{
- VALUE opt, type, num;
+ VALUE opt, type, num, result;
char format[sizeof(int) * 6 + 8], *p = format, cnv;
- int n;
+ int n = 0;
+ const char *s = 0;
rb_scan_args(argc, argv, "2:", &type, &num, &opt);
Check_Type(type, T_STRING);
if (RSTRING_LEN(type) != 1) rb_raise(rb_eArgError, "wrong length(%ld)", RSTRING_LEN(type));
switch (cnv = RSTRING_PTR(type)[0]) {
- case 'd': case 'x': case 'o': case 'X': break;
+ case 'd': case 'x': case 'o': case 'X':
+ n = NUM2INT(num);
+ break;
+ case 's':
+ s = StringValueCStr(num);
+ break;
default: rb_raise(rb_eArgError, "wrong conversion(%c)", cnv);
}
- n = NUM2INT(num);
*p++ = '%';
if (!NIL_P(opt)) {
VALUE v;
@@ -74,25 +71,29 @@ printf_test_call(int argc, VALUE *argv, VALUE self)
*p++ = '0';
}
if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("width"))))) {
- p = utoa(p, format + sizeof(format), NUM2UINT(v));
+ p = uint_to_str(p, format + sizeof(format), NUM2UINT(v));
}
if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("prec"))))) {
*p++ = '.';
if (FIXNUM_P(v))
- p = utoa(p, format + sizeof(format), NUM2UINT(v));
+ p = uint_to_str(p, format + sizeof(format), NUM2UINT(v));
}
}
*p++ = cnv;
*p++ = '\0';
- return rb_assoc_new(rb_enc_sprintf(rb_usascii_encoding(), format, n),
- rb_usascii_str_new_cstr(format));
+ if (cnv == 's') {
+ result = rb_enc_sprintf(rb_usascii_encoding(), format, s);
+ }
+ else {
+ result = rb_enc_sprintf(rb_usascii_encoding(), format, n);
+ }
+ return rb_assoc_new(result, rb_usascii_str_new_cstr(format));
}
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);
rb_define_singleton_method(m, "q", printf_test_q, 1);
diff --git a/ext/-test-/proc/extconf.rb b/ext/-test-/proc/extconf.rb
new file mode 100644
index 0000000000..9f87575749
--- /dev/null
+++ b/ext/-test-/proc/extconf.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: false
+$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+$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-/proc")
diff --git a/ext/-test-/proc/init.c b/ext/-test-/proc/init.c
new file mode 100644
index 0000000000..814c55d98b
--- /dev/null
+++ b/ext/-test-/proc/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_proc(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_module_under(mBug, "Proc");
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/proc/receiver.c b/ext/-test-/proc/receiver.c
new file mode 100644
index 0000000000..fe44a2246c
--- /dev/null
+++ b/ext/-test-/proc/receiver.c
@@ -0,0 +1,21 @@
+#include "ruby.h"
+
+VALUE rb_current_receiver(void);
+
+static VALUE
+bug_proc_call_receiver(RB_BLOCK_CALL_FUNC_ARGLIST(yieldarg, procarg))
+{
+ return rb_current_receiver();
+}
+
+static VALUE
+bug_proc_make_call_receiver(VALUE self, VALUE procarg)
+{
+ return rb_proc_new(bug_proc_call_receiver, procarg);
+}
+
+void
+Init_receiver(VALUE klass)
+{
+ rb_define_singleton_method(klass, "make_call_receiver", bug_proc_make_call_receiver, 1);
+}
diff --git a/ext/-test-/proc/super.c b/ext/-test-/proc/super.c
new file mode 100644
index 0000000000..dbe8af08f1
--- /dev/null
+++ b/ext/-test-/proc/super.c
@@ -0,0 +1,27 @@
+#include "ruby.h"
+
+static VALUE
+bug_proc_call_super(RB_BLOCK_CALL_FUNC_ARGLIST(yieldarg, procarg))
+{
+ VALUE args[2];
+ VALUE ret;
+ args[0] = yieldarg;
+ args[1] = procarg;
+ ret = rb_call_super(2, args);
+ if (!NIL_P(blockarg)) {
+ ret = rb_proc_call(blockarg, ret);
+ }
+ return ret;
+}
+
+static VALUE
+bug_proc_make_call_super(VALUE self, VALUE procarg)
+{
+ return rb_proc_new(bug_proc_call_super, procarg);
+}
+
+void
+Init_super(VALUE klass)
+{
+ rb_define_singleton_method(klass, "make_call_super", bug_proc_make_call_super, 1);
+}
diff --git a/ext/-test-/rational/depend b/ext/-test-/rational/depend
index a43589042b..bff4981ed6 100644
--- a/ext/-test-/rational/depend
+++ b/ext/-test-/rational/depend
@@ -1,3 +1,20 @@
$(OBJS): $(HDRS) $(ruby_headers)
rat.o: rat.c $(top_srcdir)/internal.h
+
+# AUTOGENERATED DEPENDENCIES START
+rat.o: $(RUBY_EXTCONF_H)
+rat.o: $(arch_hdrdir)/ruby/config.h
+rat.o: $(hdrdir)/ruby/defines.h
+rat.o: $(hdrdir)/ruby/encoding.h
+rat.o: $(hdrdir)/ruby/intern.h
+rat.o: $(hdrdir)/ruby/io.h
+rat.o: $(hdrdir)/ruby/missing.h
+rat.o: $(hdrdir)/ruby/oniguruma.h
+rat.o: $(hdrdir)/ruby/ruby.h
+rat.o: $(hdrdir)/ruby/st.h
+rat.o: $(hdrdir)/ruby/subst.h
+rat.o: $(top_srcdir)/include/ruby.h
+rat.o: $(top_srcdir)/internal.h
+rat.o: rat.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/rational/extconf.rb b/ext/-test-/rational/extconf.rb
index bd658def46..28c5d690c1 100644
--- a/ext/-test-/rational/extconf.rb
+++ b/ext/-test-/rational/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
diff --git a/ext/-test-/rational/rat.c b/ext/-test-/rational/rat.c
index 63ca849816..772546fca8 100644
--- a/ext/-test-/rational/rat.c
+++ b/ext/-test-/rational/rat.c
@@ -1,4 +1,3 @@
-#include "ruby.h"
#include "internal.h"
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
diff --git a/ext/-test-/recursion/extconf.rb b/ext/-test-/recursion/extconf.rb
index 92b28657f0..13828113f0 100644
--- a/ext/-test-/recursion/extconf.rb
+++ b/ext/-test-/recursion/extconf.rb
@@ -1,2 +1,3 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile("-test-/recursion")
diff --git a/ext/-test-/st/foreach/extconf.rb b/ext/-test-/st/foreach/extconf.rb
new file mode 100644
index 0000000000..a7346203c4
--- /dev/null
+++ b/ext/-test-/st/foreach/extconf.rb
@@ -0,0 +1,2 @@
+# frozen_string_literal: false
+create_makefile("-test-/st/foreach")
diff --git a/ext/-test-/st/foreach/foreach.c b/ext/-test-/st/foreach/foreach.c
new file mode 100644
index 0000000000..1e0fd515c9
--- /dev/null
+++ b/ext/-test-/st/foreach/foreach.c
@@ -0,0 +1,175 @@
+#include <ruby.h>
+#include <ruby/st.h>
+
+static st_data_t expect_size = 32;
+struct checker {
+ st_table *tbl;
+ st_index_t nr;
+ VALUE test;
+};
+
+static void
+force_unpack_check(struct checker *c, st_data_t key, st_data_t val)
+{
+ if (c->nr == 0) {
+ st_data_t i;
+
+ if (!c->tbl->entries_packed) rb_bug("should be packed\n");
+
+ /* force unpacking during iteration: */
+ for (i = 1; i < expect_size; i++)
+ st_add_direct(c->tbl, i, i);
+
+ if (c->tbl->entries_packed) rb_bug("should be unpacked\n");
+ }
+
+ if (key != c->nr) {
+ rb_bug("unexpected key: %"PRIuVALUE" (expected %"PRIuVALUE")\n", (VALUE)key, (VALUE)c->nr);
+ }
+ if (val != c->nr) {
+ rb_bug("unexpected val: %"PRIuVALUE" (expected %"PRIuVALUE")\n", (VALUE)val, (VALUE)c->nr);
+ }
+
+ c->nr++;
+}
+
+static int
+unp_fec_i(st_data_t key, st_data_t val, st_data_t args, int error)
+{
+ struct checker *c = (struct checker *)args;
+
+ if (error) {
+ if (c->test == ID2SYM(rb_intern("delete2")))
+ return ST_STOP;
+
+ rb_bug("unexpected error");
+ }
+
+ force_unpack_check(c, key, val);
+
+ if (c->test == ID2SYM(rb_intern("check"))) {
+ return ST_CHECK;
+ }
+ if (c->test == ID2SYM(rb_intern("delete1"))) {
+ if (c->nr == 1) return ST_DELETE;
+ return ST_CHECK;
+ }
+ if (c->test == ID2SYM(rb_intern("delete2"))) {
+ if (c->nr == 1) {
+ st_data_t k = 0;
+ st_data_t v;
+
+ if (!st_delete(c->tbl, &k, &v)) {
+ rb_bug("failed to delete\n");
+ }
+ if (v != 0) {
+ rb_bug("unexpected value deleted: %"PRIuVALUE" (expected 0)", (VALUE)v);
+ }
+ }
+ return ST_CHECK;
+ }
+
+ rb_raise(rb_eArgError, "unexpected arg: %+"PRIsVALUE, c->test);
+}
+
+static VALUE
+unp_fec(VALUE self, VALUE test)
+{
+ st_table *tbl = st_init_numtable();
+ struct checker c;
+
+ c.tbl = tbl;
+ c.nr = 0;
+ c.test = test;
+
+ st_add_direct(tbl, 0, 0);
+
+ if (!tbl->entries_packed) rb_bug("should still be packed\n");
+
+ st_foreach_check(tbl, unp_fec_i, (st_data_t)&c, -1);
+
+ if (c.test == ID2SYM(rb_intern("delete2"))) {
+ if (c.nr != 1) {
+ rb_bug("mismatched iteration: %"PRIuVALUE" (expected 1)\n", (VALUE)c.nr);
+ }
+ }
+ else if (c.nr != expect_size) {
+ rb_bug("mismatched iteration: %"PRIuVALUE" (expected %"PRIuVALUE")\n",
+ (VALUE)c.nr, (VALUE)expect_size);
+ }
+
+ if (tbl->entries_packed) rb_bug("should be unpacked\n");
+
+ st_free_table(tbl);
+
+ return Qnil;
+}
+
+static int
+unp_fe_i(st_data_t key, st_data_t val, st_data_t args, int error)
+{
+ struct checker *c = (struct checker *)args;
+
+ force_unpack_check(c, key, val);
+ if (c->test == ID2SYM(rb_intern("unpacked"))) {
+ return ST_CONTINUE;
+ }
+ else if (c->test == ID2SYM(rb_intern("unpack_delete"))) {
+ if (c->nr == 1) {
+ st_data_t k = 0;
+ st_data_t v;
+
+ if (!st_delete(c->tbl, &k, &v)) {
+ rb_bug("failed to delete\n");
+ }
+ if (v != 0) {
+ rb_bug("unexpected value deleted: %"PRIuVALUE" (expected 0)", (VALUE)v);
+ }
+ return ST_CONTINUE;
+ }
+ rb_bug("should never get here\n");
+ }
+
+ rb_raise(rb_eArgError, "unexpected arg: %+"PRIsVALUE, c->test);
+}
+
+static VALUE
+unp_fe(VALUE self, VALUE test)
+{
+ st_table *tbl = st_init_numtable();
+ struct checker c;
+
+ c.tbl = tbl;
+ c.nr = 0;
+ c.test = test;
+
+ st_add_direct(tbl, 0, 0);
+
+ if (!tbl->entries_packed) rb_bug("should still be packed\n");
+
+ st_foreach(tbl, unp_fe_i, (st_data_t)&c);
+
+ if (c.test == ID2SYM(rb_intern("unpack_delete"))) {
+ if (c.nr != 1) {
+ rb_bug("mismatched iteration: %"PRIuVALUE" (expected 1)\n", (VALUE)c.nr);
+ }
+ }
+ else if (c.nr != expect_size) {
+ rb_bug("mismatched iteration: %"PRIuVALUE" (expected %"PRIuVALUE"o)\n",
+ (VALUE)c.nr, (VALUE)expect_size);
+ }
+
+ if (tbl->entries_packed) rb_bug("should be unpacked\n");
+
+ st_free_table(tbl);
+
+ return Qnil;
+}
+
+void
+Init_foreach(void)
+{
+ VALUE bug = rb_define_module("Bug");
+ rb_define_singleton_method(bug, "unp_st_foreach_check", unp_fec, 1);
+ rb_define_singleton_method(bug, "unp_st_foreach", unp_fe, 1);
+}
diff --git a/ext/-test-/st/numhash/extconf.rb b/ext/-test-/st/numhash/extconf.rb
index 867fd75d2a..27d28a0a77 100644
--- a/ext/-test-/st/numhash/extconf.rb
+++ b/ext/-test-/st/numhash/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/st/numhash")
diff --git a/ext/-test-/st/numhash/numhash.c b/ext/-test-/st/numhash/numhash.c
index d4dbd1a0ce..fc35f476cd 100644
--- a/ext/-test-/st/numhash/numhash.c
+++ b/ext/-test-/st/numhash/numhash.c
@@ -7,16 +7,29 @@ numhash_free(void *ptr)
if (ptr) st_free_table(ptr);
}
+static size_t
+numhash_memsize(const void *ptr)
+{
+ return st_memsize(ptr);
+}
+
+static const rb_data_type_t numhash_type = {
+ "numhash",
+ {0, numhash_free, numhash_memsize,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED,
+};
+
static VALUE
numhash_alloc(VALUE klass)
{
- return Data_Wrap_Struct(klass, 0, numhash_free, 0);
+ return TypedData_Wrap_Struct(klass, &numhash_type, 0);
}
static VALUE
numhash_init(VALUE self)
{
- st_table *tbl = (st_table *)DATA_PTR(self);
+ st_table *tbl = (st_table *)Check_TypedStruct(self, &numhash_type);
if (tbl) st_free_table(tbl);
DATA_PTR(self) = st_init_numtable();
return self;
@@ -26,8 +39,9 @@ static VALUE
numhash_aref(VALUE self, VALUE key)
{
st_data_t data;
+ st_table *tbl = (st_table *)Check_TypedStruct(self, &numhash_type);
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))
+ if (st_lookup(tbl, (st_data_t)key, &data))
return (VALUE)data;
return Qnil;
}
@@ -35,9 +49,10 @@ numhash_aref(VALUE self, VALUE key)
static VALUE
numhash_aset(VALUE self, VALUE key, VALUE data)
{
+ st_table *tbl = (st_table *)Check_TypedStruct(self, &numhash_type);
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);
+ st_insert(tbl, (st_data_t)key, (st_data_t)data);
return self;
}
@@ -53,7 +68,7 @@ numhash_i(st_data_t key, st_data_t value, st_data_t arg)
static VALUE
numhash_each(VALUE self)
{
- st_table *table = DATA_PTR(self);
+ st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type);
st_data_t data = (st_data_t)self;
return st_foreach_check(table, numhash_i, data, data) ? Qtrue : Qfalse;
}
@@ -76,7 +91,8 @@ update_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
static VALUE
numhash_update(VALUE self, VALUE key)
{
- if (st_update((st_table *)DATA_PTR(self), (st_data_t)key, update_func, 0))
+ st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type);
+ if (st_update(table, (st_data_t)key, update_func, 0))
return Qtrue;
else
return Qfalse;
@@ -91,14 +107,16 @@ numhash_update(VALUE self, VALUE key)
static VALUE
numhash_size(VALUE self)
{
- return ST2NUM(((st_table *)DATA_PTR(self))->num_entries);
+ st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type);
+ return ST2NUM(table->num_entries);
}
static VALUE
numhash_delete_safe(VALUE self, VALUE key)
{
+ st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type);
st_data_t val, k = (st_data_t)key;
- if (st_delete_safe((st_table *)DATA_PTR(self), &k, &val, (st_data_t)self)) {
+ if (st_delete_safe(table, &k, &val, (st_data_t)self)) {
return val;
}
return Qnil;
diff --git a/ext/-test-/st/update/extconf.rb b/ext/-test-/st/update/extconf.rb
index 96dbae43ab..5152b24229 100644
--- a/ext/-test-/st/update/extconf.rb
+++ b/ext/-test-/st/update/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/st/update")
diff --git a/ext/-test-/string/coderange.c b/ext/-test-/string/coderange.c
index 2f1e6a06a8..b93172d72d 100644
--- a/ext/-test-/string/coderange.c
+++ b/ext/-test-/string/coderange.c
@@ -2,10 +2,11 @@
#include "ruby/encoding.h"
static VALUE sym_7bit, sym_valid, sym_unknown, sym_broken;
+
static VALUE
-str_coderange(VALUE str)
+coderange_int2sym(int coderange)
{
- switch (ENC_CODERANGE(str)) {
+ switch (coderange) {
case ENC_CODERANGE_7BIT:
return sym_7bit;
case ENC_CODERANGE_VALID:
@@ -19,6 +20,21 @@ str_coderange(VALUE str)
UNREACHABLE;
}
+/* return coderange without scan */
+static VALUE
+str_coderange(VALUE str)
+{
+ return coderange_int2sym(ENC_CODERANGE(str));
+}
+
+/* scan coderange and return the result */
+static VALUE
+str_coderange_scan(VALUE str)
+{
+ ENC_CODERANGE_SET(str, ENC_CODERANGE_UNKNOWN);
+ return coderange_int2sym(rb_enc_str_coderange(str));
+}
+
void
Init_coderange(VALUE klass)
{
@@ -27,4 +43,5 @@ Init_coderange(VALUE klass)
sym_unknown = ID2SYM(rb_intern("unknown"));
sym_broken = ID2SYM(rb_intern("broken"));
rb_define_method(klass, "coderange", str_coderange, 0);
+ rb_define_method(klass, "coderange_scan", str_coderange_scan, 0);
}
diff --git a/ext/-test-/string/cstr.c b/ext/-test-/string/cstr.c
index c2ed410b41..9bd33a344e 100644
--- a/ext/-test-/string/cstr.c
+++ b/ext/-test-/string/cstr.c
@@ -1,5 +1,4 @@
-#include "ruby.h"
-#include "ruby/encoding.h"
+#include "internal.h"
static VALUE
bug_str_cstr_term(VALUE str)
@@ -9,9 +8,7 @@ bug_str_cstr_term(VALUE str)
int c;
rb_encoding *enc;
- rb_str_modify(str);
len = RSTRING_LEN(str);
- RSTRING_PTR(str)[len] = 'x';
s = StringValueCStr(str);
rb_gc();
enc = rb_enc_get(str);
@@ -19,8 +16,108 @@ bug_str_cstr_term(VALUE str)
return INT2NUM(c);
}
+static VALUE
+bug_str_cstr_unterm(VALUE str, VALUE c)
+{
+ long len;
+
+ rb_str_modify(str);
+ len = RSTRING_LEN(str);
+ RSTRING_PTR(str)[len] = NUM2CHR(c);
+ return str;
+}
+
+static VALUE
+bug_str_cstr_term_char(VALUE str)
+{
+ long len;
+ char *s;
+ int c;
+ rb_encoding *enc = rb_enc_get(str);
+
+ RSTRING_GETMEM(str, s, len);
+ s += len;
+ len = rb_enc_mbminlen(enc);
+ c = rb_enc_precise_mbclen(s, s + len, enc);
+ if (!MBCLEN_CHARFOUND_P(c)) {
+ c = (unsigned char)*s;
+ }
+ else {
+ c = rb_enc_mbc_to_codepoint(s, s + len, enc);
+ if (!c) return Qnil;
+ }
+ return rb_enc_uint_chr((unsigned int)c, enc);
+}
+
+static VALUE
+bug_str_s_cstr_term(VALUE self, VALUE str)
+{
+ Check_Type(str, T_STRING);
+ return bug_str_cstr_term(str);
+}
+
+static VALUE
+bug_str_s_cstr_unterm(VALUE self, VALUE str, VALUE c)
+{
+ Check_Type(str, T_STRING);
+ return bug_str_cstr_unterm(str, c);
+}
+
+static VALUE
+bug_str_s_cstr_term_char(VALUE self, VALUE str)
+{
+ Check_Type(str, T_STRING);
+ return bug_str_cstr_term_char(str);
+}
+
+#define TERM_LEN(str) rb_enc_mbminlen(rb_enc_get(str))
+#define TERM_FILL(ptr, termlen) do {\
+ char *const term_fill_ptr = (ptr);\
+ const int term_fill_len = (termlen);\
+ *term_fill_ptr = '\0';\
+ if (UNLIKELY(term_fill_len > 1))\
+ memset(term_fill_ptr, 0, term_fill_len);\
+} while (0)
+
+static VALUE
+bug_str_s_cstr_noembed(VALUE self, VALUE str)
+{
+ VALUE str2 = rb_str_new(NULL, 0);
+ long capacity = RSTRING_LEN(str) + TERM_LEN(str);
+ char *buf = ALLOC_N(char, capacity);
+ Check_Type(str, T_STRING);
+ FL_SET((str2), STR_NOEMBED);
+ memcpy(buf, RSTRING_PTR(str), capacity);
+ RBASIC(str2)->flags &= ~RSTRING_EMBED_LEN_MASK;
+ RSTRING(str2)->as.heap.aux.capa = capacity;
+ RSTRING(str2)->as.heap.ptr = buf;
+ RSTRING(str2)->as.heap.len = RSTRING_LEN(str);
+ TERM_FILL(RSTRING_END(str2), TERM_LEN(str));
+ return str2;
+}
+
+static VALUE
+bug_str_s_cstr_embedded_p(VALUE self, VALUE str)
+{
+ return STR_EMBED_P(str) ? Qtrue : Qfalse;
+}
+
+static VALUE
+bug_str_s_rb_str_new_frozen(VALUE self, VALUE str)
+{
+ return rb_str_new_frozen(str);
+}
+
void
Init_cstr(VALUE klass)
{
rb_define_method(klass, "cstr_term", bug_str_cstr_term, 0);
+ rb_define_method(klass, "cstr_unterm", bug_str_cstr_unterm, 1);
+ rb_define_method(klass, "cstr_term_char", bug_str_cstr_term_char, 0);
+ rb_define_singleton_method(klass, "cstr_term", bug_str_s_cstr_term, 1);
+ rb_define_singleton_method(klass, "cstr_unterm", bug_str_s_cstr_unterm, 2);
+ rb_define_singleton_method(klass, "cstr_term_char", bug_str_s_cstr_term_char, 1);
+ rb_define_singleton_method(klass, "cstr_noembed", bug_str_s_cstr_noembed, 1);
+ rb_define_singleton_method(klass, "cstr_embedded?", bug_str_s_cstr_embedded_p, 1);
+ rb_define_singleton_method(klass, "rb_str_new_frozen", bug_str_s_rb_str_new_frozen, 1);
}
diff --git a/ext/-test-/string/depend b/ext/-test-/string/depend
index 86617ff289..ef13e44df5 100644
--- a/ext/-test-/string/depend
+++ b/ext/-test-/string/depend
@@ -1,5 +1,115 @@
-$(OBJS): $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h
-qsort.o: $(hdrdir)/ruby/util.h
+# AUTOGENERATED DEPENDENCIES START
+coderange.o: $(RUBY_EXTCONF_H)
+coderange.o: $(arch_hdrdir)/ruby/config.h
+coderange.o: $(hdrdir)/ruby/defines.h
+coderange.o: $(hdrdir)/ruby/encoding.h
+coderange.o: $(hdrdir)/ruby/intern.h
+coderange.o: $(hdrdir)/ruby/missing.h
+coderange.o: $(hdrdir)/ruby/oniguruma.h
+coderange.o: $(hdrdir)/ruby/ruby.h
+coderange.o: $(hdrdir)/ruby/st.h
+coderange.o: $(hdrdir)/ruby/subst.h
+coderange.o: coderange.c
+cstr.o: $(RUBY_EXTCONF_H)
+cstr.o: $(arch_hdrdir)/ruby/config.h
+cstr.o: $(hdrdir)/ruby/defines.h
+cstr.o: $(hdrdir)/ruby/encoding.h
+cstr.o: $(hdrdir)/ruby/intern.h
+cstr.o: $(hdrdir)/ruby/missing.h
+cstr.o: $(hdrdir)/ruby/oniguruma.h
+cstr.o: $(hdrdir)/ruby/ruby.h
+cstr.o: $(hdrdir)/ruby/st.h
+cstr.o: $(hdrdir)/ruby/subst.h
+cstr.o: $(top_srcdir)/include/ruby.h
+cstr.o: cstr.c
+ellipsize.o: $(RUBY_EXTCONF_H)
+ellipsize.o: $(arch_hdrdir)/ruby/config.h
+ellipsize.o: $(hdrdir)/ruby/defines.h
+ellipsize.o: $(hdrdir)/ruby/intern.h
+ellipsize.o: $(hdrdir)/ruby/missing.h
+ellipsize.o: $(hdrdir)/ruby/ruby.h
+ellipsize.o: $(hdrdir)/ruby/st.h
+ellipsize.o: $(hdrdir)/ruby/subst.h
+ellipsize.o: $(top_srcdir)/include/ruby.h
+ellipsize.o: ellipsize.c
+enc_associate.o: $(RUBY_EXTCONF_H)
+enc_associate.o: $(arch_hdrdir)/ruby/config.h
+enc_associate.o: $(hdrdir)/ruby/defines.h
+enc_associate.o: $(hdrdir)/ruby/encoding.h
+enc_associate.o: $(hdrdir)/ruby/intern.h
+enc_associate.o: $(hdrdir)/ruby/missing.h
+enc_associate.o: $(hdrdir)/ruby/oniguruma.h
+enc_associate.o: $(hdrdir)/ruby/ruby.h
+enc_associate.o: $(hdrdir)/ruby/st.h
+enc_associate.o: $(hdrdir)/ruby/subst.h
+enc_associate.o: $(top_srcdir)/include/ruby.h
+enc_associate.o: enc_associate.c
+enc_str_buf_cat.o: $(RUBY_EXTCONF_H)
+enc_str_buf_cat.o: $(arch_hdrdir)/ruby/config.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/defines.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/encoding.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/intern.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/missing.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/oniguruma.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/ruby.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/st.h
+enc_str_buf_cat.o: $(hdrdir)/ruby/subst.h
+enc_str_buf_cat.o: enc_str_buf_cat.c
+init.o: $(RUBY_EXTCONF_H)
+init.o: $(arch_hdrdir)/ruby/config.h
+init.o: $(hdrdir)/ruby/defines.h
+init.o: $(hdrdir)/ruby/intern.h
+init.o: $(hdrdir)/ruby/missing.h
+init.o: $(hdrdir)/ruby/ruby.h
+init.o: $(hdrdir)/ruby/st.h
+init.o: $(hdrdir)/ruby/subst.h
+init.o: $(top_srcdir)/include/ruby.h
+init.o: init.c
+modify.o: $(RUBY_EXTCONF_H)
+modify.o: $(arch_hdrdir)/ruby/config.h
+modify.o: $(hdrdir)/ruby/defines.h
+modify.o: $(hdrdir)/ruby/intern.h
+modify.o: $(hdrdir)/ruby/missing.h
+modify.o: $(hdrdir)/ruby/ruby.h
+modify.o: $(hdrdir)/ruby/st.h
+modify.o: $(hdrdir)/ruby/subst.h
+modify.o: $(top_srcdir)/include/ruby.h
+modify.o: modify.c
+normalize.o: $(RUBY_EXTCONF_H)
+normalize.o: $(arch_hdrdir)/ruby/config.h
+normalize.o: $(hdrdir)/ruby/defines.h
+normalize.o: $(hdrdir)/ruby/encoding.h
+normalize.o: $(hdrdir)/ruby/intern.h
+normalize.o: $(hdrdir)/ruby/io.h
+normalize.o: $(hdrdir)/ruby/missing.h
+normalize.o: $(hdrdir)/ruby/oniguruma.h
+normalize.o: $(hdrdir)/ruby/ruby.h
+normalize.o: $(hdrdir)/ruby/st.h
+normalize.o: $(hdrdir)/ruby/subst.h
+normalize.o: $(top_srcdir)/include/ruby.h
normalize.o: $(top_srcdir)/internal.h
+normalize.o: normalize.c
+qsort.o: $(RUBY_EXTCONF_H)
+qsort.o: $(arch_hdrdir)/ruby/config.h
+qsort.o: $(hdrdir)/ruby/defines.h
+qsort.o: $(hdrdir)/ruby/encoding.h
+qsort.o: $(hdrdir)/ruby/intern.h
+qsort.o: $(hdrdir)/ruby/missing.h
+qsort.o: $(hdrdir)/ruby/oniguruma.h
+qsort.o: $(hdrdir)/ruby/ruby.h
+qsort.o: $(hdrdir)/ruby/st.h
+qsort.o: $(hdrdir)/ruby/subst.h
+qsort.o: $(hdrdir)/ruby/util.h
+qsort.o: $(top_srcdir)/include/ruby.h
+qsort.o: qsort.c
+set_len.o: $(RUBY_EXTCONF_H)
+set_len.o: $(arch_hdrdir)/ruby/config.h
+set_len.o: $(hdrdir)/ruby/defines.h
+set_len.o: $(hdrdir)/ruby/intern.h
+set_len.o: $(hdrdir)/ruby/missing.h
+set_len.o: $(hdrdir)/ruby/ruby.h
+set_len.o: $(hdrdir)/ruby/st.h
+set_len.o: $(hdrdir)/ruby/subst.h
+set_len.o: $(top_srcdir)/include/ruby.h
+set_len.o: set_len.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/string/enc_associate.c b/ext/-test-/string/enc_associate.c
index d6614fb298..53811620a0 100644
--- a/ext/-test-/string/enc_associate.c
+++ b/ext/-test-/string/enc_associate.c
@@ -7,8 +7,16 @@ bug_str_enc_associate(VALUE str, VALUE enc)
return rb_enc_associate(str, rb_to_encoding(enc));
}
+VALUE
+bug_str_encoding_index(VALUE self, VALUE str)
+{
+ int idx = rb_enc_get_index(str);
+ return INT2NUM(idx);
+}
+
void
Init_enc_associate(VALUE klass)
{
rb_define_method(klass, "associate_encoding!", bug_str_enc_associate, 1);
+ rb_define_singleton_method(klass, "encoding_index", bug_str_encoding_index, 1);
}
diff --git a/ext/-test-/string/extconf.rb b/ext/-test-/string/extconf.rb
index 10d33cbab9..5e8b709c8a 100644
--- a/ext/-test-/string/extconf.rb
+++ b/ext/-test-/string/extconf.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: false
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
$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-/string/string")
+create_makefile("-test-/string")
diff --git a/ext/-test-/string/fstring.c b/ext/-test-/string/fstring.c
new file mode 100644
index 0000000000..b65c98ce6d
--- /dev/null
+++ b/ext/-test-/string/fstring.c
@@ -0,0 +1,15 @@
+#include "ruby.h"
+
+VALUE rb_fstring(VALUE str);
+
+VALUE
+bug_s_fstring(VALUE self, VALUE str)
+{
+ return rb_fstring(str);
+}
+
+void
+Init_fstring(VALUE klass)
+{
+ rb_define_singleton_method(klass, "fstring", bug_s_fstring, 1);
+}
diff --git a/ext/-test-/string/nofree.c b/ext/-test-/string/nofree.c
new file mode 100644
index 0000000000..d3d8071ff9
--- /dev/null
+++ b/ext/-test-/string/nofree.c
@@ -0,0 +1,13 @@
+#include "ruby.h"
+
+VALUE
+bug_str_nofree(VALUE self)
+{
+ return rb_str_new_cstr("abcdef");
+}
+
+void
+Init_nofree(VALUE klass)
+{
+ rb_define_singleton_method(klass, "nofree", bug_str_nofree, 0);
+}
diff --git a/ext/-test-/string/normalize.c b/ext/-test-/string/normalize.c
index 22bb6d7887..2e16a4616f 100644
--- a/ext/-test-/string/normalize.c
+++ b/ext/-test-/string/normalize.c
@@ -1,4 +1,3 @@
-#include "ruby.h"
#include "internal.h"
#ifdef __APPLE__
diff --git a/ext/-test-/struct/duplicate.c b/ext/-test-/struct/duplicate.c
new file mode 100644
index 0000000000..596d32aad8
--- /dev/null
+++ b/ext/-test-/struct/duplicate.c
@@ -0,0 +1,24 @@
+#include "ruby.h"
+
+static VALUE
+bug_struct_new_duplicate(VALUE obj, VALUE name, VALUE mem)
+{
+ const char *n = NIL_P(name) ? 0 : StringValueCStr(name);
+ const char *m = StringValueCStr(mem);
+ return rb_struct_define(n, m, m, NULL);
+}
+
+static VALUE
+bug_struct_new_duplicate_under(VALUE obj, VALUE name, VALUE mem)
+{
+ const char *n = StringValueCStr(name);
+ const char *m = StringValueCStr(mem);
+ return rb_struct_define_under(obj, n, m, m, NULL);
+}
+
+void
+Init_duplicate(VALUE klass)
+{
+ rb_define_singleton_method(klass, "new_duplicate", bug_struct_new_duplicate, 2);
+ rb_define_singleton_method(klass, "new_duplicate_under", bug_struct_new_duplicate_under, 2);
+}
diff --git a/ext/-test-/struct/extconf.rb b/ext/-test-/struct/extconf.rb
new file mode 100644
index 0000000000..3b01a193fc
--- /dev/null
+++ b/ext/-test-/struct/extconf.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: false
+$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+$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-/struct")
diff --git a/ext/-test-/struct/init.c b/ext/-test-/struct/init.c
new file mode 100644
index 0000000000..459a939e79
--- /dev/null
+++ b/ext/-test-/struct/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_struct(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Struct", rb_cStruct);
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/struct/member.c b/ext/-test-/struct/member.c
new file mode 100644
index 0000000000..1d404039b4
--- /dev/null
+++ b/ext/-test-/struct/member.c
@@ -0,0 +1,18 @@
+#include "ruby.h"
+
+static VALUE
+bug_struct_get(VALUE obj, VALUE name)
+{
+ ID id = rb_check_id(&name);
+
+ if (!id) {
+ rb_name_error_str(name, "`%"PRIsVALUE"' is not a struct member", name);
+ }
+ return rb_struct_getmember(obj, id);
+}
+
+void
+Init_member(VALUE klass)
+{
+ rb_define_method(klass, "get", bug_struct_get, 1);
+}
diff --git a/ext/-test-/symbol/extconf.rb b/ext/-test-/symbol/extconf.rb
index 0b7c3876fa..f62fd47c11 100644
--- a/ext/-test-/symbol/extconf.rb
+++ b/ext/-test-/symbol/extconf.rb
@@ -1,6 +1,8 @@
+# frozen_string_literal: false
$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(' ')}\""
+have_func("rb_pin_dynamic_symbol")
create_makefile("-test-/symbol")
diff --git a/ext/-test-/symbol/init.c b/ext/-test-/symbol/init.c
index e740345f2a..9e42e1a38b 100644
--- a/ext/-test-/symbol/init.c
+++ b/ext/-test-/symbol/init.c
@@ -2,10 +2,24 @@
#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+static VALUE
+sym_find(VALUE dummy, VALUE sym)
+{
+ return rb_check_symbol(&sym);
+}
+
+static VALUE
+sym_pinneddown_p(VALUE dummy, VALUE sym)
+{
+ return rb_check_id(&sym) ? Qtrue : Qfalse;
+}
+
void
Init_symbol(void)
{
VALUE mBug = rb_define_module("Bug");
VALUE klass = rb_define_class_under(mBug, "Symbol", rb_cSymbol);
+ rb_define_singleton_method(klass, "find", sym_find, 1);
+ rb_define_singleton_method(klass, "pinneddown?", sym_pinneddown_p, 1);
TEST_INIT_FUNCS(init);
}
diff --git a/ext/-test-/symbol/intern.c b/ext/-test-/symbol/intern.c
deleted file mode 100644
index 6ae86a6104..0000000000
--- a/ext/-test-/symbol/intern.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#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-/symbol/type.c b/ext/-test-/symbol/type.c
index 17f2d6824b..e51e09eb26 100644
--- a/ext/-test-/symbol/type.c
+++ b/ext/-test-/symbol/type.c
@@ -38,13 +38,41 @@ bug_sym_attrset(VALUE self, VALUE name)
static VALUE
bug_id2str(VALUE self, VALUE sym)
{
- return rb_id2str(SYM2ID(sym));
+ return rb_sym2str(sym);
}
+static VALUE
+bug_static_p(VALUE self, VALUE sym)
+{
+ return STATIC_SYM_P(sym) ? Qtrue : Qfalse;
+}
+
+static VALUE
+bug_dynamic_p(VALUE self, VALUE sym)
+{
+ return DYNAMIC_SYM_P(sym) ? Qtrue : Qfalse;
+}
+
+#ifdef HAVE_RB_PIN_DYNAMIC_SYMBOL
+ID rb_pin_dynamic_symbol(VALUE);
+
+static VALUE
+bug_pindown(VALUE self, VALUE sym)
+{
+ rb_pin_dynamic_symbol(sym);
+ return sym;
+}
+#endif
+
void
Init_type(VALUE klass)
{
FOREACH_ID_TYPES(declare_symbol_type_p);
rb_define_singleton_method(klass, "attrset", bug_sym_attrset, 1);
rb_define_singleton_method(klass, "id2str", bug_id2str, 1);
+ rb_define_singleton_method(klass, "static?", bug_static_p, 1);
+ rb_define_singleton_method(klass, "dynamic?", bug_dynamic_p, 1);
+#ifdef HAVE_RB_PIN_DYNAMIC_SYMBOL
+ rb_define_singleton_method(klass, "pindown", bug_pindown, 1);
+#endif
}
diff --git a/ext/-test-/thread_fd_close/depend b/ext/-test-/thread_fd_close/depend
new file mode 100644
index 0000000000..091074309a
--- /dev/null
+++ b/ext/-test-/thread_fd_close/depend
@@ -0,0 +1,14 @@
+# AUTOGENERATED DEPENDENCIES START
+thread_fd_close.o: $(RUBY_EXTCONF_H)
+thread_fd_close.o: $(arch_hdrdir)/ruby/config.h
+thread_fd_close.o: $(hdrdir)/ruby/defines.h
+thread_fd_close.o: $(hdrdir)/ruby/encoding.h
+thread_fd_close.o: $(hdrdir)/ruby/intern.h
+thread_fd_close.o: $(hdrdir)/ruby/io.h
+thread_fd_close.o: $(hdrdir)/ruby/missing.h
+thread_fd_close.o: $(hdrdir)/ruby/oniguruma.h
+thread_fd_close.o: $(hdrdir)/ruby/ruby.h
+thread_fd_close.o: $(hdrdir)/ruby/st.h
+thread_fd_close.o: $(hdrdir)/ruby/subst.h
+thread_fd_close.o: thread_fd_close.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/thread_fd_close/extconf.rb b/ext/-test-/thread_fd_close/extconf.rb
new file mode 100644
index 0000000000..0d9694539c
--- /dev/null
+++ b/ext/-test-/thread_fd_close/extconf.rb
@@ -0,0 +1,2 @@
+# frozen_string_literal: true
+create_makefile('-test-/thread_fd_close')
diff --git a/ext/-test-/thread_fd_close/thread_fd_close.c b/ext/-test-/thread_fd_close/thread_fd_close.c
new file mode 100644
index 0000000000..4fd967c5b3
--- /dev/null
+++ b/ext/-test-/thread_fd_close/thread_fd_close.c
@@ -0,0 +1,14 @@
+#include "ruby/ruby.h"
+
+static VALUE
+thread_fd_close(VALUE ign, VALUE fd)
+{
+ rb_thread_fd_close(NUM2INT(fd));
+ return Qnil;
+}
+
+void
+Init_thread_fd_close(void)
+{
+ rb_define_singleton_method(rb_cIO, "thread_fd_close", thread_fd_close, 1);
+}
diff --git a/ext/-test-/time/extconf.rb b/ext/-test-/time/extconf.rb
new file mode 100644
index 0000000000..c0b193445c
--- /dev/null
+++ b/ext/-test-/time/extconf.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: false
+$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+$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-/time")
diff --git a/ext/-test-/time/init.c b/ext/-test-/time/init.c
new file mode 100644
index 0000000000..01a20b8b3d
--- /dev/null
+++ b/ext/-test-/time/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_time(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Time", rb_cTime);
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/time/new.c b/ext/-test-/time/new.c
new file mode 100644
index 0000000000..0f71a5542b
--- /dev/null
+++ b/ext/-test-/time/new.c
@@ -0,0 +1,34 @@
+#include "ruby.h"
+
+static VALUE
+bug_time_s_nano_new(VALUE klass, VALUE sec, VALUE nsec)
+{
+ return rb_time_nano_new(NUM2TIMET(sec), NUM2LONG(nsec));
+}
+
+static VALUE
+bug_time_s_timespec_new(VALUE klass, VALUE sec, VALUE nsec, VALUE gmtoff)
+{
+ struct timespec ts;
+ ts.tv_sec = NUM2TIMET(sec);
+ ts.tv_nsec = NUM2LONG(nsec);
+ return rb_time_timespec_new(&ts, NUM2INT(gmtoff));
+}
+
+static VALUE
+bug_time_s_timespec_now(VALUE klass)
+{
+ struct timespec ts;
+ VALUE v;
+ rb_timespec_now(&ts);
+ v = rb_Rational(LONG2NUM(ts.tv_nsec), LONG2NUM(1000000000L));
+ return rb_num_coerce_bin(TIMET2NUM(ts.tv_sec), v, '+');
+}
+
+void
+Init_new(VALUE klass)
+{
+ rb_define_singleton_method(klass, "nano_new", bug_time_s_nano_new, 2);
+ rb_define_singleton_method(klass, "timespec_new", bug_time_s_timespec_new, 3);
+ rb_define_singleton_method(klass, "timespec_now", bug_time_s_timespec_now, 0);
+}
diff --git a/ext/-test-/tracepoint/depend b/ext/-test-/tracepoint/depend
index 8d4e5ab343..741bad0386 100644
--- a/ext/-test-/tracepoint/depend
+++ b/ext/-test-/tracepoint/depend
@@ -1 +1,22 @@
-tracepoint.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
+# AUTOGENERATED DEPENDENCIES START
+gc_hook.o: $(RUBY_EXTCONF_H)
+gc_hook.o: $(arch_hdrdir)/ruby/config.h
+gc_hook.o: $(hdrdir)/ruby/debug.h
+gc_hook.o: $(hdrdir)/ruby/defines.h
+gc_hook.o: $(hdrdir)/ruby/intern.h
+gc_hook.o: $(hdrdir)/ruby/missing.h
+gc_hook.o: $(hdrdir)/ruby/ruby.h
+gc_hook.o: $(hdrdir)/ruby/st.h
+gc_hook.o: $(hdrdir)/ruby/subst.h
+gc_hook.o: gc_hook.c
+tracepoint.o: $(RUBY_EXTCONF_H)
+tracepoint.o: $(arch_hdrdir)/ruby/config.h
+tracepoint.o: $(hdrdir)/ruby/debug.h
+tracepoint.o: $(hdrdir)/ruby/defines.h
+tracepoint.o: $(hdrdir)/ruby/intern.h
+tracepoint.o: $(hdrdir)/ruby/missing.h
+tracepoint.o: $(hdrdir)/ruby/ruby.h
+tracepoint.o: $(hdrdir)/ruby/st.h
+tracepoint.o: $(hdrdir)/ruby/subst.h
+tracepoint.o: tracepoint.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/tracepoint/extconf.rb b/ext/-test-/tracepoint/extconf.rb
index c0c2399eb4..2b7258d072 100644
--- a/ext/-test-/tracepoint/extconf.rb
+++ b/ext/-test-/tracepoint/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/tracepoint")
diff --git a/ext/-test-/tracepoint/tracepoint.c b/ext/-test-/tracepoint/tracepoint.c
index 245dbd6191..aa8c212f99 100644
--- a/ext/-test-/tracepoint/tracepoint.c
+++ b/ext/-test-/tracepoint/tracepoint.c
@@ -64,8 +64,7 @@ tracepoint_track_objspace_events(VALUE self)
VALUE result = rb_ary_new();
rb_tracepoint_enable(tpval);
- rb_yield(Qundef);
- rb_tracepoint_disable(tpval);
+ rb_ensure(rb_yield, Qundef, rb_tracepoint_disable, tpval);
rb_ary_push(result, SIZET2NUM(track.newobj_count));
rb_ary_push(result, SIZET2NUM(track.free_count));
diff --git a/ext/-test-/typeddata/extconf.rb b/ext/-test-/typeddata/extconf.rb
index 02e3e41c8b..84b92c7530 100644
--- a/ext/-test-/typeddata/extconf.rb
+++ b/ext/-test-/typeddata/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/typeddata/typeddata")
diff --git a/ext/-test-/typeddata/typeddata.c b/ext/-test-/typeddata/typeddata.c
index 1c5d677713..ae060960cd 100644
--- a/ext/-test-/typeddata/typeddata.c
+++ b/ext/-test-/typeddata/typeddata.c
@@ -2,19 +2,43 @@
static const rb_data_type_t test_data = {
"typed_data",
+ {NULL, ruby_xfree, NULL},
+ NULL, NULL,
+ 0/* deferred free */,
};
static VALUE
+test_alloc(VALUE klass)
+{
+ char *p;
+ return TypedData_Make_Struct(klass, char, &test_data, p);
+}
+
+static VALUE
test_check(VALUE self, VALUE obj)
{
rb_check_typeddata(obj, &test_data);
return obj;
}
+static VALUE
+test_make(VALUE klass, VALUE num)
+{
+ unsigned long i, n = NUM2UINT(num);
+
+ for (i = 0; i < n; i++) {
+ test_alloc(klass);
+ }
+
+ return Qnil;
+}
+
void
Init_typeddata(void)
{
VALUE mBug = rb_define_module("Bug");
VALUE klass = rb_define_class_under(mBug, "TypedData", rb_cData);
+ rb_define_alloc_func(klass, test_alloc);
rb_define_singleton_method(klass, "check", test_check, 1);
+ rb_define_singleton_method(klass, "make", test_make, 1);
}
diff --git a/ext/-test-/vm/at_exit.c b/ext/-test-/vm/at_exit.c
new file mode 100644
index 0000000000..6cfbfafa9e
--- /dev/null
+++ b/ext/-test-/vm/at_exit.c
@@ -0,0 +1,44 @@
+#include <ruby/ruby.h>
+#include <ruby/vm.h>
+
+static void
+do_nothing(ruby_vm_t *vm)
+{
+}
+
+static void
+print_begin(ruby_vm_t *vm)
+{
+ printf("begin\n");
+}
+
+static void
+print_end(ruby_vm_t *vm)
+{
+ printf("end\n");
+}
+
+static VALUE
+register_at_exit(VALUE self, VALUE t)
+{
+ switch (t) {
+ case Qtrue:
+ ruby_vm_at_exit(print_begin);
+ break;
+ case Qfalse:
+ ruby_vm_at_exit(print_end);
+ break;
+ default:
+ ruby_vm_at_exit(do_nothing);
+ break;
+ }
+ return self;
+}
+
+void
+Init_at_exit(void)
+{
+ VALUE m = rb_define_module("Bug");
+ VALUE c = rb_define_class_under(m, "VM", rb_cObject);
+ rb_define_singleton_method(c, "register_at_exit", register_at_exit, 1);
+}
diff --git a/ext/-test-/vm/extconf.rb b/ext/-test-/vm/extconf.rb
new file mode 100644
index 0000000000..614ec960d8
--- /dev/null
+++ b/ext/-test-/vm/extconf.rb
@@ -0,0 +1 @@
+create_makefile('-test-/vm/at_exit')
diff --git a/ext/-test-/wait_for_single_fd/depend b/ext/-test-/wait_for_single_fd/depend
index b94e507631..fddd41053f 100644
--- a/ext/-test-/wait_for_single_fd/depend
+++ b/ext/-test-/wait_for_single_fd/depend
@@ -1,4 +1,14 @@
-$(OBJS): $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h \
- $(hdrdir)/ruby/io.h
+# AUTOGENERATED DEPENDENCIES START
+wait_for_single_fd.o: $(RUBY_EXTCONF_H)
+wait_for_single_fd.o: $(arch_hdrdir)/ruby/config.h
+wait_for_single_fd.o: $(hdrdir)/ruby/defines.h
+wait_for_single_fd.o: $(hdrdir)/ruby/encoding.h
+wait_for_single_fd.o: $(hdrdir)/ruby/intern.h
+wait_for_single_fd.o: $(hdrdir)/ruby/io.h
+wait_for_single_fd.o: $(hdrdir)/ruby/missing.h
+wait_for_single_fd.o: $(hdrdir)/ruby/oniguruma.h
+wait_for_single_fd.o: $(hdrdir)/ruby/ruby.h
+wait_for_single_fd.o: $(hdrdir)/ruby/st.h
+wait_for_single_fd.o: $(hdrdir)/ruby/subst.h
+wait_for_single_fd.o: wait_for_single_fd.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/wait_for_single_fd/extconf.rb b/ext/-test-/wait_for_single_fd/extconf.rb
index 1a28b23da3..edb18746d1 100644
--- a/ext/-test-/wait_for_single_fd/extconf.rb
+++ b/ext/-test-/wait_for_single_fd/extconf.rb
@@ -1 +1,2 @@
+# frozen_string_literal: false
create_makefile("-test-/wait_for_single_fd/wait_for_single_fd")
diff --git a/ext/-test-/win32/console/attribute.c b/ext/-test-/win32/console/attribute.c
new file mode 100644
index 0000000000..a2c07fc4fe
--- /dev/null
+++ b/ext/-test-/win32/console/attribute.c
@@ -0,0 +1,56 @@
+#include <ruby.h>
+
+static VALUE rb_cConsoleScreenBufferInfo;
+
+static VALUE
+console_info(VALUE io)
+{
+ int fd = NUM2INT(rb_funcallv(io, rb_intern("fileno"), 0, 0));
+ HANDLE h = (HANDLE)rb_w32_get_osfhandle(fd);
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+
+ if (h == (HANDLE)-1) rb_raise(rb_eIOError, "invalid io");
+ if (!GetConsoleScreenBufferInfo(h, &csbi))
+ rb_syserr_fail(rb_w32_map_errno(GetLastError()), "not console");
+ return rb_struct_new(rb_cConsoleScreenBufferInfo,
+ INT2FIX(csbi.dwSize.X), INT2FIX(csbi.dwSize.Y),
+ INT2FIX(csbi.dwCursorPosition.X), INT2FIX(csbi.dwCursorPosition.Y),
+ INT2FIX(csbi.wAttributes));
+}
+
+static VALUE
+console_set_attribute(VALUE io, VALUE attr)
+{
+ int fd = NUM2INT(rb_funcallv(io, rb_intern("fileno"), 0, 0));
+ HANDLE h = (HANDLE)rb_w32_get_osfhandle(fd);
+
+ if (h == (HANDLE)-1) rb_raise(rb_eIOError, "invalid io");
+ SetConsoleTextAttribute(h, (WORD)NUM2INT(attr));
+ return Qnil;
+}
+
+#define FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY)
+#define BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY)
+
+void
+Init_attribute(VALUE m)
+{
+ rb_cConsoleScreenBufferInfo = rb_struct_define_under(m, "ConsoleScreenBufferInfo",
+ "size_x", "size_y",
+ "cur_x", "cur_y",
+ "attr", NULL);
+ rb_define_method(rb_cIO, "console_info", console_info, 0);
+ rb_define_method(rb_cIO, "console_attribute", console_set_attribute, 1);
+
+ rb_define_const(m, "FOREGROUND_MASK", INT2FIX(FOREGROUND_MASK));
+ rb_define_const(m, "FOREGROUND_BLUE", INT2FIX(FOREGROUND_BLUE));
+ rb_define_const(m, "FOREGROUND_GREEN", INT2FIX(FOREGROUND_GREEN));
+ rb_define_const(m, "FOREGROUND_RED", INT2FIX(FOREGROUND_RED));
+ rb_define_const(m, "FOREGROUND_INTENSITY", INT2FIX(FOREGROUND_INTENSITY));
+
+ rb_define_const(m, "BACKGROUND_MASK", INT2FIX(BACKGROUND_MASK));
+ rb_define_const(m, "BACKGROUND_BLUE", INT2FIX(BACKGROUND_BLUE));
+ rb_define_const(m, "BACKGROUND_GREEN", INT2FIX(BACKGROUND_GREEN));
+ rb_define_const(m, "BACKGROUND_RED", INT2FIX(BACKGROUND_RED));
+ rb_define_const(m, "BACKGROUND_INTENSITY", INT2FIX(BACKGROUND_INTENSITY));
+}
diff --git a/ext/-test-/win32/console/depend b/ext/-test-/win32/console/depend
new file mode 100644
index 0000000000..f4f65adf9a
--- /dev/null
+++ b/ext/-test-/win32/console/depend
@@ -0,0 +1 @@
+attribute.o: $(ruby_headers) $(hdrdir)/ruby/win32.h
diff --git a/ext/-test-/win32/console/extconf.rb b/ext/-test-/win32/console/extconf.rb
new file mode 100644
index 0000000000..fb9ef9d524
--- /dev/null
+++ b/ext/-test-/win32/console/extconf.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: false
+if $mingw or $mswin
+ $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-/win32/console")
+end
diff --git a/ext/-test-/win32/console/init.c b/ext/-test-/win32/console/init.c
new file mode 100644
index 0000000000..f2e0d1c821
--- /dev/null
+++ b/ext/-test-/win32/console/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE m); Init_##n(m);}
+
+void
+Init_console(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE m = rb_define_module_under(mBug, "Win32");
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/win32/dln/depend b/ext/-test-/win32/dln/depend
new file mode 100644
index 0000000000..712fefa29a
--- /dev/null
+++ b/ext/-test-/win32/dln/depend
@@ -0,0 +1,9 @@
+$(TARGET_SO): $(DLNTESTLIB)
+
+$(DLNTESTLIB): $(topdir)/dlntest.dll
+
+$(topdir)/dlntest.dll: libdlntest.o libdlntest.def
+ $(ECHO) linking shared-object $(@F)
+ -$(Q)$(RM) $@
+ -$(Q)$(MAKEDIRS) $(@D)
+ $(Q) $(DLNTEST_LDSHARED)
diff --git a/ext/-test-/win32/dln/extconf.rb b/ext/-test-/win32/dln/extconf.rb
index 57cee23b40..55c2d16d1e 100644
--- a/ext/-test-/win32/dln/extconf.rb
+++ b/ext/-test-/win32/dln/extconf.rb
@@ -1,37 +1,33 @@
+# frozen_string_literal: false
if $mingw or $mswin
+ dlntestlib = "dlntest.#{$LIBEXT}"
+ $LOCAL_LIBS << " #{dlntestlib}"
+ $srcs = ["dlntest.c"]
$objs = ["dlntest.o"]
testdll = "$(topdir)/dlntest.dll"
$cleanfiles << testdll
$cleanfiles << "dlntest.#{$LIBEXT}"
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
+ create_makefile("-test-/win32/dln") do |m|
+ m << "\n""DLNTESTLIB = #{dlntestlib}\n"
if $mingw
- mf.puts "$(topdir)/dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def"
- mf.puts "$(topdir)/dlntest.dll: DLDFLAGS += -Wl,--out-implib,#{dlntestlib}"
+ m << "\n"
+ m << "$(topdir)/dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def\n"
+ m << "$(topdir)/dlntest.dll: DLDFLAGS += -Wl,--out-implib,$(DLNTESTLIB)\n"
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) ")
+ m
+ end
+ m = File.read("Makefile")
+ m.sub!(/(.*)\$\(DLNTEST_LDSHARED\)$/) do
+ pre = $1
+ link_so = LINK_SO.gsub(/^/) {pre}
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
+ link_so
+ end and File.binwrite("Makefile", m)
+ FileUtils.rm_f(RbConfig.expand(testdll.dup))
end
diff --git a/ext/-test-/win32/dln/libdlntest.c b/ext/-test-/win32/dln/libdlntest.c
index 040ae8125d..5923b732c8 100644
--- a/ext/-test-/win32/dln/libdlntest.c
+++ b/ext/-test-/win32/dln/libdlntest.c
@@ -1,4 +1,4 @@
-extern __declspec(dllexport) void
+void
dlntest_ordinal(void)
{
}
diff --git a/ext/-test-/win32/fd_setsize/depend b/ext/-test-/win32/fd_setsize/depend
index 4936d6b28c..7d40e8d572 100644
--- a/ext/-test-/win32/fd_setsize/depend
+++ b/ext/-test-/win32/fd_setsize/depend
@@ -1,2 +1 @@
-fd_setsize.o: $(top_srcdir)/win32/win32.c \
- $(hdrdir)/ruby/ruby.h
+fd_setsize.o: $(ruby_headers) $(hdrdir)/ruby/win32.h
diff --git a/ext/-test-/win32/fd_setsize/extconf.rb b/ext/-test-/win32/fd_setsize/extconf.rb
index ed40f8b1d7..caa4b85a1b 100644
--- a/ext/-test-/win32/fd_setsize/extconf.rb
+++ b/ext/-test-/win32/fd_setsize/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
if $mingw or $mswin
create_makefile("-test-/win32/fd_setsize")
end
diff --git a/ext/.document b/ext/.document
index 1de3ab739b..2e6fc78879 100644
--- a/ext/.document
+++ b/ext/.document
@@ -43,6 +43,7 @@ mathn/rational/rational.c
nkf/lib
nkf/nkf.c
objspace/objspace.c
+objspace/objspace_dump.c
objspace/object_tracing.c
openssl/lib
openssl/ossl.c
@@ -88,7 +89,6 @@ pty/lib
pty/pty.c
racc/cparse/cparse.c
readline/readline.c
-refinement/refinement.c
ripper/lib
ripper/ripper.c
sdbm/init.c
@@ -99,5 +99,5 @@ syslog/syslog.c
syslog/lib
thread/thread.c
win32ole/lib
-win32ole/win32ole.c
+win32ole/*.c
zlib/zlib.c
diff --git a/ext/Setup b/ext/Setup
index 5deb604151..05998e3363 100644
--- a/ext/Setup
+++ b/ext/Setup
@@ -1,22 +1,38 @@
#option nodynamic
-#Win32API
#bigdecimal
+#cgi/escape
+#continuation
+#coverage
+#date
#dbm
+#digest/bubblebabble
#digest
#digest/md5
#digest/rmd160
#digest/sha1
#digest/sha2
-#dl
#etc
#fcntl
+#fiber
+#fiddle
#gdbm
+#io/console
+#io/nonblock
#io/wait
+#json
+#json/generator
+#json/parser
+#mathn/complex
+#mathn/rational
#nkf
+#objspace
#openssl
+#pathname
+#psych
#pty
#racc/cparse
+#rbconfig/sizeof
#readline
#ripper
#sdbm
@@ -24,6 +40,9 @@
#stringio
#strscan
#syslog
+#thread
#tk
+#tk/tkutil
+#win32
#win32ole
#zlib
diff --git a/ext/Setup.atheos b/ext/Setup.atheos
index 662ca57af1..5e39de8e15 100644
--- a/ext/Setup.atheos
+++ b/ext/Setup.atheos
@@ -2,13 +2,13 @@ option nodynamic
#Win32API
bigdecimal
+cgi/escape
dbm
digest
digest/md5
digest/rmd160
digest/sha1
digest/sha2
-dl
enumerator
etc
fcntl
diff --git a/ext/Setup.emx b/ext/Setup.emx
deleted file mode 100644
index 6c80812ac0..0000000000
--- a/ext/Setup.emx
+++ /dev/null
@@ -1,32 +0,0 @@
-# OS/2 environment w/ Autoconf 2.1x for EMX
-option platform os2-emx
-option nodynamic
-
-#Win32API
-bigdecimal
-#dbm
-digest
-digest/md5
-digest/rmd160
-digest/sha1
-digest/sha2
-#dl
-enumerator
-etc
-fcntl
-#gdbm
-#io/wait
-nkf
-#openssl
-#pty
-racc/cparse
-#readline
-#ripper
-#sdbm
-socket
-stringio
-strscan
-#syslog
-#tk
-#win32ole
-#zlib
diff --git a/ext/Setup.nacl b/ext/Setup.nacl
index d5c1e20777..f205e367c6 100644
--- a/ext/Setup.nacl
+++ b/ext/Setup.nacl
@@ -1,7 +1,8 @@
# #option nodynamic
-#
+#
# #Win32API
# bigdecimal
+# cgi/escape
# continuation
# coverage
# date
@@ -12,9 +13,6 @@
# digest/rmd160
# digest/sha1
# digest/sha2
-# dl
-# dl/callback
-# #dl/win32
# etc
# fcntl
# fiber
diff --git a/ext/Setup.nt b/ext/Setup.nt
index 3936d2ed29..4812893eef 100644
--- a/ext/Setup.nt
+++ b/ext/Setup.nt
@@ -3,13 +3,13 @@
Win32API
bigdecimal
+cgi/escape
#dbm
digest
digest/md5
digest/rmd160
digest/sha1
digest/sha2
-dl
enumerator
etc
fcntl
diff --git a/ext/bigdecimal/README b/ext/bigdecimal/README
deleted file mode 100644
index 7a4362826c..0000000000
--- a/ext/bigdecimal/README
+++ /dev/null
@@ -1,60 +0,0 @@
-
- Ruby BIGDECIMAL(Variable Precision) extension library.
- Copyright (C) 1999 by Shigeo Kobayashi(shigeo@tinyforest.gr.jp)
-
-BigDecimal is copyrighted free software by Shigeo Kobayashi <shigeo@tinyforest.gr.jp>.
-You can redistribute it and/or modify it under either the terms of the GPL
-(see COPYING file), or the conditions below:
-
- 1. You may make and give away verbatim copies of the source form of the
- software without restriction, provided that you duplicate all of the
- original copyright notices and associated disclaimers.
-
- 2. You may modify your copy of the software in any way, provided that
- you do at least ONE of the following:
-
- a) place your modifications in the Public Domain or otherwise
- make them Freely Available, such as by posting said
- modifications to Usenet or an equivalent medium, or by allowing
- the author to include your modifications in the software.
-
- b) use the modified software only within your corporation or
- organization.
-
- c) rename any non-standard executables so the names do not conflict
- with standard executables, which must also be provided.
-
- d) make other distribution arrangements with the author.
-
- 3. You may distribute the software in object code or executable
- form, provided that you do at least ONE of the following:
-
- a) distribute the executables and library files of the software,
- together with instructions (in the manual page or equivalent)
- on where to get the original distribution.
-
- b) accompany the distribution with the machine-readable source of
- the software.
-
- c) give non-standard executables non-standard names, with
- instructions on where to get the original software distribution.
-
- d) make other distribution arrangements with the author.
-
- 4. You may modify and include the part of the software into any other
- software (possibly commercial).
-
- 5. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- PURPOSE.
-
-* The Author
-
-Feel free to send comments and bug reports to the ruby-core team.
-
- 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 e0b7c01e08..e24f05782c 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -4,13 +4,6 @@
*
* 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 this BigDecimal distribution.
- *
- * NOTE: Change log in this source removed to reduce source code size.
- * See rev. 1.25 if needed.
- *
*/
/* #define BIGDECIMAL_DEBUG 1 */
@@ -18,6 +11,7 @@
# define BIGDECIMAL_ENABLE_VPRINT 1
#endif
#include "bigdecimal.h"
+#include "ruby/util.h"
#ifndef BIGDECIMAL_DEBUG
# define NDEBUG
@@ -71,9 +65,9 @@ static ID id_eq;
/* MACRO's to guard objects from GC by keeping them in stack */
#define ENTER(n) volatile VALUE RB_UNUSED_VAR(vStack[n]);int iStack=0
-#define PUSH(x) vStack[iStack++] = (VALUE)(x);
-#define SAVE(p) PUSH(p->obj);
-#define GUARD_OBJ(p,y) {p=y;SAVE(p);}
+#define PUSH(x) (vStack[iStack++] = (VALUE)(x))
+#define SAVE(p) PUSH((p)->obj)
+#define GUARD_OBJ(p,y) ((p)=(y), SAVE(p))
#define BASE_FIG RMPD_COMPONENT_FIGURES
#define BASE RMPD_BASE
@@ -85,19 +79,53 @@ static ID id_eq;
#define DBLE_FIG (DBL_DIG+1) /* figure of double */
#endif
-#ifndef RBIGNUM_ZERO_P
-# define RBIGNUM_ZERO_P(x) rb_bigzero_p(x)
-#endif
-
#ifndef RRATIONAL_ZERO_P
-# define RRATIONAL_ZERO_P(x) (FIXNUM_P(RRATIONAL(x)->num) && \
- FIX2LONG(RRATIONAL(x)->num) == 0)
+# define RRATIONAL_ZERO_P(x) (FIXNUM_P(rb_rational_num(x)) && \
+ FIX2LONG(rb_rational_num(x)) == 0)
#endif
#ifndef RRATIONAL_NEGATIVE_P
# define RRATIONAL_NEGATIVE_P(x) RTEST(rb_funcall((x), '<', 1, INT2FIX(0)))
#endif
+#ifndef DECIMAL_SIZE_OF_BITS
+#define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999)
+/* an approximation of ceil(n * log10(2)), upto 65536 at least */
+#endif
+
+#ifdef PRIsVALUE
+# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
+# define RB_OBJ_STRING(obj) (obj)
+#else
+# define PRIsVALUE "s"
+# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
+# define RB_OBJ_STRING(obj) StringValueCStr(obj)
+#endif
+
+#ifndef HAVE_RB_RATIONAL_NUM
+static inline VALUE
+rb_rational_num(VALUE rat)
+{
+#ifdef HAVE_TYPE_STRUCT_RRATIONAL
+ return RRATIONAL(rat)->num;
+#else
+ return rb_funcall(rat, rb_intern("numerator"));
+#endif
+}
+#endif
+
+#ifndef HAVE_RB_RATIONAL_DEN
+static inline VALUE
+rb_rational_den(VALUE rat)
+{
+#ifdef HAVE_TYPE_STRUCT_RRATIONAL
+ return RRATIONAL(rat)->den;
+#else
+ return rb_funcall(rat, rb_intern("denominator"));
+#endif
+}
+#endif
+
/*
* ================== Ruby Interface part ==========================
*/
@@ -144,14 +172,14 @@ static size_t
BigDecimal_memsize(const void *ptr)
{
const Real *pv = ptr;
- return pv ? (sizeof(*pv) + pv->MaxPrec * sizeof(BDIGIT)) : 0;
+ return (sizeof(*pv) + pv->MaxPrec * sizeof(BDIGIT));
}
static const rb_data_type_t BigDecimal_data_type = {
"BigDecimal",
{ 0, BigDecimal_delete, BigDecimal_memsize, },
#ifdef RUBY_TYPED_FREE_IMMEDIATELY
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
#endif
};
@@ -211,6 +239,12 @@ again:
if (prec < 0) goto unable_to_coerce_without_prec;
if (prec > DBL_DIG+1) goto SomeOneMayDoIt;
d = RFLOAT_VALUE(v);
+ if (!isfinite(d)) {
+ pv = VpCreateRbObject(prec, NULL);
+ pv->sign = isnan(d) ? VP_SIGN_NaN :
+ d > 0 ? VP_SIGN_POSITIVE_INFINITE : VP_SIGN_NEGATIVE_FINITE;
+ return pv;
+ }
if (d != 0.0) {
v = rb_funcall(v, id_to_r, 0);
goto again;
@@ -224,11 +258,11 @@ again:
if (prec < 0) goto unable_to_coerce_without_prec;
if (orig == Qundef ? (orig = v, 1) : orig != v) {
- num = RRATIONAL(v)->num;
+ num = rb_rational_num(v);
pv = GetVpValueWithPrec(num, -1, must);
if (pv == NULL) goto SomeOneMayDoIt;
- v = BigDecimal_div2(ToValue(pv), RRATIONAL(v)->den, LONG2NUM(prec));
+ v = BigDecimal_div2(ToValue(pv), rb_rational_den(v), LONG2NUM(prec));
goto again;
}
@@ -273,8 +307,8 @@ SomeOneMayDoIt:
unable_to_coerce_without_prec:
if (must) {
rb_raise(rb_eArgError,
- "%s can't be coerced into BigDecimal without a precision",
- rb_obj_classname(v));
+ "%"PRIsVALUE" can't be coerced into BigDecimal without a precision",
+ RB_OBJ_CLASSNAME(v));
}
return NULL;
}
@@ -342,7 +376,7 @@ BigDecimal_hash(VALUE self)
hash ^= rb_memhash(p->frac, sizeof(BDIGIT)*p->Prec);
hash += p->exponent;
}
- return INT2FIX(hash);
+ return LONG2FIX((long)hash);
}
/*
@@ -351,9 +385,9 @@ BigDecimal_hash(VALUE self)
* Method used to provide marshalling support.
*
* inf = BigDecimal.new('Infinity')
- * => #<BigDecimal:1e16fa8,'Infinity',9(9)>
+ * #=> #<BigDecimal:1e16fa8,'Infinity',9(9)>
* BigDecimal._load(inf._dump)
- * => #<BigDecimal:1df8dc8,'Infinity',9(9)>
+ * #=> #<BigDecimal:1df8dc8,'Infinity',9(9)>
*
* See the Marshal module.
*/
@@ -570,17 +604,17 @@ GetPositiveInt(VALUE v)
VP_EXPORT Real *
VpNewRbClass(size_t mx, const char *str, VALUE klass)
{
+ VALUE obj = TypedData_Wrap_Struct(klass, &BigDecimal_data_type, 0);
Real *pv = VpAlloc(mx,str);
- pv->obj = TypedData_Wrap_Struct(klass, &BigDecimal_data_type, pv);
+ RTYPEDDATA_DATA(obj) = pv;
+ pv->obj = obj;
return pv;
}
VP_EXPORT Real *
VpCreateRbObject(size_t mx, const char *str)
{
- Real *pv = VpAlloc(mx,str);
- pv->obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, pv);
- return pv;
+ return VpNewRbClass(mx, str, rb_cBigDecimal);
}
#define VpAllocReal(prec) (Real *)VpMemAlloc(offsetof(Real, frac) + (prec) * sizeof(BDIGIT))
@@ -602,7 +636,7 @@ VpCopy(Real *pv, Real const* const x)
return pv;
}
-/* Returns True if the value is Not a Number */
+/* Returns True if the value is Not a Number. */
static VALUE
BigDecimal_IsNaN(VALUE self)
{
@@ -623,7 +657,7 @@ BigDecimal_IsInfinite(VALUE self)
return Qnil;
}
-/* Returns True if the value is finite (not NaN or infinite) */
+/* Returns True if the value is finite (not NaN or infinite). */
static VALUE
BigDecimal_IsFinite(VALUE self)
{
@@ -671,7 +705,7 @@ BigDecimal_to_i(VALUE self)
}
else {
VALUE a = BigDecimal_split(self);
- VALUE digits = RARRAY_PTR(a)[1];
+ VALUE digits = RARRAY_AREF(a, 1);
VALUE numerator = rb_funcall(digits, rb_intern("to_i"), 0);
VALUE ret;
ssize_t dpower = e - (ssize_t)RSTRING_LEN(digits);
@@ -760,7 +794,7 @@ BigDecimal_to_r(VALUE self)
sign = VpGetSign(p);
power = VpExponent10(p);
a = BigDecimal_split(self);
- digits = RARRAY_PTR(a)[1];
+ digits = RARRAY_AREF(a, 1);
denomi_power = power - RSTRING_LEN(digits);
numerator = rb_funcall(digits, rb_intern("to_i"), 0);
@@ -787,8 +821,8 @@ BigDecimal_to_r(VALUE self)
* be coerced into a BigDecimal value.
*
* e.g.
- * a = BigDecimal.new("1.0")
- * b = a / 2.0 -> 0.5
+ * a = BigDecimal.new("1.0")
+ * b = a / 2.0 #=> 0.5
*
* Note that coercing a String to a BigDecimal is not supported by default;
* it requires a special compile-time option when building Ruby.
@@ -846,8 +880,8 @@ BigDecimal_uplus(VALUE self)
* 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.
+ * result, the result is rounded to that number of digits, according
+ * to BigDecimal.mode.
*/
static VALUE
BigDecimal_add(VALUE self, VALUE r)
@@ -891,7 +925,7 @@ BigDecimal_add(VALUE self, VALUE r)
}
/* call-seq:
- * value - digits -> bigdecimal
+ * a - b -> bigdecimal
*
* Subtract the specified value.
*
@@ -1075,7 +1109,7 @@ BigDecimal_comp(VALUE self, VALUE r)
*
* Values may be coerced to perform the comparison:
*
- * BigDecimal.new('1.0') == 1.0 -> true
+ * BigDecimal.new('1.0') == 1.0 #=> true
*/
static VALUE
BigDecimal_eq(VALUE self, VALUE r)
@@ -1167,8 +1201,8 @@ BigDecimal_neg(VALUE self)
* 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.
+ * result, the result is rounded to that number of digits, according
+ * to BigDecimal.mode.
*/
static VALUE
BigDecimal_mult(VALUE self, VALUE r)
@@ -1221,8 +1255,10 @@ BigDecimal_divide(Real **c, Real **res, Real **div, VALUE self, VALUE r)
*div = b;
mx = a->Prec + vabs(a->exponent);
- if (mx<b->Prec + vabs(b->exponent)) mx = b->Prec + vabs(b->exponent);
- mx =(mx + 1) * VpBaseFig();
+ if (mx < b->Prec + vabs(b->exponent)) mx = b->Prec + vabs(b->exponent);
+ mx++; /* NOTE: An additional digit is needed for the compatibility to
+ the version 1.2.1 and the former. */
+ mx = (mx + 1) * VpBaseFig();
GUARD_OBJ((*c), VpCreateRbObject(mx, "#0"));
GUARD_OBJ((*res), VpCreateRbObject((mx+1) * 2 +(VpBaseFig() + 1), "#0"));
VpDivd(*c, *res, a, b);
@@ -1239,8 +1275,8 @@ BigDecimal_divide(Real **c, Real **res, Real **div, VALUE self, VALUE r)
* 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.
+ * 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.
@@ -1419,7 +1455,10 @@ BigDecimal_divremain(VALUE self, VALUE r, Real **dv, Real **rv)
return Qnil;
}
-/* Returns the remainder from dividing by the value.
+/* call-seq:
+ * remainder(value)
+ *
+ * Returns the remainder from dividing by the value.
*
* x.remainder(y) means x-y*(x/y).truncate
*/
@@ -1433,21 +1472,24 @@ BigDecimal_remainder(VALUE self, VALUE r) /* remainder */
return ToValue(rv);
}
-/* Divides by the specified value, and returns the quotient and modulus
+/* call-seq:
+ * divmod(value)
+ *
+ * Divides by the specified value, and returns the quotient and modulus
* as BigDecimal numbers. The quotient is rounded towards negative infinity.
*
* For example:
*
- * require 'bigdecimal'
+ * require 'bigdecimal'
*
- * a = BigDecimal.new("42")
- * b = BigDecimal.new("9")
+ * a = BigDecimal.new("42")
+ * b = BigDecimal.new("9")
*
- * q,m = a.divmod(b)
+ * q, m = a.divmod(b)
*
- * c = q * b + m
+ * c = q * b + m
*
- * a == c -> true
+ * a == c #=> true
*
* The quotient q is (a/b).floor, and the modulus is the amount that must be
* added to q * b to get a.
@@ -1534,7 +1576,7 @@ BigDecimal_add2(VALUE self, VALUE b, VALUE n)
}
}
-/*
+/* call-seq:
* sub(value, digits) -> bigdecimal
*
* Subtract the specified value.
@@ -1543,8 +1585,8 @@ BigDecimal_add2(VALUE self, VALUE b, VALUE n)
* c = a.sub(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.
+ * result, the result is rounded to that number of digits, according
+ * to BigDecimal.mode.
*
*/
static VALUE
@@ -1582,11 +1624,10 @@ BigDecimal_mult2(VALUE self, VALUE b, VALUE n)
}
}
-/* Returns the absolute value.
- *
- * BigDecimal('5').abs -> 5
+/* Returns the absolute value, as a BigDecimal.
*
- * BigDecimal('-3').abs -> 3
+ * BigDecimal('5').abs #=> 5
+ * BigDecimal('-3').abs #=> 3
*/
static VALUE
BigDecimal_abs(VALUE self)
@@ -1627,7 +1668,7 @@ BigDecimal_sqrt(VALUE self, VALUE nFig)
return ToValue(c);
}
-/* Return the integer part of the number.
+/* Return the integer part of the number, as a BigDecimal.
*/
static VALUE
BigDecimal_fix(VALUE self)
@@ -1646,10 +1687,12 @@ BigDecimal_fix(VALUE self)
/* call-seq:
* round(n, mode)
*
- * Round to the nearest 1 (by default), returning the result as a BigDecimal.
+ * Round to the nearest integer (by default), returning the result as a
+ * BigDecimal.
*
* BigDecimal('3.14159').round #=> 3
* BigDecimal('8.7').round #=> 9
+ * BigDecimal('-9.9').round #=> -10
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
@@ -1707,10 +1750,12 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self)
/* call-seq:
* truncate(n)
*
- * Truncate to the nearest 1, returning the result as a BigDecimal.
+ * Truncate to the nearest integer (by default), returning the result as a
+ * BigDecimal.
*
* BigDecimal('3.14159').truncate #=> 3
* BigDecimal('8.7').truncate #=> 8
+ * BigDecimal('-9.9').truncate #=> -9
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
@@ -1749,7 +1794,7 @@ BigDecimal_truncate(int argc, VALUE *argv, VALUE self)
return ToValue(c);
}
-/* Return the fractional part of the number.
+/* Return the fractional part of the number, as a BigDecimal.
*/
static VALUE
BigDecimal_frac(VALUE self)
@@ -1881,14 +1926,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)
@@ -2028,8 +2073,8 @@ BigDecimal_exponent(VALUE self)
/* Returns debugging information about the value as a string of comma-separated
* values in angle brackets with a leading #:
*
- * BigDecimal.new("1234.5678").inspect ->
- * "#<BigDecimal:b7ea1130,'0.12345678E4',8(12)>"
+ * BigDecimal.new("1234.5678").inspect
+ * #=> "#<BigDecimal:b7ea1130,'0.12345678E4',8(12)>"
*
* The first part is the address, the second is the value as a string, and
* the final part ss(mm) is the current number of significant digits and the
@@ -2078,7 +2123,7 @@ is_negative(VALUE x)
return FIX2LONG(x) < 0;
}
else if (RB_TYPE_P(x, T_BIGNUM)) {
- return RBIGNUM_NEGATIVE_P(x);
+ return FIX2INT(rb_big_cmp(x, INT2FIX(0))) < 0;
}
else if (RB_TYPE_P(x, T_FLOAT)) {
return RFLOAT_VALUE(x) < 0.0;
@@ -2101,7 +2146,7 @@ is_zero(VALUE x)
return Qfalse;
case T_RATIONAL:
- num = RRATIONAL(x)->num;
+ num = rb_rational_num(x);
return FIXNUM_P(num) && FIX2LONG(num) == 0;
default:
@@ -2124,8 +2169,8 @@ is_one(VALUE x)
return Qfalse;
case T_RATIONAL:
- num = RRATIONAL(x)->num;
- den = RRATIONAL(x)->den;
+ num = rb_rational_num(x);
+ den = rb_rational_den(x);
return FIXNUM_P(den) && FIX2LONG(den) == 1 &&
FIXNUM_P(num) && FIX2LONG(num) == 1;
@@ -2183,7 +2228,7 @@ rmpd_power_by_big_decimal(Real const* x, Real const* exp, ssize_t const n)
*
* Note that n must be an Integer.
*
- * Also available as the operator **
+ * Also available as the operator **.
*/
static VALUE
BigDecimal_power(int argc, VALUE*argv, VALUE self)
@@ -2231,14 +2276,14 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
break;
case T_RATIONAL:
- if (is_zero(RRATIONAL(vexp)->num)) {
+ if (is_zero(rb_rational_num(vexp))) {
if (is_positive(vexp)) {
vexp = INT2FIX(0);
goto retry;
}
}
- else if (is_one(RRATIONAL(vexp)->den)) {
- vexp = RRATIONAL(vexp)->num;
+ else if (is_one(rb_rational_den(vexp))) {
+ vexp = rb_rational_num(vexp);
goto retry;
}
exp = GetVpValueWithPrec(vexp, n, 1);
@@ -2258,8 +2303,8 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
/* fall through */
default:
rb_raise(rb_eTypeError,
- "wrong argument type %s (expected scalar Numeric)",
- rb_obj_classname(vexp));
+ "wrong argument type %"PRIsVALUE" (expected scalar Numeric)",
+ RB_OBJ_CLASSNAME(vexp));
}
if (VpIsZero(x)) {
@@ -2415,9 +2460,11 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
/* call-seq:
- * big_decimal ** exp -> big_decimal
+ * a ** n -> bigdecimal
*
- * It is a synonym of BigDecimal#power(exp).
+ * Returns the value raised to the power of n.
+ *
+ * See BigDecimal#power.
*/
static VALUE
BigDecimal_power_op(VALUE self, VALUE exp)
@@ -2450,13 +2497,28 @@ static Real *BigDecimal_new(int argc, VALUE *argv);
*
* The actual number of significant digits used in computation is usually
* larger than the specified number.
+ *
+ * ==== Exceptions
+ *
+ * TypeError:: If the +initial+ type is neither Fixnum, Bignum, Float,
+ * Rational, nor BigDecimal, this exception is raised.
+ *
+ * TypeError:: If the +digits+ is not a Fixnum, this exception is raised.
+ *
+ * ArgumentError:: If +initial+ is a Float, and the +digits+ is larger than
+ * Float::DIG + 1, this exception is raised.
+ *
+ * ArgumentError:: If the +initial+ is a Float or Rational, and the +digits+
+ * value is omitted, this exception is raised.
*/
static VALUE
BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
{
+ ENTER(1);
Real *pv = rb_check_typeddata(self, &BigDecimal_data_type);
- Real *x = BigDecimal_new(argc, argv);
+ Real *x;
+ GUARD_OBJ(x, BigDecimal_new(argc, argv));
if (ToValue(x)) {
pv = VpCopy(pv, x);
}
@@ -2471,7 +2533,7 @@ BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
/* :nodoc:
*
- * private method to dup and clone the provided BigDecimal +other+
+ * private method for dup and clone the provided BigDecimal +other+
*/
static VALUE
BigDecimal_initialize_copy(VALUE self, VALUE other)
@@ -2479,7 +2541,9 @@ 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);
+ if (self != other) {
+ DATA_PTR(self) = VpCopy(pv, x);
+ }
return self;
}
@@ -2517,8 +2581,8 @@ BigDecimal_new(int argc, VALUE *argv)
case T_RATIONAL:
if (NIL_P(nFig)) {
rb_raise(rb_eArgError,
- "can't omit precision for a %s.",
- rb_class2name(CLASS_OF(iniValue)));
+ "can't omit precision for a %"PRIsVALUE".",
+ RB_OBJ_CLASSNAME(iniValue));
}
return GetVpValueWithPrec(iniValue, mf, 1);
@@ -2531,14 +2595,19 @@ BigDecimal_new(int argc, VALUE *argv)
return VpAlloc(mf, RSTRING_PTR(iniValue));
}
-/* See also BigDecimal::new */
+/* See also BigDecimal.new */
static VALUE
BigDecimal_global_new(int argc, VALUE *argv, VALUE self)
{
- Real *pv = BigDecimal_new(argc, argv);
+ ENTER(1);
+ Real *pv;
+ VALUE obj;
+
+ obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, 0);
+ GUARD_OBJ(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;
+ RTYPEDDATA_DATA(obj) = pv;
+ return pv->obj = obj;
}
/* call-seq:
@@ -2700,7 +2769,7 @@ BigMath_s_exp(VALUE klass, VALUE x, VALUE vprec)
rb_raise(rb_eArgError, "Zero or negative precision for exp");
}
- /* TODO: the following switch statement is almostly the same as one in the
+ /* TODO: the following switch statement is almost same as one in the
* BigDecimalCmp function. */
switch (TYPE(x)) {
case T_DATA:
@@ -2838,7 +2907,7 @@ BigMath_s_log(VALUE klass, VALUE x, VALUE vprec)
rb_raise(rb_eArgError, "Zero or negative precision for exp");
}
- /* TODO: the following switch statement is almostly the same as one in the
+ /* TODO: the following switch statement is almost same as one in the
* BigDecimalCmp function. */
switch (TYPE(x)) {
case T_DATA:
@@ -2857,8 +2926,9 @@ BigMath_s_log(VALUE klass, VALUE x, VALUE vprec)
goto get_vp_value;
case T_BIGNUM:
- zero = RBIGNUM_ZERO_P(x);
- negative = RBIGNUM_NEGATIVE_P(x);
+ i = FIX2INT(rb_big_cmp(x, INT2FIX(0)));
+ zero = i == 0;
+ negative = i < 0;
get_vp_value:
if (zero || negative) break;
vx = GetVpValue(x, 0);
@@ -2919,8 +2989,8 @@ get_vp_value:
RB_GC_GUARD(vn) = SSIZET2NUM(n);
expo = VpExponent10(vx);
if (expo < 0 || expo >= 3) {
- char buf[16];
- snprintf(buf, 16, "1E%"PRIdVALUE, -expo);
+ char buf[DECIMAL_SIZE_OF_BITS(SIZEOF_VALUE * CHAR_BIT) + 4];
+ snprintf(buf, sizeof(buf), "1E%"PRIdVALUE, -expo);
x = BigDecimal_mult2(x, ToValue(VpCreateRbObject(1, buf)), vn);
}
else {
@@ -3065,9 +3135,8 @@ get_vp_value:
*
* 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.
+ * BigDecimal is released under the Ruby and 2-clause BSD licenses.
+ * See LICENSE.txt for details.
*
* Maintained by mrkn <mrkn@mrkn.jp> and ruby-core members.
*
@@ -3762,10 +3831,10 @@ VpInit(BDIGIT BaseVal)
#ifdef BIGDECIMAL_DEBUG
if (gfDebug) {
- printf("VpInit: BaseVal = %lu\n", BaseVal);
- printf(" BASE = %lu\n", BASE);
- printf(" HALF_BASE = %lu\n", HALF_BASE);
- printf(" BASE1 = %lu\n", BASE1);
+ printf("VpInit: BaseVal = %"PRIuBDIGIT"\n", BaseVal);
+ printf(" BASE = %"PRIuBDIGIT"\n", BASE);
+ printf(" HALF_BASE = %"PRIuBDIGIT"\n", HALF_BASE);
+ printf(" BASE1 = %"PRIuBDIGIT"\n", BASE1);
printf(" BASE_FIG = %u\n", BASE_FIG);
printf(" DBLE_FIG = %d\n", DBLE_FIG);
}
@@ -3794,7 +3863,7 @@ AddExponent(Real *a, SIGNED_VALUE n)
goto overflow;
mb = m*(SIGNED_VALUE)BASE_FIG;
eb = e*(SIGNED_VALUE)BASE_FIG;
- if (mb < eb) goto overflow;
+ if (eb - mb > 0) goto overflow;
}
}
else if (n < 0) {
@@ -3803,7 +3872,7 @@ AddExponent(Real *a, SIGNED_VALUE n)
goto underflow;
mb = m*(SIGNED_VALUE)BASE_FIG;
eb = e*(SIGNED_VALUE)BASE_FIG;
- if (mb > eb) goto underflow;
+ if (mb - eb > 0) goto underflow;
}
a->exponent = m;
return 1;
@@ -3845,28 +3914,28 @@ VpAlloc(size_t mx, const char *szVal)
if (mx == 0) ++mx;
if (szVal) {
- while (ISSPACE(*szVal)) szVal++;
- if (*szVal != '#') {
- if (mf) {
- mf = (mf + BASE_FIG - 1) / BASE_FIG + 2; /* Needs 1 more for div */
- if (mx > mf) {
- mx = mf;
- }
- }
- }
- else {
- ++szVal;
- }
+ while (ISSPACE(*szVal)) szVal++;
+ if (*szVal != '#') {
+ if (mf) {
+ mf = (mf + BASE_FIG - 1) / BASE_FIG + 2; /* Needs 1 more for div */
+ if (mx > mf) {
+ mx = mf;
+ }
+ }
+ }
+ else {
+ ++szVal;
+ }
}
else {
- /* necessary to be able to store */
- /* at least mx digits. */
- /* szVal==NULL ==> allocate zero value. */
- vp = VpAllocReal(mx);
- /* xmalloc() alway returns(or throw interruption) */
- vp->MaxPrec = mx; /* set max precision */
- VpSetZero(vp, 1); /* initialize vp to zero. */
- return vp;
+ /* necessary to be able to store */
+ /* at least mx digits. */
+ /* szVal==NULL ==> allocate zero value. */
+ vp = VpAllocReal(mx);
+ /* xmalloc() alway returns(or throw interruption) */
+ vp->MaxPrec = mx; /* set max precision */
+ VpSetZero(vp, 1); /* initialize vp to zero. */
+ return vp;
}
/* Skip all '_' after digit: 2006-6-30 */
@@ -3876,43 +3945,42 @@ VpAlloc(size_t mx, const char *szVal)
i = 0;
ipn = 0;
while ((psz[i] = szVal[ipn]) != 0) {
- if (ISDIGIT(psz[i])) ++ni;
- if (psz[i] == '_') {
- if (ni > 0) {
- ipn++;
- continue;
- }
- psz[i] = 0;
- break;
- }
- ++i;
- ++ipn;
- }
- /* Skip trailing spaces */
- while (--i > 0) {
- if (ISSPACE(psz[i])) psz[i] = 0;
- else break;
+ if (ISSPACE(psz[i])) {
+ psz[i] = 0;
+ break;
+ }
+ if (ISDIGIT(psz[i])) ++ni;
+ if (psz[i] == '_') {
+ if (ni > 0) {
+ ipn++;
+ continue;
+ }
+ psz[i] = 0;
+ break;
+ }
+ ++i;
+ ++ipn;
}
szVal = psz;
/* Check on Inf & NaN */
if (StrCmp(szVal, SZ_PINF) == 0 || StrCmp(szVal, SZ_INF) == 0 ) {
- vp = VpAllocReal(1);
- vp->MaxPrec = 1; /* set max precision */
- VpSetPosInf(vp);
- return vp;
+ vp = VpAllocReal(1);
+ vp->MaxPrec = 1; /* set max precision */
+ VpSetPosInf(vp);
+ return vp;
}
if (StrCmp(szVal, SZ_NINF) == 0) {
- vp = VpAllocReal(1);
- vp->MaxPrec = 1; /* set max precision */
- VpSetNegInf(vp);
- return vp;
+ vp = VpAllocReal(1);
+ vp->MaxPrec = 1; /* set max precision */
+ VpSetNegInf(vp);
+ return vp;
}
if (StrCmp(szVal, SZ_NaN) == 0) {
- vp = VpAllocReal(1);
- vp->MaxPrec = 1; /* set max precision */
- VpSetNaN(vp);
- return vp;
+ vp = VpAllocReal(1);
+ vp->MaxPrec = 1; /* set max precision */
+ VpSetNaN(vp);
+ return vp;
}
/* check on number szVal[] */
@@ -3922,45 +3990,45 @@ VpAlloc(size_t mx, const char *szVal)
/* Skip digits */
ni = 0; /* digits in mantissa */
while ((v = szVal[i]) != 0) {
- if (!ISDIGIT(v)) break;
- ++i;
- ++ni;
+ if (!ISDIGIT(v)) break;
+ ++i;
+ ++ni;
}
nf = 0;
ipf = 0;
ipe = 0;
ne = 0;
if (v) {
- /* other than digit nor \0 */
- if (szVal[i] == '.') { /* xxx. */
- ++i;
- ipf = i;
- while ((v = szVal[i]) != 0) { /* get fraction part. */
- if (!ISDIGIT(v)) break;
- ++i;
- ++nf;
- }
- }
- ipe = 0; /* Exponent */
-
- switch (szVal[i]) {
- case '\0':
- break;
- case 'e': case 'E':
- case 'd': case 'D':
- ++i;
- ipe = i;
- v = szVal[i];
- if ((v == '-') || (v == '+')) ++i;
- while ((v=szVal[i]) != 0) {
- if (!ISDIGIT(v)) break;
- ++i;
- ++ne;
- }
- break;
- default:
- break;
- }
+ /* other than digit nor \0 */
+ if (szVal[i] == '.') { /* xxx. */
+ ++i;
+ ipf = i;
+ while ((v = szVal[i]) != 0) { /* get fraction part. */
+ if (!ISDIGIT(v)) break;
+ ++i;
+ ++nf;
+ }
+ }
+ ipe = 0; /* Exponent */
+
+ switch (szVal[i]) {
+ case '\0':
+ break;
+ case 'e': case 'E':
+ case 'd': case 'D':
+ ++i;
+ ipe = i;
+ v = szVal[i];
+ if ((v == '-') || (v == '+')) ++i;
+ while ((v=szVal[i]) != 0) {
+ if (!ISDIGIT(v)) break;
+ ++i;
+ ++ne;
+ }
+ break;
+ default:
+ break;
+ }
}
nalloc = (ni + nf + BASE_FIG - 1) / BASE_FIG + 1; /* set effective allocation */
/* units for szVal[] */
@@ -4029,7 +4097,7 @@ VpAsgn(Real *c, Real *a, int isw)
/*
* c = a + b when operation = 1 or 2
- * = a - b when operation = -1 or -2.
+ * c = a - b when operation = -1 or -2.
* Returns number of significant digits of c
*/
VP_EXPORT size_t
@@ -4162,7 +4230,7 @@ end_if:
}
/*
- * Addition of two variable precisional variables
+ * Addition of two values with variable precision
* a and b assuming abs(a)>abs(b).
* c = abs(a) + abs(b) ; where |a|>=|b|
*/
@@ -4384,7 +4452,7 @@ VpSetPTR(Real *a, Real *b, Real *c, size_t *a_pos, size_t *b_pos, size_t *c_pos,
size_t const round_limit = (VpGetPrecLimit() + BASE_FIG - 1) / BASE_FIG;
- assert(a->exponent >= b->expoennt);
+ assert(a->exponent >= b->exponent);
c->frac[0] = 0;
*av = *bv = 0;
@@ -4808,11 +4876,11 @@ out_side:
space_error:
#ifdef BIGDECIMAL_DEBUG
if (gfDebug) {
- printf(" word_a=%lu\n", word_a);
- printf(" word_b=%lu\n", word_b);
- printf(" word_c=%lu\n", word_c);
- printf(" word_r=%lu\n", word_r);
- printf(" ind_r =%lu\n", ind_r);
+ printf(" word_a=%"PRIuSIZE"\n", word_a);
+ printf(" word_b=%"PRIuSIZE"\n", word_b);
+ printf(" word_c=%"PRIuSIZE"\n", word_c);
+ printf(" word_r=%"PRIuSIZE"\n", word_r);
+ printf(" ind_r =%"PRIuSIZE"\n", ind_r);
}
#endif /* BIGDECIMAL_DEBUG */
rb_bug("ERROR(VpDivd): space for remainder too small.");
@@ -4921,7 +4989,7 @@ VpComp(Real *a, Real *b)
goto Exit;
}
- /* a and b have same exponent, then compare significand. */
+ /* a and b have same exponent, then compare their significand. */
mx = (a->Prec < b->Prec) ? a->Prec : b->Prec;
ind = 0;
while (ind < mx) {
@@ -4963,7 +5031,7 @@ Exit:
* \n ... new line
* \b ... backspace
* ... tab
- * Note: % must must not appear more than once
+ * Note: % must not appear more than once
* a ... VP variable to be printed
*/
#ifdef BIGDECIMAL_ENABLE_VPRINT
@@ -6192,7 +6260,7 @@ Exit:
if (gfDebug) {
VPrint(stdout, "VpPower y=%\n", y);
VPrint(stdout, "VpPower x=%\n", x);
- printf(" n=%d\n", n);
+ printf(" n=%"PRIdVALUE"\n", n);
}
#endif /* BIGDECIMAL_DEBUG */
VpFree(w2);
@@ -6227,10 +6295,10 @@ VpVarCheck(Real * v)
for (i = 0; i < v->Prec; ++i) {
if (v->frac[i] >= BASE) {
printf("ERROR(VpVarCheck): Illegal fraction\n");
- printf(" Frac[%"PRIuSIZE"]=%lu\n", i, v->frac[i]);
+ printf(" Frac[%"PRIuSIZE"]=%"PRIuBDIGIT"\n", i, v->frac[i]);
printf(" Prec. =%"PRIuSIZE"\n", v->Prec);
printf(" Exp. =%"PRIdVALUE"\n", v->exponent);
- printf(" BASE =%lu\n", BASE);
+ printf(" BASE =%"PRIuBDIGIT"\n", BASE);
return 3;
}
}
diff --git a/ext/bigdecimal/bigdecimal.gemspec b/ext/bigdecimal/bigdecimal.gemspec
index 676e05bacb..1666325d45 100644
--- a/ext/bigdecimal/bigdecimal.gemspec
+++ b/ext/bigdecimal/bigdecimal.gemspec
@@ -1,22 +1,22 @@
# -*- ruby -*-
-_VERSION = "1.2.3"
+_VERSION = "1.2.8"
date = %w$Date:: $[1]
Gem::Specification.new do |s|
s.name = "bigdecimal"
s.version = _VERSION
s.date = date
+ s.license = 'ruby'
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", "Zachary Scott", "Shigeo Kobayashi"]
- s.require_path = %[.]
+ s.require_path = %[lib]
s.files = %w[
bigdecimal.gemspec
bigdecimal.c
bigdecimal.h
- README
depend extconf.rb
lib/bigdecimal/jacobian.rb
lib/bigdecimal/ludcmp.rb
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h
index 805990d99c..f85c3e55ad 100644
--- a/ext/bigdecimal/bigdecimal.h
+++ b/ext/bigdecimal/bigdecimal.h
@@ -4,13 +4,6 @@
*
* 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 this BigDecimal distribution.
- *
- * NOTES:
- * 2003-03-28 V1.0 checked in.
- *
*/
#ifndef RUBY_BIG_DECIMAL_H
@@ -43,13 +36,35 @@
# define BDIGIT_DBL uint64_t
# define BDIGIT_DBL_SIGNED int64_t
# define SIZEOF_BDIGITS 4
+# define PRI_BDIGIT_PREFIX ""
+# ifdef PRI_LL_PREFIX
+# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
+# else
+# define PRI_BDIGIT_DBL_PREFIX "l"
+# endif
#else
# define BDIGIT uint16_t
# define BDIGIT_DBL uint32_t
# define BDIGIT_DBL_SIGNED int32_t
# define SIZEOF_BDIGITS 2
+# define PRI_BDIGIT_PREFIX "h"
+# define PRI_BDIGIT_DBL_PREFIX ""
#endif
+#define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
+#define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
+#define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
+#define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
+#define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
+#define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
+
+#define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
+#define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
+#define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
+#define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
+#define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
+#define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
+
#if defined(__cplusplus)
extern "C" {
#if 0
@@ -291,7 +306,7 @@ VP_EXPORT Real *VpOne(void);
#define VpIsZero(a) (VpIsPosZero(a) || VpIsNegZero(a))
#define VpSetPosZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_ZERO)
#define VpSetNegZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_ZERO)
-#define VpSetZero(a,s) ( ((s)>0)?VpSetPosZero(a):VpSetNegZero(a) )
+#define VpSetZero(a,s) (void)(((s)>0)?VpSetPosZero(a):VpSetNegZero(a))
/* NaN */
#define VpIsNaN(a) ((a)->sign==VP_SIGN_NaN)
@@ -304,7 +319,7 @@ VP_EXPORT Real *VpOne(void);
#define VpIsDef(a) ( !(VpIsNaN(a)||VpIsInf(a)) )
#define VpSetPosInf(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_INFINITE)
#define VpSetNegInf(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_INFINITE)
-#define VpSetInf(a,s) ( ((s)>0)?VpSetPosInf(a):VpSetNegInf(a) )
+#define VpSetInf(a,s) (void)(((s)>0)?VpSetPosInf(a):VpSetNegInf(a))
#define VpHasVal(a) (a->frac[0])
#define VpIsOne(a) ((a->Prec==1)&&(a->frac[0]==1)&&(a->exponent==1))
#define VpExponent(a) (a->exponent)
diff --git a/ext/bigdecimal/depend b/ext/bigdecimal/depend
index a68128478c..d9c6600b80 100644
--- a/ext/bigdecimal/depend
+++ b/ext/bigdecimal/depend
@@ -1 +1,13 @@
-bigdecimal.o: bigdecimal.c bigdecimal.h $(HDRS) $(ruby_headers)
+# AUTOGENERATED DEPENDENCIES START
+bigdecimal.o: $(RUBY_EXTCONF_H)
+bigdecimal.o: $(arch_hdrdir)/ruby/config.h
+bigdecimal.o: $(hdrdir)/ruby/defines.h
+bigdecimal.o: $(hdrdir)/ruby/intern.h
+bigdecimal.o: $(hdrdir)/ruby/missing.h
+bigdecimal.o: $(hdrdir)/ruby/st.h
+bigdecimal.o: $(hdrdir)/ruby/subst.h
+bigdecimal.o: $(hdrdir)/ruby/util.h
+bigdecimal.o: $(hdrdir)/ruby/ruby.h
+bigdecimal.o: bigdecimal.c
+bigdecimal.o: bigdecimal.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb
index d6be3e584e..3799e685bc 100644
--- a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -1,6 +1,11 @@
+# frozen_string_literal: false
require 'mkmf'
have_func("labs", "stdlib.h")
have_func("llabs", "stdlib.h")
+have_type("struct RRational", "ruby.h")
+have_func("rb_rational_num", "ruby.h")
+have_func("rb_rational_den", "ruby.h")
+
create_makefile('bigdecimal')
diff --git a/ext/bigdecimal/lib/bigdecimal/jacobian.rb b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
index eb9b1c9fc5..9cad06c09b 100644
--- a/ext/bigdecimal/lib/bigdecimal/jacobian.rb
+++ b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# require 'bigdecimal/jacobian'
#
@@ -75,7 +76,7 @@ module Jacobian
# Computes the Jacobian of f at x. fx is the value of f at x.
def jacobian(f,fx,x)
n = x.size
- dfdx = Array::new(n*n)
+ dfdx = Array.new(n*n)
for i in 0...n do
df = dfdxi(f,fx,x,i)
for j in 0...n do
diff --git a/ext/bigdecimal/lib/bigdecimal/ludcmp.rb b/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
index 6cbe29b6da..dd265e482a 100644
--- a/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
+++ b/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'bigdecimal'
#
diff --git a/ext/bigdecimal/lib/bigdecimal/math.rb b/ext/bigdecimal/lib/bigdecimal/math.rb
index 907d3b3829..3ddde6a9a0 100644
--- a/ext/bigdecimal/lib/bigdecimal/math.rb
+++ b/ext/bigdecimal/lib/bigdecimal/math.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'bigdecimal'
#
@@ -36,8 +37,8 @@ module BigMath
# Computes the square root of +decimal+ to the specified number of digits of
# precision, +numeric+.
#
- # BigMath::sqrt(BigDecimal.new('2'), 16).to_s
- # #=> "0.14142135623730950488016887242096975E1"
+ # BigMath.sqrt(BigDecimal.new('2'), 16).to_s
+ # #=> "0.1414213562373095048801688724E1"
#
def sqrt(x, prec)
x.sqrt(prec)
@@ -51,7 +52,7 @@ module BigMath
#
# If +decimal+ is Infinity or NaN, returns NaN.
#
- # BigMath::sin(BigMath::PI(5)/4, 5).to_s
+ # BigMath.sin(BigMath.PI(5)/4, 5).to_s
# #=> "0.70710678118654752440082036563292800375E0"
#
def sin(x, prec)
@@ -95,7 +96,7 @@ module BigMath
#
# If +decimal+ is Infinity or NaN, returns NaN.
#
- # BigMath::cos(BigMath::PI(4), 16).to_s
+ # BigMath.cos(BigMath.PI(4), 16).to_s
# #=> "-0.999999999999999999999999999999856613163740061349E0"
#
def cos(x, prec)
@@ -139,7 +140,7 @@ module BigMath
#
# If +decimal+ is NaN, returns NaN.
#
- # BigMath::atan(BigDecimal.new('-1'), 16).to_s
+ # BigMath.atan(BigDecimal.new('-1'), 16).to_s
# #=> "-0.785398163397448309615660845819878471907514682065E0"
#
def atan(x, prec)
@@ -176,11 +177,11 @@ module BigMath
# Computes the value of pi to the specified number of digits of precision,
# +numeric+.
#
- # BigMath::PI(10).to_s
+ # BigMath.PI(10).to_s
# #=> "0.3141592653589793238462643388813853786957412E1"
#
def PI(prec)
- raise ArgumentError, "Zero or negative argument for PI" if prec <= 0
+ raise ArgumentError, "Zero or negative precision for PI" if prec <= 0
n = prec + BigDecimal.double_fig
zero = BigDecimal("0")
one = BigDecimal("1")
@@ -221,7 +222,7 @@ module BigMath
# Computes e (the base of natural logarithms) to the specified number of
# digits of precision, +numeric+.
#
- # BigMath::E(10).to_s
+ # BigMath.E(10).to_s
# #=> "0.271828182845904523536028752390026306410273E1"
#
def E(prec)
diff --git a/ext/bigdecimal/lib/bigdecimal/newton.rb b/ext/bigdecimal/lib/bigdecimal/newton.rb
index db1a5ad99e..85bacb7f2e 100644
--- a/ext/bigdecimal/lib/bigdecimal/newton.rb
+++ b/ext/bigdecimal/lib/bigdecimal/newton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require "bigdecimal/ludcmp"
require "bigdecimal/jacobian"
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb
index 82c82c8e1e..0c4e486c00 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# BigDecimal extends the native Integer class to provide the #to_d method.
#
# When you require the BigDecimal library in your application, this methodwill
diff --git a/ext/bigdecimal/sample/linear.rb b/ext/bigdecimal/sample/linear.rb
index 93d558b539..3b23269f8a 100644
--- a/ext/bigdecimal/sample/linear.rb
+++ b/ext/bigdecimal/sample/linear.rb
@@ -1,4 +1,5 @@
#!/usr/local/bin/ruby
+# frozen_string_literal: false
#
# linear.rb
@@ -16,8 +17,8 @@ require "bigdecimal/ludcmp"
#
# NOTE:
-# Change following BigDecimal::limit() if needed.
-BigDecimal::limit(100)
+# Change following BigDecimal.limit() if needed.
+BigDecimal.limit(100)
#
include LUSolve
@@ -27,8 +28,8 @@ def rd_order(na)
end
na = ARGV.size
-zero = BigDecimal::new("0.0")
-one = BigDecimal::new("1.0")
+zero = BigDecimal.new("0.0")
+one = BigDecimal.new("1.0")
while (n=rd_order(na))>0
a = []
@@ -40,10 +41,10 @@ while (n=rd_order(na))>0
for i in 0...n do
for j in 0...n do
printf("A[%d,%d]? ",i,j); s = ARGF.gets
- a << BigDecimal::new(s);
- as << BigDecimal::new(s);
+ a << BigDecimal.new(s);
+ as << BigDecimal.new(s);
end
- printf("Contatant vector element b[%d] ? ",i); b << BigDecimal::new(ARGF.gets);
+ printf("Contatant vector element b[%d] ? ",i); b << BigDecimal.new(ARGF.gets);
end
else
# Read data from specified file.
@@ -53,10 +54,10 @@ while (n=rd_order(na))>0
printf("%d) %s",i,s)
s = s.split
for j in 0...n do
- a << BigDecimal::new(s[j]);
- as << BigDecimal::new(s[j]);
+ a << BigDecimal.new(s[j]);
+ as << BigDecimal.new(s[j]);
end
- b << BigDecimal::new(s[n]);
+ b << BigDecimal.new(s[n]);
end
end
x = lusolve(a,b,ludecomp(a,n,zero,one),zero)
diff --git a/ext/bigdecimal/sample/nlsolve.rb b/ext/bigdecimal/sample/nlsolve.rb
index 692a5023cc..b1dd08e0a3 100644
--- a/ext/bigdecimal/sample/nlsolve.rb
+++ b/ext/bigdecimal/sample/nlsolve.rb
@@ -1,4 +1,5 @@
#!/usr/local/bin/ruby
+# frozen_string_literal: false
#
# nlsolve.rb
@@ -11,11 +12,11 @@ include Newton
class Function # :nodoc: all
def initialize()
- @zero = BigDecimal::new("0.0")
- @one = BigDecimal::new("1.0")
- @two = BigDecimal::new("2.0")
- @ten = BigDecimal::new("10.0")
- @eps = BigDecimal::new("1.0e-16")
+ @zero = BigDecimal.new("0.0")
+ @one = BigDecimal.new("1.0")
+ @two = BigDecimal.new("2.0")
+ @ten = BigDecimal.new("10.0")
+ @eps = BigDecimal.new("1.0e-16")
end
def zero;@zero;end
def one ;@one ;end
@@ -31,8 +32,9 @@ class Function # :nodoc: all
f
end
end
- f = BigDecimal::limit(100)
- f = Function.new
- x = [f.zero,f.zero] # Initial values
- n = nlsolve(f,x)
- p x
+
+f = BigDecimal.limit(100)
+f = Function.new
+x = [f.zero,f.zero] # Initial values
+n = nlsolve(f,x)
+p x
diff --git a/ext/bigdecimal/sample/pi.rb b/ext/bigdecimal/sample/pi.rb
index 2f7dd27d60..ea9663896c 100644
--- a/ext/bigdecimal/sample/pi.rb
+++ b/ext/bigdecimal/sample/pi.rb
@@ -1,4 +1,5 @@
#!/usr/local/bin/ruby
+# frozen_string_literal: false
#
# pi.rb
diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c
new file mode 100644
index 0000000000..e8f64f6dcc
--- /dev/null
+++ b/ext/cgi/escape/escape.c
@@ -0,0 +1,105 @@
+#include "ruby.h"
+#include "ruby/encoding.h"
+
+static VALUE rb_cCGI, rb_mUtil, rb_mEscape;
+
+static void
+html_escaped_cat(VALUE str, char c)
+{
+ switch (c) {
+ case '\'':
+ rb_str_cat_cstr(str, "&#39;");
+ break;
+ case '&':
+ rb_str_cat_cstr(str, "&amp;");
+ break;
+ case '"':
+ rb_str_cat_cstr(str, "&quot;");
+ break;
+ case '<':
+ rb_str_cat_cstr(str, "&lt;");
+ break;
+ case '>':
+ rb_str_cat_cstr(str, "&gt;");
+ break;
+ }
+}
+
+static inline void
+preserve_original_state(VALUE orig, VALUE dest)
+{
+ rb_enc_associate(dest, rb_enc_get(orig));
+
+ RB_OBJ_INFECT_RAW(dest, orig);
+}
+
+static VALUE
+optimized_escape_html(VALUE str)
+{
+ long i, len, modified = 0, beg = 0;
+ VALUE dest;
+ const char *cstr;
+
+ len = RSTRING_LEN(str);
+ cstr = RSTRING_PTR(str);
+
+ for (i = 0; i < len; i++) {
+ switch (cstr[i]) {
+ case '\'':
+ case '&':
+ case '"':
+ case '<':
+ case '>':
+ if (!modified) {
+ modified = 1;
+ dest = rb_str_buf_new(len);
+ }
+
+ rb_str_cat(dest, cstr + beg, i - beg);
+ beg = i + 1;
+
+ html_escaped_cat(dest, cstr[i]);
+ break;
+ }
+ }
+
+ if (modified) {
+ rb_str_cat(dest, cstr + beg, len - beg);
+ preserve_original_state(str, dest);
+ return dest;
+ }
+ else {
+ return rb_str_dup(str);
+ }
+}
+
+/*
+ * call-seq:
+ * CGI.escapeHTML(string) -> string
+ *
+ * Returns HTML-escaped string.
+ *
+ */
+static VALUE
+cgiesc_escape_html(VALUE self, VALUE str)
+{
+ StringValue(str);
+
+ if (rb_enc_str_asciicompat_p(str)) {
+ return optimized_escape_html(str);
+ }
+ else {
+ return rb_call_super(1, &str);
+ }
+}
+
+void
+Init_escape(void)
+{
+ rb_cCGI = rb_define_class("CGI", rb_cObject);
+ rb_mEscape = rb_define_module_under(rb_cCGI, "Escape");
+ rb_mUtil = rb_define_module_under(rb_cCGI, "Util");
+ rb_define_method(rb_mEscape, "escapeHTML", cgiesc_escape_html, 1);
+ rb_prepend_module(rb_mUtil, rb_mEscape);
+ rb_extend_object(rb_cCGI, rb_mEscape);
+}
diff --git a/ext/cgi/escape/extconf.rb b/ext/cgi/escape/extconf.rb
new file mode 100644
index 0000000000..16e8ff224d
--- /dev/null
+++ b/ext/cgi/escape/extconf.rb
@@ -0,0 +1,3 @@
+require 'mkmf'
+
+create_makefile 'cgi/escape'
diff --git a/ext/continuation/continuation.c b/ext/continuation/continuation.c
index ae69b66cd8..c678371cca 100644
--- a/ext/continuation/continuation.c
+++ b/ext/continuation/continuation.c
@@ -1,8 +1,13 @@
+#include "ruby/ruby.h"
+
void ruby_Init_Continuation_body(void);
void
Init_continuation(void)
{
+#ifndef RUBY_EXPORT
+ rb_warn("callcc is obsolete; use Fiber instead");
+#endif
ruby_Init_Continuation_body();
}
diff --git a/ext/continuation/extconf.rb b/ext/continuation/extconf.rb
index 17e2d056db..6d54ec01a5 100644
--- a/ext/continuation/extconf.rb
+++ b/ext/continuation/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile('continuation')
diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c
index 93cb2a5c9e..f621280ca6 100644
--- a/ext/coverage/coverage.c
+++ b/ext/coverage/coverage.c
@@ -32,14 +32,22 @@ rb_coverage_start(VALUE klass)
return Qnil;
}
+/* Make coverage arrays empty so old covered files are no longer tracked. */
static int
-coverage_result_i(st_data_t key, st_data_t val, st_data_t h)
+coverage_clear_result_i(st_data_t key, st_data_t val, st_data_t h)
+{
+ VALUE coverage = (VALUE)val;
+ rb_ary_clear(coverage);
+ return ST_CONTINUE;
+}
+
+static int
+coverage_peek_result_i(st_data_t key, st_data_t val, st_data_t h)
{
VALUE path = (VALUE)key;
VALUE coverage = (VALUE)val;
VALUE coverages = (VALUE)h;
coverage = rb_ary_dup(coverage);
- rb_ary_clear((VALUE)val);
rb_ary_freeze(coverage);
rb_hash_aset(coverages, path, coverage);
return ST_CONTINUE;
@@ -47,21 +55,36 @@ coverage_result_i(st_data_t key, st_data_t val, st_data_t h)
/*
* call-seq:
- * Coverage.result => hash
+ * Coverage.peek_result => hash
*
- * Returns a hash that contains filename as key and coverage array as value
- * and disables coverage measurement.
+ * Returns a hash that contains filename as key and coverage array as value.
*/
static VALUE
-rb_coverage_result(VALUE klass)
+rb_coverage_peek_result(VALUE klass)
{
VALUE coverages = rb_get_coverages();
VALUE ncoverages = rb_hash_new();
if (!RTEST(coverages)) {
rb_raise(rb_eRuntimeError, "coverage measurement is not enabled");
}
- st_foreach(RHASH_TBL(coverages), coverage_result_i, ncoverages);
+ st_foreach(RHASH_TBL(coverages), coverage_peek_result_i, ncoverages);
rb_hash_freeze(ncoverages);
+ return ncoverages;
+}
+
+/*
+ * call-seq:
+ * Coverage.result => hash
+ *
+ * Returns a hash that contains filename as key and coverage array as value
+ * and disables coverage measurement.
+ */
+static VALUE
+rb_coverage_result(VALUE klass)
+{
+ VALUE ncoverages = rb_coverage_peek_result(klass);
+ VALUE coverages = rb_get_coverages();
+ st_foreach(RHASH_TBL(coverages), coverage_clear_result_i, ncoverages);
rb_reset_coverages();
return ncoverages;
}
@@ -71,7 +94,7 @@ rb_coverage_result(VALUE klass)
*
* = Usage
*
- * 1. require "coverage.so"
+ * 1. require "coverage"
* 2. do Coverage.start
* 3. require or load Ruby source file
* 4. Coverage.result will return a hash that contains filename as key and
@@ -94,7 +117,7 @@ rb_coverage_result(VALUE klass)
* end
* [EOF]
*
- * require "coverage.so"
+ * require "coverage"
* Coverage.start
* require "foo.rb"
* p Coverage.result #=> {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]}
@@ -105,5 +128,6 @@ Init_coverage(void)
VALUE rb_mCoverage = rb_define_module("Coverage");
rb_define_module_function(rb_mCoverage, "start", rb_coverage_start, 0);
rb_define_module_function(rb_mCoverage, "result", rb_coverage_result, 0);
+ rb_define_module_function(rb_mCoverage, "peek_result", rb_coverage_peek_result, 0);
rb_gc_register_address(&rb_coverages);
}
diff --git a/ext/coverage/depend b/ext/coverage/depend
index 1227a5c9ae..04eaf10d0a 100644
--- a/ext/coverage/depend
+++ b/ext/coverage/depend
@@ -8,4 +8,34 @@ $(OBJS): $(HDRS) $(ruby_headers) \
$(top_srcdir)/ruby_atomic.h \
$(top_srcdir)/thread_pthread.h \
$(top_srcdir)/internal.h \
- $(top_srcdir)/thread_native.h
+ $(top_srcdir)/include/ruby/thread_native.h
+
+# AUTOGENERATED DEPENDENCIES START
+coverage.o: $(RUBY_EXTCONF_H)
+coverage.o: $(arch_hdrdir)/ruby/config.h
+coverage.o: $(hdrdir)/ruby/defines.h
+coverage.o: $(hdrdir)/ruby/encoding.h
+coverage.o: $(hdrdir)/ruby/intern.h
+coverage.o: $(hdrdir)/ruby/io.h
+coverage.o: $(hdrdir)/ruby/missing.h
+coverage.o: $(hdrdir)/ruby/oniguruma.h
+coverage.o: $(hdrdir)/ruby/ruby.h
+coverage.o: $(hdrdir)/ruby/st.h
+coverage.o: $(hdrdir)/ruby/subst.h
+coverage.o: $(hdrdir)/ruby/thread_native.h
+coverage.o: $(top_srcdir)/ccan/check_type/check_type.h
+coverage.o: $(top_srcdir)/ccan/container_of/container_of.h
+coverage.o: $(top_srcdir)/ccan/list/list.h
+coverage.o: $(top_srcdir)/ccan/str/str.h
+coverage.o: $(top_srcdir)/include/ruby.h
+coverage.o: $(top_srcdir)/internal.h
+coverage.o: $(top_srcdir)/method.h
+coverage.o: $(top_srcdir)/node.h
+coverage.o: $(top_srcdir)/ruby_atomic.h
+coverage.o: $(top_srcdir)/thread_pthread.h
+coverage.o: $(top_srcdir)/vm_core.h
+coverage.o: $(top_srcdir)/vm_debug.h
+coverage.o: $(top_srcdir)/vm_opts.h
+coverage.o: coverage.c
+coverage.o: {$(VPATH)}id.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/coverage/extconf.rb b/ext/coverage/extconf.rb
index 769f85b6ef..3a6f530a92 100644
--- a/ext/coverage/extconf.rb
+++ b/ext/coverage/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
$VPATH << '$(topdir)' << '$(top_srcdir)'
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 176c76ef0c..eb1d385a7b 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-2013
+ date_core.c: Coded by Tadayoshi Funaba 2010-2014
*/
#include "ruby.h"
@@ -114,7 +114,7 @@ f_zero_p(VALUE x)
return Qfalse;
case T_RATIONAL:
{
- VALUE num = RRATIONAL(x)->num;
+ VALUE num = rb_rational_num(x);
return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
}
}
@@ -286,36 +286,36 @@ union DateData {
#define get_d1(x)\
union DateData *dat;\
- Data_Get_Struct(x, union DateData, dat);
+ TypedData_Get_Struct(x, union DateData, &d_lite_type, dat);
#define get_d1a(x)\
union DateData *adat;\
- Data_Get_Struct(x, union DateData, adat);
+ TypedData_Get_Struct(x, union DateData, &d_lite_type, adat);
#define get_d1b(x)\
union DateData *bdat;\
- Data_Get_Struct(x, union DateData, bdat);
+ TypedData_Get_Struct(x, union DateData, &d_lite_type, bdat);
#define get_d2(x,y)\
union DateData *adat, *bdat;\
- Data_Get_Struct(x, union DateData, adat);\
- Data_Get_Struct(y, union DateData, bdat);
+ TypedData_Get_Struct(x, union DateData, &d_lite_type, adat);\
+ TypedData_Get_Struct(y, union DateData, &d_lite_type, bdat);
inline static VALUE
canon(VALUE x)
{
- if (TYPE(x) == T_RATIONAL) {
- VALUE den = RRATIONAL(x)->den;
+ if (RB_TYPE_P(x, T_RATIONAL)) {
+ VALUE den = rb_rational_den(x);
if (FIXNUM_P(den) && FIX2LONG(den) == 1)
- return RRATIONAL(x)->num;
+ return rb_rational_num(x);
}
return x;
}
#ifndef USE_PACK
-#define set_to_simple(x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
+#define set_to_simple(obj, x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
{\
- (x)->nth = canon(_nth);\
+ RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth)); \
(x)->jd = _jd;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -324,9 +324,9 @@ canon(VALUE x)
(x)->flags = _flags;\
}
#else
-#define set_to_simple(x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
+#define set_to_simple(obj, x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
{\
- (x)->nth = canon(_nth);\
+ RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth)); \
(x)->jd = _jd;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -336,13 +336,13 @@ canon(VALUE x)
#endif
#ifndef USE_PACK
-#define set_to_complex(x, _nth, _jd ,_df, _sf, _of, _sg,\
+#define set_to_complex(obj, x, _nth, _jd ,_df, _sf, _of, _sg,\
_year, _mon, _mday, _hour, _min, _sec, _flags) \
{\
- (x)->nth = canon(_nth);\
+ RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth));\
(x)->jd = _jd;\
(x)->df = _df;\
- (x)->sf = canon(_sf);\
+ RB_OBJ_WRITE((obj), &(x)->sf, canon(_sf));\
(x)->of = _of;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -354,13 +354,13 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->flags = _flags;\
}
#else
-#define set_to_complex(x, _nth, _jd ,_df, _sf, _of, _sg,\
+#define set_to_complex(obj, x, _nth, _jd ,_df, _sf, _of, _sg,\
_year, _mon, _mday, _hour, _min, _sec, _flags) \
{\
- (x)->nth = canon(_nth);\
+ RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth));\
(x)->jd = _jd;\
(x)->df = _df;\
- (x)->sf = canon(_sf);\
+ RB_OBJ_WRITE((obj), &(x)->sf, canon(_sf));\
(x)->of = _of;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -370,9 +370,9 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
#endif
#ifndef USE_PACK
-#define copy_simple_to_complex(x, y) \
+#define copy_simple_to_complex(obj, x, y) \
{\
- (x)->nth = (y)->nth;\
+ RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->df = 0;\
(x)->sf = INT2FIX(0);\
@@ -387,12 +387,12 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->flags = (y)->flags;\
}
#else
-#define copy_simple_to_complex(x, y) \
+#define copy_simple_to_complex(obj, x, y) \
{\
- (x)->nth = (y)->nth;\
+ RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->df = 0;\
- (x)->sf = INT2FIX(0);\
+ RB_OBJ_WRITE((obj), &(x)->sf, INT2FIX(0));\
(x)->of = 0;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
@@ -402,9 +402,9 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
#endif
#ifndef USE_PACK
-#define copy_complex_to_simple(x, y) \
+#define copy_complex_to_simple(obj, x, y) \
{\
- (x)->nth = (y)->nth;\
+ RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
@@ -413,9 +413,9 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->flags = (y)->flags;\
}
#else
-#define copy_complex_to_simple(x, y) \
+#define copy_complex_to_simple(obj, x, y) \
{\
- (x)->nth = (y)->nth;\
+ RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
@@ -1120,11 +1120,13 @@ m_virtual_sg(union DateData *x)
}
inline static void
-canonicalize_s_jd(union DateData *x)
+canonicalize_s_jd(VALUE obj, union DateData *x)
{
int j = x->s.jd;
+ VALUE nth = x->s.nth;
assert(have_jd_p(x));
- canonicalize_jd(x->s.nth, x->s.jd);
+ canonicalize_jd(nth, x->s.jd);
+ RB_OBJ_WRITE(obj, &x->s.nth, nth);
if (x->s.jd != j)
x->flags &= ~HAVE_CIVIL;
}
@@ -1214,11 +1216,13 @@ get_c_time(union DateData *x)
}
inline static void
-canonicalize_c_jd(union DateData *x)
+canonicalize_c_jd(VALUE obj, union DateData *x)
{
int j = x->c.jd;
+ VALUE nth = x->c.nth;
assert(have_jd_p(x));
- canonicalize_jd(x->c.nth, x->c.jd);
+ canonicalize_jd(nth, x->c.jd);
+ RB_OBJ_WRITE(obj, &x->c.nth, nth);
if (x->c.jd != j)
x->flags &= ~HAVE_CIVIL;
}
@@ -1397,15 +1401,15 @@ guess_style(VALUE y, double sg) /* -/+oo or zero */
}
inline static void
-m_canonicalize_jd(union DateData *x)
+m_canonicalize_jd(VALUE obj, union DateData *x)
{
if (simple_dat_p(x)) {
get_s_jd(x);
- canonicalize_s_jd(x);
+ canonicalize_s_jd(obj, x);
}
else {
get_c_jd(x);
- canonicalize_c_jd(x);
+ canonicalize_c_jd(obj, x);
}
}
@@ -1723,23 +1727,6 @@ m_real_year(union DateData *x)
return ry;
}
-
-#ifdef USE_PACK
-inline static int
-m_pc(union DateData *x)
-{
- if (simple_dat_p(x)) {
- get_s_civil(x);
- return x->s.pc;
- }
- else {
- get_c_civil(x);
- get_c_time(x);
- return x->c.pc;
- }
-}
-#endif
-
inline static int
m_mon(union DateData *x)
{
@@ -1980,12 +1967,6 @@ k_date_p(VALUE x)
}
inline static VALUE
-k_datetime_p(VALUE x)
-{
- return f_kind_of_p(x, cDateTime);
-}
-
-inline static VALUE
k_numeric_p(VALUE x)
{
return f_kind_of_p(x, rb_cNumeric);
@@ -1997,6 +1978,13 @@ k_rational_p(VALUE x)
return f_kind_of_p(x, rb_cRational);
}
+static inline void
+expect_numeric(VALUE x)
+{
+ if (!k_numeric_p(x))
+ rb_raise(rb_eTypeError, "expected numeric");
+}
+
#ifndef NDEBUG
static void
civil_to_jd(VALUE y, int m, int d, double sg,
@@ -2370,8 +2358,7 @@ offset_to_sec(VALUE vof, int *rof)
return 1;
}
default:
- if (!k_numeric_p(vof))
- rb_raise(rb_eTypeError, "expected numeric");
+ expect_numeric(vof);
vof = f_to_r(vof);
#ifdef CANONICALIZATION_FOR_MATHN
if (!k_rational_p(vof))
@@ -2396,8 +2383,8 @@ offset_to_sec(VALUE vof, int *rof)
return 1;
}
#endif
- vn = RRATIONAL(vs)->num;
- vd = RRATIONAL(vs)->den;
+ vn = rb_rational_num(vs);
+ vd = rb_rational_den(vs);
if (FIXNUM_P(vn) && FIXNUM_P(vd) && (FIX2LONG(vd) == 1))
n = FIX2LONG(vn);
@@ -2945,17 +2932,31 @@ date_s_gregorian_leap_p(VALUE klass, VALUE y)
}
static void
-d_lite_gc_mark(union DateData *dat)
+d_lite_gc_mark(void *ptr)
{
+ union DateData *dat = ptr;
if (simple_dat_p(dat))
rb_gc_mark(dat->s.nth);
else {
rb_gc_mark(dat->c.nth);
rb_gc_mark(dat->c.sf);
-
}
}
+static size_t
+d_lite_memsize(const void *ptr)
+{
+ const union DateData *dat = ptr;
+ return complex_dat_p(dat) ? sizeof(struct ComplexDateData) : sizeof(struct SimpleDateData);
+}
+
+static const rb_data_type_t d_lite_type = {
+ "Date",
+ {d_lite_gc_mark, RUBY_TYPED_DEFAULT_FREE, d_lite_memsize,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED,
+};
+
inline static VALUE
d_simple_new_internal(VALUE klass,
VALUE nth, int jd,
@@ -2966,9 +2967,9 @@ d_simple_new_internal(VALUE klass,
struct SimpleDateData *dat;
VALUE obj;
- obj = Data_Make_Struct(klass, struct SimpleDateData,
- d_lite_gc_mark, -1, dat);
- set_to_simple(dat, nth, jd, sg, y, m, d, flags & ~COMPLEX_DAT);
+ obj = TypedData_Make_Struct(klass, struct SimpleDateData,
+ &d_lite_type, dat);
+ set_to_simple(obj, dat, nth, jd, sg, y, m, d, flags & ~COMPLEX_DAT);
assert(have_jd_p(dat) || have_civil_p(dat));
@@ -2987,9 +2988,9 @@ d_complex_new_internal(VALUE klass,
struct ComplexDateData *dat;
VALUE obj;
- obj = Data_Make_Struct(klass, struct ComplexDateData,
- d_lite_gc_mark, -1, dat);
- set_to_complex(dat, nth, jd, df, sf, of, sg,
+ obj = TypedData_Make_Struct(klass, struct ComplexDateData,
+ &d_lite_type, dat);
+ set_to_complex(obj, dat, nth, jd, df, sf, of, sg,
y, m, d, h, min, s, flags | COMPLEX_DAT);
assert(have_jd_p(dat) || have_civil_p(dat));
@@ -3120,7 +3121,7 @@ wholenum_p(VALUE x)
break;
case T_RATIONAL:
{
- VALUE den = RRATIONAL(x)->den;
+ VALUE den = rb_rational_den(x);
return FIXNUM_P(den) && FIX2LONG(den) == 1;
}
break;
@@ -3690,7 +3691,11 @@ rt_rewrite_frags(VALUE hash)
seconds = ref_hash("seconds");
if (!NIL_P(seconds)) {
- VALUE d, h, min, s, fr;
+ VALUE offset, d, h, min, s, fr;
+
+ offset = ref_hash("offset");
+ if (!NIL_P(offset))
+ seconds = f_add(seconds, offset);
d = f_idiv(seconds, INT2FIX(DAY_IN_SECONDS));
fr = f_mod(seconds, INT2FIX(DAY_IN_SECONDS));
@@ -3710,7 +3715,6 @@ rt_rewrite_frags(VALUE hash)
set_hash("sec", s);
set_hash("sec_fraction", fr);
del_hash("seconds");
- del_hash("offset");
}
return hash;
}
@@ -3725,7 +3729,8 @@ static VALUE
rt_complete_frags(VALUE klass, VALUE hash)
{
static VALUE tab = Qnil;
- int g, e;
+ int g;
+ long e;
VALUE k, a, d;
if (NIL_P(tab)) {
@@ -3822,19 +3827,19 @@ rt_complete_frags(VALUE klass, VALUE hash)
}
{
- int i, eno = 0, idx = 0;
+ long i, eno = 0, idx = 0;
- for (i = 0; i < RARRAY_LENINT(tab); i++) {
+ for (i = 0; i < RARRAY_LEN(tab); i++) {
VALUE x, a;
- x = RARRAY_PTR(tab)[i];
- a = RARRAY_PTR(x)[1];
+ x = RARRAY_AREF(tab, i);
+ a = RARRAY_AREF(x, 1);
{
- int j, n = 0;
+ long j, n = 0;
- for (j = 0; j < RARRAY_LENINT(a); j++)
- if (!NIL_P(ref_hash0(RARRAY_PTR(a)[j])))
+ for (j = 0; j < RARRAY_LEN(a); j++)
+ if (!NIL_P(ref_hash0(RARRAY_AREF(a, j))))
n++;
if (n > eno) {
eno = n;
@@ -3846,15 +3851,15 @@ rt_complete_frags(VALUE klass, VALUE hash)
g = 0;
else {
g = 1;
- k = RARRAY_PTR(RARRAY_PTR(tab)[idx])[0];
- a = RARRAY_PTR(RARRAY_PTR(tab)[idx])[1];
+ k = RARRAY_AREF(RARRAY_AREF(tab, idx), 0);
+ a = RARRAY_AREF(RARRAY_AREF(tab, idx), 1);
e = eno;
}
}
d = Qnil;
- if (g && !NIL_P(k) && (RARRAY_LENINT(a) - e)) {
+ if (g && !NIL_P(k) && (RARRAY_LEN(a) - e)) {
if (k == sym("ordinal")) {
if (NIL_P(ref_hash("year"))) {
if (NIL_P(d))
@@ -3865,10 +3870,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("yday", INT2FIX(1));
}
else if (k == sym("civil")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
- VALUE e = RARRAY_PTR(a)[i];
+ for (i = 0; i < RARRAY_LEN(a); i++) {
+ VALUE e = RARRAY_AREF(a, i);
if (!NIL_P(ref_hash0(e)))
break;
@@ -3882,10 +3887,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("mday", INT2FIX(1));
}
else if (k == sym("commercial")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
- VALUE e = RARRAY_PTR(a)[i];
+ for (i = 0; i < RARRAY_LEN(a); i++) {
+ VALUE e = RARRAY_AREF(a, i);
if (!NIL_P(ref_hash0(e)))
break;
@@ -3906,10 +3911,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
ref_hash("wday"))));
}
else if (k == sym("wnum0")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
- VALUE e = RARRAY_PTR(a)[i];
+ for (i = 0; i < RARRAY_LEN(a); i++) {
+ VALUE e = RARRAY_AREF(a, i);
if (!NIL_P(ref_hash0(e)))
break;
@@ -3923,10 +3928,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("wday", INT2FIX(0));
}
else if (k == sym("wnum1")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
- VALUE e = RARRAY_PTR(a)[i];
+ for (i = 0; i < RARRAY_LEN(a); i++) {
+ VALUE e = RARRAY_AREF(a, i);
if (!NIL_P(ref_hash0(e)))
break;
@@ -4644,6 +4649,7 @@ dup_obj(VALUE self)
{
get_d1b(new);
bdat->s = adat->s;
+ RB_OBJ_WRITTEN(new, Qundef, bdat->s.nth);
return new;
}
}
@@ -4652,6 +4658,8 @@ dup_obj(VALUE self)
{
get_d1b(new);
bdat->c = adat->c;
+ RB_OBJ_WRITTEN(new, Qundef, bdat->c.nth);
+ RB_OBJ_WRITTEN(new, Qundef, bdat->c.sf);
return new;
}
}
@@ -4666,7 +4674,7 @@ dup_obj_as_complex(VALUE self)
VALUE new = d_lite_s_alloc_complex(rb_obj_class(self));
{
get_d1b(new);
- copy_simple_to_complex(&bdat->c, &adat->s);
+ copy_simple_to_complex(new, &bdat->c, &adat->s);
bdat->c.flags |= HAVE_DF | COMPLEX_DAT;
return new;
}
@@ -4676,6 +4684,8 @@ dup_obj_as_complex(VALUE self)
{
get_d1b(new);
bdat->c = adat->c;
+ RB_OBJ_WRITTEN(new, Qundef, bdat->c.nth);
+ RB_OBJ_WRITTEN(new, Qundef, bdat->c.sf);
return new;
}
}
@@ -4734,7 +4744,7 @@ d_lite_initialize(int argc, VALUE *argv, VALUE self)
decode_jd(jd, &nth, &rjd);
if (!df && f_zero_p(sf) && !of) {
- set_to_simple(&dat->s, nth, rjd, sg, 0, 0, 0, HAVE_JD);
+ set_to_simple(self, &dat->s, nth, rjd, sg, 0, 0, 0, HAVE_JD);
}
else {
if (!complex_dat_p(dat))
@@ -5713,8 +5723,7 @@ d_lite_plus(VALUE self, VALUE other)
}
break;
default:
- if (!k_numeric_p(other))
- rb_raise(rb_eTypeError, "expected numeric");
+ expect_numeric(other);
other = f_to_r(other);
#ifdef CANONICALIZATION_FOR_MATHN
if (!k_rational_p(other))
@@ -5727,7 +5736,7 @@ d_lite_plus(VALUE self, VALUE other)
int jd, df, s;
if (wholenum_p(other))
- return d_lite_plus(self, RRATIONAL(other)->num);
+ return d_lite_plus(self, rb_rational_num(other));
if (f_positive_p(other))
s = +1;
@@ -5863,7 +5872,7 @@ minus_dd(VALUE self, VALUE other)
if (f_nonzero_p(sf))
r = f_add(r, ns_to_day(sf));
- if (TYPE(r) == T_RATIONAL)
+ if (RB_TYPE_P(r, T_RATIONAL))
return r;
return rb_rational_new1(r);
}
@@ -5898,8 +5907,7 @@ d_lite_minus(VALUE self, VALUE other)
case T_FLOAT:
return d_lite_plus(self, DBL2NUM(-RFLOAT_VALUE(other)));
default:
- if (!k_numeric_p(other))
- rb_raise(rb_eTypeError, "expected numeric");
+ expect_numeric(other);
/* fall through */
case T_BIGNUM:
case T_RATIONAL:
@@ -6018,6 +6026,7 @@ d_lite_rshift(VALUE self, VALUE other)
static VALUE
d_lite_lshift(VALUE self, VALUE other)
{
+ expect_numeric(other);
return d_lite_rshift(self, f_negate(other));
}
@@ -6210,8 +6219,8 @@ cmp_dd(VALUE self, VALUE other)
int a_jd, b_jd,
a_df, b_df;
- m_canonicalize_jd(adat);
- m_canonicalize_jd(bdat);
+ m_canonicalize_jd(self, adat);
+ m_canonicalize_jd(other, bdat);
a_nth = m_nth(adat);
b_nth = m_nth(bdat);
if (f_eqeq_p(a_nth, b_nth)) {
@@ -6289,8 +6298,8 @@ d_lite_cmp(VALUE self, VALUE other)
VALUE a_nth, b_nth;
int a_jd, b_jd;
- m_canonicalize_jd(adat);
- m_canonicalize_jd(bdat);
+ m_canonicalize_jd(self, adat);
+ m_canonicalize_jd(other, bdat);
a_nth = m_nth(adat);
b_nth = m_nth(bdat);
if (f_eqeq_p(a_nth, b_nth)) {
@@ -6306,7 +6315,7 @@ d_lite_cmp(VALUE self, VALUE other)
return INT2FIX(1);
}
}
- else if (a_nth < b_nth) {
+ else if (f_lt_p(a_nth, b_nth)) {
return INT2FIX(-1);
}
else {
@@ -6361,8 +6370,8 @@ d_lite_equal(VALUE self, VALUE other)
VALUE a_nth, b_nth;
int a_jd, b_jd;
- m_canonicalize_jd(adat);
- m_canonicalize_jd(bdat);
+ m_canonicalize_jd(self, adat);
+ m_canonicalize_jd(other, bdat);
a_nth = m_nth(adat);
b_nth = m_nth(bdat);
a_jd = m_local_jd(adat);
@@ -6396,7 +6405,7 @@ d_lite_hash(VALUE self)
h[2] = m_df(dat);
h[3] = m_sf(dat);
v = rb_memhash(h, sizeof(h));
- return LONG2FIX(v);
+ return LONG2FIX((long)v);
}
#include "date_tmx.h"
@@ -6778,7 +6787,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 or something similar information.
+ * %Z - Equivalent to %:z (e.g. +09:00)
*
* Weekday:
* %A - The full weekday name (``Sunday'')
@@ -7068,7 +7077,7 @@ d_lite_marshal_load(VALUE self, VALUE a)
rb_check_frozen(self);
rb_check_trusted(self);
- if (TYPE(a) != T_ARRAY)
+ if (!RB_TYPE_P(a, T_ARRAY))
rb_raise(rb_eTypeError, "expected an array");
switch (RARRAY_LEN(a)) {
@@ -7081,29 +7090,29 @@ d_lite_marshal_load(VALUE self, VALUE a)
if (RARRAY_LEN(a) == 2) {
- ajd = f_sub(RARRAY_PTR(a)[0], half_days_in_day);
+ ajd = f_sub(RARRAY_AREF(a, 0), half_days_in_day);
of = INT2FIX(0);
- sg = RARRAY_PTR(a)[1];
+ sg = RARRAY_AREF(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];
+ ajd = RARRAY_AREF(a, 0);
+ of = RARRAY_AREF(a, 1);
+ sg = RARRAY_AREF(a, 2);
}
old_to_new(ajd, of, sg,
&nth, &jd, &df, &sf, &rof, &rsg);
if (!df && f_zero_p(sf) && !rof) {
- set_to_simple(&dat->s, nth, jd, rsg, 0, 0, 0, HAVE_JD);
+ set_to_simple(self, &dat->s, nth, jd, rsg, 0, 0, 0, HAVE_JD);
} else {
if (!complex_dat_p(dat))
rb_raise(rb_eArgError,
"cannot load complex into simple");
- set_to_complex(&dat->c, nth, jd, df, sf, rof, rsg,
+ set_to_complex(self, &dat->c, nth, jd, df, sf, rof, rsg,
0, 0, 0, 0, 0, 0,
HAVE_JD | HAVE_DF | COMPLEX_DAT);
}
@@ -7115,20 +7124,20 @@ d_lite_marshal_load(VALUE self, VALUE a)
int jd, df, of;
double sg;
- nth = RARRAY_PTR(a)[0];
- jd = NUM2INT(RARRAY_PTR(a)[1]);
- df = NUM2INT(RARRAY_PTR(a)[2]);
- sf = RARRAY_PTR(a)[3];
- of = NUM2INT(RARRAY_PTR(a)[4]);
- sg = NUM2DBL(RARRAY_PTR(a)[5]);
+ nth = RARRAY_AREF(a, 0);
+ jd = NUM2INT(RARRAY_AREF(a, 1));
+ df = NUM2INT(RARRAY_AREF(a, 2));
+ sf = RARRAY_AREF(a, 3);
+ of = NUM2INT(RARRAY_AREF(a, 4));
+ sg = NUM2DBL(RARRAY_AREF(a, 5));
if (!df && f_zero_p(sf) && !of) {
- set_to_simple(&dat->s, nth, jd, sg, 0, 0, 0, HAVE_JD);
+ set_to_simple(self, &dat->s, nth, jd, sg, 0, 0, 0, HAVE_JD);
} else {
if (!complex_dat_p(dat))
rb_raise(rb_eArgError,
"cannot load complex into simple");
- set_to_complex(&dat->c, nth, jd, df, sf, of, sg,
+ set_to_complex(self, &dat->c, nth, jd, df, sf, of, sg,
0, 0, 0, 0, 0, 0,
HAVE_JD | HAVE_DF | COMPLEX_DAT);
}
@@ -8209,7 +8218,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 or something similar information.
+ * %Z - Equivalent to %:z (e.g. +09:00)
*
* Weekday:
* %A - The full weekday name (``Sunday'')
@@ -8554,7 +8563,7 @@ date_to_datetime(VALUE self)
get_d1b(new);
bdat->c = adat->c;
bdat->c.df = 0;
- bdat->c.sf = INT2FIX(0);
+ RB_OBJ_WRITE(new, &bdat->c.sf, INT2FIX(0));
#ifndef USE_PACK
bdat->c.hour = 0;
bdat->c.min = 0;
@@ -8620,7 +8629,7 @@ datetime_to_date(VALUE self)
VALUE new = d_lite_s_alloc_simple(cDate);
{
get_d1b(new);
- copy_complex_to_simple(&bdat->s, &adat->c)
+ copy_complex_to_simple(new, &bdat->s, &adat->c)
bdat->s.jd = m_local_jd(adat);
bdat->s.flags &= ~(HAVE_DF | HAVE_TIME | COMPLEX_DAT);
return new;
@@ -9048,7 +9057,7 @@ Init_date_core(void)
* The calendar week is a seven day period within a calendar year,
* starting on a Monday and identified by its ordinal number within
* the year; the first calendar week of the year is the one that
- * includes the first Thursday of that year. In the Gregorian
+ * includes the first Thursday of that year. In the Gregorian
* calendar, this is equivalent to the week which includes January 4.
*
* In those classes, this so-called "commercial".
@@ -9059,8 +9068,8 @@ Init_date_core(void)
* time) on January 1, 4713 BCE (in the Julian calendar).
*
* In this document, the astronomical Julian day number is same as the
- * original Julian day number. And the chronological Julian day
- * number is a variation of the Julian day number. Its days begin at
+ * original Julian day number. And the chronological Julian day
+ * number is a variation of the Julian day number. Its days begin at
* midnight on local time.
*
* In this document, when the term "Julian day number" simply appears,
@@ -9076,9 +9085,9 @@ Init_date_core(void)
* Gregorian calendar).
*
* In this document, the astronomical modified Julian day number is
- * same as the original modified Julian day number. And the
+ * same as the original modified Julian day number. And the
* chronological modified Julian day number is a variation of the
- * modified Julian day number. Its days begin at midnight on local
+ * modified Julian day number. Its days begin at midnight on local
* time.
*
* In this document, when the term "modified Julian day number" simply
@@ -9087,10 +9096,9 @@ Init_date_core(void)
*
* In those classes, this is so-called "mjd".
*
- *
* == Date
*
- * A subclass of Object includes Comparable module, easily handles
+ * A subclass of Object that includes Comparable module and easily handles
* date.
*
* Date object is created with Date::new, Date::jd, Date::ordinal,
@@ -9099,14 +9107,20 @@ Init_date_core(void)
*
* require 'date'
*
- * Date.new(2001,2,3) #=> #<Date: 2001-02-03 ...>
- * Date.jd(2451944) #=> #<Date: 2001-02-03 ...>
- * Date.ordinal(2001,34) #=> #<Date: 2001-02-03 ...>
- * Date.commercial(2001,5,6) #=> #<Date: 2001-02-03 ...>
- * Date.parse('2001-02-03') #=> #<Date: 2001-02-03 ...>
+ * Date.new(2001,2,3)
+ * #=> #<Date: 2001-02-03 ...>
+ * Date.jd(2451944)
+ * #=> #<Date: 2001-02-03 ...>
+ * Date.ordinal(2001,34)
+ * #=> #<Date: 2001-02-03 ...>
+ * Date.commercial(2001,5,6)
+ * #=> #<Date: 2001-02-03 ...>
+ * Date.parse('2001-02-03')
+ * #=> #<Date: 2001-02-03 ...>
* Date.strptime('03-02-2001', '%d-%m-%Y')
- * #=> #<Date: 2001-02-03 ...>
- * Time.new(2001,2,3).to_date #=> #<Date: 2001-02-03 ...>
+ * #=> #<Date: 2001-02-03 ...>
+ * Time.new(2001,2,3).to_date
+ * #=> #<Date: 2001-02-03 ...>
*
* All date objects are immutable; hence cannot modify themselves.
*
@@ -9114,11 +9128,11 @@ Init_date_core(void)
* of the day count, the offset and the day of calendar reform.
*
* The day count denotes the absolute position of a temporal
- * dimension. The offset is relative adjustment, which determines
- * decoded local time with the day count. The day of calendar
- * reform denotes the start day of the new style. The old style
+ * dimension. The offset is relative adjustment, which determines
+ * decoded local time with the day count. The day of calendar
+ * reform denotes the start day of the new style. The old style
* of the West is the Julian calendar which was adopted by
- * Caersar. The new style is the Gregorian calendar, which is the
+ * Caesar. The new style is the Gregorian calendar, which is the
* current civil calendar of many countries.
*
* The day count is virtually the astronomical Julian day number.
@@ -9156,66 +9170,6 @@ Init_date_core(void)
* d += 1 #=> #<Date: 2001-02-04 ...>
* d.strftime('%a %d %b %Y') #=> "Sun 04 Feb 2001"
*
- *
- * == DateTime
- *
- * A subclass of Date easily handles date, hour, minute, second and
- * offset.
- *
- * DateTime does not consider any leapseconds, does not track
- * any summer time rules.
- *
- * DateTime object is created with DateTime::new, DateTime::jd,
- * DateTime::ordinal, DateTime::commercial, DateTime::parse,
- * DateTime::strptime, DateTime::now, Time#to_datetime or etc.
- *
- * require 'date'
- *
- * DateTime.new(2001,2,3,4,5,6)
- * #=> #<DateTime: 2001-02-03T04:05:06+00:00 ...>
- *
- * The last element of day, hour, minute or senond can be
- * fractional number. The fractional number's precision is assumed
- * at most nanosecond.
- *
- * DateTime.new(2001,2,3.5)
- * #=> #<DateTime: 2001-02-03T12:00:00+00:00 ...>
- *
- * An optional argument the offset indicates the difference
- * between the local time and UTC. For example, Rational(3,24)
- * represents ahead of 3 hours of UTC, Rational(-5,24) represents
- * behind of 5 hours of UTC. The offset should be -1 to +1, and
- * its precision is assumed at most second. The default value is
- * zero (equals to UTC).
- *
- * DateTime.new(2001,2,3,4,5,6,Rational(3,24))
- * #=> #<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-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
- * -/+oo. The default value is Date::ITALY (2299161=1582-10-15).
- *
- * DateTime object has various methods. See each reference.
- *
- * d = DateTime.parse('3rd Feb 2001 04:05:06+03:30')
- * #=> #<DateTime: 2001-02-03T04:05:06+03:30 ...>
- * d.hour #=> 4
- * d.min #=> 5
- * d.sec #=> 6
- * d.offset #=> (7/48)
- * d.zone #=> "+03:30"
- * d += Rational('1.5')
- * #=> #<DateTime: 2001-02-04%16:05:06+03:30 ...>
- * d = d.new_offset('+09:00')
- * #=> #<DateTime: 2001-02-04%21:35:06+09:00 ...>
- * d.strftime('%I:%M:%S %p')
- * #=> "09:35:06 PM"
- * d > DateTime.new(1999)
- * #=> true
*/
cDate = rb_define_class("Date", rb_cObject);
@@ -9463,7 +9417,144 @@ Init_date_core(void)
rb_define_method(cDate, "marshal_load", d_lite_marshal_load, 1);
rb_define_singleton_method(cDate, "_load", date_s__load, 1);
- /* datetime */
+ /*
+ * == DateTime
+ *
+ * A subclass of Date that easily handles date, hour, minute, second and
+ * offset.
+ *
+ * DateTime does not consider any leap seconds, does not track
+ * any summer time rules.
+ *
+ * DateTime object is created with DateTime::new, DateTime::jd,
+ * DateTime::ordinal, DateTime::commercial, DateTime::parse,
+ * DateTime::strptime, DateTime::now, Time#to_datetime or etc.
+ *
+ * require 'date'
+ *
+ * DateTime.new(2001,2,3,4,5,6)
+ * #=> #<DateTime: 2001-02-03T04:05:06+00:00 ...>
+ *
+ * The last element of day, hour, minute or second can be
+ * fractional number. The fractional number's precision is assumed
+ * at most nanosecond.
+ *
+ * DateTime.new(2001,2,3.5)
+ * #=> #<DateTime: 2001-02-03T12:00:00+00:00 ...>
+ *
+ * An optional argument the offset indicates the difference
+ * between the local time and UTC. For example, <tt>Rational(3,24)</tt>
+ * represents ahead of 3 hours of UTC, <tt>Rational(-5,24)</tt> represents
+ * behind of 5 hours of UTC. The offset should be -1 to +1, and
+ * its precision is assumed at most second. The default value is
+ * zero(equals to UTC).
+ *
+ * DateTime.new(2001,2,3,4,5,6,Rational(3,24))
+ * #=> #<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-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
+ * -/+oo. The default value is +Date::ITALY+ (2299161=1582-10-15).
+ *
+ * DateTime object has various methods. See each reference.
+ *
+ * d = DateTime.parse('3rd Feb 2001 04:05:06+03:30')
+ * #=> #<DateTime: 2001-02-03T04:05:06+03:30 ...>
+ * d.hour #=> 4
+ * d.min #=> 5
+ * d.sec #=> 6
+ * d.offset #=> (7/48)
+ * d.zone #=> "+03:30"
+ * d += Rational('1.5')
+ * #=> #<DateTime: 2001-02-04%16:05:06+03:30 ...>
+ * d = d.new_offset('+09:00')
+ * #=> #<DateTime: 2001-02-04%21:35:06+09:00 ...>
+ * d.strftime('%I:%M:%S %p')
+ * #=> "09:35:06 PM"
+ * d > DateTime.new(1999)
+ * #=> true
+ *
+ * === When should you use DateTime and when should you use Time?
+ *
+ * It's a common misconception that
+ * {William Shakespeare}[http://en.wikipedia.org/wiki/William_Shakespeare]
+ * and
+ * {Miguel de Cervantes}[http://en.wikipedia.org/wiki/Miguel_de_Cervantes]
+ * died on the same day in history -
+ * so much so that UNESCO named April 23 as
+ * {World Book Day because of this fact}[http://en.wikipedia.org/wiki/World_Book_Day].
+ * However because England hadn't yet adopted
+ * {Gregorian Calendar Reform}[http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform]
+ * (and wouldn't until {1752}[http://en.wikipedia.org/wiki/Calendar_(New_Style)_Act_1750])
+ * their deaths are actually 10 days apart.
+ * Since Ruby's Time class implements a
+ * {proleptic Gregorian calendar}[http://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar]
+ * and has no concept of calendar reform then there's no way
+ * to express this. This is where DateTime steps in:
+ *
+ * shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
+ * #=> Tue, 23 Apr 1616 00:00:00 +0000
+ * cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
+ * #=> Sat, 23 Apr 1616 00:00:00 +0000
+ *
+ * Already you can see something's weird - the days of the week
+ * are different, taking this further:
+ *
+ * cervantes == shakespeare
+ * #=> false
+ * (shakespeare - cervantes).to_i
+ * #=> 10
+ *
+ * This shows that in fact they died 10 days apart (in reality
+ * 11 days since Cervantes died a day earlier but was buried on
+ * the 23rd). We can see the actual date of Shakespeare's death by
+ * using the #gregorian method to convert it:
+ *
+ * shakespeare.gregorian
+ * #=> Tue, 03 May 1616 00:00:00 +0000
+ *
+ * So there's an argument that all the celebrations that take
+ * place on the 23rd April in Stratford-upon-Avon are actually
+ * the wrong date since England is now using the Gregorian calendar.
+ * You can see why when we transition across the reform
+ * date boundary:
+ *
+ * # start off with the anniversary of Shakespeare's birth in 1751
+ * shakespeare = DateTime.iso8601('1751-04-23', Date::ENGLAND)
+ * #=> Tue, 23 Apr 1751 00:00:00 +0000
+ *
+ * # add 366 days since 1752 is a leap year and April 23 is after February 29
+ * shakespeare + 366
+ * #=> Thu, 23 Apr 1752 00:00:00 +0000
+ *
+ * # add another 365 days to take us to the anniversary in 1753
+ * shakespeare + 366 + 365
+ * #=> Fri, 04 May 1753 00:00:00 +0000
+ *
+ * As you can see, if we're accurately tracking the number of
+ * {solar years}[http://en.wikipedia.org/wiki/Tropical_year]
+ * since Shakespeare's birthday then the correct anniversary date
+ * would be the 4th May and not the 23rd April.
+ *
+ * So when should you use DateTime in Ruby and when should
+ * you use Time? Almost certainly you'll want to use Time
+ * since your app is probably dealing with current dates and
+ * times. However, if you need to deal with dates and times in a
+ * historical context you'll want to use DateTime to avoid
+ * making the same mistakes as UNESCO. If you also have to deal
+ * with timezones then best of luck - just bear in mind that
+ * you'll probably be dealing with
+ * {local solar times}[http://en.wikipedia.org/wiki/Solar_time],
+ * since it wasn't until the 19th century that the introduction
+ * of the railways necessitated the need for
+ * {Standard Time}[http://en.wikipedia.org/wiki/Standard_time#Great_Britain]
+ * and eventually timezones.
+ */
cDateTime = rb_define_class("DateTime", cDate);
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 3003b45239..17ce460877 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -68,9 +68,10 @@ static const char *abbr_months[] = {
static void
s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
+ VALUE vbuf = 0;
VALUE c = Qnil;
- if (TYPE(m) != T_STRING)
+ if (!RB_TYPE_P(m, T_STRING))
m = f_to_s(m);
if (!NIL_P(y) && !NIL_P(m) && NIL_P(d)) {
@@ -164,10 +165,11 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
char *buf;
- buf = ALLOCA_N(char, ep - bp + 1);
+ buf = ALLOCV_N(char, vbuf, ep - bp + 1);
memcpy(buf, bp, ep - bp);
buf[ep - bp] = '\0';
iy = cstr2num(buf);
+ ALLOCV_END(vbuf);
}
set_hash("year", iy);
}
@@ -189,10 +191,11 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
char *buf;
- buf = ALLOCA_N(char, ep - bp + 1);
+ buf = ALLOCV_N(char, vbuf, ep - bp + 1);
memcpy(buf, bp, ep - bp);
buf[ep - bp] = '\0';
im = cstr2num(buf);
+ ALLOCV_END(vbuf);
}
set_hash("mon", im);
}
@@ -211,10 +214,11 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
char *buf;
- buf = ALLOCA_N(char, ep - bp + 1);
+ buf = ALLOCV_N(char, vbuf, ep - bp + 1);
memcpy(buf, bp, ep - bp);
buf[ep - bp] = '\0';
id = cstr2num(buf);
+ ALLOCV_END(vbuf);
}
set_hash("mday", id);
}
@@ -420,6 +424,7 @@ VALUE
date_zone_to_diff(VALUE str)
{
VALUE offset = Qnil;
+ VALUE vbuf = 0;
long l, i;
char *s, *dest, *d;
@@ -428,7 +433,7 @@ date_zone_to_diff(VALUE str)
l = RSTRING_LEN(str);
s = RSTRING_PTR(str);
- dest = d = ALLOCA_N(char, l + 1);
+ dest = d = ALLOCV_N(char, vbuf, l + 1);
for (i = 0; i < l; i++) {
if (isspace((unsigned char)s[i]) || s[i] == '\0') {
@@ -525,13 +530,13 @@ date_zone_to_diff(VALUE str)
str = rb_str_new2(s);
- if (p = strchr(s, ':')) {
+ if ((p = strchr(s, ':')) != NULL) {
hour = rb_str_new(s, p - s);
s = ++p;
- if (p = strchr(s, ':')) {
+ if ((p = strchr(s, ':')) != NULL) {
min = rb_str_new(s, p - s);
s = ++p;
- if (p = strchr(s, ':')) {
+ if ((p = strchr(s, ':')) != NULL) {
sec = rb_str_new(s, p - s);
}
else
@@ -543,9 +548,10 @@ date_zone_to_diff(VALUE str)
goto num;
}
if (strpbrk(RSTRING_PTR(str), ",.")) {
+ VALUE astr = 0;
char *a, *b;
- a = ALLOCA_N(char, RSTRING_LEN(str) + 1);
+ a = ALLOCV_N(char, astr, RSTRING_LEN(str) + 1);
strcpy(a, RSTRING_PTR(str));
b = strpbrk(a, ",.");
*b = '\0';
@@ -557,6 +563,7 @@ date_zone_to_diff(VALUE str)
f_expt(INT2FIX(10),
LONG2NUM((long)strlen(b)))),
INT2FIX(60));
+ ALLOCV_END(astr);
goto num;
}
{
@@ -585,12 +592,12 @@ date_zone_to_diff(VALUE str)
if (NIL_P(hour))
offset = INT2FIX(0);
else {
- if (TYPE(hour) == T_STRING)
+ if (RB_TYPE_P(hour, T_STRING))
hour = str2num(hour);
offset = f_mul(hour, INT2FIX(3600));
}
if (!NIL_P(min)) {
- if (TYPE(min) == T_STRING)
+ if (RB_TYPE_P(min, T_STRING))
min = str2num(min);
offset = f_add(offset, f_mul(min, INT2FIX(60)));
}
@@ -605,6 +612,7 @@ date_zone_to_diff(VALUE str)
}
RB_GC_GUARD(str);
ok:
+ ALLOCV_END(vbuf);
return offset;
}
@@ -1975,7 +1983,8 @@ parse_ddd_cb(VALUE m, VALUE hash)
set_hash("zone", s5);
if (*cs5 == '[') {
- char *buf = ALLOCA_N(char, l5 + 1);
+ VALUE vbuf = 0;
+ char *buf = ALLOCV_N(char, vbuf, l5 + 1);
char *s1, *s2, *s3;
VALUE zone;
@@ -1997,6 +2006,7 @@ parse_ddd_cb(VALUE m, VALUE hash)
if (isdigit((unsigned char)*s1))
*--s1 = '+';
set_hash("offset", date_zone_to_diff(rb_str_new2(s1)));
+ ALLOCV_END(vbuf);
}
RB_GC_GUARD(s5);
}
diff --git a/ext/date/date_strftime.c b/ext/date/date_strftime.c
index 20931a3124..9d8167b612 100644
--- a/ext/date/date_strftime.c
+++ b/ext/date/date_strftime.c
@@ -48,7 +48,7 @@ downcase(char *s, size_t i)
/* strftime --- produce formatted time */
static size_t
-date_strftime_with_tmx(char *s, size_t maxsize, const char *format,
+date_strftime_with_tmx(char *s, const size_t maxsize, const char *format,
const struct tmx *tmx)
{
char *endp = s + maxsize;
@@ -575,7 +575,12 @@ date_strftime_with_tmx(char *s, size_t maxsize, const char *format,
case '5': case '6': case '7': case '8': case '9':
{
char *e;
- precision = (int)strtoul(format, &e, 10);
+ unsigned long prec = strtoul(format, &e, 10);
+ if (prec > INT_MAX || prec > maxsize) {
+ errno = ERANGE;
+ return 0;
+ }
+ precision = (int)prec;
format = e - 1;
goto again;
}
diff --git a/ext/date/date_strptime.c b/ext/date/date_strptime.c
index 3e1b0f85ea..4f93219317 100644
--- a/ext/date/date_strptime.c
+++ b/ext/date/date_strptime.c
@@ -103,10 +103,12 @@ read_digits(const char *s, VALUE *n, size_t width)
return l;
}
else {
- char *s2 = ALLOCA_N(char, l + 1);
+ VALUE vbuf = 0;
+ char *s2 = ALLOCV_N(char, vbuf, l + 1);
memcpy(s2, s, l);
s2[l] = '\0';
*n = rb_cstr_to_inum(s2, 10, 0);
+ ALLOCV_END(vbuf);
return l;
}
}
@@ -291,8 +293,9 @@ date__strptime_internal(const char *str, size_t slen,
if (!valid_range_p(n, 0, 99))
fail();
set_hash("cwyear",n);
- set_hash("_cent",
- INT2FIX(f_ge_p(n, INT2FIX(69)) ? 19 : 20));
+ if (NIL_P(ref_hash("_cent")))
+ set_hash("_cent",
+ INT2FIX(f_ge_p(n, INT2FIX(69)) ? 19 : 20));
goto matched;
}
@@ -556,8 +559,9 @@ date__strptime_internal(const char *str, size_t slen,
if (sign == -1)
n = f_negate(n);
set_hash("year", n);
- set_hash("_cent",
- INT2FIX(f_ge_p(n, INT2FIX(69)) ? 19 : 20));
+ if (NIL_P(ref_hash("_cent")))
+ set_hash("_cent",
+ INT2FIX(f_ge_p(n, INT2FIX(69)) ? 19 : 20));
goto matched;
}
diff --git a/ext/date/depend b/ext/date/depend
index 3a13fcc9a9..a5444e3ed9 100644
--- a/ext/date/depend
+++ b/ext/date/depend
@@ -1,7 +1,53 @@
-$(OBJS): $(ruby_headers)
-date_core.o: date_tmx.h $(hdrdir)/ruby/encoding.h $(hdrdir)/ruby/oniguruma.h
+# AUTOGENERATED DEPENDENCIES START
+date_core.o: $(RUBY_EXTCONF_H)
+date_core.o: $(arch_hdrdir)/ruby/config.h
+date_core.o: $(hdrdir)/ruby/defines.h
+date_core.o: $(hdrdir)/ruby/encoding.h
+date_core.o: $(hdrdir)/ruby/intern.h
+date_core.o: $(hdrdir)/ruby/missing.h
+date_core.o: $(hdrdir)/ruby/oniguruma.h
+date_core.o: $(hdrdir)/ruby/ruby.h
+date_core.o: $(hdrdir)/ruby/st.h
+date_core.o: $(hdrdir)/ruby/subst.h
+date_core.o: $(top_srcdir)/include/ruby.h
+date_core.o: date_core.c
+date_core.o: date_tmx.h
+date_parse.o: $(RUBY_EXTCONF_H)
+date_parse.o: $(arch_hdrdir)/ruby/config.h
+date_parse.o: $(hdrdir)/ruby/defines.h
+date_parse.o: $(hdrdir)/ruby/encoding.h
+date_parse.o: $(hdrdir)/ruby/intern.h
+date_parse.o: $(hdrdir)/ruby/missing.h
+date_parse.o: $(hdrdir)/ruby/oniguruma.h
+date_parse.o: $(hdrdir)/ruby/re.h
+date_parse.o: $(hdrdir)/ruby/regex.h
+date_parse.o: $(hdrdir)/ruby/ruby.h
+date_parse.o: $(hdrdir)/ruby/st.h
+date_parse.o: $(hdrdir)/ruby/subst.h
+date_parse.o: $(top_srcdir)/include/ruby.h
+date_parse.o: date_parse.c
+date_strftime.o: $(RUBY_EXTCONF_H)
+date_strftime.o: $(arch_hdrdir)/ruby/config.h
+date_strftime.o: $(hdrdir)/ruby/defines.h
+date_strftime.o: $(hdrdir)/ruby/intern.h
+date_strftime.o: $(hdrdir)/ruby/missing.h
+date_strftime.o: $(hdrdir)/ruby/ruby.h
+date_strftime.o: $(hdrdir)/ruby/st.h
+date_strftime.o: $(hdrdir)/ruby/subst.h
+date_strftime.o: date_strftime.c
date_strftime.o: date_tmx.h
-date_parse.o: $(hdrdir)/ruby/encoding.h $(hdrdir)/ruby/oniguruma.h $(hdrdir)/ruby/re.h $(hdrdir)/ruby/regex.h
-date_strptime.o: $(hdrdir)/ruby/encoding.h $(hdrdir)/ruby/oniguruma.h $(hdrdir)/ruby/re.h $(hdrdir)/ruby/regex.h
-
-
+date_strptime.o: $(RUBY_EXTCONF_H)
+date_strptime.o: $(arch_hdrdir)/ruby/config.h
+date_strptime.o: $(hdrdir)/ruby/defines.h
+date_strptime.o: $(hdrdir)/ruby/encoding.h
+date_strptime.o: $(hdrdir)/ruby/intern.h
+date_strptime.o: $(hdrdir)/ruby/missing.h
+date_strptime.o: $(hdrdir)/ruby/oniguruma.h
+date_strptime.o: $(hdrdir)/ruby/re.h
+date_strptime.o: $(hdrdir)/ruby/regex.h
+date_strptime.o: $(hdrdir)/ruby/ruby.h
+date_strptime.o: $(hdrdir)/ruby/st.h
+date_strptime.o: $(hdrdir)/ruby/subst.h
+date_strptime.o: $(top_srcdir)/include/ruby.h
+date_strptime.o: date_strptime.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb
index 9f7d3e8f0b..e8596952de 100644
--- a/ext/date/extconf.rb
+++ b/ext/date/extconf.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
+config_string("strict_warnflags") {|w| $warnflags += " #{w}"}
create_makefile('date_core')
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb
index d235d76e6f..48ce6316bd 100644
--- a/ext/date/lib/date.rb
+++ b/ext/date/lib/date.rb
@@ -1,7 +1,7 @@
+# frozen_string_literal: false
# date.rb: Written by Tadayoshi Funaba 1998-2011
require 'date_core'
-require 'date/format'
class Date
@@ -30,11 +30,11 @@ class Date
when Infinity; return d <=> other.d
when Numeric; return d
else
- begin
- l, r = other.coerce(self)
- return l <=> r
- rescue NoMethodError
- end
+ begin
+ l, r = other.coerce(self)
+ return l <=> r
+ rescue NoMethodError
+ end
end
nil
end
@@ -43,16 +43,16 @@ class Date
case other
when Numeric; return -d, d
else
- super
+ super
end
end
def to_f
return 0 if @d == 0
if @d > 0
- Float::INFINITY
+ Float::INFINITY
else
- -Float::INFINITY
+ -Float::INFINITY
end
end
diff --git a/ext/date/lib/date/format.rb b/ext/date/lib/date/format.rb
deleted file mode 100644
index 892e7aacaa..0000000000
--- a/ext/date/lib/date/format.rb
+++ /dev/null
@@ -1 +0,0 @@
-# format.rb: Written by Tadayoshi Funaba 1999-2011
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 1fdbaa0aca..7f9d96e3fd 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -45,26 +45,46 @@ closed_dbm(void)
rb_raise(rb_eDBMError, "closed DBM file");
}
-#define GetDBM(obj, dbmp) {\
- Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+#define GetDBM(obj, dbmp) do {\
+ TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
if ((dbmp) == 0) closed_dbm();\
if ((dbmp)->di_dbm == 0) closed_dbm();\
-}
+} while (0)
-#define GetDBM2(obj, data, dbm) {\
- GetDBM((obj), (data));\
- (dbm) = dbmp->di_dbm;\
-}
+#define GetDBM2(obj, dbmp, dbm) do {\
+ GetDBM((obj), (dbmp));\
+ (dbm) = (dbmp)->di_dbm;\
+} while (0)
static void
-free_dbm(struct dbmdata *dbmp)
+free_dbm(void *ptr)
{
+ struct dbmdata *dbmp = ptr;
if (dbmp) {
if (dbmp->di_dbm) dbm_close(dbmp->di_dbm);
xfree(dbmp);
}
}
+static size_t
+memsize_dbm(const void *ptr)
+{
+ size_t size = 0;
+ const struct dbmdata *dbmp = ptr;
+ if (dbmp) {
+ size += sizeof(*dbmp);
+ if (dbmp->di_dbm) size += DBM_SIZEOF_DBM;
+ }
+ return size;
+}
+
+static const rb_data_type_t dbm_type = {
+ "dbm",
+ {0, free_dbm, memsize_dbm,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* call-seq:
* dbm.close
@@ -94,7 +114,7 @@ fdbm_closed(VALUE obj)
{
struct dbmdata *dbmp;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
+ TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
if (dbmp == 0)
return Qtrue;
if (dbmp->di_dbm == 0)
@@ -106,7 +126,7 @@ fdbm_closed(VALUE obj)
static VALUE
fdbm_alloc(VALUE klass)
{
- return Data_Wrap_Struct(klass, 0, free_dbm, 0);
+ return TypedData_Wrap_Struct(klass, &dbm_type, 0);
}
/*
@@ -228,7 +248,7 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
static VALUE
fdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0);
+ VALUE obj = fdbm_alloc(klass);
if (NIL_P(fdbm_initialize(argc, argv, obj))) {
return Qnil;
@@ -259,8 +279,11 @@ fdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
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));
+ if (NIL_P(ifnone) && rb_block_given_p()) {
+ keystr = rb_str_dup(keystr);
+ OBJ_TAINT(keystr);
+ return rb_yield(keystr);
+ }
return ifnone;
}
return rb_tainted_str_new(value.dptr, value.dsize);
@@ -485,8 +508,8 @@ fdbm_delete_if(VALUE obj)
DBM *dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_tmp_new(0);
- int i, status = 0;
- long n;
+ int status = 0;
+ long i, n;
fdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
@@ -505,7 +528,7 @@ fdbm_delete_if(VALUE obj)
}
for (i = 0; i < RARRAY_LEN(ary); i++) {
- keystr = RARRAY_PTR(ary)[i];
+ keystr = RARRAY_AREF(ary, i);
key.dptr = RSTRING_PTR(keystr);
key.dsize = (DSIZE_TYPE)RSTRING_LEN(keystr);
if (dbm_delete(dbm, key)) {
@@ -576,11 +599,13 @@ static VALUE fdbm_store(VALUE,VALUE,VALUE);
static VALUE
update_i(RB_BLOCK_CALL_FUNC_ARGLIST(pair, dbm))
{
+ const VALUE *ptr;
Check_Type(pair, T_ARRAY);
if (RARRAY_LEN(pair) < 2) {
rb_raise(rb_eArgError, "pair must be [key, value]");
}
- fdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
+ ptr = RARRAY_CONST_PTR(pair);
+ fdbm_store(dbm, ptr[0], ptr[1]);
return Qnil;
}
@@ -1011,7 +1036,7 @@ fdbm_reject(VALUE obj)
* == Example
*
* require 'dbm'
- * db = DBM.open('rfcs', 666, DBM::WRCREAT)
+ * db = DBM.open('rfcs', 0666, DBM::WRCREAT)
* db['822'] = 'Standard for the Format of ARPA Internet Text Messages'
* db['1123'] = 'Requirements for Internet Hosts - Application and Support'
* db['3068'] = 'An Anycast Prefix for 6to4 Relay Routers'
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 68070c9970..04f751d776 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# configure option:
# --with-dbm-type=COMMA-SEPARATED-NDBM-TYPES
#
@@ -267,6 +268,23 @@ if dblib.any? {|db| headers.fetch(db, ["ndbm.h"]).any? {|hdr| headers.db_check(d
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)
+ checking_for("sizeof(DBM) is available") {
+ if try_compile(<<SRC)
+#ifdef HAVE_CDEFS_H
+# include <cdefs.h>
+#endif
+#ifdef HAVE_SYS_CDEFS_H
+# include <sys/cdefs.h>
+#endif
+#include DBM_HDR
+
+const int sizeof_DBM = (int)sizeof(DBM);
+SRC
+ $defs << '-DDBM_SIZEOF_DBM=sizeof(DBM)'
+ else
+ $defs << '-DDBM_SIZEOF_DBM=0'
+ end
+ }
create_makefile("dbm")
end
# :startdoc:
diff --git a/ext/digest/bubblebabble/bubblebabble.c b/ext/digest/bubblebabble/bubblebabble.c
index 4bccd221b8..4b8263de5a 100644
--- a/ext/digest/bubblebabble/bubblebabble.c
+++ b/ext/digest/bubblebabble/bubblebabble.c
@@ -11,8 +11,8 @@
************************************************/
-#include "ruby.h"
-#include "digest.h"
+#include <ruby/ruby.h>
+#include "../digest.h"
static ID id_digest;
diff --git a/ext/digest/bubblebabble/depend b/ext/digest/bubblebabble/depend
index d13a156ce1..59c6d0ce74 100644
--- a/ext/digest/bubblebabble/depend
+++ b/ext/digest/bubblebabble/depend
@@ -1 +1,13 @@
-bubblebabble.o: bubblebabble.c $(srcdir)/../digest.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
+# AUTOGENERATED DEPENDENCIES START
+bubblebabble.o: $(RUBY_EXTCONF_H)
+bubblebabble.o: $(arch_hdrdir)/ruby/config.h
+bubblebabble.o: $(hdrdir)/ruby/defines.h
+bubblebabble.o: $(hdrdir)/ruby/intern.h
+bubblebabble.o: $(hdrdir)/ruby/missing.h
+bubblebabble.o: $(hdrdir)/ruby/ruby.h
+bubblebabble.o: $(hdrdir)/ruby/st.h
+bubblebabble.o: $(hdrdir)/ruby/subst.h
+bubblebabble.o: $(top_srcdir)/ext/digest/digest.h
+bubblebabble.o: $(top_srcdir)/include/ruby.h
+bubblebabble.o: bubblebabble.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/bubblebabble/extconf.rb b/ext/digest/bubblebabble/extconf.rb
index 53cb83934a..21feed57fb 100644
--- a/ext/digest/bubblebabble/extconf.rb
+++ b/ext/digest/bubblebabble/extconf.rb
@@ -1,6 +1,6 @@
+# frozen_string_literal: false
require 'mkmf'
$defs << "-DHAVE_CONFIG_H"
-$INCFLAGS << " -I$(srcdir)/.."
create_makefile('digest/bubblebabble')
diff --git a/ext/digest/depend b/ext/digest/depend
index 2fbc6d9adf..dbc2bba3cc 100644
--- a/ext/digest/depend
+++ b/ext/digest/depend
@@ -1 +1,13 @@
-digest.o: digest.c digest.h $(HDRS) $(ruby_headers)
+# AUTOGENERATED DEPENDENCIES START
+digest.o: $(RUBY_EXTCONF_H)
+digest.o: $(arch_hdrdir)/ruby/config.h
+digest.o: $(hdrdir)/ruby/defines.h
+digest.o: $(hdrdir)/ruby/intern.h
+digest.o: $(hdrdir)/ruby/missing.h
+digest.o: $(hdrdir)/ruby/ruby.h
+digest.o: $(hdrdir)/ruby/st.h
+digest.o: $(hdrdir)/ruby/subst.h
+digest.o: $(top_srcdir)/include/ruby.h
+digest.o: digest.c
+digest.o: digest.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index 527d0ed1fe..a02eb12cd6 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -124,6 +124,8 @@ hexencode_str_new(VALUE str_digest)
p[i + i + 1] = hex[byte & 0x0f];
}
+ RB_GC_GUARD(str_digest);
+
return str;
}
@@ -372,7 +374,8 @@ rb_digest_instance_equal(VALUE self, VALUE other)
str2 = rb_digest_instance_digest(0, 0, other);
} else {
str1 = rb_digest_instance_to_s(self);
- str2 = other;
+ str2 = rb_check_string_type(other);
+ if (NIL_P(str2)) return Qfalse;
}
/* never blindly assume that subclass methods return strings */
@@ -517,10 +520,12 @@ get_digest_base_metadata(VALUE klass)
if (NIL_P(p))
rb_raise(rb_eRuntimeError, "Digest::Base cannot be directly inherited in Ruby");
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
Data_Get_Struct(obj, rb_digest_metadata_t, algo);
switch (algo->api_version) {
- case 2:
+ case 3:
break;
/*
@@ -534,6 +539,21 @@ get_digest_base_metadata(VALUE klass)
return algo;
}
+static const rb_data_type_t digest_type = {
+ "digest",
+ {0, RUBY_TYPED_DEFAULT_FREE, 0,},
+ 0, 0,
+ (RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED),
+};
+
+static inline void
+algo_init(const rb_digest_metadata_t *algo, void *pctx)
+{
+ if (algo->init_func(pctx) != 1) {
+ rb_raise(rb_eRuntimeError, "Digest initialization failed.");
+ }
+}
+
static VALUE
rb_digest_base_alloc(VALUE klass)
{
@@ -547,10 +567,9 @@ rb_digest_base_alloc(VALUE klass)
algo = get_digest_base_metadata(klass);
- pctx = xmalloc(algo->ctx_size);
- algo->init_func(pctx);
-
- obj = Data_Wrap_Struct(klass, 0, xfree, pctx);
+ obj = rb_data_typed_object_zalloc(klass, algo->ctx_size, &digest_type);
+ pctx = RTYPEDDATA_DATA(obj);
+ algo_init(algo, pctx);
return obj;
}
@@ -567,9 +586,11 @@ rb_digest_base_copy(VALUE copy, VALUE obj)
rb_check_frozen(copy);
algo = get_digest_base_metadata(rb_obj_class(copy));
+ if (algo != get_digest_base_metadata(rb_obj_class(obj)))
+ rb_raise(rb_eTypeError, "different algorithms");
- Data_Get_Struct(obj, void, pctx1);
- Data_Get_Struct(copy, void, pctx2);
+ TypedData_Get_Struct(obj, void, &digest_type, pctx1);
+ TypedData_Get_Struct(copy, void, &digest_type, pctx2);
memcpy(pctx2, pctx1, algo->ctx_size);
return copy;
@@ -584,9 +605,9 @@ rb_digest_base_reset(VALUE self)
algo = get_digest_base_metadata(rb_obj_class(self));
- Data_Get_Struct(self, void, pctx);
+ TypedData_Get_Struct(self, void, &digest_type, pctx);
- algo->init_func(pctx);
+ algo_init(algo, pctx);
return self;
}
@@ -600,10 +621,11 @@ rb_digest_base_update(VALUE self, VALUE str)
algo = get_digest_base_metadata(rb_obj_class(self));
- Data_Get_Struct(self, void, pctx);
+ TypedData_Get_Struct(self, void, &digest_type, pctx);
StringValue(str);
algo->update_func(pctx, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str));
+ RB_GC_GUARD(str);
return self;
}
@@ -618,13 +640,13 @@ rb_digest_base_finish(VALUE self)
algo = get_digest_base_metadata(rb_obj_class(self));
- Data_Get_Struct(self, void, pctx);
+ TypedData_Get_Struct(self, void, &digest_type, pctx);
str = rb_str_new(0, algo->digest_len);
algo->finish_func(pctx, (unsigned char *)RSTRING_PTR(str));
/* avoid potential coredump caused by use of a finished context */
- algo->init_func(pctx);
+ algo_init(algo, pctx);
return str;
}
diff --git a/ext/digest/digest.h b/ext/digest/digest.h
index 6e4906c859..30359ad348 100644
--- a/ext/digest/digest.h
+++ b/ext/digest/digest.h
@@ -15,11 +15,11 @@
#include "ruby.h"
-#define RUBY_DIGEST_API_VERSION 2
+#define RUBY_DIGEST_API_VERSION 3
-typedef void (*rb_digest_hash_init_func_t)(void *);
+typedef int (*rb_digest_hash_init_func_t)(void *);
typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
-typedef void (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
+typedef int (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
typedef struct {
int api_version;
@@ -30,3 +30,22 @@ typedef struct {
rb_digest_hash_update_func_t update_func;
rb_digest_hash_finish_func_t finish_func;
} rb_digest_metadata_t;
+
+#define DEFINE_UPDATE_FUNC_FOR_UINT(name) \
+void \
+rb_digest_##name##_update(void *ctx, unsigned char *ptr, size_t size) \
+{ \
+ const unsigned int stride = 16384; \
+ \
+ for (; size > stride; size -= stride, ptr += stride) { \
+ name##_Update(ctx, ptr, stride); \
+ } \
+ if (size > 0) name##_Update(ctx, ptr, size); \
+}
+
+#define DEFINE_FINISH_FUNC_FROM_FINAL(name) \
+int \
+rb_digest_##name##_finish(void *ctx, unsigned char *ptr) \
+{ \
+ return name##_Final(ptr, ctx); \
+}
diff --git a/ext/digest/digest_conf.rb b/ext/digest/digest_conf.rb
new file mode 100644
index 0000000000..432652852f
--- /dev/null
+++ b/ext/digest/digest_conf.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: false
+def digest_conf(name, hdr = name, funcs = nil, types = nil)
+ unless with_config("bundled-#{name}")
+ cc = with_config("common-digest")
+ if cc == true or /\b#{name}\b/ =~ cc
+ if File.exist?("#$srcdir/#{name}cc.h") and
+ have_header("CommonCrypto/CommonDigest.h")
+ $defs << "-D#{name.upcase}_USE_COMMONDIGEST"
+ return :commondigest
+ end
+ end
+
+ dir_config("openssl")
+ pkg_config("openssl")
+ require File.expand_path('../../openssl/deprecation', __FILE__)
+ if have_library("crypto")
+ funcs ||= name.upcase
+ funcs = Array(funcs)
+ types ||= funcs
+ hdr = "openssl/#{hdr}.h"
+ if funcs.all? {|func| OpenSSL.check_func("#{func}_Transform", hdr)} &&
+ types.all? {|type| have_type("#{type}_CTX", hdr)}
+ $defs << "-D#{name.upcase}_USE_OPENSSL"
+ return :ossl
+ end
+ end
+ end
+ $objs << "#{name}.#{$OBJEXT}"
+ return
+end
diff --git a/ext/digest/extconf.rb b/ext/digest/extconf.rb
index a20ca8d68f..a8c68850a2 100644
--- a/ext/digest/extconf.rb
+++ b/ext/digest/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# $RoughId: extconf.rb,v 1.6 2001/07/13 15:38:27 knu Exp $
# $Id$
diff --git a/ext/digest/lib/digest.rb b/ext/digest/lib/digest.rb
index 5f7ebc2237..d6daf36f80 100644
--- a/ext/digest/lib/digest.rb
+++ b/ext/digest/lib/digest.rb
@@ -1,6 +1,10 @@
+# frozen_string_literal: false
require 'digest.so'
module Digest
+ # A mutex for Digest().
+ REQUIRE_MUTEX = Mutex.new
+
def self.const_missing(name) # :nodoc:
case name
when :SHA256, :SHA384, :SHA512
@@ -76,15 +80,30 @@ end
# call-seq:
# Digest(name) -> digest_subclass
#
-# Returns a Digest subclass by +name+.
+# Returns a Digest subclass by +name+ in a thread-safe manner even
+# when on-demand loading is involved.
#
# require 'digest'
#
# Digest("MD5")
# # => Digest::MD5
#
-# Digest("Foo")
+# Digest(:SHA256)
+# # => Digest::SHA256
+#
+# Digest(:Foo)
# # => LoadError: library not found for class Digest::Foo -- digest/foo
def Digest(name)
- Digest.const_get(name)
+ const = name.to_sym
+ Digest::REQUIRE_MUTEX.synchronize {
+ # Ignore autoload's because it is void when we have #const_missing
+ Digest.const_missing(const)
+ }
+rescue LoadError
+ # Constants do not necessarily rely on digest/*.
+ if Digest.const_defined?(const)
+ Digest.const_get(const)
+ else
+ raise
+ end
end
diff --git a/ext/digest/lib/digest/hmac.rb b/ext/digest/lib/digest/hmac.rb
deleted file mode 100644
index 3883badc45..0000000000
--- a/ext/digest/lib/digest/hmac.rb
+++ /dev/null
@@ -1,302 +0,0 @@
-# == License
-#
-# Copyright (c) 2006 Akinori MUSHA <knu@iDaemons.org>
-#
-# Documentation by Akinori MUSHA
-#
-# All rights reserved. You can redistribute and/or modify it under
-# the same terms as Ruby.
-#
-# $Id$
-#
-
-warn "use of the experimetal library 'digest/hmac' is discouraged; require 'openssl' and use OpenSSL::HMAC instead." if $VERBOSE
-
-require 'digest'
-
-module Digest
- # = digest/hmac.rb
- #
- # An experimental implementation of HMAC keyed-hashing algorithm
- #
- # == Overview
- #
- # CAUTION: Use of this library is discouraged, because this
- # implementation was meant to be experimental but somehow got into the
- # 1.9 series without being noticed. Please use OpenSSL::HMAC in the
- # "openssl" library instead.
- #
- # == Examples
- #
- # require 'digest/hmac'
- #
- # # one-liner example
- # puts Digest::HMAC.hexdigest("data", "hash key", Digest::SHA1)
- #
- # # rather longer one
- # hmac = Digest::HMAC.new("foo", Digest::RMD160)
- #
- # buf = ""
- # while stream.read(16384, buf)
- # hmac.update(buf)
- # end
- #
- # puts hmac.hexdigest
- #
- class HMAC < Digest::Class
-
- # Creates a Digest::HMAC instance.
-
- def initialize(key, digester)
- @md = digester.new
-
- block_len = @md.block_length
-
- if key.bytesize > block_len
- key = @md.digest(key)
- end
-
- ipad = Array.new(block_len, 0x36)
- opad = Array.new(block_len, 0x5c)
-
- key.bytes.each_with_index { |c, i|
- ipad[i] ^= c
- opad[i] ^= c
- }
-
- @key = key.freeze
- @ipad = ipad.pack('C*').freeze
- @opad = opad.pack('C*').freeze
- @md.update(@ipad)
- end
-
- def initialize_copy(other) # :nodoc:
- @md = other.instance_eval { @md.clone }
- end
-
- # call-seq:
- # hmac.update(string) -> hmac
- # hmac << string -> hmac
- #
- # Updates the hmac using a given +string+ and returns self.
- def update(text)
- @md.update(text)
- self
- end
- alias << update
-
- # call-seq:
- # hmac.reset -> hmac
- #
- # Resets the hmac to the initial state and returns self.
- def reset
- @md.reset
- @md.update(@ipad)
- self
- end
-
- def finish # :nodoc:
- d = @md.digest!
- @md.update(@opad)
- @md.update(d)
- @md.digest!
- end
- private :finish
-
- # call-seq:
- # hmac.digest_length -> Integer
- #
- # Returns the length in bytes of the hash value of the digest.
- def digest_length
- @md.digest_length
- end
-
- # call-seq:
- # hmac.block_length -> Integer
- #
- # Returns the block length in bytes of the hmac.
- def block_length
- @md.block_length
- end
-
- # call-seq:
- # hmac.inspect -> string
- #
- # Creates a printable version of the hmac object.
- def inspect
- sprintf('#<%s: key=%s, digest=%s>', self.class.name, @key.inspect, @md.inspect.sub(/^\#<(.*)>$/) { $1 });
- end
- end
-end
-
-if $0 == __FILE__
- eval DATA.gets(nil), nil, $0, DATA.lineno
-end
-
-__END__
-
-require 'test/unit'
-
-module TM_HMAC
- def test_s_hexdigest
- cases.each { |h|
- digesters.each { |d|
- assert_equal(h[:hexdigest], Digest::HMAC.hexdigest(h[:data], h[:key], d))
- }
- }
- end
-
- def test_hexdigest
- cases.each { |h|
- digesters.each { |d|
- hmac = Digest::HMAC.new(h[:key], d)
-
- hmac.update(h[:data])
-
- assert_equal(h[:hexdigest], hmac.hexdigest)
- }
- }
- end
-
- def test_reset
- cases.each { |h|
- digesters.each { |d|
- hmac = Digest::HMAC.new(h[:key], d)
- hmac.update("test")
- hmac.reset
- hmac.update(h[:data])
-
- assert_equal(h[:hexdigest], hmac.hexdigest)
- }
- }
- end
-end
-
-class TC_HMAC_MD5 < Test::Unit::TestCase
- include TM_HMAC
-
- def digesters
- [Digest::MD5, Digest::MD5.new]
- end
-
- # Taken from RFC 2202: Test Cases for HMAC-MD5 and HMAC-SHA-1
- def cases
- [
- {
- :key => "\x0b" * 16,
- :data => "Hi There",
- :hexdigest => "9294727a3638bb1c13f48ef8158bfc9d",
- }, {
- :key => "Jefe",
- :data => "what do ya want for nothing?",
- :hexdigest => "750c783e6ab0b503eaa86e310a5db738",
- }, {
- :key => "\xaa" * 16,
- :data => "\xdd" * 50,
- :hexdigest => "56be34521d144c88dbb8c733f0e8b3f6",
- }, {
- :key => "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19",
- :data => "\xcd" * 50,
- :hexdigest => "697eaf0aca3a3aea3a75164746ffaa79",
- }, {
- :key => "\x0c" * 16,
- :data => "Test With Truncation",
- :hexdigest => "56461ef2342edc00f9bab995690efd4c",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key - Hash Key First",
- :hexdigest => "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data",
- :hexdigest => "6f630fad67cda0ee1fb1f562db3aa53e",
- }
- ]
- end
-end
-
-class TC_HMAC_SHA1 < Test::Unit::TestCase
- include TM_HMAC
-
- def digesters
- [Digest::SHA1, Digest::SHA1.new]
- end
-
- # Taken from RFC 2202: Test Cases for HMAC-MD5 and HMAC-SHA-1
- def cases
- [
- {
- :key => "\x0b" * 20,
- :data => "Hi There",
- :hexdigest => "b617318655057264e28bc0b6fb378c8ef146be00",
- }, {
- :key => "Jefe",
- :data => "what do ya want for nothing?",
- :hexdigest => "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79",
- }, {
- :key => "\xaa" * 20,
- :data => "\xdd" * 50,
- :hexdigest => "125d7342b9ac11cd91a39af48aa17b4f63f175d3",
- }, {
- :key => "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19",
- :data => "\xcd" * 50,
- :hexdigest => "4c9007f4026250c6bc8414f9bf50c86c2d7235da",
- }, {
- :key => "\x0c" * 20,
- :data => "Test With Truncation",
- :hexdigest => "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key - Hash Key First",
- :hexdigest => "aa4ae5e15272d00e95705637ce8a3b55ed402112",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data",
- :hexdigest => "e8e99d0f45237d786d6bbaa7965c7808bbff1a91",
- }
- ]
- end
-end
-
-class TC_HMAC_RMD160 < Test::Unit::TestCase
- include TM_HMAC
-
- def digesters
- [Digest::RMD160, Digest::RMD160.new]
- end
-
- # Taken from RFC 2286: Test Cases for HMAC-RIPEMD160 and HMAC-RIPEMD128
- def cases
- [
- {
- :key => "\x0b" * 20,
- :data => "Hi There",
- :hexdigest => "24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668",
- }, {
- :key => "Jefe",
- :data => "what do ya want for nothing?",
- :hexdigest => "dda6c0213a485a9e24f4742064a7f033b43c4069",
- }, {
- :key => "\xaa" * 20,
- :data => "\xdd" * 50,
- :hexdigest => "b0b105360de759960ab4f35298e116e295d8e7c1",
- }, {
- :key => "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19",
- :data => "\xcd" * 50,
- :hexdigest => "d5ca862f4d21d5e610e18b4cf1beb97a4365ecf4",
- }, {
- :key => "\x0c" * 20,
- :data => "Test With Truncation",
- :hexdigest => "7619693978f91d90539ae786500ff3d8e0518e39",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key - Hash Key First",
- :hexdigest => "6466ca07ac5eac29e1bd523e5ada7605b791fd8b",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data",
- :hexdigest => "69ea60798d71616cce5fd0871e23754cd75d5a0a",
- }
- ]
- end
-end
diff --git a/ext/digest/md5/depend b/ext/digest/md5/depend
index ca30d310e9..288c30aa15 100644
--- a/ext/digest/md5/depend
+++ b/ext/digest/md5/depend
@@ -1,3 +1,18 @@
md5.o: md5.c md5.h $(srcdir)/../defs.h
-md5init.o: md5init.c md5.h $(srcdir)/../digest.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
+
+# AUTOGENERATED DEPENDENCIES START
+md5init.o: $(RUBY_EXTCONF_H)
+md5init.o: $(arch_hdrdir)/ruby/config.h
+md5init.o: $(hdrdir)/ruby/defines.h
+md5init.o: $(hdrdir)/ruby/intern.h
+md5init.o: $(hdrdir)/ruby/missing.h
+md5init.o: $(hdrdir)/ruby/ruby.h
+md5init.o: $(hdrdir)/ruby/st.h
+md5init.o: $(hdrdir)/ruby/subst.h
+md5init.o: $(top_srcdir)/ext/digest/digest.h
+md5init.o: $(top_srcdir)/include/ruby.h
+md5init.o: md5init.c
+md5init.o: md5ossl.h
+md5ossl.o: md5ossl.c
md5ossl.o: md5ossl.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/md5/extconf.rb b/ext/digest/md5/extconf.rb
index 5a57fd3eea..dead9a228b 100644
--- a/ext/digest/md5/extconf.rb
+++ b/ext/digest/md5/extconf.rb
@@ -1,25 +1,16 @@
# -*- coding: us-ascii -*-
+# frozen_string_literal: false
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id$
require "mkmf"
+require File.expand_path("../../digest_conf", __FILE__)
$defs << "-DHAVE_CONFIG_H"
-$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") && OpenSSL.check_func("MD5_Transform", "openssl/md5.h")
- $objs << "md5ossl.#{$OBJEXT}"
-
-else
- $objs << "md5.#{$OBJEXT}"
-end
+digest_conf("md5")
have_header("sys/cdefs.h")
diff --git a/ext/digest/md5/md5.c b/ext/digest/md5/md5.c
index 8d7d33c5a6..19fe54a693 100644
--- a/ext/digest/md5/md5.c
+++ b/ext/digest/md5/md5.c
@@ -61,7 +61,7 @@
*/
#include <string.h>
int
-main()
+main(void)
{
static const char *const test[7*2] = {
"", "d41d8cd98f00b204e9800998ecf8427e",
@@ -102,7 +102,7 @@ main()
#ifdef COMPUTE_T_VALUES
#include <math.h>
int
-main()
+main(void)
{
int i;
for (i = 1; i <= 64; ++i) {
@@ -350,7 +350,7 @@ md5_process(MD5_CTX *pms, const uint8_t *data /*[64]*/)
pms->state[3] += d;
}
-void
+int
MD5_Init(MD5_CTX *pms)
{
pms->count[0] = pms->count[1] = 0;
@@ -358,6 +358,7 @@ MD5_Init(MD5_CTX *pms)
pms->state[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
pms->state[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
pms->state[3] = 0x10325476;
+ return 1;
}
void
@@ -398,7 +399,7 @@ MD5_Update(MD5_CTX *pms, const uint8_t *data, size_t nbytes)
memcpy(pms->buffer, p, left);
}
-void
+int
MD5_Finish(MD5_CTX *pms, uint8_t *digest)
{
static const uint8_t pad[64] = {
@@ -419,4 +420,5 @@ MD5_Finish(MD5_CTX *pms, uint8_t *digest)
MD5_Update(pms, data, 8);
for (i = 0; i < 16; ++i)
digest[i] = (uint8_t)(pms->state[i >> 2] >> ((i & 3) << 3));
+ return 1;
}
diff --git a/ext/digest/md5/md5.h b/ext/digest/md5/md5.h
index f4580ef5e7..1b3383c5ee 100644
--- a/ext/digest/md5/md5.h
+++ b/ext/digest/md5/md5.h
@@ -46,7 +46,7 @@
#ifndef MD5_INCLUDED
# define MD5_INCLUDED
-#include "defs.h"
+#include "../defs.h"
/*
* This code has some adaptations for the Ghostscript environment, but it
@@ -69,9 +69,9 @@ typedef struct md5_state_s {
#define MD5_Finish rb_Digest_MD5_Finish
#endif
-void MD5_Init _((MD5_CTX *pms));
+int MD5_Init _((MD5_CTX *pms));
void MD5_Update _((MD5_CTX *pms, const uint8_t *data, size_t nbytes));
-void MD5_Finish _((MD5_CTX *pms, uint8_t *digest));
+int MD5_Finish _((MD5_CTX *pms, uint8_t *digest));
#define MD5_BLOCK_LENGTH 64
#define MD5_DIGEST_LENGTH 16
diff --git a/ext/digest/md5/md5cc.h b/ext/digest/md5/md5cc.h
new file mode 100644
index 0000000000..35652eac6a
--- /dev/null
+++ b/ext/digest/md5/md5cc.h
@@ -0,0 +1,12 @@
+#define COMMON_DIGEST_FOR_OPENSSL 1
+#include <CommonCrypto/CommonDigest.h>
+
+#define MD5_BLOCK_LENGTH CC_MD5_BLOCK_BYTES
+
+static DEFINE_UPDATE_FUNC_FOR_UINT(MD5)
+static DEFINE_FINISH_FUNC_FROM_FINAL(MD5)
+
+#undef MD5_Update
+#undef MD5_Finish
+#define MD5_Update rb_digest_MD5_update
+#define MD5_Finish rb_digest_MD5_finish
diff --git a/ext/digest/md5/md5init.c b/ext/digest/md5/md5init.c
index 3591782f6e..a6afedef69 100644
--- a/ext/digest/md5/md5init.c
+++ b/ext/digest/md5/md5init.c
@@ -1,9 +1,12 @@
/* $RoughId: md5init.c,v 1.2 2001/07/13 19:49:10 knu Exp $ */
/* $Id$ */
-#include "digest.h"
-#if defined(HAVE_OPENSSL_MD5_H)
+#include <ruby/ruby.h>
+#include "../digest.h"
+#if defined(MD5_USE_OPENSSL)
#include "md5ossl.h"
+#elif defined(MD5_USE_COMMONDIGEST)
+#include "md5cc.h"
#else
#include "md5.h"
#endif
@@ -24,7 +27,7 @@ static const rb_digest_metadata_t md5 = {
* RFC1321.
*/
void
-Init_md5()
+Init_md5(void)
{
VALUE mDigest, cDigest_Base, cDigest_MD5;
@@ -38,6 +41,8 @@ Init_md5()
cDigest_MD5 = rb_define_class_under(mDigest, "MD5", cDigest_Base);
- rb_ivar_set(cDigest_MD5, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&md5));
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
+ rb_iv_set(cDigest_MD5, "metadata",
+ Data_Wrap_Struct(0, 0, 0, (void *)&md5));
}
diff --git a/ext/digest/md5/md5ossl.c b/ext/digest/md5/md5ossl.c
deleted file mode 100644
index d94ae2cd2f..0000000000
--- a/ext/digest/md5/md5ossl.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* $Id$ */
-
-#include "md5ossl.h"
-
-void
-MD5_Finish(MD5_CTX *pctx, unsigned char *digest)
-{
- MD5_Final(digest, pctx);
-}
diff --git a/ext/digest/md5/md5ossl.h b/ext/digest/md5/md5ossl.h
index 1680c4f5c9..94aa7ae77b 100644
--- a/ext/digest/md5/md5ossl.h
+++ b/ext/digest/md5/md5ossl.h
@@ -8,6 +8,8 @@
#define MD5_BLOCK_LENGTH MD5_CBLOCK
-void MD5_Finish(MD5_CTX *pctx, unsigned char *digest);
+static DEFINE_FINISH_FUNC_FROM_FINAL(MD5)
+#undef MD5_Finish
+#define MD5_Finish rb_digest_MD5_finish
#endif
diff --git a/ext/digest/rmd160/depend b/ext/digest/rmd160/depend
index c5524be459..49cf2afc6f 100644
--- a/ext/digest/rmd160/depend
+++ b/ext/digest/rmd160/depend
@@ -1,3 +1,28 @@
rmd160.o: rmd160.c rmd160.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
-rmd160init.o: rmd160init.c rmd160.h $(srcdir)/../digest.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
-rmd160ossl.o: rmd160ossl.h $(srcdir)/../defs.h
+
+# AUTOGENERATED DEPENDENCIES START
+rmd160init.o: $(RUBY_EXTCONF_H)
+rmd160init.o: $(arch_hdrdir)/ruby/config.h
+rmd160init.o: $(hdrdir)/ruby/defines.h
+rmd160init.o: $(hdrdir)/ruby/intern.h
+rmd160init.o: $(hdrdir)/ruby/missing.h
+rmd160init.o: $(hdrdir)/ruby/ruby.h
+rmd160init.o: $(hdrdir)/ruby/st.h
+rmd160init.o: $(hdrdir)/ruby/subst.h
+rmd160init.o: $(top_srcdir)/ext/digest/digest.h
+rmd160init.o: $(top_srcdir)/include/ruby.h
+rmd160init.o: rmd160init.c
+rmd160init.o: rmd160ossl.h
+rmd160ossl.o: $(RUBY_EXTCONF_H)
+rmd160ossl.o: $(arch_hdrdir)/ruby/config.h
+rmd160ossl.o: $(hdrdir)/ruby/defines.h
+rmd160ossl.o: $(hdrdir)/ruby/intern.h
+rmd160ossl.o: $(hdrdir)/ruby/missing.h
+rmd160ossl.o: $(hdrdir)/ruby/ruby.h
+rmd160ossl.o: $(hdrdir)/ruby/st.h
+rmd160ossl.o: $(hdrdir)/ruby/subst.h
+rmd160ossl.o: $(top_srcdir)/ext/digest/defs.h
+rmd160ossl.o: $(top_srcdir)/include/ruby.h
+rmd160ossl.o: rmd160ossl.c
+rmd160ossl.o: rmd160ossl.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/rmd160/extconf.rb b/ext/digest/rmd160/extconf.rb
index d487d6da80..a02ba56169 100644
--- a/ext/digest/rmd160/extconf.rb
+++ b/ext/digest/rmd160/extconf.rb
@@ -1,24 +1,16 @@
# -*- coding: us-ascii -*-
+# frozen_string_literal: false
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id$
require "mkmf"
+require File.expand_path("../../digest_conf", __FILE__)
$defs << "-DNDEBUG" << "-DHAVE_CONFIG_H"
-$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") && OpenSSL.check_func("RMD160_Transform", "openssl/ripemd.h")
- $objs << "rmd160ossl.#{$OBJEXT}"
-else
- $objs << "rmd160.#{$OBJEXT}"
-end
+digest_conf("rmd160", "ripemd", "RIPEMD160")
have_header("sys/cdefs.h")
diff --git a/ext/digest/rmd160/rmd160.c b/ext/digest/rmd160/rmd160.c
index bac77833b1..058d004f3a 100644
--- a/ext/digest/rmd160/rmd160.c
+++ b/ext/digest/rmd160/rmd160.c
@@ -124,7 +124,7 @@
/********************************************************************/
-void
+int
RMD160_Init(RMD160_CTX *context)
{
@@ -138,6 +138,7 @@ RMD160_Init(RMD160_CTX *context)
context->state[4] = 0xc3d2e1f0U;
context->length[0] = context->length[1] = 0;
context->buflen = 0;
+ return 1;
}
/********************************************************************/
@@ -412,7 +413,7 @@ RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes)
/********************************************************************/
-void
+int
RMD160_Finish(RMD160_CTX *context, uint8_t digest[20])
{
uint32_t i;
@@ -456,6 +457,7 @@ RMD160_Finish(RMD160_CTX *context, uint8_t digest[20])
digest[i + 3] = (context->state[i>>2] >> 24);
}
}
+ return 1;
}
/************************ end of file rmd160.c **********************/
diff --git a/ext/digest/rmd160/rmd160.h b/ext/digest/rmd160/rmd160.h
index 2c98f11cd0..6324709d96 100644
--- a/ext/digest/rmd160/rmd160.h
+++ b/ext/digest/rmd160/rmd160.h
@@ -26,7 +26,7 @@
#ifndef _RMD160_H_
#define _RMD160_H_
-#include "defs.h"
+#include "../defs.h"
typedef struct {
uint32_t state[5]; /* state (ABCDE) */
@@ -43,10 +43,10 @@ typedef struct {
#endif
__BEGIN_DECLS
-void RMD160_Init _((RMD160_CTX *));
+int RMD160_Init _((RMD160_CTX *));
void RMD160_Transform _((uint32_t[5], const uint32_t[16]));
void RMD160_Update _((RMD160_CTX *, const uint8_t *, size_t));
-void RMD160_Finish _((RMD160_CTX *, uint8_t[20]));
+int RMD160_Finish _((RMD160_CTX *, uint8_t[20]));
__END_DECLS
#define RMD160_BLOCK_LENGTH 64
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index c214ca9f33..c1e753cc11 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -1,8 +1,9 @@
/* $RoughId: rmd160init.c,v 1.3 2001/07/13 20:00:43 knu Exp $ */
/* $Id$ */
-#include "digest.h"
-#if defined(HAVE_OPENSSL_RIPEMD_H)
+#include <ruby/ruby.h>
+#include "../digest.h"
+#if defined(RMD160_USE_OPENSSL)
#include "rmd160ossl.h"
#else
#include "rmd160.h"
@@ -24,7 +25,7 @@ static const rb_digest_metadata_t rmd160 = {
* Bosselaers, and Bart Preneel.
*/
void
-Init_rmd160()
+Init_rmd160(void)
{
VALUE mDigest, cDigest_Base, cDigest_RMD160;
@@ -38,6 +39,8 @@ Init_rmd160()
cDigest_RMD160 = rb_define_class_under(mDigest, "RMD160", cDigest_Base);
- rb_ivar_set(cDigest_RMD160, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&rmd160));
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
+ rb_iv_set(cDigest_RMD160, "metadata",
+ Data_Wrap_Struct(0, 0, 0, (void *)&rmd160));
}
diff --git a/ext/digest/rmd160/rmd160ossl.c b/ext/digest/rmd160/rmd160ossl.c
deleted file mode 100644
index f24e63e3d8..0000000000
--- a/ext/digest/rmd160/rmd160ossl.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* $Id$ */
-
-#include "defs.h"
-#include "rmd160ossl.h"
-
-void RMD160_Finish(RMD160_CTX *ctx, char *buf) {
- RIPEMD160_Final((unsigned char *)buf, ctx);
-}
diff --git a/ext/digest/rmd160/rmd160ossl.h b/ext/digest/rmd160/rmd160ossl.h
index 3df38a01c0..e6bf5ea8d0 100644
--- a/ext/digest/rmd160/rmd160ossl.h
+++ b/ext/digest/rmd160/rmd160ossl.h
@@ -14,6 +14,7 @@
#define RMD160_BLOCK_LENGTH RIPEMD160_CBLOCK
#define RMD160_DIGEST_LENGTH RIPEMD160_DIGEST_LENGTH
-void RMD160_Finish(RMD160_CTX *ctx, char *buf);
+static DEFINE_FINISH_FUNC_FROM_FINAL(RIPEMD160)
+#define RMD160_Finish rb_digest_RIPEMD160_finish
#endif
diff --git a/ext/digest/sha1/depend b/ext/digest/sha1/depend
index 6b6ee6a0bf..2ce73c4238 100644
--- a/ext/digest/sha1/depend
+++ b/ext/digest/sha1/depend
@@ -1,3 +1,28 @@
sha1.o: sha1.c sha1.h $(srcdir)/../defs.h
-sha1init.o: sha1init.c sha1.h $(srcdir)/../digest.h sha1.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
-sha1ossl.o: sha1ossl.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
+
+# AUTOGENERATED DEPENDENCIES START
+sha1init.o: $(RUBY_EXTCONF_H)
+sha1init.o: $(arch_hdrdir)/ruby/config.h
+sha1init.o: $(hdrdir)/ruby/defines.h
+sha1init.o: $(hdrdir)/ruby/intern.h
+sha1init.o: $(hdrdir)/ruby/missing.h
+sha1init.o: $(hdrdir)/ruby/ruby.h
+sha1init.o: $(hdrdir)/ruby/st.h
+sha1init.o: $(hdrdir)/ruby/subst.h
+sha1init.o: $(top_srcdir)/ext/digest/digest.h
+sha1init.o: $(top_srcdir)/include/ruby.h
+sha1init.o: sha1init.c
+sha1init.o: sha1ossl.h
+sha1ossl.o: $(RUBY_EXTCONF_H)
+sha1ossl.o: $(arch_hdrdir)/ruby/config.h
+sha1ossl.o: $(hdrdir)/ruby/defines.h
+sha1ossl.o: $(hdrdir)/ruby/intern.h
+sha1ossl.o: $(hdrdir)/ruby/missing.h
+sha1ossl.o: $(hdrdir)/ruby/ruby.h
+sha1ossl.o: $(hdrdir)/ruby/st.h
+sha1ossl.o: $(hdrdir)/ruby/subst.h
+sha1ossl.o: $(top_srcdir)/ext/digest/defs.h
+sha1ossl.o: $(top_srcdir)/include/ruby.h
+sha1ossl.o: sha1ossl.c
+sha1ossl.o: sha1ossl.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/sha1/extconf.rb b/ext/digest/sha1/extconf.rb
index d7e52fe731..0ff4158bef 100644
--- a/ext/digest/sha1/extconf.rb
+++ b/ext/digest/sha1/extconf.rb
@@ -1,24 +1,16 @@
# -*- coding: us-ascii -*-
+# frozen_string_literal: false
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id$
require "mkmf"
+require File.expand_path("../../digest_conf", __FILE__)
$defs << "-DHAVE_CONFIG_H"
-$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") && OpenSSL.check_func("SHA1_Transform", "openssl/sha.h")
- $objs << "sha1ossl.#{$OBJEXT}"
-else
- $objs << "sha1.#{$OBJEXT}"
-end
+digest_conf("sha1", "sha", nil, %w[SHA])
have_header("sys/cdefs.h")
diff --git a/ext/digest/sha1/sha1.c b/ext/digest/sha1/sha1.c
index 6196ca6b82..5311227549 100644
--- a/ext/digest/sha1/sha1.c
+++ b/ext/digest/sha1/sha1.c
@@ -199,7 +199,7 @@ void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64])
/*
* SHA1_Init - Initialize new context
*/
-void SHA1_Init(SHA1_CTX *context)
+int SHA1_Init(SHA1_CTX *context)
{
_DIAGASSERT(context != 0);
@@ -211,6 +211,7 @@ void SHA1_Init(SHA1_CTX *context)
context->state[3] = 0x10325476;
context->state[4] = 0xC3D2E1F0;
context->count[0] = context->count[1] = 0;
+ return 1;
}
@@ -244,7 +245,7 @@ void SHA1_Update(SHA1_CTX *context, const uint8_t *data, size_t len)
/*
* Add padding and return the message digest.
*/
-void SHA1_Finish(SHA1_CTX* context, uint8_t digest[20])
+int SHA1_Finish(SHA1_CTX* context, uint8_t digest[20])
{
size_t i;
uint8_t finalcount[8];
@@ -266,4 +267,5 @@ void SHA1_Finish(SHA1_CTX* context, uint8_t digest[20])
digest[i] = (uint8_t)
((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
}
+ return 1;
}
diff --git a/ext/digest/sha1/sha1.h b/ext/digest/sha1/sha1.h
index 55997e73dd..2accc46d46 100644
--- a/ext/digest/sha1/sha1.h
+++ b/ext/digest/sha1/sha1.h
@@ -11,7 +11,7 @@
#ifndef _SYS_SHA1_H_
#define _SYS_SHA1_H_
-#include "defs.h"
+#include "../defs.h"
typedef struct {
uint32_t state[5];
@@ -28,9 +28,9 @@ typedef struct {
#endif
void SHA1_Transform _((uint32_t state[5], const uint8_t buffer[64]));
-void SHA1_Init _((SHA1_CTX *context));
+int SHA1_Init _((SHA1_CTX *context));
void SHA1_Update _((SHA1_CTX *context, const uint8_t *data, size_t len));
-void SHA1_Finish _((SHA1_CTX *context, uint8_t digest[20]));
+int SHA1_Finish _((SHA1_CTX *context, uint8_t digest[20]));
#define SHA1_BLOCK_LENGTH 64
#define SHA1_DIGEST_LENGTH 20
diff --git a/ext/digest/sha1/sha1cc.h b/ext/digest/sha1/sha1cc.h
new file mode 100644
index 0000000000..2ed8d646ab
--- /dev/null
+++ b/ext/digest/sha1/sha1cc.h
@@ -0,0 +1,14 @@
+#define COMMON_DIGEST_FOR_OPENSSL 1
+#include <CommonCrypto/CommonDigest.h>
+
+#define SHA1_BLOCK_LENGTH CC_SHA1_BLOCK_BYTES
+#define SHA1_DIGEST_LENGTH CC_SHA1_DIGEST_LENGTH
+#define SHA1_CTX CC_SHA1_CTX
+
+static DEFINE_UPDATE_FUNC_FOR_UINT(SHA1)
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA1)
+
+#undef SHA1_Update
+#undef SHA1_Finish
+#define SHA1_Update rb_digest_SHA1_update
+#define SHA1_Finish rb_digest_SHA1_finish
diff --git a/ext/digest/sha1/sha1init.c b/ext/digest/sha1/sha1init.c
index d52eef58b3..1f8b89e276 100644
--- a/ext/digest/sha1/sha1init.c
+++ b/ext/digest/sha1/sha1init.c
@@ -1,9 +1,12 @@
/* $RoughId: sha1init.c,v 1.2 2001/07/13 19:49:10 knu Exp $ */
/* $Id$ */
-#include "digest.h"
-#if defined(HAVE_OPENSSL_SHA_H)
+#include <ruby/ruby.h>
+#include "../digest.h"
+#if defined(SHA1_USE_OPENSSL)
#include "sha1ossl.h"
+#elif defined(SHA1_USE_COMMONDIGEST)
+#include "sha1cc.h"
#else
#include "sha1.h"
#endif
@@ -24,7 +27,7 @@ static const rb_digest_metadata_t sha1 = {
* Technology), described in FIPS PUB 180-1.
*/
void
-Init_sha1()
+Init_sha1(void)
{
VALUE mDigest, cDigest_Base, cDigest_SHA1;
@@ -38,6 +41,8 @@ Init_sha1()
cDigest_SHA1 = rb_define_class_under(mDigest, "SHA1", cDigest_Base);
- rb_ivar_set(cDigest_SHA1, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha1));
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
+ rb_iv_set(cDigest_SHA1, "metadata",
+ Data_Wrap_Struct(0, 0, 0, (void *)&sha1));
}
diff --git a/ext/digest/sha1/sha1ossl.c b/ext/digest/sha1/sha1ossl.c
deleted file mode 100644
index 452cf35084..0000000000
--- a/ext/digest/sha1/sha1ossl.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $Id$ */
-
-#include "defs.h"
-#include "sha1ossl.h"
-
-void
-SHA1_Finish(SHA1_CTX *ctx, char *buf)
-{
- SHA1_Final((unsigned char *)buf, ctx);
-}
diff --git a/ext/digest/sha1/sha1ossl.h b/ext/digest/sha1/sha1ossl.h
index 8f9984cc64..599efe9a2f 100644
--- a/ext/digest/sha1/sha1ossl.h
+++ b/ext/digest/sha1/sha1ossl.h
@@ -15,6 +15,8 @@
#endif
#define SHA1_DIGEST_LENGTH SHA_DIGEST_LENGTH
-void SHA1_Finish(SHA1_CTX *ctx, char *buf);
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA1)
+#undef SHA1_Finish
+#define SHA1_Finish rb_digest_SHA1_finish
#endif
diff --git a/ext/digest/sha2/depend b/ext/digest/sha2/depend
index 7373f46fc2..3a47a76532 100644
--- a/ext/digest/sha2/depend
+++ b/ext/digest/sha2/depend
@@ -1,3 +1,28 @@
sha2.o: sha2.c sha2.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
-sha2init.o: sha2init.c sha2.h $(srcdir)/../digest.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
-sha2ossl.o: sha2ossl.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
+
+# AUTOGENERATED DEPENDENCIES START
+sha2init.o: $(RUBY_EXTCONF_H)
+sha2init.o: $(arch_hdrdir)/ruby/config.h
+sha2init.o: $(hdrdir)/ruby/defines.h
+sha2init.o: $(hdrdir)/ruby/intern.h
+sha2init.o: $(hdrdir)/ruby/missing.h
+sha2init.o: $(hdrdir)/ruby/ruby.h
+sha2init.o: $(hdrdir)/ruby/st.h
+sha2init.o: $(hdrdir)/ruby/subst.h
+sha2init.o: $(top_srcdir)/ext/digest/digest.h
+sha2init.o: $(top_srcdir)/include/ruby.h
+sha2init.o: sha2init.c
+sha2init.o: sha2ossl.h
+sha2ossl.o: $(RUBY_EXTCONF_H)
+sha2ossl.o: $(arch_hdrdir)/ruby/config.h
+sha2ossl.o: $(hdrdir)/ruby/defines.h
+sha2ossl.o: $(hdrdir)/ruby/intern.h
+sha2ossl.o: $(hdrdir)/ruby/missing.h
+sha2ossl.o: $(hdrdir)/ruby/ruby.h
+sha2ossl.o: $(hdrdir)/ruby/st.h
+sha2ossl.o: $(hdrdir)/ruby/subst.h
+sha2ossl.o: $(top_srcdir)/ext/digest/defs.h
+sha2ossl.o: $(top_srcdir)/include/ruby.h
+sha2ossl.o: sha2ossl.c
+sha2ossl.o: sha2ossl.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/sha2/extconf.rb b/ext/digest/sha2/extconf.rb
index 5ab2d35af5..5c7f76c7f3 100644
--- a/ext/digest/sha2/extconf.rb
+++ b/ext/digest/sha2/extconf.rb
@@ -1,33 +1,21 @@
# -*- coding: us-ascii -*-
+# frozen_string_literal: false
# $RoughId: extconf.rb,v 1.4 2001/08/14 19:54:51 knu Exp $
# $Id$
require "mkmf"
+require File.expand_path("../../digest_conf", __FILE__)
$defs << "-DHAVE_CONFIG_H"
-$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| 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"
-else
+unless digest_conf("sha2", "sha", %w[SHA256 SHA512])
have_type("u_int8_t")
- $objs << "sha2.#{$OBJEXT}"
end
have_header("sys/cdefs.h")
$preload = %w[digest]
-if have_type("uint64_t", "defs.h", $defs.join(' '))
- create_makefile("digest/sha2")
-end
+create_makefile("digest/sha2")
diff --git a/ext/digest/sha2/lib/sha2.rb b/ext/digest/sha2/lib/sha2.rb
index 58d12e9b09..58ff9f5cf0 100644
--- a/ext/digest/sha2/lib/sha2.rb
+++ b/ext/digest/sha2/lib/sha2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#--
# sha2.rb - defines Digest::SHA2 class which wraps up the SHA256,
# SHA384, and SHA512 classes.
diff --git a/ext/digest/sha2/sha2.c b/ext/digest/sha2/sha2.c
index 3457790eea..c86eab37a0 100644
--- a/ext/digest/sha2/sha2.c
+++ b/ext/digest/sha2/sha2.c
@@ -34,7 +34,7 @@
* $Id$
*/
-#include "defs.h"
+#include "../defs.h"
#include <string.h> /* memcpy()/memset() or bcopy()/bzero() */
#include <assert.h> /* assert() */
#include "sha2.h"
@@ -67,7 +67,7 @@
* Please make sure that your system defines BYTE_ORDER. If your
* architecture is little-endian, make sure it also defines
* LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are
- * equivilent.
+ * equivalent.
*
* If your system does not define the above, then you can do so by
* hand like this:
@@ -341,13 +341,14 @@ static const char *sha2_hex_digits = "0123456789abcdef";
/*** SHA-256: *********************************************************/
-void SHA256_Init(SHA256_CTX* context) {
+int SHA256_Init(SHA256_CTX* context) {
if (context == (SHA256_CTX*)0) {
- return;
+ return 0;
}
MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH);
MEMSET_BZERO(context->buffer, SHA256_BLOCK_LENGTH);
context->bitcount = 0;
+ return 1;
}
#ifdef SHA2_UNROLL_TRANSFORM
@@ -574,7 +575,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
usedspace = freespace = 0;
}
-void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
+int SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
sha2_word32 *d = (sha2_word32*)digest;
unsigned int usedspace;
@@ -636,6 +637,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
/* Clean up state data: */
MEMSET_BZERO(context, sizeof(*context));
usedspace = 0;
+ return 1;
}
char *SHA256_End(SHA256_CTX* context, char buffer[]) {
@@ -670,13 +672,14 @@ char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_S
/*** SHA-512: *********************************************************/
-void SHA512_Init(SHA512_CTX* context) {
+int SHA512_Init(SHA512_CTX* context) {
if (context == (SHA512_CTX*)0) {
- return;
+ return 0;
}
MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH);
MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH);
context->bitcount[0] = context->bitcount[1] = 0;
+ return 1;
}
#ifdef SHA2_UNROLL_TRANSFORM
@@ -940,7 +943,7 @@ void SHA512_Last(SHA512_CTX* context) {
SHA512_Transform(context, (sha2_word64*)context->buffer);
}
-void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
+int SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
sha2_word64 *d = (sha2_word64*)digest;
/* Sanity check: */
@@ -967,6 +970,7 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
/* Zero out state data */
MEMSET_BZERO(context, sizeof(*context));
+ return 1;
}
char *SHA512_End(SHA512_CTX* context, char buffer[]) {
@@ -1001,20 +1005,21 @@ char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_S
/*** SHA-384: *********************************************************/
-void SHA384_Init(SHA384_CTX* context) {
+int SHA384_Init(SHA384_CTX* context) {
if (context == (SHA384_CTX*)0) {
- return;
+ return 0;
}
MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH);
MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH);
context->bitcount[0] = context->bitcount[1] = 0;
+ return 1;
}
void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) {
SHA512_Update((SHA512_CTX*)context, data, len);
}
-void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
+int SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
sha2_word64 *d = (sha2_word64*)digest;
/* Sanity check: */
@@ -1041,6 +1046,7 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
/* Zero out state data */
MEMSET_BZERO(context, sizeof(*context));
+ return 1;
}
char *SHA384_End(SHA384_CTX* context, char buffer[]) {
diff --git a/ext/digest/sha2/sha2.h b/ext/digest/sha2/sha2.h
index 465398ee19..e58f15ae12 100644
--- a/ext/digest/sha2/sha2.h
+++ b/ext/digest/sha2/sha2.h
@@ -165,52 +165,52 @@ typedef SHA512_CTX SHA384_CTX;
#ifndef NOPROTO
-void SHA256_Init(SHA256_CTX *);
+int SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t);
-void SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
+int SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
char* SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
-void SHA384_Init(SHA384_CTX*);
+int SHA384_Init(SHA384_CTX*);
void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t);
-void SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
+int SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
-void SHA512_Init(SHA512_CTX*);
+int SHA512_Init(SHA512_CTX*);
void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t);
-void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
+int SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
#else /* NOPROTO */
-void SHA256_Init();
+int SHA256_Init();
void SHA256_Update();
#ifdef RUBY
-void SHA256_Finish();
+int SHA256_Finish();
#else
-void SHA256_Final();
+int SHA256_Final();
#endif /* RUBY */
char* SHA256_End();
char* SHA256_Data();
-void SHA384_Init();
+int SHA384_Init();
void SHA384_Update();
#ifdef RUBY
-void SHA384_Finish();
+int SHA384_Finish();
#else
-void SHA384_Final();
+int SHA384_Final();
#endif /* RUBY */
char* SHA384_End();
char* SHA384_Data();
-void SHA512_Init();
+int SHA512_Init();
void SHA512_Update();
#ifdef RUBY
-void SHA512_Finish();
+int SHA512_Finish();
#else
-void SHA512_Final();
+int SHA512_Final();
#endif /* RUBY */
char* SHA512_End();
char* SHA512_Data();
diff --git a/ext/digest/sha2/sha2cc.h b/ext/digest/sha2/sha2cc.h
new file mode 100644
index 0000000000..3f99604465
--- /dev/null
+++ b/ext/digest/sha2/sha2cc.h
@@ -0,0 +1,31 @@
+#define COMMON_DIGEST_FOR_OPENSSL 1
+#include <CommonCrypto/CommonDigest.h>
+
+#define SHA256_BLOCK_LENGTH CC_SHA256_BLOCK_BYTES
+#define SHA384_BLOCK_LENGTH CC_SHA384_BLOCK_BYTES
+#define SHA512_BLOCK_LENGTH CC_SHA512_BLOCK_BYTES
+
+#define SHA384_CTX CC_SHA512_CTX
+
+static DEFINE_UPDATE_FUNC_FOR_UINT(SHA256)
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA256)
+static DEFINE_UPDATE_FUNC_FOR_UINT(SHA384)
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA384)
+static DEFINE_UPDATE_FUNC_FOR_UINT(SHA512)
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA512)
+
+
+#undef SHA256_Update
+#undef SHA256_Finish
+#define SHA256_Update rb_digest_SHA256_update
+#define SHA256_Finish rb_digest_SHA256_finish
+
+#undef SHA384_Update
+#undef SHA384_Finish
+#define SHA384_Update rb_digest_SHA384_update
+#define SHA384_Finish rb_digest_SHA384_finish
+
+#undef SHA512_Update
+#undef SHA512_Finish
+#define SHA512_Update rb_digest_SHA512_update
+#define SHA512_Finish rb_digest_SHA512_finish
diff --git a/ext/digest/sha2/sha2init.c b/ext/digest/sha2/sha2init.c
index 13df4bcb78..9fd8ece7fe 100644
--- a/ext/digest/sha2/sha2init.c
+++ b/ext/digest/sha2/sha2init.c
@@ -1,9 +1,12 @@
/* $RoughId: sha2init.c,v 1.3 2001/07/13 20:00:43 knu Exp $ */
/* $Id$ */
-#include "digest.h"
+#include <ruby/ruby.h>
+#include "../digest.h"
#if defined(SHA2_USE_OPENSSL)
#include "sha2ossl.h"
+#elif defined(SHA2_USE_COMMONDIGEST)
+#include "sha2cc.h"
#else
#include "sha2.h"
#endif
@@ -29,7 +32,7 @@ FOREACH_BITLEN(DEFINE_ALGO_METADATA)
* Standards and Technology), described in FIPS PUB 180-2.
*/
void
-Init_sha2()
+Init_sha2(void)
{
VALUE mDigest, cDigest_Base;
ID id_metadata;
@@ -41,7 +44,7 @@ Init_sha2()
rb_require("digest");
- id_metadata = rb_intern("metadata");
+ id_metadata = rb_intern_const("metadata");
mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
@@ -50,7 +53,9 @@ Init_sha2()
cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \
\
rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha##bitlen));
+ Data_Wrap_Struct(0, 0, 0, (void *)&sha##bitlen));
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
FOREACH_BITLEN(DEFINE_ALGO_CLASS)
}
diff --git a/ext/digest/sha2/sha2ossl.c b/ext/digest/sha2/sha2ossl.c
deleted file mode 100644
index 34353be8b8..0000000000
--- a/ext/digest/sha2/sha2ossl.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "defs.h"
-#include "sha2ossl.h"
-
-#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)
-SHA_Finish(512)
diff --git a/ext/digest/sha2/sha2ossl.h b/ext/digest/sha2/sha2ossl.h
index 4229d14cf9..8dd0530107 100644
--- a/ext/digest/sha2/sha2ossl.h
+++ b/ext/digest/sha2/sha2ossl.h
@@ -8,10 +8,20 @@
#define SHA384_BLOCK_LENGTH SHA512_CBLOCK
#define SHA512_BLOCK_LENGTH SHA512_CBLOCK
+#ifndef __DragonFly__
+#define SHA384_Final SHA512_Final
+#endif
+
typedef SHA512_CTX SHA384_CTX;
-void SHA256_Finish(SHA256_CTX *ctx, char *buf);
-void SHA384_Finish(SHA384_CTX *ctx, char *buf);
-void SHA512_Finish(SHA512_CTX *ctx, char *buf);
+#undef SHA256_Finish
+#undef SHA384_Finish
+#undef SHA512_Finish
+#define SHA256_Finish rb_digest_SHA256_finish
+#define SHA384_Finish rb_digest_SHA384_finish
+#define SHA512_Finish rb_digest_SHA512_finish
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA256)
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA384)
+static DEFINE_FINISH_FUNC_FROM_FINAL(SHA512)
#endif
diff --git a/ext/dl/callback/depend b/ext/dl/callback/depend
deleted file mode 100644
index c3b4fef1db..0000000000
--- a/ext/dl/callback/depend
+++ /dev/null
@@ -1,15 +0,0 @@
-src: callback.c \
- callback-0.c callback-1.c callback-2.c \
- callback-3.c callback-4.c callback-5.c \
- callback-6.c callback-7.c callback-8.c
-
-$(OBJS): $(srcdir)/../dl.h $(HDRS) $(ruby_headers)
-
-callback-0.c callback-1.c callback-2.c \
-callback-3.c callback-4.c callback-5.c \
-callback-6.c callback-7.c callback-8.c \
- : callback.c
-
-callback.c: $(srcdir)/mkcallback.rb $(srcdir)/../dl.h
- @echo "generating callback.c"
- @$(RUBY) $(srcdir)/mkcallback.rb -output=callback $(srcdir)/../dl.h
diff --git a/ext/dl/callback/extconf.rb b/ext/dl/callback/extconf.rb
deleted file mode 100644
index 6c3387670d..0000000000
--- a/ext/dl/callback/extconf.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'mkmf'
-
-if compiled?("dl")
- callbacks = (0..8).map{|i| "callback-#{i}"}.unshift("callback")
- callback_srcs = callbacks.map{|basename| "#{basename}.c"}
- callback_objs = callbacks.map{|basename| "#{basename}.o"}
-
- $distcleanfiles << '$(SRCS)'
- $srcs = callback_srcs
- $objs = callback_objs
- $INCFLAGS << " -I$(srcdir)/.."
-
- create_makefile("dl/callback")
-end
diff --git a/ext/dl/callback/mkcallback.rb b/ext/dl/callback/mkcallback.rb
deleted file mode 100644
index e94a196247..0000000000
--- a/ext/dl/callback/mkcallback.rb
+++ /dev/null
@@ -1,242 +0,0 @@
-#!ruby -s
-$output ||= "callback"
-$out = open("#{$output}.c", "w")
-
-$dl_h = ARGV[0] || "dl.h"
-
-# import DLSTACK_SIZE, DLSTACK_ARGS and so on
-File.open($dl_h){|f|
- pre = ""
- f.each{|line|
- line.chop!
- if( line[-1] == ?\\ )
- line.chop!
- line.concat(" ")
- pre += line
- next
- end
- if( pre.size > 0 )
- line = pre + line
- pre = ""
- end
- case line
- when /#define\s+DLSTACK_SIZE\s+\(?(\d+)\)?/
- DLSTACK_SIZE = $1.to_i
- when /#define\s+DLSTACK_ARGS\s+(.+)/
- DLSTACK_ARGS = $1.to_i
- when /#define\s+DLTYPE_([A-Z_]+)\s+\(?(\d+)\)?/
- eval("#{$1} = #{$2}")
- when /#define\s+MAX_DLTYPE\s+\(?(\d+)\)?/
- MAX_DLTYPE = $1.to_i
- when /#define\s+MAX_CALLBACK\s+\(?(\d+)\)?/
- MAX_CALLBACK = $1.to_i
- end
- }
-}
-
-CDECL = "cdecl"
-STDCALL = "stdcall"
-
-CALLTYPES = [CDECL, STDCALL]
-
-DLTYPE = {
- VOID => {
- :name => 'void',
- :type => 'void',
- :conv => nil,
- },
- CHAR => {
- :name => 'char',
- :type => 'char',
- :conv => 'NUM2CHR(%s)'
- },
- SHORT => {
- :name => 'short',
- :type => 'short',
- :conv => 'NUM2INT(%s)',
- },
- INT => {
- :name => 'int',
- :type => 'int',
- :conv => 'NUM2INT(%s)',
- },
- LONG => {
- :name => 'long',
- :type => 'long',
- :conv => 'NUM2LONG(%s)',
- },
- LONG_LONG => {
- :name => 'long_long',
- :type => 'LONG_LONG',
- :conv => 'NUM2LL(%s)',
- },
- FLOAT => {
- :name => 'float',
- :type => 'float',
- :conv => '(float)RFLOAT_VALUE(%s)',
- },
- DOUBLE => {
- :name => 'double',
- :type => 'double',
- :conv => 'RFLOAT_VALUE(%s)',
- },
- VOIDP => {
- :name => 'ptr',
- :type => 'void *',
- :conv => 'NUM2PTR(%s)',
- },
-}
-
-
-def func_name(ty, argc, n, calltype)
- "rb_dl_callback_#{DLTYPE[ty][:name]}_#{argc}_#{n}_#{calltype}"
-end
-
-$out << (<<EOS)
-#include "ruby.h"
-
-VALUE rb_DLCdeclCallbackAddrs, rb_DLCdeclCallbackProcs;
-#ifdef FUNC_STDCALL
-VALUE rb_DLStdcallCallbackAddrs, rb_DLStdcallCallbackProcs;
-#endif
-/*static void *cdecl_callbacks[MAX_DLTYPE][MAX_CALLBACK];*/
-#ifdef FUNC_STDCALL
-/*static void *stdcall_callbacks[MAX_DLTYPE][MAX_CALLBACK];*/
-#endif
-ID rb_dl_cb_call;
-EOS
-
-def foreach_proc_entry
- for calltype in CALLTYPES
- case calltype
- when CDECL
- proc_entry = "rb_DLCdeclCallbackProcs"
- when STDCALL
- proc_entry = "rb_DLStdcallCallbackProcs"
- else
- raise "unknown calltype: #{calltype}"
- end
- yield calltype, proc_entry
- end
-end
-
-def gencallback(ty, calltype, proc_entry, argc, n)
- dltype = DLTYPE[ty]
- ret = dltype[:conv]
- src = <<-EOS
-#{calltype == STDCALL ? "\n#ifdef FUNC_STDCALL" : ""}
-static #{dltype[:type]}
-FUNC_#{calltype.upcase}(#{func_name(ty,argc,n,calltype)})(#{(0...argc).collect{|i| "DLSTACK_TYPE stack#{i}"}.join(", ")})
-{
- VALUE #{ret ? "ret, " : ""}cb#{argc > 0 ? ", args[#{argc}]" : ""};
-#{
- (0...argc).collect{|i|
- "\n args[#{i}] = PTR2NUM(stack#{i});"
- }.join("")
-}
- cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});
- #{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
-end
-
-def gen_push_proc_ary(ty, aryname)
- sprintf(" rb_ary_push(#{aryname}, rb_ary_new3(%d,%s));",
- MAX_CALLBACK * DLSTACK_SIZE,
- (0...MAX_CALLBACK).collect{
- (0...DLSTACK_SIZE).collect{ "Qnil" }.join(",")
- }.join(","))
-end
-
-def gen_push_addr_ary(ty, aryname, calltype)
- sprintf(" rb_ary_push(#{aryname}, rb_ary_new3(%d,%s));",
- MAX_CALLBACK * DLSTACK_SIZE,
- (0...MAX_CALLBACK).collect{|i|
- (0...DLSTACK_SIZE).collect{|argc|
- "PTR2NUM(%s)" % func_name(ty,argc,i,calltype)
- }.join(",")
- }.join(","))
-end
-
-def gen_callback_file(ty)
- filename = "#{$output}-#{ty}.c"
- initname = "rb_dl_init_callbacks_#{ty}"
- body = <<-EOS
-#include "dl.h"
-
-extern VALUE rb_DLCdeclCallbackAddrs, rb_DLCdeclCallbackProcs;
-#ifdef FUNC_STDCALL
-extern VALUE rb_DLStdcallCallbackAddrs, rb_DLStdcallCallbackProcs;
-#endif
-extern ID rb_dl_cb_call;
- EOS
- yield body
- body << <<-EOS
-void
-#{initname}()
-{
-#{gen_push_proc_ary(ty, "rb_DLCdeclCallbackProcs")}
-#{gen_push_addr_ary(ty, "rb_DLCdeclCallbackAddrs", CDECL)}
-#ifdef FUNC_STDCALL
-#{gen_push_proc_ary(ty, "rb_DLStdcallCallbackProcs")}
-#{gen_push_addr_ary(ty, "rb_DLStdcallCallbackAddrs", STDCALL)}
-#endif
-}
- EOS
- [filename, initname, body]
-end
-
-callbacks = []
-for ty in 0...MAX_DLTYPE
- filename, initname, body = gen_callback_file(ty) {|f|
- foreach_proc_entry do |calltype, proc_entry|
- for argc in 0...DLSTACK_SIZE
- for n in 0...MAX_CALLBACK
- f << gencallback(ty, calltype, proc_entry, argc, n)
- end
- end
- end
- }
- $out << "void #{initname}();\n"
- callbacks << [filename, body]
-end
-
-$out << (<<EOS)
-void
-Init_callback(void)
-{
- VALUE tmp;
- VALUE rb_mDL = rb_path2class("DL");
-
- rb_dl_cb_call = rb_intern("call");
-
- tmp = rb_DLCdeclCallbackProcs = rb_ary_new();
- rb_define_const(rb_mDL, "CdeclCallbackProcs", tmp);
-
- tmp = rb_DLCdeclCallbackAddrs = rb_ary_new();
- rb_define_const(rb_mDL, "CdeclCallbackAddrs", tmp);
-
-#ifdef FUNC_STDCALL
- tmp = rb_DLStdcallCallbackProcs = rb_ary_new();
- rb_define_const(rb_mDL, "StdcallCallbackProcs", tmp);
-
- tmp = rb_DLStdcallCallbackAddrs = rb_ary_new();
- rb_define_const(rb_mDL, "StdcallCallbackAddrs", tmp);
-#endif
-
-#{
- (0...MAX_DLTYPE).collect{|ty|
- " rb_dl_init_callbacks_#{ty}();"
- }.join("\n")
-}
-}
-EOS
-$out.close
-
-for filename, body in callbacks
- open(filename, "wb") {|f| f.puts body}
-end
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c
deleted file mode 100644
index 1f4958bbdc..0000000000
--- a/ext/dl/cfunc.c
+++ /dev/null
@@ -1,677 +0,0 @@
-/* -*- C -*-
- * $Id$
- */
-
-#include <ruby/ruby.h>
-#include <ruby/util.h>
-#include <errno.h>
-#include "dl.h"
-
-VALUE rb_cDLCFunc;
-
-static ID id_last_error;
-
-static VALUE
-rb_dl_get_last_error(VALUE self)
-{
- return rb_thread_local_aref(rb_thread_current(), id_last_error);
-}
-
-static VALUE
-rb_dl_set_last_error(VALUE self, VALUE val)
-{
- rb_thread_local_aset(rb_thread_current(), id_last_error, val);
- return Qnil;
-}
-
-#if defined(_WIN32)
-#include <windows.h>
-static ID id_win32_last_error;
-
-static VALUE
-rb_dl_get_win32_last_error(VALUE self)
-{
- return rb_thread_local_aref(rb_thread_current(), id_win32_last_error);
-}
-
-static VALUE
-rb_dl_set_win32_last_error(VALUE self, VALUE val)
-{
- rb_thread_local_aset(rb_thread_current(), id_win32_last_error, val);
- return Qnil;
-}
-#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)
-{
- struct cfunc_data *data = ptr;
- if( data->name ){
- xfree(data->name);
- }
- xfree(data);
-}
-
-static size_t
-dlcfunc_memsize(const void *ptr)
-{
- const struct cfunc_data *data = ptr;
- size_t size = 0;
- if( data ){
- size += sizeof(*data);
- if( data->name ){
- size += strlen(data->name) + 1;
- }
- }
- return size;
-}
-
-const rb_data_type_t dlcfunc_data_type = {
- "dl/cfunc",
- {dlcfunc_mark, dlcfunc_free, dlcfunc_memsize,},
-};
-
-VALUE
-rb_dlcfunc_new(void (*func)(), int type, const char *name, ID calltype)
-{
- VALUE val;
- struct cfunc_data *data;
-
- if( func ){
- val = TypedData_Make_Struct(rb_cDLCFunc, struct cfunc_data, &dlcfunc_data_type, data);
- data->ptr = (void *)(VALUE)func;
- data->name = name ? strdup(name) : NULL;
- data->type = type;
- data->calltype = calltype;
- }
- else{
- val = Qnil;
- }
-
- return val;
-}
-
-void *
-rb_dlcfunc2ptr(VALUE val)
-{
- struct cfunc_data *data;
- void * func;
-
- if( rb_typeddata_is_kind_of(val, &dlcfunc_data_type) ){
- data = DATA_PTR(val);
- func = data->ptr;
- }
- else if( val == Qnil ){
- func = NULL;
- }
- else{
- rb_raise(rb_eTypeError, "DL::CFunc was expected");
- }
-
- return func;
-}
-
-static VALUE
-rb_dlcfunc_s_allocate(VALUE klass)
-{
- VALUE obj;
- struct cfunc_data *data;
-
- obj = TypedData_Make_Struct(klass, struct cfunc_data, &dlcfunc_data_type, data);
- data->ptr = 0;
- data->name = 0;
- data->type = 0;
- data->calltype = CFUNC_CDECL;
-
- return obj;
-}
-
-int
-rb_dlcfunc_kind_p(VALUE func)
-{
- return rb_typeddata_is_kind_of(func, &dlcfunc_data_type);
-}
-
-/*
- * call-seq:
- * DL::CFunc.new(address, type=DL::TYPE_VOID, name=nil, calltype=:cdecl)
- *
- * Create a new function that points to +address+ with an optional return type
- * of +type+, a name of +name+ and a calltype of +calltype+.
- */
-static VALUE
-rb_dlcfunc_initialize(int argc, VALUE argv[], VALUE self)
-{
- 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);
-
- 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);
- if( data->name ) xfree(data->name);
- data->ptr = saddr;
- 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;
-}
-
-/*
- * call-seq:
- * name => str
- *
- * Get the name of this function
- */
-static VALUE
-rb_dlcfunc_name(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- return cfunc->name ? rb_tainted_str_new2(cfunc->name) : Qnil;
-}
-
-/*
- * call-seq:
- * cfunc.ctype => num
- *
- * Get the C function return value type. See DL for a list of constants
- * corresponding to this method's return value.
- */
-static VALUE
-rb_dlcfunc_ctype(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- return INT2NUM(cfunc->type);
-}
-
-/*
- * call-seq:
- * cfunc.ctype = type
- *
- * Set the C function return value type to +type+.
- */
-static VALUE
-rb_dlcfunc_set_ctype(VALUE self, VALUE ctype)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- cfunc->type = NUM2INT(ctype);
- return ctype;
-}
-
-/*
- * call-seq:
- * cfunc.calltype => symbol
- *
- * Get the call type of this function.
- */
-static VALUE
-rb_dlcfunc_calltype(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- return ID2SYM(cfunc->calltype);
-}
-
-/*
- * call-seq:
- * cfunc.calltype = symbol
- *
- * Set the call type for this function.
- */
-static VALUE
-rb_dlcfunc_set_calltype(VALUE self, VALUE sym)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- cfunc->calltype = SYM2ID(sym);
- return sym;
-}
-
-/*
- * call-seq:
- * cfunc.ptr
- *
- * Get the underlying function pointer as a DL::CPtr object.
- */
-static VALUE
-rb_dlcfunc_ptr(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- return PTR2NUM(cfunc->ptr);
-}
-
-/*
- * call-seq:
- * cfunc.ptr = pointer
- *
- * Set the underlying function pointer to a DL::CPtr named +pointer+.
- */
-static VALUE
-rb_dlcfunc_set_ptr(VALUE self, VALUE addr)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- cfunc->ptr = NUM2PTR(addr);
-
- return Qnil;
-}
-
-/*
- * call-seq:
- * inspect
- * to_s
- *
- * Returns a string formatted with an easily readable representation of the
- * internal state of the DL::CFunc
- */
-static VALUE
-rb_dlcfunc_inspect(VALUE self)
-{
- VALUE val;
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
-
- val = rb_sprintf("#<DL::CFunc:%p ptr=%p type=%d name='%s'>",
- cfunc,
- cfunc->ptr,
- cfunc->type,
- cfunc->name ? cfunc->name : "");
- OBJ_TAINT(val);
- return val;
-}
-
-
-# define DECL_FUNC_CDECL(f,ret,args,val) \
- ret (FUNC_CDECL(*(f)))(args) = (ret (FUNC_CDECL(*))(args))(VALUE)(val)
-#ifdef FUNC_STDCALL
-# define DECL_FUNC_STDCALL(f,ret,args,val) \
- ret (FUNC_STDCALL(*(f)))(args) = (ret (FUNC_STDCALL(*))(args))(VALUE)(val)
-#endif
-
-#define CALL_CASE switch( RARRAY_LEN(ary) ){ \
- CASE(0); break; \
- CASE(1); break; CASE(2); break; CASE(3); break; CASE(4); break; CASE(5); break; \
- CASE(6); break; CASE(7); break; CASE(8); break; CASE(9); break; CASE(10);break; \
- CASE(11);break; CASE(12);break; CASE(13);break; CASE(14);break; CASE(15);break; \
- CASE(16);break; CASE(17);break; CASE(18);break; CASE(19);break; CASE(20);break; \
- default: rb_raise(rb_eArgError, "too many arguments"); \
-}
-
-
-#if defined(_MSC_VER) && defined(_M_AMD64) && _MSC_VER >= 1400 && _MSC_VER < 1600
-# pragma optimize("", off)
-#endif
-/*
- * call-seq:
- * dlcfunc.call(ary) => some_value
- * dlcfunc[ary] => some_value
- *
- * Calls the function pointer passing in +ary+ as values to the underlying
- * C function. The return value depends on the ctype.
- */
-static VALUE
-rb_dlcfunc_call(VALUE self, VALUE ary)
-{
- struct cfunc_data *cfunc;
- int i;
- DLSTACK_TYPE stack[DLSTACK_SIZE];
- VALUE result = Qnil;
-
- memset(stack, 0, sizeof(DLSTACK_TYPE) * DLSTACK_SIZE);
- Check_Type(ary, T_ARRAY);
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
-
- if( cfunc->ptr == 0 ){
- rb_raise(rb_eDLError, "can't call null-function");
- return Qnil;
- }
-
- for( i = 0; i < RARRAY_LEN(ary); i++ ){
- VALUE arg;
- if( i >= DLSTACK_SIZE ){
- rb_raise(rb_eDLError, "too many arguments (stack overflow)");
- }
- arg = rb_to_int(RARRAY_PTR(ary)[i]);
- rb_check_safe_obj(arg);
- if (FIXNUM_P(arg)) {
- stack[i] = (DLSTACK_TYPE)FIX2LONG(arg);
- }
- else if (RB_TYPE_P(arg, T_BIGNUM)) {
- unsigned long ls[(sizeof(DLSTACK_TYPE) + sizeof(long) - 1)/sizeof(long)];
- DLSTACK_TYPE d;
- int j;
- rb_big_pack(arg, ls, sizeof(ls)/sizeof(*ls));
- d = 0;
- for (j = 0; j < (int)(sizeof(ls)/sizeof(*ls)); j++)
- d |= (DLSTACK_TYPE)ls[j] << (j * sizeof(long) * CHAR_BIT);
- stack[i] = d;
- }
- else {
- Check_Type(arg, T_FIXNUM);
- }
- }
-
- /* calltype == CFUNC_CDECL */
- if( cfunc->calltype == CFUNC_CDECL
-#ifndef FUNC_STDCALL
- || cfunc->calltype == CFUNC_STDCALL
-#endif
- ){
- switch( cfunc->type ){
- case DLTYPE_VOID:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,void,DLSTACK_PROTO##n,cfunc->ptr); \
- f(DLSTACK_ARGS##n(stack)); \
- result = Qnil; \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_VOIDP:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,void*,DLSTACK_PROTO##n,cfunc->ptr); \
- void * ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = PTR2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_CHAR:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,char,DLSTACK_PROTO##n,cfunc->ptr); \
- char ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = CHR2FIX(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_SHORT:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,short,DLSTACK_PROTO##n,cfunc->ptr); \
- short ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM((int)ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_INT:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,int,DLSTACK_PROTO##n,cfunc->ptr); \
- int ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,long,DLSTACK_PROTO##n,cfunc->ptr); \
- long ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LONG2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#if HAVE_LONG_LONG /* used in ruby.h */
- case DLTYPE_LONG_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,LONG_LONG,DLSTACK_PROTO##n,cfunc->ptr); \
- LONG_LONG ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LL2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#endif
- case DLTYPE_FLOAT:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,float,DLSTACK_PROTO##n,cfunc->ptr); \
- float ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_DOUBLE:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,double,DLSTACK_PROTO##n,cfunc->ptr); \
- double ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- default:
- rb_raise(rb_eDLTypeError, "unknown type %d", cfunc->type);
- }
- }
-#ifdef FUNC_STDCALL
- else if( cfunc->calltype == CFUNC_STDCALL ){
- /* calltype == CFUNC_STDCALL */
- switch( cfunc->type ){
- case DLTYPE_VOID:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,void,DLSTACK_PROTO##n##_,cfunc->ptr); \
- f(DLSTACK_ARGS##n(stack)); \
- result = Qnil; \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_VOIDP:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,void*,DLSTACK_PROTO##n##_,cfunc->ptr); \
- void * ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = PTR2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_CHAR:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,char,DLSTACK_PROTO##n##_,cfunc->ptr); \
- char ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = CHR2FIX(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_SHORT:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,short,DLSTACK_PROTO##n##_,cfunc->ptr); \
- short ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM((int)ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_INT:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,int,DLSTACK_PROTO##n##_,cfunc->ptr); \
- int ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,long,DLSTACK_PROTO##n##_,cfunc->ptr); \
- long ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LONG2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#if HAVE_LONG_LONG /* used in ruby.h */
- case DLTYPE_LONG_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,LONG_LONG,DLSTACK_PROTO##n##_,cfunc->ptr); \
- LONG_LONG ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LL2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#endif
- case DLTYPE_FLOAT:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,float,DLSTACK_PROTO##n##_,cfunc->ptr); \
- float ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_DOUBLE:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,double,DLSTACK_PROTO##n##_,cfunc->ptr); \
- double ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- default:
- rb_raise(rb_eDLTypeError, "unknown type %d", cfunc->type);
- }
- }
-#endif
- else{
- const char *name = rb_id2name(cfunc->calltype);
- if( name ){
- rb_raise(rb_eDLError, "unsupported call type: %s",
- name);
- }
- else{
- rb_raise(rb_eDLError, "unsupported call type: %"PRIxVALUE,
- cfunc->calltype);
- }
- }
-
- rb_dl_set_last_error(self, INT2NUM(errno));
-#if defined(_WIN32)
- rb_dl_set_win32_last_error(self, INT2NUM(GetLastError()));
-#endif
-
- return result;
-}
-#if defined(_MSC_VER) && defined(_M_AMD64) && _MSC_VER >= 1400 && _MSC_VER < 1600
-# pragma optimize("", on)
-#endif
-
-/*
- * call-seq:
- * dlfunc.to_i => integer
- *
- * Returns the memory location of this function pointer as an integer.
- */
-static VALUE
-rb_dlcfunc_to_i(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
- return PTR2NUM(cfunc->ptr);
-}
-
-void
-Init_dlcfunc(void)
-{
- id_last_error = rb_intern("__DL2_LAST_ERROR__");
-#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);
- rb_define_method(rb_cDLCFunc, "call", rb_dlcfunc_call, 1);
- rb_define_method(rb_cDLCFunc, "[]", rb_dlcfunc_call, 1);
- rb_define_method(rb_cDLCFunc, "name", rb_dlcfunc_name, 0);
- rb_define_method(rb_cDLCFunc, "ctype", rb_dlcfunc_ctype, 0);
- rb_define_method(rb_cDLCFunc, "ctype=", rb_dlcfunc_set_ctype, 1);
- rb_define_method(rb_cDLCFunc, "calltype", rb_dlcfunc_calltype, 0);
- rb_define_method(rb_cDLCFunc, "calltype=", rb_dlcfunc_set_calltype, 1);
- rb_define_method(rb_cDLCFunc, "ptr", rb_dlcfunc_ptr, 0);
- rb_define_method(rb_cDLCFunc, "ptr=", rb_dlcfunc_set_ptr, 1);
- rb_define_method(rb_cDLCFunc, "inspect", rb_dlcfunc_inspect, 0);
- rb_define_method(rb_cDLCFunc, "to_s", rb_dlcfunc_inspect, 0);
- rb_define_method(rb_cDLCFunc, "to_i", rb_dlcfunc_to_i, 0);
-}
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
deleted file mode 100644
index 9e59139fc9..0000000000
--- a/ext/dl/cptr.c
+++ /dev/null
@@ -1,670 +0,0 @@
-/* -*- C -*-
- * $Id$
- */
-
-#include <ruby/ruby.h>
-#include <ruby/io.h>
-#include <ctype.h>
-#include "dl.h"
-
-VALUE rb_cDLCPtr;
-
-static inline freefunc_t
-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;
- }
- 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;
- if (data->ptr) {
- if (data->free) {
- (*(data->free))(data->ptr);
- }
- }
-}
-
-static size_t
-dlptr_memsize(const void *ptr)
-{
- const struct ptr_data *data = ptr;
- return data ? sizeof(*data) + data->size : 0;
-}
-
-static const rb_data_type_t dlptr_data_type = {
- "dl/ptr",
- {dlptr_mark, dlptr_free, dlptr_memsize,},
-};
-
-VALUE
-rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
-{
- struct ptr_data *data;
- VALUE val;
-
- val = TypedData_Make_Struct(klass, struct ptr_data, &dlptr_data_type, data);
- data->ptr = ptr;
- data->free = func;
- data->size = size;
- OBJ_TAINT(val);
-
- return val;
-}
-
-VALUE
-rb_dlptr_new(void *ptr, long size, freefunc_t func)
-{
- return rb_dlptr_new2(rb_cDLCPtr, ptr, size, func);
-}
-
-VALUE
-rb_dlptr_malloc(long size, freefunc_t func)
-{
- void *ptr;
-
- ptr = ruby_xmalloc((size_t)size);
- memset(ptr,0,(size_t)size);
- return rb_dlptr_new(ptr, size, func);
-}
-
-void *
-rb_dlptr2cptr(VALUE val)
-{
- struct ptr_data *data;
- void *ptr;
-
- if (rb_obj_is_kind_of(val, rb_cDLCPtr)) {
- TypedData_Get_Struct(val, struct ptr_data, &dlptr_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_dlptr_s_allocate(VALUE klass)
-{
- VALUE obj;
- struct ptr_data *data;
-
- obj = TypedData_Make_Struct(klass, struct ptr_data, &dlptr_data_type, data);
- data->ptr = 0;
- data->size = 0;
- data->free = 0;
-
- return obj;
-}
-
-/*
- * call-seq:
- * DL::CPtr.new(address) => dl_cptr
- * DL::CPtr.new(address, size) => dl_cptr
- * DL::CPtr.new(address, size, freefunc) => dl_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_dlptr_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, &dlptr_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:
- *
- * DL::CPtr.malloc(size, freefunc = nil) => dl cptr 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
- * DL::CFunc
- */
-static VALUE
-rb_dlptr_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_dlptr_s_malloc");
- }
-
- obj = rb_dlptr_malloc(s,f);
- if (wrap) RPTR_DATA(obj)->wrap[1] = wrap;
-
- return obj;
-}
-
-/*
- * call-seq: to_i
- *
- * Returns the integer memory location of this DL::CPtr.
- */
-static VALUE
-rb_dlptr_to_i(VALUE self)
-{
- struct ptr_data *data;
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
- return PTR2NUM(data->ptr);
-}
-
-/*
- * call-seq: to_value
- *
- * Cast this CPtr to a ruby object.
- */
-static VALUE
-rb_dlptr_to_value(VALUE self)
-{
- struct ptr_data *data;
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
- return (VALUE)(data->ptr);
-}
-
-/*
- * call-seq: ptr
- *
- * Returns a DL::CPtr that is a dereferenced pointer for this DL::CPtr.
- * Analogous to the star operator in C.
- */
-VALUE
-rb_dlptr_ptr(VALUE self)
-{
- struct ptr_data *data;
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
- return rb_dlptr_new(*((void**)(data->ptr)),0,0);
-}
-
-/*
- * call-seq: ref
- *
- * Returns a DL::CPtr that is a reference pointer for this DL::CPtr.
- * Analogous to the ampersand operator in C.
- */
-VALUE
-rb_dlptr_ref(VALUE self)
-{
- struct ptr_data *data;
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
- return rb_dlptr_new(&(data->ptr),0,0);
-}
-
-/*
- * call-seq: null?
- *
- * Returns true if this is a null pointer.
- */
-VALUE
-rb_dlptr_null_p(VALUE self)
-{
- struct ptr_data *data;
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
- return data->ptr ? Qfalse : Qtrue;
-}
-
-/*
- * call-seq: free=(function)
- *
- * Set the free function for this pointer to the DL::CFunc in +function+.
- */
-static VALUE
-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->wrap[1]);
-
- return Qnil;
-}
-
-/*
- * call-seq: free
- *
- * Get the free function for this pointer. Returns DL::CFunc or nil.
- */
-static VALUE
-rb_dlptr_free_get(VALUE self)
-{
- struct ptr_data *pdata;
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, pdata);
-
- return rb_dlcfunc_new(pdata->free, DLTYPE_VOID, "free<anonymous>", CFUNC_CDECL);
-}
-
-/*
- * 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.
- */
-static VALUE
-rb_dlptr_to_s(int argc, VALUE argv[], VALUE self)
-{
- struct ptr_data *data;
- VALUE arg1, val;
- int len;
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_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_dlptr_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.
- */
-static VALUE
-rb_dlptr_to_str(int argc, VALUE argv[], VALUE self)
-{
- struct ptr_data *data;
- VALUE arg1, val;
- int len;
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_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_dlptr_to_str");
- }
-
- return val;
-}
-
-/*
- * call-seq: inspect
- *
- * Returns a string formatted with an easily readable representation of the
- * internal state of the DL::CPtr
- */
-static VALUE
-rb_dlptr_inspect(VALUE self)
-{
- struct ptr_data *data;
- char str[1024];
-
- TypedData_Get_Struct(self, struct ptr_data, &dlptr_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.
- */
-VALUE
-rb_dlptr_eql(VALUE self, VALUE other)
-{
- void *ptr1, *ptr2;
-
- if(!rb_obj_is_kind_of(other, rb_cDLCPtr)) return Qfalse;
-
- ptr1 = rb_dlptr2cptr(self);
- ptr2 = rb_dlptr2cptr(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_dlptr_cmp(VALUE self, VALUE other)
-{
- void *ptr1, *ptr2;
- SIGNED_VALUE diff;
-
- if(!rb_obj_is_kind_of(other, rb_cDLCPtr)) return Qnil;
-
- ptr1 = rb_dlptr2cptr(self);
- ptr2 = rb_dlptr2cptr(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 DL::CPtr that has been advanced +n+ bytes.
- */
-static VALUE
-rb_dlptr_plus(VALUE self, VALUE other)
-{
- void *ptr;
- long num, size;
-
- ptr = rb_dlptr2cptr(self);
- size = RPTR_DATA(self)->size;
- num = NUM2LONG(other);
- return rb_dlptr_new((char *)ptr + num, size - num, 0);
-}
-
-/*
- * call-seq:
- * ptr - n => new cptr
- *
- * Returns a new DL::CPtr that has been moved back +n+ bytes.
- */
-static VALUE
-rb_dlptr_minus(VALUE self, VALUE other)
-{
- void *ptr;
- long num, size;
-
- ptr = rb_dlptr2cptr(self);
- size = RPTR_DATA(self)->size;
- num = NUM2LONG(other);
- return rb_dlptr_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 _length_ will be
- * returned.
- */
-VALUE
-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 *)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_dlptr_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+.
- */
-VALUE
-rb_dlptr_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, &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*)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_cDLCPtr) ){
- mem = rb_dlptr2cptr(arg2);
- }
- else{
- mem = NUM2PTR(arg2);
- }
- memcpy((char *)data->ptr + offset, mem, len);
- retval = arg2;
- break;
- default:
- rb_bug("rb_dlptr_aset()");
- }
- return retval;
-}
-
-/*
- * call-seq: size=(size)
- *
- * Set the size of this pointer to +size+
- */
-static VALUE
-rb_dlptr_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_dlptr_size_get(VALUE self)
-{
- return LONG2NUM(RPTR_DATA(self)->size);
-}
-
-/*
- * call-seq:
- * DL::CPtr.to_ptr(val) => cptr
- * DL::CPtr[val] => cptr
- *
- * Get the underlying pointer for ruby object +val+ and return it as a
- * DL::CPtr object.
- */
-static VALUE
-rb_dlptr_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_dlptr_new(fp, 0, NULL);
- }
- else if (RTEST(rb_obj_is_kind_of(val, rb_cString))){
- char *str = StringValuePtr(val);
- ptr = rb_dlptr_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_cDLCPtr)){
- ptr = vptr;
- wrap = 0;
- }
- else{
- rb_raise(rb_eDLError, "to_ptr should return a CPtr object");
- }
- }
- else{
- VALUE num = rb_Integer(val);
- if (num == val) wrap = 0;
- ptr = rb_dlptr_new(NUM2PTR(num), 0, NULL);
- }
- OBJ_INFECT(ptr, val);
- if (wrap) RPTR_DATA(ptr)->wrap[0] = wrap;
- return ptr;
-}
-
-void
-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);
- rb_define_singleton_method(rb_cDLCPtr, "to_ptr", rb_dlptr_s_to_ptr, 1);
- rb_define_singleton_method(rb_cDLCPtr, "[]", rb_dlptr_s_to_ptr, 1);
- rb_define_method(rb_cDLCPtr, "initialize", rb_dlptr_initialize, -1);
- rb_define_method(rb_cDLCPtr, "free=", rb_dlptr_free_set, 1);
- rb_define_method(rb_cDLCPtr, "free", rb_dlptr_free_get, 0);
- rb_define_method(rb_cDLCPtr, "to_i", rb_dlptr_to_i, 0);
- rb_define_method(rb_cDLCPtr, "to_int", rb_dlptr_to_i, 0);
- rb_define_method(rb_cDLCPtr, "to_value", rb_dlptr_to_value, 0);
- rb_define_method(rb_cDLCPtr, "ptr", rb_dlptr_ptr, 0);
- rb_define_method(rb_cDLCPtr, "+@", rb_dlptr_ptr, 0);
- rb_define_method(rb_cDLCPtr, "ref", rb_dlptr_ref, 0);
- rb_define_method(rb_cDLCPtr, "-@", rb_dlptr_ref, 0);
- rb_define_method(rb_cDLCPtr, "null?", rb_dlptr_null_p, 0);
- rb_define_method(rb_cDLCPtr, "to_s", rb_dlptr_to_s, -1);
- rb_define_method(rb_cDLCPtr, "to_str", rb_dlptr_to_str, -1);
- rb_define_method(rb_cDLCPtr, "inspect", rb_dlptr_inspect, 0);
- rb_define_method(rb_cDLCPtr, "<=>", rb_dlptr_cmp, 1);
- rb_define_method(rb_cDLCPtr, "==", rb_dlptr_eql, 1);
- rb_define_method(rb_cDLCPtr, "eql?", rb_dlptr_eql, 1);
- rb_define_method(rb_cDLCPtr, "+", rb_dlptr_plus, 1);
- rb_define_method(rb_cDLCPtr, "-", rb_dlptr_minus, 1);
- rb_define_method(rb_cDLCPtr, "[]", rb_dlptr_aref, -1);
- rb_define_method(rb_cDLCPtr, "[]=", rb_dlptr_aset, -1);
- 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/depend b/ext/dl/depend
deleted file mode 100644
index d0a3ab8ef0..0000000000
--- a/ext/dl/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-cfunc.o: cfunc.c dl.h $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/util.h
-
-cptr.o: cptr.c dl.h $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h
-
-handle.o: handle.c dl.h $(HDRS) $(ruby_headers)
-
-dl.o: dl.c dl.h $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
deleted file mode 100644
index 23f5d7fe6e..0000000000
--- a/ext/dl/dl.c
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * ext/dl/dl.c
- *
- * documentation:
- * - Vincent Batts (vbatts@hashbangbash.com)
- *
- */
-#include <ruby/ruby.h>
-#include <ruby/io.h>
-#include <ctype.h>
-#include "dl.h"
-
-VALUE rb_mDL;
-VALUE rb_eDLError;
-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)
-{
- return rb_class_new_instance(argc, argv, rb_cDLHandle);
-}
-
-/*
- * call-seq: DL.malloc(size)
- *
- * Allocate +size+ bytes of memory and return the integer memory address
- * for the allocated memory.
- */
-VALUE
-rb_dl_malloc(VALUE self, VALUE size)
-{
- void *ptr;
-
- ptr = (void*)ruby_xmalloc(NUM2INT(size));
- return PTR2NUM(ptr);
-}
-
-/*
- * call-seq: DL.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.
- */
-VALUE
-rb_dl_realloc(VALUE self, VALUE addr, VALUE size)
-{
- void *ptr = NUM2PTR(addr);
-
- ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
- return PTR2NUM(ptr);
-}
-
-/*
- * call-seq: DL.free(addr)
- *
- * Free the memory at address +addr+
- */
-VALUE
-rb_dl_free(VALUE self, VALUE addr)
-{
- void *ptr = NUM2PTR(addr);
-
- ruby_xfree(ptr);
- 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)
-{
- 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)
-{
- return PTR2NUM((void*)val);
-}
-
-static void
-rb_dl_init_callbacks(VALUE dl)
-{
- static const char cb[] = "dl/callback.so";
-
- rb_autoload(dl, rb_intern_const("CdeclCallbackAddrs"), cb);
- rb_autoload(dl, rb_intern_const("CdeclCallbackProcs"), cb);
-#ifdef FUNC_STDCALL
- rb_autoload(dl, rb_intern_const("StdcallCallbackAddrs"), cb);
- rb_autoload(dl, rb_intern_const("StdcallCallbackProcs"), cb);
-#endif
-}
-
-void
-Init_dl(void)
-{
- void Init_dlhandle(void);
- void Init_dlcfunc(void);
- void Init_dlptr(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);
-
- rb_define_module_function(rb_mDL, "dlopen", rb_dl_dlopen, -1);
- rb_define_module_function(rb_mDL, "malloc", rb_dl_malloc, 1);
- 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();
- Init_dlcfunc();
- Init_dlptr();
-}
diff --git a/ext/dl/dl.h b/ext/dl/dl.h
deleted file mode 100644
index f8380a8471..0000000000
--- a/ext/dl/dl.h
+++ /dev/null
@@ -1,217 +0,0 @@
-#ifndef RUBY_DL_H
-#define RUBY_DL_H
-
-#include <ruby.h>
-
-#if !defined(FUNC_CDECL)
-# define FUNC_CDECL(x) x
-#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)(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
-
-#define MAX_CALLBACK 5
-#define DLSTACK_TYPE SIGNED_VALUE
-#define DLSTACK_SIZE (20)
-#define DLSTACK_PROTO \
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE
-#define DLSTACK_ARGS(stack) \
- (stack)[0],(stack)[1],(stack)[2],(stack)[3],(stack)[4],\
- (stack)[5],(stack)[6],(stack)[7],(stack)[8],(stack)[9],\
- (stack)[10],(stack)[11],(stack)[12],(stack)[13],(stack)[14],\
- (stack)[15],(stack)[16],(stack)[17],(stack)[18],(stack)[19]
-
-#define DLSTACK_PROTO0_ void
-#define DLSTACK_PROTO1_ DLSTACK_TYPE
-#define DLSTACK_PROTO2_ DLSTACK_PROTO1_, DLSTACK_TYPE
-#define DLSTACK_PROTO3_ DLSTACK_PROTO2_, DLSTACK_TYPE
-#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
-#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
-#define DLSTACK_PROTO5_ DLSTACK_PROTO4_, DLSTACK_TYPE
-#define DLSTACK_PROTO6_ DLSTACK_PROTO5_, DLSTACK_TYPE
-#define DLSTACK_PROTO7_ DLSTACK_PROTO6_, DLSTACK_TYPE
-#define DLSTACK_PROTO8_ DLSTACK_PROTO7_, DLSTACK_TYPE
-#define DLSTACK_PROTO9_ DLSTACK_PROTO8_, DLSTACK_TYPE
-#define DLSTACK_PROTO10_ DLSTACK_PROTO9_, DLSTACK_TYPE
-#define DLSTACK_PROTO11_ DLSTACK_PROTO10_, DLSTACK_TYPE
-#define DLSTACK_PROTO12_ DLSTACK_PROTO11_, DLSTACK_TYPE
-#define DLSTACK_PROTO13_ DLSTACK_PROTO12_, DLSTACK_TYPE
-#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
-#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
-#define DLSTACK_PROTO15_ DLSTACK_PROTO14_, DLSTACK_TYPE
-#define DLSTACK_PROTO16_ DLSTACK_PROTO15_, DLSTACK_TYPE
-#define DLSTACK_PROTO17_ DLSTACK_PROTO16_, DLSTACK_TYPE
-#define DLSTACK_PROTO18_ DLSTACK_PROTO17_, DLSTACK_TYPE
-#define DLSTACK_PROTO19_ DLSTACK_PROTO18_, DLSTACK_TYPE
-#define DLSTACK_PROTO20_ DLSTACK_PROTO19_, DLSTACK_TYPE
-
-/*
- * Add ",..." as the last argument.
- * This is required for variable argument functions such
- * as fprintf() on x86_64-linux.
- *
- * http://refspecs.linuxfoundation.org/elf/x86_64-abi-0.95.pdf
- * page 19:
- *
- * For calls that may call functions that use varargs or stdargs
- * (prototype-less calls or calls to functions containing ellipsis
- * (...) in the declaration) %al is used as hidden argument to
- * specify the number of SSE registers used.
- */
-#define DLSTACK_PROTO0 void
-#define DLSTACK_PROTO1 DLSTACK_PROTO1_, ...
-#define DLSTACK_PROTO2 DLSTACK_PROTO2_, ...
-#define DLSTACK_PROTO3 DLSTACK_PROTO3_, ...
-#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
-#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
-#define DLSTACK_PROTO5 DLSTACK_PROTO5_, ...
-#define DLSTACK_PROTO6 DLSTACK_PROTO6_, ...
-#define DLSTACK_PROTO7 DLSTACK_PROTO7_, ...
-#define DLSTACK_PROTO8 DLSTACK_PROTO8_, ...
-#define DLSTACK_PROTO9 DLSTACK_PROTO9_, ...
-#define DLSTACK_PROTO10 DLSTACK_PROTO10_, ...
-#define DLSTACK_PROTO11 DLSTACK_PROTO11_, ...
-#define DLSTACK_PROTO12 DLSTACK_PROTO12_, ...
-#define DLSTACK_PROTO13 DLSTACK_PROTO13_, ...
-#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
-#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
-#define DLSTACK_PROTO15 DLSTACK_PROTO15_, ...
-#define DLSTACK_PROTO16 DLSTACK_PROTO16_, ...
-#define DLSTACK_PROTO17 DLSTACK_PROTO17_, ...
-#define DLSTACK_PROTO18 DLSTACK_PROTO18_, ...
-#define DLSTACK_PROTO19 DLSTACK_PROTO19_, ...
-#define DLSTACK_PROTO20 DLSTACK_PROTO20_, ...
-
-#define DLSTACK_ARGS0(stack)
-#define DLSTACK_ARGS1(stack) (stack)[0]
-#define DLSTACK_ARGS2(stack) DLSTACK_ARGS1(stack), (stack)[1]
-#define DLSTACK_ARGS3(stack) DLSTACK_ARGS2(stack), (stack)[2]
-#define DLSTACK_ARGS4(stack) DLSTACK_ARGS3(stack), (stack)[3]
-#define DLSTACK_ARGS5(stack) DLSTACK_ARGS4(stack), (stack)[4]
-#define DLSTACK_ARGS6(stack) DLSTACK_ARGS5(stack), (stack)[5]
-#define DLSTACK_ARGS7(stack) DLSTACK_ARGS6(stack), (stack)[6]
-#define DLSTACK_ARGS8(stack) DLSTACK_ARGS7(stack), (stack)[7]
-#define DLSTACK_ARGS9(stack) DLSTACK_ARGS8(stack), (stack)[8]
-#define DLSTACK_ARGS10(stack) DLSTACK_ARGS9(stack), (stack)[9]
-#define DLSTACK_ARGS11(stack) DLSTACK_ARGS10(stack), (stack)[10]
-#define DLSTACK_ARGS12(stack) DLSTACK_ARGS11(stack), (stack)[11]
-#define DLSTACK_ARGS13(stack) DLSTACK_ARGS12(stack), (stack)[12]
-#define DLSTACK_ARGS14(stack) DLSTACK_ARGS13(stack), (stack)[13]
-#define DLSTACK_ARGS15(stack) DLSTACK_ARGS14(stack), (stack)[14]
-#define DLSTACK_ARGS16(stack) DLSTACK_ARGS15(stack), (stack)[15]
-#define DLSTACK_ARGS17(stack) DLSTACK_ARGS16(stack), (stack)[16]
-#define DLSTACK_ARGS18(stack) DLSTACK_ARGS17(stack), (stack)[17]
-#define DLSTACK_ARGS19(stack) DLSTACK_ARGS18(stack), (stack)[18]
-#define DLSTACK_ARGS20(stack) DLSTACK_ARGS19(stack), (stack)[19]
-
-extern VALUE rb_mDL;
-extern VALUE rb_cDLHandle;
-extern VALUE rb_cDLSymbol;
-extern VALUE rb_eDLError;
-extern VALUE rb_eDLTypeError;
-
-#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)
-
-#define DLALIGN(ptr,offset,align) \
- ((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align))
-
-
-#define DLTYPE_VOID 0
-#define DLTYPE_VOIDP 1
-#define DLTYPE_CHAR 2
-#define DLTYPE_SHORT 3
-#define DLTYPE_INT 4
-#define DLTYPE_LONG 5
-#if HAVE_LONG_LONG
-#define DLTYPE_LONG_LONG 6
-#endif
-#define DLTYPE_FLOAT 7
-#define DLTYPE_DOUBLE 8
-#define MAX_DLTYPE 9
-
-#if SIZEOF_VOIDP == SIZEOF_LONG
-# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
-# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
-#else
-/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
-# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
-# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
-#endif
-
-#define BOOL2INT(x) (((x) == Qtrue)?1:0)
-#define INT2BOOL(x) ((x)?Qtrue:Qfalse)
-
-typedef void (*freefunc_t)(void*);
-
-struct dl_handle {
- void *ptr;
- int open;
- int enable_close;
-};
-
-
-struct cfunc_data {
- void *ptr;
- char *name;
- int type;
- ID calltype;
- VALUE wrap;
-};
-extern ID rbdl_id_cdecl;
-extern ID rbdl_id_stdcall;
-#define CFUNC_CDECL (rbdl_id_cdecl)
-#define CFUNC_STDCALL (rbdl_id_stdcall)
-
-struct ptr_data {
- void *ptr;
- long size;
- freefunc_t free;
- VALUE wrap[2];
-};
-
-#define RDL_HANDLE(obj) ((struct dl_handle *)(DATA_PTR(obj)))
-#define RCFUNC_DATA(obj) ((struct cfunc_data *)(DATA_PTR(obj)))
-#define RPTR_DATA(obj) ((struct ptr_data *)(DATA_PTR(obj)))
-
-VALUE rb_dlcfunc_new(void (*func)(), int dltype, const char * name, ID calltype);
-int rb_dlcfunc_kind_p(VALUE func);
-VALUE rb_dlptr_new(void *ptr, long size, freefunc_t func);
-VALUE rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func);
-VALUE rb_dlptr_malloc(long size, freefunc_t func);
-
-#endif
diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb
deleted file mode 100644
index 4ef46f85fb..0000000000
--- a/ext/dl/extconf.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'mkmf'
-
-if RbConfig::CONFIG['GCC'] == 'yes'
- (have_macro("__clang__") ? $LDFLAGS : $CFLAGS) << " -fno-defer-pop"
- $CFLAGS << " -fno-omit-frame-pointer"
-end
-
-$INSTALLFILES = [
- ["dl.h", "$(HDRDIR)"],
-]
-
-check = true
-if( have_header("dlfcn.h") )
- have_library("dl")
- check &&= have_func("dlopen")
- check &&= have_func("dlclose")
- check &&= have_func("dlsym")
- have_func("dlerror")
-elsif( have_header("windows.h") )
- check &&= have_func("LoadLibrary")
- check &&= have_func("FreeLibrary")
- check &&= have_func("GetProcAddress")
-else
- check = false
-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
deleted file mode 100644
index ef182e816f..0000000000
--- a/ext/dl/handle.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/* -*- C -*-
- * $Id$
- */
-
-#include <ruby.h>
-#include "dl.h"
-
-VALUE rb_cDLHandle;
-
-#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
-dlhandle_free(void *ptr)
-{
- struct dl_handle *dlhandle = ptr;
- if( dlhandle->ptr && dlhandle->open && dlhandle->enable_close ){
- dlclose(dlhandle->ptr);
- }
-}
-
-static size_t
-dlhandle_memsize(const void *ptr)
-{
- return ptr ? sizeof(struct dl_handle) : 0;
-}
-
-static const rb_data_type_t dlhandle_data_type = {
- "dl/handle",
- {0, dlhandle_free, dlhandle_memsize,},
-};
-
-/*
- * call-seq: close
- *
- * Close this DL::Handle. Calling close more than once will raise a
- * DL::DLError exception.
- */
-VALUE
-rb_dlhandle_close(VALUE self)
-{
- struct dl_handle *dlhandle;
-
- TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
- if(dlhandle->open) {
- int ret = dlclose(dlhandle->ptr);
- dlhandle->open = 0;
-
- /* Check dlclose for successful return value */
- if(ret) {
-#if defined(HAVE_DLERROR)
- rb_raise(rb_eDLError, "%s", dlerror());
-#else
- rb_raise(rb_eDLError, "could not close handle");
-#endif
- }
- return INT2NUM(ret);
- }
- rb_raise(rb_eDLError, "dlclose() called too many times");
-
- UNREACHABLE;
-}
-
-VALUE
-rb_dlhandle_s_allocate(VALUE klass)
-{
- VALUE obj;
- struct dl_handle *dlhandle;
-
- obj = TypedData_Make_Struct(rb_cDLHandle, struct dl_handle, &dlhandle_data_type, dlhandle);
- dlhandle->ptr = 0;
- dlhandle->open = 0;
- dlhandle->enable_close = 0;
-
- return obj;
-}
-
-static VALUE
-predefined_dlhandle(void *handle)
-{
- VALUE obj = rb_dlhandle_s_allocate(rb_cDLHandle);
- struct dl_handle *dlhandle = DATA_PTR(obj);
-
- dlhandle->ptr = handle;
- dlhandle->open = 1;
- OBJ_FREEZE(obj);
- return obj;
-}
-
-/*
- * call-seq:
- * initialize(lib = nil, flags = DL::RTLD_LAZY | DL::RTLD_GLOBAL)
- *
- * Create a new handler that opens library named +lib+ with +flags+. If no
- * library is specified, RTLD_DEFAULT is used.
- */
-VALUE
-rb_dlhandle_initialize(int argc, VALUE argv[], VALUE self)
-{
- void *ptr;
- struct dl_handle *dlhandle;
- 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_dlhandle_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_eDLError, "%s", err);
- }
-#else
- if( !ptr ){
- err = dlerror();
- rb_raise(rb_eDLError, "%s", err);
- }
-#endif
- TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
- if( dlhandle->ptr && dlhandle->open && dlhandle->enable_close ){
- dlclose(dlhandle->ptr);
- }
- dlhandle->ptr = ptr;
- dlhandle->open = 1;
- dlhandle->enable_close = 0;
-
- if( rb_block_given_p() ){
- rb_ensure(rb_yield, self, rb_dlhandle_close, self);
- }
-
- return Qnil;
-}
-
-/*
- * call-seq: enable_close
- *
- * Enable a call to dlclose() when this DL::Handle is garbage collected.
- */
-VALUE
-rb_dlhandle_enable_close(VALUE self)
-{
- struct dl_handle *dlhandle;
-
- TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
- dlhandle->enable_close = 1;
- return Qnil;
-}
-
-/*
- * call-seq: disable_close
- *
- * Disable a call to dlclose() when this DL::Handle is garbage collected.
- */
-VALUE
-rb_dlhandle_disable_close(VALUE self)
-{
- struct dl_handle *dlhandle;
-
- TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
- dlhandle->enable_close = 0;
- return Qnil;
-}
-
-/*
- * call-seq: close_enabled?
- *
- * Returns +true+ if dlclose() will be called when this DL::Handle is
- * garbage collected.
- */
-static VALUE
-rb_dlhandle_close_enabled_p(VALUE self)
-{
- struct dl_handle *dlhandle;
-
- TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
-
- if(dlhandle->enable_close) return Qtrue;
- return Qfalse;
-}
-
-/*
- * call-seq: to_i
- *
- * Returns the memory address for this handle.
- */
-VALUE
-rb_dlhandle_to_i(VALUE self)
-{
- struct dl_handle *dlhandle;
-
- TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
- return PTR2NUM(dlhandle);
-}
-
-static VALUE dlhandle_sym(void *handle, const char *symbol);
-
-/*
- * Document-method: sym
- * Document-method: []
- *
- * call-seq: sym(name)
- *
- * Get the address as an Integer for the function named +name+.
- */
-VALUE
-rb_dlhandle_sym(VALUE self, VALUE sym)
-{
- struct dl_handle *dlhandle;
-
- TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
- if( ! dlhandle->open ){
- rb_raise(rb_eDLError, "closed handle");
- }
-
- return dlhandle_sym(dlhandle->ptr, StringValueCStr(sym));
-}
-
-#ifndef RTLD_NEXT
-#define RTLD_NEXT NULL
-#endif
-#ifndef RTLD_DEFAULT
-#define RTLD_DEFAULT NULL
-#endif
-
-/*
- * Document-method: sym
- * Document-method: []
- *
- * 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.
- */
-VALUE
-rb_dlhandle_s_sym(VALUE self, VALUE sym)
-{
- return dlhandle_sym(RTLD_NEXT, StringValueCStr(sym));
-}
-
-static VALUE
-dlhandle_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_eDLError, "unknown symbol \"%s\"", name);
- }
-
- return PTR2NUM(func);
-}
-
-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);
- rb_define_method(rb_cDLHandle, "close", rb_dlhandle_close, 0);
- rb_define_method(rb_cDLHandle, "sym", rb_dlhandle_sym, 1);
- rb_define_method(rb_cDLHandle, "[]", rb_dlhandle_sym, 1);
- rb_define_method(rb_cDLHandle, "disable_close", rb_dlhandle_disable_close, 0);
- rb_define_method(rb_cDLHandle, "enable_close", rb_dlhandle_enable_close, 0);
- rb_define_method(rb_cDLHandle, "close_enabled?", rb_dlhandle_close_enabled_p, 0);
-}
-
-/* mode: c; tab-with=8; sw=4; ts=8; noexpandtab: */
diff --git a/ext/dl/lib/dl.rb b/ext/dl/lib/dl.rb
deleted file mode 100644
index 8e615ae718..0000000000
--- a/ext/dl/lib/dl.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'dl.so'
-
-begin
- require 'fiddle' unless Object.const_defined?(:Fiddle)
-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
-end
diff --git a/ext/dl/lib/dl/callback.rb b/ext/dl/lib/dl/callback.rb
deleted file mode 100644
index 1722d3c6b9..0000000000
--- a/ext/dl/lib/dl/callback.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-require 'dl'
-require 'thread'
-
-module DL
- # The mutual exclusion (Mutex) semaphore for the DL module
- SEM = Mutex.new # :nodoc:
-
- if DL.fiddle?
- # 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)
- if( argc < 0 )
- raise(ArgumentError, "arity should not be less than 0.")
- end
- addr = nil
-
- if DL.fiddle?
- abi ||= Fiddle::Function::DEFAULT
- closure = Fiddle::Closure::BlockCaller.new(ty, [TYPE_VOIDP] * argc, abi, &cbp)
- proc_entry[closure.to_i] = closure
- addr = closure.to_i
- else
- SEM.synchronize{
- ary = proc_entry[ty]
- (0...MAX_CALLBACK).each{|n|
- idx = (n * DLSTACK_SIZE) + argc
- if( ary[idx].nil? )
- ary[idx] = cbp
- addr = addr_entry[ty][idx]
- break
- end
- }
- }
- end
-
- addr
- end
-
- def set_cdecl_callback(ty, argc, &cbp)
- set_callback_internal(CdeclCallbackProcs, CdeclCallbackAddrs, argc, ty, &cbp)
- end
-
- def set_stdcall_callback(ty, argc, &cbp)
- if DL.fiddle?
- set_callback_internal(StdcallCallbackProcs, StdcallCallbackAddrs, argc, ty, Fiddle::Function::STDCALL, &cbp)
- else
- set_callback_internal(StdcallCallbackProcs, StdcallCallbackAddrs, argc, ty, &cbp)
- end
- end
-
- def remove_callback_internal(proc_entry, addr_entry, addr, ctype = nil)
- if DL.fiddle?
- addr = addr.to_i
- return false unless proc_entry.key?(addr)
- proc_entry.delete(addr)
- true
- else
- index = nil
- if( ctype )
- addr_entry[ctype].each_with_index{|xaddr, idx|
- if( xaddr == addr )
- index = idx
- end
- }
- else
- addr_entry.each{|ty,entry|
- entry.each_with_index{|xaddr, idx|
- if( xaddr == addr )
- index = idx
- end
- }
- }
- end
- if( index and proc_entry[ctype][index] )
- proc_entry[ctype][index] = nil
- return true
- else
- return false
- end
- end
- end
-
- def remove_cdecl_callback(addr, ctype = nil)
- remove_callback_internal(CdeclCallbackProcs, CdeclCallbackAddrs, addr, ctype)
- end
-
- def remove_stdcall_callback(addr, ctype = nil)
- remove_callback_internal(StdcallCallbackProcs, StdcallCallbackAddrs, addr, ctype)
- end
-
- alias set_callback set_cdecl_callback
- alias remove_callback remove_cdecl_callback
-end
diff --git a/ext/dl/lib/dl/cparser.rb b/ext/dl/lib/dl/cparser.rb
deleted file mode 100644
index e70e0f1dc1..0000000000
--- a/ext/dl/lib/dl/cparser.rb
+++ /dev/null
@@ -1,156 +0,0 @@
-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*/)
- 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
- #
- # 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
- 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+, 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
- 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/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
deleted file mode 100644
index 543711f651..0000000000
--- a/ext/dl/lib/dl/func.rb
+++ /dev/null
@@ -1,251 +0,0 @@
-require 'dl'
-require 'dl/callback'
-require 'dl/stack'
-require 'dl/value'
-require 'thread'
-
-module DL
- parent = DL.fiddle? ? Fiddle::Function : Object
-
- class Function < parent
- include DL
- include ValueUtil
-
- if DL.fiddle?
- # :stopdoc:
- CALL_TYPE_TO_ABI = Hash.new { |h, k|
- raise RuntimeError, "unsupported call type: #{k}"
- }.merge({ :stdcall =>
- (Fiddle::Function::STDCALL rescue Fiddle::Function::DEFAULT),
- :cdecl => Fiddle::Function::DEFAULT,
- nil => Fiddle::Function::DEFAULT
- }).freeze
- private_constant :CALL_TYPE_TO_ABI
- # :startdoc:
-
- def self.call_type_to_abi(call_type) # :nodoc:
- CALL_TYPE_TO_ABI[call_type]
- end
- private_class_method :call_type_to_abi
-
- class FiddleClosureCFunc < Fiddle::Closure # :nodoc: all
- def initialize ctype, arg, abi, name
- @name = name
- super(ctype, arg, abi)
- end
- def name
- @name
- end
- def ptr
- to_i
- end
- end
- private_constant :FiddleClosureCFunc
-
- def self.class_fiddle_closure_cfunc # :nodoc:
- FiddleClosureCFunc
- end
- private_class_method :class_fiddle_closure_cfunc
- end
-
- def initialize cfunc, argtypes, abi = nil, &block
- if DL.fiddle?
- abi ||= CALL_TYPE_TO_ABI[(cfunc.calltype rescue nil)]
- if block_given?
- @cfunc = Class.new(FiddleClosureCFunc) {
- define_method(:call, block)
- }.new(cfunc.ctype, argtypes, abi, cfunc.name)
- else
- @cfunc = cfunc
- end
-
- @args = argtypes
- super(@cfunc, @args.reject { |x| x == TYPE_VOID }, cfunc.ctype, abi)
- else
- @cfunc = cfunc
- @stack = Stack.new(argtypes.collect{|ty| ty.abs})
- if( @cfunc.ctype < 0 )
- @cfunc.ctype = @cfunc.ctype.abs
- @unsigned = true
- else
- @unsigned = false
- end
- if block_given?
- bind(&block)
- end
- end
- end
-
- def to_i()
- @cfunc.to_i
- end
-
- def name
- @cfunc.name
- end
-
- def call(*args, &block)
- if DL.fiddle?
- if block_given?
- args.find { |a| DL::Function === a }.bind_at_call(&block)
- end
- super
- else
- funcs = []
- if $SAFE >= 1 && args.any? { |x| x.tainted? }
- raise SecurityError, "tainted parameter not allowed"
- end
- _args = wrap_args(args, @stack.types, funcs, &block)
- r = @cfunc.call(@stack.pack(_args))
- funcs.each{|f| f.unbind_at_call()}
- return wrap_result(r)
- end
- end
-
- def wrap_result(r)
- case @cfunc.ctype
- when TYPE_VOIDP
- r = CPtr.new(r)
- else
- if( @unsigned )
- r = unsigned_value(r, @cfunc.ctype)
- end
- end
- r
- end
-
- def bind(&block)
- if DL.fiddle?
- @cfunc = Class.new(FiddleClosureCFunc) {
- def initialize ctype, args, abi, name, block
- super(ctype, args, abi, name)
- @block = block
- end
-
- def call *args
- @block.call(*args)
- end
- }.new(@cfunc.ctype, @args, abi, name, block)
- @ptr = @cfunc
- return nil
- else
- 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)
- @stack.types.each_with_index{|ty, idx|
- case ty
- when TYPE_VOIDP
- ary[idx] = CPtr.new(ary[idx])
- end
- }
- r = block.call(*ary)
- wrap_arg(r, @cfunc.ctype, [])
- }
- case @cfunc.calltype
- when :cdecl
- @cfunc.ptr = set_cdecl_callback(@cfunc.ctype, @stack.size, &cb)
- when :stdcall
- @cfunc.ptr = set_stdcall_callback(@cfunc.ctype, @stack.size, &cb)
- else
- raise(RuntimeError, "unsupported calltype: #{@cfunc.calltype}")
- end
- if( @cfunc.ptr == 0 )
- raise(RuntimeException, "can't bind C function.")
- end
- end
- end
- end
-
- def unbind()
- if DL.fiddle? then
- if @cfunc.kind_of?(Fiddle::Closure) and @cfunc.ptr != 0 then
- call_type = case abi
- when CALL_TYPE_TO_ABI[nil]
- nil
- when CALL_TYPE_TO_ABI[:stdcall]
- :stdcall
- else
- raise(RuntimeError, "unsupported abi: #{abi}")
- end
- @cfunc = CFunc.new(0, @cfunc.ctype, name, call_type)
- return 0
- elsif @cfunc.ptr != 0 then
- @cfunc.ptr = 0
- return 0
- else
- return nil
- end
- end
- if( @cfunc.ptr != 0 )
- case @cfunc.calltype
- when :cdecl
- remove_cdecl_callback(@cfunc.ptr, @cfunc.ctype)
- when :stdcall
- remove_stdcall_callback(@cfunc.ptr, @cfunc.ctype)
- else
- raise(RuntimeError, "unsupported calltype: #{@cfunc.calltype}")
- end
- @cfunc.ptr = 0
- end
- end
-
- def bound?()
- @cfunc.ptr != 0
- end
-
- def bind_at_call(&block)
- bind(&block)
- end
-
- def unbind_at_call()
- end
- end
-
- class TempFunction < Function
- def bind_at_call(&block)
- bind(&block)
- end
-
- def unbind_at_call()
- unbind()
- end
- end
-
- class CarriedFunction < Function
- def initialize(cfunc, argtypes, n)
- super(cfunc, argtypes)
- @carrier = []
- @index = n
- @mutex = Mutex.new
- end
-
- def create_carrier(data)
- ary = []
- userdata = [ary, data]
- @mutex.lock()
- @carrier.push(userdata)
- return dlwrap(userdata)
- end
-
- def bind_at_call(&block)
- userdata = @carrier[-1]
- userdata[0].push(block)
- bind{|*args|
- ptr = args[@index]
- if( !ptr )
- raise(RuntimeError, "The index of userdata should be lower than #{args.size}.")
- end
- userdata = dlunwrap(Integer(ptr))
- args[@index] = userdata[1]
- userdata[0][0].call(*args)
- }
- @mutex.unlock()
- end
- end
-end
diff --git a/ext/dl/lib/dl/import.rb b/ext/dl/lib/dl/import.rb
deleted file mode 100644
index 6f157ccf28..0000000000
--- a/ext/dl/lib/dl/import.rb
+++ /dev/null
@@ -1,268 +0,0 @@
-require 'dl'
-require 'dl/func.rb'
-require 'dl/struct.rb'
-require 'dl/cparser.rb'
-
-module DL
- class CompositeHandler
- def initialize(handlers)
- @handlers = handlers
- end
-
- def handlers()
- @handlers
- end
-
- def sym(symbol)
- @handlers.each{|handle|
- if( handle )
- begin
- addr = handle.sym(symbol)
- return addr
- rescue DLError
- end
- end
- }
- return nil
- end
-
- def [](symbol)
- sym(symbol)
- 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
- extend Importer
-
- def dlload(*libs)
- handles = libs.collect{|lib|
- case lib
- when nil
- nil
- when Handle
- lib
- when Importer
- lib.handlers
- else
- begin
- DL.dlopen(lib)
- rescue DLError
- raise(DLError, "can't load #{lib}")
- end
- end
- }.flatten()
- @handler = CompositeHandler.new(handles)
- @func_map = {}
- @type_alias = {}
- end
-
- def typealias(alias_type, orig_type)
- @type_alias[alias_type] = orig_type
- end
-
- def sizeof(ty)
- @type_alias ||= nil
- 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
-
- 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])
- 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
-
- 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]
- when :bind, nil
- f = bind_function(name, ctype, argtype, h[:call_type], &blk)
- when :temp, :temporal
- f = create_temp_function(name, ctype, argtype, h[:call_type])
- when :carried
- f = create_carried_function(name, ctype, argtype, h[:call_type], h[:carrier])
- 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)
- @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
-
- def [](name)
- @func_map[name]
- end
-
- 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
-
- def import_value(ty, addr)
- s = struct([ty + " value"])
- ptr = s.new(addr)
- return ptr
- end
-
- def handler
- defined?(@handler) or raise "call dlload before importing symbols and functions"
- @handler
- end
-
- def import_symbol(name)
- addr = handler.sym(name)
- if( !addr )
- raise(DLError, "cannot find the symbol: #{name}")
- end
- CPtr.new(addr)
- end
-
- 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(CFunc.new(addr, ctype, name, call_type || :cdecl), argtype)
- end
-
- def bind_function(name, ctype, argtype, call_type = nil, &block)
- if DL.fiddle?
- klass = Function.instance_eval { class_fiddle_closure_cfunc }
- abi = Function.instance_eval { call_type_to_abi(call_type) }
- closure = Class.new(klass) {
- define_method(:call, block)
- }.new(ctype, argtype, abi, name)
-
- Function.new(closure, argtype, abi)
- else
- f = Function.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype)
- f.bind(&block)
- f
- end
- end
-
- def create_temp_function(name, ctype, argtype, call_type = nil)
- TempFunction.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype)
- end
-
- def create_carried_function(name, ctype, argtype, call_type = nil, n = 0)
- CarriedFunction.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype, n)
- end
- end
-end
diff --git a/ext/dl/lib/dl/pack.rb b/ext/dl/lib/dl/pack.rb
deleted file mode 100644
index 7fbc802b0f..0000000000
--- a/ext/dl/lib/dl/pack.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-require 'dl'
-
-module DL
- module PackInfo
- 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
- 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/dl/lib/dl/stack.rb b/ext/dl/lib/dl/stack.rb
deleted file mode 100644
index dc22378fcb..0000000000
--- a/ext/dl/lib/dl/stack.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-require 'dl'
-
-module DL
- class Stack
- def self.[](*types)
- new(types)
- end
-
- def initialize(types)
- parse_types(types)
- end
-
- def size()
- @size
- end
-
- def types()
- @types
- end
-
- def pack(ary)
- case SIZEOF_VOIDP
- when SIZEOF_LONG
- ary.pack(@template).unpack('l!*')
- when SIZEOF_LONG_LONG
- ary.pack(@template).unpack('q*')
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
- end
-
- def unpack(ary)
- case SIZEOF_VOIDP
- when SIZEOF_LONG
- ary.pack('l!*').unpack(@template)
- when SIZEOF_LONG_LONG
- ary.pack('q*').unpack(@template)
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
- end
-
- private
-
- def align(addr, align)
- d = addr % align
- if( d == 0 )
- addr
- else
- addr + (align - d)
- end
- end
-
- ALIGN_MAP = {
- TYPE_VOIDP => ALIGN_VOIDP,
- TYPE_CHAR => ALIGN_VOIDP,
- TYPE_SHORT => ALIGN_VOIDP,
- TYPE_INT => ALIGN_VOIDP,
- TYPE_LONG => ALIGN_VOIDP,
- TYPE_FLOAT => ALIGN_FLOAT,
- TYPE_DOUBLE => ALIGN_DOUBLE,
- }
-
- 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",
- }
-
- 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,
- }
- if defined?(TYPE_LONG_LONG)
- ALIGN_MAP[TYPE_LONG_LONG] = ALIGN_LONG_LONG
- PACK_MAP[TYPE_LONG_LONG] = "q"
- SIZE_MAP[TYPE_LONG_LONG] = SIZEOF_LONG_LONG
- end
-
- def parse_types(types)
- @types = types
- @template = ""
- addr = 0
- types.each{|t|
- addr = add_padding(addr, ALIGN_MAP[t])
- @template << PACK_MAP[t]
- addr += SIZE_MAP[t]
- }
- addr = add_padding(addr, ALIGN_MAP[SIZEOF_VOIDP])
- if( addr % SIZEOF_VOIDP == 0 )
- @size = addr / SIZEOF_VOIDP
- else
- @size = (addr / SIZEOF_VOIDP) + 1
- end
- end
-
- def add_padding(addr, align)
- orig_addr = addr
- addr = align(orig_addr, align)
- d = addr - orig_addr
- if( d > 0 )
- @template << "x#{d}"
- end
- addr
- end
- end
-end
diff --git a/ext/dl/lib/dl/struct.rb b/ext/dl/lib/dl/struct.rb
deleted file mode 100644
index e2d91a6d14..0000000000
--- a/ext/dl/lib/dl/struct.rb
+++ /dev/null
@@ -1,236 +0,0 @@
-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|
- @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 = DL.malloc(#{size})
- new(addr)
- end
- EOS
- return new_class
- end
- module_function :create
- end
-
- # 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 = 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 = 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. 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)
- 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 = 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
deleted file mode 100644
index d5724e407b..0000000000
--- a/ext/dl/lib/dl/types.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-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) # :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"
- typealias "ATOM", "int"
- typealias "BYTE", "unsigned char"
- typealias "PBYTE", "unsigned char *"
- typealias "UINT", "unsigned int"
- typealias "ULONG", "unsigned long"
- typealias "UCHAR", "unsigned char"
- typealias "HANDLE", "uintptr_t"
- typealias "PHANDLE", "void*"
- typealias "PVOID", "void*"
- typealias "LPCSTR", "char*"
- typealias "LPSTR", "char*"
- typealias "HINSTANCE", "unsigned int"
- typealias "HDC", "unsigned int"
- typealias "HWND", "unsigned int"
- }
- end
- 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) # :nodoc:
- m.module_eval{
- typealias "uint", "unsigned int"
- typealias "u_int", "unsigned int"
- typealias "ulong", "unsigned long"
- typealias "u_long", "unsigned long"
- }
- end
- module_function :included
- end
-end
diff --git a/ext/dl/lib/dl/value.rb b/ext/dl/lib/dl/value.rb
deleted file mode 100644
index 147d9d120a..0000000000
--- a/ext/dl/lib/dl/value.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-require 'dl'
-
-module DL
- module ValueUtil
- 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)
- require 'dl/func'
-
- funcs ||= []
- case arg
- when nil
- return 0
- when CPtr
- return arg.to_i
- when IO
- case ty
- when TYPE_VOIDP
- return CPtr[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/etc/depend b/ext/etc/depend
index 2db89d969c..a73a18465a 100644
--- a/ext/etc/depend
+++ b/ext/etc/depend
@@ -1,3 +1,9 @@
-etc.o : etc.c $(HDRS) $(ruby_headers) \
+etc.o : etc.c constdefs.h $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
$(hdrdir)/ruby/encoding.h \
$(hdrdir)/ruby/oniguruma.h
+
+constdefs.h : $(srcdir)/mkconstants.rb
+ @echo "generating constant definitions"
+ @$(RUBY) $(srcdir)/mkconstants.rb -o constdefs.h
+
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 18d425a8bf..ddd9441f9d 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -9,6 +9,7 @@
#include "ruby.h"
#include "ruby/encoding.h"
+#include "ruby/io.h"
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
@@ -23,6 +24,16 @@
#include <grp.h>
#endif
+#include <errno.h>
+
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
+#ifdef HAVE_SCHED_GETAFFINITY
+#include <sched.h>
+#endif
+
static VALUE sPasswd;
#ifdef HAVE_GETGRENT
static VALUE sGroup;
@@ -33,6 +44,7 @@ static VALUE sGroup;
#ifndef CSIDL_COMMON_APPDATA
#define CSIDL_COMMON_APPDATA 35
#endif
+#define HAVE_UNAME 1
#endif
#ifndef _WIN32
@@ -40,6 +52,8 @@ char *getenv();
#endif
char *getlogin();
+#include "constdefs.h"
+
/* call-seq:
* getlogin -> String
*
@@ -67,8 +81,15 @@ etc_getlogin(VALUE obj)
login = getenv("USER");
#endif
- if (login)
- return rb_tainted_str_new2(login);
+ if (login) {
+#ifdef _WIN32
+ rb_encoding *extenc = rb_utf8_encoding();
+#else
+ rb_encoding *extenc = rb_locale_encoding();
+#endif
+ return rb_external_str_new_with_enc(login, strlen(login), extenc);
+ }
+
return Qnil;
}
@@ -220,7 +241,7 @@ passwd_iterate(void)
struct passwd *pw;
setpwent();
- while (pw = getpwent()) {
+ while ((pw = getpwent()) != 0) {
rb_yield(setup_passwd(pw));
}
return Qnil;
@@ -266,7 +287,7 @@ etc_passwd(VALUE obj)
if (rb_block_given_p()) {
each_passwd();
}
- else if (pw = getpwent()) {
+ else if ((pw = getpwent()) != 0) {
return setup_passwd(pw);
}
#endif
@@ -348,7 +369,7 @@ etc_getpwent(VALUE obj)
#ifdef HAVE_GETPWENT
struct passwd *pw;
- if (pw = getpwent()) {
+ if ((pw = getpwent()) != 0) {
return setup_passwd(pw);
}
#endif
@@ -464,7 +485,7 @@ group_iterate(void)
struct group *pw;
setgrent();
- while (pw = getgrent()) {
+ while ((pw = getgrent()) != 0) {
rb_yield(setup_group(pw));
}
return Qnil;
@@ -506,7 +527,7 @@ etc_group(VALUE obj)
if (rb_block_given_p()) {
each_group();
}
- else if (grp = getgrent()) {
+ else if ((grp = getgrent()) != 0) {
return setup_group(grp);
}
#endif
@@ -585,7 +606,7 @@ etc_getgrent(VALUE obj)
#ifdef HAVE_GETGRENT
struct group *gr;
- if (gr = getgrent()) {
+ if ((gr = getgrent()) != 0) {
return setup_group(gr);
}
#endif
@@ -630,12 +651,382 @@ etc_systmpdir(void)
if (!len) return Qnil;
tmpdir = rb_w32_conv_from_wchar(path, rb_filesystem_encoding());
#else
- tmpdir = rb_filesystem_str_new_cstr("/tmp");
+ const char default_tmp[] = "/tmp";
+ const char *tmpstr = default_tmp;
+ size_t tmplen = strlen(default_tmp);
+# if defined _CS_DARWIN_USER_TEMP_DIR
+ #ifndef MAXPATHLEN
+ #define MAXPATHLEN 1024
+ #endif
+ char path[MAXPATHLEN];
+ size_t len;
+ len = confstr(_CS_DARWIN_USER_TEMP_DIR, path, sizeof(path));
+ if (len > 0) {
+ tmpstr = path;
+ tmplen = len - 1;
+ }
+# endif
+ tmpdir = rb_filesystem_str_new(tmpstr, tmplen);
#endif
FL_UNSET(tmpdir, FL_TAINT);
return tmpdir;
}
+#ifdef HAVE_UNAME
+/*
+ * Returns the system information obtained by uname system call.
+ *
+ * The return value is a hash which has 5 keys at least:
+ * :sysname, :nodename, :release, :version, :machine
+ *
+ * Example:
+ *
+ * require 'etc'
+ * require 'pp'
+ *
+ * pp Etc.uname
+ * #=> {:sysname=>"Linux",
+ * # :nodename=>"boron",
+ * # :release=>"2.6.18-6-xen-686",
+ * # :version=>"#1 SMP Thu Nov 5 19:54:42 UTC 2009",
+ * # :machine=>"i686"}
+ *
+ */
+static VALUE
+etc_uname(VALUE obj)
+{
+#ifdef _WIN32
+ OSVERSIONINFOW v;
+ SYSTEM_INFO s;
+ const char *sysname, *mach;
+ VALUE result, release, version;
+ VALUE vbuf, nodename = Qnil;
+ DWORD len = 0;
+ WCHAR *buf;
+
+ v.dwOSVersionInfoSize = sizeof(v);
+ if (!GetVersionExW(&v))
+ rb_sys_fail("GetVersionEx");
+
+ result = rb_hash_new();
+ switch (v.dwPlatformId) {
+ case VER_PLATFORM_WIN32s:
+ sysname = "Win32s";
+ break;
+ case VER_PLATFORM_WIN32_NT:
+ sysname = "Windows_NT";
+ break;
+ case VER_PLATFORM_WIN32_WINDOWS:
+ default:
+ sysname = "Windows";
+ break;
+ }
+ rb_hash_aset(result, ID2SYM(rb_intern("sysname")), rb_str_new_cstr(sysname));
+ release = rb_sprintf("%lu.%lu.%lu", v.dwMajorVersion, v.dwMinorVersion, v.dwBuildNumber);
+ rb_hash_aset(result, ID2SYM(rb_intern("release")), release);
+ version = rb_sprintf("%s Version %"PRIsVALUE": %"PRIsVALUE, sysname, release,
+ rb_w32_conv_from_wchar(v.szCSDVersion, rb_utf8_encoding()));
+ rb_hash_aset(result, ID2SYM(rb_intern("version")), version);
+
+# if defined _MSC_VER && _MSC_VER < 1300
+# define GET_COMPUTER_NAME(ptr, plen) GetComputerNameW(ptr, plen)
+# else
+# define GET_COMPUTER_NAME(ptr, plen) GetComputerNameExW(ComputerNameDnsFullyQualified, ptr, plen)
+# endif
+ GET_COMPUTER_NAME(NULL, &len);
+ buf = ALLOCV_N(WCHAR, vbuf, len);
+ if (GET_COMPUTER_NAME(buf, &len)) {
+ nodename = rb_w32_conv_from_wchar(buf, rb_utf8_encoding());
+ }
+ ALLOCV_END(vbuf);
+ if (NIL_P(nodename)) nodename = rb_str_new(0, 0);
+ rb_hash_aset(result, ID2SYM(rb_intern("nodename")), nodename);
+
+# ifndef PROCESSOR_ARCHITECTURE_AMD64
+# define PROCESSOR_ARCHITECTURE_AMD64 9
+# endif
+# ifndef PROCESSOR_ARCHITECTURE_IA64
+# define PROCESSOR_ARCHITECTURE_IA64 6
+# endif
+# ifndef PROCESSOR_ARCHITECTURE_INTEL
+# define PROCESSOR_ARCHITECTURE_INTEL 0
+# endif
+ GetSystemInfo(&s);
+ switch (s.wProcessorArchitecture) {
+ case PROCESSOR_ARCHITECTURE_AMD64:
+ mach = "x64";
+ break;
+ case PROCESSOR_ARCHITECTURE_ARM:
+ mach = "ARM";
+ break;
+ case PROCESSOR_ARCHITECTURE_IA64:
+ mach = "IA64";
+ break;
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ mach = "x86";
+ break;
+ default:
+ mach = "unknown";
+ break;
+ }
+
+ rb_hash_aset(result, ID2SYM(rb_intern("machine")), rb_str_new_cstr(mach));
+#else
+ struct utsname u;
+ int ret;
+ VALUE result;
+
+ ret = uname(&u);
+ if (ret == -1)
+ rb_sys_fail("uname");
+
+ result = rb_hash_new();
+ rb_hash_aset(result, ID2SYM(rb_intern("sysname")), rb_str_new_cstr(u.sysname));
+ rb_hash_aset(result, ID2SYM(rb_intern("nodename")), rb_str_new_cstr(u.nodename));
+ rb_hash_aset(result, ID2SYM(rb_intern("release")), rb_str_new_cstr(u.release));
+ rb_hash_aset(result, ID2SYM(rb_intern("version")), rb_str_new_cstr(u.version));
+ rb_hash_aset(result, ID2SYM(rb_intern("machine")), rb_str_new_cstr(u.machine));
+#endif
+
+ return result;
+}
+#else
+#define etc_uname rb_f_notimplement
+#endif
+
+#ifdef HAVE_SYSCONF
+/*
+ * Returns system configuration variable using sysconf().
+ *
+ * _name_ should be a constant under <code>Etc</code> which begins with <code>SC_</code>.
+ *
+ * The return value is an integer or nil.
+ * nil means indefinite limit. (sysconf() returns -1 but errno is not set.)
+ *
+ * Etc.sysconf(Etc::SC_ARG_MAX) #=> 2097152
+ * Etc.sysconf(Etc::SC_LOGIN_NAME_MAX) #=> 256
+ *
+ */
+static VALUE
+etc_sysconf(VALUE obj, VALUE arg)
+{
+ int name;
+ long ret;
+
+ name = NUM2INT(arg);
+
+ errno = 0;
+ ret = sysconf(name);
+ if (ret == -1) {
+ if (errno == 0) /* no limit */
+ return Qnil;
+ rb_sys_fail("sysconf");
+ }
+ return LONG2NUM(ret);
+}
+#else
+#define etc_sysconf rb_f_notimplement
+#endif
+
+#ifdef HAVE_CONFSTR
+/*
+ * Returns system configuration variable using confstr().
+ *
+ * _name_ should be a constant under <code>Etc</code> which begins with <code>CS_</code>.
+ *
+ * The return value is a string or nil.
+ * nil means no configuration-defined value. (confstr() returns 0 but errno is not set.)
+ *
+ * Etc.confstr(Etc::CS_PATH) #=> "/bin:/usr/bin"
+ *
+ * # GNU/Linux
+ * Etc.confstr(Etc::CS_GNU_LIBC_VERSION) #=> "glibc 2.18"
+ * Etc.confstr(Etc::CS_GNU_LIBPTHREAD_VERSION) #=> "NPTL 2.18"
+ *
+ */
+static VALUE
+etc_confstr(VALUE obj, VALUE arg)
+{
+ int name;
+ char localbuf[128], *buf = localbuf;
+ size_t bufsize = sizeof(localbuf), ret;
+ VALUE tmp;
+
+ name = NUM2INT(arg);
+
+ errno = 0;
+ ret = confstr(name, buf, bufsize);
+ if (bufsize < ret) {
+ bufsize = ret;
+ buf = ALLOCV_N(char, tmp, bufsize);
+ errno = 0;
+ ret = confstr(name, buf, bufsize);
+ }
+ if (bufsize < ret)
+ rb_bug("required buffer size for confstr() changed dynamically.");
+ if (ret == 0) {
+ if (errno == 0) /* no configuration-defined value */
+ return Qnil;
+ rb_sys_fail("confstr");
+ }
+ return rb_str_new_cstr(buf);
+}
+#else
+#define etc_confstr rb_f_notimplement
+#endif
+
+#ifdef HAVE_FPATHCONF
+/*
+ * Returns pathname configuration variable using fpathconf().
+ *
+ * _name_ should be a constant under <code>Etc</code> which begins with <code>PC_</code>.
+ *
+ * The return value is an integer or nil.
+ * nil means indefinite limit. (fpathconf() returns -1 but errno is not set.)
+ *
+ * require 'etc'
+ * IO.pipe {|r, w|
+ * p w.pathconf(Etc::PC_PIPE_BUF) #=> 4096
+ * }
+ *
+ */
+static VALUE
+io_pathconf(VALUE io, VALUE arg)
+{
+ int name;
+ long ret;
+ rb_io_t *fptr;
+
+ name = NUM2INT(arg);
+
+ GetOpenFile(io, fptr);
+
+ errno = 0;
+ ret = fpathconf(fptr->fd, name);
+ if (ret == -1) {
+ if (errno == 0) /* no limit */
+ return Qnil;
+ rb_sys_fail("fpathconf");
+ }
+ return LONG2NUM(ret);
+}
+#else
+#define io_pathconf rb_f_notimplement
+#endif
+
+#if (defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)) || defined(_WIN32)
+
+#if defined(HAVE_SCHED_GETAFFINITY) && defined(CPU_ALLOC)
+static int
+etc_nprocessors_affin(void)
+{
+ cpu_set_t *cpuset;
+ size_t size;
+ int ret;
+ int n;
+
+ /*
+ * XXX:
+ * man page says CPU_ALLOC takes number of cpus. But it is not accurate
+ * explanation. sched_getaffinity() returns EINVAL if cpuset bitmap is
+ * smaller than kernel internal bitmap.
+ * That said, sched_getaffinity() can fail when a kernel have sparse bitmap
+ * even if cpuset bitmap is larger than number of cpus.
+ * The precious way is to use /sys/devices/system/cpu/online. But there are
+ * two problems,
+ * - Costly calculation
+ * It is a minor issue, but possibly kill a benefit of a parallel processing.
+ * - No guarantee to exist /sys/devices/system/cpu/online
+ * This is an issue especially when using Linux containers.
+ * So, we use hardcode number for a workaround. Current linux kernel
+ * (Linux 3.17) support 8192 cpus at maximum. Then 16384 must be enough.
+ */
+ for (n=64; n <= 16384; n *= 2) {
+ size = CPU_ALLOC_SIZE(n);
+ if (size >= 1024) {
+ cpuset = xcalloc(1, size);
+ if (!cpuset)
+ return -1;
+ } else {
+ cpuset = alloca(size);
+ CPU_ZERO_S(size, cpuset);
+ }
+
+ ret = sched_getaffinity(0, size, cpuset);
+ if (ret == 0) {
+ /* On success, count number of cpus. */
+ ret = CPU_COUNT_S(size, cpuset);
+ }
+
+ if (size >= 1024) {
+ xfree(cpuset);
+ }
+ if (ret > 0) {
+ return ret;
+ }
+ }
+
+ return ret;
+}
+#endif
+
+/*
+ * Returns the number of online processors.
+ *
+ * The result is intended as the number of processes to
+ * use all available processors.
+ *
+ * This method is implemented using:
+ * - sched_getaffinity(): Linux
+ * - sysconf(_SC_NPROCESSORS_ONLN): GNU/Linux, NetBSD, FreeBSD, OpenBSD, DragonFly BSD, OpenIndiana, Mac OS X, AIX
+ *
+ * Example:
+ *
+ * require 'etc'
+ * p Etc.nprocessors #=> 4
+ *
+ * The result might be smaller number than physical cpus especially when ruby
+ * process is bound to specific cpus. This is intended for getting better
+ * parallel processing.
+ *
+ * Example: (Linux)
+ *
+ * linux$ taskset 0x3 ./ruby -retc -e "p Etc.nprocessors" #=> 2
+ *
+ */
+static VALUE
+etc_nprocessors(VALUE obj)
+{
+ long ret;
+
+#if !defined(_WIN32)
+
+#if defined(HAVE_SCHED_GETAFFINITY) && defined(CPU_ALLOC)
+ int ncpus;
+
+ ncpus = etc_nprocessors_affin();
+ if (ncpus != -1) {
+ return INT2NUM(ncpus);
+ }
+ /* fallback to _SC_NPROCESSORS_ONLN */
+#endif
+
+ errno = 0;
+ ret = sysconf(_SC_NPROCESSORS_ONLN);
+ if (ret == -1) {
+ rb_sys_fail("sysconf(_SC_NPROCESSORS_ONLN)");
+ }
+#else
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ ret = (long)si.dwNumberOfProcessors;
+#endif
+ return LONG2NUM(ret);
+}
+#else
+#define etc_nprocessors rb_f_notimplement
+#endif
+
/*
* The Etc module provides access to information typically stored in
* files in the /etc directory on Unix systems.
@@ -668,6 +1059,8 @@ Init_etc(void)
VALUE mEtc;
mEtc = rb_define_module("Etc");
+ init_constants(mEtc);
+
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
rb_define_module_function(mEtc, "getpwuid", etc_getpwuid, -1);
@@ -685,6 +1078,11 @@ Init_etc(void)
rb_define_module_function(mEtc, "getgrent", etc_getgrent, 0);
rb_define_module_function(mEtc, "sysconfdir", etc_sysconfdir, 0);
rb_define_module_function(mEtc, "systmpdir", etc_systmpdir, 0);
+ rb_define_module_function(mEtc, "uname", etc_uname, 0);
+ rb_define_module_function(mEtc, "sysconf", etc_sysconf, 1);
+ rb_define_module_function(mEtc, "confstr", etc_confstr, 1);
+ rb_define_method(rb_cIO, "pathconf", io_pathconf, 1);
+ rb_define_module_function(mEtc, "nprocessors", etc_nprocessors, 0);
sPasswd = rb_struct_define_under(mEtc, "Passwd",
"name",
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb
index 1967560cd4..11bc9458c0 100644
--- a/ext/etc/extconf.rb
+++ b/ext/etc/extconf.rb
@@ -1,30 +1,44 @@
+# frozen_string_literal: false
require 'mkmf'
+headers = []
+%w[sys/utsname.h].each {|h|
+ if have_header(h, headers)
+ headers << h
+ end
+}
have_library("sun", "getpwnam") # NIS (== YP) interface for IRIX 4
-a = have_func("getlogin")
-b = have_func("getpwent")
-c = have_func("getgrent")
+have_func("uname((struct utsname *)NULL)", headers)
+have_func("getlogin")
+have_func("getpwent")
+have_func("getgrent")
sysconfdir = RbConfig.expand(RbConfig::CONFIG["sysconfdir"].dup, "prefix"=>"", "DESTDIR"=>"")
$defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}")
-if a or b or c or sysconfdir
- have_struct_member('struct passwd', 'pw_gecos', 'pwd.h')
- have_struct_member('struct passwd', 'pw_change', 'pwd.h')
- have_struct_member('struct passwd', 'pw_quota', 'pwd.h')
- if have_struct_member('struct passwd', 'pw_age', 'pwd.h')
- case what_type?('struct passwd', 'pw_age', 'pwd.h')
- when "string"
- f = "safe_setup_str"
- when "long long"
- f = "LL2NUM"
- else
- f = "INT2NUM"
- end
- $defs.push("-DPW_AGE2VAL="+f)
+
+have_func("sysconf")
+have_func("confstr")
+have_func("fpathconf")
+
+have_struct_member('struct passwd', 'pw_gecos', 'pwd.h')
+have_struct_member('struct passwd', 'pw_change', 'pwd.h')
+have_struct_member('struct passwd', 'pw_quota', 'pwd.h')
+if have_struct_member('struct passwd', 'pw_age', 'pwd.h')
+ case what_type?('struct passwd', 'pw_age', 'pwd.h')
+ when "string"
+ f = "safe_setup_str"
+ when "long long"
+ f = "LL2NUM"
+ else
+ f = "INT2NUM"
end
- have_struct_member('struct passwd', 'pw_class', 'pwd.h')
- have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin/ === RUBY_PLATFORM
- have_struct_member('struct passwd', 'pw_expire', 'pwd.h')
- have_struct_member('struct passwd', 'pw_passwd', 'pwd.h')
- have_struct_member('struct group', 'gr_passwd', 'grp.h')
- create_makefile("etc")
+ $defs.push("-DPW_AGE2VAL="+f)
end
+have_struct_member('struct passwd', 'pw_class', 'pwd.h')
+have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin/ === RUBY_PLATFORM
+have_struct_member('struct passwd', 'pw_expire', 'pwd.h')
+have_struct_member('struct passwd', 'pw_passwd', 'pwd.h')
+have_struct_member('struct group', 'gr_passwd', 'grp.h')
+
+$distcleanfiles << "constdefs.h"
+
+create_makefile("etc")
diff --git a/ext/etc/mkconstants.rb b/ext/etc/mkconstants.rb
new file mode 100644
index 0000000000..0c4d17e6f9
--- /dev/null
+++ b/ext/etc/mkconstants.rb
@@ -0,0 +1,332 @@
+# frozen_string_literal: false
+require 'optparse'
+require 'erb'
+
+C_ESC = {
+ "\\" => "\\\\",
+ '"' => '\"',
+ "\n" => '\n',
+}
+
+0x00.upto(0x1f) {|ch| C_ESC[[ch].pack("C")] ||= "\\%03o" % ch }
+0x7f.upto(0xff) {|ch| C_ESC[[ch].pack("C")] = "\\%03o" % ch }
+C_ESC_PAT = Regexp.union(*C_ESC.keys)
+
+def c_str(str)
+ '"' + str.gsub(C_ESC_PAT) {|s| C_ESC[s]} + '"'
+end
+
+opt = OptionParser.new
+
+opt.def_option('-h', 'help') {
+ puts opt
+ exit 0
+}
+
+opt_o = nil
+opt.def_option('-o FILE', 'specify output file') {|filename|
+ opt_o = filename
+}
+
+opt_H = nil
+opt.def_option('-H FILE', 'specify output header file') {|filename|
+ opt_H = filename
+}
+
+opt.parse!
+
+h = {}
+COMMENTS = {}
+
+DATA.each_line {|s|
+ next if /\A\s*(\#|\z)/ =~ s
+ name, default_value, comment = s.chomp.split(/\s+/, 3)
+
+ default_value = nil if default_value == 'nil'
+
+ if h.has_key? name
+ warn "#{$.}: warning: duplicate name: #{name}"
+ next
+ end
+ h[name] = default_value
+ COMMENTS[name] = comment if comment
+}
+DEFS = h.to_a
+
+def each_const
+ DEFS.each {|name, default_value|
+ yield name, default_value
+ }
+end
+
+def each_name(pat)
+ DEFS.each {|name, default_value|
+ next if pat !~ name
+ yield name
+ }
+end
+
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
+% each_const {|name, default_value|
+#if !defined(<%=name%>)
+# if defined(HAVE_CONST_<%=name.upcase%>)
+# define <%=name%> <%=name%>
+%if default_value
+# else
+# define <%=name%> <%=default_value%>
+%end
+# endif
+#endif
+% }
+EOS
+
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
+% each_const {|name, default_value|
+#if defined(<%=name%>)
+% if comment = COMMENTS[name]
+ /* <%=comment%> */
+% end
+ rb_define_const(mod, <%=c_str name.sub(/\A_*/, '')%>, INTEGER2NUM(<%=name%>));
+#endif
+% }
+EOS
+
+header_result = ERB.new(<<'EOS', nil, '%').result(binding)
+/* autogenerated file */
+
+<%= gen_const_decls %>
+EOS
+
+result = ERB.new(<<'EOS', nil, '%').result(binding)
+/* autogenerated file */
+
+#ifdef HAVE_LONG_LONG
+#define INTEGER2NUM(n) \
+ (FIXNUM_MAX < (n) ? ULL2NUM(n) : \
+ FIXNUM_MIN > (LONG_LONG)(n) ? LL2NUM(n) : \
+ LONG2FIX(n))
+#else
+#define INTEGER2NUM(n) \
+ (FIXNUM_MAX < (n) ? ULONG2NUM(n) : \
+ FIXNUM_MIN > (long)(n) ? LONG2NUM(n) : \
+ LONG2FIX(n))
+#endif
+
+static void
+init_constants(VALUE mod)
+{
+<%= gen_const_defs %>
+}
+EOS
+
+if opt_H
+ File.open(opt_H, 'w') {|f|
+ f << header_result
+ }
+else
+ result = header_result + result
+end
+
+if opt_o
+ File.open(opt_o, 'w') {|f|
+ f << result
+ }
+else
+ $stdout << result
+end
+
+__END__
+# SUSv4
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ARG_MAX
+_SC_ATEXIT_MAX
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CHILD_MAX
+_SC_CLK_TCK
+_SC_COLL_WEIGHTS_MAX
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_HOST_NAME_MAX
+_SC_IOV_MAX
+_SC_LINE_MAX
+_SC_LOGIN_NAME_MAX
+_SC_NGROUPS_MAX
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_OPEN_MAX
+_SC_ADVISORY_INFO
+_SC_BARRIERS
+_SC_ASYNCHRONOUS_IO
+_SC_CLOCK_SELECTION
+_SC_CPUTIME
+_SC_FSYNC
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_REGEXP
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_SYNCHRONIZED_IO
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREADS
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_VERSION
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_CHAR_TERM
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_PAGE_SIZE
+_SC_PAGESIZE
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_RE_DUP_MAX
+_SC_RTSIG_MAX
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SIGQUEUE_MAX
+_SC_STREAM_MAX
+_SC_SYMLOOP_MAX
+_SC_TIMER_MAX
+_SC_TTY_NAME_MAX
+_SC_TZNAME_MAX
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_UUCP
+_SC_XOPEN_VERSION
+
+# non-standard
+_SC_PHYS_PAGES
+_SC_AVPHYS_PAGES
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_CPUSET_SIZE
+
+# SUSv4
+_CS_PATH
+_CS_POSIX_V7_ILP32_OFF32_CFLAGS
+_CS_POSIX_V7_ILP32_OFF32_LDFLAGS
+_CS_POSIX_V7_ILP32_OFF32_LIBS
+_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
+_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
+_CS_POSIX_V7_ILP32_OFFBIG_LIBS
+_CS_POSIX_V7_LP64_OFF64_CFLAGS
+_CS_POSIX_V7_LP64_OFF64_LDFLAGS
+_CS_POSIX_V7_LP64_OFF64_LIBS
+_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
+_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
+_CS_POSIX_V7_LPBIG_OFFBIG_LIBS
+_CS_POSIX_V7_THREADS_CFLAGS
+_CS_POSIX_V7_THREADS_LDFLAGS
+_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS
+_CS_V7_ENV
+_CS_POSIX_V6_ILP32_OFF32_CFLAGS
+_CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+_CS_POSIX_V6_ILP32_OFF32_LIBS
+_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+_CS_POSIX_V6_ILP32_OFFBIG_LIBS
+_CS_POSIX_V6_LP64_OFF64_CFLAGS
+_CS_POSIX_V6_LP64_OFF64_LDFLAGS
+_CS_POSIX_V6_LP64_OFF64_LIBS
+_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+_CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
+_CS_V6_ENV
+
+# non-standard
+_CS_GNU_LIBC_VERSION
+_CS_GNU_LIBPTHREAD_VERSION
+
+# SUSv4
+_PC_FILESIZEBITS
+_PC_LINK_MAX
+_PC_MAX_CANON
+_PC_MAX_INPUT
+_PC_NAME_MAX
+_PC_PATH_MAX
+_PC_PIPE_BUF
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SYMLINK_MAX
+_PC_CHOWN_RESTRICTED
+_PC_NO_TRUNC
+_PC_VDISABLE
+_PC_ASYNC_IO
+_PC_PRIO_IO
+_PC_SYNC_IO
+_PC_TIMESTAMP_RESOLUTION
+
diff --git a/ext/extmk.rb b/ext/extmk.rb
index ef9afa0676..ac77641fc3 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby
# -*- mode: ruby; coding: us-ascii -*-
+# frozen_string_literal: false
# :stopdoc:
$extension = nil
@@ -50,7 +51,6 @@ elsif !File.chardev?(@null = "/dev/null")
end
def sysquote(x)
- @quote ||= /os2/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
@quote ? x.quote : x
end
@@ -69,8 +69,22 @@ def system(*args)
super
end
+def atomic_write_open(filename)
+ filename_new = filename + ".new.#$$"
+ open(filename_new, "wb") do |f|
+ yield f
+ end
+ if File.binread(filename_new) != (File.binread(filename) rescue nil)
+ File.rename(filename_new, filename)
+ else
+ File.unlink(filename_new)
+ end
+end
+
def extract_makefile(makefile, keep = true)
m = File.read(makefile)
+ s = m[/^CLEANFILES[ \t]*=[ \t](.*)/, 1] and $cleanfiles = s.split
+ s = m[/^DISTCLEANFILES[ \t]*=[ \t](.*)/, 1] and $distcleanfiles = s.split
if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
return keep
end
@@ -115,7 +129,6 @@ def extract_makefile(makefile, keep = true)
end
$objs = (m[/^OBJS[ \t]*=[ \t](.*)/, 1] || "").split
$srcs = (m[/^SRCS[ \t]*=[ \t](.*)/, 1] || "").split
- $distcleanfiles = (m[/^DISTCLEANFILES[ \t]*=[ \t](.*)/, 1] || "").split
$LOCAL_LIBS = m[/^LOCAL_LIBS[ \t]*=[ \t]*(.*)/, 1] || ""
$LIBPATH = Shellwords.shellwords(m[/^libpath[ \t]*=[ \t]*(.*)/, 1] || "") - %w[$(libdir) $(topdir)]
true
@@ -129,6 +142,16 @@ def extmake(target)
FileUtils.mkpath target unless File.directory?(target)
begin
+ # don't build if parent library isn't build
+ parent = true
+ d = target
+ until (d = File.dirname(d)) == '.'
+ if File.exist?("#{$top_srcdir}/ext/#{d}/extconf.rb")
+ parent = (/^all:\s*install/ =~ IO.read("#{d}/Makefile") rescue false)
+ break
+ end
+ end
+
dir = Dir.pwd
FileUtils.mkpath target unless File.directory?(target)
Dir.chdir target
@@ -149,8 +172,8 @@ def extmake(target)
makefile = "./Makefile"
static = $static
$static = nil if noinstall = File.fnmatch?("-*", target)
- ok = File.exist?(makefile)
- unless $ignore
+ ok = parent && File.exist?(makefile)
+ if parent && !$ignore
rbconfig0 = RbConfig::CONFIG
mkconfig0 = CONFIG
rbconfig = {
@@ -179,7 +202,7 @@ def extmake(target)
$extconf_h = nil
ok &&= extract_makefile(makefile)
old_objs = $objs
- old_cleanfiles = $distcleanfiles
+ old_cleanfiles = $distcleanfiles | $cleanfiles
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
if (!ok || ($extconf_h && !File.exist?($extconf_h)) ||
!(t = modified?(makefile, MTIMES)) ||
@@ -219,21 +242,16 @@ def extmake(target)
$0 = $PROGRAM_NAME
end
end
- ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
+ ok &&= File.open(makefile){|f| s = f.gets and !s[DUMMY_SIGNATURE]}
ok = yield(ok) if block_given?
- if ok
- open(makefile, "r+b") do |f|
- s = f.read.sub!(/^(static:)\s(?!all\b).*/, '\1 all') or break
- f.rewind
- f.print(s)
- f.truncate(f.pos)
- end unless $static
- else
- open(makefile, "wb") do |f|
+ unless ok
+ atomic_write_open(makefile) do |f|
f.puts "# " + DUMMY_SIGNATURE
f.print(*dummy_makefile(CONFIG["srcdir"]))
end
+ return true if !error and target.start_with?("-")
+
mess = "Failed to configure #{target}. It will not be installed.\n"
if error
mess = "#{error}\n#{mess}"
@@ -252,7 +270,7 @@ def extmake(target)
args += ["static"] unless $clean
$extlist.push [$static, target, $target, $preload]
end
- FileUtils.rm_f(old_cleanfiles - $distcleanfiles)
+ FileUtils.rm_f(old_cleanfiles - $distcleanfiles - $cleanfiles)
FileUtils.rm_f(old_objs - $objs)
unless $configure_only or system($make, *args)
$ignore or $continue or return false
@@ -271,18 +289,20 @@ def extmake(target)
unless $mswin
$extflags = split_libs($extflags, $DLDFLAGS, $LDFLAGS).uniq.join(" ")
end
- $extlibs = merge_libs($extlibs, split_libs($libs), split_libs($LOCAL_LIBS))
+ $extlibs = merge_libs($extlibs, split_libs($libs, $LOCAL_LIBS).map {|lib| lib.sub(/\A\.\//, "ext/#{target}/")})
$extpath |= $LIBPATH
end
ensure
Logging::log_close
- unless $ignore
+ if rbconfig0
RbConfig.module_eval {
remove_const(:CONFIG)
const_set(:CONFIG, rbconfig0)
remove_const(:MAKEFILE_CONFIG)
const_set(:MAKEFILE_CONFIG, mkconfig0)
}
+ end
+ if mkconfig0
MakeMakefile.class_eval {
remove_const(:CONFIG)
const_set(:CONFIG, mkconfig0)
@@ -347,6 +367,12 @@ def parse_args()
opts.on('--command-output=FILE', String) do |v|
$command_output = v
end
+ opts.on('--gnumake=yes|no', true) do |v|
+ $gnumake = v
+ end
+ opts.on('--extflags=FLAGS') do |v|
+ $extflags = v || ""
+ end
end
begin
$optparser.parse!(ARGV)
@@ -467,24 +493,29 @@ 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|
+default_exclude_exts =
+ case
+ when $cygwin
+ %w''
+ when $mswin, $mingw
+ %w'pty syslog'
+ else
+ %w'*win32*'
+ end
+withes, withouts = [["--with", nil], ["--without", default_exclude_exts]].collect {|w, d|
if !(w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
- nil
+ d ? proc {|c1| d.any?(&c1)} : proc {true}
elsif (w = w.grep(String)).empty?
proc {true}
else
- proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)}
+ w = w.collect {|o| o.split(/,/)}.flatten
+ w.collect! {|o| o == '+' ? d : o}.flatten! if d
+ proc {|c1| w.any?(&c1)}
end
}
-if withes
- withouts ||= proc {true}
-else
- withes = proc {false}
- withouts ||= withes
-end
cond = proc {|ext, *|
cond1 = proc {|n| File.fnmatch(n, ext)}
- withes.call(cond1) or !withouts.call(cond1)
+ withes.call(cond1) and !withouts.call(cond1)
}
($extension || %w[*]).each do |e|
e = e.sub(/\A(?:\.\/)+/, '')
@@ -495,6 +526,9 @@ cond = proc {|ext, *|
}.find_all {|ext|
with_config(ext, &cond)
}.sort
+ if $LIBRUBYARG_SHARED.empty? and CONFIG["EXTSTATIC"] == "static"
+ exts.delete_if {|d| File.fnmatch?("-*", d)}
+ end
end
if $extout
@@ -511,7 +545,7 @@ Dir::chdir('ext')
hdrdir = $hdrdir
$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
exts.each do |d|
- $static = $force_static ? true : $static_ext[target]
+ $static = $force_static ? true : $static_ext[d]
if $ignore or !$nodynamic or $static
extmake(d) or abort
@@ -586,9 +620,6 @@ void Init_ext(void)\n{\n#$extinit}
open(extinit.c, "w") {|fe| fe.print src}
end
- if RUBY_PLATFORM =~ /beos/
- $extflags.delete("-L/usr/local/lib")
- end
$extpath.delete("$(topdir)")
$extflags = libpathflag($extpath) << " " << $extflags.strip
conf = [
@@ -636,7 +667,7 @@ $mflags.unshift("topdir=#$topdir")
ENV.delete("RUBYOPT")
if $configure_only and $command_output
exts.map! {|d| "ext/#{d}/."}
- open($command_output, "wb") do |mf|
+ atomic_write_open($command_output) do |mf|
mf.puts "V = 0"
mf.puts "Q1 = $(V:1=)"
mf.puts "Q = $(Q1:0=@)"
@@ -666,14 +697,17 @@ if $configure_only and $command_output
mf.macro "EXTLDFLAGS", $extflags.split
submakeopts = []
if enable_config("shared", $enable_shared)
- submakeopts << 'DLDOBJS="$(EXTOBJS) $(ENCOBJS)"'
+ submakeopts << 'DLDOBJS="$(EXTOBJS) $(EXTENCS)"'
+ submakeopts << 'EXTOBJS='
submakeopts << 'EXTSOLIBS="$(EXTLIBS)"'
submakeopts << 'LIBRUBY_SO_UPDATE=$(LIBRUBY_EXTS)'
else
- submakeopts << 'EXTOBJS="$(EXTOBJS) $(ENCOBJS)"'
+ submakeopts << 'EXTOBJS="$(EXTOBJS) $(EXTENCS)"'
submakeopts << 'EXTLIBS="$(EXTLIBS)"'
end
submakeopts << 'EXTLDFLAGS="$(EXTLDFLAGS)"'
+ submakeopts << 'UPDATE_LIBRARIES="$(UPDATE_LIBRARIES)"'
+ submakeopts << 'SHOWFLAGS='
mf.macro "SUBMAKEOPTS", submakeopts
mf.puts
targets = %w[all install static install-so install-rb clean distclean realclean]
@@ -686,15 +720,27 @@ if $configure_only and $command_output
mf.puts
mf.puts "#{rubies.join(' ')}: $(extensions:/.=/#{$force_static ? 'static' : 'all'})"
submake = "$(Q)$(MAKE) $(MFLAGS) $(SUBMAKEOPTS)"
- mf.puts "all static:\n\t#{submake} #{rubies.join(' ')}\n"
+ mf.puts "all static: #{rubies.join(' ')}\n"
+ $extobjs.each do |tgt|
+ mf.puts "#{tgt}: #{File.dirname(tgt)}/static"
+ end
+ mf.puts "#{rubies.join(' ')}: $(EXTOBJS)#{' libencs' if CONFIG['ENCSTATIC'] == 'static'}"
rubies.each do |tgt|
mf.puts "#{tgt}:\n\t#{submake} $@"
end
+ mf.puts "libencs:\n\t$(Q)$(MAKE) -f enc.mk V=$(V) $@"
+ mf.puts "ext/extinit.#{$OBJEXT}:\n\t$(Q)$(MAKE) $(MFLAGS) V=$(V) $@" if $static
mf.puts
- exec = config_string("exec") {|str| str + " "}
+ if $gnumake == "yes"
+ submake = "$(MAKE) -C $(@D)"
+ else
+ submake = "cd $(@D) && "
+ config_string("exec") {|str| submake << str << " "}
+ submake << "$(MAKE)"
+ end
targets.each do |tgt|
exts.each do |d|
- mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)cd $(@D) && #{exec}$(MAKE) $(MFLAGS) V=$(V) $(@F)"
+ mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
end
end
end
diff --git a/ext/fcntl/extconf.rb b/ext/fcntl/extconf.rb
index 8b717d4a5b..35371ebe18 100644
--- a/ext/fcntl/extconf.rb
+++ b/ext/fcntl/extconf.rb
@@ -1,2 +1,3 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile('fcntl')
diff --git a/ext/fcntl/fcntl.c b/ext/fcntl/fcntl.c
index 3538d94948..62780b78c0 100644
--- a/ext/fcntl/fcntl.c
+++ b/ext/fcntl/fcntl.c
@@ -62,7 +62,7 @@ pack up your own arguments to pass as args for locking functions, etc.
*
*/
void
-Init_fcntl()
+Init_fcntl(void)
{
VALUE mFcntl = rb_define_module("Fcntl");
#ifdef F_DUPFD
diff --git a/ext/fiber/extconf.rb b/ext/fiber/extconf.rb
index 904ab94a9c..7f11e0dafa 100644
--- a/ext/fiber/extconf.rb
+++ b/ext/fiber/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile('fiber')
diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c
index 121a08ea19..f19091b29b 100644
--- a/ext/fiddle/closure.c
+++ b/ext/fiddle/closure.c
@@ -1,4 +1,6 @@
#include <fiddle.h>
+#include <ruby/thread.h>
+#include "internal.h" /* rb_thread_has_gvl_p */
VALUE cFiddleClosure;
@@ -27,7 +29,7 @@ dealloc(void * ptr)
#if USE_FFI_CLOSURE_ALLOC
ffi_closure_free(cls->pcl);
#else
- munmap(cls->pcl, sizeof(cls->pcl));
+ munmap(cls->pcl, sizeof(*cls->pcl));
#endif
if (cls->argv) xfree(cls->argv);
xfree(cls);
@@ -39,14 +41,13 @@ closure_memsize(const void * ptr)
fiddle_closure * cls = (fiddle_closure *)ptr;
size_t size = 0;
- if (ptr) {
- size += sizeof(*cls);
+ size += sizeof(*cls);
#if !defined(FFI_NO_RAW_API) || !FFI_NO_RAW_API
- size += ffi_raw_size(&cls->cif);
+ size += ffi_raw_size(&cls->cif);
#endif
- size += sizeof(*cls->argv);
- size += sizeof(ffi_closure);
- }
+ size += sizeof(*cls->argv);
+ size += sizeof(ffi_closure);
+
return size;
}
@@ -55,10 +56,19 @@ const rb_data_type_t closure_data_type = {
{0, dealloc, closure_memsize,},
};
-void
-callback(ffi_cif *cif, void *resp, void **args, void *ctx)
+struct callback_args {
+ ffi_cif *cif;
+ void *resp;
+ void **args;
+ void *ctx;
+};
+
+static void *
+with_gvl_callback(void *ptr)
{
- VALUE self = (VALUE)ctx;
+ struct callback_args *x = ptr;
+
+ VALUE self = (VALUE)x->ctx;
VALUE rbargs = rb_iv_get(self, "@args");
VALUE ctype = rb_iv_get(self, "@ctype");
int argc = RARRAY_LENINT(rbargs);
@@ -70,52 +80,52 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
cPointer = rb_const_get(mFiddle, rb_intern("Pointer"));
for (i = 0; i < argc; i++) {
- type = NUM2INT(RARRAY_PTR(rbargs)[i]);
+ type = NUM2INT(RARRAY_AREF(rbargs, i));
switch (type) {
case TYPE_VOID:
argc = 0;
break;
case TYPE_INT:
- rb_ary_push(params, INT2NUM(*(int *)args[i]));
+ rb_ary_push(params, INT2NUM(*(int *)x->args[i]));
break;
case -TYPE_INT:
- rb_ary_push(params, UINT2NUM(*(unsigned int *)args[i]));
+ rb_ary_push(params, UINT2NUM(*(unsigned int *)x->args[i]));
break;
case TYPE_VOIDP:
rb_ary_push(params,
rb_funcall(cPointer, rb_intern("[]"), 1,
- PTR2NUM(*(void **)args[i])));
+ PTR2NUM(*(void **)x->args[i])));
break;
case TYPE_LONG:
- rb_ary_push(params, LONG2NUM(*(long *)args[i]));
+ rb_ary_push(params, LONG2NUM(*(long *)x->args[i]));
break;
case -TYPE_LONG:
- rb_ary_push(params, ULONG2NUM(*(unsigned long *)args[i]));
+ rb_ary_push(params, ULONG2NUM(*(unsigned long *)x->args[i]));
break;
case TYPE_CHAR:
- rb_ary_push(params, INT2NUM(*(signed char *)args[i]));
+ rb_ary_push(params, INT2NUM(*(signed char *)x->args[i]));
break;
case -TYPE_CHAR:
- rb_ary_push(params, UINT2NUM(*(unsigned char *)args[i]));
+ rb_ary_push(params, UINT2NUM(*(unsigned char *)x->args[i]));
break;
case TYPE_SHORT:
- rb_ary_push(params, INT2NUM(*(signed short *)args[i]));
+ rb_ary_push(params, INT2NUM(*(signed short *)x->args[i]));
break;
case -TYPE_SHORT:
- rb_ary_push(params, UINT2NUM(*(unsigned short *)args[i]));
+ rb_ary_push(params, UINT2NUM(*(unsigned short *)x->args[i]));
break;
case TYPE_DOUBLE:
- rb_ary_push(params, rb_float_new(*(double *)args[i]));
+ rb_ary_push(params, rb_float_new(*(double *)x->args[i]));
break;
case TYPE_FLOAT:
- rb_ary_push(params, rb_float_new(*(float *)args[i]));
+ rb_ary_push(params, rb_float_new(*(float *)x->args[i]));
break;
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- rb_ary_push(params, LL2NUM(*(LONG_LONG *)args[i]));
+ rb_ary_push(params, LL2NUM(*(LONG_LONG *)x->args[i]));
break;
case -TYPE_LONG_LONG:
- rb_ary_push(params, ULL2NUM(*(unsigned LONG_LONG *)args[i]));
+ rb_ary_push(params, ULL2NUM(*(unsigned LONG_LONG *)x->args[i]));
break;
#endif
default:
@@ -123,7 +133,7 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
}
}
- ret = rb_funcall2(self, rb_intern("call"), argc, RARRAY_PTR(params));
+ ret = rb_funcall2(self, rb_intern("call"), argc, RARRAY_CONST_PTR(params));
RB_GC_GUARD(params);
type = NUM2INT(ctype);
@@ -131,41 +141,59 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
case TYPE_VOID:
break;
case TYPE_LONG:
- *(long *)resp = NUM2LONG(ret);
+ *(long *)x->resp = NUM2LONG(ret);
break;
case -TYPE_LONG:
- *(unsigned long *)resp = NUM2ULONG(ret);
+ *(unsigned long *)x->resp = NUM2ULONG(ret);
break;
case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
- *(ffi_sarg *)resp = NUM2INT(ret);
+ *(ffi_sarg *)x->resp = NUM2INT(ret);
break;
case -TYPE_CHAR:
case -TYPE_SHORT:
case -TYPE_INT:
- *(ffi_arg *)resp = NUM2UINT(ret);
+ *(ffi_arg *)x->resp = NUM2UINT(ret);
break;
case TYPE_VOIDP:
- *(void **)resp = NUM2PTR(ret);
+ *(void **)x->resp = NUM2PTR(ret);
break;
case TYPE_DOUBLE:
- *(double *)resp = NUM2DBL(ret);
+ *(double *)x->resp = NUM2DBL(ret);
break;
case TYPE_FLOAT:
- *(float *)resp = (float)NUM2DBL(ret);
+ *(float *)x->resp = (float)NUM2DBL(ret);
break;
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- *(LONG_LONG *)resp = NUM2LL(ret);
+ *(LONG_LONG *)x->resp = NUM2LL(ret);
break;
case -TYPE_LONG_LONG:
- *(unsigned LONG_LONG *)resp = NUM2ULL(ret);
+ *(unsigned LONG_LONG *)x->resp = NUM2ULL(ret);
break;
#endif
default:
rb_raise(rb_eRuntimeError, "closure retval: %d", type);
}
+ return 0;
+}
+
+static void
+callback(ffi_cif *cif, void *resp, void **args, void *ctx)
+{
+ struct callback_args x;
+
+ x.cif = cif;
+ x.resp = resp;
+ x.args = args;
+ x.ctx = ctx;
+
+ if (ruby_thread_has_gvl_p()) {
+ (void)with_gvl_callback(&x);
+ } else {
+ (void)rb_thread_call_with_gvl(with_gvl_callback, &x);
+ }
}
static VALUE
@@ -210,7 +238,7 @@ initialize(int rbargc, VALUE argv[], VALUE self)
cl->argv = (ffi_type **)xcalloc(argc + 1, sizeof(ffi_type *));
for (i = 0; i < argc; i++) {
- int type = NUM2INT(RARRAY_PTR(args)[i]);
+ int type = NUM2INT(RARRAY_AREF(args, i));
cl->argv[i] = INT2FFI_TYPE(type);
}
cl->argv[argc] = NULL;
@@ -234,7 +262,7 @@ initialize(int rbargc, VALUE argv[], VALUE self)
#else
result = ffi_prep_closure(pcl, cif, callback, (void *)self);
cl->code = (void *)pcl;
- i = mprotect(pcl, sizeof(pcl), PROT_READ | PROT_EXEC);
+ i = mprotect(pcl, sizeof(*pcl), PROT_READ | PROT_EXEC);
if (i) {
rb_sys_fail("mprotect");
}
@@ -260,7 +288,7 @@ to_i(VALUE self)
}
void
-Init_fiddle_closure()
+Init_fiddle_closure(void)
{
#if 0
mFiddle = rb_define_module("Fiddle"); /* let rdoc know about mFiddle */
diff --git a/ext/fiddle/closure.h b/ext/fiddle/closure.h
index 1e870e2285..d0a8be6180 100644
--- a/ext/fiddle/closure.h
+++ b/ext/fiddle/closure.h
@@ -3,6 +3,6 @@
#include <fiddle.h>
-void Init_fiddle_closure();
+void Init_fiddle_closure(void);
#endif
diff --git a/ext/fiddle/conversions.h b/ext/fiddle/conversions.h
index d0a08d6bc0..cbc610bad2 100644
--- a/ext/fiddle/conversions.h
+++ b/ext/fiddle/conversions.h
@@ -33,11 +33,11 @@ VALUE generic_to_value(VALUE rettype, fiddle_generic retval);
#define GENERIC2VALUE(_type, _retval) generic_to_value((_type), (_retval))
#if SIZEOF_VOIDP == SIZEOF_LONG
-# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
+# define PTR2NUM(x) (LONG2NUM((long)(x)))
# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
#else
/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
-# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
+# define PTR2NUM(x) (LL2NUM((LONG_LONG)(x)))
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
#endif
diff --git a/ext/fiddle/depend b/ext/fiddle/depend
index e786dc71d2..bf264a18eb 100644
--- a/ext/fiddle/depend
+++ b/ext/fiddle/depend
@@ -1,4 +1,57 @@
+PWD =
+
+CONFIGURE_LIBFFI = \
+ $(LIBFFI_CONFIGURE) --disable-shared \
+ --host=$(LIBFFI_ARCH) --enable-builddir=$(arch) \
+ CC="$(CC)" CFLAGS="$(LIBFFI_CFLAGS)" \
+ LD="$(LD)" LDFLAGS="$(LIBFFI_LDFLAGS)"
+
$(OBJS): $(HDRS) $(ruby_headers) \
$(hdrdir)/ruby/io.h \
$(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h
+ $(hdrdir)/ruby/oniguruma.h \
+ $(hdrdir)/ruby/thread.h \
+ $(top_srcdir)/internal.h
+
+$(STATIC_LIB) $(RUBYARCHDIR)/$(DLLIB) $(DLLIB): $(LIBFFI_A)
+
+$(OBJS): $(FFI_H)
+
+.PHONY: .FORCE hdr
+
+.FORCE:
+
+hdr: $(FFI_H)
+
+configure-libffi build-libffi: .FORCE
+configure-libffi \
+$(LIBFFI_DIR)/include/ffi.h \
+$(LIBFFI_DIR)/include/ffitarget.h \
+$(LIBFFI_DIR)/fficonfig.h \
+$(LIBFFI_DIR)/Makefile:
+ $(Q) $(MAKEDIRS) $(LIBFFI_DIR)
+ $(Q) $(CONFIGURE_LIBFFI)
+
+build-libffi: $(LIBFFI_A)
+build-libffi $(LIBFFI_A):
+ $(Q) $(SUBMAKE_LIBFFI)
+
+clean-libffi:
+ $(Q) $(SUBMAKE_LIBFFI) clean
+
+distclean-libffi:
+ $(Q) $(SUBMAKE_LIBFFI) distclean
+ $(Q) $(RM) $(LIBFFI_DIR)/local.exp
+ $(Q) $(RUBY) -rfileutils -e "FileUtils.rmdir(Dir.glob(ARGV[0]+'/**/{,.*/}'), :parents=>true)" $(LIBFFI_DIR)
+
+realclean-libffi:
+ $(Q) $(RMALL) $(LIBFFI_DIR)
+
+.PHONY: clean-libffi distclean-libffi realclean-libffi
+.PHONY: clean-none distclean-none realclean-none
+
+clean: clean-$(LIBFFI_CLEAN)
+distclean: distclean-$(LIBFFI_CLEAN)
+realclean: realclean-$(LIBFFI_CLEAN)
+
+.PHONY: configure configure-libffi
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 2190aa907f..0359355193 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -1,25 +1,111 @@
+# frozen_string_literal: false
require 'mkmf'
# :stopdoc:
-dir_config 'libffi'
+bundle = enable_config('bundled-libffi')
+if ! bundle
+ dir_config 'libffi'
-pkg_config("libffi")
-if ver = pkg_config("libffi", "modversion")
- ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
- $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver.split('.') }})
-end
+ pkg_config("libffi") and
+ ver = pkg_config("libffi", "modversion")
-unless have_header('ffi.h')
- if have_header('ffi/ffi.h')
+ if have_header(ffi_header = 'ffi.h')
+ true
+ elsif have_header(ffi_header = 'ffi/ffi.h')
$defs.push(format('-DUSE_HEADER_HACKS'))
+ true
+ end and (have_library('ffi') || have_library('libffi'))
+end or
+begin
+ ver = bundle != false &&
+ Dir.glob("#{$srcdir}/libffi-*/")
+ .map {|n| File.basename(n)}
+ .max_by {|n| n.scan(/\d+/).map(&:to_i)}
+ unless ver
+ raise "missing libffi. Please install libffi."
+ end
+
+ srcdir = "#{$srcdir}/#{ver}"
+ ffi_header = 'ffi.h'
+ libffi = Struct.new(*%I[dir srcdir builddir include lib a cflags ldflags opt arch]).new
+ libffi.dir = ver
+ if $srcdir == "."
+ libffi.builddir = "#{ver}/#{RUBY_PLATFORM}"
+ libffi.srcdir = "."
else
- raise "ffi.h is missing. Please install libffi."
+ libffi.builddir = libffi.dir
+ libffi.srcdir = relative_from(srcdir, "..")
+ end
+ libffi.include = "#{libffi.builddir}/include"
+ libffi.lib = "#{libffi.builddir}/.libs"
+ libffi.a = "#{libffi.lib}/libffi_convenience.#{$LIBEXT}"
+ nowarn = CONFIG.merge("warnflags"=>"")
+ libffi.cflags = RbConfig.expand("$(CFLAGS)", nowarn)
+ ver = ver[/libffi-(.*)/, 1]
+
+ FileUtils.mkdir_p(libffi.dir)
+ libffi.opt = CONFIG['configure_args'][/'(-C)'/, 1]
+ libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}")
+ libffi.arch = RbConfig::CONFIG['host']
+ if $mswin
+ unless find_executable(as = /x64/ =~ libffi.arch ? "ml64" : "ml")
+ raise "missing #{as} command."
+ end
+ $defs << "-DFFI_BUILDING"
+ libffi_config = "#{relative_from($srcdir, '..')}/win32/libffi-config.rb"
+ config = CONFIG.merge("top_srcdir" => $top_srcdir)
+ args = $ruby.gsub(/:\/=\\/, '')
+ args.gsub!(/\)\\/, ')/')
+ args = args.shellsplit
+ args.map! {|s| RbConfig.expand(s, config)}
+ args << '-C' << libffi.dir << libffi_config
+ opts = {}
+ else
+ args = %W[sh #{libffi.srcdir}/configure ]
+ opts = {chdir: libffi.dir}
+ end
+ cc = RbConfig::CONFIG['CC']
+ cxx = RbConfig::CONFIG['CXX']
+ ld = RbConfig::CONFIG['LD']
+ args.concat %W[
+ --srcdir=#{libffi.srcdir}
+ --host=#{libffi.arch}
+ --enable-builddir=#{RUBY_PLATFORM}
+ ]
+ args << ($enable_shared || !$static ? '--enable-shared' : '--enable-static')
+ args << libffi.opt if libffi.opt
+ args.concat %W[
+ CC=#{cc} CFLAGS=#{libffi.cflags}
+ CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)", nowarn)}
+ LD=#{ld} LDFLAGS=#{libffi.ldflags}
+ ]
+
+ FileUtils.rm_f("#{libffi.include}/ffitarget.h")
+ Logging::open do
+ Logging.message("%p in %p\n", args, opts)
+ unless system(*args, **opts)
+ begin
+ IO.copy_stream(libffi.dir + "/config.log", Logging.instance_variable_get(:@logfile))
+ rescue SystemCallError => e
+ Logfile.message("%s\n", e.message)
+ end
+ raise "failed to configure libffi. Please install libffi."
+ end
end
+ if $mswin && File.file?("#{libffi.include}/ffitarget.h")
+ FileUtils.rm_f("#{libffi.include}/ffitarget.h")
+ end
+ unless File.file?("#{libffi.include}/ffitarget.h")
+ FileUtils.cp("#{srcdir}/src/x86/ffitarget.h", libffi.include, preserve: true)
+ end
+ $INCFLAGS << " -I" << libffi.include
end
-unless have_library('ffi') || have_library('libffi')
- raise "libffi is missing. Please install libffi."
+if ver
+ ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
+ ver = (ver.split('.') + [0,0])[0,3]
+ $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver }})
end
have_header 'sys/mman.h'
@@ -38,7 +124,7 @@ elsif have_header "windows.h"
end
end
-have_const('FFI_STDCALL', 'ffi.h') || have_const('FFI_STDCALL', 'ffi/ffi.h')
+have_const('FFI_STDCALL', ffi_header)
config = File.read(RbConfig.expand(File.join($arch_hdrdir, "ruby/config.h")))
types = {"SIZE_T"=>"SSIZE_T", "PTRDIFF_T"=>nil, "INTPTR_T"=>nil}
@@ -54,6 +140,43 @@ types.each do |type, signed|
end
end
-create_makefile 'fiddle'
+if libffi
+ $LOCAL_LIBS.prepend("./#{libffi.a} ").strip! # to exts.mk
+ $INCFLAGS.gsub!(/-I#{libffi.dir}/, '-I$(LIBFFI_DIR)')
+end
+$INCFLAGS << " -I$(top_srcdir)"
+create_makefile 'fiddle' do |conf|
+ if !libffi
+ next conf << "LIBFFI_CLEAN = none\n"
+ elsif $gnumake && !$nmake
+ submake = "$(MAKE) -C $(LIBFFI_DIR)\n"
+ else
+ submake = "cd $(LIBFFI_DIR) && \\\n\t\t" << "#{config_string("exec")} $(MAKE)".strip
+ end
+ if $nmake
+ cmd = "$(RUBY) -C $(LIBFFI_DIR) #{libffi_config} --srcdir=$(LIBFFI_SRCDIR)"
+ else
+ cmd = "cd $(LIBFFI_DIR) && #$exec $(LIBFFI_SRCDIR)/configure #{libffi.opt}"
+ end
+ sep = "/"
+ seprpl = config_string('BUILD_FILE_SEPARATOR') {|s| sep = s; ":/=#{s}" if s != "/"} || ""
+ conf << <<-MK.gsub(/^ +| +$/, '')
+ PWD =
+ LIBFFI_CONFIGURE = #{cmd}
+ LIBFFI_ARCH = #{libffi.arch}
+ LIBFFI_SRCDIR = #{libffi.srcdir.sub(libffi.dir, '$(LIBFFI_DIR)')}
+ LIBFFI_DIR = #{libffi.dir}
+ LIBFFI_A = #{libffi.a.sub(libffi.dir, '$(LIBFFI_DIR)')}
+ LIBFFI_CFLAGS = #{libffi.cflags}
+ LIBFFI_LDFLAGS = #{libffi.ldflags}
+ FFI_H = $(LIBFFI_DIR)/include/ffi.h
+ SUBMAKE_LIBFFI = #{submake}
+ LIBFFI_CLEAN = libffi
+ MK
+end
+
+if libffi
+ $LIBPATH.pop
+end
# :startdoc:
diff --git a/ext/fiddle/extlibs b/ext/fiddle/extlibs
new file mode 100644
index 0000000000..7d5fda5247
--- /dev/null
+++ b/ext/fiddle/extlibs
@@ -0,0 +1,2 @@
+ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz md5:83b89587607e3eb65c70d361f13bab43
+ win32/libffi-3.2.1-mswin.patch -p0
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c
index 7a7c708245..9f3d1537d6 100644
--- a/ext/fiddle/fiddle.c
+++ b/ext/fiddle/fiddle.c
@@ -48,7 +48,7 @@ rb_fiddle_malloc(VALUE self, VALUE size)
{
void *ptr;
- ptr = (void*)ruby_xmalloc(NUM2INT(size));
+ ptr = (void*)ruby_xmalloc(NUM2SIZET(size));
return PTR2NUM(ptr);
}
@@ -64,7 +64,7 @@ rb_fiddle_realloc(VALUE self, VALUE addr, VALUE size)
{
void *ptr = NUM2PTR(addr);
- ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
+ ptr = (void*)ruby_xrealloc(ptr, NUM2SIZET(size));
return PTR2NUM(ptr);
}
diff --git a/ext/fiddle/fiddle.h b/ext/fiddle/fiddle.h
index b37c37bc65..d2583c1cbf 100644
--- a/ext/fiddle/fiddle.h
+++ b/ext/fiddle/fiddle.h
@@ -104,11 +104,6 @@
#include <conversions.h>
#include <function.h>
-/* FIXME
- * These constants need to match up with DL. We need to refactor this to use
- * the DL header files or vice versa.
- */
-
#define TYPE_VOID 0
#define TYPE_VOIDP 1
#define TYPE_CHAR 2
diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c
index 4a5a5892a6..8e280567db 100644
--- a/ext/fiddle/function.c
+++ b/ext/fiddle/function.c
@@ -1,7 +1,33 @@
#include <fiddle.h>
+#include <ruby/thread.h>
+
+#ifdef PRIsVALUE
+# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
+# define RB_OBJ_STRING(obj) (obj)
+#else
+# define PRIsVALUE "s"
+# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
+# define RB_OBJ_STRING(obj) StringValueCStr(obj)
+#endif
VALUE cFiddleFunction;
+#define MAX_ARGS (SIZE_MAX / (sizeof(void *) + sizeof(fiddle_generic)) - 1)
+
+#define Check_Max_Args(name, len) \
+ Check_Max_Args_(name, len, "")
+#define Check_Max_Args_Long(name, len) \
+ Check_Max_Args_(name, len, "l")
+#define Check_Max_Args_(name, len, fmt) \
+ if ((size_t)(len) < MAX_ARGS) { \
+ /* OK */ \
+ } \
+ else { \
+ rb_raise(rb_eTypeError, \
+ name" is so large that it can cause integer overflow (%"fmt"d)", \
+ (len)); \
+ }
+
static void
deallocate(void *p)
{
@@ -16,12 +42,11 @@ function_memsize(const void *p)
/* const */ffi_cif *ptr = (ffi_cif *)p;
size_t size = 0;
- if (ptr) {
- size += sizeof(*ptr);
+ size += sizeof(*ptr);
#if !defined(FFI_NO_RAW_API) || !FFI_NO_RAW_API
- size += ffi_raw_size(ptr);
+ size += ffi_raw_size(ptr);
#endif
- }
+
return size;
}
@@ -53,27 +78,47 @@ rb_fiddle_new_function(VALUE address, VALUE arg_types, VALUE ret_type)
static int
parse_keyword_arg_i(VALUE key, VALUE value, VALUE self)
{
- if (key == ID2SYM(rb_intern("name"))) {
- rb_iv_set(self, "@name", value);
- } else {
- rb_raise(rb_eArgError, "unknown keyword: %"PRIsVALUE, key);
- }
- return ST_CONTINUE;
+ if (key == ID2SYM(rb_intern("name"))) {
+ rb_iv_set(self, "@name", value);
+ } else {
+ rb_raise(rb_eArgError, "unknown keyword: %"PRIsVALUE,
+ RB_OBJ_STRING(key));
+ }
+ return ST_CONTINUE;
}
static VALUE
initialize(int argc, VALUE argv[], VALUE self)
{
ffi_cif * cif;
- ffi_type **arg_types;
+ ffi_type **arg_types, *rtype;
ffi_status result;
- VALUE ptr, args, ret_type, abi, kwds;
- int i;
+ VALUE ptr, args, ret_type, abi, kwds, ary;
+ int i, len;
+ int nabi;
+ void *cfunc;
rb_scan_args(argc, argv, "31:", &ptr, &args, &ret_type, &abi, &kwds);
- if(NIL_P(abi)) abi = INT2NUM(FFI_DEFAULT_ABI);
+ ptr = rb_Integer(ptr);
+ cfunc = NUM2PTR(ptr);
+ PTR2NUM(cfunc);
+ nabi = NIL_P(abi) ? FFI_DEFAULT_ABI : NUM2INT(abi);
+ abi = INT2FIX(nabi);
+ i = NUM2INT(ret_type);
+ rtype = INT2FFI_TYPE(i);
+ ret_type = INT2FIX(i);
Check_Type(args, T_ARRAY);
+ len = RARRAY_LENINT(args);
+ Check_Max_Args("args", len);
+ ary = rb_ary_subseq(args, 0, len);
+ for (i = 0; i < RARRAY_LEN(args); i++) {
+ VALUE a = RARRAY_PTR(args)[i];
+ int type = NUM2INT(a);
+ (void)INT2FFI_TYPE(type); /* raise */
+ if (INT2FIX(type) != a) rb_ary_store(ary, i, INT2FIX(type));
+ }
+ OBJ_FREEZE(ary);
rb_iv_set(self, "@ptr", ptr);
rb_iv_set(self, "@args", args);
@@ -84,20 +129,15 @@ initialize(int argc, VALUE argv[], VALUE self)
TypedData_Get_Struct(self, ffi_cif, &function_data_type, cif);
- arg_types = xcalloc(RARRAY_LEN(args) + 1, sizeof(ffi_type *));
+ arg_types = xcalloc(len + 1, sizeof(ffi_type *));
for (i = 0; i < RARRAY_LEN(args); i++) {
- int type = NUM2INT(RARRAY_PTR(args)[i]);
+ int type = NUM2INT(RARRAY_AREF(args, i));
arg_types[i] = INT2FFI_TYPE(type);
}
- arg_types[RARRAY_LEN(args)] = NULL;
+ arg_types[len] = NULL;
- result = ffi_prep_cif (
- cif,
- NUM2INT(abi),
- RARRAY_LENINT(args),
- INT2FFI_TYPE(NUM2INT(ret_type)),
- arg_types);
+ result = ffi_prep_cif(cif, nabi, len, rtype, arg_types);
if (result)
rb_raise(rb_eRuntimeError, "error creating CIF %d", result);
@@ -105,26 +145,42 @@ initialize(int argc, VALUE argv[], VALUE self)
return self;
}
+struct nogvl_ffi_call_args {
+ ffi_cif *cif;
+ void (*fn)(void);
+ void **values;
+ fiddle_generic retval;
+};
+
+static void *
+nogvl_ffi_call(void *ptr)
+{
+ struct nogvl_ffi_call_args *args = ptr;
+
+ ffi_call(args->cif, args->fn, &args->retval, args->values);
+
+ return NULL;
+}
+
static VALUE
function_call(int argc, VALUE argv[], VALUE self)
{
- ffi_cif * cif;
- fiddle_generic retval;
+ struct nogvl_ffi_call_args args = { 0 };
fiddle_generic *generic_args;
- void **values;
VALUE cfunc, types, cPointer;
int i;
+ VALUE alloc_buffer = 0;
cfunc = rb_iv_get(self, "@ptr");
types = rb_iv_get(self, "@args");
cPointer = rb_const_get(mFiddle, rb_intern("Pointer"));
- if(argc != RARRAY_LENINT(types)) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
- argc, RARRAY_LENINT(types));
+ Check_Max_Args("number of arguments", argc);
+ if (argc != (i = RARRAY_LENINT(types))) {
+ rb_error_arity(argc, i, i);
}
- TypedData_Get_Struct(self, ffi_cif, &function_data_type, cif);
+ TypedData_Get_Struct(self, ffi_cif, &function_data_type, args.cif);
if (rb_safe_level() >= 1) {
for (i = 0; i < argc; i++) {
@@ -135,14 +191,17 @@ function_call(int argc, VALUE argv[], VALUE self)
}
}
- values = xcalloc((size_t)argc + 1, (size_t)sizeof(void *));
- generic_args = xcalloc((size_t)argc, (size_t)sizeof(fiddle_generic));
+ generic_args = ALLOCV(alloc_buffer,
+ (size_t)(argc + 1) * sizeof(void *) + (size_t)argc * sizeof(fiddle_generic));
+ args.values = (void **)((char *)generic_args +
+ (size_t)argc * sizeof(fiddle_generic));
for (i = 0; i < argc; i++) {
- VALUE type = RARRAY_PTR(types)[i];
+ VALUE type = RARRAY_AREF(types, i);
VALUE src = argv[i];
+ int argtype = FIX2INT(type);
- if(NUM2INT(type) == TYPE_VOIDP) {
+ if (argtype == TYPE_VOIDP) {
if(NIL_P(src)) {
src = INT2FIX(0);
} else if(cPointer != CLASS_OF(src)) {
@@ -151,22 +210,22 @@ function_call(int argc, VALUE argv[], VALUE self)
src = rb_Integer(src);
}
- VALUE2GENERIC(NUM2INT(type), src, &generic_args[i]);
- values[i] = (void *)&generic_args[i];
+ VALUE2GENERIC(argtype, src, &generic_args[i]);
+ args.values[i] = (void *)&generic_args[i];
}
- values[argc] = NULL;
+ args.values[argc] = NULL;
+ args.fn = NUM2PTR(cfunc);
- ffi_call(cif, NUM2PTR(rb_Integer(cfunc)), &retval, values);
+ (void)rb_thread_call_without_gvl(nogvl_ffi_call, &args, 0, 0);
rb_funcall(mFiddle, rb_intern("last_error="), 1, INT2NUM(errno));
#if defined(_WIN32)
rb_funcall(mFiddle, rb_intern("win32_last_error="), 1, INT2NUM(errno));
#endif
- xfree(values);
- xfree(generic_args);
+ ALLOCV_END(alloc_buffer);
- return GENERIC2VALUE(rb_iv_get(self, "@return_type"), retval);
+ return GENERIC2VALUE(rb_iv_get(self, "@return_type"), args.retval);
}
void
@@ -199,7 +258,7 @@ Init_fiddle_function(void)
*
* === ABI check
*
- * @libc = DL.dlopen "/lib/libc.so.6"
+ * @libc = Fiddle.dlopen "/lib/libc.so.6"
* #=> #<Fiddle::Handle:0x00000001d7a8d8>
* f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP)
* #=> #<Fiddle::Function:0x00000001d8ee00>
@@ -231,7 +290,9 @@ Init_fiddle_function(void)
/*
* Document-method: call
*
- * Calls the constructed Function, with +args+
+ * Calls the constructed Function, with +args+.
+ * Caller must ensure the underlying function is called in a
+ * thread-safe manner if running in a multi-threaded process.
*
* For an example see Fiddle::Function
*
diff --git a/ext/fiddle/function.h b/ext/fiddle/function.h
index e5465ab64f..829e592c8a 100644
--- a/ext/fiddle/function.h
+++ b/ext/fiddle/function.h
@@ -3,6 +3,6 @@
#include <fiddle.h>
-void Init_fiddle_function();
+void Init_fiddle_function(void);
#endif
diff --git a/ext/fiddle/handle.c b/ext/fiddle/handle.c
index 330dbafe67..e727ccfd00 100644
--- a/ext/fiddle/handle.c
+++ b/ext/fiddle/handle.c
@@ -1,6 +1,8 @@
#include <ruby.h>
#include <fiddle.h>
+#define SafeStringValueCStr(v) (rb_check_safe_obj(rb_string_value(&v)), StringValueCStr(v))
+
VALUE rb_cHandle;
struct dl_handle {
@@ -40,12 +42,13 @@ fiddle_handle_free(void *ptr)
if( fiddle_handle->ptr && fiddle_handle->open && fiddle_handle->enable_close ){
dlclose(fiddle_handle->ptr);
}
+ xfree(ptr);
}
static size_t
fiddle_handle_memsize(const void *ptr)
{
- return ptr ? sizeof(struct dl_handle) : 0;
+ return sizeof(struct dl_handle);
}
static const rb_data_type_t fiddle_handle_data_type = {
@@ -142,19 +145,17 @@ rb_fiddle_handle_initialize(int argc, VALUE argv[], VALUE self)
cflag = RTLD_LAZY | RTLD_GLOBAL;
break;
case 1:
- clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
+ clib = NIL_P(lib) ? NULL : SafeStringValueCStr(lib);
cflag = RTLD_LAZY | RTLD_GLOBAL;
break;
case 2:
- clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
+ clib = NIL_P(lib) ? NULL : SafeStringValueCStr(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);
@@ -169,6 +170,7 @@ rb_fiddle_handle_initialize(int argc, VALUE argv[], VALUE self)
# ifdef _WIN32_WCE
ptr = dlopen("coredll.dll", cflag);
# else
+ (void)cflag;
ptr = w32_coredll();
# endif
}
@@ -262,7 +264,7 @@ rb_fiddle_handle_to_i(VALUE self)
return PTR2NUM(fiddle_handle);
}
-static VALUE fiddle_handle_sym(void *handle, const char *symbol);
+static VALUE fiddle_handle_sym(void *handle, VALUE symbol);
/*
* Document-method: sym
@@ -281,7 +283,7 @@ rb_fiddle_handle_sym(VALUE self, VALUE sym)
rb_raise(rb_eFiddleError, "closed handle");
}
- return fiddle_handle_sym(fiddle_handle->ptr, StringValueCStr(sym));
+ return fiddle_handle_sym(fiddle_handle->ptr, sym);
}
#ifndef RTLD_NEXT
@@ -304,21 +306,21 @@ rb_fiddle_handle_sym(VALUE self, VALUE sym)
static VALUE
rb_fiddle_handle_s_sym(VALUE self, VALUE sym)
{
- return fiddle_handle_sym(RTLD_NEXT, StringValueCStr(sym));
+ return fiddle_handle_sym(RTLD_NEXT, sym);
}
static VALUE
-fiddle_handle_sym(void *handle, const char *name)
+fiddle_handle_sym(void *handle, VALUE symbol)
{
#if defined(HAVE_DLERROR)
const char *err;
-# define CHECK_DLERROR if( err = dlerror() ){ func = 0; }
+# define CHECK_DLERROR if ((err = dlerror()) != 0) { func = 0; }
#else
# define CHECK_DLERROR
#endif
void (*func)();
+ const char *name = SafeStringValueCStr(symbol);
- rb_secure(2);
#ifdef HAVE_DLERROR
dlerror();
#endif
@@ -366,7 +368,7 @@ fiddle_handle_sym(void *handle, const char *name)
}
#endif
if( !func ){
- rb_raise(rb_eFiddleError, "unknown symbol \"%s\"", name);
+ rb_raise(rb_eFiddleError, "unknown symbol \"%"PRIsVALUE"\"", symbol);
}
return PTR2NUM(func);
diff --git a/ext/fiddle/lib/fiddle.rb b/ext/fiddle/lib/fiddle.rb
index ae6e299637..5208eb9328 100644
--- a/ext/fiddle/lib/fiddle.rb
+++ b/ext/fiddle/lib/fiddle.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'fiddle.so'
require 'fiddle/function'
require 'fiddle/closure'
diff --git a/ext/fiddle/lib/fiddle/closure.rb b/ext/fiddle/lib/fiddle/closure.rb
index beb90ecbe5..0b9adbb60a 100644
--- a/ext/fiddle/lib/fiddle/closure.rb
+++ b/ext/fiddle/lib/fiddle/closure.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Fiddle
class Closure
diff --git a/ext/fiddle/lib/fiddle/cparser.rb b/ext/fiddle/lib/fiddle/cparser.rb
index 43fb184a12..6b9da9fa7c 100644
--- a/ext/fiddle/lib/fiddle/cparser.rb
+++ b/ext/fiddle/lib/fiddle/cparser.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Fiddle
# A mixin that provides methods for parsing C struct and prototype signatures.
#
@@ -7,8 +8,14 @@ module Fiddle
# include Fiddle::CParser
# #=> Object
#
- # parse_ctype('int increment(int)')
- # #=> ["increment", Fiddle::TYPE_INT, [Fiddle::TYPE_INT]]
+ # parse_ctype('int')
+ # #=> Fiddle::TYPE_INT
+ #
+ # parse_struct_signature(['int i', 'char c'])
+ # #=> [[Fiddle::TYPE_INT, Fiddle::TYPE_CHAR], ["i", "c"]]
+ #
+ # parse_signature('double sum(double, double)')
+ # #=> ["sum", Fiddle::TYPE_DOUBLE, [Fiddle::TYPE_DOUBLE, Fiddle::TYPE_DOUBLE]]
#
module CParser
# Parses a C struct's members
@@ -21,37 +28,33 @@ module Fiddle
# parse_struct_signature(['int i', 'char c'])
# #=> [[Fiddle::TYPE_INT, Fiddle::TYPE_CHAR], ["i", "c"]]
#
+ # parse_struct_signature(['char buffer[80]'])
+ # #=> [[[Fiddle::TYPE_CHAR, 80]], ["buffer"]]
+ #
def parse_struct_signature(signature, tymap=nil)
- if( signature.is_a?(String) )
- signature = signature.split(/\s*,\s*/)
+ if signature.is_a?(String)
+ signature = split_arguments(signature, /[,;]/)
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*\[\]/, "")
+ msig = compact(msig)
+ case msig
+ when /^[\w\*\s]+[\*\s](\w+)$/
+ mems.push($1)
+ tys.push(parse_ctype(msig, tymap))
+ when /^[\w\*\s]+\(\*(\w+)\)\(.*?\)$/
+ mems.push($1)
+ tys.push(parse_ctype(msig, tymap))
+ when /^([\w\*\s]+[\*\s])(\w+)\[(\d+)\]$/
+ mems.push($2)
+ tys.push([parse_ctype($1.strip, tymap), $3.to_i])
+ when /^([\w\*\s]+)\[(\d+)\](\w+)$/
+ mems.push($3)
+ tys.push([parse_ctype($1.strip, tymap), $2.to_i])
+ else
+ raise(RuntimeError,"can't parse the struct member: #{msig}")
end
-
- mems.push(member)
- tys.push(parse_ctype(ty,tymap))
}
return tys, mems
end
@@ -70,22 +73,21 @@ module Fiddle
# parse_signature('double sum(double, double)')
# #=> ["sum", Fiddle::TYPE_DOUBLE, [Fiddle::TYPE_DOUBLE, Fiddle::TYPE_DOUBLE]]
#
+ # parse_signature('void update(void (*cb)(int code))')
+ # #=> ["update", Fiddle::TYPE_VOID, [Fiddle::TYPE_VOIDP]]
+ #
+ # parse_signature('char (*getbuffer(void))[80]')
+ # #=> ["getbuffer", Fiddle::TYPE_VOIDP, []]
+ #
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)}]
+ case compact(signature)
+ when /^(?:[\w\*\s]+)\(\*(\w+)\((.*?)\)\)(?:\[\w*\]|\(.*?\));?$/
+ func, args = $1, $2
+ return [func, TYPE_VOIDP, split_arguments(args).collect {|arg| parse_ctype(arg, tymap)}]
+ when /^([\w\*\s]+[\*\s])(\w+)\((.*?)\);?$/
+ ret, func, args = $1.strip, $2, $3
+ return [func, parse_ctype(ret, tymap), split_arguments(args).collect {|arg| parse_ctype(arg, tymap)}]
else
raise(RuntimeError,"can't parse the function prototype: #{signature}")
end
@@ -107,64 +109,68 @@ module Fiddle
# parse_ctype('int')
# #=> Fiddle::TYPE_INT
#
- # parse_ctype('double')
+ # parse_ctype('double diff')
# #=> Fiddle::TYPE_DOUBLE
#
- # parse_ctype('unsigned char')
+ # parse_ctype('unsigned char byte')
# #=> -Fiddle::TYPE_CHAR
#
+ # parse_ctype('const char* const argv[]')
+ # #=> -Fiddle::TYPE_VOIDP
+ #
def parse_ctype(ty, tymap=nil)
tymap ||= {}
case ty
when Array
return [parse_ctype(ty[0], tymap), ty[1]]
- when "void"
+ 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"
+ when /^(?:(?:signed\s+)?long\s+long(?:\s+int\s+)?|int64_t)(?:\s+\w+)?$/
if( defined?(TYPE_LONG_LONG) )
return TYPE_LONG_LONG
else
raise(RuntimeError, "unsupported type: #{ty}")
end
- when "unsigned long long"
+ when /^(?:unsigned\s+long\s+long(?:\s+int\s+)?|uint64_t)(?:\s+\w+)?$/
if( defined?(TYPE_LONG_LONG) )
return -TYPE_LONG_LONG
else
raise(RuntimeError, "unsupported type: #{ty}")
end
- when "float"
+ when /^(?:signed\s+)?long(?:\s+int\s+)?(?:\s+\w+)?$/
+ return TYPE_LONG
+ when /^unsigned\s+long(?:\s+int\s+)?(?:\s+\w+)?$/
+ return -TYPE_LONG
+ when /^(?:signed\s+)?int(?:\s+\w+)?$/
+ return TYPE_INT
+ when /^(?:unsigned\s+int|uint)(?:\s+\w+)?$/
+ return -TYPE_INT
+ when /^(?:signed\s+)?short(?:\s+int\s+)?(?:\s+\w+)?$/
+ return TYPE_SHORT
+ when /^unsigned\s+short(?:\s+int\s+)?(?:\s+\w+)?$/
+ return -TYPE_SHORT
+ when /^(?:signed\s+)?char(?:\s+\w+)?$/
+ return TYPE_CHAR
+ when /^unsigned\s+char(?:\s+\w+)?$/
+ return -TYPE_CHAR
+ when /^float(?:\s+\w+)?$/
return TYPE_FLOAT
- when "double"
+ when /^double(?:\s+\w+)?$/
return TYPE_DOUBLE
- when "size_t"
+ when /^size_t(?:\s+\w+)?$/
return TYPE_SIZE_T
- when "ssize_t"
+ when /^ssize_t(?:\s+\w+)?$/
return TYPE_SSIZE_T
- when "ptrdiff_t"
+ when /^ptrdiff_t(?:\s+\w+)?$/
return TYPE_PTRDIFF_T
- when "intptr_t"
+ when /^intptr_t(?:\s+\w+)?$/
return TYPE_INTPTR_T
- when "uintptr_t"
+ when /^uintptr_t(?:\s+\w+)?$/
return TYPE_UINTPTR_T
- when /\*/, /\[\s*\]/
+ when /\*/, /\[[\s\d]*\]/
return TYPE_VOIDP
else
+ ty = ty.split(' ', 2)[0]
if( tymap[ty] )
return parse_ctype(tymap[ty], tymap)
else
@@ -172,5 +178,17 @@ module Fiddle
end
end
end
+
+ private
+
+ def split_arguments(arguments, sep=',')
+ return [] if arguments.strip == 'void'
+ arguments.scan(/([\w\*\s]+\(\*\w*\)\(.*?\)|[\w\*\s\[\]]+)(?:#{sep}\s*|$)/).collect {|m| m[0]}
+ end
+
+ def compact(signature)
+ signature.gsub(/\s+/, ' ').gsub(/\s*([\(\)\[\]\*,;])\s*/, '\1').strip
+ end
+
end
end
diff --git a/ext/fiddle/lib/fiddle/function.rb b/ext/fiddle/lib/fiddle/function.rb
index ab7496e944..fcd90dfd26 100644
--- a/ext/fiddle/lib/fiddle/function.rb
+++ b/ext/fiddle/lib/fiddle/function.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Fiddle
class Function
# The ABI of the Function.
diff --git a/ext/fiddle/lib/fiddle/import.rb b/ext/fiddle/lib/fiddle/import.rb
index 8b948e8f23..7f959ed20b 100644
--- a/ext/fiddle/lib/fiddle/import.rb
+++ b/ext/fiddle/lib/fiddle/import.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'fiddle'
require 'fiddle/struct'
require 'fiddle/cparser'
@@ -63,7 +64,7 @@ module Fiddle
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, Fiddle::Importer, or will create a new instance of
# Fiddle::Handle using Fiddle.dlopen
#
# Raises a DLError if the library cannot be loaded.
@@ -112,7 +113,7 @@ module Fiddle
when TYPE_LONG
return SIZEOF_LONG
when TYPE_LONG_LONG
- return SIZEOF_LONG_LON
+ return SIZEOF_LONG_LONG
when TYPE_FLOAT
return SIZEOF_FLOAT
when TYPE_DOUBLE
diff --git a/ext/fiddle/lib/fiddle/pack.rb b/ext/fiddle/lib/fiddle/pack.rb
index e4e9542cc0..6301068450 100644
--- a/ext/fiddle/lib/fiddle/pack.rb
+++ b/ext/fiddle/lib/fiddle/pack.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'fiddle'
module Fiddle
diff --git a/ext/fiddle/lib/fiddle/struct.rb b/ext/fiddle/lib/fiddle/struct.rb
index 695a4d2247..233a987269 100644
--- a/ext/fiddle/lib/fiddle/struct.rb
+++ b/ext/fiddle/lib/fiddle/struct.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'fiddle'
require 'fiddle/value'
require 'fiddle/pack'
diff --git a/ext/fiddle/lib/fiddle/types.rb b/ext/fiddle/lib/fiddle/types.rb
index 02c1d25a37..8a72635a69 100644
--- a/ext/fiddle/lib/fiddle/types.rb
+++ b/ext/fiddle/lib/fiddle/types.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Fiddle
# Adds Windows type aliases to the including class for use with
# Fiddle::Importer.
diff --git a/ext/fiddle/lib/fiddle/value.rb b/ext/fiddle/lib/fiddle/value.rb
index 8d71e47ce6..ac318cf2c4 100644
--- a/ext/fiddle/lib/fiddle/value.rb
+++ b/ext/fiddle/lib/fiddle/value.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'fiddle'
module Fiddle
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
index 4f4842fc33..932bc576c5 100644
--- a/ext/fiddle/pointer.c
+++ b/ext/fiddle/pointer.c
@@ -7,6 +7,15 @@
#include <ctype.h>
#include <fiddle.h>
+#ifdef PRIsVALUE
+# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
+# define RB_OBJ_STRING(obj) (obj)
+#else
+# define PRIsVALUE "s"
+# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
+# define RB_OBJ_STRING(obj) StringValueCStr(obj)
+#endif
+
VALUE rb_cPointer;
typedef void (*freefunc_t)(void*);
@@ -56,13 +65,14 @@ fiddle_ptr_free(void *ptr)
(*(data->free))(data->ptr);
}
}
+ xfree(ptr);
}
static size_t
fiddle_ptr_memsize(const void *ptr)
{
const struct ptr_data *data = ptr;
- return data ? sizeof(*data) + data->size : 0;
+ return sizeof(*data) + data->size;
}
static const rb_data_type_t fiddle_ptr_data_type = {
@@ -427,12 +437,10 @@ 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);
+ return rb_sprintf("#<%"PRIsVALUE":%p ptr=%p size=%ld free=%p>",
+ RB_OBJ_CLASSNAME(self), data, data->ptr, data->size, data->free);
}
/*
diff --git a/ext/fiddle/win32/fficonfig.h b/ext/fiddle/win32/fficonfig.h
new file mode 100755
index 0000000000..776808159c
--- /dev/null
+++ b/ext/fiddle/win32/fficonfig.h
@@ -0,0 +1,29 @@
+#define HAVE_ALLOCA 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TYPES_H 1
+#if _MSC_VER >= 1600
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#endif
+
+#define SIZEOF_DOUBLE 8
+#if defined(X86_WIN64)
+#define SIZEOF_SIZE_T 8
+#else
+#define SIZEOF_SIZE_T 4
+#endif
+
+#define STACK_DIRECTION -1
+
+#define STDC_HEADERS 1
+
+#ifdef LIBFFI_ASM
+#define FFI_HIDDEN(name)
+#else
+#define FFI_HIDDEN
+#endif
+
diff --git a/ext/fiddle/win32/libffi-3.2.1-mswin.patch b/ext/fiddle/win32/libffi-3.2.1-mswin.patch
new file mode 100644
index 0000000000..f9100e703d
--- /dev/null
+++ b/ext/fiddle/win32/libffi-3.2.1-mswin.patch
@@ -0,0 +1,191 @@
+diff -ru libffi-3.2.1/src/x86/ffi.c libffi-3.2.1/src/x86/ffi.c
+--- libffi-3.2.1/src/x86/ffi.c 2014-11-08 21:47:24.000000000 +0900
++++ libffi-3.2.1/src/x86/ffi.c 2014-12-25 18:46:14.806761900 +0900
+@@ -99,11 +99,13 @@
+ i != 0;
+ i--, p_arg += dir, p_argv += dir)
+ {
++ size_t z;
++
+ /* Align if necessary */
+ if ((sizeof(void*) - 1) & (size_t) argp)
+ argp = (char *) ALIGN(argp, sizeof(void*));
+
+- size_t z = (*p_arg)->size;
++ z = (*p_arg)->size;
+
+ #ifdef X86_WIN64
+ if (z > FFI_SIZEOF_ARG
+@@ -202,6 +204,7 @@
+ on top of stack, so that those can be moved to registers by call-handler. */
+ if (stack_args_count > 0)
+ {
++ int i;
+ if (dir < 0 && stack_args_count > 1)
+ {
+ /* Reverse order if iterating arguments backwards */
+@@ -210,7 +213,6 @@
+ *(ffi_arg*) p_stack_data[stack_args_count - 1] = tmp;
+ }
+
+- int i;
+ for (i = 0; i < stack_args_count; i++)
+ {
+ if (p_stack_data[i] != argp2)
+@@ -569,11 +571,12 @@
+ i < cif->nargs && passed_regs < max_stack_count;
+ i++, p_arg++)
+ {
++ size_t sz;
+ if ((*p_arg)->type == FFI_TYPE_FLOAT
+ || (*p_arg)->type == FFI_TYPE_STRUCT)
+ continue;
+
+- size_t sz = (*p_arg)->size;
++ sz = (*p_arg)->size;
+ if(sz == 0 || sz > FFI_SIZEOF_ARG)
+ continue;
+
+@@ -599,11 +602,13 @@
+ i != 0;
+ i--, p_arg += dir, p_argv += dir)
+ {
++ size_t z;
++
+ /* Align if necessary */
+ if ((sizeof(void*) - 1) & (size_t) argp)
+ argp = (char *) ALIGN(argp, sizeof(void*));
+
+- size_t z = (*p_arg)->size;
++ z = (*p_arg)->size;
+
+ #ifdef X86_WIN64
+ if (z > FFI_SIZEOF_ARG
+@@ -642,7 +647,7 @@
+ #endif
+ }
+
+- return (size_t)argp - (size_t)stack;
++ return (int)((size_t)argp - (size_t)stack);
+ }
+
+ #define FFI_INIT_TRAMPOLINE_WIN64(TRAMP,FUN,CTX,MASK) \
+@@ -855,11 +860,12 @@
+
+ for (i = 0; i < cif->nargs && passed_regs <= max_regs; i++)
+ {
++ size_t sz;
+ if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
+ || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
+ continue;
+
+- size_t sz = cif->arg_types[i]->size;
++ sz = cif->arg_types[i]->size;
+ if (sz == 0 || sz > FFI_SIZEOF_ARG)
+ continue;
+
+diff -ru libffi-3.2.1/src/x86/ffitarget.h libffi-3.2.1/src/x86/ffitarget.h
+--- libffi-3.2.1/src/x86/ffitarget.h 2014-11-08 21:47:24.000000000 +0900
++++ libffi-3.2.1/src/x86/ffitarget.h 2014-12-22 15:45:54.000000000 +0900
+@@ -50,7 +50,9 @@
+ #endif
+
+ #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
++#ifndef _MSC_VER
+ #define FFI_TARGET_HAS_COMPLEX_TYPE
++#endif
+
+ /* ---- Generic type definitions ----------------------------------------- */
+
+diff -ru libffi-3.2.1/src/x86/win64.S libffi-3.2.1/src/x86/win64.S
+--- libffi-3.2.1/src/x86/win64.S 2014-11-08 21:47:24.000000000 +0900
++++ libffi-3.2.1/src/x86/win64.S 2014-12-22 16:14:40.000000000 +0900
+@@ -127,7 +127,7 @@
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov DWORD PTR [rcx], eax
+- jmp ret_void$
++ jmp SHORT ret_void$
+
+ ret_struct2b$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_2B
+@@ -135,7 +135,7 @@
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov WORD PTR [rcx], ax
+- jmp ret_void$
++ jmp SHORT ret_void$
+
+ ret_struct1b$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_1B
+@@ -143,7 +143,7 @@
+
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov BYTE PTR [rcx], al
+- jmp ret_void$
++ jmp SHORT ret_void$
+
+ ret_uint8$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT8
+@@ -152,7 +152,7 @@
+ mov rcx, QWORD PTR RVALUE[rbp]
+ movzx rax, al
+ mov QWORD PTR [rcx], rax
+- jmp ret_void$
++ jmp SHORT ret_void$
+
+ ret_sint8$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT8
+@@ -161,7 +161,7 @@
+ mov rcx, QWORD PTR RVALUE[rbp]
+ movsx rax, al
+ mov QWORD PTR [rcx], rax
+- jmp ret_void$
++ jmp SHORT ret_void$
+
+ ret_uint16$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT16
+@@ -188,7 +188,13 @@
+ mov rcx, QWORD PTR RVALUE[rbp]
+ mov eax, eax
+ mov QWORD PTR [rcx], rax
+- jmp SHORT ret_void$
++
++ret_void$:
++ xor rax, rax
++
++ lea rsp, QWORD PTR [rbp+16]
++ pop rbp
++ ret 0
+
+ ret_sint32$:
+ cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT32
+@@ -247,13 +253,6 @@
+ cdqe
+ mov QWORD PTR [rcx], rax
+ jmp SHORT ret_void$
+-
+-ret_void$:
+- xor rax, rax
+-
+- lea rsp, QWORD PTR [rbp+16]
+- pop rbp
+- ret 0
+ ffi_call_win64 ENDP
+ _TEXT ENDS
+ END
+diff -ru libffi-3.2.1/include/ffi.h.in libffi-3.2.1/include/ffi.h.in
+--- libffi-3.2.1/include/ffi.h.in 2014-11-08 21:47:24.000000000 +0900
++++ libffi-3.2.1/include/ffi.h.in 2015-01-11 12:35:30.000000000 +0900
+@@ -103,6 +103,11 @@
+ # undef FFI_64_BIT_MAX
+ # define FFI_64_BIT_MAX 9223372036854775807LL
+ # endif
++# ifdef _MSC_VER
++# define FFI_LONG_LONG_MAX _I64_MAX
++# undef FFI_64_BIT_MAX
++# define FFI_64_BIT_MAX 9223372036854775807I64
++# endif
+ # endif
+ #endif
+
diff --git a/ext/fiddle/win32/libffi-config.rb b/ext/fiddle/win32/libffi-config.rb
new file mode 100755
index 0000000000..7a32a91517
--- /dev/null
+++ b/ext/fiddle/win32/libffi-config.rb
@@ -0,0 +1,48 @@
+#!/usr/bin/ruby
+# frozen_string_literal: false
+require 'fileutils'
+
+basedir = File.dirname(__FILE__)
+conf = {}
+enable = {}
+until ARGV.empty?
+ arg = ARGV.shift
+ case arg
+ when '-C'
+ # ignore
+ when /\A--srcdir=(.*)/
+ conf['SRCDIR'] = srcdir = $1
+ when /\A(CC|CFLAGS|CXX|CXXFLAGS|LD|LDFLAGS)=(.*)/
+ conf[$1] = $2
+ when /\A--host=(.*)/
+ host = $1
+ when /\A--enable-([^=]+)(?:=(.*))?/
+ enable[$1] = $2 || true
+ when /\A--disable-([^=]+)/
+ enable[$1] = false
+ end
+end
+
+IO.foreach("#{srcdir}/configure.ac") do |line|
+ if /^AC_INIT\((.*)\)/ =~ line
+ version = $1.split(/,\s*/)[1]
+ version.gsub!(/\A\[|\]\z/, '')
+ conf['VERSION'] = version
+ break
+ end
+end
+
+builddir = srcdir == "." ? enable['builddir'] : "."
+conf['TARGET'] = /^x64/ =~ host ? "X86_WIN64" : "X86_WIN32"
+
+FileUtils.mkdir_p([builddir, "#{builddir}/include", "#{builddir}/src/x86"])
+FileUtils.cp("#{basedir}/fficonfig.h", ".", preserve: true)
+
+hdr = IO.binread("#{srcdir}/include/ffi.h.in")
+hdr.gsub!(/@(\w+)@/) {conf[$1] || $&}
+hdr.gsub!(/^(#if\s+)@\w+@/, '\10')
+IO.binwrite("#{builddir}/include/ffi.h", hdr)
+
+mk = IO.binread("#{basedir}/libffi.mk.tmpl")
+mk.gsub!(/@(\w+)@/) {conf[$1] || $&}
+IO.binwrite("Makefile", mk)
diff --git a/ext/fiddle/win32/libffi.mk.tmpl b/ext/fiddle/win32/libffi.mk.tmpl
new file mode 100755
index 0000000000..2a16e8efec
--- /dev/null
+++ b/ext/fiddle/win32/libffi.mk.tmpl
@@ -0,0 +1,96 @@
+# -*- makefile -*-
+# ====================================================================
+#
+# libffi Windows Makefile
+#
+#
+# ====================================================================
+#
+NAME = ffi
+TARGET = @TARGET@
+CC = cl
+!if "$(TARGET)" == "X86_WIN64"
+AS = ml64
+!else
+AS = ml
+!endif
+AR = link
+DLEXT = dll
+OBJEXT = obj
+LIBEXT = lib
+TOPDIR = @SRCDIR@
+CPP = $(CC) -EP
+CFLAGS = @CFLAGS@
+ARFLAGS = -lib
+ASFLAGS = -coff -W3 -Cx
+INCLUDES= -I. -I./include -I./src/x86 \
+ -I$(TOPDIR)/include -I$(TOPDIR)/include/src/x86
+
+SRCDIR = $(TOPDIR)/src
+WORKDIR = ./.libs
+BUILDDIR= ./src
+LIBNAME = lib$(NAME)
+STATICLIB= $(WORKDIR)/$(LIBNAME)_convenience.$(LIBEXT)
+
+HEADERS = \
+ ./fficonfig.h
+FFI_HEADERS = \
+ ./include/ffi.h \
+ ./include/ffitarget.h
+
+!if "$(TARGET)" == "X86_WIN32"
+OSSRC = win32
+!else if "$(TARGET)" == "X86_WIN64"
+OSSRC = win64
+!else
+! error unknown target: $(TARGET)
+!endif
+
+OBJECTS = \
+ $(BUILDDIR)/closures.$(OBJEXT) \
+ $(BUILDDIR)/debug.$(OBJEXT) \
+ $(BUILDDIR)/java_raw_api.$(OBJEXT) \
+ $(BUILDDIR)/prep_cif.$(OBJEXT) \
+ $(BUILDDIR)/raw_api.$(OBJEXT) \
+ $(BUILDDIR)/types.$(OBJEXT) \
+ $(BUILDDIR)/x86/ffi.$(OBJEXT) \
+ $(BUILDDIR)/x86/$(OSSRC).$(OBJEXT)
+ASMSRCS = \
+ $(BUILDDIR)/x86/$(OSSRC).asm
+
+.SUFFIXES : .S .asm
+
+all: $(WORKDIR) $(STATICLIB)
+
+{$(SRCDIR)}.c{$(BUILDDIR)}.$(OBJEXT):
+ $(CC) -c $(CFLAGS) $(INCLUDES) -Fo$(@:\=/) -Fd$(WORKDIR)/$(NAME)-src $(<:\=/)
+
+{$(SRCDIR)/x86}.c{$(BUILDDIR)/x86}.$(OBJEXT):
+ $(CC) -c $(CFLAGS) $(INCLUDES) -Fo$(@:\=/) -Fd$(WORKDIR)/$(NAME)-src $(<:\=/)
+
+{$(SRCDIR)/x86}.S{$(BUILDDIR)/x86}.asm:
+ $(CPP) $(CFLAGS) $(INCLUDES) $(<:\=/) >$(@:\=/)
+
+{$(BUILDDIR)/x86}.asm{$(BUILDDIR)/x86}.$(OBJEXT):
+ cd $(@D) && $(AS) -c $(ASFLAGS) -Fo $(@F) $(<F)
+
+$(BUILDDIR)/x86/$(OSSRC).asm: $(SRCDIR)/x86/$(OSSRC).S
+
+$(OBJECTS): $(FFI_HEADERS) $(HEADERS)
+
+$(WORKDIR):
+ -@if not exist "$(WORKDIR:/=\)\$(NULL)" mkdir $(WORKDIR:/=\)
+
+$(STATICLIB): $(WORKDIR) $(OBJECTS)
+ $(AR) $(ARFLAGS) -out:$(STATICLIB) @<<
+ $(OBJECTS)
+<<
+
+clean:
+ -@del /Q $(OBJECTS:/=\) 2>NUL
+ -@del /Q $(ASMSRCS:/=\) 2>NUL
+ -@del /Q /S $(WORKDIR:/=\) 2>NUL
+
+distclean: clean
+ -@del /Q $(HEADERS:/=\) $(FFI_HEADERS:/=\) 2>NUL
+ -@del /Q Makefile 2>NUL
diff --git a/ext/gdbm/extconf.rb b/ext/gdbm/extconf.rb
index 5a09492e5e..d1908ffa5c 100644
--- a/ext/gdbm/extconf.rb
+++ b/ext/gdbm/extconf.rb
@@ -1,7 +1,19 @@
+# frozen_string_literal: false
require 'mkmf'
dir_config("gdbm")
if have_library("gdbm", "gdbm_open") and
have_header("gdbm.h")
+ checking_for("sizeof(DBM) is available") {
+ if try_compile(<<SRC)
+#include <gdbm.h>
+
+const int sizeof_DBM = (int)sizeof(DBM);
+SRC
+ $defs << '-DDBM_SIZEOF_DBM=sizeof(DBM)'
+ else
+ $defs << '-DDBM_SIZEOF_DBM=0'
+ end
+ }
create_makefile("gdbm")
end
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 888f95d91f..709f466cd8 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -101,25 +101,45 @@ closed_dbm(void)
}
#define GetDBM(obj, dbmp) do {\
- Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+ TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
if ((dbmp) == 0) closed_dbm();\
if ((dbmp)->di_dbm == 0) closed_dbm();\
} while (0)
-#define GetDBM2(obj, data, dbm) {\
- GetDBM((obj), (data));\
- (dbm) = dbmp->di_dbm;\
-}
+#define GetDBM2(obj, dbmp, dbm) do {\
+ GetDBM((obj), (dbmp));\
+ (dbm) = (dbmp)->di_dbm;\
+} while (0)
static void
-free_dbm(struct dbmdata *dbmp)
+free_dbm(void *ptr)
{
+ struct dbmdata *dbmp = ptr;
if (dbmp) {
if (dbmp->di_dbm) gdbm_close(dbmp->di_dbm);
xfree(dbmp);
}
}
+static size_t
+memsize_dbm(const void *ptr)
+{
+ size_t size = 0;
+ const struct dbmdata *dbmp = ptr;
+ if (dbmp) {
+ size += sizeof(*dbmp);
+ if (dbmp->di_dbm) size += DBM_SIZEOF_DBM;
+ }
+ return size;
+}
+
+static const rb_data_type_t dbm_type = {
+ "gdbm",
+ {0, free_dbm, memsize_dbm,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* call-seq:
* gdbm.close -> nil
@@ -149,7 +169,7 @@ fgdbm_closed(VALUE obj)
{
struct dbmdata *dbmp;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
+ TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
if (dbmp == 0)
return Qtrue;
if (dbmp->di_dbm == 0)
@@ -161,7 +181,7 @@ fgdbm_closed(VALUE obj)
static VALUE
fgdbm_s_alloc(VALUE klass)
{
- return Data_Wrap_Struct(klass, 0, free_dbm, 0);
+ return TypedData_Wrap_Struct(klass, &dbm_type, 0);
}
/*
@@ -279,7 +299,7 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
static VALUE
fgdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0);
+ VALUE obj = fgdbm_s_alloc(klass);
if (NIL_P(fgdbm_initialize(argc, argv, obj))) {
return Qnil;
@@ -594,7 +614,8 @@ fgdbm_delete_if(VALUE obj)
GDBM_FILE dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_tmp_new(0);
- int i, status = 0, n;
+ long i;
+ int status = 0, n;
rb_gdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
@@ -613,7 +634,7 @@ fgdbm_delete_if(VALUE obj)
}
for (i = 0; i < RARRAY_LEN(ary); i++)
- rb_gdbm_delete(obj, RARRAY_PTR(ary)[i]);
+ rb_gdbm_delete(obj, RARRAY_AREF(ary, i));
if (status) rb_jump_tag(status);
if (n > 0) dbmp->di_size = n - (int)RARRAY_LEN(ary);
rb_ary_clear(ary);
@@ -726,11 +747,13 @@ fgdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
static VALUE
update_i(RB_BLOCK_CALL_FUNC_ARGLIST(pair, dbm))
{
+ const VALUE *ptr;
Check_Type(pair, T_ARRAY);
if (RARRAY_LEN(pair) < 2) {
rb_raise(rb_eArgError, "pair must be [key, value]");
}
- fgdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
+ ptr = RARRAY_CONST_PTR(pair);
+ fgdbm_store(dbm, ptr[0], ptr[1]);
return Qnil;
}
@@ -878,7 +901,7 @@ fgdbm_each_key(VALUE obj)
* gdbm.each_pair { |key, value| block } -> gdbm
*
* Executes _block_ for each key in the database, passing the _key_ and the
- * correspoding _value_ as a parameter.
+ * corresponding _value_ as a parameter.
*/
static VALUE
fgdbm_each_pair(VALUE obj)
@@ -1062,7 +1085,7 @@ fgdbm_reorganize(VALUE obj)
* gdbm.sync -> gdbm
*
* Unless the _gdbm_ object has been opened with the *SYNC* flag, it is not
- * guarenteed that database modification operations are immediately applied to
+ * guaranteed that database modification operations are immediately applied to
* the database file. This method ensures that all recent modifications
* to the database are written to the file. Blocks until all writing operations
* to the disk have been finished.
diff --git a/ext/io/console/buildgem.sh b/ext/io/console/buildgem.sh
new file mode 100755
index 0000000000..65fe545e1e
--- /dev/null
+++ b/ext/io/console/buildgem.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+cd ${0%/*}
+trap "mv depend.$$ depend" 0 2
+${RUBY-ruby} -i.$$ -pe 'exit if /^win32_vk/' depend
+${GEM-gem} build io-console.gemspec
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index f3379ffd8d..a408fd0870 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -3,17 +3,7 @@
* console IO module
*/
#include "ruby.h"
-#ifdef HAVE_RUBY_IO_H
#include "ruby/io.h"
-#else
-#include "rubyio.h"
-/* assumes rb_io_t doesn't have pathv */
-#include "util.h" /* for ruby_strdup() */
-#endif
-
-#ifndef HAVE_RB_IO_T
-typedef OpenFile rb_io_t;
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -25,10 +15,6 @@ typedef OpenFile rb_io_t;
#include <sys/ioctl.h>
#endif
-#ifndef RB_TYPE_P
-#define RB_TYPE_P(obj, type) (TYPE(obj) == type)
-#endif
-
#if defined HAVE_TERMIOS_H
# include <termios.h>
typedef struct termios conmode;
@@ -64,11 +50,7 @@ typedef struct sgttyb conmode;
#include <winioctl.h>
typedef DWORD conmode;
-#ifdef HAVE_RB_W32_MAP_ERRNO
#define LAST_ERROR rb_w32_map_errno(GetLastError())
-#else
-#define LAST_ERROR EBADF
-#endif
#define SET_LAST_ERROR (errno = LAST_ERROR, 0)
static int
@@ -91,11 +73,29 @@ getattr(int fd, conmode *t)
#define SET_LAST_ERROR (0)
#endif
-#ifndef InitVM
-#define InitVM(ext) {void InitVM_##ext(void);InitVM_##ext();}
+static ID id_getc, id_console, id_close, id_min, id_time;
+#if ENABLE_IO_GETPASS
+static ID id_gets;
#endif
-static ID id_getc, id_console;
+#ifndef HAVE_RB_F_SEND
+static ID id___send__;
+
+static VALUE
+rb_f_send(int argc, VALUE *argv, VALUE recv)
+{
+ VALUE sym = argv[0];
+ ID vid = rb_check_id(&sym);
+ if (vid) {
+ --argc;
+ ++argv;
+ }
+ else {
+ vid = id___send__;
+ }
+ return rb_funcallv(recv, vid, argc, argv);
+}
+#endif
typedef struct {
int vmin;
@@ -107,26 +107,10 @@ rawmode_opt(int argc, VALUE *argv, rawmode_arg_t *opts)
{
rawmode_arg_t *optp = NULL;
VALUE vopts;
-#ifdef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
rb_scan_args(argc, argv, "0:", &vopts);
-#else
- vopts = Qnil;
- if (argc > 0) {
- vopts = argv[--argc];
- if (!NIL_P(vopts)) {
-# ifdef HAVE_RB_CHECK_HASH_TYPE
- vopts = rb_check_hash_type(vopts);
- if (NIL_P(vopts)) ++argc;
-# else
- Check_Type(vopts, T_HASH);
-# endif
- }
- }
- rb_scan_args(argc, argv, "0");
-#endif
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 vmin = rb_hash_aref(vopts, ID2SYM(id_min));
+ VALUE vtime = rb_hash_aref(vopts, ID2SYM(id_time));
/* default values by `stty raw` */
opts->vmin = 1;
opts->vtime = 0;
@@ -232,15 +216,8 @@ set_ttymode(int fd, conmode *t, void (*setter)(conmode *, void *), void *arg)
return setattr(fd, &r);
}
-#ifdef GetReadFile
-#define GetReadFD(fptr) fileno(GetReadFile(fptr))
-#else
#define GetReadFD(fptr) ((fptr)->fd)
-#endif
-#ifdef GetWriteFile
-#define GetWriteFD(fptr) fileno(GetWriteFile(fptr))
-#else
static inline int
get_write_fd(const rb_io_t *fptr)
{
@@ -251,7 +228,6 @@ get_write_fd(const rb_io_t *fptr)
return ofptr->fd;
}
#define GetWriteFD(fptr) get_write_fd(fptr)
-#endif
#define FD_PER_IO 2
@@ -304,8 +280,7 @@ ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *, void *), void
}
if (status) {
if (status == -1) {
- errno = error;
- rb_sys_fail(0);
+ rb_syserr_fail(error, 0);
}
rb_jump_tag(status);
}
@@ -548,16 +523,22 @@ console_set_winsize(VALUE io, VALUE size)
int newrow, newcol;
#endif
VALUE row, col, xpixel, ypixel;
-#if defined TIOCSWINSZ
+ const VALUE *sz;
int fd;
-#endif
+ long sizelen;
GetOpenFile(io, fptr);
size = rb_Array(size);
- rb_scan_args((int)RARRAY_LEN(size), RARRAY_PTR(size), "22",
- &row, &col, &xpixel, &ypixel);
-#if defined TIOCSWINSZ
+ if ((sizelen = RARRAY_LEN(size)) != 2 && sizelen != 4) {
+ rb_raise(rb_eArgError,
+ "wrong number of arguments (given %ld, expected 2 or 4)",
+ sizelen);
+ }
+ sz = RARRAY_CONST_PTR(size);
+ row = sz[0], col = sz[1], xpixel = ypixel = Qnil;
+ if (sizelen == 4) xpixel = sz[2], ypixel = sz[3];
fd = GetWriteFD(fptr);
+#if defined TIOCSWINSZ
ws.ws_row = ws.ws_col = ws.ws_xpixel = ws.ws_ypixel = 0;
#define SET(m) ws.ws_##m = NIL_P(m) ? 0 : (unsigned short)NUM2UINT(m)
SET(row);
@@ -567,24 +548,28 @@ console_set_winsize(VALUE io, VALUE size)
#undef SET
if (!setwinsize(fd, &ws)) rb_sys_fail(0);
#elif defined _WIN32
- wh = (HANDLE)rb_w32_get_osfhandle(GetReadFD(fptr));
- newrow = (SHORT)NUM2UINT(row);
- newcol = (SHORT)NUM2UINT(col);
- if (!getwinsize(GetReadFD(fptr), &ws)) {
- rb_sys_fail("GetConsoleScreenBufferInfo");
+ wh = (HANDLE)rb_w32_get_osfhandle(fd);
+#define SET(m) new##m = NIL_P(m) ? 0 : (unsigned short)NUM2UINT(m)
+ SET(row);
+ SET(col);
+#undef SET
+ if (!NIL_P(xpixel)) (void)NUM2UINT(xpixel);
+ if (!NIL_P(ypixel)) (void)NUM2UINT(ypixel);
+ if (!GetConsoleScreenBufferInfo(wh, &ws)) {
+ rb_syserr_fail(LAST_ERROR, "GetConsoleScreenBufferInfo");
}
if ((ws.dwSize.X < newcol && (ws.dwSize.X = newcol, 1)) ||
(ws.dwSize.Y < newrow && (ws.dwSize.Y = newrow, 1))) {
- if (!(SetConsoleScreenBufferSize(wh, ws.dwSize) || SET_LAST_ERROR)) {
- rb_sys_fail("SetConsoleScreenBufferInfo");
+ if (!SetConsoleScreenBufferSize(wh, ws.dwSize)) {
+ rb_syserr_fail(LAST_ERROR, "SetConsoleScreenBufferInfo");
}
}
ws.srWindow.Left = 0;
ws.srWindow.Top = 0;
ws.srWindow.Right = newcol;
ws.srWindow.Bottom = newrow;
- if (!(SetConsoleWindowInfo(wh, FALSE, &ws.srWindow) || SET_LAST_ERROR)) {
- rb_sys_fail("SetConsoleWindowInfo");
+ if (!SetConsoleWindowInfo(wh, FALSE, &ws.srWindow)) {
+ rb_syserr_fail(LAST_ERROR, "SetConsoleWindowInfo");
}
#endif
return io;
@@ -668,30 +653,141 @@ console_ioflush(VALUE io)
return io;
}
+static VALUE
+console_beep(VALUE io)
+{
+ rb_io_t *fptr;
+ int fd;
+
+ GetOpenFile(io, fptr);
+ fd = GetWriteFD(fptr);
+#ifdef _WIN32
+ (void)fd;
+ MessageBeep(0);
+#else
+ if (write(fd, "\a", 1) < 0)
+ rb_sys_fail(0);
+#endif
+ return io;
+}
+
+#if defined _WIN32
+static VALUE
+console_goto(VALUE io, VALUE x, VALUE y)
+{
+ rb_io_t *fptr;
+ int fd;
+ COORD pos;
+
+ GetOpenFile(io, fptr);
+ fd = GetWriteFD(fptr);
+ pos.X = NUM2UINT(x);
+ pos.Y = NUM2UINT(y);
+ if (!SetConsoleCursorPosition((HANDLE)rb_w32_get_osfhandle(fd), pos)) {
+ rb_syserr_fail(LAST_ERROR, 0);
+ }
+ return io;
+}
+
+static VALUE
+console_cursor_pos(VALUE io)
+{
+ rb_io_t *fptr;
+ int fd;
+ rb_console_size_t ws;
+
+ GetOpenFile(io, fptr);
+ fd = GetWriteFD(fptr);
+ if (!GetConsoleScreenBufferInfo((HANDLE)rb_w32_get_osfhandle(fd), &ws)) {
+ rb_syserr_fail(LAST_ERROR, 0);
+ }
+ return rb_assoc_new(UINT2NUM(ws.dwCursorPosition.X), UINT2NUM(ws.dwCursorPosition.Y));
+}
+
+static VALUE
+console_cursor_set(VALUE io, VALUE cpos)
+{
+ cpos = rb_convert_type(cpos, T_ARRAY, "Array", "to_ary");
+ if (RARRAY_LEN(cpos) != 2) rb_raise(rb_eArgError, "expected 2D coordinate");
+ return console_goto(io, RARRAY_AREF(cpos, 0), RARRAY_AREF(cpos, 1));
+}
+
+#include "win32_vk.inc"
+
+static VALUE
+console_key_pressed_p(VALUE io, VALUE k)
+{
+ int vk = -1;
+
+ if (FIXNUM_P(k)) {
+ vk = NUM2UINT(k);
+ }
+ else {
+ const struct vktable *t;
+ if (SYMBOL_P(k)) {
+ k = rb_sym2str(k);
+ }
+ else {
+ StringValueCStr(k);
+ }
+ t = console_win32_vk(RSTRING_PTR(k), RSTRING_LEN(k));
+ if (!t || (vk = (short)t->vk) == -1) {
+ rb_raise(rb_eArgError, "unknown virtual key code: %"PRIsVALUE, k);
+ }
+ }
+ return GetKeyState(vk) & 0x80 ? Qtrue : Qfalse;
+}
+#else
+# define console_goto rb_f_notimplement
+# define console_cursor_pos rb_f_notimplement
+# define console_cursor_set rb_f_notimplement
+# define console_key_pressed_p rb_f_notimplement
+#endif
+
/*
* call-seq:
* IO.console -> #<File:/dev/tty>
+ * IO.console(sym, *args)
*
* Returns an File instance opened console.
*
+ * If +sym+ is given, it will be sent to the opened console with
+ * +args+ and the result will be returned instead of the console IO
+ * itself.
+ *
* You must require 'io/console' to use this method.
*/
static VALUE
-console_dev(VALUE klass)
+console_dev(int argc, VALUE *argv, VALUE klass)
{
VALUE con = 0;
rb_io_t *fptr;
+ VALUE sym = 0;
+ rb_check_arity(argc, 0, UNLIMITED_ARGUMENTS);
+ if (argc) {
+ Check_Type(sym = argv[0], T_SYMBOL);
+ }
if (klass == rb_cIO) klass = rb_cFile;
if (rb_const_defined(klass, id_console)) {
con = rb_const_get(klass, id_console);
- if (RB_TYPE_P(con, T_FILE)) {
- if ((fptr = RFILE(con)->fptr) && GetReadFD(fptr) != -1)
- return con;
+ if (!RB_TYPE_P(con, T_FILE) ||
+ (!(fptr = RFILE(con)->fptr) || GetReadFD(fptr) == -1)) {
+ rb_const_remove(klass, id_console);
+ con = 0;
}
- rb_mod_remove_const(klass, ID2SYM(id_console));
}
- {
+ if (sym) {
+ if (sym == ID2SYM(id_close) && argc == 1) {
+ if (con) {
+ rb_io_close(con);
+ rb_const_remove(klass, id_console);
+ con = 0;
+ }
+ return Qnil;
+ }
+ }
+ if (!con) {
VALUE args[2];
#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H || defined HAVE_SGTTY_H
# define CONSOLE_DEVICE "/dev/tty"
@@ -710,7 +806,7 @@ console_dev(VALUE klass)
int fd;
#ifdef CONSOLE_DEVICE_FOR_WRITING
- fd = rb_cloexec_open(CONSOLE_DEVICE_FOR_WRITING, O_WRONLY, 0);
+ fd = rb_cloexec_open(CONSOLE_DEVICE_FOR_WRITING, O_RDWR, 0);
if (fd < 0) return Qnil;
rb_update_max_fd(fd);
args[1] = INT2FIX(O_WRONLY);
@@ -729,25 +825,19 @@ console_dev(VALUE klass)
args[0] = INT2NUM(fd);
con = rb_class_new_instance(2, args, klass);
GetOpenFile(con, fptr);
-#ifdef HAVE_RUBY_IO_H
fptr->pathv = rb_obj_freeze(rb_str_new2(CONSOLE_DEVICE));
-#else
- fptr->path = ruby_strdup(CONSOLE_DEVICE);
-#endif
#ifdef CONSOLE_DEVICE_FOR_WRITING
GetOpenFile(out, ofptr);
-# ifdef HAVE_RB_IO_GET_WRITE_IO
ofptr->pathv = fptr->pathv;
fptr->tied_io_for_writing = out;
-# else
- fptr->f2 = ofptr->f;
- ofptr->f = 0;
-# endif
ofptr->mode |= FMODE_SYNC;
#endif
fptr->mode |= FMODE_SYNC;
rb_const_set(klass, id_console, con);
}
+ if (sym) {
+ return rb_f_send(argc, argv, con);
+ }
return con;
}
@@ -760,17 +850,101 @@ console_dev(VALUE klass)
static VALUE
io_getch(int argc, VALUE *argv, VALUE io)
{
- return rb_funcall2(io, rb_intern("getc"), argc, argv);
+ return rb_funcall2(io, id_getc, argc, argv);
+}
+
+#if ENABLE_IO_GETPASS
+static VALUE
+puts_call(VALUE io)
+{
+ return rb_io_write(io, rb_default_rs);
+}
+
+static VALUE
+getpass_call(VALUE io)
+{
+ return ttymode(io, rb_io_gets, set_noecho, NULL);
+}
+
+static void
+prompt(int argc, VALUE *argv, VALUE io)
+{
+ if (argc > 0 && !NIL_P(argv[0])) {
+ VALUE str = argv[0];
+ StringValueCStr(str);
+ rb_check_safe_obj(str);
+ rb_io_write(io, str);
+ }
+}
+
+static VALUE
+str_chomp(VALUE str)
+{
+ if (!NIL_P(str)) {
+ str = rb_funcallv(str, rb_intern("chomp!"), 0, 0);
+ }
+ return str;
}
/*
+ * call-seq:
+ * io.getpass(prompt=nil) -> string
+ *
+ * Reads and returns a line without echo back.
+ * Prints +prompt+ unless it is +nil+.
+ *
+ * You must require 'io/console' to use this method.
+ */
+static VALUE
+console_getpass(int argc, VALUE *argv, VALUE io)
+{
+ VALUE str, wio;
+
+ rb_check_arity(argc, 0, 1);
+ wio = rb_io_get_write_io(io);
+ if (wio == io && io == rb_stdin) wio = rb_stderr;
+ prompt(argc, argv, wio);
+ str = rb_ensure(getpass_call, io, puts_call, wio);
+ return str_chomp(str);
+}
+
+/*
+ * call-seq:
+ * io.getpass(prompt=nil) -> string
+ *
+ * See IO#getpass.
+ */
+static VALUE
+io_getpass(int argc, VALUE *argv, VALUE io)
+{
+ VALUE str;
+
+ rb_check_arity(argc, 0, 1);
+ prompt(argc, argv, io);
+ str = str_chomp(rb_funcallv(io, id_gets, 0, 0));
+ puts_call(io);
+ return str;
+}
+#endif
+
+/*
* IO console methods
*/
void
Init_console(void)
{
+#undef rb_intern
id_getc = rb_intern("getc");
+#if ENABLE_IO_GETPASS
+ id_gets = rb_intern("gets");
+#endif
id_console = rb_intern("console");
+ id_close = rb_intern("close");
+ id_min = rb_intern("min");
+ id_time = rb_intern("time");
+#ifndef HAVE_RB_F_SEND
+ id___send__ = rb_intern("__send__");
+#endif
InitVM(console);
}
@@ -790,9 +964,20 @@ InitVM_console(void)
rb_define_method(rb_cIO, "iflush", console_iflush, 0);
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);
+ rb_define_method(rb_cIO, "beep", console_beep, 0);
+ rb_define_method(rb_cIO, "goto", console_goto, 2);
+ rb_define_method(rb_cIO, "cursor", console_cursor_pos, 0);
+ rb_define_method(rb_cIO, "cursor=", console_cursor_set, 1);
+ rb_define_method(rb_cIO, "pressed?", console_key_pressed_p, 1);
+#if ENABLE_IO_GETPASS
+ rb_define_method(rb_cIO, "getpass", console_getpass, -1);
+#endif
+ rb_define_singleton_method(rb_cIO, "console", console_dev, -1);
{
VALUE mReadable = rb_define_module_under(rb_cIO, "generic_readable");
rb_define_method(mReadable, "getch", io_getch, -1);
+#if ENABLE_IO_GETPASS
+ rb_define_method(mReadable, "getpass", io_getpass, -1);
+#endif
}
}
diff --git a/ext/io/console/depend b/ext/io/console/depend
index e786dc71d2..40eacd21e1 100644
--- a/ext/io/console/depend
+++ b/ext/io/console/depend
@@ -1,4 +1,25 @@
$(OBJS): $(HDRS) $(ruby_headers) \
+ $(VK_HEADER) \
$(hdrdir)/ruby/io.h \
$(hdrdir)/ruby/encoding.h \
$(hdrdir)/ruby/oniguruma.h
+
+win32_vk.inc: win32_vk.list
+
+.list.inc:
+ ( \
+ $(RUBY) -anF, \
+ -e 'BEGIN {puts "#define UNDEFINED_VK (unsigned short)-1"}' \
+ -e 'n=$$F[1] and (n.strip!; /\AVK_/=~n) and' \
+ -e 'puts(%[#ifndef #{n}\n# define #{n} UNDEFINED_VK\n#endif])' \
+ $< && \
+ gperf --ignore-case -E -C -P -p -j1 -i 1 -g -o -t -K ofs -N console_win32_vk -k* $< \
+ | sed 's/(int)(long)&((\(struct stringpool_t\) *\*)0)->\(stringpool_[a-z0-9]*\)/offsetof(\1, \2)/g' \
+ ) > $(@F)
+
+.SUFFIXES: .chksum .list .inc
+
+.list.chksum:
+ @$(RUBY) -I$(top_srcdir)/tool -rchecksum \
+ -e "Checksum.update(ARGV) {|k|k.copy(k.target) rescue k.make(k.target)}" \
+ -- --make=$(MAKE) -I$(srcdir) $(<F) $(@F:.chksum=.inc)
diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb
index bbd1235986..381520a92c 100644
--- a/ext/io/console/extconf.rb
+++ b/ext/io/console/extconf.rb
@@ -1,10 +1,13 @@
+# frozen_string_literal: false
require 'mkmf'
ok = true
hdr = nil
case
when macro_defined?("_WIN32", "")
- have_func("rb_w32_map_errno", "ruby.h")
+ # rb_w32_map_errno: 1.8.7
+ vk_header = File.exist?("#$srcdir/win32_vk.list") ? "chksum" : "inc"
+ vk_header = "#{'{$(srcdir)}' if $nmake == ?m}win32_vk.#{vk_header}"
when hdr = %w"termios.h termio.h".find {|h| have_header(h)}
have_func("cfmakeraw", hdr)
when have_header(hdr = "sgtty.h")
@@ -12,15 +15,13 @@ when have_header(hdr = "sgtty.h")
else
ok = false
end
-ok &&= enable_config("io-console-force-compatible-with-1.8") ||
- macro_defined?("HAVE_RUBY_IO_H", cpp_include("ruby.h"))
if ok
- have_header("sys/ioctl.h")
- have_func("rb_check_hash_type", "ruby.h")
- have_func("rb_io_get_write_io", "ruby/io.h")
- have_func("rb_cloexec_open", "ruby/io.h")
- if enable_config("io-console-rb_scan_args-optional-hash", true)
- $defs << "-DHAVE_RB_SCAN_ARGS_OPTIONAL_HASH=1"
- end
- create_makefile("io/console")
+ have_header("sys/ioctl.h") if hdr
+ # rb_check_hash_type: 1.9.3
+ # rb_io_get_write_io: 1.9.1
+ # rb_cloexec_open: 2.0.0
+ $defs << "-D""ENABLE_IO_GETPASS=1"
+ create_makefile("io/console") {|conf|
+ conf << "\n""VK_HEADER = #{vk_header}\n"
+ }
end
diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec
index f71e1b9b8f..2c5ce6b578 100644
--- a/ext/io/console/io-console.gemspec
+++ b/ext/io/console/io-console.gemspec
@@ -1,5 +1,5 @@
# -*- ruby -*-
-_VERSION = "0.4.2"
+_VERSION = "0.4.5"
date = %w$Date:: $[1]
Gem::Specification.new do |s|
@@ -12,10 +12,10 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 2.0.0"
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]
+ s.require_path = %[lib]
+ s.files = %w[console.c depend extconf.rb lib/console/size.rb win32_vk.inc]
s.extensions = %w[extconf.rb]
- s.licenses = "ruby"
+ s.license = "BSD-2-Clause"
s.cert_chain = %w[certs/nobu.pem]
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
end
diff --git a/ext/io/console/lib/console/size.rb b/ext/io/console/lib/console/size.rb
index 519bc3be6d..f17206dfcf 100644
--- a/ext/io/console/lib/console/size.rb
+++ b/ext/io/console/lib/console/size.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# fallback to console window size
def IO.default_console_size
[
diff --git a/ext/io/console/win32_vk.chksum b/ext/io/console/win32_vk.chksum
new file mode 100644
index 0000000000..bc9fff7560
--- /dev/null
+++ b/ext/io/console/win32_vk.chksum
@@ -0,0 +1 @@
+src="win32_vk.list", len=3269, checksum=34076
diff --git a/ext/io/console/win32_vk.inc b/ext/io/console/win32_vk.inc
new file mode 100644
index 0000000000..a098158e27
--- /dev/null
+++ b/ext/io/console/win32_vk.inc
@@ -0,0 +1,1400 @@
+#define UNDEFINED_VK (unsigned short)-1
+#ifndef VK_LBUTTON
+# define VK_LBUTTON UNDEFINED_VK
+#endif
+#ifndef VK_RBUTTON
+# define VK_RBUTTON UNDEFINED_VK
+#endif
+#ifndef VK_CANCEL
+# define VK_CANCEL UNDEFINED_VK
+#endif
+#ifndef VK_MBUTTON
+# define VK_MBUTTON UNDEFINED_VK
+#endif
+#ifndef VK_XBUTTON1
+# define VK_XBUTTON1 UNDEFINED_VK
+#endif
+#ifndef VK_XBUTTON2
+# define VK_XBUTTON2 UNDEFINED_VK
+#endif
+#ifndef VK_BACK
+# define VK_BACK UNDEFINED_VK
+#endif
+#ifndef VK_TAB
+# define VK_TAB UNDEFINED_VK
+#endif
+#ifndef VK_CLEAR
+# define VK_CLEAR UNDEFINED_VK
+#endif
+#ifndef VK_RETURN
+# define VK_RETURN UNDEFINED_VK
+#endif
+#ifndef VK_SHIFT
+# define VK_SHIFT UNDEFINED_VK
+#endif
+#ifndef VK_CONTROL
+# define VK_CONTROL UNDEFINED_VK
+#endif
+#ifndef VK_MENU
+# define VK_MENU UNDEFINED_VK
+#endif
+#ifndef VK_PAUSE
+# define VK_PAUSE UNDEFINED_VK
+#endif
+#ifndef VK_CAPITAL
+# define VK_CAPITAL UNDEFINED_VK
+#endif
+#ifndef VK_KANA
+# define VK_KANA UNDEFINED_VK
+#endif
+#ifndef VK_HANGEUL
+# define VK_HANGEUL UNDEFINED_VK
+#endif
+#ifndef VK_HANGUL
+# define VK_HANGUL UNDEFINED_VK
+#endif
+#ifndef VK_JUNJA
+# define VK_JUNJA UNDEFINED_VK
+#endif
+#ifndef VK_FINAL
+# define VK_FINAL UNDEFINED_VK
+#endif
+#ifndef VK_HANJA
+# define VK_HANJA UNDEFINED_VK
+#endif
+#ifndef VK_KANJI
+# define VK_KANJI UNDEFINED_VK
+#endif
+#ifndef VK_ESCAPE
+# define VK_ESCAPE UNDEFINED_VK
+#endif
+#ifndef VK_CONVERT
+# define VK_CONVERT UNDEFINED_VK
+#endif
+#ifndef VK_NONCONVERT
+# define VK_NONCONVERT UNDEFINED_VK
+#endif
+#ifndef VK_ACCEPT
+# define VK_ACCEPT UNDEFINED_VK
+#endif
+#ifndef VK_MODECHANGE
+# define VK_MODECHANGE UNDEFINED_VK
+#endif
+#ifndef VK_SPACE
+# define VK_SPACE UNDEFINED_VK
+#endif
+#ifndef VK_PRIOR
+# define VK_PRIOR UNDEFINED_VK
+#endif
+#ifndef VK_NEXT
+# define VK_NEXT UNDEFINED_VK
+#endif
+#ifndef VK_END
+# define VK_END UNDEFINED_VK
+#endif
+#ifndef VK_HOME
+# define VK_HOME UNDEFINED_VK
+#endif
+#ifndef VK_LEFT
+# define VK_LEFT UNDEFINED_VK
+#endif
+#ifndef VK_UP
+# define VK_UP UNDEFINED_VK
+#endif
+#ifndef VK_RIGHT
+# define VK_RIGHT UNDEFINED_VK
+#endif
+#ifndef VK_DOWN
+# define VK_DOWN UNDEFINED_VK
+#endif
+#ifndef VK_SELECT
+# define VK_SELECT UNDEFINED_VK
+#endif
+#ifndef VK_PRINT
+# define VK_PRINT UNDEFINED_VK
+#endif
+#ifndef VK_EXECUTE
+# define VK_EXECUTE UNDEFINED_VK
+#endif
+#ifndef VK_SNAPSHOT
+# define VK_SNAPSHOT UNDEFINED_VK
+#endif
+#ifndef VK_INSERT
+# define VK_INSERT UNDEFINED_VK
+#endif
+#ifndef VK_DELETE
+# define VK_DELETE UNDEFINED_VK
+#endif
+#ifndef VK_HELP
+# define VK_HELP UNDEFINED_VK
+#endif
+#ifndef VK_LWIN
+# define VK_LWIN UNDEFINED_VK
+#endif
+#ifndef VK_RWIN
+# define VK_RWIN UNDEFINED_VK
+#endif
+#ifndef VK_APPS
+# define VK_APPS UNDEFINED_VK
+#endif
+#ifndef VK_SLEEP
+# define VK_SLEEP UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD0
+# define VK_NUMPAD0 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD1
+# define VK_NUMPAD1 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD2
+# define VK_NUMPAD2 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD3
+# define VK_NUMPAD3 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD4
+# define VK_NUMPAD4 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD5
+# define VK_NUMPAD5 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD6
+# define VK_NUMPAD6 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD7
+# define VK_NUMPAD7 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD8
+# define VK_NUMPAD8 UNDEFINED_VK
+#endif
+#ifndef VK_NUMPAD9
+# define VK_NUMPAD9 UNDEFINED_VK
+#endif
+#ifndef VK_MULTIPLY
+# define VK_MULTIPLY UNDEFINED_VK
+#endif
+#ifndef VK_ADD
+# define VK_ADD UNDEFINED_VK
+#endif
+#ifndef VK_SEPARATOR
+# define VK_SEPARATOR UNDEFINED_VK
+#endif
+#ifndef VK_SUBTRACT
+# define VK_SUBTRACT UNDEFINED_VK
+#endif
+#ifndef VK_DECIMAL
+# define VK_DECIMAL UNDEFINED_VK
+#endif
+#ifndef VK_DIVIDE
+# define VK_DIVIDE UNDEFINED_VK
+#endif
+#ifndef VK_F1
+# define VK_F1 UNDEFINED_VK
+#endif
+#ifndef VK_F2
+# define VK_F2 UNDEFINED_VK
+#endif
+#ifndef VK_F3
+# define VK_F3 UNDEFINED_VK
+#endif
+#ifndef VK_F4
+# define VK_F4 UNDEFINED_VK
+#endif
+#ifndef VK_F5
+# define VK_F5 UNDEFINED_VK
+#endif
+#ifndef VK_F6
+# define VK_F6 UNDEFINED_VK
+#endif
+#ifndef VK_F7
+# define VK_F7 UNDEFINED_VK
+#endif
+#ifndef VK_F8
+# define VK_F8 UNDEFINED_VK
+#endif
+#ifndef VK_F9
+# define VK_F9 UNDEFINED_VK
+#endif
+#ifndef VK_F10
+# define VK_F10 UNDEFINED_VK
+#endif
+#ifndef VK_F11
+# define VK_F11 UNDEFINED_VK
+#endif
+#ifndef VK_F12
+# define VK_F12 UNDEFINED_VK
+#endif
+#ifndef VK_F13
+# define VK_F13 UNDEFINED_VK
+#endif
+#ifndef VK_F14
+# define VK_F14 UNDEFINED_VK
+#endif
+#ifndef VK_F15
+# define VK_F15 UNDEFINED_VK
+#endif
+#ifndef VK_F16
+# define VK_F16 UNDEFINED_VK
+#endif
+#ifndef VK_F17
+# define VK_F17 UNDEFINED_VK
+#endif
+#ifndef VK_F18
+# define VK_F18 UNDEFINED_VK
+#endif
+#ifndef VK_F19
+# define VK_F19 UNDEFINED_VK
+#endif
+#ifndef VK_F20
+# define VK_F20 UNDEFINED_VK
+#endif
+#ifndef VK_F21
+# define VK_F21 UNDEFINED_VK
+#endif
+#ifndef VK_F22
+# define VK_F22 UNDEFINED_VK
+#endif
+#ifndef VK_F23
+# define VK_F23 UNDEFINED_VK
+#endif
+#ifndef VK_F24
+# define VK_F24 UNDEFINED_VK
+#endif
+#ifndef VK_NUMLOCK
+# define VK_NUMLOCK UNDEFINED_VK
+#endif
+#ifndef VK_SCROLL
+# define VK_SCROLL UNDEFINED_VK
+#endif
+#ifndef VK_OEM_NEC_EQUAL
+# define VK_OEM_NEC_EQUAL UNDEFINED_VK
+#endif
+#ifndef VK_OEM_FJ_JISHO
+# define VK_OEM_FJ_JISHO UNDEFINED_VK
+#endif
+#ifndef VK_OEM_FJ_MASSHOU
+# define VK_OEM_FJ_MASSHOU UNDEFINED_VK
+#endif
+#ifndef VK_OEM_FJ_TOUROKU
+# define VK_OEM_FJ_TOUROKU UNDEFINED_VK
+#endif
+#ifndef VK_OEM_FJ_LOYA
+# define VK_OEM_FJ_LOYA UNDEFINED_VK
+#endif
+#ifndef VK_OEM_FJ_ROYA
+# define VK_OEM_FJ_ROYA UNDEFINED_VK
+#endif
+#ifndef VK_LSHIFT
+# define VK_LSHIFT UNDEFINED_VK
+#endif
+#ifndef VK_RSHIFT
+# define VK_RSHIFT UNDEFINED_VK
+#endif
+#ifndef VK_LCONTROL
+# define VK_LCONTROL UNDEFINED_VK
+#endif
+#ifndef VK_RCONTROL
+# define VK_RCONTROL UNDEFINED_VK
+#endif
+#ifndef VK_LMENU
+# define VK_LMENU UNDEFINED_VK
+#endif
+#ifndef VK_RMENU
+# define VK_RMENU UNDEFINED_VK
+#endif
+#ifndef VK_BROWSER_BACK
+# define VK_BROWSER_BACK UNDEFINED_VK
+#endif
+#ifndef VK_BROWSER_FORWARD
+# define VK_BROWSER_FORWARD UNDEFINED_VK
+#endif
+#ifndef VK_BROWSER_REFRESH
+# define VK_BROWSER_REFRESH UNDEFINED_VK
+#endif
+#ifndef VK_BROWSER_STOP
+# define VK_BROWSER_STOP UNDEFINED_VK
+#endif
+#ifndef VK_BROWSER_SEARCH
+# define VK_BROWSER_SEARCH UNDEFINED_VK
+#endif
+#ifndef VK_BROWSER_FAVORITES
+# define VK_BROWSER_FAVORITES UNDEFINED_VK
+#endif
+#ifndef VK_BROWSER_HOME
+# define VK_BROWSER_HOME UNDEFINED_VK
+#endif
+#ifndef VK_VOLUME_MUTE
+# define VK_VOLUME_MUTE UNDEFINED_VK
+#endif
+#ifndef VK_VOLUME_DOWN
+# define VK_VOLUME_DOWN UNDEFINED_VK
+#endif
+#ifndef VK_VOLUME_UP
+# define VK_VOLUME_UP UNDEFINED_VK
+#endif
+#ifndef VK_MEDIA_NEXT_TRACK
+# define VK_MEDIA_NEXT_TRACK UNDEFINED_VK
+#endif
+#ifndef VK_MEDIA_PREV_TRACK
+# define VK_MEDIA_PREV_TRACK UNDEFINED_VK
+#endif
+#ifndef VK_MEDIA_STOP
+# define VK_MEDIA_STOP UNDEFINED_VK
+#endif
+#ifndef VK_MEDIA_PLAY_PAUSE
+# define VK_MEDIA_PLAY_PAUSE UNDEFINED_VK
+#endif
+#ifndef VK_LAUNCH_MAIL
+# define VK_LAUNCH_MAIL UNDEFINED_VK
+#endif
+#ifndef VK_LAUNCH_MEDIA_SELECT
+# define VK_LAUNCH_MEDIA_SELECT UNDEFINED_VK
+#endif
+#ifndef VK_LAUNCH_APP1
+# define VK_LAUNCH_APP1 UNDEFINED_VK
+#endif
+#ifndef VK_LAUNCH_APP2
+# define VK_LAUNCH_APP2 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_1
+# define VK_OEM_1 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_PLUS
+# define VK_OEM_PLUS UNDEFINED_VK
+#endif
+#ifndef VK_OEM_COMMA
+# define VK_OEM_COMMA UNDEFINED_VK
+#endif
+#ifndef VK_OEM_MINUS
+# define VK_OEM_MINUS UNDEFINED_VK
+#endif
+#ifndef VK_OEM_PERIOD
+# define VK_OEM_PERIOD UNDEFINED_VK
+#endif
+#ifndef VK_OEM_2
+# define VK_OEM_2 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_3
+# define VK_OEM_3 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_4
+# define VK_OEM_4 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_5
+# define VK_OEM_5 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_6
+# define VK_OEM_6 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_7
+# define VK_OEM_7 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_8
+# define VK_OEM_8 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_AX
+# define VK_OEM_AX UNDEFINED_VK
+#endif
+#ifndef VK_OEM_102
+# define VK_OEM_102 UNDEFINED_VK
+#endif
+#ifndef VK_ICO_HELP
+# define VK_ICO_HELP UNDEFINED_VK
+#endif
+#ifndef VK_ICO_00
+# define VK_ICO_00 UNDEFINED_VK
+#endif
+#ifndef VK_PROCESSKEY
+# define VK_PROCESSKEY UNDEFINED_VK
+#endif
+#ifndef VK_ICO_CLEAR
+# define VK_ICO_CLEAR UNDEFINED_VK
+#endif
+#ifndef VK_PACKET
+# define VK_PACKET UNDEFINED_VK
+#endif
+#ifndef VK_OEM_RESET
+# define VK_OEM_RESET UNDEFINED_VK
+#endif
+#ifndef VK_OEM_JUMP
+# define VK_OEM_JUMP UNDEFINED_VK
+#endif
+#ifndef VK_OEM_PA1
+# define VK_OEM_PA1 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_PA2
+# define VK_OEM_PA2 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_PA3
+# define VK_OEM_PA3 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_WSCTRL
+# define VK_OEM_WSCTRL UNDEFINED_VK
+#endif
+#ifndef VK_OEM_CUSEL
+# define VK_OEM_CUSEL UNDEFINED_VK
+#endif
+#ifndef VK_OEM_ATTN
+# define VK_OEM_ATTN UNDEFINED_VK
+#endif
+#ifndef VK_OEM_FINISH
+# define VK_OEM_FINISH UNDEFINED_VK
+#endif
+#ifndef VK_OEM_COPY
+# define VK_OEM_COPY UNDEFINED_VK
+#endif
+#ifndef VK_OEM_AUTO
+# define VK_OEM_AUTO UNDEFINED_VK
+#endif
+#ifndef VK_OEM_ENLW
+# define VK_OEM_ENLW UNDEFINED_VK
+#endif
+#ifndef VK_OEM_BACKTAB
+# define VK_OEM_BACKTAB UNDEFINED_VK
+#endif
+#ifndef VK_ATTN
+# define VK_ATTN UNDEFINED_VK
+#endif
+#ifndef VK_CRSEL
+# define VK_CRSEL UNDEFINED_VK
+#endif
+#ifndef VK_EXSEL
+# define VK_EXSEL UNDEFINED_VK
+#endif
+#ifndef VK_EREOF
+# define VK_EREOF UNDEFINED_VK
+#endif
+#ifndef VK_PLAY
+# define VK_PLAY UNDEFINED_VK
+#endif
+#ifndef VK_ZOOM
+# define VK_ZOOM UNDEFINED_VK
+#endif
+#ifndef VK_NONAME
+# define VK_NONAME UNDEFINED_VK
+#endif
+#ifndef VK_PA1
+# define VK_PA1 UNDEFINED_VK
+#endif
+#ifndef VK_OEM_CLEAR
+# define VK_OEM_CLEAR UNDEFINED_VK
+#endif
+/* C code produced by gperf version 3.0.4 */
+/* Command-line: gperf --ignore-case -E -C -P -p -j1 -i 1 -g -o -t -K ofs -N console_win32_vk -k'*' win32_vk.list */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "win32_vk.list"
+
+struct vktable {short ofs; unsigned short vk;};
+static const struct vktable *console_win32_vk(const char *, unsigned int);
+#line 5 "win32_vk.list"
+struct vktable;
+/* maximum key range = 245, duplicates = 0 */
+
+#ifndef GPERF_DOWNCASE
+#define GPERF_DOWNCASE 1
+static unsigned char gperf_downcase[256] =
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
+ 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
+ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
+ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
+ 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
+ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
+ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
+ 255
+ };
+#endif
+
+#ifndef GPERF_CASE_STRCMP
+#define GPERF_CASE_STRCMP 1
+static int
+gperf_case_strcmp (s1, s2)
+ register const char *s1;
+ register const char *s2;
+{
+ for (;;)
+ {
+ unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
+ unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
+ if (c1 != 0 && c1 == c2)
+ continue;
+ return (int)c1 - (int)c2;
+ }
+}
+#endif
+
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__)
+inline
+#elif defined(__GNUC__)
+__inline
+#endif
+static unsigned int
+hash (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const unsigned short asso_values[] =
+ {
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 51, 74,
+ 80, 116, 127, 124, 95, 140, 77, 53, 7, 3,
+ 257, 257, 257, 257, 257, 1, 11, 1, 55, 1,
+ 25, 84, 31, 33, 13, 16, 2, 28, 8, 1,
+ 6, 10, 1, 1, 3, 4, 45, 18, 73, 79,
+ 30, 257, 257, 257, 257, 5, 257, 1, 11, 1,
+ 55, 1, 25, 84, 31, 33, 13, 16, 2, 28,
+ 8, 1, 6, 10, 1, 1, 3, 4, 45, 18,
+ 73, 79, 30, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
+ 257, 257, 257, 257, 257, 257, 257, 257
+ };
+ register int hval = len;
+
+ switch (hval)
+ {
+ default:
+ hval += asso_values[(unsigned char)str[18]];
+ /*FALLTHROUGH*/
+ case 18:
+ hval += asso_values[(unsigned char)str[17]];
+ /*FALLTHROUGH*/
+ case 17:
+ hval += asso_values[(unsigned char)str[16]];
+ /*FALLTHROUGH*/
+ case 16:
+ hval += asso_values[(unsigned char)str[15]];
+ /*FALLTHROUGH*/
+ case 15:
+ hval += asso_values[(unsigned char)str[14]];
+ /*FALLTHROUGH*/
+ case 14:
+ hval += asso_values[(unsigned char)str[13]];
+ /*FALLTHROUGH*/
+ case 13:
+ hval += asso_values[(unsigned char)str[12]];
+ /*FALLTHROUGH*/
+ case 12:
+ hval += asso_values[(unsigned char)str[11]];
+ /*FALLTHROUGH*/
+ case 11:
+ hval += asso_values[(unsigned char)str[10]];
+ /*FALLTHROUGH*/
+ case 10:
+ hval += asso_values[(unsigned char)str[9]];
+ /*FALLTHROUGH*/
+ case 9:
+ hval += asso_values[(unsigned char)str[8]];
+ /*FALLTHROUGH*/
+ case 8:
+ hval += asso_values[(unsigned char)str[7]];
+ /*FALLTHROUGH*/
+ case 7:
+ hval += asso_values[(unsigned char)str[6]];
+ /*FALLTHROUGH*/
+ case 6:
+ hval += asso_values[(unsigned char)str[5]];
+ /*FALLTHROUGH*/
+ case 5:
+ hval += asso_values[(unsigned char)str[4]];
+ /*FALLTHROUGH*/
+ case 4:
+ hval += asso_values[(unsigned char)str[3]];
+ /*FALLTHROUGH*/
+ case 3:
+ hval += asso_values[(unsigned char)str[2]+2];
+ /*FALLTHROUGH*/
+ case 2:
+ hval += asso_values[(unsigned char)str[1]];
+ /*FALLTHROUGH*/
+ case 1:
+ hval += asso_values[(unsigned char)str[0]];
+ break;
+ }
+ return hval;
+}
+
+struct stringpool_t
+ {
+ char stringpool_str12[sizeof("UP")];
+ char stringpool_str13[sizeof("APPS")];
+ char stringpool_str14[sizeof("CRSEL")];
+ char stringpool_str15[sizeof("SPACE")];
+ char stringpool_str16[sizeof("SCROLL")];
+ char stringpool_str17[sizeof("ESCAPE")];
+ char stringpool_str18[sizeof("CANCEL")];
+ char stringpool_str19[sizeof("ACCEPT")];
+ char stringpool_str20[sizeof("SEPARATOR")];
+ char stringpool_str21[sizeof("SELECT")];
+ char stringpool_str22[sizeof("CONTROL")];
+ char stringpool_str23[sizeof("OEM_CLEAR")];
+ char stringpool_str24[sizeof("OEM_RESET")];
+ char stringpool_str25[sizeof("OEM_AUTO")];
+ char stringpool_str26[sizeof("OEM_CUSEL")];
+ char stringpool_str28[sizeof("KANA")];
+ char stringpool_str29[sizeof("OEM_PLUS")];
+ char stringpool_str30[sizeof("PRIOR")];
+ char stringpool_str31[sizeof("OEM_ATTN")];
+ char stringpool_str32[sizeof("PAUSE")];
+ char stringpool_str33[sizeof("BACK")];
+ char stringpool_str34[sizeof("PACKET")];
+ char stringpool_str35[sizeof("RCONTROL")];
+ char stringpool_str36[sizeof("LCONTROL")];
+ char stringpool_str37[sizeof("END")];
+ char stringpool_str38[sizeof("HOME")];
+ char stringpool_str39[sizeof("PRINT")];
+ char stringpool_str40[sizeof("NUMLOCK")];
+ char stringpool_str41[sizeof("LEFT")];
+ char stringpool_str42[sizeof("JUNJA")];
+ char stringpool_str43[sizeof("MENU")];
+ char stringpool_str44[sizeof("OEM_WSCTRL")];
+ char stringpool_str45[sizeof("OEM_ENLW")];
+ char stringpool_str46[sizeof("NEXT")];
+ char stringpool_str47[sizeof("RWIN")];
+ char stringpool_str48[sizeof("LWIN")];
+ char stringpool_str49[sizeof("CAPITAL")];
+ char stringpool_str50[sizeof("HELP")];
+ char stringpool_str51[sizeof("NONAME")];
+ char stringpool_str52[sizeof("RBUTTON")];
+ char stringpool_str53[sizeof("LBUTTON")];
+ char stringpool_str54[sizeof("OEM_NEC_EQUAL")];
+ char stringpool_str56[sizeof("INSERT")];
+ char stringpool_str57[sizeof("HANJA")];
+ char stringpool_str60[sizeof("SNAPSHOT")];
+ char stringpool_str61[sizeof("ATTN")];
+ char stringpool_str62[sizeof("TAB")];
+ char stringpool_str63[sizeof("OEM_BACKTAB")];
+ char stringpool_str64[sizeof("ICO_CLEAR")];
+ char stringpool_str65[sizeof("CONVERT")];
+ char stringpool_str66[sizeof("RETURN")];
+ char stringpool_str67[sizeof("OEM_JUMP")];
+ char stringpool_str71[sizeof("BROWSER_STOP")];
+ char stringpool_str72[sizeof("FINAL")];
+ char stringpool_str73[sizeof("ZOOM")];
+ char stringpool_str74[sizeof("KANJI")];
+ char stringpool_str75[sizeof("DELETE")];
+ char stringpool_str76[sizeof("OEM_COMMA")];
+ char stringpool_str77[sizeof("SUBTRACT")];
+ char stringpool_str79[sizeof("MBUTTON")];
+ char stringpool_str80[sizeof("F9")];
+ char stringpool_str81[sizeof("SHIFT")];
+ char stringpool_str82[sizeof("RSHIFT")];
+ char stringpool_str83[sizeof("LSHIFT")];
+ char stringpool_str84[sizeof("ADD")];
+ char stringpool_str85[sizeof("NONCONVERT")];
+ char stringpool_str86[sizeof("EXSEL")];
+ char stringpool_str87[sizeof("OEM_1")];
+ char stringpool_str88[sizeof("OEM_AX")];
+ char stringpool_str89[sizeof("BROWSER_BACK")];
+ char stringpool_str90[sizeof("OEM_8")];
+ char stringpool_str91[sizeof("OEM_MINUS")];
+ char stringpool_str92[sizeof("PLAY")];
+ char stringpool_str93[sizeof("OEM_2")];
+ char stringpool_str94[sizeof("CLEAR")];
+ char stringpool_str95[sizeof("OEM_FJ_TOUROKU")];
+ char stringpool_str96[sizeof("OEM_PA1")];
+ char stringpool_str97[sizeof("ICO_HELP")];
+ char stringpool_str98[sizeof("BROWSER_SEARCH")];
+ char stringpool_str99[sizeof("SLEEP")];
+ char stringpool_str101[sizeof("F1")];
+ char stringpool_str102[sizeof("OEM_PA2")];
+ char stringpool_str103[sizeof("OEM_COPY")];
+ char stringpool_str104[sizeof("F8")];
+ char stringpool_str105[sizeof("F19")];
+ char stringpool_str106[sizeof("RIGHT")];
+ char stringpool_str107[sizeof("F2")];
+ char stringpool_str108[sizeof("OEM_6")];
+ char stringpool_str109[sizeof("F18")];
+ char stringpool_str111[sizeof("VOLUME_UP")];
+ char stringpool_str114[sizeof("MEDIA_STOP")];
+ char stringpool_str115[sizeof("OEM_PERIOD")];
+ char stringpool_str117[sizeof("EREOF")];
+ char stringpool_str121[sizeof("BROWSER_HOME")];
+ char stringpool_str122[sizeof("F6")];
+ char stringpool_str124[sizeof("BROWSER_REFRESH")];
+ char stringpool_str126[sizeof("PA1")];
+ char stringpool_str127[sizeof("PROCESSKEY")];
+ char stringpool_str128[sizeof("DECIMAL")];
+ char stringpool_str129[sizeof("OEM_3")];
+ char stringpool_str130[sizeof("RMENU")];
+ char stringpool_str131[sizeof("LMENU")];
+ char stringpool_str132[sizeof("OEM_FJ_MASSHOU")];
+ char stringpool_str133[sizeof("NUMPAD0")];
+ char stringpool_str134[sizeof("HANGUL")];
+ char stringpool_str135[sizeof("NUMPAD9")];
+ char stringpool_str136[sizeof("HANGEUL")];
+ char stringpool_str137[sizeof("OEM_5")];
+ char stringpool_str138[sizeof("OEM_PA3")];
+ char stringpool_str139[sizeof("VOLUME_MUTE")];
+ char stringpool_str140[sizeof("OEM_4")];
+ char stringpool_str141[sizeof("LAUNCH_MAIL")];
+ char stringpool_str142[sizeof("OEM_FJ_JISHO")];
+ char stringpool_str143[sizeof("F3")];
+ char stringpool_str144[sizeof("OEM_FJ_ROYA")];
+ char stringpool_str145[sizeof("OEM_FJ_LOYA")];
+ char stringpool_str147[sizeof("DOWN")];
+ char stringpool_str149[sizeof("OEM_FINISH")];
+ char stringpool_str151[sizeof("F5")];
+ char stringpool_str153[sizeof("OEM_7")];
+ char stringpool_str154[sizeof("F4")];
+ char stringpool_str155[sizeof("F17")];
+ char stringpool_str156[sizeof("NUMPAD1")];
+ char stringpool_str157[sizeof("ICO_00")];
+ char stringpool_str159[sizeof("NUMPAD8")];
+ char stringpool_str162[sizeof("NUMPAD2")];
+ char stringpool_str164[sizeof("LAUNCH_APP1")];
+ char stringpool_str165[sizeof("BROWSER_FORWARD")];
+ char stringpool_str167[sizeof("F7")];
+ char stringpool_str170[sizeof("LAUNCH_APP2")];
+ char stringpool_str171[sizeof("MULTIPLY")];
+ char stringpool_str174[sizeof("EXECUTE")];
+ char stringpool_str176[sizeof("BROWSER_FAVORITES")];
+ char stringpool_str177[sizeof("NUMPAD6")];
+ char stringpool_str179[sizeof("F16")];
+ char stringpool_str182[sizeof("F10")];
+ char stringpool_str185[sizeof("VOLUME_DOWN")];
+ char stringpool_str188[sizeof("F20")];
+ char stringpool_str189[sizeof("MEDIA_PREV_TRACK")];
+ char stringpool_str191[sizeof("MODECHANGE")];
+ char stringpool_str197[sizeof("F14")];
+ char stringpool_str198[sizeof("NUMPAD3")];
+ char stringpool_str199[sizeof("XBUTTON1")];
+ char stringpool_str203[sizeof("F24")];
+ char stringpool_str205[sizeof("XBUTTON2")];
+ char stringpool_str206[sizeof("NUMPAD5")];
+ char stringpool_str209[sizeof("NUMPAD4")];
+ char stringpool_str215[sizeof("MEDIA_PLAY_PAUSE")];
+ char stringpool_str217[sizeof("LAUNCH_MEDIA_SELECT")];
+ char stringpool_str218[sizeof("F11")];
+ char stringpool_str220[sizeof("OEM_102")];
+ char stringpool_str221[sizeof("MEDIA_NEXT_TRACK")];
+ char stringpool_str222[sizeof("NUMPAD7")];
+ char stringpool_str224[sizeof("F21")];
+ char stringpool_str226[sizeof("F13")];
+ char stringpool_str229[sizeof("F12")];
+ char stringpool_str232[sizeof("F23")];
+ char stringpool_str235[sizeof("F22")];
+ char stringpool_str242[sizeof("F15")];
+ char stringpool_str256[sizeof("DIVIDE")];
+ };
+static const struct stringpool_t stringpool_contents =
+ {
+ "UP",
+ "APPS",
+ "CRSEL",
+ "SPACE",
+ "SCROLL",
+ "ESCAPE",
+ "CANCEL",
+ "ACCEPT",
+ "SEPARATOR",
+ "SELECT",
+ "CONTROL",
+ "OEM_CLEAR",
+ "OEM_RESET",
+ "OEM_AUTO",
+ "OEM_CUSEL",
+ "KANA",
+ "OEM_PLUS",
+ "PRIOR",
+ "OEM_ATTN",
+ "PAUSE",
+ "BACK",
+ "PACKET",
+ "RCONTROL",
+ "LCONTROL",
+ "END",
+ "HOME",
+ "PRINT",
+ "NUMLOCK",
+ "LEFT",
+ "JUNJA",
+ "MENU",
+ "OEM_WSCTRL",
+ "OEM_ENLW",
+ "NEXT",
+ "RWIN",
+ "LWIN",
+ "CAPITAL",
+ "HELP",
+ "NONAME",
+ "RBUTTON",
+ "LBUTTON",
+ "OEM_NEC_EQUAL",
+ "INSERT",
+ "HANJA",
+ "SNAPSHOT",
+ "ATTN",
+ "TAB",
+ "OEM_BACKTAB",
+ "ICO_CLEAR",
+ "CONVERT",
+ "RETURN",
+ "OEM_JUMP",
+ "BROWSER_STOP",
+ "FINAL",
+ "ZOOM",
+ "KANJI",
+ "DELETE",
+ "OEM_COMMA",
+ "SUBTRACT",
+ "MBUTTON",
+ "F9",
+ "SHIFT",
+ "RSHIFT",
+ "LSHIFT",
+ "ADD",
+ "NONCONVERT",
+ "EXSEL",
+ "OEM_1",
+ "OEM_AX",
+ "BROWSER_BACK",
+ "OEM_8",
+ "OEM_MINUS",
+ "PLAY",
+ "OEM_2",
+ "CLEAR",
+ "OEM_FJ_TOUROKU",
+ "OEM_PA1",
+ "ICO_HELP",
+ "BROWSER_SEARCH",
+ "SLEEP",
+ "F1",
+ "OEM_PA2",
+ "OEM_COPY",
+ "F8",
+ "F19",
+ "RIGHT",
+ "F2",
+ "OEM_6",
+ "F18",
+ "VOLUME_UP",
+ "MEDIA_STOP",
+ "OEM_PERIOD",
+ "EREOF",
+ "BROWSER_HOME",
+ "F6",
+ "BROWSER_REFRESH",
+ "PA1",
+ "PROCESSKEY",
+ "DECIMAL",
+ "OEM_3",
+ "RMENU",
+ "LMENU",
+ "OEM_FJ_MASSHOU",
+ "NUMPAD0",
+ "HANGUL",
+ "NUMPAD9",
+ "HANGEUL",
+ "OEM_5",
+ "OEM_PA3",
+ "VOLUME_MUTE",
+ "OEM_4",
+ "LAUNCH_MAIL",
+ "OEM_FJ_JISHO",
+ "F3",
+ "OEM_FJ_ROYA",
+ "OEM_FJ_LOYA",
+ "DOWN",
+ "OEM_FINISH",
+ "F5",
+ "OEM_7",
+ "F4",
+ "F17",
+ "NUMPAD1",
+ "ICO_00",
+ "NUMPAD8",
+ "NUMPAD2",
+ "LAUNCH_APP1",
+ "BROWSER_FORWARD",
+ "F7",
+ "LAUNCH_APP2",
+ "MULTIPLY",
+ "EXECUTE",
+ "BROWSER_FAVORITES",
+ "NUMPAD6",
+ "F16",
+ "F10",
+ "VOLUME_DOWN",
+ "F20",
+ "MEDIA_PREV_TRACK",
+ "MODECHANGE",
+ "F14",
+ "NUMPAD3",
+ "XBUTTON1",
+ "F24",
+ "XBUTTON2",
+ "NUMPAD5",
+ "NUMPAD4",
+ "MEDIA_PLAY_PAUSE",
+ "LAUNCH_MEDIA_SELECT",
+ "F11",
+ "OEM_102",
+ "MEDIA_NEXT_TRACK",
+ "NUMPAD7",
+ "F21",
+ "F13",
+ "F12",
+ "F23",
+ "F22",
+ "F15",
+ "DIVIDE"
+ };
+#define stringpool ((const char *) &stringpool_contents)
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct vktable *
+console_win32_vk (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 160,
+ MIN_WORD_LENGTH = 2,
+ MAX_WORD_LENGTH = 19,
+ MIN_HASH_VALUE = 12,
+ MAX_HASH_VALUE = 256
+ };
+
+ static const struct vktable wordlist[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+#line 40 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str12), VK_UP},
+#line 52 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str13), VK_APPS},
+#line 159 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str14), VK_CRSEL},
+#line 34 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str15), VK_SPACE},
+#line 95 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str16), VK_SCROLL},
+#line 29 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str17), VK_ESCAPE},
+#line 9 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str18), VK_CANCEL},
+#line 32 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str19), VK_ACCEPT},
+#line 66 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str20), VK_SEPARATOR},
+#line 43 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str21), VK_SELECT},
+#line 18 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str22), VK_CONTROL},
+#line 166 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str23), VK_OEM_CLEAR},
+#line 145 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str24), VK_OEM_RESET},
+#line 155 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str25), VK_OEM_AUTO},
+#line 151 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str26), VK_OEM_CUSEL},
+ {-1},
+#line 22 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str28), VK_KANA},
+#line 127 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str29), VK_OEM_PLUS},
+#line 35 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str30), VK_PRIOR},
+#line 152 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str31), VK_OEM_ATTN},
+#line 20 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str32), VK_PAUSE},
+#line 13 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str33), VK_BACK},
+#line 144 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str34), VK_PACKET},
+#line 105 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str35), VK_RCONTROL},
+#line 104 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str36), VK_LCONTROL},
+#line 37 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str37), VK_END},
+#line 38 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str38), VK_HOME},
+#line 44 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str39), VK_PRINT},
+#line 94 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str40), VK_NUMLOCK},
+#line 39 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str41), VK_LEFT},
+#line 25 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str42), VK_JUNJA},
+#line 19 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str43), VK_MENU},
+#line 150 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str44), VK_OEM_WSCTRL},
+#line 156 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str45), VK_OEM_ENLW},
+#line 36 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str46), VK_NEXT},
+#line 51 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str47), VK_RWIN},
+#line 50 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str48), VK_LWIN},
+#line 21 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str49), VK_CAPITAL},
+#line 49 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str50), VK_HELP},
+#line 164 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str51), VK_NONAME},
+#line 8 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str52), VK_RBUTTON},
+#line 7 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str53), VK_LBUTTON},
+#line 96 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str54), VK_OEM_NEC_EQUAL},
+ {-1},
+#line 47 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str56), VK_INSERT},
+#line 27 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str57), VK_HANJA},
+ {-1}, {-1},
+#line 46 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str60), VK_SNAPSHOT},
+#line 158 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str61), VK_ATTN},
+#line 14 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str62), VK_TAB},
+#line 157 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str63), VK_OEM_BACKTAB},
+#line 143 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str64), VK_ICO_CLEAR},
+#line 30 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str65), VK_CONVERT},
+#line 16 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str66), VK_RETURN},
+#line 146 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str67), VK_OEM_JUMP},
+ {-1}, {-1}, {-1},
+#line 111 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str71), VK_BROWSER_STOP},
+#line 26 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str72), VK_FINAL},
+#line 163 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str73), VK_ZOOM},
+#line 28 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str74), VK_KANJI},
+#line 48 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str75), VK_DELETE},
+#line 128 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str76), VK_OEM_COMMA},
+#line 67 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str77), VK_SUBTRACT},
+ {-1},
+#line 10 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str79), VK_MBUTTON},
+#line 78 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str80), VK_F9},
+#line 17 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str81), VK_SHIFT},
+#line 103 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str82), VK_RSHIFT},
+#line 102 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str83), VK_LSHIFT},
+#line 65 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str84), VK_ADD},
+#line 31 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str85), VK_NONCONVERT},
+#line 160 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str86), VK_EXSEL},
+#line 126 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str87), VK_OEM_1},
+#line 138 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str88), VK_OEM_AX},
+#line 108 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str89), VK_BROWSER_BACK},
+#line 137 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str90), VK_OEM_8},
+#line 129 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str91), VK_OEM_MINUS},
+#line 162 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str92), VK_PLAY},
+#line 131 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str93), VK_OEM_2},
+#line 15 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str94), VK_CLEAR},
+#line 99 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str95), VK_OEM_FJ_TOUROKU},
+#line 147 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str96), VK_OEM_PA1},
+#line 140 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str97), VK_ICO_HELP},
+#line 112 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str98), VK_BROWSER_SEARCH},
+#line 53 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str99), VK_SLEEP},
+ {-1},
+#line 70 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str101), VK_F1},
+#line 148 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str102), VK_OEM_PA2},
+#line 154 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str103), VK_OEM_COPY},
+#line 77 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str104), VK_F8},
+#line 88 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str105), VK_F19},
+#line 41 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str106), VK_RIGHT},
+#line 71 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str107), VK_F2},
+#line 135 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str108), VK_OEM_6},
+#line 87 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str109), VK_F18},
+ {-1},
+#line 117 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str111), VK_VOLUME_UP},
+ {-1}, {-1},
+#line 120 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str114), VK_MEDIA_STOP},
+#line 130 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str115), VK_OEM_PERIOD},
+ {-1},
+#line 161 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str117), VK_EREOF},
+ {-1}, {-1}, {-1},
+#line 114 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str121), VK_BROWSER_HOME},
+#line 75 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str122), VK_F6},
+ {-1},
+#line 110 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str124), VK_BROWSER_REFRESH},
+ {-1},
+#line 165 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str126), VK_PA1},
+#line 142 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str127), VK_PROCESSKEY},
+#line 68 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str128), VK_DECIMAL},
+#line 132 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str129), VK_OEM_3},
+#line 107 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str130), VK_RMENU},
+#line 106 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str131), VK_LMENU},
+#line 98 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str132), VK_OEM_FJ_MASSHOU},
+#line 54 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str133), VK_NUMPAD0},
+#line 24 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str134), VK_HANGUL},
+#line 63 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str135), VK_NUMPAD9},
+#line 23 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str136), VK_HANGEUL},
+#line 134 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str137), VK_OEM_5},
+#line 149 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str138), VK_OEM_PA3},
+#line 115 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str139), VK_VOLUME_MUTE},
+#line 133 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str140), VK_OEM_4},
+#line 122 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str141), VK_LAUNCH_MAIL},
+#line 97 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str142), VK_OEM_FJ_JISHO},
+#line 72 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str143), VK_F3},
+#line 101 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str144), VK_OEM_FJ_ROYA},
+#line 100 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str145), VK_OEM_FJ_LOYA},
+ {-1},
+#line 42 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str147), VK_DOWN},
+ {-1},
+#line 153 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str149), VK_OEM_FINISH},
+ {-1},
+#line 74 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str151), VK_F5},
+ {-1},
+#line 136 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str153), VK_OEM_7},
+#line 73 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str154), VK_F4},
+#line 86 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str155), VK_F17},
+#line 55 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str156), VK_NUMPAD1},
+#line 141 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str157), VK_ICO_00},
+ {-1},
+#line 62 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str159), VK_NUMPAD8},
+ {-1}, {-1},
+#line 56 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str162), VK_NUMPAD2},
+ {-1},
+#line 124 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str164), VK_LAUNCH_APP1},
+#line 109 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str165), VK_BROWSER_FORWARD},
+ {-1},
+#line 76 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str167), VK_F7},
+ {-1}, {-1},
+#line 125 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str170), VK_LAUNCH_APP2},
+#line 64 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str171), VK_MULTIPLY},
+ {-1}, {-1},
+#line 45 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str174), VK_EXECUTE},
+ {-1},
+#line 113 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str176), VK_BROWSER_FAVORITES},
+#line 60 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str177), VK_NUMPAD6},
+ {-1},
+#line 85 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str179), VK_F16},
+ {-1}, {-1},
+#line 79 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str182), VK_F10},
+ {-1}, {-1},
+#line 116 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str185), VK_VOLUME_DOWN},
+ {-1}, {-1},
+#line 89 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str188), VK_F20},
+#line 119 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str189), VK_MEDIA_PREV_TRACK},
+ {-1},
+#line 33 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str191), VK_MODECHANGE},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+#line 83 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str197), VK_F14},
+#line 57 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str198), VK_NUMPAD3},
+#line 11 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str199), VK_XBUTTON1},
+ {-1}, {-1}, {-1},
+#line 93 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str203), VK_F24},
+ {-1},
+#line 12 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str205), VK_XBUTTON2},
+#line 59 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str206), VK_NUMPAD5},
+ {-1}, {-1},
+#line 58 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str209), VK_NUMPAD4},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+#line 121 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str215), VK_MEDIA_PLAY_PAUSE},
+ {-1},
+#line 123 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str217), VK_LAUNCH_MEDIA_SELECT},
+#line 80 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str218), VK_F11},
+ {-1},
+#line 139 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str220), VK_OEM_102},
+#line 118 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str221), VK_MEDIA_NEXT_TRACK},
+#line 61 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str222), VK_NUMPAD7},
+ {-1},
+#line 90 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str224), VK_F21},
+ {-1},
+#line 82 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str226), VK_F13},
+ {-1}, {-1},
+#line 81 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str229), VK_F12},
+ {-1}, {-1},
+#line 92 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str232), VK_F23},
+ {-1}, {-1},
+#line 91 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str235), VK_F22},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 84 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str242), VK_F15},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+#line 69 "win32_vk.list"
+ {offsetof(struct stringpool_t, stringpool_str256), VK_DIVIDE}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = wordlist[key].ofs;
+ if (o >= 0)
+ {
+ register const char *s = o + stringpool;
+
+ if ((((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strcmp (str, s))
+ return &wordlist[key];
+ }
+ }
+ }
+ return 0;
+}
diff --git a/ext/io/console/win32_vk.list b/ext/io/console/win32_vk.list
new file mode 100644
index 0000000000..28bc9545ec
--- /dev/null
+++ b/ext/io/console/win32_vk.list
@@ -0,0 +1,166 @@
+%{
+struct vktable {short ofs; unsigned short vk;};
+static const struct vktable *console_win32_vk(const char *, unsigned int);
+%}
+struct vktable
+%%
+LBUTTON, VK_LBUTTON
+RBUTTON, VK_RBUTTON
+CANCEL, VK_CANCEL
+MBUTTON, VK_MBUTTON
+XBUTTON1, VK_XBUTTON1
+XBUTTON2, VK_XBUTTON2
+BACK, VK_BACK
+TAB, VK_TAB
+CLEAR, VK_CLEAR
+RETURN, VK_RETURN
+SHIFT, VK_SHIFT
+CONTROL, VK_CONTROL
+MENU, VK_MENU
+PAUSE, VK_PAUSE
+CAPITAL, VK_CAPITAL
+KANA, VK_KANA
+HANGEUL, VK_HANGEUL
+HANGUL, VK_HANGUL
+JUNJA, VK_JUNJA
+FINAL, VK_FINAL
+HANJA, VK_HANJA
+KANJI, VK_KANJI
+ESCAPE, VK_ESCAPE
+CONVERT, VK_CONVERT
+NONCONVERT, VK_NONCONVERT
+ACCEPT, VK_ACCEPT
+MODECHANGE, VK_MODECHANGE
+SPACE, VK_SPACE
+PRIOR, VK_PRIOR
+NEXT, VK_NEXT
+END, VK_END
+HOME, VK_HOME
+LEFT, VK_LEFT
+UP, VK_UP
+RIGHT, VK_RIGHT
+DOWN, VK_DOWN
+SELECT, VK_SELECT
+PRINT, VK_PRINT
+EXECUTE, VK_EXECUTE
+SNAPSHOT, VK_SNAPSHOT
+INSERT, VK_INSERT
+DELETE, VK_DELETE
+HELP, VK_HELP
+LWIN, VK_LWIN
+RWIN, VK_RWIN
+APPS, VK_APPS
+SLEEP, VK_SLEEP
+NUMPAD0, VK_NUMPAD0
+NUMPAD1, VK_NUMPAD1
+NUMPAD2, VK_NUMPAD2
+NUMPAD3, VK_NUMPAD3
+NUMPAD4, VK_NUMPAD4
+NUMPAD5, VK_NUMPAD5
+NUMPAD6, VK_NUMPAD6
+NUMPAD7, VK_NUMPAD7
+NUMPAD8, VK_NUMPAD8
+NUMPAD9, VK_NUMPAD9
+MULTIPLY, VK_MULTIPLY
+ADD, VK_ADD
+SEPARATOR, VK_SEPARATOR
+SUBTRACT, VK_SUBTRACT
+DECIMAL, VK_DECIMAL
+DIVIDE, VK_DIVIDE
+F1, VK_F1
+F2, VK_F2
+F3, VK_F3
+F4, VK_F4
+F5, VK_F5
+F6, VK_F6
+F7, VK_F7
+F8, VK_F8
+F9, VK_F9
+F10, VK_F10
+F11, VK_F11
+F12, VK_F12
+F13, VK_F13
+F14, VK_F14
+F15, VK_F15
+F16, VK_F16
+F17, VK_F17
+F18, VK_F18
+F19, VK_F19
+F20, VK_F20
+F21, VK_F21
+F22, VK_F22
+F23, VK_F23
+F24, VK_F24
+NUMLOCK, VK_NUMLOCK
+SCROLL, VK_SCROLL
+OEM_NEC_EQUAL, VK_OEM_NEC_EQUAL
+OEM_FJ_JISHO, VK_OEM_FJ_JISHO
+OEM_FJ_MASSHOU, VK_OEM_FJ_MASSHOU
+OEM_FJ_TOUROKU, VK_OEM_FJ_TOUROKU
+OEM_FJ_LOYA, VK_OEM_FJ_LOYA
+OEM_FJ_ROYA, VK_OEM_FJ_ROYA
+LSHIFT, VK_LSHIFT
+RSHIFT, VK_RSHIFT
+LCONTROL, VK_LCONTROL
+RCONTROL, VK_RCONTROL
+LMENU, VK_LMENU
+RMENU, VK_RMENU
+BROWSER_BACK, VK_BROWSER_BACK
+BROWSER_FORWARD, VK_BROWSER_FORWARD
+BROWSER_REFRESH, VK_BROWSER_REFRESH
+BROWSER_STOP, VK_BROWSER_STOP
+BROWSER_SEARCH, VK_BROWSER_SEARCH
+BROWSER_FAVORITES, VK_BROWSER_FAVORITES
+BROWSER_HOME, VK_BROWSER_HOME
+VOLUME_MUTE, VK_VOLUME_MUTE
+VOLUME_DOWN, VK_VOLUME_DOWN
+VOLUME_UP, VK_VOLUME_UP
+MEDIA_NEXT_TRACK, VK_MEDIA_NEXT_TRACK
+MEDIA_PREV_TRACK, VK_MEDIA_PREV_TRACK
+MEDIA_STOP, VK_MEDIA_STOP
+MEDIA_PLAY_PAUSE, VK_MEDIA_PLAY_PAUSE
+LAUNCH_MAIL, VK_LAUNCH_MAIL
+LAUNCH_MEDIA_SELECT, VK_LAUNCH_MEDIA_SELECT
+LAUNCH_APP1, VK_LAUNCH_APP1
+LAUNCH_APP2, VK_LAUNCH_APP2
+OEM_1, VK_OEM_1
+OEM_PLUS, VK_OEM_PLUS
+OEM_COMMA, VK_OEM_COMMA
+OEM_MINUS, VK_OEM_MINUS
+OEM_PERIOD, VK_OEM_PERIOD
+OEM_2, VK_OEM_2
+OEM_3, VK_OEM_3
+OEM_4, VK_OEM_4
+OEM_5, VK_OEM_5
+OEM_6, VK_OEM_6
+OEM_7, VK_OEM_7
+OEM_8, VK_OEM_8
+OEM_AX, VK_OEM_AX
+OEM_102, VK_OEM_102
+ICO_HELP, VK_ICO_HELP
+ICO_00, VK_ICO_00
+PROCESSKEY, VK_PROCESSKEY
+ICO_CLEAR, VK_ICO_CLEAR
+PACKET, VK_PACKET
+OEM_RESET, VK_OEM_RESET
+OEM_JUMP, VK_OEM_JUMP
+OEM_PA1, VK_OEM_PA1
+OEM_PA2, VK_OEM_PA2
+OEM_PA3, VK_OEM_PA3
+OEM_WSCTRL, VK_OEM_WSCTRL
+OEM_CUSEL, VK_OEM_CUSEL
+OEM_ATTN, VK_OEM_ATTN
+OEM_FINISH, VK_OEM_FINISH
+OEM_COPY, VK_OEM_COPY
+OEM_AUTO, VK_OEM_AUTO
+OEM_ENLW, VK_OEM_ENLW
+OEM_BACKTAB, VK_OEM_BACKTAB
+ATTN, VK_ATTN
+CRSEL, VK_CRSEL
+EXSEL, VK_EXSEL
+EREOF, VK_EREOF
+PLAY, VK_PLAY
+ZOOM, VK_ZOOM
+NONAME, VK_NONAME
+PA1, VK_PA1
+OEM_CLEAR, VK_OEM_CLEAR
diff --git a/ext/io/nonblock/extconf.rb b/ext/io/nonblock/extconf.rb
index aecdc16cea..d813a01e7c 100644
--- a/ext/io/nonblock/extconf.rb
+++ b/ext/io/nonblock/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
target = "io/nonblock"
diff --git a/ext/io/nonblock/nonblock.c b/ext/io/nonblock/nonblock.c
index ccd8728a31..2509329f6c 100644
--- a/ext/io/nonblock/nonblock.c
+++ b/ext/io/nonblock/nonblock.c
@@ -50,21 +50,22 @@ rb_io_nonblock_p(VALUE io)
#endif
#ifdef F_SETFL
-static void
+static int
io_nonblock_set(int fd, int f, int nb)
{
if (nb) {
if ((f & O_NONBLOCK) != 0)
- return;
+ return 0;
f |= O_NONBLOCK;
}
else {
if ((f & O_NONBLOCK) == 0)
- return;
+ return 0;
f &= ~O_NONBLOCK;
}
if (fcntl(fd, F_SETFL, f) == -1)
rb_sys_fail(0);
+ return 1;
}
/*
@@ -79,7 +80,10 @@ rb_io_nonblock_set(VALUE io, VALUE nb)
{
rb_io_t *fptr;
GetOpenFile(io, fptr);
- io_nonblock_set(fptr->fd, io_nonblock_mode(fptr->fd), RTEST(nb));
+ if (RTEST(nb))
+ rb_io_set_nonblock(fptr);
+ else
+ io_nonblock_set(fptr->fd, io_nonblock_mode(fptr->fd), RTEST(nb));
return io;
}
@@ -118,7 +122,8 @@ rb_io_nonblock_block(int argc, VALUE *argv, VALUE io)
f = io_nonblock_mode(fptr->fd);
restore[0] = fptr->fd;
restore[1] = f;
- io_nonblock_set(fptr->fd, f, nb);
+ if (!io_nonblock_set(fptr->fd, f, nb))
+ return rb_yield(io);
return rb_ensure(rb_yield, io, io_nonblock_restore, (VALUE)restore);
}
#else
diff --git a/ext/io/wait/extconf.rb b/ext/io/wait/extconf.rb
index eed3543124..b5d36c3fe3 100644
--- a/ext/io/wait/extconf.rb
+++ b/ext/io/wait/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
target = "io/wait"
diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c
index d8bb55fc47..99435460d4 100644
--- a/ext/io/wait/wait.c
+++ b/ext/io/wait/wait.c
@@ -44,6 +44,30 @@ 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));
+static struct timeval *
+get_timeout(int argc, VALUE *argv, struct timeval *timerec)
+{
+ VALUE timeout = Qnil;
+ rb_check_arity(argc, 0, 1);
+ if (!argc || NIL_P(timeout = argv[0])) {
+ return NULL;
+ }
+ else {
+ *timerec = rb_time_interval(timeout);
+ return timerec;
+ }
+}
+
+static int
+wait_for_single_fd(rb_io_t *fptr, int events, struct timeval *tv)
+{
+ int i = rb_wait_for_single_fd(fptr->fd, events, tv);
+ if (i < 0)
+ rb_sys_fail(0);
+ rb_io_check_closed(fptr);
+ return (i & events);
+}
+
/*
* call-seq:
* io.nread -> int
@@ -62,7 +86,7 @@ io_nread(VALUE io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
len = rb_io_read_pending(fptr);
- if (len > 0) return len;
+ if (len > 0) return INT2FIX(len);
if (!FIONREAD_POSSIBLE_P(fptr->fd)) return INT2FIX(0);
if (ioctl(fptr->fd, FIONREAD, &n)) return INT2FIX(0);
if (n > 0) return ioctl_arg2num(n);
@@ -81,57 +105,42 @@ static VALUE
io_ready_p(VALUE io)
{
rb_io_t *fptr;
- ioctl_arg n;
+ struct timeval tv = {0, 0};
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
if (rb_io_read_pending(fptr)) return Qtrue;
- if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qnil;
- if (ioctl(fptr->fd, FIONREAD, &n)) return Qnil;
- if (n > 0) return Qtrue;
+ if (wait_for_single_fd(fptr, RB_WAITFD_IN, &tv))
+ return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * io.wait -> IO, true, false or nil
- * io.wait(timeout) -> IO, true, false or nil
- * io.wait_readable -> IO, true, false or nil
- * io.wait_readable(timeout) -> IO, true, false or nil
+ * io.wait -> IO, true or nil
+ * io.wait(timeout) -> IO, true or nil
+ * io.wait_readable -> IO, true or nil
+ * io.wait_readable(timeout) -> IO, true or nil
*
- * Waits until input is available or times out and returns self or nil when
- * EOF is reached.
+ * Waits until IO is readable without blocking and returns +self+, or
+ * +nil+ when times out.
+ * Returns +true+ immediately when buffered data is available.
*/
static VALUE
io_wait_readable(int argc, VALUE *argv, VALUE io)
{
rb_io_t *fptr;
- int i;
- ioctl_arg n;
- VALUE timeout;
struct timeval timerec;
struct timeval *tv;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
- rb_scan_args(argc, argv, "01", &timeout);
- if (NIL_P(timeout)) {
- tv = NULL;
- }
- else {
- timerec = rb_time_interval(timeout);
- tv = &timerec;
- }
-
+ tv = get_timeout(argc, argv, &timerec);
if (rb_io_read_pending(fptr)) return Qtrue;
- if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qfalse;
- i = rb_wait_for_single_fd(fptr->fd, RB_WAITFD_IN, tv);
- if (i < 0)
- rb_sys_fail(0);
- rb_io_check_closed(fptr);
- if (ioctl(fptr->fd, FIONREAD, &n)) rb_sys_fail(0);
- if (n > 0) return io;
+ if (wait_for_single_fd(fptr, RB_WAITFD_IN, tv)) {
+ return io;
+ }
return Qnil;
}
@@ -140,35 +149,22 @@ io_wait_readable(int argc, VALUE *argv, VALUE io)
* 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.
+ * Waits until IO is writable without blocking and returns +self+ or
+ * +nil+ when times out.
*/
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)
+ tv = get_timeout(argc, argv, &timerec);
+ if (wait_for_single_fd(fptr, RB_WAITFD_OUT, tv)) {
return io;
+ }
return Qnil;
}
@@ -177,7 +173,7 @@ io_wait_writable(int argc, VALUE *argv, VALUE io)
*/
void
-Init_wait()
+Init_wait(void)
{
rb_define_method(rb_cIO, "nread", io_nread, 0);
rb_define_method(rb_cIO, "ready?", io_ready_p, 0);
diff --git a/ext/json/extconf.rb b/ext/json/extconf.rb
index 850798c643..ad1ef9ba82 100644
--- a/ext/json/extconf.rb
+++ b/ext/json/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile('json')
diff --git a/ext/json/fbuffer/fbuffer.h b/ext/json/fbuffer/fbuffer.h
index af74187566..5a0a27cda5 100644
--- a/ext/json/fbuffer/fbuffer.h
+++ b/ext/json/fbuffer/fbuffer.h
@@ -25,6 +25,15 @@
#define RSTRING_LEN(string) RSTRING(string)->len
#endif
+#ifdef PRIsVALUE
+# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
+# define RB_OBJ_STRING(obj) (obj)
+#else
+# define PRIsVALUE "s"
+# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
+# define RB_OBJ_STRING(obj) StringValueCStr(obj)
+#endif
+
#ifdef HAVE_RUBY_ENCODING_H
#include "ruby/encoding.h"
#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
@@ -172,7 +181,7 @@ static FBuffer *fbuffer_dup(FBuffer *fb)
static VALUE fbuffer_to_s(FBuffer *fb)
{
- VALUE result = rb_str_new(FBUFFER_PAIR(fb));
+ VALUE result = rb_str_new(FBUFFER_PTR(fb), FBUFFER_LEN(fb));
fbuffer_free(fb);
FORCE_UTF8(result);
return result;
diff --git a/ext/json/generator/depend b/ext/json/generator/depend
index 1a042a2501..b7373cde1f 100644
--- a/ext/json/generator/depend
+++ b/ext/json/generator/depend
@@ -1 +1,21 @@
+$(OBJS): $(ruby_headers)
generator.o: generator.c generator.h $(srcdir)/../fbuffer/fbuffer.h
+
+# AUTOGENERATED DEPENDENCIES START
+generator.o: $(RUBY_EXTCONF_H)
+generator.o: $(arch_hdrdir)/ruby/config.h
+generator.o: $(hdrdir)/ruby/defines.h
+generator.o: $(hdrdir)/ruby/encoding.h
+generator.o: $(hdrdir)/ruby/intern.h
+generator.o: $(hdrdir)/ruby/missing.h
+generator.o: $(hdrdir)/ruby/oniguruma.h
+generator.o: $(hdrdir)/ruby/re.h
+generator.o: $(hdrdir)/ruby/regex.h
+generator.o: $(hdrdir)/ruby/ruby.h
+generator.o: $(hdrdir)/ruby/st.h
+generator.o: $(hdrdir)/ruby/subst.h
+generator.o: $(top_srcdir)/ext/json/fbuffer/fbuffer.h
+generator.o: $(top_srcdir)/include/ruby.h
+generator.o: generator.c
+generator.o: generator.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/json/generator/extconf.rb b/ext/json/generator/extconf.rb
index 8627c5f4bd..fd5c4a7f49 100644
--- a/ext/json/generator/extconf.rb
+++ b/ext/json/generator/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
$defs << "-DJSON_GENERATOR"
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index ed7bb82887..2cdca5685f 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -301,7 +301,7 @@ static char *fstrndup(const char *ptr, unsigned long len) {
char *result;
if (len <= 0) return NULL;
result = ALLOC_N(char, len);
- memccpy(result, ptr, 0, len);
+ memcpy(result, ptr, len);
return result;
}
@@ -486,8 +486,9 @@ static VALUE mObject_to_json(int argc, VALUE *argv, VALUE self)
return cState_partial_generate(state, string);
}
-static void State_free(JSON_Generator_State *state)
+static void State_free(void *ptr)
{
+ JSON_Generator_State *state = ptr;
if (state->indent) ruby_xfree(state->indent);
if (state->space) ruby_xfree(state->space);
if (state->space_before) ruby_xfree(state->space_before);
@@ -499,17 +500,37 @@ static void State_free(JSON_Generator_State *state)
ruby_xfree(state);
}
-static JSON_Generator_State *State_allocate()
-{
- JSON_Generator_State *state = ALLOC(JSON_Generator_State);
- MEMZERO(state, JSON_Generator_State, 1);
- return state;
-}
+static size_t State_memsize(const void *ptr)
+{
+ const JSON_Generator_State *state = ptr;
+ size_t size = sizeof(*state);
+ if (state->indent) size += state->indent_len + 1;
+ if (state->space) size += state->space_len + 1;
+ if (state->space_before) size += state->space_before_len + 1;
+ if (state->object_nl) size += state->object_nl_len + 1;
+ if (state->array_nl) size += state->array_nl_len + 1;
+ if (state->array_delim) size += FBUFFER_CAPA(state->array_delim);
+ if (state->object_delim) size += FBUFFER_CAPA(state->object_delim);
+ if (state->object_delim2) size += FBUFFER_CAPA(state->object_delim2);
+ return size;
+}
+
+#ifdef NEW_TYPEDDATA_WRAPPER
+static const rb_data_type_t JSON_Generator_State_type = {
+ "JSON/Generator/State",
+ {NULL, State_free, State_memsize,},
+#ifdef RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+#endif
+};
+#endif
static VALUE cState_s_allocate(VALUE klass)
{
- JSON_Generator_State *state = State_allocate();
- return Data_Wrap_Struct(klass, NULL, State_free, state);
+ JSON_Generator_State *state;
+ return TypedData_Make_Struct(klass, JSON_Generator_State,
+ &JSON_Generator_State_type, state);
}
/*
@@ -646,7 +667,7 @@ static VALUE cState_to_h(VALUE self)
/*
* call-seq: [](name)
*
-* Return the value returned by method +name+.
+* Returns the value returned by method +name+.
*/
static VALUE cState_aref(VALUE self, VALUE name)
{
@@ -661,7 +682,7 @@ static VALUE cState_aref(VALUE self, VALUE name)
/*
* call-seq: []=(name, value)
*
-* Set the attribute name to value.
+* Sets the attribute name to value.
*/
static VALUE cState_aset(VALUE self, VALUE name, VALUE value)
{
@@ -812,10 +833,10 @@ static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_St
if (!allow_nan) {
if (isinf(value)) {
fbuffer_free(buffer);
- rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp));
+ rb_raise(eGeneratorError, "%u: %"PRIsVALUE" not allowed in JSON", __LINE__, RB_OBJ_STRING(tmp));
} else if (isnan(value)) {
fbuffer_free(buffer);
- rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp));
+ rb_raise(eGeneratorError, "%u: %"PRIsVALUE" not allowed in JSON", __LINE__, RB_OBJ_STRING(tmp));
}
}
fbuffer_append_str(buffer, tmp);
@@ -850,7 +871,7 @@ static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *s
} else {
tmp = rb_funcall(obj, i_to_s, 0);
Check_Type(tmp, T_STRING);
- generate_json(buffer, Vstate, state, tmp);
+ generate_json_string(buffer, Vstate, state, tmp);
}
}
@@ -871,6 +892,7 @@ static FBuffer *cState_prepare_buffer(VALUE self)
} else {
state->object_delim2 = fbuffer_alloc(16);
}
+ if (state->space_before) fbuffer_append(state->object_delim2, state->space_before, state->space_before_len);
fbuffer_append_char(state->object_delim2, ':');
if (state->space) fbuffer_append(state->object_delim2, state->space, state->space_len);
@@ -958,15 +980,16 @@ static VALUE cState_initialize(int argc, VALUE *argv, VALUE self)
/*
* call-seq: initialize_copy(orig)
*
- * Initializes this object from orig if it to be duplicated/cloned and returns
+ * Initializes this object from orig if it can be duplicated/cloned and returns
* it.
*/
static VALUE cState_init_copy(VALUE obj, VALUE orig)
{
JSON_Generator_State *objState, *origState;
- Data_Get_Struct(obj, JSON_Generator_State, objState);
- Data_Get_Struct(orig, JSON_Generator_State, origState);
+ if (obj == orig) return obj;
+ GET_STATE_TO(obj, objState);
+ GET_STATE_TO(orig, origState);
if (!objState) rb_raise(rb_eArgError, "unallocated JSON::State");
MEMCPY(objState, origState, JSON_Generator_State, 1);
@@ -1005,7 +1028,7 @@ static VALUE cState_from_state_s(VALUE self, VALUE opts)
/*
* call-seq: indent()
*
- * This string is used to indent levels in the JSON text.
+ * Returns the string that is used to indent levels in the JSON text.
*/
static VALUE cState_indent(VALUE self)
{
@@ -1016,7 +1039,7 @@ static VALUE cState_indent(VALUE self)
/*
* call-seq: indent=(indent)
*
- * This string is used to indent levels in the JSON text.
+ * Sets the string that is used to indent levels in the JSON text.
*/
static VALUE cState_indent_set(VALUE self, VALUE indent)
{
@@ -1032,7 +1055,7 @@ static VALUE cState_indent_set(VALUE self, VALUE indent)
}
} else {
if (state->indent) ruby_xfree(state->indent);
- state->indent = strdup(RSTRING_PTR(indent));
+ state->indent = fstrndup(RSTRING_PTR(indent), len);
state->indent_len = len;
}
return Qnil;
@@ -1041,7 +1064,7 @@ static VALUE cState_indent_set(VALUE self, VALUE indent)
/*
* call-seq: space()
*
- * This string is used to insert a space between the tokens in a JSON
+ * Returns the string that is used to insert a space between the tokens in a JSON
* string.
*/
static VALUE cState_space(VALUE self)
@@ -1053,7 +1076,7 @@ static VALUE cState_space(VALUE self)
/*
* call-seq: space=(space)
*
- * This string is used to insert a space between the tokens in a JSON
+ * Sets _space_ to the string that is used to insert a space between the tokens in a JSON
* string.
*/
static VALUE cState_space_set(VALUE self, VALUE space)
@@ -1070,7 +1093,7 @@ static VALUE cState_space_set(VALUE self, VALUE space)
}
} else {
if (state->space) ruby_xfree(state->space);
- state->space = strdup(RSTRING_PTR(space));
+ state->space = fstrndup(RSTRING_PTR(space), len);
state->space_len = len;
}
return Qnil;
@@ -1079,7 +1102,7 @@ static VALUE cState_space_set(VALUE self, VALUE space)
/*
* call-seq: space_before()
*
- * This string is used to insert a space before the ':' in JSON objects.
+ * Returns the string that is used to insert a space before the ':' in JSON objects.
*/
static VALUE cState_space_before(VALUE self)
{
@@ -1090,7 +1113,7 @@ static VALUE cState_space_before(VALUE self)
/*
* call-seq: space_before=(space_before)
*
- * This string is used to insert a space before the ':' in JSON objects.
+ * Sets the string that is used to insert a space before the ':' in JSON objects.
*/
static VALUE cState_space_before_set(VALUE self, VALUE space_before)
{
@@ -1106,7 +1129,7 @@ static VALUE cState_space_before_set(VALUE self, VALUE space_before)
}
} else {
if (state->space_before) ruby_xfree(state->space_before);
- state->space_before = strdup(RSTRING_PTR(space_before));
+ state->space_before = fstrndup(RSTRING_PTR(space_before), len);
state->space_before_len = len;
}
return Qnil;
@@ -1143,7 +1166,7 @@ static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
}
} else {
if (state->object_nl) ruby_xfree(state->object_nl);
- state->object_nl = strdup(RSTRING_PTR(object_nl));
+ state->object_nl = fstrndup(RSTRING_PTR(object_nl), len);
state->object_nl_len = len;
}
return Qnil;
@@ -1178,7 +1201,7 @@ static VALUE cState_array_nl_set(VALUE self, VALUE array_nl)
}
} else {
if (state->array_nl) ruby_xfree(state->array_nl);
- state->array_nl = strdup(RSTRING_PTR(array_nl));
+ state->array_nl = fstrndup(RSTRING_PTR(array_nl), len);
state->array_nl_len = len;
}
return Qnil;
@@ -1297,7 +1320,7 @@ static VALUE cState_depth_set(VALUE self, VALUE depth)
/*
* call-seq: buffer_initial_length
*
- * This integer returns the current inital length of the buffer.
+ * This integer returns the current initial length of the buffer.
*/
static VALUE cState_buffer_initial_length(VALUE self)
{
@@ -1326,7 +1349,7 @@ static VALUE cState_buffer_initial_length_set(VALUE self, VALUE buffer_initial_l
/*
*
*/
-void Init_generator()
+void Init_generator(void)
{
rb_require("json/common");
diff --git a/ext/json/generator/generator.h b/ext/json/generator/generator.h
index b58cc4bc2f..6bbf817b7d 100644
--- a/ext/json/generator/generator.h
+++ b/ext/json/generator/generator.h
@@ -1,7 +1,6 @@
#ifndef _GENERATOR_H_
#define _GENERATOR_H_
-#include <string.h>
#include <math.h>
#include <ctype.h>
@@ -23,7 +22,7 @@
#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
-/* unicode defintions */
+/* unicode definitions */
#define UNI_STRICT_CONVERSION 1
@@ -78,9 +77,12 @@ typedef struct JSON_Generator_StateStruct {
long buffer_initial_length;
} JSON_Generator_State;
+#define GET_STATE_TO(self, state) \
+ TypedData_Get_Struct(self, JSON_Generator_State, &JSON_Generator_State_type, state)
+
#define GET_STATE(self) \
JSON_Generator_State *state; \
- Data_Get_Struct(self, JSON_Generator_State, state)
+ GET_STATE_TO(self, state)
#define GENERATE_JSON(type) \
FBuffer *buffer; \
@@ -89,7 +91,7 @@ typedef struct JSON_Generator_StateStruct {
\
rb_scan_args(argc, argv, "01", &Vstate); \
Vstate = cState_from_state_s(cState, Vstate); \
- Data_Get_Struct(Vstate, JSON_Generator_State, state); \
+ TypedData_Get_Struct(Vstate, JSON_Generator_State, &JSON_Generator_State_type, state); \
buffer = cState_prepare_buffer(Vstate); \
generate_json_##type(buffer, Vstate, state, self); \
return fbuffer_to_s(buffer)
@@ -108,8 +110,7 @@ static VALUE mTrueClass_to_json(int argc, VALUE *argv, VALUE self);
static VALUE mFalseClass_to_json(int argc, VALUE *argv, VALUE self);
static VALUE mNilClass_to_json(int argc, VALUE *argv, VALUE self);
static VALUE mObject_to_json(int argc, VALUE *argv, VALUE self);
-static void State_free(JSON_Generator_State *state);
-static JSON_Generator_State *State_allocate();
+static void State_free(void *state);
static VALUE cState_s_allocate(VALUE klass);
static VALUE cState_configure(VALUE self, VALUE opts);
static VALUE cState_to_h(VALUE self);
@@ -144,5 +145,21 @@ static VALUE cState_ascii_only_p(VALUE self);
static VALUE cState_depth(VALUE self);
static VALUE cState_depth_set(VALUE self, VALUE depth);
static FBuffer *cState_prepare_buffer(VALUE self);
+#ifndef ZALLOC
+#define ZALLOC(type) ((type *)ruby_zalloc(sizeof(type)))
+static inline void *ruby_zalloc(size_t n)
+{
+ void *p = ruby_xmalloc(n);
+ memset(p, 0, n);
+ return p;
+}
+#endif
+#ifdef TypedData_Make_Struct
+static const rb_data_type_t JSON_Generator_State_type;
+#define NEW_TYPEDDATA_WRAPPER 1
+#else
+#define TypedData_Make_Struct(klass, type, ignore, json) Data_Make_Struct(klass, type, NULL, State_free, json)
+#define TypedData_Get_Struct(self, JSON_Generator_State, ignore, json) Data_Get_Struct(self, JSON_Generator_State, json)
+#endif
#endif
diff --git a/ext/json/json.gemspec b/ext/json/json.gemspec
new file mode 100644
index 0000000000..e3c897a977
--- /dev/null
+++ b/ext/json/json.gemspec
@@ -0,0 +1,7 @@
+Gem::Specification.new do |s|
+ s.name = "json"
+ s.version = "1.8.3.1"
+ s.summary = "This json is bundled with Ruby"
+ s.executables = []
+ s.files = ["json.rb", "json/add/bigdecimal.rb", "json/add/complex.rb", "json/add/core.rb", "json/add/date.rb", "json/add/date_time.rb", "json/add/exception.rb", "json/add/ostruct.rb", "json/add/range.rb", "json/add/rational.rb", "json/add/regexp.rb", "json/add/struct.rb", "json/add/symbol.rb", "json/add/time.rb", "json/common.rb", "json/ext.rb", "json/ext/generator.bundle", "json/ext/parser.bundle", "json/generic_object.rb", "json/version.rb"]
+end
diff --git a/ext/json/lib/json.rb b/ext/json/lib/json.rb
index 24aa385c91..61bb8fae0e 100644
--- a/ext/json/lib/json.rb
+++ b/ext/json/lib/json.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'json/common'
##
diff --git a/ext/json/lib/json/add/bigdecimal.rb b/ext/json/lib/json/add/bigdecimal.rb
index 0ef69f12e0..a7646860a2 100644
--- a/ext/json/lib/json/add/bigdecimal.rb
+++ b/ext/json/lib/json/add/bigdecimal.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
diff --git a/ext/json/lib/json/add/complex.rb b/ext/json/lib/json/add/complex.rb
index d7ebebf5f7..65d388b48a 100644
--- a/ext/json/lib/json/add/complex.rb
+++ b/ext/json/lib/json/add/complex.rb
@@ -1,13 +1,19 @@
+# frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
defined?(::Complex) or require 'complex'
class Complex
+
+ # Deserializes JSON string by converting Real value <tt>r</tt>, imaginary
+ # value <tt>i</tt>, to a Complex object.
def self.json_create(object)
Complex(object['r'], object['i'])
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,
@@ -16,6 +22,7 @@ class Complex
}
end
+ # Stores class name (Complex) along with real value <tt>r</tt> and imaginary value <tt>i</tt> as JSON string
def to_json(*)
as_json.to_json
end
diff --git a/ext/json/lib/json/add/core.rb b/ext/json/lib/json/add/core.rb
index 77d9dc0b20..93b2bff424 100644
--- a/ext/json/lib/json/add/core.rb
+++ b/ext/json/lib/json/add/core.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# This file requires the implementations of ruby core's custom objects for
# serialisation/deserialisation.
diff --git a/ext/json/lib/json/add/date.rb b/ext/json/lib/json/add/date.rb
index 4288237db1..b58af76e10 100644
--- a/ext/json/lib/json/add/date.rb
+++ b/ext/json/lib/json/add/date.rb
@@ -1,9 +1,9 @@
+# frozen_string_literal: false
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
diff --git a/ext/json/lib/json/add/date_time.rb b/ext/json/lib/json/add/date_time.rb
index 5ea42ea656..f794eb3d7d 100644
--- a/ext/json/lib/json/add/date_time.rb
+++ b/ext/json/lib/json/add/date_time.rb
@@ -1,9 +1,9 @@
+# frozen_string_literal: false
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>,
diff --git a/ext/json/lib/json/add/exception.rb b/ext/json/lib/json/add/exception.rb
index e6ad257abf..caac713c6a 100644
--- a/ext/json/lib/json/add/exception.rb
+++ b/ext/json/lib/json/add/exception.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: false
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
diff --git a/ext/json/lib/json/add/ostruct.rb b/ext/json/lib/json/add/ostruct.rb
index da81e107a7..1f9ce7b3b4 100644
--- a/ext/json/lib/json/add/ostruct.rb
+++ b/ext/json/lib/json/add/ostruct.rb
@@ -1,9 +1,9 @@
+# frozen_string_literal: false
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
diff --git a/ext/json/lib/json/add/range.rb b/ext/json/lib/json/add/range.rb
index e61e553cdb..3ef20150bf 100644
--- a/ext/json/lib/json/add/range.rb
+++ b/ext/json/lib/json/add/range.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: false
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
diff --git a/ext/json/lib/json/add/rational.rb b/ext/json/lib/json/add/rational.rb
index 867cd92f05..e83a532775 100644
--- a/ext/json/lib/json/add/rational.rb
+++ b/ext/json/lib/json/add/rational.rb
@@ -1,13 +1,18 @@
+# frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
defined?(::Rational) or require 'rational'
class Rational
+ # Deserializes JSON string by converting numerator value <tt>n</tt>,
+ # denominator value <tt>d</tt>, to a Rational object.
def self.json_create(object)
Rational(object['n'], object['d'])
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,
@@ -16,6 +21,7 @@ class Rational
}
end
+ # Stores class name (Rational) along with numerator value <tt>n</tt> and denominator value <tt>d</tt> as JSON string
def to_json(*)
as_json.to_json
end
diff --git a/ext/json/lib/json/add/regexp.rb b/ext/json/lib/json/add/regexp.rb
index 2fcbb6fb14..41b260f307 100644
--- a/ext/json/lib/json/add/regexp.rb
+++ b/ext/json/lib/json/add/regexp.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: false
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
diff --git a/ext/json/lib/json/add/struct.rb b/ext/json/lib/json/add/struct.rb
index 6847cde99b..d08d88237a 100644
--- a/ext/json/lib/json/add/struct.rb
+++ b/ext/json/lib/json/add/struct.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: false
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
diff --git a/ext/json/lib/json/add/symbol.rb b/ext/json/lib/json/add/symbol.rb
index 03dc9a56a5..31b56a294f 100644
--- a/ext/json/lib/json/add/symbol.rb
+++ b/ext/json/lib/json/add/symbol.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: false
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.
diff --git a/ext/json/lib/json/add/time.rb b/ext/json/lib/json/add/time.rb
index 338209d899..80b6434f17 100644
--- a/ext/json/lib/json/add/time.rb
+++ b/ext/json/lib/json/add/time.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: false
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
@@ -10,7 +10,7 @@ class Time
if usec = object.delete('u') # used to be tv_usec -> tv_nsec
object['n'] = usec * 1000
end
- if instance_methods.include?(:tv_nsec)
+ if method_defined?(:tv_nsec)
at(object['s'], Rational(object['n'], 1000))
else
at(object['s'], object['n'] / 1000)
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
index 8fbaa2baad..020615fc1d 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'json/version'
require 'json/generic_object'
@@ -148,7 +149,7 @@ module JSON
# the default.
# * *create_additions*: If set to false, the Parser doesn't create
# additions even if a matching class and create_id was found. This option
- # defaults to true.
+ # defaults to false.
# * *object_class*: Defaults to Hash
# * *array_class*: Defaults to Array
def parse(source, opts = {})
@@ -169,7 +170,7 @@ module JSON
# to true.
# * *create_additions*: If set to false, the Parser doesn't create
# additions even if a matching class and create_id was found. This option
- # defaults to true.
+ # defaults to false.
def parse!(source, opts = {})
opts = {
:max_nesting => false,
@@ -390,7 +391,7 @@ module JSON
end
end
opts = JSON.dump_default_options
- limit and opts.update(:max_nesting => limit)
+ opts = opts.merge(:max_nesting => limit) if limit
result = generate(obj, opts)
if anIO
anIO.write result
@@ -411,7 +412,7 @@ module JSON
string
end
- # Shortuct for iconv.
+ # Shortcut for iconv.
if ::String.method_defined?(:encode)
# Encodes string using Ruby's _String.encode_
def self.iconv(to, from, string)
diff --git a/ext/json/lib/json/ext.rb b/ext/json/lib/json/ext.rb
index c5f813181d..2486f084cd 100644
--- a/ext/json/lib/json/ext.rb
+++ b/ext/json/lib/json/ext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
if ENV['SIMPLECOV_COVERAGE'].to_i == 1
require 'simplecov'
SimpleCov.start do
diff --git a/ext/json/lib/json/generic_object.rb b/ext/json/lib/json/generic_object.rb
index 8b8fd53bef..2241f6c7ce 100644
--- a/ext/json/lib/json/generic_object.rb
+++ b/ext/json/lib/json/generic_object.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'ostruct'
module JSON
@@ -47,14 +48,6 @@ module JSON
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
diff --git a/ext/json/lib/json/version.rb b/ext/json/lib/json/version.rb
index 47cdcd607c..cd7ddf8777 100644
--- a/ext/json/lib/json/version.rb
+++ b/ext/json/lib/json/version.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: false
module JSON
# JSON version
- VERSION = '1.8.1'
+ VERSION = '1.8.3.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 498ffa964c..bc5db06404 100644
--- a/ext/json/parser/depend
+++ b/ext/json/parser/depend
@@ -1 +1,20 @@
+$(OBJS): $(ruby_headers)
parser.o: parser.c parser.h $(srcdir)/../fbuffer/fbuffer.h
+
+# AUTOGENERATED DEPENDENCIES START
+parser.o: $(RUBY_EXTCONF_H)
+parser.o: $(arch_hdrdir)/ruby/config.h
+parser.o: $(hdrdir)/ruby/defines.h
+parser.o: $(hdrdir)/ruby/encoding.h
+parser.o: $(hdrdir)/ruby/intern.h
+parser.o: $(hdrdir)/ruby/missing.h
+parser.o: $(hdrdir)/ruby/oniguruma.h
+parser.o: $(hdrdir)/ruby/ruby.h
+parser.o: $(hdrdir)/ruby/st.h
+parser.o: $(hdrdir)/ruby/subst.h
+parser.o: $(top_srcdir)/ext/json/fbuffer/fbuffer.h
+parser.o: $(top_srcdir)/include/ruby.h
+parser.o: parser.c
+parser.o: parser.h
+parser.o: parser.rl
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/json/parser/extconf.rb b/ext/json/parser/extconf.rb
index ae4f861c79..f7360d46b2 100644
--- a/ext/json/parser/extconf.rb
+++ b/ext/json/parser/extconf.rb
@@ -1,3 +1,6 @@
+# frozen_string_literal: false
require 'mkmf'
+have_func("rb_enc_raise", "ruby.h")
+
create_makefile 'json/ext/parser'
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
index df89f2c58b..773605cf7c 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -3,6 +3,28 @@
#include "../fbuffer/fbuffer.h"
#include "parser.h"
+#if defined HAVE_RUBY_ENCODING_H
+# define EXC_ENCODING UTF_8,
+# ifndef HAVE_RB_ENC_RAISE
+static void
+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));
+}
+# define rb_enc_raise enc_raise
+# endif
+#else
+# define EXC_ENCODING /* nothing */
+# define rb_enc_raise rb_raise
+#endif
+
/* unicode */
static const char digit_values[256] = {
@@ -28,16 +50,16 @@ static UTF32 unescape_unicode(const unsigned char *p)
UTF32 result = 0;
b = digit_values[p[0]];
if (b < 0) return UNI_REPLACEMENT_CHAR;
- result = (result << 4) | b;
+ result = (result << 4) | (unsigned char)b;
b = digit_values[p[1]];
- result = (result << 4) | b;
if (b < 0) return UNI_REPLACEMENT_CHAR;
+ result = (result << 4) | (unsigned char)b;
b = digit_values[p[2]];
- result = (result << 4) | b;
if (b < 0) return UNI_REPLACEMENT_CHAR;
+ result = (result << 4) | (unsigned char)b;
b = digit_values[p[3]];
- result = (result << 4) | b;
if (b < 0) return UNI_REPLACEMENT_CHAR;
+ result = (result << 4) | (unsigned char)b;
return result;
}
@@ -68,9 +90,7 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
}
#ifdef HAVE_RUBY_ENCODING_H
-static VALUE CEncoding_ASCII_8BIT, CEncoding_UTF_8, CEncoding_UTF_16BE,
- CEncoding_UTF_16LE, CEncoding_UTF_32BE, CEncoding_UTF_32LE;
-static ID i_encoding, i_encode;
+static rb_encoding *UTF_8, *UTF_16BE, *UTF_16LE, *UTF_32BE, *UTF_32LE;
#else
static ID i_iconv;
#endif
@@ -84,19 +104,19 @@ static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
i_match_string, i_aset, i_aref, i_leftshift;
-#line 110 "parser.rl"
+#line 130 "parser.rl"
-#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;
+#line 112 "parser.c"
+enum {JSON_object_start = 1};
+enum {JSON_object_first_final = 27};
+enum {JSON_object_error = 0};
-static const int JSON_object_en_main = 1;
+enum {JSON_object_en_main = 1};
-#line 151 "parser.rl"
+#line 171 "parser.rl"
static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -112,14 +132,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 116 "parser.c"
+#line 136 "parser.c"
{
cs = JSON_object_start;
}
-#line 166 "parser.rl"
+#line 186 "parser.rl"
-#line 123 "parser.c"
+#line 143 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -147,7 +167,7 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 133 "parser.rl"
+#line 153 "parser.rl"
{
char *np;
json->parsing_name = 1;
@@ -160,7 +180,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 164 "parser.c"
+#line 184 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -227,7 +247,7 @@ case 8:
goto st8;
goto st0;
tr11:
-#line 118 "parser.rl"
+#line 138 "parser.rl"
{
VALUE v = Qnil;
char *np = JSON_parse_value(json, p, pe, &v);
@@ -247,7 +267,7 @@ st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 251 "parser.c"
+#line 271 "parser.c"
switch( (*p) ) {
case 13: goto st9;
case 32: goto st9;
@@ -336,14 +356,14 @@ case 18:
goto st9;
goto st18;
tr4:
-#line 141 "parser.rl"
+#line 161 "parser.rl"
{ p--; {p++; cs = 27; goto _out;} }
goto st27;
st27:
if ( ++p == pe )
goto _test_eof27;
case 27:
-#line 347 "parser.c"
+#line 367 "parser.c"
goto st0;
st19:
if ( ++p == pe )
@@ -441,7 +461,7 @@ case 26:
_out: {}
}
-#line 167 "parser.rl"
+#line 187 "parser.rl"
if (cs >= JSON_object_first_final) {
if (json->create_additions) {
@@ -466,15 +486,15 @@ case 26:
-#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;
+#line 490 "parser.c"
+enum {JSON_value_start = 1};
+enum {JSON_value_first_final = 21};
+enum {JSON_value_error = 0};
-static const int JSON_value_en_main = 1;
+enum {JSON_value_en_main = 1};
-#line 271 "parser.rl"
+#line 291 "parser.rl"
static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -482,14 +502,14 @@ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *resul
int cs = EVIL;
-#line 486 "parser.c"
+#line 506 "parser.c"
{
cs = JSON_value_start;
}
-#line 278 "parser.rl"
+#line 298 "parser.rl"
-#line 493 "parser.c"
+#line 513 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -514,14 +534,14 @@ st0:
cs = 0;
goto _out;
tr0:
-#line 219 "parser.rl"
+#line 239 "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 224 "parser.rl"
+#line 244 "parser.rl"
{
char *np;
if(pe > p + 9 - json->quirks_mode && !strncmp(MinusInfinity, p, 9)) {
@@ -530,7 +550,7 @@ tr2:
{p = (( p + 10))-1;}
p--; {p++; cs = 21; goto _out;}
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
}
}
np = JSON_parse_float(json, p, pe, result);
@@ -541,7 +561,7 @@ tr2:
}
goto st21;
tr5:
-#line 242 "parser.rl"
+#line 262 "parser.rl"
{
char *np;
json->current_nesting++;
@@ -551,7 +571,7 @@ tr5:
}
goto st21;
tr9:
-#line 250 "parser.rl"
+#line 270 "parser.rl"
{
char *np;
json->current_nesting++;
@@ -561,39 +581,39 @@ tr9:
}
goto st21;
tr16:
-#line 212 "parser.rl"
+#line 232 "parser.rl"
{
if (json->allow_nan) {
*result = CInfinity;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
}
}
goto st21;
tr18:
-#line 205 "parser.rl"
+#line 225 "parser.rl"
{
if (json->allow_nan) {
*result = CNaN;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
}
}
goto st21;
tr22:
-#line 199 "parser.rl"
+#line 219 "parser.rl"
{
*result = Qfalse;
}
goto st21;
tr25:
-#line 196 "parser.rl"
+#line 216 "parser.rl"
{
*result = Qnil;
}
goto st21;
tr28:
-#line 202 "parser.rl"
+#line 222 "parser.rl"
{
*result = Qtrue;
}
@@ -602,9 +622,9 @@ st21:
if ( ++p == pe )
goto _test_eof21;
case 21:
-#line 258 "parser.rl"
+#line 278 "parser.rl"
{ p--; {p++; cs = 21; goto _out;} }
-#line 608 "parser.c"
+#line 628 "parser.c"
goto st0;
st2:
if ( ++p == pe )
@@ -765,7 +785,7 @@ case 20:
_out: {}
}
-#line 279 "parser.rl"
+#line 299 "parser.rl"
if (cs >= JSON_value_first_final) {
return p;
@@ -775,15 +795,15 @@ case 20:
}
-#line 779 "parser.c"
-static const int JSON_integer_start = 1;
-static const int JSON_integer_first_final = 3;
-static const int JSON_integer_error = 0;
+#line 799 "parser.c"
+enum {JSON_integer_start = 1};
+enum {JSON_integer_first_final = 3};
+enum {JSON_integer_error = 0};
-static const int JSON_integer_en_main = 1;
+enum {JSON_integer_en_main = 1};
-#line 295 "parser.rl"
+#line 315 "parser.rl"
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -791,15 +811,15 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
int cs = EVIL;
-#line 795 "parser.c"
+#line 815 "parser.c"
{
cs = JSON_integer_start;
}
-#line 302 "parser.rl"
+#line 322 "parser.rl"
json->memo = p;
-#line 803 "parser.c"
+#line 823 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -833,14 +853,14 @@ case 3:
goto st0;
goto tr4;
tr4:
-#line 292 "parser.rl"
+#line 312 "parser.rl"
{ p--; {p++; cs = 4; goto _out;} }
goto st4;
st4:
if ( ++p == pe )
goto _test_eof4;
case 4:
-#line 844 "parser.c"
+#line 864 "parser.c"
goto st0;
st5:
if ( ++p == pe )
@@ -859,7 +879,7 @@ case 5:
_out: {}
}
-#line 304 "parser.rl"
+#line 324 "parser.rl"
if (cs >= JSON_integer_first_final) {
long len = p - json->memo;
@@ -874,15 +894,15 @@ case 5:
}
-#line 878 "parser.c"
-static const int JSON_float_start = 1;
-static const int JSON_float_first_final = 8;
-static const int JSON_float_error = 0;
+#line 898 "parser.c"
+enum {JSON_float_start = 1};
+enum {JSON_float_first_final = 8};
+enum {JSON_float_error = 0};
-static const int JSON_float_en_main = 1;
+enum {JSON_float_en_main = 1};
-#line 329 "parser.rl"
+#line 349 "parser.rl"
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -890,15 +910,15 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
int cs = EVIL;
-#line 894 "parser.c"
+#line 914 "parser.c"
{
cs = JSON_float_start;
}
-#line 336 "parser.rl"
+#line 356 "parser.rl"
json->memo = p;
-#line 902 "parser.c"
+#line 922 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -956,14 +976,14 @@ case 8:
goto st0;
goto tr9;
tr9:
-#line 323 "parser.rl"
+#line 343 "parser.rl"
{ p--; {p++; cs = 9; goto _out;} }
goto st9;
st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 967 "parser.c"
+#line 987 "parser.c"
goto st0;
st5:
if ( ++p == pe )
@@ -1024,7 +1044,7 @@ case 7:
_out: {}
}
-#line 338 "parser.rl"
+#line 358 "parser.rl"
if (cs >= JSON_float_first_final) {
long len = p - json->memo;
@@ -1040,15 +1060,15 @@ case 7:
-#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;
+#line 1064 "parser.c"
+enum {JSON_array_start = 1};
+enum {JSON_array_first_final = 17};
+enum {JSON_array_error = 0};
-static const int JSON_array_en_main = 1;
+enum {JSON_array_en_main = 1};
-#line 381 "parser.rl"
+#line 401 "parser.rl"
static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -1062,14 +1082,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 1066 "parser.c"
+#line 1086 "parser.c"
{
cs = JSON_array_start;
}
-#line 394 "parser.rl"
+#line 414 "parser.rl"
-#line 1073 "parser.c"
+#line 1093 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1108,7 +1128,7 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 358 "parser.rl"
+#line 378 "parser.rl"
{
VALUE v = Qnil;
char *np = JSON_parse_value(json, p, pe, &v);
@@ -1128,7 +1148,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 1132 "parser.c"
+#line 1152 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -1228,14 +1248,14 @@ case 12:
goto st3;
goto st12;
tr4:
-#line 373 "parser.rl"
+#line 393 "parser.rl"
{ p--; {p++; cs = 17; goto _out;} }
goto st17;
st17:
if ( ++p == pe )
goto _test_eof17;
case 17:
-#line 1239 "parser.c"
+#line 1259 "parser.c"
goto st0;
st13:
if ( ++p == pe )
@@ -1291,12 +1311,12 @@ case 16:
_out: {}
}
-#line 395 "parser.rl"
+#line 415 "parser.rl"
if(cs >= JSON_array_first_final) {
return p + 1;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return NULL;
}
}
@@ -1372,15 +1392,15 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
}
-#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;
+#line 1396 "parser.c"
+enum {JSON_string_start = 1};
+enum {JSON_string_first_final = 8};
+enum {JSON_string_error = 0};
-static const int JSON_string_en_main = 1;
+enum {JSON_string_en_main = 1};
-#line 494 "parser.rl"
+#line 514 "parser.rl"
static int
@@ -1402,15 +1422,15 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
*result = rb_str_buf_new(0);
-#line 1406 "parser.c"
+#line 1426 "parser.c"
{
cs = JSON_string_start;
}
-#line 515 "parser.rl"
+#line 535 "parser.rl"
json->memo = p;
-#line 1414 "parser.c"
+#line 1434 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1435,7 +1455,7 @@ case 2:
goto st0;
goto st2;
tr2:
-#line 480 "parser.rl"
+#line 500 "parser.rl"
{
*result = json_string_unescape(*result, json->memo + 1, p);
if (NIL_P(*result)) {
@@ -1446,14 +1466,14 @@ tr2:
{p = (( p + 1))-1;}
}
}
-#line 491 "parser.rl"
+#line 511 "parser.rl"
{ p--; {p++; cs = 8; goto _out;} }
goto st8;
st8:
if ( ++p == pe )
goto _test_eof8;
case 8:
-#line 1457 "parser.c"
+#line 1477 "parser.c"
goto st0;
st3:
if ( ++p == pe )
@@ -1529,7 +1549,7 @@ case 7:
_out: {}
}
-#line 517 "parser.rl"
+#line 537 "parser.rl"
if (json->create_additions && RTEST(match_string = json->match_string)) {
VALUE klass;
@@ -1566,29 +1586,29 @@ case 7:
static VALUE convert_encoding(VALUE source)
{
- char *ptr = RSTRING_PTR(source);
+ const char *ptr = RSTRING_PTR(source);
long len = RSTRING_LEN(source);
if (len < 2) {
rb_raise(eParserError, "A JSON text must at least contain two octets!");
}
#ifdef HAVE_RUBY_ENCODING_H
{
- VALUE encoding = rb_funcall(source, i_encoding, 0);
- if (encoding == CEncoding_ASCII_8BIT) {
+ rb_encoding *enc = rb_enc_get(source);
+ if (enc == rb_ascii8bit_encoding()) {
if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32BE);
+ source = rb_str_conv_enc(source, UTF_32BE, rb_utf8_encoding());
} else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16BE);
+ source = rb_str_conv_enc(source, UTF_16BE, rb_utf8_encoding());
} else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32LE);
+ source = rb_str_conv_enc(source, UTF_32LE, rb_utf8_encoding());
} else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE);
+ source = rb_str_conv_enc(source, UTF_16LE, rb_utf8_encoding());
} else {
source = rb_str_dup(source);
FORCE_UTF8(source);
}
} else {
- source = rb_funcall(source, i_encode, 1, CEncoding_UTF_8);
+ source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
}
}
#else
@@ -1626,8 +1646,8 @@ static VALUE convert_encoding(VALUE source)
* (keys) in a JSON object. Otherwise strings are returned, which is also
* 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
- * defaults to true.
+ * additions even if a matching class and create_id was found. This option
+ * defaults to false.
* * *object_class*: Defaults to Hash
* * *array_class*: Defaults to Array
*/
@@ -1639,12 +1659,18 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
if (json->Vsource) {
rb_raise(rb_eTypeError, "already initialized instance");
}
+#ifdef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
+ rb_scan_args(argc, argv, "1:", &source, &opts);
+#else
rb_scan_args(argc, argv, "11", &source, &opts);
+#endif
if (!NIL_P(opts)) {
+#ifndef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
opts = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
if (NIL_P(opts)) {
rb_raise(rb_eArgError, "opts needs to be like a hash");
} else {
+#endif
VALUE tmp = ID2SYM(i_max_nesting);
if (option_given_p(opts, tmp)) {
VALUE max_nesting = rb_hash_aref(opts, tmp);
@@ -1707,7 +1733,9 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->match_string = Qnil;
}
+#ifndef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
}
+#endif
} else {
json->max_nesting = 100;
json->allow_nan = 0;
@@ -1716,12 +1744,11 @@ 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");
+ StringValue(source);
if (!json->quirks_mode) {
- source = convert_encoding(StringValue(source));
+ source = convert_encoding(source);
}
json->current_nesting = 0;
- StringValue(source);
json->len = RSTRING_LEN(source);
json->source = RSTRING_PTR(source);;
json->Vsource = source;
@@ -1729,15 +1756,15 @@ static VALUE cParser_initialize(int argc, VALUE *argv, 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;
+#line 1760 "parser.c"
+enum {JSON_start = 1};
+enum {JSON_first_final = 10};
+enum {JSON_error = 0};
-static const int JSON_en_main = 1;
+enum {JSON_en_main = 1};
-#line 740 "parser.rl"
+#line 767 "parser.rl"
static VALUE cParser_parse_strict(VALUE self)
@@ -1748,16 +1775,16 @@ static VALUE cParser_parse_strict(VALUE self)
GET_PARSER;
-#line 1752 "parser.c"
+#line 1779 "parser.c"
{
cs = JSON_start;
}
-#line 750 "parser.rl"
+#line 777 "parser.rl"
p = json->source;
pe = p + json->len;
-#line 1761 "parser.c"
+#line 1788 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1813,7 +1840,7 @@ case 5:
goto st1;
goto st5;
tr3:
-#line 729 "parser.rl"
+#line 756 "parser.rl"
{
char *np;
json->current_nesting = 1;
@@ -1822,7 +1849,7 @@ tr3:
}
goto st10;
tr4:
-#line 722 "parser.rl"
+#line 749 "parser.rl"
{
char *np;
json->current_nesting = 1;
@@ -1834,7 +1861,7 @@ st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
-#line 1838 "parser.c"
+#line 1865 "parser.c"
switch( (*p) ) {
case 13: goto st10;
case 32: goto st10;
@@ -1891,27 +1918,27 @@ case 9:
_out: {}
}
-#line 753 "parser.rl"
+#line 780 "parser.rl"
if (cs >= JSON_first_final && p == pe) {
return result;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return Qnil;
}
}
-#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;
+#line 1934 "parser.c"
+enum {JSON_quirks_mode_start = 1};
+enum {JSON_quirks_mode_first_final = 10};
+enum {JSON_quirks_mode_error = 0};
-static const int JSON_quirks_mode_en_main = 1;
+enum {JSON_quirks_mode_en_main = 1};
-#line 778 "parser.rl"
+#line 805 "parser.rl"
static VALUE cParser_parse_quirks_mode(VALUE self)
@@ -1922,16 +1949,16 @@ static VALUE cParser_parse_quirks_mode(VALUE self)
GET_PARSER;
-#line 1926 "parser.c"
+#line 1953 "parser.c"
{
cs = JSON_quirks_mode_start;
}
-#line 788 "parser.rl"
+#line 815 "parser.rl"
p = json->source;
pe = p + json->len;
-#line 1935 "parser.c"
+#line 1962 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1965,7 +1992,7 @@ st0:
cs = 0;
goto _out;
tr2:
-#line 770 "parser.rl"
+#line 797 "parser.rl"
{
char *np = JSON_parse_value(json, p, pe, &result);
if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
@@ -1975,7 +2002,7 @@ st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
-#line 1979 "parser.c"
+#line 2006 "parser.c"
switch( (*p) ) {
case 13: goto st10;
case 32: goto st10;
@@ -2064,12 +2091,12 @@ case 9:
_out: {}
}
-#line 791 "parser.rl"
+#line 818 "parser.rl"
if (cs >= JSON_quirks_mode_first_final && p == pe) {
return result;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return Qnil;
}
}
@@ -2091,17 +2118,9 @@ static VALUE cParser_parse(VALUE self)
}
}
-
-static JSON_Parser *JSON_allocate()
-{
- JSON_Parser *json = ALLOC(JSON_Parser);
- MEMZERO(json, JSON_Parser, 1);
- json->fbuffer = fbuffer_alloc(0);
- return json;
-}
-
-static void JSON_mark(JSON_Parser *json)
+static void JSON_mark(void *ptr)
{
+ JSON_Parser *json = ptr;
rb_gc_mark_maybe(json->Vsource);
rb_gc_mark_maybe(json->create_id);
rb_gc_mark_maybe(json->object_class);
@@ -2109,16 +2128,36 @@ static void JSON_mark(JSON_Parser *json)
rb_gc_mark_maybe(json->match_string);
}
-static void JSON_free(JSON_Parser *json)
+static void JSON_free(void *ptr)
{
+ JSON_Parser *json = ptr;
fbuffer_free(json->fbuffer);
ruby_xfree(json);
}
+static size_t JSON_memsize(const void *ptr)
+{
+ const JSON_Parser *json = ptr;
+ return sizeof(*json) + FBUFFER_CAPA(json->fbuffer);
+}
+
+#ifdef NEW_TYPEDDATA_WRAPPER
+static const rb_data_type_t JSON_Parser_type = {
+ "JSON/Parser",
+ {JSON_mark, JSON_free, JSON_memsize,},
+#ifdef RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+#endif
+};
+#endif
+
static VALUE cJSON_parser_s_allocate(VALUE klass)
{
- JSON_Parser *json = JSON_allocate();
- return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
+ JSON_Parser *json;
+ VALUE obj = TypedData_Make_Struct(klass, JSON_Parser, &JSON_Parser_type, json);
+ json->fbuffer = fbuffer_alloc(0);
+ return obj;
}
/*
@@ -2145,7 +2184,7 @@ static VALUE cParser_quirks_mode_p(VALUE self)
}
-void Init_parser()
+void Init_parser(void)
{
rb_require("json/common");
mJSON = rb_define_module("JSON");
@@ -2182,14 +2221,11 @@ void Init_parser()
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"));
- CEncoding_UTF_16BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16be"));
- CEncoding_UTF_16LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16le"));
- CEncoding_UTF_32BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32be"));
- CEncoding_UTF_32LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32le"));
- CEncoding_ASCII_8BIT = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("ascii-8bit"));
- i_encoding = rb_intern("encoding");
- i_encode = rb_intern("encode");
+ UTF_8 = rb_utf8_encoding();
+ UTF_16BE = rb_enc_find("utf-16be");
+ UTF_16LE = rb_enc_find("utf-16le");
+ UTF_32BE = rb_enc_find("utf-32be");
+ UTF_32LE = rb_enc_find("utf-32le");
#else
i_iconv = rb_intern("iconv");
#endif
diff --git a/ext/json/parser/parser.h b/ext/json/parser/parser.h
index b192064c09..abcc2571f1 100644
--- a/ext/json/parser/parser.h
+++ b/ext/json/parser/parser.h
@@ -51,7 +51,7 @@ typedef struct JSON_ParserStruct {
if (!json->Vsource) rb_raise(rb_eTypeError, "uninitialized instance")
#define GET_PARSER_INIT \
JSON_Parser *json; \
- Data_Get_Struct(self, JSON_Parser, json)
+ TypedData_Get_Struct(self, JSON_Parser, &JSON_Parser_type, json)
#define MinusInfinity "-Infinity"
#define EVIL 0x666
@@ -68,10 +68,25 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
static VALUE convert_encoding(VALUE source);
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self);
static VALUE cParser_parse(VALUE self);
-static JSON_Parser *JSON_allocate();
-static void JSON_mark(JSON_Parser *json);
-static void JSON_free(JSON_Parser *json);
+static void JSON_mark(void *json);
+static void JSON_free(void *json);
static VALUE cJSON_parser_s_allocate(VALUE klass);
static VALUE cParser_source(VALUE self);
+#ifndef ZALLOC
+#define ZALLOC(type) ((type *)ruby_zalloc(sizeof(type)))
+static inline void *ruby_zalloc(size_t n)
+{
+ void *p = ruby_xmalloc(n);
+ memset(p, 0, n);
+ return p;
+}
+#endif
+#ifdef TypedData_Make_Struct
+static const rb_data_type_t JSON_Parser_type;
+#define NEW_TYPEDDATA_WRAPPER 1
+#else
+#define TypedData_Make_Struct(klass, type, ignore, json) Data_Make_Struct(klass, type, NULL, JSON_free, json)
+#define TypedData_Get_Struct(self, JSON_Parser, ignore, json) Data_Get_Struct(self, JSON_Parser, json)
+#endif
#endif
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl
index ab8d318173..2fa0caee7a 100644
--- a/ext/json/parser/parser.rl
+++ b/ext/json/parser/parser.rl
@@ -1,6 +1,28 @@
#include "../fbuffer/fbuffer.h"
#include "parser.h"
+#if defined HAVE_RUBY_ENCODING_H
+# define EXC_ENCODING UTF_8,
+# ifndef HAVE_RB_ENC_RAISE
+static void
+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));
+}
+# define rb_enc_raise enc_raise
+# endif
+#else
+# define EXC_ENCODING /* nothing */
+# define rb_enc_raise rb_raise
+#endif
+
/* unicode */
static const char digit_values[256] = {
@@ -26,16 +48,16 @@ static UTF32 unescape_unicode(const unsigned char *p)
UTF32 result = 0;
b = digit_values[p[0]];
if (b < 0) return UNI_REPLACEMENT_CHAR;
- result = (result << 4) | b;
+ result = (result << 4) | (unsigned char)b;
b = digit_values[p[1]];
- result = (result << 4) | b;
if (b < 0) return UNI_REPLACEMENT_CHAR;
+ result = (result << 4) | (unsigned char)b;
b = digit_values[p[2]];
- result = (result << 4) | b;
if (b < 0) return UNI_REPLACEMENT_CHAR;
+ result = (result << 4) | (unsigned char)b;
b = digit_values[p[3]];
- result = (result << 4) | b;
if (b < 0) return UNI_REPLACEMENT_CHAR;
+ result = (result << 4) | (unsigned char)b;
return result;
}
@@ -66,9 +88,7 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
}
#ifdef HAVE_RUBY_ENCODING_H
-static VALUE CEncoding_ASCII_8BIT, CEncoding_UTF_8, CEncoding_UTF_16BE,
- CEncoding_UTF_16LE, CEncoding_UTF_32BE, CEncoding_UTF_32LE;
-static ID i_encoding, i_encode;
+static rb_encoding *UTF_8, *UTF_16BE, *UTF_16LE, *UTF_32BE, *UTF_32LE;
#else
static ID i_iconv;
#endif
@@ -206,14 +226,14 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
if (json->allow_nan) {
*result = CNaN;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
}
}
action parse_infinity {
if (json->allow_nan) {
*result = CInfinity;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
}
}
action parse_string {
@@ -229,7 +249,7 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
fexec p + 10;
fhold; fbreak;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
}
}
np = JSON_parse_float(json, fpc, pe, result);
@@ -396,7 +416,7 @@ static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *resul
if(cs >= JSON_array_first_final) {
return p + 1;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return NULL;
}
}
@@ -550,29 +570,29 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
static VALUE convert_encoding(VALUE source)
{
- char *ptr = RSTRING_PTR(source);
+ const char *ptr = RSTRING_PTR(source);
long len = RSTRING_LEN(source);
if (len < 2) {
rb_raise(eParserError, "A JSON text must at least contain two octets!");
}
#ifdef HAVE_RUBY_ENCODING_H
{
- VALUE encoding = rb_funcall(source, i_encoding, 0);
- if (encoding == CEncoding_ASCII_8BIT) {
+ rb_encoding *enc = rb_enc_get(source);
+ if (enc == rb_ascii8bit_encoding()) {
if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32BE);
+ source = rb_str_conv_enc(source, UTF_32BE, rb_utf8_encoding());
} else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16BE);
+ source = rb_str_conv_enc(source, UTF_16BE, rb_utf8_encoding());
} else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32LE);
+ source = rb_str_conv_enc(source, UTF_32LE, rb_utf8_encoding());
} else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
- source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE);
+ source = rb_str_conv_enc(source, UTF_16LE, rb_utf8_encoding());
} else {
source = rb_str_dup(source);
FORCE_UTF8(source);
}
} else {
- source = rb_funcall(source, i_encode, 1, CEncoding_UTF_8);
+ source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
}
}
#else
@@ -610,8 +630,8 @@ static VALUE convert_encoding(VALUE source)
* (keys) in a JSON object. Otherwise strings are returned, which is also
* 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
- * defaults to true.
+ * additions even if a matching class and create_id was found. This option
+ * defaults to false.
* * *object_class*: Defaults to Hash
* * *array_class*: Defaults to Array
*/
@@ -623,12 +643,18 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
if (json->Vsource) {
rb_raise(rb_eTypeError, "already initialized instance");
}
+#ifdef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
+ rb_scan_args(argc, argv, "1:", &source, &opts);
+#else
rb_scan_args(argc, argv, "11", &source, &opts);
+#endif
if (!NIL_P(opts)) {
+#ifndef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
opts = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
if (NIL_P(opts)) {
rb_raise(rb_eArgError, "opts needs to be like a hash");
} else {
+#endif
VALUE tmp = ID2SYM(i_max_nesting);
if (option_given_p(opts, tmp)) {
VALUE max_nesting = rb_hash_aref(opts, tmp);
@@ -691,7 +717,9 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->match_string = Qnil;
}
+#ifndef HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
}
+#endif
} else {
json->max_nesting = 100;
json->allow_nan = 0;
@@ -700,12 +728,11 @@ 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");
+ StringValue(source);
if (!json->quirks_mode) {
- source = convert_encoding(StringValue(source));
+ source = convert_encoding(source);
}
json->current_nesting = 0;
- StringValue(source);
json->len = RSTRING_LEN(source);
json->source = RSTRING_PTR(source);;
json->Vsource = source;
@@ -754,7 +781,7 @@ static VALUE cParser_parse_strict(VALUE self)
if (cs >= JSON_first_final && p == pe) {
return result;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return Qnil;
}
}
@@ -792,7 +819,7 @@ static VALUE cParser_parse_quirks_mode(VALUE self)
if (cs >= JSON_quirks_mode_first_final && p == pe) {
return result;
} else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return Qnil;
}
}
@@ -814,17 +841,9 @@ static VALUE cParser_parse(VALUE self)
}
}
-
-static JSON_Parser *JSON_allocate()
-{
- JSON_Parser *json = ALLOC(JSON_Parser);
- MEMZERO(json, JSON_Parser, 1);
- json->fbuffer = fbuffer_alloc(0);
- return json;
-}
-
-static void JSON_mark(JSON_Parser *json)
+static void JSON_mark(void *ptr)
{
+ JSON_Parser *json = ptr;
rb_gc_mark_maybe(json->Vsource);
rb_gc_mark_maybe(json->create_id);
rb_gc_mark_maybe(json->object_class);
@@ -832,16 +851,36 @@ static void JSON_mark(JSON_Parser *json)
rb_gc_mark_maybe(json->match_string);
}
-static void JSON_free(JSON_Parser *json)
+static void JSON_free(void *ptr)
{
+ JSON_Parser *json = ptr;
fbuffer_free(json->fbuffer);
ruby_xfree(json);
}
+static size_t JSON_memsize(const void *ptr)
+{
+ const JSON_Parser *json = ptr;
+ return sizeof(*json) + FBUFFER_CAPA(json->fbuffer);
+}
+
+#ifdef NEW_TYPEDDATA_WRAPPER
+static const rb_data_type_t JSON_Parser_type = {
+ "JSON/Parser",
+ {JSON_mark, JSON_free, JSON_memsize,},
+#ifdef RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+#endif
+};
+#endif
+
static VALUE cJSON_parser_s_allocate(VALUE klass)
{
- JSON_Parser *json = JSON_allocate();
- return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
+ JSON_Parser *json;
+ VALUE obj = TypedData_Make_Struct(klass, JSON_Parser, &JSON_Parser_type, json);
+ json->fbuffer = fbuffer_alloc(0);
+ return obj;
}
/*
@@ -868,7 +907,7 @@ static VALUE cParser_quirks_mode_p(VALUE self)
}
-void Init_parser()
+void Init_parser(void)
{
rb_require("json/common");
mJSON = rb_define_module("JSON");
@@ -905,14 +944,11 @@ void Init_parser()
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"));
- CEncoding_UTF_16BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16be"));
- CEncoding_UTF_16LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16le"));
- CEncoding_UTF_32BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32be"));
- CEncoding_UTF_32LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32le"));
- CEncoding_ASCII_8BIT = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("ascii-8bit"));
- i_encoding = rb_intern("encoding");
- i_encode = rb_intern("encode");
+ UTF_8 = rb_utf8_encoding();
+ UTF_16BE = rb_enc_find("utf-16be");
+ UTF_16LE = rb_enc_find("utf-16le");
+ UTF_32BE = rb_enc_find("utf-32be");
+ UTF_32LE = rb_enc_find("utf-32le");
#else
i_iconv = rb_intern("iconv");
#endif
diff --git a/ext/json/parser/prereq.mk b/ext/json/parser/prereq.mk
index 440ef4017e..be7bcb4319 100644
--- a/ext/json/parser/prereq.mk
+++ b/ext/json/parser/prereq.mk
@@ -4,6 +4,7 @@ RAGEL = ragel
.rl.c:
$(RAGEL) -G2 $<
- $(BASERUBY) -pli -e '$$_.sub!(/[ \t]+$$/, "")' $@
+ $(BASERUBY) -pli -e '$$_.sub!(/[ \t]+$$/, "")' \
+ -e '$$_.sub!(/^static const int (JSON_.*=.*);$$/, "enum {\\1};")' $@
parser.c:
diff --git a/ext/mathn/complex/extconf.rb b/ext/mathn/complex/extconf.rb
index d4d14ffcb8..a3f45ac4fc 100644
--- a/ext/mathn/complex/extconf.rb
+++ b/ext/mathn/complex/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require "mkmf"
create_makefile "mathn/complex"
diff --git a/ext/mathn/rational/extconf.rb b/ext/mathn/rational/extconf.rb
index ba76306b7b..4e4cc5f621 100644
--- a/ext/mathn/rational/extconf.rb
+++ b/ext/mathn/rational/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require "mkmf"
create_makefile "mathn/rational"
diff --git a/ext/nkf/depend b/ext/nkf/depend
index f368cd51d7..16421508b1 100644
--- a/ext/nkf/depend
+++ b/ext/nkf/depend
@@ -1,6 +1,22 @@
-nkf.o : nkf.c $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.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
+# BSD make needs "nkf.o: nkf.c" dependency BEFORE "nkf.o: nkf-utf8/nkf.c".
+# It seems BSD make searches the target for implicit rule in dependencies at first.
+nkf.o: nkf.c
+
+# AUTOGENERATED DEPENDENCIES START
+nkf.o: $(RUBY_EXTCONF_H)
+nkf.o: $(arch_hdrdir)/ruby/config.h
+nkf.o: $(hdrdir)/ruby/defines.h
+nkf.o: $(hdrdir)/ruby/encoding.h
+nkf.o: $(hdrdir)/ruby/intern.h
+nkf.o: $(hdrdir)/ruby/missing.h
+nkf.o: $(hdrdir)/ruby/oniguruma.h
+nkf.o: $(hdrdir)/ruby/ruby.h
+nkf.o: $(hdrdir)/ruby/st.h
+nkf.o: $(hdrdir)/ruby/subst.h
+nkf.o: nkf-utf8/config.h
+nkf.o: nkf-utf8/nkf.c
+nkf.o: nkf-utf8/nkf.h
+nkf.o: nkf-utf8/utf8tbl.c
+nkf.o: nkf-utf8/utf8tbl.h
+nkf.o: nkf.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/nkf/extconf.rb b/ext/nkf/extconf.rb
index 710662f19c..f41f6b11dc 100644
--- a/ext/nkf/extconf.rb
+++ b/ext/nkf/extconf.rb
@@ -1,2 +1,3 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile('nkf')
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index f8c1ae8f59..f52b755288 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# kconv.rb - Kanji Converter.
#
diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c
index ca3e438220..3e46c33f7d 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.3"
-#define NKF_RELEASE_DATE "2013-11-22"
+#define NKF_VERSION "2.1.4"
+#define NKF_RELEASE_DATE "2015-12-12"
#define COPY_RIGHT \
"Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
- "Copyright (C) 1996-2013, The nkf Project."
+ "Copyright (C) 1996-2015, The nkf Project."
#include "config.h"
#include "nkf.h"
@@ -774,7 +774,7 @@ nkf_enc_find(const char *name)
#ifdef DEFAULT_CODE_LOCALE
static const char*
-nkf_locale_charmap()
+nkf_locale_charmap(void)
{
#ifdef HAVE_LANGINFO_H
return nl_langinfo(CODESET);
@@ -802,7 +802,7 @@ nkf_locale_charmap()
}
static nkf_encoding*
-nkf_locale_encoding()
+nkf_locale_encoding(void)
{
nkf_encoding *enc = 0;
const char *encname = nkf_locale_charmap();
@@ -813,13 +813,13 @@ nkf_locale_encoding()
#endif /* DEFAULT_CODE_LOCALE */
static nkf_encoding*
-nkf_utf8_encoding()
+nkf_utf8_encoding(void)
{
return &nkf_encoding_table[UTF_8];
}
static nkf_encoding*
-nkf_default_encoding()
+nkf_default_encoding(void)
{
nkf_encoding *enc = 0;
#ifdef DEFAULT_CODE_LOCALE
@@ -3575,6 +3575,7 @@ static void
check_bom(FILE *f)
{
int c2;
+ input_bom_f = FALSE;
switch(c2 = (*i_getc)(f)){
case 0x00:
if((c2 = (*i_getc)(f)) == 0x00){
@@ -3833,8 +3834,8 @@ fold_conv(nkf_char c2, nkf_char c1)
f_prev = c1;
f_line = 0;
fold_state = CR;
- } else if ((f_prev == c1 && !fold_preserve_f)
- || (f_prev == LF && fold_preserve_f)
+ } else if ((f_prev == c1)
+ || (f_prev == LF)
) { /* duplicate newline */
if (f_line) {
f_line = 0;
@@ -4340,7 +4341,7 @@ mime_ungetc_buf(nkf_char c, FILE *f)
static nkf_char
mime_getc_buf(FILE *f)
{
- /* we don't keep eof of mime_input_buf, becase it contains ?= as
+ /* we don't keep eof of mime_input_buf, because it contains ?= as
a terminator. It was checked in mime_integrity. */
return ((mimebuf_f)?
(*i_mgetc_buf)(f):mime_input_buf(mime_input_state.input++));
@@ -5435,8 +5436,8 @@ mime_putc(nkf_char c)
mimeout_state.buf[mimeout_state.count++] = (char)c;
if (mimeout_state.count>MIMEOUT_BUF_LENGTH) {
eof_mime();
- for (i=0;i<mimeout_state.count;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
+ for (j=0;j<mimeout_state.count;j++) {
+ (*o_mputc)(mimeout_state.buf[j]);
base64_count++;
}
mimeout_state.count = 0;
@@ -5490,7 +5491,7 @@ typedef struct nkf_iconv_t {
size_t input_buffer_size;
char *output_buffer;
size_t output_buffer_size;
-}
+};
static nkf_iconv_t
nkf_iconv_new(char *tocode, char *fromcode)
@@ -5713,9 +5714,9 @@ module_connection(void)
x0201_f = X0201_DEFAULT;
}
- /* replace continucation module, from output side */
+ /* replace continuation module, from output side */
- /* output redicrection */
+ /* output redirection */
#ifdef CHECK_OPTION
if (noout_f || guess_f){
o_putc = no_putc;
@@ -5752,7 +5753,7 @@ module_connection(void)
i_getc = std_getc;
i_ungetc = std_ungetc;
- /* input redicrection */
+ /* input redirection */
#ifdef INPUT_OPTION
if (cap_f){
i_cgetc = i_getc; i_getc = cap_getc;
@@ -5914,7 +5915,7 @@ kanji_convert(FILE *f)
/* in case of 8th bit is on */
if (!estab_f&&!mime_decode_mode) {
/* in case of not established yet */
- /* It is still ambiguious */
+ /* It is still ambiguous */
if (h_conv(f, c2, c1)==EOF) {
LAST;
}
@@ -6898,7 +6899,7 @@ options(unsigned char *cp)
continue;
#endif
case SP:
- /* module muliple options in a string are allowed for Perl moudle */
+ /* module multiple options in a string are allowed for Perl module */
while(*cp && *cp++!='-');
continue;
default:
diff --git a/ext/nkf/nkf-utf8/utf8tbl.c b/ext/nkf/nkf-utf8/utf8tbl.c
index e493c6beb5..3821c59468 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.c
+++ b/ext/nkf/nkf-utf8/utf8tbl.c
@@ -1,5 +1,5 @@
/*
- * utf8tbl.c - Convertion Table for nkf
+ * utf8tbl.c - Conversion Table for nkf
*
*/
diff --git a/ext/nkf/nkf-utf8/utf8tbl.h b/ext/nkf/nkf-utf8/utf8tbl.h
index 96b61ed5a4..54a34271dd 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.h
+++ b/ext/nkf/nkf-utf8/utf8tbl.h
@@ -1,5 +1,5 @@
/*
- * utf8tbl.h - Header file for Convertion Table
+ * utf8tbl.h - Header file for Conversion Table
*
*/
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index 2f36866ac4..9613a925ce 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -478,7 +478,7 @@ rb_nkf_guess(VALUE obj, VALUE src)
*/
void
-Init_nkf()
+Init_nkf(void)
{
VALUE mNKF = rb_define_module("NKF");
diff --git a/ext/objspace/depend b/ext/objspace/depend
index 270bd911d3..32af521ba5 100644
--- a/ext/objspace/depend
+++ b/ext/objspace/depend
@@ -1,14 +1,66 @@
-objspace.o: $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h \
- $(hdrdir)/ruby/regex.h \
- $(top_srcdir)/regenc.h \
- $(top_srcdir)/node.h $(top_srcdir)/gc.h \
- $(hdrdir)/ruby/re.h $(top_srcdir)/node.h $(top_srcdir)/gc.h \
- $(top_srcdir)/regint.h $(top_srcdir)/internal.h
-gc_hook.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
-object_tracing.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
-objspace_dump.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h \
- $(hdrdir)/ruby/encoding.h $(hdrdir)/ruby/io.h \
- $(top_srcdir)/node.h $(top_srcdir)/vm_core.h $(top_srcdir)/gc.h
+# AUTOGENERATED DEPENDENCIES START
+object_tracing.o: $(RUBY_EXTCONF_H)
+object_tracing.o: $(arch_hdrdir)/ruby/config.h
+object_tracing.o: $(hdrdir)/ruby/debug.h
+object_tracing.o: $(hdrdir)/ruby/defines.h
+object_tracing.o: $(hdrdir)/ruby/encoding.h
+object_tracing.o: $(hdrdir)/ruby/intern.h
+object_tracing.o: $(hdrdir)/ruby/io.h
+object_tracing.o: $(hdrdir)/ruby/missing.h
+object_tracing.o: $(hdrdir)/ruby/oniguruma.h
+object_tracing.o: $(hdrdir)/ruby/ruby.h
+object_tracing.o: $(hdrdir)/ruby/st.h
+object_tracing.o: $(hdrdir)/ruby/subst.h
+object_tracing.o: $(top_srcdir)/include/ruby.h
+object_tracing.o: $(top_srcdir)/internal.h
+object_tracing.o: object_tracing.c
+object_tracing.o: objspace.h
+objspace.o: $(RUBY_EXTCONF_H)
+objspace.o: $(arch_hdrdir)/ruby/config.h
+objspace.o: $(hdrdir)/ruby/defines.h
+objspace.o: $(hdrdir)/ruby/encoding.h
+objspace.o: $(hdrdir)/ruby/intern.h
+objspace.o: $(hdrdir)/ruby/io.h
+objspace.o: $(hdrdir)/ruby/missing.h
+objspace.o: $(hdrdir)/ruby/oniguruma.h
+objspace.o: $(hdrdir)/ruby/re.h
+objspace.o: $(hdrdir)/ruby/regex.h
+objspace.o: $(hdrdir)/ruby/ruby.h
+objspace.o: $(hdrdir)/ruby/st.h
+objspace.o: $(hdrdir)/ruby/subst.h
+objspace.o: $(top_srcdir)/gc.h
+objspace.o: $(top_srcdir)/include/ruby.h
+objspace.o: $(top_srcdir)/internal.h
+objspace.o: $(top_srcdir)/node.h
+objspace.o: objspace.c
+objspace_dump.o: $(RUBY_EXTCONF_H)
+objspace_dump.o: $(arch_hdrdir)/ruby/config.h
+objspace_dump.o: $(hdrdir)/ruby/debug.h
+objspace_dump.o: $(hdrdir)/ruby/defines.h
+objspace_dump.o: $(hdrdir)/ruby/encoding.h
+objspace_dump.o: $(hdrdir)/ruby/intern.h
+objspace_dump.o: $(hdrdir)/ruby/io.h
+objspace_dump.o: $(hdrdir)/ruby/missing.h
+objspace_dump.o: $(hdrdir)/ruby/oniguruma.h
+objspace_dump.o: $(hdrdir)/ruby/ruby.h
+objspace_dump.o: $(hdrdir)/ruby/st.h
+objspace_dump.o: $(hdrdir)/ruby/subst.h
+objspace_dump.o: $(hdrdir)/ruby/thread_native.h
+objspace_dump.o: $(top_srcdir)/ccan/check_type/check_type.h
+objspace_dump.o: $(top_srcdir)/ccan/container_of/container_of.h
+objspace_dump.o: $(top_srcdir)/ccan/list/list.h
+objspace_dump.o: $(top_srcdir)/ccan/str/str.h
+objspace_dump.o: $(top_srcdir)/gc.h
+objspace_dump.o: $(top_srcdir)/include/ruby.h
+objspace_dump.o: $(top_srcdir)/internal.h
+objspace_dump.o: $(top_srcdir)/method.h
+objspace_dump.o: $(top_srcdir)/node.h
+objspace_dump.o: $(top_srcdir)/ruby_atomic.h
+objspace_dump.o: $(top_srcdir)/thread_pthread.h
+objspace_dump.o: $(top_srcdir)/vm_core.h
+objspace_dump.o: $(top_srcdir)/vm_debug.h
+objspace_dump.o: $(top_srcdir)/vm_opts.h
+objspace_dump.o: objspace.h
+objspace_dump.o: objspace_dump.c
+objspace_dump.o: {$(VPATH)}id.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/objspace/extconf.rb b/ext/objspace/extconf.rb
index 23a42c4c20..adb8ef9169 100644
--- a/ext/objspace/extconf.rb
+++ b/ext/objspace/extconf.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: false
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+$VPATH << '$(topdir)' << '$(top_srcdir)' # for id.h.
create_makefile('objspace')
diff --git a/ext/objspace/object_tracing.c b/ext/objspace/object_tracing.c
index 45b06aef8c..3a7f54427d 100644
--- a/ext/objspace/object_tracing.c
+++ b/ext/objspace/object_tracing.c
@@ -13,10 +13,9 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/debug.h"
#include "objspace.h"
-#include "internal.h"
struct traceobj_arg {
int running;
@@ -287,7 +286,10 @@ object_allocations_reporter_i(st_data_t key, st_data_t val, st_data_t ptr)
if (info->class_path) fprintf(out, "C: %s", info->class_path);
else fprintf(out, "C: %p", (void *)info->klass);
fprintf(out, "@%s:%lu", info->path ? info->path : "", info->line);
- if (!NIL_P(info->mid)) fprintf(out, " (%s)", rb_id2name(SYM2ID(info->mid)));
+ if (!NIL_P(info->mid)) {
+ VALUE m = rb_sym2str(info->mid);
+ fprintf(out, " (%s)", RSTRING_PTR(m));
+ }
fprintf(out, ")\n");
return ST_CONTINUE;
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index b1f1358c01..eff9d0c7f8 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -12,13 +12,13 @@
**********************************************************************/
-#include <ruby/ruby.h>
+#include "internal.h"
#include <ruby/st.h>
#include <ruby/io.h>
#include <ruby/re.h>
#include "node.h"
#include "gc.h"
-#include "internal.h"
+#include "symbol.h"
/*
* call-seq:
@@ -31,6 +31,9 @@
* correct.
*
* This method is only expected to work with C Ruby.
+ *
+ * From Ruby 2.2, memsize_of(obj) returns a memory size includes
+ * sizeof(RVALUE).
*/
static VALUE
@@ -54,13 +57,11 @@ total_i(void *vstart, void *vend, size_t stride, void *ptr)
if (RBASIC(v)->flags) {
switch (BUILTIN_TYPE(v)) {
case T_NONE:
+ case T_IMEMO:
case T_ICLASS:
case T_NODE:
case T_ZOMBIE:
continue;
- case T_CLASS:
- if (FL_TEST(v, FL_SINGLETON))
- continue;
default:
if (data->klass == 0 || rb_obj_is_kind_of(v, data->klass)) {
data->total += rb_obj_memsize_of(v);
@@ -122,6 +123,26 @@ set_zero_i(st_data_t key, st_data_t val, st_data_t arg)
return ST_CONTINUE;
}
+static VALUE
+setup_hash(int argc, VALUE *argv)
+{
+ VALUE hash;
+
+ if (rb_scan_args(argc, argv, "01", &hash) == 1) {
+ if (!RB_TYPE_P(hash, T_HASH))
+ rb_raise(rb_eTypeError, "non-hash given");
+ }
+
+ if (hash == Qnil) {
+ hash = rb_hash_new();
+ }
+ else if (!RHASH_EMPTY_P(hash)) {
+ st_foreach(RHASH_TBL(hash), set_zero_i, hash);
+ }
+
+ return hash;
+}
+
static int
cos_i(void *vstart, void *vend, size_t stride, void *data)
{
@@ -164,6 +185,7 @@ type2sym(enum ruby_value_type i)
CASE_TYPE(T_SYMBOL);
CASE_TYPE(T_FIXNUM);
CASE_TYPE(T_UNDEF);
+ CASE_TYPE(T_IMEMO);
CASE_TYPE(T_NODE);
CASE_TYPE(T_ICLASS);
CASE_TYPE(T_ZOMBIE);
@@ -202,12 +224,7 @@ count_objects_size(int argc, VALUE *argv, VALUE os)
size_t counts[T_MASK+1];
size_t total = 0;
enum ruby_value_type i;
- VALUE hash;
-
- if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (!RB_TYPE_P(hash, T_HASH))
- rb_raise(rb_eTypeError, "non-hash given");
- }
+ VALUE hash = setup_hash(argc, argv);
for (i = 0; i <= T_MASK; i++) {
counts[i] = 0;
@@ -233,6 +250,84 @@ count_objects_size(int argc, VALUE *argv, VALUE os)
return hash;
}
+struct dynamic_symbol_counts {
+ size_t mortal;
+ size_t immortal;
+};
+
+static int
+cs_i(void *vstart, void *vend, size_t stride, void *n)
+{
+ struct dynamic_symbol_counts *counts = (struct dynamic_symbol_counts *)n;
+ VALUE v = (VALUE)vstart;
+
+ for (; v != (VALUE)vend; v += stride) {
+ if (RBASIC(v)->flags && BUILTIN_TYPE(v) == T_SYMBOL) {
+ ID id = RSYMBOL(v)->id;
+ if ((id & ~ID_SCOPE_MASK) == 0) {
+ counts->mortal++;
+ }
+ else {
+ counts->immortal++;
+ }
+ }
+ }
+
+ return 0;
+}
+
+size_t rb_sym_immortal_count(void);
+
+/*
+ * call-seq:
+ * ObjectSpace.count_symbols([result_hash]) -> hash
+ *
+ * Counts symbols for each Symbol type.
+ *
+ * This method is only for MRI developers interested in performance and memory
+ * usage of Ruby programs.
+ *
+ * If the optional argument, result_hash, is given, it is overwritten and
+ * returned. This is intended to avoid probe effect.
+ *
+ * Note:
+ * The contents of the returned hash is implementation defined.
+ * It may be changed in future.
+ *
+ * This method is only expected to work with C Ruby.
+ *
+ * On this version of MRI, they have 3 types of Symbols (and 1 total counts).
+ *
+ * * mortal_dynamic_symbol: GC target symbols (collected by GC)
+ * * immortal_dynamic_symbol: Immortal symbols promoted from dynamic symbols (do not collected by GC)
+ * * immortal_static_symbol: Immortal symbols (do not collected by GC)
+ * * immortal_symbol: total immortal symbols (immortal_dynamic_symbol+immortal_static_symbol)
+ */
+
+static VALUE
+count_symbols(int argc, VALUE *argv, VALUE os)
+{
+ struct dynamic_symbol_counts dynamic_counts = {0, 0};
+ VALUE hash = setup_hash(argc, argv);
+
+ size_t immortal_symbols = rb_sym_immortal_count();
+ rb_objspace_each_objects(cs_i, &dynamic_counts);
+
+ if (hash == Qnil) {
+ hash = rb_hash_new();
+ }
+ else if (!RHASH_EMPTY_P(hash)) {
+ st_foreach(RHASH_TBL(hash), set_zero_i, hash);
+ }
+
+ rb_hash_aset(hash, ID2SYM(rb_intern("mortal_dynamic_symbol")), SIZET2NUM(dynamic_counts.mortal));
+ rb_hash_aset(hash, ID2SYM(rb_intern("immortal_dynamic_symbol")), SIZET2NUM(dynamic_counts.immortal));
+ rb_hash_aset(hash, ID2SYM(rb_intern("immortal_static_symbol")), SIZET2NUM(immortal_symbols - dynamic_counts.immortal));
+ rb_hash_aset(hash, ID2SYM(rb_intern("immortal_symbol")), SIZET2NUM(immortal_symbols));
+
+ return hash;
+}
+
static int
cn_i(void *vstart, void *vend, size_t stride, void *n)
{
@@ -277,12 +372,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
{
size_t nodes[NODE_LAST+1];
size_t i;
- VALUE hash;
-
- if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (!RB_TYPE_P(hash, T_HASH))
- rb_raise(rb_eTypeError, "non-hash given");
- }
+ VALUE hash = setup_hash(argc, argv);
for (i = 0; i <= NODE_LAST; i++) {
nodes[i] = 0;
@@ -388,7 +478,6 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_SCLASS);
COUNT_NODE(NODE_COLON2);
COUNT_NODE(NODE_COLON3);
- COUNT_NODE(NODE_CREF);
COUNT_NODE(NODE_DOT2);
COUNT_NODE(NODE_DOT3);
COUNT_NODE(NODE_FLIP2);
@@ -402,8 +491,6 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_POSTEXE);
COUNT_NODE(NODE_ALLOCA);
COUNT_NODE(NODE_BMETHOD);
- COUNT_NODE(NODE_MEMO);
- COUNT_NODE(NODE_IFUNC);
COUNT_NODE(NODE_DSYM);
COUNT_NODE(NODE_ATTRASGN);
COUNT_NODE(NODE_PRELUDE);
@@ -484,21 +571,85 @@ cto_i(void *vstart, void *vend, size_t stride, void *data)
static VALUE
count_tdata_objects(int argc, VALUE *argv, VALUE self)
{
- VALUE hash;
+ VALUE hash = setup_hash(argc, argv);
+ rb_objspace_each_objects(cto_i, (void *)hash);
+ return hash;
+}
- if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (!RB_TYPE_P(hash, T_HASH))
- rb_raise(rb_eTypeError, "non-hash given");
- }
+static ID imemo_type_ids[imemo_mask+1];
- if (hash == Qnil) {
- hash = rb_hash_new();
+static int
+count_imemo_objects_i(void *vstart, void *vend, size_t stride, void *data)
+{
+ VALUE hash = (VALUE)data;
+ VALUE v = (VALUE)vstart;
+
+ for (; v != (VALUE)vend; v += stride) {
+ if (RBASIC(v)->flags && BUILTIN_TYPE(v) == T_IMEMO) {
+ VALUE counter;
+ VALUE key = ID2SYM(imemo_type_ids[imemo_type(v)]);
+
+ counter = rb_hash_aref(hash, key);
+
+ if (NIL_P(counter)) {
+ counter = INT2FIX(1);
+ }
+ else {
+ counter = INT2FIX(FIX2INT(counter) + 1);
+ }
+
+ rb_hash_aset(hash, key, counter);
+ }
}
- else if (!RHASH_EMPTY_P(hash)) {
- st_foreach(RHASH_TBL(hash), set_zero_i, hash);
+
+ return 0;
+}
+
+/*
+ * call-seq:
+ * ObjectSpace.count_imemo_objects([result_hash]) -> hash
+ *
+ * Counts objects for each +T_IMEMO+ type.
+ *
+ * This method is only for MRI developers interested in performance and memory
+ * usage of Ruby programs.
+ *
+ * It returns a hash as:
+ *
+ * {:imemo_ifunc=>8,
+ * :imemo_svar=>7,
+ * :imemo_cref=>509,
+ * :imemo_memo=>1,
+ * :imemo_throw_data=>1}
+ *
+ * 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 specific and may change
+ * in the future.
+ *
+ * In this version, keys are symbol objects.
+ *
+ * This method is only expected to work with C Ruby.
+ */
+
+static VALUE
+count_imemo_objects(int argc, VALUE *argv, VALUE self)
+{
+ VALUE hash = setup_hash(argc, argv);
+
+ if (imemo_type_ids[0] == 0) {
+ imemo_type_ids[0] = rb_intern("imemo_none");
+ imemo_type_ids[1] = rb_intern("imemo_cref");
+ imemo_type_ids[2] = rb_intern("imemo_svar");
+ imemo_type_ids[3] = rb_intern("imemo_throw_data");
+ imemo_type_ids[4] = rb_intern("imemo_ifunc");
+ imemo_type_ids[5] = rb_intern("imemo_memo");
+ imemo_type_ids[6] = rb_intern("imemo_ment");
+ imemo_type_ids[7] = rb_intern("imemo_iseq");
}
- rb_objspace_each_objects(cto_i, (void *)hash);
+ rb_objspace_each_objects(count_imemo_objects_i, (void *)hash);
return hash;
}
@@ -519,7 +670,7 @@ iow_size(const void *ptr)
static const rb_data_type_t iow_data_type = {
"ObjectSpace::InternalObjectWrapper",
{iow_mark, 0, iow_size,},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE rb_mInternalObjectWrapper;
@@ -527,7 +678,7 @@ static VALUE rb_mInternalObjectWrapper;
static VALUE
iow_newobj(VALUE obj)
{
- return rb_data_typed_object_alloc(rb_mInternalObjectWrapper, (void *)obj, &iow_data_type);
+ return TypedData_Wrap_Struct(rb_mInternalObjectWrapper, &iow_data_type, (void *)obj);
}
/* Returns the type of the internal object. */
@@ -545,7 +696,7 @@ 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)));
+ return rb_sprintf("#<InternalObject:%p %"PRIsVALUE">", (void *)obj, rb_sym2str(type));
}
/* Returns the Object#object_id of the internal object. */
@@ -672,8 +823,7 @@ reachable_object_from_root_i(const char *category, VALUE obj, void *ptr)
else {
data->last_category = category;
category_str = data->last_category_str = rb_str_new2(category);
- category_objects = data->last_category_objects = rb_hash_new();
- rb_funcall(category_objects, rb_intern("compare_by_identity"), 0);
+ category_objects = data->last_category_objects = rb_ident_hash_new();
if (!NIL_P(rb_hash_lookup(data->categories, category_str))) {
rb_bug("reachable_object_from_root_i: category should insert at once");
}
@@ -709,16 +859,82 @@ static VALUE
reachable_objects_from_root(VALUE self)
{
struct rofr_data data;
- VALUE hash = data.categories = rb_hash_new();
+ VALUE hash = data.categories = rb_ident_hash_new();
data.last_category = 0;
- rb_funcall(hash, rb_intern("compare_by_identity"), 0);
rb_objspace_reachable_objects_from_root(reachable_object_from_root_i, &data);
rb_hash_foreach(hash, collect_values_of_values, hash);
return hash;
}
+static VALUE
+wrap_klass_iow(VALUE klass)
+{
+ if (!RTEST(klass)) {
+ return Qnil;
+ }
+ else if (RB_TYPE_P(klass, T_ICLASS)) {
+ return iow_newobj(klass);
+ }
+ else {
+ return klass;
+ }
+}
+
+/*
+ * call-seq:
+ * ObjectSpace.internal_class_of(obj) -> Class or Module
+ *
+ * [MRI specific feature] Return internal class of obj.
+ * obj can be an instance of InternalObjectWrapper.
+ *
+ * Note that you should not use this method in your application.
+ */
+static VALUE
+objspace_internal_class_of(VALUE self, VALUE obj)
+{
+ VALUE klass;
+
+ if (rb_typeddata_is_kind_of(obj, &iow_data_type)) {
+ obj = (VALUE)DATA_PTR(obj);
+ }
+
+ klass = CLASS_OF(obj);
+ return wrap_klass_iow(klass);
+}
+
+/*
+ * call-seq:
+ * ObjectSpace.internal_super_of(cls) -> Class or Module
+ *
+ * [MRI specific feature] Return internal super class of cls (Class or Module).
+ * obj can be an instance of InternalObjectWrapper.
+ *
+ * Note that you should not use this method in your application.
+ */
+static VALUE
+objspace_internal_super_of(VALUE self, VALUE obj)
+{
+ VALUE super;
+
+ if (rb_typeddata_is_kind_of(obj, &iow_data_type)) {
+ obj = (VALUE)DATA_PTR(obj);
+ }
+
+ switch (TYPE(obj)) {
+ case T_MODULE:
+ case T_CLASS:
+ case T_ICLASS:
+ super = RCLASS_SUPER(obj);
+ break;
+ default:
+ rb_raise(rb_eArgError, "class or module is expected");
+ }
+
+ return wrap_klass_iow(super);
+}
+
void Init_object_tracing(VALUE rb_mObjSpace);
void Init_objspace_dump(VALUE rb_mObjSpace);
@@ -750,12 +966,17 @@ Init_objspace(void)
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_symbols", count_symbols, -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, "count_imemo_objects", count_imemo_objects, -1);
rb_define_module_function(rb_mObjSpace, "reachable_objects_from", reachable_objects_from, 1);
rb_define_module_function(rb_mObjSpace, "reachable_objects_from_root", reachable_objects_from_root, 0);
+ rb_define_module_function(rb_mObjSpace, "internal_class_of", objspace_internal_class_of, 1);
+ rb_define_module_function(rb_mObjSpace, "internal_super_of", objspace_internal_super_of, 1);
+
/*
* This class is used as a return value from
* ObjectSpace::reachable_objects_from.
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index 9a694d33aa..3b73b81499 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -12,15 +12,13 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/debug.h"
-#include "ruby/encoding.h"
#include "ruby/io.h"
#include "gc.h"
#include "node.h"
#include "vm_core.h"
#include "objspace.h"
-#include "internal.h"
static VALUE sym_output, sym_stdout, sym_string, sym_file;
@@ -43,7 +41,6 @@ dump_append(struct dump_config *dc, const char *format, ...)
if (dc->stream) {
vfprintf(dc->stream, format, vl);
- fflush(dc->stream);
}
else if (dc->string)
rb_str_vcatf(dc->string, format, vl);
@@ -54,8 +51,9 @@ dump_append(struct dump_config *dc, const char *format, ...)
static void
dump_append_string_value(struct dump_config *dc, VALUE obj)
{
- int i;
- char c, *value;
+ long i;
+ char c;
+ const char *value;
dump_append(dc, "\"");
for (i = 0, value = RSTRING_PTR(obj); i < RSTRING_LEN(obj); i++) {
@@ -92,6 +90,14 @@ dump_append_string_value(struct dump_config *dc, VALUE obj)
dump_append(dc, "\"");
}
+static void
+dump_append_symbol_value(struct dump_config *dc, VALUE obj)
+{
+ dump_append(dc, "{\"type\":\"SYMBOL\", \"value\":");
+ dump_append_string_value(dc, rb_sym2str(obj));
+ dump_append(dc, "}");
+}
+
static inline const char *
obj_type(VALUE obj)
{
@@ -119,6 +125,7 @@ obj_type(VALUE obj)
CASE_TYPE(SYMBOL);
CASE_TYPE(RATIONAL);
CASE_TYPE(COMPLEX);
+ CASE_TYPE(IMEMO);
CASE_TYPE(UNDEF);
CASE_TYPE(NODE);
CASE_TYPE(ZOMBIE);
@@ -128,6 +135,32 @@ obj_type(VALUE obj)
}
static void
+dump_append_special_const(struct dump_config *dc, VALUE value)
+{
+ if (value == Qtrue) {
+ dump_append(dc, "true");
+ }
+ else if (value == Qfalse) {
+ dump_append(dc, "false");
+ }
+ else if (value == Qnil) {
+ dump_append(dc, "null");
+ }
+ else if (FIXNUM_P(value)) {
+ dump_append(dc, "%ld", FIX2LONG(value));
+ }
+ else if (FLONUM_P(value)) {
+ dump_append(dc, "%#g", RFLOAT_VALUE(value));
+ }
+ else if (SYMBOL_P(value)) {
+ dump_append_symbol_value(dc, value);
+ }
+ else {
+ dump_append(dc, "{}");
+ }
+}
+
+static void
reachable_object_i(VALUE ref, void *data)
{
struct dump_config *dc = (struct dump_config *)data;
@@ -144,6 +177,19 @@ reachable_object_i(VALUE ref, void *data)
}
static void
+dump_append_string_content(struct dump_config *dc, VALUE obj)
+{
+ dump_append(dc, ", \"bytesize\":%ld", RSTRING_LEN(obj));
+ if (!STR_EMBED_P(obj) && !STR_SHARED_P(obj) && (long)rb_str_capacity(obj) != RSTRING_LEN(obj))
+ dump_append(dc, ", \"capacity\":%ld", rb_str_capacity(obj));
+
+ if (is_ascii_string(obj)) {
+ dump_append(dc, ", \"value\":");
+ dump_append_string_value(dc, obj);
+ }
+}
+
+static void
dump_object(VALUE obj, struct dump_config *dc)
{
size_t memsize;
@@ -152,6 +198,11 @@ dump_object(VALUE obj, struct dump_config *dc)
ID flags[RB_OBJ_GC_FLAGS_MAX];
size_t n, i;
+ if (SPECIAL_CONST_P(obj)) {
+ dump_append_special_const(dc, obj);
+ return;
+ }
+
dc->cur_obj = obj;
dc->cur_obj_references = 0;
dc->cur_obj_klass = BUILTIN_TYPE(obj) == T_NODE ? 0 : RBASIC_CLASS(obj);
@@ -171,27 +222,21 @@ dump_object(VALUE obj, struct dump_config *dc)
dump_append(dc, ", \"node_type\":\"%s\"", ruby_node_name(nd_type(obj)));
break;
+ case T_SYMBOL:
+ dump_append_string_content(dc, rb_sym2str(obj));
+ break;
+
case T_STRING:
if (STR_EMBED_P(obj))
dump_append(dc, ", \"embedded\":true");
- if (STR_ASSOC_P(obj))
- dump_append(dc, ", \"associated\":true");
if (is_broken_string(obj))
dump_append(dc, ", \"broken\":true");
if (FL_TEST(obj, RSTRING_FSTR))
dump_append(dc, ", \"fstring\":true");
if (STR_SHARED_P(obj))
dump_append(dc, ", \"shared\":true");
- else {
- dump_append(dc, ", \"bytesize\":%ld", RSTRING_LEN(obj));
- if (!STR_EMBED_P(obj) && !STR_NOCAPA_P(obj) && (long)rb_str_capacity(obj) != RSTRING_LEN(obj))
- dump_append(dc, ", \"capacity\":%ld", rb_str_capacity(obj));
-
- if (is_ascii_string(obj)) {
- dump_append(dc, ", \"value\":");
- dump_append_string_value(dc, obj);
- }
- }
+ else
+ dump_append_string_content(dc, obj);
if (!ENCODING_IS_ASCII8BIT(obj))
dump_append(dc, ", \"encoding\":\"%s\"", rb_enc_name(rb_enc_from_index(ENCODING_GET(obj))));
@@ -232,7 +277,8 @@ dump_object(VALUE obj, struct dump_config *dc)
case T_FILE:
fptr = RFILE(obj)->fptr;
- dump_append(dc, ", \"fd\":%d", fptr->fd);
+ if (fptr)
+ dump_append(dc, ", \"fd\":%d", fptr->fd);
break;
case T_ZOMBIE:
@@ -246,8 +292,10 @@ dump_object(VALUE obj, struct dump_config *dc)
if ((ainfo = objspace_lookup_allocation_info(obj))) {
dump_append(dc, ", \"file\":\"%s\", \"line\":%lu", ainfo->path, ainfo->line);
- if (RTEST(ainfo->mid))
- dump_append(dc, ", \"method\":\"%s\"", rb_id2name(SYM2ID(ainfo->mid)));
+ if (RTEST(ainfo->mid)) {
+ VALUE m = rb_sym2str(ainfo->mid);
+ dump_append(dc, ", \"method\":\"%s\"", RSTRING_PTR(m));
+ }
dump_append(dc, ", \"generation\":%"PRIuSIZE, ainfo->generation);
}
diff --git a/ext/openssl/depend b/ext/openssl/depend
index 7991159f2e..21ba20abde 100644
--- a/ext/openssl/depend
+++ b/ext/openssl/depend
@@ -1,6 +1,1091 @@
-$(OBJS): $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h \
- $(hdrdir)/ruby/thread.h
-ossl.o: $(top_srcdir)/thread_native.h $(top_srcdir)/thread_$(THREAD_MODEL).h
+# AUTOGENERATED DEPENDENCIES START
+openssl_missing.o: $(RUBY_EXTCONF_H)
+openssl_missing.o: openssl_missing.c
+openssl_missing.o: openssl_missing.h
+ossl.o: $(RUBY_EXTCONF_H)
+ossl.o: $(arch_hdrdir)/ruby/config.h
+ossl.o: $(hdrdir)/ruby/defines.h
+ossl.o: $(hdrdir)/ruby/encoding.h
+ossl.o: $(hdrdir)/ruby/intern.h
+ossl.o: $(hdrdir)/ruby/io.h
+ossl.o: $(hdrdir)/ruby/missing.h
+ossl.o: $(hdrdir)/ruby/oniguruma.h
+ossl.o: $(hdrdir)/ruby/ruby.h
+ossl.o: $(hdrdir)/ruby/st.h
+ossl.o: $(hdrdir)/ruby/subst.h
+ossl.o: $(hdrdir)/ruby/thread.h
+ossl.o: $(hdrdir)/ruby/thread_native.h
+ossl.o: $(top_srcdir)/include/ruby.h
+ossl.o: openssl_missing.h
+ossl.o: ossl.c
+ossl.o: ossl.h
+ossl.o: ossl_asn1.h
+ossl.o: ossl_bio.h
+ossl.o: ossl_bn.h
+ossl.o: ossl_cipher.h
+ossl.o: ossl_config.h
+ossl.o: ossl_digest.h
+ossl.o: ossl_engine.h
+ossl.o: ossl_hmac.h
+ossl.o: ossl_ns_spki.h
+ossl.o: ossl_ocsp.h
+ossl.o: ossl_pkcs12.h
+ossl.o: ossl_pkcs5.h
+ossl.o: ossl_pkcs7.h
+ossl.o: ossl_pkey.h
+ossl.o: ossl_rand.h
+ossl.o: ossl_ssl.h
+ossl.o: ossl_version.h
+ossl.o: ossl_x509.h
+ossl.o: ruby_missing.h
+ossl_asn1.o: $(RUBY_EXTCONF_H)
+ossl_asn1.o: $(arch_hdrdir)/ruby/config.h
+ossl_asn1.o: $(hdrdir)/ruby/defines.h
+ossl_asn1.o: $(hdrdir)/ruby/encoding.h
+ossl_asn1.o: $(hdrdir)/ruby/intern.h
+ossl_asn1.o: $(hdrdir)/ruby/io.h
+ossl_asn1.o: $(hdrdir)/ruby/missing.h
+ossl_asn1.o: $(hdrdir)/ruby/oniguruma.h
+ossl_asn1.o: $(hdrdir)/ruby/ruby.h
+ossl_asn1.o: $(hdrdir)/ruby/st.h
+ossl_asn1.o: $(hdrdir)/ruby/subst.h
+ossl_asn1.o: $(hdrdir)/ruby/thread.h
+ossl_asn1.o: $(top_srcdir)/include/ruby.h
+ossl_asn1.o: openssl_missing.h
+ossl_asn1.o: ossl.h
+ossl_asn1.o: ossl_asn1.c
+ossl_asn1.o: ossl_asn1.h
+ossl_asn1.o: ossl_bio.h
+ossl_asn1.o: ossl_bn.h
+ossl_asn1.o: ossl_cipher.h
+ossl_asn1.o: ossl_config.h
+ossl_asn1.o: ossl_digest.h
+ossl_asn1.o: ossl_engine.h
+ossl_asn1.o: ossl_hmac.h
+ossl_asn1.o: ossl_ns_spki.h
+ossl_asn1.o: ossl_ocsp.h
+ossl_asn1.o: ossl_pkcs12.h
+ossl_asn1.o: ossl_pkcs5.h
+ossl_asn1.o: ossl_pkcs7.h
+ossl_asn1.o: ossl_pkey.h
+ossl_asn1.o: ossl_rand.h
+ossl_asn1.o: ossl_ssl.h
+ossl_asn1.o: ossl_version.h
+ossl_asn1.o: ossl_x509.h
+ossl_asn1.o: ruby_missing.h
+ossl_bio.o: $(RUBY_EXTCONF_H)
+ossl_bio.o: $(arch_hdrdir)/ruby/config.h
+ossl_bio.o: $(hdrdir)/ruby/defines.h
+ossl_bio.o: $(hdrdir)/ruby/encoding.h
+ossl_bio.o: $(hdrdir)/ruby/intern.h
+ossl_bio.o: $(hdrdir)/ruby/io.h
+ossl_bio.o: $(hdrdir)/ruby/missing.h
+ossl_bio.o: $(hdrdir)/ruby/oniguruma.h
+ossl_bio.o: $(hdrdir)/ruby/ruby.h
+ossl_bio.o: $(hdrdir)/ruby/st.h
+ossl_bio.o: $(hdrdir)/ruby/subst.h
+ossl_bio.o: $(hdrdir)/ruby/thread.h
+ossl_bio.o: $(top_srcdir)/include/ruby.h
+ossl_bio.o: openssl_missing.h
+ossl_bio.o: ossl.h
+ossl_bio.o: ossl_asn1.h
+ossl_bio.o: ossl_bio.c
+ossl_bio.o: ossl_bio.h
+ossl_bio.o: ossl_bn.h
+ossl_bio.o: ossl_cipher.h
+ossl_bio.o: ossl_config.h
+ossl_bio.o: ossl_digest.h
+ossl_bio.o: ossl_engine.h
+ossl_bio.o: ossl_hmac.h
+ossl_bio.o: ossl_ns_spki.h
+ossl_bio.o: ossl_ocsp.h
+ossl_bio.o: ossl_pkcs12.h
+ossl_bio.o: ossl_pkcs5.h
+ossl_bio.o: ossl_pkcs7.h
+ossl_bio.o: ossl_pkey.h
+ossl_bio.o: ossl_rand.h
+ossl_bio.o: ossl_ssl.h
+ossl_bio.o: ossl_version.h
+ossl_bio.o: ossl_x509.h
+ossl_bio.o: ruby_missing.h
+ossl_bn.o: $(RUBY_EXTCONF_H)
+ossl_bn.o: $(arch_hdrdir)/ruby/config.h
+ossl_bn.o: $(hdrdir)/ruby/defines.h
+ossl_bn.o: $(hdrdir)/ruby/encoding.h
+ossl_bn.o: $(hdrdir)/ruby/intern.h
+ossl_bn.o: $(hdrdir)/ruby/io.h
+ossl_bn.o: $(hdrdir)/ruby/missing.h
+ossl_bn.o: $(hdrdir)/ruby/oniguruma.h
+ossl_bn.o: $(hdrdir)/ruby/ruby.h
+ossl_bn.o: $(hdrdir)/ruby/st.h
+ossl_bn.o: $(hdrdir)/ruby/subst.h
+ossl_bn.o: $(hdrdir)/ruby/thread.h
+ossl_bn.o: $(top_srcdir)/include/ruby.h
+ossl_bn.o: openssl_missing.h
+ossl_bn.o: ossl.h
+ossl_bn.o: ossl_asn1.h
+ossl_bn.o: ossl_bio.h
+ossl_bn.o: ossl_bn.c
+ossl_bn.o: ossl_bn.h
+ossl_bn.o: ossl_cipher.h
+ossl_bn.o: ossl_config.h
+ossl_bn.o: ossl_digest.h
+ossl_bn.o: ossl_engine.h
+ossl_bn.o: ossl_hmac.h
+ossl_bn.o: ossl_ns_spki.h
+ossl_bn.o: ossl_ocsp.h
+ossl_bn.o: ossl_pkcs12.h
+ossl_bn.o: ossl_pkcs5.h
+ossl_bn.o: ossl_pkcs7.h
+ossl_bn.o: ossl_pkey.h
+ossl_bn.o: ossl_rand.h
+ossl_bn.o: ossl_ssl.h
+ossl_bn.o: ossl_version.h
+ossl_bn.o: ossl_x509.h
+ossl_bn.o: ruby_missing.h
+ossl_cipher.o: $(RUBY_EXTCONF_H)
+ossl_cipher.o: $(arch_hdrdir)/ruby/config.h
+ossl_cipher.o: $(hdrdir)/ruby/defines.h
+ossl_cipher.o: $(hdrdir)/ruby/encoding.h
+ossl_cipher.o: $(hdrdir)/ruby/intern.h
+ossl_cipher.o: $(hdrdir)/ruby/io.h
+ossl_cipher.o: $(hdrdir)/ruby/missing.h
+ossl_cipher.o: $(hdrdir)/ruby/oniguruma.h
+ossl_cipher.o: $(hdrdir)/ruby/ruby.h
+ossl_cipher.o: $(hdrdir)/ruby/st.h
+ossl_cipher.o: $(hdrdir)/ruby/subst.h
+ossl_cipher.o: $(hdrdir)/ruby/thread.h
+ossl_cipher.o: $(top_srcdir)/include/ruby.h
+ossl_cipher.o: openssl_missing.h
+ossl_cipher.o: ossl.h
+ossl_cipher.o: ossl_asn1.h
+ossl_cipher.o: ossl_bio.h
+ossl_cipher.o: ossl_bn.h
+ossl_cipher.o: ossl_cipher.c
+ossl_cipher.o: ossl_cipher.h
+ossl_cipher.o: ossl_config.h
+ossl_cipher.o: ossl_digest.h
+ossl_cipher.o: ossl_engine.h
+ossl_cipher.o: ossl_hmac.h
+ossl_cipher.o: ossl_ns_spki.h
+ossl_cipher.o: ossl_ocsp.h
+ossl_cipher.o: ossl_pkcs12.h
+ossl_cipher.o: ossl_pkcs5.h
+ossl_cipher.o: ossl_pkcs7.h
+ossl_cipher.o: ossl_pkey.h
+ossl_cipher.o: ossl_rand.h
+ossl_cipher.o: ossl_ssl.h
+ossl_cipher.o: ossl_version.h
+ossl_cipher.o: ossl_x509.h
+ossl_cipher.o: ruby_missing.h
+ossl_config.o: $(RUBY_EXTCONF_H)
+ossl_config.o: $(arch_hdrdir)/ruby/config.h
+ossl_config.o: $(hdrdir)/ruby/defines.h
+ossl_config.o: $(hdrdir)/ruby/encoding.h
+ossl_config.o: $(hdrdir)/ruby/intern.h
+ossl_config.o: $(hdrdir)/ruby/io.h
+ossl_config.o: $(hdrdir)/ruby/missing.h
+ossl_config.o: $(hdrdir)/ruby/oniguruma.h
+ossl_config.o: $(hdrdir)/ruby/ruby.h
+ossl_config.o: $(hdrdir)/ruby/st.h
+ossl_config.o: $(hdrdir)/ruby/subst.h
+ossl_config.o: $(hdrdir)/ruby/thread.h
+ossl_config.o: $(top_srcdir)/include/ruby.h
+ossl_config.o: openssl_missing.h
+ossl_config.o: ossl.h
+ossl_config.o: ossl_asn1.h
+ossl_config.o: ossl_bio.h
+ossl_config.o: ossl_bn.h
+ossl_config.o: ossl_cipher.h
+ossl_config.o: ossl_config.c
+ossl_config.o: ossl_config.h
+ossl_config.o: ossl_digest.h
+ossl_config.o: ossl_engine.h
+ossl_config.o: ossl_hmac.h
+ossl_config.o: ossl_ns_spki.h
+ossl_config.o: ossl_ocsp.h
+ossl_config.o: ossl_pkcs12.h
+ossl_config.o: ossl_pkcs5.h
+ossl_config.o: ossl_pkcs7.h
+ossl_config.o: ossl_pkey.h
+ossl_config.o: ossl_rand.h
+ossl_config.o: ossl_ssl.h
+ossl_config.o: ossl_version.h
+ossl_config.o: ossl_x509.h
+ossl_config.o: ruby_missing.h
+ossl_digest.o: $(RUBY_EXTCONF_H)
+ossl_digest.o: $(arch_hdrdir)/ruby/config.h
+ossl_digest.o: $(hdrdir)/ruby/defines.h
+ossl_digest.o: $(hdrdir)/ruby/encoding.h
+ossl_digest.o: $(hdrdir)/ruby/intern.h
+ossl_digest.o: $(hdrdir)/ruby/io.h
+ossl_digest.o: $(hdrdir)/ruby/missing.h
+ossl_digest.o: $(hdrdir)/ruby/oniguruma.h
+ossl_digest.o: $(hdrdir)/ruby/ruby.h
+ossl_digest.o: $(hdrdir)/ruby/st.h
+ossl_digest.o: $(hdrdir)/ruby/subst.h
+ossl_digest.o: $(hdrdir)/ruby/thread.h
+ossl_digest.o: $(top_srcdir)/include/ruby.h
+ossl_digest.o: openssl_missing.h
+ossl_digest.o: ossl.h
+ossl_digest.o: ossl_asn1.h
+ossl_digest.o: ossl_bio.h
+ossl_digest.o: ossl_bn.h
+ossl_digest.o: ossl_cipher.h
+ossl_digest.o: ossl_config.h
+ossl_digest.o: ossl_digest.c
+ossl_digest.o: ossl_digest.h
+ossl_digest.o: ossl_engine.h
+ossl_digest.o: ossl_hmac.h
+ossl_digest.o: ossl_ns_spki.h
+ossl_digest.o: ossl_ocsp.h
+ossl_digest.o: ossl_pkcs12.h
+ossl_digest.o: ossl_pkcs5.h
+ossl_digest.o: ossl_pkcs7.h
+ossl_digest.o: ossl_pkey.h
+ossl_digest.o: ossl_rand.h
+ossl_digest.o: ossl_ssl.h
+ossl_digest.o: ossl_version.h
+ossl_digest.o: ossl_x509.h
+ossl_digest.o: ruby_missing.h
+ossl_engine.o: $(RUBY_EXTCONF_H)
+ossl_engine.o: $(arch_hdrdir)/ruby/config.h
+ossl_engine.o: $(hdrdir)/ruby/defines.h
+ossl_engine.o: $(hdrdir)/ruby/encoding.h
+ossl_engine.o: $(hdrdir)/ruby/intern.h
+ossl_engine.o: $(hdrdir)/ruby/io.h
+ossl_engine.o: $(hdrdir)/ruby/missing.h
+ossl_engine.o: $(hdrdir)/ruby/oniguruma.h
+ossl_engine.o: $(hdrdir)/ruby/ruby.h
+ossl_engine.o: $(hdrdir)/ruby/st.h
+ossl_engine.o: $(hdrdir)/ruby/subst.h
+ossl_engine.o: $(hdrdir)/ruby/thread.h
+ossl_engine.o: $(top_srcdir)/include/ruby.h
+ossl_engine.o: openssl_missing.h
+ossl_engine.o: ossl.h
+ossl_engine.o: ossl_asn1.h
+ossl_engine.o: ossl_bio.h
+ossl_engine.o: ossl_bn.h
+ossl_engine.o: ossl_cipher.h
+ossl_engine.o: ossl_config.h
+ossl_engine.o: ossl_digest.h
+ossl_engine.o: ossl_engine.c
+ossl_engine.o: ossl_engine.h
+ossl_engine.o: ossl_hmac.h
+ossl_engine.o: ossl_ns_spki.h
+ossl_engine.o: ossl_ocsp.h
+ossl_engine.o: ossl_pkcs12.h
+ossl_engine.o: ossl_pkcs5.h
+ossl_engine.o: ossl_pkcs7.h
+ossl_engine.o: ossl_pkey.h
+ossl_engine.o: ossl_rand.h
+ossl_engine.o: ossl_ssl.h
+ossl_engine.o: ossl_version.h
+ossl_engine.o: ossl_x509.h
+ossl_engine.o: ruby_missing.h
+ossl_hmac.o: $(RUBY_EXTCONF_H)
+ossl_hmac.o: $(arch_hdrdir)/ruby/config.h
+ossl_hmac.o: $(hdrdir)/ruby/defines.h
+ossl_hmac.o: $(hdrdir)/ruby/encoding.h
+ossl_hmac.o: $(hdrdir)/ruby/intern.h
+ossl_hmac.o: $(hdrdir)/ruby/io.h
+ossl_hmac.o: $(hdrdir)/ruby/missing.h
+ossl_hmac.o: $(hdrdir)/ruby/oniguruma.h
+ossl_hmac.o: $(hdrdir)/ruby/ruby.h
+ossl_hmac.o: $(hdrdir)/ruby/st.h
+ossl_hmac.o: $(hdrdir)/ruby/subst.h
+ossl_hmac.o: $(hdrdir)/ruby/thread.h
+ossl_hmac.o: $(top_srcdir)/include/ruby.h
+ossl_hmac.o: openssl_missing.h
+ossl_hmac.o: ossl.h
+ossl_hmac.o: ossl_asn1.h
+ossl_hmac.o: ossl_bio.h
+ossl_hmac.o: ossl_bn.h
+ossl_hmac.o: ossl_cipher.h
+ossl_hmac.o: ossl_config.h
+ossl_hmac.o: ossl_digest.h
+ossl_hmac.o: ossl_engine.h
+ossl_hmac.o: ossl_hmac.c
+ossl_hmac.o: ossl_hmac.h
+ossl_hmac.o: ossl_ns_spki.h
+ossl_hmac.o: ossl_ocsp.h
+ossl_hmac.o: ossl_pkcs12.h
+ossl_hmac.o: ossl_pkcs5.h
+ossl_hmac.o: ossl_pkcs7.h
+ossl_hmac.o: ossl_pkey.h
+ossl_hmac.o: ossl_rand.h
+ossl_hmac.o: ossl_ssl.h
+ossl_hmac.o: ossl_version.h
+ossl_hmac.o: ossl_x509.h
+ossl_hmac.o: ruby_missing.h
+ossl_ns_spki.o: $(RUBY_EXTCONF_H)
+ossl_ns_spki.o: $(arch_hdrdir)/ruby/config.h
+ossl_ns_spki.o: $(hdrdir)/ruby/defines.h
+ossl_ns_spki.o: $(hdrdir)/ruby/encoding.h
+ossl_ns_spki.o: $(hdrdir)/ruby/intern.h
+ossl_ns_spki.o: $(hdrdir)/ruby/io.h
+ossl_ns_spki.o: $(hdrdir)/ruby/missing.h
+ossl_ns_spki.o: $(hdrdir)/ruby/oniguruma.h
+ossl_ns_spki.o: $(hdrdir)/ruby/ruby.h
+ossl_ns_spki.o: $(hdrdir)/ruby/st.h
+ossl_ns_spki.o: $(hdrdir)/ruby/subst.h
+ossl_ns_spki.o: $(hdrdir)/ruby/thread.h
+ossl_ns_spki.o: $(top_srcdir)/include/ruby.h
+ossl_ns_spki.o: openssl_missing.h
+ossl_ns_spki.o: ossl.h
+ossl_ns_spki.o: ossl_asn1.h
+ossl_ns_spki.o: ossl_bio.h
+ossl_ns_spki.o: ossl_bn.h
+ossl_ns_spki.o: ossl_cipher.h
+ossl_ns_spki.o: ossl_config.h
+ossl_ns_spki.o: ossl_digest.h
+ossl_ns_spki.o: ossl_engine.h
+ossl_ns_spki.o: ossl_hmac.h
+ossl_ns_spki.o: ossl_ns_spki.c
+ossl_ns_spki.o: ossl_ns_spki.h
+ossl_ns_spki.o: ossl_ocsp.h
+ossl_ns_spki.o: ossl_pkcs12.h
+ossl_ns_spki.o: ossl_pkcs5.h
+ossl_ns_spki.o: ossl_pkcs7.h
+ossl_ns_spki.o: ossl_pkey.h
+ossl_ns_spki.o: ossl_rand.h
+ossl_ns_spki.o: ossl_ssl.h
+ossl_ns_spki.o: ossl_version.h
+ossl_ns_spki.o: ossl_x509.h
+ossl_ns_spki.o: ruby_missing.h
+ossl_ocsp.o: $(RUBY_EXTCONF_H)
+ossl_ocsp.o: $(arch_hdrdir)/ruby/config.h
+ossl_ocsp.o: $(hdrdir)/ruby/defines.h
+ossl_ocsp.o: $(hdrdir)/ruby/encoding.h
+ossl_ocsp.o: $(hdrdir)/ruby/intern.h
+ossl_ocsp.o: $(hdrdir)/ruby/io.h
+ossl_ocsp.o: $(hdrdir)/ruby/missing.h
+ossl_ocsp.o: $(hdrdir)/ruby/oniguruma.h
+ossl_ocsp.o: $(hdrdir)/ruby/ruby.h
+ossl_ocsp.o: $(hdrdir)/ruby/st.h
+ossl_ocsp.o: $(hdrdir)/ruby/subst.h
+ossl_ocsp.o: $(hdrdir)/ruby/thread.h
+ossl_ocsp.o: $(top_srcdir)/include/ruby.h
+ossl_ocsp.o: openssl_missing.h
+ossl_ocsp.o: ossl.h
+ossl_ocsp.o: ossl_asn1.h
+ossl_ocsp.o: ossl_bio.h
+ossl_ocsp.o: ossl_bn.h
+ossl_ocsp.o: ossl_cipher.h
+ossl_ocsp.o: ossl_config.h
+ossl_ocsp.o: ossl_digest.h
+ossl_ocsp.o: ossl_engine.h
+ossl_ocsp.o: ossl_hmac.h
+ossl_ocsp.o: ossl_ns_spki.h
+ossl_ocsp.o: ossl_ocsp.c
+ossl_ocsp.o: ossl_ocsp.h
+ossl_ocsp.o: ossl_pkcs12.h
+ossl_ocsp.o: ossl_pkcs5.h
+ossl_ocsp.o: ossl_pkcs7.h
+ossl_ocsp.o: ossl_pkey.h
+ossl_ocsp.o: ossl_rand.h
+ossl_ocsp.o: ossl_ssl.h
+ossl_ocsp.o: ossl_version.h
+ossl_ocsp.o: ossl_x509.h
+ossl_ocsp.o: ruby_missing.h
+ossl_pkcs12.o: $(RUBY_EXTCONF_H)
+ossl_pkcs12.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkcs12.o: $(hdrdir)/ruby/defines.h
+ossl_pkcs12.o: $(hdrdir)/ruby/encoding.h
+ossl_pkcs12.o: $(hdrdir)/ruby/intern.h
+ossl_pkcs12.o: $(hdrdir)/ruby/io.h
+ossl_pkcs12.o: $(hdrdir)/ruby/missing.h
+ossl_pkcs12.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkcs12.o: $(hdrdir)/ruby/ruby.h
+ossl_pkcs12.o: $(hdrdir)/ruby/st.h
+ossl_pkcs12.o: $(hdrdir)/ruby/subst.h
+ossl_pkcs12.o: $(hdrdir)/ruby/thread.h
+ossl_pkcs12.o: $(top_srcdir)/include/ruby.h
+ossl_pkcs12.o: openssl_missing.h
+ossl_pkcs12.o: ossl.h
+ossl_pkcs12.o: ossl_asn1.h
+ossl_pkcs12.o: ossl_bio.h
+ossl_pkcs12.o: ossl_bn.h
+ossl_pkcs12.o: ossl_cipher.h
+ossl_pkcs12.o: ossl_config.h
+ossl_pkcs12.o: ossl_digest.h
+ossl_pkcs12.o: ossl_engine.h
+ossl_pkcs12.o: ossl_hmac.h
+ossl_pkcs12.o: ossl_ns_spki.h
+ossl_pkcs12.o: ossl_ocsp.h
+ossl_pkcs12.o: ossl_pkcs12.c
+ossl_pkcs12.o: ossl_pkcs12.h
+ossl_pkcs12.o: ossl_pkcs5.h
+ossl_pkcs12.o: ossl_pkcs7.h
+ossl_pkcs12.o: ossl_pkey.h
+ossl_pkcs12.o: ossl_rand.h
+ossl_pkcs12.o: ossl_ssl.h
+ossl_pkcs12.o: ossl_version.h
+ossl_pkcs12.o: ossl_x509.h
+ossl_pkcs12.o: ruby_missing.h
+ossl_pkcs5.o: $(RUBY_EXTCONF_H)
+ossl_pkcs5.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkcs5.o: $(hdrdir)/ruby/defines.h
+ossl_pkcs5.o: $(hdrdir)/ruby/encoding.h
+ossl_pkcs5.o: $(hdrdir)/ruby/intern.h
+ossl_pkcs5.o: $(hdrdir)/ruby/io.h
+ossl_pkcs5.o: $(hdrdir)/ruby/missing.h
+ossl_pkcs5.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkcs5.o: $(hdrdir)/ruby/ruby.h
+ossl_pkcs5.o: $(hdrdir)/ruby/st.h
+ossl_pkcs5.o: $(hdrdir)/ruby/subst.h
+ossl_pkcs5.o: $(hdrdir)/ruby/thread.h
+ossl_pkcs5.o: $(top_srcdir)/include/ruby.h
+ossl_pkcs5.o: openssl_missing.h
+ossl_pkcs5.o: ossl.h
+ossl_pkcs5.o: ossl_asn1.h
+ossl_pkcs5.o: ossl_bio.h
+ossl_pkcs5.o: ossl_bn.h
+ossl_pkcs5.o: ossl_cipher.h
+ossl_pkcs5.o: ossl_config.h
+ossl_pkcs5.o: ossl_digest.h
+ossl_pkcs5.o: ossl_engine.h
+ossl_pkcs5.o: ossl_hmac.h
+ossl_pkcs5.o: ossl_ns_spki.h
+ossl_pkcs5.o: ossl_ocsp.h
+ossl_pkcs5.o: ossl_pkcs12.h
+ossl_pkcs5.o: ossl_pkcs5.c
+ossl_pkcs5.o: ossl_pkcs5.h
+ossl_pkcs5.o: ossl_pkcs7.h
+ossl_pkcs5.o: ossl_pkey.h
+ossl_pkcs5.o: ossl_rand.h
+ossl_pkcs5.o: ossl_ssl.h
+ossl_pkcs5.o: ossl_version.h
+ossl_pkcs5.o: ossl_x509.h
+ossl_pkcs5.o: ruby_missing.h
+ossl_pkcs7.o: $(RUBY_EXTCONF_H)
+ossl_pkcs7.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkcs7.o: $(hdrdir)/ruby/defines.h
+ossl_pkcs7.o: $(hdrdir)/ruby/encoding.h
+ossl_pkcs7.o: $(hdrdir)/ruby/intern.h
+ossl_pkcs7.o: $(hdrdir)/ruby/io.h
+ossl_pkcs7.o: $(hdrdir)/ruby/missing.h
+ossl_pkcs7.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkcs7.o: $(hdrdir)/ruby/ruby.h
+ossl_pkcs7.o: $(hdrdir)/ruby/st.h
+ossl_pkcs7.o: $(hdrdir)/ruby/subst.h
+ossl_pkcs7.o: $(hdrdir)/ruby/thread.h
+ossl_pkcs7.o: $(top_srcdir)/include/ruby.h
+ossl_pkcs7.o: openssl_missing.h
+ossl_pkcs7.o: ossl.h
+ossl_pkcs7.o: ossl_asn1.h
+ossl_pkcs7.o: ossl_bio.h
+ossl_pkcs7.o: ossl_bn.h
+ossl_pkcs7.o: ossl_cipher.h
+ossl_pkcs7.o: ossl_config.h
+ossl_pkcs7.o: ossl_digest.h
+ossl_pkcs7.o: ossl_engine.h
+ossl_pkcs7.o: ossl_hmac.h
+ossl_pkcs7.o: ossl_ns_spki.h
+ossl_pkcs7.o: ossl_ocsp.h
+ossl_pkcs7.o: ossl_pkcs12.h
+ossl_pkcs7.o: ossl_pkcs5.h
+ossl_pkcs7.o: ossl_pkcs7.c
+ossl_pkcs7.o: ossl_pkcs7.h
+ossl_pkcs7.o: ossl_pkey.h
+ossl_pkcs7.o: ossl_rand.h
+ossl_pkcs7.o: ossl_ssl.h
+ossl_pkcs7.o: ossl_version.h
+ossl_pkcs7.o: ossl_x509.h
+ossl_pkcs7.o: ruby_missing.h
+ossl_pkey.o: $(RUBY_EXTCONF_H)
+ossl_pkey.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkey.o: $(hdrdir)/ruby/defines.h
+ossl_pkey.o: $(hdrdir)/ruby/encoding.h
+ossl_pkey.o: $(hdrdir)/ruby/intern.h
+ossl_pkey.o: $(hdrdir)/ruby/io.h
+ossl_pkey.o: $(hdrdir)/ruby/missing.h
+ossl_pkey.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkey.o: $(hdrdir)/ruby/ruby.h
+ossl_pkey.o: $(hdrdir)/ruby/st.h
+ossl_pkey.o: $(hdrdir)/ruby/subst.h
+ossl_pkey.o: $(hdrdir)/ruby/thread.h
+ossl_pkey.o: $(top_srcdir)/include/ruby.h
+ossl_pkey.o: openssl_missing.h
+ossl_pkey.o: ossl.h
+ossl_pkey.o: ossl_asn1.h
+ossl_pkey.o: ossl_bio.h
+ossl_pkey.o: ossl_bn.h
+ossl_pkey.o: ossl_cipher.h
+ossl_pkey.o: ossl_config.h
+ossl_pkey.o: ossl_digest.h
+ossl_pkey.o: ossl_engine.h
+ossl_pkey.o: ossl_hmac.h
+ossl_pkey.o: ossl_ns_spki.h
+ossl_pkey.o: ossl_ocsp.h
+ossl_pkey.o: ossl_pkcs12.h
+ossl_pkey.o: ossl_pkcs5.h
+ossl_pkey.o: ossl_pkcs7.h
+ossl_pkey.o: ossl_pkey.c
+ossl_pkey.o: ossl_pkey.h
+ossl_pkey.o: ossl_rand.h
+ossl_pkey.o: ossl_ssl.h
+ossl_pkey.o: ossl_version.h
+ossl_pkey.o: ossl_x509.h
+ossl_pkey.o: ruby_missing.h
+ossl_pkey_dh.o: $(RUBY_EXTCONF_H)
+ossl_pkey_dh.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/defines.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/encoding.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/intern.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/io.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/missing.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/ruby.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/st.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/subst.h
+ossl_pkey_dh.o: $(hdrdir)/ruby/thread.h
+ossl_pkey_dh.o: $(top_srcdir)/include/ruby.h
+ossl_pkey_dh.o: openssl_missing.h
+ossl_pkey_dh.o: ossl.h
+ossl_pkey_dh.o: ossl_asn1.h
+ossl_pkey_dh.o: ossl_bio.h
+ossl_pkey_dh.o: ossl_bn.h
+ossl_pkey_dh.o: ossl_cipher.h
+ossl_pkey_dh.o: ossl_config.h
+ossl_pkey_dh.o: ossl_digest.h
+ossl_pkey_dh.o: ossl_engine.h
+ossl_pkey_dh.o: ossl_hmac.h
+ossl_pkey_dh.o: ossl_ns_spki.h
+ossl_pkey_dh.o: ossl_ocsp.h
+ossl_pkey_dh.o: ossl_pkcs12.h
+ossl_pkey_dh.o: ossl_pkcs5.h
+ossl_pkey_dh.o: ossl_pkcs7.h
+ossl_pkey_dh.o: ossl_pkey.h
+ossl_pkey_dh.o: ossl_pkey_dh.c
+ossl_pkey_dh.o: ossl_rand.h
+ossl_pkey_dh.o: ossl_ssl.h
+ossl_pkey_dh.o: ossl_version.h
+ossl_pkey_dh.o: ossl_x509.h
+ossl_pkey_dh.o: ruby_missing.h
+ossl_pkey_dsa.o: $(RUBY_EXTCONF_H)
+ossl_pkey_dsa.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/defines.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/encoding.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/intern.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/io.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/missing.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/ruby.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/st.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/subst.h
+ossl_pkey_dsa.o: $(hdrdir)/ruby/thread.h
+ossl_pkey_dsa.o: $(top_srcdir)/include/ruby.h
+ossl_pkey_dsa.o: openssl_missing.h
+ossl_pkey_dsa.o: ossl.h
+ossl_pkey_dsa.o: ossl_asn1.h
+ossl_pkey_dsa.o: ossl_bio.h
+ossl_pkey_dsa.o: ossl_bn.h
+ossl_pkey_dsa.o: ossl_cipher.h
+ossl_pkey_dsa.o: ossl_config.h
+ossl_pkey_dsa.o: ossl_digest.h
+ossl_pkey_dsa.o: ossl_engine.h
+ossl_pkey_dsa.o: ossl_hmac.h
+ossl_pkey_dsa.o: ossl_ns_spki.h
+ossl_pkey_dsa.o: ossl_ocsp.h
+ossl_pkey_dsa.o: ossl_pkcs12.h
+ossl_pkey_dsa.o: ossl_pkcs5.h
+ossl_pkey_dsa.o: ossl_pkcs7.h
+ossl_pkey_dsa.o: ossl_pkey.h
+ossl_pkey_dsa.o: ossl_pkey_dsa.c
+ossl_pkey_dsa.o: ossl_rand.h
+ossl_pkey_dsa.o: ossl_ssl.h
+ossl_pkey_dsa.o: ossl_version.h
+ossl_pkey_dsa.o: ossl_x509.h
+ossl_pkey_dsa.o: ruby_missing.h
+ossl_pkey_ec.o: $(RUBY_EXTCONF_H)
+ossl_pkey_ec.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/defines.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/encoding.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/intern.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/io.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/missing.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/ruby.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/st.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/subst.h
+ossl_pkey_ec.o: $(hdrdir)/ruby/thread.h
+ossl_pkey_ec.o: $(top_srcdir)/include/ruby.h
+ossl_pkey_ec.o: openssl_missing.h
+ossl_pkey_ec.o: ossl.h
+ossl_pkey_ec.o: ossl_asn1.h
+ossl_pkey_ec.o: ossl_bio.h
+ossl_pkey_ec.o: ossl_bn.h
+ossl_pkey_ec.o: ossl_cipher.h
+ossl_pkey_ec.o: ossl_config.h
+ossl_pkey_ec.o: ossl_digest.h
+ossl_pkey_ec.o: ossl_engine.h
+ossl_pkey_ec.o: ossl_hmac.h
+ossl_pkey_ec.o: ossl_ns_spki.h
+ossl_pkey_ec.o: ossl_ocsp.h
+ossl_pkey_ec.o: ossl_pkcs12.h
+ossl_pkey_ec.o: ossl_pkcs5.h
+ossl_pkey_ec.o: ossl_pkcs7.h
+ossl_pkey_ec.o: ossl_pkey.h
+ossl_pkey_ec.o: ossl_pkey_ec.c
+ossl_pkey_ec.o: ossl_rand.h
+ossl_pkey_ec.o: ossl_ssl.h
+ossl_pkey_ec.o: ossl_version.h
+ossl_pkey_ec.o: ossl_x509.h
+ossl_pkey_ec.o: ruby_missing.h
+ossl_pkey_rsa.o: $(RUBY_EXTCONF_H)
+ossl_pkey_rsa.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/defines.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/encoding.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/intern.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/io.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/missing.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/ruby.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/st.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/subst.h
+ossl_pkey_rsa.o: $(hdrdir)/ruby/thread.h
+ossl_pkey_rsa.o: $(top_srcdir)/include/ruby.h
+ossl_pkey_rsa.o: openssl_missing.h
+ossl_pkey_rsa.o: ossl.h
+ossl_pkey_rsa.o: ossl_asn1.h
+ossl_pkey_rsa.o: ossl_bio.h
+ossl_pkey_rsa.o: ossl_bn.h
+ossl_pkey_rsa.o: ossl_cipher.h
+ossl_pkey_rsa.o: ossl_config.h
+ossl_pkey_rsa.o: ossl_digest.h
+ossl_pkey_rsa.o: ossl_engine.h
+ossl_pkey_rsa.o: ossl_hmac.h
+ossl_pkey_rsa.o: ossl_ns_spki.h
+ossl_pkey_rsa.o: ossl_ocsp.h
+ossl_pkey_rsa.o: ossl_pkcs12.h
+ossl_pkey_rsa.o: ossl_pkcs5.h
+ossl_pkey_rsa.o: ossl_pkcs7.h
+ossl_pkey_rsa.o: ossl_pkey.h
+ossl_pkey_rsa.o: ossl_pkey_rsa.c
+ossl_pkey_rsa.o: ossl_rand.h
+ossl_pkey_rsa.o: ossl_ssl.h
+ossl_pkey_rsa.o: ossl_version.h
+ossl_pkey_rsa.o: ossl_x509.h
+ossl_pkey_rsa.o: ruby_missing.h
+ossl_rand.o: $(RUBY_EXTCONF_H)
+ossl_rand.o: $(arch_hdrdir)/ruby/config.h
+ossl_rand.o: $(hdrdir)/ruby/defines.h
+ossl_rand.o: $(hdrdir)/ruby/encoding.h
+ossl_rand.o: $(hdrdir)/ruby/intern.h
+ossl_rand.o: $(hdrdir)/ruby/io.h
+ossl_rand.o: $(hdrdir)/ruby/missing.h
+ossl_rand.o: $(hdrdir)/ruby/oniguruma.h
+ossl_rand.o: $(hdrdir)/ruby/ruby.h
+ossl_rand.o: $(hdrdir)/ruby/st.h
+ossl_rand.o: $(hdrdir)/ruby/subst.h
+ossl_rand.o: $(hdrdir)/ruby/thread.h
+ossl_rand.o: $(top_srcdir)/include/ruby.h
+ossl_rand.o: openssl_missing.h
+ossl_rand.o: ossl.h
+ossl_rand.o: ossl_asn1.h
+ossl_rand.o: ossl_bio.h
+ossl_rand.o: ossl_bn.h
+ossl_rand.o: ossl_cipher.h
+ossl_rand.o: ossl_config.h
+ossl_rand.o: ossl_digest.h
+ossl_rand.o: ossl_engine.h
+ossl_rand.o: ossl_hmac.h
+ossl_rand.o: ossl_ns_spki.h
+ossl_rand.o: ossl_ocsp.h
+ossl_rand.o: ossl_pkcs12.h
+ossl_rand.o: ossl_pkcs5.h
+ossl_rand.o: ossl_pkcs7.h
+ossl_rand.o: ossl_pkey.h
+ossl_rand.o: ossl_rand.c
+ossl_rand.o: ossl_rand.h
+ossl_rand.o: ossl_ssl.h
+ossl_rand.o: ossl_version.h
+ossl_rand.o: ossl_x509.h
+ossl_rand.o: ruby_missing.h
+ossl_ssl.o: $(RUBY_EXTCONF_H)
+ossl_ssl.o: $(arch_hdrdir)/ruby/config.h
+ossl_ssl.o: $(hdrdir)/ruby/defines.h
+ossl_ssl.o: $(hdrdir)/ruby/encoding.h
+ossl_ssl.o: $(hdrdir)/ruby/intern.h
+ossl_ssl.o: $(hdrdir)/ruby/io.h
+ossl_ssl.o: $(hdrdir)/ruby/missing.h
+ossl_ssl.o: $(hdrdir)/ruby/oniguruma.h
+ossl_ssl.o: $(hdrdir)/ruby/ruby.h
+ossl_ssl.o: $(hdrdir)/ruby/st.h
+ossl_ssl.o: $(hdrdir)/ruby/subst.h
+ossl_ssl.o: $(hdrdir)/ruby/thread.h
+ossl_ssl.o: $(top_srcdir)/include/ruby.h
+ossl_ssl.o: openssl_missing.h
+ossl_ssl.o: ossl.h
+ossl_ssl.o: ossl_asn1.h
+ossl_ssl.o: ossl_bio.h
+ossl_ssl.o: ossl_bn.h
+ossl_ssl.o: ossl_cipher.h
+ossl_ssl.o: ossl_config.h
+ossl_ssl.o: ossl_digest.h
+ossl_ssl.o: ossl_engine.h
+ossl_ssl.o: ossl_hmac.h
+ossl_ssl.o: ossl_ns_spki.h
+ossl_ssl.o: ossl_ocsp.h
+ossl_ssl.o: ossl_pkcs12.h
+ossl_ssl.o: ossl_pkcs5.h
+ossl_ssl.o: ossl_pkcs7.h
+ossl_ssl.o: ossl_pkey.h
+ossl_ssl.o: ossl_rand.h
+ossl_ssl.o: ossl_ssl.c
+ossl_ssl.o: ossl_ssl.h
+ossl_ssl.o: ossl_version.h
+ossl_ssl.o: ossl_x509.h
+ossl_ssl.o: ruby_missing.h
+ossl_ssl_session.o: $(RUBY_EXTCONF_H)
+ossl_ssl_session.o: $(arch_hdrdir)/ruby/config.h
+ossl_ssl_session.o: $(hdrdir)/ruby/defines.h
+ossl_ssl_session.o: $(hdrdir)/ruby/encoding.h
+ossl_ssl_session.o: $(hdrdir)/ruby/intern.h
+ossl_ssl_session.o: $(hdrdir)/ruby/io.h
+ossl_ssl_session.o: $(hdrdir)/ruby/missing.h
+ossl_ssl_session.o: $(hdrdir)/ruby/oniguruma.h
+ossl_ssl_session.o: $(hdrdir)/ruby/ruby.h
+ossl_ssl_session.o: $(hdrdir)/ruby/st.h
+ossl_ssl_session.o: $(hdrdir)/ruby/subst.h
+ossl_ssl_session.o: $(hdrdir)/ruby/thread.h
+ossl_ssl_session.o: $(top_srcdir)/include/ruby.h
+ossl_ssl_session.o: openssl_missing.h
+ossl_ssl_session.o: ossl.h
+ossl_ssl_session.o: ossl_asn1.h
+ossl_ssl_session.o: ossl_bio.h
+ossl_ssl_session.o: ossl_bn.h
+ossl_ssl_session.o: ossl_cipher.h
+ossl_ssl_session.o: ossl_config.h
+ossl_ssl_session.o: ossl_digest.h
+ossl_ssl_session.o: ossl_engine.h
+ossl_ssl_session.o: ossl_hmac.h
+ossl_ssl_session.o: ossl_ns_spki.h
+ossl_ssl_session.o: ossl_ocsp.h
+ossl_ssl_session.o: ossl_pkcs12.h
+ossl_ssl_session.o: ossl_pkcs5.h
+ossl_ssl_session.o: ossl_pkcs7.h
+ossl_ssl_session.o: ossl_pkey.h
+ossl_ssl_session.o: ossl_rand.h
+ossl_ssl_session.o: ossl_ssl.h
+ossl_ssl_session.o: ossl_ssl_session.c
+ossl_ssl_session.o: ossl_version.h
+ossl_ssl_session.o: ossl_x509.h
+ossl_ssl_session.o: ruby_missing.h
+ossl_x509.o: $(RUBY_EXTCONF_H)
+ossl_x509.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509.o: $(hdrdir)/ruby/defines.h
+ossl_x509.o: $(hdrdir)/ruby/encoding.h
+ossl_x509.o: $(hdrdir)/ruby/intern.h
+ossl_x509.o: $(hdrdir)/ruby/io.h
+ossl_x509.o: $(hdrdir)/ruby/missing.h
+ossl_x509.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509.o: $(hdrdir)/ruby/ruby.h
+ossl_x509.o: $(hdrdir)/ruby/st.h
+ossl_x509.o: $(hdrdir)/ruby/subst.h
+ossl_x509.o: $(hdrdir)/ruby/thread.h
+ossl_x509.o: $(top_srcdir)/include/ruby.h
+ossl_x509.o: openssl_missing.h
+ossl_x509.o: ossl.h
+ossl_x509.o: ossl_asn1.h
+ossl_x509.o: ossl_bio.h
+ossl_x509.o: ossl_bn.h
+ossl_x509.o: ossl_cipher.h
+ossl_x509.o: ossl_config.h
+ossl_x509.o: ossl_digest.h
+ossl_x509.o: ossl_engine.h
+ossl_x509.o: ossl_hmac.h
+ossl_x509.o: ossl_ns_spki.h
+ossl_x509.o: ossl_ocsp.h
+ossl_x509.o: ossl_pkcs12.h
+ossl_x509.o: ossl_pkcs5.h
+ossl_x509.o: ossl_pkcs7.h
+ossl_x509.o: ossl_pkey.h
+ossl_x509.o: ossl_rand.h
+ossl_x509.o: ossl_ssl.h
+ossl_x509.o: ossl_version.h
+ossl_x509.o: ossl_x509.c
+ossl_x509.o: ossl_x509.h
+ossl_x509.o: ruby_missing.h
+ossl_x509attr.o: $(RUBY_EXTCONF_H)
+ossl_x509attr.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509attr.o: $(hdrdir)/ruby/defines.h
+ossl_x509attr.o: $(hdrdir)/ruby/encoding.h
+ossl_x509attr.o: $(hdrdir)/ruby/intern.h
+ossl_x509attr.o: $(hdrdir)/ruby/io.h
+ossl_x509attr.o: $(hdrdir)/ruby/missing.h
+ossl_x509attr.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509attr.o: $(hdrdir)/ruby/ruby.h
+ossl_x509attr.o: $(hdrdir)/ruby/st.h
+ossl_x509attr.o: $(hdrdir)/ruby/subst.h
+ossl_x509attr.o: $(hdrdir)/ruby/thread.h
+ossl_x509attr.o: $(top_srcdir)/include/ruby.h
+ossl_x509attr.o: openssl_missing.h
+ossl_x509attr.o: ossl.h
+ossl_x509attr.o: ossl_asn1.h
+ossl_x509attr.o: ossl_bio.h
+ossl_x509attr.o: ossl_bn.h
+ossl_x509attr.o: ossl_cipher.h
+ossl_x509attr.o: ossl_config.h
+ossl_x509attr.o: ossl_digest.h
+ossl_x509attr.o: ossl_engine.h
+ossl_x509attr.o: ossl_hmac.h
+ossl_x509attr.o: ossl_ns_spki.h
+ossl_x509attr.o: ossl_ocsp.h
+ossl_x509attr.o: ossl_pkcs12.h
+ossl_x509attr.o: ossl_pkcs5.h
+ossl_x509attr.o: ossl_pkcs7.h
+ossl_x509attr.o: ossl_pkey.h
+ossl_x509attr.o: ossl_rand.h
+ossl_x509attr.o: ossl_ssl.h
+ossl_x509attr.o: ossl_version.h
+ossl_x509attr.o: ossl_x509.h
+ossl_x509attr.o: ossl_x509attr.c
+ossl_x509attr.o: ruby_missing.h
+ossl_x509cert.o: $(RUBY_EXTCONF_H)
+ossl_x509cert.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509cert.o: $(hdrdir)/ruby/defines.h
+ossl_x509cert.o: $(hdrdir)/ruby/encoding.h
+ossl_x509cert.o: $(hdrdir)/ruby/intern.h
+ossl_x509cert.o: $(hdrdir)/ruby/io.h
+ossl_x509cert.o: $(hdrdir)/ruby/missing.h
+ossl_x509cert.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509cert.o: $(hdrdir)/ruby/ruby.h
+ossl_x509cert.o: $(hdrdir)/ruby/st.h
+ossl_x509cert.o: $(hdrdir)/ruby/subst.h
+ossl_x509cert.o: $(hdrdir)/ruby/thread.h
+ossl_x509cert.o: $(top_srcdir)/include/ruby.h
+ossl_x509cert.o: openssl_missing.h
+ossl_x509cert.o: ossl.h
+ossl_x509cert.o: ossl_asn1.h
+ossl_x509cert.o: ossl_bio.h
+ossl_x509cert.o: ossl_bn.h
+ossl_x509cert.o: ossl_cipher.h
+ossl_x509cert.o: ossl_config.h
+ossl_x509cert.o: ossl_digest.h
+ossl_x509cert.o: ossl_engine.h
+ossl_x509cert.o: ossl_hmac.h
+ossl_x509cert.o: ossl_ns_spki.h
+ossl_x509cert.o: ossl_ocsp.h
+ossl_x509cert.o: ossl_pkcs12.h
+ossl_x509cert.o: ossl_pkcs5.h
+ossl_x509cert.o: ossl_pkcs7.h
+ossl_x509cert.o: ossl_pkey.h
+ossl_x509cert.o: ossl_rand.h
+ossl_x509cert.o: ossl_ssl.h
+ossl_x509cert.o: ossl_version.h
+ossl_x509cert.o: ossl_x509.h
+ossl_x509cert.o: ossl_x509cert.c
+ossl_x509cert.o: ruby_missing.h
+ossl_x509crl.o: $(RUBY_EXTCONF_H)
+ossl_x509crl.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509crl.o: $(hdrdir)/ruby/defines.h
+ossl_x509crl.o: $(hdrdir)/ruby/encoding.h
+ossl_x509crl.o: $(hdrdir)/ruby/intern.h
+ossl_x509crl.o: $(hdrdir)/ruby/io.h
+ossl_x509crl.o: $(hdrdir)/ruby/missing.h
+ossl_x509crl.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509crl.o: $(hdrdir)/ruby/ruby.h
+ossl_x509crl.o: $(hdrdir)/ruby/st.h
+ossl_x509crl.o: $(hdrdir)/ruby/subst.h
+ossl_x509crl.o: $(hdrdir)/ruby/thread.h
+ossl_x509crl.o: $(top_srcdir)/include/ruby.h
+ossl_x509crl.o: openssl_missing.h
+ossl_x509crl.o: ossl.h
+ossl_x509crl.o: ossl_asn1.h
+ossl_x509crl.o: ossl_bio.h
+ossl_x509crl.o: ossl_bn.h
+ossl_x509crl.o: ossl_cipher.h
+ossl_x509crl.o: ossl_config.h
+ossl_x509crl.o: ossl_digest.h
+ossl_x509crl.o: ossl_engine.h
+ossl_x509crl.o: ossl_hmac.h
+ossl_x509crl.o: ossl_ns_spki.h
+ossl_x509crl.o: ossl_ocsp.h
+ossl_x509crl.o: ossl_pkcs12.h
+ossl_x509crl.o: ossl_pkcs5.h
+ossl_x509crl.o: ossl_pkcs7.h
+ossl_x509crl.o: ossl_pkey.h
+ossl_x509crl.o: ossl_rand.h
+ossl_x509crl.o: ossl_ssl.h
+ossl_x509crl.o: ossl_version.h
+ossl_x509crl.o: ossl_x509.h
+ossl_x509crl.o: ossl_x509crl.c
+ossl_x509crl.o: ruby_missing.h
+ossl_x509ext.o: $(RUBY_EXTCONF_H)
+ossl_x509ext.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509ext.o: $(hdrdir)/ruby/defines.h
+ossl_x509ext.o: $(hdrdir)/ruby/encoding.h
+ossl_x509ext.o: $(hdrdir)/ruby/intern.h
+ossl_x509ext.o: $(hdrdir)/ruby/io.h
+ossl_x509ext.o: $(hdrdir)/ruby/missing.h
+ossl_x509ext.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509ext.o: $(hdrdir)/ruby/ruby.h
+ossl_x509ext.o: $(hdrdir)/ruby/st.h
+ossl_x509ext.o: $(hdrdir)/ruby/subst.h
+ossl_x509ext.o: $(hdrdir)/ruby/thread.h
+ossl_x509ext.o: $(top_srcdir)/include/ruby.h
+ossl_x509ext.o: openssl_missing.h
+ossl_x509ext.o: ossl.h
+ossl_x509ext.o: ossl_asn1.h
+ossl_x509ext.o: ossl_bio.h
+ossl_x509ext.o: ossl_bn.h
+ossl_x509ext.o: ossl_cipher.h
+ossl_x509ext.o: ossl_config.h
+ossl_x509ext.o: ossl_digest.h
+ossl_x509ext.o: ossl_engine.h
+ossl_x509ext.o: ossl_hmac.h
+ossl_x509ext.o: ossl_ns_spki.h
+ossl_x509ext.o: ossl_ocsp.h
+ossl_x509ext.o: ossl_pkcs12.h
+ossl_x509ext.o: ossl_pkcs5.h
+ossl_x509ext.o: ossl_pkcs7.h
+ossl_x509ext.o: ossl_pkey.h
+ossl_x509ext.o: ossl_rand.h
+ossl_x509ext.o: ossl_ssl.h
+ossl_x509ext.o: ossl_version.h
+ossl_x509ext.o: ossl_x509.h
+ossl_x509ext.o: ossl_x509ext.c
+ossl_x509ext.o: ruby_missing.h
+ossl_x509name.o: $(RUBY_EXTCONF_H)
+ossl_x509name.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509name.o: $(hdrdir)/ruby/defines.h
+ossl_x509name.o: $(hdrdir)/ruby/encoding.h
+ossl_x509name.o: $(hdrdir)/ruby/intern.h
+ossl_x509name.o: $(hdrdir)/ruby/io.h
+ossl_x509name.o: $(hdrdir)/ruby/missing.h
+ossl_x509name.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509name.o: $(hdrdir)/ruby/ruby.h
+ossl_x509name.o: $(hdrdir)/ruby/st.h
+ossl_x509name.o: $(hdrdir)/ruby/subst.h
+ossl_x509name.o: $(hdrdir)/ruby/thread.h
+ossl_x509name.o: $(top_srcdir)/include/ruby.h
+ossl_x509name.o: openssl_missing.h
+ossl_x509name.o: ossl.h
+ossl_x509name.o: ossl_asn1.h
+ossl_x509name.o: ossl_bio.h
+ossl_x509name.o: ossl_bn.h
+ossl_x509name.o: ossl_cipher.h
+ossl_x509name.o: ossl_config.h
+ossl_x509name.o: ossl_digest.h
+ossl_x509name.o: ossl_engine.h
+ossl_x509name.o: ossl_hmac.h
+ossl_x509name.o: ossl_ns_spki.h
+ossl_x509name.o: ossl_ocsp.h
+ossl_x509name.o: ossl_pkcs12.h
+ossl_x509name.o: ossl_pkcs5.h
+ossl_x509name.o: ossl_pkcs7.h
+ossl_x509name.o: ossl_pkey.h
+ossl_x509name.o: ossl_rand.h
+ossl_x509name.o: ossl_ssl.h
+ossl_x509name.o: ossl_version.h
+ossl_x509name.o: ossl_x509.h
+ossl_x509name.o: ossl_x509name.c
+ossl_x509name.o: ruby_missing.h
+ossl_x509req.o: $(RUBY_EXTCONF_H)
+ossl_x509req.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509req.o: $(hdrdir)/ruby/defines.h
+ossl_x509req.o: $(hdrdir)/ruby/encoding.h
+ossl_x509req.o: $(hdrdir)/ruby/intern.h
+ossl_x509req.o: $(hdrdir)/ruby/io.h
+ossl_x509req.o: $(hdrdir)/ruby/missing.h
+ossl_x509req.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509req.o: $(hdrdir)/ruby/ruby.h
+ossl_x509req.o: $(hdrdir)/ruby/st.h
+ossl_x509req.o: $(hdrdir)/ruby/subst.h
+ossl_x509req.o: $(hdrdir)/ruby/thread.h
+ossl_x509req.o: $(top_srcdir)/include/ruby.h
+ossl_x509req.o: openssl_missing.h
+ossl_x509req.o: ossl.h
+ossl_x509req.o: ossl_asn1.h
+ossl_x509req.o: ossl_bio.h
+ossl_x509req.o: ossl_bn.h
+ossl_x509req.o: ossl_cipher.h
+ossl_x509req.o: ossl_config.h
+ossl_x509req.o: ossl_digest.h
+ossl_x509req.o: ossl_engine.h
+ossl_x509req.o: ossl_hmac.h
+ossl_x509req.o: ossl_ns_spki.h
+ossl_x509req.o: ossl_ocsp.h
+ossl_x509req.o: ossl_pkcs12.h
+ossl_x509req.o: ossl_pkcs5.h
+ossl_x509req.o: ossl_pkcs7.h
+ossl_x509req.o: ossl_pkey.h
+ossl_x509req.o: ossl_rand.h
+ossl_x509req.o: ossl_ssl.h
+ossl_x509req.o: ossl_version.h
+ossl_x509req.o: ossl_x509.h
+ossl_x509req.o: ossl_x509req.c
+ossl_x509req.o: ruby_missing.h
+ossl_x509revoked.o: $(RUBY_EXTCONF_H)
+ossl_x509revoked.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509revoked.o: $(hdrdir)/ruby/defines.h
+ossl_x509revoked.o: $(hdrdir)/ruby/encoding.h
+ossl_x509revoked.o: $(hdrdir)/ruby/intern.h
+ossl_x509revoked.o: $(hdrdir)/ruby/io.h
+ossl_x509revoked.o: $(hdrdir)/ruby/missing.h
+ossl_x509revoked.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509revoked.o: $(hdrdir)/ruby/ruby.h
+ossl_x509revoked.o: $(hdrdir)/ruby/st.h
+ossl_x509revoked.o: $(hdrdir)/ruby/subst.h
+ossl_x509revoked.o: $(hdrdir)/ruby/thread.h
+ossl_x509revoked.o: $(top_srcdir)/include/ruby.h
+ossl_x509revoked.o: openssl_missing.h
+ossl_x509revoked.o: ossl.h
+ossl_x509revoked.o: ossl_asn1.h
+ossl_x509revoked.o: ossl_bio.h
+ossl_x509revoked.o: ossl_bn.h
+ossl_x509revoked.o: ossl_cipher.h
+ossl_x509revoked.o: ossl_config.h
+ossl_x509revoked.o: ossl_digest.h
+ossl_x509revoked.o: ossl_engine.h
+ossl_x509revoked.o: ossl_hmac.h
+ossl_x509revoked.o: ossl_ns_spki.h
+ossl_x509revoked.o: ossl_ocsp.h
+ossl_x509revoked.o: ossl_pkcs12.h
+ossl_x509revoked.o: ossl_pkcs5.h
+ossl_x509revoked.o: ossl_pkcs7.h
+ossl_x509revoked.o: ossl_pkey.h
+ossl_x509revoked.o: ossl_rand.h
+ossl_x509revoked.o: ossl_ssl.h
+ossl_x509revoked.o: ossl_version.h
+ossl_x509revoked.o: ossl_x509.h
+ossl_x509revoked.o: ossl_x509revoked.c
+ossl_x509revoked.o: ruby_missing.h
+ossl_x509store.o: $(RUBY_EXTCONF_H)
+ossl_x509store.o: $(arch_hdrdir)/ruby/config.h
+ossl_x509store.o: $(hdrdir)/ruby/defines.h
+ossl_x509store.o: $(hdrdir)/ruby/encoding.h
+ossl_x509store.o: $(hdrdir)/ruby/intern.h
+ossl_x509store.o: $(hdrdir)/ruby/io.h
+ossl_x509store.o: $(hdrdir)/ruby/missing.h
+ossl_x509store.o: $(hdrdir)/ruby/oniguruma.h
+ossl_x509store.o: $(hdrdir)/ruby/ruby.h
+ossl_x509store.o: $(hdrdir)/ruby/st.h
+ossl_x509store.o: $(hdrdir)/ruby/subst.h
+ossl_x509store.o: $(hdrdir)/ruby/thread.h
+ossl_x509store.o: $(top_srcdir)/include/ruby.h
+ossl_x509store.o: openssl_missing.h
+ossl_x509store.o: ossl.h
+ossl_x509store.o: ossl_asn1.h
+ossl_x509store.o: ossl_bio.h
+ossl_x509store.o: ossl_bn.h
+ossl_x509store.o: ossl_cipher.h
+ossl_x509store.o: ossl_config.h
+ossl_x509store.o: ossl_digest.h
+ossl_x509store.o: ossl_engine.h
+ossl_x509store.o: ossl_hmac.h
+ossl_x509store.o: ossl_ns_spki.h
+ossl_x509store.o: ossl_ocsp.h
+ossl_x509store.o: ossl_pkcs12.h
+ossl_x509store.o: ossl_pkcs5.h
+ossl_x509store.o: ossl_pkcs7.h
+ossl_x509store.o: ossl_pkey.h
+ossl_x509store.o: ossl_rand.h
+ossl_x509store.o: ossl_ssl.h
+ossl_x509store.o: ossl_version.h
+ossl_x509store.o: ossl_x509.h
+ossl_x509store.o: ossl_x509store.c
+ossl_x509store.o: ruby_missing.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/openssl/deprecation.rb b/ext/openssl/deprecation.rb
index 39ebfa0d37..d77353678a 100644
--- a/ext/openssl/deprecation.rb
+++ b/ext/openssl/deprecation.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module OpenSSL
def self.deprecated_warning_flag
unless flag = (@deprecated_warning_flag ||= nil)
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index e272cba092..0b7fa2aaf9 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -1,18 +1,14 @@
# -*- coding: us-ascii -*-
+# frozen_string_literal: false
=begin
-= $RCSfile$ -- Generator for Makefile
-
= 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.
+ This program is licensed under the same licence as Ruby.
(See the file 'LICENCE'.)
-
-= Version
- $Id$
=end
require "mkmf"
@@ -87,6 +83,7 @@ have_func("HMAC_CTX_init")
have_func("PEM_def_callback")
have_func("PKCS5_PBKDF2_HMAC")
have_func("PKCS5_PBKDF2_HMAC_SHA1")
+have_func("RAND_egd")
have_func("X509V3_set_nconf")
have_func("X509V3_EXT_nconf_nid")
have_func("X509_CRL_add0_revoked")
@@ -103,13 +100,17 @@ have_func("OPENSSL_cleanse")
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
+have_func("SSLv3_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")
+have_func("SSL_CTX_set_alpn_select_cb")
+have_func("SSL_CTX_set_next_proto_select_cb")
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
diff --git a/ext/openssl/lib/openssl.rb b/ext/openssl/lib/openssl.rb
index 19a4382d0d..26d167a9b4 100644
--- a/ext/openssl/lib/openssl.rb
+++ b/ext/openssl/lib/openssl.rb
@@ -1,22 +1,19 @@
+# frozen_string_literal: false
=begin
-= $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions
-
= 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.
+ This program is licensed under the same licence as Ruby.
(See the file 'LICENCE'.)
-
-= Version
- $Id$
=end
require 'openssl.so'
require 'openssl/bn'
+require 'openssl/pkey'
require 'openssl/cipher'
require 'openssl/config'
require 'openssl/digest'
diff --git a/ext/openssl/lib/openssl/bn.rb b/ext/openssl/lib/openssl/bn.rb
index 0e19c20d34..6d6c96e42d 100644
--- a/ext/openssl/lib/openssl/bn.rb
+++ b/ext/openssl/lib/openssl/bn.rb
@@ -1,7 +1,6 @@
+# frozen_string_literal: false
#--
#
-# $RCSfile$
-#
# = Ruby-space definitions that completes C-space funcs for BN
#
# = Info
@@ -10,17 +9,20 @@
# All rights reserved.
#
# = Licence
-# This program is licenced under the same licence as Ruby.
+# This program is licensed under the same licence as Ruby.
# (See the file 'LICENCE'.)
-#
-# = Version
-# $Id$
-#
#++
module OpenSSL
class BN
include Comparable
+
+ def pretty_print(q)
+ q.object_group(self) {
+ q.text ' '
+ q.text to_i.to_s
+ }
+ end
end # BN
end # OpenSSL
@@ -35,4 +37,3 @@ class Integer
OpenSSL::BN::new(self)
end
end # Integer
-
diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb
index 1223c5de15..d082199000 100644
--- a/ext/openssl/lib/openssl/buffering.rb
+++ b/ext/openssl/lib/openssl/buffering.rb
@@ -1,18 +1,14 @@
# coding: binary
+# frozen_string_literal: false
#--
-#= $RCSfile$ -- Buffering mix-in module.
-#
#= 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.
+# This program is licensed under the same licence as Ruby.
# (See the file 'LICENCE'.)
-#
-#= Version
-# $Id$
#++
##
@@ -213,7 +209,7 @@ module OpenSSL::Buffering
else
size = idx ? idx+eol.size : nil
end
- if limit and limit >= 0
+ if size && limit && limit >= 0
size = [size, limit].min
end
consume_rbuff(size)
diff --git a/ext/openssl/lib/openssl/cipher.rb b/ext/openssl/lib/openssl/cipher.rb
index b3340ff52a..a69d5ac827 100644
--- a/ext/openssl/lib/openssl/cipher.rb
+++ b/ext/openssl/lib/openssl/cipher.rb
@@ -1,7 +1,5 @@
+# frozen_string_literal: false
#--
-#
-# $RCSfile$
-#
# = Ruby-space predefined Cipher subclasses
#
# = Info
@@ -10,12 +8,8 @@
# All rights reserved.
#
# = Licence
-# This program is licenced under the same licence as Ruby.
+# This program is licensed under the same licence as Ruby.
# (See the file 'LICENCE'.)
-#
-# = Version
-# $Id$
-#
#++
module OpenSSL
diff --git a/ext/openssl/lib/openssl/config.rb b/ext/openssl/lib/openssl/config.rb
index 5716d59fd6..8822545192 100644
--- a/ext/openssl/lib/openssl/config.rb
+++ b/ext/openssl/lib/openssl/config.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
=begin
= Ruby-space definitions that completes C-space funcs for Config
@@ -5,7 +6,7 @@
Copyright (C) 2010 Hiroshi Nakamura <nahi@ruby-lang.org>
= Licence
- This program is licenced under the same licence as Ruby.
+ This program is licensed under the same licence as Ruby.
(See the file 'LICENCE'.)
=end
diff --git a/ext/openssl/lib/openssl/digest.rb b/ext/openssl/lib/openssl/digest.rb
index a7b641fd22..1240bf596b 100644
--- a/ext/openssl/lib/openssl/digest.rb
+++ b/ext/openssl/lib/openssl/digest.rb
@@ -1,7 +1,5 @@
+# frozen_string_literal: false
#--
-#
-# $RCSfile$
-#
# = Ruby-space predefined Digest subclasses
#
# = Info
@@ -10,12 +8,8 @@
# All rights reserved.
#
# = Licence
-# This program is licenced under the same licence as Ruby.
+# This program is licensed under the same licence as Ruby.
# (See the file 'LICENCE'.)
-#
-# = Version
-# $Id$
-#
#++
module OpenSSL
@@ -85,4 +79,3 @@ module OpenSSL
module_function :Digest
end # OpenSSL
-
diff --git a/ext/openssl/lib/openssl/pkey.rb b/ext/openssl/lib/openssl/pkey.rb
new file mode 100644
index 0000000000..3f65adadb5
--- /dev/null
+++ b/ext/openssl/lib/openssl/pkey.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: false
+module OpenSSL
+ module PKey
+ if defined?(OpenSSL::PKey::DH)
+
+ class DH
+ DEFAULT_512 = new <<-_end_of_pem_
+-----BEGIN DH PARAMETERS-----
+MEYCQQD0zXHljRg/mJ9PYLACLv58Cd8VxBxxY7oEuCeURMiTqEhMym16rhhKgZG2
+zk2O9uUIBIxSj+NKMURHGaFKyIvLAgEC
+-----END DH PARAMETERS-----
+ _end_of_pem_
+
+ DEFAULT_1024 = new <<-_end_of_pem_
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAJ0lOVy0VIr/JebWn0zDwY2h+rqITFOpdNr6ugsgvkDXuucdcChhYExJ
+AV/ZD2AWPbrTqV76mGRgJg4EddgT1zG0jq3rnFdMj2XzkBYx3BVvfR0Arnby0RHR
+T4h7KZ/2zmjvV+eF8kBUHBJAojUlzxKj4QeO2x20FP9X5xmNUXeDAgEC
+-----END DH PARAMETERS-----
+ _end_of_pem_
+ end
+
+ DEFAULT_TMP_DH_CALLBACK = lambda { |ctx, is_export, keylen|
+ warn "using default DH parameters." if $VERBOSE
+ case keylen
+ when 512 then OpenSSL::PKey::DH::DEFAULT_512
+ when 1024 then OpenSSL::PKey::DH::DEFAULT_1024
+ else
+ nil
+ end
+ }
+
+ else
+ DEFAULT_TMP_DH_CALLBACK = nil
+ end
+ end
+end
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index 014e1137bc..9893757011 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -1,21 +1,17 @@
+# frozen_string_literal: false
=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.
+ This program is licensed under the same licence as Ruby.
(See the file 'LICENCE'.)
-
-= Version
- $Id$
=end
require "openssl/buffering"
-require "fcntl"
+require "io/nonblock"
module OpenSSL
module SSL
@@ -23,10 +19,49 @@ module OpenSSL
DEFAULT_PARAMS = {
:ssl_version => "SSLv23",
:verify_mode => OpenSSL::SSL::VERIFY_PEER,
- :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
- :options => defined?(OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS) ?
- OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS :
- OpenSSL::SSL::OP_ALL,
+ :ciphers => %w{
+ ECDHE-ECDSA-AES128-GCM-SHA256
+ ECDHE-RSA-AES128-GCM-SHA256
+ ECDHE-ECDSA-AES256-GCM-SHA384
+ ECDHE-RSA-AES256-GCM-SHA384
+ DHE-RSA-AES128-GCM-SHA256
+ DHE-DSS-AES128-GCM-SHA256
+ DHE-RSA-AES256-GCM-SHA384
+ DHE-DSS-AES256-GCM-SHA384
+ ECDHE-ECDSA-AES128-SHA256
+ ECDHE-RSA-AES128-SHA256
+ ECDHE-ECDSA-AES128-SHA
+ ECDHE-RSA-AES128-SHA
+ ECDHE-ECDSA-AES256-SHA384
+ ECDHE-RSA-AES256-SHA384
+ ECDHE-ECDSA-AES256-SHA
+ ECDHE-RSA-AES256-SHA
+ DHE-RSA-AES128-SHA256
+ DHE-RSA-AES256-SHA256
+ DHE-RSA-AES128-SHA
+ DHE-RSA-AES256-SHA
+ DHE-DSS-AES128-SHA256
+ DHE-DSS-AES256-SHA256
+ DHE-DSS-AES128-SHA
+ DHE-DSS-AES256-SHA
+ AES128-GCM-SHA256
+ AES256-GCM-SHA384
+ AES128-SHA256
+ AES256-SHA256
+ AES128-SHA
+ AES256-SHA
+ ECDHE-ECDSA-RC4-SHA
+ ECDHE-RSA-RC4-SHA
+ RC4-SHA
+ }.join(":"),
+ :options => -> {
+ opts = OpenSSL::SSL::OP_ALL
+ opts &= ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS if defined?(OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS)
+ opts |= OpenSSL::SSL::OP_NO_COMPRESSION if defined?(OpenSSL::SSL::OP_NO_COMPRESSION)
+ opts |= OpenSSL::SSL::OP_NO_SSLv2 if defined?(OpenSSL::SSL::OP_NO_SSLv2)
+ opts |= OpenSSL::SSL::OP_NO_SSLv3 if defined?(OpenSSL::SSL::OP_NO_SSLv3)
+ opts
+ }.call
}
DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
@@ -35,6 +70,48 @@ module OpenSSL
DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
end
+ INIT_VARS = ["cert", "key", "client_ca", "ca_file", "ca_path",
+ "timeout", "verify_mode", "verify_depth", "renegotiation_cb",
+ "verify_callback", "cert_store", "extra_chain_cert",
+ "client_cert_cb", "session_id_context", "tmp_dh_callback",
+ "session_get_cb", "session_new_cb", "session_remove_cb",
+ "tmp_ecdh_callback", "servername_cb", "npn_protocols",
+ "alpn_protocols", "alpn_select_cb",
+ "npn_select_cb"].map { |x| "@#{x}" }
+
+ # A callback invoked when DH parameters are required.
+ #
+ # The callback is invoked with the Session for the key exchange, an
+ # flag indicating the use of an export cipher and the keylength
+ # required.
+ #
+ # The callback must return an OpenSSL::PKey::DH instance of the correct
+ # key length.
+
+ attr_accessor :tmp_dh_callback
+
+ if ExtConfig::HAVE_TLSEXT_HOST_NAME
+ # A callback invoked at connect time to distinguish between multiple
+ # server names.
+ #
+ # The callback is invoked with an SSLSocket and a server name. The
+ # callback must return an SSLContext for the server name or nil.
+ attr_accessor :servername_cb
+ end
+
+ # call-seq:
+ # SSLContext.new => ctx
+ # SSLContext.new(:TLSv1) => ctx
+ # SSLContext.new("SSLv23_client") => ctx
+ #
+ # You can get a list of valid methods with OpenSSL::SSL::SSLContext::METHODS
+ def initialize(version = nil)
+ INIT_VARS.each { |v| instance_variable_set v, nil }
+ self.options = self.options | OpenSSL::SSL::OP_ALL
+ return unless version
+ self.ssl_version = version
+ end
+
##
# Sets the parameters for this SSL context to the values in +params+.
# The keys in +params+ must be assignment methods on SSLContext.
@@ -85,15 +162,6 @@ module OpenSSL
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|
@@ -104,8 +172,7 @@ module OpenSSL
case san.tag
when 2 # dNSName in GeneralName (RFC5280)
should_verify_common_name = false
- reg = Regexp.escape(san.value).gsub(/\\\*/, "[^.]+")
- return true if /\A#{reg}\z/i =~ hostname
+ return true if verify_hostname(hostname, san.value)
when 7 # iPAddress in GeneralName (RFC5280)
should_verify_common_name = false
# follows GENERAL_NAME_print() in x509v3/v3_alt.c
@@ -120,8 +187,7 @@ module OpenSSL
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
+ return true if verify_hostname(hostname, value)
end
}
end
@@ -129,12 +195,125 @@ module OpenSSL
end
module_function :verify_certificate_identity
+ def verify_hostname(hostname, san) # :nodoc:
+ # RFC 5280, IA5String is limited to the set of ASCII characters
+ return false unless san.ascii_only?
+ return false unless hostname.ascii_only?
+
+ # See RFC 6125, section 6.4.1
+ # Matching is case-insensitive.
+ san_parts = san.downcase.split(".")
+
+ # TODO: this behavior should probably be more strict
+ return san == hostname if san_parts.size < 2
+
+ # Matching is case-insensitive.
+ host_parts = hostname.downcase.split(".")
+
+ # RFC 6125, section 6.4.3, subitem 2.
+ # If the wildcard character is the only character of the left-most
+ # label in the presented identifier, the client SHOULD NOT compare
+ # against anything but the left-most label of the reference
+ # identifier (e.g., *.example.com would match foo.example.com but
+ # not bar.foo.example.com or example.com).
+ return false unless san_parts.size == host_parts.size
+
+ # RFC 6125, section 6.4.3, subitem 1.
+ # The client SHOULD NOT attempt to match a presented identifier in
+ # which the wildcard character comprises a label other than the
+ # left-most label (e.g., do not match bar.*.example.net).
+ return false unless verify_wildcard(host_parts.shift, san_parts.shift)
+
+ san_parts.join(".") == host_parts.join(".")
+ end
+ module_function :verify_hostname
+
+ def verify_wildcard(domain_component, san_component) # :nodoc:
+ parts = san_component.split("*", -1)
+
+ return false if parts.size > 2
+ return san_component == domain_component if parts.size == 1
+
+ # RFC 6125, section 6.4.3, subitem 3.
+ # The client SHOULD NOT attempt to match a presented identifier
+ # where the wildcard character is embedded within an A-label or
+ # U-label of an internationalized domain name.
+ return false if domain_component.start_with?("xn--") && san_component != "*"
+
+ parts[0].length + parts[1].length < domain_component.length &&
+ domain_component.start_with?(parts[0]) &&
+ domain_component.end_with?(parts[1])
+ end
+ module_function :verify_wildcard
+
class SSLSocket
include Buffering
include SocketForwarder
- include Nonblock
+ if ExtConfig::OPENSSL_NO_SOCK
+ def initialize(io, ctx = nil); raise NotImplementedError; end
+ else
+ if ExtConfig::HAVE_TLSEXT_HOST_NAME
+ attr_accessor :hostname
+ end
+
+ attr_reader :io, :context
+ attr_accessor :sync_close
+ alias :to_io :io
+
+ # call-seq:
+ # SSLSocket.new(io) => aSSLSocket
+ # SSLSocket.new(io, ctx) => aSSLSocket
+ #
+ # Creates a new SSL socket from +io+ which must be a real ruby object (not an
+ # IO-like object that responds to read/write).
+ #
+ # If +ctx+ is provided the SSL Sockets initial params will be taken from
+ # the context.
+ #
+ # The OpenSSL::Buffering module provides additional IO methods.
+ #
+ # This method will freeze the SSLContext if one is provided;
+ # however, session management is still allowed in the frozen SSLContext.
+
+ def initialize(io, context = OpenSSL::SSL::SSLContext.new)
+ @io = io
+ @context = context
+ @sync_close = false
+ @hostname = nil
+ @io.nonblock = true if @io.respond_to?(:nonblock=)
+ context.setup
+ super()
+ end
+ end
+
+ # call-seq:
+ # ssl.sysclose => nil
+ #
+ # Sends "close notify" to the peer and tries to shut down the SSL
+ # connection gracefully.
+ #
+ # If sync_close is set to +true+, the underlying IO is also closed.
+ def sysclose
+ return if closed?
+ stop
+ io.close if sync_close
+ end
+
+ ##
+ # Perform hostname verification after an SSL connection is established
+ #
+ # This method MUST be called after calling #connect to ensure that the
+ # hostname of a remote peer has been verified.
def post_connection_check(hostname)
+ if peer_cert.nil?
+ msg = "Peer verification enabled, but no certificate received."
+ if using_anon_cipher?
+ msg += " Anonymous cipher suite #{cipher[0]} was negotiated. Anonymous suites must be disabled to use peer verification."
+ end
+ raise SSLError, msg
+ end
+
unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
raise SSLError, "hostname \"#{hostname}\" does not match the server certificate"
end
@@ -146,6 +325,34 @@ module OpenSSL
rescue SSL::Session::SessionError
nil
end
+
+ private
+
+ def using_anon_cipher?
+ ctx = OpenSSL::SSL::SSLContext.new
+ ctx.ciphers = "aNULL"
+ ctx.ciphers.include?(cipher)
+ end
+
+ def client_cert_cb
+ @context.client_cert_cb
+ end
+
+ def tmp_dh_callback
+ @context.tmp_dh_callback || OpenSSL::PKey::DEFAULT_TMP_DH_CALLBACK
+ end
+
+ def tmp_ecdh_callback
+ @context.tmp_ecdh_callback
+ end
+
+ def session_new_cb
+ @context.session_new_cb
+ end
+
+ def session_get_cb
+ @context.session_get_cb
+ end
end
##
@@ -187,14 +394,21 @@ module OpenSSL
# Works similar to TCPServer#accept.
def accept
- sock = @svr.accept
+ # Socket#accept returns [socket, addrinfo].
+ # TCPServer#accept returns a socket.
+ # The following comma strips addrinfo.
+ 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
+ rescue Exception => ex
+ if ssl
+ ssl.close
+ else
+ sock.close
+ end
raise ex
end
end
diff --git a/ext/openssl/lib/openssl/x509.rb b/ext/openssl/lib/openssl/x509.rb
index 31a4381db4..aef3456e0f 100644
--- a/ext/openssl/lib/openssl/x509.rb
+++ b/ext/openssl/lib/openssl/x509.rb
@@ -1,7 +1,5 @@
+# frozen_string_literal: false
#--
-#
-# $RCSfile$
-#
# = Ruby-space definitions that completes C-space funcs for X509 and subclasses
#
# = Info
@@ -10,12 +8,8 @@
# All rights reserved.
#
# = Licence
-# This program is licenced under the same licence as Ruby.
+# This program is licensed under the same licence as Ruby.
# (See the file 'LICENCE'.)
-#
-# = Version
-# $Id$
-#
#++
module OpenSSL
@@ -70,7 +64,7 @@ module OpenSSL
HexPair = /#{HexChar}#{HexChar}/
HexString = /#{HexPair}+/
Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
- StringChar = /[^#{Special}\\"]/
+ StringChar = /[^\\"#{Special}]/
QuoteChar = /[^\\"]/
AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
AttributeValue = /
@@ -151,6 +145,13 @@ module OpenSSL
alias parse parse_openssl
end
+
+ def pretty_print(q)
+ q.object_group(self) {
+ q.text ' '
+ q.text to_s(OpenSSL::X509::Name::RFC2253)
+ }
+ end
end
class StoreContext
@@ -158,5 +159,18 @@ module OpenSSL
warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
end
end
+
+ class Certificate
+ def pretty_print(q)
+ q.object_group(self) {
+ q.breakable
+ q.text 'subject='; q.pp self.subject; q.text ','; q.breakable
+ q.text 'issuer='; q.pp self.issuer; q.text ','; q.breakable
+ q.text 'serial='; q.pp self.serial; q.text ','; q.breakable
+ q.text 'not_before='; q.pp self.not_before; q.text ','; q.breakable
+ q.text 'not_after='; q.pp self.not_after
+ }
+ end
+ end
end
end
diff --git a/ext/openssl/openssl_missing.c b/ext/openssl/openssl_missing.c
index b5efaaf15d..31f2d0a5f9 100644
--- a/ext/openssl/openssl_missing.c
+++ b/ext/openssl/openssl_missing.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include RUBY_EXTCONF_H
@@ -35,20 +34,6 @@ HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
#endif /* HAVE_HMAC_CTX_COPY */
#endif /* NO_HMAC */
-#if !defined(HAVE_X509_STORE_SET_EX_DATA)
-int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data)
-{
- return CRYPTO_set_ex_data(&str->ex_data, idx, data);
-}
-#endif
-
-#if !defined(HAVE_X509_STORE_GET_EX_DATA)
-void *X509_STORE_get_ex_data(X509_STORE *str, int idx)
-{
- return CRYPTO_get_ex_data(&str->ex_data, idx);
-}
-#endif
-
#if !defined(HAVE_EVP_MD_CTX_CREATE)
EVP_MD_CTX *
EVP_MD_CTX_create(void)
@@ -353,4 +338,3 @@ ASN1_put_eoc(unsigned char **pp)
return 2;
}
#endif
-
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 3635f88b73..955579cf9f 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_OPENSSL_MISSING_H_)
@@ -134,11 +133,16 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
#endif
#if !defined(HAVE_X509_STORE_GET_EX_DATA)
-void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
+# define X509_STORE_get_ex_data(x, idx) \
+ CRYPTO_get_ex_data(&(x)->ex_data, (idx))
#endif
#if !defined(HAVE_X509_STORE_SET_EX_DATA)
-int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
+# define X509_STORE_set_ex_data(x, idx, data) \
+ CRYPTO_set_ex_data(&(x)->ex_data, (idx), (data))
+# define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
+ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, (l), (p), \
+ (newf), (dupf), (freef))
#endif
#if !defined(HAVE_X509_CRL_SET_VERSION)
@@ -195,4 +199,3 @@ int ASN1_put_eoc(unsigned char **pp);
#endif /* _OSSL_OPENSSL_MISSING_H_ */
-
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index 43ccf4c3fd..fb8f2c8171 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -18,11 +17,12 @@ int
string2hex(const unsigned char *buf, int buf_len, char **hexbuf, int *hexbuf_len)
{
static const char hex[]="0123456789abcdef";
- int i, len = 2 * buf_len;
+ int i, len;
- if (buf_len < 0 || len < buf_len) { /* PARANOIA? */
+ if (buf_len < 0 || buf_len > INT_MAX / 2) { /* PARANOIA? */
return -1;
}
+ len = 2 * buf_len;
if (!hexbuf) { /* if no buf, return calculated len */
if (hexbuf_len) {
*hexbuf_len = len;
@@ -198,7 +198,8 @@ ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd)
/*
* Verify callback
*/
-int ossl_verify_cb_idx;
+int ossl_store_ctx_ex_verify_cb_idx;
+int ossl_store_ex_verify_cb_idx;
VALUE
ossl_call_verify_cb_proc(struct ossl_verify_cb_args *args)
@@ -214,10 +215,10 @@ ossl_verify_cb(int ok, X509_STORE_CTX *ctx)
struct ossl_verify_cb_args args;
int state = 0;
- proc = (VALUE)X509_STORE_CTX_get_ex_data(ctx, ossl_verify_cb_idx);
- if ((void*)proc == 0)
- proc = (VALUE)X509_STORE_get_ex_data(ctx->ctx, ossl_verify_cb_idx);
- if ((void*)proc == 0)
+ proc = (VALUE)X509_STORE_CTX_get_ex_data(ctx, ossl_store_ctx_ex_verify_cb_idx);
+ if (!proc)
+ proc = (VALUE)X509_STORE_get_ex_data(ctx->ctx, ossl_store_ex_verify_cb_idx);
+ if (!proc)
return ok;
if (!NIL_P(proc)) {
ret = Qfalse;
@@ -293,10 +294,9 @@ ossl_to_der_if_possible(VALUE obj)
static VALUE
ossl_make_error(VALUE exc, const char *fmt, va_list args)
{
- char buf[BUFSIZ];
+ VALUE str = Qnil;
const char *msg;
long e;
- int len = 0;
#ifdef HAVE_ERR_PEEK_LAST_ERROR
e = ERR_peek_last_error();
@@ -304,14 +304,20 @@ ossl_make_error(VALUE exc, const char *fmt, va_list args)
e = ERR_peek_error();
#endif
if (fmt) {
- len = vsnprintf(buf, BUFSIZ, fmt, args);
+ str = rb_vsprintf(fmt, args);
}
- if (len < BUFSIZ && e) {
+ if (e) {
if (dOSSL == Qtrue) /* FULL INFO */
msg = ERR_error_string(e, NULL);
else
msg = ERR_reason_error_string(e);
- len += snprintf(buf+len, BUFSIZ-len, "%s%s", (len ? ": " : ""), msg);
+ if (NIL_P(str)) {
+ if (msg) str = rb_str_new_cstr(msg);
+ }
+ else {
+ if (RSTRING_LEN(str)) rb_str_cat2(str, ": ");
+ rb_str_cat2(str, msg ? msg : "(null)");
+ }
}
if (dOSSL == Qtrue){ /* show all errors on the stack */
while ((e = ERR_get_error()) != 0){
@@ -320,8 +326,8 @@ ossl_make_error(VALUE exc, const char *fmt, va_list args)
}
ERR_clear_error();
- if(len > BUFSIZ) len = rb_long2int(strlen(buf));
- return rb_exc_new(exc, buf, len);
+ if (NIL_P(str)) str = rb_str_new(0, 0);
+ return rb_exc_new3(exc, str);
}
void
@@ -355,7 +361,7 @@ ossl_exc_new(VALUE exc, const char *fmt, ...)
* Any errors you see here are probably due to a bug in ruby's OpenSSL implementation.
*/
VALUE
-ossl_get_errors()
+ossl_get_errors(void)
{
VALUE ary;
long e;
@@ -461,7 +467,7 @@ ossl_fips_mode_set(VALUE self, VALUE enabled)
/**
* Stores locks needed for OpenSSL thread safety
*/
-#include "../../thread_native.h"
+#include "ruby/thread_native.h"
static rb_nativethread_lock_t *ossl_locks;
static void
@@ -550,6 +556,20 @@ static void Init_ossl_locks(void)
* OpenSSL provides SSL, TLS and general purpose cryptography. It wraps the
* OpenSSL[http://www.openssl.org/] library.
*
+ * = Install
+ *
+ * OpenSSL comes bundled with the Standard Library of Ruby.
+ *
+ * This means the OpenSSL extension is compiled with Ruby and packaged on
+ * build. During compile time, Ruby will need to link against the OpenSSL
+ * library on your system. However, you cannot use openssl provided by Apple to
+ * build standard library openssl.
+ *
+ * If you use OSX, you should install another openssl and run ```./configure
+ * --with-openssl-dir=/path/to/another-openssl```. For Homebrew user, run `brew
+ * install openssl` and then ```./configure --with-openssl-dir=`brew --prefix
+ * openssl` ```.
+ *
* = Examples
*
* All examples assume you have loaded OpenSSL with:
@@ -742,27 +762,27 @@ static void Init_ossl_locks(void)
*
* First set up the cipher for encryption
*
- * encrypter = OpenSSL::Cipher.new 'AES-128-CBC'
- * encrypter.encrypt
- * encrypter.pkcs5_keyivgen pass_phrase, salt
+ * encryptor = OpenSSL::Cipher.new 'AES-128-CBC'
+ * encryptor.encrypt
+ * encryptor.pkcs5_keyivgen pass_phrase, salt
*
* Then pass the data you want to encrypt through
*
- * encrypted = encrypter.update 'top secret document'
- * encrypted << encrypter.final
+ * encrypted = encryptor.update 'top secret document'
+ * encrypted << encryptor.final
*
* === Decryption
*
* Use a new Cipher instance set up for decryption
*
- * decrypter = OpenSSL::Cipher.new 'AES-128-CBC'
- * decrypter.decrypt
- * decrypter.pkcs5_keyivgen pass_phrase, salt
+ * decryptor = OpenSSL::Cipher.new 'AES-128-CBC'
+ * decryptor.decrypt
+ * decryptor.pkcs5_keyivgen pass_phrase, salt
*
* Then pass the data you want to decrypt through
*
- * plain = decrypter.update encrypted
- * plain << decrypter.final
+ * plain = decryptor.update encrypted
+ * plain << decryptor.final
*
* == X509 Certificates
*
@@ -1028,7 +1048,7 @@ static void Init_ossl_locks(void)
*
*/
void
-Init_openssl()
+Init_openssl(void)
{
/*
* Init timezone info
@@ -1078,6 +1098,11 @@ Init_openssl()
rb_define_const(mOSSL, "OPENSSL_VERSION", rb_str_new2(OPENSSL_VERSION_TEXT));
/*
+ * Version of OpenSSL the ruby OpenSSL extension is running with
+ */
+ rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(SSLeay_version(SSLEAY_VERSION)));
+
+ /*
* Version number of OpenSSL the ruby OpenSSL extension was built with
* (base 16)
*/
@@ -1103,8 +1128,10 @@ Init_openssl()
/*
* Verify callback Proc index for ext-data
*/
- if ((ossl_verify_cb_idx = X509_STORE_CTX_get_ex_new_index(0, (void *)"ossl_verify_cb_idx", 0, 0, 0)) < 0)
+ if ((ossl_store_ctx_ex_verify_cb_idx = X509_STORE_CTX_get_ex_new_index(0, (void *)"ossl_store_ctx_ex_verify_cb_idx", 0, 0, 0)) < 0)
ossl_raise(eOSSLError, "X509_STORE_CTX_get_ex_new_index");
+ if ((ossl_store_ex_verify_cb_idx = X509_STORE_get_ex_new_index(0, (void *)"ossl_store_ex_verify_cb_idx", 0, 0, 0)) < 0)
+ ossl_raise(eOSSLError, "X509_STORE_get_ex_new_index");
/*
* Init debug core
@@ -1154,4 +1181,3 @@ main(int argc, char *argv[])
return 0;
}
#endif /* OSSL_DEBUG */
-
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 96d0ade11e..8e6f2ce7e3 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_H_)
@@ -45,7 +44,7 @@ extern "C" {
# define assert(condition)
#endif
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(LIBRESSL_VERSION_NUMBER)
# include <openssl/e_os2.h>
# define OSSL_NO_CONF_API 1
# if !defined(OPENSSL_SYS_WIN32)
@@ -64,6 +63,9 @@ extern "C" {
#include <openssl/rand.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
+#if !defined(_WIN32)
+# include <openssl/crypto.h>
+#endif
#undef X509_NAME
#undef PKCS7_SIGNER_INFO
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
@@ -95,15 +97,15 @@ extern VALUE eOSSLError;
*/
#define OSSL_Check_Kind(obj, klass) do {\
if (!rb_obj_is_kind_of((obj), (klass))) {\
- ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected kind of %s)",\
- rb_obj_classname(obj), rb_class2name(klass));\
+ ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected kind of %"PRIsVALUE")",\
+ rb_obj_class(obj), (klass));\
}\
} while (0)
#define OSSL_Check_Instance(obj, klass) do {\
if (!rb_obj_is_instance_of((obj), (klass))) {\
- ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected instance of %s)",\
- rb_obj_classname(obj), rb_class2name(klass));\
+ ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected instance of %"PRIsVALUE")",\
+ rb_obj_class(obj), (klass));\
}\
} while (0)
@@ -137,8 +139,8 @@ VALUE ossl_x509name_sk2ary(STACK_OF(X509_NAME) *names);
VALUE ossl_buf2str(char *buf, int len);
#define ossl_str_adjust(str, p) \
do{\
- int len = RSTRING_LENINT(str);\
- int newlen = rb_long2int((p) - (unsigned char*)RSTRING_PTR(str));\
+ long len = RSTRING_LEN(str);\
+ long newlen = (long)((p) - (unsigned char*)RSTRING_PTR(str));\
assert(newlen <= len);\
rb_str_set_len((str), newlen);\
}while(0)
@@ -165,7 +167,8 @@ VALUE ossl_exc_new(VALUE, const char *, ...);
/*
* Verify callback
*/
-extern int ossl_verify_cb_idx;
+extern int ossl_store_ctx_ex_verify_cb_idx;
+extern int ossl_store_ex_verify_cb_idx;
struct ossl_verify_cb_args {
VALUE proc;
@@ -244,4 +247,3 @@ void Init_openssl(void);
#endif
#endif /* _OSSL_H_ */
-
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index e3f59bfe1e..444440125c 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -495,7 +494,7 @@ typedef struct {
VALUE *klass;
} ossl_asn1_info_t;
-static ossl_asn1_info_t ossl_asn1_info[] = {
+static const ossl_asn1_info_t ossl_asn1_info[] = {
{ "EOC", &cASN1EndOfContent, }, /* 0 */
{ "BOOLEAN", &cASN1Boolean, }, /* 1 */
{ "INTEGER", &cASN1Integer, }, /* 2 */
@@ -529,7 +528,7 @@ static ossl_asn1_info_t ossl_asn1_info[] = {
{ "BMPSTRING", &cASN1BMPString, }, /* 30 */
};
-int ossl_asn1_info_size = (sizeof(ossl_asn1_info)/sizeof(ossl_asn1_info[0]));
+enum {ossl_asn1_info_size = (sizeof(ossl_asn1_info)/sizeof(ossl_asn1_info[0]))};
static VALUE class_tag_map;
@@ -624,8 +623,8 @@ ossl_asn1_default_tag(VALUE obj)
}
tmp_class = rb_class_superclass(tmp_class);
}
- ossl_raise(eASN1Error, "universal tag for %s not found",
- rb_class2name(CLASS_OF(obj)));
+ ossl_raise(eASN1Error, "universal tag for %"PRIsVALUE" not found",
+ rb_obj_class(obj));
return -1; /* dummy */
}
@@ -871,19 +870,18 @@ int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length,
{
VALUE value, asn1data, ary;
int infinite;
- long off = *offset;
+ long available_len, off = *offset;
infinite = (j == 0x21);
ary = rb_ary_new();
- while (length > 0 || infinite) {
+ available_len = infinite ? max_len : length;
+ while (available_len > 0) {
long inner_read = 0;
- value = ossl_asn1_decode0(pp, max_len, &off, depth + 1, yield, &inner_read);
+ value = ossl_asn1_decode0(pp, available_len, &off, depth + 1, yield, &inner_read);
*num_read += inner_read;
- max_len -= inner_read;
+ available_len -= inner_read;
rb_ary_push(ary, value);
- if (length > 0)
- length -= inner_read;
if (infinite &&
NUM2INT(ossl_asn1_get_tag(value)) == V_ASN1_EOC &&
@@ -974,7 +972,7 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, int depth,
if(j & V_ASN1_CONSTRUCTED) {
*pp += hlen;
off += hlen;
- asn1data = int_ossl_asn1_decode0_cons(pp, length, len, &off, depth, yield, j, tag, tag_class, &inner_read);
+ asn1data = int_ossl_asn1_decode0_cons(pp, length - hlen, len, &off, depth, yield, j, tag, tag_class, &inner_read);
inner_read += hlen;
}
else {
@@ -1029,7 +1027,7 @@ static VALUE
ossl_asn1_traverse(VALUE self, VALUE obj)
{
unsigned char *p;
- volatile VALUE tmp;
+ VALUE tmp;
long len, read = 0, offset = 0;
obj = ossl_to_der_if_possible(obj);
@@ -1037,6 +1035,7 @@ ossl_asn1_traverse(VALUE self, VALUE obj)
p = (unsigned char *)RSTRING_PTR(tmp);
len = RSTRING_LEN(tmp);
ossl_asn1_decode0(&p, len, &offset, 0, 1, &read);
+ RB_GC_GUARD(tmp);
int_ossl_decode_sanity_check(len, read, offset);
return Qnil;
}
@@ -1058,7 +1057,7 @@ ossl_asn1_decode(VALUE self, VALUE obj)
{
VALUE ret;
unsigned char *p;
- volatile VALUE tmp;
+ VALUE tmp;
long len, read = 0, offset = 0;
obj = ossl_to_der_if_possible(obj);
@@ -1066,6 +1065,7 @@ ossl_asn1_decode(VALUE self, VALUE obj)
p = (unsigned char *)RSTRING_PTR(tmp);
len = RSTRING_LEN(tmp);
ret = ossl_asn1_decode0(&p, len, &offset, 0, 0, &read);
+ RB_GC_GUARD(tmp);
int_ossl_decode_sanity_check(len, read, offset);
return ret;
}
@@ -1089,7 +1089,7 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
VALUE ary, val;
unsigned char *p;
long len, tmp_len = 0, read = 0, offset = 0;
- volatile VALUE tmp;
+ VALUE tmp;
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
@@ -1104,6 +1104,7 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
read += tmp_read;
tmp_len -= tmp_read;
}
+ RB_GC_GUARD(tmp);
int_ossl_decode_sanity_check(len, read, offset);
return ary;
}
@@ -1150,7 +1151,7 @@ ossl_asn1_initialize(int argc, VALUE *argv, VALUE self)
}
if(!SYMBOL_P(tag_class))
ossl_raise(eASN1Error, "invalid tag class");
- if(SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
+ if(!NIL_P(tagging) && SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
ossl_raise(eASN1Error, "tag number for Universal too large");
}
else{
@@ -1360,13 +1361,13 @@ ossl_asn1cons_each(VALUE self)
/*
* call-seq:
- * ObjectId.register(object_id, short_name, long_name)
+ * OpenSSL::ASN1::ObjectId.register(object_id, short_name, long_name)
*
* This adds a new ObjectId to the internal tables. Where +object_id+ is the
* numerical form, +short_name+ is the short name, and +long_name+ is the long
* name.
*
- * Returns +true+ if successful. Raises an ASN1Error otherwise.
+ * Returns +true+ if successful. Raises an OpenSSL::ASN1::ASN1Error if it fails.
*
*/
static VALUE
@@ -1384,11 +1385,11 @@ ossl_asn1obj_s_register(VALUE self, VALUE oid, VALUE sn, VALUE ln)
/* Document-method: OpenSSL::ASN1::ObjectId#sn
*
- * The short name of the ObjectId, as defined in +openssl/objects.h+.
+ * The short name of the ObjectId, as defined in <openssl/objects.h>.
*/
/* Document-method: OpenSSL::ASN1::ObjectId#short_name
*
- * #short_name is an alias to #sn
+ * +short_name+ is an alias to +sn+
*/
static VALUE
ossl_asn1obj_get_sn(VALUE self)
@@ -1405,11 +1406,11 @@ ossl_asn1obj_get_sn(VALUE self)
/* Document-method: OpenSSL::ASN1::ObjectId#ln
*
- * The long name of the ObjectId, as defined in +openssl/objects.h+.
+ * The long name of the ObjectId, as defined in <openssl/objects.h>.
*/
-/* Document-method: OpenSSL::ASN1::ObjectId.long_name
+/* Document-method: OpenSSL::ASN1::ObjectId#long_name
*
- * #long_name is an alias to #ln
+ * +long_name+ is an alias to +ln+
*/
static VALUE
ossl_asn1obj_get_ln(VALUE self)
@@ -1426,7 +1427,7 @@ ossl_asn1obj_get_ln(VALUE self)
/* Document-method: OpenSSL::ASN1::ObjectId#oid
*
- * The object identifier as a String.
+ * The object identifier as a +String+, e.g. "1.2.3.4.5"
*/
static VALUE
ossl_asn1obj_get_oid(VALUE self)
@@ -1472,7 +1473,7 @@ OSSL_ASN1_IMPL_FACTORY_METHOD(Set)
OSSL_ASN1_IMPL_FACTORY_METHOD(EndOfContent)
void
-Init_ossl_asn1()
+Init_ossl_asn1(void)
{
VALUE ary;
int i;
@@ -1809,6 +1810,10 @@ Init_ossl_asn1()
*
* == OpenSSL::ASN1::ObjectId
*
+ * NOTE: While OpenSSL::ASN1::ObjectId.new will allocate a new ObjectId,
+ * it is not typically allocated this way, but rather that are received from
+ * parsed ASN1 encodings.
+ *
* While OpenSSL::ASN1::ObjectId.new will allocate a new ObjectId, it is
* not typically allocated this way, but rather that are received from
* parsed ASN1 encodings.
diff --git a/ext/openssl/ossl_asn1.h b/ext/openssl/ossl_asn1.h
index 718f43f068..8250746c79 100644
--- a/ext/openssl/ossl_asn1.h
+++ b/ext/openssl/ossl_asn1.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_ASN1_H_)
diff --git a/ext/openssl/ossl_bio.c b/ext/openssl/ossl_bio.c
index a11c08c1a3..cd2582646b 100644
--- a/ext/openssl/ossl_bio.c
+++ b/ext/openssl/ossl_bio.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -18,7 +17,7 @@ ossl_obj2bio(VALUE obj)
{
BIO *bio;
- if (TYPE(obj) == T_FILE) {
+ if (RB_TYPE_P(obj, T_FILE)) {
rb_io_t *fptr;
FILE *fp;
int fd;
@@ -30,8 +29,9 @@ ossl_obj2bio(VALUE obj)
}
rb_update_max_fd(fd);
if (!(fp = fdopen(fd, "r"))){
+ int e = errno;
close(fd);
- rb_sys_fail(0);
+ rb_syserr_fail(e, 0);
}
if (!(bio = BIO_new_fp(fp, BIO_CLOSE))){
fclose(fp);
diff --git a/ext/openssl/ossl_bio.h b/ext/openssl/ossl_bio.h
index 2d8f675c5b..1705d0ac89 100644
--- a/ext/openssl/ossl_bio.h
+++ b/ext/openssl/ossl_bio.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_BIO_H_)
@@ -18,4 +17,3 @@ VALUE ossl_membio2str(BIO*);
VALUE ossl_protect_membio2str(BIO*,int*);
#endif
-
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index 05473635ae..57bb68099a 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -1,25 +1,26 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Technorama team <oss-ruby@technorama.net>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
/* modified by Michal Rokos <m.rokos@sh.cvut.cz> */
#include "ossl.h"
-#define WrapBN(klass, obj, bn) do { \
+#define NewBN(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_bn_type, 0)
+#define SetBN(obj, bn) do { \
if (!(bn)) { \
ossl_raise(rb_eRuntimeError, "BN wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, BN_clear_free, (bn)); \
+ RTYPEDDATA_DATA(obj) = (bn); \
} while (0)
#define GetBN(obj, bn) do { \
- Data_Get_Struct((obj), BIGNUM, (bn)); \
+ TypedData_Get_Struct((obj), BIGNUM, &ossl_bn_type, (bn)); \
if (!(bn)) { \
ossl_raise(rb_eRuntimeError, "BN wasn't initialized!"); \
} \
@@ -30,10 +31,36 @@
GetBN((obj), (bn)); \
} while (0)
+static void
+ossl_bn_free(void *ptr)
+{
+ BN_clear_free(ptr);
+}
+
+static size_t
+ossl_bn_size(const void *ptr)
+{
+ return sizeof(BIGNUM);
+}
+
+static const rb_data_type_t ossl_bn_type = {
+ "OpenSSL/BN",
+ {0, ossl_bn_free, ossl_bn_size,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Classes
*/
VALUE cBN;
+
+/* Document-class: OpenSSL::BNError
+ *
+ * BNError < OpenSSLError
+ *
+ * Generic Error for all of OpenSSL::BN (big num)
+ */
VALUE eBNError;
/*
@@ -45,19 +72,21 @@ ossl_bn_new(const BIGNUM *bn)
BIGNUM *newbn;
VALUE obj;
+ obj = NewBN(cBN);
newbn = bn ? BN_dup(bn) : BN_new();
if (!newbn) {
ossl_raise(eBNError, NULL);
}
- WrapBN(cBN, obj, newbn);
+ SetBN(obj, newbn);
return obj;
}
-BIGNUM *
-GetBNPtr(VALUE obj)
+static BIGNUM *
+try_convert_to_bnptr(VALUE obj)
{
BIGNUM *bn = NULL;
+ VALUE newobj;
if (RTEST(rb_obj_is_kind_of(obj, cBN))) {
GetBN(obj, bn);
@@ -65,19 +94,26 @@ GetBNPtr(VALUE obj)
case T_FIXNUM:
case T_BIGNUM:
obj = rb_String(obj);
+ newobj = NewBN(cBN); /* GC bug */
if (!BN_dec2bn(&bn, StringValuePtr(obj))) {
ossl_raise(eBNError, NULL);
}
- WrapBN(cBN, obj, bn); /* Handle potencial mem leaks */
- break;
- case T_NIL:
+ SetBN(newobj, bn); /* Handle potencial mem leaks */
break;
- default:
- ossl_raise(rb_eTypeError, "Cannot convert into OpenSSL::BN");
}
return bn;
}
+BIGNUM *
+GetBNPtr(VALUE obj)
+{
+ BIGNUM *bn = try_convert_to_bnptr(obj);
+ if (!bn)
+ ossl_raise(rb_eTypeError, "Cannot convert into OpenSSL::BN");
+
+ return bn;
+}
+
/*
* Private
*/
@@ -92,23 +128,25 @@ static VALUE
ossl_bn_alloc(VALUE klass)
{
BIGNUM *bn;
- VALUE obj;
+ VALUE obj = NewBN(klass);
if (!(bn = BN_new())) {
ossl_raise(eBNError, NULL);
}
- WrapBN(klass, obj, bn);
+ SetBN(obj, bn);
return obj;
}
-/*
- * call-seq:
- * BN.new => aBN
- * BN.new(bn) => aBN
- * BN.new(integer) => aBN
- * BN.new(string) => aBN
- * BN.new(string, 0 | 2 | 10 | 16) => aBN
+/* Document-method: OpenSSL::BN.new
+ *
+ * OpenSSL::BN.new => aBN
+ * OpenSSL::BN.new(bn) => aBN
+ * OpenSSL::BN.new(integer) => aBN
+ * OpenSSL::BN.new(string) => aBN
+ * OpenSSL::BN.new(string, 0 | 2 | 10 | 16) => aBN
+ *
+ * Construct a new OpenSSL BigNum object.
*/
static VALUE
ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
@@ -140,26 +178,24 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
else if (RB_TYPE_P(str, T_BIGNUM)) {
- int i, j, len = RBIGNUM_LENINT(str);
- BDIGIT *ds = RBIGNUM_DIGITS(str);
+ size_t len = rb_absint_size(str, NULL);
+ unsigned char *bin;
VALUE buf;
- unsigned char *bin = (unsigned char*)ALLOCV_N(BDIGIT, buf, len);
-
- for (i = 0; len > i; i++) {
- BDIGIT v = ds[i];
- for (j = SIZEOF_BDIGITS - 1; 0 <= j; j--) {
- bin[(len-1-i)*SIZEOF_BDIGITS+j] = v&0xff;
- v >>= 8;
- }
- }
+ int sign;
+
+ if (INT_MAX < len) {
+ rb_raise(eBNError, "bignum too long");
+ }
+ bin = (unsigned char*)ALLOCV_N(unsigned char, buf, len);
+ sign = rb_integer_pack(str, bin, len, 1, 0, INTEGER_PACK_BIG_ENDIAN);
GetBN(self, bn);
- if (!BN_bin2bn(bin, (int)SIZEOF_BDIGITS*len, bn)) {
+ if (!BN_bin2bn(bin, (int)len, bn)) {
ALLOCV_END(buf);
ossl_raise(eBNError, NULL);
}
ALLOCV_END(buf);
- if (!RBIGNUM_SIGN(str)) BN_set_negative(bn, 1);
+ if (sign < 0) BN_set_negative(bn, 1);
return self;
}
if (RTEST(rb_obj_is_kind_of(str, cBN))) {
@@ -303,11 +339,6 @@ ossl_bn_coerce(VALUE self, VALUE other)
}
#define BIGNUM_BOOL1(func) \
- /* \
- * call-seq: \
- * bn.##func -> true | false \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self) \
{ \
@@ -318,22 +349,33 @@ ossl_bn_coerce(VALUE self, VALUE other)
} \
return Qfalse; \
}
+
+/*
+ * Document-method: OpenSSL::BN#zero?
+ * bn.zero? => true | false
+ */
BIGNUM_BOOL1(is_zero)
+
+/*
+ * Document-method: OpenSSL::BN#one?
+ * bn.one? => true | false
+ */
BIGNUM_BOOL1(is_one)
+
+/*
+ * Document-method: OpenSSL::BN#odd?
+ * bn.odd? => true | false
+ */
BIGNUM_BOOL1(is_odd)
#define BIGNUM_1c(func) \
- /* \
- * call-seq: \
- * bn.##func -> aBN \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self) \
{ \
BIGNUM *bn, *result; \
VALUE obj; \
GetBN(self, bn); \
+ obj = NewBN(CLASS_OF(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -341,23 +383,24 @@ BIGNUM_BOOL1(is_odd)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- WrapBN(CLASS_OF(self), obj, result); \
+ SetBN(obj, result); \
return obj; \
}
+
+/*
+ * Document-method: OpenSSL::BN#sqr
+ * bn.sqr => aBN
+ */
BIGNUM_1c(sqr)
#define BIGNUM_2(func) \
- /* \
- * call-seq: \
- * bn.##func(bn2) -> aBN \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self, VALUE other) \
{ \
BIGNUM *bn1, *bn2 = GetBNPtr(other), *result; \
VALUE obj; \
GetBN(self, bn1); \
+ obj = NewBN(CLASS_OF(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -365,24 +408,30 @@ BIGNUM_1c(sqr)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- WrapBN(CLASS_OF(self), obj, result); \
+ SetBN(obj, result); \
return obj; \
}
+
+/*
+ * Document-method: OpenSSL::BN#+
+ * bn + bn2 => aBN
+ */
BIGNUM_2(add)
+
+/*
+ * Document-method: OpenSSL::BN#-
+ * bn - bn2 => aBN
+ */
BIGNUM_2(sub)
#define BIGNUM_2c(func) \
- /* \
- * call-seq: \
- * bn.##func(bn2) -> aBN \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self, VALUE other) \
{ \
BIGNUM *bn1, *bn2 = GetBNPtr(other), *result; \
VALUE obj; \
GetBN(self, bn1); \
+ obj = NewBN(CLASS_OF(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -390,19 +439,51 @@ BIGNUM_2(sub)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- WrapBN(CLASS_OF(self), obj, result); \
+ SetBN(obj, result); \
return obj; \
}
+
+/*
+ * Document-method: OpenSSL::BN#*
+ * bn * bn2 => aBN
+ */
BIGNUM_2c(mul)
+
+/*
+ * Document-method: OpenSSL::BN#%
+ * bn % bn2 => aBN
+ */
BIGNUM_2c(mod)
+
+/*
+ * Document-method: OpenSSL::BN#**
+ * bn ** bn2 => aBN
+ */
BIGNUM_2c(exp)
+
+/*
+ * Document-method: OpenSSL::BN#gcd
+ * bn.gcd(bn2) => aBN
+ */
BIGNUM_2c(gcd)
+
+/*
+ * Document-method: OpenSSL::BN#mod_sqr
+ * bn.mod_sqr(bn2) => aBN
+ */
BIGNUM_2c(mod_sqr)
+
+/*
+ * Document-method: OpenSSL::BN#mod_inverse
+ * bn.mod_inverse(bn2) => aBN
+ */
BIGNUM_2c(mod_inverse)
/*
- * call-seq:
+ * Document-method: OpenSSL::BN#/
* bn1 / bn2 => [result, remainder]
+ *
+ * Division of OpenSSL::BN instances
*/
static VALUE
ossl_bn_div(VALUE self, VALUE other)
@@ -412,6 +493,8 @@ ossl_bn_div(VALUE self, VALUE other)
GetBN(self, bn1);
+ obj1 = NewBN(CLASS_OF(self));
+ obj2 = NewBN(CLASS_OF(self));
if (!(r1 = BN_new())) {
ossl_raise(eBNError, NULL);
}
@@ -424,18 +507,13 @@ ossl_bn_div(VALUE self, VALUE other)
BN_free(r2);
ossl_raise(eBNError, NULL);
}
- WrapBN(CLASS_OF(self), obj1, r1);
- WrapBN(CLASS_OF(self), obj2, r2);
+ SetBN(obj1, r1);
+ SetBN(obj2, r2);
return rb_ary_new3(2, obj1, obj2);
}
#define BIGNUM_3c(func) \
- /* \
- * call-seq: \
- * bn.##func(bn1, bn2) -> aBN \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self, VALUE other1, VALUE other2) \
{ \
@@ -443,6 +521,7 @@ ossl_bn_div(VALUE self, VALUE other)
BIGNUM *bn3 = GetBNPtr(other2), *result; \
VALUE obj; \
GetBN(self, bn1); \
+ obj = NewBN(CLASS_OF(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -450,20 +529,35 @@ ossl_bn_div(VALUE self, VALUE other)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- WrapBN(CLASS_OF(self), obj, result); \
+ SetBN(obj, result); \
return obj; \
}
+
+/*
+ * Document-method: OpenSSL::BN#mod_add
+ * bn.mod_add(bn1, bn2) -> aBN
+ */
BIGNUM_3c(mod_add)
+
+/*
+ * Document-method: OpenSSL::BN#mod_sub
+ * bn.mod_sub(bn1, bn2) -> aBN
+ */
BIGNUM_3c(mod_sub)
+
+/*
+ * Document-method: OpenSSL::BN#mod_mul
+ * bn.mod_mul(bn1, bn2) -> aBN
+ */
BIGNUM_3c(mod_mul)
+
+/*
+ * Document-method: OpenSSL::BN#mod_exp
+ * bn.mod_exp(bn1, bn2) -> aBN
+ */
BIGNUM_3c(mod_exp)
#define BIGNUM_BIT(func) \
- /* \
- * call-seq: \
- * bn.##func(bit) -> self \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self, VALUE bit) \
{ \
@@ -474,13 +568,32 @@ BIGNUM_3c(mod_exp)
} \
return self; \
}
+
+/*
+ * Document-method: OpenSSL::BN#set_bit!
+ * bn.set_bit!(bit) -> self
+ */
BIGNUM_BIT(set_bit)
+
+/*
+ * Document-method: OpenSSL::BN#clear_bit!
+ * bn.clear_bit!(bit) -> self
+ */
BIGNUM_BIT(clear_bit)
-BIGNUM_BIT(mask_bits)
/*
- * call-seq:
+ * Document-method: OpenSSL::BN#mask_bit!
+ * bn.mask_bit!(bit) -> self
+ */
+BIGNUM_BIT(mask_bits)
+
+/* Document-method: OpenSSL::BN#bit_set?
+ *
+ * Returns boolean of whether +bit+ is set.
+ * Bitwise operations for openssl BIGNUMs.
+ *
* bn.bit_set?(bit) => true | false
+ *
*/
static VALUE
ossl_bn_is_bit_set(VALUE self, VALUE bit)
@@ -497,11 +610,6 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
}
#define BIGNUM_SHIFT(func) \
- /* \
- * call-seq: \
- * bn.##func(bits) -> aBN \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self, VALUE bits) \
{ \
@@ -510,6 +618,7 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
VALUE obj; \
b = NUM2INT(bits); \
GetBN(self, bn); \
+ obj = NewBN(CLASS_OF(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -517,18 +626,25 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- WrapBN(CLASS_OF(self), obj, result); \
+ SetBN(obj, result); \
return obj; \
}
+
+/*
+ * Document-method: OpenSSL::BN#<<
+ * call-seq:
+ * bn << bits -> aBN
+ */
BIGNUM_SHIFT(lshift)
+
+/*
+ * Document-method: OpenSSL::BN#>>
+ * call-seq:
+ * bn >> bits -> aBN
+ */
BIGNUM_SHIFT(rshift)
#define BIGNUM_SELF_SHIFT(func) \
- /* \
- * call-seq: \
- * bn.##func!(bits) -> self \
- * \
- */ \
static VALUE \
ossl_bn_self_##func(VALUE self, VALUE bits) \
{ \
@@ -540,15 +656,20 @@ BIGNUM_SHIFT(rshift)
ossl_raise(eBNError, NULL); \
return self; \
}
+
+/*
+ * Document-method: OpenSSL::BN#lshift!
+ * bn.lshift!(bits) -> self
+ */
BIGNUM_SELF_SHIFT(lshift)
+
+/*
+ * Document-method: OpenSSL::BN#rshift!
+ * bn.rshift!(bits) -> self
+ */
BIGNUM_SELF_SHIFT(rshift)
#define BIGNUM_RAND(func) \
- /* \
- * call-seq: \
- * BN.##func(bits [, fill [, odd]]) -> aBN \
- * \
- */ \
static VALUE \
ossl_bn_s_##func(int argc, VALUE *argv, VALUE klass) \
{ \
@@ -564,6 +685,7 @@ BIGNUM_SELF_SHIFT(rshift)
top = NUM2INT(fill); \
} \
b = NUM2INT(bits); \
+ obj = NewBN(klass); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -571,23 +693,28 @@ BIGNUM_SELF_SHIFT(rshift)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- WrapBN(klass, obj, result); \
+ SetBN(obj, result); \
return obj; \
}
+
+/*
+ * Document-method: OpenSSL::BN.rand
+ * BN.rand(bits [, fill [, odd]]) -> aBN
+ */
BIGNUM_RAND(rand)
+
+/*
+ * Document-method: OpenSSL::BN.pseudo_rand
+ * BN.pseudo_rand(bits [, fill [, odd]]) -> aBN
+ */
BIGNUM_RAND(pseudo_rand)
#define BIGNUM_RAND_RANGE(func) \
- /* \
- * call-seq: \
- * BN.##func(range) -> aBN \
- * \
- */ \
static VALUE \
ossl_bn_s_##func##_range(VALUE klass, VALUE range) \
{ \
BIGNUM *bn = GetBNPtr(range), *result; \
- VALUE obj; \
+ VALUE obj = NewBN(klass); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -595,10 +722,22 @@ BIGNUM_RAND(pseudo_rand)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- WrapBN(klass, obj, result); \
+ SetBN(obj, result); \
return obj; \
}
+
+/*
+ * Document-method: OpenSSL::BN.rand_range
+ * BN.rand_range(range) -> aBN
+ *
+ */
BIGNUM_RAND_RANGE(rand)
+
+/*
+ * Document-method: OpenSSL::BN.pseudo_rand_range
+ * BN.pseudo_rand_range(range) -> aBN
+ *
+ */
BIGNUM_RAND_RANGE(pseudo_rand)
/*
@@ -629,6 +768,7 @@ ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
add = GetBNPtr(vadd);
rem = NIL_P(vrem) ? NULL : GetBNPtr(vrem);
}
+ obj = NewBN(klass);
if (!(result = BN_new())) {
ossl_raise(eBNError, NULL);
}
@@ -636,17 +776,12 @@ ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
BN_free(result);
ossl_raise(eBNError, NULL);
}
- WrapBN(klass, obj, result);
+ SetBN(obj, result);
return obj;
}
#define BIGNUM_NUM(func) \
- /* \
- * call-seq: \
- * bn.##func -> integer \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self) \
{ \
@@ -654,7 +789,17 @@ ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
GetBN(self, bn); \
return INT2FIX(BN_##func(bn)); \
}
+
+/*
+ * Document-method: OpenSSL::BN#num_bytes
+ * bn.num_bytes => integer
+ */
BIGNUM_NUM(num_bytes)
+
+/*
+ * Document-method: OpenSSL::BN#num_bits
+ * bn.num_bits => integer
+ */
BIGNUM_NUM(num_bits)
static VALUE
@@ -676,11 +821,6 @@ ossl_bn_copy(VALUE self, VALUE other)
}
#define BIGNUM_CMP(func) \
- /* \
- * call-seq: \
- * bn.##func(bn2) -> integer \
- * \
- */ \
static VALUE \
ossl_bn_##func(VALUE self, VALUE other) \
{ \
@@ -688,19 +828,97 @@ ossl_bn_copy(VALUE self, VALUE other)
GetBN(self, bn1); \
return INT2FIX(BN_##func(bn1, bn2)); \
}
+
+/*
+ * Document-method: OpenSSL::BN#cmp
+ * bn.cmp(bn2) => integer
+ */
+/*
+ * Document-method: OpenSSL::BN#<=>
+ * bn <=> bn2 => integer
+ */
BIGNUM_CMP(cmp)
+
+/*
+ * Document-method: OpenSSL::BN#ucmp
+ * bn.ucmp(bn2) => integer
+ */
BIGNUM_CMP(ucmp)
+/*
+ * call-seq:
+ * bn == obj => true or false
+ *
+ * Returns +true+ only if +obj+ has the same value as +bn+. Contrast this
+ * with OpenSSL::BN#eql?, which requires obj to be OpenSSL::BN.
+ */
static VALUE
-ossl_bn_eql(VALUE self, VALUE other)
+ossl_bn_eq(VALUE self, VALUE other)
{
- if (ossl_bn_cmp(self, other) == INT2FIX(0)) {
+ BIGNUM *bn1, *bn2;
+
+ GetBN(self, bn1);
+ /* BNPtr may raise, so we can't use here */
+ bn2 = try_convert_to_bnptr(other);
+
+ if (bn2 && !BN_cmp(bn1, bn2)) {
return Qtrue;
}
return Qfalse;
}
/*
+ * call-seq:
+ * bn.eql?(obj) => true or false
+ *
+ * Returns <code>true</code> only if <i>obj</i> is a
+ * <code>OpenSSL::BN</code> with the same value as <i>big</i>. Contrast this
+ * with OpenSSL::BN#==, which performs type conversions.
+ */
+static VALUE
+ossl_bn_eql(VALUE self, VALUE other)
+{
+ BIGNUM *bn1, *bn2;
+
+ if (!rb_obj_is_kind_of(other, cBN))
+ return Qfalse;
+ GetBN(self, bn1);
+ GetBN(other, bn2);
+
+ return BN_cmp(bn1, bn2) ? Qfalse : Qtrue;
+}
+
+/*
+ * call-seq:
+ * bn.hash => Integer
+ *
+ * Returns a hash code for this object.
+ *
+ * See also Object#hash.
+ */
+static VALUE
+ossl_bn_hash(VALUE self)
+{
+ BIGNUM *bn;
+ VALUE hash;
+ unsigned char *buf;
+ int len;
+
+ GetBN(self, bn);
+ len = BN_num_bytes(bn);
+ buf = xmalloc(len);
+ if (BN_bn2bin(bn, buf) != len) {
+ xfree(buf);
+ ossl_raise(eBNError, NULL);
+ }
+
+ hash = LONG2FIX((long)rb_memhash(buf, len));
+ xfree(buf);
+
+ return hash;
+}
+
+/*
* call-seq:
* bn.prime? => true | false
* bn.prime?(checks) => true | false
@@ -775,7 +993,7 @@ ossl_bn_is_prime_fasttest(int argc, VALUE *argv, VALUE self)
* (NOTE: ordering of methods is the same as in 'man bn')
*/
void
-Init_ossl_bn()
+Init_ossl_bn(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
@@ -827,8 +1045,9 @@ Init_ossl_bn()
rb_define_alias(cBN, "<=>", "cmp");
rb_define_method(cBN, "ucmp", ossl_bn_ucmp, 1);
rb_define_method(cBN, "eql?", ossl_bn_eql, 1);
- rb_define_alias(cBN, "==", "eql?");
- rb_define_alias(cBN, "===", "eql?");
+ rb_define_method(cBN, "hash", ossl_bn_hash, 0);
+ rb_define_method(cBN, "==", ossl_bn_eq, 1);
+ rb_define_alias(cBN, "===", "==");
rb_define_method(cBN, "zero?", ossl_bn_is_zero, 0);
rb_define_method(cBN, "one?", ossl_bn_is_one, 0);
/* is_word */
@@ -895,4 +1114,3 @@ Init_ossl_bn()
*/
rb_define_method(cBN, "prime_fasttest?", ossl_bn_is_prime_fasttest, -1);
}
-
diff --git a/ext/openssl/ossl_bn.h b/ext/openssl/ossl_bn.h
index d6c396227b..4cd9d0600a 100644
--- a/ext/openssl/ossl_bn.h
+++ b/ext/openssl/ossl_bn.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_BN_H_)
@@ -22,4 +21,3 @@ void Init_ossl_bn(void);
#endif /* _OSS_BN_H_ */
-
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index 03374372ad..24caba6e37 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -1,23 +1,22 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapCipher(obj, klass, ctx) \
- (obj) = Data_Wrap_Struct((klass), 0, ossl_cipher_free, (ctx))
+#define NewCipher(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_cipher_type, 0)
#define MakeCipher(obj, klass, ctx) \
- (obj) = Data_Make_Struct((klass), EVP_CIPHER_CTX, 0, ossl_cipher_free, (ctx))
+ (obj) = TypedData_Make_Struct((klass), EVP_CIPHER_CTX, &ossl_cipher_type, (ctx))
#define AllocCipher(obj, ctx) \
- memset(DATA_PTR(obj) = (ctx) = ALLOC(EVP_CIPHER_CTX), 0, sizeof(EVP_CIPHER_CTX))
+ (DATA_PTR(obj) = (ctx) = ZALLOC(EVP_CIPHER_CTX))
#define GetCipherInit(obj, ctx) do { \
- Data_Get_Struct((obj), EVP_CIPHER_CTX, (ctx)); \
+ TypedData_Get_Struct((obj), EVP_CIPHER_CTX, &ossl_cipher_type, (ctx)); \
} while (0)
#define GetCipher(obj, ctx) do { \
GetCipherInit((obj), (ctx)); \
@@ -35,8 +34,18 @@
*/
VALUE cCipher;
VALUE eCipherError;
+static ID id_key_set;
static VALUE ossl_cipher_alloc(VALUE klass);
+static void ossl_cipher_free(void *ptr);
+static size_t ossl_cipher_memsize(const void *ptr);
+
+static const rb_data_type_t ossl_cipher_type = {
+ "OpenSSL/Cipher",
+ {0, ossl_cipher_free, ossl_cipher_memsize,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+};
/*
* PUBLIC
@@ -70,22 +79,26 @@ ossl_cipher_new(const EVP_CIPHER *cipher)
* PRIVATE
*/
static void
-ossl_cipher_free(EVP_CIPHER_CTX *ctx)
+ossl_cipher_free(void *ptr)
{
+ EVP_CIPHER_CTX *ctx = ptr;
if (ctx) {
EVP_CIPHER_CTX_cleanup(ctx);
ruby_xfree(ctx);
}
}
+static size_t
+ossl_cipher_memsize(const void *ptr)
+{
+ const EVP_CIPHER_CTX *ctx = ptr;
+ return sizeof(*ctx);
+}
+
static VALUE
ossl_cipher_alloc(VALUE klass)
{
- VALUE obj;
-
- WrapCipher(obj, klass, 0);
-
- return obj;
+ return NewCipher(klass);
}
/*
@@ -102,7 +115,6 @@ ossl_cipher_initialize(VALUE self, VALUE str)
EVP_CIPHER_CTX *ctx;
const EVP_CIPHER *cipher;
char *name;
- unsigned char key[EVP_MAX_KEY_LENGTH];
name = StringValuePtr(str);
GetCipherInit(self, ctx);
@@ -114,14 +126,7 @@ ossl_cipher_initialize(VALUE self, VALUE str)
if (!(cipher = EVP_get_cipherbyname(name))) {
ossl_raise(rb_eRuntimeError, "unsupported cipher algorithm (%s)", name);
}
- /*
- * 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.
- */
- memset(key, 0, EVP_MAX_KEY_LENGTH);
- if (EVP_CipherInit_ex(ctx, cipher, NULL, key, NULL, -1) != 1)
+ if (EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, -1) != 1)
ossl_raise(eCipherError, NULL);
return self;
@@ -158,7 +163,7 @@ add_cipher_name_to_ary(const OBJ_NAME *name, VALUE ary)
#ifdef HAVE_OBJ_NAME_DO_ALL_SORTED
/*
* call-seq:
- * Cipher.ciphers -> array[string...]
+ * OpenSSL::Cipher.ciphers -> array[string...]
*
* Returns the names of all available ciphers in an array.
*/
@@ -183,7 +188,7 @@ ossl_s_ciphers(VALUE self)
* 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.
+ * Cipher instance may be used several times for encryption or decryption tasks.
*
* Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, -1).
*/
@@ -213,9 +218,9 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
* We deprecated the arguments for this method, but we decided
* keeping this behaviour for backward compatibility.
*/
- const char *cname = rb_class2name(rb_obj_class(self));
- rb_warn("arguments for %s#encrypt and %s#decrypt were deprecated; "
- "use %s#pkcs5_keyivgen to derive key and IV",
+ VALUE cname = rb_class_path(rb_obj_class(self));
+ rb_warn("arguments for %"PRIsVALUE"#encrypt and %"PRIsVALUE"#decrypt were deprecated; "
+ "use %"PRIsVALUE"#pkcs5_keyivgen to derive key and IV",
cname, cname, cname);
StringValue(pass);
GetCipher(self, ctx);
@@ -240,6 +245,9 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
ossl_raise(eCipherError, NULL);
}
+ if (p_key)
+ rb_ivar_set(self, id_key_set, Qtrue);
+
return self;
}
@@ -326,9 +334,38 @@ ossl_cipher_pkcs5_keyivgen(int argc, VALUE *argv, VALUE self)
OPENSSL_cleanse(key, sizeof key);
OPENSSL_cleanse(iv, sizeof iv);
+ rb_ivar_set(self, id_key_set, Qtrue);
+
return Qnil;
}
+static int
+ossl_cipher_update_long(EVP_CIPHER_CTX *ctx, unsigned char *out, long *out_len_ptr,
+ const unsigned char *in, long in_len)
+{
+ int out_part_len;
+ long out_len = 0;
+#define UPDATE_LENGTH_LIMIT INT_MAX
+
+#if SIZEOF_LONG > UPDATE_LENGTH_LIMIT
+ if (in_len > UPDATE_LENGTH_LIMIT) {
+ const int in_part_len = (UPDATE_LENGTH_LIMIT / 2 + 1) & ~1;
+ do {
+ if (!EVP_CipherUpdate(ctx, out ? (out + out_len) : 0,
+ &out_part_len, in, in_part_len))
+ return 0;
+ out_len += out_part_len;
+ in += in_part_len;
+ } while ((in_len -= in_part_len) > UPDATE_LENGTH_LIMIT);
+ }
+#endif
+ if (!EVP_CipherUpdate(ctx, out ? (out + out_len) : 0,
+ &out_part_len, in, (int)in_len))
+ return 0;
+ if (out_len_ptr) *out_len_ptr = out_len += out_part_len;
+ return 1;
+}
+
/*
* call-seq:
* cipher.update(data [, buffer]) -> string or buffer
@@ -347,17 +384,24 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
{
EVP_CIPHER_CTX *ctx;
unsigned char *in;
- int in_len, out_len;
+ long in_len, out_len;
VALUE data, str;
rb_scan_args(argc, argv, "11", &data, &str);
+ if (!RTEST(rb_attr_get(self, id_key_set)))
+ ossl_raise(eCipherError, "key not set");
+
StringValue(data);
in = (unsigned char *)RSTRING_PTR(data);
- if ((in_len = RSTRING_LENINT(data)) == 0)
+ if ((in_len = RSTRING_LEN(data)) == 0)
ossl_raise(rb_eArgError, "data must not be empty");
GetCipher(self, ctx);
out_len = in_len+EVP_CIPHER_CTX_block_size(ctx);
+ if (out_len <= 0) {
+ ossl_raise(rb_eRangeError,
+ "data too big to make output buffer: %ld bytes", in_len);
+ }
if (NIL_P(str)) {
str = rb_str_new(0, out_len);
@@ -366,7 +410,7 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
rb_str_resize(str, out_len);
}
- if (!EVP_CipherUpdate(ctx, (unsigned char *)RSTRING_PTR(str), &out_len, in, in_len))
+ if (!ossl_cipher_update_long(ctx, (unsigned char *)RSTRING_PTR(str), &out_len, in, in_len))
ossl_raise(eCipherError, NULL);
assert(out_len < RSTRING_LEN(str));
rb_str_set_len(str, out_len);
@@ -447,6 +491,8 @@ ossl_cipher_set_key(VALUE self, VALUE key)
if (EVP_CipherInit_ex(ctx, NULL, NULL, (unsigned char *)RSTRING_PTR(key), NULL, -1) != 1)
ossl_raise(eCipherError, NULL);
+ rb_ivar_set(self, id_key_set, Qtrue);
+
return key;
}
@@ -506,17 +552,16 @@ ossl_cipher_set_auth_data(VALUE self, VALUE data)
{
EVP_CIPHER_CTX *ctx;
unsigned char *in;
- int in_len;
- int out_len;
+ long in_len, out_len;
StringValue(data);
in = (unsigned char *) RSTRING_PTR(data);
- in_len = RSTRING_LENINT(data);
+ in_len = RSTRING_LEN(data);
GetCipher(self, ctx);
- if (!EVP_CipherUpdate(ctx, NULL, &out_len, in, in_len))
+ if (!ossl_cipher_update_long(ctx, NULL, &out_len, in, in_len))
ossl_raise(eCipherError, "couldn't set additional authenticated data");
return data;
@@ -966,5 +1011,6 @@ Init_ossl_cipher(void)
rb_define_method(cCipher, "iv_len", ossl_cipher_iv_length, 0);
rb_define_method(cCipher, "block_size", ossl_cipher_block_size, 0);
rb_define_method(cCipher, "padding=", ossl_cipher_set_padding, 1);
-}
+ id_key_set = rb_intern_const("key_set");
+}
diff --git a/ext/openssl/ossl_cipher.h b/ext/openssl/ossl_cipher.h
index bed4fa853b..c444089fc2 100644
--- a/ext/openssl/ossl_cipher.h
+++ b/ext/openssl/ossl_cipher.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_CIPHER_H_)
@@ -19,4 +18,3 @@ VALUE ossl_cipher_new(const EVP_CIPHER *);
void Init_ossl_cipher(void);
#endif /* _OSSL_CIPHER_H_ */
-
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index 0f25a19e50..47d2658453 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -17,7 +16,7 @@
VALUE cConfig;
/* Document-class: OpenSSL::ConfigError
*
- * General error for openssl library configuration files. Including formating,
+ * General error for openssl library configuration files. Including formatting,
* parsing errors, etc.
*/
VALUE eConfigError;
@@ -27,13 +26,13 @@ VALUE eConfigError;
*/
/*
- * GetConfigPtr is a public C-level function for getting OpenSSL CONF struct
+ * DupConfigPtr is a public C-level function for getting OpenSSL CONF struct
* from an OpenSSL::Config(eConfig) instance. We decided to implement
* OpenSSL::Config in Ruby level but we need to pass native CONF struct for
* some OpenSSL features such as X509V3_EXT_*.
*/
CONF *
-GetConfigPtr(VALUE obj)
+DupConfigPtr(VALUE obj)
{
CONF *conf;
VALUE str;
@@ -51,9 +50,10 @@ GetConfigPtr(VALUE obj)
if(!NCONF_load_bio(conf, bio, &eline)){
BIO_free(bio);
NCONF_free(conf);
- if (eline <= 0) ossl_raise(eConfigError, "wrong config format");
- else ossl_raise(eConfigError, "error in line %d", eline);
- ossl_raise(eConfigError, NULL);
+ if (eline <= 0)
+ ossl_raise(eConfigError, "wrong config format");
+ else
+ ossl_raise(eConfigError, "error in line %d", eline);
}
BIO_free(bio);
@@ -69,7 +69,7 @@ GetConfigPtr(VALUE obj)
* INIT
*/
void
-Init_ossl_config()
+Init_ossl_config(void)
{
char *default_config_file;
eConfigError = rb_define_class_under(mOSSL, "ConfigError", eOSSLError);
diff --git a/ext/openssl/ossl_config.h b/ext/openssl/ossl_config.h
index cb226b27e5..627d297ba3 100644
--- a/ext/openssl/ossl_config.h
+++ b/ext/openssl/ossl_config.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_CONFIG_H_)
@@ -14,9 +13,7 @@
extern VALUE cConfig;
extern VALUE eConfigError;
-CONF* GetConfigPtr(VALUE obj);
CONF* DupConfigPtr(VALUE obj);
void Init_ossl_config(void);
#endif /* _OSSL_CONFIG_H_ */
-
diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c
index fdf13e98e5..44968dd9e5 100644
--- a/ext/openssl/ossl_digest.c
+++ b/ext/openssl/ossl_digest.c
@@ -1,17 +1,16 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
#define GetDigest(obj, ctx) do { \
- Data_Get_Struct((obj), EVP_MD_CTX, (ctx)); \
+ TypedData_Get_Struct((obj), EVP_MD_CTX, &ossl_digest_type, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "Digest CTX wasn't initialized!"); \
} \
@@ -29,6 +28,20 @@ VALUE eDigestError;
static VALUE ossl_digest_alloc(VALUE klass);
+static void
+ossl_digest_free(void *ctx)
+{
+ EVP_MD_CTX_destroy(ctx);
+}
+
+static const rb_data_type_t ossl_digest_type = {
+ "OpenSSL/Digest",
+ {
+ 0, ossl_digest_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public
*/
@@ -38,7 +51,7 @@ GetDigestPtr(VALUE obj)
const EVP_MD *md;
ASN1_OBJECT *oid = NULL;
- if (TYPE(obj) == T_STRING) {
+ if (RB_TYPE_P(obj, T_STRING)) {
const char *name = StringValueCStr(obj);
md = EVP_get_digestbyname(name);
@@ -81,13 +94,11 @@ ossl_digest_new(const EVP_MD *md)
static VALUE
ossl_digest_alloc(VALUE klass)
{
- EVP_MD_CTX *ctx;
- VALUE obj;
-
- ctx = EVP_MD_CTX_create();
+ VALUE obj = TypedData_Wrap_Struct(klass, &ossl_digest_type, 0);
+ EVP_MD_CTX *ctx = EVP_MD_CTX_create();
if (ctx == NULL)
ossl_raise(rb_eRuntimeError, "EVP_MD_CTX_create() failed");
- obj = Data_Wrap_Struct(klass, 0, EVP_MD_CTX_destroy, ctx);
+ RTYPEDDATA_DATA(obj) = ctx;
return obj;
}
@@ -294,7 +305,7 @@ ossl_digest_block_length(VALUE self)
* INIT
*/
void
-Init_ossl_digest()
+Init_ossl_digest(void)
{
rb_require("digest");
diff --git a/ext/openssl/ossl_digest.h b/ext/openssl/ossl_digest.h
index 8cc5b1bc56..512f7d3a39 100644
--- a/ext/openssl/ossl_digest.h
+++ b/ext/openssl/ossl_digest.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_DIGEST_H_)
@@ -19,4 +18,3 @@ VALUE ossl_digest_new(const EVP_MD *);
void Init_ossl_digest(void);
#endif /* _OSSL_DIGEST_H_ */
-
diff --git a/ext/openssl/ossl_engine.c b/ext/openssl/ossl_engine.c
index da1a3c7a74..890ec724e5 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -1,25 +1,26 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
#if defined(OSSL_ENGINE_ENABLED)
-#define WrapEngine(klass, obj, engine) do { \
+#define NewEngine(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_engine_type, 0)
+#define SetEngine(obj, engine) do { \
if (!(engine)) { \
ossl_raise(rb_eRuntimeError, "ENGINE wasn't initialized."); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, ENGINE_free, (engine)); \
+ RTYPEDDATA_DATA(obj) = (engine); \
} while(0)
#define GetEngine(obj, engine) do { \
- Data_Get_Struct((obj), ENGINE, (engine)); \
+ TypedData_Get_Struct((obj), ENGINE, &ossl_engine_type, (engine)); \
if (!(engine)) { \
ossl_raise(rb_eRuntimeError, "ENGINE wasn't initialized."); \
} \
@@ -57,6 +58,20 @@ do{\
}\
}while(0)
+static void
+ossl_engine_free(void *engine)
+{
+ ENGINE_free(engine);
+}
+
+static const rb_data_type_t ossl_engine_type = {
+ "OpenSSL/Engine",
+ {
+ 0, ossl_engine_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/* Document-method: OpenSSL::Engine.load
*
* call-seq:
@@ -168,11 +183,12 @@ ossl_engine_s_engines(VALUE klass)
ary = rb_ary_new();
for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)){
+ obj = NewEngine(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);
- WrapEngine(klass, obj, e);
+ SetEngine(obj, e);
rb_ary_push(ary, obj);
}
@@ -199,9 +215,10 @@ ossl_engine_s_by_id(VALUE klass, VALUE id)
StringValue(id);
ossl_engine_s_load(1, &id, klass);
+ obj = NewEngine(klass);
if(!(e = ENGINE_by_id(RSTRING_PTR(id))))
ossl_raise(eEngineError, NULL);
- WrapEngine(klass, obj, e);
+ SetEngine(obj, e);
if(rb_block_given_p()) rb_yield(obj);
if(!ENGINE_init(e))
ossl_raise(eEngineError, NULL);
@@ -218,10 +235,11 @@ ossl_engine_s_alloc(VALUE klass)
ENGINE *e;
VALUE obj;
+ obj = NewEngine(klass);
if (!(e = ENGINE_new())) {
ossl_raise(eEngineError, NULL);
}
- WrapEngine(klass, obj, e);
+ SetEngine(obj, e);
return obj;
}
@@ -523,24 +541,17 @@ ossl_engine_get_cmds(VALUE self)
static VALUE
ossl_engine_inspect(VALUE self)
{
- VALUE str;
- const char *cname = rb_class2name(rb_obj_class(self));
-
- str = rb_str_new2("#<");
- rb_str_cat2(str, cname);
- rb_str_cat2(str, " id=\"");
- rb_str_append(str, ossl_engine_get_id(self));
- rb_str_cat2(str, "\" name=\"");
- rb_str_append(str, ossl_engine_get_name(self));
- rb_str_cat2(str, "\">");
-
- return str;
+ ENGINE *e;
+
+ GetEngine(self, e);
+ return rb_sprintf("#<%"PRIsVALUE" id=\"%s\" name=\"%s\">",
+ rb_obj_class(self), ENGINE_get_id(e), ENGINE_get_name(e));
}
#define DefEngineConst(x) rb_define_const(cEngine, #x, INT2NUM(ENGINE_##x))
void
-Init_ossl_engine()
+Init_ossl_engine(void)
{
cEngine = rb_define_class_under(mOSSL, "Engine", rb_cObject);
eEngineError = rb_define_class_under(cEngine, "EngineError", eOSSLError);
@@ -585,7 +596,7 @@ Init_ossl_engine()
}
#else
void
-Init_ossl_engine()
+Init_ossl_engine(void)
{
}
#endif
diff --git a/ext/openssl/ossl_engine.h b/ext/openssl/ossl_engine.h
index ea2f256912..cd548beea3 100644
--- a/ext/openssl/ossl_engine.h
+++ b/ext/openssl/ossl_engine.h
@@ -1,12 +1,11 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2003 Michal Rokos <m.rokos@sh.cvut.cz>
* Copyright (C) 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(OSSL_ENGINE_H)
diff --git a/ext/openssl/ossl_hmac.c b/ext/openssl/ossl_hmac.c
index 0bba44d783..5513cb20de 100644
--- a/ext/openssl/ossl_hmac.c
+++ b/ext/openssl/ossl_hmac.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(OPENSSL_NO_HMAC)
@@ -13,9 +12,9 @@
#include "ossl.h"
#define MakeHMAC(obj, klass, ctx) \
- (obj) = Data_Make_Struct((klass), HMAC_CTX, 0, ossl_hmac_free, (ctx))
+ (obj) = TypedData_Make_Struct((klass), HMAC_CTX, &ossl_hmac_type, (ctx))
#define GetHMAC(obj, ctx) do { \
- Data_Get_Struct((obj), HMAC_CTX, (ctx)); \
+ TypedData_Get_Struct((obj), HMAC_CTX, &ossl_hmac_type, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "HMAC wasn't initialized"); \
} \
@@ -39,12 +38,20 @@ VALUE eHMACError;
* Private
*/
static void
-ossl_hmac_free(HMAC_CTX *ctx)
+ossl_hmac_free(void *ctx)
{
HMAC_CTX_cleanup(ctx);
ruby_xfree(ctx);
}
+static const rb_data_type_t ossl_hmac_type = {
+ "OpenSSL/HMAC",
+ {
+ 0, ossl_hmac_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE
ossl_hmac_alloc(VALUE klass)
{
@@ -327,7 +334,7 @@ ossl_hmac_s_hexdigest(VALUE klass, VALUE digest, VALUE key, VALUE data)
* INIT
*/
void
-Init_ossl_hmac()
+Init_ossl_hmac(void)
{
#if 0
/* :nodoc: */
@@ -357,8 +364,8 @@ Init_ossl_hmac()
#else /* NO_HMAC */
# warning >>> OpenSSL is compiled without HMAC support <<<
void
-Init_ossl_hmac()
+Init_ossl_hmac(void)
{
- rb_warning("HMAC will NOT be avaible: OpenSSL is compiled without HMAC.");
+ rb_warning("HMAC is not available: OpenSSL is compiled without HMAC.");
}
#endif /* NO_HMAC */
diff --git a/ext/openssl/ossl_hmac.h b/ext/openssl/ossl_hmac.h
index 1a2978b39a..7c51f4722d 100644
--- a/ext/openssl/ossl_hmac.h
+++ b/ext/openssl/ossl_hmac.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_HMAC_H_)
diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c
index b80984cfee..35c2e3e542 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapSPKI(klass, obj, spki) do { \
+#define NewSPKI(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_netscape_spki_type, 0)
+#define SetSPKI(obj, spki) do { \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, NETSCAPE_SPKI_free, (spki)); \
+ RTYPEDDATA_DATA(obj) = (spki); \
} while (0)
#define GetSPKI(obj, spki) do { \
- Data_Get_Struct((obj), NETSCAPE_SPKI, (spki)); \
+ TypedData_Get_Struct((obj), NETSCAPE_SPKI, &ossl_netscape_spki_type, (spki)); \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
@@ -37,16 +38,32 @@ VALUE eSPKIError;
/*
* Private functions
*/
+
+static void
+ossl_netscape_spki_free(void *spki)
+{
+ NETSCAPE_SPKI_free(spki);
+}
+
+static const rb_data_type_t ossl_netscape_spki_type = {
+ "OpenSSL/NETSCAPE_SPKI",
+ {
+ 0, ossl_netscape_spki_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE
ossl_spki_alloc(VALUE klass)
{
NETSCAPE_SPKI *spki;
VALUE obj;
+ obj = NewSPKI(klass);
if (!(spki = NETSCAPE_SPKI_new())) {
ossl_raise(eSPKIError, NULL);
}
- WrapSPKI(klass, obj, spki);
+ SetSPKI(obj, spki);
return obj;
}
@@ -360,7 +377,7 @@ ossl_spki_verify(VALUE self, VALUE key)
*/
void
-Init_ossl_ns_spki()
+Init_ossl_ns_spki(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
@@ -386,4 +403,3 @@ Init_ossl_ns_spki()
rb_define_method(cSPKI, "challenge", ossl_spki_get_challenge, 0);
rb_define_method(cSPKI, "challenge=", ossl_spki_set_challenge, 1);
}
-
diff --git a/ext/openssl/ossl_ns_spki.h b/ext/openssl/ossl_ns_spki.h
index 9977035a9c..62ba8cb163 100644
--- a/ext/openssl/ossl_ns_spki.h
+++ b/ext/openssl/ossl_ns_spki.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_NS_SPKI_H_)
@@ -18,4 +17,3 @@ extern VALUE eSPKIError;
void Init_ossl_ns_spki(void);
#endif /* _OSSL_NS_SPKI_H_ */
-
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c
index 4e2e8394a4..b97e26cf92 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -1,24 +1,25 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2003 Michal Rokos <m.rokos@sh.cvut.cz>
* Copyright (C) 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
#if defined(OSSL_OCSP_ENABLED)
-#define WrapOCSPReq(klass, obj, req) do { \
+#define NewOCSPReq(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_ocsp_request_type, 0)
+#define SetOCSPReq(obj, req) do { \
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
- (obj) = Data_Wrap_Struct((klass), 0, OCSP_REQUEST_free, (req)); \
+ RTYPEDDATA_DATA(obj) = (req); \
} while (0)
#define GetOCSPReq(obj, req) do { \
- Data_Get_Struct((obj), OCSP_REQUEST, (req)); \
+ TypedData_Get_Struct((obj), OCSP_REQUEST, &ossl_ocsp_request_type, (req)); \
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
} while (0)
#define SafeGetOCSPReq(obj, req) do { \
@@ -26,12 +27,14 @@
GetOCSPReq((obj), (req)); \
} while (0)
-#define WrapOCSPRes(klass, obj, res) do { \
+#define NewOCSPRes(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_ocsp_response_type, 0)
+#define SetOCSPRes(obj, res) do { \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
- (obj) = Data_Wrap_Struct((klass), 0, OCSP_RESPONSE_free, (res)); \
+ RTYPEDDATA_DATA(obj) = (res); \
} while (0)
#define GetOCSPRes(obj, res) do { \
- Data_Get_Struct((obj), OCSP_RESPONSE, (res)); \
+ TypedData_Get_Struct((obj), OCSP_RESPONSE, &ossl_ocsp_response_type, (res)); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)
#define SafeGetOCSPRes(obj, res) do { \
@@ -39,12 +42,14 @@
GetOCSPRes((obj), (res)); \
} while (0)
-#define WrapOCSPBasicRes(klass, obj, res) do { \
+#define NewOCSPBasicRes(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_ocsp_basicresp_type, 0)
+#define SetOCSPBasicRes(obj, res) do { \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
- (obj) = Data_Wrap_Struct((klass), 0, OCSP_BASICRESP_free, (res)); \
+ RTYPEDDATA_DATA(obj) = (res); \
} while (0)
#define GetOCSPBasicRes(obj, res) do { \
- Data_Get_Struct((obj), OCSP_BASICRESP, (res)); \
+ TypedData_Get_Struct((obj), OCSP_BASICRESP, &ossl_ocsp_basicresp_type, (res)); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)
#define SafeGetOCSPBasicRes(obj, res) do { \
@@ -52,12 +57,14 @@
GetOCSPBasicRes((obj), (res)); \
} while (0)
-#define WrapOCSPCertId(klass, obj, cid) do { \
+#define NewOCSPCertId(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_ocsp_certid_type, 0)
+#define SetOCSPCertId(obj, cid) do { \
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
- (obj) = Data_Wrap_Struct((klass), 0, OCSP_CERTID_free, (cid)); \
+ RTYPEDDATA_DATA(obj) = (cid); \
} while (0)
#define GetOCSPCertId(obj, cid) do { \
- Data_Get_Struct((obj), OCSP_CERTID, (cid)); \
+ TypedData_Get_Struct((obj), OCSP_CERTID, &ossl_ocsp_certid_type, (cid)); \
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
} while (0)
#define SafeGetOCSPCertId(obj, cid) do { \
@@ -72,14 +79,70 @@ VALUE cOCSPRes;
VALUE cOCSPBasicRes;
VALUE cOCSPCertId;
+static void
+ossl_ocsp_request_free(void *ptr)
+{
+ OCSP_REQUEST_free(ptr);
+}
+
+static const rb_data_type_t ossl_ocsp_request_type = {
+ "OpenSSL/OCSP/REQUEST",
+ {
+ 0, ossl_ocsp_request_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
+static void
+ossl_ocsp_response_free(void *ptr)
+{
+ OCSP_RESPONSE_free(ptr);
+}
+
+static const rb_data_type_t ossl_ocsp_response_type = {
+ "OpenSSL/OCSP/RESPONSE",
+ {
+ 0, ossl_ocsp_response_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
+static void
+ossl_ocsp_basicresp_free(void *ptr)
+{
+ OCSP_BASICRESP_free(ptr);
+}
+
+static const rb_data_type_t ossl_ocsp_basicresp_type = {
+ "OpenSSL/OCSP/BASICRESP",
+ {
+ 0, ossl_ocsp_basicresp_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
+static void
+ossl_ocsp_certid_free(void *ptr)
+{
+ OCSP_CERTID_free(ptr);
+}
+
+static const rb_data_type_t ossl_ocsp_certid_type = {
+ "OpenSSL/OCSP/CERTID",
+ {
+ 0, ossl_ocsp_certid_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public
*/
static VALUE
ossl_ocspcertid_new(OCSP_CERTID *cid)
{
- VALUE obj;
- WrapOCSPCertId(cOCSPCertId, obj, cid);
+ VALUE obj = NewOCSPCertId(cOCSPCertId);
+ SetOCSPCertId(obj, cid);
return obj;
}
@@ -92,13 +155,23 @@ ossl_ocspreq_alloc(VALUE klass)
OCSP_REQUEST *req;
VALUE obj;
+ obj = NewOCSPReq(klass);
if (!(req = OCSP_REQUEST_new()))
ossl_raise(eOCSPError, NULL);
- WrapOCSPReq(klass, obj, req);
+ SetOCSPReq(obj, req);
return obj;
}
+/*
+ * call-seq:
+ * OpenSSL::OCSP::Request.new -> request
+ * OpenSSL::OCSP::Request.new(request_der) -> request
+ *
+ * Creates a new OpenSSL::OCSP::Request. The request may be created empty or
+ * from a +request_der+ string.
+ */
+
static VALUE
ossl_ocspreq_initialize(int argc, VALUE *argv, VALUE self)
{
@@ -121,6 +194,17 @@ ossl_ocspreq_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
+/*
+ * call-seq:
+ * request.add_nonce(nonce = nil) -> request
+ *
+ * Adds a +nonce+ to the OCSP request. If no nonce is given a random one will
+ * be generated.
+ *
+ * The nonce is used to prevent replay attacks but some servers do not support
+ * it.
+ */
+
static VALUE
ossl_ocspreq_add_nonce(int argc, VALUE *argv, VALUE self)
{
@@ -143,18 +227,25 @@ ossl_ocspreq_add_nonce(int argc, VALUE *argv, VALUE self)
return self;
}
-/* Check nonce validity in a request and response.
- * Return value reflects result:
- * 1: nonces present and equal.
- * 2: nonces both absent.
- * 3: nonce present in response only.
- * 0: nonces both present and not equal.
- * -1: nonce in request only.
+/*
+ * call-seq:
+ * request.check_nonce(response) -> result
+ *
+ * Checks the nonce validity for this request and +response+.
+ *
+ * The return value is one of the following:
+ *
+ * -1 :: nonce in request only.
+ * 0 :: nonces both present and not equal.
+ * 1 :: nonces present and equal.
+ * 2 :: nonces both absent.
+ * 3 :: nonce present in response only.
*
- * For most responders clients can check return > 0.
- * If responder doesn't handle nonces return != 0 may be
- * necessary. return == 0 is always an error.
+ * For most responses, clients can check +result+ > 0. If a responder doesn't
+ * handle nonces <code>result.nonzero?</code> may be necessary. A result of
+ * <code>0</code> is always an error.
*/
+
static VALUE
ossl_ocspreq_check_nonce(VALUE self, VALUE basic_resp)
{
@@ -169,20 +260,39 @@ ossl_ocspreq_check_nonce(VALUE self, VALUE basic_resp)
return INT2NUM(res);
}
+/*
+ * call-seq:
+ * request.add_certid(certificate_id) -> request
+ *
+ * Adds +certificate_id+ to the request.
+ */
+
static VALUE
ossl_ocspreq_add_certid(VALUE self, VALUE certid)
{
OCSP_REQUEST *req;
- OCSP_CERTID *id;
+ OCSP_CERTID *id, *id_new;
GetOCSPReq(self, req);
GetOCSPCertId(certid, id);
- if(!OCSP_request_add0_id(req, OCSP_CERTID_dup(id)))
- ossl_raise(eOCSPError, NULL);
+
+ if (!(id_new = OCSP_CERTID_dup(id)))
+ ossl_raise(eOCSPError, "OCSP_CERTID_dup");
+ if (!OCSP_request_add0_id(req, id_new)) {
+ OCSP_CERTID_free(id_new);
+ ossl_raise(eOCSPError, "OCSP_request_add0_id");
+ }
return self;
}
+/*
+ * call-seq:
+ * request.certid -> [certificate_id, ...]
+ *
+ * Returns all certificate IDs in this request.
+ */
+
static VALUE
ossl_ocspreq_get_certid(VALUE self)
{
@@ -197,15 +307,27 @@ ossl_ocspreq_get_certid(VALUE self)
ary = (count > 0) ? rb_ary_new() : Qnil;
for(i = 0; i < count; i++){
one = OCSP_request_onereq_get0(req, i);
+ tmp = NewOCSPCertId(cOCSPCertId);
if(!(id = OCSP_CERTID_dup(OCSP_onereq_get0_id(one))))
ossl_raise(eOCSPError, NULL);
- WrapOCSPCertId(cOCSPCertId, tmp, id);
+ SetOCSPCertId(tmp, id);
rb_ary_push(ary, tmp);
}
return ary;
}
+/*
+ * call-seq:
+ * request.sign(signer_cert, signer_key) -> self
+ * request.sign(signer_cert, signer_key, certificates) -> self
+ * request.sign(signer_cert, signer_key, certificates, flags) -> self
+ *
+ * Signs this OCSP request using +signer_cert+ and +signer_key+.
+ * +certificates+ is an optional Array of certificates that may be included in
+ * the request.
+ */
+
static VALUE
ossl_ocspreq_sign(int argc, VALUE *argv, VALUE self)
{
@@ -234,6 +356,14 @@ ossl_ocspreq_sign(int argc, VALUE *argv, VALUE self)
return self;
}
+/*
+ * call-seq:
+ * request.verify(certificates, store) -> true or false
+ * request.verify(certificates, store, flags) -> true or false
+ *
+ * Verifies this request using the given +certificates+ and X509 +store+.
+ */
+
static VALUE
ossl_ocspreq_verify(int argc, VALUE *argv, VALUE self)
{
@@ -255,6 +385,10 @@ ossl_ocspreq_verify(int argc, VALUE *argv, VALUE self)
return result ? Qtrue : Qfalse;
}
+/*
+ * Returns this request as a DER-encoded string
+ */
+
static VALUE
ossl_ocspreq_to_der(VALUE self)
{
@@ -278,6 +412,13 @@ ossl_ocspreq_to_der(VALUE self)
/*
* OCSP::Response
*/
+
+/* call-seq:
+ * OpenSSL::OCSP::Response.create(status, basic_response = nil) -> response
+ *
+ * Creates an OpenSSL::OCSP::Response from +status+ and +basic_response+.
+ */
+
static VALUE
ossl_ocspres_s_create(VALUE klass, VALUE status, VALUE basic_resp)
{
@@ -288,9 +429,10 @@ ossl_ocspres_s_create(VALUE klass, VALUE status, VALUE basic_resp)
if(NIL_P(basic_resp)) bs = NULL;
else GetOCSPBasicRes(basic_resp, bs); /* NO NEED TO DUP */
+ obj = NewOCSPRes(klass);
if(!(res = OCSP_response_create(st, bs)))
ossl_raise(eOCSPError, NULL);
- WrapOCSPRes(klass, obj, res);
+ SetOCSPRes(obj, res);
return obj;
}
@@ -301,13 +443,23 @@ ossl_ocspres_alloc(VALUE klass)
OCSP_RESPONSE *res;
VALUE obj;
+ obj = NewOCSPRes(klass);
if(!(res = OCSP_RESPONSE_new()))
ossl_raise(eOCSPError, NULL);
- WrapOCSPRes(klass, obj, res);
+ SetOCSPRes(obj, res);
return obj;
}
+/*
+ * call-seq:
+ * OpenSSL::OCSP::Response.new -> response
+ * OpenSSL::OCSP::Response.new(response_der) -> response
+ *
+ * Creates a new OpenSSL::OCSP::Response. The response may be created empty or
+ * from a +response_der+ string.
+ */
+
static VALUE
ossl_ocspres_initialize(int argc, VALUE *argv, VALUE self)
{
@@ -330,6 +482,13 @@ ossl_ocspres_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
+/*
+ * call-seq:
+ * response.status -> Integer
+ *
+ * Returns the status of the response.
+ */
+
static VALUE
ossl_ocspres_status(VALUE self)
{
@@ -342,6 +501,13 @@ ossl_ocspres_status(VALUE self)
return INT2NUM(st);
}
+/*
+ * call-seq:
+ * response.status_string -> String
+ *
+ * Returns a status string for the response.
+ */
+
static VALUE
ossl_ocspres_status_string(VALUE self)
{
@@ -354,6 +520,13 @@ ossl_ocspres_status_string(VALUE self)
return rb_str_new2(OCSP_response_status_str(st));
}
+/*
+ * call-seq:
+ * response.basic
+ *
+ * Returns a BasicResponse for this response
+ */
+
static VALUE
ossl_ocspres_get_basic(VALUE self)
{
@@ -362,13 +535,21 @@ ossl_ocspres_get_basic(VALUE self)
VALUE ret;
GetOCSPRes(self, res);
+ ret = NewOCSPBasicRes(cOCSPBasicRes);
if(!(bs = OCSP_response_get1_basic(res)))
return Qnil;
- WrapOCSPBasicRes(cOCSPBasicRes, ret, bs);
+ SetOCSPBasicRes(ret, bs);
return ret;
}
+/*
+ * call-seq:
+ * response.to_der -> String
+ *
+ * Returns this response as a DER-encoded string.
+ */
+
static VALUE
ossl_ocspres_to_der(VALUE self)
{
@@ -398,19 +579,35 @@ ossl_ocspbres_alloc(VALUE klass)
OCSP_BASICRESP *bs;
VALUE obj;
+ obj = NewOCSPBasicRes(klass);
if(!(bs = OCSP_BASICRESP_new()))
ossl_raise(eOCSPError, NULL);
- WrapOCSPBasicRes(klass, obj, bs);
+ SetOCSPBasicRes(obj, bs);
return obj;
}
+/*
+ * call-seq:
+ * OpenSSL::OCSP::BasicResponse.new(*) -> basic_response
+ *
+ * Creates a new BasicResponse and ignores all arguments.
+ */
+
static VALUE
ossl_ocspbres_initialize(int argc, VALUE *argv, VALUE self)
{
return self;
}
+/*
+ * call-seq:
+ * basic_response.copy_nonce(request) -> Integer
+ *
+ * Copies the nonce from +request+ into this response. Returns 1 on success
+ * and 0 on failure.
+ */
+
static VALUE
ossl_ocspbres_copy_nonce(VALUE self, VALUE request)
{
@@ -425,6 +622,14 @@ ossl_ocspbres_copy_nonce(VALUE self, VALUE request)
return INT2NUM(ret);
}
+/*
+ * call-seq:
+ * basic_response.add_nonce(nonce = nil)
+ *
+ * Adds +nonce+ to this response. If no nonce was provided a random nonce
+ * will be added.
+ */
+
static VALUE
ossl_ocspbres_add_nonce(int argc, VALUE *argv, VALUE self)
{
@@ -447,6 +652,22 @@ ossl_ocspbres_add_nonce(int argc, VALUE *argv, VALUE self)
return self;
}
+/*
+ * call-seq:
+ * basic_response.add_status(certificate_id, status, reason, revocation_time, this_update, next_update, extensions) -> basic_response
+ *
+ * Adds a validation +status+ (0 for good, 1 for revoked, 2 for unknown) to this
+ * response for +certificate_id+. +reason+ describes the reason for the
+ * revocation, if any.
+ *
+ * The +revocation_time+, +this_update+ and +next_update+ are times for the
+ * certificate's revocation time, the time of this status and the next update
+ * time for a new status, respectively.
+ *
+ * +extensions+ may be an Array of OpenSSL::X509::Extension that will
+ * be added to this response or nil.
+ */
+
static VALUE
ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
VALUE reason, VALUE revtime,
@@ -455,9 +676,9 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
OCSP_BASICRESP *bs;
OCSP_SINGLERESP *single;
OCSP_CERTID *id;
- int st, rsn;
ASN1_TIME *ths, *nxt, *rev;
- int error, i, rstatus = 0;
+ int st, rsn, error, rstatus = 0;
+ long i;
VALUE tmp;
st = NUM2INT(status);
@@ -466,7 +687,7 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
/* All ary's members should be X509Extension */
Check_Type(ext, T_ARRAY);
for (i = 0; i < RARRAY_LEN(ext); i++)
- OSSL_Check_Kind(RARRAY_PTR(ext)[i], cX509Ext);
+ OSSL_Check_Kind(RARRAY_AREF(ext, i), cX509Ext);
}
error = 0;
@@ -495,7 +716,7 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
sk_X509_EXTENSION_pop_free(single->singleExtensions, X509_EXTENSION_free);
single->singleExtensions = NULL;
for(i = 0; i < RARRAY_LEN(ext); i++){
- x509ext = DupX509ExtPtr(RARRAY_PTR(ext)[i]);
+ x509ext = DupX509ExtPtr(RARRAY_AREF(ext, i));
if(!OCSP_SINGLERESP_add_ext(single, x509ext, -1)){
X509_EXTENSION_free(x509ext);
error = 1;
@@ -515,6 +736,16 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
return self;
}
+/*
+ * call-seq:
+ * basic_response.status -> statuses
+ *
+ * Returns an Array of statuses for this response. Each status contains a
+ * CertificateId, the status (0 for good, 1 for revoked, 2 for unknown), the reason for
+ * the status, the revocation time, the time of this update, the time for the
+ * next update and a list of OpenSSL::X509::Extensions.
+ */
+
static VALUE
ossl_ocspbres_get_status(VALUE self)
{
@@ -560,6 +791,16 @@ ossl_ocspbres_get_status(VALUE self)
return ret;
}
+/*
+ * call-seq:
+ * basic_response.sign(signer_cert, signer_key) -> self
+ * basic_response.sign(signer_cert, signer_key, certificates) -> self
+ * basic_response.sign(signer_cert, signer_key, certificates, flags) -> self
+ *
+ * Signs this response using the +signer_cert+ and +signer_key+. Additional
+ * +certificates+ may be added to the signature along with a set of +flags+.
+ */
+
static VALUE
ossl_ocspbres_sign(int argc, VALUE *argv, VALUE self)
{
@@ -590,6 +831,14 @@ ossl_ocspbres_sign(int argc, VALUE *argv, VALUE self)
return self;
}
+/*
+ * call-seq:
+ * basic_response.verify(certificates, store) -> true or false
+ * basic_response.verify(certificates, store, flags) -> true or false
+ *
+ * Verifies the signature of the response using the given +certificates+,
+ * +store+ and +flags+.
+ */
static VALUE
ossl_ocspbres_verify(int argc, VALUE *argv, VALUE self)
{
@@ -620,13 +869,23 @@ ossl_ocspcid_alloc(VALUE klass)
OCSP_CERTID *id;
VALUE obj;
+ obj = NewOCSPCertId(klass);
if(!(id = OCSP_CERTID_new()))
ossl_raise(eOCSPError, NULL);
- WrapOCSPCertId(klass, obj, id);
+ SetOCSPCertId(obj, id);
return obj;
}
+/*
+ * call-seq:
+ * OpenSSL::OCSP::CertificateId.new(subject, issuer, digest = nil) -> certificate_id
+ *
+ * Creates a new OpenSSL::OCSP::CertificateId for the given +subject+ and
+ * +issuer+ X509 certificates. The +digest+ is used to compute the
+ * certificate ID and must be an OpenSSL::Digest instance.
+ */
+
static VALUE
ossl_ocspcid_initialize(int argc, VALUE *argv, VALUE self)
{
@@ -657,6 +916,13 @@ ossl_ocspcid_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
+/*
+ * call-seq:
+ * certificate_id.cmp(other) -> true or false
+ *
+ * Compares this certificate id with +other+ and returns true if they are the
+ * same.
+ */
static VALUE
ossl_ocspcid_cmp(VALUE self, VALUE other)
{
@@ -670,6 +936,14 @@ ossl_ocspcid_cmp(VALUE self, VALUE other)
return (result == 0) ? Qtrue : Qfalse;
}
+/*
+ * call-seq:
+ * certificate_id.cmp_issuer(other) -> true or false
+ *
+ * Compares this certificate id's issuer with +other+ and returns true if
+ * they are the same.
+ */
+
static VALUE
ossl_ocspcid_cmp_issuer(VALUE self, VALUE other)
{
@@ -683,6 +957,13 @@ ossl_ocspcid_cmp_issuer(VALUE self, VALUE other)
return (result == 0) ? Qtrue : Qfalse;
}
+/*
+ * call-seq:
+ * certificate_id.get_serial -> Integer
+ *
+ * Returns the serial number of the issuing certificate.
+ */
+
static VALUE
ossl_ocspcid_get_serial(VALUE self)
{
@@ -694,12 +975,132 @@ ossl_ocspcid_get_serial(VALUE self)
}
void
-Init_ossl_ocsp()
+Init_ossl_ocsp(void)
{
+ /*
+ * OpenSSL::OCSP implements Online Certificate Status Protocol requests
+ * and responses.
+ *
+ * Creating and sending an OCSP request requires a subject certificate
+ * that contains an OCSP URL in an authorityInfoAccess extension and the
+ * issuer certificate for the subject certificate. First, load the issuer
+ * and subject certificates:
+ *
+ * subject = OpenSSL::X509::Certificate.new subject_pem
+ * issuer = OpenSSL::X509::Certificate.new issuer_pem
+ *
+ * To create the request we need to create a certificate ID for the
+ * subject certificate so the CA knows which certificate we are asking
+ * about:
+ *
+ * digest = OpenSSL::Digest::SHA1.new
+ * certificate_id =
+ * OpenSSL::OCSP::CertificateId.new subject, issuer, digest
+ *
+ * Then create a request and add the certificate ID to it:
+ *
+ * request = OpenSSL::OCSP::Request.new
+ * request.add_certid certificate_id
+ *
+ * Adding a nonce to the request protects against replay attacks but not
+ * all CA process the nonce.
+ *
+ * request.add_nonce
+ *
+ * To submit the request to the CA for verification we need to extract the
+ * OCSP URI from the subject certificate:
+ *
+ * authority_info_access = subject.extensions.find do |extension|
+ * extension.oid == 'authorityInfoAccess'
+ * end
+ *
+ * descriptions = authority_info_access.value.split "\n"
+ * ocsp = descriptions.find do |description|
+ * description.start_with? 'OCSP'
+ * end
+ *
+ * require 'uri'
+ *
+ * ocsp_uri = URI ocsp[/URI:(.*)/, 1]
+ *
+ * To submit the request we'll POST the request to the OCSP URI (per RFC
+ * 2560). Note that we only handle HTTP requests and don't handle any
+ * redirects in this example, so this is insufficient for serious use.
+ *
+ * require 'net/http'
+ *
+ * http_response =
+ * Net::HTTP.start ocsp_uri.hostname, ocsp.port do |http|
+ * http.post ocsp_uri.path, request.to_der,
+ * 'content-type' => 'application/ocsp-request'
+ * end
+ *
+ * response = OpenSSL::OCSP::Response.new http_response.body
+ * response_basic = response.basic
+ *
+ * First we check if the response has a valid signature. Without a valid
+ * signature we cannot trust it. If you get a failure here you may be
+ * missing a system certificate store or may be missing the intermediate
+ * certificates.
+ *
+ * store = OpenSSL::X509::Store.new
+ * store.set_default_paths
+ *
+ * unless response.verify [], store then
+ * raise 'response is not signed by a trusted certificate'
+ * end
+ *
+ * The response contains the status information (success/fail). We can
+ * display the status as a string:
+ *
+ * puts response.status_string #=> successful
+ *
+ * Next we need to know the response details to determine if the response
+ * matches our request. First we check the nonce. Again, not all CAs
+ * support a nonce. See Request#check_nonce for the meanings of the
+ * return values.
+ *
+ * p request.check_nonce basic_response #=> value from -1 to 3
+ *
+ * Then extract the status information from the basic response. (You can
+ * check multiple certificates in a request, but for this example we only
+ * submitted one.)
+ *
+ * response_certificate_id, status, reason, revocation_time,
+ * this_update, next_update, extensions = basic_response.status
+ *
+ * Then check the various fields.
+ *
+ * unless response_certificate_id == certificate_id then
+ * raise 'certificate id mismatch'
+ * end
+ *
+ * now = Time.now
+ *
+ * if this_update > now then
+ * raise 'update date is in the future'
+ * end
+ *
+ * if now > next_update then
+ * raise 'next update time has passed'
+ * end
+ */
+
mOCSP = rb_define_module_under(mOSSL, "OCSP");
+ /*
+ * OCSP error class.
+ */
+
eOCSPError = rb_define_class_under(mOCSP, "OCSPError", eOSSLError);
+ /*
+ * An OpenSSL::OCSP::Request contains the certificate information for
+ * determining if a certificate has been revoked or not. A Request can be
+ * created for a certificate or from a DER-encoded request created
+ * elsewhere.
+ */
+
cOCSPReq = rb_define_class_under(mOCSP, "Request", rb_cObject);
rb_define_alloc_func(cOCSPReq, ossl_ocspreq_alloc);
rb_define_method(cOCSPReq, "initialize", ossl_ocspreq_initialize, -1);
@@ -711,6 +1112,11 @@ Init_ossl_ocsp()
rb_define_method(cOCSPReq, "verify", ossl_ocspreq_verify, -1);
rb_define_method(cOCSPReq, "to_der", ossl_ocspreq_to_der, 0);
+ /*
+ * An OpenSSL::OCSP::Response contains the status of a certificate check
+ * which is created from an OpenSSL::OCSP::Request.
+ */
+
cOCSPRes = rb_define_class_under(mOCSP, "Response", rb_cObject);
rb_define_singleton_method(cOCSPRes, "create", ossl_ocspres_s_create, 2);
rb_define_alloc_func(cOCSPRes, ossl_ocspres_alloc);
@@ -720,6 +1126,12 @@ Init_ossl_ocsp()
rb_define_method(cOCSPRes, "basic", ossl_ocspres_get_basic, 0);
rb_define_method(cOCSPRes, "to_der", ossl_ocspres_to_der, 0);
+ /*
+ * An OpenSSL::OCSP::BasicResponse contains the status of a certificate
+ * check which is created from an OpenSSL::OCSP::Request. A
+ * BasicResponse is more detailed than a Response.
+ */
+
cOCSPBasicRes = rb_define_class_under(mOCSP, "BasicResponse", rb_cObject);
rb_define_alloc_func(cOCSPBasicRes, ossl_ocspbres_alloc);
rb_define_method(cOCSPBasicRes, "initialize", ossl_ocspbres_initialize, -1);
@@ -730,6 +1142,11 @@ Init_ossl_ocsp()
rb_define_method(cOCSPBasicRes, "sign", ossl_ocspbres_sign, -1);
rb_define_method(cOCSPBasicRes, "verify", ossl_ocspbres_verify, -1);
+ /*
+ * An OpenSSL::OCSP::CertificateId identifies a certificate to the CA so
+ * that a status check can be performed.
+ */
+
cOCSPCertId = rb_define_class_under(mOCSP, "CertificateId", rb_cObject);
rb_define_alloc_func(cOCSPCertId, ossl_ocspcid_alloc);
rb_define_method(cOCSPCertId, "initialize", ossl_ocspcid_initialize, -1);
@@ -737,50 +1154,110 @@ Init_ossl_ocsp()
rb_define_method(cOCSPCertId, "cmp_issuer", ossl_ocspcid_cmp_issuer, 1);
rb_define_method(cOCSPCertId, "serial", ossl_ocspcid_get_serial, 0);
-#define DefOCSPConst(x) rb_define_const(mOCSP, #x, INT2NUM(OCSP_##x))
-
- DefOCSPConst(RESPONSE_STATUS_SUCCESSFUL);
- DefOCSPConst(RESPONSE_STATUS_MALFORMEDREQUEST);
- DefOCSPConst(RESPONSE_STATUS_INTERNALERROR);
- DefOCSPConst(RESPONSE_STATUS_TRYLATER);
- DefOCSPConst(RESPONSE_STATUS_SIGREQUIRED);
- DefOCSPConst(RESPONSE_STATUS_UNAUTHORIZED);
-
- DefOCSPConst(REVOKED_STATUS_NOSTATUS);
- DefOCSPConst(REVOKED_STATUS_UNSPECIFIED);
- DefOCSPConst(REVOKED_STATUS_KEYCOMPROMISE);
- DefOCSPConst(REVOKED_STATUS_CACOMPROMISE);
- DefOCSPConst(REVOKED_STATUS_AFFILIATIONCHANGED);
- DefOCSPConst(REVOKED_STATUS_SUPERSEDED);
- DefOCSPConst(REVOKED_STATUS_CESSATIONOFOPERATION);
- DefOCSPConst(REVOKED_STATUS_CERTIFICATEHOLD);
- DefOCSPConst(REVOKED_STATUS_REMOVEFROMCRL);
-
- DefOCSPConst(NOCERTS);
- DefOCSPConst(NOINTERN);
- DefOCSPConst(NOSIGS);
- DefOCSPConst(NOCHAIN);
- DefOCSPConst(NOVERIFY);
- DefOCSPConst(NOEXPLICIT);
- DefOCSPConst(NOCASIGN);
- DefOCSPConst(NODELEGATED);
- DefOCSPConst(NOCHECKS);
- DefOCSPConst(TRUSTOTHER);
- DefOCSPConst(RESPID_KEY);
- DefOCSPConst(NOTIME);
-
-#define DefOCSPVConst(x) rb_define_const(mOCSP, "V_" #x, INT2NUM(V_OCSP_##x))
-
- DefOCSPVConst(CERTSTATUS_GOOD);
- DefOCSPVConst(CERTSTATUS_REVOKED);
- DefOCSPVConst(CERTSTATUS_UNKNOWN);
- DefOCSPVConst(RESPID_NAME);
- DefOCSPVConst(RESPID_KEY);
+ /* Internal error in issuer */
+ rb_define_const(mOCSP, "RESPONSE_STATUS_INTERNALERROR", INT2NUM(OCSP_RESPONSE_STATUS_INTERNALERROR));
+
+ /* Illegal confirmation request */
+ rb_define_const(mOCSP, "RESPONSE_STATUS_MALFORMEDREQUEST", INT2NUM(OCSP_RESPONSE_STATUS_MALFORMEDREQUEST));
+
+ /* The certificate was revoked for an unknown reason */
+ rb_define_const(mOCSP, "REVOKED_STATUS_NOSTATUS", INT2NUM(OCSP_REVOKED_STATUS_NOSTATUS));
+
+ /* You must sign the request and resubmit */
+ rb_define_const(mOCSP, "RESPONSE_STATUS_SIGREQUIRED", INT2NUM(OCSP_RESPONSE_STATUS_SIGREQUIRED));
+
+ /* Response has valid confirmations */
+ rb_define_const(mOCSP, "RESPONSE_STATUS_SUCCESSFUL", INT2NUM(OCSP_RESPONSE_STATUS_SUCCESSFUL));
+
+ /* Try again later */
+ rb_define_const(mOCSP, "RESPONSE_STATUS_TRYLATER", INT2NUM(OCSP_RESPONSE_STATUS_TRYLATER));
+
+ /* The certificate subject's name or other information changed */
+ rb_define_const(mOCSP, "REVOKED_STATUS_AFFILIATIONCHANGED", INT2NUM(OCSP_REVOKED_STATUS_AFFILIATIONCHANGED));
+
+ /* This CA certificate was revoked due to a key compromise */
+ rb_define_const(mOCSP, "REVOKED_STATUS_CACOMPROMISE", INT2NUM(OCSP_REVOKED_STATUS_CACOMPROMISE));
+
+ /* The certificate is on hold */
+ rb_define_const(mOCSP, "REVOKED_STATUS_CERTIFICATEHOLD", INT2NUM(OCSP_REVOKED_STATUS_CERTIFICATEHOLD));
+
+ /* The certificate is no longer needed */
+ rb_define_const(mOCSP, "REVOKED_STATUS_CESSATIONOFOPERATION", INT2NUM(OCSP_REVOKED_STATUS_CESSATIONOFOPERATION));
+
+ /* The certificate was revoked due to a key compromise */
+ rb_define_const(mOCSP, "REVOKED_STATUS_KEYCOMPROMISE", INT2NUM(OCSP_REVOKED_STATUS_KEYCOMPROMISE));
+
+ /* The certificate was previously on hold and should now be removed from
+ * the CRL */
+ rb_define_const(mOCSP, "REVOKED_STATUS_REMOVEFROMCRL", INT2NUM(OCSP_REVOKED_STATUS_REMOVEFROMCRL));
+
+ /* The certificate was superseded by a new certificate */
+ rb_define_const(mOCSP, "REVOKED_STATUS_SUPERSEDED", INT2NUM(OCSP_REVOKED_STATUS_SUPERSEDED));
+
+ /* Your request is unauthorized. */
+ rb_define_const(mOCSP, "RESPONSE_STATUS_UNAUTHORIZED", INT2NUM(OCSP_RESPONSE_STATUS_UNAUTHORIZED));
+
+ /* The certificate was revoked for an unspecified reason */
+ rb_define_const(mOCSP, "REVOKED_STATUS_UNSPECIFIED", INT2NUM(OCSP_REVOKED_STATUS_UNSPECIFIED));
+
+ /* Do not include certificates in the response */
+ rb_define_const(mOCSP, "NOCERTS", INT2NUM(OCSP_NOCERTS));
+
+ /* Do not search certificates contained in the response for a signer */
+ rb_define_const(mOCSP, "NOINTERN", INT2NUM(OCSP_NOINTERN));
+
+ /* Do not check the signature on the response */
+ rb_define_const(mOCSP, "NOSIGS", INT2NUM(OCSP_NOSIGS));
+
+ /* Do not verify the certificate chain on the response */
+ rb_define_const(mOCSP, "NOCHAIN", INT2NUM(OCSP_NOCHAIN));
+
+ /* Do not verify the response at all */
+ rb_define_const(mOCSP, "NOVERIFY", INT2NUM(OCSP_NOVERIFY));
+
+ /* Do not check trust */
+ rb_define_const(mOCSP, "NOEXPLICIT", INT2NUM(OCSP_NOEXPLICIT));
+
+ /* (This flag is not used by OpenSSL 1.0.1g) */
+ rb_define_const(mOCSP, "NOCASIGN", INT2NUM(OCSP_NOCASIGN));
+
+ /* (This flag is not used by OpenSSL 1.0.1g) */
+ rb_define_const(mOCSP, "NODELEGATED", INT2NUM(OCSP_NODELEGATED));
+
+ /* Do not make additional signing certificate checks */
+ rb_define_const(mOCSP, "NOCHECKS", INT2NUM(OCSP_NOCHECKS));
+
+ /* Do not verify additional certificates */
+ rb_define_const(mOCSP, "TRUSTOTHER", INT2NUM(OCSP_TRUSTOTHER));
+
+ /* Identify the response by signing the certificate key ID */
+ rb_define_const(mOCSP, "RESPID_KEY", INT2NUM(OCSP_RESPID_KEY));
+
+ /* Do not include producedAt time in response */
+ rb_define_const(mOCSP, "NOTIME", INT2NUM(OCSP_NOTIME));
+
+ /* Indicates the certificate is not revoked but does not necessarily mean
+ * the certificate was issued or that this response is within the
+ * certificate's validity interval */
+ rb_define_const(mOCSP, "V_CERTSTATUS_GOOD", INT2NUM(V_OCSP_CERTSTATUS_GOOD));
+ /* Indicates the certificate has been revoked either permanently or
+ * temporarily (on hold). */
+ rb_define_const(mOCSP, "V_CERTSTATUS_REVOKED", INT2NUM(V_OCSP_CERTSTATUS_REVOKED));
+
+ /* Indicates the responder does not know about the certificate being
+ * requested. */
+ rb_define_const(mOCSP, "V_CERTSTATUS_UNKNOWN", INT2NUM(V_OCSP_CERTSTATUS_UNKNOWN));
+
+ /* The responder ID is based on the key name. */
+ rb_define_const(mOCSP, "V_RESPID_NAME", INT2NUM(V_OCSP_RESPID_NAME));
+
+ /* The responder ID is based on the public key. */
+ rb_define_const(mOCSP, "V_RESPID_KEY", INT2NUM(V_OCSP_RESPID_KEY));
}
#else /* ! OSSL_OCSP_ENABLED */
void
-Init_ossl_ocsp()
+Init_ossl_ocsp(void)
{
}
#endif
diff --git a/ext/openssl/ossl_ocsp.h b/ext/openssl/ossl_ocsp.h
index 65b4f2e23f..c5064fbc85 100644
--- a/ext/openssl/ossl_ocsp.h
+++ b/ext/openssl/ossl_ocsp.h
@@ -1,12 +1,11 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2003 Michal Rokos <m.rokos@sh.cvut.cz>
* Copyright (C) 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_OCSP_H_)
diff --git a/ext/openssl/ossl_pkcs12.c b/ext/openssl/ossl_pkcs12.c
index 8a5f816082..2a42ee973b 100644
--- a/ext/openssl/ossl_pkcs12.c
+++ b/ext/openssl/ossl_pkcs12.c
@@ -1,17 +1,19 @@
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
- * $Id$
*/
#include "ossl.h"
-#define WrapPKCS12(klass, obj, p12) do { \
+#define NewPKCS12(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_pkcs12_type, 0)
+
+#define SetPKCS12(obj, p12) do { \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
- (obj) = Data_Wrap_Struct((klass), 0, PKCS12_free, (p12)); \
+ RTYPEDDATA_DATA(obj) = (p12); \
} while (0)
#define GetPKCS12(obj, p12) do { \
- Data_Get_Struct((obj), PKCS12, (p12)); \
+ TypedData_Get_Struct((obj), PKCS12, &ossl_pkcs12_type, (p12)); \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
} while (0)
@@ -36,14 +38,29 @@ VALUE ePKCS12Error;
/*
* Private
*/
+static void
+ossl_pkcs12_free(void *ptr)
+{
+ PKCS12_free(ptr);
+}
+
+static const rb_data_type_t ossl_pkcs12_type = {
+ "OpenSSL/PKCS12",
+ {
+ 0, ossl_pkcs12_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE
ossl_pkcs12_s_allocate(VALUE klass)
{
PKCS12 *p12;
VALUE obj;
+ obj = NewPKCS12(klass);
if(!(p12 = PKCS12_new())) ossl_raise(ePKCS12Error, NULL);
- WrapPKCS12(klass, obj, p12);
+ SetPKCS12(obj, p12);
return obj;
}
@@ -87,7 +104,6 @@ ossl_pkcs12_s_create(int argc, VALUE *argv, VALUE self)
friendlyname = NIL_P(name) ? NULL : StringValuePtr(name);
key = GetPKeyPtr(pkey);
x509 = GetX509CertPtr(cert);
- x509s = NIL_P(ca) ? NULL : ossl_x509_ary2sk(ca);
/* TODO: make a VALUE to nid function */
if (!NIL_P(key_nid)) {
if ((nkey = OBJ_txt2nid(StringValuePtr(key_nid))) == NID_undef)
@@ -104,11 +120,13 @@ ossl_pkcs12_s_create(int argc, VALUE *argv, VALUE self)
if (!NIL_P(keytype))
ktype = NUM2INT(keytype);
+ obj = NewPKCS12(cPKCS12);
+ x509s = NIL_P(ca) ? NULL : ossl_x509_ary2sk(ca);
p12 = PKCS12_create(passphrase, friendlyname, key, x509, x509s,
nkey, ncert, kiter, miter, ktype);
sk_X509_pop_free(x509s, X509_free);
if(!p12) ossl_raise(ePKCS12Error, NULL);
- WrapPKCS12(cPKCS12, obj, p12);
+ SetPKCS12(obj, p12);
ossl_pkcs12_set_key(obj, pkey);
ossl_pkcs12_set_cert(obj, cert);
@@ -147,8 +165,12 @@ ossl_pkcs12_initialize(int argc, VALUE *argv, VALUE self)
BIO_free(in);
pkey = cert = ca = Qnil;
+ /* OpenSSL's bug; PKCS12_parse() puts errors even if it succeeds.
+ * Fixed in OpenSSL 1.0.0t, 1.0.1p, 1.0.2d */
+ ERR_set_mark();
if(!PKCS12_parse(pkcs, passphrase, &key, &x509, &x509s))
ossl_raise(ePKCS12Error, "PKCS12_parse");
+ ERR_pop_to_mark();
pkey = rb_protect((VALUE(*)_((VALUE)))ossl_pkey_new, (VALUE)key,
&st); /* NO DUP */
if(st) goto err;
@@ -192,7 +214,7 @@ ossl_pkcs12_to_der(VALUE self)
}
void
-Init_ossl_pkcs12()
+Init_ossl_pkcs12(void)
{
/*
* Defines a file format commonly used to store private keys with
diff --git a/ext/openssl/ossl_pkcs12.h b/ext/openssl/ossl_pkcs12.h
index 24d25d00bb..fe4f15ef60 100644
--- a/ext/openssl/ossl_pkcs12.h
+++ b/ext/openssl/ossl_pkcs12.h
@@ -1,7 +1,6 @@
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
- * $Id$
*/
#if !defined(_OSSL_PKCS12_H_)
#define _OSSL_PKCS12_H_
@@ -12,4 +11,3 @@ extern VALUE ePKCS12Error;
void Init_ossl_pkcs12(void);
#endif /* _OSSL_PKCS12_H_ */
-
diff --git a/ext/openssl/ossl_pkcs5.c b/ext/openssl/ossl_pkcs5.c
index 3b615e4828..73d989e164 100644
--- a/ext/openssl/ossl_pkcs5.c
+++ b/ext/openssl/ossl_pkcs5.c
@@ -1,5 +1,4 @@
/*
- * $Id$
* Copyright (C) 2007 Technorama Ltd. <oss-ruby@technorama.net>
*/
#include "ossl.h"
@@ -87,7 +86,7 @@ ossl_pkcs5_pbkdf2_hmac_sha1(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALU
#endif
void
-Init_ossl_pkcs5()
+Init_ossl_pkcs5(void)
{
/*
* Password-based Encryption
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index 553a580923..04e41db598 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapPKCS7(klass, obj, pkcs7) do { \
+#define NewPKCS7(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_pkcs7_type, 0)
+#define SetPKCS7(obj, pkcs7) do { \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, PKCS7_free, (pkcs7)); \
+ RTYPEDDATA_DATA(obj) = (pkcs7); \
} while (0)
#define GetPKCS7(obj, pkcs7) do { \
- Data_Get_Struct((obj), PKCS7, (pkcs7)); \
+ TypedData_Get_Struct((obj), PKCS7, &ossl_pkcs7_type, (pkcs7)); \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
@@ -27,14 +28,16 @@
GetPKCS7((obj), (pkcs7)); \
} while (0)
-#define WrapPKCS7si(klass, obj, p7si) do { \
+#define NewPKCS7si(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_pkcs7_signer_info_type, 0)
+#define SetPKCS7si(obj, p7si) do { \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, PKCS7_SIGNER_INFO_free, (p7si)); \
+ RTYPEDDATA_DATA(obj) = (p7si); \
} while (0)
#define GetPKCS7si(obj, p7si) do { \
- Data_Get_Struct((obj), PKCS7_SIGNER_INFO, (p7si)); \
+ TypedData_Get_Struct((obj), PKCS7_SIGNER_INFO, &ossl_pkcs7_signer_info_type, (p7si)); \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
@@ -44,14 +47,16 @@
GetPKCS7si((obj), (p7si)); \
} while (0)
-#define WrapPKCS7ri(klass, obj, p7ri) do { \
+#define NewPKCS7ri(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_pkcs7_recip_info_type, 0)
+#define SetPKCS7ri(obj, p7ri) do { \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, PKCS7_RECIP_INFO_free, (p7ri)); \
+ RTYPEDDATA_DATA(obj) = (p7ri); \
} while (0)
#define GetPKCS7ri(obj, p7ri) do { \
- Data_Get_Struct((obj), PKCS7_RECIP_INFO, (p7ri)); \
+ TypedData_Get_Struct((obj), PKCS7_RECIP_INFO, &ossl_pkcs7_recip_info_type, (p7ri)); \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
@@ -76,6 +81,48 @@ VALUE cPKCS7Signer;
VALUE cPKCS7Recipient;
VALUE ePKCS7Error;
+static void
+ossl_pkcs7_free(void *ptr)
+{
+ PKCS7_free(ptr);
+}
+
+static const rb_data_type_t ossl_pkcs7_type = {
+ "OpenSSL/PKCS7",
+ {
+ 0, ossl_pkcs7_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
+static void
+ossl_pkcs7_signer_info_free(void *ptr)
+{
+ PKCS7_SIGNER_INFO_free(ptr);
+}
+
+static const rb_data_type_t ossl_pkcs7_signer_info_type = {
+ "OpenSSL/PKCS7/SIGNER_INFO",
+ {
+ 0, ossl_pkcs7_signer_info_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
+static void
+ossl_pkcs7_recip_info_free(void *ptr)
+{
+ PKCS7_RECIP_INFO_free(ptr);
+}
+
+static const rb_data_type_t ossl_pkcs7_recip_info_type = {
+ "OpenSSL/PKCS7/RECIP_INFO",
+ {
+ 0, ossl_pkcs7_recip_info_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public
* (MADE PRIVATE UNTIL SOMEBODY WILL NEED THEM)
@@ -86,9 +133,10 @@ ossl_pkcs7si_new(PKCS7_SIGNER_INFO *p7si)
PKCS7_SIGNER_INFO *pkcs7;
VALUE obj;
+ obj = NewPKCS7si(cPKCS7Signer);
pkcs7 = p7si ? PKCS7_SIGNER_INFO_dup(p7si) : PKCS7_SIGNER_INFO_new();
if (!pkcs7) ossl_raise(ePKCS7Error, NULL);
- WrapPKCS7si(cPKCS7Signer, obj, pkcs7);
+ SetPKCS7si(obj, pkcs7);
return obj;
}
@@ -112,9 +160,10 @@ ossl_pkcs7ri_new(PKCS7_RECIP_INFO *p7ri)
PKCS7_RECIP_INFO *pkcs7;
VALUE obj;
+ obj = NewPKCS7ri(cPKCS7Recipient);
pkcs7 = p7ri ? PKCS7_RECIP_INFO_dup(p7ri) : PKCS7_RECIP_INFO_new();
if (!pkcs7) ossl_raise(ePKCS7Error, NULL);
- WrapPKCS7ri(cPKCS7Recipient, obj, pkcs7);
+ SetPKCS7ri(obj, pkcs7);
return obj;
}
@@ -143,13 +192,14 @@ ossl_pkcs7_s_read_smime(VALUE klass, VALUE arg)
PKCS7 *pkcs7;
VALUE ret, data;
+ ret = NewPKCS7(cPKCS7);
in = ossl_obj2bio(arg);
out = NULL;
pkcs7 = SMIME_read_PKCS7(in, &out);
BIO_free(in);
if(!pkcs7) ossl_raise(ePKCS7Error, NULL);
data = out ? ossl_membio2str(out) : Qnil;
- WrapPKCS7(cPKCS7, ret, pkcs7);
+ SetPKCS7(ret, pkcs7);
ossl_pkcs7_set_data(ret, data);
ossl_pkcs7_set_err_string(ret, Qnil);
@@ -211,6 +261,7 @@ ossl_pkcs7_s_sign(int argc, VALUE *argv, VALUE klass)
x509 = GetX509CertPtr(cert); /* NO NEED TO DUP */
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
+ ret = NewPKCS7(cPKCS7);
in = ossl_obj2bio(data);
if(NIL_P(certs)) x509s = NULL;
else{
@@ -225,7 +276,7 @@ ossl_pkcs7_s_sign(int argc, VALUE *argv, VALUE klass)
sk_X509_pop_free(x509s, X509_free);
ossl_raise(ePKCS7Error, NULL);
}
- WrapPKCS7(cPKCS7, ret, pkcs7);
+ SetPKCS7(ret, pkcs7);
ossl_pkcs7_set_data(ret, data);
ossl_pkcs7_set_err_string(ret, Qnil);
BIO_free(in);
@@ -266,6 +317,7 @@ ossl_pkcs7_s_encrypt(int argc, VALUE *argv, VALUE klass)
}
else ciph = GetCipherPtr(cipher); /* NO NEED TO DUP */
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
+ ret = NewPKCS7(cPKCS7);
in = ossl_obj2bio(data);
x509s = ossl_protect_x509_ary2sk(certs, &status);
if(status){
@@ -278,7 +330,7 @@ ossl_pkcs7_s_encrypt(int argc, VALUE *argv, VALUE klass)
ossl_raise(ePKCS7Error, NULL);
}
BIO_free(in);
- WrapPKCS7(cPKCS7, ret, p7);
+ SetPKCS7(ret, p7);
ossl_pkcs7_set_data(ret, data);
sk_X509_pop_free(x509s, X509_free);
@@ -291,10 +343,11 @@ ossl_pkcs7_alloc(VALUE klass)
PKCS7 *pkcs7;
VALUE obj;
+ obj = NewPKCS7(klass);
if (!(pkcs7 = PKCS7_new())) {
ossl_raise(ePKCS7Error, NULL);
}
- WrapPKCS7(klass, obj, pkcs7);
+ SetPKCS7(obj, pkcs7);
return obj;
}
@@ -362,9 +415,10 @@ ossl_pkcs7_sym2typeid(VALUE sym)
{
int i, ret = Qnil;
const char *s;
+ size_t l;
- static struct {
- const char *name;
+ static const struct {
+ char name[20];
int nid;
} p7_type_tab[] = {
{ "signed", NID_pkcs7_signed },
@@ -373,14 +427,15 @@ ossl_pkcs7_sym2typeid(VALUE sym)
{ "enveloped", NID_pkcs7_enveloped },
{ "encrypted", NID_pkcs7_encrypted },
{ "digest", NID_pkcs7_digest },
- { NULL, 0 },
};
- if(TYPE(sym) == T_SYMBOL) s = rb_id2name(SYM2ID(sym));
- else s = StringValuePtr(sym);
- for(i = 0; i < numberof(p7_type_tab); i++){
- if(p7_type_tab[i].name == NULL)
+ if (RB_TYPE_P(sym, T_SYMBOL)) sym = rb_sym2str(sym);
+ else StringValue(sym);
+ RSTRING_GETMEM(sym, s, l);
+ for(i = 0; ; i++){
+ if(i == numberof(p7_type_tab))
ossl_raise(ePKCS7Error, "unknown type \"%s\"", s);
+ if(strlen(p7_type_tab[i].name) != l) continue;
if(strcmp(p7_type_tab[i].name, s) == 0){
ret = p7_type_tab[i].nid;
break;
@@ -700,7 +755,9 @@ ossl_pkcs7_verify(int argc, VALUE *argv, VALUE self)
VALUE data;
const char *msg;
+ GetPKCS7(self, p7);
rb_scan_args(argc, argv, "22", &certs, &store, &indata, &flags);
+ x509st = GetX509StorePtr(store);
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
if(NIL_P(indata)) indata = ossl_pkcs7_get_data(self);
in = NIL_P(indata) ? NULL : ossl_obj2bio(indata);
@@ -712,8 +769,6 @@ ossl_pkcs7_verify(int argc, VALUE *argv, VALUE self)
rb_jump_tag(status);
}
}
- x509st = GetX509StorePtr(store);
- GetPKCS7(self, p7);
if(!(out = BIO_new(BIO_s_mem()))){
BIO_free(in);
sk_X509_pop_free(x509s, X509_free);
@@ -721,13 +776,13 @@ ossl_pkcs7_verify(int argc, VALUE *argv, VALUE self)
}
ok = PKCS7_verify(p7, x509s, x509st, in, out, flg);
BIO_free(in);
- if (ok < 0) ossl_raise(ePKCS7Error, NULL);
+ sk_X509_pop_free(x509s, X509_free);
+ if (ok < 0) ossl_raise(ePKCS7Error, "PKCS7_verify");
msg = ERR_reason_error_string(ERR_get_error());
ossl_pkcs7_set_err_string(self, msg ? rb_str_new2(msg) : Qnil);
ERR_clear_error();
data = ossl_membio2str(out);
ossl_pkcs7_set_data(self, data);
- sk_X509_pop_free(x509s, X509_free);
return (ok == 1) ? Qtrue : Qfalse;
}
@@ -767,12 +822,12 @@ ossl_pkcs7_add_data(VALUE self, VALUE data)
char buf[4096];
int len;
- in = ossl_obj2bio(data);
GetPKCS7(self, pkcs7);
if(PKCS7_type_is_signed(pkcs7)){
if(!PKCS7_content_new(pkcs7, NID_pkcs7_data))
ossl_raise(ePKCS7Error, NULL);
}
+ in = ossl_obj2bio(data);
if(!(out = PKCS7_dataInit(pkcs7, NULL))) goto err;
for(;;){
if((len = BIO_read(in, buf, sizeof(buf))) <= 0)
@@ -784,7 +839,7 @@ ossl_pkcs7_add_data(VALUE self, VALUE data)
ossl_pkcs7_set_data(self, Qnil);
err:
- BIO_free(out);
+ BIO_free_all(out);
BIO_free(in);
if(ERR_peek_error()){
ossl_raise(ePKCS7Error, NULL);
@@ -842,10 +897,11 @@ ossl_pkcs7si_alloc(VALUE klass)
PKCS7_SIGNER_INFO *p7si;
VALUE obj;
+ obj = NewPKCS7si(klass);
if (!(p7si = PKCS7_SIGNER_INFO_new())) {
ossl_raise(ePKCS7Error, NULL);
}
- WrapPKCS7si(klass, obj, p7si);
+ SetPKCS7si(obj, p7si);
return obj;
}
@@ -921,10 +977,11 @@ ossl_pkcs7ri_alloc(VALUE klass)
PKCS7_RECIP_INFO *p7ri;
VALUE obj;
+ obj = NewPKCS7ri(klass);
if (!(p7ri = PKCS7_RECIP_INFO_new())) {
ossl_raise(ePKCS7Error, NULL);
}
- WrapPKCS7ri(klass, obj, p7ri);
+ SetPKCS7ri(obj, p7ri);
return obj;
}
@@ -978,7 +1035,7 @@ ossl_pkcs7ri_get_enc_key(VALUE self)
* INIT
*/
void
-Init_ossl_pkcs7()
+Init_ossl_pkcs7(void)
{
cPKCS7 = rb_define_class_under(mOSSL, "PKCS7", rb_cObject);
ePKCS7Error = rb_define_class_under(cPKCS7, "PKCS7Error", eOSSLError);
diff --git a/ext/openssl/ossl_pkcs7.h b/ext/openssl/ossl_pkcs7.h
index 371c421103..139e00d640 100644
--- a/ext/openssl/ossl_pkcs7.h
+++ b/ext/openssl/ossl_pkcs7.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_PKCS7_H_)
@@ -19,4 +18,3 @@ extern VALUE ePKCS7Error;
void Init_ossl_pkcs7(void);
#endif /* _OSSL_PKCS7_H_ */
-
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index 0004d9d9b5..e758c9e331 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -69,9 +68,23 @@ ossl_generate_cb_stop(void *ptr)
}
#endif
+static void
+ossl_evp_pkey_free(void *ptr)
+{
+ EVP_PKEY_free(ptr);
+}
+
/*
* Public
*/
+const rb_data_type_t ossl_evp_pkey_type = {
+ "OpenSSL/EVP_PKEY",
+ {
+ 0, ossl_evp_pkey_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
VALUE
ossl_pkey_new(EVP_PKEY *pkey)
{
@@ -185,7 +198,7 @@ GetPrivPKeyPtr(VALUE obj)
{
EVP_PKEY *pkey;
- if (rb_funcall(obj, id_private_q, 0, NULL) != Qtrue) {
+ if (rb_funcallv(obj, id_private_q, 0, NULL) != Qtrue) {
ossl_raise(rb_eArgError, "Private key is needed.");
}
SafeGetPKey(obj, pkey);
@@ -209,7 +222,7 @@ DupPrivPKeyPtr(VALUE obj)
{
EVP_PKEY *pkey;
- if (rb_funcall(obj, id_private_q, 0, NULL) != Qtrue) {
+ if (rb_funcallv(obj, id_private_q, 0, NULL) != Qtrue) {
ossl_raise(rb_eArgError, "Private key is needed.");
}
SafeGetPKey(obj, pkey);
@@ -227,10 +240,11 @@ ossl_pkey_alloc(VALUE klass)
EVP_PKEY *pkey;
VALUE obj;
+ obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
ossl_raise(ePKeyError, NULL);
}
- WrapPKey(klass, obj, pkey);
+ SetPKey(obj, pkey);
return obj;
}
@@ -275,8 +289,9 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
EVP_MD_CTX ctx;
unsigned int buf_len;
VALUE str;
+ int result;
- if (rb_funcall(self, id_private_q, 0, NULL) != Qtrue) {
+ if (rb_funcallv(self, id_private_q, 0, NULL) != Qtrue) {
ossl_raise(rb_eArgError, "Private key is needed.");
}
GetPKey(self, pkey);
@@ -284,7 +299,9 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
StringValue(data);
EVP_SignUpdate(&ctx, RSTRING_PTR(data), RSTRING_LEN(data));
str = rb_str_new(0, EVP_PKEY_size(pkey)+16);
- if (!EVP_SignFinal(&ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey))
+ result = EVP_SignFinal(&ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey);
+ EVP_MD_CTX_cleanup(&ctx);
+ if (!result)
ossl_raise(ePKeyError, NULL);
assert((long)buf_len <= RSTRING_LEN(str));
rb_str_set_len(str, buf_len);
@@ -318,13 +335,16 @@ ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
{
EVP_PKEY *pkey;
EVP_MD_CTX ctx;
+ int result;
GetPKey(self, pkey);
- EVP_VerifyInit(&ctx, GetDigestPtr(digest));
StringValue(sig);
StringValue(data);
+ EVP_VerifyInit(&ctx, GetDigestPtr(digest));
EVP_VerifyUpdate(&ctx, RSTRING_PTR(data), RSTRING_LEN(data));
- switch (EVP_VerifyFinal(&ctx, (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), pkey)) {
+ result = EVP_VerifyFinal(&ctx, (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), pkey);
+ EVP_MD_CTX_cleanup(&ctx);
+ switch (result) {
case 0:
return Qfalse;
case 1:
@@ -339,7 +359,7 @@ ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
* INIT
*/
void
-Init_ossl_pkey()
+Init_ossl_pkey(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
@@ -433,4 +453,3 @@ Init_ossl_pkey()
Init_ossl_dh();
Init_ossl_ec();
}
-
diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h
index 686e956ee5..7288d5af7f 100644
--- a/ext/openssl/ossl_pkey.h
+++ b/ext/openssl/ossl_pkey.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_PKEY_H_)
@@ -15,20 +14,23 @@ extern VALUE mPKey;
extern VALUE cPKey;
extern VALUE ePKeyError;
extern ID id_private_q;
+extern const rb_data_type_t ossl_evp_pkey_type;
#define OSSL_PKEY_SET_PRIVATE(obj) rb_iv_set((obj), "private", Qtrue)
#define OSSL_PKEY_SET_PUBLIC(obj) rb_iv_set((obj), "private", Qfalse)
#define OSSL_PKEY_IS_PRIVATE(obj) (rb_iv_get((obj), "private") == Qtrue)
-#define WrapPKey(klass, obj, pkey) do { \
+#define NewPKey(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_evp_pkey_type, 0)
+#define SetPKey(obj, pkey) do { \
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, EVP_PKEY_free, (pkey)); \
+ RTYPEDDATA_DATA(obj) = (pkey); \
OSSL_PKEY_SET_PUBLIC(obj); \
} while (0)
#define GetPKey(obj, pkey) do {\
- Data_Get_Struct((obj), EVP_PKEY, (pkey));\
+ TypedData_Get_Struct((obj), EVP_PKEY, &ossl_evp_pkey_type, (pkey)); \
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
} \
@@ -81,8 +83,6 @@ void Init_ossl_dsa(void);
*/
extern VALUE cDH;
extern VALUE eDHError;
-extern DH *OSSL_DEFAULT_DH_512;
-extern DH *OSSL_DEFAULT_DH_1024;
VALUE ossl_dh_new(EVP_PKEY *);
void Init_ossl_dh(void);
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index a6ae0063f5..3668acb165 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(OPENSSL_NO_DH)
@@ -46,6 +45,7 @@ dh_instance(VALUE klass, DH *dh)
if (!dh) {
return Qfalse;
}
+ obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -53,7 +53,7 @@ dh_instance(VALUE klass, DH *dh)
EVP_PKEY_free(pkey);
return Qfalse;
}
- WrapPKey(klass, obj, pkey);
+ SetPKey(obj, pkey);
return obj;
}
@@ -66,10 +66,11 @@ ossl_dh_new(EVP_PKEY *pkey)
if (!pkey) {
obj = dh_instance(cDH, DH_new());
} else {
+ obj = NewPKey(cDH);
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DH) {
ossl_raise(rb_eTypeError, "Not a DH key!");
}
- WrapPKey(cDH, obj, pkey);
+ SetPKey(obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eDHError, NULL);
@@ -505,6 +506,8 @@ ossl_dh_compute_key(VALUE self, VALUE pub)
GetPKeyDH(self, pkey);
dh = pkey->pkey.dh;
+ if (!dh->p)
+ ossl_raise(eDHError, "incomplete DH");
pub_key = GetBNPtr(pub);
len = DH_size(dh);
str = rb_str_new(0, len);
@@ -522,73 +525,10 @@ OSSL_PKEY_BN(dh, pub_key)
OSSL_PKEY_BN(dh, priv_key)
/*
- * -----BEGIN DH PARAMETERS-----
- * MEYCQQD0zXHljRg/mJ9PYLACLv58Cd8VxBxxY7oEuCeURMiTqEhMym16rhhKgZG2
- * zk2O9uUIBIxSj+NKMURHGaFKyIvLAgEC
- * -----END DH PARAMETERS-----
- */
-static unsigned char DEFAULT_DH_512_PRIM[] = {
- 0xf4, 0xcd, 0x71, 0xe5, 0x8d, 0x18, 0x3f, 0x98,
- 0x9f, 0x4f, 0x60, 0xb0, 0x02, 0x2e, 0xfe, 0x7c,
- 0x09, 0xdf, 0x15, 0xc4, 0x1c, 0x71, 0x63, 0xba,
- 0x04, 0xb8, 0x27, 0x94, 0x44, 0xc8, 0x93, 0xa8,
- 0x48, 0x4c, 0xca, 0x6d, 0x7a, 0xae, 0x18, 0x4a,
- 0x81, 0x91, 0xb6, 0xce, 0x4d, 0x8e, 0xf6, 0xe5,
- 0x08, 0x04, 0x8c, 0x52, 0x8f, 0xe3, 0x4a, 0x31,
- 0x44, 0x47, 0x19, 0xa1, 0x4a, 0xc8, 0x8b, 0xcb,
-};
-static unsigned char DEFAULT_DH_512_GEN[] = { 0x02 };
-DH *OSSL_DEFAULT_DH_512 = NULL;
-
-/*
- * -----BEGIN DH PARAMETERS-----
- * MIGHAoGBAJ0lOVy0VIr/JebWn0zDwY2h+rqITFOpdNr6ugsgvkDXuucdcChhYExJ
- * AV/ZD2AWPbrTqV76mGRgJg4EddgT1zG0jq3rnFdMj2XzkBYx3BVvfR0Arnby0RHR
- * T4h7KZ/2zmjvV+eF8kBUHBJAojUlzxKj4QeO2x20FP9X5xmNUXeDAgEC
- * -----END DH PARAMETERS-----
- */
-static unsigned char DEFAULT_DH_1024_PRIM[] = {
- 0x9d, 0x25, 0x39, 0x5c, 0xb4, 0x54, 0x8a, 0xff,
- 0x25, 0xe6, 0xd6, 0x9f, 0x4c, 0xc3, 0xc1, 0x8d,
- 0xa1, 0xfa, 0xba, 0x88, 0x4c, 0x53, 0xa9, 0x74,
- 0xda, 0xfa, 0xba, 0x0b, 0x20, 0xbe, 0x40, 0xd7,
- 0xba, 0xe7, 0x1d, 0x70, 0x28, 0x61, 0x60, 0x4c,
- 0x49, 0x01, 0x5f, 0xd9, 0x0f, 0x60, 0x16, 0x3d,
- 0xba, 0xd3, 0xa9, 0x5e, 0xfa, 0x98, 0x64, 0x60,
- 0x26, 0x0e, 0x04, 0x75, 0xd8, 0x13, 0xd7, 0x31,
- 0xb4, 0x8e, 0xad, 0xeb, 0x9c, 0x57, 0x4c, 0x8f,
- 0x65, 0xf3, 0x90, 0x16, 0x31, 0xdc, 0x15, 0x6f,
- 0x7d, 0x1d, 0x00, 0xae, 0x76, 0xf2, 0xd1, 0x11,
- 0xd1, 0x4f, 0x88, 0x7b, 0x29, 0x9f, 0xf6, 0xce,
- 0x68, 0xef, 0x57, 0xe7, 0x85, 0xf2, 0x40, 0x54,
- 0x1c, 0x12, 0x40, 0xa2, 0x35, 0x25, 0xcf, 0x12,
- 0xa3, 0xe1, 0x07, 0x8e, 0xdb, 0x1d, 0xb4, 0x14,
- 0xff, 0x57, 0xe7, 0x19, 0x8d, 0x51, 0x77, 0x83
-};
-static unsigned char DEFAULT_DH_1024_GEN[] = { 0x02 };
-DH *OSSL_DEFAULT_DH_1024 = NULL;
-
-static DH*
-ossl_create_dh(unsigned char *p, size_t plen, unsigned char *g, size_t glen)
-{
- DH *dh;
-
- if ((dh = DH_new()) == NULL) ossl_raise(eDHError, NULL);
- dh->p = BN_bin2bn(p, rb_long2int(plen), NULL);
- dh->g = BN_bin2bn(g, rb_long2int(glen), NULL);
- if (dh->p == NULL || dh->g == NULL){
- DH_free(dh);
- ossl_raise(eDHError, NULL);
- }
-
- return dh;
-}
-
-/*
* INIT
*/
void
-Init_ossl_dh()
+Init_ossl_dh(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL and mPKey */
@@ -621,7 +561,7 @@ Init_ossl_dh()
*
* === Example of a key exchange
* dh1 = OpenSSL::PKey::DH.new(2048)
- * params = dh1.public_key.to_der #you may send this publicly to the participating party
+ * der = dh1.public_key.to_der #you may send this publicly to the participating party
* dh2 = OpenSSL::PKey::DH.new(der)
* dh2.generate_key! #generate the per-session key pair
* symm_key1 = dh1.compute_key(dh2.pub_key)
@@ -649,19 +589,11 @@ Init_ossl_dh()
DEF_OSSL_PKEY_BN(cDH, dh, pub_key);
DEF_OSSL_PKEY_BN(cDH, dh, priv_key);
rb_define_method(cDH, "params", ossl_dh_get_params, 0);
-
- OSSL_DEFAULT_DH_512 = ossl_create_dh(
- DEFAULT_DH_512_PRIM, sizeof(DEFAULT_DH_512_PRIM),
- DEFAULT_DH_512_GEN, sizeof(DEFAULT_DH_512_GEN));
- OSSL_DEFAULT_DH_1024 = ossl_create_dh(
- DEFAULT_DH_1024_PRIM, sizeof(DEFAULT_DH_1024_PRIM),
- DEFAULT_DH_1024_GEN, sizeof(DEFAULT_DH_1024_GEN));
}
#else /* defined NO_DH */
void
-Init_ossl_dh()
+Init_ossl_dh(void)
{
}
#endif /* NO_DH */
-
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index 823b9b66e5..1fe5753a4e 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(OPENSSL_NO_DSA)
@@ -40,6 +39,7 @@ dsa_instance(VALUE klass, DSA *dsa)
if (!dsa) {
return Qfalse;
}
+ obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -47,7 +47,7 @@ dsa_instance(VALUE klass, DSA *dsa)
EVP_PKEY_free(pkey);
return Qfalse;
}
- WrapPKey(klass, obj, pkey);
+ SetPKey(obj, pkey);
return obj;
}
@@ -60,10 +60,11 @@ ossl_dsa_new(EVP_PKEY *pkey)
if (!pkey) {
obj = dsa_instance(cDSA, DSA_new());
} else {
+ obj = NewPKey(cDSA);
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DSA) {
ossl_raise(rb_eTypeError, "Not a DSA key!");
}
- WrapPKey(cDSA, obj, pkey);
+ SetPKey(obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eDSAError, NULL);
@@ -109,7 +110,7 @@ dsa_generate(int size)
unsigned long h;
if (!dsa) return 0;
- if (!RAND_bytes(seed, seed_len)) {
+ if (RAND_bytes(seed, seed_len) <= 0) {
DSA_free(dsa);
return 0;
}
@@ -143,7 +144,7 @@ dsa_generate(int size)
int seed_len = 20, counter;
unsigned long h;
- if (!RAND_bytes(seed, seed_len)) {
+ if (RAND_bytes(seed, seed_len) <= 0) {
return 0;
}
dsa = DSA_generate_parameters(size, seed, seed_len, &counter, &h,
@@ -497,10 +498,11 @@ ossl_dsa_sign(VALUE self, VALUE data)
VALUE str;
GetPKeyDSA(self, pkey);
- StringValue(data);
- if (!DSA_PRIVATE(self, pkey->pkey.dsa)) {
+ if (!pkey->pkey.dsa->q)
+ ossl_raise(eDSAError, "incomplete DSA");
+ if (!DSA_PRIVATE(self, pkey->pkey.dsa))
ossl_raise(eDSAError, "Private DSA key needed!");
- }
+ StringValue(data);
str = rb_str_new(0, ossl_dsa_buf_size(pkey));
if (!DSA_sign(0, (unsigned char *)RSTRING_PTR(data), RSTRING_LENINT(data),
(unsigned char *)RSTRING_PTR(str),
@@ -563,7 +565,7 @@ OSSL_PKEY_BN(dsa, priv_key)
* INIT
*/
void
-Init_ossl_dsa()
+Init_ossl_dsa(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL and mPKey */
@@ -617,7 +619,7 @@ Init_ossl_dsa()
#else /* defined NO_DSA */
void
-Init_ossl_dsa()
+Init_ossl_dsa(void)
{
}
#endif /* NO_DSA */
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index 5e419bd167..09987e5426 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -20,6 +20,8 @@ typedef struct {
#define EXPORT_PEM 0
#define EXPORT_DER 1
+static const rb_data_type_t ossl_ec_group_type;
+static const rb_data_type_t ossl_ec_point_type;
#define GetPKeyEC(obj, pkey) do { \
GetPKey((obj), (pkey)); \
@@ -30,7 +32,7 @@ typedef struct {
#define SafeGet_ec_group(obj, group) do { \
OSSL_Check_Kind((obj), cEC_GROUP); \
- Data_Get_Struct((obj), ossl_ec_group, (group)); \
+ TypedData_Get_Struct((obj), ossl_ec_group, &ossl_ec_group_type, (group)); \
} while(0)
#define Get_EC_KEY(obj, key) do { \
@@ -52,7 +54,7 @@ typedef struct {
#define Get_EC_GROUP(obj, g) do { \
ossl_ec_group *ec_group; \
- Data_Get_Struct((obj), ossl_ec_group, ec_group); \
+ TypedData_Get_Struct((obj), ossl_ec_group, &ossl_ec_group_type, ec_group); \
if (ec_group == NULL) \
ossl_raise(eEC_GROUP, "missing ossl_ec_group structure"); \
(g) = ec_group->group; \
@@ -71,7 +73,7 @@ typedef struct {
#define Get_EC_POINT(obj, p) do { \
ossl_ec_point *ec_point; \
- Data_Get_Struct((obj), ossl_ec_point, ec_point); \
+ TypedData_Get_Struct((obj), ossl_ec_point, &ossl_ec_point_type, ec_point); \
if (ec_point == NULL) \
ossl_raise(eEC_POINT, "missing ossl_ec_point structure"); \
(p) = ec_point->point; \
@@ -114,6 +116,7 @@ static VALUE ec_instance(VALUE klass, EC_KEY *ec)
if (!ec) {
return Qfalse;
}
+ obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -121,7 +124,7 @@ static VALUE ec_instance(VALUE klass, EC_KEY *ec)
EVP_PKEY_free(pkey);
return Qfalse;
}
- WrapPKey(klass, obj, pkey);
+ SetPKey(obj, pkey);
return obj;
}
@@ -133,10 +136,11 @@ VALUE ossl_ec_new(EVP_PKEY *pkey)
if (!pkey) {
obj = ec_instance(cEC, EC_KEY_new());
} else {
+ obj = NewPKey(cEC);
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_EC) {
ossl_raise(rb_eTypeError, "Not a EC key!");
}
- WrapPKey(cEC, obj, pkey);
+ SetPKey(obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eECError, NULL);
@@ -369,7 +373,7 @@ static VALUE ossl_ec_point_dup(const EC_POINT *point, VALUE group_v)
ossl_ec_point *new_point;
obj = rb_obj_alloc(cEC_POINT);
- Data_Get_Struct(obj, ossl_ec_point, new_point);
+ TypedData_Get_Struct(obj, ossl_ec_point, &ossl_ec_point_type, new_point);
SafeRequire_EC_GROUP(group_v, group);
@@ -471,6 +475,7 @@ static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int forma
int private = 0;
char *password = NULL;
VALUE str;
+ const EVP_CIPHER *cipher = NULL;
Require_EC_KEY(self, ec);
@@ -483,25 +488,22 @@ static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int forma
if (EC_KEY_get0_private_key(ec))
private = 1;
+ if (!NIL_P(ciph)) {
+ cipher = GetCipherPtr(ciph);
+ if (!NIL_P(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);
+ }
+ }
+
if (!(out = BIO_new(BIO_s_mem())))
ossl_raise(eECError, "BIO_new(BIO_s_mem())");
switch(format) {
case EXPORT_PEM:
if (private) {
- const EVP_CIPHER *cipher;
- if (!NIL_P(ciph)) {
- cipher = GetCipherPtr(ciph);
- if (!NIL_P(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 {
- cipher = NULL;
- }
i = PEM_write_bio_ECPrivateKey(out, ec, cipher, NULL, 0, NULL, password);
} else {
i = PEM_write_bio_EC_PUBKEY(out, ec);
@@ -707,19 +709,28 @@ static VALUE ossl_ec_key_dsa_verify_asn1(VALUE self, VALUE data, VALUE sig)
UNREACHABLE;
}
-static void ossl_ec_group_free(ossl_ec_group *ec_group)
+static void ossl_ec_group_free(void *ptr)
{
+ ossl_ec_group *ec_group = ptr;
if (!ec_group->dont_free && ec_group->group)
EC_GROUP_clear_free(ec_group->group);
ruby_xfree(ec_group);
}
+static const rb_data_type_t ossl_ec_group_type = {
+ "OpenSSL/ec_group",
+ {
+ 0, ossl_ec_group_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE ossl_ec_group_alloc(VALUE klass)
{
ossl_ec_group *ec_group;
VALUE obj;
- obj = Data_Make_Struct(klass, ossl_ec_group, 0, ossl_ec_group_free, ec_group);
+ obj = TypedData_Make_Struct(klass, ossl_ec_group, &ossl_ec_group_type, ec_group);
return obj;
}
@@ -746,7 +757,7 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
ossl_ec_group *ec_group;
EC_GROUP *group = NULL;
- Data_Get_Struct(self, ossl_ec_group, ec_group);
+ TypedData_Get_Struct(self, ossl_ec_group, &ossl_ec_group_type, ec_group);
if (ec_group->group != NULL)
ossl_raise(rb_eRuntimeError, "EC_GROUP is already initialized");
@@ -1219,19 +1230,28 @@ static VALUE ossl_ec_group_to_text(VALUE self)
}
-static void ossl_ec_point_free(ossl_ec_point *ec_point)
+static void ossl_ec_point_free(void *ptr)
{
+ ossl_ec_point *ec_point = ptr;
if (!ec_point->dont_free && ec_point->point)
EC_POINT_clear_free(ec_point->point);
ruby_xfree(ec_point);
}
+static const rb_data_type_t ossl_ec_point_type = {
+ "OpenSSL/ec_point",
+ {
+ 0, ossl_ec_point_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE ossl_ec_point_alloc(VALUE klass)
{
ossl_ec_point *ec_point;
VALUE obj;
- obj = Data_Make_Struct(klass, ossl_ec_point, 0, ossl_ec_point_free, ec_point);
+ obj = TypedData_Make_Struct(klass, ossl_ec_point, &ossl_ec_point_type, ec_point);
return obj;
}
@@ -1252,7 +1272,7 @@ static VALUE ossl_ec_point_initialize(int argc, VALUE *argv, VALUE self)
VALUE group_v = Qnil;
const EC_GROUP *group = NULL;
- Data_Get_Struct(self, ossl_ec_point, ec_point);
+ TypedData_Get_Struct(self, ossl_ec_point, &ossl_ec_point_type, ec_point);
if (ec_point->point)
ossl_raise(eEC_POINT, "EC_POINT already initialized");
@@ -1556,7 +1576,7 @@ static void no_copy(VALUE klass)
rb_undef_method(klass, "initialize_copy");
}
-void Init_ossl_ec()
+void Init_ossl_ec(void)
{
#ifdef DONT_NEED_RDOC_WORKAROUND
mOSSL = rb_define_module("OpenSSL");
@@ -1677,7 +1697,7 @@ void Init_ossl_ec()
}
#else /* defined NO_EC */
-void Init_ossl_ec()
+void Init_ossl_ec(void)
{
}
#endif /* NO_EC */
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 4c346a042f..26b1fbe1b6 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(OPENSSL_NO_RSA)
@@ -40,6 +39,7 @@ rsa_instance(VALUE klass, RSA *rsa)
if (!rsa) {
return Qfalse;
}
+ obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -47,7 +47,7 @@ rsa_instance(VALUE klass, RSA *rsa)
EVP_PKEY_free(pkey);
return Qfalse;
}
- WrapPKey(klass, obj, pkey);
+ SetPKey(obj, pkey);
return obj;
}
@@ -61,10 +61,11 @@ ossl_rsa_new(EVP_PKEY *pkey)
obj = rsa_instance(cRSA, RSA_new());
}
else {
+ obj = NewPKey(cRSA);
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_RSA) {
ossl_raise(rb_eTypeError, "Not a RSA key!");
}
- WrapPKey(cRSA, obj, pkey);
+ SetPKey(obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eRSAError, NULL);
@@ -390,6 +391,8 @@ ossl_rsa_public_encrypt(int argc, VALUE *argv, VALUE self)
VALUE str, buffer, padding;
GetPKeyRSA(self, pkey);
+ if (!pkey->pkey.rsa->n)
+ ossl_raise(eRSAError, "incomplete RSA");
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
@@ -419,6 +422,8 @@ ossl_rsa_public_decrypt(int argc, VALUE *argv, VALUE self)
VALUE str, buffer, padding;
GetPKeyRSA(self, pkey);
+ if (!pkey->pkey.rsa->n)
+ ossl_raise(eRSAError, "incomplete RSA");
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
@@ -448,9 +453,10 @@ ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self)
VALUE str, buffer, padding;
GetPKeyRSA(self, pkey);
- if (!RSA_PRIVATE(self, pkey->pkey.rsa)) {
- ossl_raise(eRSAError, "private key needed.");
- }
+ if (!pkey->pkey.rsa->n)
+ ossl_raise(eRSAError, "incomplete RSA");
+ if (!RSA_PRIVATE(self, pkey->pkey.rsa))
+ ossl_raise(eRSAError, "private key needed");
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
@@ -480,9 +486,10 @@ ossl_rsa_private_decrypt(int argc, VALUE *argv, VALUE self)
VALUE str, buffer, padding;
GetPKeyRSA(self, pkey);
- if (!RSA_PRIVATE(self, pkey->pkey.rsa)) {
- ossl_raise(eRSAError, "private key needed.");
- }
+ if (!pkey->pkey.rsa->n)
+ ossl_raise(eRSAError, "incomplete RSA");
+ if (!RSA_PRIVATE(self, pkey->pkey.rsa))
+ ossl_raise(eRSAError, "private key needed");
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
@@ -626,7 +633,7 @@ OSSL_PKEY_BN(rsa, iqmp)
#define DefRSAConst(x) rb_define_const(cRSA, #x,INT2FIX(RSA_##x))
void
-Init_ossl_rsa()
+Init_ossl_rsa(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL and mPKey */
@@ -694,8 +701,7 @@ Init_ossl_rsa()
#else /* defined NO_RSA */
void
-Init_ossl_rsa()
+Init_ossl_rsa(void)
{
}
#endif /* NO_RSA */
-
diff --git a/ext/openssl/ossl_rand.c b/ext/openssl/ossl_rand.c
index 270a4b7437..daf866d772 100644
--- a/ext/openssl/ossl_rand.c
+++ b/ext/openssl/ossl_rand.c
@@ -1,37 +1,22 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
+ *
* All rights reserved.
- */
-/*
- * This program is licenced under the same licence as Ruby.
+ *
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-/*
- * Classes
- */
VALUE mRandom;
VALUE eRandomError;
/*
- * Struct
- */
-
-/*
- * Public
- */
-
-/*
- * Private
- */
-
-/*
* call-seq:
* seed(str) -> str
*
+ * ::seed is equivalent to ::add where +entropy+ is length of +str+.
*/
static VALUE
ossl_rand_seed(VALUE self, VALUE str)
@@ -46,6 +31,23 @@ ossl_rand_seed(VALUE self, VALUE str)
* call-seq:
* add(str, entropy) -> self
*
+ * Mixes the bytes from +str+ into the Pseudo Random Number Generator(PRNG)
+ * state.
+ *
+ * Thus, if the data from +str+ are unpredictable to an adversary, this
+ * increases the uncertainty about the state and makes the PRNG output less
+ * predictable.
+ *
+ * The +entropy+ argument is (the lower bound of) an estimate of how much
+ * randomness is contained in +str+, measured in bytes.
+ *
+ * Example:
+ *
+ * pid = $$
+ * now = Time.now
+ * ary = [now.to_i, now.nsec, 1000, pid]
+ * OpenSSL::Random.add(ary.join("").to_s, 0.0)
+ * OpenSSL::Random.seed(ary.join("").to_s)
*/
static VALUE
ossl_rand_add(VALUE self, VALUE str, VALUE entropy)
@@ -60,6 +62,7 @@ ossl_rand_add(VALUE self, VALUE str, VALUE entropy)
* call-seq:
* load_random_file(filename) -> true
*
+ * Reads bytes from +filename+ and adds them to the PRNG.
*/
static VALUE
ossl_rand_load_file(VALUE self, VALUE filename)
@@ -76,6 +79,9 @@ ossl_rand_load_file(VALUE self, VALUE filename)
* call-seq:
* write_random_file(filename) -> true
*
+ * Writes a number of random generated bytes (currently 1024) to +filename+
+ * which can be used to initialize the PRNG by calling ::load_random_file in a
+ * later session.
*/
static VALUE
ossl_rand_write_file(VALUE self, VALUE filename)
@@ -89,18 +95,31 @@ ossl_rand_write_file(VALUE self, VALUE filename)
/*
* call-seq:
- * random_bytes(length) -> aString
+ * random_bytes(length) -> string
+ *
+ * Generates +string+ with +length+ number of cryptographically strong
+ * pseudo-random bytes.
+ *
+ * Example:
*
+ * OpenSSL::Random.random_bytes(12)
+ * => "..."
*/
static VALUE
ossl_rand_bytes(VALUE self, VALUE len)
{
VALUE str;
int n = NUM2INT(len);
+ int ret;
str = rb_str_new(0, n);
- if (!RAND_bytes((unsigned char *)RSTRING_PTR(str), n)) {
- ossl_raise(eRandomError, NULL);
+ ret = RAND_bytes((unsigned char *)RSTRING_PTR(str), n);
+ if (ret == 0){
+ char buf[256];
+ ERR_error_string_n(ERR_get_error(), buf, 256);
+ ossl_raise(eRandomError, "RAND_bytes error: %s", buf);
+ } else if (ret == -1) {
+ ossl_raise(eRandomError, "RAND_bytes is not supported");
}
return str;
@@ -108,8 +127,17 @@ ossl_rand_bytes(VALUE self, VALUE len)
/*
* call-seq:
- * pseudo_bytes(length) -> aString
+ * pseudo_bytes(length) -> string
+ *
+ * Generates +string+ with +length+ number of pseudo-random bytes.
+ *
+ * Pseudo-random byte sequences generated by ::pseudo_bytes will be unique if
+ * they are of sufficient length, but are not necessarily unpredictable.
+ *
+ * Example:
*
+ * OpenSSL::Random.pseudo_bytes(12)
+ * => "..."
*/
static VALUE
ossl_rand_pseudo_bytes(VALUE self, VALUE len)
@@ -125,10 +153,12 @@ ossl_rand_pseudo_bytes(VALUE self, VALUE len)
return str;
}
+#ifdef HAVE_RAND_EGD
/*
* call-seq:
* egd(filename) -> true
*
+ * Same as ::egd_bytes but queries 255 bytes by default.
*/
static VALUE
ossl_rand_egd(VALUE self, VALUE filename)
@@ -145,6 +175,10 @@ ossl_rand_egd(VALUE self, VALUE filename)
* call-seq:
* egd_bytes(filename, length) -> true
*
+ * Queries the entropy gathering daemon EGD on socket path given by +filename+.
+ *
+ * Fetches +length+ number of bytes and uses ::add to seed the OpenSSL built-in
+ * PRNG.
*/
static VALUE
ossl_rand_egd_bytes(VALUE self, VALUE filename, VALUE len)
@@ -158,6 +192,7 @@ ossl_rand_egd_bytes(VALUE self, VALUE filename, VALUE len)
}
return Qtrue;
}
+#endif /* HAVE_RAND_EGD */
/*
* call-seq:
@@ -171,15 +206,11 @@ ossl_rand_status(VALUE self)
return RAND_status() ? Qtrue : Qfalse;
}
-#define DEFMETH(class, name, func, argc) \
- rb_define_method((class), (name), (func), (argc)); \
- rb_define_singleton_method((class), (name), (func), (argc));
-
/*
* INIT
*/
void
-Init_ossl_rand()
+Init_ossl_rand(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
@@ -189,14 +220,15 @@ Init_ossl_rand()
eRandomError = rb_define_class_under(mRandom, "RandomError", eOSSLError);
- DEFMETH(mRandom, "seed", ossl_rand_seed, 1);
- DEFMETH(mRandom, "random_add", ossl_rand_add, 2);
- DEFMETH(mRandom, "load_random_file", ossl_rand_load_file, 1);
- DEFMETH(mRandom, "write_random_file", ossl_rand_write_file, 1);
- DEFMETH(mRandom, "random_bytes", ossl_rand_bytes, 1);
- DEFMETH(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
- DEFMETH(mRandom, "egd", ossl_rand_egd, 1);
- DEFMETH(mRandom, "egd_bytes", ossl_rand_egd_bytes, 2);
- DEFMETH(mRandom, "status?", ossl_rand_status, 0)
+ rb_define_module_function(mRandom, "seed", ossl_rand_seed, 1);
+ rb_define_module_function(mRandom, "random_add", ossl_rand_add, 2);
+ rb_define_module_function(mRandom, "load_random_file", ossl_rand_load_file, 1);
+ rb_define_module_function(mRandom, "write_random_file", ossl_rand_write_file, 1);
+ rb_define_module_function(mRandom, "random_bytes", ossl_rand_bytes, 1);
+ rb_define_module_function(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
+#ifdef HAVE_RAND_EGD
+ rb_define_module_function(mRandom, "egd", ossl_rand_egd, 1);
+ rb_define_module_function(mRandom, "egd_bytes", ossl_rand_egd_bytes, 2);
+#endif /* HAVE_RAND_EGD */
+ rb_define_module_function(mRandom, "status?", ossl_rand_status, 0);
}
-
diff --git a/ext/openssl/ossl_rand.h b/ext/openssl/ossl_rand.h
index ce2ae0d129..8f77a3b239 100644
--- a/ext/openssl/ossl_rand.h
+++ b/ext/openssl/ossl_rand.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_RAND_H_)
@@ -17,4 +16,3 @@ extern VALUE eRandomError;
void Init_ossl_rand(void);
#endif /* _OSSL_RAND_H_ */
-
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index ec7135064a..7a0eb4ec90 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1,5 +1,4 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2000-2002 GOTOU Yuuzou <gotoyuzo@notwork.org>
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
@@ -7,7 +6,7 @@
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -24,8 +23,13 @@
# define TO_SOCKET(s) (s)
#endif
+#define GetSSLCTX(obj, ctx) do { \
+ TypedData_Get_Struct((obj), SSL_CTX, &ossl_sslctx_type, (ctx)); \
+} while (0)
+
VALUE mSSL;
-VALUE eSSLError;
+static VALUE mSSLExtConfig;
+static VALUE eSSLError;
VALUE cSSLContext;
VALUE cSSLSocket;
@@ -41,11 +45,9 @@ static VALUE eSSLErrorWaitWritable;
#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")
@@ -57,58 +59,30 @@ static VALUE eSSLErrorWaitWritable;
#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_tmp_ecdh_cb(o) rb_iv_get((o),"@tmp_ecdh_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", "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")
#define ossl_ssl_get_ctx(o) rb_iv_get((o),"@context")
-#define ossl_ssl_get_sync_close(o) rb_iv_get((o),"@sync_close")
#define ossl_ssl_get_x509(o) rb_iv_get((o),"@x509")
#define ossl_ssl_get_key(o) rb_iv_get((o),"@key")
-#define ossl_ssl_get_tmp_dh(o) rb_iv_get((o),"@tmp_dh")
-#define ossl_ssl_set_io(o,v) rb_iv_set((o),"@io",(v))
-#define ossl_ssl_set_ctx(o,v) rb_iv_set((o),"@context",(v))
-#define ossl_ssl_set_sync_close(o,v) rb_iv_set((o),"@sync_close",(v))
#define ossl_ssl_set_x509(o,v) rb_iv_set((o),"@x509",(v))
#define ossl_ssl_set_key(o,v) rb_iv_set((o),"@key",(v))
#define ossl_ssl_set_tmp_dh(o,v) rb_iv_set((o),"@tmp_dh",(v))
+#define ossl_ssl_set_tmp_ecdh(o,v) rb_iv_set((o),"@tmp_ecdh",(v))
-static const char *ossl_ssl_attr_readers[] = { "io", "context", };
-static const char *ossl_ssl_attrs[] = {
-#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
- "hostname",
-#endif
- "sync_close",
-};
-
-ID ID_callback_state;
+static ID ID_callback_state;
-static VALUE sym_exception;
+static VALUE sym_exception, sym_wait_readable, sym_wait_writable;
/*
* SSLContext class
*/
-struct {
+static const struct {
const char *name;
SSL_METHOD *(*func)(void);
} ossl_ssl_method_tab[] = {
@@ -134,45 +108,60 @@ struct {
OSSL_SSL_METHOD_ENTRY(SSLv2_server),
OSSL_SSL_METHOD_ENTRY(SSLv2_client),
#endif
+#if defined(HAVE_SSLV3_METHOD) && defined(HAVE_SSLV3_SERVER_METHOD) && \
+ defined(HAVE_SSLV3_CLIENT_METHOD)
OSSL_SSL_METHOD_ENTRY(SSLv3),
OSSL_SSL_METHOD_ENTRY(SSLv3_server),
OSSL_SSL_METHOD_ENTRY(SSLv3_client),
+#endif
OSSL_SSL_METHOD_ENTRY(SSLv23),
OSSL_SSL_METHOD_ENTRY(SSLv23_server),
OSSL_SSL_METHOD_ENTRY(SSLv23_client),
#undef OSSL_SSL_METHOD_ENTRY
};
-int ossl_ssl_ex_vcb_idx;
-int ossl_ssl_ex_store_p;
-int ossl_ssl_ex_ptr_idx;
-int ossl_ssl_ex_client_cert_cb_idx;
-int ossl_ssl_ex_tmp_dh_callback_idx;
+static int ossl_ssl_ex_vcb_idx;
+static int ossl_ssl_ex_store_p;
+static int ossl_ssl_ex_ptr_idx;
static void
-ossl_sslctx_free(SSL_CTX *ctx)
+ossl_sslctx_free(void *ptr)
{
+ SSL_CTX *ctx = ptr;
if(ctx && SSL_CTX_get_ex_data(ctx, ossl_ssl_ex_store_p)== (void*)1)
ctx->cert_store = NULL;
SSL_CTX_free(ctx);
}
+static const rb_data_type_t ossl_sslctx_type = {
+ "OpenSSL/SSL/CTX",
+ {
+ 0, ossl_sslctx_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE
ossl_sslctx_s_alloc(VALUE klass)
{
SSL_CTX *ctx;
long mode = SSL_MODE_ENABLE_PARTIAL_WRITE;
+ VALUE obj;
#ifdef SSL_MODE_RELEASE_BUFFERS
mode |= SSL_MODE_RELEASE_BUFFERS;
#endif
+ obj = TypedData_Wrap_Struct(klass, &ossl_sslctx_type, 0);
ctx = SSL_CTX_new(SSLv23_method());
if (!ctx) {
ossl_raise(eSSLError, "SSL_CTX_new");
}
SSL_CTX_set_mode(ctx, mode);
- return Data_Wrap_Struct(klass, 0, ossl_sslctx_free, ctx);
+ RTYPEDDATA_DATA(obj) = ctx;
+ SSL_CTX_set_ex_data(ctx, ossl_ssl_ex_ptr_idx, (void*)obj);
+
+ return obj;
}
/*
@@ -187,13 +176,13 @@ ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method)
{
SSL_METHOD *method = NULL;
const char *s;
+ VALUE m = ssl_method;
int i;
SSL_CTX *ctx;
- if(TYPE(ssl_method) == T_SYMBOL)
- s = rb_id2name(SYM2ID(ssl_method));
- else
- s = StringValuePtr(ssl_method);
+ if (RB_TYPE_P(ssl_method, T_SYMBOL))
+ m = rb_sym2str(ssl_method);
+ s = StringValueCStr(m);
for (i = 0; i < numberof(ossl_ssl_method_tab); i++) {
if (strcmp(ossl_ssl_method_tab[i].name, s) == 0) {
method = ossl_ssl_method_tab[i].func();
@@ -201,9 +190,9 @@ ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method)
}
}
if (!method) {
- ossl_raise(rb_eArgError, "unknown SSL method `%s'.", s);
+ ossl_raise(rb_eArgError, "unknown SSL method `%"PRIsVALUE"'.", m);
}
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
if (SSL_CTX_set_ssl_version(ctx, method) != 1) {
ossl_raise(eSSLError, "SSL_CTX_set_ssl_version");
}
@@ -211,41 +200,12 @@ ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method)
return ssl_method;
}
-/*
- * call-seq:
- * SSLContext.new => ctx
- * SSLContext.new(:TLSv1) => ctx
- * SSLContext.new("SSLv23_client") => ctx
- *
- * You can get a list of valid methods with OpenSSL::SSL::SSLContext::METHODS
- */
-static VALUE
-ossl_sslctx_initialize(int argc, VALUE *argv, VALUE self)
-{
- VALUE ssl_method;
- int i;
-
- for(i = 0; i < numberof(ossl_sslctx_attrs); i++){
- char buf[32];
- snprintf(buf, sizeof(buf), "@%s", ossl_sslctx_attrs[i]);
- rb_iv_set(self, buf, Qnil);
- }
- if (rb_scan_args(argc, argv, "01", &ssl_method) == 0){
- return self;
- }
- ossl_sslctx_set_ssl_version(self, ssl_method);
-
- return self;
-}
-
static VALUE
ossl_call_client_cert_cb(VALUE obj)
{
VALUE cb, ary, cert, key;
- SSL *ssl;
- Data_Get_Struct(obj, SSL, ssl);
- cb = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_client_cert_cb_idx);
+ cb = rb_funcall(obj, rb_intern("client_cert_cb"), 0);
if (NIL_P(cb)) return Qfalse;
ary = rb_funcall(cb, rb_intern("call"), 1, obj);
Check_Type(ary, T_ARRAY);
@@ -263,8 +223,7 @@ ossl_client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
VALUE obj, success;
obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- success = rb_protect((VALUE(*)_((VALUE)))ossl_call_client_cert_cb,
- obj, NULL);
+ success = rb_protect(ossl_call_client_cert_cb, obj, NULL);
if (!RTEST(success)) return 0;
*x509 = DupX509CertPtr(ossl_ssl_get_x509(obj));
*pkey = DupPKeyPtr(ossl_ssl_get_key(obj));
@@ -274,52 +233,71 @@ ossl_client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
#if !defined(OPENSSL_NO_DH)
static VALUE
-ossl_call_tmp_dh_callback(VALUE *args)
+ossl_call_tmp_dh_callback(VALUE args)
{
- SSL *ssl;
VALUE cb, dh;
EVP_PKEY *pkey;
- Data_Get_Struct(args[0], SSL, ssl);
- cb = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_tmp_dh_callback_idx);
+ cb = rb_funcall(rb_ary_entry(args, 0), rb_intern("tmp_dh_callback"), 0);
+
if (NIL_P(cb)) return Qfalse;
- dh = rb_funcall(cb, rb_intern("call"), 3, args[0], args[1], args[2]);
+ dh = rb_apply(cb, rb_intern("call"), args);
pkey = GetPKeyPtr(dh);
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DH) return Qfalse;
- ossl_ssl_set_tmp_dh(args[0], dh);
- return Qtrue;
+ return dh;
}
static DH*
ossl_tmp_dh_callback(SSL *ssl, int is_export, int keylength)
{
- VALUE args[3], success;
+ VALUE args, dh, rb_ssl;
+
+ rb_ssl = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- args[0] = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- args[1] = INT2FIX(is_export);
- args[2] = INT2FIX(keylength);
- success = rb_protect((VALUE(*)_((VALUE)))ossl_call_tmp_dh_callback,
- (VALUE)args, NULL);
- if (!RTEST(success)) return NULL;
+ args = rb_ary_new_from_args(3, rb_ssl, INT2FIX(is_export), INT2FIX(keylength));
- return GetPKeyPtr(ossl_ssl_get_tmp_dh(args[0]))->pkey.dh;
+ dh = rb_protect(ossl_call_tmp_dh_callback, args, NULL);
+ if (!RTEST(dh)) return NULL;
+ ossl_ssl_set_tmp_dh(rb_ssl, dh);
+
+ return GetPKeyPtr(dh)->pkey.dh;
}
+#endif /* OPENSSL_NO_DH */
-static DH*
-ossl_default_tmp_dh_callback(SSL *ssl, int is_export, int keylength)
+#if !defined(OPENSSL_NO_EC)
+static VALUE
+ossl_call_tmp_ecdh_callback(VALUE args)
+{
+ VALUE cb, ecdh;
+ EVP_PKEY *pkey;
+
+ cb = rb_funcall(rb_ary_entry(args, 0), rb_intern("tmp_ecdh_callback"), 0);
+
+ if (NIL_P(cb)) return Qfalse;
+ ecdh = rb_apply(cb, rb_intern("call"), args);
+ pkey = GetPKeyPtr(ecdh);
+ if (EVP_PKEY_type(pkey->type) != EVP_PKEY_EC) return Qfalse;
+
+ return ecdh;
+}
+
+static EC_KEY*
+ossl_tmp_ecdh_callback(SSL *ssl, int is_export, int keylength)
{
- rb_warning("using default DH parameters.");
+ VALUE args, ecdh, rb_ssl;
- switch(keylength){
- case 512:
- return OSSL_DEFAULT_DH_512;
- case 1024:
- return OSSL_DEFAULT_DH_1024;
- }
- return NULL;
+ rb_ssl = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
+
+ args = rb_ary_new_from_args(3, rb_ssl, INT2FIX(is_export), INT2FIX(keylength));
+
+ ecdh = rb_protect(ossl_call_tmp_ecdh_callback, args, NULL);
+ if (!RTEST(ecdh)) return NULL;
+ ossl_ssl_set_tmp_ecdh(rb_ssl, ecdh);
+
+ return GetPKeyPtr(ecdh)->pkey.ec;
}
-#endif /* OPENSSL_NO_DH */
+#endif
static int
ossl_ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
@@ -329,21 +307,19 @@ ossl_ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
cb = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_vcb_idx);
- X509_STORE_CTX_set_ex_data(ctx, ossl_verify_cb_idx, (void*)cb);
+ X509_STORE_CTX_set_ex_data(ctx, ossl_store_ctx_ex_verify_cb_idx, (void *)cb);
return ossl_verify_cb(preverify_ok, ctx);
}
static VALUE
ossl_call_session_get_cb(VALUE ary)
{
- VALUE ssl_obj, sslctx_obj, cb;
+ VALUE ssl_obj, cb;
Check_Type(ary, T_ARRAY);
ssl_obj = rb_ary_entry(ary, 0);
- sslctx_obj = rb_iv_get(ssl_obj, "@context");
- if (NIL_P(sslctx_obj)) return Qnil;
- cb = rb_iv_get(sslctx_obj, "@session_get_cb");
+ cb = rb_funcall(ssl_obj, rb_intern("session_get_cb"), 0);
if (NIL_P(cb)) return Qnil;
return rb_funcall(cb, rb_intern("call"), 1, ary);
@@ -366,7 +342,7 @@ ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, rb_str_new((const char *)buf, len));
- ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_get_cb, ary, &state);
+ ret_obj = rb_protect(ossl_call_session_get_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
return NULL;
@@ -383,14 +359,12 @@ ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy)
static VALUE
ossl_call_session_new_cb(VALUE ary)
{
- VALUE ssl_obj, sslctx_obj, cb;
+ VALUE ssl_obj, cb;
Check_Type(ary, T_ARRAY);
ssl_obj = rb_ary_entry(ary, 0);
- sslctx_obj = rb_iv_get(ssl_obj, "@context");
- if (NIL_P(sslctx_obj)) return Qnil;
- cb = rb_iv_get(sslctx_obj, "@session_new_cb");
+ cb = rb_funcall(ssl_obj, rb_intern("session_new_cb"), 0);
if (NIL_P(cb)) return Qnil;
return rb_funcall(cb, rb_intern("call"), 1, ary);
@@ -417,7 +391,7 @@ ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, sess_obj);
- rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
+ rb_protect(ossl_call_session_new_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
}
@@ -482,7 +456,7 @@ ossl_sslctx_add_extra_chain_cert_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arg))
X509 *x509;
SSL_CTX *ctx;
- Data_Get_Struct(arg, SSL_CTX, ctx);
+ GetSSLCTX(arg, ctx);
x509 = DupX509CertPtr(i);
if(!SSL_CTX_add_extra_chain_cert(ctx, x509)){
ossl_raise(eSSLError, NULL);
@@ -513,9 +487,10 @@ ossl_call_servername_cb(VALUE ary)
SSL_CTX *ctx2;
ossl_sslctx_setup(ret_obj);
- Data_Get_Struct(ssl_obj, SSL, ssl);
- Data_Get_Struct(ret_obj, SSL_CTX, ctx2);
+ GetSSL(ssl_obj, ssl);
+ GetSSLCTX(ret_obj, ctx2);
SSL_set_SSL_CTX(ssl, ctx2);
+ rb_iv_set(ssl_obj, "@context", ret_obj);
} else if (!NIL_P(ret_obj)) {
ossl_raise(rb_eArgError, "servername_cb must return an OpenSSL::SSL::SSLContext object or nil");
}
@@ -569,7 +544,7 @@ ssl_renegotiation_cb(const SSL *ssl)
(void) rb_funcall(cb, rb_intern("call"), 1, ssl_obj);
}
-#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+#if defined(HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB) || defined(HAVE_SSL_CTX_SET_ALPN_SELECT_CB)
static VALUE
ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
{
@@ -584,15 +559,45 @@ ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
return Qnil;
}
-static void
-ssl_npn_encode_protocols(VALUE sslctx, VALUE protocols)
+static VALUE
+ssl_encode_npn_protocols(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);
+ return encoded;
+}
+
+static int
+ssl_npn_select_cb_common(VALUE cb, const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen)
+{
+ VALUE selected;
+ long len;
+ VALUE protocols = rb_ary_new();
+ unsigned char l;
+ const unsigned char *in_end = in + inlen;
+
+ /* assume OpenSSL verifies this format */
+ /* The format is len_1|proto_1|...|len_n|proto_n */
+ while (in < in_end) {
+ l = *in++;
+ rb_ary_push(protocols, rb_str_new((const char *)in, l));
+ in += l;
+ }
+
+ selected = rb_funcall(cb, rb_intern("call"), 1, protocols);
+ StringValue(selected);
+ len = RSTRING_LEN(selected);
+ if (len < 1 || len >= 256) {
+ ossl_raise(eSSLError, "Selected protocol name must have length 1..255");
+ }
+ *out = (unsigned char *)RSTRING_PTR(selected);
+ *outlen = (unsigned char)len;
+
+ return SSL_TLSEXT_ERR_OK;
}
+#ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
static int
ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg)
{
@@ -608,28 +613,28 @@ ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen,
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;
+ VALUE sslctx_obj, cb;
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;
- }
+ return ssl_npn_select_cb_common(cb, (const unsigned char **)out, outlen, in, inlen);
+}
+#endif
- selected = rb_funcall(cb, rb_intern("call"), 1, protocols);
- StringValue(selected);
- *out = (unsigned char *) StringValuePtr(selected);
- *outlen = RSTRING_LENINT(selected);
+#ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
+static int
+ssl_alpn_select_cb(SSL *ssl, const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
+{
+ VALUE sslctx_obj, cb;
- return SSL_TLSEXT_ERR_OK;
+ sslctx_obj = (VALUE) arg;
+ cb = rb_iv_get(sslctx_obj, "@alpn_select_cb");
+
+ return ssl_npn_select_cb_common(cb, out, outlen, in, inlen);
}
#endif
+#endif /* HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB || HAVE_SSL_CTX_SET_ALPN_SELECT_CB */
/* This function may serve as the entry point to support further
* callbacks. */
@@ -645,13 +650,46 @@ ssl_info_cb(const SSL *ssl, int where, int val)
}
/*
+ * Gets various OpenSSL options.
+ */
+static VALUE
+ossl_sslctx_get_options(VALUE self)
+{
+ SSL_CTX *ctx;
+ GetSSLCTX(self, ctx);
+ return LONG2NUM(SSL_CTX_get_options(ctx));
+}
+
+/*
+ * Sets various OpenSSL options.
+ */
+static VALUE
+ossl_sslctx_set_options(VALUE self, VALUE options)
+{
+ SSL_CTX *ctx;
+
+ rb_check_frozen(self);
+ GetSSLCTX(self, ctx);
+
+ SSL_CTX_clear_options(ctx, SSL_CTX_get_options(ctx));
+
+ if (NIL_P(options)) {
+ SSL_CTX_set_options(ctx, SSL_OP_ALL);
+ } else {
+ SSL_CTX_set_options(ctx, NUM2LONG(options));
+ }
+
+ return self;
+}
+
+/*
* call-seq:
* ctx.setup => Qtrue # first time
* ctx.setup => nil # thereafter
*
* This method is called automatically when a new SSLSocket is created.
- * Normally you do not need to call this method (unless you are writing an
- * extension in C).
+ * However, it is not thread-safe and must be called before creating
+ * SSLSocket objects in a multi-threaded program.
*/
static VALUE
ossl_sslctx_setup(VALUE self)
@@ -661,21 +699,22 @@ ossl_sslctx_setup(VALUE self)
X509_STORE *store;
EVP_PKEY *key = NULL;
char *ca_path = NULL, *ca_file = NULL;
- int i, verify_mode;
+ int verify_mode;
+ long i;
VALUE val;
if(OBJ_FROZEN(self)) return Qnil;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
#if !defined(OPENSSL_NO_DH)
- if (RTEST(ossl_sslctx_get_tmp_dh_cb(self))){
- SSL_CTX_set_tmp_dh_callback(ctx, ossl_tmp_dh_callback);
- }
- else{
- SSL_CTX_set_tmp_dh_callback(ctx, ossl_default_tmp_dh_callback);
+ SSL_CTX_set_tmp_dh_callback(ctx, ossl_tmp_dh_callback);
+#endif
+
+#if !defined(OPENSSL_NO_EC)
+ if (RTEST(ossl_sslctx_get_tmp_ecdh_cb(self))){
+ SSL_CTX_set_tmp_ecdh_callback(ctx, ossl_tmp_ecdh_callback);
}
#endif
- SSL_CTX_set_ex_data(ctx, ossl_ssl_ex_ptr_idx, (void*)self);
val = ossl_sslctx_get_cert_store(self);
if(!NIL_P(val)){
@@ -716,9 +755,9 @@ ossl_sslctx_setup(VALUE self)
val = ossl_sslctx_get_client_ca(self);
if(!NIL_P(val)){
- if(TYPE(val) == T_ARRAY){
+ if (RB_TYPE_P(val, T_ARRAY)) {
for(i = 0; i < RARRAY_LEN(val); i++){
- client_ca = GetX509CertPtr(RARRAY_PTR(val)[i]);
+ client_ca = GetX509CertPtr(RARRAY_AREF(val, i));
if (!SSL_CTX_add_client_CA(ctx, client_ca)){
/* Copies X509_NAME => FREE it. */
ossl_raise(eSSLError, "SSL_CTX_add_client_CA");
@@ -755,17 +794,10 @@ ossl_sslctx_setup(VALUE self)
val = ossl_sslctx_get_verify_dep(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));
- } else {
- SSL_CTX_set_options(ctx, SSL_OP_ALL);
- }
-
-#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+#ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
val = rb_iv_get(self, "@npn_protocols");
if (!NIL_P(val)) {
- ssl_npn_encode_protocols(self, val);
+ rb_iv_set(self, "@_protocols", ssl_encode_npn_protocols(val));
SSL_CTX_set_next_protos_advertised_cb(ctx, ssl_npn_advertise_cb, (void *) self);
OSSL_Debug("SSL NPN advertise callback added");
}
@@ -775,6 +807,19 @@ ossl_sslctx_setup(VALUE self)
}
#endif
+#ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
+ val = rb_iv_get(self, "@alpn_protocols");
+ if (!NIL_P(val)) {
+ VALUE rprotos = ssl_encode_npn_protocols(val);
+ SSL_CTX_set_alpn_protos(ctx, (const unsigned char *)StringValueCStr(rprotos), RSTRING_LENINT(rprotos));
+ OSSL_Debug("SSL ALPN values added");
+ }
+ if (RTEST(rb_iv_get(self, "@alpn_select_cb"))) {
+ SSL_CTX_set_alpn_select_cb(ctx, ssl_alpn_select_cb, (void *) self);
+ OSSL_Debug("SSL ALPN select callback added");
+ }
+#endif
+
rb_obj_freeze(self);
val = ossl_sslctx_get_sess_id_ctx(self);
@@ -841,7 +886,7 @@ ossl_sslctx_get_ciphers(VALUE self)
VALUE ary;
int i, num;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
if(!ctx){
rb_warning("SSL_CTX is not initialized.");
return Qnil;
@@ -882,11 +927,11 @@ ossl_sslctx_set_ciphers(VALUE self, VALUE v)
rb_check_frozen(self);
if (NIL_P(v))
return v;
- else if (TYPE(v) == T_ARRAY) {
+ else if (RB_TYPE_P(v, T_ARRAY)) {
str = rb_str_new(0, 0);
for (i = 0; i < RARRAY_LEN(v); i++) {
elem = rb_ary_entry(v, i);
- if (TYPE(elem) == T_ARRAY) elem = rb_ary_entry(elem, 0);
+ if (RB_TYPE_P(elem, T_ARRAY)) elem = rb_ary_entry(elem, 0);
elem = rb_String(elem);
rb_str_append(str, elem);
if (i < RARRAY_LEN(v)-1) rb_str_cat2(str, ":");
@@ -896,7 +941,7 @@ ossl_sslctx_set_ciphers(VALUE self, VALUE v)
StringValue(str);
}
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
if(!ctx){
ossl_raise(eSSLError, "SSL_CTX is not initialized.");
return Qnil;
@@ -920,7 +965,7 @@ ossl_sslctx_session_add(VALUE self, VALUE arg)
SSL_CTX *ctx;
SSL_SESSION *sess;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
SafeGetSSLSession(arg, sess);
return SSL_CTX_add_session(ctx, sess) == 1 ? Qtrue : Qfalse;
@@ -938,7 +983,7 @@ ossl_sslctx_session_remove(VALUE self, VALUE arg)
SSL_CTX *ctx;
SSL_SESSION *sess;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
SafeGetSSLSession(arg, sess);
return SSL_CTX_remove_session(ctx, sess) == 1 ? Qtrue : Qfalse;
@@ -955,7 +1000,7 @@ ossl_sslctx_get_session_cache_mode(VALUE self)
{
SSL_CTX *ctx;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
return LONG2NUM(SSL_CTX_get_session_cache_mode(ctx));
}
@@ -973,7 +1018,7 @@ ossl_sslctx_set_session_cache_mode(VALUE self, VALUE arg)
{
SSL_CTX *ctx;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
SSL_CTX_set_session_cache_mode(ctx, NUM2LONG(arg));
@@ -992,7 +1037,7 @@ ossl_sslctx_get_session_cache_size(VALUE self)
{
SSL_CTX *ctx;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
return LONG2NUM(SSL_CTX_sess_get_cache_size(ctx));
}
@@ -1009,7 +1054,7 @@ ossl_sslctx_set_session_cache_size(VALUE self, VALUE arg)
{
SSL_CTX *ctx;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
SSL_CTX_sess_set_cache_size(ctx, NUM2LONG(arg));
@@ -1044,7 +1089,7 @@ ossl_sslctx_get_session_cache_stats(VALUE self)
SSL_CTX *ctx;
VALUE hash;
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
hash = rb_hash_new();
rb_hash_aset(hash, ID2SYM(rb_intern("cache_num")), LONG2NUM(SSL_CTX_sess_number(ctx)));
@@ -1079,7 +1124,7 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "01", &arg1);
- Data_Get_Struct(self, SSL_CTX, ctx);
+ GetSSLCTX(self, ctx);
if (NIL_P(arg1)) {
tm = time(0);
@@ -1111,7 +1156,7 @@ ossl_ssl_shutdown(SSL *ssl)
* Ignore the case SSL_shutdown returns -1. Empty handshake_func
* must not happen.
*/
- if (rc = SSL_shutdown(ssl))
+ if ((rc = SSL_shutdown(ssl)) != 0)
break;
}
SSL_clear(ssl);
@@ -1120,53 +1165,23 @@ ossl_ssl_shutdown(SSL *ssl)
}
static void
-ossl_ssl_free(SSL *ssl)
+ossl_ssl_free(void *ssl)
{
SSL_free(ssl);
}
-static VALUE
-ossl_ssl_s_alloc(VALUE klass)
-{
- return Data_Wrap_Struct(klass, 0, ossl_ssl_free, NULL);
-}
+const rb_data_type_t ossl_ssl_type = {
+ "OpenSSL/SSL",
+ {
+ 0, ossl_ssl_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
-/*
- * call-seq:
- * SSLSocket.new(io) => aSSLSocket
- * SSLSocket.new(io, ctx) => aSSLSocket
- *
- * Creates a new SSL socket from +io+ which must be a real ruby object (not an
- * IO-like object that responds to read/write).
- *
- * If +ctx+ is provided the SSL Sockets initial params will be taken from
- * the context.
- *
- * The OpenSSL::Buffering module provides additional IO methods.
- *
- * This method will freeze the SSLContext if one is provided;
- * however, session management is still allowed in the frozen SSLContext.
- */
static VALUE
-ossl_ssl_initialize(int argc, VALUE *argv, VALUE self)
+ossl_ssl_s_alloc(VALUE klass)
{
- VALUE io, ctx;
-
- if (rb_scan_args(argc, argv, "11", &io, &ctx) == 1) {
- ctx = rb_funcall(cSSLContext, rb_intern("new"), 0);
- }
- OSSL_Check_Kind(ctx, cSSLContext);
- Check_Type(io, T_FILE);
- ossl_ssl_set_io(self, io);
- ossl_ssl_set_ctx(self, ctx);
- ossl_ssl_set_sync_close(self, Qfalse);
- ossl_sslctx_setup(ctx);
-
- rb_iv_set(self, "@hostname", Qnil);
-
- rb_call_super(0, 0);
-
- return self;
+ return TypedData_Wrap_Struct(klass, &ossl_ssl_type, NULL);
}
static VALUE
@@ -1177,14 +1192,14 @@ ossl_ssl_setup(VALUE self)
SSL *ssl;
rb_io_t *fptr;
- Data_Get_Struct(self, SSL, ssl);
+ GetSSL(self, ssl);
if(!ssl){
#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
VALUE hostname = rb_iv_get(self, "@hostname");
#endif
v_ctx = ossl_ssl_get_ctx(self);
- Data_Get_Struct(v_ctx, SSL_CTX, ctx);
+ GetSSLCTX(v_ctx, ctx);
ssl = SSL_new(ctx);
if (!ssl) {
@@ -1206,10 +1221,6 @@ ossl_ssl_setup(VALUE self)
SSL_set_ex_data(ssl, ossl_ssl_ex_ptr_idx, (void*)self);
cb = ossl_sslctx_get_verify_cb(v_ctx);
SSL_set_ex_data(ssl, ossl_ssl_ex_vcb_idx, (void*)cb);
- cb = ossl_sslctx_get_client_cert_cb(v_ctx);
- 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);
}
@@ -1224,7 +1235,7 @@ ossl_ssl_setup(VALUE self)
#define ossl_ssl_data_get_struct(v, ssl) \
do { \
- Data_Get_Struct((v), SSL, (ssl)); \
+ GetSSL((v), (ssl)); \
if (!(ssl)) { \
rb_warning("SSL session is not started yet."); \
return Qnil; \
@@ -1249,13 +1260,23 @@ read_would_block(int nonblock)
}
}
+static int
+no_exception_p(VALUE opts)
+{
+ if (RB_TYPE_P(opts, T_HASH) &&
+ rb_hash_lookup2(opts, sym_exception, Qundef) == Qfalse)
+ return 1;
+ return 0;
+}
+
static VALUE
-ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, int nonblock)
+ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, VALUE opts)
{
SSL *ssl;
rb_io_t *fptr;
int ret, ret2;
VALUE cb_state;
+ int nonblock = opts != Qfalse;
rb_ivar_set(self, ID_callback_state, Qnil);
@@ -1274,10 +1295,12 @@ ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, int nonblock)
switch((ret2 = ssl_get_error(ssl, ret))){
case SSL_ERROR_WANT_WRITE:
+ if (no_exception_p(opts)) { return sym_wait_writable; }
write_would_block(nonblock);
rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
+ if (no_exception_p(opts)) { return sym_wait_readable; }
read_would_block(nonblock);
rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
@@ -1303,12 +1326,13 @@ static VALUE
ossl_ssl_connect(VALUE self)
{
ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_connect, "SSL_connect", 0);
+
+ return ossl_start_ssl(self, SSL_connect, "SSL_connect", Qfalse);
}
/*
* call-seq:
- * ssl.connect_nonblock => self
+ * ssl.connect_nonblock([options]) => self
*
* Initiates the SSL/TLS handshake as a client in non-blocking manner.
*
@@ -1323,12 +1347,20 @@ ossl_ssl_connect(VALUE self)
* retry
* end
*
+ * By specifying `exception: false`, the options hash allows you to indicate
+ * that connect_nonblock should not raise an IO::WaitReadable or
+ * IO::WaitWritable exception, but return the symbol :wait_readable or
+ * :wait_writable instead.
*/
static VALUE
-ossl_ssl_connect_nonblock(VALUE self)
+ossl_ssl_connect_nonblock(int argc, VALUE *argv, VALUE self)
{
+ VALUE opts;
+ rb_scan_args(argc, argv, "0:", &opts);
+
ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_connect, "SSL_connect", 1);
+
+ return ossl_start_ssl(self, SSL_connect, "SSL_connect", opts);
}
/*
@@ -1342,12 +1374,13 @@ static VALUE
ossl_ssl_accept(VALUE self)
{
ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_accept, "SSL_accept", 0);
+
+ return ossl_start_ssl(self, SSL_accept, "SSL_accept", Qfalse);
}
/*
* call-seq:
- * ssl.accept_nonblock => self
+ * ssl.accept_nonblock([options]) => self
*
* Initiates the SSL/TLS handshake as a server in non-blocking manner.
*
@@ -1362,12 +1395,20 @@ ossl_ssl_accept(VALUE self)
* retry
* end
*
+ * By specifying `exception: false`, the options hash allows you to indicate
+ * that accept_nonblock should not raise an IO::WaitReadable or
+ * IO::WaitWritable exception, but return the symbol :wait_readable or
+ * :wait_writable instead.
*/
static VALUE
-ossl_ssl_accept_nonblock(VALUE self)
+ossl_ssl_accept_nonblock(int argc, VALUE *argv, VALUE self)
{
+ VALUE opts;
+
+ rb_scan_args(argc, argv, "0:", &opts);
ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_accept, "SSL_accept", 1);
+
+ return ossl_start_ssl(self, SSL_accept, "SSL_accept", opts);
}
static VALUE
@@ -1375,15 +1416,15 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
{
SSL *ssl;
int ilen, nread = 0;
- int no_exception = 0;
VALUE len, str;
rb_io_t *fptr;
VALUE opts = Qnil;
- rb_scan_args(argc, argv, "11:", &len, &str, &opts);
-
- if (!NIL_P(opts) && Qfalse == rb_hash_aref(opts, sym_exception))
- no_exception = 1;
+ if (nonblock) {
+ rb_scan_args(argc, argv, "11:", &len, &str, &opts);
+ } else {
+ rb_scan_args(argc, argv, "11", &len, &str);
+ }
ilen = NUM2INT(len);
if(NIL_P(str)) str = rb_str_new(0, ilen);
@@ -1394,7 +1435,7 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
}
if(ilen == 0) return str;
- Data_Get_Struct(self, SSL, ssl);
+ GetSSL(self, ssl);
GetOpenFile(ossl_ssl_get_io(self), fptr);
if (ssl) {
if(!nonblock && SSL_pending(ssl) <= 0)
@@ -1405,21 +1446,21 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
case SSL_ERROR_NONE:
goto end;
case SSL_ERROR_ZERO_RETURN:
- if (no_exception) { return Qnil; }
+ if (no_exception_p(opts)) { return Qnil; }
rb_eof_error();
case SSL_ERROR_WANT_WRITE:
- if (no_exception) { return ID2SYM(rb_intern("wait_writable")); }
+ if (no_exception_p(opts)) { return sym_wait_writable; }
write_would_block(nonblock);
rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
- if (no_exception) { return ID2SYM(rb_intern("wait_readable")); }
+ if (no_exception_p(opts)) { return sym_wait_readable; }
read_would_block(nonblock);
rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_SYSCALL:
if(ERR_peek_error() == 0 && nread == 0) {
- if (no_exception) { return Qnil; }
+ if (no_exception_p(opts)) { return Qnil; }
rb_eof_error();
}
rb_sys_fail(0);
@@ -1431,7 +1472,11 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
else {
ID meth = nonblock ? rb_intern("read_nonblock") : rb_intern("sysread");
rb_warning("SSL session is not started yet.");
- return rb_funcall(ossl_ssl_get_io(self), meth, 2, len, str);
+ if (nonblock) {
+ return rb_funcall(ossl_ssl_get_io(self), meth, 3, len, str, opts);
+ } else {
+ return rb_funcall(ossl_ssl_get_io(self), meth, 2, len, str);
+ }
}
end:
@@ -1475,29 +1520,36 @@ ossl_ssl_read_nonblock(int argc, VALUE *argv, VALUE self)
}
static VALUE
-ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock, int no_exception)
+ossl_ssl_write_internal(VALUE self, VALUE str, VALUE opts)
{
SSL *ssl;
int nwrite = 0;
rb_io_t *fptr;
+ int nonblock = opts != Qfalse;
StringValue(str);
- Data_Get_Struct(self, SSL, ssl);
+ GetSSL(self, ssl);
GetOpenFile(ossl_ssl_get_io(self), fptr);
if (ssl) {
for (;;){
- nwrite = SSL_write(ssl, RSTRING_PTR(str), RSTRING_LENINT(str));
+ int num = RSTRING_LENINT(str);
+
+ /* SSL_write(3ssl) manpage states num == 0 is undefined */
+ if (num == 0)
+ goto end;
+
+ nwrite = SSL_write(ssl, RSTRING_PTR(str), num);
switch(ssl_get_error(ssl, nwrite)){
case SSL_ERROR_NONE:
goto end;
case SSL_ERROR_WANT_WRITE:
- if (no_exception) { return ID2SYM(rb_intern("wait_writable")); }
+ if (no_exception_p(opts)) { return sym_wait_writable; }
write_would_block(nonblock);
rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
- if (no_exception) { return ID2SYM(rb_intern("wait_readable")); }
+ if (no_exception_p(opts)) { return sym_wait_readable; }
read_would_block(nonblock);
rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
@@ -1527,7 +1579,7 @@ ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock, int no_exception)
static VALUE
ossl_ssl_write(VALUE self, VALUE str)
{
- return ossl_ssl_write_internal(self, str, 0, 0);
+ return ossl_ssl_write_internal(self, str, Qfalse);
}
/*
@@ -1540,41 +1592,28 @@ ossl_ssl_write(VALUE self, VALUE str)
static VALUE
ossl_ssl_write_nonblock(int argc, VALUE *argv, VALUE self)
{
- VALUE str;
- VALUE opts = Qnil;
- int no_exception = 0;
+ VALUE str, opts;
rb_scan_args(argc, argv, "1:", &str, &opts);
- if (!NIL_P(opts) && Qfalse == rb_hash_aref(opts, sym_exception))
- no_exception = 1;
-
- return ossl_ssl_write_internal(self, str, 1, no_exception);
+ return ossl_ssl_write_internal(self, str, opts);
}
/*
* call-seq:
- * ssl.sysclose => nil
+ * ssl.stop => nil
*
- * Shuts down the SSL connection and prepares it for another connection.
+ * Sends "close notify" to the peer and tries to shut down the SSL connection
+ * gracefully.
*/
static VALUE
-ossl_ssl_close(VALUE self)
+ossl_ssl_stop(VALUE self)
{
SSL *ssl;
ossl_ssl_data_get_struct(self, ssl);
- if (ssl) {
- VALUE io = ossl_ssl_get_io(self);
- if (!RTEST(rb_funcall(io, rb_intern("closed?"), 0))) {
- ossl_ssl_shutdown(ssl);
- SSL_free(ssl);
- DATA_PTR(self) = NULL;
- if (RTEST(ossl_ssl_get_sync_close(self)))
- rb_funcall(io, rb_intern("close"), 0);
- }
- }
+ ossl_ssl_shutdown(ssl);
return Qnil;
}
@@ -1823,7 +1862,7 @@ ossl_ssl_get_client_ca_list(VALUE self)
return ossl_x509name_sk2ary(ca);
}
-# ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+# ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
/*
* call-seq:
* ssl.npn_protocol => String
@@ -1847,10 +1886,35 @@ ossl_ssl_npn_protocol(VALUE self)
return rb_str_new((const char *) out, outlen);
}
# endif
+
+# ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
+/*
+ * call-seq:
+ * ssl.alpn_protocol => String
+ *
+ * Returns the ALPN protocol string that was finally selected by the client
+ * during the handshake.
+ */
+static VALUE
+ossl_ssl_alpn_protocol(VALUE self)
+{
+ SSL *ssl;
+ const unsigned char *out;
+ unsigned int outlen;
+
+ ossl_ssl_data_get_struct(self, ssl);
+
+ SSL_get0_alpn_selected(ssl, &out, &outlen);
+ if (!outlen)
+ return Qnil;
+ else
+ return rb_str_new((const char *) out, outlen);
+}
+# endif
#endif /* !defined(OPENSSL_NO_SOCK) */
void
-Init_ossl_ssl()
+Init_ossl_ssl(void)
{
int i;
VALUE ary;
@@ -1864,10 +1928,6 @@ Init_ossl_ssl()
ossl_ssl_ex_vcb_idx = SSL_get_ex_new_index(0,(void *)"ossl_ssl_ex_vcb_idx",0,0,0);
ossl_ssl_ex_store_p = SSL_get_ex_new_index(0,(void *)"ossl_ssl_ex_store_p",0,0,0);
ossl_ssl_ex_ptr_idx = SSL_get_ex_new_index(0,(void *)"ossl_ssl_ex_ptr_idx",0,0,0);
- ossl_ssl_ex_client_cert_cb_idx =
- SSL_get_ex_new_index(0,(void *)"ossl_ssl_ex_client_cert_cb_idx",0,0,0);
- 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
*
@@ -1877,6 +1937,17 @@ Init_ossl_ssl()
* of SSLContext to set up connections.
*/
mSSL = rb_define_module_under(mOSSL, "SSL");
+
+ /* Document-module: OpenSSL::ExtConfig
+ *
+ * This module contains configuration information about the SSL extension,
+ * for example if socket support is enabled, or the host name TLS extension
+ * is enabled. Constants in this module will always be defined, but contain
+ * `true` or `false` values depending on the configuration of your OpenSSL
+ * installation.
+ */
+ mSSLExtConfig = rb_define_module_under(mOSSL, "ExtConfig");
+
/* Document-class: OpenSSL::SSL::SSLError
*
* Generic error class raised by SSLSocket and SSLContext.
@@ -1965,11 +2036,6 @@ Init_ossl_ssl()
rb_attr(cSSLContext, rb_intern("verify_callback"), 1, 1, Qfalse);
/*
- * Sets various OpenSSL options.
- */
- rb_attr(cSSLContext, rb_intern("options"), 1, 1, Qfalse);
-
- /*
* An OpenSSL::X509::Store used for certificate verification
*/
rb_attr(cSSLContext, rb_intern("cert_store"), 1, 1, Qfalse);
@@ -1991,16 +2057,16 @@ Init_ossl_ssl()
rb_attr(cSSLContext, rb_intern("client_cert_cb"), 1, 1, Qfalse);
/*
- * A callback invoked when DH parameters are required.
+ * A callback invoked when ECDH parameters are required.
*
* The callback is invoked with the Session for the key exchange, an
* flag indicating the use of an export cipher and the keylength
* required.
*
- * The callback must return an OpenSSL::PKey::DH instance of the correct
+ * The callback must return an OpenSSL::PKey::EC instance of the correct
* key length.
*/
- rb_attr(cSSLContext, rb_intern("tmp_dh_callback"), 1, 1, Qfalse);
+ rb_attr(cSSLContext, rb_intern("tmp_ecdh_callback"), 1, 1, Qfalse);
/*
* Sets the context in which a session can be reused. This allows
@@ -2019,7 +2085,7 @@ Init_ossl_ssl()
rb_attr(cSSLContext, rb_intern("session_get_cb"), 1, 1, Qfalse);
/*
- * A callback invoked when a new session was negotiatied.
+ * A callback invoked when a new session was negotiated.
*
* The callback is invoked with an SSLSocket. If false is returned the
* session will be removed from the internal cache.
@@ -2034,15 +2100,17 @@ Init_ossl_ssl()
rb_attr(cSSLContext, rb_intern("session_remove_cb"), 1, 1, Qfalse);
#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
- /*
- * A callback invoked at connect time to distinguish between multiple
- * server names.
- *
- * The callback is invoked with an SSLSocket and a server name. The
- * callback must return an SSLContext for the server name or nil.
- */
- rb_attr(cSSLContext, rb_intern("servername_cb"), 1, 1, Qfalse);
+ rb_define_const(mSSLExtConfig, "HAVE_TLSEXT_HOST_NAME", Qtrue);
+#else
+ rb_define_const(mSSLExtConfig, "HAVE_TLSEXT_HOST_NAME", Qfalse);
#endif
+
+#ifdef TLS_DH_anon_WITH_AES_256_GCM_SHA384
+ rb_define_const(mSSLExtConfig, "TLS_DH_anon_WITH_AES_256_GCM_SHA384", Qtrue);
+#else
+ rb_define_const(mSSLExtConfig, "TLS_DH_anon_WITH_AES_256_GCM_SHA384", Qfalse);
+#endif
+
/*
* A callback invoked whenever a new handshake is initiated. May be used
* to disable renegotiation entirely.
@@ -2065,7 +2133,7 @@ Init_ossl_ssl()
* end
*/
rb_attr(cSSLContext, rb_intern("renegotiation_cb"), 1, 1, Qfalse);
-#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+#ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
/*
* An Enumerable of Strings. Each String represents a protocol to be
* advertised as the list of supported protocols for Next Protocol
@@ -2097,9 +2165,40 @@ Init_ossl_ssl()
rb_attr(cSSLContext, rb_intern("npn_select_cb"), 1, 1, Qfalse);
#endif
+#ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
+ /*
+ * An Enumerable of Strings. Each String represents a protocol to be
+ * advertised as the list of supported protocols for Application-Layer 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.alpn_protocols = ["http/1.1", "spdy/2", "h2"]
+ */
+ rb_attr(cSSLContext, rb_intern("alpn_protocols"), 1, 1, Qfalse);
+ /*
+ * A callback invoked on the server side when the server needs to select
+ * a protocol from the list sent by the client. Supported in OpenSSL 1.0.2
+ * and higher. The server MUST select a protocol of those advertised by
+ * the client. 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 ALPN extension on the client - any protocols
+ * advertised by the server will be ignored.
+ *
+ * === Example
+ *
+ * ctx.alpn_select_cb = lambda do |protocols|
+ * #inspect the protocols and select one
+ * protocols.first
+ * end
+ */
+ rb_attr(cSSLContext, rb_intern("alpn_select_cb"), 1, 1, Qfalse);
+#endif
+
rb_define_alias(cSSLContext, "ssl_timeout", "timeout");
rb_define_alias(cSSLContext, "ssl_timeout=", "timeout=");
- rb_define_method(cSSLContext, "initialize", ossl_sslctx_initialize, -1);
rb_define_method(cSSLContext, "ssl_version=", ossl_sslctx_set_ssl_version, 1);
rb_define_method(cSSLContext, "ciphers", ossl_sslctx_get_ciphers, 0);
rb_define_method(cSSLContext, "ciphers=", ossl_sslctx_set_ciphers, 1);
@@ -2161,6 +2260,8 @@ Init_ossl_ssl()
rb_define_method(cSSLContext, "session_cache_size=", ossl_sslctx_set_session_cache_size, 1);
rb_define_method(cSSLContext, "session_cache_stats", ossl_sslctx_get_session_cache_stats, 0);
rb_define_method(cSSLContext, "flush_sessions", ossl_sslctx_flush_sessions, -1);
+ rb_define_method(cSSLContext, "options", ossl_sslctx_get_options, 0);
+ rb_define_method(cSSLContext, "options=", ossl_sslctx_set_options, 1);
ary = rb_ary_new2(numberof(ossl_ssl_method_tab));
for (i = 0; i < numberof(ossl_ssl_method_tab); i++) {
@@ -2179,24 +2280,19 @@ Init_ossl_ssl()
*/
cSSLSocket = rb_define_class_under(mSSL, "SSLSocket", rb_cObject);
#ifdef OPENSSL_NO_SOCK
- rb_define_method(cSSLSocket, "initialize", rb_notimplement, -1);
+ rb_define_const(mSSLExtConfig, "OPENSSL_NO_SOCK", Qtrue);
#else
+ rb_define_const(mSSLExtConfig, "OPENSSL_NO_SOCK", Qfalse);
rb_define_alloc_func(cSSLSocket, ossl_ssl_s_alloc);
- for(i = 0; i < numberof(ossl_ssl_attr_readers); i++)
- rb_attr(cSSLSocket, rb_intern(ossl_ssl_attr_readers[i]), 1, 0, Qfalse);
- for(i = 0; i < numberof(ossl_ssl_attrs); i++)
- rb_attr(cSSLSocket, rb_intern(ossl_ssl_attrs[i]), 1, 1, Qfalse);
- rb_define_alias(cSSLSocket, "to_io", "io");
- rb_define_method(cSSLSocket, "initialize", ossl_ssl_initialize, -1);
rb_define_method(cSSLSocket, "connect", ossl_ssl_connect, 0);
- rb_define_method(cSSLSocket, "connect_nonblock", ossl_ssl_connect_nonblock, 0);
+ rb_define_method(cSSLSocket, "connect_nonblock", ossl_ssl_connect_nonblock, -1);
rb_define_method(cSSLSocket, "accept", ossl_ssl_accept, 0);
- rb_define_method(cSSLSocket, "accept_nonblock", ossl_ssl_accept_nonblock, 0);
+ rb_define_method(cSSLSocket, "accept_nonblock", ossl_ssl_accept_nonblock, -1);
rb_define_method(cSSLSocket, "sysread", ossl_ssl_read, -1);
rb_define_private_method(cSSLSocket, "sysread_nonblock", ossl_ssl_read_nonblock, -1);
rb_define_method(cSSLSocket, "syswrite", ossl_ssl_write, 1);
rb_define_private_method(cSSLSocket, "syswrite_nonblock", ossl_ssl_write_nonblock, -1);
- rb_define_method(cSSLSocket, "sysclose", ossl_ssl_close, 0);
+ rb_define_private_method(cSSLSocket, "stop", ossl_ssl_stop, 0);
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);
@@ -2209,12 +2305,15 @@ Init_ossl_ssl()
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
+# ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
+ rb_define_method(cSSLSocket, "alpn_protocol", ossl_ssl_alpn_protocol, 0);
+# endif
+# ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
rb_define_method(cSSLSocket, "npn_protocol", ossl_ssl_npn_protocol, 0);
# endif
#endif
-#define ossl_ssl_def_const(x) rb_define_const(mSSL, #x, INT2NUM(SSL_##x))
+#define ossl_ssl_def_const(x) rb_define_const(mSSL, #x, LONG2NUM(SSL_##x))
ossl_ssl_def_const(VERIFY_NONE);
ossl_ssl_def_const(VERIFY_PEER);
@@ -2229,7 +2328,9 @@ Init_ossl_ssl()
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);
+#if defined(SSL_OP_MSIE_SSLV2_RSA_PADDING)
ossl_ssl_def_const(OP_MSIE_SSLV2_RSA_PADDING);
+#endif
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);
@@ -2267,5 +2368,8 @@ Init_ossl_ssl()
ossl_ssl_def_const(OP_NETSCAPE_CA_DN_BUG);
ossl_ssl_def_const(OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
+#undef rb_intern
sym_exception = ID2SYM(rb_intern("exception"));
+ sym_wait_readable = ID2SYM(rb_intern("wait_readable"));
+ sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
}
diff --git a/ext/openssl/ossl_ssl.h b/ext/openssl/ossl_ssl.h
index 034762fc46..909f6798c4 100644
--- a/ext/openssl/ossl_ssl.h
+++ b/ext/openssl/ossl_ssl.h
@@ -1,18 +1,21 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_SSL_H_)
#define _OSSL_SSL_H_
+#define GetSSL(obj, ssl) do { \
+ TypedData_Get_Struct((obj), SSL, &ossl_ssl_type, (ssl)); \
+} while (0)
+
#define GetSSLSession(obj, sess) do { \
- Data_Get_Struct((obj), SSL_SESSION, (sess)); \
+ TypedData_Get_Struct((obj), SSL_SESSION, &ossl_ssl_session_type, (sess)); \
if (!(sess)) { \
ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
} \
@@ -23,14 +26,13 @@
GetSSLSession((obj), (sess)); \
} while (0)
+extern const rb_data_type_t ossl_ssl_type;
+extern const rb_data_type_t ossl_ssl_session_type;
extern VALUE mSSL;
-extern VALUE eSSLError;
extern VALUE cSSLSocket;
-extern VALUE cSSLContext;
extern VALUE cSSLSession;
void Init_ossl_ssl(void);
void Init_ossl_ssl_session(void);
#endif /* _OSSL_SSL_H_ */
-
diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c
index a7437caf37..e1bbc6fb54 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -4,25 +4,26 @@
#include "ossl.h"
-#define GetSSLSession(obj, sess) do { \
- Data_Get_Struct((obj), SSL_SESSION, (sess)); \
- if (!(sess)) { \
- ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
- } \
-} while (0)
-
-#define SafeGetSSLSession(obj, sess) do { \
- OSSL_Check_Kind((obj), cSSLSession); \
- GetSSLSession((obj), (sess)); \
-} while (0)
-
-
VALUE cSSLSession;
static VALUE eSSLSession;
+static void
+ossl_ssl_session_free(void *ptr)
+{
+ SSL_SESSION_free(ptr);
+}
+
+const rb_data_type_t ossl_ssl_session_type = {
+ "OpenSSL/SSL/Session",
+ {
+ 0, ossl_ssl_session_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE ossl_ssl_session_alloc(VALUE klass)
{
- return Data_Wrap_Struct(klass, 0, SSL_SESSION_free, NULL);
+ return TypedData_Wrap_Struct(klass, &ossl_ssl_session_type, NULL);
}
/*
@@ -43,7 +44,7 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
if (rb_obj_is_instance_of(arg1, cSSLSocket)) {
SSL *ssl;
- Data_Get_Struct(arg1, SSL, ssl);
+ GetSSL(arg1, ssl);
if (!ssl || (ctx = SSL_get1_session(ssl)) == NULL)
ossl_raise(eSSLSession, "no session available");
@@ -78,7 +79,11 @@ int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b)
if (a->ssl_version != b->ssl_version ||
a->session_id_length != b->session_id_length)
return 1;
- return memcmp(a->session_id,b-> session_id, a->session_id_length);
+#if defined(_WIN32)
+ return memcmp(a->session_id, b->session_id, a->session_id_length);
+#else
+ return CRYPTO_memcmp(a->session_id, b->session_id, a->session_id_length);
+#endif
}
#endif
diff --git a/ext/openssl/ossl_version.h b/ext/openssl/ossl_version.h
index 193ceab089..dcd026a19c 100644
--- a/ext/openssl/ossl_version.h
+++ b/ext/openssl/ossl_version.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_VERSION_H_)
diff --git a/ext/openssl/ossl_x509.c b/ext/openssl/ossl_x509.c
index fd1d9b6c7e..2fd14566cd 100644
--- a/ext/openssl/ossl_x509.c
+++ b/ext/openssl/ossl_x509.c
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -17,7 +16,7 @@ VALUE mX509;
rb_define_const(mX509, "DEFAULT_" #x, rb_str_new2(X509_get_default_##i()))
void
-Init_ossl_x509()
+Init_ossl_x509(void)
{
mX509 = rb_define_module_under(mOSSL, "X509");
@@ -101,4 +100,3 @@ Init_ossl_x509()
DefX509Default(CERT_FILE_ENV, cert_file_env);
DefX509Default(PRIVATE_DIR, private_dir);
}
-
diff --git a/ext/openssl/ossl_x509.h b/ext/openssl/ossl_x509.h
index 1a43569073..9dedb9a49a 100644
--- a/ext/openssl/ossl_x509.h
+++ b/ext/openssl/ossl_x509.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_X509_H_)
@@ -25,7 +24,7 @@ extern VALUE cX509Attr;
extern VALUE eX509AttrError;
VALUE ossl_x509attr_new(X509_ATTRIBUTE *);
-X509_ATTRIBUTE *DupX509AttrPtr(VALUE);
+X509_ATTRIBUTE *GetX509AttrPtr(VALUE);
void Init_ossl_x509attr(void);
/*
diff --git a/ext/openssl/ossl_x509attr.c b/ext/openssl/ossl_x509attr.c
index d50f88c969..b5a2441807 100644
--- a/ext/openssl/ossl_x509attr.c
+++ b/ext/openssl/ossl_x509attr.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509Attr(klass, obj, attr) do { \
+#define NewX509Attr(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509attr_type, 0)
+#define SetX509Attr(obj, attr) do { \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_ATTRIBUTE_free, (attr)); \
+ RTYPEDDATA_DATA(obj) = (attr); \
} while (0)
#define GetX509Attr(obj, attr) do { \
- Data_Get_Struct((obj), X509_ATTRIBUTE, (attr)); \
+ TypedData_Get_Struct((obj), X509_ATTRIBUTE, &ossl_x509attr_type, (attr)); \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
@@ -33,6 +34,20 @@
VALUE cX509Attr;
VALUE eX509AttrError;
+static void
+ossl_x509attr_free(void *ptr)
+{
+ X509_ATTRIBUTE_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509attr_type = {
+ "OpenSSL/X509/ATTRIBUTE",
+ {
+ 0, ossl_x509attr_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public
*/
@@ -42,6 +57,7 @@ ossl_x509attr_new(X509_ATTRIBUTE *attr)
X509_ATTRIBUTE *new;
VALUE obj;
+ obj = NewX509Attr(cX509Attr);
if (!attr) {
new = X509_ATTRIBUTE_new();
} else {
@@ -50,22 +66,19 @@ ossl_x509attr_new(X509_ATTRIBUTE *attr)
if (!new) {
ossl_raise(eX509AttrError, NULL);
}
- WrapX509Attr(cX509Attr, obj, new);
+ SetX509Attr(obj, new);
return obj;
}
X509_ATTRIBUTE *
-DupX509AttrPtr(VALUE obj)
+GetX509AttrPtr(VALUE obj)
{
- X509_ATTRIBUTE *attr, *new;
+ X509_ATTRIBUTE *attr;
SafeGetX509Attr(obj, attr);
- if (!(new = X509_ATTRIBUTE_dup(attr))) {
- ossl_raise(eX509AttrError, NULL);
- }
- return new;
+ return attr;
}
/*
@@ -77,9 +90,10 @@ ossl_x509attr_alloc(VALUE klass)
X509_ATTRIBUTE *attr;
VALUE obj;
+ obj = NewX509Attr(klass);
if (!(attr = X509_ATTRIBUTE_new()))
ossl_raise(eX509AttrError, NULL);
- WrapX509Attr(klass, obj, attr);
+ SetX509Attr(obj, attr);
return obj;
}
@@ -124,12 +138,15 @@ ossl_x509attr_set_oid(VALUE self, VALUE oid)
ASN1_OBJECT *obj;
char *s;
- s = StringValuePtr(oid);
+ GetX509Attr(self, attr);
+ s = StringValueCStr(oid);
obj = OBJ_txt2obj(s, 0);
- if(!obj) obj = OBJ_txt2obj(s, 1);
if(!obj) ossl_raise(eX509AttrError, NULL);
- GetX509Attr(self, attr);
- X509_ATTRIBUTE_set1_object(attr, obj);
+ if (!X509_ATTRIBUTE_set1_object(attr, obj)) {
+ ASN1_OBJECT_free(obj);
+ ossl_raise(eX509AttrError, "X509_ATTRIBUTE_set1_object");
+ }
+ ASN1_OBJECT_free(obj);
return oid;
}
@@ -260,7 +277,7 @@ ossl_x509attr_to_der(VALUE self)
* X509_ATTRIBUTE init
*/
void
-Init_ossl_x509attr()
+Init_ossl_x509attr(void)
{
eX509AttrError = rb_define_class_under(mX509, "AttributeError", eOSSLError);
diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c
index 84cedc763a..4dafae17b9 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509(klass, obj, x509) do { \
+#define NewX509(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509_type, 0)
+#define SetX509(obj, x509) do { \
if (!(x509)) { \
ossl_raise(rb_eRuntimeError, "CERT wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_free, (x509)); \
+ RTYPEDDATA_DATA(obj) = (x509); \
} while (0)
#define GetX509(obj, x509) do { \
- Data_Get_Struct((obj), X509, (x509)); \
+ TypedData_Get_Struct((obj), X509, &ossl_x509_type, (x509)); \
if (!(x509)) { \
ossl_raise(rb_eRuntimeError, "CERT wasn't initialized!"); \
} \
@@ -33,6 +34,20 @@
VALUE cX509Cert;
VALUE eX509CertError;
+static void
+ossl_x509_free(void *ptr)
+{
+ X509_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509_type = {
+ "OpenSSL/X509",
+ {
+ 0, ossl_x509_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public
*/
@@ -42,6 +57,7 @@ ossl_x509_new(X509 *x509)
X509 *new;
VALUE obj;
+ obj = NewX509(cX509Cert);
if (!x509) {
new = X509_new();
} else {
@@ -50,7 +66,7 @@ ossl_x509_new(X509 *x509)
if (!new) {
ossl_raise(eX509CertError, NULL);
}
- WrapX509(cX509Cert, obj, new);
+ SetX509(obj, new);
return obj;
}
@@ -63,6 +79,7 @@ ossl_x509_new_from_file(VALUE filename)
VALUE obj;
SafeStringValue(filename);
+ obj = NewX509(cX509Cert);
if (!(fp = fopen(RSTRING_PTR(filename), "r"))) {
ossl_raise(eX509CertError, "%s", strerror(errno));
}
@@ -83,7 +100,7 @@ ossl_x509_new_from_file(VALUE filename)
if (!x509) {
ossl_raise(eX509CertError, NULL);
}
- WrapX509(cX509Cert, obj, x509);
+ SetX509(obj, x509);
return obj;
}
@@ -119,10 +136,10 @@ ossl_x509_alloc(VALUE klass)
X509 *x509;
VALUE obj;
+ obj = NewX509(klass);
x509 = X509_new();
if (!x509) ossl_raise(eX509CertError, NULL);
-
- WrapX509(klass, obj, x509);
+ SetX509(obj, x509);
return obj;
}
@@ -646,18 +663,18 @@ ossl_x509_set_extensions(VALUE self, VALUE ary)
{
X509 *x509;
X509_EXTENSION *ext;
- int i;
+ long i;
Check_Type(ary, T_ARRAY);
/* All ary's members should be X509Extension */
for (i=0; i<RARRAY_LEN(ary); i++) {
- OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Ext);
+ OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext);
}
GetX509(self, x509);
sk_X509_EXTENSION_pop_free(x509->cert_info->extensions, X509_EXTENSION_free);
x509->cert_info->extensions = NULL;
for (i=0; i<RARRAY_LEN(ary); i++) {
- ext = DupX509ExtPtr(RARRAY_PTR(ary)[i]);
+ ext = DupX509ExtPtr(RARRAY_AREF(ary, i));
if (!X509_add_ext(x509, ext, -1)) { /* DUPs ext - FREE it */
X509_EXTENSION_free(ext);
@@ -693,42 +710,22 @@ ossl_x509_add_extension(VALUE self, VALUE extension)
static VALUE
ossl_x509_inspect(VALUE self)
{
- VALUE str;
- const char *cname = rb_class2name(rb_obj_class(self));
-
- str = rb_str_new2("#<");
- rb_str_cat2(str, cname);
- rb_str_cat2(str, " ");
-
- rb_str_cat2(str, "subject=");
- rb_str_append(str, rb_inspect(ossl_x509_get_subject(self)));
- rb_str_cat2(str, ", ");
-
- rb_str_cat2(str, "issuer=");
- rb_str_append(str, rb_inspect(ossl_x509_get_issuer(self)));
- rb_str_cat2(str, ", ");
-
- rb_str_cat2(str, "serial=");
- rb_str_append(str, rb_inspect(ossl_x509_get_serial(self)));
- rb_str_cat2(str, ", ");
-
- rb_str_cat2(str, "not_before=");
- rb_str_append(str, rb_inspect(ossl_x509_get_not_before(self)));
- rb_str_cat2(str, ", ");
-
- rb_str_cat2(str, "not_after=");
- rb_str_append(str, rb_inspect(ossl_x509_get_not_after(self)));
-
- str = rb_str_cat2(str, ">");
-
- return str;
+ return rb_sprintf("#<%"PRIsVALUE": subject=%+"PRIsVALUE", "
+ "issuer=%+"PRIsVALUE", serial=%+"PRIsVALUE", "
+ "not_before=%+"PRIsVALUE", not_after=%+"PRIsVALUE">",
+ rb_obj_class(self),
+ ossl_x509_get_subject(self),
+ ossl_x509_get_issuer(self),
+ ossl_x509_get_serial(self),
+ ossl_x509_get_not_before(self),
+ ossl_x509_get_not_after(self));
}
/*
* INIT
*/
void
-Init_ossl_x509cert()
+Init_ossl_x509cert(void)
{
#if 0
@@ -863,4 +860,3 @@ Init_ossl_x509cert()
rb_define_method(cX509Cert, "add_extension", ossl_x509_add_extension, 1);
rb_define_method(cX509Cert, "inspect", ossl_x509_inspect, 0);
}
-
diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c
index dec13c8cae..3905762d3c 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509CRL(klass, obj, crl) do { \
+#define NewX509CRL(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509crl_type, 0)
+#define SetX509CRL(obj, crl) do { \
if (!(crl)) { \
ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_CRL_free, (crl)); \
+ RTYPEDDATA_DATA(obj) = (crl); \
} while (0)
#define GetX509CRL(obj, crl) do { \
- Data_Get_Struct((obj), X509_CRL, (crl)); \
+ TypedData_Get_Struct((obj), X509_CRL, &ossl_x509crl_type, (crl)); \
if (!(crl)) { \
ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
} \
@@ -33,6 +34,20 @@
VALUE cX509CRL;
VALUE eX509CRLError;
+static void
+ossl_x509crl_free(void *ptr)
+{
+ X509_CRL_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509crl_type = {
+ "OpenSSL/X509/CRL",
+ {
+ 0, ossl_x509crl_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* PUBLIC
*/
@@ -63,9 +78,10 @@ ossl_x509crl_new(X509_CRL *crl)
X509_CRL *tmp;
VALUE obj;
+ obj = NewX509CRL(cX509CRL);
tmp = crl ? X509_CRL_dup(crl) : X509_CRL_new();
if(!tmp) ossl_raise(eX509CRLError, NULL);
- WrapX509CRL(cX509CRL, obj, tmp);
+ SetX509CRL(obj, tmp);
return obj;
}
@@ -79,10 +95,11 @@ ossl_x509crl_alloc(VALUE klass)
X509_CRL *crl;
VALUE obj;
+ obj = NewX509CRL(klass);
if (!(crl = X509_CRL_new())) {
ossl_raise(eX509CRLError, NULL);
}
- WrapX509CRL(klass, obj, crl);
+ SetX509CRL(obj, crl);
return obj;
}
@@ -285,20 +302,21 @@ ossl_x509crl_set_revoked(VALUE self, VALUE ary)
{
X509_CRL *crl;
X509_REVOKED *rev;
- int i;
+ long i;
Check_Type(ary, T_ARRAY);
/* All ary members should be X509 Revoked */
for (i=0; i<RARRAY_LEN(ary); i++) {
- OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Rev);
+ OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Rev);
}
GetX509CRL(self, crl);
sk_X509_REVOKED_pop_free(crl->crl->revoked, X509_REVOKED_free);
crl->crl->revoked = NULL;
for (i=0; i<RARRAY_LEN(ary); i++) {
- rev = DupX509RevokedPtr(RARRAY_PTR(ary)[i]);
+ rev = DupX509RevokedPtr(RARRAY_AREF(ary, i));
if (!X509_CRL_add0_revoked(crl, rev)) { /* NO DUP - don't free! */
- ossl_raise(eX509CRLError, NULL);
+ X509_REVOKED_free(rev);
+ ossl_raise(eX509CRLError, "X509_CRL_add0_revoked");
}
}
X509_CRL_sort(crl);
@@ -315,7 +333,8 @@ ossl_x509crl_add_revoked(VALUE self, VALUE revoked)
GetX509CRL(self, crl);
rev = DupX509RevokedPtr(revoked);
if (!X509_CRL_add0_revoked(crl, rev)) { /* NO DUP - don't free! */
- ossl_raise(eX509CRLError, NULL);
+ X509_REVOKED_free(rev);
+ ossl_raise(eX509CRLError, "X509_CRL_add0_revoked");
}
X509_CRL_sort(crl);
@@ -459,18 +478,18 @@ ossl_x509crl_set_extensions(VALUE self, VALUE ary)
{
X509_CRL *crl;
X509_EXTENSION *ext;
- int i;
+ long i;
Check_Type(ary, T_ARRAY);
/* All ary members should be X509 Extensions */
for (i=0; i<RARRAY_LEN(ary); i++) {
- OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Ext);
+ OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext);
}
GetX509CRL(self, crl);
sk_X509_EXTENSION_pop_free(crl->crl->extensions, X509_EXTENSION_free);
crl->crl->extensions = NULL;
for (i=0; i<RARRAY_LEN(ary); i++) {
- ext = DupX509ExtPtr(RARRAY_PTR(ary)[i]);
+ ext = DupX509ExtPtr(RARRAY_AREF(ary, i));
if(!X509_CRL_add_ext(crl, ext, -1)) { /* DUPs ext - FREE it */
X509_EXTENSION_free(ext);
ossl_raise(eX509CRLError, NULL);
@@ -502,7 +521,7 @@ ossl_x509crl_add_extension(VALUE self, VALUE extension)
* INIT
*/
void
-Init_ossl_x509crl()
+Init_ossl_x509crl(void)
{
eX509CRLError = rb_define_class_under(mX509, "CRLError", eOSSLError);
@@ -534,4 +553,3 @@ Init_ossl_x509crl()
rb_define_method(cX509CRL, "extensions=", ossl_x509crl_set_extensions, 1);
rb_define_method(cX509CRL, "add_extension", ossl_x509crl_add_extension, 1);
}
-
diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c
index bd2e1dd2fa..f1058a0c1f 100644
--- a/ext/openssl/ossl_x509ext.c
+++ b/ext/openssl/ossl_x509ext.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509Ext(klass, obj, ext) do { \
+#define NewX509Ext(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509ext_type, 0)
+#define SetX509Ext(obj, ext) do { \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_EXTENSION_free, (ext)); \
+ RTYPEDDATA_DATA(obj) = (ext); \
} while (0)
#define GetX509Ext(obj, ext) do { \
- Data_Get_Struct((obj), X509_EXTENSION, (ext)); \
+ TypedData_Get_Struct((obj), X509_EXTENSION, &ossl_x509ext_type, (ext)); \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
@@ -27,13 +28,14 @@
GetX509Ext((obj), (ext)); \
} while (0)
#define MakeX509ExtFactory(klass, obj, ctx) do { \
+ (obj) = TypedData_Wrap_Struct((klass), &ossl_x509extfactory_type, 0); \
if (!((ctx) = OPENSSL_malloc(sizeof(X509V3_CTX)))) \
ossl_raise(rb_eRuntimeError, "CTX wasn't allocated!"); \
X509V3_set_ctx((ctx), NULL, NULL, NULL, NULL, 0); \
- (obj) = Data_Wrap_Struct((klass), 0, ossl_x509extfactory_free, (ctx)); \
+ RTYPEDDATA_DATA(obj) = (ctx); \
} while (0)
#define GetX509ExtFactory(obj, ctx) do { \
- Data_Get_Struct((obj), X509V3_CTX, (ctx)); \
+ TypedData_Get_Struct((obj), X509V3_CTX, &ossl_x509extfactory_type, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "CTX wasn't initialized!"); \
} \
@@ -46,6 +48,20 @@ VALUE cX509Ext;
VALUE cX509ExtFactory;
VALUE eX509ExtError;
+static void
+ossl_x509ext_free(void *ptr)
+{
+ X509_EXTENSION_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509ext_type = {
+ "OpenSSL/X509/EXTENSION",
+ {
+ 0, ossl_x509ext_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public
*/
@@ -55,6 +71,7 @@ ossl_x509ext_new(X509_EXTENSION *ext)
X509_EXTENSION *new;
VALUE obj;
+ obj = NewX509Ext(cX509Ext);
if (!ext) {
new = X509_EXTENSION_new();
} else {
@@ -63,7 +80,7 @@ ossl_x509ext_new(X509_EXTENSION *ext)
if (!new) {
ossl_raise(eX509ExtError, NULL);
}
- WrapX509Ext(cX509Ext, obj, new);
+ SetX509Ext(obj, new);
return obj;
}
@@ -98,11 +115,19 @@ DupX509ExtPtr(VALUE obj)
* Ext factory
*/
static void
-ossl_x509extfactory_free(X509V3_CTX *ctx)
+ossl_x509extfactory_free(void *ctx)
{
OPENSSL_free(ctx);
}
+static const rb_data_type_t ossl_x509extfactory_type = {
+ "OpenSSL/X509/EXTENSION/Factory",
+ {
+ 0, ossl_x509extfactory_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE
ossl_x509extfactory_alloc(VALUE klass)
{
@@ -163,24 +188,6 @@ ossl_x509extfactory_set_crl(VALUE self, VALUE crl)
return crl;
}
-#ifdef HAVE_X509V3_SET_NCONF
-static VALUE
-ossl_x509extfactory_set_config(VALUE self, VALUE config)
-{
- X509V3_CTX *ctx;
- CONF *conf;
-
- GetX509ExtFactory(self, ctx);
- rb_iv_set(self, "@config", config);
- conf = GetConfigPtr(config); /* NO DUP NEEDED */
- X509V3_set_nconf(ctx, conf);
-
- return config;
-}
-#else
-#define ossl_x509extfactory_set_config rb_f_notimplement
-#endif
-
static VALUE
ossl_x509extfactory_initialize(int argc, VALUE *argv, VALUE self)
{
@@ -236,10 +243,14 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self)
valstr = rb_str_new2(RTEST(critical) ? "critical," : "");
rb_str_append(valstr, value);
GetX509ExtFactory(self, ctx);
+ obj = NewX509Ext(cX509Ext);
#ifdef HAVE_X509V3_EXT_NCONF_NID
rconf = rb_iv_get(self, "@config");
- conf = NIL_P(rconf) ? NULL : GetConfigPtr(rconf);
+ conf = NIL_P(rconf) ? NULL : DupConfigPtr(rconf);
+ X509V3_set_nconf(ctx, conf);
ext = X509V3_EXT_nconf_nid(conf, ctx, nid, RSTRING_PTR(valstr));
+ X509V3_set_ctx_nodb(ctx);
+ NCONF_free(conf);
#else
if (!empty_lhash) empty_lhash = lh_new(NULL, NULL);
ext = X509V3_EXT_conf_nid(empty_lhash, ctx, nid, RSTRING_PTR(valstr));
@@ -248,7 +259,7 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self)
ossl_raise(eX509ExtError, "%s = %s",
RSTRING_PTR(oid), RSTRING_PTR(value));
}
- WrapX509Ext(cX509Ext, obj, ext);
+ SetX509Ext(obj, ext);
return obj;
}
@@ -262,10 +273,11 @@ ossl_x509ext_alloc(VALUE klass)
X509_EXTENSION *ext;
VALUE obj;
+ obj = NewX509Ext(klass);
if(!(ext = X509_EXTENSION_new())){
ossl_raise(eX509ExtError, NULL);
}
- WrapX509Ext(klass, obj, ext);
+ SetX509Ext(obj, ext);
return obj;
}
@@ -312,14 +324,16 @@ ossl_x509ext_set_oid(VALUE self, VALUE oid)
{
X509_EXTENSION *ext;
ASN1_OBJECT *obj;
- char *s;
- s = StringValuePtr(oid);
- obj = OBJ_txt2obj(s, 0);
- if(!obj) obj = OBJ_txt2obj(s, 1);
- if(!obj) ossl_raise(eX509ExtError, NULL);
GetX509Ext(self, ext);
- X509_EXTENSION_set_object(ext, obj);
+ obj = OBJ_txt2obj(StringValueCStr(oid), 0);
+ if (!obj)
+ ossl_raise(eX509ExtError, "OBJ_txt2obj");
+ if (!X509_EXTENSION_set_object(ext, obj)) {
+ ASN1_OBJECT_free(obj);
+ ossl_raise(eX509ExtError, "X509_EXTENSION_set_object");
+ }
+ ASN1_OBJECT_free(obj);
return oid;
}
@@ -329,25 +343,16 @@ ossl_x509ext_set_value(VALUE self, VALUE data)
{
X509_EXTENSION *ext;
ASN1_OCTET_STRING *asn1s;
- char *s;
+ GetX509Ext(self, ext);
data = ossl_to_der_if_possible(data);
StringValue(data);
- if(!(s = OPENSSL_malloc(RSTRING_LEN(data))))
- ossl_raise(eX509ExtError, "malloc error");
- memcpy(s, RSTRING_PTR(data), RSTRING_LEN(data));
- if(!(asn1s = ASN1_OCTET_STRING_new())){
- OPENSSL_free(s);
- ossl_raise(eX509ExtError, NULL);
- }
- if(!M_ASN1_OCTET_STRING_set(asn1s, s, RSTRING_LENINT(data))){
- OPENSSL_free(s);
- ASN1_OCTET_STRING_free(asn1s);
- ossl_raise(eX509ExtError, NULL);
+ asn1s = X509_EXTENSION_get_data(ext);
+
+ if (!ASN1_OCTET_STRING_set(asn1s, (unsigned char *)RSTRING_PTR(data),
+ RSTRING_LENINT(data))) {
+ ossl_raise(eX509ExtError, "ASN1_OCTET_STRING_set");
}
- OPENSSL_free(s);
- GetX509Ext(self, ext);
- X509_EXTENSION_set_data(ext, asn1s);
return data;
}
@@ -436,7 +441,7 @@ ossl_x509ext_to_der(VALUE obj)
* INIT
*/
void
-Init_ossl_x509ext()
+Init_ossl_x509ext(void)
{
eX509ExtError = rb_define_class_under(mX509, "ExtensionError", eOSSLError);
@@ -449,13 +454,12 @@ Init_ossl_x509ext()
rb_attr(cX509ExtFactory, rb_intern("subject_certificate"), 1, 0, Qfalse);
rb_attr(cX509ExtFactory, rb_intern("subject_request"), 1, 0, Qfalse);
rb_attr(cX509ExtFactory, rb_intern("crl"), 1, 0, Qfalse);
- rb_attr(cX509ExtFactory, rb_intern("config"), 1, 0, Qfalse);
+ rb_attr(cX509ExtFactory, rb_intern("config"), 1, 1, Qfalse);
rb_define_method(cX509ExtFactory, "issuer_certificate=", ossl_x509extfactory_set_issuer_cert, 1);
rb_define_method(cX509ExtFactory, "subject_certificate=", ossl_x509extfactory_set_subject_cert, 1);
rb_define_method(cX509ExtFactory, "subject_request=", ossl_x509extfactory_set_subject_req, 1);
rb_define_method(cX509ExtFactory, "crl=", ossl_x509extfactory_set_crl, 1);
- rb_define_method(cX509ExtFactory, "config=", ossl_x509extfactory_set_config, 1);
rb_define_method(cX509ExtFactory, "create_ext", ossl_x509extfactory_create_ext, -1);
cX509Ext = rb_define_class_under(mX509, "Extension", rb_cObject);
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c
index 6de79d45e9..a0e28e29ec 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509Name(klass, obj, name) do { \
+#define NewX509Name(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509name_type, 0)
+#define SetX509Name(obj, name) do { \
if (!(name)) { \
ossl_raise(rb_eRuntimeError, "Name wasn't initialized."); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_NAME_free, (name)); \
+ RTYPEDDATA_DATA(obj) = (name); \
} while (0)
#define GetX509Name(obj, name) do { \
- Data_Get_Struct((obj), X509_NAME, (name)); \
+ TypedData_Get_Struct((obj), X509_NAME, &ossl_x509name_type, (name)); \
if (!(name)) { \
ossl_raise(rb_eRuntimeError, "Name wasn't initialized."); \
} \
@@ -38,6 +39,20 @@
VALUE cX509Name;
VALUE eX509NameError;
+static void
+ossl_x509name_free(void *ptr)
+{
+ X509_NAME_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509name_type = {
+ "OpenSSL/X509/NAME",
+ {
+ 0, ossl_x509name_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public
*/
@@ -47,6 +62,7 @@ ossl_x509name_new(X509_NAME *name)
X509_NAME *new;
VALUE obj;
+ obj = NewX509Name(cX509Name);
if (!name) {
new = X509_NAME_new();
} else {
@@ -55,7 +71,7 @@ ossl_x509name_new(X509_NAME *name)
if (!new) {
ossl_raise(eX509NameError, NULL);
}
- WrapX509Name(cX509Name, obj, new);
+ SetX509Name(obj, new);
return obj;
}
@@ -79,10 +95,11 @@ ossl_x509name_alloc(VALUE klass)
X509_NAME *name;
VALUE obj;
+ obj = NewX509Name(klass);
if (!(name = X509_NAME_new())) {
ossl_raise(eX509NameError, NULL);
}
- WrapX509Name(klass, obj, name);
+ SetX509Name(obj, name);
return obj;
}
@@ -183,13 +200,14 @@ VALUE ossl_x509name_add_entry(int argc, VALUE *argv, VALUE self)
{
X509_NAME *name;
VALUE oid, value, type;
+ const char *oid_name;
rb_scan_args(argc, argv, "21", &oid, &value, &type);
- StringValue(oid);
+ oid_name = StringValueCStr(oid);
StringValue(value);
if(NIL_P(type)) type = rb_aref(OBJECT_TYPE_TEMPLATE, oid);
GetX509Name(self, name);
- if (!X509_NAME_add_entry_by_txt(name, RSTRING_PTR(oid), NUM2INT(type),
+ if (!X509_NAME_add_entry_by_txt(name, oid_name, NUM2INT(type),
(const unsigned char *)RSTRING_PTR(value), RSTRING_LENINT(value), -1, 0)) {
ossl_raise(eX509NameError, NULL);
}
@@ -425,7 +443,7 @@ ossl_x509name_to_der(VALUE self)
*/
void
-Init_ossl_x509name()
+Init_ossl_x509name(void)
{
VALUE utf8str, ptrstr, ia5str, hash;
diff --git a/ext/openssl/ossl_x509req.c b/ext/openssl/ossl_x509req.c
index 5927f76d44..0c13c8ca3e 100644
--- a/ext/openssl/ossl_x509req.c
+++ b/ext/openssl/ossl_x509req.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509Req(klass, obj, req) do { \
+#define NewX509Req(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509req_type, 0)
+#define SetX509Req(obj, req) do { \
if (!(req)) { \
ossl_raise(rb_eRuntimeError, "Req wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_REQ_free, (req)); \
+ RTYPEDDATA_DATA(obj) = (req); \
} while (0)
#define GetX509Req(obj, req) do { \
- Data_Get_Struct((obj), X509_REQ, (req)); \
+ TypedData_Get_Struct((obj), X509_REQ, &ossl_x509req_type, (req)); \
if (!(req)) { \
ossl_raise(rb_eRuntimeError, "Req wasn't initialized!"); \
} \
@@ -33,6 +34,20 @@
VALUE cX509Req;
VALUE eX509ReqError;
+static void
+ossl_x509req_free(void *ptr)
+{
+ X509_REQ_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509req_type = {
+ "OpenSSL/X509/REQ",
+ {
+ 0, ossl_x509req_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public functions
*/
@@ -42,6 +57,7 @@ ossl_x509req_new(X509_REQ *req)
X509_REQ *new;
VALUE obj;
+ obj = NewX509Req(cX509Req);
if (!req) {
new = X509_REQ_new();
} else {
@@ -50,7 +66,7 @@ ossl_x509req_new(X509_REQ *req)
if (!new) {
ossl_raise(eX509ReqError, NULL);
}
- WrapX509Req(cX509Req, obj, new);
+ SetX509Req(obj, new);
return obj;
}
@@ -87,10 +103,11 @@ ossl_x509req_alloc(VALUE klass)
X509_REQ *req;
VALUE obj;
+ obj = NewX509Req(klass);
if (!(req = X509_REQ_new())) {
ossl_raise(eX509ReqError, NULL);
}
- WrapX509Req(klass, obj, req);
+ SetX509Req(obj, req);
return obj;
}
@@ -401,19 +418,19 @@ ossl_x509req_set_attributes(VALUE self, VALUE ary)
{
X509_REQ *req;
X509_ATTRIBUTE *attr;
- int i;
+ long i;
VALUE item;
Check_Type(ary, T_ARRAY);
for (i=0;i<RARRAY_LEN(ary); i++) {
- OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Attr);
+ OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Attr);
}
GetX509Req(self, req);
sk_X509_ATTRIBUTE_pop_free(req->req_info->attributes, X509_ATTRIBUTE_free);
req->req_info->attributes = NULL;
for (i=0;i<RARRAY_LEN(ary); i++) {
- item = RARRAY_PTR(ary)[i];
- attr = DupX509AttrPtr(item);
+ item = RARRAY_AREF(ary, i);
+ attr = GetX509AttrPtr(item);
if (!X509_REQ_add1_attr(req, attr)) {
ossl_raise(eX509ReqError, NULL);
}
@@ -427,7 +444,7 @@ ossl_x509req_add_attribute(VALUE self, VALUE attr)
X509_REQ *req;
GetX509Req(self, req);
- if (!X509_REQ_add1_attr(req, DupX509AttrPtr(attr))) {
+ if (!X509_REQ_add1_attr(req, GetX509AttrPtr(attr))) {
ossl_raise(eX509ReqError, NULL);
}
@@ -438,7 +455,7 @@ ossl_x509req_add_attribute(VALUE self, VALUE attr)
* X509_REQUEST init
*/
void
-Init_ossl_x509req()
+Init_ossl_x509req(void)
{
eX509ReqError = rb_define_class_under(mX509, "RequestError", eOSSLError);
@@ -465,4 +482,3 @@ Init_ossl_x509req()
rb_define_method(cX509Req, "attributes=", ossl_x509req_set_attributes, 1);
rb_define_method(cX509Req, "add_attribute", ossl_x509req_add_attribute, 1);
}
-
diff --git a/ext/openssl/ossl_x509revoked.c b/ext/openssl/ossl_x509revoked.c
index 320abaa7ae..4691d507d3 100644
--- a/ext/openssl/ossl_x509revoked.c
+++ b/ext/openssl/ossl_x509revoked.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509Rev(klass, obj, rev) do { \
+#define NewX509Rev(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509rev_type, 0)
+#define SetX509Rev(obj, rev) do { \
if (!(rev)) { \
ossl_raise(rb_eRuntimeError, "REV wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_REVOKED_free, (rev)); \
+ RTYPEDDATA_DATA(obj) = (rev); \
} while (0)
#define GetX509Rev(obj, rev) do { \
- Data_Get_Struct((obj), X509_REVOKED, (rev)); \
+ TypedData_Get_Struct((obj), X509_REVOKED, &ossl_x509rev_type, (rev)); \
if (!(rev)) { \
ossl_raise(rb_eRuntimeError, "REV wasn't initialized!"); \
} \
@@ -33,6 +34,20 @@
VALUE cX509Rev;
VALUE eX509RevError;
+static void
+ossl_x509rev_free(void *ptr)
+{
+ X509_REVOKED_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509rev_type = {
+ "OpenSSL/X509/REV",
+ {
+ 0, ossl_x509rev_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* PUBLIC
*/
@@ -42,6 +57,7 @@ ossl_x509revoked_new(X509_REVOKED *rev)
X509_REVOKED *new;
VALUE obj;
+ obj = NewX509Rev(cX509Rev);
if (!rev) {
new = X509_REVOKED_new();
} else {
@@ -50,7 +66,7 @@ ossl_x509revoked_new(X509_REVOKED *rev)
if (!new) {
ossl_raise(eX509RevError, NULL);
}
- WrapX509Rev(cX509Rev, obj, new);
+ SetX509Rev(obj, new);
return obj;
}
@@ -77,10 +93,11 @@ ossl_x509revoked_alloc(VALUE klass)
X509_REVOKED *rev;
VALUE obj;
+ obj = NewX509Rev(klass);
if (!(rev = X509_REVOKED_new())) {
ossl_raise(eX509RevError, NULL);
}
- WrapX509Rev(klass, obj, rev);
+ SetX509Rev(obj, rev);
return obj;
}
@@ -171,19 +188,19 @@ ossl_x509revoked_set_extensions(VALUE self, VALUE ary)
{
X509_REVOKED *rev;
X509_EXTENSION *ext;
- int i;
+ long i;
VALUE item;
Check_Type(ary, T_ARRAY);
for (i=0; i<RARRAY_LEN(ary); i++) {
- OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Ext);
+ OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext);
}
GetX509Rev(self, rev);
sk_X509_EXTENSION_pop_free(rev->extensions, X509_EXTENSION_free);
rev->extensions = NULL;
for (i=0; i<RARRAY_LEN(ary); i++) {
- item = RARRAY_PTR(ary)[i];
- ext = DupX509ExtPtr(item);
+ item = RARRAY_AREF(ary, i);
+ ext = GetX509ExtPtr(item);
if(!X509_REVOKED_add_ext(rev, ext, -1)) {
ossl_raise(eX509RevError, NULL);
}
@@ -198,7 +215,7 @@ ossl_x509revoked_add_extension(VALUE self, VALUE ext)
X509_REVOKED *rev;
GetX509Rev(self, rev);
- if(!X509_REVOKED_add_ext(rev, DupX509ExtPtr(ext), -1)) {
+ if (!X509_REVOKED_add_ext(rev, GetX509ExtPtr(ext), -1)) {
ossl_raise(eX509RevError, NULL);
}
@@ -209,7 +226,7 @@ ossl_x509revoked_add_extension(VALUE self, VALUE ext)
* INIT
*/
void
-Init_ossl_x509revoked()
+Init_ossl_x509revoked(void)
{
eX509RevError = rb_define_class_under(mX509, "RevokedError", eOSSLError);
@@ -226,4 +243,3 @@ Init_ossl_x509revoked()
rb_define_method(cX509Rev, "extensions=", ossl_x509revoked_set_extensions, 1);
rb_define_method(cX509Rev, "add_extension", ossl_x509revoked_add_extension, 1);
}
-
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index f59c376574..cec9dbbb44 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -1,23 +1,24 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define WrapX509Store(klass, obj, st) do { \
+#define NewX509Store(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509store_type, 0)
+#define SetX509Store(obj, st) do { \
if (!(st)) { \
ossl_raise(rb_eRuntimeError, "STORE wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_STORE_free, (st)); \
+ RTYPEDDATA_DATA(obj) = (st); \
} while (0)
#define GetX509Store(obj, st) do { \
- Data_Get_Struct((obj), X509_STORE, (st)); \
+ TypedData_Get_Struct((obj), X509_STORE, &ossl_x509store_type, (st)); \
if (!(st)) { \
ossl_raise(rb_eRuntimeError, "STORE wasn't initialized!"); \
} \
@@ -27,14 +28,16 @@
GetX509Store((obj), (st)); \
} while (0)
-#define WrapX509StCtx(klass, obj, ctx) do { \
+#define NewX509StCtx(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_x509stctx_type, 0)
+#define SetX509StCtx(obj, ctx) do { \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "STORE_CTX wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, ossl_x509stctx_free, (ctx)); \
+ RTYPEDDATA_DATA(obj) = (ctx); \
} while (0)
#define GetX509StCtx(obj, ctx) do { \
- Data_Get_Struct((obj), X509_STORE_CTX, (ctx)); \
+ TypedData_Get_Struct((obj), X509_STORE_CTX, &ossl_x509stctx_type, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "STORE_CTX is out of scope!"); \
} \
@@ -51,6 +54,20 @@ VALUE cX509Store;
VALUE cX509StoreContext;
VALUE eX509StoreError;
+static void
+ossl_x509store_free(void *ptr)
+{
+ X509_STORE_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509store_type = {
+ "OpenSSL/X509/STORE",
+ {
+ 0, ossl_x509store_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* Public functions
*/
@@ -59,7 +76,8 @@ ossl_x509store_new(X509_STORE *store)
{
VALUE obj;
- WrapX509Store(cX509Store, obj, store);
+ obj = NewX509Store(cX509Store);
+ SetX509Store(obj, store);
return obj;
}
@@ -94,10 +112,11 @@ ossl_x509store_alloc(VALUE klass)
X509_STORE *store;
VALUE obj;
+ obj = NewX509Store(klass);
if((store = X509_STORE_new()) == NULL){
ossl_raise(eX509StoreError, NULL);
}
- WrapX509Store(klass, obj, store);
+ SetX509Store(obj, store);
return obj;
}
@@ -111,7 +130,7 @@ ossl_x509store_set_vfy_cb(VALUE self, VALUE cb)
X509_STORE *store;
GetX509Store(self, store);
- X509_STORE_set_ex_data(store, ossl_verify_cb_idx, (void*)cb);
+ X509_STORE_set_ex_data(store, ossl_store_ex_verify_cb_idx, (void *)cb);
rb_iv_set(self, "@verify_callback", cb);
return cb;
@@ -230,6 +249,13 @@ ossl_x509store_add_file(VALUE self, VALUE file)
if(X509_LOOKUP_load_file(lookup, path, X509_FILETYPE_PEM) != 1){
ossl_raise(eX509StoreError, NULL);
}
+ /*
+ * X509_load_cert_crl_file() which is called from X509_LOOKUP_load_file()
+ * did not check the return value of X509_STORE_add_{cert,crl}(), leaking
+ * "cert already in hash table" errors on the error queue, if duplicate
+ * certificates are found. This will be fixed by OpenSSL 1.1.1.
+ */
+ ERR_clear_error();
return self;
}
@@ -342,14 +368,25 @@ ossl_x509store_verify(int argc, VALUE *argv, VALUE self)
/*
* Public Functions
*/
-static void ossl_x509stctx_free(X509_STORE_CTX*);
+static void ossl_x509stctx_free(void*);
+
+
+static const rb_data_type_t ossl_x509stctx_type = {
+ "OpenSSL/X509/STORE_CTX",
+ {
+ 0, ossl_x509stctx_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
VALUE
ossl_x509stctx_new(X509_STORE_CTX *ctx)
{
VALUE obj;
- WrapX509StCtx(cX509StoreContext, obj, ctx);
+ obj = NewX509StCtx(cX509StoreContext);
+ SetX509StCtx(obj, ctx);
return obj;
}
@@ -367,8 +404,9 @@ ossl_x509stctx_clear_ptr(VALUE obj)
* Private functions
*/
static void
-ossl_x509stctx_free(X509_STORE_CTX *ctx)
+ossl_x509stctx_free(void *ptr)
{
+ X509_STORE_CTX *ctx = ptr;
if(ctx->untrusted)
sk_X509_pop_free(ctx->untrusted, X509_free);
if(ctx->cert)
@@ -382,10 +420,11 @@ ossl_x509stctx_alloc(VALUE klass)
X509_STORE_CTX *ctx;
VALUE obj;
+ obj = NewX509StCtx(klass);
if((ctx = X509_STORE_CTX_new()) == NULL){
ossl_raise(eX509StoreError, NULL);
}
- WrapX509StCtx(klass, obj, ctx);
+ SetX509StCtx(obj, ctx);
return obj;
}
@@ -435,7 +474,7 @@ ossl_x509stctx_verify(VALUE self)
int result;
GetX509StCtx(self, ctx);
- X509_STORE_CTX_set_ex_data(ctx, ossl_verify_cb_idx,
+ X509_STORE_CTX_set_ex_data(ctx, ossl_store_ctx_ex_verify_cb_idx,
(void*)rb_iv_get(self, "@verify_callback"));
result = X509_verify_cert(ctx);
@@ -593,7 +632,7 @@ ossl_x509stctx_set_time(VALUE self, VALUE time)
* INIT
*/
void
-Init_ossl_x509store()
+Init_ossl_x509store(void)
{
VALUE x509stctx;
diff --git a/ext/openssl/ruby_missing.h b/ext/openssl/ruby_missing.h
index 0f9de1c842..d7384ec32c 100644
--- a/ext/openssl/ruby_missing.h
+++ b/ext/openssl/ruby_missing.h
@@ -1,11 +1,10 @@
/*
- * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2003 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licenced under the same licence as Ruby.
+ * This program is licensed under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_RUBY_MISSING_H_)
diff --git a/ext/pathname/extconf.rb b/ext/pathname/extconf.rb
index 6720903e88..c9133bc153 100644
--- a/ext/pathname/extconf.rb
+++ b/ext/pathname/extconf.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
+have_struct_member("struct stat", "st_birthtimespec", "sys/stat.h")
create_makefile('pathname')
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 46fa72b784..8bdb73f439 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# = pathname.rb
#
@@ -13,16 +14,12 @@ require 'pathname.so'
class Pathname
- # :stopdoc:
- if RUBY_VERSION < "1.9"
- TO_PATH = :to_str
- else
- # to_path is implemented so Pathname objects are usable with File.open, etc.
- TO_PATH = :to_path
- end
+ # to_path is implemented so Pathname objects are usable with File.open, etc.
+ TO_PATH = :to_path
SAME_PATHS = if File::FNM_SYSCASE.nonzero?
- proc {|a, b| a.casecmp(b).zero?}
+ # Avoid #zero? here because #casecmp can return nil.
+ proc {|a, b| a.casecmp(b) == 0}
else
proc {|a, b| a == b}
end
@@ -113,6 +110,7 @@ class Pathname
end
end
end
+ pre.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
if /#{SEPARATOR_PAT}/o =~ File.basename(pre)
names.shift while names[0] == '..'
end
@@ -161,6 +159,7 @@ class Pathname
pre, base = r
names.unshift base if base != '.'
end
+ pre.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
if /#{SEPARATOR_PAT}/o =~ File.basename(pre)
names.shift while names[0] == '..'
end
@@ -280,9 +279,17 @@ class Pathname
# #<Pathname:path/to/some>
# #<Pathname:path/to/some/file.rb>
#
+ # Returns an Enumerator if no block was given.
+ #
+ # enum = Pathname.new("/usr/bin/ruby").descend
+ # # ... do stuff ...
+ # enum.each { |e| ... }
+ # # yields Pathnames /, /usr, /usr/bin, and /usr/bin/ruby.
+ #
# It doesn't access the filesystem.
#
def descend
+ return to_enum(__method__) unless block_given?
vs = []
ascend {|v| vs << v }
vs.reverse_each {|v| yield v }
@@ -305,9 +312,17 @@ class Pathname
# #<Pathname:path/to>
# #<Pathname:path>
#
+ # Returns an Enumerator if no block was given.
+ #
+ # enum = Pathname.new("/usr/bin/ruby").ascend
+ # # ... do stuff ...
+ # enum.each { |e| ... }
+ # # yields Pathnames /usr/bin/ruby, /usr/bin, /usr, and /.
+ #
# It doesn't access the filesystem.
#
def ascend
+ return to_enum(__method__) unless block_given?
path = @path
yield self
while r = chop_basename(path)
@@ -324,12 +339,17 @@ class Pathname
# p2 = p1 + "bin/ruby" # Pathname:/usr/bin/ruby
# p3 = p1 + "/etc/passwd" # Pathname:/etc/passwd
#
+ # # / is aliased to +.
+ # p4 = p1 / "bin/ruby" # Pathname:/usr/bin/ruby
+ # p5 = p1 / "/etc/passwd" # Pathname:/etc/passwd
+ #
# This method doesn't access the file system; it is pure string manipulation.
#
def +(other)
other = Pathname.new(other) unless Pathname === other
Pathname.new(plus(@path, other.to_s))
end
+ alias / +
def plus(path1, path2) # -> path # :nodoc:
prefix2 = path2
@@ -358,7 +378,7 @@ class Pathname
basename_list2.shift
end
r1 = chop_basename(prefix1)
- if !r1 && /#{SEPARATOR_PAT}/o =~ File.basename(prefix1)
+ if !r1 && (r1 = /#{SEPARATOR_PAT}/o =~ File.basename(prefix1))
while !basename_list2.empty? && basename_list2.first == '..'
index_list2.shift
basename_list2.shift
@@ -384,7 +404,7 @@ class Pathname
# #=> true
#
def join(*args)
- args.unshift self
+ return self if args.empty?
result = args.pop
result = Pathname.new(result) unless Pathname === result
return result if result.absolute?
@@ -393,7 +413,7 @@ class Pathname
result = arg + result
return result if result.absolute?
}
- result
+ self + result
end
#
@@ -534,13 +554,13 @@ class Pathname # * Find *
#
# See Find.find
#
- def find # :yield: pathname
- return to_enum(__method__) unless block_given?
+ def find(ignore_error: true) # :yield: pathname
+ return to_enum(__method__, ignore_error: ignore_error) unless block_given?
require 'find'
if @path == '.'
- Find.find(@path) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
+ Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
else
- Find.find(@path) {|f| yield self.class.new(f) }
+ Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f) }
end
end
end
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 3db97fcf3d..d560e7356f 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -440,6 +440,25 @@ path_atime(VALUE self)
return rb_funcall(rb_cFile, rb_intern("atime"), 1, get_strpath(self));
}
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) || defined(_WIN32)
+/*
+ * call-seq:
+ * pathname.birthtime -> time
+ *
+ * Returns the birth time for the file.
+ * If the platform doesn't have birthtime, raises NotImplementedError.
+ *
+ * See File.birthtime.
+ */
+static VALUE
+path_birthtime(VALUE self)
+{
+ return rb_funcall(rb_cFile, rb_intern("birthtime"), 1, get_strpath(self));
+}
+#else
+# define path_birthtime rb_f_notimplement
+#endif
+
/*
* call-seq:
* pathname.ctime -> time
@@ -1288,6 +1307,7 @@ path_f_pathname(VALUE self, VALUE str)
*
* These methods are a facade for File:
* - #atime
+ * - #birthtime
* - #ctime
* - #mtime
* - #chmod(mode)
@@ -1350,7 +1370,7 @@ path_f_pathname(VALUE self, VALUE str)
* information. In some cases, a brief description will follow.
*/
void
-Init_pathname()
+Init_pathname(void)
{
id_at_path = rb_intern("@path");
id_to_path = rb_intern("to_path");
@@ -1380,6 +1400,7 @@ Init_pathname()
rb_define_method(rb_cPathname, "binwrite", path_binwrite, -1);
rb_define_method(rb_cPathname, "sysopen", path_sysopen, -1);
rb_define_method(rb_cPathname, "atime", path_atime, 0);
+ rb_define_method(rb_cPathname, "birthtime", path_birthtime, 0);
rb_define_method(rb_cPathname, "ctime", path_ctime, 0);
rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
rb_define_method(rb_cPathname, "chmod", path_chmod, 1);
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
index 65e83a3554..be33d35a5e 100644
--- a/ext/psych/extconf.rb
+++ b/ext/psych/extconf.rb
@@ -1,4 +1,5 @@
# -*- coding: us-ascii -*-
+# frozen_string_literal: false
require 'mkmf'
require 'fileutils'
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index 2a87f43efe..4e678deedc 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -1,4 +1,11 @@
-require 'psych.so'
+# frozen_string_literal: false
+case RUBY_ENGINE
+when 'jruby'
+ require 'psych_jars'
+ org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false)
+else
+ require 'psych.so'
+end
require 'psych/nodes'
require 'psych/streaming'
require 'psych/visitors'
@@ -14,13 +21,14 @@ require 'psych/stream'
require 'psych/json/tree_builder'
require 'psych/json/stream'
require 'psych/handlers/document_stream'
+require 'psych/class_loader'
###
# = Overview
#
# 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
+# or [HG repo: https://bitbucket.org/xi/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.
@@ -71,7 +79,7 @@ require 'psych/handlers/document_stream'
# ==== Exception handling
#
# begin
-# # The second argument chnages only the exception contents
+# # The second argument changes only the exception contents
# Psych.parse("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
@@ -135,7 +143,7 @@ require 'psych/handlers/document_stream'
# ==== Exception handling
#
# begin
-# # The second argument chnages only the exception contents
+# # The second argument changes only the exception contents
# Psych.parse("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
@@ -216,11 +224,13 @@ require 'psych/handlers/document_stream'
module Psych
# The version is Psych you're using
- VERSION = '2.0.2'
+ VERSION = '2.1.0'
# The version of libyaml Psych is using
LIBYAML_VERSION = Psych.libyaml_version.join '.'
+ FALLBACK = Struct.new :to_ruby # :nodoc:
+
###
# Load +yaml+ in to a Ruby data structure. If multiple documents are
# provided, the object contained in the first document will be returned.
@@ -240,8 +250,8 @@ module Psych
# ex.file # => 'file.txt'
# ex.message # => "(file.txt): found character that cannot start any token"
# end
- def self.load yaml, filename = nil
- result = parse(yaml, filename)
+ def self.load yaml, filename = nil, fallback = false
+ result = parse(yaml, filename, fallback)
result ? result.to_ruby : result
end
@@ -313,11 +323,11 @@ module Psych
# end
#
# See Psych::Nodes for more information about YAML AST.
- def self.parse yaml, filename = nil
+ def self.parse yaml, filename = nil, fallback = false
parse_stream(yaml, filename) do |node|
return node
end
- false
+ fallback
end
###
@@ -458,9 +468,12 @@ module Psych
###
# Load the document contained in +filename+. Returns the yaml contained in
- # +filename+ as a Ruby object
- def self.load_file filename
- File.open(filename, 'r:bom|utf-8') { |f| self.load f, filename }
+ # +filename+ as a Ruby object, or if the file is empty, it returns
+ # the specified default return value, which defaults to an empty Hash
+ def self.load_file filename, fallback = false
+ File.open(filename, 'r:bom|utf-8') { |f|
+ self.load f, filename, FALLBACK.new(fallback)
+ }
end
# :stopdoc:
diff --git a/ext/psych/lib/psych/class_loader.rb b/ext/psych/lib/psych/class_loader.rb
index 46c6b93627..ba756f7ea7 100644
--- a/ext/psych/lib/psych/class_loader.rb
+++ b/ext/psych/lib/psych/class_loader.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/omap'
require 'psych/set'
diff --git a/ext/psych/lib/psych/coder.rb b/ext/psych/lib/psych/coder.rb
index 2b830d2b21..26005f57b4 100644
--- a/ext/psych/lib/psych/coder.rb
+++ b/ext/psych/lib/psych/coder.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
###
# If an object defines +encode_with+, then an instance of Psych::Coder will
diff --git a/ext/psych/lib/psych/core_ext.rb b/ext/psych/lib/psych/core_ext.rb
index 9c8134da7e..1a98279afd 100644
--- a/ext/psych/lib/psych/core_ext.rb
+++ b/ext/psych/lib/psych/core_ext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
class Object
def self.yaml_tag url
Psych.add_tag(url, self)
diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/deprecated.rb
index 8c310b3207..165d2102b4 100644
--- a/ext/psych/lib/psych/deprecated.rb
+++ b/ext/psych/lib/psych/deprecated.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'date'
module Psych
diff --git a/ext/psych/lib/psych/exception.rb b/ext/psych/lib/psych/exception.rb
index ce9d2caf3f..83c3d7fa82 100644
--- a/ext/psych/lib/psych/exception.rb
+++ b/ext/psych/lib/psych/exception.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
class Exception < RuntimeError
end
diff --git a/ext/psych/lib/psych/handler.rb b/ext/psych/lib/psych/handler.rb
index c55afe745f..1ab5f73e95 100644
--- a/ext/psych/lib/psych/handler.rb
+++ b/ext/psych/lib/psych/handler.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
###
# Psych::Handler is an abstract base class that defines the events used
diff --git a/ext/psych/lib/psych/handlers/document_stream.rb b/ext/psych/lib/psych/handlers/document_stream.rb
index e429993c1c..c43b39ebc5 100644
--- a/ext/psych/lib/psych/handlers/document_stream.rb
+++ b/ext/psych/lib/psych/handlers/document_stream.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/tree_builder'
module Psych
diff --git a/ext/psych/lib/psych/handlers/recorder.rb b/ext/psych/lib/psych/handlers/recorder.rb
index 4eae62e5f9..341b81dec4 100644
--- a/ext/psych/lib/psych/handlers/recorder.rb
+++ b/ext/psych/lib/psych/handlers/recorder.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/handler'
module Psych
diff --git a/ext/psych/lib/psych/json/ruby_events.rb b/ext/psych/lib/psych/json/ruby_events.rb
index 6b73249c06..478eb667c7 100644
--- a/ext/psych/lib/psych/json/ruby_events.rb
+++ b/ext/psych/lib/psych/json/ruby_events.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module JSON
module RubyEvents # :nodoc:
diff --git a/ext/psych/lib/psych/json/stream.rb b/ext/psych/lib/psych/json/stream.rb
index fe2a6e9116..83b7e13655 100644
--- a/ext/psych/lib/psych/json/stream.rb
+++ b/ext/psych/lib/psych/json/stream.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/json/ruby_events'
require 'psych/json/yaml_events'
diff --git a/ext/psych/lib/psych/json/tree_builder.rb b/ext/psych/lib/psych/json/tree_builder.rb
index b799c93f58..2f94b8c252 100644
--- a/ext/psych/lib/psych/json/tree_builder.rb
+++ b/ext/psych/lib/psych/json/tree_builder.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/json/yaml_events'
module Psych
diff --git a/ext/psych/lib/psych/json/yaml_events.rb b/ext/psych/lib/psych/json/yaml_events.rb
index d054d9b458..07f64737c5 100644
--- a/ext/psych/lib/psych/json/yaml_events.rb
+++ b/ext/psych/lib/psych/json/yaml_events.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module JSON
module YAMLEvents # :nodoc:
diff --git a/ext/psych/lib/psych/nodes.rb b/ext/psych/lib/psych/nodes.rb
index f3b33fe975..01573b509b 100644
--- a/ext/psych/lib/psych/nodes.rb
+++ b/ext/psych/lib/psych/nodes.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/nodes/node'
require 'psych/nodes/stream'
require 'psych/nodes/document'
diff --git a/ext/psych/lib/psych/nodes/alias.rb b/ext/psych/lib/psych/nodes/alias.rb
index 5bd4df13d1..716a00d62f 100644
--- a/ext/psych/lib/psych/nodes/alias.rb
+++ b/ext/psych/lib/psych/nodes/alias.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/document.rb b/ext/psych/lib/psych/nodes/document.rb
index 32014d60dc..7234fef1d8 100644
--- a/ext/psych/lib/psych/nodes/document.rb
+++ b/ext/psych/lib/psych/nodes/document.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/mapping.rb b/ext/psych/lib/psych/nodes/mapping.rb
index 5ba95ce4b6..4c11df8cd6 100644
--- a/ext/psych/lib/psych/nodes/mapping.rb
+++ b/ext/psych/lib/psych/nodes/mapping.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/node.rb b/ext/psych/lib/psych/nodes/node.rb
index 83233a61fd..e3621dc451 100644
--- a/ext/psych/lib/psych/nodes/node.rb
+++ b/ext/psych/lib/psych/nodes/node.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'stringio'
require 'psych/class_loader'
require 'psych/scalar_scanner'
diff --git a/ext/psych/lib/psych/nodes/scalar.rb b/ext/psych/lib/psych/nodes/scalar.rb
index 1b1b25b98a..ee5570518e 100644
--- a/ext/psych/lib/psych/nodes/scalar.rb
+++ b/ext/psych/lib/psych/nodes/scalar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/sequence.rb b/ext/psych/lib/psych/nodes/sequence.rb
index e4b833d330..1096469567 100644
--- a/ext/psych/lib/psych/nodes/sequence.rb
+++ b/ext/psych/lib/psych/nodes/sequence.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Nodes
###
@@ -56,7 +57,7 @@ module Psych
# Is this sequence started implicitly?
attr_accessor :implicit
- # The sequece style used
+ # The sequence style used
attr_accessor :style
###
diff --git a/ext/psych/lib/psych/nodes/stream.rb b/ext/psych/lib/psych/nodes/stream.rb
index 7cf5e033ec..559b0846e7 100644
--- a/ext/psych/lib/psych/nodes/stream.rb
+++ b/ext/psych/lib/psych/nodes/stream.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/omap.rb b/ext/psych/lib/psych/omap.rb
index 6286270616..233b945c4a 100644
--- a/ext/psych/lib/psych/omap.rb
+++ b/ext/psych/lib/psych/omap.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
class Omap < ::Hash
end
diff --git a/ext/psych/lib/psych/parser.rb b/ext/psych/lib/psych/parser.rb
index 84085f1fb0..242512f89f 100644
--- a/ext/psych/lib/psych/parser.rb
+++ b/ext/psych/lib/psych/parser.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
###
# YAML event parser class. This class parses a YAML document and calls
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb
index 3fc9edd25d..f519da1465 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'strscan'
module Psych
@@ -37,7 +38,7 @@ module Psych
case string
# 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!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/
+ when /^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/, /\n/
if string.length > 5
@string_cache[string] = true
return string
diff --git a/ext/psych/lib/psych/set.rb b/ext/psych/lib/psych/set.rb
index 6793a8ed1b..f35be15e6f 100644
--- a/ext/psych/lib/psych/set.rb
+++ b/ext/psych/lib/psych/set.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
class Set < ::Hash
end
diff --git a/ext/psych/lib/psych/stream.rb b/ext/psych/lib/psych/stream.rb
index 88c4c4cb4e..2f63d7d552 100644
--- a/ext/psych/lib/psych/stream.rb
+++ b/ext/psych/lib/psych/stream.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
###
# Psych::Stream is a streaming YAML emitter. It will not buffer your YAML,
diff --git a/ext/psych/lib/psych/streaming.rb b/ext/psych/lib/psych/streaming.rb
index 9d94eb549f..260f8a8008 100644
--- a/ext/psych/lib/psych/streaming.rb
+++ b/ext/psych/lib/psych/streaming.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Streaming
module ClassMethods
diff --git a/ext/psych/lib/psych/syntax_error.rb b/ext/psych/lib/psych/syntax_error.rb
index e200ef0060..db293b9fb2 100644
--- a/ext/psych/lib/psych/syntax_error.rb
+++ b/ext/psych/lib/psych/syntax_error.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/exception'
module Psych
diff --git a/ext/psych/lib/psych/tree_builder.rb b/ext/psych/lib/psych/tree_builder.rb
index c8f344787c..d359c933af 100644
--- a/ext/psych/lib/psych/tree_builder.rb
+++ b/ext/psych/lib/psych/tree_builder.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/handler'
module Psych
diff --git a/ext/psych/lib/psych/versions.rb b/ext/psych/lib/psych/versions.rb
new file mode 100644
index 0000000000..5f7652b097
--- /dev/null
+++ b/ext/psych/lib/psych/versions.rb
@@ -0,0 +1,4 @@
+# frozen_string_literal: false
+module Psych
+ DEFAULT_SNAKEYAML_VERSION = '1.14'.freeze
+end
diff --git a/ext/psych/lib/psych/visitors.rb b/ext/psych/lib/psych/visitors.rb
index cc98b103f1..5dee4ebd7a 100644
--- a/ext/psych/lib/psych/visitors.rb
+++ b/ext/psych/lib/psych/visitors.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/visitors/visitor'
require 'psych/visitors/to_ruby'
require 'psych/visitors/emitter'
diff --git a/ext/psych/lib/psych/visitors/depth_first.rb b/ext/psych/lib/psych/visitors/depth_first.rb
index c6eb814ac0..2d74a212d6 100644
--- a/ext/psych/lib/psych/visitors/depth_first.rb
+++ b/ext/psych/lib/psych/visitors/depth_first.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Visitors
class DepthFirst < Psych::Visitors::Visitor
diff --git a/ext/psych/lib/psych/visitors/emitter.rb b/ext/psych/lib/psych/visitors/emitter.rb
index c886e5092e..f2ff9fdb28 100644
--- a/ext/psych/lib/psych/visitors/emitter.rb
+++ b/ext/psych/lib/psych/visitors/emitter.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Visitors
class Emitter < Psych::Visitors::Visitor
diff --git a/ext/psych/lib/psych/visitors/json_tree.rb b/ext/psych/lib/psych/visitors/json_tree.rb
index 0127ac8aa8..f2f0215cd2 100644
--- a/ext/psych/lib/psych/visitors/json_tree.rb
+++ b/ext/psych/lib/psych/visitors/json_tree.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/json/ruby_events'
module Psych
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index 1bfffb952f..c061da25f1 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/scalar_scanner'
require 'psych/class_loader'
require 'psych/exception'
@@ -32,7 +33,7 @@ module Psych
return result if @domain_types.empty? || !target.tag
key = target.tag.sub(/^[!\/]*/, '').sub(/(,\d+)\//, '\1:')
- key = "tag:#{key}" unless key =~ /^(tag:|x-private)/
+ key = "tag:#{key}" unless key =~ /^(?:tag:|x-private)/
if @domain_types.key? key
value, block = @domain_types[key]
@@ -61,7 +62,7 @@ module Psych
case o.tag
when '!binary', 'tag:yaml.org,2002:binary'
o.value.unpack('m').first
- when /^!(?:str|ruby\/string)(?::(.*))?/, 'tag:yaml.org,2002:str'
+ when /^!(?:str|ruby\/string)(?::(.*))?$/, 'tag:yaml.org,2002:str'
klass = resolve_class($1)
if klass
klass.allocate.replace o.value
@@ -75,6 +76,8 @@ module Psych
class_loader.date_time
require 'date'
@ss.parse_time(o.value).to_datetime
+ when '!ruby/encoding'
+ ::Encoding.find o.value
when "!ruby/object:Complex"
class_loader.complex
Complex(o.value)
@@ -87,7 +90,7 @@ module Psych
Float(@ss.tokenize(o.value))
when "!ruby/regexp"
klass = class_loader.regexp
- o.value =~ /^\/(.*)\/([mixn]*)$/
+ o.value =~ /^\/(.*)\/([mixn]*)$/m
source = $1
options = 0
lang = nil
@@ -181,9 +184,11 @@ module Psych
klass = class_loader.struct
members = o.children.map { |c| accept c }
h = Hash[*members]
- klass.new(*h.map { |k,v|
+ s = klass.new(*h.map { |k,v|
class_loader.symbolize k
}).new(*h.map { |k,v| v })
+ register(o, s)
+ s
end
when /^!ruby\/object:?(.*)?$/
@@ -197,12 +202,14 @@ module Psych
class_loader.rational
h = Hash[*o.children.map { |c| accept c }]
register o, Rational(h['numerator'], h['denominator'])
+ elsif name == 'Hash'
+ revive_hash(register(o, {}), o)
else
obj = revive((resolve_class(name) || class_loader.object), o)
obj
end
- when /^!(?:str|ruby\/string)(?::(.*))?/, 'tag:yaml.org,2002:str'
+ when /^!(?:str|ruby\/string)(?::(.*))?$/, 'tag:yaml.org,2002:str'
klass = resolve_class($1)
members = {}
string = nil
@@ -255,8 +262,23 @@ module Psych
end
set
+ when /^!ruby\/hash-with-ivars(?::(.*))?$/
+ hash = $1 ? resolve_class($1).allocate : {}
+ register o, hash
+ o.children.each_slice(2) do |key, value|
+ case key.value
+ when 'elements'
+ revive_hash hash, value
+ when 'ivars'
+ value.children.each_slice(2) do |k,v|
+ hash.instance_variable_set accept(k), accept(v)
+ end
+ end
+ end
+ hash
+
when /^!map:(.*)$/, /^!ruby\/hash:(.*)$/
- revive_hash register(o, resolve_class($1).new), o
+ revive_hash register(o, resolve_class($1).allocate), o
when '!omap', 'tag:yaml.org,2002:omap'
map = register(o, class_loader.psych_omap.new)
@@ -265,6 +287,21 @@ module Psych
end
map
+ when /^!ruby\/marshalable:(.*)$/
+ name = $1
+ klass = resolve_class(name)
+ obj = register(o, klass.allocate)
+
+ if obj.respond_to?(:init_with)
+ init_with(obj, revive_hash({}, o), o)
+ elsif obj.respond_to?(:marshal_load)
+ marshal_data = o.children.map(&method(:accept))
+ obj.marshal_load(marshal_data)
+ obj
+ else
+ raise ArgumentError, "Cannot deserialize #{name}"
+ end
+
else
revive_hash(register(o, {}), o)
end
@@ -294,14 +331,15 @@ module Psych
list
end
+ SHOVEL = '<<'
def revive_hash hash, o
o.children.each_slice(2) { |k,v|
key = accept(k)
val = accept(v)
- if key == '<<'
+ if key == SHOVEL && k.tag != "tag:yaml.org,2002:str"
case v
- when Nodes::Alias
+ when Nodes::Alias, Nodes::Mapping
begin
hash.merge! val
rescue TypeError
diff --git a/ext/psych/lib/psych/visitors/visitor.rb b/ext/psych/lib/psych/visitors/visitor.rb
index 4d7772f428..d97bf550f6 100644
--- a/ext/psych/lib/psych/visitors/visitor.rb
+++ b/ext/psych/lib/psych/visitors/visitor.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Psych
module Visitors
class Visitor
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb
index 1cb2137693..38cee2ff78 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'psych/tree_builder'
require 'psych/scalar_scanner'
require 'psych/class_loader'
@@ -16,15 +17,20 @@ module Psych
def initialize
@obj_to_id = {}
@obj_to_node = {}
+ @targets = []
@counter = 0
end
def register target, node
+ return unless target.respond_to? :object_id
+ @targets << target
@obj_to_node[target.object_id] = node
end
def key? target
@obj_to_node.key? target.object_id
+ rescue NoMethodError
+ false
end
def id_for target
@@ -58,13 +64,22 @@ module Psych
def initialize emitter, ss, options
super()
- @started = false
- @finished = false
- @emitter = emitter
- @st = Registrar.new
- @ss = ss
- @options = options
- @coders = []
+ @started = false
+ @finished = false
+ @emitter = emitter
+ @st = Registrar.new
+ @ss = ss
+ @options = options
+ @line_width = options[:line_width]
+ if @line_width && @line_width < 0
+ if @line_width == -1
+ # Treat -1 as unlimited line-width, same as libyaml does.
+ @line_width = nil
+ else
+ fail(ArgumentError, "Invalid line_width #{@line_width}, must be non-negative or -1 for unlimited.")
+ end
+ end
+ @coders = []
@dispatch_cache = Hash.new do |h,klass|
method = "visit_#{(klass.name || '').split('::').join('_')}"
@@ -150,13 +165,18 @@ module Psych
end
def visit_Psych_Omap o
- seq = @emitter.start_sequence(nil, '!omap', false, Nodes::Sequence::BLOCK)
+ seq = @emitter.start_sequence(nil, 'tag:yaml.org,2002:omap', false, Nodes::Sequence::BLOCK)
register(o, seq)
o.each { |k,v| visit_Hash k => v }
@emitter.end_sequence
end
+ def visit_Encoding o
+ tag = "!ruby/encoding"
+ @emitter.scalar o.name, nil, tag, false, false, Nodes::Scalar::ANY
+ end
+
def visit_Object o
tag = Psych.dump_tags[o.class]
unless tag
@@ -204,6 +224,25 @@ module Psych
@emitter.end_mapping
end
+ def visit_NameError o
+ tag = ['!ruby/exception', o.class.name].join ':'
+
+ @emitter.start_mapping nil, tag, false, Nodes::Mapping::BLOCK
+
+ {
+ 'message' => o.message.to_s,
+ 'backtrace' => private_iv_get(o, 'backtrace'),
+ }.each do |k,v|
+ next unless v
+ @emitter.scalar k, nil, nil, true, false, Nodes::Scalar::ANY
+ accept v
+ end
+
+ dump_ivars o
+
+ @emitter.end_mapping
+ end
+
def visit_Regexp o
register o, @emitter.scalar(o.inspect, nil, '!ruby/regexp', false, false, Nodes::Scalar::ANY)
end
@@ -273,41 +312,46 @@ module Psych
quote = true
style = Nodes::Scalar::PLAIN
tag = nil
- str = o
if binary?(o)
- str = [o].pack('m').chomp
+ o = [o].pack('m').chomp
tag = '!binary' # FIXME: change to below when syck is removed
#tag = 'tag:yaml.org,2002:binary'
style = Nodes::Scalar::LITERAL
plain = false
quote = false
- elsif o =~ /\n/
+ elsif o =~ /\n(?!\Z)/ # match \n except blank line at the end of string
style = Nodes::Scalar::LITERAL
- elsif o =~ /^\W/
+ elsif o == '<<'
+ style = Nodes::Scalar::SINGLE_QUOTED
+ tag = 'tag:yaml.org,2002:str'
+ plain = false
+ quote = false
+ elsif @line_width && o.length > @line_width
+ style = Nodes::Scalar::FOLDED
+ elsif o =~ /^[^[:word:]][^"]*$/
style = Nodes::Scalar::DOUBLE_QUOTED
- else
- unless String === @ss.tokenize(o)
- style = Nodes::Scalar::SINGLE_QUOTED
- end
+ elsif not String === @ss.tokenize(o) or /\A0[0-7]*[89]/ =~ o
+ style = Nodes::Scalar::SINGLE_QUOTED
end
- ivars = find_ivars o
+ is_primitive = o.class == ::String
+ ivars = find_ivars o, is_primitive
if ivars.empty?
- unless o.class == ::String
+ unless is_primitive
tag = "!ruby/string:#{o.class}"
plain = false
quote = false
end
- @emitter.scalar str, nil, tag, plain, quote, style
+ @emitter.scalar o, nil, tag, plain, quote, style
else
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
+ @emitter.scalar o, nil, tag, plain, quote, style
dump_ivars o
@@ -334,17 +378,16 @@ module Psych
end
def visit_Hash o
- tag = o.class == ::Hash ? nil : "!ruby/hash:#{o.class}"
- implicit = !tag
-
- register(o, @emitter.start_mapping(nil, tag, implicit, Psych::Nodes::Mapping::BLOCK))
-
- o.each do |k,v|
- accept k
- accept v
+ if o.class == ::Hash
+ register(o, @emitter.start_mapping(nil, nil, true, Psych::Nodes::Mapping::BLOCK))
+ o.each do |k,v|
+ accept k
+ accept v
+ end
+ @emitter.end_mapping
+ else
+ visit_hash_subclass o
end
-
- @emitter.end_mapping
end
def visit_Psych_Set o
@@ -373,7 +416,23 @@ module Psych
end
def visit_Symbol o
- @emitter.scalar ":#{o}", nil, nil, true, false, Nodes::Scalar::ANY
+ if o.empty?
+ @emitter.scalar "", nil, '!ruby/symbol', false, false, Nodes::Scalar::ANY
+ else
+ @emitter.scalar ":#{o}", nil, nil, true, false, Nodes::Scalar::ANY
+ end
+ end
+
+ def visit_BasicObject o
+ tag = Psych.dump_tags[o.class]
+ tag ||= "!ruby/marshalable:#{o.class.name}"
+
+ map = @emitter.start_mapping(nil, tag, false, Nodes::Mapping::BLOCK)
+ register(o, map)
+
+ o.marshal_dump.each(&method(:accept))
+
+ @emitter.end_mapping
end
private
@@ -390,7 +449,8 @@ module Psych
def visit_array_subclass o
tag = "!ruby/array:#{o.class}"
- if o.instance_variables.empty?
+ ivars = o.instance_variables
+ if ivars.empty?
node = @emitter.start_sequence(nil, tag, false, Nodes::Sequence::BLOCK)
register o, node
o.each { |c| accept c }
@@ -408,7 +468,7 @@ module Psych
# Dump the ivars
accept 'ivars'
@emitter.start_mapping(nil, nil, true, Nodes::Sequence::BLOCK)
- o.instance_variables.each do |ivar|
+ ivars.each do |ivar|
accept ivar
accept o.instance_variable_get ivar
end
@@ -418,35 +478,57 @@ module Psych
end
end
- def dump_list o
- end
+ def visit_hash_subclass o
+ ivars = o.instance_variables
+ if ivars.any?
+ tag = "!ruby/hash-with-ivars:#{o.class}"
+ node = @emitter.start_mapping(nil, tag, false, Psych::Nodes::Mapping::BLOCK)
+ register(o, node)
- # '%: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")
+ # Dump the elements
+ accept 'elements'
+ @emitter.start_mapping nil, nil, true, Nodes::Mapping::BLOCK
+ o.each do |k,v|
+ accept k
+ accept v
+ end
+ @emitter.end_mapping
- if time.utc?
- formatted += " Z"
- else
- zone = time.strftime('%z')
- formatted += " #{zone[0,3]}:#{zone[3,5]}"
+ # Dump the ivars
+ accept 'ivars'
+ @emitter.start_mapping nil, nil, true, Nodes::Mapping::BLOCK
+ o.instance_variables.each do |ivar|
+ accept ivar
+ accept o.instance_variable_get ivar
end
+ @emitter.end_mapping
- 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")
+ @emitter.end_mapping
+ else
+ tag = "!ruby/hash:#{o.class}"
+ node = @emitter.start_mapping(nil, tag, false, Psych::Nodes::Mapping::BLOCK)
+ register(o, node)
+ o.each do |k,v|
+ accept k
+ accept v
end
+ @emitter.end_mapping
+ end
+ end
+
+ def dump_list o
+ end
+
+ 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
# FIXME: remove this method once "to_yaml_properties" is removed
- def find_ivars target
+ def find_ivars target, is_primitive=false
begin
loc = target.method(:to_yaml_properties).source_location.first
unless loc.start_with?(Psych::DEPRECATED) || loc.end_with?('rubytypes.rb')
@@ -460,7 +542,7 @@ module Psych
# and it's OK to skip it since it's only to emit a warning.
end
- target.instance_variables
+ is_primitive ? [] : target.instance_variables
end
def register target, yaml_obj
@@ -478,10 +560,10 @@ module Psych
c = Psych::Coder.new(tag)
o.encode_with(c)
- emit_coder c
+ emit_coder c, o
end
- def emit_coder c
+ def emit_coder c, o
case c.type
when :scalar
@emitter.scalar c.scalar, nil, c.tag, c.tag.nil?, false, Nodes::Scalar::ANY
@@ -492,7 +574,7 @@ module Psych
end
@emitter.end_sequence
when :map
- @emitter.start_mapping nil, c.tag, c.implicit, c.style
+ register o, @emitter.start_mapping(nil, c.tag, c.implicit, c.style)
c.map.each do |k,v|
accept k
accept v
diff --git a/ext/psych/lib/psych/y.rb b/ext/psych/lib/psych/y.rb
index d0e049d4e5..82e05a783c 100644
--- a/ext/psych/lib/psych/y.rb
+++ b/ext/psych/lib/psych/y.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module Kernel
###
# An alias for Psych.dump_stream meant to be used with IRB.
diff --git a/ext/psych/lib/psych_jars.rb b/ext/psych/lib/psych_jars.rb
new file mode 100644
index 0000000000..bd7ea04de7
--- /dev/null
+++ b/ext/psych/lib/psych_jars.rb
@@ -0,0 +1,6 @@
+# frozen_string_literal: false
+require 'psych/versions'
+require 'psych.jar'
+
+require 'jar-dependencies'
+require_jar('org.yaml', 'snakeyaml', Psych::DEFAULT_SNAKEYAML_VERSION)
diff --git a/ext/psych/psych.c b/ext/psych/psych.c
index 69ff1d8dfc..3bb59bfc11 100644
--- a/ext/psych/psych.c
+++ b/ext/psych/psych.c
@@ -20,7 +20,7 @@ static VALUE libyaml_version(VALUE module)
VALUE mPsych;
-void Init_psych()
+void Init_psych(void)
{
mPsych = rb_define_module("Psych");
diff --git a/ext/psych/psych.gemspec b/ext/psych/psych.gemspec
index ca751a033d..c50ce592a9 100644
--- a/ext/psych/psych.gemspec
+++ b/ext/psych/psych.gemspec
@@ -1,24 +1,45 @@
# -*- encoding: utf-8 -*-
+# stub: psych 2.1.0 ruby lib
+# stub: ext/psych/extconf.rb
Gem::Specification.new do |s|
s.name = "psych"
- s.version = "2.0.2"
+ s.version = "2.1.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.require_paths = ["lib"]
s.authors = ["Aaron Patterson"]
- s.date = "2013-11-26"
+ s.date = "2016-06-24"
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/depend", "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/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.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_safe_load.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.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc", "CHANGELOG.rdoc", "README.rdoc"]
+ s.files = [".autotest", ".travis.yml", "CHANGELOG.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "ext/psych/depend", "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/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.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/versions.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", "lib/psych_jars.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_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_safe_load.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"]
s.homepage = "http://github.com/tenderlove/psych"
s.licenses = ["MIT"]
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 = "2.0.2"
+ s.rubygems_version = "2.5.1"
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_safe_load.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"]
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 4
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
+ s.add_development_dependency(%q<rake-compiler>, [">= 0.4.1"])
+ s.add_development_dependency(%q<minitest>, ["~> 5.0"])
+ s.add_development_dependency(%q<hoe>, ["~> 3.15"])
+ else
+ s.add_dependency(%q<rdoc>, ["~> 4.0"])
+ s.add_dependency(%q<rake-compiler>, [">= 0.4.1"])
+ s.add_dependency(%q<minitest>, ["~> 5.0"])
+ s.add_dependency(%q<hoe>, ["~> 3.15"])
+ end
+ else
+ s.add_dependency(%q<rdoc>, ["~> 4.0"])
+ s.add_dependency(%q<rake-compiler>, [">= 0.4.1"])
+ s.add_dependency(%q<minitest>, ["~> 5.0"])
+ s.add_dependency(%q<hoe>, ["~> 3.15"])
+ end
end
diff --git a/ext/psych/psych_emitter.c b/ext/psych/psych_emitter.c
index f0d032649c..371c285183 100644
--- a/ext/psych/psych_emitter.c
+++ b/ext/psych/psych_emitter.c
@@ -1,5 +1,12 @@
#include <psych.h>
+#if !defined(RARRAY_CONST_PTR)
+#define RARRAY_CONST_PTR(s) (const VALUE *)RARRAY_PTR(s)
+#endif
+#if !defined(RARRAY_AREF)
+#define RARRAY_AREF(a, i) RARRAY_CONST_PTR(a)[i]
+#endif
+
VALUE cPsychEmitter;
static ID id_write;
static ID id_line_width;
@@ -15,7 +22,11 @@ static void emit(yaml_emitter_t * emitter, yaml_event_t * event)
static int writer(void *ctx, unsigned char *buffer, size_t size)
{
VALUE io = (VALUE)ctx;
+#ifdef HAVE_RUBY_ENCODING_H
+ VALUE str = rb_enc_str_new((const char *)buffer, (long)size, rb_utf8_encoding());
+#else
VALUE str = rb_str_new((const char *)buffer, (long)size);
+#endif
VALUE wrote = rb_funcall(io, id_write, 1, str);
return (int)NUM2INT(wrote);
}
@@ -29,17 +40,34 @@ static void dealloc(void * ptr)
xfree(emitter);
}
+#if 0
+static size_t memsize(const void *ptr)
+{
+ const yaml_emitter_t *emitter = ptr;
+ /* TODO: calculate emitter's size */
+ return 0;
+}
+#endif
+
+static const rb_data_type_t psych_emitter_type = {
+ "Psych/emitter",
+ {0, dealloc, 0,},
+ 0, 0,
+#ifdef RUBY_TYPED_FREE_IMMEDIATELY
+ RUBY_TYPED_FREE_IMMEDIATELY,
+#endif
+};
+
static VALUE allocate(VALUE klass)
{
yaml_emitter_t * emitter;
-
- emitter = xmalloc(sizeof(yaml_emitter_t));
+ VALUE obj = TypedData_Make_Struct(klass, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_emitter_initialize(emitter);
yaml_emitter_set_unicode(emitter, 1);
yaml_emitter_set_indent(emitter, 2);
- return Data_Wrap_Struct(klass, 0, dealloc, emitter);
+ return obj;
}
/* call-seq: Psych::Emitter.new(io, options = Psych::Emitter::OPTIONS)
@@ -54,7 +82,7 @@ static VALUE initialize(int argc, VALUE *argv, VALUE self)
VALUE indent;
VALUE canonical;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
if (rb_scan_args(argc, argv, "11", &io, &options) == 2) {
line_width = rb_funcall(options, id_line_width, 0);
@@ -81,7 +109,7 @@ static VALUE start_stream(VALUE self, VALUE encoding)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
Check_Type(encoding, T_FIXNUM);
yaml_stream_start_event_initialize(&event, (yaml_encoding_t)NUM2INT(encoding));
@@ -101,7 +129,7 @@ static VALUE end_stream(VALUE self)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_stream_end_event_initialize(&event);
@@ -124,7 +152,7 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
yaml_tag_directive_t * tail = NULL;
yaml_event_t event;
yaml_version_directive_t version_directive;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
Check_Type(version, T_ARRAY);
@@ -138,18 +166,20 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
}
if(RTEST(tags)) {
- int i = 0;
+ long i = 0;
+ long len;
#ifdef HAVE_RUBY_ENCODING_H
rb_encoding * encoding = rb_utf8_encoding();
#endif
Check_Type(tags, T_ARRAY);
- head = xcalloc((size_t)RARRAY_LEN(tags), sizeof(yaml_tag_directive_t));
+ len = RARRAY_LEN(tags);
+ head = xcalloc((size_t)len, sizeof(yaml_tag_directive_t));
tail = head;
- for(i = 0; i < RARRAY_LEN(tags); i++) {
- VALUE tuple = RARRAY_PTR(tags)[i];
+ for(i = 0; i < len && i < RARRAY_LEN(tags); i++) {
+ VALUE tuple = RARRAY_AREF(tags, i);
VALUE name;
VALUE value;
@@ -159,15 +189,17 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
xfree(head);
rb_raise(rb_eRuntimeError, "tag tuple must be of length 2");
}
- name = RARRAY_PTR(tuple)[0];
- value = RARRAY_PTR(tuple)[1];
+ name = RARRAY_AREF(tuple, 0);
+ value = RARRAY_AREF(tuple, 1);
+ StringValue(name);
+ StringValue(value);
#ifdef HAVE_RUBY_ENCODING_H
name = rb_str_export_to_enc(name, encoding);
value = rb_str_export_to_enc(value, encoding);
#endif
- tail->handle = (yaml_char_t *)StringValuePtr(name);
- tail->prefix = (yaml_char_t *)StringValuePtr(value);
+ tail->handle = (yaml_char_t *)RSTRING_PTR(name);
+ tail->prefix = (yaml_char_t *)RSTRING_PTR(value);
tail++;
}
@@ -198,7 +230,7 @@ static VALUE end_document(VALUE self, VALUE imp)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_document_end_event_initialize(&event, imp ? 1 : 0);
@@ -228,7 +260,7 @@ static VALUE scalar(
#ifdef HAVE_RUBY_ENCODING_H
rb_encoding *encoding;
#endif
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
Check_Type(value, T_STRING);
@@ -295,7 +327,7 @@ static VALUE start_sequence(
}
#endif
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_sequence_start_event_initialize(
&event,
@@ -320,7 +352,7 @@ static VALUE end_sequence(VALUE self)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_sequence_end_event_initialize(&event);
@@ -348,7 +380,7 @@ static VALUE start_mapping(
#ifdef HAVE_RUBY_ENCODING_H
rb_encoding *encoding;
#endif
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
#ifdef HAVE_RUBY_ENCODING_H
encoding = rb_utf8_encoding();
@@ -387,7 +419,7 @@ static VALUE end_mapping(VALUE self)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_mapping_end_event_initialize(&event);
@@ -406,7 +438,7 @@ static VALUE alias(VALUE self, VALUE anchor)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
#ifdef HAVE_RUBY_ENCODING_H
if(!NIL_P(anchor)) {
@@ -432,7 +464,7 @@ static VALUE alias(VALUE self, VALUE anchor)
static VALUE set_canonical(VALUE self, VALUE style)
{
yaml_emitter_t * emitter;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_emitter_set_canonical(emitter, Qtrue == style ? 1 : 0);
@@ -446,7 +478,7 @@ static VALUE set_canonical(VALUE self, VALUE style)
static VALUE canonical(VALUE self)
{
yaml_emitter_t * emitter;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
return (emitter->canonical == 0) ? Qfalse : Qtrue;
}
@@ -459,7 +491,7 @@ static VALUE canonical(VALUE self)
static VALUE set_indentation(VALUE self, VALUE level)
{
yaml_emitter_t * emitter;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_emitter_set_indent(emitter, NUM2INT(level));
@@ -473,7 +505,7 @@ static VALUE set_indentation(VALUE self, VALUE level)
static VALUE indentation(VALUE self)
{
yaml_emitter_t * emitter;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
return INT2NUM(emitter->best_indent);
}
@@ -485,7 +517,7 @@ static VALUE indentation(VALUE self)
static VALUE line_width(VALUE self)
{
yaml_emitter_t * emitter;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
return INT2NUM(emitter->best_width);
}
@@ -497,14 +529,14 @@ static VALUE line_width(VALUE self)
static VALUE set_line_width(VALUE self, VALUE width)
{
yaml_emitter_t * emitter;
- Data_Get_Struct(self, yaml_emitter_t, emitter);
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
yaml_emitter_set_width(emitter, NUM2INT(width));
return width;
}
-void Init_psych_emitter()
+void Init_psych_emitter(void)
{
VALUE psych = rb_define_module("Psych");
VALUE handler = rb_define_class_under(psych, "Handler", rb_cObject);
diff --git a/ext/psych/psych_emitter.h b/ext/psych/psych_emitter.h
index 560451ef31..4c1482a78b 100644
--- a/ext/psych/psych_emitter.h
+++ b/ext/psych/psych_emitter.h
@@ -3,6 +3,6 @@
#include <psych.h>
-void Init_psych_emitter();
+void Init_psych_emitter(void);
#endif
diff --git a/ext/psych/psych_parser.c b/ext/psych/psych_parser.c
index 8c65ce1307..2caa8a09c3 100644
--- a/ext/psych/psych_parser.c
+++ b/ext/psych/psych_parser.c
@@ -49,14 +49,32 @@ static void dealloc(void * ptr)
xfree(parser);
}
+#if 0
+static size_t memsize(const void *ptr)
+{
+ const yaml_parser_t *parser = ptr;
+ /* TODO: calculate parser's size */
+ return 0;
+}
+#endif
+
+static const rb_data_type_t psych_parser_type = {
+ "Psych/parser",
+ {0, dealloc, 0,},
+ 0, 0,
+#ifdef RUBY_TYPED_FREE_IMMEDIATELY
+ RUBY_TYPED_FREE_IMMEDIATELY,
+#endif
+};
+
static VALUE allocate(VALUE klass)
{
yaml_parser_t * parser;
+ VALUE obj = TypedData_Make_Struct(klass, yaml_parser_t, &psych_parser_type, parser);
- parser = xmalloc(sizeof(yaml_parser_t));
yaml_parser_initialize(parser);
- return Data_Wrap_Struct(klass, 0, dealloc, parser);
+ return obj;
}
static VALUE make_exception(yaml_parser_t * parser, VALUE path)
@@ -248,7 +266,7 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
path = rb_str_new2("<unknown>");
}
- Data_Get_Struct(self, yaml_parser_t, parser);
+ TypedData_Get_Struct(self, yaml_parser_t, &psych_parser_type, parser);
yaml_parser_delete(parser);
yaml_parser_initialize(parser);
@@ -526,7 +544,7 @@ static VALUE mark(VALUE self)
VALUE args[3];
yaml_parser_t * parser;
- Data_Get_Struct(self, yaml_parser_t, parser);
+ TypedData_Get_Struct(self, yaml_parser_t, &psych_parser_type, parser);
mark_klass = rb_const_get_at(cPsychParser, rb_intern("Mark"));
args[0] = INT2NUM(parser->mark.index);
args[1] = INT2NUM(parser->mark.line);
@@ -535,7 +553,7 @@ static VALUE mark(VALUE self)
return rb_class_new_instance(3, args, mark_klass);
}
-void Init_psych_parser()
+void Init_psych_parser(void)
{
#if 0
mPsych = rb_define_module("Psych");
diff --git a/ext/psych/psych_parser.h b/ext/psych/psych_parser.h
index 25e896f01d..beb3dd0709 100644
--- a/ext/psych/psych_parser.h
+++ b/ext/psych/psych_parser.h
@@ -1,6 +1,6 @@
#ifndef PSYCH_PARSER_H
#define PSYCH_PARSER_H
-void Init_psych_parser();
+void Init_psych_parser(void);
#endif
diff --git a/ext/psych/yaml/api.c b/ext/psych/yaml/api.c
index 0c4732e152..b1a8da0bda 100644
--- a/ext/psych/yaml/api.c
+++ b/ext/psych/yaml/api.c
@@ -415,7 +415,7 @@ 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
+ if (emitter->output.string.size - *emitter->output.string.size_written
< size) {
memcpy(emitter->output.string.buffer
+ *emitter->output.string.size_written,
diff --git a/ext/psych/yaml/config.h b/ext/psych/yaml/config.h
index 6d6c25b3b1..79e8501f4f 100644
--- a/ext/psych/yaml/config.h
+++ b/ext/psych/yaml/config.h
@@ -1,11 +1,10 @@
-
#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 PACKAGE_VERSION "0.1.7"
+#define PACKAGE_STRING "yaml 0.1.7"
+#define PACKAGE_BUGREPORT "https://github.com/yaml/libyaml/issues"
+#define PACKAGE_URL "https://github.com/yaml/libyaml"
#define YAML_VERSION_MAJOR 0
#define YAML_VERSION_MINOR 1
-#define YAML_VERSION_PATCH 4
-#define YAML_VERSION_STRING "0.1.4"
+#define YAML_VERSION_PATCH 7
+#define YAML_VERSION_STRING "0.1.7"
diff --git a/ext/psych/yaml/emitter.c b/ext/psych/yaml/emitter.c
index c41a94a79f..5adcbdeb32 100644
--- a/ext/psych/yaml/emitter.c
+++ b/ext/psych/yaml/emitter.c
@@ -221,7 +221,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter);
static int
yaml_emitter_write_indicator(yaml_emitter_t *emitter,
- const char *indicator, int need_whitespace,
+ char *indicator, int need_whitespace,
int is_whitespace, int is_indention);
static int
@@ -1784,7 +1784,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter)
static int
yaml_emitter_write_indicator(yaml_emitter_t *emitter,
- const char *indicator, int need_whitespace,
+ char *indicator, int need_whitespace,
int is_whitespace, int is_indention)
{
size_t indicator_length;
@@ -2178,7 +2178,7 @@ yaml_emitter_write_block_scalar_hints(yaml_emitter_t *emitter,
yaml_string_t string)
{
char indent_hint[2];
- const char *chomp_hint = NULL;
+ char *chomp_hint = NULL;
if (IS_SPACE(string) || IS_BREAK(string))
{
diff --git a/ext/psych/yaml/loader.c b/ext/psych/yaml/loader.c
index 9d3d912663..3ba99f087e 100644
--- a/ext/psych/yaml/loader.c
+++ b/ext/psych/yaml/loader.c
@@ -239,8 +239,8 @@ yaml_parser_register_anchor(yaml_parser_t *parser,
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);
+ "found duplicate anchor; first occurrence",
+ alias_data->mark, "second occurrence", data.mark);
}
}
@@ -286,6 +286,8 @@ yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
int index;
yaml_char_t *tag = first_event->data.scalar.tag;
+ if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
+
if (!tag || strcmp((char *)tag, "!") == 0) {
yaml_free(tag);
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SCALAR_TAG);
@@ -329,6 +331,8 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
int index, item_index;
yaml_char_t *tag = first_event->data.sequence_start.tag;
+ if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
+
if (!tag || strcmp((char *)tag, "!") == 0) {
yaml_free(tag);
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG);
@@ -351,6 +355,9 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
if (!yaml_parser_parse(parser, &event)) return 0;
while (event.type != YAML_SEQUENCE_END_EVENT) {
+ if (!STACK_LIMIT(parser,
+ parser->document->nodes.start[index-1].data.sequence.items,
+ INT_MAX-1)) return 0;
item_index = yaml_parser_load_node(parser, &event);
if (!item_index) return 0;
if (!PUSH(parser,
@@ -387,6 +394,8 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_node_pair_t pair;
yaml_char_t *tag = first_event->data.mapping_start.tag;
+ if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
+
if (!tag || strcmp((char *)tag, "!") == 0) {
yaml_free(tag);
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_MAPPING_TAG);
@@ -409,6 +418,9 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
if (!yaml_parser_parse(parser, &event)) return 0;
while (event.type != YAML_MAPPING_END_EVENT) {
+ if (!STACK_LIMIT(parser,
+ parser->document->nodes.start[index-1].data.mapping.pairs,
+ INT_MAX-1)) return 0;
pair.key = yaml_parser_load_node(parser, &event);
if (!pair.key) return 0;
if (!yaml_parser_parse(parser, &event)) return 0;
diff --git a/ext/psych/yaml/reader.c b/ext/psych/yaml/reader.c
index 4e48add7b8..f1a06deb9d 100644
--- a/ext/psych/yaml/reader.c
+++ b/ext/psych/yaml/reader.c
@@ -460,6 +460,10 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
}
+ if (parser->offset >= PTRDIFF_MAX)
+ return yaml_parser_set_reader_error(parser, "input is too long",
+ PTRDIFF_MAX, -1);
+
return 1;
}
diff --git a/ext/psych/yaml/scanner.c b/ext/psych/yaml/scanner.c
index 31fed0ed94..3ef90dc66b 100644
--- a/ext/psych/yaml/scanner.c
+++ b/ext/psych/yaml/scanner.c
@@ -70,7 +70,7 @@
* %TAG !yaml! tag:yaml.org,2002:
* ---
*
- * The correspoding sequence of tokens:
+ * The corresponding sequence of tokens:
*
* STREAM-START(utf-8)
* VERSION-DIRECTIVE(1,1)
@@ -615,11 +615,11 @@ yaml_parser_decrease_flow_level(yaml_parser_t *parser);
*/
static int
-yaml_parser_roll_indent(yaml_parser_t *parser, int column,
- int number, yaml_token_type_t type, yaml_mark_t mark);
+yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column,
+ ptrdiff_t number, yaml_token_type_t type, yaml_mark_t mark);
static int
-yaml_parser_unroll_indent(yaml_parser_t *parser, int column);
+yaml_parser_unroll_indent(yaml_parser_t *parser, ptrdiff_t column);
/*
* Token fetchers.
@@ -1103,14 +1103,7 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
*/
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. */
+ && parser->indent == (ptrdiff_t)parser->mark.column);
/*
* If the current position may start a simple key, save it.
@@ -1176,6 +1169,11 @@ yaml_parser_increase_flow_level(yaml_parser_t *parser)
/* Increase the flow level. */
+ if (parser->flow_level == INT_MAX) {
+ parser->error = YAML_MEMORY_ERROR;
+ return 0;
+ }
+
parser->flow_level++;
return 1;
@@ -1206,8 +1204,8 @@ yaml_parser_decrease_flow_level(yaml_parser_t *parser)
*/
static int
-yaml_parser_roll_indent(yaml_parser_t *parser, int column,
- int number, yaml_token_type_t type, yaml_mark_t mark)
+yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column,
+ ptrdiff_t number, yaml_token_type_t type, yaml_mark_t mark)
{
yaml_token_t token;
@@ -1226,6 +1224,11 @@ yaml_parser_roll_indent(yaml_parser_t *parser, int column,
if (!PUSH(parser, parser->indents, parser->indent))
return 0;
+ if (column > INT_MAX) {
+ parser->error = YAML_MEMORY_ERROR;
+ return 0;
+ }
+
parser->indent = column;
/* Create a token and insert it into the queue. */
@@ -1254,7 +1257,7 @@ yaml_parser_roll_indent(yaml_parser_t *parser, int column,
static int
-yaml_parser_unroll_indent(yaml_parser_t *parser, int column)
+yaml_parser_unroll_indent(yaml_parser_t *parser, ptrdiff_t column)
{
yaml_token_t token;
@@ -2050,7 +2053,7 @@ yaml_parser_scan_directive(yaml_parser_t *parser, yaml_token_t *token)
else
{
yaml_parser_set_scanner_error(parser, "while scanning a directive",
- start_mark, "found uknown directive name");
+ start_mark, "found unknown directive name");
goto error;
}
@@ -2574,7 +2577,7 @@ yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
/* Resize the string to include the head. */
- while (string.end - string.start <= (int)length) {
+ while ((size_t)(string.end - string.start) <= length) {
if (!yaml_string_extend(&string.start, &string.pointer, &string.end)) {
parser->error = YAML_MEMORY_ERROR;
goto error;
@@ -2619,6 +2622,9 @@ yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
/* Check if it is a URI-escape sequence. */
if (CHECK(parser->buffer, '%')) {
+ if (!STRING_EXTEND(parser, string))
+ goto error;
+
if (!yaml_parser_scan_uri_escapes(parser,
directive, start_mark, &string)) goto error;
}
@@ -3498,7 +3504,7 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
{
if (IS_BLANK(parser->buffer))
{
- /* Check for tab character that abuse indentation. */
+ /* Check for tab characters that abuse indentation. */
if (leading_blanks && (int)parser->mark.column < indent
&& IS_TAB(parser->buffer)) {
diff --git a/ext/psych/yaml/yaml_private.h b/ext/psych/yaml/yaml_private.h
index af10c83973..ce262d3086 100644
--- a/ext/psych/yaml/yaml_private.h
+++ b/ext/psych/yaml/yaml_private.h
@@ -10,6 +10,17 @@
#include <assert.h>
#include <limits.h>
+#include <stddef.h>
+
+#ifndef _MSC_VER
+#include <stdint.h>
+#else
+#ifdef _WIN64
+#define PTRDIFF_MAX _I64_MAX
+#else
+#define PTRDIFF_MAX INT_MAX
+#endif
+#endif
/*
* Memory management.
@@ -135,9 +146,12 @@ yaml_string_join(
(string).start = (string).pointer = (string).end = 0)
#define STRING_EXTEND(context,string) \
- (((string).pointer+5 < (string).end) \
+ ((((string).pointer+5 < (string).end) \
|| yaml_string_extend(&(string).start, \
- &(string).pointer, &(string).end))
+ &(string).pointer, &(string).end)) ? \
+ 1 : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
#define CLEAR(context,string) \
((string).pointer = (string).start, \
@@ -424,6 +438,12 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
#define STACK_EMPTY(context,stack) \
((stack).start == (stack).top)
+#define STACK_LIMIT(context,stack,size) \
+ ((stack).top - (stack).start < (size) ? \
+ 1 : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
#define PUSH(context,stack,value) \
(((stack).top != (stack).end \
|| yaml_stack_extend((void **)&(stack).start, \
@@ -640,4 +660,3 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
(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/depend b/ext/pty/depend
index cfcd3c910e..a1982af215 100644
--- a/ext/pty/depend
+++ b/ext/pty/depend
@@ -1,6 +1,17 @@
-pty.o: pty.c $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h \
- $(hdrdir)/ruby/util.h \
- $(top_srcdir)/internal.h
+# AUTOGENERATED DEPENDENCIES START
+pty.o: $(RUBY_EXTCONF_H)
+pty.o: $(arch_hdrdir)/ruby/config.h
+pty.o: $(hdrdir)/ruby/defines.h
+pty.o: $(hdrdir)/ruby/encoding.h
+pty.o: $(hdrdir)/ruby/intern.h
+pty.o: $(hdrdir)/ruby/io.h
+pty.o: $(hdrdir)/ruby/missing.h
+pty.o: $(hdrdir)/ruby/oniguruma.h
+pty.o: $(hdrdir)/ruby/ruby.h
+pty.o: $(hdrdir)/ruby/st.h
+pty.o: $(hdrdir)/ruby/subst.h
+pty.o: $(hdrdir)/ruby/util.h
+pty.o: $(top_srcdir)/include/ruby.h
+pty.o: $(top_srcdir)/internal.h
+pty.o: pty.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb
index 1db9f6e8aa..b37057f3c9 100644
--- a/ext/pty/extconf.rb
+++ b/ext/pty/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb
index c3f3925be7..122562127d 100644
--- a/ext/pty/lib/expect.rb
+++ b/ext/pty/lib/expect.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$expect_verbose = false
# Expect library adds the IO instance method #expect, which does similar act to
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 4ba1cba621..c8aee4ce38 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -33,10 +33,9 @@
#endif
#include <ctype.h>
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/io.h"
#include "ruby/util.h"
-#include "internal.h"
#include <signal.h>
#ifdef HAVE_SYS_STROPTS_H
@@ -183,7 +182,7 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
carg.execarg_obj = rb_execarg_new(argc, argv, 1);
carg.eargp = rb_execarg_get(carg.execarg_obj);
- rb_execarg_fixup(carg.execarg_obj);
+ rb_execarg_parent_start(carg.execarg_obj);
getDevice(&master, &slave, SlaveName, 0);
@@ -197,12 +196,14 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
int e = errno;
close(master);
close(slave);
+ rb_execarg_parent_end(carg.execarg_obj);
errno = e;
if (status) rb_jump_tag(status);
rb_sys_fail(errbuf[0] ? errbuf : "fork failed");
}
close(slave);
+ rb_execarg_parent_end(carg.execarg_obj);
info->child_pid = pid;
info->fd = master;
@@ -262,7 +263,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
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__) && !defined(_AIX)
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;
@@ -346,7 +347,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
if (no_mesg(slavedevice, nomesg) == -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__) && !defined(_AIX)
if(ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
if(ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
ioctl(slavefd, I_PUSH, "ttcompat");
@@ -504,6 +505,14 @@ pty_close_pty(VALUE assoc)
* +slave_file+:: the slave of the pty, as a File. The path to the
* terminal device is available via +slave_file.path+
*
+ * IO#raw! is usable to disable newline conversions:
+ *
+ * require 'io/console'
+ * PTY.open {|m, s|
+ * s.raw!
+ * ...
+ * }
+ *
*/
static VALUE
pty_open(VALUE klass)
@@ -538,6 +547,11 @@ pty_open(VALUE klass)
static VALUE
pty_detach_process(struct pty_info *info)
{
+#ifdef WNOHANG
+ int st;
+ if (rb_waitpid(info->child_pid, &st, WNOHANG) <= 0)
+ return Qnil;
+#endif
rb_detach_process(info->child_pid);
return Qnil;
}
@@ -565,7 +579,7 @@ pty_detach_process(struct pty_info *info)
*
* In the block form these same values will be yielded to the block:
*
- * +r+:: A readable IO that that contains the command's
+ * +r+:: A readable IO that contains the command's
* standard output and standard error
* +w+:: A writable IO that is the command's standard input
* +pid+:: The process identifier for the command.
@@ -585,11 +599,11 @@ pty_getpty(int argc, VALUE *argv, VALUE self)
establishShell(argc, argv, &info, SlaveName);
- rfptr->mode = rb_io_mode_flags("r");
+ rfptr->mode = rb_io_modestr_fmode("r");
rfptr->fd = info.fd;
rfptr->pathv = rb_obj_freeze(rb_str_new_cstr(SlaveName));
- wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC;
+ wfptr->mode = rb_io_modestr_fmode("w") | FMODE_SYNC;
wfptr->fd = rb_cloexec_dup(info.fd);
if (wfptr->fd == -1)
rb_sys_fail("dup()");
@@ -613,7 +627,7 @@ static void
raise_from_check(rb_pid_t pid, int status)
{
const char *state;
- char buf[1024];
+ VALUE msg;
VALUE exc;
#if defined(WIFSTOPPED)
@@ -631,8 +645,8 @@ raise_from_check(rb_pid_t pid, int status)
else {
state = "exited";
}
- snprintf(buf, sizeof(buf), "pty - %s: %ld", state, (long)pid);
- exc = rb_exc_new2(eChildExited, buf);
+ msg = rb_sprintf("pty - %s: %ld", state, (long)pid);
+ exc = rb_exc_new_str(eChildExited, msg);
rb_iv_set(exc, "status", rb_last_status_get());
rb_exc_raise(exc);
}
@@ -719,7 +733,7 @@ static VALUE cPTY;
* # The result of read operation when pty slave is closed is platform
* # dependent.
* ret = begin
- * m.gets # FreeBSD returns nil.
+ * master.gets # FreeBSD returns nil.
* rescue Errno::EIO # GNU/Linux raises EIO.
* nil
* end
@@ -740,10 +754,10 @@ static VALUE cPTY;
*/
void
-Init_pty()
+Init_pty(void)
{
cPTY = rb_define_module("PTY");
- /* :nodoc */
+ /* :nodoc: */
rb_define_module_function(cPTY,"getpty",pty_getpty,-1);
rb_define_module_function(cPTY,"spawn",pty_getpty,-1);
rb_define_singleton_method(cPTY,"check",pty_check,-1);
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index 9bb40e7483..b4429ed5f3 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -200,6 +200,7 @@ static VALUE assert_hash _((VALUE h));
static VALUE initialize_params _((VALUE vparams, VALUE parser, VALUE arg,
VALUE lexer, VALUE lexmid));
static void cparse_params_mark _((void *ptr));
+static size_t cparse_params_memsize _((const void *ptr));
static void parse_main _((struct cparse_params *v,
VALUE tok, VALUE val, int resume));
@@ -217,31 +218,48 @@ static VALUE reduce0 _((VALUE block_args, VALUE data, VALUE self));
# define D_printf(fmt,arg)
#endif
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 1
+
+static const rb_data_type_t cparse_params_type = {
+ "racc/cparse",
+ {
+ cparse_params_mark,
+ RUBY_TYPED_DEFAULT_FREE,
+ cparse_params_memsize,
+ },
+#ifdef RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+#endif
+};
+
static VALUE
racc_cparse(VALUE parser, VALUE arg, VALUE sysdebug)
{
- volatile VALUE vparams;
+ VALUE vparams;
struct cparse_params *v;
- vparams = Data_Make_Struct(CparseParams, struct cparse_params,
- cparse_params_mark, -1, v);
+ vparams = TypedData_Make_Struct(CparseParams, struct cparse_params,
+ &cparse_params_type, v);
D_puts("starting cparse");
v->sys_debug = RTEST(sysdebug);
vparams = initialize_params(vparams, parser, arg, Qnil, Qnil);
v->lex_is_iterator = FALSE;
parse_main(v, Qnil, Qnil, 0);
+ RB_GC_GUARD(vparams);
return v->retval;
}
static VALUE
racc_yyparse(VALUE parser, VALUE lexer, VALUE lexmid, VALUE arg, VALUE sysdebug)
{
- volatile VALUE vparams;
+ VALUE vparams;
struct cparse_params *v;
- vparams = Data_Make_Struct(CparseParams, struct cparse_params,
- cparse_params_mark, -1, v);
+ vparams = TypedData_Make_Struct(CparseParams, struct cparse_params,
+ &cparse_params_type, v);
v->sys_debug = RTEST(sysdebug);
D_puts("start C yyparse");
vparams = initialize_params(vparams, parser, arg, lexer, lexmid);
@@ -254,6 +272,7 @@ racc_yyparse(VALUE parser, VALUE lexer, VALUE lexmid, VALUE arg, VALUE sysdebug)
rb_id2name(v->lexmid));
}
+ RB_GC_GUARD(vparams);
return v->retval;
}
@@ -267,9 +286,8 @@ call_lexer(struct cparse_params *v)
static VALUE
lexer_iter(VALUE data)
{
- struct cparse_params *v;
+ struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
- Data_Get_Struct(data, struct cparse_params, v);
rb_funcall(v->lexer, v->lexmid, 0);
return Qnil;
}
@@ -284,10 +302,9 @@ call_lexer(struct cparse_params *v)
static VALUE
lexer_i(RB_BLOCK_CALL_FUNC_ARGLIST(block_args, data))
{
- struct cparse_params *v;
+ struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
VALUE tok, val;
- Data_Get_Struct(data, struct cparse_params, v);
if (v->fin)
rb_raise(rb_eArgError, "extra token after EndOfToken");
extract_user_token(v, block_args, &tok, &val);
@@ -320,9 +337,8 @@ assert_integer(VALUE n)
static VALUE
initialize_params(VALUE vparams, VALUE parser, VALUE arg, VALUE lexer, VALUE lexmid)
{
- struct cparse_params *v;
+ struct cparse_params *v = rb_check_typeddata(vparams, &cparse_params_type);
- Data_Get_Struct(vparams, struct cparse_params, v);
v->value_v = vparams;
v->parser = parser;
v->lexer = lexer;
@@ -405,6 +421,12 @@ cparse_params_mark(void *ptr)
rb_gc_mark(v->retval);
}
+static size_t
+cparse_params_memsize(const void *ptr)
+{
+ return sizeof(struct cparse_params);
+}
+
static void
extract_user_token(struct cparse_params *v, VALUE block_args,
VALUE *tok, VALUE *val)
@@ -418,10 +440,10 @@ extract_user_token(struct cparse_params *v, VALUE block_args,
if (!RB_TYPE_P(block_args, T_ARRAY)) {
rb_raise(rb_eTypeError,
- "%s() %s %s (must be Array[2])",
+ "%s() %s %"PRIsVALUE" (must be Array[2])",
v->lex_is_iterator ? rb_id2name(v->lexmid) : "next_token",
v->lex_is_iterator ? "yielded" : "returned",
- rb_class2name(CLASS_OF(block_args)));
+ rb_obj_class(block_args));
}
if (RARRAY_LEN(block_args) != 2) {
rb_raise(rb_eArgError,
@@ -684,7 +706,7 @@ reduce(struct cparse_params *v, long act)
static VALUE
reduce0(VALUE val, VALUE data, VALUE self)
{
- struct cparse_params *v;
+ struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
VALUE reduce_to, reduce_len, method_id;
long len;
ID mid;
@@ -692,7 +714,6 @@ reduce0(VALUE val, VALUE data, VALUE self)
long i, k1, k2;
VALUE goto_state;
- Data_Get_Struct(data, struct cparse_params, v);
reduce_len = rb_ary_entry(v->reduce_table, v->ruleno);
reduce_to = rb_ary_entry(v->reduce_table, v->ruleno+1);
method_id = rb_ary_entry(v->reduce_table, v->ruleno+2);
@@ -794,6 +815,8 @@ reduce0(VALUE val, VALUE data, VALUE self)
void
Init_cparse(void)
{
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
VALUE Racc, Parser;
ID id_racc = rb_intern("Racc");
@@ -813,6 +836,9 @@ Init_cparse(void)
rb_str_new2("$originalId: cparse.c,v 1.8 2006/07/06 11:39:46 aamine Exp $"));
CparseParams = rb_define_class_under(Racc, "CparseParams", rb_cObject);
+ rb_undef_alloc_func(CparseParams);
+ rb_undef_method(CparseParams, "initialize");
+ rb_undef_method(CparseParams, "initialize_copy");
RaccBug = rb_eRuntimeError;
diff --git a/ext/racc/cparse/extconf.rb b/ext/racc/cparse/extconf.rb
index 3710f6f7e7..dfddf57111 100644
--- a/ext/racc/cparse/extconf.rb
+++ b/ext/racc/cparse/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# $Id$
require 'mkmf'
diff --git a/ext/rbconfig/sizeof/depend b/ext/rbconfig/sizeof/depend
index 360b3386d3..56564b1b99 100644
--- a/ext/rbconfig/sizeof/depend
+++ b/ext/rbconfig/sizeof/depend
@@ -1,3 +1,17 @@
-sizes.c: $(top_srcdir)/tool/generic_erb.rb $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in
+sizes.c: $(top_srcdir)/tool/generic_erb.rb $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in $(top_srcdir)/ext/rbconfig/sizeof/extconf.rb
$(Q) $(RUBY) $(top_srcdir)/tool/generic_erb.rb --output=$@ \
- $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in
+ $(top_srcdir)/template/sizes.c.tmpl \
+ $(top_srcdir)/configure.in \
+ $(top_srcdir)/ext/rbconfig/sizeof/extconf.rb
+
+# AUTOGENERATED DEPENDENCIES START
+sizes.o: $(RUBY_EXTCONF_H)
+sizes.o: $(arch_hdrdir)/ruby/config.h
+sizes.o: $(hdrdir)/ruby/defines.h
+sizes.o: $(hdrdir)/ruby/intern.h
+sizes.o: $(hdrdir)/ruby/missing.h
+sizes.o: $(hdrdir)/ruby/ruby.h
+sizes.o: $(hdrdir)/ruby/st.h
+sizes.o: $(hdrdir)/ruby/subst.h
+sizes.o: {$(VPATH)}sizes.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/rbconfig/sizeof/extconf.rb b/ext/rbconfig/sizeof/extconf.rb
index 619b4256f8..b7cc876e7e 100644
--- a/ext/rbconfig/sizeof/extconf.rb
+++ b/ext/rbconfig/sizeof/extconf.rb
@@ -1,2 +1,36 @@
+# frozen_string_literal: false
$srcs = %w[sizes.c]
+$distcleanfiles.concat($srcs)
+
+check_sizeof('int_least8_t')
+check_sizeof('int_least16_t')
+check_sizeof('int_least32_t')
+check_sizeof('int_least64_t')
+check_sizeof('int_fast8_t')
+check_sizeof('int_fast16_t')
+check_sizeof('int_fast32_t')
+check_sizeof('int_fast64_t')
+check_sizeof('intmax_t')
+check_sizeof('sig_atomic_t', %w[signal.h])
+check_sizeof('wchar_t')
+check_sizeof('wint_t', %w[wctype.h])
+check_sizeof('wctrans_t', %w[wctype.h])
+check_sizeof('wctype_t', %w[wctype.h])
+check_sizeof('_Bool')
+check_sizeof('long double')
+check_sizeof('float _Complex')
+check_sizeof('double _Complex')
+check_sizeof('long double _Complex')
+check_sizeof('float _Imaginary')
+check_sizeof('double _Imaginary')
+check_sizeof('long double _Imaginary')
+check_sizeof('__int128') # x86_64 ABI (optional)
+check_sizeof('__float128') # x86_64 ABI (optional)
+check_sizeof('_Decimal32') # x86_64 ABI
+check_sizeof('_Decimal64') # x86_64 ABI
+check_sizeof('_Decimal128') # x86_64 ABI
+check_sizeof('__m64') # x86_64 ABI (optional)
+check_sizeof('__m128') # x86_64 ABI (optional)
+check_sizeof('__float80') # gcc x86
+
create_makefile('rbconfig/sizeof')
diff --git a/ext/readline/depend b/ext/readline/depend
index ef0414d9b2..26777f2816 100644
--- a/ext/readline/depend
+++ b/ext/readline/depend
@@ -1,5 +1,17 @@
-readline.o: readline.c $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h \
- $(hdrdir)/ruby/thread.h
+# AUTOGENERATED DEPENDENCIES START
+readline.o: $(RUBY_EXTCONF_H)
+readline.o: $(arch_hdrdir)/ruby/config.h
+readline.o: $(hdrdir)/ruby/defines.h
+readline.o: $(hdrdir)/ruby/encoding.h
+readline.o: $(hdrdir)/ruby/intern.h
+readline.o: $(hdrdir)/ruby/io.h
+readline.o: $(hdrdir)/ruby/missing.h
+readline.o: $(hdrdir)/ruby/oniguruma.h
+readline.o: $(hdrdir)/ruby/ruby.h
+readline.o: $(hdrdir)/ruby/st.h
+readline.o: $(hdrdir)/ruby/subst.h
+readline.o: $(hdrdir)/ruby/thread.h
+readline.o: $(top_srcdir)/include/ruby.h
+readline.o: $(top_srcdir)/internal.h
+readline.o: readline.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 0b121c1ebe..776ab19ba8 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require "mkmf"
readline = Struct.new(:headers, :extra_check).new(["stdio.h"])
@@ -19,6 +20,10 @@ def readline.have_func(func)
return super(func, headers)
end
+def readline.have_type(type)
+ return super(type, headers)
+end
+
dir_config('curses')
dir_config('ncurses')
dir_config('termcap')
@@ -33,6 +38,7 @@ have_library("ncurses", "tgetnum") ||
case enable_libedit
when true
# --enable-libedit
+ dir_config("libedit")
unless (readline.have_header("editline/readline.h") ||
readline.have_header("readline/readline.h")) &&
have_library("edit", "readline")
@@ -94,4 +100,12 @@ readline.have_func("clear_history")
readline.have_func("rl_redisplay")
readline.have_func("rl_insert_text")
readline.have_func("rl_delete_text")
+unless readline.have_type("rl_hook_func_t*")
+ # rl_hook_func_t is available since readline-4.2 (2001).
+ # Function is removed at readline-6.3 (2014).
+ # However, editline (NetBSD 6.1.3, 2014) doesn't have rl_hook_func_t.
+ $defs << "-Drl_hook_func_t=Function"
+end
+
+$INCFLAGS << " -I$(top_srcdir)"
create_makefile("readline")
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 820c6b74be..c3b98a8dc9 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -33,7 +33,7 @@
#include <editline/readline.h>
#endif
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/io.h"
#include "ruby/thread.h"
@@ -229,8 +229,7 @@ readline_getc(FILE *input)
goto again;
rb_sys_fail("rb_wait_for_single_fd");
}
- errno = data.err;
- rb_sys_fail("read");
+ rb_syserr_fail(data.err, "read");
}
return data.ret;
}
@@ -359,6 +358,34 @@ clear_rl_outstream(void)
readline_outstream = Qfalse;
}
+static void
+prepare_readline(void)
+{
+ static int initialized = 0;
+ if (!initialized) {
+ rl_initialize();
+ initialized = 1;
+ }
+
+ if (readline_instream) {
+ rb_io_t *ifp;
+ rb_io_check_initialized(ifp = RFILE(rb_io_taint_check(readline_instream))->fptr);
+ if (ifp->fd < 0) {
+ clear_rl_instream();
+ rb_raise(rb_eIOError, "closed readline input");
+ }
+ }
+
+ if (readline_outstream) {
+ rb_io_t *ofp;
+ rb_io_check_initialized(ofp = RFILE(rb_io_taint_check(readline_outstream))->fptr);
+ if (ofp->fd < 0) {
+ clear_rl_outstream();
+ rb_raise(rb_eIOError, "closed readline output");
+ }
+ }
+}
+
/*
* call-seq:
* Readline.readline(prompt = "", add_hist = false) -> string or nil
@@ -460,23 +487,7 @@ readline_readline(int argc, VALUE *argv, VALUE self)
prompt = RSTRING_PTR(tmp);
}
- if (readline_instream) {
- rb_io_t *ifp;
- rb_io_check_initialized(ifp = RFILE(rb_io_taint_check(readline_instream))->fptr);
- if (ifp->fd < 0) {
- clear_rl_instream();
- rb_raise(rb_eIOError, "closed readline input");
- }
- }
-
- if (readline_outstream) {
- rb_io_t *ofp;
- rb_io_check_initialized(ofp = RFILE(rb_io_taint_check(readline_outstream))->fptr);
- if (ofp->fd < 0) {
- clear_rl_outstream();
- rb_raise(rb_eIOError, "closed readline output");
- }
- }
+ prepare_readline();
#ifdef _WIN32
rl_prep_terminal(1);
@@ -545,8 +556,7 @@ readline_s_set_input(VALUE self, VALUE input)
if (f == NULL) {
int save_errno = errno;
close(fd);
- errno = save_errno;
- rb_sys_fail("fdopen");
+ rb_syserr_fail(save_errno, "fdopen");
}
rl_instream = readline_rl_instream = f;
readline_instream = input;
@@ -582,8 +592,7 @@ readline_s_set_output(VALUE self, VALUE output)
if (f == NULL) {
int save_errno = errno;
close(fd);
- errno = save_errno;
- rb_sys_fail("fdopen");
+ rb_syserr_fail(save_errno, "fdopen");
}
rl_outstream = readline_rl_outstream = f;
readline_outstream = output;
@@ -688,12 +697,7 @@ readline_s_delete_text(int argc, VALUE *argv, VALUE self)
char *p, *ptr = rl_line_buffer;
long beg = 0, len = strlen(rl_line_buffer);
struct RString fakestr;
- VALUE str = (VALUE)&fakestr;
-
- fakestr.basic.flags = T_STRING | RSTRING_NOEMBED;
- fakestr.as.heap.ptr = ptr;
- fakestr.as.heap.len = len;
- rb_enc_associate(str, rb_locale_encoding());
+ VALUE str = rb_setup_fake_str(&fakestr, ptr, len, rb_locale_encoding());
OBJ_FREEZE(str);
if (argc == 2) {
beg = NUM2LONG(argv[0]);
@@ -959,7 +963,7 @@ readline_attempted_completion_function(const char *text, int start, int end)
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]);
+ temp = rb_obj_as_string(RARRAY_AREF(ary, i));
StringValueCStr(temp); /* must be NUL-terminated */
rb_enc_check(encobj, temp);
result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1);
@@ -1554,6 +1558,7 @@ readline_s_get_filename_quote_characters(VALUE self, VALUE str)
static VALUE
readline_s_refresh_line(VALUE self)
{
+ prepare_readline();
rl_refresh_line(0, 0);
return Qnil;
}
@@ -1790,7 +1795,7 @@ username_completion_proc_call(VALUE self, VALUE str)
}
void
-Init_readline()
+Init_readline(void)
{
VALUE history, fcomp, ucomp, version;
@@ -1974,7 +1979,7 @@ Init_readline()
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;
diff --git a/ext/ripper/depend b/ext/ripper/depend
index db7bea74ed..64236cd592 100644
--- a/ext/ripper/depend
+++ b/ext/ripper/depend
@@ -7,19 +7,7 @@ BISON = bison
src: ripper.c eventids1.c eventids2table.c
-ripper.o: ripper.c id.c lex.c eventids1.c eventids2.c eventids2table.c \
- $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h \
- $(hdrdir)/ruby/regex.h \
- $(hdrdir)/ruby/util.h \
- $(top_srcdir)/node.h \
- $(top_srcdir)/internal.h \
- {$(VPATH)}parse.h \
- {$(VPATH)}id.h \
- $(top_srcdir)/regenc.h \
- $(top_srcdir)/vm_opts.h \
- $(topdir)/probes.h
+ripper.o: ripper.c
.y.c:
$(ECHO) compiling compiler $<
@@ -54,3 +42,34 @@ preproc: ripper.E
ripper.E: ripper.c
$(ECHO) preprocessing ripper.c
$(Q) $(CC) -E $(CPPFLAGS) ripper.c | $(RUBY) $(srcdir)/tools/strip.rb > $@
+
+# AUTOGENERATED DEPENDENCIES START
+ripper.o: $(RUBY_EXTCONF_H)
+ripper.o: $(arch_hdrdir)/ruby/config.h
+ripper.o: $(hdrdir)/ruby/defines.h
+ripper.o: $(hdrdir)/ruby/encoding.h
+ripper.o: $(hdrdir)/ruby/intern.h
+ripper.o: $(hdrdir)/ruby/io.h
+ripper.o: $(hdrdir)/ruby/missing.h
+ripper.o: $(hdrdir)/ruby/oniguruma.h
+ripper.o: $(hdrdir)/ruby/regex.h
+ripper.o: $(hdrdir)/ruby/ruby.h
+ripper.o: $(hdrdir)/ruby/st.h
+ripper.o: $(hdrdir)/ruby/subst.h
+ripper.o: $(hdrdir)/ruby/util.h
+ripper.o: $(top_srcdir)/include/ruby.h
+ripper.o: $(top_srcdir)/internal.h
+ripper.o: $(top_srcdir)/node.h
+ripper.o: $(top_srcdir)/regenc.h
+ripper.o: $(top_srcdir)/symbol.h
+ripper.o: $(top_srcdir)/vm_opts.h
+ripper.o: ../../probes.h
+ripper.o: eventids2.c
+ripper.o: ripper.y
+ripper.o: {$(VPATH)}eventids1.c
+ripper.o: {$(VPATH)}eventids2table.c
+ripper.o: {$(VPATH)}id.h
+ripper.o: {$(VPATH)}lex.c
+ripper.o: {$(VPATH)}parse.h
+ripper.o: {$(VPATH)}ripper.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
index 423f9d7e29..04a40e0da7 100644
--- a/ext/ripper/eventids2.c
+++ b/ext/ripper/eventids2.c
@@ -8,284 +8,297 @@
#define tHEREDOC_END (tLAST_TOKEN + 8)
#define k__END__ (tLAST_TOKEN + 9)
-static ID ripper_id_backref;
-static ID ripper_id_backtick;
-static ID ripper_id_comma;
-static ID ripper_id_const;
-static ID ripper_id_cvar;
-static ID ripper_id_embexpr_beg;
-static ID ripper_id_embexpr_end;
-static ID ripper_id_embvar;
-static ID ripper_id_float;
-static ID ripper_id_gvar;
-static ID ripper_id_ident;
-static ID ripper_id_imaginary;
-static ID ripper_id_int;
-static ID ripper_id_ivar;
-static ID ripper_id_kw;
-static ID ripper_id_lbrace;
-static ID ripper_id_lbracket;
-static ID ripper_id_lparen;
-static ID ripper_id_nl;
-static ID ripper_id_op;
-static ID ripper_id_period;
-static ID ripper_id_rbrace;
-static ID ripper_id_rbracket;
-static ID ripper_id_rparen;
-static ID ripper_id_semicolon;
-static ID ripper_id_symbeg;
-static ID ripper_id_tstring_beg;
-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_rational;
-static ID ripper_id_regexp_beg;
-static ID ripper_id_regexp_end;
-static ID ripper_id_label;
-static ID ripper_id_tlambda;
-static ID ripper_id_tlambeg;
+typedef struct {
+ ID ripper_id_backref;
+ ID ripper_id_backtick;
+ ID ripper_id_comma;
+ ID ripper_id_const;
+ ID ripper_id_cvar;
+ ID ripper_id_embexpr_beg;
+ ID ripper_id_embexpr_end;
+ ID ripper_id_embvar;
+ ID ripper_id_float;
+ ID ripper_id_gvar;
+ ID ripper_id_ident;
+ ID ripper_id_imaginary;
+ ID ripper_id_int;
+ ID ripper_id_ivar;
+ ID ripper_id_kw;
+ ID ripper_id_lbrace;
+ ID ripper_id_lbracket;
+ ID ripper_id_lparen;
+ ID ripper_id_nl;
+ ID ripper_id_op;
+ ID ripper_id_period;
+ ID ripper_id_rbrace;
+ ID ripper_id_rbracket;
+ ID ripper_id_rparen;
+ ID ripper_id_semicolon;
+ ID ripper_id_symbeg;
+ ID ripper_id_tstring_beg;
+ ID ripper_id_tstring_content;
+ ID ripper_id_tstring_end;
+ ID ripper_id_words_beg;
+ ID ripper_id_qwords_beg;
+ ID ripper_id_qsymbols_beg;
+ ID ripper_id_symbols_beg;
+ ID ripper_id_words_sep;
+ ID ripper_id_rational;
+ ID ripper_id_regexp_beg;
+ ID ripper_id_regexp_end;
+ ID ripper_id_label;
+ ID ripper_id_label_end;
+ ID ripper_id_tlambda;
+ ID ripper_id_tlambeg;
-static ID ripper_id_ignored_nl;
-static ID ripper_id_comment;
-static ID ripper_id_embdoc_beg;
-static ID ripper_id_embdoc;
-static ID ripper_id_embdoc_end;
-static ID ripper_id_sp;
-static ID ripper_id_heredoc_beg;
-static ID ripper_id_heredoc_end;
-static ID ripper_id___end__;
-static ID ripper_id_CHAR;
+ ID ripper_id_ignored_nl;
+ ID ripper_id_comment;
+ ID ripper_id_embdoc_beg;
+ ID ripper_id_embdoc;
+ ID ripper_id_embdoc_end;
+ ID ripper_id_sp;
+ ID ripper_id_heredoc_beg;
+ ID ripper_id_heredoc_end;
+ ID ripper_id___end__;
+ ID ripper_id_CHAR;
+} ripper_scanner_ids_t;
+
+static ripper_scanner_ids_t ripper_scanner_ids;
#include "eventids2table.c"
static void
ripper_init_eventids2(void)
{
- ripper_id_backref = rb_intern_const("on_backref");
- ripper_id_backtick = rb_intern_const("on_backtick");
- ripper_id_comma = rb_intern_const("on_comma");
- ripper_id_const = rb_intern_const("on_const");
- ripper_id_cvar = rb_intern_const("on_cvar");
- ripper_id_embexpr_beg = rb_intern_const("on_embexpr_beg");
- ripper_id_embexpr_end = rb_intern_const("on_embexpr_end");
- ripper_id_embvar = rb_intern_const("on_embvar");
- ripper_id_float = rb_intern_const("on_float");
- ripper_id_gvar = rb_intern_const("on_gvar");
- ripper_id_ident = rb_intern_const("on_ident");
- ripper_id_imaginary = rb_intern_const("on_imaginary");
- ripper_id_int = rb_intern_const("on_int");
- ripper_id_ivar = rb_intern_const("on_ivar");
- ripper_id_kw = rb_intern_const("on_kw");
- ripper_id_lbrace = rb_intern_const("on_lbrace");
- ripper_id_lbracket = rb_intern_const("on_lbracket");
- ripper_id_lparen = rb_intern_const("on_lparen");
- ripper_id_nl = rb_intern_const("on_nl");
- ripper_id_op = rb_intern_const("on_op");
- ripper_id_period = rb_intern_const("on_period");
- ripper_id_rbrace = rb_intern_const("on_rbrace");
- ripper_id_rbracket = rb_intern_const("on_rbracket");
- ripper_id_rparen = rb_intern_const("on_rparen");
- ripper_id_semicolon = rb_intern_const("on_semicolon");
- ripper_id_symbeg = rb_intern_const("on_symbeg");
- ripper_id_tstring_beg = rb_intern_const("on_tstring_beg");
- ripper_id_tstring_content = rb_intern_const("on_tstring_content");
- 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_rational = rb_intern_const("on_rational");
- ripper_id_regexp_beg = rb_intern_const("on_regexp_beg");
- ripper_id_regexp_end = rb_intern_const("on_regexp_end");
- ripper_id_label = rb_intern_const("on_label");
- ripper_id_tlambda = rb_intern_const("on_tlambda");
- ripper_id_tlambeg = rb_intern_const("on_tlambeg");
+#define set_id2(name) ripper_scanner_ids.ripper_id_##name = rb_intern_const("on_"#name)
+ set_id2(backref);
+ set_id2(backtick);
+ set_id2(comma);
+ set_id2(const);
+ set_id2(cvar);
+ set_id2(embexpr_beg);
+ set_id2(embexpr_end);
+ set_id2(embvar);
+ set_id2(float);
+ set_id2(gvar);
+ set_id2(ident);
+ set_id2(imaginary);
+ set_id2(int);
+ set_id2(ivar);
+ set_id2(kw);
+ set_id2(lbrace);
+ set_id2(lbracket);
+ set_id2(lparen);
+ set_id2(nl);
+ set_id2(op);
+ set_id2(period);
+ set_id2(rbrace);
+ set_id2(rbracket);
+ set_id2(rparen);
+ set_id2(semicolon);
+ set_id2(symbeg);
+ set_id2(tstring_beg);
+ set_id2(tstring_content);
+ set_id2(tstring_end);
+ set_id2(words_beg);
+ set_id2(qwords_beg);
+ set_id2(qsymbols_beg);
+ set_id2(symbols_beg);
+ set_id2(words_sep);
+ set_id2(rational);
+ set_id2(regexp_beg);
+ set_id2(regexp_end);
+ set_id2(label);
+ set_id2(label_end);
+ set_id2(tlambda);
+ set_id2(tlambeg);
- ripper_id_ignored_nl = rb_intern_const("on_ignored_nl");
- ripper_id_comment = rb_intern_const("on_comment");
- ripper_id_embdoc_beg = rb_intern_const("on_embdoc_beg");
- ripper_id_embdoc = rb_intern_const("on_embdoc");
- ripper_id_embdoc_end = rb_intern_const("on_embdoc_end");
- ripper_id_sp = rb_intern_const("on_sp");
- ripper_id_heredoc_beg = rb_intern_const("on_heredoc_beg");
- 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");
+ set_id2(ignored_nl);
+ set_id2(comment);
+ set_id2(embdoc_beg);
+ set_id2(embdoc);
+ set_id2(embdoc_end);
+ set_id2(sp);
+ set_id2(heredoc_beg);
+ set_id2(heredoc_end);
+ set_id2(__end__);
+ set_id2(CHAR);
}
+STATIC_ASSERT(k__END___range, k__END__ < SHRT_MAX);
+STATIC_ASSERT(ripper_scanner_ids_size, sizeof(ripper_scanner_ids) < SHRT_MAX);
+#define O(member) (int)offsetof(ripper_scanner_ids_t, ripper_id_##member)
+
static const struct token_assoc {
- int token;
- ID *id;
+ unsigned short token;
+ unsigned short id_offset;
} token_to_eventid[] = {
- {' ', &ripper_id_words_sep},
- {'!', &ripper_id_op},
- {'%', &ripper_id_op},
- {'&', &ripper_id_op},
- {'*', &ripper_id_op},
- {'+', &ripper_id_op},
- {'-', &ripper_id_op},
- {'/', &ripper_id_op},
- {'<', &ripper_id_op},
- {'=', &ripper_id_op},
- {'>', &ripper_id_op},
- {'?', &ripper_id_op},
- {'^', &ripper_id_op},
- {'|', &ripper_id_op},
- {'~', &ripper_id_op},
- {':', &ripper_id_op},
- {',', &ripper_id_comma},
- {'.', &ripper_id_period},
- {';', &ripper_id_semicolon},
- {'`', &ripper_id_backtick},
- {'\n', &ripper_id_nl},
- {keyword_alias, &ripper_id_kw},
- {keyword_and, &ripper_id_kw},
- {keyword_begin, &ripper_id_kw},
- {keyword_break, &ripper_id_kw},
- {keyword_case, &ripper_id_kw},
- {keyword_class, &ripper_id_kw},
- {keyword_def, &ripper_id_kw},
- {keyword_defined, &ripper_id_kw},
- {keyword_do, &ripper_id_kw},
- {keyword_do_block, &ripper_id_kw},
- {keyword_do_cond, &ripper_id_kw},
- {keyword_else, &ripper_id_kw},
- {keyword_elsif, &ripper_id_kw},
- {keyword_end, &ripper_id_kw},
- {keyword_ensure, &ripper_id_kw},
- {keyword_false, &ripper_id_kw},
- {keyword_for, &ripper_id_kw},
- {keyword_if, &ripper_id_kw},
- {modifier_if, &ripper_id_kw},
- {keyword_in, &ripper_id_kw},
- {keyword_module, &ripper_id_kw},
- {keyword_next, &ripper_id_kw},
- {keyword_nil, &ripper_id_kw},
- {keyword_not, &ripper_id_kw},
- {keyword_or, &ripper_id_kw},
- {keyword_redo, &ripper_id_kw},
- {keyword_rescue, &ripper_id_kw},
- {modifier_rescue, &ripper_id_kw},
- {keyword_retry, &ripper_id_kw},
- {keyword_return, &ripper_id_kw},
- {keyword_self, &ripper_id_kw},
- {keyword_super, &ripper_id_kw},
- {keyword_then, &ripper_id_kw},
- {keyword_true, &ripper_id_kw},
- {keyword_undef, &ripper_id_kw},
- {keyword_unless, &ripper_id_kw},
- {modifier_unless, &ripper_id_kw},
- {keyword_until, &ripper_id_kw},
- {modifier_until, &ripper_id_kw},
- {keyword_when, &ripper_id_kw},
- {keyword_while, &ripper_id_kw},
- {modifier_while, &ripper_id_kw},
- {keyword_yield, &ripper_id_kw},
- {keyword__FILE__, &ripper_id_kw},
- {keyword__LINE__, &ripper_id_kw},
- {keyword__ENCODING__, &ripper_id_kw},
- {keyword_BEGIN, &ripper_id_kw},
- {keyword_END, &ripper_id_kw},
- {keyword_do_LAMBDA, &ripper_id_kw},
- {tAMPER, &ripper_id_op},
- {tANDOP, &ripper_id_op},
- {tAREF, &ripper_id_op},
- {tASET, &ripper_id_op},
- {tASSOC, &ripper_id_op},
- {tBACK_REF, &ripper_id_backref},
- {tCHAR, &ripper_id_CHAR},
- {tCMP, &ripper_id_op},
- {tCOLON2, &ripper_id_op},
- {tCOLON3, &ripper_id_op},
- {tCONSTANT, &ripper_id_const},
- {tCVAR, &ripper_id_cvar},
- {tDOT2, &ripper_id_op},
- {tDOT3, &ripper_id_op},
- {tEQ, &ripper_id_op},
- {tEQQ, &ripper_id_op},
- {tFID, &ripper_id_ident},
- {tFLOAT, &ripper_id_float},
- {tGEQ, &ripper_id_op},
- {tGVAR, &ripper_id_gvar},
- {tIDENTIFIER, &ripper_id_ident},
- {tIMAGINARY, &ripper_id_imaginary},
- {tINTEGER, &ripper_id_int},
- {tIVAR, &ripper_id_ivar},
- {tLBRACE, &ripper_id_lbrace},
- {tLBRACE_ARG, &ripper_id_lbrace},
- {'{', &ripper_id_lbrace},
- {'}', &ripper_id_rbrace},
- {tLBRACK, &ripper_id_lbracket},
- {'[', &ripper_id_lbracket},
- {']', &ripper_id_rbracket},
- {tLEQ, &ripper_id_op},
- {tLPAREN, &ripper_id_lparen},
- {tLPAREN_ARG, &ripper_id_lparen},
- {'(', &ripper_id_lparen},
- {')', &ripper_id_rparen},
- {tLSHFT, &ripper_id_op},
- {tMATCH, &ripper_id_op},
- {tNEQ, &ripper_id_op},
- {tNMATCH, &ripper_id_op},
- {tNTH_REF, &ripper_id_backref},
- {tOP_ASGN, &ripper_id_op},
- {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},
- {tRATIONAL, &ripper_id_rational},
- {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},
- {tUMINUS, &ripper_id_op},
- {tUMINUS_NUM, &ripper_id_op},
- {tUPLUS, &ripper_id_op},
- {tWORDS_BEG, &ripper_id_words_beg},
- {tXSTRING_BEG, &ripper_id_backtick},
- {tLABEL, &ripper_id_label},
- {tLAMBDA, &ripper_id_tlambda},
- {tLAMBEG, &ripper_id_tlambeg},
+ {' ', O(words_sep)},
+ {'!', O(op)},
+ {'%', O(op)},
+ {'&', O(op)},
+ {'*', O(op)},
+ {'+', O(op)},
+ {'-', O(op)},
+ {'/', O(op)},
+ {'<', O(op)},
+ {'=', O(op)},
+ {'>', O(op)},
+ {'?', O(op)},
+ {'^', O(op)},
+ {'|', O(op)},
+ {'~', O(op)},
+ {':', O(op)},
+ {',', O(comma)},
+ {'.', O(period)},
+ {';', O(semicolon)},
+ {'`', O(backtick)},
+ {'\n', O(nl)},
+ {keyword_alias, O(kw)},
+ {keyword_and, O(kw)},
+ {keyword_begin, O(kw)},
+ {keyword_break, O(kw)},
+ {keyword_case, O(kw)},
+ {keyword_class, O(kw)},
+ {keyword_def, O(kw)},
+ {keyword_defined, O(kw)},
+ {keyword_do, O(kw)},
+ {keyword_do_block, O(kw)},
+ {keyword_do_cond, O(kw)},
+ {keyword_else, O(kw)},
+ {keyword_elsif, O(kw)},
+ {keyword_end, O(kw)},
+ {keyword_ensure, O(kw)},
+ {keyword_false, O(kw)},
+ {keyword_for, O(kw)},
+ {keyword_if, O(kw)},
+ {modifier_if, O(kw)},
+ {keyword_in, O(kw)},
+ {keyword_module, O(kw)},
+ {keyword_next, O(kw)},
+ {keyword_nil, O(kw)},
+ {keyword_not, O(kw)},
+ {keyword_or, O(kw)},
+ {keyword_redo, O(kw)},
+ {keyword_rescue, O(kw)},
+ {modifier_rescue, O(kw)},
+ {keyword_retry, O(kw)},
+ {keyword_return, O(kw)},
+ {keyword_self, O(kw)},
+ {keyword_super, O(kw)},
+ {keyword_then, O(kw)},
+ {keyword_true, O(kw)},
+ {keyword_undef, O(kw)},
+ {keyword_unless, O(kw)},
+ {modifier_unless, O(kw)},
+ {keyword_until, O(kw)},
+ {modifier_until, O(kw)},
+ {keyword_when, O(kw)},
+ {keyword_while, O(kw)},
+ {modifier_while, O(kw)},
+ {keyword_yield, O(kw)},
+ {keyword__FILE__, O(kw)},
+ {keyword__LINE__, O(kw)},
+ {keyword__ENCODING__, O(kw)},
+ {keyword_BEGIN, O(kw)},
+ {keyword_END, O(kw)},
+ {keyword_do_LAMBDA, O(kw)},
+ {tAMPER, O(op)},
+ {tANDOP, O(op)},
+ {tAREF, O(op)},
+ {tASET, O(op)},
+ {tASSOC, O(op)},
+ {tBACK_REF, O(backref)},
+ {tCHAR, O(CHAR)},
+ {tCMP, O(op)},
+ {tCOLON2, O(op)},
+ {tCOLON3, O(op)},
+ {tCONSTANT, O(const)},
+ {tCVAR, O(cvar)},
+ {tDOT2, O(op)},
+ {tDOT3, O(op)},
+ {tEQ, O(op)},
+ {tEQQ, O(op)},
+ {tFID, O(ident)},
+ {tFLOAT, O(float)},
+ {tGEQ, O(op)},
+ {tGVAR, O(gvar)},
+ {tIDENTIFIER, O(ident)},
+ {tIMAGINARY, O(imaginary)},
+ {tINTEGER, O(int)},
+ {tIVAR, O(ivar)},
+ {tLBRACE, O(lbrace)},
+ {tLBRACE_ARG, O(lbrace)},
+ {'{', O(lbrace)},
+ {'}', O(rbrace)},
+ {tLBRACK, O(lbracket)},
+ {'[', O(lbracket)},
+ {']', O(rbracket)},
+ {tLEQ, O(op)},
+ {tLPAREN, O(lparen)},
+ {tLPAREN_ARG, O(lparen)},
+ {'(', O(lparen)},
+ {')', O(rparen)},
+ {tLSHFT, O(op)},
+ {tMATCH, O(op)},
+ {tNEQ, O(op)},
+ {tNMATCH, O(op)},
+ {tNTH_REF, O(backref)},
+ {tOP_ASGN, O(op)},
+ {tOROP, O(op)},
+ {tPOW, O(op)},
+ {tQWORDS_BEG, O(qwords_beg)},
+ {tQSYMBOLS_BEG, O(qsymbols_beg)},
+ {tSYMBOLS_BEG, O(symbols_beg)},
+ {tRATIONAL, O(rational)},
+ {tREGEXP_BEG, O(regexp_beg)},
+ {tREGEXP_END, O(regexp_end)},
+ {tRPAREN, O(rparen)},
+ {tRSHFT, O(op)},
+ {tSTAR, O(op)},
+ {tDSTAR, O(op)},
+ {tANDDOT, O(op)},
+ {tSTRING_BEG, O(tstring_beg)},
+ {tSTRING_CONTENT, O(tstring_content)},
+ {tSTRING_DBEG, O(embexpr_beg)},
+ {tSTRING_DEND, O(embexpr_end)},
+ {tSTRING_DVAR, O(embvar)},
+ {tSTRING_END, O(tstring_end)},
+ {tSYMBEG, O(symbeg)},
+ {tUMINUS, O(op)},
+ {tUMINUS_NUM, O(op)},
+ {tUPLUS, O(op)},
+ {tWORDS_BEG, O(words_beg)},
+ {tXSTRING_BEG, O(backtick)},
+ {tLABEL, O(label)},
+ {tLABEL_END, O(label_end)},
+ {tLAMBDA, O(tlambda)},
+ {tLAMBEG, O(tlambeg)},
/* ripper specific tokens */
- {tIGNORED_NL, &ripper_id_ignored_nl},
- {tCOMMENT, &ripper_id_comment},
- {tEMBDOC_BEG, &ripper_id_embdoc_beg},
- {tEMBDOC, &ripper_id_embdoc},
- {tEMBDOC_END, &ripper_id_embdoc_end},
- {tSP, &ripper_id_sp},
- {tHEREDOC_BEG, &ripper_id_heredoc_beg},
- {tHEREDOC_END, &ripper_id_heredoc_end},
- {k__END__, &ripper_id___end__},
- {0, NULL}
+ {tIGNORED_NL, O(ignored_nl)},
+ {tCOMMENT, O(comment)},
+ {tEMBDOC_BEG, O(embdoc_beg)},
+ {tEMBDOC, O(embdoc)},
+ {tEMBDOC_END, O(embdoc_end)},
+ {tSP, O(sp)},
+ {tHEREDOC_BEG, O(heredoc_beg)},
+ {tHEREDOC_END, O(heredoc_end)},
+ {k__END__, O(__end__)},
};
static ID
ripper_token2eventid(int tok)
{
- const struct token_assoc *a;
+ int i;
- for (a = token_to_eventid; a->id != NULL; a++) {
+ for (i = 0; i < numberof(token_to_eventid); i++) {
+ const struct token_assoc *const a = &token_to_eventid[i];
if (a->token == tok)
- return *a->id;
+ return *(const ID *)((const char *)&ripper_scanner_ids + a->id_offset);
}
if (tok < 256) {
- return ripper_id_CHAR;
+ return ripper_scanner_ids.ripper_id_CHAR;
}
rb_raise(rb_eRuntimeError, "[Ripper FATAL] unknown token %d", tok);
diff --git a/ext/ripper/extconf.rb b/ext/ripper/extconf.rb
index db54e5ca2a..ec686986f9 100644
--- a/ext/ripper/extconf.rb
+++ b/ext/ripper/extconf.rb
@@ -1,4 +1,5 @@
#!ruby -s
+# frozen_string_literal: false
require 'mkmf'
require 'rbconfig'
diff --git a/ext/ripper/lib/ripper.rb b/ext/ripper/lib/ripper.rb
index 542bd405d2..c5c3a8091e 100644
--- a/ext/ripper/lib/ripper.rb
+++ b/ext/ripper/lib/ripper.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'ripper/core'
require 'ripper/lexer'
require 'ripper/filter'
diff --git a/ext/ripper/lib/ripper/core.rb b/ext/ripper/lib/ripper/core.rb
index 637a72f4ad..53ed14d5e1 100644
--- a/ext/ripper/lib/ripper/core.rb
+++ b/ext/ripper/lib/ripper/core.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# $Id$
#
@@ -29,16 +30,21 @@ class Ripper
private
+ def _dispatch_0() nil end
+ def _dispatch_1(a) a end
+ def _dispatch_2(a, b) a end
+ def _dispatch_3(a, b, c) a end
+ def _dispatch_4(a, b, c, d) a end
+ def _dispatch_5(a, b, c, d, e) a end
+ def _dispatch_6(a, b, c, d, e, f) a end
+ def _dispatch_7(a, b, c, d, e, f, g) a end
+
#
# Parser Events
#
PARSER_EVENT_TABLE.each do |id, arity|
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{id}(#{ ('a'..'z').to_a[0, arity].join(', ') })
- #{arity == 0 ? 'nil' : 'a'}
- end
- End
+ alias_method "on_#{id}", "_dispatch_#{arity}"
end
# This method is called when weak warning is produced by the parser.
@@ -60,11 +66,7 @@ class Ripper
#
SCANNER_EVENTS.each do |id|
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{id}(token)
- token
- end
- End
+ alias_method "on_#{id}", :_dispatch_1
end
end
diff --git a/ext/ripper/lib/ripper/filter.rb b/ext/ripper/lib/ripper/filter.rb
index 239f9f00e1..a50a2c6c4e 100644
--- a/ext/ripper/lib/ripper/filter.rb
+++ b/ext/ripper/lib/ripper/filter.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# $Id$
#
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb
index 5c99dfe8fa..e70db0b1d1 100644
--- a/ext/ripper/lib/ripper/lexer.rb
+++ b/ext/ripper/lib/ripper/lexer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# $Id$
#
@@ -12,7 +13,7 @@ require 'ripper/core'
class Ripper
- # Tokenizes the Ruby program and returns an Array of String.
+ # Tokenizes the Ruby program and returns an array of strings.
#
# p Ripper.tokenize("def m(a) nil end")
# # => ["def", " ", "m", "(", "a", ")", " ", "nil", " ", "end"]
@@ -21,7 +22,7 @@ class Ripper
Lexer.new(src, filename, lineno).tokenize
end
- # Tokenizes the Ruby program and returns an Array of an Array,
+ # Tokenizes the Ruby program and returns an array of an array,
# which is formatted like <code>[[lineno, column], type, token]</code>.
#
# require 'ripper'
@@ -44,28 +45,63 @@ class Ripper
end
class Lexer < ::Ripper #:nodoc: internal use only
+ Elem = Struct.new(:pos, :event, :tok)
+
def tokenize
- lex().map {|pos, event, tok| tok }
+ parse().sort_by(&:pos).map(&:tok)
end
def lex
- parse().sort_by {|pos, event, tok| pos }
+ parse().sort_by(&:pos).map(&:to_a)
end
def parse
@buf = []
+ @stack = []
super
+ @buf.flatten!
@buf
end
private
- SCANNER_EVENTS.each do |event|
- module_eval(<<-End, __FILE__+'/module_eval', __LINE__ + 1)
- def on_#{event}(tok)
- @buf.push [[lineno(), column()], :on_#{event}, tok]
+ def on_heredoc_dedent(v, w)
+ ignored_sp = []
+ heredoc = @buf.last
+ heredoc.each_with_index do |e, i|
+ if Elem === e and e.event == :on_tstring_content
+ tok = e.tok.dup if w > 0 and /\A\s/ =~ e.tok
+ if (n = dedent_string(e.tok, w)) > 0
+ ignored_sp << [i, Elem.new(e.pos.dup, :on_ignored_sp, tok[0, n])]
+ e.pos[1] += n
+ end
end
- End
+ end
+ ignored_sp.reverse_each do |i, e|
+ heredoc[i, 0] = [e]
+ end
+ v
+ end
+
+ def on_heredoc_beg(tok)
+ @stack.push @buf
+ buf = []
+ @buf << buf
+ @buf = buf
+ @buf.push Elem.new([lineno(), column()], __callee__, tok)
+ end
+
+ def on_heredoc_end(tok)
+ @buf.push Elem.new([lineno(), column()], __callee__, tok)
+ @buf = @stack.pop
+ end
+
+ def _push_token(tok)
+ @buf.push Elem.new([lineno(), column()], __callee__, tok)
+ end
+
+ (SCANNER_EVENTS.map {|event|:"on_#{event}"} - private_instance_methods(false)).each do |event|
+ alias_method event, :_push_token
end
end
diff --git a/ext/ripper/lib/ripper/sexp.rb b/ext/ripper/lib/ripper/sexp.rb
index 66bd69134d..aa1f86e38c 100644
--- a/ext/ripper/lib/ripper/sexp.rb
+++ b/ext/ripper/lib/ripper/sexp.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# $Id$
#
@@ -28,7 +29,9 @@ class Ripper
# [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]]
#
def Ripper.sexp(src, filename = '-', lineno = 1)
- SexpBuilderPP.new(src, filename, lineno).parse
+ builder = SexpBuilderPP.new(src, filename, lineno)
+ sexp = builder.parse
+ sexp unless builder.error?
end
# [EXPERIMENTAL]
@@ -52,48 +55,43 @@ class Ripper
# nil]]]]
#
def Ripper.sexp_raw(src, filename = '-', lineno = 1)
- SexpBuilder.new(src, filename, lineno).parse
+ builder = SexpBuilder.new(src, filename, lineno)
+ sexp = builder.parse
+ sexp unless builder.error?
end
- class SexpBuilderPP < ::Ripper #:nodoc:
+ class SexpBuilder < ::Ripper #:nodoc:
private
- PARSER_EVENT_TABLE.each do |event, arity|
- if /_new\z/ =~ event.to_s and arity == 0
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}
- []
- end
- End
- elsif /_add\z/ =~ event.to_s
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(list, item)
- list.push item
- list
- end
- End
- else
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(*args)
- [:#{event}, *args]
- end
- End
+ def dedent_element(e, width)
+ if (n = dedent_string(e[1], width)) > 0
+ e[2][1] += n
end
+ e
end
- SCANNER_EVENTS.each do |event|
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(tok)
- [:@#{event}, tok, [lineno(), column()]]
+ def on_heredoc_dedent(val, width)
+ sub = proc do |cont|
+ cont.map! do |e|
+ if Array === e
+ case e[0]
+ when :@tstring_content
+ e = dedent_element(e, width)
+ when /_add\z/
+ e[1] = sub[e[1]]
+ end
+ elsif String === e
+ dedent_string(e, width)
+ end
+ e
end
- End
+ end
+ sub[val]
+ val
end
- end
-
- class SexpBuilder < ::Ripper #:nodoc:
- private
- PARSER_EVENTS.each do |event|
+ events = private_instance_methods(false).grep(/\Aon_/) {$'.to_sym}
+ (PARSER_EVENTS - events).each do |event|
module_eval(<<-End, __FILE__, __LINE__ + 1)
def on_#{event}(*args)
args.unshift :#{event}
@@ -111,4 +109,38 @@ class Ripper
end
end
+ class SexpBuilderPP < SexpBuilder #:nodoc:
+ private
+
+ def on_heredoc_dedent(val, width)
+ val.map! do |e|
+ next e if Symbol === e and /_content\z/ =~ e
+ if Array === e and e[0] == :@tstring_content
+ e = dedent_element(e, width)
+ elsif String === e
+ dedent_string(e, width)
+ end
+ e
+ end
+ val
+ end
+
+ def _dispatch_event_new
+ []
+ end
+
+ def _dispatch_event_push(list, item)
+ list.push item
+ list
+ end
+
+ PARSER_EVENT_TABLE.each do |event, arity|
+ if /_new\z/ =~ event and arity == 0
+ alias_method "on_#{event}", :_dispatch_event_new
+ elsif /_add\z/ =~ event
+ alias_method "on_#{event}", :_dispatch_event_push
+ end
+ end
+ end
+
end
diff --git a/ext/ripper/tools/generate-param-macros.rb b/ext/ripper/tools/generate-param-macros.rb
index b19f6e8d5c..c1f0c5bc31 100755
--- a/ext/ripper/tools/generate-param-macros.rb
+++ b/ext/ripper/tools/generate-param-macros.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
off = true
ARGF.each do |line|
case line
diff --git a/ext/ripper/tools/generate.rb b/ext/ripper/tools/generate.rb
index 48ad9e1d25..cb02de9b4b 100755
--- a/ext/ripper/tools/generate.rb
+++ b/ext/ripper/tools/generate.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# $Id$
require 'optparse'
@@ -68,15 +69,22 @@ end
def generate_eventids1(ids)
buf = ""
+ buf << %Q[static struct {\n]
ids.each do |id, arity|
- buf << %Q[static ID ripper_id_#{id};\n]
+ buf << %Q[ ID id_#{id};\n]
+ end
+ buf << %Q[} ripper_parser_ids;\n]
+ buf << %Q[\n]
+ ids.each do |id, arity|
+ buf << %Q[#define ripper_id_#{id} ripper_parser_ids.id_#{id}\n]
end
buf << %Q[\n]
buf << %Q[static void\n]
buf << %Q[ripper_init_eventids1(void)\n]
buf << %Q[{\n]
+ buf << %Q[#define set_id1(name) ripper_id_##name = rb_intern_const("on_"#name)\n]
ids.each do |id, arity|
- buf << %Q[ ripper_id_#{id} = rb_intern_const("on_#{id}");\n]
+ buf << %Q[ set_id1(#{id});\n]
end
buf << %Q[}\n]
buf << %Q[\n]
@@ -84,11 +92,9 @@ def generate_eventids1(ids)
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]
- buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(#{arity}));\n]
+ buf << %Q[ rb_hash_aset(h, intern_sym("#{id}"), INT2FIX(#{arity}));\n]
end
buf << %Q[}\n]
buf
@@ -100,11 +106,9 @@ def generate_eventids2_table(ids)
buf << %Q[ripper_init_eventids2_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, "SCANNER_EVENT_TABLE", h);\n]
ids.each do |id|
- buf << %Q[ id = rb_intern_const("#{id}");\n]
- buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(1));\n]
+ buf << %Q[ rb_hash_aset(h, intern_sym("#{id}"), INT2FIX(1));\n]
end
buf << %Q[}\n]
buf
@@ -135,9 +139,9 @@ def read_ids1_with_locations(path)
h = {}
File.open(path) {|f|
f.each do |line|
- next if /\A\#\s*define\s+s?dispatch/ =~ line
+ next if /\A\#\s*define\s+dispatch/ =~ line
next if /ripper_dispatch/ =~ line
- line.scan(/dispatch(\d)\((\w+)/) do |arity, event|
+ line.scan(/\bdispatch(\d)\((\w+)/) do |arity, event|
(h[event] ||= []).push [f.lineno, arity.to_i]
end
end
@@ -146,9 +150,13 @@ def read_ids1_with_locations(path)
end
def read_ids2(path)
- File.open(path) {|f|
- return f.read.scan(/ripper_id_(\w+)/).flatten.uniq.sort
- }
+ src = File.open(path) {|f| f.read}
+ ids2 = src.scan(/ID\s+ripper_id_(\w+)/).flatten.uniq.sort
+ diff = src.scan(/set_id2\((\w+)\);/).flatten - ids2
+ unless diff.empty?
+ abort "missing scanner IDs: #{diff}"
+ end
+ return ids2
end
main
diff --git a/ext/ripper/tools/preproc.rb b/ext/ripper/tools/preproc.rb
index 06397cea05..2377506cd5 100755
--- a/ext/ripper/tools/preproc.rb
+++ b/ext/ripper/tools/preproc.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# $Id$
require 'optparse'
diff --git a/ext/ripper/tools/strip.rb b/ext/ripper/tools/strip.rb
index 99413c361d..82022d0b55 100755
--- a/ext/ripper/tools/strip.rb
+++ b/ext/ripper/tools/strip.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
last_is_void = false
ARGF.each do |line|
if line.strip.empty?
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 847eb2aaf6..9ff0e7959a 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -7,8 +7,7 @@
* core routines
*/
-#include "ruby/config.h"
-#include "ruby/defines.h"
+#include "ruby/ruby.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -373,7 +372,7 @@ makroom(register DBM *db, long int hash, int need)
{
long newp;
char twin[PBLKSIZ];
-#if defined _WIN32 && !defined __CYGWIN__
+#if defined _WIN32
char zer[PBLKSIZ];
long oldtail;
#endif
@@ -400,7 +399,7 @@ makroom(register DBM *db, long int hash, int need)
* here, as sdbm_store will do so, after it inserts the incoming pair.
*/
-#if defined _WIN32 && !defined __CYGWIN__
+#if defined _WIN32
/*
* Fill hole with 0 if made it.
* (hole is NOT read as 0)
@@ -507,7 +506,7 @@ getpage(register DBM *db, register long int hash)
while (dbit < db->maxbno && getdbit(db, dbit))
dbit = 2 * dbit + ((hash & ((long) 1 << hbit++)) ? 2 : 1);
- debug(("dbit: %d...", dbit));
+ debug(("dbit: %ld...", dbit));
db->curbit = dbit;
db->hmask = masks[hbit];
@@ -532,7 +531,7 @@ getpage(register DBM *db, register long int hash)
}
db->pagbno = pagb;
- debug(("pag read: %d\n", pagb));
+ debug(("pag read: %ld\n", pagb));
}
return 1;
}
@@ -552,7 +551,7 @@ getdbit(register DBM *db, register long int dbit)
return 0;
db->dirbno = dirb;
- debug(("dir read: %d\n", dirb));
+ debug(("dir read: %ld\n", dirb));
}
return db->dirbuf[c % DBLKSIZ] & (1 << (dbit % BYTESIZ));
@@ -573,7 +572,7 @@ setdbit(register DBM *db, register long int dbit)
return 0;
db->dirbno = dirb;
- debug(("dir read: %d\n", dirb));
+ debug(("dir read: %ld\n", dirb));
}
db->dirbuf[c % DBLKSIZ] |= (1 << (dbit % BYTESIZ));
@@ -803,7 +802,7 @@ delpair(char *pag, datum key)
}
#else
#ifdef MEMMOVE
- memmove(dst, src, m);
+ memmove(dst-m, src-m, m);
#else
while (m--)
*--dst = *--src;
diff --git a/ext/sdbm/depend b/ext/sdbm/depend
index 09f171a511..b8f551369b 100644
--- a/ext/sdbm/depend
+++ b/ext/sdbm/depend
@@ -1,2 +1,19 @@
-_sdbm.o: _sdbm.c sdbm.h $(HDRS) $(ruby_headers)
-init.o: init.c sdbm.h $(HDRS) $(ruby_headers)
+# AUTOGENERATED DEPENDENCIES START
+_sdbm.o: $(RUBY_EXTCONF_H)
+_sdbm.o: $(arch_hdrdir)/ruby/config.h
+_sdbm.o: $(hdrdir)/ruby/defines.h
+_sdbm.o: $(hdrdir)/ruby/missing.h
+_sdbm.o: _sdbm.c
+_sdbm.o: sdbm.h
+init.o: $(RUBY_EXTCONF_H)
+init.o: $(arch_hdrdir)/ruby/config.h
+init.o: $(hdrdir)/ruby/defines.h
+init.o: $(hdrdir)/ruby/intern.h
+init.o: $(hdrdir)/ruby/missing.h
+init.o: $(hdrdir)/ruby/ruby.h
+init.o: $(hdrdir)/ruby/st.h
+init.o: $(hdrdir)/ruby/subst.h
+init.o: $(top_srcdir)/include/ruby.h
+init.o: init.c
+init.o: sdbm.h
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/sdbm/extconf.rb b/ext/sdbm/extconf.rb
index 67796fbf8a..bdf3e299e6 100644
--- a/ext/sdbm/extconf.rb
+++ b/ext/sdbm/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
$defs << "-D""BADMESS=0"
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 0f26bb89ed..c984152382 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -72,30 +72,50 @@ struct dbmdata {
};
static void
-closed_sdbm()
+closed_sdbm(void)
{
rb_raise(rb_eDBMError, "closed SDBM file");
}
-#define GetDBM(obj, dbmp) {\
- Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+#define GetDBM(obj, dbmp) do {\
+ TypedData_Get_Struct((obj), struct dbmdata, &sdbm_type, (dbmp));\
if ((dbmp) == 0) closed_sdbm();\
if ((dbmp)->di_dbm == 0) closed_sdbm();\
-}
+} while (0)
-#define GetDBM2(obj, data, dbm) {\
- GetDBM((obj), (data));\
- (dbm) = dbmp->di_dbm;\
-}
+#define GetDBM2(obj, dbmp, dbm) do {\
+ GetDBM((obj), (dbmp));\
+ (dbm) = (dbmp)->di_dbm;\
+} while (0)
static void
-free_sdbm(struct dbmdata *dbmp)
+free_sdbm(void *ptr)
{
+ struct dbmdata *dbmp = ptr;
if (dbmp->di_dbm) sdbm_close(dbmp->di_dbm);
ruby_xfree(dbmp);
}
+static size_t
+memsize_dbm(const void *ptr)
+{
+ size_t size = 0;
+ const struct dbmdata *dbmp = ptr;
+ if (dbmp) {
+ size += sizeof(*dbmp);
+ if (dbmp->di_dbm) size += sizeof(DBM);
+ }
+ return size;
+}
+
+static const rb_data_type_t sdbm_type = {
+ "sdbm",
+ {0, free_sdbm, memsize_dbm,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* call-seq:
* sdbm.close -> nil
@@ -127,7 +147,7 @@ fsdbm_closed(VALUE obj)
{
struct dbmdata *dbmp;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
+ TypedData_Get_Struct(obj, struct dbmdata, &sdbm_type, dbmp);
if (dbmp == 0)
return Qtrue;
if (dbmp->di_dbm == 0)
@@ -139,7 +159,7 @@ fsdbm_closed(VALUE obj)
static VALUE
fsdbm_alloc(VALUE klass)
{
- return Data_Wrap_Struct(klass, 0, free_sdbm, 0);
+ return TypedData_Wrap_Struct(klass, &sdbm_type, 0);
}
/*
* call-seq:
@@ -218,7 +238,7 @@ fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
static VALUE
fsdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE obj = Data_Wrap_Struct(klass, 0, free_sdbm, 0);
+ VALUE obj = fsdbm_alloc(klass);
if (NIL_P(fsdbm_initialize(argc, argv, obj))) {
return Qnil;
@@ -492,7 +512,8 @@ fsdbm_delete_if(VALUE obj)
DBM *dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_new();
- int i, status = 0, n;
+ long i;
+ int status = 0, n;
fdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
@@ -509,7 +530,7 @@ fsdbm_delete_if(VALUE obj)
}
for (i = 0; i < RARRAY_LEN(ary); i++) {
- keystr = RARRAY_PTR(ary)[i];
+ keystr = RARRAY_AREF(ary, i);
ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LENINT(keystr);
@@ -634,11 +655,13 @@ fsdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
static VALUE
update_i(RB_BLOCK_CALL_FUNC_ARGLIST(pair, dbm))
{
+ const VALUE *ptr;
Check_Type(pair, T_ARRAY);
if (RARRAY_LEN(pair) < 2) {
rb_raise(rb_eArgError, "pair must be [key, value]");
}
- fsdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
+ ptr = RARRAY_CONST_PTR(pair);
+ fsdbm_store(dbm, ptr[0], ptr[1]);
return Qnil;
}
@@ -991,7 +1014,7 @@ fsdbm_reject(VALUE obj)
}
void
-Init_sdbm()
+Init_sdbm(void)
{
rb_cDBM = rb_define_class("SDBM", rb_cObject);
rb_eDBMError = rb_define_class("SDBMError", rb_eStandardError);
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 9a68a0c289..02766ba5d2 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -2,6 +2,9 @@
#include <time.h>
+int rsock_cmsg_cloexec_state = -1; /* <0: unknown, 0: ignored, >0: working */
+static VALUE sym_wait_readable, sym_wait_writable;
+
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
static VALUE rb_cAncillaryData;
@@ -204,7 +207,7 @@ ancillary_s_unix_rights(int argc, VALUE *argv, VALUE klass)
str = rb_str_buf_new(sizeof(int) * argc);
for (i = 0 ; i < argc; i++) {
- VALUE obj = RARRAY_PTR(ary)[i];
+ VALUE obj = RARRAY_AREF(ary, i);
rb_io_t *fptr;
int fd;
GetOpenFile(obj, fptr);
@@ -987,7 +990,7 @@ ancillary_inspect(VALUE self)
vtype = ip_cmsg_type_to_sym(level, type);
if (SYMBOL_P(vtype))
- rb_str_catf(ret, " %s", rb_id2name(SYM2ID(vtype)));
+ rb_str_catf(ret, " %"PRIsVALUE, rb_sym2str(vtype));
else
rb_str_catf(ret, " cmsg_type:%d", type);
}
@@ -1103,8 +1106,8 @@ ancillary_cmsg_is_p(VALUE self, VALUE vlevel, VALUE vtype)
#if defined(HAVE_SENDMSG)
struct sendmsg_args_struct {
int fd;
- const struct msghdr *msg;
int flags;
+ const struct msghdr *msg;
};
static void *
@@ -1125,16 +1128,16 @@ rb_sendmsg(int fd, const struct msghdr *msg, int flags)
}
static VALUE
-bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
+bsock_sendmsg_internal(VALUE sock, VALUE data, VALUE vflags,
+ VALUE dest_sockaddr, VALUE controls, VALUE ex,
+ int nonblock)
{
rb_io_t *fptr;
- VALUE data, vflags, dest_sockaddr;
- int controls_num;
struct msghdr mh;
struct iovec iov;
+ int controls_num;
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- volatile VALUE controls_str = 0;
- VALUE *controls_ptr = NULL;
+ VALUE controls_str = 0;
int family;
#endif
int flags;
@@ -1142,27 +1145,21 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
GetOpenFile(sock, fptr);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- family = rsock_getfamily(fptr->fd);
-#endif
-
- data = vflags = dest_sockaddr = Qnil;
-
- if (argc == 0)
- rb_raise(rb_eArgError, "mesg argument required");
- data = argv[0];
- if (1 < argc) vflags = argv[1];
- if (2 < argc) dest_sockaddr = argv[2];
- controls_num = 3 < argc ? argc - 3 : 0;
-#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- if (3 < argc) { controls_ptr = &argv[3]; }
+ family = rsock_getfamily(fptr);
#endif
StringValue(data);
+ if (!RB_TYPE_P(controls, T_ARRAY)) {
+ controls = rb_ary_new();
+ }
+ controls_num = RARRAY_LENINT(controls);
+
if (controls_num) {
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
int i;
size_t last_pad = 0;
+ const VALUE *controls_ptr = RARRAY_CONST_PTR(controls);
#if defined(__NetBSD__)
int last_level = 0;
int last_type = 0;
@@ -1237,6 +1234,7 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
rb_str_set_len(controls_str, RSTRING_LEN(controls_str)-last_pad);
#endif
}
+ RB_GC_GUARD(controls);
#else
rb_raise(rb_eNotImpError, "control message for sendmsg is unimplemented");
#endif
@@ -1268,97 +1266,63 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
mh.msg_control = RSTRING_PTR(controls_str);
mh.msg_controllen = RSTRING_SOCKLEN(controls_str);
}
- else {
- mh.msg_control = NULL;
- mh.msg_controllen = 0;
- }
#endif
rb_io_check_closed(fptr);
- if (nonblock)
+ if (nonblock && !MSG_DONTWAIT_RELIABLE)
rb_io_set_nonblock(fptr);
ss = rb_sendmsg(fptr->fd, &mh, flags);
- if (!nonblock && rb_io_wait_writable(fptr->fd)) {
- rb_io_check_closed(fptr);
- goto retry;
- }
-
if (ss == -1) {
- if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
- rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "sendmsg(2) would block");
- rb_sys_fail("sendmsg(2)");
+ int e;
+ if (!nonblock && rb_io_wait_writable(fptr->fd)) {
+ rb_io_check_closed(fptr);
+ goto retry;
+ }
+ e = errno;
+ if (nonblock && (e == EWOULDBLOCK || e == EAGAIN)) {
+ if (ex == Qfalse) {
+ return sym_wait_writable;
+ }
+ rb_readwrite_syserr_fail(RB_IO_WAIT_WRITABLE, e,
+ "sendmsg(2) would block");
+ }
+ rb_syserr_fail(e, "sendmsg(2)");
}
+#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
+ RB_GC_GUARD(controls_str);
+#endif
return SSIZET2NUM(ss);
}
#endif
#if defined(HAVE_SENDMSG)
-/*
- * call-seq:
- * basicsocket.sendmsg(mesg, flags=0, dest_sockaddr=nil, *controls) => numbytes_sent
- *
- * sendmsg sends a message using sendmsg(2) system call in blocking manner.
- *
- * _mesg_ is a string to send.
- *
- * _flags_ is bitwise OR of MSG_* constants such as Socket::MSG_OOB.
- *
- * _dest_sockaddr_ is a destination socket address for connection-less socket.
- * It should be a sockaddr such as a result of Socket.sockaddr_in.
- * An Addrinfo object can be used too.
- *
- * _controls_ is a list of ancillary data.
- * The element of _controls_ should be Socket::AncillaryData or
- * 3-elements array.
- * The 3-element array should contains cmsg_level, cmsg_type and data.
- *
- * The return value, _numbytes_sent_ is an integer which is the number of bytes sent.
- *
- * sendmsg can be used to implement send_io as follows:
- *
- * # use Socket::AncillaryData.
- * ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, io.fileno)
- * sock.sendmsg("a", 0, nil, ancdata)
- *
- * # use 3-element array.
- * ancdata = [:SOCKET, :RIGHTS, [io.fileno].pack("i!")]
- * sock.sendmsg("\0", 0, nil, ancdata)
- *
- */
VALUE
-rsock_bsock_sendmsg(int argc, VALUE *argv, VALUE sock)
+rsock_bsock_sendmsg(VALUE sock, VALUE data, VALUE flags, VALUE dest_sockaddr,
+ VALUE controls)
{
- return bsock_sendmsg_internal(argc, argv, sock, 0);
+ return bsock_sendmsg_internal(sock, data, flags, dest_sockaddr, controls,
+ Qtrue, 0);
}
#endif
#if defined(HAVE_SENDMSG)
-/*
- * call-seq:
- * basicsocket.sendmsg_nonblock(mesg, flags=0, dest_sockaddr=nil, *controls) => numbytes_sent
- *
- * sendmsg_nonblock sends a message using sendmsg(2) system call in non-blocking manner.
- *
- * It is similar to BasicSocket#sendmsg
- * but the non-blocking flag is set before the system call
- * and it doesn't retry the system call.
- *
- */
VALUE
-rsock_bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock)
+rsock_bsock_sendmsg_nonblock(VALUE sock, VALUE data, VALUE flags,
+ VALUE dest_sockaddr, VALUE controls, VALUE ex)
{
- return bsock_sendmsg_internal(argc, argv, sock, 1);
+ return bsock_sendmsg_internal(sock, data, flags, dest_sockaddr,
+ controls, ex, 1);
}
#endif
#if defined(HAVE_RECVMSG)
struct recvmsg_args_struct {
int fd;
- struct msghdr *msg;
int flags;
+ struct msghdr *msg;
};
ssize_t
@@ -1416,7 +1380,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_fd_fix_cloexec(*fdp);
+ rb_update_max_fd(*fdp);
close(*fdp);
fdp++;
}
@@ -1459,7 +1423,11 @@ 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_fd_fix_cloexec(fd);
+ rb_update_max_fd(fd);
+ if (rsock_cmsg_cloexec_state < 0)
+ rsock_cmsg_cloexec_state = rsock_detect_cloexec(fd);
+ if (rsock_cmsg_cloexec_state == 0 || fd <= 2)
+ rb_maygvl_fd_fix_cloexec(fd);
if (S_ISSOCK(stbuf.st_mode))
io = rsock_init_sock(rb_obj_alloc(rb_cSocket), fd);
else
@@ -1474,18 +1442,18 @@ make_io_for_unix_rights(VALUE ctl, struct cmsghdr *cmh, char *msg_end)
#endif
static VALUE
-bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
+bsock_recvmsg_internal(VALUE sock,
+ VALUE vmaxdatlen, VALUE vflags, VALUE vmaxctllen,
+ VALUE scm_rights, VALUE ex, int nonblock)
{
rb_io_t *fptr;
- VALUE vmaxdatlen, vmaxctllen, vflags;
- VALUE vopts;
int grow_buffer;
size_t maxdatlen;
int flags, orig_flags;
struct msghdr mh;
struct iovec iov;
union_sockaddr namebuf;
- char datbuf0[4096], *datbuf;
+ char *datbuf;
VALUE dat_str = Qnil;
VALUE ret;
ssize_t ss;
@@ -1493,27 +1461,20 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
struct cmsghdr *cmh;
size_t maxctllen;
- union {
- char bytes[4096];
- struct cmsghdr align;
- } ctlbuf0;
char *ctlbuf;
VALUE ctl_str = Qnil;
int family;
int gc_done = 0;
#endif
-
- rb_scan_args(argc, argv, "03:", &vmaxdatlen, &vflags, &vmaxctllen, &vopts);
-
- maxdatlen = NIL_P(vmaxdatlen) ? sizeof(datbuf0) : NUM2SIZET(vmaxdatlen);
+ maxdatlen = NIL_P(vmaxdatlen) ? 4096 : NUM2SIZET(vmaxdatlen);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- maxctllen = NIL_P(vmaxctllen) ? sizeof(ctlbuf0) : NUM2SIZET(vmaxctllen);
+ maxctllen = NIL_P(vmaxctllen) ? 4096 : NUM2SIZET(vmaxctllen);
#else
if (!NIL_P(vmaxctllen))
rb_raise(rb_eArgError, "control message not supported");
#endif
- flags = NIL_P(vflags) ? 0 : NUM2INT(vflags);
+ flags = NUM2INT(vflags);
#ifdef MSG_DONTWAIT
if (nonblock)
flags |= MSG_DONTWAIT;
@@ -1523,7 +1484,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
grow_buffer = NIL_P(vmaxdatlen) || NIL_P(vmaxctllen);
request_scm_rights = 0;
- if (!NIL_P(vopts) && RTEST(rb_hash_aref(vopts, ID2SYM(rb_intern("scm_rights")))))
+ if (RTEST(scm_rights))
request_scm_rights = 1;
#if !defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
if (request_scm_rights)
@@ -1548,26 +1509,18 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
#endif
retry:
- if (maxdatlen <= sizeof(datbuf0))
- datbuf = datbuf0;
- else {
- if (NIL_P(dat_str))
- dat_str = rb_str_tmp_new(maxdatlen);
- else
- rb_str_resize(dat_str, maxdatlen);
- datbuf = RSTRING_PTR(dat_str);
- }
+ if (NIL_P(dat_str))
+ dat_str = rb_str_tmp_new(maxdatlen);
+ else
+ rb_str_resize(dat_str, maxdatlen);
+ datbuf = RSTRING_PTR(dat_str);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- if (maxctllen <= sizeof(ctlbuf0))
- ctlbuf = ctlbuf0.bytes;
- else {
- if (NIL_P(ctl_str))
- ctl_str = rb_str_tmp_new(maxctllen);
- else
- rb_str_resize(ctl_str, maxctllen);
- ctlbuf = RSTRING_PTR(ctl_str);
- }
+ if (NIL_P(ctl_str))
+ ctl_str = rb_str_tmp_new(maxctllen);
+ else
+ rb_str_resize(ctl_str, maxctllen);
+ ctlbuf = RSTRING_PTR(ctl_str);
#endif
memset(&mh, 0, sizeof(mh));
@@ -1590,21 +1543,26 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
flags |= MSG_PEEK;
rb_io_check_closed(fptr);
- if (nonblock)
+ if (nonblock && !MSG_DONTWAIT_RELIABLE)
rb_io_set_nonblock(fptr);
ss = rb_recvmsg(fptr->fd, &mh, flags);
- if (!nonblock && rb_io_wait_readable(fptr->fd)) {
- rb_io_check_closed(fptr);
- goto retry;
- }
-
if (ss == -1) {
- if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
- rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "recvmsg(2) would block");
+ int e;
+ if (!nonblock && rb_io_wait_readable(fptr->fd)) {
+ rb_io_check_closed(fptr);
+ goto retry;
+ }
+ e = errno;
+ if (nonblock && (e == EWOULDBLOCK || e == EAGAIN)) {
+ if (ex == Qfalse) {
+ return sym_wait_readable;
+ }
+ rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE, e, "recvmsg(2) would block");
+ }
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- if (!gc_done && (errno == EMFILE || errno == EMSGSIZE)) {
+ if (!gc_done && (e == EMFILE || e == EMSGSIZE)) {
/*
* When SCM_RIGHTS hit the file descriptors limit:
* - Linux 2.6.18 causes success with MSG_CTRUNC
@@ -1616,19 +1574,23 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
gc_done = 1;
goto retry;
}
+#else
+ if (NIL_P(vmaxdatlen) && grow_buffer && e == EMSGSIZE)
+ ss = (ssize_t)iov.iov_len;
+ else
#endif
- rb_sys_fail("recvmsg(2)");
+ rb_syserr_fail(e, "recvmsg(2)");
}
if (grow_buffer) {
int grown = 0;
-#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- if (NIL_P(vmaxdatlen) && (mh.msg_flags & MSG_TRUNC)) {
+ if (NIL_P(vmaxdatlen) && ss != -1 && ss == (ssize_t)iov.iov_len) {
if (SIZE_MAX/2 < maxdatlen)
rb_raise(rb_eArgError, "max data length too big");
maxdatlen *= 2;
grown = 1;
}
+#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
if (NIL_P(vmaxctllen) && (mh.msg_flags & MSG_CTRUNC)) {
#define BIG_ENOUGH_SPACE 65536
if (BIG_ENOUGH_SPACE < maxctllen &&
@@ -1648,13 +1610,6 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
}
#undef BIG_ENOUGH_SPACE
}
-#else
- if (NIL_P(vmaxdatlen) && ss != -1 && ss == (ssize_t)iov.iov_len) {
- if (SIZE_MAX/2 < maxdatlen)
- rb_raise(rb_eArgError, "max data length too big");
- maxdatlen *= 2;
- grown = 1;
- }
#endif
if (grown) {
rsock_discard_cmsg_resource(&mh, (flags & MSG_PEEK) != 0);
@@ -1688,7 +1643,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- family = rsock_getfamily(fptr->fd);
+ family = rsock_getfamily(fptr);
if (mh.msg_controllen) {
char *msg_end = (char *)mh.msg_control + mh.msg_controllen;
for (cmh = CMSG_FIRSTHDR(&mh); cmh != NULL; cmh = CMSG_NXTHDR(&mh, cmh)) {
@@ -1707,6 +1662,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
discard_cmsg(cmh, msg_end, (flags & MSG_PEEK) != 0);
rb_ary_push(ret, ctl);
}
+ RB_GC_GUARD(ctl_str);
}
#endif
@@ -1715,82 +1671,21 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
#endif
#if defined(HAVE_RECVMSG)
-/*
- * call-seq:
- * basicsocket.recvmsg(maxmesglen=nil, flags=0, maxcontrollen=nil, opts={}) => [mesg, sender_addrinfo, rflags, *controls]
- *
- * recvmsg receives a message using recvmsg(2) system call in blocking manner.
- *
- * _maxmesglen_ is the maximum length of mesg to receive.
- *
- * _flags_ is bitwise OR of MSG_* constants such as Socket::MSG_PEEK.
- *
- * _maxcontrollen_ is the maximum length of controls (ancillary data) to receive.
- *
- * _opts_ is option hash.
- * Currently :scm_rights=>bool is the only option.
- *
- * :scm_rights option specifies that application expects SCM_RIGHTS control message.
- * If the value is nil or false, application don't expects SCM_RIGHTS control message.
- * In this case, recvmsg closes the passed file descriptors immediately.
- * This is the default behavior.
- *
- * If :scm_rights value is neither nil nor false, application expects SCM_RIGHTS control message.
- * In this case, recvmsg creates IO objects for each file descriptors for
- * Socket::AncillaryData#unix_rights method.
- *
- * The return value is 4-elements array.
- *
- * _mesg_ is a string of the received message.
- *
- * _sender_addrinfo_ is a sender socket address for connection-less socket.
- * It is an Addrinfo object.
- * For connection-oriented socket such as TCP, sender_addrinfo is platform dependent.
- *
- * _rflags_ is a flags on the received message which is bitwise OR of MSG_* constants such as Socket::MSG_TRUNC.
- * It will be nil if the system uses 4.3BSD style old recvmsg system call.
- *
- * _controls_ is ancillary data which is an array of Socket::AncillaryData objects such as:
- *
- * #<Socket::AncillaryData: AF_UNIX SOCKET RIGHTS 7>
- *
- * _maxmesglen_ and _maxcontrollen_ can be nil.
- * In that case, the buffer will be grown until the message is not truncated.
- * Internally, MSG_PEEK is used and MSG_TRUNC/MSG_CTRUNC are checked.
- *
- * recvmsg can be used to implement recv_io as follows:
- *
- * mesg, sender_sockaddr, rflags, *controls = sock.recvmsg(:scm_rights=>true)
- * controls.each {|ancdata|
- * if ancdata.cmsg_is?(:SOCKET, :RIGHTS)
- * return ancdata.unix_rights[0]
- * end
- * }
- *
- */
VALUE
-rsock_bsock_recvmsg(int argc, VALUE *argv, VALUE sock)
+rsock_bsock_recvmsg(VALUE sock, VALUE dlen, VALUE flags, VALUE clen,
+ VALUE scm_rights)
{
- return bsock_recvmsg_internal(argc, argv, sock, 0);
+ VALUE ex = Qtrue;
+ return bsock_recvmsg_internal(sock, dlen, flags, clen, scm_rights, ex, 0);
}
#endif
#if defined(HAVE_RECVMSG)
-/*
- * call-seq:
- * basicsocket.recvmsg_nonblock(maxdatalen=nil, flags=0, maxcontrollen=nil, opts={}) => [data, sender_addrinfo, rflags, *controls]
- *
- * recvmsg receives a message using recvmsg(2) system call in non-blocking manner.
- *
- * It is similar to BasicSocket#recvmsg
- * but non-blocking flag is set before the system call
- * and it doesn't retry the system call.
- *
- */
VALUE
-rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock)
+rsock_bsock_recvmsg_nonblock(VALUE sock, VALUE dlen, VALUE flags, VALUE clen,
+ VALUE scm_rights, VALUE ex)
{
- return bsock_recvmsg_internal(argc, argv, sock, 1);
+ return bsock_recvmsg_internal(sock, dlen, flags, clen, scm_rights, ex, 1);
}
#endif
@@ -1831,4 +1726,7 @@ rsock_init_ancdata(void)
rb_define_method(rb_cAncillaryData, "ipv6_pktinfo_addr", ancillary_ipv6_pktinfo_addr, 0);
rb_define_method(rb_cAncillaryData, "ipv6_pktinfo_ifindex", ancillary_ipv6_pktinfo_ifindex, 0);
#endif
+#undef rb_intern
+ sym_wait_readable = ID2SYM(rb_intern("wait_readable"));
+ sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
}
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index bce085b632..2d2b22e1a9 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -66,9 +66,6 @@ bsock_shutdown(int argc, VALUE *argv, VALUE sock)
int how;
rb_io_t *fptr;
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't shutdown socket");
- }
rb_scan_args(argc, argv, "01", &howto);
if (howto == Qnil)
how = SHUT_RDWR;
@@ -100,9 +97,6 @@ bsock_close_read(VALUE sock)
{
rb_io_t *fptr;
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't close socket");
- }
GetOpenFile(sock, fptr);
shutdown(fptr->fd, 0);
if (!(fptr->mode & FMODE_WRITABLE)) {
@@ -133,9 +127,6 @@ bsock_close_write(VALUE sock)
{
rb_io_t *fptr;
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't close socket");
- }
GetOpenFile(sock, fptr);
if (!(fptr->mode & FMODE_READABLE)) {
return rb_io_close(sock);
@@ -222,9 +213,8 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
rb_scan_args(argc, argv, "30", &lev, &optname, &val);
}
- rb_secure(2);
GetOpenFile(sock, fptr);
- family = rsock_getfamily(fptr->fd);
+ family = rsock_getfamily(fptr);
level = rsock_level_arg(family, lev);
option = rsock_optname_arg(family, level, optname);
@@ -254,7 +244,6 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
return INT2FIX(0);
}
-#if !defined(__BEOS__)
/*
* Document-method: getsockopt
* call-seq:
@@ -321,7 +310,7 @@ bsock_getsockopt(VALUE sock, VALUE lev, VALUE optname)
int family;
GetOpenFile(sock, fptr);
- family = rsock_getfamily(fptr->fd);
+ family = rsock_getfamily(fptr);
level = rsock_level_arg(family, lev);
option = rsock_optname_arg(family, level, optname);
len = 256;
@@ -334,9 +323,6 @@ bsock_getsockopt(VALUE sock, VALUE lev, VALUE optname)
return rsock_sockopt_new(family, level, option, rb_str_new(buf, len));
}
-#else
-#define bsock_getsockopt rb_f_notimplement
-#endif
/*
* call-seq:
@@ -563,7 +549,7 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
GetOpenFile(sock, fptr);
arg.fd = fptr->fd;
arg.flags = NUM2INT(flags);
- while (rb_thread_fd_writable(arg.fd),
+ while (rsock_maybe_fd_writable(arg.fd),
(n = (int)BLOCKING_REGION_FD(func, &arg)) < 0) {
if (rb_io_wait_writable(arg.fd)) {
continue;
@@ -579,11 +565,13 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
*
* Gets the do_not_reverse_lookup flag of _basicsocket_.
*
+ * BasicSocket.do_not_reverse_lookup = false
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
* p sock.do_not_reverse_lookup #=> false
- * p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
- * sock.do_not_reverse_lookup = true
- * p sock.peeraddr #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
+ * }
+ * BasicSocket.do_not_reverse_lookup = true
+ * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
+ * p sock.do_not_reverse_lookup #=> true
* }
*/
static VALUE
@@ -601,10 +589,12 @@ bsock_do_not_reverse_lookup(VALUE sock)
*
* Sets the do_not_reverse_lookup flag of _basicsocket_.
*
- * BasicSocket.do_not_reverse_lookup = false
- * p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> false
- * BasicSocket.do_not_reverse_lookup = true
- * p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> true
+ * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
+ * p sock.do_not_reverse_lookup #=> true
+ * p sock.peeraddr #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
+ * sock.do_not_reverse_lookup = false
+ * p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "54.163.249.195"]
+ * }
*
*/
static VALUE
@@ -624,8 +614,7 @@ bsock_do_not_reverse_lookup_set(VALUE sock, VALUE state)
/*
* call-seq:
- * basicsocket.recv(maxlen) => mesg
- * basicsocket.recv(maxlen, flags) => mesg
+ * basicsocket.recv(maxlen[, flags[, outbuf]]) => mesg
*
* Receives a message.
*
@@ -633,6 +622,9 @@ bsock_do_not_reverse_lookup_set(VALUE sock, VALUE state)
*
* _flags_ should be a bitwise OR of Socket::MSG_* constants.
*
+ * _outbuf_ will contain only the received data after the method call
+ * even if it is not empty at the beginning.
+ *
* UNIXSocket.pair {|s1, s2|
* s1.puts "Hello World"
* p s2.recv(4) #=> "Hell"
@@ -647,55 +639,11 @@ bsock_recv(int argc, VALUE *argv, VALUE sock)
return rsock_s_recvfrom(sock, argc, argv, RECV_RECV);
}
-/*
- * call-seq:
- * basicsocket.recv_nonblock(maxlen) => mesg
- * basicsocket.recv_nonblock(maxlen, flags) => mesg
- *
- * Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * _flags_ is zero or more of the +MSG_+ options.
- * The result, _mesg_, is the data received.
- *
- * When recvfrom(2) returns 0, Socket#recv_nonblock returns
- * an empty string as data.
- * The meaning depends on the socket: EOF on TCP, empty packet on UDP, etc.
- *
- * === Parameters
- * * +maxlen+ - the number of bytes to receive from the socket
- * * +flags+ - zero or more of the +MSG_+ options
- *
- * === Example
- * serv = TCPServer.new("127.0.0.1", 0)
- * af, port, host, addr = serv.addr
- * c = TCPSocket.new(addr, port)
- * s = serv.accept
- * c.send "aaa", 0
- * begin # emulate blocking recv.
- * p s.recv_nonblock(10) #=> "aaa"
- * rescue IO::WaitReadable
- * IO.select([s])
- * retry
- * end
- *
- * Refer to Socket#recvfrom for the exceptions that may be thrown if the call
- * to _recv_nonblock_ fails.
- *
- * BasicSocket#recv_nonblock may raise any error corresponding to recvfrom(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK or Errno::AGAIN,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying recv_nonblock.
- *
- * === See
- * * Socket#recvfrom
- */
-
+/* :nodoc: */
static VALUE
-bsock_recv_nonblock(int argc, VALUE *argv, VALUE sock)
+bsock_recv_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex)
{
- return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_RECV);
+ return rsock_s_recvfrom_nonblock(sock, len, flg, str, ex, RECV_RECV);
}
/*
@@ -764,13 +712,22 @@ rsock_init_basicsocket(void)
rb_define_method(rb_cBasicSocket, "remote_address", bsock_remote_address, 0);
rb_define_method(rb_cBasicSocket, "send", rsock_bsock_send, -1);
rb_define_method(rb_cBasicSocket, "recv", bsock_recv, -1);
- rb_define_method(rb_cBasicSocket, "recv_nonblock", bsock_recv_nonblock, -1);
+
rb_define_method(rb_cBasicSocket, "do_not_reverse_lookup", bsock_do_not_reverse_lookup, 0);
rb_define_method(rb_cBasicSocket, "do_not_reverse_lookup=", bsock_do_not_reverse_lookup_set, 1);
- rb_define_method(rb_cBasicSocket, "sendmsg", rsock_bsock_sendmsg, -1); /* in ancdata.c */
- rb_define_method(rb_cBasicSocket, "sendmsg_nonblock", rsock_bsock_sendmsg_nonblock, -1); /* in ancdata.c */
- rb_define_method(rb_cBasicSocket, "recvmsg", rsock_bsock_recvmsg, -1); /* in ancdata.c */
- rb_define_method(rb_cBasicSocket, "recvmsg_nonblock", rsock_bsock_recvmsg_nonblock, -1); /* in ancdata.c */
+ /* for ext/socket/lib/socket.rb use only: */
+ rb_define_private_method(rb_cBasicSocket,
+ "__recv_nonblock", bsock_recv_nonblock, 4);
+
+ /* in ancdata.c */
+ rb_define_private_method(rb_cBasicSocket, "__sendmsg",
+ rsock_bsock_sendmsg, 4);
+ rb_define_private_method(rb_cBasicSocket, "__sendmsg_nonblock",
+ rsock_bsock_sendmsg_nonblock, 5);
+ rb_define_private_method(rb_cBasicSocket, "__recvmsg",
+ rsock_bsock_recvmsg, 4);
+ rb_define_private_method(rb_cBasicSocket, "__recvmsg_nonblock",
+ rsock_bsock_recvmsg_nonblock, 5);
}
diff --git a/ext/socket/constants.c b/ext/socket/constants.c
index bab27b23bb..6fc862777e 100644
--- a/ext/socket/constants.c
+++ b/ext/socket/constants.c
@@ -22,7 +22,7 @@ constant_arg(VALUE arg, int (*str_to_int)(const char*, long, int*), const char *
int ret;
if (SYMBOL_P(arg)) {
- arg = rb_sym_to_s(arg);
+ arg = rb_sym2str(arg);
goto str;
}
else if (!NIL_P(tmp = rb_check_string_type(arg))) {
diff --git a/ext/socket/depend b/ext/socket/depend
index cd3fae98ea..30ecfc5b52 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,29 +1,295 @@
-SOCK_HEADERS = $(srcdir)/rubysocket.h $(HDRS) $(ruby_headers) \
- $(hdrdir)/ruby/encoding.h \
- $(hdrdir)/ruby/oniguruma.h \
- $(hdrdir)/ruby/util.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)
-constants.o: constants.c constdefs.c $(SOCK_HEADERS)
-basicsocket.o: basicsocket.c $(SOCK_HEADERS)
-socket.o: socket.c $(SOCK_HEADERS)
-ifaddr.o: ifaddr.c $(SOCK_HEADERS)
-ipsocket.o: ipsocket.c $(SOCK_HEADERS)
-tcpsocket.o: tcpsocket.c $(SOCK_HEADERS)
-tcpserver.o: tcpserver.c $(SOCK_HEADERS)
-sockssocket.o: sockssocket.c $(SOCK_HEADERS)
-udpsocket.o: udpsocket.c $(SOCK_HEADERS)
-unixsocket.o: unixsocket.c $(SOCK_HEADERS)
-unixserver.o: unixserver.c $(SOCK_HEADERS)
-option.o: option.c $(SOCK_HEADERS)
-ancdata.o: ancdata.c $(SOCK_HEADERS)
-raddrinfo.o: raddrinfo.c $(SOCK_HEADERS)
-
getnameinfo.o: getnameinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
getaddrinfo.o: getaddrinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
constdefs.h constdefs.c : $(srcdir)/mkconstants.rb
@echo "generating constant definitions"
@$(RUBY) $(srcdir)/mkconstants.rb -H constdefs.h -o constdefs.c
+
+# AUTOGENERATED DEPENDENCIES START
+ancdata.o: $(RUBY_EXTCONF_H)
+ancdata.o: $(arch_hdrdir)/ruby/config.h
+ancdata.o: $(hdrdir)/ruby/defines.h
+ancdata.o: $(hdrdir)/ruby/encoding.h
+ancdata.o: $(hdrdir)/ruby/intern.h
+ancdata.o: $(hdrdir)/ruby/io.h
+ancdata.o: $(hdrdir)/ruby/missing.h
+ancdata.o: $(hdrdir)/ruby/oniguruma.h
+ancdata.o: $(hdrdir)/ruby/ruby.h
+ancdata.o: $(hdrdir)/ruby/st.h
+ancdata.o: $(hdrdir)/ruby/subst.h
+ancdata.o: $(hdrdir)/ruby/thread.h
+ancdata.o: $(hdrdir)/ruby/util.h
+ancdata.o: $(top_srcdir)/include/ruby.h
+ancdata.o: $(top_srcdir)/internal.h
+ancdata.o: ancdata.c
+ancdata.o: constdefs.h
+ancdata.o: rubysocket.h
+ancdata.o: sockport.h
+basicsocket.o: $(RUBY_EXTCONF_H)
+basicsocket.o: $(arch_hdrdir)/ruby/config.h
+basicsocket.o: $(hdrdir)/ruby/defines.h
+basicsocket.o: $(hdrdir)/ruby/encoding.h
+basicsocket.o: $(hdrdir)/ruby/intern.h
+basicsocket.o: $(hdrdir)/ruby/io.h
+basicsocket.o: $(hdrdir)/ruby/missing.h
+basicsocket.o: $(hdrdir)/ruby/oniguruma.h
+basicsocket.o: $(hdrdir)/ruby/ruby.h
+basicsocket.o: $(hdrdir)/ruby/st.h
+basicsocket.o: $(hdrdir)/ruby/subst.h
+basicsocket.o: $(hdrdir)/ruby/thread.h
+basicsocket.o: $(hdrdir)/ruby/util.h
+basicsocket.o: $(top_srcdir)/include/ruby.h
+basicsocket.o: $(top_srcdir)/internal.h
+basicsocket.o: basicsocket.c
+basicsocket.o: constdefs.h
+basicsocket.o: rubysocket.h
+basicsocket.o: sockport.h
+constants.o: $(RUBY_EXTCONF_H)
+constants.o: $(arch_hdrdir)/ruby/config.h
+constants.o: $(hdrdir)/ruby/defines.h
+constants.o: $(hdrdir)/ruby/encoding.h
+constants.o: $(hdrdir)/ruby/intern.h
+constants.o: $(hdrdir)/ruby/io.h
+constants.o: $(hdrdir)/ruby/missing.h
+constants.o: $(hdrdir)/ruby/oniguruma.h
+constants.o: $(hdrdir)/ruby/ruby.h
+constants.o: $(hdrdir)/ruby/st.h
+constants.o: $(hdrdir)/ruby/subst.h
+constants.o: $(hdrdir)/ruby/thread.h
+constants.o: $(hdrdir)/ruby/util.h
+constants.o: $(top_srcdir)/include/ruby.h
+constants.o: $(top_srcdir)/internal.h
+constants.o: constants.c
+constants.o: constdefs.c
+constants.o: constdefs.h
+constants.o: rubysocket.h
+constants.o: sockport.h
+ifaddr.o: $(RUBY_EXTCONF_H)
+ifaddr.o: $(arch_hdrdir)/ruby/config.h
+ifaddr.o: $(hdrdir)/ruby/defines.h
+ifaddr.o: $(hdrdir)/ruby/encoding.h
+ifaddr.o: $(hdrdir)/ruby/intern.h
+ifaddr.o: $(hdrdir)/ruby/io.h
+ifaddr.o: $(hdrdir)/ruby/missing.h
+ifaddr.o: $(hdrdir)/ruby/oniguruma.h
+ifaddr.o: $(hdrdir)/ruby/ruby.h
+ifaddr.o: $(hdrdir)/ruby/st.h
+ifaddr.o: $(hdrdir)/ruby/subst.h
+ifaddr.o: $(hdrdir)/ruby/thread.h
+ifaddr.o: $(hdrdir)/ruby/util.h
+ifaddr.o: $(top_srcdir)/include/ruby.h
+ifaddr.o: $(top_srcdir)/internal.h
+ifaddr.o: constdefs.h
+ifaddr.o: ifaddr.c
+ifaddr.o: rubysocket.h
+ifaddr.o: sockport.h
+init.o: $(RUBY_EXTCONF_H)
+init.o: $(arch_hdrdir)/ruby/config.h
+init.o: $(hdrdir)/ruby/defines.h
+init.o: $(hdrdir)/ruby/encoding.h
+init.o: $(hdrdir)/ruby/intern.h
+init.o: $(hdrdir)/ruby/io.h
+init.o: $(hdrdir)/ruby/missing.h
+init.o: $(hdrdir)/ruby/oniguruma.h
+init.o: $(hdrdir)/ruby/ruby.h
+init.o: $(hdrdir)/ruby/st.h
+init.o: $(hdrdir)/ruby/subst.h
+init.o: $(hdrdir)/ruby/thread.h
+init.o: $(hdrdir)/ruby/util.h
+init.o: $(top_srcdir)/include/ruby.h
+init.o: $(top_srcdir)/internal.h
+init.o: constdefs.h
+init.o: init.c
+init.o: rubysocket.h
+init.o: sockport.h
+ipsocket.o: $(RUBY_EXTCONF_H)
+ipsocket.o: $(arch_hdrdir)/ruby/config.h
+ipsocket.o: $(hdrdir)/ruby/defines.h
+ipsocket.o: $(hdrdir)/ruby/encoding.h
+ipsocket.o: $(hdrdir)/ruby/intern.h
+ipsocket.o: $(hdrdir)/ruby/io.h
+ipsocket.o: $(hdrdir)/ruby/missing.h
+ipsocket.o: $(hdrdir)/ruby/oniguruma.h
+ipsocket.o: $(hdrdir)/ruby/ruby.h
+ipsocket.o: $(hdrdir)/ruby/st.h
+ipsocket.o: $(hdrdir)/ruby/subst.h
+ipsocket.o: $(hdrdir)/ruby/thread.h
+ipsocket.o: $(hdrdir)/ruby/util.h
+ipsocket.o: $(top_srcdir)/include/ruby.h
+ipsocket.o: $(top_srcdir)/internal.h
+ipsocket.o: constdefs.h
+ipsocket.o: ipsocket.c
+ipsocket.o: rubysocket.h
+ipsocket.o: sockport.h
+option.o: $(RUBY_EXTCONF_H)
+option.o: $(arch_hdrdir)/ruby/config.h
+option.o: $(hdrdir)/ruby/defines.h
+option.o: $(hdrdir)/ruby/encoding.h
+option.o: $(hdrdir)/ruby/intern.h
+option.o: $(hdrdir)/ruby/io.h
+option.o: $(hdrdir)/ruby/missing.h
+option.o: $(hdrdir)/ruby/oniguruma.h
+option.o: $(hdrdir)/ruby/ruby.h
+option.o: $(hdrdir)/ruby/st.h
+option.o: $(hdrdir)/ruby/subst.h
+option.o: $(hdrdir)/ruby/thread.h
+option.o: $(hdrdir)/ruby/util.h
+option.o: $(top_srcdir)/include/ruby.h
+option.o: $(top_srcdir)/internal.h
+option.o: constdefs.h
+option.o: option.c
+option.o: rubysocket.h
+option.o: sockport.h
+raddrinfo.o: $(RUBY_EXTCONF_H)
+raddrinfo.o: $(arch_hdrdir)/ruby/config.h
+raddrinfo.o: $(hdrdir)/ruby/defines.h
+raddrinfo.o: $(hdrdir)/ruby/encoding.h
+raddrinfo.o: $(hdrdir)/ruby/intern.h
+raddrinfo.o: $(hdrdir)/ruby/io.h
+raddrinfo.o: $(hdrdir)/ruby/missing.h
+raddrinfo.o: $(hdrdir)/ruby/oniguruma.h
+raddrinfo.o: $(hdrdir)/ruby/ruby.h
+raddrinfo.o: $(hdrdir)/ruby/st.h
+raddrinfo.o: $(hdrdir)/ruby/subst.h
+raddrinfo.o: $(hdrdir)/ruby/thread.h
+raddrinfo.o: $(hdrdir)/ruby/util.h
+raddrinfo.o: $(top_srcdir)/include/ruby.h
+raddrinfo.o: $(top_srcdir)/internal.h
+raddrinfo.o: constdefs.h
+raddrinfo.o: raddrinfo.c
+raddrinfo.o: rubysocket.h
+raddrinfo.o: sockport.h
+socket.o: $(RUBY_EXTCONF_H)
+socket.o: $(arch_hdrdir)/ruby/config.h
+socket.o: $(hdrdir)/ruby/defines.h
+socket.o: $(hdrdir)/ruby/encoding.h
+socket.o: $(hdrdir)/ruby/intern.h
+socket.o: $(hdrdir)/ruby/io.h
+socket.o: $(hdrdir)/ruby/missing.h
+socket.o: $(hdrdir)/ruby/oniguruma.h
+socket.o: $(hdrdir)/ruby/ruby.h
+socket.o: $(hdrdir)/ruby/st.h
+socket.o: $(hdrdir)/ruby/subst.h
+socket.o: $(hdrdir)/ruby/thread.h
+socket.o: $(hdrdir)/ruby/util.h
+socket.o: $(top_srcdir)/include/ruby.h
+socket.o: $(top_srcdir)/internal.h
+socket.o: constdefs.h
+socket.o: rubysocket.h
+socket.o: socket.c
+socket.o: sockport.h
+sockssocket.o: $(RUBY_EXTCONF_H)
+sockssocket.o: $(arch_hdrdir)/ruby/config.h
+sockssocket.o: $(hdrdir)/ruby/defines.h
+sockssocket.o: $(hdrdir)/ruby/encoding.h
+sockssocket.o: $(hdrdir)/ruby/intern.h
+sockssocket.o: $(hdrdir)/ruby/io.h
+sockssocket.o: $(hdrdir)/ruby/missing.h
+sockssocket.o: $(hdrdir)/ruby/oniguruma.h
+sockssocket.o: $(hdrdir)/ruby/ruby.h
+sockssocket.o: $(hdrdir)/ruby/st.h
+sockssocket.o: $(hdrdir)/ruby/subst.h
+sockssocket.o: $(hdrdir)/ruby/thread.h
+sockssocket.o: $(hdrdir)/ruby/util.h
+sockssocket.o: $(top_srcdir)/include/ruby.h
+sockssocket.o: $(top_srcdir)/internal.h
+sockssocket.o: constdefs.h
+sockssocket.o: rubysocket.h
+sockssocket.o: sockport.h
+sockssocket.o: sockssocket.c
+tcpserver.o: $(RUBY_EXTCONF_H)
+tcpserver.o: $(arch_hdrdir)/ruby/config.h
+tcpserver.o: $(hdrdir)/ruby/defines.h
+tcpserver.o: $(hdrdir)/ruby/encoding.h
+tcpserver.o: $(hdrdir)/ruby/intern.h
+tcpserver.o: $(hdrdir)/ruby/io.h
+tcpserver.o: $(hdrdir)/ruby/missing.h
+tcpserver.o: $(hdrdir)/ruby/oniguruma.h
+tcpserver.o: $(hdrdir)/ruby/ruby.h
+tcpserver.o: $(hdrdir)/ruby/st.h
+tcpserver.o: $(hdrdir)/ruby/subst.h
+tcpserver.o: $(hdrdir)/ruby/thread.h
+tcpserver.o: $(hdrdir)/ruby/util.h
+tcpserver.o: $(top_srcdir)/include/ruby.h
+tcpserver.o: $(top_srcdir)/internal.h
+tcpserver.o: constdefs.h
+tcpserver.o: rubysocket.h
+tcpserver.o: sockport.h
+tcpserver.o: tcpserver.c
+tcpsocket.o: $(RUBY_EXTCONF_H)
+tcpsocket.o: $(arch_hdrdir)/ruby/config.h
+tcpsocket.o: $(hdrdir)/ruby/defines.h
+tcpsocket.o: $(hdrdir)/ruby/encoding.h
+tcpsocket.o: $(hdrdir)/ruby/intern.h
+tcpsocket.o: $(hdrdir)/ruby/io.h
+tcpsocket.o: $(hdrdir)/ruby/missing.h
+tcpsocket.o: $(hdrdir)/ruby/oniguruma.h
+tcpsocket.o: $(hdrdir)/ruby/ruby.h
+tcpsocket.o: $(hdrdir)/ruby/st.h
+tcpsocket.o: $(hdrdir)/ruby/subst.h
+tcpsocket.o: $(hdrdir)/ruby/thread.h
+tcpsocket.o: $(hdrdir)/ruby/util.h
+tcpsocket.o: $(top_srcdir)/include/ruby.h
+tcpsocket.o: $(top_srcdir)/internal.h
+tcpsocket.o: constdefs.h
+tcpsocket.o: rubysocket.h
+tcpsocket.o: sockport.h
+tcpsocket.o: tcpsocket.c
+udpsocket.o: $(RUBY_EXTCONF_H)
+udpsocket.o: $(arch_hdrdir)/ruby/config.h
+udpsocket.o: $(hdrdir)/ruby/defines.h
+udpsocket.o: $(hdrdir)/ruby/encoding.h
+udpsocket.o: $(hdrdir)/ruby/intern.h
+udpsocket.o: $(hdrdir)/ruby/io.h
+udpsocket.o: $(hdrdir)/ruby/missing.h
+udpsocket.o: $(hdrdir)/ruby/oniguruma.h
+udpsocket.o: $(hdrdir)/ruby/ruby.h
+udpsocket.o: $(hdrdir)/ruby/st.h
+udpsocket.o: $(hdrdir)/ruby/subst.h
+udpsocket.o: $(hdrdir)/ruby/thread.h
+udpsocket.o: $(hdrdir)/ruby/util.h
+udpsocket.o: $(top_srcdir)/include/ruby.h
+udpsocket.o: $(top_srcdir)/internal.h
+udpsocket.o: constdefs.h
+udpsocket.o: rubysocket.h
+udpsocket.o: sockport.h
+udpsocket.o: udpsocket.c
+unixserver.o: $(RUBY_EXTCONF_H)
+unixserver.o: $(arch_hdrdir)/ruby/config.h
+unixserver.o: $(hdrdir)/ruby/defines.h
+unixserver.o: $(hdrdir)/ruby/encoding.h
+unixserver.o: $(hdrdir)/ruby/intern.h
+unixserver.o: $(hdrdir)/ruby/io.h
+unixserver.o: $(hdrdir)/ruby/missing.h
+unixserver.o: $(hdrdir)/ruby/oniguruma.h
+unixserver.o: $(hdrdir)/ruby/ruby.h
+unixserver.o: $(hdrdir)/ruby/st.h
+unixserver.o: $(hdrdir)/ruby/subst.h
+unixserver.o: $(hdrdir)/ruby/thread.h
+unixserver.o: $(hdrdir)/ruby/util.h
+unixserver.o: $(top_srcdir)/include/ruby.h
+unixserver.o: $(top_srcdir)/internal.h
+unixserver.o: constdefs.h
+unixserver.o: rubysocket.h
+unixserver.o: sockport.h
+unixserver.o: unixserver.c
+unixsocket.o: $(RUBY_EXTCONF_H)
+unixsocket.o: $(arch_hdrdir)/ruby/config.h
+unixsocket.o: $(hdrdir)/ruby/defines.h
+unixsocket.o: $(hdrdir)/ruby/encoding.h
+unixsocket.o: $(hdrdir)/ruby/intern.h
+unixsocket.o: $(hdrdir)/ruby/io.h
+unixsocket.o: $(hdrdir)/ruby/missing.h
+unixsocket.o: $(hdrdir)/ruby/oniguruma.h
+unixsocket.o: $(hdrdir)/ruby/ruby.h
+unixsocket.o: $(hdrdir)/ruby/st.h
+unixsocket.o: $(hdrdir)/ruby/subst.h
+unixsocket.o: $(hdrdir)/ruby/thread.h
+unixsocket.o: $(hdrdir)/ruby/util.h
+unixsocket.o: $(top_srcdir)/include/ruby.h
+unixsocket.o: $(top_srcdir)/internal.h
+unixsocket.o: constdefs.h
+unixsocket.o: rubysocket.h
+unixsocket.o: sockport.h
+unixsocket.o: unixsocket.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index f3be5862f0..fd70be45da 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
AF_INET6_SOCKET_CREATION_TEST = <<EOF
@@ -309,6 +310,7 @@ end
xti.h
netinet/in_systm.h
netinet/tcp.h
+ netinet/tcp_fsm.h
netinet/udp.h
arpa/inet.h
netpacket/packet.h
@@ -332,6 +334,7 @@ end
have_struct_member("struct sockaddr", "sa_len", headers) # 4.4BSD
have_struct_member("struct sockaddr_in", "sin_len", headers) # 4.4BSD
+have_struct_member("struct sockaddr_in6", "sin6_len", headers) # 4.4BSD
if have_type("struct sockaddr_un", headers) # POSIX
have_struct_member("struct sockaddr_un", "sun_len", headers) # 4.4BSD
@@ -369,21 +372,73 @@ have_msg_control = nil
have_msg_control = have_struct_member('struct msghdr', 'msg_control', headers) unless $mswin or $mingw
have_struct_member('struct msghdr', 'msg_accrights', headers)
+if have_type("struct tcp_info", headers)
+ have_const("TCP_ESTABLISHED", headers)
+ have_const("TCP_SYN_SENT", headers)
+ have_const("TCP_SYN_RECV", headers)
+ have_const("TCP_FIN_WAIT1", headers)
+ have_const("TCP_FIN_WAIT2", headers)
+ have_const("TCP_TIME_WAIT", headers)
+ have_const("TCP_CLOSE", headers)
+ have_const("TCP_CLOSE_WAIT", headers)
+ have_const("TCP_LAST_ACK", headers)
+ have_const("TCP_LISTEN", headers)
+ have_const("TCP_CLOSING", headers)
+ have_struct_member('struct tcp_info', 'tcpi_state', headers)
+ if /solaris/ !~ RUBY_PLATFORM
+ have_struct_member('struct tcp_info', 'tcpi_ca_state', headers)
+ end
+ have_struct_member('struct tcp_info', 'tcpi_retransmits', headers)
+ have_struct_member('struct tcp_info', 'tcpi_probes', headers)
+ have_struct_member('struct tcp_info', 'tcpi_backoff', headers)
+ have_struct_member('struct tcp_info', 'tcpi_options', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_wscale', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rcv_wscale', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rto', headers)
+ have_struct_member('struct tcp_info', 'tcpi_ato', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_mss', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rcv_mss', headers)
+ have_struct_member('struct tcp_info', 'tcpi_unacked', headers)
+ have_struct_member('struct tcp_info', 'tcpi_sacked', headers)
+ have_struct_member('struct tcp_info', 'tcpi_lost', headers)
+ have_struct_member('struct tcp_info', 'tcpi_retrans', headers)
+ have_struct_member('struct tcp_info', 'tcpi_fackets', headers)
+ have_struct_member('struct tcp_info', 'tcpi_last_data_sent', headers)
+ have_struct_member('struct tcp_info', 'tcpi_last_ack_sent', headers)
+ have_struct_member('struct tcp_info', 'tcpi_last_data_recv', headers)
+ have_struct_member('struct tcp_info', 'tcpi_last_ack_recv', headers)
+ have_struct_member('struct tcp_info', 'tcpi_pmtu', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rcv_ssthresh', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rtt', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rttvar', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_ssthresh', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_cwnd', headers)
+ have_struct_member('struct tcp_info', 'tcpi_advmss', headers)
+ have_struct_member('struct tcp_info', 'tcpi_reordering', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rcv_rtt', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rcv_space', headers)
+ have_struct_member('struct tcp_info', 'tcpi_total_retrans', headers)
+
+ # FreeBSD extension
+ have_struct_member('struct tcp_info', 'tcpi_snd_wnd', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_bwnd', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_nxt', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rcv_nxt', headers)
+ have_struct_member('struct tcp_info', 'tcpi_toe_tid', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_rexmitpack', headers)
+ have_struct_member('struct tcp_info', 'tcpi_rcv_ooopack', headers)
+ have_struct_member('struct tcp_info', 'tcpi_snd_zerowin', headers)
+end
+
case RUBY_PLATFORM
when /mswin(32|64)|mingw/
test_func = "WSACleanup"
have_library("ws2_32", "WSACleanup", headers)
when /cygwin/
test_func = "socket(0,0,0)"
-when /beos/
- test_func = "socket(0,0,0)"
- have_library("net", "socket(0,0,0)", headers)
when /haiku/
test_func = "socket(0,0,0)"
have_library("network", "socket(0,0,0)", headers)
-when /i386-os2_emx/
- test_func = "socket(0,0,0)"
- have_library("socket", "socket(0,0,0)", headers)
else
test_func = "socket(0,0,0)"
have_library("nsl", 't_open("", 0, (struct t_info *)NULL)', headers) # SunOS
@@ -450,7 +505,7 @@ EOF
end
ipv6 = false
- default_ipv6 = /beos|haiku/ !~ RUBY_PLATFORM
+ default_ipv6 = /haiku/ !~ RUBY_PLATFORM
if enable_config("ipv6", default_ipv6)
if checking_for("ipv6") {try_link(AF_INET6_SOCKET_CREATION_TEST)}
$defs << "-DENABLE_IPV6" << "-DINET6"
@@ -507,29 +562,15 @@ EOS
case enable_config("wide-getaddrinfo")
when true
getaddr_info_ok = :wide
- when nil
- if have_func("getnameinfo", headers) and have_func("getaddrinfo", headers)
- getaddr_info_ok = :os
- if !CROSS_COMPILING &&
- !checking_for("system getaddrinfo working") {
- try_run(cpp_include(headers) + GETADDRINFO_GETNAMEINFO_TEST)
- }
- getaddr_info_ok = :wide
- end
- else
- getaddr_info_ok = :wide
- end
- when false
+ when nil, false
+ getaddr_info_ok = (:wide if getaddr_info_ok.nil?)
if have_func("getnameinfo", headers) and have_func("getaddrinfo", headers)
- getaddr_info_ok = :os
- if !CROSS_COMPILING &&
- !checking_for("system getaddrinfo working") {
+ if CROSS_COMPILING ||
+ checking_for("system getaddrinfo working") {
try_run(cpp_include(headers) + GETADDRINFO_GETNAMEINFO_TEST)
}
- getaddr_info_ok = nil
+ getaddr_info_ok = :os
end
- else
- getaddr_info_ok = nil
end
else
raise "unexpected enable_config() value"
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index a17d12b705..b01f1cb82e 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -45,11 +45,7 @@
#include <sys/types.h>
#ifndef _WIN32
#include <sys/param.h>
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
-# include <net/socket.h>
-#else
-# include <sys/socket.h>
-#endif
+#include <sys/socket.h>
#include <netinet/in.h>
#if defined(HAVE_ARPA_INET_H)
#include <arpa/inet.h>
@@ -66,6 +62,9 @@
#endif
#include <unistd.h>
#else
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+#include <windows.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#include <io.h>
@@ -436,11 +435,8 @@ getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *h
s = socket(afd->a_af, SOCK_DGRAM, 0);
if (s < 0)
continue;
-#if defined(__BEOS__)
- closesocket(s);
-#else
+
close(s);
-#endif
if (pai->ai_flags & AI_PASSIVE) {
GET_AI(cur->ai_next, afd, afd->a_addrany, port);
@@ -593,6 +589,7 @@ get_addr(const char *hostname, int af, struct addrinfo **res, struct addrinfo *p
} else
hp = getipnodebyname(hostname, af, AI_ADDRCONFIG, &h_error);
#else
+ if (strlen(hostname) >= NI_MAXHOST) ERR(EAI_NODATA);
hp = gethostbyname((char*)hostname);
h_error = h_errno;
#endif
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 4da9680ccb..b7e75f7d27 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -41,11 +41,7 @@
#include <stdio.h>
#include <sys/types.h>
#ifndef _WIN32
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
-# include <net/socket.h>
-#else
-# include <sys/socket.h>
-#endif
+#include <sys/socket.h>
#include <netinet/in.h>
#if defined(HAVE_ARPA_INET_H)
#include <arpa/inet.h>
@@ -59,6 +55,9 @@
#endif
#endif
#ifdef _WIN32
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+#include <windows.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#define snprintf _snprintf
@@ -118,24 +117,6 @@ static struct afd {
#define ENI_FAMILY 5
#define ENI_SALEN 6
-#ifndef HAVE_INET_NTOP
-static const char *
-inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
-{
-#ifdef HAVE_INET_NTOA
- struct in_addr in;
- memcpy(&in.s_addr, addr, sizeof(in.s_addr));
- snprintf(numaddr, numaddr_len, "%s", inet_ntoa(in));
-#else
- unsigned long x = ntohl(*(unsigned long*)addr);
- snprintf(numaddr, numaddr_len, "%d.%d.%d.%d",
- (int) (x>>24) & 0xff, (int) (x>>16) & 0xff,
- (int) (x>> 8) & 0xff, (int) (x>> 0) & 0xff);
-#endif
- return numaddr;
-}
-#endif
-
int
getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
{
diff --git a/ext/socket/ifaddr.c b/ext/socket/ifaddr.c
index 16cd47be5a..a954163369 100644
--- a/ext/socket/ifaddr.c
+++ b/ext/socket/ifaddr.c
@@ -41,11 +41,6 @@ get_root(const rb_ifaddr_t *ifaddr)
}
static void
-ifaddr_mark(void *ptr)
-{
-}
-
-static void
ifaddr_free(void *ptr)
{
rb_ifaddr_t *ifaddr = ptr;
@@ -62,8 +57,6 @@ ifaddr_memsize(const void *ptr)
{
const rb_ifaddr_t *ifaddr;
const rb_ifaddr_root_t *root;
- if (ptr == NULL)
- return 0;
ifaddr = ptr;
root = get_root(ifaddr);
return sizeof(rb_ifaddr_root_t) + (root->numifaddrs - 1) * sizeof(rb_ifaddr_t);
@@ -71,10 +64,9 @@ ifaddr_memsize(const void *ptr)
static const rb_data_type_t ifaddr_type = {
"socket/ifaddr",
- {ifaddr_mark, ifaddr_free, ifaddr_memsize,},
+ {0, ifaddr_free, ifaddr_memsize,},
};
-#define IS_IFADDRS(obj) rb_typeddata_is_kind_of((obj), &ifaddr_type)
static inline rb_ifaddr_t *
check_ifaddr(VALUE self)
{
@@ -99,7 +91,7 @@ rsock_getifaddrs(void)
int numifaddrs, i;
struct ifaddrs *ifaddrs, *ifa;
rb_ifaddr_root_t *root;
- VALUE result;
+ VALUE result, addr;
ret = getifaddrs(&ifaddrs);
if (ret == -1)
@@ -113,8 +105,10 @@ rsock_getifaddrs(void)
for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next)
numifaddrs++;
+ addr = TypedData_Wrap_Struct(rb_cSockIfaddr, &ifaddr_type, 0);
root = xmalloc(sizeof(rb_ifaddr_root_t) + (numifaddrs-1) * sizeof(rb_ifaddr_t));
- root->refcount = root->numifaddrs = numifaddrs;
+ root->refcount = 0;
+ root->numifaddrs = numifaddrs;
ifa = ifaddrs;
for (i = 0; i < numifaddrs; i++) {
@@ -123,10 +117,15 @@ rsock_getifaddrs(void)
root->ary[i].root = root;
ifa = ifa->ifa_next;
}
+ RTYPEDDATA_DATA(addr) = &root->ary[0];
+ root->refcount++;
result = rb_ary_new2(numifaddrs);
- for (i = 0; i < numifaddrs; i++) {
- rb_ary_push(result, TypedData_Wrap_Struct(rb_cSockIfaddr, &ifaddr_type, &root->ary[i]));
+ rb_ary_push(result, addr);
+ for (i = 1; i < numifaddrs; i++) {
+ addr = TypedData_Wrap_Struct(rb_cSockIfaddr, &ifaddr_type, &root->ary[i]);
+ root->refcount++;
+ rb_ary_push(result, addr);
}
return result;
@@ -293,6 +292,9 @@ ifaddr_inspect_flags(ifa_flags_t flags, VALUE result)
#ifdef IFF_ALLMULTI
INSPECT_BIT(IFF_ALLMULTI, "ALLMULTI")
#endif
+#ifdef IFF_SIMPLEX
+ INSPECT_BIT(IFF_SIMPLEX, "SIMPLEX")
+#endif
#ifdef IFF_MASTER
INSPECT_BIT(IFF_MASTER, "MASTER")
#endif
diff --git a/ext/socket/init.c b/ext/socket/init.c
index 6d98a66d6e..1ecd4fe352 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -29,34 +29,43 @@ VALUE rb_cSOCKSSocket;
#endif
int rsock_do_not_reverse_lookup = 1;
+static VALUE sym_wait_readable;
void
rsock_raise_socket_error(const char *reason, int error)
{
#ifdef EAI_SYSTEM
- if (error == EAI_SYSTEM) rb_sys_fail(reason);
+ int e;
+ if (error == EAI_SYSTEM && (e = errno) != 0)
+ rb_syserr_fail(e, reason);
#endif
rb_raise(rb_eSocket, "%s: %s", reason, gai_strerror(error));
}
-VALUE
-rsock_init_sock(VALUE sock, int fd)
+#ifdef _WIN32
+#define is_socket(fd) rb_w32_is_socket(fd)
+#else
+static int
+is_socket(int fd)
{
- rb_io_t *fp;
-#ifndef _WIN32
struct stat sbuf;
if (fstat(fd, &sbuf) < 0)
rb_sys_fail("fstat(2)");
- rb_update_max_fd(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");
+ return S_ISSOCK(sbuf.st_mode);
+}
#endif
+VALUE
+rsock_init_sock(VALUE sock, int fd)
+{
+ rb_io_t *fp;
+
+ if (!is_socket(fd) || rb_reserved_fd_p(fd)) {
+ rb_syserr_fail(EBADF, "not a socket file descriptor");
+ }
+
+ rb_update_max_fd(fd);
MakeOpenFile(sock, fp);
fp->fd = fd;
fp->mode = FMODE_READWRITE|FMODE_DUPLEX;
@@ -107,21 +116,48 @@ recvfrom_blocking(void *data)
return (VALUE)ret;
}
+static VALUE
+rsock_strbuf(VALUE str, long buflen)
+{
+ long len;
+
+ if (NIL_P(str)) return rb_tainted_str_new(0, buflen);
+
+ StringValue(str);
+ len = RSTRING_LEN(str);
+ if (len >= buflen) {
+ rb_str_modify(str);
+ } else {
+ rb_str_modify_expand(str, buflen - len);
+ }
+ rb_str_set_len(str, buflen);
+ return str;
+}
+
+static VALUE
+recvfrom_locktmp(VALUE v)
+{
+ struct recvfrom_arg *arg = (struct recvfrom_arg *)v;
+
+ return rb_thread_io_blocking_region(recvfrom_blocking, arg, arg->fd);
+}
+
VALUE
rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
{
rb_io_t *fptr;
- VALUE str, klass;
+ VALUE str;
struct recvfrom_arg arg;
VALUE len, flg;
long buflen;
long slen;
- rb_scan_args(argc, argv, "11", &len, &flg);
+ rb_scan_args(argc, argv, "12", &len, &flg, &str);
if (flg == Qnil) arg.flags = 0;
else arg.flags = NUM2INT(flg);
buflen = NUM2INT(len);
+ str = rsock_strbuf(str, buflen);
GetOpenFile(sock, fptr);
if (rb_io_read_pending(fptr)) {
@@ -129,24 +165,18 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
}
arg.fd = fptr->fd;
arg.alen = (socklen_t)sizeof(arg.buf);
-
- arg.str = str = rb_tainted_str_new(0, buflen);
- klass = RBASIC(str)->klass;
- rb_obj_hide(str);
+ arg.str = str;
while (rb_io_check_closed(fptr),
- rb_thread_wait_fd(arg.fd),
- (slen = BLOCKING_REGION_FD(recvfrom_blocking, &arg)) < 0) {
+ rsock_maybe_wait_fd(arg.fd),
+ (slen = (long)rb_str_locktmp_ensure(str, recvfrom_locktmp,
+ (VALUE)&arg)) < 0) {
if (!rb_io_wait_readable(fptr->fd)) {
rb_sys_fail("recvfrom(2)");
}
- if (RBASIC(str)->klass || RSTRING_LEN(str) != buflen) {
- rb_raise(rb_eRuntimeError, "buffer string modified");
- }
}
- rb_obj_reveal(str, klass);
- if (slen < RSTRING_LEN(str)) {
+ if (slen != RSTRING_LEN(str)) {
rb_str_set_len(str, slen);
}
rb_obj_taint(str);
@@ -176,24 +206,21 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
}
VALUE
-rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
+rsock_s_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str,
+ VALUE ex, enum sock_recv_type from)
{
rb_io_t *fptr;
- VALUE str;
union_sockaddr buf;
socklen_t alen = (socklen_t)sizeof buf;
- VALUE len, flg;
long buflen;
long slen;
int fd, flags;
VALUE addr = Qnil;
socklen_t len0;
- rb_scan_args(argc, argv, "11", &len, &flg);
-
- if (flg == Qnil) flags = 0;
- else flags = NUM2INT(flg);
+ flags = NUM2INT(flg);
buflen = NUM2INT(len);
+ str = rsock_strbuf(str, buflen);
#ifdef MSG_DONTWAIT
/* MSG_DONTWAIT avoids the race condition between fcntl and recvfrom.
@@ -207,26 +234,30 @@ rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type
}
fd = fptr->fd;
- str = rb_tainted_str_new(0, buflen);
-
rb_io_check_closed(fptr);
- rb_io_set_nonblock(fptr);
+
+ if (!MSG_DONTWAIT_RELIABLE)
+ rb_io_set_nonblock(fptr);
+
len0 = alen;
slen = recvfrom(fd, RSTRING_PTR(str), buflen, flags, &buf.addr, &alen);
if (slen != -1 && len0 < alen)
alen = len0;
if (slen < 0) {
- switch (errno) {
+ int e = errno;
+ switch (e) {
case EAGAIN:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "recvfrom(2) would block");
+ if (ex == Qfalse)
+ return sym_wait_readable;
+ rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE, e, "recvfrom(2) would block");
}
- rb_sys_fail("recvfrom(2)");
+ rb_syserr_fail(e, "recvfrom(2)");
}
- if (slen < RSTRING_LEN(str)) {
+ if (slen != RSTRING_LEN(str)) {
rb_str_set_len(str, slen);
}
rb_obj_taint(str);
@@ -249,37 +280,78 @@ rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type
return rb_assoc_new(str, addr);
}
+/* returns true if SOCK_CLOEXEC is supported */
+int rsock_detect_cloexec(int fd)
+{
+#ifdef SOCK_CLOEXEC
+ int flags = fcntl(fd, F_GETFD);
+
+ if (flags == -1)
+ rb_bug("rsock_detect_cloexec: fcntl(%d, F_GETFD) failed: %s", fd, strerror(errno));
+
+ if (flags & FD_CLOEXEC)
+ return 1;
+#endif
+ return 0;
+}
+
+#ifdef SOCK_CLOEXEC
static int
rsock_socket0(int domain, int type, int proto)
{
int ret;
+ static int cloexec_state = -1; /* <0: unknown, 0: ignored, >0: working */
-#ifdef SOCK_CLOEXEC
- static int try_sock_cloexec = 1;
- if (try_sock_cloexec) {
+ if (cloexec_state > 0) { /* common path, if SOCK_CLOEXEC is defined */
+ ret = socket(domain, type|SOCK_CLOEXEC, proto);
+ if (ret >= 0) {
+ if (ret <= 2)
+ goto fix_cloexec;
+ goto update_max_fd;
+ }
+ }
+ else if (cloexec_state < 0) { /* usually runs once only for detection */
ret = socket(domain, type|SOCK_CLOEXEC, proto);
- if (ret == -1 && errno == EINVAL) {
+ if (ret >= 0) {
+ cloexec_state = rsock_detect_cloexec(ret);
+ if (cloexec_state == 0 || ret <= 2)
+ goto fix_cloexec;
+ goto update_max_fd;
+ }
+ else 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;
+ cloexec_state = 0;
+ /* fall through to fix_cloexec */
}
}
}
- else {
+ else { /* cloexec_state == 0 */
ret = socket(domain, type, proto);
}
-#else
- ret = socket(domain, type, proto);
-#endif
if (ret == -1)
return -1;
+fix_cloexec:
+ rb_maygvl_fd_fix_cloexec(ret);
+update_max_fd:
+ rb_update_max_fd(ret);
+ return ret;
+}
+#else /* !SOCK_CLOEXEC */
+static int
+rsock_socket0(int domain, int type, int proto)
+{
+ int ret = socket(domain, type, proto);
+
+ if (ret == -1)
+ return -1;
rb_fd_fix_cloexec(ret);
return ret;
-
}
+#endif /* !SOCK_CLOEXEC */
int
rsock_socket(int domain, int type, int proto)
@@ -288,8 +360,7 @@ rsock_socket(int domain, int type, int proto)
fd = rsock_socket0(domain, type, proto);
if (fd < 0) {
- if (errno == EMFILE || errno == ENFILE) {
- rb_gc();
+ if (rb_gc_for_fd(errno)) {
fd = rsock_socket0(domain, type, proto);
}
}
@@ -298,68 +369,69 @@ rsock_socket(int domain, int type, int proto)
return fd;
}
+/* emulate blocking connect behavior on EINTR or non-blocking socket */
static int
wait_connectable(int fd)
{
- int sockerr;
+ int sockerr, revents;
socklen_t sockerrlen;
- int revents;
- int ret;
- for (;;) {
- /*
- * Stevens book says, succuessful finish turn on RB_WAITFD_OUT and
- * failure finish turn on both RB_WAITFD_IN and RB_WAITFD_OUT.
- */
- revents = rb_wait_for_single_fd(fd, RB_WAITFD_IN|RB_WAITFD_OUT, NULL);
-
- if (revents & (RB_WAITFD_IN|RB_WAITFD_OUT)) {
- sockerrlen = (socklen_t)sizeof(sockerr);
- ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
-
- /*
- * Solaris getsockopt(SO_ERROR) return -1 and set errno
- * in getsockopt(). Let's return immediately.
- */
- if (ret < 0)
- break;
- if (sockerr == 0)
- continue; /* workaround for winsock */
-
- /* BSD and Linux use sockerr. */
- errno = sockerr;
- ret = -1;
- break;
- }
+ /* only to clear pending error */
+ sockerrlen = (socklen_t)sizeof(sockerr);
+ if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen) < 0)
+ return -1;
- if ((revents & (RB_WAITFD_IN|RB_WAITFD_OUT)) == RB_WAITFD_OUT) {
- ret = 0;
- break;
- }
- }
+ /*
+ * Stevens book says, successful finish turn on RB_WAITFD_OUT and
+ * failure finish turn on both RB_WAITFD_IN and RB_WAITFD_OUT.
+ * So it's enough to wait only RB_WAITFD_OUT and check the pending error
+ * by getsockopt().
+ *
+ * Note: rb_wait_for_single_fd already retries on EINTR/ERESTART
+ */
+ revents = rb_wait_for_single_fd(fd, RB_WAITFD_IN|RB_WAITFD_OUT, NULL);
- return ret;
-}
+ if (revents < 0)
+ return -1;
+
+ sockerrlen = (socklen_t)sizeof(sockerr);
+ if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen) < 0)
+ return -1;
-#ifdef __CYGWIN__
-#define WAIT_IN_PROGRESS 10
+ switch (sockerr) {
+ case 0:
+ /*
+ * be defensive in case some platforms set SO_ERROR on the original,
+ * interrupted connect()
+ */
+ case EINTR:
+#ifdef ERESTART
+ case ERESTART:
#endif
-#ifdef __APPLE__
-#define WAIT_IN_PROGRESS 10
+ case EAGAIN:
+#ifdef EINPROGRESS
+ case EINPROGRESS:
#endif
-#ifdef __linux__
-/* returns correct error */
-#define WAIT_IN_PROGRESS 0
+#ifdef EALREADY
+ case EALREADY:
#endif
-#ifndef WAIT_IN_PROGRESS
-/* BSD origin code apparently has a problem */
-#define WAIT_IN_PROGRESS 1
+#ifdef EISCONN
+ case EISCONN:
#endif
+ return 0; /* success */
+ default:
+ /* likely (but not limited to): ECONNREFUSED, ETIMEDOUT, EHOSTUNREACH */
+ errno = sockerr;
+ return -1;
+ }
+
+ return 0;
+}
struct connect_arg {
int fd;
- const struct sockaddr *sockaddr;
socklen_t len;
+ const struct sockaddr *sockaddr;
};
static VALUE
@@ -384,11 +456,6 @@ rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks)
int status;
rb_blocking_function_t *func = connect_blocking;
struct connect_arg arg;
-#if WAIT_IN_PROGRESS > 0
- int wait_in_progress = -1;
- int sockerr;
- socklen_t sockerrlen;
-#endif
arg.fd = fd;
arg.sockaddr = sockaddr;
@@ -396,76 +463,22 @@ rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks)
#if defined(SOCKS) && !defined(SOCKS5)
if (socks) func = socks_connect_blocking;
#endif
- for (;;) {
- status = (int)BLOCKING_REGION_FD(func, &arg);
- if (status < 0) {
- switch (errno) {
- case EINTR:
-#if defined(ERESTART)
- case ERESTART:
-#endif
- continue;
+ status = (int)BLOCKING_REGION_FD(func, &arg);
- case EAGAIN:
-#ifdef EINPROGRESS
- case EINPROGRESS:
-#endif
-#if WAIT_IN_PROGRESS > 0
- sockerrlen = (socklen_t)sizeof(sockerr);
- status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
- if (status) break;
- if (sockerr) {
- status = -1;
- errno = sockerr;
- break;
- }
-#endif
-#ifdef EALREADY
- case EALREADY:
-#endif
-#if WAIT_IN_PROGRESS > 0
- wait_in_progress = WAIT_IN_PROGRESS;
-#endif
- status = wait_connectable(fd);
- if (status) {
- break;
- }
- errno = 0;
- continue;
-
-#if WAIT_IN_PROGRESS > 0
- case EINVAL:
- if (wait_in_progress-- > 0) {
- /*
- * connect() after EINPROGRESS returns EINVAL on
- * some platforms, need to check true error
- * status.
- */
- sockerrlen = (socklen_t)sizeof(sockerr);
- status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
- if (!status && !sockerr) {
- struct timeval tv = {0, 100000};
- rb_thread_wait_for(tv);
- continue;
- }
- status = -1;
- errno = sockerr;
- }
- break;
+ if (status < 0) {
+ switch (errno) {
+ case EINTR:
+#ifdef ERESTART
+ case ERESTART:
#endif
-
-#ifdef EISCONN
- case EISCONN:
- status = 0;
- errno = 0;
- break;
+ case EAGAIN:
+#ifdef EINPROGRESS
+ case EINPROGRESS:
#endif
- default:
- break;
- }
- }
- return status;
+ return wait_connectable(fd);
+ }
}
+ return status;
}
static void
@@ -487,7 +500,8 @@ make_fd_nonblock(int fd)
}
static int
-cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len)
+cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len,
+ int nonblock)
{
int ret;
socklen_t len0 = 0;
@@ -501,11 +515,21 @@ cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len)
#ifdef SOCK_CLOEXEC
flags |= SOCK_CLOEXEC;
#endif
+#ifdef SOCK_NONBLOCK
+ if (nonblock) {
+ flags |= SOCK_NONBLOCK;
+ }
+#endif
ret = accept4(socket, address, address_len, flags);
/* accept4 is available since Linux 2.6.28, glibc 2.10. */
if (ret != -1) {
if (ret <= 2)
rb_maygvl_fd_fix_cloexec(ret);
+#ifndef SOCK_NONBLOCK
+ if (nonblock) {
+ make_fd_nonblock(ret);
+ }
+#endif
if (address_len && len0 < *address_len) *address_len = len0;
return ret;
}
@@ -519,20 +543,23 @@ cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len)
if (ret == -1) return -1;
if (address_len && len0 < *address_len) *address_len = len0;
rb_maygvl_fd_fix_cloexec(ret);
+ if (nonblock) {
+ make_fd_nonblock(ret);
+ }
return ret;
}
-
VALUE
-rsock_s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len)
+rsock_s_accept_nonblock(VALUE klass, VALUE ex, rb_io_t *fptr,
+ struct sockaddr *sockaddr, socklen_t *len)
{
int fd2;
- rb_secure(3);
rb_io_set_nonblock(fptr);
- fd2 = cloexec_accept(fptr->fd, (struct sockaddr*)sockaddr, len);
+ fd2 = cloexec_accept(fptr->fd, (struct sockaddr*)sockaddr, len, 1);
if (fd2 < 0) {
- switch (errno) {
+ int e = errno;
+ switch (e) {
case EAGAIN:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
@@ -541,12 +568,13 @@ rsock_s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, s
#if defined EPROTO
case EPROTO:
#endif
- rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "accept(2) would block");
+ if (ex == Qfalse)
+ return sym_wait_readable;
+ rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE, e, "accept(2) would block");
}
- rb_sys_fail("accept(2)");
+ rb_syserr_fail(e, "accept(2)");
}
rb_update_max_fd(fd2);
- make_fd_nonblock(fd2);
return rsock_init_sock(rb_obj_alloc(klass), fd2);
}
@@ -560,7 +588,7 @@ static VALUE
accept_blocking(void *data)
{
struct accept_arg *arg = data;
- return (VALUE)cloexec_accept(arg->fd, arg->sockaddr, arg->len);
+ return (VALUE)cloexec_accept(arg->fd, arg->sockaddr, arg->len, 0);
}
VALUE
@@ -570,17 +598,18 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
int retry = 0;
struct accept_arg arg;
- rb_secure(3);
arg.fd = fd;
arg.sockaddr = sockaddr;
arg.len = len;
retry:
- rb_thread_wait_fd(fd);
+ rsock_maybe_wait_fd(fd);
fd2 = (int)BLOCKING_REGION_FD(accept_blocking, &arg);
if (fd2 < 0) {
- switch (errno) {
+ int e = errno;
+ switch (e) {
case EMFILE:
case ENFILE:
+ case ENOMEM:
if (retry) break;
rb_gc();
retry = 1;
@@ -590,7 +619,7 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
retry = 0;
goto retry;
}
- rb_sys_fail("accept(2)");
+ rb_syserr_fail(e, "accept(2)");
}
rb_update_max_fd(fd2);
if (!klass) return INT2NUM(fd2);
@@ -598,20 +627,39 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
}
int
-rsock_getfamily(int sockfd)
+rsock_getfamily(rb_io_t *fptr)
{
union_sockaddr ss;
socklen_t sslen = (socklen_t)sizeof(ss);
+ int cached = fptr->mode & FMODE_SOCK;
+
+ if (cached) {
+ switch (cached) {
+#ifdef AF_UNIX
+ case FMODE_UNIX: return AF_UNIX;
+#endif
+ case FMODE_INET: return AF_INET;
+ case FMODE_INET6: return AF_INET6;
+ }
+ }
ss.addr.sa_family = AF_UNSPEC;
- if (getsockname(sockfd, &ss.addr, &sslen) < 0)
+ if (getsockname(fptr->fd, &ss.addr, &sslen) < 0)
return AF_UNSPEC;
+ switch (ss.addr.sa_family) {
+#ifdef AF_UNIX
+ case AF_UNIX: fptr->mode |= FMODE_UNIX; break;
+#endif
+ case AF_INET: fptr->mode |= FMODE_INET; break;
+ case AF_INET6: fptr->mode |= FMODE_INET6; break;
+ }
+
return ss.addr.sa_family;
}
void
-rsock_init_socket_init()
+rsock_init_socket_init(void)
{
/*
* SocketError is the error class for socket.
@@ -629,4 +677,7 @@ rsock_init_socket_init()
rsock_init_addrinfo();
rsock_init_sockifaddr();
rsock_init_socket_constants();
+
+#undef rb_intern
+ sym_wait_readable = ID2SYM(rb_intern("wait_readable"));
}
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index 7b198bd154..9981fd43ad 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -15,7 +15,7 @@ struct inetsock_arg
VALUE sock;
struct {
VALUE host, serv;
- struct addrinfo *res;
+ struct rb_addrinfo *res;
} remote, local;
int type;
int fd;
@@ -25,11 +25,11 @@ static VALUE
inetsock_cleanup(struct inetsock_arg *arg)
{
if (arg->remote.res) {
- freeaddrinfo(arg->remote.res);
+ rb_freeaddrinfo(arg->remote.res);
arg->remote.res = 0;
}
if (arg->local.res) {
- freeaddrinfo(arg->local.res);
+ rb_freeaddrinfo(arg->local.res);
arg->local.res = 0;
}
if (arg->fd >= 0) {
@@ -41,30 +41,34 @@ inetsock_cleanup(struct inetsock_arg *arg)
static VALUE
init_inetsock_internal(struct inetsock_arg *arg)
{
+ int error = 0;
int type = arg->type;
struct addrinfo *res, *lres;
int fd, status = 0, local = 0;
+ int family = AF_UNSPEC;
const char *syscall = 0;
- arg->remote.res = rsock_addrinfo(arg->remote.host, arg->remote.serv, SOCK_STREAM,
- (type == INET_SERVER) ? AI_PASSIVE : 0);
+ arg->remote.res = rsock_addrinfo(arg->remote.host, arg->remote.serv,
+ family, SOCK_STREAM,
+ (type == INET_SERVER) ? AI_PASSIVE : 0);
/*
* Maybe also accept a local address
*/
if (type != INET_SERVER && (!NIL_P(arg->local.host) || !NIL_P(arg->local.serv))) {
- arg->local.res = rsock_addrinfo(arg->local.host, arg->local.serv, SOCK_STREAM, 0);
+ arg->local.res = rsock_addrinfo(arg->local.host, arg->local.serv,
+ family, SOCK_STREAM, 0);
}
arg->fd = fd = -1;
- for (res = arg->remote.res; res; res = res->ai_next) {
+ for (res = arg->remote.res->ai; res; res = res->ai_next) {
#if !defined(INET6) && defined(AF_INET6)
if (res->ai_family == AF_INET6)
continue;
#endif
lres = NULL;
if (arg->local.res) {
- for (lres = arg->local.res; lres; lres = lres->ai_next) {
+ for (lres = arg->local.res->ai; lres; lres = lres->ai_next) {
if (lres->ai_family == res->ai_family)
break;
}
@@ -73,13 +77,14 @@ init_inetsock_internal(struct inetsock_arg *arg)
continue;
/* Use a different family local address if no choice, this
* will cause EAFNOSUPPORT. */
- lres = arg->local.res;
+ lres = arg->local.res->ai;
}
}
status = rsock_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
syscall = "socket(2)";
fd = status;
if (fd < 0) {
+ error = errno;
continue;
}
arg->fd = fd;
@@ -107,6 +112,7 @@ init_inetsock_internal(struct inetsock_arg *arg)
}
if (status < 0) {
+ error = errno;
close(fd);
arg->fd = fd = -1;
continue;
@@ -124,7 +130,7 @@ init_inetsock_internal(struct inetsock_arg *arg)
port = arg->remote.serv;
}
- rsock_sys_fail_host_port(syscall, host, port);
+ rsock_syserr_fail_host_port(error, syscall, host, port);
}
arg->fd = -1;
@@ -132,8 +138,9 @@ init_inetsock_internal(struct inetsock_arg *arg)
if (type == INET_SERVER) {
status = listen(fd, SOMAXCONN);
if (status < 0) {
+ error = errno;
close(fd);
- rb_sys_fail("listen(2)");
+ rb_syserr_fail(error, "listen(2)");
}
}
@@ -193,7 +200,7 @@ rsock_revlookup_flag(VALUE revlookup, int *norevlookup)
* hostname is obtained from numeric_address using reverse lookup.
* Or if it is +false+, or +:numeric+,
* hostname is same as numeric_address.
- * Or if it is +nil+ or ommitted, obeys to +ipsocket.do_not_reverse_lookup+.
+ * Or if it is +nil+ or omitted, obeys to +ipsocket.do_not_reverse_lookup+.
* See +Socket.getaddrinfo+ also.
*
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
@@ -234,7 +241,7 @@ ip_addr(int argc, VALUE *argv, VALUE sock)
* hostname is obtained from numeric_address using reverse lookup.
* Or if it is +false+, or +:numeric+,
* hostname is same as numeric_address.
- * Or if it is +nil+ or ommitted, obeys to +ipsocket.do_not_reverse_lookup+.
+ * Or if it is +nil+ or omitted, obeys to +ipsocket.do_not_reverse_lookup+.
* See +Socket.getaddrinfo+ also.
*
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
@@ -304,13 +311,14 @@ static VALUE
ip_s_getaddress(VALUE obj, VALUE host)
{
union_sockaddr addr;
- struct addrinfo *res = rsock_addrinfo(host, Qnil, SOCK_STREAM, 0);
+ struct rb_addrinfo *res = rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, 0);
+ socklen_t len = res->ai->ai_addrlen;
/* just take the first one */
- memcpy(&addr, res->ai_addr, res->ai_addrlen);
- freeaddrinfo(res);
+ memcpy(&addr, res->ai->ai_addr, len);
+ rb_freeaddrinfo(res);
- return rsock_make_ipaddr(&addr.addr, res->ai_addrlen);
+ return rsock_make_ipaddr(&addr.addr, len);
}
void
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 2cd7aeadf9..5c3ed400f4 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -1,4 +1,7 @@
+# frozen_string_literal: true
+
require 'socket.so'
+require 'io/wait'
class Addrinfo
# creates an Addrinfo object from the arguments.
@@ -50,17 +53,13 @@ class Addrinfo
sock.ipv6only! if self.ipv6?
sock.bind local_addrinfo if local_addrinfo
if timeout
- begin
- sock.connect_nonblock(self)
- rescue IO::WaitWritable
- if !IO.select(nil, [sock], nil, timeout)
+ case sock.connect_nonblock(self, exception: false)
+ when 0 # success or EISCONN, other errors raise
+ break
+ when :wait_writable
+ sock.wait_writable(timeout) or
raise Errno::ETIMEDOUT, 'user specified timeout'
- end
- begin
- sock.connect_nonblock(self) # check connection failure
- rescue Errno::EISCONN
- end
- end
+ end while true
else
sock.connect(self)
end
@@ -275,6 +274,178 @@ class BasicSocket < IO
end
addr
end
+
+ # call-seq:
+ # basicsocket.sendmsg(mesg, flags=0, dest_sockaddr=nil, *controls) => numbytes_sent
+ #
+ # sendmsg sends a message using sendmsg(2) system call in blocking manner.
+ #
+ # _mesg_ is a string to send.
+ #
+ # _flags_ is bitwise OR of MSG_* constants such as Socket::MSG_OOB.
+ #
+ # _dest_sockaddr_ is a destination socket address for connection-less socket.
+ # It should be a sockaddr such as a result of Socket.sockaddr_in.
+ # An Addrinfo object can be used too.
+ #
+ # _controls_ is a list of ancillary data.
+ # The element of _controls_ should be Socket::AncillaryData or
+ # 3-elements array.
+ # The 3-element array should contains cmsg_level, cmsg_type and data.
+ #
+ # The return value, _numbytes_sent_ is an integer which is the number of bytes sent.
+ #
+ # sendmsg can be used to implement send_io as follows:
+ #
+ # # use Socket::AncillaryData.
+ # ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, io.fileno)
+ # sock.sendmsg("a", 0, nil, ancdata)
+ #
+ # # use 3-element array.
+ # ancdata = [:SOCKET, :RIGHTS, [io.fileno].pack("i!")]
+ # sock.sendmsg("\0", 0, nil, ancdata)
+ def sendmsg(mesg, flags = 0, dest_sockaddr = nil, *controls)
+ __sendmsg(mesg, flags, dest_sockaddr, controls)
+ end
+
+ # call-seq:
+ # basicsocket.sendmsg_nonblock(mesg, flags=0, dest_sockaddr=nil, *controls, opts={}) => numbytes_sent
+ #
+ # sendmsg_nonblock sends a message using sendmsg(2) system call in non-blocking manner.
+ #
+ # It is similar to BasicSocket#sendmsg
+ # but the non-blocking flag is set before the system call
+ # and it doesn't retry the system call.
+ #
+ # By specifying `exception: false`, the _opts_ hash allows you to indicate
+ # that sendmsg_nonblock should not raise an IO::WaitWritable exception, but
+ # return the symbol :wait_writable instead.
+ def sendmsg_nonblock(mesg, flags = 0, dest_sockaddr = nil, *controls,
+ exception: true)
+ __sendmsg_nonblock(mesg, flags, dest_sockaddr, controls, exception)
+ end
+
+ # call-seq:
+ # basicsocket.recv_nonblock(maxlen [, flags [, buf [, options ]]]) => mesg
+ #
+ # Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
+ # O_NONBLOCK is set for the underlying file descriptor.
+ # _flags_ is zero or more of the +MSG_+ options.
+ # The result, _mesg_, is the data received.
+ #
+ # When recvfrom(2) returns 0, Socket#recv_nonblock returns
+ # an empty string as data.
+ # The meaning depends on the socket: EOF on TCP, empty packet on UDP, etc.
+ #
+ # === Parameters
+ # * +maxlen+ - the number of bytes to receive from the socket
+ # * +flags+ - zero or more of the +MSG_+ options
+ # * +options+ - keyword hash, supporting `exception: false`
+ #
+ # === Example
+ # serv = TCPServer.new("127.0.0.1", 0)
+ # af, port, host, addr = serv.addr
+ # c = TCPSocket.new(addr, port)
+ # s = serv.accept
+ # c.send "aaa", 0
+ # begin # emulate blocking recv.
+ # p s.recv_nonblock(10) #=> "aaa"
+ # rescue IO::WaitReadable
+ # IO.select([s])
+ # retry
+ # end
+ #
+ # Refer to Socket#recvfrom for the exceptions that may be thrown if the call
+ # to _recv_nonblock_ fails.
+ #
+ # BasicSocket#recv_nonblock may raise any error corresponding to recvfrom(2) failure,
+ # including Errno::EWOULDBLOCK.
+ #
+ # If the exception is Errno::EWOULDBLOCK or Errno::EAGAIN,
+ # it is extended by IO::WaitReadable.
+ # So IO::WaitReadable can be used to rescue the exceptions for retrying recv_nonblock.
+ #
+ # By specifying `exception: false`, the options hash allows you to indicate
+ # that recv_nonblock should not raise an IO::WaitWritable exception, but
+ # return the symbol :wait_writable instead.
+ #
+ # === See
+ # * Socket#recvfrom
+ def recv_nonblock(len, flag = 0, str = nil, exception: true)
+ __recv_nonblock(len, flag, str, exception)
+ end
+
+ # call-seq:
+ # basicsocket.recvmsg(maxmesglen=nil, flags=0, maxcontrollen=nil, opts={}) => [mesg, sender_addrinfo, rflags, *controls]
+ #
+ # recvmsg receives a message using recvmsg(2) system call in blocking manner.
+ #
+ # _maxmesglen_ is the maximum length of mesg to receive.
+ #
+ # _flags_ is bitwise OR of MSG_* constants such as Socket::MSG_PEEK.
+ #
+ # _maxcontrollen_ is the maximum length of controls (ancillary data) to receive.
+ #
+ # _opts_ is option hash.
+ # Currently :scm_rights=>bool is the only option.
+ #
+ # :scm_rights option specifies that application expects SCM_RIGHTS control message.
+ # If the value is nil or false, application don't expects SCM_RIGHTS control message.
+ # In this case, recvmsg closes the passed file descriptors immediately.
+ # This is the default behavior.
+ #
+ # If :scm_rights value is neither nil nor false, application expects SCM_RIGHTS control message.
+ # In this case, recvmsg creates IO objects for each file descriptors for
+ # Socket::AncillaryData#unix_rights method.
+ #
+ # The return value is 4-elements array.
+ #
+ # _mesg_ is a string of the received message.
+ #
+ # _sender_addrinfo_ is a sender socket address for connection-less socket.
+ # It is an Addrinfo object.
+ # For connection-oriented socket such as TCP, sender_addrinfo is platform dependent.
+ #
+ # _rflags_ is a flags on the received message which is bitwise OR of MSG_* constants such as Socket::MSG_TRUNC.
+ # It will be nil if the system uses 4.3BSD style old recvmsg system call.
+ #
+ # _controls_ is ancillary data which is an array of Socket::AncillaryData objects such as:
+ #
+ # #<Socket::AncillaryData: AF_UNIX SOCKET RIGHTS 7>
+ #
+ # _maxmesglen_ and _maxcontrollen_ can be nil.
+ # In that case, the buffer will be grown until the message is not truncated.
+ # Internally, MSG_PEEK is used.
+ # Buffer full and MSG_CTRUNC are checked for truncation.
+ #
+ # recvmsg can be used to implement recv_io as follows:
+ #
+ # mesg, sender_sockaddr, rflags, *controls = sock.recvmsg(:scm_rights=>true)
+ # controls.each {|ancdata|
+ # if ancdata.cmsg_is?(:SOCKET, :RIGHTS)
+ # return ancdata.unix_rights[0]
+ # end
+ # }
+ def recvmsg(dlen = nil, flags = 0, clen = nil, scm_rights: false)
+ __recvmsg(dlen, flags, clen, scm_rights)
+ end
+
+ # call-seq:
+ # basicsocket.recvmsg_nonblock(maxdatalen=nil, flags=0, maxcontrollen=nil, opts={}) => [data, sender_addrinfo, rflags, *controls]
+ #
+ # recvmsg receives a message using recvmsg(2) system call in non-blocking manner.
+ #
+ # It is similar to BasicSocket#recvmsg
+ # but non-blocking flag is set before the system call
+ # and it doesn't retry the system call.
+ #
+ # By specifying `exception: false`, the _opts_ hash allows you to indicate
+ # that recvmsg_nonblock should not raise an IO::WaitWritable exception, but
+ # return the symbol :wait_writable instead.
+ def recvmsg_nonblock(dlen = nil, flags = 0, clen = nil,
+ scm_rights: false, exception: true)
+ __recvmsg_nonblock(dlen, flags, clen, scm_rights, exception)
+ end
end
class Socket < BasicSocket
@@ -285,6 +456,133 @@ class Socket < BasicSocket
end
end
+ # call-seq:
+ # socket.recvfrom_nonblock(maxlen[, flags[, outbuf[, opts]]]) => [mesg, sender_addrinfo]
+ #
+ # Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
+ # O_NONBLOCK is set for the underlying file descriptor.
+ # _flags_ is zero or more of the +MSG_+ options.
+ # The first element of the results, _mesg_, is the data received.
+ # The second element, _sender_addrinfo_, contains protocol-specific address
+ # information of the sender.
+ #
+ # When recvfrom(2) returns 0, Socket#recvfrom_nonblock returns
+ # an empty string as data.
+ # The meaning depends on the socket: EOF on TCP, empty packet on UDP, etc.
+ #
+ # === Parameters
+ # * +maxlen+ - the maximum number of bytes to receive from the socket
+ # * +flags+ - zero or more of the +MSG_+ options
+ # * +outbuf+ - destination String buffer
+ # * +opts+ - keyword hash, supporting `exception: false`
+ #
+ # === Example
+ # # In one file, start this first
+ # require 'socket'
+ # include Socket::Constants
+ # socket = Socket.new(AF_INET, SOCK_STREAM, 0)
+ # sockaddr = Socket.sockaddr_in(2200, 'localhost')
+ # socket.bind(sockaddr)
+ # socket.listen(5)
+ # client, client_addrinfo = socket.accept
+ # begin # emulate blocking recvfrom
+ # pair = client.recvfrom_nonblock(20)
+ # rescue IO::WaitReadable
+ # IO.select([client])
+ # retry
+ # end
+ # data = pair[0].chomp
+ # puts "I only received 20 bytes '#{data}'"
+ # sleep 1
+ # socket.close
+ #
+ # # In another file, start this second
+ # require 'socket'
+ # include Socket::Constants
+ # socket = Socket.new(AF_INET, SOCK_STREAM, 0)
+ # sockaddr = Socket.sockaddr_in(2200, 'localhost')
+ # socket.connect(sockaddr)
+ # socket.puts "Watch this get cut short!"
+ # socket.close
+ #
+ # Refer to Socket#recvfrom for the exceptions that may be thrown if the call
+ # to _recvfrom_nonblock_ fails.
+ #
+ # Socket#recvfrom_nonblock may raise any error corresponding to recvfrom(2) failure,
+ # including Errno::EWOULDBLOCK.
+ #
+ # If the exception is Errno::EWOULDBLOCK or Errno::EAGAIN,
+ # it is extended by IO::WaitReadable.
+ # So IO::WaitReadable can be used to rescue the exceptions for retrying
+ # recvfrom_nonblock.
+ #
+ # By specifying `exception: false`, the options hash allows you to indicate
+ # that accept_nonblock should not raise an IO::WaitReadable exception, but
+ # return the symbol :wait_readable instead.
+ #
+ # === See
+ # * Socket#recvfrom
+ def recvfrom_nonblock(len, flag = 0, str = nil, exception: true)
+ __recvfrom_nonblock(len, flag, str, exception)
+ end
+
+ # call-seq:
+ # socket.accept_nonblock([options]) => [client_socket, client_addrinfo]
+ #
+ # Accepts an incoming connection using accept(2) after
+ # O_NONBLOCK is set for the underlying file descriptor.
+ # It returns an array containing the accepted socket
+ # for the incoming connection, _client_socket_,
+ # and an Addrinfo, _client_addrinfo_.
+ #
+ # === Example
+ # # In one script, start this first
+ # require 'socket'
+ # include Socket::Constants
+ # socket = Socket.new(AF_INET, SOCK_STREAM, 0)
+ # sockaddr = Socket.sockaddr_in(2200, 'localhost')
+ # socket.bind(sockaddr)
+ # socket.listen(5)
+ # begin # emulate blocking accept
+ # client_socket, client_addrinfo = socket.accept_nonblock
+ # rescue IO::WaitReadable, Errno::EINTR
+ # IO.select([socket])
+ # retry
+ # end
+ # puts "The client said, '#{client_socket.readline.chomp}'"
+ # client_socket.puts "Hello from script one!"
+ # socket.close
+ #
+ # # In another script, start this second
+ # require 'socket'
+ # include Socket::Constants
+ # socket = Socket.new(AF_INET, SOCK_STREAM, 0)
+ # sockaddr = Socket.sockaddr_in(2200, 'localhost')
+ # socket.connect(sockaddr)
+ # socket.puts "Hello from script 2."
+ # puts "The server said, '#{socket.readline.chomp}'"
+ # socket.close
+ #
+ # Refer to Socket#accept for the exceptions that may be thrown if the call
+ # to _accept_nonblock_ fails.
+ #
+ # Socket#accept_nonblock may raise any error corresponding to accept(2) failure,
+ # including Errno::EWOULDBLOCK.
+ #
+ # If the exception is Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::ECONNABORTED or Errno::EPROTO,
+ # it is extended by IO::WaitReadable.
+ # So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
+ #
+ # By specifying `exception: false`, the options hash allows you to indicate
+ # that accept_nonblock should not raise an IO::WaitReadable exception, but
+ # return the symbol :wait_readable instead.
+ #
+ # === See
+ # * Socket#accept
+ def accept_nonblock(exception: true)
+ __accept_nonblock(exception)
+ 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])
@@ -501,11 +799,8 @@ class Socket < BasicSocket
loop {
readable, _, _ = IO.select(sockets)
readable.each {|r|
- begin
- sock, addr = r.accept_nonblock
- rescue IO::WaitReadable
- next
- end
+ sock, addr = r.accept_nonblock(exception: false)
+ next if sock == :wait_readable
yield sock, addr
}
}
@@ -669,11 +964,8 @@ class Socket < BasicSocket
#
def self.udp_server_recv(sockets)
sockets.each {|r|
- begin
- msg, sender_addrinfo, _, *controls = r.recvmsg_nonblock
- rescue IO::WaitReadable
- next
- end
+ msg, sender_addrinfo, _, *controls = r.recvmsg_nonblock(exception: false)
+ next if msg == :wait_readable
ai = r.local_address
if ai.ipv6? and pktinfo = controls.find {|c| c.cmsg_is?(:IPV6, :PKTINFO) }
ai = Addrinfo.udp(pktinfo.ipv6_pktinfo_addr.ip_address, ai.ip_port)
@@ -750,7 +1042,7 @@ class Socket < BasicSocket
attr_reader :local_address
def inspect # :nodoc:
- "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>"
+ "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>".dup
end
# Sends the String +msg+ to the source
@@ -810,7 +1102,7 @@ class Socket < BasicSocket
st = File.lstat(path)
rescue Errno::ENOENT
end
- if st && st.socket? && st.owned?
+ if st&.socket? && st.owned?
File.unlink path
end
end
@@ -867,5 +1159,193 @@ class Socket < BasicSocket
}
end
+ # call-seq:
+ # socket.connect_nonblock(remote_sockaddr, [options]) => 0
+ #
+ # Requests a connection to be made on the given +remote_sockaddr+ after
+ # O_NONBLOCK is set for the underlying file descriptor.
+ # Returns 0 if successful, otherwise an exception is raised.
+ #
+ # === Parameter
+ # # +remote_sockaddr+ - the +struct+ sockaddr contained in a string or Addrinfo object
+ #
+ # === Example:
+ # # Pull down Google's web page
+ # require 'socket'
+ # include Socket::Constants
+ # socket = Socket.new(AF_INET, SOCK_STREAM, 0)
+ # sockaddr = Socket.sockaddr_in(80, 'www.google.com')
+ # begin # emulate blocking connect
+ # socket.connect_nonblock(sockaddr)
+ # rescue IO::WaitWritable
+ # IO.select(nil, [socket]) # wait 3-way handshake completion
+ # begin
+ # socket.connect_nonblock(sockaddr) # check connection failure
+ # rescue Errno::EISCONN
+ # end
+ # end
+ # socket.write("GET / HTTP/1.0\r\n\r\n")
+ # results = socket.read
+ #
+ # Refer to Socket#connect for the exceptions that may be thrown if the call
+ # to _connect_nonblock_ fails.
+ #
+ # Socket#connect_nonblock may raise any error corresponding to connect(2) failure,
+ # including Errno::EINPROGRESS.
+ #
+ # If the exception is Errno::EINPROGRESS,
+ # it is extended by IO::WaitWritable.
+ # So IO::WaitWritable can be used to rescue the exceptions for retrying connect_nonblock.
+ #
+ # By specifying `exception: false`, the options hash allows you to indicate
+ # that connect_nonblock should not raise an IO::WaitWritable exception, but
+ # return the symbol :wait_writable instead.
+ #
+ # === See
+ # # Socket#connect
+ def connect_nonblock(addr, exception: true)
+ __connect_nonblock(addr, exception)
+ end
end
+class UDPSocket < IPSocket
+
+ # call-seq:
+ # udpsocket.recvfrom_nonblock(maxlen [, flags[, outbuf [, options]]]) => [mesg, sender_inet_addr]
+ #
+ # Receives up to _maxlen_ bytes from +udpsocket+ using recvfrom(2) after
+ # O_NONBLOCK is set for the underlying file descriptor.
+ # If _maxlen_ is omitted, its default value is 65536.
+ # _flags_ is zero or more of the +MSG_+ options.
+ # The first element of the results, _mesg_, is the data received.
+ # The second element, _sender_inet_addr_, is an array to represent the sender address.
+ #
+ # When recvfrom(2) returns 0,
+ # Socket#recvfrom_nonblock returns an empty string as data.
+ # It means an empty packet.
+ #
+ # === Parameters
+ # * +maxlen+ - the number of bytes to receive from the socket
+ # * +flags+ - zero or more of the +MSG_+ options
+ # * +outbuf+ - destination String buffer
+ # * +options+ - keyword hash, supporting `exception: false`
+ #
+ # === Example
+ # require 'socket'
+ # s1 = UDPSocket.new
+ # s1.bind("127.0.0.1", 0)
+ # s2 = UDPSocket.new
+ # s2.bind("127.0.0.1", 0)
+ # s2.connect(*s1.addr.values_at(3,1))
+ # s1.connect(*s2.addr.values_at(3,1))
+ # s1.send "aaa", 0
+ # begin # emulate blocking recvfrom
+ # p s2.recvfrom_nonblock(10) #=> ["aaa", ["AF_INET", 33302, "localhost.localdomain", "127.0.0.1"]]
+ # rescue IO::WaitReadable
+ # IO.select([s2])
+ # retry
+ # end
+ #
+ # Refer to Socket#recvfrom for the exceptions that may be thrown if the call
+ # to _recvfrom_nonblock_ fails.
+ #
+ # UDPSocket#recvfrom_nonblock may raise any error corresponding to recvfrom(2) failure,
+ # including Errno::EWOULDBLOCK.
+ #
+ # If the exception is Errno::EWOULDBLOCK or Errno::EAGAIN,
+ # it is extended by IO::WaitReadable.
+ # So IO::WaitReadable can be used to rescue the exceptions for retrying recvfrom_nonblock.
+ #
+ # By specifying `exception: false`, the options hash allows you to indicate
+ # that recvmsg_nonblock should not raise an IO::WaitWritable exception, but
+ # return the symbol :wait_writable instead.
+ #
+ # === See
+ # * Socket#recvfrom
+ def recvfrom_nonblock(len, flag = 0, outbuf = nil, exception: true)
+ __recvfrom_nonblock(len, flag, outbuf, exception)
+ end
+end
+
+class TCPServer < TCPSocket
+
+ # call-seq:
+ # tcpserver.accept_nonblock([options]) => tcpsocket
+ #
+ # Accepts an incoming connection using accept(2) after
+ # O_NONBLOCK is set for the underlying file descriptor.
+ # It returns an accepted TCPSocket for the incoming connection.
+ #
+ # === Example
+ # require 'socket'
+ # serv = TCPServer.new(2202)
+ # begin # emulate blocking accept
+ # sock = serv.accept_nonblock
+ # rescue IO::WaitReadable, Errno::EINTR
+ # IO.select([serv])
+ # retry
+ # end
+ # # sock is an accepted socket.
+ #
+ # Refer to Socket#accept for the exceptions that may be thrown if the call
+ # to TCPServer#accept_nonblock fails.
+ #
+ # TCPServer#accept_nonblock may raise any error corresponding to accept(2) failure,
+ # including Errno::EWOULDBLOCK.
+ #
+ # If the exception is Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO,
+ # it is extended by IO::WaitReadable.
+ # So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
+ #
+ # By specifying `exception: false`, the options hash allows you to indicate
+ # that accept_nonblock should not raise an IO::WaitReadable exception, but
+ # return the symbol :wait_readable instead.
+ #
+ # === See
+ # * TCPServer#accept
+ # * Socket#accept
+ def accept_nonblock(exception: true)
+ __accept_nonblock(exception)
+ end
+end
+
+class UNIXServer < UNIXSocket
+ # call-seq:
+ # unixserver.accept_nonblock([options]) => unixsocket
+ #
+ # Accepts an incoming connection using accept(2) after
+ # O_NONBLOCK is set for the underlying file descriptor.
+ # It returns an accepted UNIXSocket for the incoming connection.
+ #
+ # === Example
+ # require 'socket'
+ # serv = UNIXServer.new("/tmp/sock")
+ # begin # emulate blocking accept
+ # sock = serv.accept_nonblock
+ # rescue IO::WaitReadable, Errno::EINTR
+ # IO.select([serv])
+ # retry
+ # end
+ # # sock is an accepted socket.
+ #
+ # Refer to Socket#accept for the exceptions that may be thrown if the call
+ # to UNIXServer#accept_nonblock fails.
+ #
+ # UNIXServer#accept_nonblock may raise any error corresponding to accept(2) failure,
+ # including Errno::EWOULDBLOCK.
+ #
+ # If the exception is Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::ECONNABORTED or Errno::EPROTO,
+ # it is extended by IO::WaitReadable.
+ # So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
+ #
+ # By specifying `exception: false`, the options hash allows you to indicate
+ # that accept_nonblock should not raise an IO::WaitReadable exception, but
+ # return the symbol :wait_readable instead.
+ #
+ # === See
+ # * UNIXServer#accept
+ # * Socket#accept
+ def accept_nonblock(exception: true)
+ __accept_nonblock(exception)
+ end
+end if defined?(UNIXSocket)
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index d12b2a24e3..0ebf628b46 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'optparse'
require 'erb'
@@ -540,6 +541,7 @@ IP_FREEBIND nil Allow binding to nonexistent IP addresses
IP_IPSEC_POLICY nil IPsec security policy
IP_XFRM_POLICY
IP_PASSSEC nil Retrieve security context with datagram
+IP_TRANSPARENT nil Transparent proxy
IP_PMTUDISC_DONT nil Never send DF frames
IP_PMTUDISC_WANT nil Use per-route hints
IP_PMTUDISC_DO nil Always send DF frames
@@ -568,6 +570,8 @@ SO_DONTROUTE nil Use interface addresses
SO_BROADCAST nil Permit sending of broadcast messages
SO_SNDBUF nil Send buffer size
SO_RCVBUF nil Receive buffer size
+SO_SNDBUFFORCE nil Send buffer size without wmem_max limit (Linux 2.6.14)
+SO_RCVBUFFORCE nil Receive buffer size without rmem_max limit (Linux 2.6.14)
SO_KEEPALIVE nil Keep connections alive
SO_OOBINLINE nil Leave received out-of-band data in-line
SO_NO_CHECK nil Disable checksums
@@ -594,6 +598,7 @@ SO_SECURITY_ENCRYPTION_NETWORK
SO_BINDTODEVICE nil Only send packets from the given interface
SO_ATTACH_FILTER nil Attach an accept filter
SO_DETACH_FILTER nil Detach an accept filter
+SO_GET_FILTER nil Obtain filter set by SO_ATTACH_FILTER (Linux 3.8)
SO_PEERNAME nil Name of the connecting user
SO_TIMESTAMP nil Receive timestamp with datagrams (timeval)
SO_TIMESTAMPNS nil Receive nanosecond timestamp with datagrams (timespec)
@@ -601,6 +606,21 @@ SO_BINTIME nil Receive timestamp with datagrams (bintime)
SO_RECVUCRED nil Receive user credentials with datagram
SO_MAC_EXEMPT nil Mandatory Access Control exemption for unlabeled peers
SO_ALLZONES nil Bypass zone boundaries
+SO_PEERSEC nil Obtain the security credentials (Linux 2.6.2)
+SO_PASSSEC nil Toggle security context passing (Linux 2.6.18)
+SO_MARK nil Set the mark for mark-based routing (Linux 2.6.25)
+SO_TIMESTAMPING nil Time stamping of incoming and outgoing packets (Linux 2.6.30)
+SO_PROTOCOL nil Protocol given for socket() (Linux 2.6.32)
+SO_DOMAIN nil Domain given for socket() (Linux 2.6.32)
+SO_RXQ_OVFL nil Toggle cmsg for number of packets dropped (Linux 2.6.33)
+SO_WIFI_STATUS nil Toggle cmsg for wifi status (Linux 3.3)
+SO_PEEK_OFF nil Set the peek offset (Linux 3.4)
+SO_NOFCS nil Set netns of a socket (Linux 3.4)
+SO_LOCK_FILTER nil Lock the filter attached to a socket (Linux 3.9)
+SO_SELECT_ERR_QUEUE nil Make select() detect socket error queue with errorfds (Linux 3.10)
+SO_BUSY_POLL nil Set the threshold in microseconds for low latency polling (Linux 3.11)
+SO_MAX_PACING_RATE nil Cap the rate computed by transport layer. [bytes per second] (Linux 3.13)
+SO_BPF_EXTENSIONS nil Query supported BPF extensions (Linux 3.14)
SOPRI_INTERACTIVE nil Interactive socket priority
SOPRI_NORMAL nil Normal socket priority
@@ -610,22 +630,32 @@ IPX_TYPE
TCP_NODELAY nil Don't delay sending to coalesce packets
TCP_MAXSEG nil Set maximum segment size
-TCP_CORK nil Don't send partial frames
-TCP_DEFER_ACCEPT nil Don't notify a listening socket until data is ready
-TCP_INFO nil Retrieve information about this socket
-TCP_KEEPCNT nil Maximum number of keepalive probes allowed before dropping a connection
-TCP_KEEPIDLE nil Idle time before keepalive probes are sent
-TCP_KEEPINTVL nil Time between keepalive probes
-TCP_LINGER2 nil Lifetime of orphaned FIN_WAIT2 sockets
-TCP_MD5SIG nil Use MD5 digests (RFC2385)
+TCP_CORK nil Don't send partial frames (Linux 2.2, glibc 2.2)
+TCP_DEFER_ACCEPT nil Don't notify a listening socket until data is ready (Linux 2.4, glibc 2.2)
+TCP_INFO nil Retrieve information about this socket (Linux 2.4, glibc 2.2)
+TCP_KEEPCNT nil Maximum number of keepalive probes allowed before dropping a connection (Linux 2.4, glibc 2.2)
+TCP_KEEPIDLE nil Idle time before keepalive probes are sent (Linux 2.4, glibc 2.2)
+TCP_KEEPINTVL nil Time between keepalive probes (Linux 2.4, glibc 2.2)
+TCP_LINGER2 nil Lifetime of orphaned FIN_WAIT2 sockets (Linux 2.4, glibc 2.2)
+TCP_MD5SIG nil Use MD5 digests (RFC2385, Linux 2.6.20, glibc 2.7)
TCP_NOOPT nil Don't use TCP options
TCP_NOPUSH nil Don't push the last block of write
-TCP_QUICKACK nil Enable quickack mode
-TCP_SYNCNT nil Number of SYN retransmits before a connection is dropped
-TCP_WINDOW_CLAMP nil Clamp the size of the advertised window
-TCP_FASTOPEN nil Reduce step of the handshake process
-
-UDP_CORK nil Don't send partial frames
+TCP_QUICKACK nil Enable quickack mode (Linux 2.4.4, glibc 2.3)
+TCP_SYNCNT nil Number of SYN retransmits before a connection is dropped (Linux 2.4, glibc 2.2)
+TCP_WINDOW_CLAMP nil Clamp the size of the advertised window (Linux 2.4, glibc 2.2)
+TCP_FASTOPEN nil Reduce step of the handshake process (Linux 3.7, glibc 2.18)
+TCP_CONGESTION nil TCP congestion control algorithm (Linux 2.6.13, glibc 2.6)
+TCP_COOKIE_TRANSACTIONS nil TCP Cookie Transactions (Linux 2.6.33, glibc 2.18)
+TCP_QUEUE_SEQ nil Sequence of a queue for repair mode (Linux 3.5, glibc 2.18)
+TCP_REPAIR nil Repair mode (Linux 3.5, glibc 2.18)
+TCP_REPAIR_OPTIONS nil Options for repair mode (Linux 3.5, glibc 2.18)
+TCP_REPAIR_QUEUE nil Queue for repair mode (Linux 3.5, glibc 2.18)
+TCP_THIN_DUPACK nil Duplicated acknowledgments handling for thin-streams (Linux 2.6.34, glibc 2.18)
+TCP_THIN_LINEAR_TIMEOUTS nil Linear timeouts for thin-streams (Linux 2.6.34, glibc 2.18)
+TCP_TIMESTAMP nil TCP timestamp (Linux 3.9, glibc 2.18)
+TCP_USER_TIMEOUT nil Max timeout before a TCP connection is aborted (Linux 2.6.37, glibc 2.18)
+
+UDP_CORK nil Don't send partial frames (Linux 2.5.44, glibc 2.11)
EAI_ADDRFAMILY nil Address family for hostname not supported
EAI_AGAIN nil Temporary failure in name resolution
@@ -704,10 +734,12 @@ SOMAXCONN 5 Maximum connection requests that may be queued for a socket
SCM_RIGHTS nil Access rights
SCM_TIMESTAMP nil Timestamp (timeval)
SCM_TIMESTAMPNS nil Timespec (timespec)
+SCM_TIMESTAMPING nil Timestamp (timespec list) (Linux 2.6.30)
SCM_BINTIME nil Timestamp (bintime)
SCM_CREDENTIALS nil The sender's credentials
SCM_CREDS nil Process credentials
SCM_UCRED nil User credentials
+SCM_WIFI_STATUS nil Wifi status (Linux 3.3)
LOCAL_PEERCRED nil Retrieve peer credentials
LOCAL_CREDS nil Pass credentials to receiver
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 3e32230aab..a823ec7757 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -2,6 +2,51 @@
VALUE rb_cSockOpt;
+#define pack_var(v) rb_str_new((const char *)&(v), sizeof(v))
+
+#define CAT(x,y) x##y
+#define XCAT(x,y) CAT(x,y)
+
+#if defined(__linux__) || \
+ defined(__GNU__) /* GNU/Hurd */ || \
+ defined(__FreeBSD__) || \
+ defined(__DragonFly__) || \
+ defined(__APPLE__) || \
+ defined(_WIN32) || \
+ defined(__CYGWIN__)
+# define TYPE_IP_MULTICAST_LOOP int
+# define TYPE_IP_MULTICAST_TTL int
+#else
+/* The original IP multicast implementation by Steve Deering
+ * NetBSD
+ * OpenBSD
+ * SunOS
+ */
+# define TYPE_IP_MULTICAST_LOOP byte
+# define TYPE_IP_MULTICAST_TTL byte
+# define USE_INSPECT_BYTE 1
+#endif
+
+#define check_size(len, size) \
+ ((len) == (size) ? \
+ (void)0 : \
+ rb_raise(rb_eTypeError, "size differ. expected as "#size"=%d but %ld", \
+ (int)size, (long)(len)))
+
+static VALUE
+sockopt_pack_byte(VALUE value)
+{
+ char i = NUM2CHR(rb_to_int(value));
+ return pack_var(i);
+}
+
+static VALUE
+sockopt_pack_int(VALUE value)
+{
+ int i = NUM2INT(rb_to_int(value));
+ return pack_var(i);
+}
+
static VALUE
constant_to_sym(int constant, ID (*intern_const)(int))
{
@@ -148,8 +193,6 @@ sockopt_data(VALUE self)
*
* Creates a new Socket::Option object which contains a byte as data.
*
- * The size and endian is dependent on the platform.
- *
* p Socket::Option.byte(:INET, :SOCKET, :KEEPALIVE, 1)
* #=> #<Socket::Option: INET SOCKET KEEPALIVE 1>
*/
@@ -159,8 +202,7 @@ sockopt_s_byte(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE v
int family = rsock_family_arg(vfamily);
int level = rsock_level_arg(family, vlevel);
int optname = rsock_optname_arg(family, level, voptname);
- unsigned char i = (unsigned char)NUM2CHR(vint);
- return rsock_sockopt_new(family, level, optname, rb_str_new((char*)&i, sizeof(i)));
+ return rsock_sockopt_new(family, level, optname, sockopt_pack_byte(vint));
}
/*
@@ -169,20 +211,15 @@ sockopt_s_byte(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE v
*
* Returns the data in _sockopt_ as an byte.
*
- * The size and endian is dependent on the platform.
- *
* sockopt = Socket::Option.byte(:INET, :SOCKET, :KEEPALIVE, 1)
* p sockopt.byte => 1
*/
static VALUE
sockopt_byte(VALUE self)
{
- unsigned char i;
VALUE data = sockopt_data(self);
StringValue(data);
- if (RSTRING_LEN(data) != sizeof(i))
- rb_raise(rb_eTypeError, "size differ. expected as sizeof(int)=%d but %ld",
- (int)sizeof(i), (long)RSTRING_LEN(data));
+ check_size(RSTRING_LEN(data), sizeof(char));
return CHR2FIX(*RSTRING_PTR(data));
}
@@ -203,8 +240,7 @@ sockopt_s_int(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE vi
int family = rsock_family_arg(vfamily);
int level = rsock_level_arg(family, vlevel);
int optname = rsock_optname_arg(family, level, voptname);
- int i = NUM2INT(vint);
- return rsock_sockopt_new(family, level, optname, rb_str_new((char*)&i, sizeof(i)));
+ return rsock_sockopt_new(family, level, optname, sockopt_pack_int(vint));
}
/*
@@ -224,9 +260,7 @@ sockopt_int(VALUE self)
int i;
VALUE data = sockopt_data(self);
StringValue(data);
- if (RSTRING_LEN(data) != sizeof(int))
- rb_raise(rb_eTypeError, "size differ. expected as sizeof(int)=%d but %ld",
- (int)sizeof(int), (long)RSTRING_LEN(data));
+ check_size(RSTRING_LEN(data), sizeof(int));
memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
return INT2NUM(i);
}
@@ -252,7 +286,7 @@ sockopt_s_bool(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE v
int level = rsock_level_arg(family, vlevel);
int optname = rsock_optname_arg(family, level, voptname);
int i = RTEST(vbool) ? 1 : 0;
- return rsock_sockopt_new(family, level, optname, rb_str_new((char*)&i, sizeof(i)));
+ return rsock_sockopt_new(family, level, optname, pack_var(i));
}
/*
@@ -268,12 +302,15 @@ static VALUE
sockopt_bool(VALUE self)
{
int i;
+ long len;
VALUE data = sockopt_data(self);
StringValue(data);
- if (RSTRING_LEN(data) != sizeof(int))
- rb_raise(rb_eTypeError, "size differ. expected as sizeof(int)=%d but %ld",
- (int)sizeof(int), (long)RSTRING_LEN(data));
- memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
+ len = RSTRING_LEN(data);
+ if (len == 1) {
+ return *RSTRING_PTR(data) == 0 ? Qfalse : Qtrue;
+ }
+ check_size(len, sizeof(int));
+ memcpy((char*)&i, RSTRING_PTR(data), len);
return i == 0 ? Qfalse : Qtrue;
}
@@ -302,7 +339,7 @@ sockopt_s_linger(VALUE klass, VALUE vonoff, VALUE vsecs)
else
l.l_onoff = RTEST(vonoff) ? 1 : 0;
l.l_linger = NUM2INT(vsecs);
- return rsock_sockopt_new(AF_UNSPEC, SOL_SOCKET, SO_LINGER, rb_str_new((char*)&l, sizeof(l)));
+ return rsock_sockopt_new(AF_UNSPEC, SOL_SOCKET, SO_LINGER, pack_var(l));
}
/*
@@ -325,9 +362,7 @@ sockopt_linger(VALUE self)
if (level != SOL_SOCKET || optname != SO_LINGER)
rb_raise(rb_eTypeError, "linger socket option expected");
- if (RSTRING_LEN(data) != sizeof(l))
- rb_raise(rb_eTypeError, "size differ. expected as sizeof(struct linger)=%d but %ld",
- (int)sizeof(struct linger), (long)RSTRING_LEN(data));
+ check_size(RSTRING_LEN(data), sizeof(struct linger));
memcpy((char*)&l, RSTRING_PTR(data), sizeof(struct linger));
switch (l.l_onoff) {
case 0: vonoff = Qfalse; break;
@@ -356,14 +391,10 @@ sockopt_linger(VALUE self)
static VALUE
sockopt_s_ipv4_multicast_loop(VALUE klass, VALUE value)
{
+
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
-# ifdef __NetBSD__
- unsigned char i = NUM2CHR(rb_to_int(value));
-# else
- int i = NUM2INT(rb_to_int(value));
-# endif
- return rsock_sockopt_new(AF_INET, IPPROTO_IP, IP_MULTICAST_LOOP,
- rb_str_new((char*)&i, sizeof(i)));
+ VALUE o = XCAT(sockopt_pack_,TYPE_IP_MULTICAST_LOOP)(value);
+ return rsock_sockopt_new(AF_INET, IPPROTO_IP, IP_MULTICAST_LOOP, o);
#else
# error IPPROTO_IP or IP_MULTICAST_LOOP is not implemented
#endif
@@ -387,22 +418,15 @@ sockopt_ipv4_multicast_loop(VALUE self)
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_LOOP) {
-# ifdef __NetBSD__
- return sockopt_byte(self);
-# else
- return sockopt_int(self);
-# endif
+ return XCAT(sockopt_,TYPE_IP_MULTICAST_LOOP)(self);
}
#endif
rb_raise(rb_eTypeError, "ipv4_multicast_loop socket option expected");
UNREACHABLE;
}
-#ifdef __NetBSD__
-# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_byte(a,b,c,d)
-#else
-# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_int(a,b,c,d)
-#endif
+#define inspect_ipv4_multicast_loop(a,b,c,d) \
+ XCAT(inspect_,TYPE_IP_MULTICAST_LOOP)(a,b,c,d)
/*
* call-seq:
@@ -420,13 +444,8 @@ static VALUE
sockopt_s_ipv4_multicast_ttl(VALUE klass, VALUE value)
{
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
-# ifdef __NetBSD__
- unsigned char i = NUM2CHR(rb_to_int(value));
-# else
- int i = NUM2INT(rb_to_int(value));
-# endif
- return rsock_sockopt_new(AF_INET, IPPROTO_IP, IP_MULTICAST_TTL,
- rb_str_new((char*)&i, sizeof(i)));
+ VALUE o = XCAT(sockopt_pack_,TYPE_IP_MULTICAST_TTL)(value);
+ return rsock_sockopt_new(AF_INET, IPPROTO_IP, IP_MULTICAST_TTL, o);
#else
# error IPPROTO_IP or IP_MULTICAST_TTL is not implemented
#endif
@@ -450,22 +469,15 @@ sockopt_ipv4_multicast_ttl(VALUE self)
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_TTL) {
-# ifdef __NetBSD__
- return sockopt_byte(self);
-# else
- return sockopt_int(self);
-# endif
+ return XCAT(sockopt_,TYPE_IP_MULTICAST_TTL)(self);
}
#endif
rb_raise(rb_eTypeError, "ipv4_multicast_ttl socket option expected");
UNREACHABLE;
}
-#ifdef __NetBSD__
-# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_byte(a,b,c,d)
-#else
-# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_int(a,b,c,d)
-#endif
+#define inspect_ipv4_multicast_ttl(a,b,c,d) \
+ XCAT(inspect_,TYPE_IP_MULTICAST_TTL)(a,b,c,d)
static int
inspect_int(int level, int optname, VALUE data, VALUE ret)
@@ -481,7 +493,7 @@ inspect_int(int level, int optname, VALUE data, VALUE ret)
}
}
-#ifdef __NetBSD__
+#ifdef USE_INSPECT_BYTE
static int
inspect_byte(int level, int optname, VALUE data, VALUE ret)
{
@@ -591,6 +603,15 @@ inspect_timeval_as_interval(int level, int optname, VALUE data, VALUE ret)
* (MULTICAST 1.2 Release)
* http://www.kohala.com/start/mcast.api.txt
*
+ * There are 2 socket options which takes a u_char (unsigned char).
+ *
+ * IP_MULTICAST_TTL
+ * IP_MULTICAST_LOOP
+ *
+ * However Linux and FreeBSD setsockname accepts int argument
+ * as well as u_char.
+ * Their getsockname returns int.
+ *
* There are 3 socket options which takes a struct.
*
* IP_MULTICAST_IF: struct in_addr
@@ -623,8 +644,8 @@ inspect_timeval_as_interval(int level, int optname, VALUE data, VALUE ret)
* it is not distinguishable by the size.
*/
-#ifndef HAVE_INET_NTOP
-static const char *
+#if !defined HAVE_INET_NTOP && ! defined _WIN32
+const char *
inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
{
#ifdef HAVE_INET_NTOA
@@ -639,8 +660,6 @@ 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". */
@@ -789,6 +808,333 @@ inspect_ipv6_mreq(int level, int optname, VALUE data, VALUE ret)
}
#endif
+#if defined(IPPROTO_TCP) && defined(TCP_INFO) && defined(HAVE_TYPE_STRUCT_TCP_INFO)
+
+#ifdef __FreeBSD__
+# ifndef HAVE_CONST_TCP_ESTABLISHED
+# define TCP_ESTABLISHED TCPS_ESTABLISHED
+# endif
+# ifndef HAVE_CONST_TCP_SYN_SENT
+# define TCP_SYN_SENT TCPS_SYN_SENT
+# endif
+# ifndef HAVE_CONST_TCP_SYN_RECV
+# define TCP_SYN_RECV TCPS_SYN_RECEIVED
+# endif
+# ifndef HAVE_CONST_TCP_FIN_WAIT1
+# define TCP_FIN_WAIT1 TCPS_FIN_WAIT_1
+# endif
+# ifndef HAVE_CONST_TCP_FIN_WAIT2
+# define TCP_FIN_WAIT2 TCPS_FIN_WAIT_2
+# endif
+# ifndef HAVE_CONST_TCP_TIME_WAIT
+# define TCP_TIME_WAIT TCPS_TIME_WAIT
+# endif
+# ifndef HAVE_CONST_TCP_CLOSE
+# define TCP_CLOSE TCPS_CLOSED
+# endif
+# ifndef HAVE_CONST_TCP_CLOSE_WAIT
+# define TCP_CLOSE_WAIT TCPS_CLOSE_WAIT
+# endif
+# ifndef HAVE_CONST_TCP_LAST_ACK
+# define TCP_LAST_ACK TCPS_LAST_ACK
+# endif
+# ifndef HAVE_CONST_TCP_LISTEN
+# define TCP_LISTEN TCPS_LISTEN
+# endif
+# ifndef HAVE_CONST_TCP_CLOSING
+# define TCP_CLOSING TCPS_CLOSING
+# endif
+#endif
+
+#if defined(HAVE_CONST_TCP_ESTABLISHED) && !defined(TCP_ESTABLISHED)
+# define TCP_ESTABLISHED TCP_ESTABLISHED
+#endif
+#if defined(HAVE_CONST_TCP_SYN_SENT) && !defined(TCP_SYN_SENT)
+# define TCP_SYN_SENT TCP_SYN_SENT
+#endif
+#if defined(HAVE_CONST_TCP_SYN_RECV) && !defined(TCP_SYN_RECV)
+# define TCP_SYN_RECV TCP_SYN_RECV
+#endif
+#if defined(HAVE_CONST_TCP_FIN_WAIT1) && !defined(TCP_FIN_WAIT1)
+# define TCP_FIN_WAIT1 TCP_FIN_WAIT1
+#endif
+#if defined(HAVE_CONST_TCP_FIN_WAIT2) && !defined(TCP_FIN_WAIT2)
+# define TCP_FIN_WAIT2 TCP_FIN_WAIT2
+#endif
+#if defined(HAVE_CONST_TCP_TIME_WAIT) && !defined(TCP_TIME_WAIT)
+# define TCP_TIME_WAIT TCP_TIME_WAIT
+#endif
+#if defined(HAVE_CONST_TCP_CLOSE) && !defined(TCP_CLOSE)
+# define TCP_CLOSE TCP_CLOSE
+#endif
+#if defined(HAVE_CONST_TCP_CLOSE_WAIT) && !defined(TCP_CLOSE_WAIT)
+# define TCP_CLOSE_WAIT TCP_CLOSE_WAIT
+#endif
+#if defined(HAVE_CONST_TCP_LAST_ACK) && !defined(TCP_LAST_ACK)
+# define TCP_LAST_ACK TCP_LAST_ACK
+#endif
+#if defined(HAVE_CONST_TCP_LISTEN) && !defined(TCP_LISTEN)
+# define TCP_LISTEN TCP_LISTEN
+#endif
+#if defined(HAVE_CONST_TCP_CLOSING) && !defined(TCP_CLOSING)
+# define TCP_CLOSING TCP_CLOSING
+#endif
+
+static void
+inspect_tcpi_options(VALUE ret, uint8_t options)
+{
+ int sep = '=';
+
+ rb_str_cat2(ret, " options");
+#define INSPECT_TCPI_OPTION(optval, name) \
+ if (options & (optval)) { \
+ options &= ~(uint8_t)(optval); \
+ rb_str_catf(ret, "%c%s", sep, name); \
+ sep = ','; \
+ }
+#ifdef TCPI_OPT_TIMESTAMPS /* GNU/Linux, FreeBSD */
+ INSPECT_TCPI_OPTION(TCPI_OPT_TIMESTAMPS, "TIMESTAMPS");
+#endif
+#ifdef TCPI_OPT_SACK /* GNU/Linux, FreeBSD */
+ INSPECT_TCPI_OPTION(TCPI_OPT_SACK, "SACK");
+#endif
+#ifdef TCPI_OPT_WSCALE /* GNU/Linux, FreeBSD */
+ INSPECT_TCPI_OPTION(TCPI_OPT_WSCALE, "WSCALE");
+#endif
+#ifdef TCPI_OPT_ECN /* GNU/Linux, FreeBSD */
+ INSPECT_TCPI_OPTION(TCPI_OPT_ECN, "ECN");
+#endif
+#ifdef TCPI_OPT_ECN_SEEN /* GNU/Linux */
+ INSPECT_TCPI_OPTION(TCPI_OPT_ECN_SEEN, "ECN_SEEN");
+#endif
+#ifdef TCPI_OPT_SYN_DATA /* GNU/Linux */
+ INSPECT_TCPI_OPTION(TCPI_OPT_SYN_DATA, "SYN_DATA");
+#endif
+#ifdef TCPI_OPT_TOE /* FreeBSD */
+ INSPECT_TCPI_OPTION(TCPI_OPT_TOE, "TOE");
+#endif
+#undef INSPECT_TCPI_OPTION
+
+ if (options || sep == '=') {
+ rb_str_catf(ret, "%c%u", sep, options);
+ }
+}
+
+static void
+inspect_tcpi_usec(VALUE ret, const char *prefix, uint32_t t)
+{
+ rb_str_catf(ret, "%s%u.%06us", prefix, t / 1000000, t % 1000000);
+}
+
+#if !defined __FreeBSD__ && ( \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_DATA_SENT || \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_DATA_RECV || \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_ACK_SENT || \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_ACK_RECV || \
+ 0)
+static void
+inspect_tcpi_msec(VALUE ret, const char *prefix, uint32_t t)
+{
+ rb_str_catf(ret, "%s%u.%03us", prefix, t / 1000, t % 1000);
+}
+#endif
+
+#ifdef __FreeBSD__
+# define inspect_tcpi_rto(ret, t) inspect_tcpi_usec(ret, " rto=", t)
+# define inspect_tcpi_last_data_recv(ret, t) inspect_tcpi_usec(ret, " last_data_recv=", t)
+# define inspect_tcpi_rtt(ret, t) inspect_tcpi_usec(ret, " rtt=", t)
+# define inspect_tcpi_rttvar(ret, t) inspect_tcpi_usec(ret, " rttvar=", t)
+#else
+# define inspect_tcpi_rto(ret, t) inspect_tcpi_usec(ret, " rto=", t)
+# define inspect_tcpi_ato(ret, t) inspect_tcpi_usec(ret, " ato=", t)
+# define inspect_tcpi_last_data_sent(ret, t) inspect_tcpi_msec(ret, " last_data_sent=", t)
+# define inspect_tcpi_last_data_recv(ret, t) inspect_tcpi_msec(ret, " last_data_recv=", t)
+# define inspect_tcpi_last_ack_sent(ret, t) inspect_tcpi_msec(ret, " last_ack_sent=", t)
+# define inspect_tcpi_last_ack_recv(ret, t) inspect_tcpi_msec(ret, " last_ack_recv=", t)
+# define inspect_tcpi_rtt(ret, t) inspect_tcpi_usec(ret, " rtt=", t)
+# define inspect_tcpi_rttvar(ret, t) inspect_tcpi_usec(ret, " rttvar=", t)
+# define inspect_tcpi_rcv_rtt(ret, t) inspect_tcpi_usec(ret, " rcv_rtt=", t)
+#endif
+
+static int
+inspect_tcp_info(int level, int optname, VALUE data, VALUE ret)
+{
+ size_t actual_size = RSTRING_LEN(data);
+ if (sizeof(struct tcp_info) <= actual_size) {
+ struct tcp_info s;
+ memcpy((char*)&s, RSTRING_PTR(data), sizeof(s));
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_STATE
+ switch (s.tcpi_state) {
+# ifdef TCP_ESTABLISHED
+ case TCP_ESTABLISHED: rb_str_cat_cstr(ret, " state=ESTABLISHED"); break;
+# endif
+# ifdef TCP_SYN_SENT
+ case TCP_SYN_SENT: rb_str_cat_cstr(ret, " state=SYN_SENT"); break;
+# endif
+# ifdef TCP_SYN_RECV
+ case TCP_SYN_RECV: rb_str_cat_cstr(ret, " state=SYN_RECV"); break;
+# endif
+# ifdef TCP_FIN_WAIT1
+ case TCP_FIN_WAIT1: rb_str_cat_cstr(ret, " state=FIN_WAIT1"); break;
+# endif
+# ifdef TCP_FIN_WAIT2
+ case TCP_FIN_WAIT2: rb_str_cat_cstr(ret, " state=FIN_WAIT2"); break;
+# endif
+# ifdef TCP_TIME_WAIT
+ case TCP_TIME_WAIT: rb_str_cat_cstr(ret, " state=TIME_WAIT"); break;
+# endif
+# ifdef TCP_CLOSE
+ case TCP_CLOSE: rb_str_cat_cstr(ret, " state=CLOSED"); break; /* RFC 793 uses "CLOSED", not "CLOSE" */
+# endif
+# ifdef TCP_CLOSE_WAIT
+ case TCP_CLOSE_WAIT: rb_str_cat_cstr(ret, " state=CLOSE_WAIT"); break;
+# endif
+# ifdef TCP_LAST_ACK
+ case TCP_LAST_ACK: rb_str_cat_cstr(ret, " state=LAST_ACK"); break;
+# endif
+# ifdef TCP_LISTEN
+ case TCP_LISTEN: rb_str_cat_cstr(ret, " state=LISTEN"); break;
+# endif
+# ifdef TCP_CLOSING
+ case TCP_CLOSING: rb_str_cat_cstr(ret, " state=CLOSING"); break;
+# endif
+ default: rb_str_catf(ret, " state=%u", s.tcpi_state); break;
+ }
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_CA_STATE
+ switch (s.tcpi_ca_state) {
+ case TCP_CA_Open: rb_str_cat_cstr(ret, " ca_state=Open"); break;
+ case TCP_CA_Disorder: rb_str_cat_cstr(ret, " ca_state=Disorder"); break;
+ case TCP_CA_CWR: rb_str_cat_cstr(ret, " ca_state=CWR"); break;
+ case TCP_CA_Recovery: rb_str_cat_cstr(ret, " ca_state=Recovery"); break;
+ case TCP_CA_Loss: rb_str_cat_cstr(ret, " ca_state=Loss"); break;
+ default: rb_str_catf(ret, " ca_state=%u", s.tcpi_ca_state); break;
+ }
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RETRANSMITS
+ rb_str_catf(ret, " retransmits=%u", s.tcpi_retransmits);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_PROBES
+ rb_str_catf(ret, " probes=%u", s.tcpi_probes);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_BACKOFF
+ rb_str_catf(ret, " backoff=%u", s.tcpi_backoff);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_OPTIONS
+ inspect_tcpi_options(ret, s.tcpi_options);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_WSCALE
+ rb_str_catf(ret, " snd_wscale=%u", s.tcpi_snd_wscale);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RCV_WSCALE
+ rb_str_catf(ret, " rcv_wscale=%u", s.tcpi_rcv_wscale);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RTO
+ inspect_tcpi_rto(ret, s.tcpi_rto);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_ATO
+ inspect_tcpi_ato(ret, s.tcpi_ato);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_MSS
+ rb_str_catf(ret, " snd_mss=%u", s.tcpi_snd_mss);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RCV_MSS
+ rb_str_catf(ret, " rcv_mss=%u", s.tcpi_rcv_mss);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_UNACKED
+ rb_str_catf(ret, " unacked=%u", s.tcpi_unacked);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SACKED
+ rb_str_catf(ret, " sacked=%u", s.tcpi_sacked);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_LOST
+ rb_str_catf(ret, " lost=%u", s.tcpi_lost);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RETRANS
+ rb_str_catf(ret, " retrans=%u", s.tcpi_retrans);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_FACKETS
+ rb_str_catf(ret, " fackets=%u", s.tcpi_fackets);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_LAST_DATA_SENT
+ inspect_tcpi_last_data_sent(ret, s.tcpi_last_data_sent);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_LAST_ACK_SENT
+ inspect_tcpi_last_ack_sent(ret, s.tcpi_last_ack_sent);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_LAST_DATA_RECV
+ inspect_tcpi_last_data_recv(ret, s.tcpi_last_data_recv);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_LAST_ACK_RECV
+ inspect_tcpi_last_ack_recv(ret, s.tcpi_last_ack_recv);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_PMTU
+ rb_str_catf(ret, " pmtu=%u", s.tcpi_pmtu);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RCV_SSTHRESH
+ rb_str_catf(ret, " rcv_ssthresh=%u", s.tcpi_rcv_ssthresh);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RTT
+ inspect_tcpi_rtt(ret, s.tcpi_rtt);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RTTVAR
+ inspect_tcpi_rttvar(ret, s.tcpi_rttvar);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_SSTHRESH
+ rb_str_catf(ret, " snd_ssthresh=%u", s.tcpi_snd_ssthresh);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
+ rb_str_catf(ret, " snd_cwnd=%u", s.tcpi_snd_cwnd);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_ADVMSS
+ rb_str_catf(ret, " advmss=%u", s.tcpi_advmss);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_REORDERING
+ rb_str_catf(ret, " reordering=%u", s.tcpi_reordering);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RCV_RTT
+ inspect_tcpi_rcv_rtt(ret, s.tcpi_rcv_rtt);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RCV_SPACE
+ rb_str_catf(ret, " rcv_space=%u", s.tcpi_rcv_space);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_TOTAL_RETRANS
+ rb_str_catf(ret, " total_retrans=%u", s.tcpi_total_retrans);
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_WND
+ rb_str_catf(ret, " snd_wnd=%u", s.tcpi_snd_wnd); /* FreeBSD */
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_BWND
+ rb_str_catf(ret, " snd_bwnd=%u", s.tcpi_snd_bwnd); /* FreeBSD */
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_NXT
+ rb_str_catf(ret, " snd_nxt=%u", s.tcpi_snd_nxt); /* FreeBSD */
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RCV_NXT
+ rb_str_catf(ret, " rcv_nxt=%u", s.tcpi_rcv_nxt); /* FreeBSD */
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_TOE_TID
+ rb_str_catf(ret, " toe_tid=%u", s.tcpi_toe_tid); /* FreeBSD */
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_REXMITPACK
+ rb_str_catf(ret, " snd_rexmitpack=%u", s.tcpi_snd_rexmitpack); /* FreeBSD */
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_RCV_OOOPACK
+ rb_str_catf(ret, " rcv_ooopack=%u", s.tcpi_rcv_ooopack); /* FreeBSD */
+#endif
+#ifdef HAVE_STRUCT_TCP_INFO_TCPI_SND_ZEROWIN
+ rb_str_catf(ret, " snd_zerowin=%u", s.tcpi_snd_zerowin); /* FreeBSD */
+#endif
+ if (sizeof(struct tcp_info) < actual_size)
+ rb_str_catf(ret, " (%u bytes too long)", (unsigned)(actual_size - sizeof(struct tcp_info)));
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+#endif
+
#if defined(SOL_SOCKET) && defined(SO_PEERCRED) /* GNU/Linux, OpenBSD */
#if defined(__OpenBSD__)
#define RUBY_SOCK_PEERCRED struct sockpeercred
@@ -901,7 +1247,7 @@ sockopt_inspect(VALUE self)
v = optname_to_sym(level, optname);
if (SYMBOL_P(v))
- rb_str_catf(ret, " %s", rb_id2name(SYM2ID(v)));
+ rb_str_catf(ret, " %"PRIsVALUE, rb_sym2str(v));
else
rb_str_catf(ret, " optname:%d", optname);
}
@@ -1036,6 +1382,9 @@ sockopt_inspect(VALUE self)
# if defined(TCP_NODELAY) /* POSIX */
case TCP_NODELAY: inspected = inspect_int(level, optname, data, ret); break;
# endif
+# if defined(TCP_INFO) && defined(HAVE_TYPE_STRUCT_TCP_INFO) /* Linux, FreeBSD */
+ case TCP_INFO: inspected = inspect_tcp_info(level, optname, data, ret); break;
+# endif
}
break;
# endif
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index 109fcccae8..92556fc9d2 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -1,6 +1,6 @@
/************************************************
- ainfo.c -
+ raddrinfo.c -
created at: Thu Mar 31 12:21:29 JST 1994
@@ -154,6 +154,34 @@ struct getaddrinfo_arg
struct addrinfo **res;
};
+#ifdef HAVE_INET_PTON
+static int
+parse_numeric_port(const char *service, int *portp)
+{
+ unsigned long u;
+
+ if (!service) {
+ *portp = 0;
+ return 1;
+ }
+
+ if (strspn(service, "0123456789") != strlen(service))
+ return 0;
+
+ errno = 0;
+ u = STRTOUL(service, NULL, 10);
+ if (errno)
+ return 0;
+
+ if (0x10000 <= u)
+ return 0;
+
+ *portp = (int)u;
+
+ return 1;
+}
+#endif
+
static void *
nogvl_getaddrinfo(void *arg)
{
@@ -171,24 +199,141 @@ nogvl_getaddrinfo(void *arg)
}
#endif
+static int
+numeric_getaddrinfo(const char *node, const char *service,
+ const struct addrinfo *hints,
+ struct addrinfo **res)
+{
+#ifdef HAVE_INET_PTON
+# if defined __MINGW64__
+# define inet_pton(f,s,d) rb_w32_inet_pton(f,s,d)
+# endif
+
+ int port;
+
+ if (node && parse_numeric_port(service, &port)) {
+ static const struct {
+ int socktype;
+ int protocol;
+ } list[] = {
+ { SOCK_STREAM, IPPROTO_TCP },
+ { SOCK_DGRAM, IPPROTO_UDP },
+ { SOCK_RAW, 0 }
+ };
+ struct addrinfo *ai = NULL;
+ int hint_family = hints ? hints->ai_family : PF_UNSPEC;
+ int hint_socktype = hints ? hints->ai_socktype : 0;
+ int hint_protocol = hints ? hints->ai_protocol : 0;
+ char ipv4addr[4];
+#ifdef AF_INET6
+ char ipv6addr[16];
+ if ((hint_family == PF_UNSPEC || hint_family == PF_INET6) &&
+ strspn(node, "0123456789abcdefABCDEF.:") == strlen(node) &&
+ inet_pton(AF_INET6, node, ipv6addr)) {
+ int i;
+ for (i = numberof(list)-1; 0 <= i; i--) {
+ if ((hint_socktype == 0 || hint_socktype == list[i].socktype) &&
+ (hint_protocol == 0 || list[i].protocol == 0 || hint_protocol == list[i].protocol)) {
+ struct addrinfo *ai0 = xcalloc(1, sizeof(struct addrinfo));
+ struct sockaddr_in6 *sa = xmalloc(sizeof(struct sockaddr_in6));
+ INIT_SOCKADDR_IN6(sa, sizeof(struct sockaddr_in6));
+ memcpy(&sa->sin6_addr, ipv6addr, sizeof(ipv6addr));
+ sa->sin6_port = htons(port);
+ ai0->ai_family = PF_INET6;
+ ai0->ai_socktype = list[i].socktype;
+ ai0->ai_protocol = hint_protocol ? hint_protocol : list[i].protocol;
+ ai0->ai_addrlen = sizeof(struct sockaddr_in6);
+ ai0->ai_addr = (struct sockaddr *)sa;
+ ai0->ai_canonname = NULL;
+ ai0->ai_next = ai;
+ ai = ai0;
+ }
+ }
+ }
+ else
+#endif
+ if ((hint_family == PF_UNSPEC || hint_family == PF_INET) &&
+ strspn(node, "0123456789.") == strlen(node) &&
+ inet_pton(AF_INET, node, ipv4addr)) {
+ int i;
+ for (i = numberof(list)-1; 0 <= i; i--) {
+ if ((hint_socktype == 0 || hint_socktype == list[i].socktype) &&
+ (hint_protocol == 0 || list[i].protocol == 0 || hint_protocol == list[i].protocol)) {
+ struct addrinfo *ai0 = xcalloc(1, sizeof(struct addrinfo));
+ struct sockaddr_in *sa = xmalloc(sizeof(struct sockaddr_in));
+ INIT_SOCKADDR_IN(sa, sizeof(struct sockaddr_in));
+ memcpy(&sa->sin_addr, ipv4addr, sizeof(ipv4addr));
+ sa->sin_port = htons(port);
+ ai0->ai_family = PF_INET;
+ ai0->ai_socktype = list[i].socktype;
+ ai0->ai_protocol = hint_protocol ? hint_protocol : list[i].protocol;
+ ai0->ai_addrlen = sizeof(struct sockaddr_in);
+ ai0->ai_addr = (struct sockaddr *)sa;
+ ai0->ai_canonname = NULL;
+ ai0->ai_next = ai;
+ ai = ai0;
+ }
+ }
+ }
+ if (ai) {
+ *res = ai;
+ return 0;
+ }
+ }
+#endif
+ return EAI_FAIL;
+}
+
int
rb_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
- struct addrinfo **res)
+ struct rb_addrinfo **res)
{
+ struct addrinfo *ai;
+ int ret;
+ int allocated_by_malloc = 0;
+
+ ret = numeric_getaddrinfo(node, service, hints, &ai);
+ if (ret == 0)
+ allocated_by_malloc = 1;
+ else {
#ifdef GETADDRINFO_EMU
- return getaddrinfo(node, service, hints, res);
+ ret = getaddrinfo(node, service, hints, &ai);
#else
- struct getaddrinfo_arg arg;
- int ret;
- MEMZERO(&arg, sizeof arg, 1);
- arg.node = node;
- arg.service = service;
- arg.hints = hints;
- arg.res = res;
- ret = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getaddrinfo, &arg, RUBY_UBF_IO, 0);
- return ret;
+ struct getaddrinfo_arg arg;
+ MEMZERO(&arg, struct getaddrinfo_arg, 1);
+ arg.node = node;
+ arg.service = service;
+ arg.hints = hints;
+ arg.res = &ai;
+ ret = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getaddrinfo, &arg, RUBY_UBF_IO, 0);
#endif
+ }
+
+ if (ret == 0) {
+ *res = (struct rb_addrinfo *)xmalloc(sizeof(struct rb_addrinfo));
+ (*res)->allocated_by_malloc = allocated_by_malloc;
+ (*res)->ai = ai;
+ }
+ return ret;
+}
+
+void
+rb_freeaddrinfo(struct rb_addrinfo *ai)
+{
+ if (!ai->allocated_by_malloc)
+ freeaddrinfo(ai->ai);
+ else {
+ struct addrinfo *ai1, *ai2;
+ ai1 = ai->ai;
+ while (ai1) {
+ ai2 = ai1->ai_next;
+ xfree(ai1->ai_addr);
+ xfree(ai1);
+ ai1 = ai2;
+ }
+ }
+ xfree(ai);
}
#ifndef GETADDRINFO_EMU
@@ -196,11 +341,11 @@ struct getnameinfo_arg
{
const struct sockaddr *sa;
socklen_t salen;
+ int flags;
char *host;
size_t hostlen;
char *serv;
size_t servlen;
- int flags;
};
static void *
@@ -345,10 +490,10 @@ port_str(VALUE port, char *pbuf, size_t pbuflen, int *flags_ptr)
}
}
-struct addrinfo*
+struct rb_addrinfo*
rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack)
{
- struct addrinfo* res = NULL;
+ struct rb_addrinfo* res = NULL;
char *hostp, *portp;
int error;
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
@@ -373,13 +518,26 @@ rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_h
return res;
}
-struct addrinfo*
-rsock_addrinfo(VALUE host, VALUE port, int socktype, int flags)
+int
+rsock_fd_family(int fd)
+{
+ struct sockaddr sa = { 0 };
+ socklen_t sa_len = sizeof(sa);
+
+ if (fd < 0 || getsockname(fd, &sa, &sa_len) != 0 ||
+ (size_t)sa_len < offsetof(struct sockaddr, sa_family) + sizeof(sa.sa_family)) {
+ return AF_UNSPEC;
+ }
+ return sa.sa_family;
+}
+
+struct rb_addrinfo*
+rsock_addrinfo(VALUE host, VALUE port, int family, int socktype, int flags)
{
struct addrinfo hints;
MEMZERO(&hints, struct addrinfo, 1);
- hints.ai_family = AF_UNSPEC;
+ hints.ai_family = family;
hints.ai_socktype = socktype;
hints.ai_flags = flags;
return rsock_getaddrinfo(host, port, &hints, 1);
@@ -474,7 +632,7 @@ rsock_unix_sockaddr_len(VALUE path)
struct hostent_arg {
VALUE host;
- struct addrinfo* addr;
+ struct rb_addrinfo* addr;
VALUE (*ipaddr)(struct sockaddr*, socklen_t);
};
@@ -482,7 +640,7 @@ static VALUE
make_hostent_internal(struct hostent_arg *arg)
{
VALUE host = arg->host;
- struct addrinfo* addr = arg->addr;
+ struct addrinfo* addr = arg->addr->ai;
VALUE (*ipaddr)(struct sockaddr*, socklen_t) = arg->ipaddr;
struct addrinfo *ai;
@@ -501,7 +659,8 @@ make_hostent_internal(struct hostent_arg *arg)
}
rb_ary_push(ary, rb_str_new2(hostp));
- if (addr->ai_canonname && (h = gethostbyname(addr->ai_canonname))) {
+ if (addr->ai_canonname && strlen(addr->ai_canonname) < NI_MAXHOST &&
+ (h = gethostbyname(addr->ai_canonname))) {
names = rb_ary_new();
if (h->h_aliases != NULL) {
for (pch = h->h_aliases; *pch; pch++) {
@@ -522,14 +681,15 @@ make_hostent_internal(struct hostent_arg *arg)
}
VALUE
-rsock_freeaddrinfo(struct addrinfo *addr)
+rsock_freeaddrinfo(VALUE arg)
{
- freeaddrinfo(addr);
+ struct rb_addrinfo *addr = (struct rb_addrinfo *)arg;
+ rb_freeaddrinfo(addr);
return Qnil;
}
VALUE
-rsock_make_hostent(VALUE host, struct addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, socklen_t))
+rsock_make_hostent(VALUE host, struct rb_addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, socklen_t))
{
struct hostent_arg arg;
@@ -565,7 +725,7 @@ addrinfo_mark(void *ptr)
static size_t
addrinfo_memsize(const void *ptr)
{
- return ptr ? sizeof(rb_addrinfo_t) : 0;
+ return sizeof(rb_addrinfo_t);
}
static const rb_data_type_t addrinfo_type = {
@@ -599,10 +759,9 @@ get_addrinfo(VALUE self)
static rb_addrinfo_t *
-alloc_addrinfo()
+alloc_addrinfo(void)
{
- rb_addrinfo_t *rai = ALLOC(rb_addrinfo_t);
- memset(rai, 0, sizeof(rb_addrinfo_t));
+ rb_addrinfo_t *rai = ZALLOC(rb_addrinfo_t);
rai->inspectname = Qnil;
rai->canonname = Qnil;
return rai;
@@ -639,12 +798,13 @@ rsock_addrinfo_new(struct sockaddr *addr, socklen_t len,
return a;
}
-static struct addrinfo *
+static struct rb_addrinfo *
call_getaddrinfo(VALUE node, VALUE service,
VALUE family, VALUE socktype, VALUE protocol, VALUE flags,
int socktype_hack)
{
- struct addrinfo hints, *res;
+ struct addrinfo hints;
+ struct rb_addrinfo *res;
MEMZERO(&hints, struct addrinfo, 1);
hints.ai_family = NIL_P(family) ? PF_UNSPEC : rsock_family_arg(family);
@@ -672,21 +832,21 @@ init_addrinfo_getaddrinfo(rb_addrinfo_t *rai, VALUE node, VALUE service,
VALUE family, VALUE socktype, VALUE protocol, VALUE flags,
VALUE inspectnode, VALUE inspectservice)
{
- struct addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 1);
+ struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 1);
VALUE canonname;
- VALUE inspectname = rb_str_equal(node, inspectnode) ? Qnil : make_inspectname(inspectnode, inspectservice, res);
+ VALUE inspectname = rb_str_equal(node, inspectnode) ? Qnil : make_inspectname(inspectnode, inspectservice, res->ai);
canonname = Qnil;
- if (res->ai_canonname) {
- canonname = rb_tainted_str_new_cstr(res->ai_canonname);
+ if (res->ai->ai_canonname) {
+ canonname = rb_tainted_str_new_cstr(res->ai->ai_canonname);
OBJ_FREEZE(canonname);
}
- init_addrinfo(rai, res->ai_addr, res->ai_addrlen,
+ init_addrinfo(rai, res->ai->ai_addr, res->ai->ai_addrlen,
NUM2INT(family), NUM2INT(socktype), NUM2INT(protocol),
canonname, inspectname);
- freeaddrinfo(res);
+ rb_freeaddrinfo(res);
}
static VALUE
@@ -742,21 +902,22 @@ addrinfo_firstonly_new(VALUE node, VALUE service, VALUE family, VALUE socktype,
VALUE canonname;
VALUE inspectname;
- struct addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
+ struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
- inspectname = make_inspectname(node, service, res);
+ inspectname = make_inspectname(node, service, res->ai);
canonname = Qnil;
- if (res->ai_canonname) {
- canonname = rb_tainted_str_new_cstr(res->ai_canonname);
+ if (res->ai->ai_canonname) {
+ canonname = rb_tainted_str_new_cstr(res->ai->ai_canonname);
OBJ_FREEZE(canonname);
}
- ret = rsock_addrinfo_new(res->ai_addr, res->ai_addrlen,
- res->ai_family, res->ai_socktype, res->ai_protocol,
+ ret = rsock_addrinfo_new(res->ai->ai_addr, res->ai->ai_addrlen,
+ res->ai->ai_family, res->ai->ai_socktype,
+ res->ai->ai_protocol,
canonname, inspectname);
- freeaddrinfo(res);
+ rb_freeaddrinfo(res);
return ret;
}
@@ -767,12 +928,12 @@ addrinfo_list_new(VALUE node, VALUE service, VALUE family, VALUE socktype, VALUE
struct addrinfo *r;
VALUE inspectname;
- struct addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
+ struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
- inspectname = make_inspectname(node, service, res);
+ inspectname = make_inspectname(node, service, res->ai);
ret = rb_ary_new();
- for (r = res; r; r = r->ai_next) {
+ for (r = res->ai; r; r = r->ai_next) {
VALUE addr;
VALUE canonname = Qnil;
@@ -788,7 +949,7 @@ addrinfo_list_new(VALUE node, VALUE service, VALUE family, VALUE socktype, VALUE
rb_ary_push(ret, addr);
}
- freeaddrinfo(res);
+ rb_freeaddrinfo(res);
return ret;
}
@@ -1091,7 +1252,7 @@ rsock_inspect_sockaddr(struct sockaddr *sockaddr_arg, socklen_t socklen, VALUE r
}
#endif
-#ifdef AF_PACKET
+#if defined(AF_PACKET) && defined(__linux__)
/* GNU/Linux */
case AF_PACKET:
{
@@ -1513,7 +1674,7 @@ addrinfo_mload(VALUE self, VALUE ary)
default:
{
VALUE pair = rb_convert_type(v, T_ARRAY, "Array", "to_ary");
- struct addrinfo *res;
+ struct rb_addrinfo *res;
int flags = AI_NUMERICHOST;
#ifdef AI_NUMERICSERV
flags |= AI_NUMERICSERV;
@@ -1522,8 +1683,9 @@ addrinfo_mload(VALUE self, VALUE ary)
INT2NUM(pfamily), INT2NUM(socktype), INT2NUM(protocol),
INT2NUM(flags), 1);
- len = res->ai_addrlen;
- memcpy(&ss, res->ai_addr, res->ai_addrlen);
+ len = res->ai->ai_addrlen;
+ memcpy(&ss, res->ai->ai_addr, res->ai->ai_addrlen);
+ rb_freeaddrinfo(res);
break;
}
}
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 97c02fc410..352da8c56e 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -27,11 +27,7 @@
# undef HAVE_TYPE_STRUCT_SOCKADDR_DL
# endif
#else
-# if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
-# include <net/socket.h>
-# else
-# include <sys/socket.h>
-# endif
+# include <sys/socket.h>
# include <netinet/in.h>
# ifdef HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
@@ -39,6 +35,9 @@
# ifdef HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
# endif
+# ifdef HAVE_NETINET_TCP_FSM_H
+# include <netinet/tcp_fsm.h>
+# endif
# ifdef HAVE_NETINET_UDP_H
# include <netinet/udp.h>
# endif
@@ -77,6 +76,9 @@
#endif
#ifdef HAVE_IFADDRS_H
+# ifdef __HAIKU__
+# define _BSD_SOURCE
+# endif
# include <ifaddrs.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
@@ -216,18 +218,20 @@ typedef union {
# endif
#endif
-#ifdef __BEOS__
-# undef close
-# define close closesocket
-#endif
-
#define INET_CLIENT 0
#define INET_SERVER 1
#define INET_SOCKS 2
extern int rsock_do_not_reverse_lookup;
+extern int rsock_cmsg_cloexec_state;
#define FMODE_NOREVLOOKUP 0x100
+/* common socket families only */
+#define FMODE_UNIX 0x00200000
+#define FMODE_INET 0x00400000
+#define FMODE_INET6 0x00800000
+#define FMODE_SOCK (FMODE_UNIX|FMODE_INET|FMODE_INET6)
+
extern VALUE rb_cBasicSocket;
extern VALUE rb_cIPSocket;
extern VALUE rb_cTCPSocket;
@@ -255,7 +259,6 @@ int Rconnect();
#include "constdefs.h"
-#define BLOCKING_REGION(func, arg) (long)rb_thread_blocking_region((func), (arg), RUBY_UBF_IO, 0)
#define BLOCKING_REGION_FD(func, arg) (long)rb_thread_io_blocking_region((func), (arg), (arg)->fd)
#define SockAddrStringValue(v) rsock_sockaddr_string_value(&(v))
@@ -276,12 +279,19 @@ int rsock_optname_arg(int family, int level, VALUE optname);
int rsock_cmsg_type_arg(int family, int level, VALUE type);
int rsock_shutdown_how_arg(VALUE how);
-int rsock_getfamily(int sockfd);
+int rsock_getfamily(rb_io_t *fptr);
-int rb_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);
+struct rb_addrinfo {
+ struct addrinfo *ai;
+ int allocated_by_malloc;
+};
+int rb_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct rb_addrinfo **res);
+void rb_freeaddrinfo(struct rb_addrinfo *ai);
+VALUE rsock_freeaddrinfo(VALUE arg);
int rb_getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);
-struct addrinfo *rsock_addrinfo(VALUE host, VALUE port, int socktype, int flags);
-struct addrinfo *rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack);
+int rsock_fd_family(int fd);
+struct rb_addrinfo *rsock_addrinfo(VALUE host, VALUE port, int family, int socktype, int flags);
+struct rb_addrinfo *rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack);
VALUE rsock_fd_socket_addrinfo(int fd, struct sockaddr *addr, socklen_t len);
VALUE rsock_io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len);
@@ -290,7 +300,7 @@ VALUE rsock_addrinfo_inspect_sockaddr(VALUE rai);
VALUE rsock_make_ipaddr(struct sockaddr *addr, socklen_t addrlen);
VALUE rsock_ipaddr(struct sockaddr *sockaddr, socklen_t sockaddrlen, int norevlookup);
-VALUE rsock_make_hostent(VALUE host, struct addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, socklen_t));
+VALUE rsock_make_hostent(VALUE host, struct rb_addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, socklen_t));
VALUE rsock_inspect_sockaddr(struct sockaddr *addr, socklen_t socklen, VALUE ret);
socklen_t rsock_sockaddr_len(struct sockaddr *addr);
VALUE rsock_sockaddr_obj(struct sockaddr *addr, socklen_t len);
@@ -304,6 +314,7 @@ socklen_t rsock_unix_sockaddr_len(VALUE path);
#endif
int rsock_socket(int domain, int type, int proto);
+int rsock_detect_cloexec(int fd);
VALUE rsock_init_sock(VALUE sock, int fd);
VALUE rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass);
VALUE rsock_init_inetsock(VALUE sock, VALUE remote_host, VALUE remote_serv, VALUE local_host, VALUE local_serv, int type);
@@ -327,28 +338,34 @@ enum sock_recv_type {
RECV_SOCKET /* Socket#recvfrom */
};
-VALUE rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from);
+VALUE rsock_s_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str,
+ VALUE ex, enum sock_recv_type from);
VALUE rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from);
int rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks);
VALUE rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len);
-VALUE rsock_s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len);
+VALUE rsock_s_accept_nonblock(VALUE klass, VALUE ex, rb_io_t *fptr,
+ struct sockaddr *sockaddr, socklen_t *len);
VALUE rsock_sock_listen(VALUE sock, VALUE log);
VALUE rsock_sockopt_new(int family, int level, int optname, VALUE data);
#if defined(HAVE_SENDMSG)
-VALUE rsock_bsock_sendmsg(int argc, VALUE *argv, VALUE sock);
-VALUE rsock_bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock);
+VALUE rsock_bsock_sendmsg(VALUE sock, VALUE data, VALUE flags,
+ VALUE dest_sockaddr, VALUE controls);
+VALUE rsock_bsock_sendmsg_nonblock(VALUE sock, VALUE data, VALUE flags,
+ VALUE dest_sockaddr, VALUE controls, VALUE ex);
#else
#define rsock_bsock_sendmsg rb_f_notimplement
#define rsock_bsock_sendmsg_nonblock rb_f_notimplement
#endif
#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);
+VALUE rsock_bsock_recvmsg(VALUE sock, VALUE dlen, VALUE clen, VALUE flags,
+ VALUE scm_rights);
+VALUE rsock_bsock_recvmsg_nonblock(VALUE sock, VALUE dlen, VALUE clen,
+ VALUE flags, VALUE scm_rights, VALUE ex);
ssize_t rsock_recvmsg(int socket, struct msghdr *message, int flags);
#else
#define rsock_bsock_recvmsg rb_f_notimplement
@@ -374,10 +391,51 @@ void rsock_init_sockopt(void);
void rsock_init_sockifaddr(void);
void rsock_init_socket_init(void);
+NORETURN(void rsock_syserr_fail_host_port(int err, const char *, VALUE, VALUE));
+NORETURN(void rsock_syserr_fail_path(int err, const char *, VALUE));
+NORETURN(void rsock_syserr_fail_sockaddr(int err, const char *mesg, struct sockaddr *addr, socklen_t len));
+NORETURN(void rsock_syserr_fail_raddrinfo(int err, const char *mesg, VALUE rai));
+NORETURN(void rsock_syserr_fail_raddrinfo_or_sockaddr(int err, const char *mesg, VALUE addr, VALUE rai));
+
NORETURN(void rsock_sys_fail_host_port(const char *, VALUE, VALUE));
NORETURN(void rsock_sys_fail_path(const char *, VALUE));
NORETURN(void rsock_sys_fail_sockaddr(const char *, struct sockaddr *addr, socklen_t len));
NORETURN(void rsock_sys_fail_raddrinfo(const char *, VALUE rai));
NORETURN(void rsock_sys_fail_raddrinfo_or_sockaddr(const char *, VALUE addr, VALUE rai));
+/*
+ * It is safe on Linux to attempt using a socket without waiting on it in
+ * all cases. For some syscalls (e.g. accept/accept4), blocking on the
+ * syscall instead of relying on select/poll allows the kernel to use
+ * "wake-one" behavior and avoid the thundering herd problem.
+ * This is likely safe on all other *nix-like systems, so this whitelist
+ * can be expanded by interested parties.
+ */
+#if defined(__linux__)
+static inline int rsock_maybe_fd_writable(int fd) { return 1; }
+static inline void rsock_maybe_wait_fd(int fd) { }
+# ifdef MSG_DONTWAIT
+# define MSG_DONTWAIT_RELIABLE 1
+# endif
+#else /* some systems (mswin/mingw) need these. ref: r36946 */
+# define rsock_maybe_fd_writable(fd) rb_thread_fd_writable((fd))
+# define rsock_maybe_wait_fd(fd) rb_thread_wait_fd((fd))
+#endif
+
+/*
+ * some OSes may support MSG_DONTWAIT inconsistently depending on socket
+ * type, we only expect Linux to support it consistently for all socket types.
+ */
+#ifndef MSG_DONTWAIT_RELIABLE
+# define MSG_DONTWAIT_RELIABLE 0
+#endif
+
+#if !defined HAVE_INET_NTOP && ! defined _WIN32
+const char *inet_ntop(int, const void *, char *, size_t);
+#elif defined __MINGW32__
+# define inet_ntop(f,a,n,l) rb_w32_inet_ntop(f,a,n,l)
+#elif defined _MSC_VER && RUBY_MSVCRT_VERSION < 90
+const char *WSAAPI inet_ntop(int, const void *, char *, size_t);
+#endif
+
#endif
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 5fd74652c6..542cd02ed6 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -10,74 +10,98 @@
#include "rubysocket.h"
+static VALUE sym_wait_writable;
+
static VALUE sock_s_unpack_sockaddr_in(VALUE, VALUE);
void
rsock_sys_fail_host_port(const char *mesg, VALUE host, VALUE port)
{
- VALUE message;
+ rsock_syserr_fail_host_port(errno, mesg, host, port);
+}
- port = rb_String(port);
+void
+rsock_syserr_fail_host_port(int err, const char *mesg, VALUE host, VALUE port)
+{
+ VALUE message;
- message = rb_sprintf("%s for \"%s\" port %s",
- mesg, StringValueCStr(host), StringValueCStr(port));
+ message = rb_sprintf("%s for %+"PRIsVALUE" port % "PRIsVALUE"",
+ mesg, host, port);
- rb_sys_fail_str(message);
+ rb_syserr_fail_str(err, message);
}
void
rsock_sys_fail_path(const char *mesg, VALUE path)
{
+ rsock_syserr_fail_path(errno, mesg, path);
+}
+
+void
+rsock_syserr_fail_path(int err, const char *mesg, VALUE path)
+{
VALUE message;
+
if (RB_TYPE_P(path, T_STRING)) {
- if (memchr(RSTRING_PTR(path), '\0', RSTRING_LEN(path))) {
- path = rb_str_inspect(path);
- message = rb_sprintf("%s for %s", mesg,
- StringValueCStr(path));
- }
- else {
- message = rb_sprintf("%s for \"%s\"", mesg,
- StringValueCStr(path));
- }
- rb_sys_fail_str(message);
+ message = rb_sprintf("%s for % "PRIsVALUE"", mesg, path);
+ rb_syserr_fail_str(err, message);
}
else {
- rb_sys_fail(mesg);
+ rb_syserr_fail(err, mesg);
}
}
void
rsock_sys_fail_sockaddr(const char *mesg, struct sockaddr *addr, socklen_t len)
{
+ rsock_syserr_fail_sockaddr(errno, mesg, addr, len);
+}
+
+void
+rsock_syserr_fail_sockaddr(int err, const char *mesg, struct sockaddr *addr, socklen_t len)
+{
VALUE rai;
rai = rsock_addrinfo_new(addr, len, PF_UNSPEC, 0, 0, Qnil, Qnil);
- rsock_sys_fail_raddrinfo(mesg, rai);
+ rsock_syserr_fail_raddrinfo(err, mesg, rai);
}
void
rsock_sys_fail_raddrinfo(const char *mesg, VALUE rai)
{
+ rsock_syserr_fail_raddrinfo(errno, mesg, rai);
+}
+
+void
+rsock_syserr_fail_raddrinfo(int err, const char *mesg, VALUE rai)
+{
VALUE str, message;
str = rsock_addrinfo_inspect_sockaddr(rai);
- message = rb_sprintf("%s for %s", mesg, StringValueCStr(str));
+ message = rb_sprintf("%s for %"PRIsVALUE"", mesg, str);
- rb_sys_fail_str(message);
+ rb_syserr_fail_str(err, message);
}
void
rsock_sys_fail_raddrinfo_or_sockaddr(const char *mesg, VALUE addr, VALUE rai)
{
+ rsock_syserr_fail_raddrinfo_or_sockaddr(errno, mesg, addr, rai);
+}
+
+void
+rsock_syserr_fail_raddrinfo_or_sockaddr(int err, const char *mesg, VALUE addr, VALUE rai)
+{
if (NIL_P(rai)) {
StringValue(addr);
- rsock_sys_fail_sockaddr(mesg,
+
+ rsock_syserr_fail_sockaddr(err, mesg,
(struct sockaddr *)RSTRING_PTR(addr),
(socklen_t)RSTRING_LEN(addr)); /* overflow should be checked already */
}
else
- rsock_sys_fail_raddrinfo(mesg, rai);
+ rsock_syserr_fail_raddrinfo(err, mesg, rai);
}
static void
@@ -116,7 +140,6 @@ sock_initialize(int argc, VALUE *argv, VALUE sock)
if (NIL_P(protocol))
protocol = INT2FIX(0);
- rb_secure(3);
setup_domain_and_type(domain, &d, type, &t);
fd = rsock_socket(d, t, NUM2INT(protocol));
if (fd < 0) rb_sys_fail("socket(2)");
@@ -128,7 +151,7 @@ sock_initialize(int argc, VALUE *argv, VALUE sock)
static VALUE
io_call_close(VALUE io)
{
- return rb_funcall(io, rb_intern("close"), 0, 0);
+ return rb_funcallv(io, rb_intern("close"), 0, 0);
}
static VALUE
@@ -146,16 +169,29 @@ pair_yield(VALUE pair)
#if defined HAVE_SOCKETPAIR
+#ifdef SOCK_CLOEXEC
static int
rsock_socketpair0(int domain, int type, int protocol, int sv[2])
{
int ret;
+ static int cloexec_state = -1; /* <0: unknown, 0: ignored, >0: working */
-#ifdef SOCK_CLOEXEC
- static int try_sock_cloexec = 1;
- if (try_sock_cloexec) {
+ if (cloexec_state > 0) { /* common path, if SOCK_CLOEXEC is defined */
ret = socketpair(domain, type|SOCK_CLOEXEC, protocol, sv);
- if (ret == -1 && errno == EINVAL) {
+ if (ret == 0 && (sv[0] <= 2 || sv[1] <= 2)) {
+ goto fix_cloexec; /* highly unlikely */
+ }
+ goto update_max_fd;
+ }
+ else if (cloexec_state < 0) { /* usually runs once only for detection */
+ ret = socketpair(domain, type|SOCK_CLOEXEC, protocol, sv);
+ if (ret == 0) {
+ cloexec_state = rsock_detect_cloexec(sv[0]);
+ if ((cloexec_state == 0) || (sv[0] <= 2 || sv[1] <= 2))
+ goto fix_cloexec;
+ goto update_max_fd;
+ }
+ else 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) {
@@ -163,26 +199,41 @@ rsock_socketpair0(int domain, int type, int protocol, int sv[2])
* So disable SOCK_CLOEXEC only if socketpair() succeeds without SOCK_CLOEXEC.
* Ex. Socket.pair(:UNIX, 0xff) fails with EINVAL.
*/
- try_sock_cloexec = 0;
+ cloexec_state = 0;
}
}
}
- else {
+ else { /* cloexec_state == 0 */
ret = socketpair(domain, type, protocol, sv);
}
-#else
- ret = socketpair(domain, type, protocol, sv);
-#endif
-
if (ret == -1) {
return -1;
}
+fix_cloexec:
+ rb_maygvl_fd_fix_cloexec(sv[0]);
+ rb_maygvl_fd_fix_cloexec(sv[1]);
+
+update_max_fd:
+ rb_update_max_fd(sv[0]);
+ rb_update_max_fd(sv[1]);
+
+ return ret;
+}
+#else /* !SOCK_CLOEXEC */
+static int
+rsock_socketpair0(int domain, int type, int protocol, int sv[2])
+{
+ int ret = socketpair(domain, type, protocol, sv);
+
+ if (ret == -1)
+ return -1;
+
rb_fd_fix_cloexec(sv[0]);
rb_fd_fix_cloexec(sv[1]);
-
return ret;
}
+#endif /* !SOCK_CLOEXEC */
static int
rsock_socketpair(int domain, int type, int protocol, int sv[2])
@@ -190,8 +241,7 @@ 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();
+ if (ret < 0 && rb_gc_for_fd(errno)) {
ret = rsock_socketpair0(domain, type, protocol, sv);
}
@@ -245,8 +295,6 @@ rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
if (ret < 0) {
rb_sys_fail("socketpair(2)");
}
- 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]);
@@ -271,14 +319,14 @@ rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
* * +remote_sockaddr+ - the +struct+ sockaddr contained in a string or Addrinfo object
*
* === Example:
- * # Pull down Google's web page
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * sockaddr = Socket.pack_sockaddr_in( 80, 'www.google.com' )
- * socket.connect( sockaddr )
- * socket.write( "GET / HTTP/1.0\r\n\r\n" )
- * results = socket.read
+ * # Pull down Google's web page
+ * require 'socket'
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * sockaddr = Socket.pack_sockaddr_in( 80, 'www.google.com' )
+ * socket.connect( sockaddr )
+ * socket.write( "GET / HTTP/1.0\r\n\r\n" )
+ * results = socket.read
*
* === Unix-based Exceptions
* On unix-based systems the following system exceptions may be raised if
@@ -390,50 +438,9 @@ sock_connect(VALUE sock, VALUE addr)
return INT2FIX(n);
}
-/*
- * call-seq:
- * socket.connect_nonblock(remote_sockaddr) => 0
- *
- * Requests a connection to be made on the given +remote_sockaddr+ after
- * O_NONBLOCK is set for the underlying file descriptor.
- * Returns 0 if successful, otherwise an exception is raised.
- *
- * === Parameter
- * * +remote_sockaddr+ - the +struct+ sockaddr contained in a string or Addrinfo object
- *
- * === Example:
- * # Pull down Google's web page
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new(AF_INET, SOCK_STREAM, 0)
- * sockaddr = Socket.sockaddr_in(80, 'www.google.com')
- * begin # emulate blocking connect
- * socket.connect_nonblock(sockaddr)
- * rescue IO::WaitWritable
- * IO.select(nil, [socket]) # wait 3-way handshake completion
- * begin
- * socket.connect_nonblock(sockaddr) # check connection failure
- * rescue Errno::EISCONN
- * end
- * end
- * socket.write("GET / HTTP/1.0\r\n\r\n")
- * results = socket.read
- *
- * Refer to Socket#connect for the exceptions that may be thrown if the call
- * to _connect_nonblock_ fails.
- *
- * Socket#connect_nonblock may raise any error corresponding to connect(2) failure,
- * including Errno::EINPROGRESS.
- *
- * If the exception is Errno::EINPROGRESS,
- * it is extended by IO::WaitWritable.
- * So IO::WaitWritable can be used to rescue the exceptions for retrying connect_nonblock.
- *
- * === See
- * * Socket#connect
- */
+/* :nodoc: */
static VALUE
-sock_connect_nonblock(VALUE sock, VALUE addr)
+sock_connect_nonblock(VALUE sock, VALUE addr, VALUE ex)
{
VALUE rai;
rb_io_t *fptr;
@@ -445,9 +452,19 @@ sock_connect_nonblock(VALUE sock, VALUE addr)
rb_io_set_nonblock(fptr);
n = connect(fptr->fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_SOCKLEN(addr));
if (n < 0) {
- if (errno == EINPROGRESS)
- rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "connect(2) would block");
- rsock_sys_fail_raddrinfo_or_sockaddr("connect(2)", addr, rai);
+ int e = errno;
+ if (e == EINPROGRESS) {
+ if (ex == Qfalse) {
+ return sym_wait_writable;
+ }
+ rb_readwrite_syserr_fail(RB_IO_WAIT_WRITABLE, e, "connect(2) would block");
+ }
+ if (e == EISCONN) {
+ if (ex == Qfalse) {
+ return INT2FIX(0);
+ }
+ }
+ rsock_syserr_fail_raddrinfo_or_sockaddr(e, "connect(2)", addr, rai);
}
return INT2FIX(n);
@@ -463,18 +480,18 @@ sock_connect_nonblock(VALUE sock, VALUE addr)
* * +local_sockaddr+ - the +struct+ sockaddr contained in a string or an Addrinfo object
*
* === Example
- * require 'socket'
+ * require 'socket'
*
- * # use Addrinfo
- * socket = Socket.new(:INET, :STREAM, 0)
- * socket.bind(Addrinfo.tcp("127.0.0.1", 2222))
- * p socket.local_address #=> #<Addrinfo: 127.0.0.1:2222 TCP>
+ * # use Addrinfo
+ * socket = Socket.new(:INET, :STREAM, 0)
+ * socket.bind(Addrinfo.tcp("127.0.0.1", 2222))
+ * p socket.local_address #=> #<Addrinfo: 127.0.0.1:2222 TCP>
*
- * # use struct sockaddr
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
- * socket.bind( sockaddr )
+ * # use struct sockaddr
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
+ * socket.bind( sockaddr )
*
* === Unix-based Exceptions
* On unix-based based systems the following system exceptions may be raised if
@@ -565,18 +582,18 @@ sock_bind(VALUE sock, VALUE addr)
* * +backlog+ - the maximum length of the queue for pending connections.
*
* === Example 1
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
- * socket.bind( sockaddr )
- * socket.listen( 5 )
+ * require 'socket'
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
+ * socket.bind( sockaddr )
+ * socket.listen( 5 )
*
* === Example 2 (listening on an arbitrary port, unix-based systems only):
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * socket.listen( 1 )
+ * require 'socket'
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * socket.listen( 1 )
*
* === Unix-based Exceptions
* On unix based systems the above will work because a new +sockaddr+ struct
@@ -652,27 +669,27 @@ rsock_sock_listen(VALUE sock, VALUE log)
* * +flags+ - zero or more of the +MSG_+ options
*
* === Example
- * # In one file, start this first
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
- * socket.bind( sockaddr )
- * socket.listen( 5 )
- * client, client_addrinfo = socket.accept
- * data = client.recvfrom( 20 )[0].chomp
- * puts "I only received 20 bytes '#{data}'"
- * sleep 1
- * socket.close
- *
- * # In another file, start this second
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
- * socket.connect( sockaddr )
- * socket.puts "Watch this get cut short!"
- * socket.close
+ * # In one file, start this first
+ * require 'socket'
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
+ * socket.bind( sockaddr )
+ * socket.listen( 5 )
+ * client, client_addrinfo = socket.accept
+ * data = client.recvfrom( 20 )[0].chomp
+ * puts "I only received 20 bytes '#{data}'"
+ * sleep 1
+ * socket.close
+ *
+ * # In another file, start this second
+ * require 'socket'
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
+ * socket.connect( sockaddr )
+ * socket.puts "Watch this get cut short!"
+ * socket.close
*
* === Unix-based Exceptions
* On unix-based based systems the following system exceptions may be raised if the
@@ -748,72 +765,11 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
return rsock_s_recvfrom(sock, argc, argv, RECV_SOCKET);
}
-/*
- * call-seq:
- * socket.recvfrom_nonblock(maxlen) => [mesg, sender_addrinfo]
- * socket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_addrinfo]
- *
- * Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * _flags_ is zero or more of the +MSG_+ options.
- * The first element of the results, _mesg_, is the data received.
- * The second element, _sender_addrinfo_, contains protocol-specific address
- * information of the sender.
- *
- * When recvfrom(2) returns 0, Socket#recvfrom_nonblock returns
- * an empty string as data.
- * The meaning depends on the socket: EOF on TCP, empty packet on UDP, etc.
- *
- * === Parameters
- * * +maxlen+ - the maximum number of bytes to receive from the socket
- * * +flags+ - zero or more of the +MSG_+ options
- *
- * === Example
- * # In one file, start this first
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new(AF_INET, SOCK_STREAM, 0)
- * sockaddr = Socket.sockaddr_in(2200, 'localhost')
- * socket.bind(sockaddr)
- * socket.listen(5)
- * client, client_addrinfo = socket.accept
- * begin # emulate blocking recvfrom
- * pair = client.recvfrom_nonblock(20)
- * rescue IO::WaitReadable
- * IO.select([client])
- * retry
- * end
- * data = pair[0].chomp
- * puts "I only received 20 bytes '#{data}'"
- * sleep 1
- * socket.close
- *
- * # In another file, start this second
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new(AF_INET, SOCK_STREAM, 0)
- * sockaddr = Socket.sockaddr_in(2200, 'localhost')
- * socket.connect(sockaddr)
- * socket.puts "Watch this get cut short!"
- * socket.close
- *
- * Refer to Socket#recvfrom for the exceptions that may be thrown if the call
- * to _recvfrom_nonblock_ fails.
- *
- * Socket#recvfrom_nonblock may raise any error corresponding to recvfrom(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK or Errno::AGAIN,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying recvfrom_nonblock.
- *
- * === See
- * * Socket#recvfrom
- */
+/* :nodoc: */
static VALUE
-sock_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock)
+sock_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex)
{
- return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_SOCKET);
+ return rsock_s_recvfrom_nonblock(sock, len, flg, str, ex, RECV_SOCKET);
}
/*
@@ -844,67 +800,21 @@ sock_accept(VALUE sock)
return rb_assoc_new(sock2, rsock_io_socket_addrinfo(sock2, &buf.addr, len));
}
-/*
- * call-seq:
- * socket.accept_nonblock => [client_socket, client_addrinfo]
- *
- * Accepts an incoming connection using accept(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * It returns an array containing the accepted socket
- * for the incoming connection, _client_socket_,
- * and an Addrinfo, _client_addrinfo_.
- *
- * === Example
- * # In one script, start this first
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new(AF_INET, SOCK_STREAM, 0)
- * sockaddr = Socket.sockaddr_in(2200, 'localhost')
- * socket.bind(sockaddr)
- * socket.listen(5)
- * begin # emulate blocking accept
- * client_socket, client_addrinfo = socket.accept_nonblock
- * rescue IO::WaitReadable, Errno::EINTR
- * IO.select([socket])
- * retry
- * end
- * puts "The client said, '#{client_socket.readline.chomp}'"
- * client_socket.puts "Hello from script one!"
- * socket.close
- *
- * # In another script, start this second
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new(AF_INET, SOCK_STREAM, 0)
- * sockaddr = Socket.sockaddr_in(2200, 'localhost')
- * socket.connect(sockaddr)
- * socket.puts "Hello from script 2."
- * puts "The server said, '#{socket.readline.chomp}'"
- * socket.close
- *
- * Refer to Socket#accept for the exceptions that may be thrown if the call
- * to _accept_nonblock_ fails.
- *
- * Socket#accept_nonblock may raise any error corresponding to accept(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK, Errno::AGAIN, Errno::ECONNABORTED or Errno::EPROTO,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
- *
- * === See
- * * Socket#accept
- */
+/* :nodoc: */
static VALUE
-sock_accept_nonblock(VALUE sock)
+sock_accept_nonblock(VALUE sock, VALUE ex)
{
rb_io_t *fptr;
VALUE sock2;
union_sockaddr buf;
+ struct sockaddr *addr = &buf.addr;
socklen_t len = (socklen_t)sizeof buf;
GetOpenFile(sock, fptr);
- sock2 = rsock_s_accept_nonblock(rb_cSocket, fptr, &buf.addr, &len);
+ sock2 = rsock_s_accept_nonblock(rb_cSocket, ex, fptr, addr, &len);
+
+ if (SYMBOL_P(sock2)) /* :wait_readable */
+ return sock2;
return rb_assoc_new(sock2, rsock_io_socket_addrinfo(sock2, &buf.addr, len));
}
@@ -917,28 +827,28 @@ sock_accept_nonblock(VALUE sock)
* and an Addrinfo, _client_addrinfo_.
*
* === Example
- * # In one script, start this first
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
- * socket.bind( sockaddr )
- * socket.listen( 5 )
- * client_fd, client_addrinfo = socket.sysaccept
- * client_socket = Socket.for_fd( client_fd )
- * puts "The client said, '#{client_socket.readline.chomp}'"
- * client_socket.puts "Hello from script one!"
- * socket.close
- *
- * # In another script, start this second
- * require 'socket'
- * include Socket::Constants
- * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
- * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
- * socket.connect( sockaddr )
- * socket.puts "Hello from script 2."
- * puts "The server said, '#{socket.readline.chomp}'"
- * socket.close
+ * # In one script, start this first
+ * require 'socket'
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
+ * socket.bind( sockaddr )
+ * socket.listen( 5 )
+ * client_fd, client_addrinfo = socket.sysaccept
+ * client_socket = Socket.for_fd( client_fd )
+ * puts "The client said, '#{client_socket.readline.chomp}'"
+ * client_socket.puts "Hello from script one!"
+ * socket.close
+ *
+ * # In another script, start this second
+ * require 'socket'
+ * include Socket::Constants
+ * socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
+ * sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
+ * socket.connect( sockaddr )
+ * socket.puts "Hello from script 2."
+ * puts "The server said, '#{socket.readline.chomp}'"
+ * socket.close
*
* Refer to Socket#accept for the exceptions that may be thrown if the call
* to _sysaccept_ fails.
@@ -975,17 +885,35 @@ sock_sysaccept(VALUE sock)
static VALUE
sock_gethostname(VALUE obj)
{
-#ifndef HOST_NAME_MAX
-# define HOST_NAME_MAX 1024
+#if defined(NI_MAXHOST)
+# define RUBY_MAX_HOST_NAME_LEN NI_MAXHOST
+#elif defined(HOST_NAME_MAX)
+# define RUBY_MAX_HOST_NAME_LEN HOST_NAME_MAX
+#else
+# define RUBY_MAX_HOST_NAME_LEN 1024
#endif
- char buf[HOST_NAME_MAX+1];
-
- rb_secure(3);
- if (gethostname(buf, (int)sizeof buf - 1) < 0)
- rb_sys_fail("gethostname(3)");
- buf[sizeof buf - 1] = '\0';
- return rb_str_new2(buf);
+ long len = RUBY_MAX_HOST_NAME_LEN;
+ VALUE name;
+
+ name = rb_str_new(0, len);
+ while (gethostname(RSTRING_PTR(name), len) < 0) {
+ int e = errno;
+ switch (e) {
+ case ENAMETOOLONG:
+#ifdef __linux__
+ case EINVAL:
+ /* glibc before version 2.1 uses EINVAL instead of ENAMETOOLONG */
+#endif
+ break;
+ default:
+ rb_syserr_fail(e, "gethostname(3)");
+ }
+ rb_str_modify_expand(name, len);
+ len += len;
+ }
+ rb_str_resize(name, strlen(RSTRING_PTR(name)));
+ return name;
}
#else
#ifdef HAVE_UNAME
@@ -997,7 +925,6 @@ sock_gethostname(VALUE obj)
{
struct utsname un;
- rb_secure(3);
uname(&un);
return rb_str_new2(un.nodename);
}
@@ -1007,7 +934,7 @@ sock_gethostname(VALUE obj)
#endif
static VALUE
-make_addrinfo(struct addrinfo *res0, int norevlookup)
+make_addrinfo(struct rb_addrinfo *res0, int norevlookup)
{
VALUE base, ary;
struct addrinfo *res;
@@ -1016,10 +943,10 @@ make_addrinfo(struct addrinfo *res0, int norevlookup)
rb_raise(rb_eSocket, "host not found");
}
base = rb_ary_new();
- for (res = res0; res; res = res->ai_next) {
+ for (res = res0->ai; res; res = res->ai_next) {
ary = rsock_ipaddr(res->ai_addr, res->ai_addrlen, norevlookup);
if (res->ai_canonname) {
- RARRAY_PTR(ary)[2] = rb_str_new2(res->ai_canonname);
+ RARRAY_ASET(ary, 2, rb_str_new2(res->ai_canonname));
}
rb_ary_push(ary, INT2FIX(res->ai_family));
rb_ary_push(ary, INT2FIX(res->ai_socktype));
@@ -1064,8 +991,9 @@ sock_sockaddr(struct sockaddr *addr, socklen_t len)
static VALUE
sock_s_gethostbyname(VALUE obj, VALUE host)
{
- rb_secure(3);
- return rsock_make_hostent(host, rsock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
+ struct rb_addrinfo *res =
+ rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
+ return rsock_make_hostent(host, res, sock_sockaddr);
}
/*
@@ -1209,7 +1137,7 @@ sock_s_getservbyport(int argc, VALUE *argv)
*
* Obtains address information for _nodename_:_servname_.
*
- * _family_ should be an address family such as: :INET, :INET6, :UNIX, etc.
+ * _family_ should be an address family such as: :INET, :INET6, etc.
*
* _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
*
@@ -1239,7 +1167,8 @@ static VALUE
sock_s_getaddrinfo(int argc, VALUE *argv)
{
VALUE host, port, family, socktype, protocol, flags, ret, revlookup;
- struct addrinfo hints, *res;
+ struct addrinfo hints;
+ struct rb_addrinfo *res;
int norevlookup;
rb_scan_args(argc, argv, "25", &host, &port, &family, &socktype, &protocol, &flags, &revlookup);
@@ -1262,7 +1191,7 @@ sock_s_getaddrinfo(int argc, VALUE *argv)
res = rsock_getaddrinfo(host, port, &hints, 0);
ret = make_addrinfo(res, norevlookup);
- freeaddrinfo(res);
+ rb_freeaddrinfo(res);
return ret;
}
@@ -1295,8 +1224,9 @@ sock_s_getnameinfo(int argc, VALUE *argv)
char *hptr, *pptr;
char hbuf[1024], pbuf[1024];
int fl;
- struct addrinfo hints, *res = NULL, *r;
- int error;
+ struct rb_addrinfo *res = NULL;
+ struct addrinfo hints, *r;
+ int error, saved_errno;
union_sockaddr ss;
struct sockaddr *sap;
socklen_t salen;
@@ -1327,16 +1257,16 @@ sock_s_getnameinfo(int argc, VALUE *argv)
sa = tmp;
MEMZERO(&hints, struct addrinfo, 1);
if (RARRAY_LEN(sa) == 3) {
- af = RARRAY_PTR(sa)[0];
- port = RARRAY_PTR(sa)[1];
- host = RARRAY_PTR(sa)[2];
+ af = RARRAY_AREF(sa, 0);
+ port = RARRAY_AREF(sa, 1);
+ host = RARRAY_AREF(sa, 2);
}
else if (RARRAY_LEN(sa) >= 4) {
- af = RARRAY_PTR(sa)[0];
- port = RARRAY_PTR(sa)[1];
- host = RARRAY_PTR(sa)[3];
+ af = RARRAY_AREF(sa, 0);
+ port = RARRAY_AREF(sa, 1);
+ host = RARRAY_AREF(sa, 3);
if (NIL_P(host)) {
- host = RARRAY_PTR(sa)[2];
+ host = RARRAY_AREF(sa, 2);
}
else {
/*
@@ -1380,8 +1310,8 @@ sock_s_getnameinfo(int argc, VALUE *argv)
hints.ai_family = NIL_P(af) ? PF_UNSPEC : rsock_family_arg(af);
error = rb_getaddrinfo(hptr, pptr, &hints, &res);
if (error) goto error_exit_addr;
- sap = res->ai_addr;
- salen = res->ai_addrlen;
+ sap = res->ai->ai_addr;
+ salen = res->ai->ai_addrlen;
}
else {
rb_raise(rb_eTypeError, "expecting String or Array");
@@ -1392,7 +1322,7 @@ sock_s_getnameinfo(int argc, VALUE *argv)
pbuf, sizeof(pbuf), fl);
if (error) goto error_exit_name;
if (res) {
- for (r = res->ai_next; r; r = r->ai_next) {
+ for (r = res->ai->ai_next; r; r = r->ai_next) {
char hbuf2[1024], pbuf2[1024];
sap = r->ai_addr;
@@ -1401,20 +1331,24 @@ sock_s_getnameinfo(int argc, VALUE *argv)
pbuf2, sizeof(pbuf2), fl);
if (error) goto error_exit_name;
if (strcmp(hbuf, hbuf2) != 0|| strcmp(pbuf, pbuf2) != 0) {
- freeaddrinfo(res);
+ rb_freeaddrinfo(res);
rb_raise(rb_eSocket, "sockaddr resolved to multiple nodename");
}
}
- freeaddrinfo(res);
+ rb_freeaddrinfo(res);
}
return rb_assoc_new(rb_str_new2(hbuf), rb_str_new2(pbuf));
error_exit_addr:
- if (res) freeaddrinfo(res);
+ saved_errno = errno;
+ if (res) rb_freeaddrinfo(res);
+ errno = saved_errno;
rsock_raise_socket_error("getaddrinfo", error);
error_exit_name:
- if (res) freeaddrinfo(res);
+ saved_errno = errno;
+ if (res) rb_freeaddrinfo(res);
+ errno = saved_errno;
rsock_raise_socket_error("getnameinfo", error);
UNREACHABLE;
@@ -1437,10 +1371,10 @@ sock_s_getnameinfo(int argc, VALUE *argv)
static VALUE
sock_s_pack_sockaddr_in(VALUE self, VALUE port, VALUE host)
{
- struct addrinfo *res = rsock_addrinfo(host, port, 0, 0);
- VALUE addr = rb_str_new((char*)res->ai_addr, res->ai_addrlen);
+ struct rb_addrinfo *res = rsock_addrinfo(host, port, AF_UNSPEC, 0, 0);
+ VALUE addr = rb_str_new((char*)res->ai->ai_addr, res->ai->ai_addrlen);
- freeaddrinfo(res);
+ rb_freeaddrinfo(res);
OBJ_INFECT(addr, port);
OBJ_INFECT(addr, host);
@@ -1708,7 +1642,7 @@ socket_s_ip_address_list(VALUE self)
int ret;
struct lifnum ln;
struct lifconf lc;
- char *reason = NULL;
+ const char *reason = NULL;
int save_errno;
int i;
VALUE list = Qnil;
@@ -1769,7 +1703,7 @@ socket_s_ip_address_list(VALUE self)
errno = save_errno;
if (reason)
- rb_sys_fail(reason);
+ rb_syserr_fail(save_errno, reason);
return list;
#elif defined(SIOCGIFCONF)
@@ -1854,7 +1788,7 @@ socket_s_ip_address_list(VALUE self)
errno = save_errno;
if (reason)
- rb_sys_fail(reason);
+ rb_syserr_fail(save_errno, reason);
return list;
#undef EXTRA_SPACE
@@ -1966,7 +1900,7 @@ socket_s_ip_address_list(VALUE self)
#endif
void
-Init_socket()
+Init_socket(void)
{
rsock_init_basicsocket();
@@ -1984,7 +1918,7 @@ Init_socket()
*
* === What's a socket?
*
- * Sockets are endpoints of a bidirectionnal communication channel.
+ * Sockets are endpoints of a bidirectional 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.
@@ -2009,7 +1943,7 @@ Init_socket()
*
* *hostname:*
* The identifier of a network interface:
- * * a string (hostname, IPv4 or IPv6 adress or +broadcast+
+ * * a string (hostname, IPv4 or IPv6 address 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).
@@ -2091,15 +2025,26 @@ Init_socket()
rb_define_method(rb_cSocket, "initialize", sock_initialize, -1);
rb_define_method(rb_cSocket, "connect", sock_connect, 1);
- rb_define_method(rb_cSocket, "connect_nonblock", sock_connect_nonblock, 1);
+
+ /* for ext/socket/lib/socket.rb use only: */
+ rb_define_private_method(rb_cSocket,
+ "__connect_nonblock", sock_connect_nonblock, 2);
+
rb_define_method(rb_cSocket, "bind", sock_bind, 1);
rb_define_method(rb_cSocket, "listen", rsock_sock_listen, 1);
rb_define_method(rb_cSocket, "accept", sock_accept, 0);
- rb_define_method(rb_cSocket, "accept_nonblock", sock_accept_nonblock, 0);
+
+ /* for ext/socket/lib/socket.rb use only: */
+ rb_define_private_method(rb_cSocket,
+ "__accept_nonblock", sock_accept_nonblock, 1);
+
rb_define_method(rb_cSocket, "sysaccept", sock_sysaccept, 0);
rb_define_method(rb_cSocket, "recvfrom", sock_recvfrom, -1);
- rb_define_method(rb_cSocket, "recvfrom_nonblock", sock_recvfrom_nonblock, -1);
+
+ /* for ext/socket/lib/socket.rb use only: */
+ rb_define_private_method(rb_cSocket,
+ "__recvfrom_nonblock", sock_recvfrom_nonblock, 4);
rb_define_singleton_method(rb_cSocket, "socketpair", rsock_sock_s_socketpair, -1);
rb_define_singleton_method(rb_cSocket, "pair", rsock_sock_s_socketpair, -1);
@@ -2120,4 +2065,7 @@ Init_socket()
#endif
rb_define_singleton_method(rb_cSocket, "ip_address_list", socket_s_ip_address_list, 0);
+
+#undef rb_intern
+ sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
}
diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h
index a3c698e8a4..2b58958ae7 100644
--- a/ext/socket/sockport.h
+++ b/ext/socket/sockport.h
@@ -29,6 +29,12 @@
# define SET_SIN_LEN(sa, len) SET_SA_LEN((struct sockaddr *)(sa), (len))
#endif
+#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+# define SET_SIN6_LEN(sa, len) (void)((sa)->sin6_len = (len))
+#else
+# define SET_SIN6_LEN(sa, len) SET_SA_LEN((struct sockaddr *)(sa), (len))
+#endif
+
#define INIT_SOCKADDR(addr, family, len) \
do { \
struct sockaddr *init_sockaddr_ptr = (addr); \
@@ -47,6 +53,15 @@
SET_SIN_LEN(init_sockaddr_ptr, init_sockaddr_len); \
} while (0)
+#define INIT_SOCKADDR_IN6(addr, len) \
+ do { \
+ struct sockaddr_in6 *init_sockaddr_ptr = (addr); \
+ socklen_t init_sockaddr_len = (len); \
+ memset(init_sockaddr_ptr, 0, init_sockaddr_len); \
+ init_sockaddr_ptr->sin6_family = AF_INET6; \
+ SET_SIN6_LEN(init_sockaddr_ptr, init_sockaddr_len); \
+ } while (0)
+
/* for strict-aliasing rule */
#ifdef HAVE_TYPE_STRUCT_SOCKADDR_UN
diff --git a/ext/socket/sockssocket.c b/ext/socket/sockssocket.c
index 48be4fcf99..81f77a67c5 100644
--- a/ext/socket/sockssocket.c
+++ b/ext/socket/sockssocket.c
@@ -41,9 +41,6 @@ socks_s_close(VALUE sock)
{
rb_io_t *fptr;
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't close socket");
- }
GetOpenFile(sock, fptr);
shutdown(fptr->fd, 2);
return rb_io_close(sock);
diff --git a/ext/socket/tcpserver.c b/ext/socket/tcpserver.c
index 2245a0600d..1bbb31adcf 100644
--- a/ext/socket/tcpserver.c
+++ b/ext/socket/tcpserver.c
@@ -64,49 +64,16 @@ tcp_accept(VALUE sock)
return rsock_s_accept(rb_cTCPSocket, fptr->fd, &from.addr, &fromlen);
}
-/*
- * call-seq:
- * tcpserver.accept_nonblock => tcpsocket
- *
- * Accepts an incoming connection using accept(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * It returns an accepted TCPSocket for the incoming connection.
- *
- * === Example
- * require 'socket'
- * serv = TCPServer.new(2202)
- * begin # emulate blocking accept
- * sock = serv.accept_nonblock
- * rescue IO::WaitReadable, Errno::EINTR
- * IO.select([serv])
- * retry
- * end
- * # sock is an accepted socket.
- *
- * Refer to Socket#accept for the exceptions that may be thrown if the call
- * to TCPServer#accept_nonblock fails.
- *
- * TCPServer#accept_nonblock may raise any error corresponding to accept(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK, Errno::AGAIN, Errno::ECONNABORTED, Errno::EPROTO,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
- *
- * === See
- * * TCPServer#accept
- * * Socket#accept
- */
+/* :nodoc: */
static VALUE
-tcp_accept_nonblock(VALUE sock)
+tcp_accept_nonblock(VALUE sock, VALUE ex)
{
rb_io_t *fptr;
union_sockaddr from;
- socklen_t fromlen;
+ socklen_t len = (socklen_t)sizeof(from);
GetOpenFile(sock, fptr);
- fromlen = (socklen_t)sizeof(from);
- return rsock_s_accept_nonblock(rb_cTCPSocket, fptr, &from.addr, &fromlen);
+ return rsock_s_accept_nonblock(rb_cTCPSocket, ex, fptr, &from.addr, &len);
}
/*
@@ -171,7 +138,8 @@ rsock_init_tcpserver(void)
*/
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);
+ rb_define_private_method(rb_cTCPServer,
+ "__accept_nonblock", tcp_accept_nonblock, 1);
rb_define_method(rb_cTCPServer, "sysaccept", tcp_sysaccept, 0);
rb_define_method(rb_cTCPServer, "initialize", tcp_svr_init, -1);
rb_define_method(rb_cTCPServer, "listen", rsock_sock_listen, 1); /* in socket.c */
diff --git a/ext/socket/tcpsocket.c b/ext/socket/tcpsocket.c
index 6217e424d9..a7a82fd880 100644
--- a/ext/socket/tcpsocket.c
+++ b/ext/socket/tcpsocket.c
@@ -50,9 +50,9 @@ tcp_sockaddr(struct sockaddr *addr, socklen_t len)
static VALUE
tcp_s_gethostbyname(VALUE obj, VALUE host)
{
- rb_secure(3);
- return rsock_make_hostent(host, rsock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME),
- tcp_sockaddr);
+ struct rb_addrinfo *res =
+ rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
+ return rsock_make_hostent(host, res, tcp_sockaddr);
}
void
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
index a89c453239..7b7b34f04d 100644
--- a/ext/socket/udpsocket.c
+++ b/ext/socket/udpsocket.c
@@ -30,7 +30,6 @@ udp_init(int argc, VALUE *argv, VALUE sock)
int family = AF_INET;
int fd;
- rb_secure(3);
if (rb_scan_args(argc, argv, "01", &arg) == 1) {
family = rsock_family_arg(arg);
}
@@ -44,17 +43,20 @@ udp_init(int argc, VALUE *argv, VALUE sock)
struct udp_arg
{
- struct addrinfo *res;
- int fd;
+ struct rb_addrinfo *res;
+ rb_io_t *fptr;
};
static VALUE
udp_connect_internal(struct udp_arg *arg)
{
- int fd = arg->fd;
+ rb_io_t *fptr;
+ int fd;
struct addrinfo *res;
- for (res = arg->res; res; res = res->ai_next) {
+ rb_io_check_closed(fptr = arg->fptr);
+ fd = fptr->fd;
+ for (res = arg->res->ai; res; res = res->ai_next) {
if (rsock_connect(fd, res->ai_addr, res->ai_addrlen, 0) >= 0) {
return Qtrue;
}
@@ -62,8 +64,6 @@ udp_connect_internal(struct udp_arg *arg)
return Qfalse;
}
-VALUE rsock_freeaddrinfo(struct addrinfo *addr);
-
/*
* call-seq:
* udpsocket.connect(host, port) => 0
@@ -83,20 +83,35 @@ VALUE rsock_freeaddrinfo(struct addrinfo *addr);
static VALUE
udp_connect(VALUE sock, VALUE host, VALUE port)
{
- rb_io_t *fptr;
struct udp_arg arg;
VALUE ret;
- rb_secure(3);
- arg.res = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
- GetOpenFile(sock, fptr);
- arg.fd = fptr->fd;
+ GetOpenFile(sock, arg.fptr);
+ arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM, 0);
ret = rb_ensure(udp_connect_internal, (VALUE)&arg,
rsock_freeaddrinfo, (VALUE)arg.res);
if (!ret) rsock_sys_fail_host_port("connect(2)", host, port);
return INT2FIX(0);
}
+static VALUE
+udp_bind_internal(struct udp_arg *arg)
+{
+ rb_io_t *fptr;
+ int fd;
+ struct addrinfo *res;
+
+ rb_io_check_closed(fptr = arg->fptr);
+ fd = fptr->fd;
+ for (res = arg->res->ai; res; res = res->ai_next) {
+ if (bind(fd, res->ai_addr, res->ai_addrlen) < 0) {
+ continue;
+ }
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
/*
* call-seq:
* udpsocket.bind(host, port) #=> 0
@@ -112,24 +127,46 @@ udp_connect(VALUE sock, VALUE host, VALUE port)
static VALUE
udp_bind(VALUE sock, VALUE host, VALUE port)
{
+ struct udp_arg arg;
+ VALUE ret;
+
+ GetOpenFile(sock, arg.fptr);
+ arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM, 0);
+ ret = rb_ensure(udp_bind_internal, (VALUE)&arg,
+ rsock_freeaddrinfo, (VALUE)arg.res);
+ if (!ret) rsock_sys_fail_host_port("bind(2)", host, port);
+ return INT2FIX(0);
+}
+
+struct udp_send_arg {
+ struct rb_addrinfo *res;
rb_io_t *fptr;
- struct addrinfo *res0, *res;
+ struct rsock_send_arg sarg;
+};
- rb_secure(3);
- res0 = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
- GetOpenFile(sock, fptr);
- for (res = res0; res; res = res->ai_next) {
- if (bind(fptr->fd, res->ai_addr, res->ai_addrlen) < 0) {
- continue;
+static VALUE
+udp_send_internal(struct udp_send_arg *arg)
+{
+ rb_io_t *fptr;
+ int n;
+ struct addrinfo *res;
+
+ rb_io_check_closed(fptr = arg->fptr);
+ for (res = arg->res->ai; res; res = res->ai_next) {
+ retry:
+ arg->sarg.fd = fptr->fd;
+ arg->sarg.to = res->ai_addr;
+ arg->sarg.tolen = res->ai_addrlen;
+ rsock_maybe_fd_writable(arg->sarg.fd);
+ n = (int)BLOCKING_REGION_FD(rsock_sendto_blocking, &arg->sarg);
+ if (n >= 0) {
+ return INT2FIX(n);
+ }
+ if (rb_io_wait_writable(fptr->fd)) {
+ goto retry;
}
- freeaddrinfo(res0);
- return INT2FIX(0);
}
- freeaddrinfo(res0);
-
- rsock_sys_fail_host_port("bind(2)", host, port);
-
- return INT2FIX(0);
+ return Qfalse;
}
/*
@@ -158,93 +195,30 @@ static VALUE
udp_send(int argc, VALUE *argv, VALUE sock)
{
VALUE flags, host, port;
- rb_io_t *fptr;
- int n;
- struct addrinfo *res0, *res;
- struct rsock_send_arg arg;
+ struct udp_send_arg arg;
+ VALUE ret;
if (argc == 2 || argc == 3) {
return rsock_bsock_send(argc, argv, sock);
}
- rb_scan_args(argc, argv, "4", &arg.mesg, &flags, &host, &port);
-
- StringValue(arg.mesg);
- res0 = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
- GetOpenFile(sock, fptr);
- arg.fd = fptr->fd;
- arg.flags = NUM2INT(flags);
- for (res = res0; res; res = res->ai_next) {
- retry:
- arg.to = res->ai_addr;
- arg.tolen = res->ai_addrlen;
- rb_thread_fd_writable(arg.fd);
- n = (int)BLOCKING_REGION_FD(rsock_sendto_blocking, &arg);
- if (n >= 0) {
- freeaddrinfo(res0);
- return INT2FIX(n);
- }
- if (rb_io_wait_writable(fptr->fd)) {
- goto retry;
- }
- }
- freeaddrinfo(res0);
- rsock_sys_fail_host_port("sendto(2)", host, port);
- return INT2FIX(n);
+ rb_scan_args(argc, argv, "4", &arg.sarg.mesg, &flags, &host, &port);
+
+ StringValue(arg.sarg.mesg);
+ GetOpenFile(sock, arg.fptr);
+ arg.sarg.fd = arg.fptr->fd;
+ arg.sarg.flags = NUM2INT(flags);
+ arg.res = rsock_addrinfo(host, port, rsock_fd_family(arg.fptr->fd), SOCK_DGRAM, 0);
+ ret = rb_ensure(udp_send_internal, (VALUE)&arg,
+ rsock_freeaddrinfo, (VALUE)arg.res);
+ if (!ret) rsock_sys_fail_host_port("sendto(2)", host, port);
+ return ret;
}
-/*
- * call-seq:
- * udpsocket.recvfrom_nonblock(maxlen) => [mesg, sender_inet_addr]
- * udpsocket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_inet_addr]
- *
- * Receives up to _maxlen_ bytes from +udpsocket+ using recvfrom(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * If _maxlen_ is omitted, its default value is 65536.
- * _flags_ is zero or more of the +MSG_+ options.
- * The first element of the results, _mesg_, is the data received.
- * The second element, _sender_inet_addr_, is an array to represent the sender address.
- *
- * When recvfrom(2) returns 0,
- * Socket#recvfrom_nonblock returns an empty string as data.
- * It means an empty packet.
- *
- * === Parameters
- * * +maxlen+ - the number of bytes to receive from the socket
- * * +flags+ - zero or more of the +MSG_+ options
- *
- * === Example
- * require 'socket'
- * s1 = UDPSocket.new
- * s1.bind("127.0.0.1", 0)
- * s2 = UDPSocket.new
- * s2.bind("127.0.0.1", 0)
- * s2.connect(*s1.addr.values_at(3,1))
- * s1.connect(*s2.addr.values_at(3,1))
- * s1.send "aaa", 0
- * begin # emulate blocking recvfrom
- * p s2.recvfrom_nonblock(10) #=> ["aaa", ["AF_INET", 33302, "localhost.localdomain", "127.0.0.1"]]
- * rescue IO::WaitReadable
- * IO.select([s2])
- * retry
- * end
- *
- * Refer to Socket#recvfrom for the exceptions that may be thrown if the call
- * to _recvfrom_nonblock_ fails.
- *
- * UDPSocket#recvfrom_nonblock may raise any error corresponding to recvfrom(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK or Errno::AGAIN,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying recvfrom_nonblock.
- *
- * === See
- * * Socket#recvfrom
- */
+/* :nodoc: */
static VALUE
-udp_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock)
+udp_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex)
{
- return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_IP);
+ return rsock_s_recvfrom_nonblock(sock, len, flg, str, ex, RECV_IP);
}
void
@@ -261,6 +235,8 @@ rsock_init_udpsocket(void)
rb_define_method(rb_cUDPSocket, "connect", udp_connect, 2);
rb_define_method(rb_cUDPSocket, "bind", udp_bind, 2);
rb_define_method(rb_cUDPSocket, "send", udp_send, -1);
- rb_define_method(rb_cUDPSocket, "recvfrom_nonblock", udp_recvfrom_nonblock, -1);
-}
+ /* for ext/socket/lib/socket.rb use only: */
+ rb_define_private_method(rb_cUDPSocket,
+ "__recvfrom_nonblock", udp_recvfrom_nonblock, 4);
+}
diff --git a/ext/socket/unixserver.c b/ext/socket/unixserver.c
index df9849703b..799dcffb00 100644
--- a/ext/socket/unixserver.c
+++ b/ext/socket/unixserver.c
@@ -57,41 +57,9 @@ unix_accept(VALUE sock)
(struct sockaddr*)&from, &fromlen);
}
-/*
- * call-seq:
- * unixserver.accept_nonblock => unixsocket
- *
- * Accepts an incoming connection using accept(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * It returns an accepted UNIXSocket for the incoming connection.
- *
- * === Example
- * require 'socket'
- * serv = UNIXServer.new("/tmp/sock")
- * begin # emulate blocking accept
- * sock = serv.accept_nonblock
- * rescue IO::WaitReadable, Errno::EINTR
- * IO.select([serv])
- * retry
- * end
- * # sock is an accepted socket.
- *
- * Refer to Socket#accept for the exceptions that may be thrown if the call
- * to UNIXServer#accept_nonblock fails.
- *
- * UNIXServer#accept_nonblock may raise any error corresponding to accept(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK, Errno::AGAIN, Errno::ECONNABORTED or Errno::EPROTO,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
- *
- * === See
- * * UNIXServer#accept
- * * Socket#accept
- */
+/* :nodoc: */
static VALUE
-unix_accept_nonblock(VALUE sock)
+unix_accept_nonblock(VALUE sock, VALUE ex)
{
rb_io_t *fptr;
struct sockaddr_un from;
@@ -99,7 +67,7 @@ unix_accept_nonblock(VALUE sock)
GetOpenFile(sock, fptr);
fromlen = (socklen_t)sizeof(from);
- return rsock_s_accept_nonblock(rb_cUNIXSocket, fptr,
+ return rsock_s_accept_nonblock(rb_cUNIXSocket, ex, fptr,
(struct sockaddr *)&from, &fromlen);
}
@@ -148,7 +116,10 @@ rsock_init_unixserver(void)
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);
- rb_define_method(rb_cUNIXServer, "accept_nonblock", unix_accept_nonblock, 0);
+
+ rb_define_private_method(rb_cUNIXServer,
+ "__accept_nonblock", unix_accept_nonblock, 1);
+
rb_define_method(rb_cUNIXServer, "sysaccept", unix_sysaccept, 0);
rb_define_method(rb_cUNIXServer, "listen", rsock_sock_listen, 1); /* in socket.c */
#endif
diff --git a/ext/socket/unixsocket.c b/ext/socket/unixsocket.c
index 1742496e84..f73f12777c 100644
--- a/ext/socket/unixsocket.c
+++ b/ext/socket/unixsocket.c
@@ -34,10 +34,6 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
rb_io_t *fptr;
SafeStringValue(path);
- fd = rsock_socket(AF_UNIX, SOCK_STREAM, 0);
- if (fd < 0) {
- rsock_sys_fail_path("socket(2)", path);
- }
INIT_SOCKADDR_UN(&sockaddr, sizeof(struct sockaddr_un));
if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) {
@@ -47,6 +43,11 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
memcpy(sockaddr.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
sockaddrlen = rsock_unix_sockaddr_len(path);
+ fd = rsock_socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ rsock_sys_fail_path("socket(2)", path);
+ }
+
if (server) {
status = bind(fd, (struct sockaddr*)&sockaddr, sockaddrlen);
}
@@ -64,14 +65,16 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
}
if (status < 0) {
+ int e = errno;
close(fd);
- rsock_sys_fail_path("connect(2)", path);
+ rsock_syserr_fail_path(e, "connect(2)", path);
}
if (server) {
if (listen(fd, SOMAXCONN) < 0) {
+ int e = errno;
close(fd);
- rsock_sys_fail_path("listen(2)", path);
+ rsock_syserr_fail_path(e, "listen(2)", path);
}
}
@@ -130,7 +133,7 @@ unix_path(VALUE sock)
/*
* call-seq:
- * unixsocket.recvfrom(maxlen [, flags]) => [mesg, unixaddress]
+ * unixsocket.recvfrom(maxlen [, flags[, outbuf]]) => [mesg, unixaddress]
*
* Receives a message via _unixsocket_.
*
@@ -138,6 +141,9 @@ unix_path(VALUE sock)
*
* _flags_ should be a bitwise OR of Socket::MSG_* constants.
*
+ * _outbuf_ will contain only the received data after the method call
+ * even if it is not empty at the beginning.
+ *
* s1 = Socket.new(:UNIX, :DGRAM, 0)
* s1_ai = Addrinfo.unix("/tmp/sock1")
* s1.bind(s1_ai)
@@ -197,6 +203,8 @@ sendmsg_blocking(void *data)
* p stdout.fileno #=> 6
*
* stdout.puts "hello" # outputs "hello\n" to standard output.
+ *
+ * _io_ may be any kind of IO object or integer file descriptor.
*/
static VALUE
unix_send_io(VALUE sock, VALUE val)
@@ -277,6 +285,8 @@ recvmsg_blocking(void *data)
* call-seq:
* unixsocket.recv_io([klass [, mode]]) => io
*
+ * Example
+ *
* UNIXServer.open("/tmp/sock") {|serv|
* UNIXSocket.open("/tmp/sock") {|c|
* s = serv.accept
@@ -291,6 +301,11 @@ recvmsg_blocking(void *data)
* }
* }
*
+ * _klass_ will determine the class of _io_ returned (using the
+ * IO.for_fd singleton method or similar).
+ * If _klass_ is +nil+, an integer file descriptor is returned.
+ *
+ * _mode_ is the same as the argument passed to IO.for_fd
*/
static VALUE
unix_recv_io(int argc, VALUE *argv, VALUE sock)
@@ -389,7 +404,13 @@ 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_fd_fix_cloexec(fd);
+
+ rb_update_max_fd(fd);
+
+ if (rsock_cmsg_cloexec_state < 0)
+ rsock_cmsg_cloexec_state = rsock_detect_cloexec(fd);
+ if (rsock_cmsg_cloexec_state == 0 || fd <= 2)
+ rb_maygvl_fd_fix_cloexec(fd);
if (klass == Qnil)
return INT2FIX(fd);
@@ -468,7 +489,7 @@ unix_peeraddr(VALUE sock)
* UNIXSocket.pair([type [, protocol]]) => [unixsocket1, unixsocket2]
* UNIXSocket.socketpair([type [, protocol]]) => [unixsocket1, unixsocket2]
*
- * Creates a pair of sockets connected each other.
+ * Creates a pair of sockets connected to each other.
*
* _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
*
diff --git a/ext/stringio/extconf.rb b/ext/stringio/extconf.rb
index 8fc84b3735..ad8650dce2 100644
--- a/ext/stringio/extconf.rb
+++ b/ext/stringio/extconf.rb
@@ -1,2 +1,3 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile('stringio')
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 3fef619de6..8ae4cd5b2e 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -20,8 +20,13 @@
#include <sys/fcntl.h>
#endif
+#ifndef RB_INTEGER_TYPE_P
+# define RB_INTEGER_TYPE_P(c) (FIXNUM_P(c) || RB_TYPE_P(c, T_BIGNUM))
+#endif
+
struct StringIO {
VALUE string;
+ rb_encoding *enc;
long pos;
long lineno;
int flags;
@@ -29,9 +34,11 @@ struct StringIO {
};
static void strio_init(int, VALUE *, struct StringIO *, VALUE);
+static VALUE strio_unget_bytes(struct StringIO *, const char *, long);
#define IS_STRIO(obj) (rb_typeddata_is_kind_of((obj), &strio_data_type))
-#define error_inval(msg) (errno = EINVAL, rb_sys_fail(msg))
+#define error_inval(msg) (rb_syserr_fail(EINVAL, msg))
+#define get_enc(ptr) ((ptr)->enc ? (ptr)->enc : rb_enc_get((ptr)->string))
static struct StringIO *
strio_alloc(void)
@@ -66,8 +73,6 @@ strio_free(void *p)
static size_t
strio_memsize(const void *p)
{
- const struct StringIO *ptr = p;
- if (!ptr) return 0;
return sizeof(struct StringIO);
}
@@ -78,7 +83,7 @@ static const rb_data_type_t strio_data_type = {
strio_free,
strio_memsize,
},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
#define check_strio(self) ((struct StringIO*)rb_check_typeddata((self), &strio_data_type))
@@ -98,7 +103,7 @@ static VALUE
strio_substr(struct StringIO *ptr, long pos, long len)
{
VALUE str = ptr->string;
- rb_encoding *enc = rb_enc_get(str);
+ rb_encoding *enc = get_enc(ptr);
long rlen = RSTRING_LEN(str) - pos;
if (len > rlen) len = rlen;
@@ -139,8 +144,6 @@ writable(VALUE strio)
if (!WRITABLE(strio)) {
rb_raise(rb_eIOError, "not opened for writing");
}
- if (!OBJ_TAINTED(ptr->string)) {
- }
return ptr;
}
@@ -186,18 +189,17 @@ strio_init(int argc, VALUE *argv, struct StringIO *ptr, VALUE self)
case 2:
if (FIXNUM_P(mode)) {
int flags = FIX2INT(mode);
- ptr->flags = rb_io_modenum_flags(flags);
+ ptr->flags = rb_io_oflags_fmode(flags);
trunc = flags & O_TRUNC;
}
else {
const char *m = StringValueCStr(mode);
- ptr->flags = rb_io_mode_flags(m);
+ ptr->flags = rb_io_modestr_fmode(m);
trunc = *m == 'w';
}
StringValue(string);
if ((ptr->flags & FMODE_WRITABLE) && OBJ_FROZEN(string)) {
- errno = EACCES;
- rb_sys_fail(0);
+ rb_syserr_fail(EACCES, 0);
}
if (trunc) {
rb_str_resize(string, 0);
@@ -213,6 +215,7 @@ strio_init(int argc, VALUE *argv, struct StringIO *ptr, VALUE self)
break;
}
ptr->string = string;
+ ptr->enc = 0;
ptr->pos = 0;
ptr->lineno = 0;
RBASIC(self)->flags |= (ptr->flags & FMODE_READWRITE) * (STRIO_READABLE / FMODE_READABLE);
@@ -346,9 +349,6 @@ static VALUE
strio_close(VALUE self)
{
StringIO(self);
- if (CLOSED(self)) {
- rb_raise(rb_eIOError, "closed stream");
- }
RBASIC(self)->flags &= ~STRIO_READWRITE;
return Qnil;
}
@@ -363,8 +363,8 @@ strio_close(VALUE self)
static VALUE
strio_close_read(VALUE self)
{
- StringIO(self);
- if (!READABLE(self)) {
+ struct StringIO *ptr = StringIO(self);
+ if (!(ptr->flags & FMODE_READABLE)) {
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
RBASIC(self)->flags &= ~STRIO_READABLE;
@@ -381,8 +381,8 @@ strio_close_read(VALUE self)
static VALUE
strio_close_write(VALUE self)
{
- StringIO(self);
- if (!WRITABLE(self)) {
+ struct StringIO *ptr = StringIO(self);
+ if (!(ptr->flags & FMODE_WRITABLE)) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
RBASIC(self)->flags &= ~STRIO_WRITABLE;
@@ -497,7 +497,18 @@ strio_set_lineno(VALUE self, VALUE lineno)
return lineno;
}
-#define strio_binmode strio_self
+static VALUE
+strio_binmode(VALUE self)
+{
+ struct StringIO *ptr = StringIO(self);
+ rb_encoding *enc = rb_ascii8bit_encoding();
+
+ ptr->enc = enc;
+ if (WRITABLE(self)) {
+ rb_enc_associate(ptr->string, enc);
+ }
+ return self;
+}
#define strio_fcntl strio_unimpl
@@ -669,7 +680,7 @@ static VALUE
strio_getc(VALUE self)
{
struct StringIO *ptr = readable(self);
- rb_encoding *enc = rb_enc_get(ptr->string);
+ rb_encoding *enc = get_enc(ptr);
int len;
char *p;
@@ -679,7 +690,7 @@ strio_getc(VALUE self)
p = RSTRING_PTR(ptr->string)+ptr->pos;
len = rb_enc_mbclen(p, RSTRING_END(ptr->string), enc);
ptr->pos += len;
- return rb_enc_str_new(p, len, rb_enc_get(ptr->string));
+ return rb_enc_str_new(p, len, enc);
}
/*
@@ -730,19 +741,19 @@ static VALUE
strio_ungetc(VALUE self, VALUE c)
{
struct StringIO *ptr = readable(self);
- long lpos, clen;
- char *p, *pend;
rb_encoding *enc, *enc2;
- if (NIL_P(c)) return Qnil;
check_modifiable(ptr);
- if (FIXNUM_P(c)) {
- int cc = FIX2INT(c);
+ if (NIL_P(c)) return Qnil;
+ if (RB_INTEGER_TYPE_P(c)) {
+ int len, cc = NUM2INT(c);
char buf[16];
enc = rb_enc_get(ptr->string);
+ len = rb_enc_codelen(cc, enc);
+ if (len <= 0) rb_enc_uint_chr(cc, enc);
rb_enc_mbcput(cc, buf, enc);
- c = rb_enc_str_new(buf, rb_enc_codelen(cc, enc), enc);
+ return strio_unget_bytes(ptr, buf, len);
}
else {
SafeStringValue(c);
@@ -751,29 +762,10 @@ strio_ungetc(VALUE self, VALUE c)
if (enc != enc2 && enc != rb_ascii8bit_encoding()) {
c = rb_str_conv_enc(c, enc2, enc);
}
+ strio_unget_bytes(ptr, RSTRING_PTR(c), RSTRING_LEN(c));
+ RB_GC_GUARD(c);
+ return Qnil;
}
- if (RSTRING_LEN(ptr->string) < ptr->pos) {
- long len = RSTRING_LEN(ptr->string);
- rb_str_resize(ptr->string, ptr->pos - 1);
- memset(RSTRING_PTR(ptr->string) + len, 0, ptr->pos - len - 1);
- rb_str_concat(ptr->string, c);
- ptr->pos--;
- }
- else {
- /* get logical position */
- lpos = 0; p = RSTRING_PTR(ptr->string); pend = p + ptr->pos;
- for (;;) {
- clen = rb_enc_mbclen(p, pend, enc);
- if (p+clen >= pend) break;
- p += clen;
- lpos++;
- }
- clen = p - RSTRING_PTR(ptr->string);
- rb_str_update(ptr->string, lpos, ptr->pos ? 1 : 0, c);
- ptr->pos = clen;
- }
-
- return Qnil;
}
/*
@@ -787,35 +779,53 @@ strio_ungetbyte(VALUE self, VALUE c)
{
struct StringIO *ptr = readable(self);
char buf[1], *cp = buf;
- long pos = ptr->pos, cl = 1;
- VALUE str = ptr->string;
+ long cl = 1;
+ check_modifiable(ptr);
if (NIL_P(c)) return Qnil;
if (FIXNUM_P(c)) {
buf[0] = (char)FIX2INT(c);
+ return strio_unget_bytes(ptr, buf, 1);
}
else {
SafeStringValue(c);
cp = RSTRING_PTR(c);
cl = RSTRING_LEN(c);
if (cl == 0) return Qnil;
+ strio_unget_bytes(ptr, cp, cl);
+ RB_GC_GUARD(c);
+ return Qnil;
}
- check_modifiable(ptr);
- rb_str_modify(str);
+}
+
+static VALUE
+strio_unget_bytes(struct StringIO *ptr, const char *cp, long cl)
+{
+ long pos = ptr->pos, len, rest;
+ VALUE str = ptr->string;
+ char *s;
+
+ len = RSTRING_LEN(str);
+ rest = pos - len;
if (cl > pos) {
- char *s;
- long rest = RSTRING_LEN(str) - pos;
- rb_str_resize(str, rest + cl);
+ long ex = (rest < 0 ? cl-pos : cl+rest);
+ rb_str_modify_expand(str, ex);
+ rb_str_set_len(str, len + ex);
s = RSTRING_PTR(str);
- memmove(s + cl, s + pos, rest);
+ if (rest < 0) memmove(s + cl, s + pos, -rest);
pos = 0;
}
else {
+ if (rest > 0) {
+ rb_str_modify_expand(str, rest);
+ rb_str_set_len(str, len + rest);
+ }
+ s = RSTRING_PTR(str);
+ if (rest > cl) memset(s + len, 0, rest - cl);
pos -= cl;
}
- memcpy(RSTRING_PTR(str) + pos, cp, cl);
+ memcpy(s + pos, cp, cl);
ptr->pos = pos;
- RB_GC_GUARD(c);
return Qnil;
}
@@ -897,7 +907,7 @@ strio_each_codepoint(VALUE self)
RETURN_ENUMERATOR(self, 0, 0);
ptr = readable(self);
- enc = rb_enc_get(ptr->string);
+ enc = get_enc(ptr);
for (;;) {
if (ptr->pos >= RSTRING_LEN(ptr->string)) {
return self;
@@ -996,7 +1006,7 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
e = s + RSTRING_LEN(ptr->string);
s += ptr->pos;
if (limit > 0 && s + limit < e) {
- e = rb_enc_right_char_head(s, s + limit, e, rb_enc_get(ptr->string));
+ e = rb_enc_right_char_head(s, s + limit, e, get_enc(ptr));
}
if (NIL_P(str)) {
str = strio_substr(ptr, ptr->pos, e - s);
@@ -1169,13 +1179,13 @@ strio_write(VALUE self, VALUE str)
struct StringIO *ptr = writable(self);
long len, olen;
rb_encoding *enc, *enc2;
+ rb_encoding *const ascii8bit = rb_ascii8bit_encoding();
- RB_GC_GUARD(str);
if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
- enc = rb_enc_get(ptr->string);
+ enc = get_enc(ptr);
enc2 = rb_enc_get(str);
- if (enc != enc2 && enc != rb_ascii8bit_encoding()) {
+ if (enc != enc2 && enc != ascii8bit) {
str = rb_str_conv_enc(str, enc2, enc);
}
len = RSTRING_LEN(str);
@@ -1186,7 +1196,13 @@ strio_write(VALUE self, VALUE str)
ptr->pos = olen;
}
if (ptr->pos == olen) {
- rb_enc_str_buf_cat(ptr->string, RSTRING_PTR(str), len, enc);
+ if (enc == ascii8bit || enc2 == ascii8bit) {
+ rb_enc_str_buf_cat(ptr->string, RSTRING_PTR(str), len, enc);
+ OBJ_INFECT(ptr->string, str);
+ }
+ else {
+ rb_str_buf_append(ptr->string, str);
+ }
}
else {
strio_extend(ptr, ptr->pos, len);
@@ -1194,6 +1210,7 @@ strio_write(VALUE self, VALUE str)
OBJ_INFECT(ptr->string, str);
}
OBJ_INFECT(ptr->string, self);
+ RB_GC_GUARD(str);
ptr->pos += len;
return LONG2NUM(len);
}
@@ -1233,17 +1250,17 @@ static VALUE
strio_putc(VALUE self, VALUE ch)
{
struct StringIO *ptr = writable(self);
- int c = NUM2CHR(ch);
- long olen;
+ VALUE str;
check_modifiable(ptr);
- olen = RSTRING_LEN(ptr->string);
- if (ptr->flags & FMODE_APPEND) {
- ptr->pos = olen;
+ if (RB_TYPE_P(ch, T_STRING)) {
+ str = rb_str_substr(ch, 0, 1);
}
- strio_extend(ptr, ptr->pos, 1);
- RSTRING_PTR(ptr->string)[ptr->pos++] = c;
- OBJ_INFECT(ptr->string, self);
+ else {
+ char c = NUM2CHR(ch);
+ str = rb_str_new(&c, 1);
+ }
+ strio_write(self, str);
return ch;
}
@@ -1269,6 +1286,7 @@ strio_read(int argc, VALUE *argv, VALUE self)
long len;
int binary = 0;
+ rb_check_arity(argc, 0, 2);
switch (argc) {
case 2:
str = argv[1];
@@ -1305,8 +1323,6 @@ strio_read(int argc, VALUE *argv, VALUE self)
len -= ptr->pos;
}
break;
- default:
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
if (NIL_P(str)) {
str = strio_substr(ptr, ptr->pos, len);
@@ -1355,20 +1371,17 @@ static VALUE
strio_read_nonblock(int argc, VALUE *argv, VALUE self)
{
VALUE opts = Qnil, val;
- int no_exception = 0;
rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
if (!NIL_P(opts)) {
argc--;
-
- if (Qfalse == rb_hash_aref(opts, sym_exception))
- no_exception = 1;
}
val = strio_read(argc, argv, self);
if (NIL_P(val)) {
- if (no_exception)
+ if (!NIL_P(opts) &&
+ rb_hash_lookup2(opts, sym_exception, Qundef) == Qfalse)
return Qnil;
else
rb_eof_error();
@@ -1445,7 +1458,8 @@ strio_truncate(VALUE self, VALUE len)
static VALUE
strio_external_encoding(VALUE self)
{
- return rb_enc_from_encoding(rb_enc_get(StringIO(self)->string));
+ struct StringIO *ptr = StringIO(self);
+ return rb_enc_from_encoding(get_enc(ptr));
}
/*
@@ -1476,7 +1490,7 @@ static VALUE
strio_set_encoding(int argc, VALUE *argv, VALUE self)
{
rb_encoding* enc;
- VALUE str = StringIO(self)->string;
+ struct StringIO *ptr = StringIO(self);
VALUE ext_enc, int_enc, opt;
argc = rb_scan_args(argc, argv, "11:", &ext_enc, &int_enc, &opt);
@@ -1487,15 +1501,29 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
else {
enc = rb_to_encoding(ext_enc);
}
- rb_enc_associate(str, enc);
+ ptr->enc = enc;
+ if (WRITABLE(self)) {
+ rb_enc_associate(ptr->string, enc);
+ }
+
return self;
}
/*
* Pseudo I/O on String object.
+ *
+ * Commonly used to simulate `$stdio` or `$stderr`
+ *
+ * === Examples
+ *
+ * require 'stringio'
+ *
+ * io = StringIO.new
+ * io.puts "Hello World"
+ * io.string #=> "Hello World\n"
*/
void
-Init_stringio()
+Init_stringio(void)
{
VALUE StringIO = rb_define_class("StringIO", rb_cData);
diff --git a/ext/strscan/depend b/ext/strscan/depend
index 689510ec66..324c5da2f2 100644
--- a/ext/strscan/depend
+++ b/ext/strscan/depend
@@ -1,7 +1,17 @@
-strscan.o: strscan.c $(HDRS) $(ruby_headers) \
- $(hdrdir)/re.h \
- $(hdrdir)/regex.h \
- $(hdrdir)/encoding.h \
- $(hdrdir)/oniguruma.h \
- $(top_srcdir)/regint.h \
- $(top_srcdir)/regenc.h
+# AUTOGENERATED DEPENDENCIES START
+strscan.o: $(RUBY_EXTCONF_H)
+strscan.o: $(arch_hdrdir)/ruby/config.h
+strscan.o: $(hdrdir)/ruby/defines.h
+strscan.o: $(hdrdir)/ruby/encoding.h
+strscan.o: $(hdrdir)/ruby/intern.h
+strscan.o: $(hdrdir)/ruby/missing.h
+strscan.o: $(hdrdir)/ruby/oniguruma.h
+strscan.o: $(hdrdir)/ruby/re.h
+strscan.o: $(hdrdir)/ruby/regex.h
+strscan.o: $(hdrdir)/ruby/ruby.h
+strscan.o: $(hdrdir)/ruby/st.h
+strscan.o: $(hdrdir)/ruby/subst.h
+strscan.o: $(top_srcdir)/regenc.h
+strscan.o: $(top_srcdir)/regint.h
+strscan.o: strscan.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/strscan/extconf.rb b/ext/strscan/extconf.rb
index 3e5a295e31..c968f81c95 100644
--- a/ext/strscan/extconf.rb
+++ b/ext/strscan/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
$INCFLAGS << " -I$(top_srcdir)"
create_makefile 'strscan'
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index f020ba780d..05a62da405 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -64,6 +64,7 @@ struct strscanner
Function Prototypes
======================================================================= */
+static inline long minl _((const long n, const long x));
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));
@@ -140,12 +141,17 @@ str_new(struct strscanner *p, const char *ptr, long len)
return str;
}
+static inline long
+minl(const long x, const long y)
+{
+ return (x < y) ? x : y;
+}
+
static VALUE
extract_range(struct strscanner *p, long beg_i, long end_i)
{
if (beg_i > S_LEN(p)) return Qnil;
- if (end_i > S_LEN(p))
- end_i = S_LEN(p);
+ end_i = minl(end_i, S_LEN(p));
return infect(str_new(p, S_PBEG(p) + beg_i, end_i - beg_i), p);
}
@@ -153,8 +159,7 @@ static VALUE
extract_beg_len(struct strscanner *p, long beg_i, long len)
{
if (beg_i > S_LEN(p)) return Qnil;
- if (beg_i + len > S_LEN(p))
- len = S_LEN(p) - beg_i;
+ len = minl(len, S_LEN(p) - beg_i);
return infect(str_new(p, S_PBEG(p) + beg_i, len), p);
}
@@ -181,30 +186,25 @@ 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;
+ return sizeof(*p) - sizeof(p->regs) + onig_region_memsize(&p->regs);
}
static const rb_data_type_t strscanner_type = {
"StringScanner",
{strscan_mark, strscan_free, strscan_memsize},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
strscan_s_allocate(VALUE klass)
{
struct strscanner *p;
+ VALUE obj = TypedData_Make_Struct(klass, struct strscanner, &strscanner_type, p);
- p = ALLOC(struct strscanner);
- MEMZERO(p, struct strscanner, 1);
CLEAR_MATCH_STATUS(p);
onig_region_init(&(p->regs));
p->str = Qnil;
- return TypedData_Wrap_Struct(klass, &strscanner_type, p);
+ return obj;
}
/*
@@ -252,7 +252,9 @@ strscan_init_copy(VALUE vself, VALUE vorig)
self->str = orig->str;
self->prev = orig->prev;
self->curr = orig->curr;
- onig_region_copy(&self->regs, &orig->regs);
+ if (rb_reg_region_copy(&self->regs, &orig->regs))
+ rb_memerror();
+ RB_GC_GUARD(vorig);
}
return vself;
@@ -731,9 +733,7 @@ strscan_getch(VALUE self)
return Qnil;
len = rb_enc_mbclen(CURPTR(p), S_PEND(p), rb_enc_get(p->str));
- if (p->curr + len > S_LEN(p)) {
- len = S_LEN(p) - p->curr;
- }
+ len = minl(len, S_RESTLEN(p));
p->prev = p->curr;
p->curr += len;
MATCHED(p);
@@ -810,8 +810,7 @@ strscan_peek(VALUE self, VALUE vlen)
if (EOS_P(p))
return infect(str_new(p, "", 0), p);
- if (p->curr + len > S_LEN(p))
- len = S_LEN(p) - p->curr;
+ len = minl(len, S_RESTLEN(p));
return extract_beg_len(p, p->curr, len);
}
@@ -977,7 +976,7 @@ strscan_matched_size(VALUE self)
}
static int
-name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name, const char* name_end)
+name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name, const char* name_end, rb_encoding *enc)
{
int num;
@@ -987,9 +986,8 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name
return num;
}
else {
- VALUE s = rb_str_new(name, (long )(name_end - name));
- rb_raise(rb_eIndexError, "undefined group name reference: %s",
- StringValuePtr(s));
+ rb_enc_raise(enc, rb_eIndexError, "undefined group name reference: %.*s",
+ rb_long2int(name_end - name), name);
}
UNREACHABLE;
@@ -1033,13 +1031,12 @@ strscan_aref(VALUE self, VALUE idx)
switch (TYPE(idx)) {
case T_SYMBOL:
- name = rb_id2name(SYM2ID(idx));
- goto name_to_backref;
- break;
+ idx = rb_sym2str(idx);
+ /* fall through */
case T_STRING:
- name = StringValuePtr(idx);
- name_to_backref:
- i = name_to_backref_number(&(p->regs), p->regex, name, name + strlen(name));
+ if (!p->regex) return Qnil;
+ RSTRING_GETMEM(idx, name, i);
+ i = name_to_backref_number(&(p->regs), p->regex, name, name + i, rb_enc_get(idx));
break;
default:
i = NUM2LONG(idx);
@@ -1122,7 +1119,7 @@ strscan_rest_size(VALUE self)
if (EOS_P(p)) {
return INT2FIX(0);
}
- i = S_LEN(p) - p->curr;
+ i = S_RESTLEN(p);
return INT2FIX(i);
}
@@ -1138,7 +1135,6 @@ strscan_restsize(VALUE self)
}
#define INSPECT_LENGTH 5
-#define BUFSIZE 256
/*
* Returns a string that represents the StringScanner object, showing:
@@ -1155,76 +1151,69 @@ static VALUE
strscan_inspect(VALUE self)
{
struct strscanner *p;
- char buf[BUFSIZE];
- long len;
VALUE a, b;
p = check_strscan(self);
if (NIL_P(p->str)) {
- len = snprintf(buf, BUFSIZE, "#<%s (uninitialized)>",
- rb_class2name(CLASS_OF(self)));
- return infect(rb_str_new(buf, len), p);
+ a = rb_sprintf("#<%"PRIsVALUE" (uninitialized)>", rb_obj_class(self));
+ return infect(a, p);
}
if (EOS_P(p)) {
- len = snprintf(buf, BUFSIZE, "#<%s fin>",
- rb_class2name(CLASS_OF(self)));
- return infect(rb_str_new(buf, len), p);
+ a = rb_sprintf("#<%"PRIsVALUE" fin>", rb_obj_class(self));
+ return infect(a, p);
}
if (p->curr == 0) {
- b = inspect2(p);
- len = snprintf(buf, BUFSIZE, "#<%s %ld/%ld @ %s>",
- rb_class2name(CLASS_OF(self)),
- p->curr, S_LEN(p),
- RSTRING_PTR(b));
- return infect(rb_str_new(buf, len), p);
+ b = inspect2(p);
+ a = rb_sprintf("#<%"PRIsVALUE" %ld/%ld @ %"PRIsVALUE">",
+ rb_obj_class(self),
+ p->curr, S_LEN(p),
+ b);
+ return infect(a, p);
}
a = inspect1(p);
b = inspect2(p);
- len = snprintf(buf, BUFSIZE, "#<%s %ld/%ld %s @ %s>",
- rb_class2name(CLASS_OF(self)),
- p->curr, S_LEN(p),
- RSTRING_PTR(a),
- RSTRING_PTR(b));
- return infect(rb_str_new(buf, len), p);
+ a = rb_sprintf("#<%"PRIsVALUE" %ld/%ld %"PRIsVALUE" @ %"PRIsVALUE">",
+ rb_obj_class(self),
+ p->curr, S_LEN(p),
+ a, b);
+ return infect(a, p);
}
static VALUE
inspect1(struct strscanner *p)
{
- char buf[BUFSIZE];
- char *bp = buf;
+ VALUE str;
long len;
if (p->curr == 0) return rb_str_new2("");
if (p->curr > INSPECT_LENGTH) {
- strcpy(bp, "..."); bp += 3;
- len = INSPECT_LENGTH;
+ str = rb_str_new_cstr("...");
+ len = INSPECT_LENGTH;
}
else {
- len = p->curr;
+ str = rb_str_new(0, 0);
+ len = p->curr;
}
- memcpy(bp, CURPTR(p) - len, len); bp += len;
- return rb_str_dump(rb_str_new(buf, bp - buf));
+ rb_str_cat(str, CURPTR(p) - len, len);
+ return rb_str_dump(str);
}
static VALUE
inspect2(struct strscanner *p)
{
- char buf[BUFSIZE];
- char *bp = buf;
+ VALUE str;
long len;
if (EOS_P(p)) return rb_str_new2("");
- len = S_LEN(p) - p->curr;
+ len = S_RESTLEN(p);
if (len > INSPECT_LENGTH) {
- len = INSPECT_LENGTH;
- memcpy(bp, CURPTR(p), len); bp += len;
- strcpy(bp, "..."); bp += 3;
+ str = rb_str_new(CURPTR(p), INSPECT_LENGTH);
+ rb_str_cat2(str, "...");
}
else {
- memcpy(bp, CURPTR(p), len); bp += len;
+ str = rb_str_new(CURPTR(p), len);
}
- return rb_str_dump(rb_str_new(buf, bp - buf));
+ return rb_str_dump(str);
}
/* =======================================================================
@@ -1335,7 +1324,7 @@ inspect2(struct strscanner *p)
* There are aliases to several of the methods.
*/
void
-Init_strscan()
+Init_strscan(void)
{
ID id_scanerr = rb_intern("ScanError");
VALUE tmp;
diff --git a/ext/syslog/depend b/ext/syslog/depend
index 0e2d76fbf6..d818fd80aa 100644
--- a/ext/syslog/depend
+++ b/ext/syslog/depend
@@ -1,2 +1,12 @@
-syslog.o: syslog.c $(HDRS) $(ruby_headers) \
- $(hdrdir)/util.h
+# AUTOGENERATED DEPENDENCIES START
+syslog.o: $(RUBY_EXTCONF_H)
+syslog.o: $(arch_hdrdir)/ruby/config.h
+syslog.o: $(hdrdir)/ruby/defines.h
+syslog.o: $(hdrdir)/ruby/intern.h
+syslog.o: $(hdrdir)/ruby/missing.h
+syslog.o: $(hdrdir)/ruby/ruby.h
+syslog.o: $(hdrdir)/ruby/st.h
+syslog.o: $(hdrdir)/ruby/subst.h
+syslog.o: $(hdrdir)/ruby/util.h
+syslog.o: syslog.c
+# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/syslog/extconf.rb b/ext/syslog/extconf.rb
index 0fa0bc339b..3bfea1fa73 100644
--- a/ext/syslog/extconf.rb
+++ b/ext/syslog/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# $RoughId: extconf.rb,v 1.3 2001/11/24 17:49:26 knu Exp $
# $Id$
diff --git a/ext/syslog/lib/syslog/logger.rb b/ext/syslog/lib/syslog/logger.rb
index 086f83c591..06cbe5b19d 100644
--- a/ext/syslog/lib/syslog/logger.rb
+++ b/ext/syslog/lib/syslog/logger.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'syslog'
require 'logger'
@@ -66,7 +67,7 @@ class Syslog::Logger
##
# The version of Syslog::Logger you are using.
- VERSION = '2.0'
+ VERSION = '2.1.0'
##
# Maps Logger warning types to syslog(3) warning types.
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index 17c5ef8969..9c41795f5b 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -304,15 +304,13 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
{
VALUE pri;
- if (argc < 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 2+)", argc);
- }
+ rb_check_arity(argc, 2, UNLIMITED_ARGUMENTS);
argc--;
pri = *argv++;
if (!FIXNUM_P(pri)) {
- rb_raise(rb_eTypeError, "type mismatch: %s given", rb_class2name(CLASS_OF(pri)));
+ rb_raise(rb_eTypeError, "type mismatch: %"PRIsVALUE" given", rb_obj_class(pri));
}
syslog_write(FIX2INT(pri), argc, argv);
@@ -327,10 +325,10 @@ static VALUE mSyslog_inspect(VALUE self)
Check_Type(self, T_MODULE);
if (!syslog_opened)
- return rb_sprintf("<#%s: opened=false>", rb_class2name(self));
+ return rb_sprintf("<#%"PRIsVALUE": opened=false>", self);
- return rb_sprintf("<#%s: opened=true, ident=\"%s\", options=%d, facility=%d, mask=%d>",
- rb_class2name(self),
+ return rb_sprintf("<#%"PRIsVALUE": opened=true, ident=\"%s\", options=%d, facility=%d, mask=%d>",
+ self,
syslog_ident,
syslog_options,
syslog_facility,
@@ -418,7 +416,7 @@ static VALUE mSyslogMacros_included(VALUE mod, VALUE target)
*
* The syslog protocol is standardized in RFC 5424.
*/
-void Init_syslog()
+void Init_syslog(void)
{
mSyslog = rb_define_module("Syslog");
diff --git a/ext/thread/extconf.rb b/ext/thread/extconf.rb
index f2f0890580..7e1c6d2716 100644
--- a/ext/thread/extconf.rb
+++ b/ext/thread/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'mkmf'
create_makefile('thread')
diff --git a/ext/thread/thread.c b/ext/thread/thread.c
index b8be5d883f..9eef3b442e 100644
--- a/ext/thread/thread.c
+++ b/ext/thread/thread.c
@@ -1,604 +1,6 @@
#include <ruby.h>
-enum {
- CONDVAR_WAITERS = 0
-};
-
-enum {
- QUEUE_QUE = 0,
- QUEUE_WAITERS = 1,
- SZQUEUE_WAITERS = 2,
- SZQUEUE_MAX = 3
-};
-
-#define GET_CONDVAR_WAITERS(cv) RSTRUCT_GET((cv), CONDVAR_WAITERS)
-
-#define GET_QUEUE_QUE(q) RSTRUCT_GET((q), QUEUE_QUE)
-#define GET_QUEUE_WAITERS(q) RSTRUCT_GET((q), QUEUE_WAITERS)
-#define GET_SZQUEUE_WAITERS(q) RSTRUCT_GET((q), SZQUEUE_WAITERS)
-#define GET_SZQUEUE_MAX(q) RSTRUCT_GET((q), SZQUEUE_MAX)
-#define GET_SZQUEUE_ULONGMAX(q) NUM2ULONG(GET_SZQUEUE_MAX(q))
-
-static VALUE
-ary_buf_new(void)
-{
- return rb_ary_tmp_new(1);
-}
-
-static void
-wakeup_first_thread(VALUE list)
-{
- VALUE thread;
-
- while (!NIL_P(thread = rb_ary_shift(list))) {
- if (RTEST(rb_thread_wakeup_alive(thread))) break;
- }
-}
-
-static void
-wakeup_all_threads(VALUE list)
-{
- VALUE thread;
- long i;
-
- for (i=0; i<RARRAY_LEN(list); i++) {
- thread = RARRAY_AREF(list, i);
- rb_thread_wakeup_alive(thread);
- }
- rb_ary_clear(list);
-}
-
-/*
- * Document-class: ConditionVariable
- *
- * ConditionVariable objects augment class Mutex. Using condition variables,
- * it is possible to suspend while in the middle of a critical section until a
- * resource becomes available.
- *
- * Example:
- *
- * require 'thread'
- *
- * mutex = Mutex.new
- * resource = ConditionVariable.new
- *
- * a = Thread.new {
- * mutex.synchronize {
- * # Thread 'a' now needs the resource
- * resource.wait(mutex)
- * # 'a' can now have the resource
- * }
- * }
- *
- * b = Thread.new {
- * mutex.synchronize {
- * # Thread 'b' has finished using the resource
- * resource.signal
- * }
- * }
- */
-
-/*
- * Document-method: ConditionVariable::new
- *
- * Creates a new condition variable instance.
- */
-
-static VALUE
-rb_condvar_initialize(VALUE self)
-{
- RSTRUCT_SET(self, CONDVAR_WAITERS, ary_buf_new());
- return self;
-}
-
-struct sleep_call {
- VALUE mutex;
- VALUE timeout;
-};
-
-static ID id_sleep;
-
-static VALUE
-do_sleep(VALUE args)
-{
- struct sleep_call *p = (struct sleep_call *)args;
- return rb_funcall2(p->mutex, id_sleep, 1, &p->timeout);
-}
-
-static VALUE
-delete_current_thread(VALUE ary)
-{
- return rb_ary_delete(ary, rb_thread_current());
-}
-
-/*
- * Document-method: ConditionVariable#wait
- * call-seq: wait(mutex, timeout=nil)
- *
- * Releases the lock held in +mutex+ and waits; reacquires the lock on wakeup.
- *
- * If +timeout+ is given, this method returns after +timeout+ seconds passed,
- * even if no other thread doesn't signal.
- */
-
-static VALUE
-rb_condvar_wait(int argc, VALUE *argv, VALUE self)
-{
- VALUE waiters = GET_CONDVAR_WAITERS(self);
- VALUE mutex, timeout;
- struct sleep_call args;
-
- rb_scan_args(argc, argv, "11", &mutex, &timeout);
-
- args.mutex = mutex;
- args.timeout = timeout;
- rb_ary_push(waiters, rb_thread_current());
- rb_ensure(do_sleep, (VALUE)&args, delete_current_thread, waiters);
-
- return self;
-}
-
-/*
- * Document-method: ConditionVariable#signal
- *
- * Wakes up the first thread in line waiting for this lock.
- */
-
-static VALUE
-rb_condvar_signal(VALUE self)
-{
- wakeup_first_thread(GET_CONDVAR_WAITERS(self));
- return self;
-}
-
-/*
- * Document-method: ConditionVariable#broadcast
- *
- * Wakes up all threads waiting for this lock.
- */
-
-static VALUE
-rb_condvar_broadcast(VALUE self)
-{
- wakeup_all_threads(GET_CONDVAR_WAITERS(self));
- return self;
-}
-
-/*
- * Document-class: Queue
- *
- * This class provides a way to synchronize communication between threads.
- *
- * Example:
- *
- * require 'thread'
- * queue = Queue.new
- *
- * producer = Thread.new do
- * 5.times do |i|
- * sleep rand(i) # simulate expense
- * queue << i
- * puts "#{i} produced"
- * end
- * end
- *
- * consumer = Thread.new do
- * 5.times do |i|
- * value = queue.pop
- * sleep rand(i/2) # simulate expense
- * puts "consumed #{value}"
- * end
- * end
- *
- */
-
-/*
- * Document-method: Queue::new
- *
- * Creates a new queue instance.
- */
-
-static VALUE
-rb_queue_initialize(VALUE self)
-{
- RSTRUCT_SET(self, QUEUE_QUE, ary_buf_new());
- RSTRUCT_SET(self, QUEUE_WAITERS, ary_buf_new());
- return self;
-}
-
-static VALUE
-queue_do_push(VALUE self, VALUE obj)
-{
- rb_ary_push(GET_QUEUE_QUE(self), obj);
- wakeup_first_thread(GET_QUEUE_WAITERS(self));
- return self;
-}
-
-/*
- * Document-method: Queue#push
- * call-seq:
- * push(object)
- * enq(object)
- * <<(object)
- *
- * Pushes the given +object+ to the queue.
- */
-
-static VALUE
-rb_queue_push(VALUE self, VALUE obj)
-{
- return queue_do_push(self, obj);
-}
-
-static unsigned long
-queue_length(VALUE self)
-{
- return RARRAY_LEN(GET_QUEUE_QUE(self));
-}
-
-static unsigned long
-queue_num_waiting(VALUE self)
-{
- return RARRAY_LEN(GET_QUEUE_WAITERS(self));
-}
-
-struct waiting_delete {
- VALUE waiting;
- VALUE th;
-};
-
-static VALUE
-queue_delete_from_waiting(struct waiting_delete *p)
-{
- rb_ary_delete(p->waiting, p->th);
- return Qnil;
-}
-
-static VALUE
-queue_sleep(VALUE arg)
-{
- rb_thread_sleep_deadly();
- return Qnil;
-}
-
-static VALUE
-queue_do_pop(VALUE self, VALUE should_block)
-{
- struct waiting_delete args;
- args.waiting = GET_QUEUE_WAITERS(self);
- args.th = rb_thread_current();
-
- while (queue_length(self) == 0) {
- if (!(int)should_block) {
- rb_raise(rb_eThreadError, "queue empty");
- }
- rb_ary_push(args.waiting, args.th);
- rb_ensure(queue_sleep, (VALUE)0, queue_delete_from_waiting, (VALUE)&args);
- }
-
- return rb_ary_shift(GET_QUEUE_QUE(self));
-}
-
-static VALUE
-queue_pop_should_block(int argc, VALUE *argv)
-{
- VALUE should_block = Qtrue;
- switch (argc) {
- case 0:
- break;
- case 1:
- should_block = RTEST(argv[0]) ? Qfalse : Qtrue;
- break;
- default:
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
- }
- return should_block;
-}
-
-/*
- * Document-method: Queue#pop
- * call-seq:
- * pop(non_block=false)
- * deq(non_block=false)
- * shift(non_block=false)
- *
- * Retrieves data from the queue.
- *
- * If the queue is empty, the calling thread is suspended until data is pushed
- * onto the queue. If +non_block+ is true, the thread isn't suspended, and an
- * exception is raised.
- */
-
-static VALUE
-rb_queue_pop(int argc, VALUE *argv, VALUE self)
-{
- VALUE should_block = queue_pop_should_block(argc, argv);
- return queue_do_pop(self, should_block);
-}
-
-/*
- * Document-method: Queue#empty?
- * call-seq: empty?
- *
- * Returns +true+ if the queue is empty.
- */
-
-static VALUE
-rb_queue_empty_p(VALUE self)
-{
- return queue_length(self) == 0 ? Qtrue : Qfalse;
-}
-
-/*
- * Document-method: Queue#clear
- *
- * Removes all objects from the queue.
- */
-
-static VALUE
-rb_queue_clear(VALUE self)
-{
- rb_ary_clear(GET_QUEUE_QUE(self));
- return self;
-}
-
-/*
- * Document-method: Queue#length
- * call-seq:
- * length
- * size
- *
- * Returns the length of the queue.
- */
-
-static VALUE
-rb_queue_length(VALUE self)
-{
- unsigned long len = queue_length(self);
- return ULONG2NUM(len);
-}
-
-/*
- * Document-method: Queue#num_waiting
- *
- * Returns the number of threads waiting on the queue.
- */
-
-static VALUE
-rb_queue_num_waiting(VALUE self)
-{
- unsigned long len = queue_num_waiting(self);
- return ULONG2NUM(len);
-}
-
-/*
- * Document-class: SizedQueue
- *
- * This class represents queues of specified size capacity. The push operation
- * may be blocked if the capacity is full.
- *
- * See Queue for an example of how a SizedQueue works.
- */
-
-/*
- * Document-method: SizedQueue::new
- * call-seq: new(max)
- *
- * Creates a fixed-length queue with a maximum size of +max+.
- */
-
-static VALUE
-rb_szqueue_initialize(VALUE self, VALUE vmax)
-{
- long max;
-
- max = NUM2LONG(vmax);
- if (max <= 0) {
- rb_raise(rb_eArgError, "queue size must be positive");
- }
-
- RSTRUCT_SET(self, QUEUE_QUE, ary_buf_new());
- RSTRUCT_SET(self, QUEUE_WAITERS, ary_buf_new());
- RSTRUCT_SET(self, SZQUEUE_WAITERS, ary_buf_new());
- RSTRUCT_SET(self, SZQUEUE_MAX, vmax);
-
- return self;
-}
-
-/*
- * Document-method: SizedQueue#max
- *
- * Returns the maximum size of the queue.
- */
-
-static VALUE
-rb_szqueue_max_get(VALUE self)
-{
- return GET_SZQUEUE_MAX(self);
-}
-
-/*
- * Document-method: SizedQueue#max=
- * call-seq: max=(number)
- *
- * Sets the maximum size of the queue to the given +number+.
- */
-
-static VALUE
-rb_szqueue_max_set(VALUE self, VALUE vmax)
-{
- long max = NUM2LONG(vmax), diff = 0;
- VALUE t;
-
- if (max <= 0) {
- rb_raise(rb_eArgError, "queue size must be positive");
- }
- if ((unsigned long)max > GET_SZQUEUE_ULONGMAX(self)) {
- diff = max - GET_SZQUEUE_ULONGMAX(self);
- }
- RSTRUCT_SET(self, SZQUEUE_MAX, vmax);
- while (diff > 0 && !NIL_P(t = rb_ary_shift(GET_QUEUE_QUE(self)))) {
- rb_thread_wakeup_alive(t);
- }
- return vmax;
-}
-
-/*
- * Document-method: SizedQueue#push
- * call-seq:
- * push(object)
- * enq(object)
- * <<(object)
- *
- * Pushes +object+ to the queue.
- *
- * If there is no space left in the queue, waits until space becomes available.
- */
-
-static VALUE
-rb_szqueue_push(VALUE self, VALUE obj)
-{
- struct waiting_delete args;
- args.waiting = GET_QUEUE_WAITERS(self);
- args.th = rb_thread_current();
-
- while (queue_length(self) >= GET_SZQUEUE_ULONGMAX(self)) {
- rb_ary_push(args.waiting, args.th);
- rb_ensure((VALUE (*)())rb_thread_sleep_deadly, (VALUE)0, queue_delete_from_waiting, (VALUE)&args);
- }
- return queue_do_push(self, obj);
-}
-
-static VALUE
-szqueue_do_pop(VALUE self, VALUE should_block)
-{
- VALUE retval = queue_do_pop(self, should_block);
-
- if (queue_length(self) < GET_SZQUEUE_ULONGMAX(self)) {
- wakeup_first_thread(GET_SZQUEUE_WAITERS(self));
- }
-
- return retval;
-}
-
-/*
- * Document-method: SizedQueue#pop
- * call-seq:
- * pop(non_block=false)
- * deq(non_block=false)
- * shift(non_block=false)
- *
- * Retrieves data from the queue.
- *
- * If the queue is empty, the calling thread is suspended until data is pushed
- * onto the queue. If +non_block+ is true, the thread isn't suspended, and an
- * exception is raised.
- */
-
-static VALUE
-rb_szqueue_pop(int argc, VALUE *argv, VALUE self)
-{
- VALUE should_block = queue_pop_should_block(argc, argv);
- return szqueue_do_pop(self, should_block);
-}
-
-/*
- * Document-method: SizedQueue#num_waiting
- *
- * Returns the number of threads waiting on the queue.
- */
-
-static VALUE
-rb_szqueue_num_waiting(VALUE self)
-{
- long len = queue_num_waiting(self);
- len += RARRAY_LEN(GET_SZQUEUE_WAITERS(self));
- return ULONG2NUM(len);
-}
-
-#ifndef UNDER_THREAD
-#define UNDER_THREAD 1
-#endif
-
void
Init_thread(void)
{
-#if UNDER_THREAD
-#define ALIAS_GLOBAL_CONST(name) do { \
- ID id = rb_intern_const(#name); \
- if (!rb_const_defined_at(rb_cObject, id)) { \
- rb_const_set(rb_cObject, id, rb_c##name); \
- } \
- } while (0)
-#define OUTER rb_cThread
-#else
-#define ALIAS_GLOBAL_CONST(name) do { /* nothing */ } while (0)
-#define OUTER 0
-#endif
-
- VALUE rb_cConditionVariable = rb_struct_define_without_accessor_under(
- OUTER,
- "ConditionVariable", rb_cObject, rb_struct_alloc_noinit,
- "waiters", NULL);
- VALUE rb_cQueue = rb_struct_define_without_accessor_under(
- OUTER,
- "Queue", rb_cObject, rb_struct_alloc_noinit,
- "que", "waiters", NULL);
- VALUE rb_cSizedQueue = rb_struct_define_without_accessor_under(
- OUTER,
- "SizedQueue", rb_cQueue, rb_struct_alloc_noinit,
- "que", "waiters", "queue_waiters", "size", NULL);
-
-#if 0
- rb_cConditionVariable = rb_define_class("ConditionVariable", rb_cObject); /* teach rdoc ConditionVariable */
- rb_cQueue = rb_define_class("Queue", rb_cObject); /* teach rdoc Queue */
- rb_cSizedQueue = rb_define_class("SizedQueue", rb_cObject); /* teach rdoc SizedQueue */
-#endif
-
- id_sleep = rb_intern("sleep");
-
- rb_define_method(rb_cConditionVariable, "initialize", rb_condvar_initialize, 0);
- rb_define_method(rb_cConditionVariable, "wait", rb_condvar_wait, -1);
- rb_define_method(rb_cConditionVariable, "signal", rb_condvar_signal, 0);
- rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
-
- rb_define_method(rb_cQueue, "initialize", rb_queue_initialize, 0);
- rb_define_method(rb_cQueue, "push", rb_queue_push, 1);
- rb_define_method(rb_cQueue, "pop", rb_queue_pop, -1);
- rb_define_method(rb_cQueue, "empty?", rb_queue_empty_p, 0);
- rb_define_method(rb_cQueue, "clear", rb_queue_clear, 0);
- rb_define_method(rb_cQueue, "length", rb_queue_length, 0);
- rb_define_method(rb_cQueue, "num_waiting", rb_queue_num_waiting, 0);
-
- /* Alias for #push. */
- rb_define_alias(rb_cQueue, "enq", "push");
- /* Alias for #push. */
- rb_define_alias(rb_cQueue, "<<", "push");
- /* Alias for #pop. */
- rb_define_alias(rb_cQueue, "deq", "pop");
- /* Alias for #pop. */
- rb_define_alias(rb_cQueue, "shift", "pop");
- /* Alias for #length. */
- rb_define_alias(rb_cQueue, "size", "length");
-
- rb_define_method(rb_cSizedQueue, "initialize", rb_szqueue_initialize, 1);
- rb_define_method(rb_cSizedQueue, "max", rb_szqueue_max_get, 0);
- rb_define_method(rb_cSizedQueue, "max=", rb_szqueue_max_set, 1);
- rb_define_method(rb_cSizedQueue, "push", rb_szqueue_push, 1);
- rb_define_method(rb_cSizedQueue, "pop", rb_szqueue_pop, -1);
- rb_define_method(rb_cSizedQueue, "num_waiting", rb_szqueue_num_waiting, 0);
-
- /* Alias for #push. */
- rb_define_alias(rb_cSizedQueue, "enq", "push");
- /* Alias for #push. */
- rb_define_alias(rb_cSizedQueue, "<<", "push");
- /* Alias for #pop. */
- rb_define_alias(rb_cSizedQueue, "deq", "pop");
- /* Alias for #pop. */
- rb_define_alias(rb_cSizedQueue, "shift", "pop");
-
- rb_provide("thread.rb");
- ALIAS_GLOBAL_CONST(ConditionVariable);
- ALIAS_GLOBAL_CONST(Queue);
- ALIAS_GLOBAL_CONST(SizedQueue);
}
diff --git a/ext/tk/MANUAL_tcltklib.eng b/ext/tk/MANUAL_tcltklib.eng
index 957e8ec840..bd124f7620 100644
--- a/ext/tk/MANUAL_tcltklib.eng
+++ b/ext/tk/MANUAL_tcltklib.eng
@@ -1,7 +1,7 @@
(tof)
2005/07/05 Hidetoshi NAGAI
-This document discribes about the 'tcltklib' library. Although there
+This document describes about the 'tcltklib' library. Although there
is the 'tcltk' library (tcltk.rb) under this directory, no description
in this document (because it is not maintained recently).
@@ -171,7 +171,7 @@ module TclTklib
: a target event.
: If set DONT_WAIT flag and no event for processing, returns
: false immediately.
- : If $SAFE >= 4, or $SAFE >= 1 and the flag is tainted,
+ : If $SAFE >= 1 and the flag is tainted,
: force to set DONT_WAIT flag.
set_eventloop_tick(timer_tick)
@@ -183,7 +183,6 @@ module TclTklib
: However, if the eventloop thread is the only thread,
: timer_tick cannot be set to 0. If 0, then is set to 100 ms
: automatically (see NO_THREAD_INTERRUPT_TIME on tcltklib.c).
- : On $SAFE >= 4, cannot call this method.
get_eventloop_tick
: Get current value of 'timer_tick'
@@ -194,7 +193,6 @@ module TclTklib
: Default value is 20 (ms).
: If the eventloop thread is the only thread, this value is
: invalid.
- : On $SAFE >= 4, cannot call this method.
get_no_event_wait
: Get current value of 'no_event_wait'.
@@ -207,7 +205,6 @@ module TclTklib
: when no event for processing (And then, the eventloop thread
: sleeps 'no_event_wait' mili-seconds).
: 'loop_max == 800' and 'no_event_tick == 10' are default.
- : On $SAFE >= 4, cannot call this method.
get_eventloop_weight
: Get current values of 'loop_max' and 'no_event_tick'.
@@ -215,7 +212,7 @@ module TclTklib
mainloop_abort_on_exception=(bool)
: Define whether the eventloop stops on exception or not.
: If true (default value), stops on exception.
- : If false, show a waring message but ignore the exception.
+ : If false, show a warning message but ignore the exception.
: If nil, no warning message and ignore the exception.
: This parameter is sometimes useful when multiple Tk
: interpreters are working. Because the only one eventloop
@@ -223,7 +220,6 @@ module TclTklib
: interpreter kills the eventloop thread. Even if such
: situation, when abort_on_exception == false or nil,
: the eventloop ignores the exception and continue to working.
- : On $SAFE >= 4, cannot call this method.
mainloop_abort_on_exception
: Get current status of that.
@@ -294,7 +290,6 @@ class TclTkIp
: interpreter. Default is false. However, if the parent
: interpreter is a safe interpreter, the created interpreter is
: a safe interpreter (ignore 'safe' argument value).
- : If $SAFE >= 4, can create a safe interpreter only.
make_safe
: Make the interpreter to the safe interpreter, and returns
@@ -314,7 +309,7 @@ class TclTkIp
allow_ruby_exit=(mode)
: Change the mode of 'allow_ruby_exit?'.
- : If $SAFE >= 4 or the interpreter is a "safe" interpreter,
+ : If the interpreter is a "safe" interpreter,
: this is not permitted (raise an exception).
delete
@@ -335,7 +330,6 @@ class TclTkIp
: Restart Tk part of the interpreter.
: Use this when you need Tk functions after destroying the
: root widget.
- : On $SAFE >= 4, cannot call this method.
_eval(str)
_invoke(*args)
diff --git a/ext/tk/MANUAL_tcltklib.ja b/ext/tk/MANUAL_tcltklib.ja
index 1de1736f9f..8641909517 100644
--- a/ext/tk/MANUAL_tcltklib.ja
+++ b/ext/tk/MANUAL_tcltklib.ja
@@ -272,7 +272,7 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
: 象ã¨ãªã£ã¦ã„る種類ã®ã‚¤ãƒ™ãƒ³ãƒˆãŒç™ºç”Ÿã™ã‚‹ã¾ã§å¾…ã¡ç¶šã‘る.
: DONT_WAIT を指定ã—ã¦ã„ãŸå ´åˆï¼Œå‡¦ç†å¯¾è±¡ã‚¤ãƒ™ãƒ³ãƒˆãŒãªãã¦ã‚‚
: ã™ãã«çµ‚了㗠false ã‚’è¿”ã™ï¼Ž
- : $SAFE >= 4 ã‹ï¼Œ$SAFE >= 1 ã‹ã¤ flag ãŒæ±šæŸ“ã•れã¦ã„ã‚‹ãªã‚‰ã°
+ : $SAFE >= 1 ã‹ã¤ flag ãŒæ±šæŸ“ã•れã¦ã„ã‚‹ãªã‚‰ã°
: flag ã«ã¯ DONT_WAIT ãŒå¼·åˆ¶çš„ã«ä»˜ã‘られる.
set_eventloop_tick(timer_tick)
@@ -288,7 +288,6 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
: 定ã•れる.
: 詳細ãªèª¬æ˜Žã¯ç•¥ã™ãŒï¼Œã“れ㯠CPU パワーを節約ã—ã¤ã¤å®‰å…¨ã§
: 安定ã—ãŸå‹•作を実ç¾ã™ã‚‹ãŸã‚ã«å®Ÿè£…ã—ãŸä»•様ã§ã‚る.
- : $SAFE >= 4 ã§ã¯å®Ÿè¡ŒãŒç¦æ­¢ã•れる.
get_eventloop_tick
: timer_tick ã®ç¾åœ¨å€¤ã‚’è¿”ã™ï¼Ž
@@ -298,7 +297,6 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
: ã存在ã—ãªã‹ã£ãŸéš›ã« sleep 状態ã«å…¥ã‚‹æ™‚間長を指定ã™ã‚‹ï¼Ž
: 稼åƒã‚¹ãƒ¬ãƒƒãƒ‰ãŒã‚¤ãƒ™ãƒ³ãƒˆãƒ«ãƒ¼ãƒ—ã ã‘ã®å ´åˆã«ã¯æ„味をãªã•ãªã„.
: デフォルトã®å€¤ã¯ 20 (ms)
- : $SAFE >= 4 ã§ã¯å®Ÿè¡ŒãŒç¦æ­¢ã•れる.
get_no_event_wait
: no_event_wait ã®ç¾åœ¨å€¤ã‚’è¿”ã™ï¼Ž
@@ -316,7 +314,6 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
: ãŒå…¨ã発生ã—ãªã„ã¾ã¾ã« 80 回ã®å‡¦ç†å¾…ã¡ã‚¤ãƒ™ãƒ³ãƒˆæ¤œæŸ»ãŒå®Œäº†
: ã™ã‚‹ã¨ã‹ã§ã‚«ã‚¦ãƒ³ãƒˆãŒ 800 以上ã«ãªã‚‹ã¨ã‚¹ãƒ¬ãƒƒãƒ‰ã‚¹ã‚¤ãƒƒãƒãƒ³ã‚°
: ãŒç™ºç”Ÿã™ã‚‹ã“ã¨ã«ãªã‚‹ï¼Ž
- : $SAFE >= 4 ã§ã¯å®Ÿè¡ŒãŒç¦æ­¢ã•れる.
get_eventloop_weight
: ç¾åœ¨ã® loop_max 㨠no_event_tick ã¨ã®å€¤ã‚’è¿”ã™ï¼Ž
@@ -336,7 +333,6 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
: ä»–ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã®å‡¦ç†ç¶™ç¶šãŒä¸å¯èƒ½ã«ãªã‚‹ã“ã¨ãŒã‚る.ãã®
: よã†ãªå ´åˆã§ã‚‚エラーを無視ã—ã¦ã‚¤ãƒ™ãƒ³ãƒˆãƒ«ãƒ¼ãƒ—ãŒç¨¼åƒã‚’ç¶šã‘ã‚‹
: ã“ã¨ã§ï¼Œä»–ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—ãƒªã‚¿ãŒæ­£å¸¸ã«å‹•作ã—ç¶šã‘ã‚‹ã“ã¨ãŒã§ãる.
- : $SAFE >= 4 ã§ã¯å®Ÿè¡ŒãŒç¦æ­¢ã•れる.
mainloop_abort_on_exception
: Tk インタープリタ上ã§ä¾‹å¤–を発生ã—ãŸéš›ã«ï¼Œã‚¤ãƒ™ãƒ³ãƒˆãƒ«ãƒ¼ãƒ—をエ
@@ -404,7 +400,6 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
: ãŸã¨ãˆæ˜Žç¢ºã« false を指定ã—ã¦ã„ãŸã¨ã—ã¦ã‚‚,親ã¨ãªã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼
: プリタ㌠safe インタープリタã§ã‚れã°ï¼Œãã®è¨­å®šã‚’引ãç¶™ã„ã§
: safe インタープリタã¨ã—ã¦ç”Ÿæˆã•れる.
- : $SAFE >= 4 ã§ã¯ï¼Œsafe インタープリタ以外ã®ç”ŸæˆãŒç¦æ­¢ã•れる.
make_safe
: Tcl/Tk インタープリタを safe インタープリタã«å¤‰æ›´ã™ã‚‹ï¼Ž
@@ -425,8 +420,8 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
allow_ruby_exit=(mode)
: 対象ã¨ãªã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタ㮠allow_ruby_exit? ã®çŠ¶æ…‹ã‚’å¤‰æ›´ã™ã‚‹ï¼Ž
- : $SAFE >= 4 ã¾ãŸã¯ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタ㌠safe インタープリタã®å ´åˆã¯
- : 変更ãŒè¨±ã•れãªã„ (例外を発生).
+ : インタープリタ㌠safe インタープリタã®å ´åˆã¯å¤‰æ›´ãŒè¨±ã•れãªã„
+ : (例外を発生).
delete
: Tcl/Tk インタープリタを delete ã™ã‚‹ï¼Ž
@@ -447,7 +442,6 @@ require "tcltklib" ã™ã‚‹ã¨, 以下ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«, クラスãŒåˆ©ç”¨å¯èƒ½
: Tcl/Tk インタープリタ㮠Tk 部分ã®åˆæœŸåŒ–,å†èµ·å‹•を行ã†ï¼Ž
: 一旦 root widget を破壊ã—ãŸå¾Œã«å†åº¦ Tk ã®æ©Ÿèƒ½ãŒå¿…è¦ã¨
: ãªã£ãŸå ´åˆã«ç”¨ã„る.
- : $SAFE >= 4 ã§ã¯å®Ÿè¡ŒãŒç¦æ­¢ã•れる.
_eval(str)
_invoke(*args)
diff --git a/ext/tk/README.macosx-aqua b/ext/tk/README.macosx-aqua
index 15630727ec..52edf4dcbf 100644
--- a/ext/tk/README.macosx-aqua
+++ b/ext/tk/README.macosx-aqua
@@ -3,7 +3,7 @@
First of all, please read README.tcltklib to use Tcl/Tk Aqua Framework.
-With Tcl/Tk Aqua libraries, current tcltklib somtimes freezes when
+With Tcl/Tk Aqua libraries, current tcltklib sometimes freezes when
using Aqua specific dialogs (e.g. Tk.messageBox).
This is a known bug of Ruby-1.8.4 release.
diff --git a/ext/tk/README.tcltklib b/ext/tk/README.tcltklib
index 1367189690..da343a4f3e 100644
--- a/ext/tk/README.tcltklib
+++ b/ext/tk/README.tcltklib
@@ -30,7 +30,7 @@ some or all of the following options.
--with-tcltkversion=<version>
--with-tcltkversion=<tclversion>,<tkversion>
- force version of Tcl/Tk libaray
+ force version of Tcl/Tk library
(e.g. libtcl8.4g.so & libtk8.4g.so ==> --with-tcltkversion=8.4g
libtcl8.4.so & libtk8.4g.so ==> --with-tcltkversion=8.4,8.4g)
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 6e2ddb79e6..c4ea4067bd 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
##############################################################
# extconf.rb for tcltklib
# release date: 2010-07-30
@@ -9,10 +10,10 @@ TkLib_Config['search_versions'] =
# %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2]
# %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0]
# %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps
- %w[8.5 8.4] # At present, Tcl/Tk8.6 is not supported.
+ %w[8.6 8.5 8.4]
TkLib_Config['unsupported_versions'] =
- %w[8.8 8.7 8.6] # At present, Tcl/Tk8.6 is not supported.
+ %w[8.8 8.7]
TkLib_Config['major_nums'] = '87'
@@ -623,7 +624,7 @@ def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf)
$INCFLAGS << " -I" << File.join(File.dirname(File.dirname(file)),"include") if is_win32?
else
tcllibs = append_library($libs, libname)
- tcllibs = "-L#{tcldir.quote} -Wl,-R#{tcldir.quote} " + tcllibs
+ tcllibs = "#{libpathflag([tcldir])} #{tcllibs}"
# FIX ME: avoid pathname trouble (fail to find) on MinGW.
$INCFLAGS << " -I" << File.join(File.dirname(tcldir),"include") if is_win32?
@@ -665,7 +666,7 @@ def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf)
else
tklibs = append_library("", libname)
#tklibs = append_library("", $1)
- tklibs = "-L#{tkdir.quote} -Wl,-R#{tkdir.quote} " + tklibs
+ tklibs = "#{libpathflag([tkdir])} #{tklibs}"
# FIX ME: avoid pathname trouble (fail to find) on MinGW.
$INCFLAGS << " -I" << File.join(File.dirname(tcldir),"include") if is_win32?
@@ -1137,7 +1138,7 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
if tcllib
print(".")
if have_library(tcllib, func, ["tcl.h"])
- return [true, path, lib_w_sufx, nil, *inc]
+ return [true, path, tcllib, nil, *inc]
end
else
sufx_list = ['', 't', 'g', 's', 'x']
@@ -1161,7 +1162,7 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
tcllibs = libs_param + " -DSTATIC_BUILD " + fname.quote
else
tcllibs = append_library($libs, lib_w_sufx)
- tcllibs = "-L#{path.quote} -Wl,-R#{path.quote} " + tcllibs
+ tcllibs = "#{libpathflag([path])} #{tcllibs}"
end
if try_func(func, tcllibs, ["tcl.h"])
return [true, path, nil, tcllibs, *inc]
@@ -1277,7 +1278,7 @@ def find_tk(tklib, stubs, version, *opt_paths)
if tklib
print(".")
if have_library(tklib, func, ["tcl.h", "tk.h"])
- return [true, path, lib_w_sufx, nil, *inc]
+ return [true, path, tklib, nil, *inc]
end
else
sufx_list = ['', 't', 'g', 's', 'x']
@@ -1300,7 +1301,7 @@ def find_tk(tklib, stubs, version, *opt_paths)
tklibs = libs_param + " -DSTATIC_BUILD " + fname.quote
else
tklibs = append_library($libs, lib_w_sufx)
- tklibs = "-L#{path.quote} -Wl,-R#{path.quote} " + tklibs
+ tklibs = "#{libpathflag([path])} #{tklibs}"
end
if try_func(func, tklibs, ["tcl.h", "tk.h"])
return [true, path, nil, tklibs, *inc]
@@ -1646,7 +1647,7 @@ def pthread_check()
if TclConfig_Info['config_file_path']
if tcl_enable_thread == true
- puts("Warning: definiton of tclConfig.sh is ignored, because --enable-tcl-thread option is given.")
+ puts("Warning: definition of tclConfig.sh is ignored, because --enable-tcl-thread option is given.")
elsif tcl_enable_thread == false
puts("Warning: definition of tclConfig.sh is ignored, because --disable-tcl-thread option is given.")
else
@@ -1795,7 +1796,9 @@ print("check functions.")
%w"ruby_native_thread_p rb_errinfo rb_safe_level rb_hash_lookup
rb_proc_new rb_obj_untrust rb_obj_taint rb_set_safe_level_force
- rb_sourcefile rb_thread_alive_p rb_thread_check_trap_pending".each do |func|
+ rb_sourcefile rb_thread_alive_p rb_thread_check_trap_pending
+ ruby_enc_find_basename
+".each do |func|
have_func(func, "ruby.h")
print(".") # progress
end
@@ -2003,7 +2006,7 @@ $defs += collect_tcltk_defs(TclConfig_Info['TCL_DEFS'], TkConfig_Info['TK_DEFS']
# MacOS X Frameworks?
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"]
+ ($LDFLAGS ||= "") << " " << libpathflag([TkLib_Config["tcl-build-dir"]]) if TkLib_Config["tcl-build-dir"]
libs = ''
if tcl_cfg_dir
@@ -2029,7 +2032,7 @@ if TkLib_Config["tcltk-framework"]
end
end
- libs << " -L#{TkLib_Config["tk-build-dir"].quote} -Wl,-R#{TkLib_Config["tk-build-dir"].quote}" if TkLib_Config["tk-build-dir"]
+ libs << " " << libpathflag([TkLib_Config["tk-build-dir"]]) if TkLib_Config["tk-build-dir"]
if tk_cfg_dir
TkConfig_Info['TK_LIBS'] ||= ""
diff --git a/ext/tk/lib/README b/ext/tk/lib/README
index c076755756..df1c7906ea 100644
--- a/ext/tk/lib/README
+++ b/ext/tk/lib/README
@@ -23,7 +23,7 @@ tkfont.rb Tk font support
tkmacpkg.rb Mac resource support
tkmenubar.rb TK menubar utility
tkmngfocus.rb focus manager
-tkpalette.rb pallete support
+tkpalette.rb palette support
tkscrollbox.rb scroll box, also example of compound widget
tktext.rb text classes
tkvirtevent.rb virtual event support
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index 68bd849670..a5759c70cc 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# multi-tk.rb - supports multi Tk interpreters
# by Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -148,7 +149,7 @@ class MultiTkIp
end
def delete(idx, &blk)
- # if gets an entry, is permited to delete
+ # if gets an entry, is permitted to delete
if self[idx]
@tbl.delete(idx)
elsif blk
@@ -1265,14 +1266,6 @@ class MultiTkIp
######################################
def initialize(master, safeip=true, keys={})
- if $SAFE >= 4
- fail SecurityError, "cannot create a new interpreter at level #{$SAFE}"
- end
-
- if safeip == nil && $SAFE >= 2
- fail SecurityError, "cannot create a master-ip at level #{$SAFE}"
- end
-
if master.deleted? && safeip == nil
fail RuntimeError, "cannot create a slave of a deleted interpreter"
end
@@ -1307,7 +1300,7 @@ class MultiTkIp
name, safe, safe_opts, tk_opts = _parse_slaveopts(keys)
- safe = 4 if safe && !safe.kind_of?(Fixnum)
+ safe = 1 if safe && !safe.kind_of?(Fixnum)
@safe_base = false
@@ -1423,7 +1416,7 @@ class MultiTkIp
safe = master.safe_level if safe < master.safe_level
@safe_level = [safe]
else
- @safe_level = [4]
+ @safe_level = [1]
end
else
@interp, @ip_name = master.__create_trusted_slave_obj(name, tk_opts)
@@ -1490,17 +1483,17 @@ class MultiTkIp
begin
@interp._eval("::safe::disallowTk #{slave}")
rescue
- warn("Waring: fail to call '::safe::disallowTk'") if $DEBUG
+ warn("Warning: fail to call '::safe::disallowTk'") if $DEBUG
end
else # toplevel path
begin
@interp._eval("::safe::tkDelete {} #{top} #{slave}")
rescue
- warn("Waring: fail to call '::safe::tkDelete'") if $DEBUG
+ warn("Warning: fail to call '::safe::tkDelete'") if $DEBUG
begin
@interp._eval("destroy #{top}")
rescue
- warn("Waring: fail to destroy toplevel") if $DEBUG
+ warn("Warning: fail to destroy toplevel") if $DEBUG
end
end
end
@@ -1615,7 +1608,7 @@ class << MultiTkIp
end
alias new_trusted_slave new_slave
- def new_safe_slave(safe=4, keys={}, &blk)
+ def new_safe_slave(safe=1, keys={}, &blk)
if safe.kind_of?(Hash)
keys = safe
elsif safe.kind_of?(Integer)
@@ -2475,7 +2468,7 @@ end
# event loop
-# all master/slave IPs are controled by only one event-loop
+# all master/slave IPs are controlled by only one event-loop
class MultiTkIp
def self.default_master?
__getip == @@DEFAULT_MASTER
@@ -2754,13 +2747,9 @@ class MultiTkIp
if @wait_on_mainloop[0]
begin
@wait_on_mainloop[1] += 1
- if $SAFE >= 4
- _receiver_mainloop(check_root).join
- else
- @cmd_queue.enq([@system, 'call_mainloop',
- Thread.current, check_root])
- Thread.stop
- end
+ @cmd_queue.enq([@system, 'call_mainloop',
+ Thread.current, check_root])
+ Thread.stop
rescue MultiTkIp_OK => ret
# return value
if ret.value.kind_of?(Thread)
diff --git a/ext/tk/lib/remote-tk.rb b/ext/tk/lib/remote-tk.rb
index 443d66010c..165e6587fd 100644
--- a/ext/tk/lib/remote-tk.rb
+++ b/ext/tk/lib/remote-tk.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# remote-tk.rb - supports to control remote Tk interpreters
# by Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -61,10 +62,6 @@ end
class RemoteTkIp
def initialize(remote_ip, displayof=nil, timeout=5)
- if $SAFE >= 4
- fail SecurityError, "cannot access another interpreter at level #{$SAFE}"
- end
-
@interp = MultiTkIp.__getip
if @interp.safe?
fail SecurityError, "safe-IP cannot create RemoteTkIp"
@@ -199,9 +196,7 @@ class RemoteTkIp
raise SecurityError, "no permission to manipulate" unless self.manipulable?
p ['_appsend', [@remote, @displayof], enc_mode, async, cmds] if $DEBUG
- if $SAFE >= 4
- fail SecurityError, "cannot send commands at level 4"
- elsif $SAFE >= 1 && cmds.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && cmds.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted commands at level #{$SAFE}"
end
diff --git a/ext/tk/lib/tcltk.rb b/ext/tk/lib/tcltk.rb
index 48ec1df09a..7796bb86ef 100644
--- a/ext/tk/lib/tcltk.rb
+++ b/ext/tk/lib/tcltk.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# tof
#### tcltk library, more direct manipulation of tcl/tk
@@ -325,7 +326,7 @@ class TclTkCallback < TclTkObject
TclTk._addcallback(self)
end
- # to_eval(): retuens string representation for @ip._eval_args
+ # to_eval(): returns string representation for @ip._eval_args
def to_eval()
if @arg
# bind replaces %s before calling ruby_fmt, so %%s is used
@@ -349,7 +350,7 @@ class TclTkImage < TclTkCommand
# initialize(interp, t, *args):
# generating image is done by TclTkImage.new()
- # destrying is done by image delete (inconsistent, sigh)
+ # destroying is done by image delete (inconsistent, sigh)
# interp: interpreter(TclTkInterpreter)
# t: image type (photo, bitmap, etc.)
# *args: command argument
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 5bac92e47c..7fe2fb0878 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk.rb - Tk interface module using tcltklib
# by Yukihiro Matsumoto <matz@netlab.jp>
@@ -1309,8 +1310,12 @@ EOS
end
unless interp.deleted?
- #Thread.current[:status].value = TclTkLib.mainloop(false)
- Thread.current[:status].value = interp.mainloop(false)
+ begin
+ #Thread.current[:status].value = TclTkLib.mainloop(false)
+ Thread.current[:status].value = interp.mainloop(false)
+ rescue Exception=>e
+ puts "ignore exception on interp: #{e.inspect}\n" if $DEBUG
+ end
end
ensure
@@ -1569,7 +1574,15 @@ EOS
EOL
=end
- at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
+ if !WITH_RUBY_VM || RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
+ at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
+ else
+ at_exit{
+ Tk.root.destroy
+ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME)
+ INTERP_THREAD.kill.join
+ }
+ end
EventFlag = TclTkLib::EventFlag
@@ -1773,9 +1786,7 @@ EOS
end
def appsend(interp, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Tk commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Tk commands at level #{$SAFE}"
end
if async != true && async != false && async != nil
@@ -1790,9 +1801,7 @@ EOS
end
def rb_appsend(interp, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Ruby commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Ruby commands at level #{$SAFE}"
end
if async != true && async != false && async != nil
@@ -1808,9 +1817,7 @@ EOS
end
def appsend_displayof(interp, win, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Tk commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Tk commands at level #{$SAFE}"
end
win = '.' if win == nil
@@ -1826,9 +1833,7 @@ EOS
end
def rb_appsend_displayof(interp, win, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Ruby commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Ruby commands at level #{$SAFE}"
end
win = '.' if win == nil
@@ -1887,7 +1892,7 @@ EOS
INTERP_ROOT_CHECK.wait(INTERP_MUTEX)
status = INTERP_THREAD_STATUS.value
if status && TkCore::INTERP.default_master?
- INTERP_THREAD_STATUS.value = nil if $SAFE < 4
+ INTERP_THREAD_STATUS.value = nil
raise status if status.kind_of?(Exception)
end
}
@@ -2197,9 +2202,6 @@ module Tk
# tk_split_simplelist(INTERP._invoke('set', 'tcl_libPath'))
when :PLATFORM, :TCL_PLATFORM
- if $SAFE >= 4
- fail SecurityError, "can't get #{sym} when $SAFE >= 4"
- end
INTERP._invoke_without_enc('global', 'tcl_platform')
Hash[*tk_split_simplelist(INTERP._invoke_without_enc('array', 'get',
'tcl_platform'))]
@@ -3734,7 +3736,6 @@ module TkConfigMethod
@mode || false
end
def TkConfigMethod.__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode)
- fail SecurityError, "can't change the mode" if $SAFE>=4
@mode = (mode)? true: false
end
@@ -5197,6 +5198,8 @@ class TkWindow<TkObject
TkWinfo.exist?(self)
end
+ alias subcommand tk_send
+
def bind_class
@db_class || self.class()
end
@@ -5636,9 +5639,6 @@ class TkWindow<TkObject
end
def wait_visibility(on_thread = true)
- if $SAFE >= 4
- fail SecurityError, "can't wait visibility at $SAFE >= 4"
- end
on_thread &= (Thread.list.size != 1)
if on_thread
INTERP._thread_tkwait('visibility', path)
@@ -5662,9 +5662,6 @@ class TkWindow<TkObject
alias thread_tkwait_visibility thread_wait_visibility
def wait_destroy(on_thread = true)
- if $SAFE >= 4
- fail SecurityError, "can't wait destroy at $SAFE >= 4"
- end
on_thread &= (Thread.list.size != 1)
if on_thread
INTERP._thread_tkwait('window', epath)
@@ -5742,7 +5739,7 @@ TkWidget = TkWindow
#Tk.freeze
module Tk
- RELEASE_DATE = '2010-06-03'.freeze
+ RELEASE_DATE = '2014-10-19'.freeze
autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'
diff --git a/ext/tk/lib/tk/after.rb b/ext/tk/lib/tk/after.rb
index 8c58210331..3213a6b818 100644
--- a/ext/tk/lib/tk/after.rb
+++ b/ext/tk/lib/tk/after.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/after.rb : methods for Tcl/Tk after command
#
diff --git a/ext/tk/lib/tk/autoload.rb b/ext/tk/lib/tk/autoload.rb
index f6ca261da9..3d19fb053d 100644
--- a/ext/tk/lib/tk/autoload.rb
+++ b/ext/tk/lib/tk/autoload.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# autoload
#
@@ -94,6 +95,8 @@ module Tk
autoload :Y_Scrollable, 'tk/scrollable'
autoload :Scrollable, 'tk/scrollable'
+ autoload :Fontchooser, 'tk/fontchooser'
+
autoload :Wm, 'tk/wm'
autoload :Wm_for_General, 'tk/wm'
diff --git a/ext/tk/lib/tk/bgerror.rb b/ext/tk/lib/tk/bgerror.rb
index c82a8e046b..9d2f59357e 100644
--- a/ext/tk/lib/tk/bgerror.rb
+++ b/ext/tk/lib/tk/bgerror.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkbgerror -- bgerror ( tkerror ) module
# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/bindtag.rb b/ext/tk/lib/tk/bindtag.rb
index 23b4e0b7c3..ad3c90b505 100644
--- a/ext/tk/lib/tk/bindtag.rb
+++ b/ext/tk/lib/tk/bindtag.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/bind.rb : control event binding
#
diff --git a/ext/tk/lib/tk/busy.rb b/ext/tk/lib/tk/busy.rb
index 7f4f89f524..18ebede9dd 100644
--- a/ext/tk/lib/tk/busy.rb
+++ b/ext/tk/lib/tk/busy.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/busy.rb: support 'tk busy' command (Tcl/Tk8.6 or later)
#
diff --git a/ext/tk/lib/tk/button.rb b/ext/tk/lib/tk/button.rb
index 65233c91b6..dc252d8e82 100644
--- a/ext/tk/lib/tk/button.rb
+++ b/ext/tk/lib/tk/button.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/button.rb : treat button widget
#
diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb
index f3e9a7c229..d707733d8c 100644
--- a/ext/tk/lib/tk/canvas.rb
+++ b/ext/tk/lib/tk/canvas.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/canvas.rb - Tk canvas classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
diff --git a/ext/tk/lib/tk/canvastag.rb b/ext/tk/lib/tk/canvastag.rb
index 495d92a9a8..4a14cd78a9 100644
--- a/ext/tk/lib/tk/canvastag.rb
+++ b/ext/tk/lib/tk/canvastag.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/canvastag.rb - methods for treating canvas tags
#
diff --git a/ext/tk/lib/tk/checkbutton.rb b/ext/tk/lib/tk/checkbutton.rb
index b7449541c5..521b015b3e 100644
--- a/ext/tk/lib/tk/checkbutton.rb
+++ b/ext/tk/lib/tk/checkbutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/checkbutton.rb : treat checkbutton widget
#
diff --git a/ext/tk/lib/tk/clipboard.rb b/ext/tk/lib/tk/clipboard.rb
index d4205a5c28..c5f481f979 100644
--- a/ext/tk/lib/tk/clipboard.rb
+++ b/ext/tk/lib/tk/clipboard.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/clipboard.rb : methods to treat clipboard
#
diff --git a/ext/tk/lib/tk/clock.rb b/ext/tk/lib/tk/clock.rb
index 4e9438f5ab..df900d7364 100644
--- a/ext/tk/lib/tk/clock.rb
+++ b/ext/tk/lib/tk/clock.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/clock.rb : methods for clock command
#
diff --git a/ext/tk/lib/tk/composite.rb b/ext/tk/lib/tk/composite.rb
index e267c7a22b..830d383d69 100644
--- a/ext/tk/lib/tk/composite.rb
+++ b/ext/tk/lib/tk/composite.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/composite.rb :
#
diff --git a/ext/tk/lib/tk/console.rb b/ext/tk/lib/tk/console.rb
index 64e257594c..c560912da8 100644
--- a/ext/tk/lib/tk/console.rb
+++ b/ext/tk/lib/tk/console.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/console.rb : control the console on system without a real console
#
diff --git a/ext/tk/lib/tk/dialog.rb b/ext/tk/lib/tk/dialog.rb
index 7ef7820699..0b19be7cfa 100644
--- a/ext/tk/lib/tk/dialog.rb
+++ b/ext/tk/lib/tk/dialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/dialog.rb : create dialog boxes
#
diff --git a/ext/tk/lib/tk/encodedstr.rb b/ext/tk/lib/tk/encodedstr.rb
index 59fbb1911d..9ca13b3d1a 100644
--- a/ext/tk/lib/tk/encodedstr.rb
+++ b/ext/tk/lib/tk/encodedstr.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/encodedstr.rb : Tk::EncodedString class
#
diff --git a/ext/tk/lib/tk/entry.rb b/ext/tk/lib/tk/entry.rb
index d4aa03f2b6..aa40e4755c 100644
--- a/ext/tk/lib/tk/entry.rb
+++ b/ext/tk/lib/tk/entry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/entry.rb - Tk entry classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb
index bf4e122322..5658e92874 100644
--- a/ext/tk/lib/tk/event.rb
+++ b/ext/tk/lib/tk/event.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/event.rb - module for event
#
diff --git a/ext/tk/lib/tk/font.rb b/ext/tk/lib/tk/font.rb
index 03db850f96..7a2a549849 100644
--- a/ext/tk/lib/tk/font.rb
+++ b/ext/tk/lib/tk/font.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/font.rb - the class to treat fonts on Ruby/Tk
#
diff --git a/ext/tk/lib/tk/fontchooser.rb b/ext/tk/lib/tk/fontchooser.rb
index 694c58a607..325ca4dbd2 100644
--- a/ext/tk/lib/tk/fontchooser.rb
+++ b/ext/tk/lib/tk/fontchooser.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/fontchooser.rb -- "tk fontchooser" support (Tcl/Tk8.6 or later)
#
@@ -8,6 +9,10 @@ module TkFont::Chooser
extend TkCore
end
+module Tk
+ Fontchooser = TkFont::Chooser
+end
+
class << TkFont::Chooser
def method_missing(id, *args)
name = id.id2name
@@ -47,7 +52,7 @@ class << TkFont::Chooser
tk_tcl2ruby(val)
when 'visible'
bool(val)
- else # unkown
+ else # unknown
val
end
end
diff --git a/ext/tk/lib/tk/frame.rb b/ext/tk/lib/tk/frame.rb
index 5118939732..0682faf3fe 100644
--- a/ext/tk/lib/tk/frame.rb
+++ b/ext/tk/lib/tk/frame.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/frame.rb : treat frame widget
#
diff --git a/ext/tk/lib/tk/grid.rb b/ext/tk/lib/tk/grid.rb
index e1e07c44fa..5a4a26403a 100644
--- a/ext/tk/lib/tk/grid.rb
+++ b/ext/tk/lib/tk/grid.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/grid.rb : control grid geometry manager
#
diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb
index 972383982f..ec23e495d0 100644
--- a/ext/tk/lib/tk/image.rb
+++ b/ext/tk/lib/tk/image.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/image.rb : treat Tk image objects
#
diff --git a/ext/tk/lib/tk/itemconfig.rb b/ext/tk/lib/tk/itemconfig.rb
index 14396048ba..e615fa0950 100644
--- a/ext/tk/lib/tk/itemconfig.rb
+++ b/ext/tk/lib/tk/itemconfig.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/itemconfig.rb : control item/tag configuration of widget
#
@@ -124,7 +125,6 @@ module TkItemConfigMethod
@mode || false
end
def TkItemConfigMethod.__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode)
- fail SecurityError, "can't change the mode" if $SAFE>=4
@mode = (mode)? true: false
end
diff --git a/ext/tk/lib/tk/itemfont.rb b/ext/tk/lib/tk/itemfont.rb
index b5da4fa1ef..92f75ac388 100644
--- a/ext/tk/lib/tk/itemfont.rb
+++ b/ext/tk/lib/tk/itemfont.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/itemfont.rb : control font of widget items
#
diff --git a/ext/tk/lib/tk/kinput.rb b/ext/tk/lib/tk/kinput.rb
index b63f756def..6d2b3d7a7a 100644
--- a/ext/tk/lib/tk/kinput.rb
+++ b/ext/tk/lib/tk/kinput.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/kinput.rb : control kinput
#
diff --git a/ext/tk/lib/tk/label.rb b/ext/tk/lib/tk/label.rb
index 05e430e49b..48f67deb31 100644
--- a/ext/tk/lib/tk/label.rb
+++ b/ext/tk/lib/tk/label.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/label.rb : treat label widget
#
diff --git a/ext/tk/lib/tk/labelframe.rb b/ext/tk/lib/tk/labelframe.rb
index 6f679e55b5..f9497dc2f0 100644
--- a/ext/tk/lib/tk/labelframe.rb
+++ b/ext/tk/lib/tk/labelframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/labelframe.rb : treat labelframe widget
#
diff --git a/ext/tk/lib/tk/listbox.rb b/ext/tk/lib/tk/listbox.rb
index 6742b2132c..df4d422007 100644
--- a/ext/tk/lib/tk/listbox.rb
+++ b/ext/tk/lib/tk/listbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/listbox.rb : treat listbox widget
#
diff --git a/ext/tk/lib/tk/macpkg.rb b/ext/tk/lib/tk/macpkg.rb
index 3ca7953c13..abf9b176fb 100644
--- a/ext/tk/lib/tk/macpkg.rb
+++ b/ext/tk/lib/tk/macpkg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/macpkg.rb : methods for Tcl/Tk packages for Macintosh
# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb
index bcd250026d..16347a98ea 100644
--- a/ext/tk/lib/tk/menu.rb
+++ b/ext/tk/lib/tk/menu.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/menu.rb : treat menu and menubutton
#
diff --git a/ext/tk/lib/tk/menubar.rb b/ext/tk/lib/tk/menubar.rb
index 9d5571c470..6c5df6b1c2 100644
--- a/ext/tk/lib/tk/menubar.rb
+++ b/ext/tk/lib/tk/menubar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/menubar.rb
#
@@ -76,7 +77,7 @@
# 'tearoff'=>false,
# 'foreground'=>'grey40',
# 'activeforeground'=>'red',
-# 'font'=>'Helvetia 12 bold')
+# 'font'=>'Helvetica 12 bold')
# menubar.pack('side'=>'top', 'fill'=>'x')
# See tk/menuspce.rb about the format of the menu_spec
diff --git a/ext/tk/lib/tk/menuspec.rb b/ext/tk/lib/tk/menuspec.rb
index cb3597eec9..2de62242ff 100644
--- a/ext/tk/lib/tk/menuspec.rb
+++ b/ext/tk/lib/tk/menuspec.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/menuspec.rb
# Hidethoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tk/message.rb b/ext/tk/lib/tk/message.rb
index 5f73b3066f..432e9667bd 100644
--- a/ext/tk/lib/tk/message.rb
+++ b/ext/tk/lib/tk/message.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/message.rb : treat message widget
#
diff --git a/ext/tk/lib/tk/mngfocus.rb b/ext/tk/lib/tk/mngfocus.rb
index a05fb94f8e..06b20eb6ab 100644
--- a/ext/tk/lib/tk/mngfocus.rb
+++ b/ext/tk/lib/tk/mngfocus.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/mngfocus.rb : methods for Tcl/Tk standard library 'focus.tcl'
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/msgcat.rb b/ext/tk/lib/tk/msgcat.rb
index f2d0653c69..1e98889faf 100644
--- a/ext/tk/lib/tk/msgcat.rb
+++ b/ext/tk/lib/tk/msgcat.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/msgcat.rb : methods for Tcl message catalog
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/namespace.rb b/ext/tk/lib/tk/namespace.rb
index 0119ba5ef7..1cab6fa060 100644
--- a/ext/tk/lib/tk/namespace.rb
+++ b/ext/tk/lib/tk/namespace.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/namespace.rb : methods to manipulate Tcl/Tk namespace
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/optiondb.rb b/ext/tk/lib/tk/optiondb.rb
index 0f3be30ff7..b27a5e5721 100644
--- a/ext/tk/lib/tk/optiondb.rb
+++ b/ext/tk/lib/tk/optiondb.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/optiondb.rb : treat option database
#
@@ -22,15 +23,9 @@ module TkOptionDB
end
def add(pat, value, pri=None)
- # if $SAFE >= 4
- # fail SecurityError, "can't call 'TkOptionDB.add' at $SAFE >= 4"
- # end
tk_call('option', 'add', pat, value, pri)
end
def clear
- # if $SAFE >= 4
- # fail SecurityError, "can't call 'TkOptionDB.crear' at $SAFE >= 4"
- # end
tk_call_without_enc('option', 'clear')
end
def get(win, name, klass)
diff --git a/ext/tk/lib/tk/optionobj.rb b/ext/tk/lib/tk/optionobj.rb
index 29b06da0eb..4219e4be71 100644
--- a/ext/tk/lib/tk/optionobj.rb
+++ b/ext/tk/lib/tk/optionobj.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/optionobj.rb : control options for a group of widgets
#
diff --git a/ext/tk/lib/tk/pack.rb b/ext/tk/lib/tk/pack.rb
index 220a38e524..45926d4043 100644
--- a/ext/tk/lib/tk/pack.rb
+++ b/ext/tk/lib/tk/pack.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/pack.rb : control pack geometry manager
#
diff --git a/ext/tk/lib/tk/package.rb b/ext/tk/lib/tk/package.rb
index 0c329732f5..fe6939c2d4 100644
--- a/ext/tk/lib/tk/package.rb
+++ b/ext/tk/lib/tk/package.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/package.rb : package command
#
diff --git a/ext/tk/lib/tk/palette.rb b/ext/tk/lib/tk/palette.rb
index 9462bb0667..e118e8dbe5 100644
--- a/ext/tk/lib/tk/palette.rb
+++ b/ext/tk/lib/tk/palette.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/palette.rb : methods for Tcl/Tk standard library 'palette.tcl'
# 1998/06/21 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/panedwindow.rb b/ext/tk/lib/tk/panedwindow.rb
index 04407802ea..285292f018 100644
--- a/ext/tk/lib/tk/panedwindow.rb
+++ b/ext/tk/lib/tk/panedwindow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/panedwindow.rb : treat panedwindow
#
diff --git a/ext/tk/lib/tk/place.rb b/ext/tk/lib/tk/place.rb
index 109d866fda..efda36df5e 100644
--- a/ext/tk/lib/tk/place.rb
+++ b/ext/tk/lib/tk/place.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/place.rb : control place geometry manager
#
diff --git a/ext/tk/lib/tk/radiobutton.rb b/ext/tk/lib/tk/radiobutton.rb
index 627df6d9cf..b0858df2b4 100644
--- a/ext/tk/lib/tk/radiobutton.rb
+++ b/ext/tk/lib/tk/radiobutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/radiobutton.rb : treat radiobutton widget
#
diff --git a/ext/tk/lib/tk/root.rb b/ext/tk/lib/tk/root.rb
index b4f0bd107f..3fb7c472d3 100644
--- a/ext/tk/lib/tk/root.rb
+++ b/ext/tk/lib/tk/root.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/root.rb : treat root widget
#
diff --git a/ext/tk/lib/tk/scale.rb b/ext/tk/lib/tk/scale.rb
index 0bdcead7f2..f6f60e3c25 100644
--- a/ext/tk/lib/tk/scale.rb
+++ b/ext/tk/lib/tk/scale.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/scale.rb : treat scale widget
#
diff --git a/ext/tk/lib/tk/scrollable.rb b/ext/tk/lib/tk/scrollable.rb
index 96959b7a4b..e9b4a93d6d 100644
--- a/ext/tk/lib/tk/scrollable.rb
+++ b/ext/tk/lib/tk/scrollable.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/scrollable.rb : module for scrollable widget
#
diff --git a/ext/tk/lib/tk/scrollbar.rb b/ext/tk/lib/tk/scrollbar.rb
index c0ac201acb..c16ed38756 100644
--- a/ext/tk/lib/tk/scrollbar.rb
+++ b/ext/tk/lib/tk/scrollbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/scrollbar.rb : treat scrollbar widget
#
diff --git a/ext/tk/lib/tk/scrollbox.rb b/ext/tk/lib/tk/scrollbox.rb
index d20742a666..a470765d7c 100644
--- a/ext/tk/lib/tk/scrollbox.rb
+++ b/ext/tk/lib/tk/scrollbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/scrollbox.rb - Tk Listbox with Scrollbar
# as an example of Composite Widget
diff --git a/ext/tk/lib/tk/selection.rb b/ext/tk/lib/tk/selection.rb
index ba0a6f49f9..085d8b2d2d 100644
--- a/ext/tk/lib/tk/selection.rb
+++ b/ext/tk/lib/tk/selection.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/selection.rb : control selection
#
diff --git a/ext/tk/lib/tk/spinbox.rb b/ext/tk/lib/tk/spinbox.rb
index f2917d60ca..4be41c4266 100644
--- a/ext/tk/lib/tk/spinbox.rb
+++ b/ext/tk/lib/tk/spinbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/spinbox.rb - Tk spinbox classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
diff --git a/ext/tk/lib/tk/tagfont.rb b/ext/tk/lib/tk/tagfont.rb
index a1807395d2..e3fd60465c 100644
--- a/ext/tk/lib/tk/tagfont.rb
+++ b/ext/tk/lib/tk/tagfont.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/tagfont.rb : control font of tags
#
diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb
index c18b3843b4..fc4f112933 100644
--- a/ext/tk/lib/tk/text.rb
+++ b/ext/tk/lib/tk/text.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/text.rb - Tk text classes
# by Yukihiro Matsumoto <matz@caelum.co.jp>
diff --git a/ext/tk/lib/tk/textimage.rb b/ext/tk/lib/tk/textimage.rb
index 99027a06fb..f7329c5dcc 100644
--- a/ext/tk/lib/tk/textimage.rb
+++ b/ext/tk/lib/tk/textimage.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/textimage.rb - treat Tk text image object
#
diff --git a/ext/tk/lib/tk/textmark.rb b/ext/tk/lib/tk/textmark.rb
index d1888c5e54..80945cc70c 100644
--- a/ext/tk/lib/tk/textmark.rb
+++ b/ext/tk/lib/tk/textmark.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/textmark.rb - methods for treating text marks
#
diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb
index 96692014e4..9f11c6539b 100644
--- a/ext/tk/lib/tk/texttag.rb
+++ b/ext/tk/lib/tk/texttag.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/texttag.rb - methods for treating text tags
#
diff --git a/ext/tk/lib/tk/textwindow.rb b/ext/tk/lib/tk/textwindow.rb
index 49327b2c81..e0be5bac7a 100644
--- a/ext/tk/lib/tk/textwindow.rb
+++ b/ext/tk/lib/tk/textwindow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/textwindow.rb - treat Tk text window object
#
diff --git a/ext/tk/lib/tk/timer.rb b/ext/tk/lib/tk/timer.rb
index ddfbfce9be..794463aab1 100644
--- a/ext/tk/lib/tk/timer.rb
+++ b/ext/tk/lib/tk/timer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/timer.rb : methods for Tcl/Tk after command
#
@@ -498,10 +499,6 @@ class TkTimer
end
def wait(on_thread = true, check_root = false)
- if $SAFE >= 4
- fail SecurityError, "can't wait timer at $SAFE >= 4"
- end
-
unless @running
if @return_value.kind_of?(Exception)
fail @return_value
diff --git a/ext/tk/lib/tk/tk_mac.rb b/ext/tk/lib/tk/tk_mac.rb
new file mode 100644
index 0000000000..ed90fd1c67
--- /dev/null
+++ b/ext/tk/lib/tk/tk_mac.rb
@@ -0,0 +1,159 @@
+# frozen_string_literal: false
+#
+# tk/tk_mac.rb : Access Mac-Specific functionality on OS X from Tk
+# (supported by Tk8.6 or later)
+#
+# ATTENTION !!
+# This is NOT TESTED. Because I have no test-environment.
+#
+require 'tk'
+
+module Tk
+ module Mac
+ end
+end
+
+module Tk::Mac
+ extend TkCore
+
+ # event handler callbacks
+ def self.def_ShowPreferences(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::ShowPreferences {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OpenApplication(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OpenApplication {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_ReopenApplication(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::ReopenApplication {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OpenDocument(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OpenDocument {args} { eval #{install_cmd(cmd)} $args }")
+ nil
+ end
+
+ def self.def_PrintDocument(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::PrintDocument {args} { eval #{install_cmd(cmd)} $args }")
+ nil
+ end
+
+ def self.def_Quit(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::Quit {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OnHide(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OnHide {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OnShow(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OnShow {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_ShowHelp(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::ShowHelp {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+
+ # additional dialogs
+ def self.standardAboutPanel
+ tk_call('::tk::mac::standardAboutPanel')
+ nil
+ end
+
+
+ # system configuration
+ def self.useCompatibilityMetrics(mode)
+ tk_call('::tk::mac::useCompatibilityMetrics', mode)
+ nil
+ end
+
+ def self.CGAntialiasLimit(limit)
+ tk_call('::tk::mac::CGAntialiasLimit', limit)
+ nil
+ end
+
+ def self.antialiasedtext(num)
+ tk_call('::tk::mac::antialiasedtext', num)
+ nil
+ end
+
+ def self.useThemedToplevel(mode)
+ tk_call('::tk::mac::useThemedToplevel', mode)
+ nil
+ end
+
+end
+
+class Tk::Mac::IconBitmap < TkImage
+ TkCommandNames = ['::tk::mac::iconBitmap'].freeze
+
+ def self.new(width, height, keys)
+ if keys.kind_of?(Hash)
+ name = nil
+ if keys.key?(:imagename)
+ name = keys[:imagename]
+ elsif keys.key?('imagename')
+ name = keys['imagename']
+ end
+ if name
+ if name.kind_of?(TkImage)
+ obj = name
+ else
+ name = _get_eval_string(name)
+ obj = nil
+ Tk_IMGTBL.mutex.synchronize{
+ obj = Tk_IMGTBL[name]
+ }
+ end
+ if obj
+ if !(keys[:without_creating] || keys['without_creating'])
+ keys = _symbolkey2str(keys)
+ keys.delete('imagename')
+ keys.delete('without_creating')
+ obj.instance_eval{
+ tk_call_without_enc('::tk::mac::iconBitmap',
+ @path, width, height, *hash_kv(keys, true))
+ }
+ end
+ return obj
+ end
+ end
+ end
+ (obj = self.allocate).instance_eval{
+ Tk_IMGTBL.mutex.synchronize{
+ initialize(width, height, keys)
+ Tk_IMGTBL[@path] = self
+ }
+ }
+ obj
+ end
+
+ def initialize(width, height, keys)
+ @path = nil
+ without_creating = false
+ if keys.kind_of?(Hash)
+ keys = _symbolkey2str(keys)
+ @path = keys.delete('imagename')
+ without_creating = keys.delete('without_creating')
+ end
+ unless @path
+ Tk_Image_ID.mutex.synchronize{
+ @path = Tk_Image_ID.join(TkCore::INTERP._ip_id_)
+ Tk_Image_ID[1].succ!
+ }
+ end
+ unless without_creating
+ tk_call_without_enc('::tk::mac::iconBitmap',
+ @path, width, height, *hash_kv(keys, true))
+ end
+ end
+end
diff --git a/ext/tk/lib/tk/toplevel.rb b/ext/tk/lib/tk/toplevel.rb
index 30ef009517..e66b0fc1be 100644
--- a/ext/tk/lib/tk/toplevel.rb
+++ b/ext/tk/lib/tk/toplevel.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/toplevel.rb : treat toplevel widget
#
diff --git a/ext/tk/lib/tk/ttk_selector.rb b/ext/tk/lib/tk/ttk_selector.rb
index cc9e9928cb..4589e7fc29 100644
--- a/ext/tk/lib/tk/ttk_selector.rb
+++ b/ext/tk/lib/tk/ttk_selector.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ttk_selector
#
diff --git a/ext/tk/lib/tk/txtwin_abst.rb b/ext/tk/lib/tk/txtwin_abst.rb
index 540f806d17..3c9beef6c4 100644
--- a/ext/tk/lib/tk/txtwin_abst.rb
+++ b/ext/tk/lib/tk/txtwin_abst.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/txtwin_abst.rb : TkTextWin abstruct class
#
diff --git a/ext/tk/lib/tk/validation.rb b/ext/tk/lib/tk/validation.rb
index 0ebd5c51b7..c6cbfb280e 100644
--- a/ext/tk/lib/tk/validation.rb
+++ b/ext/tk/lib/tk/validation.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/validation.rb - validation support module for entry, spinbox, and so on
#
diff --git a/ext/tk/lib/tk/variable.rb b/ext/tk/lib/tk/variable.rb
index 0487b034bd..8ac0fc6ace 100644
--- a/ext/tk/lib/tk/variable.rb
+++ b/ext/tk/lib/tk/variable.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/variable.rb : treat Tk variable object
#
@@ -360,9 +361,6 @@ class TkVariable
end
def wait(on_thread = false, check_root = false)
- if $SAFE >= 4
- fail SecurityError, "can't wait variable at $SAFE >= 4"
- end
on_thread &= (Thread.list.size != 1)
if on_thread
if check_root
diff --git a/ext/tk/lib/tk/virtevent.rb b/ext/tk/lib/tk/virtevent.rb
index c11e9692e7..de3c33da36 100644
--- a/ext/tk/lib/tk/virtevent.rb
+++ b/ext/tk/lib/tk/virtevent.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/virtevent.rb : treats virtual events
# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/winfo.rb b/ext/tk/lib/tk/winfo.rb
index b10cfe6760..36f32e5952 100644
--- a/ext/tk/lib/tk/winfo.rb
+++ b/ext/tk/lib/tk/winfo.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/winfo.rb : methods for winfo command
#
diff --git a/ext/tk/lib/tk/winpkg.rb b/ext/tk/lib/tk/winpkg.rb
index 80e0439ace..2a8f724bef 100644
--- a/ext/tk/lib/tk/winpkg.rb
+++ b/ext/tk/lib/tk/winpkg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/winpkg.rb : methods for Tcl/Tk packages for Microsoft Windows
# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/tk/wm.rb b/ext/tk/lib/tk/wm.rb
index fcd5a2cbd2..114ba24276 100644
--- a/ext/tk/lib/tk/wm.rb
+++ b/ext/tk/lib/tk/wm.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/wm.rb : methods for wm command
#
diff --git a/ext/tk/lib/tk/xim.rb b/ext/tk/lib/tk/xim.rb
index c0126c5175..7e77591b45 100644
--- a/ext/tk/lib/tk/xim.rb
+++ b/ext/tk/lib/tk/xim.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tk/xim.rb : control imput_method
#
diff --git a/ext/tk/lib/tkafter.rb b/ext/tk/lib/tkafter.rb
index f65945884c..0ce5049d4a 100644
--- a/ext/tk/lib/tkafter.rb
+++ b/ext/tk/lib/tkafter.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkafter.rb - load tk/after.rb
#
diff --git a/ext/tk/lib/tkbgerror.rb b/ext/tk/lib/tkbgerror.rb
index deba7a57fa..875f3fef2f 100644
--- a/ext/tk/lib/tkbgerror.rb
+++ b/ext/tk/lib/tkbgerror.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkbgerror.rb - load tk/bgerror.rb
#
diff --git a/ext/tk/lib/tkcanvas.rb b/ext/tk/lib/tkcanvas.rb
index 9524614291..d4d0afac9e 100644
--- a/ext/tk/lib/tkcanvas.rb
+++ b/ext/tk/lib/tkcanvas.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkcanvas.rb - load tk/canvas.rb
#
diff --git a/ext/tk/lib/tkclass.rb b/ext/tk/lib/tkclass.rb
index 87f5acc453..947cbf3a4a 100644
--- a/ext/tk/lib/tkclass.rb
+++ b/ext/tk/lib/tkclass.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkclass.rb - Tk classes
# Date: 2000/11/27 09:23:36
diff --git a/ext/tk/lib/tkconsole.rb b/ext/tk/lib/tkconsole.rb
index 9960ddb8ac..f4e8669c11 100644
--- a/ext/tk/lib/tkconsole.rb
+++ b/ext/tk/lib/tkconsole.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkconsole.rb - load tk/console.rb
#
diff --git a/ext/tk/lib/tkdialog.rb b/ext/tk/lib/tkdialog.rb
index bec5e5d29a..7a24e2a37a 100644
--- a/ext/tk/lib/tkdialog.rb
+++ b/ext/tk/lib/tkdialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkdialog.rb - load tk/dialog.rb
#
diff --git a/ext/tk/lib/tkentry.rb b/ext/tk/lib/tkentry.rb
index 2dcfcab5da..9ae2f7c8fe 100644
--- a/ext/tk/lib/tkentry.rb
+++ b/ext/tk/lib/tkentry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkentry.rb - load tk/entry.rb
#
diff --git a/ext/tk/lib/tkextlib/ICONS.rb b/ext/tk/lib/tkextlib/ICONS.rb
index 18d84c05e9..10402c1292 100644
--- a/ext/tk/lib/tkextlib/ICONS.rb
+++ b/ext/tk/lib/tkextlib/ICONS.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ICONS support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/ICONS/icons.rb b/ext/tk/lib/tkextlib/ICONS/icons.rb
index bd3180aa55..2934757b6d 100644
--- a/ext/tk/lib/tkextlib/ICONS/icons.rb
+++ b/ext/tk/lib/tkextlib/ICONS/icons.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/ICONS/icons.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/ICONS/setup.rb b/ext/tk/lib/tkextlib/ICONS/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/ICONS/setup.rb
+++ b/ext/tk/lib/tkextlib/ICONS/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/SUPPORT_STATUS b/ext/tk/lib/tkextlib/SUPPORT_STATUS
index de51c519fa..b44b629e46 100644
--- a/ext/tk/lib/tkextlib/SUPPORT_STATUS
+++ b/ext/tk/lib/tkextlib/SUPPORT_STATUS
@@ -4,7 +4,7 @@
*** RELEASE_DATE of the libraries => see 'tkextlib/version.rb' ***
The following list shows *CURRENT* status when this file was modified
-at last. If you want to add other Tcl/Tk extensions to the planed list
+at last. If you want to add other Tcl/Tk extensions to the planned list
(or change its status position), please request them at the ruby-talk,
ruby-list, or ruby-dev ML. Although we cannot promise to support your
requests, we'll try to do.
diff --git a/ext/tk/lib/tkextlib/blt.rb b/ext/tk/lib/tkextlib/blt.rb
index 8b132e41a7..665e41226f 100644
--- a/ext/tk/lib/tkextlib/blt.rb
+++ b/ext/tk/lib/tkextlib/blt.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# BLT support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/barchart.rb b/ext/tk/lib/tkextlib/blt/barchart.rb
index a86b91c959..5b6f09ead3 100644
--- a/ext/tk/lib/tkextlib/blt/barchart.rb
+++ b/ext/tk/lib/tkextlib/blt/barchart.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/barchart.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/bitmap.rb b/ext/tk/lib/tkextlib/blt/bitmap.rb
index 3254b63116..b9f411044e 100644
--- a/ext/tk/lib/tkextlib/blt/bitmap.rb
+++ b/ext/tk/lib/tkextlib/blt/bitmap.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/bitmap.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/busy.rb b/ext/tk/lib/tkextlib/blt/busy.rb
index b5287fb5b7..ab24420750 100644
--- a/ext/tk/lib/tkextlib/blt/busy.rb
+++ b/ext/tk/lib/tkextlib/blt/busy.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/busy.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/component.rb b/ext/tk/lib/tkextlib/blt/component.rb
index c7ea213cee..a6b6f13905 100644
--- a/ext/tk/lib/tkextlib/blt/component.rb
+++ b/ext/tk/lib/tkextlib/blt/component.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/component.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/container.rb b/ext/tk/lib/tkextlib/blt/container.rb
index be05828d95..6ee11138d7 100644
--- a/ext/tk/lib/tkextlib/blt/container.rb
+++ b/ext/tk/lib/tkextlib/blt/container.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/container.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/cutbuffer.rb b/ext/tk/lib/tkextlib/blt/cutbuffer.rb
index 1cc39dfb94..b36aece6e7 100644
--- a/ext/tk/lib/tkextlib/blt/cutbuffer.rb
+++ b/ext/tk/lib/tkextlib/blt/cutbuffer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/cutbuffer.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/dragdrop.rb b/ext/tk/lib/tkextlib/blt/dragdrop.rb
index aa5c5654c2..dc2531b12e 100644
--- a/ext/tk/lib/tkextlib/blt/dragdrop.rb
+++ b/ext/tk/lib/tkextlib/blt/dragdrop.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/dragdrop.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/eps.rb b/ext/tk/lib/tkextlib/blt/eps.rb
index 0dba87a7cc..bd2d3cc47e 100644
--- a/ext/tk/lib/tkextlib/blt/eps.rb
+++ b/ext/tk/lib/tkextlib/blt/eps.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/eps.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/graph.rb b/ext/tk/lib/tkextlib/blt/graph.rb
index 6bd4424065..02de006f33 100644
--- a/ext/tk/lib/tkextlib/blt/graph.rb
+++ b/ext/tk/lib/tkextlib/blt/graph.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/graph.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/htext.rb b/ext/tk/lib/tkextlib/blt/htext.rb
index 878bd9982d..d0f5e8b5e6 100644
--- a/ext/tk/lib/tkextlib/blt/htext.rb
+++ b/ext/tk/lib/tkextlib/blt/htext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/htext.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/setup.rb b/ext/tk/lib/tkextlib/blt/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/blt/setup.rb
+++ b/ext/tk/lib/tkextlib/blt/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/blt/spline.rb b/ext/tk/lib/tkextlib/blt/spline.rb
index 9f75a0b217..84d96a08f0 100644
--- a/ext/tk/lib/tkextlib/blt/spline.rb
+++ b/ext/tk/lib/tkextlib/blt/spline.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/spline.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/stripchart.rb b/ext/tk/lib/tkextlib/blt/stripchart.rb
index 74093f1868..332521ab0b 100644
--- a/ext/tk/lib/tkextlib/blt/stripchart.rb
+++ b/ext/tk/lib/tkextlib/blt/stripchart.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/stripchart.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/table.rb b/ext/tk/lib/tkextlib/blt/table.rb
index 205e29e6c5..39e345408d 100644
--- a/ext/tk/lib/tkextlib/blt/table.rb
+++ b/ext/tk/lib/tkextlib/blt/table.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/table.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tabnotebook.rb b/ext/tk/lib/tkextlib/blt/tabnotebook.rb
index 82936c67d3..f08f198163 100644
--- a/ext/tk/lib/tkextlib/blt/tabnotebook.rb
+++ b/ext/tk/lib/tkextlib/blt/tabnotebook.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tabnotebook.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tabset.rb b/ext/tk/lib/tkextlib/blt/tabset.rb
index c4716c7304..022d9784e9 100644
--- a/ext/tk/lib/tkextlib/blt/tabset.rb
+++ b/ext/tk/lib/tkextlib/blt/tabset.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tabset.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/ted.rb b/ext/tk/lib/tkextlib/blt/ted.rb
index 53ab9acdaa..7e81eab27d 100644
--- a/ext/tk/lib/tkextlib/blt/ted.rb
+++ b/ext/tk/lib/tkextlib/blt/ted.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/ted.rb
#
diff --git a/ext/tk/lib/tkextlib/blt/tile.rb b/ext/tk/lib/tkextlib/blt/tile.rb
index c67cafd8d6..f52a5d3944 100644
--- a/ext/tk/lib/tkextlib/blt/tile.rb
+++ b/ext/tk/lib/tkextlib/blt/tile.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tile/button.rb b/ext/tk/lib/tkextlib/blt/tile/button.rb
index 2e0863cfbe..e3d819edb7 100644
--- a/ext/tk/lib/tkextlib/blt/tile/button.rb
+++ b/ext/tk/lib/tkextlib/blt/tile/button.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile/button.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb b/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb
index da230b5925..0c8c7f9774 100644
--- a/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb
+++ b/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile/checkbutton.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tile/frame.rb b/ext/tk/lib/tkextlib/blt/tile/frame.rb
index 5434af4b72..8d979fe485 100644
--- a/ext/tk/lib/tkextlib/blt/tile/frame.rb
+++ b/ext/tk/lib/tkextlib/blt/tile/frame.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile/frame.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tile/label.rb b/ext/tk/lib/tkextlib/blt/tile/label.rb
index f370c1403b..f58450d902 100644
--- a/ext/tk/lib/tkextlib/blt/tile/label.rb
+++ b/ext/tk/lib/tkextlib/blt/tile/label.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile/label.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb b/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb
index 814f9a5cc4..ee449c75b0 100644
--- a/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb
+++ b/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile/radiobutton.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb b/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb
index 2ae871d518..35d878d5aa 100644
--- a/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb
+++ b/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile/scrollbar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tile/toplevel.rb b/ext/tk/lib/tkextlib/blt/tile/toplevel.rb
index 76d5f86b1b..e30b8b37b5 100644
--- a/ext/tk/lib/tkextlib/blt/tile/toplevel.rb
+++ b/ext/tk/lib/tkextlib/blt/tile/toplevel.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tile/toplevel.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/tree.rb b/ext/tk/lib/tkextlib/blt/tree.rb
index 1a3563e60d..ae235f68e8 100644
--- a/ext/tk/lib/tkextlib/blt/tree.rb
+++ b/ext/tk/lib/tkextlib/blt/tree.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/tree.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
@@ -635,7 +636,7 @@ module Tk::BLT
}
end
- def initialzie(name = nil)
+ def initialize(name = nil)
if name
@path = @id = name
else
diff --git a/ext/tk/lib/tkextlib/blt/treeview.rb b/ext/tk/lib/tkextlib/blt/treeview.rb
index 38d90412e0..2866ba3027 100644
--- a/ext/tk/lib/tkextlib/blt/treeview.rb
+++ b/ext/tk/lib/tkextlib/blt/treeview.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/treeview.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/unix_dnd.rb b/ext/tk/lib/tkextlib/blt/unix_dnd.rb
index 8996f7c891..3c0cd33b79 100644
--- a/ext/tk/lib/tkextlib/blt/unix_dnd.rb
+++ b/ext/tk/lib/tkextlib/blt/unix_dnd.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/unix_dnd.rb
#
diff --git a/ext/tk/lib/tkextlib/blt/vector.rb b/ext/tk/lib/tkextlib/blt/vector.rb
index 742e901d3e..a3ab7e64b2 100644
--- a/ext/tk/lib/tkextlib/blt/vector.rb
+++ b/ext/tk/lib/tkextlib/blt/vector.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/vector.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/watch.rb b/ext/tk/lib/tkextlib/blt/watch.rb
index 292623ff58..b88c81c745 100644
--- a/ext/tk/lib/tkextlib/blt/watch.rb
+++ b/ext/tk/lib/tkextlib/blt/watch.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/watch.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/blt/win_printer.rb b/ext/tk/lib/tkextlib/blt/win_printer.rb
index 7ac6a0dcfc..8d609acc19 100644
--- a/ext/tk/lib/tkextlib/blt/win_printer.rb
+++ b/ext/tk/lib/tkextlib/blt/win_printer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/win_printer.rb
#
diff --git a/ext/tk/lib/tkextlib/blt/winop.rb b/ext/tk/lib/tkextlib/blt/winop.rb
index 03bdb60810..38033e1113 100644
--- a/ext/tk/lib/tkextlib/blt/winop.rb
+++ b/ext/tk/lib/tkextlib/blt/winop.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/blt/winop.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget.rb b/ext/tk/lib/tkextlib/bwidget.rb
index 7a1eff51d8..0fa9c77ecf 100644
--- a/ext/tk/lib/tkextlib/bwidget.rb
+++ b/ext/tk/lib/tkextlib/bwidget.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# BWidget extension support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb b/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
index 13fe9e59bf..a991245065 100644
--- a/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
+++ b/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/arrowbutton.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/bitmap.rb b/ext/tk/lib/tkextlib/bwidget/bitmap.rb
index 6cfde203e8..3acdfdf5ec 100644
--- a/ext/tk/lib/tkextlib/bwidget/bitmap.rb
+++ b/ext/tk/lib/tkextlib/bwidget/bitmap.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/bitmap.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/button.rb b/ext/tk/lib/tkextlib/bwidget/button.rb
index e139fb6708..ad880ebfdd 100644
--- a/ext/tk/lib/tkextlib/bwidget/button.rb
+++ b/ext/tk/lib/tkextlib/bwidget/button.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/button.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/buttonbox.rb b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
index a6de33c40c..780a6a649e 100644
--- a/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/buttonbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/combobox.rb b/ext/tk/lib/tkextlib/bwidget/combobox.rb
index 16143dfbc6..b3de3186d6 100644
--- a/ext/tk/lib/tkextlib/bwidget/combobox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/combobox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/combobox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/dialog.rb b/ext/tk/lib/tkextlib/bwidget/dialog.rb
index 3b0656f021..ed929cb830 100644
--- a/ext/tk/lib/tkextlib/bwidget/dialog.rb
+++ b/ext/tk/lib/tkextlib/bwidget/dialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/dialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/dragsite.rb b/ext/tk/lib/tkextlib/bwidget/dragsite.rb
index 4d4de1780c..6c7ea4491a 100644
--- a/ext/tk/lib/tkextlib/bwidget/dragsite.rb
+++ b/ext/tk/lib/tkextlib/bwidget/dragsite.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/dragsite.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/dropsite.rb b/ext/tk/lib/tkextlib/bwidget/dropsite.rb
index e5e98fbc51..e5eb7f4a88 100644
--- a/ext/tk/lib/tkextlib/bwidget/dropsite.rb
+++ b/ext/tk/lib/tkextlib/bwidget/dropsite.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/dropsite.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb b/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb
index 846e58062d..7e7538fc00 100644
--- a/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb
+++ b/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/dynamichelp.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/entry.rb b/ext/tk/lib/tkextlib/bwidget/entry.rb
index 8dc4496123..bfbe2f1967 100644
--- a/ext/tk/lib/tkextlib/bwidget/entry.rb
+++ b/ext/tk/lib/tkextlib/bwidget/entry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/entry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/label.rb b/ext/tk/lib/tkextlib/bwidget/label.rb
index e8d9352c62..9a0b73d95c 100644
--- a/ext/tk/lib/tkextlib/bwidget/label.rb
+++ b/ext/tk/lib/tkextlib/bwidget/label.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/label.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/labelentry.rb b/ext/tk/lib/tkextlib/bwidget/labelentry.rb
index 16e7b46933..501f9515fa 100644
--- a/ext/tk/lib/tkextlib/bwidget/labelentry.rb
+++ b/ext/tk/lib/tkextlib/bwidget/labelentry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/labelentry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/labelframe.rb b/ext/tk/lib/tkextlib/bwidget/labelframe.rb
index 0710f213f0..21c529c6c9 100644
--- a/ext/tk/lib/tkextlib/bwidget/labelframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/labelframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/labelframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/listbox.rb b/ext/tk/lib/tkextlib/bwidget/listbox.rb
index 930491c869..394c379a34 100644
--- a/ext/tk/lib/tkextlib/bwidget/listbox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/listbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/listbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/mainframe.rb b/ext/tk/lib/tkextlib/bwidget/mainframe.rb
index 92253bd8d3..ad097439c3 100644
--- a/ext/tk/lib/tkextlib/bwidget/mainframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/mainframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/mainframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
index 7b62614737..69819360a8 100644
--- a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
+++ b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/messagedlg.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/notebook.rb b/ext/tk/lib/tkextlib/bwidget/notebook.rb
index ed28bcd86a..05c8939a30 100644
--- a/ext/tk/lib/tkextlib/bwidget/notebook.rb
+++ b/ext/tk/lib/tkextlib/bwidget/notebook.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/notebook.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb b/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
index 31bbf1fb8b..ce18ee0edb 100644
--- a/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
+++ b/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/pagesmanager.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/panedwindow.rb b/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
index 54cf06cbde..560c563479 100644
--- a/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
+++ b/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/panedwindow.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/panelframe.rb b/ext/tk/lib/tkextlib/bwidget/panelframe.rb
index 1cbf914425..0e32f4e261 100644
--- a/ext/tk/lib/tkextlib/bwidget/panelframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/panelframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/panelframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/passwddlg.rb b/ext/tk/lib/tkextlib/bwidget/passwddlg.rb
index ea50c87cef..9fe6fc6a02 100644
--- a/ext/tk/lib/tkextlib/bwidget/passwddlg.rb
+++ b/ext/tk/lib/tkextlib/bwidget/passwddlg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/passwddlg.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/progressbar.rb b/ext/tk/lib/tkextlib/bwidget/progressbar.rb
index 18eb67349b..f06ddc164e 100644
--- a/ext/tk/lib/tkextlib/bwidget/progressbar.rb
+++ b/ext/tk/lib/tkextlib/bwidget/progressbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/progressbar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/progressdlg.rb b/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
index 0c0c4540bc..e11a73e88d 100644
--- a/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
+++ b/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/progressdlg.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb b/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
index 5bd00d6870..2b184746a4 100644
--- a/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/scrollableframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb b/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
index ea5a18cc66..9bd5e87554 100644
--- a/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
+++ b/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/scrolledwindow.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/scrollview.rb b/ext/tk/lib/tkextlib/bwidget/scrollview.rb
index ab27bc91cf..d60fdca89e 100644
--- a/ext/tk/lib/tkextlib/bwidget/scrollview.rb
+++ b/ext/tk/lib/tkextlib/bwidget/scrollview.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/scrollview.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/selectcolor.rb b/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
index 456175e87e..85809b69bd 100644
--- a/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
+++ b/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/selectcolor.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/selectfont.rb b/ext/tk/lib/tkextlib/bwidget/selectfont.rb
index 23419cb0fa..4f67a2e239 100644
--- a/ext/tk/lib/tkextlib/bwidget/selectfont.rb
+++ b/ext/tk/lib/tkextlib/bwidget/selectfont.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/selectfont.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/separator.rb b/ext/tk/lib/tkextlib/bwidget/separator.rb
index 6d92321210..786c41c763 100644
--- a/ext/tk/lib/tkextlib/bwidget/separator.rb
+++ b/ext/tk/lib/tkextlib/bwidget/separator.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/separator.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/setup.rb b/ext/tk/lib/tkextlib/bwidget/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/bwidget/setup.rb
+++ b/ext/tk/lib/tkextlib/bwidget/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/bwidget/spinbox.rb b/ext/tk/lib/tkextlib/bwidget/spinbox.rb
index 0a45b045fb..00fe33da39 100644
--- a/ext/tk/lib/tkextlib/bwidget/spinbox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/spinbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/entry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/statusbar.rb b/ext/tk/lib/tkextlib/bwidget/statusbar.rb
index 5c5dd43fe4..28fd6fab21 100644
--- a/ext/tk/lib/tkextlib/bwidget/statusbar.rb
+++ b/ext/tk/lib/tkextlib/bwidget/statusbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/statusbar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/titleframe.rb b/ext/tk/lib/tkextlib/bwidget/titleframe.rb
index 71879111c1..eca622399e 100644
--- a/ext/tk/lib/tkextlib/bwidget/titleframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/titleframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/titleframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/tree.rb b/ext/tk/lib/tkextlib/bwidget/tree.rb
index 089c482fe8..688ed5f324 100644
--- a/ext/tk/lib/tkextlib/bwidget/tree.rb
+++ b/ext/tk/lib/tkextlib/bwidget/tree.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/tree.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/bwidget/widget.rb b/ext/tk/lib/tkextlib/bwidget/widget.rb
index a93364b567..ab08826b19 100644
--- a/ext/tk/lib/tkextlib/bwidget/widget.rb
+++ b/ext/tk/lib/tkextlib/bwidget/widget.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/bwidget/widget.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/itcl.rb b/ext/tk/lib/tkextlib/itcl.rb
index 1d6ecf04f2..3a67b3f651 100644
--- a/ext/tk/lib/tkextlib/itcl.rb
+++ b/ext/tk/lib/tkextlib/itcl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# [incr Tcl] support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/itcl/incr_tcl.rb b/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
index 8f6bb33abe..de1be12392 100644
--- a/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
+++ b/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/itk/incr_tcl.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/itcl/setup.rb b/ext/tk/lib/tkextlib/itcl/setup.rb
index 70b38e4916..917b877947 100644
--- a/ext/tk/lib/tkextlib/itcl/setup.rb
+++ b/ext/tk/lib/tkextlib/itcl/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/itk.rb b/ext/tk/lib/tkextlib/itk.rb
index 7492bd3eb4..112cb789f2 100644
--- a/ext/tk/lib/tkextlib/itk.rb
+++ b/ext/tk/lib/tkextlib/itk.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# [incr Tk] support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/itk/incr_tk.rb b/ext/tk/lib/tkextlib/itk/incr_tk.rb
index 989585e33b..8c6fe1374f 100644
--- a/ext/tk/lib/tkextlib/itk/incr_tk.rb
+++ b/ext/tk/lib/tkextlib/itk/incr_tk.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/itk/incr_tk.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/itk/setup.rb b/ext/tk/lib/tkextlib/itk/setup.rb
index 544926efe0..f32d5d6a75 100644
--- a/ext/tk/lib/tkextlib/itk/setup.rb
+++ b/ext/tk/lib/tkextlib/itk/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/iwidgets.rb b/ext/tk/lib/tkextlib/iwidgets.rb
index ebd4cf7507..2ebd9d993e 100644
--- a/ext/tk/lib/tkextlib/iwidgets.rb
+++ b/ext/tk/lib/tkextlib/iwidgets.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# [incr Widgets] support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb b/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
index 91e06d1b52..0357114c83 100644
--- a/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/buttonbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/calendar.rb b/ext/tk/lib/tkextlib/iwidgets/calendar.rb
index a5478c7cc6..4cfb9203c8 100644
--- a/ext/tk/lib/tkextlib/iwidgets/calendar.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/calendar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/calendar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb b/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
index 398eec3f1a..3fe489dc95 100644
--- a/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/canvasprintbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb b/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
index e64d8154ca..4b5fdf5d7c 100644
--- a/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/canvasprintdialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/checkbox.rb b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
index a7476c824e..4589fe7ffa 100644
--- a/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/checkbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/combobox.rb b/ext/tk/lib/tkextlib/iwidgets/combobox.rb
index 82dcf25d0b..d4c05b5be5 100644
--- a/ext/tk/lib/tkextlib/iwidgets/combobox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/combobox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/combobox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/dateentry.rb b/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
index 98a0051e55..e135b89ed7 100644
--- a/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/dateentry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/datefield.rb b/ext/tk/lib/tkextlib/iwidgets/datefield.rb
index 50d5405a3b..35977e1f6d 100644
--- a/ext/tk/lib/tkextlib/iwidgets/datefield.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/datefield.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/datefield.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/dialog.rb b/ext/tk/lib/tkextlib/iwidgets/dialog.rb
index 2d554ca7b5..edefba1844 100644
--- a/ext/tk/lib/tkextlib/iwidgets/dialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/dialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/dialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb b/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
index e880594532..009fc61c56 100644
--- a/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/dialogshell.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb b/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
index 07ab025cdf..3ae3f319b6 100644
--- a/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/disjointlistbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/entryfield.rb b/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
index 3e7149a662..75baca05d4 100644
--- a/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/entryfield.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/extbutton.rb b/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
index e744fba91a..3c77c2ec21 100644
--- a/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/extbutton.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
index 2ff15bb509..4581771309 100644
--- a/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/extfileselectionbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
index 509fdcf636..32a06cc46f 100644
--- a/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/extfileselectiondialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/feedback.rb b/ext/tk/lib/tkextlib/iwidgets/feedback.rb
index 29d04c8a5d..e52d60edac 100644
--- a/ext/tk/lib/tkextlib/iwidgets/feedback.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/feedback.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/feedback.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
index a425b53b5f..3811f2b57e 100644
--- a/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/fileselectionbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
index ebcdaf8c0b..8d368486ea 100644
--- a/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/fileselectiondialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/finddialog.rb b/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
index 3d522e07c8..ff0b587390 100644
--- a/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/finddialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb b/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
index cb9301d0c9..af99973240 100644
--- a/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/hierarchy.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb b/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
index d4ea1aac65..1650c7af37 100644
--- a/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/hyperhelp.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb b/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
index 6595398427..f4f3786528 100644
--- a/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/labeledframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb b/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
index d36d42878d..fe3c03135c 100644
--- a/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/labeledwidget.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb b/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
index ebf48021db..34c9eb52e3 100644
--- a/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/mainwindow.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/menubar.rb b/ext/tk/lib/tkextlib/iwidgets/menubar.rb
index f9a17d0b55..f729511230 100644
--- a/ext/tk/lib/tkextlib/iwidgets/menubar.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/menubar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/menubar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/messagebox.rb b/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
index 6adb53d941..a4c28228ee 100644
--- a/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/messagebox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb b/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
index 9aa590056f..2fb4533b67 100644
--- a/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/messagedialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/notebook.rb b/ext/tk/lib/tkextlib/iwidgets/notebook.rb
index 7ed4126a4d..ad2a372512 100644
--- a/ext/tk/lib/tkextlib/iwidgets/notebook.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/notebook.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/notebook.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb b/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
index 57a3cc7d2b..642db11ff1 100644
--- a/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/optionmenu.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb b/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
index 65463cc85a..5f17bdd862 100644
--- a/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/panedwindow.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb b/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
index 7c7ff7ad62..fc73a51742 100644
--- a/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/promptdialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb b/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
index ae56788289..cec3563ddc 100644
--- a/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/pushbutton.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/radiobox.rb b/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
index 21181777b5..1c9e9f8d34 100644
--- a/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/radiobox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb b/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
index 056cd85322..e17fee98dc 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/buttonbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
index 4dea2f2d5c..463689f513 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/scrolledcanvas.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
index 7b7b95df1c..f105576fd6 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/scrolledframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
index dc2966bd48..4ee5abe9fc 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/scrolledhtml.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
index 20a4cd1d36..94949c5524 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/scrolledlistbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
index 69b7d314fd..1e2898988c 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/scrolledtext.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
index 5ecd2d72d2..a8b4e5a27b 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/scrolledwidget.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
index eb8fe3ad52..333f68e306 100644
--- a/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/selectionbox.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
index 45aecf3266..0d0b94e8d2 100644
--- a/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/selectiondialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/setup.rb b/ext/tk/lib/tkextlib/iwidgets/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/iwidgets/setup.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/iwidgets/shell.rb b/ext/tk/lib/tkextlib/iwidgets/shell.rb
index c560e3ac29..f09e7d4d31 100644
--- a/ext/tk/lib/tkextlib/iwidgets/shell.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/shell.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/shell.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/spindate.rb b/ext/tk/lib/tkextlib/iwidgets/spindate.rb
index b3de9ed989..8860348cc0 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spindate.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spindate.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/spindate.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/spinint.rb b/ext/tk/lib/tkextlib/iwidgets/spinint.rb
index bede3bb1bf..85736d095c 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spinint.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spinint.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/spinint.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/spinner.rb b/ext/tk/lib/tkextlib/iwidgets/spinner.rb
index d960996e22..49968e86d8 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spinner.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spinner.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/spinner.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/spintime.rb b/ext/tk/lib/tkextlib/iwidgets/spintime.rb
index 20f8197a09..9b280ec0e4 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spintime.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spintime.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/spintime.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb b/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
index f56efa9aaf..89e3362185 100644
--- a/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/tabnotebook.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/tabset.rb b/ext/tk/lib/tkextlib/iwidgets/tabset.rb
index 501ead4964..816ea087ef 100644
--- a/ext/tk/lib/tkextlib/iwidgets/tabset.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/tabset.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/tabset.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/timeentry.rb b/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
index b0afb3afd9..d4078e6e4f 100644
--- a/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/timeentry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/timefield.rb b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
index c34281d4ff..d759a0762f 100644
--- a/ext/tk/lib/tkextlib/iwidgets/timefield.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/timefield.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/toolbar.rb b/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
index 5b474c3816..7f2a54b88b 100644
--- a/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/toolbar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/iwidgets/watch.rb b/ext/tk/lib/tkextlib/iwidgets/watch.rb
index f10ec54cb2..c6e862b36a 100644
--- a/ext/tk/lib/tkextlib/iwidgets/watch.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/watch.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/iwidgets/watch.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/pkg_checker.rb b/ext/tk/lib/tkextlib/pkg_checker.rb
index e2fd97bb6a..76a25ca629 100755
--- a/ext/tk/lib/tkextlib/pkg_checker.rb
+++ b/ext/tk/lib/tkextlib/pkg_checker.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# Ruby/Tk extension library checker
#
diff --git a/ext/tk/lib/tkextlib/setup.rb b/ext/tk/lib/tkextlib/setup.rb
index 79facc5ee3..08ad32e99b 100644
--- a/ext/tk/lib/tkextlib/setup.rb
+++ b/ext/tk/lib/tkextlib/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before using Tk extension libraries
#
diff --git a/ext/tk/lib/tkextlib/tcllib.rb b/ext/tk/lib/tkextlib/tcllib.rb
index 2831989759..75d250cba4 100644
--- a/ext/tk/lib/tkextlib/tcllib.rb
+++ b/ext/tk/lib/tkextlib/tcllib.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tcllib extension support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/autoscroll.rb b/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
index 2def59bf73..ae45b84787 100644
--- a/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
+++ b/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/autoscroll.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/calendar.rb b/ext/tk/lib/tkextlib/tcllib/calendar.rb
index b6843df176..fa53603d91 100644
--- a/ext/tk/lib/tkextlib/tcllib/calendar.rb
+++ b/ext/tk/lib/tkextlib/tcllib/calendar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/calendar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb
index ba87cd3aae..f3d1847d73 100644
--- a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb
+++ b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/canvas.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb
index f4ffb48ece..bb8b04a18b 100644
--- a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb
+++ b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/canvas.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb
index ddb0340c31..34a8ca5094 100644
--- a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb
+++ b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/chatwidget.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/crosshair.rb b/ext/tk/lib/tkextlib/tcllib/crosshair.rb
index 49b5361e4f..74cc0a881c 100644
--- a/ext/tk/lib/tkextlib/tcllib/crosshair.rb
+++ b/ext/tk/lib/tkextlib/tcllib/crosshair.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/crosshair.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/ctext.rb b/ext/tk/lib/tkextlib/tcllib/ctext.rb
index 308847c233..1c61ec81a6 100644
--- a/ext/tk/lib/tkextlib/tcllib/ctext.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ctext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/ctext.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/cursor.rb b/ext/tk/lib/tkextlib/tcllib/cursor.rb
index 5c47f9709b..4c93cfc063 100644
--- a/ext/tk/lib/tkextlib/tcllib/cursor.rb
+++ b/ext/tk/lib/tkextlib/tcllib/cursor.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/cursor.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/dateentry.rb b/ext/tk/lib/tkextlib/tcllib/dateentry.rb
index 77038d95bc..81b38515fc 100644
--- a/ext/tk/lib/tkextlib/tcllib/dateentry.rb
+++ b/ext/tk/lib/tkextlib/tcllib/dateentry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/dateentry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/datefield.rb b/ext/tk/lib/tkextlib/tcllib/datefield.rb
index 4c2eae741e..ceed1260df 100644
--- a/ext/tk/lib/tkextlib/tcllib/datefield.rb
+++ b/ext/tk/lib/tkextlib/tcllib/datefield.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/datefield.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/diagrams.rb b/ext/tk/lib/tkextlib/tcllib/diagrams.rb
index d24ba9d232..7fb7b3c7ee 100644
--- a/ext/tk/lib/tkextlib/tcllib/diagrams.rb
+++ b/ext/tk/lib/tkextlib/tcllib/diagrams.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/diagrams.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/dialog.rb b/ext/tk/lib/tkextlib/tcllib/dialog.rb
index 86a0ef2269..46fd06f177 100644
--- a/ext/tk/lib/tkextlib/tcllib/dialog.rb
+++ b/ext/tk/lib/tkextlib/tcllib/dialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/dialog.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/getstring.rb b/ext/tk/lib/tkextlib/tcllib/getstring.rb
index 48711d3b66..72d9c5f517 100644
--- a/ext/tk/lib/tkextlib/tcllib/getstring.rb
+++ b/ext/tk/lib/tkextlib/tcllib/getstring.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/getstring.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/history.rb b/ext/tk/lib/tkextlib/tcllib/history.rb
index a01a4ebfcc..a1b92726ee 100644
--- a/ext/tk/lib/tkextlib/tcllib/history.rb
+++ b/ext/tk/lib/tkextlib/tcllib/history.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/history.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/ico.rb b/ext/tk/lib/tkextlib/tcllib/ico.rb
index 36a32c6b09..8814205f94 100644
--- a/ext/tk/lib/tkextlib/tcllib/ico.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ico.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/ico.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
index 4878cc3c23..6bbd8442a6 100644
--- a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/ip_entry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/khim.rb b/ext/tk/lib/tkextlib/tcllib/khim.rb
index 5dc2130b35..e79f26b381 100644
--- a/ext/tk/lib/tkextlib/tcllib/khim.rb
+++ b/ext/tk/lib/tkextlib/tcllib/khim.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/khim.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/menuentry.rb b/ext/tk/lib/tkextlib/tcllib/menuentry.rb
index f1eb2f295c..51521499da 100644
--- a/ext/tk/lib/tkextlib/tcllib/menuentry.rb
+++ b/ext/tk/lib/tkextlib/tcllib/menuentry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/menuentry.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/ntext.rb b/ext/tk/lib/tkextlib/tcllib/ntext.rb
index 7888ed4871..2d0c208236 100644
--- a/ext/tk/lib/tkextlib/tcllib/ntext.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ntext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/ntext.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/panelframe.rb b/ext/tk/lib/tkextlib/tcllib/panelframe.rb
index 020c51cbd1..678d5d0a9a 100644
--- a/ext/tk/lib/tkextlib/tcllib/panelframe.rb
+++ b/ext/tk/lib/tkextlib/tcllib/panelframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/panelframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/plotchart.rb b/ext/tk/lib/tkextlib/tcllib/plotchart.rb
index 2f3d79d427..1817f9a791 100644
--- a/ext/tk/lib/tkextlib/tcllib/plotchart.rb
+++ b/ext/tk/lib/tkextlib/tcllib/plotchart.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/plotchart.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
@@ -142,7 +143,7 @@ module Tk::Tcllib::Plotchart
end
def self.pixel_to_coords(w, x, y)
- list(tk_call_without_enc('::Plotchart::coordsToPixel', w.path, x, y))
+ list(tk_call_without_enc('::Plotchart::pixelToCoords', w.path, x, y))
end
def self.determine_scale(*args) # (xmin, xmax, inverted=false)
@@ -311,7 +312,7 @@ module Tk::Tcllib::Plotchart
end
def pixel_to_coords(x, y)
- list(tk_call_without_enc('::Plotchart::coordsToPixel', @path, x, y))
+ list(tk_call_without_enc('::Plotchart::pixelToCoords', @path, x, y))
end
def determine_scale(xmax, ymax)
@@ -519,7 +520,7 @@ module Tk::Tcllib::Plotchart
class Histogram < XYPlot
TkCommandNames = [
'canvas'.freeze,
- '::Plotchart::createHistgram'.freeze
+ '::Plotchart::createHistogram'.freeze
].freeze
end
diff --git a/ext/tk/lib/tkextlib/tcllib/ruler.rb b/ext/tk/lib/tkextlib/tcllib/ruler.rb
index d22dafa053..f57b0b0e1a 100644
--- a/ext/tk/lib/tkextlib/tcllib/ruler.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ruler.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/ruler.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/screenruler.rb b/ext/tk/lib/tkextlib/tcllib/screenruler.rb
index 75fa36b66d..64dd4f4ccc 100644
--- a/ext/tk/lib/tkextlib/tcllib/screenruler.rb
+++ b/ext/tk/lib/tkextlib/tcllib/screenruler.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/screenruler.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb b/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb
index c9488b4686..380d301a1a 100644
--- a/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb
+++ b/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/scrolledwindow.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/scrollwin.rb b/ext/tk/lib/tkextlib/tcllib/scrollwin.rb
index c9f6062fef..f9bf127799 100644
--- a/ext/tk/lib/tkextlib/tcllib/scrollwin.rb
+++ b/ext/tk/lib/tkextlib/tcllib/scrollwin.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/scrollwin.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/setup.rb b/ext/tk/lib/tkextlib/tcllib/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tcllib/setup.rb
+++ b/ext/tk/lib/tkextlib/tcllib/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tcllib/statusbar.rb b/ext/tk/lib/tkextlib/tcllib/statusbar.rb
index 46a4b9d8b6..b2c8f54b94 100644
--- a/ext/tk/lib/tkextlib/tcllib/statusbar.rb
+++ b/ext/tk/lib/tkextlib/tcllib/statusbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/statusbar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/style.rb b/ext/tk/lib/tkextlib/tcllib/style.rb
index dac6916e46..f3b66b7861 100644
--- a/ext/tk/lib/tkextlib/tcllib/style.rb
+++ b/ext/tk/lib/tkextlib/tcllib/style.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/style.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/superframe.rb b/ext/tk/lib/tkextlib/tcllib/superframe.rb
index adc9c4adbd..776ad7c166 100644
--- a/ext/tk/lib/tkextlib/tcllib/superframe.rb
+++ b/ext/tk/lib/tkextlib/tcllib/superframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/superframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/swaplist.rb b/ext/tk/lib/tkextlib/tcllib/swaplist.rb
index 7698640534..7eaed8dbaa 100644
--- a/ext/tk/lib/tkextlib/tcllib/swaplist.rb
+++ b/ext/tk/lib/tkextlib/tcllib/swaplist.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/swaplist.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist.rb b/ext/tk/lib/tkextlib/tcllib/tablelist.rb
index bf5ab6620a..7cfe2faf1e 100644
--- a/ext/tk/lib/tkextlib/tcllib/tablelist.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/tablelist.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb
index 2a5c415cc7..b45f18796a 100644
--- a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/tablelist_core.rb
#
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb b/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
index 0a1458415e..d09bbe7225 100644
--- a/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/tablelist_tlie.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
@@ -15,7 +16,7 @@ unless defined? Tk::Tcllib::Tablelist_usingTile
Tk::Tcllib::Tablelist_usingTile = true
end
-requrie 'tkextlib/tcllib/tablelist_core'
+require 'tkextlib/tcllib/tablelist_core'
module Tk
module Tcllib
diff --git a/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb b/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
index 2f6e4b44fc..2fc75a68ec 100644
--- a/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/tkpiechart.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/toolbar.rb b/ext/tk/lib/tkextlib/tcllib/toolbar.rb
index 6eae4eb3e1..a771548db4 100644
--- a/ext/tk/lib/tkextlib/tcllib/toolbar.rb
+++ b/ext/tk/lib/tkextlib/tcllib/toolbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/toolbar.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
@@ -56,7 +57,7 @@ class Tk::Tcllib::Widget::ToolbarItem < TkObject
}
end
- def initaialize(parent, *args)
+ def initialize(parent, *args)
@parent = @t = parent
@tpath = parent.path
diff --git a/ext/tk/lib/tkextlib/tcllib/tooltip.rb b/ext/tk/lib/tkextlib/tcllib/tooltip.rb
index 070e63a7b5..4a70ec5732 100644
--- a/ext/tk/lib/tkextlib/tcllib/tooltip.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tooltip.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/tooltip.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tcllib/validator.rb b/ext/tk/lib/tkextlib/tcllib/validator.rb
new file mode 100644
index 0000000000..c2c9dda376
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/validator.rb
@@ -0,0 +1,66 @@
+# frozen_string_literal: false
+#
+# tkextlib/tcllib/validator.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Provides a unified validation API
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::validator', '0.1')
+TkPackage.require('widget::validator')
+
+module Tk::Tcllib
+ module Validator
+ PACKAGE_NAME = 'widget::validator'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::validator')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+module Tk::Tcllib::Validator
+ extend TkCore
+
+ def self.attach(widget, color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'attach', widget, color, cmd)
+ nil
+ end
+
+ def self.detach(widget)
+ tk_call_without_enc('::widget::validator', 'detach', widget)
+ nil
+ end
+
+ def self.validate(widget)
+ tk_call_without_enc('::widget::validator', 'validate', widget)
+ nil
+ end
+
+ def attach_validator(color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'attach', @path, color, cmd)
+ self
+ end
+
+ def detach_validator(color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'detach', @path)
+ self
+ end
+
+ def invoke_validator(color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'validate', @path)
+ self
+ end
+ alias validate_validator invoke_validator
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/widget.rb b/ext/tk/lib/tkextlib/tcllib/widget.rb
index 57fdf7a575..b8d5070b0b 100644
--- a/ext/tk/lib/tkextlib/tcllib/widget.rb
+++ b/ext/tk/lib/tkextlib/tcllib/widget.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tcllib/widget.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tclx.rb b/ext/tk/lib/tkextlib/tclx.rb
index 3a4ff27644..1189d855cb 100644
--- a/ext/tk/lib/tkextlib/tclx.rb
+++ b/ext/tk/lib/tkextlib/tclx.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TclX support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tclx/setup.rb b/ext/tk/lib/tkextlib/tclx/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tclx/setup.rb
+++ b/ext/tk/lib/tkextlib/tclx/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tclx/tclx.rb b/ext/tk/lib/tkextlib/tclx/tclx.rb
index 5a908fcd0b..7360a85403 100644
--- a/ext/tk/lib/tkextlib/tclx/tclx.rb
+++ b/ext/tk/lib/tkextlib/tclx/tclx.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tclx/tclx.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile.rb b/ext/tk/lib/tkextlib/tile.rb
index 6c11e212ae..ef15351066 100644
--- a/ext/tk/lib/tkextlib/tile.rb
+++ b/ext/tk/lib/tkextlib/tile.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Tile theme engin (tile widget set) support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/dialog.rb b/ext/tk/lib/tkextlib/tile/dialog.rb
index b112e6152b..d81851bb68 100644
--- a/ext/tk/lib/tkextlib/tile/dialog.rb
+++ b/ext/tk/lib/tkextlib/tile/dialog.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ttk::dialog (tile-0.7+)
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/setup.rb b/ext/tk/lib/tkextlib/tile/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tile/setup.rb
+++ b/ext/tk/lib/tkextlib/tile/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tile/sizegrip.rb b/ext/tk/lib/tkextlib/tile/sizegrip.rb
index 9947e0d870..4b9510aefa 100644
--- a/ext/tk/lib/tkextlib/tile/sizegrip.rb
+++ b/ext/tk/lib/tkextlib/tile/sizegrip.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ttk::sizegrip widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb
index 83a0c9a2e8..a96cba795f 100644
--- a/ext/tk/lib/tkextlib/tile/style.rb
+++ b/ext/tk/lib/tkextlib/tile/style.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# style commands
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tbutton.rb b/ext/tk/lib/tkextlib/tile/tbutton.rb
index c852024842..217da62eca 100644
--- a/ext/tk/lib/tkextlib/tile/tbutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tbutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tbutton widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
index 01751ede0f..c0e4d4b505 100644
--- a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tcheckbutton widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tcombobox.rb b/ext/tk/lib/tkextlib/tile/tcombobox.rb
index b5ab827e2d..f2dec21fbf 100644
--- a/ext/tk/lib/tkextlib/tile/tcombobox.rb
+++ b/ext/tk/lib/tkextlib/tile/tcombobox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tcombobox widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tentry.rb b/ext/tk/lib/tkextlib/tile/tentry.rb
index 8d2633a774..5d577a65a6 100644
--- a/ext/tk/lib/tkextlib/tile/tentry.rb
+++ b/ext/tk/lib/tkextlib/tile/tentry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tentry widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tframe.rb b/ext/tk/lib/tkextlib/tile/tframe.rb
index d6d4312628..5ebf19d1e8 100644
--- a/ext/tk/lib/tkextlib/tile/tframe.rb
+++ b/ext/tk/lib/tkextlib/tile/tframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tframe widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tlabel.rb b/ext/tk/lib/tkextlib/tile/tlabel.rb
index 55b98acc68..3dddeafc21 100644
--- a/ext/tk/lib/tkextlib/tile/tlabel.rb
+++ b/ext/tk/lib/tkextlib/tile/tlabel.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tlabel widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tlabelframe.rb b/ext/tk/lib/tkextlib/tile/tlabelframe.rb
index a34c98583f..d512f31ffe 100644
--- a/ext/tk/lib/tkextlib/tile/tlabelframe.rb
+++ b/ext/tk/lib/tkextlib/tile/tlabelframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tlabelframe widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tmenubutton.rb b/ext/tk/lib/tkextlib/tile/tmenubutton.rb
index 1cf553ec8c..a22ebaeca7 100644
--- a/ext/tk/lib/tkextlib/tile/tmenubutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tmenubutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tmenubutton widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tnotebook.rb b/ext/tk/lib/tkextlib/tile/tnotebook.rb
index 9e27e2c1fd..4089dcfd4b 100644
--- a/ext/tk/lib/tkextlib/tile/tnotebook.rb
+++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tnotebook widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tpaned.rb b/ext/tk/lib/tkextlib/tile/tpaned.rb
index d6ad234559..f51a1f3b41 100644
--- a/ext/tk/lib/tkextlib/tile/tpaned.rb
+++ b/ext/tk/lib/tkextlib/tile/tpaned.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tpaned widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tprogressbar.rb b/ext/tk/lib/tkextlib/tile/tprogressbar.rb
index 0c9d15e1b9..446e053e3b 100644
--- a/ext/tk/lib/tkextlib/tile/tprogressbar.rb
+++ b/ext/tk/lib/tkextlib/tile/tprogressbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tprogressbar widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tradiobutton.rb b/ext/tk/lib/tkextlib/tile/tradiobutton.rb
index 5dbf260666..202de1eb25 100644
--- a/ext/tk/lib/tkextlib/tile/tradiobutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tradiobutton.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tradiobutton widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/treeview.rb b/ext/tk/lib/tkextlib/tile/treeview.rb
index 70db3d6d78..1be8f54348 100644
--- a/ext/tk/lib/tkextlib/tile/treeview.rb
+++ b/ext/tk/lib/tkextlib/tile/treeview.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# treeview widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
@@ -986,6 +987,18 @@ class Tk::Tile::Treeview::Tag < TkObject
end
alias added? tag_has?
+ def tag_has
+ @t.tag_has(@id)
+ end
+
+ def add(*items)
+ @t.tag_add(@id, *items)
+ end
+
+ def remove(*items)
+ @t.tag_remove(@id, *items)
+ end
+
def bind(seq, *args)
if TkComm._callback_entry?(args[0]) || !block_given?
cmd = args.shift
@@ -1299,6 +1312,24 @@ class Tk::Tile::Treeview < TkWindow
_bindinfo([@path, 'tag', 'bind', tag], context)
end
alias tagbindinfo tag_bindinfo
+
+ def tag_names
+ tk_split_simplelist(tk_send('tag', 'names')).collect{|id|
+ Tk::Tile::Treeview::Tag.id2obj(self, id)
+ }
+ end
+
+ def tag_add(tag, *items)
+ fail ArgumentError, "no target items" if items.empty?
+ tk_send('tag', 'add', tagid(tag), *(items.collect{|item| tagid(item)}))
+ self
+ end
+
+ def tag_remove(tag, *items)
+ tk_send('tag', 'remove', tagid(tag), *(items.collect{|item| tagid(item)}))
+ self
+ end
+
end
#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
diff --git a/ext/tk/lib/tkextlib/tile/tscale.rb b/ext/tk/lib/tkextlib/tile/tscale.rb
index 7eefcef731..446344ecea 100644
--- a/ext/tk/lib/tkextlib/tile/tscale.rb
+++ b/ext/tk/lib/tkextlib/tile/tscale.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tscale & tprogress widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tscrollbar.rb b/ext/tk/lib/tkextlib/tile/tscrollbar.rb
index c6bba5810b..621ca48efb 100644
--- a/ext/tk/lib/tkextlib/tile/tscrollbar.rb
+++ b/ext/tk/lib/tkextlib/tile/tscrollbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tscrollbar widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tseparator.rb b/ext/tk/lib/tkextlib/tile/tseparator.rb
index ffd2f6f89f..d4a90e56db 100644
--- a/ext/tk/lib/tkextlib/tile/tseparator.rb
+++ b/ext/tk/lib/tkextlib/tile/tseparator.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tseparator widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tspinbox.rb b/ext/tk/lib/tkextlib/tile/tspinbox.rb
index 2f2d73c5ab..47d822e68c 100644
--- a/ext/tk/lib/tkextlib/tile/tspinbox.rb
+++ b/ext/tk/lib/tkextlib/tile/tspinbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ttk::spinbox widget (Tcl/Tk 8.6b1 or later)
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tile/tsquare.rb b/ext/tk/lib/tkextlib/tile/tsquare.rb
index a81cd7b98a..7412966708 100644
--- a/ext/tk/lib/tkextlib/tile/tsquare.rb
+++ b/ext/tk/lib/tkextlib/tile/tsquare.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tsquare widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkDND.rb b/ext/tk/lib/tkextlib/tkDND.rb
index 5d52e34418..c76c48d169 100644
--- a/ext/tk/lib/tkextlib/tkDND.rb
+++ b/ext/tk/lib/tkextlib/tkDND.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkDND (Tk Drag & Drop Extension) support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkDND/setup.rb b/ext/tk/lib/tkextlib/tkDND/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tkDND/setup.rb
+++ b/ext/tk/lib/tkextlib/tkDND/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tkDND/shape.rb b/ext/tk/lib/tkextlib/tkDND/shape.rb
index d44068ed33..06d8d64ac7 100644
--- a/ext/tk/lib/tkextlib/tkDND/shape.rb
+++ b/ext/tk/lib/tkextlib/tkDND/shape.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tkDND/shape.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
index 97cdfc7f1c..c2059b7c23 100644
--- a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
+++ b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tkDND/tkdnd.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
@@ -158,7 +159,7 @@ module Tk
cmd = Proc.new
end
- args = [None] if args.empty
+ args = [TkComm::None] if args.empty?
tk_call('dnd', 'bindsource', @path, type, cmd, *args)
self
diff --git a/ext/tk/lib/tkextlib/tkHTML.rb b/ext/tk/lib/tkextlib/tkHTML.rb
index 5fddde72ff..d64e676024 100644
--- a/ext/tk/lib/tkextlib/tkHTML.rb
+++ b/ext/tk/lib/tkextlib/tkHTML.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkHtml support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb b/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
index b9ee90aace..362c381830 100644
--- a/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
+++ b/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tkHTML/htmlwidget.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkHTML/setup.rb b/ext/tk/lib/tkextlib/tkHTML/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tkHTML/setup.rb
+++ b/ext/tk/lib/tkextlib/tkHTML/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tkimg.rb b/ext/tk/lib/tkextlib/tkimg.rb
index c01359d3ef..de4b7212c3 100644
--- a/ext/tk/lib/tkextlib/tkimg.rb
+++ b/ext/tk/lib/tkextlib/tkimg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg extension support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/bmp.rb b/ext/tk/lib/tkextlib/tkimg/bmp.rb
index ea90181aa3..48a3b7ef5f 100644
--- a/ext/tk/lib/tkextlib/tkimg/bmp.rb
+++ b/ext/tk/lib/tkextlib/tkimg/bmp.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'bmp'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/dted.rb b/ext/tk/lib/tkextlib/tkimg/dted.rb
new file mode 100644
index 0000000000..30c595c1b6
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/dted.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: false
+#
+# TkImg - format 'DTED'
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/tkimg/setup.rb'
+
+# TkPackage.require('img::dted', '1.4')
+TkPackage.require('img::dted')
+
+module Tk
+ module Img
+ module DTED
+ PACKAGE_NAME = 'img::dted'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::dted')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/gif.rb b/ext/tk/lib/tkextlib/tkimg/gif.rb
index d542d47561..ce5f3e94ec 100644
--- a/ext/tk/lib/tkextlib/tkimg/gif.rb
+++ b/ext/tk/lib/tkextlib/tkimg/gif.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'gif'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/ico.rb b/ext/tk/lib/tkextlib/tkimg/ico.rb
index e79bdf45e9..80656005f0 100644
--- a/ext/tk/lib/tkextlib/tkimg/ico.rb
+++ b/ext/tk/lib/tkextlib/tkimg/ico.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'ico'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/jpeg.rb b/ext/tk/lib/tkextlib/tkimg/jpeg.rb
index 2126120161..24e11a84de 100644
--- a/ext/tk/lib/tkextlib/tkimg/jpeg.rb
+++ b/ext/tk/lib/tkextlib/tkimg/jpeg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'jpeg'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/pcx.rb b/ext/tk/lib/tkextlib/tkimg/pcx.rb
index 6831f4d35b..942d585120 100644
--- a/ext/tk/lib/tkextlib/tkimg/pcx.rb
+++ b/ext/tk/lib/tkextlib/tkimg/pcx.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'pcx'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)#
diff --git a/ext/tk/lib/tkextlib/tkimg/pixmap.rb b/ext/tk/lib/tkextlib/tkimg/pixmap.rb
index bd1b870af7..b90468a108 100644
--- a/ext/tk/lib/tkextlib/tkimg/pixmap.rb
+++ b/ext/tk/lib/tkextlib/tkimg/pixmap.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'pixmap'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/png.rb b/ext/tk/lib/tkextlib/tkimg/png.rb
index 5c829f48d2..76f7329772 100644
--- a/ext/tk/lib/tkextlib/tkimg/png.rb
+++ b/ext/tk/lib/tkextlib/tkimg/png.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'png'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/ppm.rb b/ext/tk/lib/tkextlib/tkimg/ppm.rb
index eacfae467d..a6b705e6ad 100644
--- a/ext/tk/lib/tkextlib/tkimg/ppm.rb
+++ b/ext/tk/lib/tkextlib/tkimg/ppm.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'ppm'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/ps.rb b/ext/tk/lib/tkextlib/tkimg/ps.rb
index 68e9178ac0..2a450ed157 100644
--- a/ext/tk/lib/tkextlib/tkimg/ps.rb
+++ b/ext/tk/lib/tkextlib/tkimg/ps.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'ps'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/raw.rb b/ext/tk/lib/tkextlib/tkimg/raw.rb
new file mode 100644
index 0000000000..2eddbbc43a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/raw.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: false
+#
+# TkImg - format 'Raw Data'
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/tkimg/setup.rb'
+
+# TkPackage.require('img::raw', '1.4')
+TkPackage.require('img::raw')
+
+module Tk
+ module Img
+ module Raw
+ PACKAGE_NAME = 'img::raw'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::raw')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/setup.rb b/ext/tk/lib/tkextlib/tkimg/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tkimg/setup.rb
+++ b/ext/tk/lib/tkextlib/tkimg/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tkimg/sgi.rb b/ext/tk/lib/tkextlib/tkimg/sgi.rb
index ec7038bf0e..73a5bce0ac 100644
--- a/ext/tk/lib/tkextlib/tkimg/sgi.rb
+++ b/ext/tk/lib/tkextlib/tkimg/sgi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'sgi'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/sun.rb b/ext/tk/lib/tkextlib/tkimg/sun.rb
index 651f946497..bd1ac0e577 100644
--- a/ext/tk/lib/tkextlib/tkimg/sun.rb
+++ b/ext/tk/lib/tkextlib/tkimg/sun.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'sun'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/tga.rb b/ext/tk/lib/tkextlib/tkimg/tga.rb
index 1eae407c0a..1dd499b953 100644
--- a/ext/tk/lib/tkextlib/tkimg/tga.rb
+++ b/ext/tk/lib/tkextlib/tkimg/tga.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'tga'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/tiff.rb b/ext/tk/lib/tkextlib/tkimg/tiff.rb
index ed271c2600..a2d1d8fcc5 100644
--- a/ext/tk/lib/tkextlib/tkimg/tiff.rb
+++ b/ext/tk/lib/tkextlib/tkimg/tiff.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'tiff'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/window.rb b/ext/tk/lib/tkextlib/tkimg/window.rb
index 3b5906fab6..346f246aa4 100644
--- a/ext/tk/lib/tkextlib/tkimg/window.rb
+++ b/ext/tk/lib/tkextlib/tkimg/window.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'window'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/xbm.rb b/ext/tk/lib/tkextlib/tkimg/xbm.rb
index f4bea030be..0a4deffdd7 100644
--- a/ext/tk/lib/tkextlib/tkimg/xbm.rb
+++ b/ext/tk/lib/tkextlib/tkimg/xbm.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'xbm'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tkimg/xpm.rb b/ext/tk/lib/tkextlib/tkimg/xpm.rb
index 5119c8710b..7708b9d427 100644
--- a/ext/tk/lib/tkextlib/tkimg/xpm.rb
+++ b/ext/tk/lib/tkextlib/tkimg/xpm.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkImg - format 'xpm'
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tktable.rb b/ext/tk/lib/tkextlib/tktable.rb
index 385eb13497..a957294db0 100644
--- a/ext/tk/lib/tkextlib/tktable.rb
+++ b/ext/tk/lib/tkextlib/tktable.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkTable support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tktable/setup.rb b/ext/tk/lib/tkextlib/tktable/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tktable/setup.rb
+++ b/ext/tk/lib/tkextlib/tktable/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tktable/tktable.rb b/ext/tk/lib/tkextlib/tktable/tktable.rb
index f7074655ed..d8811a9676 100644
--- a/ext/tk/lib/tkextlib/tktable/tktable.rb
+++ b/ext/tk/lib/tkextlib/tktable/tktable.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/tktable/tktable.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tktrans.rb b/ext/tk/lib/tkextlib/tktrans.rb
index c5de5be5e6..031eeb9fd7 100644
--- a/ext/tk/lib/tkextlib/tktrans.rb
+++ b/ext/tk/lib/tkextlib/tktrans.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkTrans support (win32 only)
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/tktrans/setup.rb b/ext/tk/lib/tkextlib/tktrans/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/tktrans/setup.rb
+++ b/ext/tk/lib/tkextlib/tktrans/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/tktrans/tktrans.rb b/ext/tk/lib/tkextlib/tktrans/tktrans.rb
index e051c09211..e6e0e3a78d 100644
--- a/ext/tk/lib/tkextlib/tktrans/tktrans.rb
+++ b/ext/tk/lib/tkextlib/tktrans/tktrans.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkTrans support (win32 only)
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/treectrl.rb b/ext/tk/lib/tkextlib/treectrl.rb
index 1944fb83e3..227d55ff1e 100644
--- a/ext/tk/lib/tkextlib/treectrl.rb
+++ b/ext/tk/lib/tkextlib/treectrl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# TkTreeCtrl support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/treectrl/setup.rb b/ext/tk/lib/tkextlib/treectrl/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/treectrl/setup.rb
+++ b/ext/tk/lib/tkextlib/treectrl/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb
index 1879a531ae..dbd59f8c05 100644
--- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb
+++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/treectrl/tktreectrl.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/trofs.rb b/ext/tk/lib/tkextlib/trofs.rb
index 5914e5165f..46581a3dad 100644
--- a/ext/tk/lib/tkextlib/trofs.rb
+++ b/ext/tk/lib/tkextlib/trofs.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# trofs support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/trofs/setup.rb b/ext/tk/lib/tkextlib/trofs/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/trofs/setup.rb
+++ b/ext/tk/lib/tkextlib/trofs/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/trofs/trofs.rb b/ext/tk/lib/tkextlib/trofs/trofs.rb
index 7a2606a275..dc55ec269a 100644
--- a/ext/tk/lib/tkextlib/trofs/trofs.rb
+++ b/ext/tk/lib/tkextlib/trofs/trofs.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/trofs/trofs.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/version.rb b/ext/tk/lib/tkextlib/version.rb
index 4bef78fe54..68c8ae31a2 100644
--- a/ext/tk/lib/tkextlib/version.rb
+++ b/ext/tk/lib/tkextlib/version.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# release date of tkextlib
#
diff --git a/ext/tk/lib/tkextlib/vu.rb b/ext/tk/lib/tkextlib/vu.rb
index d2234eb2a8..145a0b5647 100644
--- a/ext/tk/lib/tkextlib/vu.rb
+++ b/ext/tk/lib/tkextlib/vu.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# The vu widget set support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/vu/bargraph.rb b/ext/tk/lib/tkextlib/vu/bargraph.rb
index b9fcf925f3..e1d58e9555 100644
--- a/ext/tk/lib/tkextlib/vu/bargraph.rb
+++ b/ext/tk/lib/tkextlib/vu/bargraph.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ::vu::bargraph widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/vu/charts.rb b/ext/tk/lib/tkextlib/vu/charts.rb
index 8569ac5541..66d5cfd394 100644
--- a/ext/tk/lib/tkextlib/vu/charts.rb
+++ b/ext/tk/lib/tkextlib/vu/charts.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# charts -- Create and manipulate canvas Add-On Items
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/vu/dial.rb b/ext/tk/lib/tkextlib/vu/dial.rb
index 4d04974a55..7eb5650df0 100644
--- a/ext/tk/lib/tkextlib/vu/dial.rb
+++ b/ext/tk/lib/tkextlib/vu/dial.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ::vu::dial widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/vu/pie.rb b/ext/tk/lib/tkextlib/vu/pie.rb
index 6b0c485d8a..fb9920cc68 100644
--- a/ext/tk/lib/tkextlib/vu/pie.rb
+++ b/ext/tk/lib/tkextlib/vu/pie.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ::vu::pie widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/vu/setup.rb b/ext/tk/lib/tkextlib/vu/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/vu/setup.rb
+++ b/ext/tk/lib/tkextlib/vu/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/vu/spinbox.rb b/ext/tk/lib/tkextlib/vu/spinbox.rb
index 7d6104f4d1..082ebd1f62 100644
--- a/ext/tk/lib/tkextlib/vu/spinbox.rb
+++ b/ext/tk/lib/tkextlib/vu/spinbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ::vu::spinbox widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/winico.rb b/ext/tk/lib/tkextlib/winico.rb
index ce7b8eac5c..996fc409b8 100644
--- a/ext/tk/lib/tkextlib/winico.rb
+++ b/ext/tk/lib/tkextlib/winico.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# winico -- Windows Icon extension support
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkextlib/winico/setup.rb b/ext/tk/lib/tkextlib/winico/setup.rb
index ee406c6ca0..cc967dced6 100644
--- a/ext/tk/lib/tkextlib/winico/setup.rb
+++ b/ext/tk/lib/tkextlib/winico/setup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# setup.rb -- setup script before calling TkPackage.require()
#
diff --git a/ext/tk/lib/tkextlib/winico/winico.rb b/ext/tk/lib/tkextlib/winico/winico.rb
index 9160c2960f..dda0357a16 100644
--- a/ext/tk/lib/tkextlib/winico/winico.rb
+++ b/ext/tk/lib/tkextlib/winico/winico.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkextlib/winico/winico.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb
index 38a96633de..6036006aac 100644
--- a/ext/tk/lib/tkfont.rb
+++ b/ext/tk/lib/tkfont.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkfont.rb - load tk/font.rb
#
diff --git a/ext/tk/lib/tkmacpkg.rb b/ext/tk/lib/tkmacpkg.rb
index 35560e78ce..4f76c2feb8 100644
--- a/ext/tk/lib/tkmacpkg.rb
+++ b/ext/tk/lib/tkmacpkg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkmacpkg.rb - load tk/macpkg.rb
#
diff --git a/ext/tk/lib/tkmenubar.rb b/ext/tk/lib/tkmenubar.rb
index 70214fda1a..43109e2b67 100644
--- a/ext/tk/lib/tkmenubar.rb
+++ b/ext/tk/lib/tkmenubar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkmenubar.rb - load tk/menubar.rb
#
diff --git a/ext/tk/lib/tkmngfocus.rb b/ext/tk/lib/tkmngfocus.rb
index fe70950e8e..43abd210c9 100644
--- a/ext/tk/lib/tkmngfocus.rb
+++ b/ext/tk/lib/tkmngfocus.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkmngfocus.rb - load tk/mngfocus.rb
#
diff --git a/ext/tk/lib/tkpalette.rb b/ext/tk/lib/tkpalette.rb
index 56b203bbb9..f4e7321c47 100644
--- a/ext/tk/lib/tkpalette.rb
+++ b/ext/tk/lib/tkpalette.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkpalette.rb - load tk/palette.rb
#
diff --git a/ext/tk/lib/tkscrollbox.rb b/ext/tk/lib/tkscrollbox.rb
index 6093b2e4e7..c316ce2ea6 100644
--- a/ext/tk/lib/tkscrollbox.rb
+++ b/ext/tk/lib/tkscrollbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkscrollbox.rb - load tk/scrollbox.rb
#
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb
index 97ad62a3ea..8ed41ac15a 100644
--- a/ext/tk/lib/tktext.rb
+++ b/ext/tk/lib/tktext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tktext.rb - load tk/text.rb
#
diff --git a/ext/tk/lib/tkvirtevent.rb b/ext/tk/lib/tkvirtevent.rb
index f4fae19a0a..4efa790505 100644
--- a/ext/tk/lib/tkvirtevent.rb
+++ b/ext/tk/lib/tkvirtevent.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkvirtevent.rb - load tk/virtevent.rb
#
diff --git a/ext/tk/lib/tkwinpkg.rb b/ext/tk/lib/tkwinpkg.rb
index 83371c546d..97c84f8ab1 100644
--- a/ext/tk/lib/tkwinpkg.rb
+++ b/ext/tk/lib/tkwinpkg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkwinpkg.rb - load tk/winpkg.rb
#
diff --git a/ext/tk/old-extconf.rb b/ext/tk/old-extconf.rb
index ebc83a0c0b..a13fa4c46e 100644
--- a/ext/tk/old-extconf.rb
+++ b/ext/tk/old-extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# extconf.rb for tcltklib
require 'mkmf'
diff --git a/ext/tk/sample/24hr_clock.rb b/ext/tk/sample/24hr_clock.rb
index 29f84e0b40..3a030ddaf2 100644
--- a/ext/tk/sample/24hr_clock.rb
+++ b/ext/tk/sample/24hr_clock.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
diff --git a/ext/tk/sample/binding_sample.rb b/ext/tk/sample/binding_sample.rb
index 3c2eb5e1cb..a324a745f3 100644
--- a/ext/tk/sample/binding_sample.rb
+++ b/ext/tk/sample/binding_sample.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
diff --git a/ext/tk/sample/bindtag_sample.rb b/ext/tk/sample/bindtag_sample.rb
index b13364bb68..7b4ac16f64 100644
--- a/ext/tk/sample/bindtag_sample.rb
+++ b/ext/tk/sample/bindtag_sample.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
TkLabel.new(:text=><<EOT, :justify=>:left).pack
diff --git a/ext/tk/sample/binstr_usage.rb b/ext/tk/sample/binstr_usage.rb
index fa81f98b5e..92882b8e1b 100644
--- a/ext/tk/sample/binstr_usage.rb
+++ b/ext/tk/sample/binstr_usage.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require "tk"
diff --git a/ext/tk/sample/btn_with_frame.rb b/ext/tk/sample/btn_with_frame.rb
index d04c95a289..43e120b123 100644
--- a/ext/tk/sample/btn_with_frame.rb
+++ b/ext/tk/sample/btn_with_frame.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'tk'
class Button_with_Frame < TkButton
diff --git a/ext/tk/sample/cd_timer.rb b/ext/tk/sample/cd_timer.rb
index e2611fbf23..1efe8cdb7c 100644
--- a/ext/tk/sample/cd_timer.rb
+++ b/ext/tk/sample/cd_timer.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# countdown timer
# usage: cd_timer min [, min ... ]
diff --git a/ext/tk/sample/cmd_res_test.rb b/ext/tk/sample/cmd_res_test.rb
index 8df2e61af7..52c5bc7515 100644
--- a/ext/tk/sample/cmd_res_test.rb
+++ b/ext/tk/sample/cmd_res_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'tk'
TkOptionDB.readfile(File.expand_path('cmd_resource',
File.dirname(__FILE__)))
diff --git a/ext/tk/sample/demos-en/anilabel.rb b/ext/tk/sample/demos-en/anilabel.rb
index ebd84accd2..a48f4a10e8 100644
--- a/ext/tk/sample/demos-en/anilabel.rb
+++ b/ext/tk/sample/demos-en/anilabel.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# animated label widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/aniwave.rb b/ext/tk/sample/demos-en/aniwave.rb
index 57d58193f6..955f202767 100644
--- a/ext/tk/sample/demos-en/aniwave.rb
+++ b/ext/tk/sample/demos-en/aniwave.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# animated wave demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/arrow.rb b/ext/tk/sample/demos-en/arrow.rb
index 452153d010..46229668c2 100644
--- a/ext/tk/sample/demos-en/arrow.rb
+++ b/ext/tk/sample/demos-en/arrow.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# arrow.rb
#
# This demonstration script creates a canvas widget that displays a
diff --git a/ext/tk/sample/demos-en/bind.rb b/ext/tk/sample/demos-en/bind.rb
index c291e4730a..38f2b46eaf 100644
--- a/ext/tk/sample/demos-en/bind.rb
+++ b/ext/tk/sample/demos-en/bind.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# bind.rb
#
# This demonstration script creates a text widget with bindings set
diff --git a/ext/tk/sample/demos-en/bitmap.rb b/ext/tk/sample/demos-en/bitmap.rb
index 858d067d0d..bb7a13d7b6 100644
--- a/ext/tk/sample/demos-en/bitmap.rb
+++ b/ext/tk/sample/demos-en/bitmap.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# bitmap.rb
#
# This demonstration script creates a toplevel window that displays
diff --git a/ext/tk/sample/demos-en/button.rb b/ext/tk/sample/demos-en/button.rb
index f63a2f3b06..00331002d2 100644
--- a/ext/tk/sample/demos-en/button.rb
+++ b/ext/tk/sample/demos-en/button.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# button.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/check.rb b/ext/tk/sample/demos-en/check.rb
index bf0b73476a..3f3b07bd0a 100644
--- a/ext/tk/sample/demos-en/check.rb
+++ b/ext/tk/sample/demos-en/check.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# check.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/check2.rb b/ext/tk/sample/demos-en/check2.rb
index 4f7b1f07bc..d68b86438a 100644
--- a/ext/tk/sample/demos-en/check2.rb
+++ b/ext/tk/sample/demos-en/check2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# checkbutton widget demo2 (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/clrpick.rb b/ext/tk/sample/demos-en/clrpick.rb
index 6da28cb112..081d11be4f 100644
--- a/ext/tk/sample/demos-en/clrpick.rb
+++ b/ext/tk/sample/demos-en/clrpick.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# clrpick.rb
#
# This demonstration script prompts the user to select a color.
diff --git a/ext/tk/sample/demos-en/colors.rb b/ext/tk/sample/demos-en/colors.rb
index b0ef9590b9..dca147b51e 100644
--- a/ext/tk/sample/demos-en/colors.rb
+++ b/ext/tk/sample/demos-en/colors.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# colors.rb
#
# This demonstration script creates a listbox widget that displays
diff --git a/ext/tk/sample/demos-en/combo.rb b/ext/tk/sample/demos-en/combo.rb
index d77660095c..b8bf2d8803 100644
--- a/ext/tk/sample/demos-en/combo.rb
+++ b/ext/tk/sample/demos-en/combo.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# combo.rb --
#
# This demonstration script creates several combobox widgets.
@@ -71,7 +72,7 @@ australianCities = [
]
-secondValue.value = 'unchangable'
+secondValue.value = 'unchangeable'
ozCity.value = 'Sydney'
Tk.pack(Ttk::Labelframe.new(frame, :text=>'Fully Editable'){|f|
diff --git a/ext/tk/sample/demos-en/cscroll.rb b/ext/tk/sample/demos-en/cscroll.rb
index 40a3afc0ad..eac615d035 100644
--- a/ext/tk/sample/demos-en/cscroll.rb
+++ b/ext/tk/sample/demos-en/cscroll.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# cscroll.rb
#
# This demonstration script creates a simple canvas that can be
diff --git a/ext/tk/sample/demos-en/ctext.rb b/ext/tk/sample/demos-en/ctext.rb
index e04cb283f0..dbd26d21df 100644
--- a/ext/tk/sample/demos-en/ctext.rb
+++ b/ext/tk/sample/demos-en/ctext.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# ctext.rb
#
# This demonstration script creates a canvas widget with a text
diff --git a/ext/tk/sample/demos-en/dialog1.rb b/ext/tk/sample/demos-en/dialog1.rb
index af476ecd05..3fd56a69c3 100644
--- a/ext/tk/sample/demos-en/dialog1.rb
+++ b/ext/tk/sample/demos-en/dialog1.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# a dialog box with a local grab (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/dialog2.rb b/ext/tk/sample/demos-en/dialog2.rb
index efc4b714da..fed14081c8 100644
--- a/ext/tk/sample/demos-en/dialog2.rb
+++ b/ext/tk/sample/demos-en/dialog2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# a dialog box with a global grab (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/entry1.rb b/ext/tk/sample/demos-en/entry1.rb
index fac0afc243..d6b0af2b5d 100644
--- a/ext/tk/sample/demos-en/entry1.rb
+++ b/ext/tk/sample/demos-en/entry1.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# entry (no scrollbars) widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/entry2.rb b/ext/tk/sample/demos-en/entry2.rb
index 05a6c83cfd..460a0a02ea 100644
--- a/ext/tk/sample/demos-en/entry2.rb
+++ b/ext/tk/sample/demos-en/entry2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# entry2.rb
#
# This demonstration script is the same as the entry1.tcl script
diff --git a/ext/tk/sample/demos-en/entry3.rb b/ext/tk/sample/demos-en/entry3.rb
index d3bc629fdf..6170fe1365 100644
--- a/ext/tk/sample/demos-en/entry3.rb
+++ b/ext/tk/sample/demos-en/entry3.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# entry3.rb --
#
# This demonstration script creates several entry widgets whose
diff --git a/ext/tk/sample/demos-en/filebox.rb b/ext/tk/sample/demos-en/filebox.rb
index 0c284c11d4..2bdf0aac10 100644
--- a/ext/tk/sample/demos-en/filebox.rb
+++ b/ext/tk/sample/demos-en/filebox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# filebox.rb
#
# This demonstration script prompts the user to select a file.#
diff --git a/ext/tk/sample/demos-en/floor.rb b/ext/tk/sample/demos-en/floor.rb
index eb8b23eb7d..b22ccecfd2 100644
--- a/ext/tk/sample/demos-en/floor.rb
+++ b/ext/tk/sample/demos-en/floor.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# floor.rb
#
# This demonstration script creates a canvas widet that displays the
diff --git a/ext/tk/sample/demos-en/floor2.rb b/ext/tk/sample/demos-en/floor2.rb
index 3bfa89a920..a95bfedbfd 100644
--- a/ext/tk/sample/demos-en/floor2.rb
+++ b/ext/tk/sample/demos-en/floor2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
%# floor2.rb
#
# This demonstration script creates a canvas widet that displays the
diff --git a/ext/tk/sample/demos-en/form.rb b/ext/tk/sample/demos-en/form.rb
index abb3e0e10e..b6c6655083 100644
--- a/ext/tk/sample/demos-en/form.rb
+++ b/ext/tk/sample/demos-en/form.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# form widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/goldberg.rb b/ext/tk/sample/demos-en/goldberg.rb
index d3956ef78c..555ad4af35 100644
--- a/ext/tk/sample/demos-en/goldberg.rb
+++ b/ext/tk/sample/demos-en/goldberg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Ruby/Tk Goldverg demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/hscale.rb b/ext/tk/sample/demos-en/hscale.rb
index e660216967..05a8f39362 100644
--- a/ext/tk/sample/demos-en/hscale.rb
+++ b/ext/tk/sample/demos-en/hscale.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require "tkcanvas"
if defined?($hscale_demo) && $hscale_demo
diff --git a/ext/tk/sample/demos-en/icon.rb b/ext/tk/sample/demos-en/icon.rb
index bab40da214..ab29a0c186 100644
--- a/ext/tk/sample/demos-en/icon.rb
+++ b/ext/tk/sample/demos-en/icon.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# icon.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/image1.rb b/ext/tk/sample/demos-en/image1.rb
index 233cb963d1..c7c0989df8 100644
--- a/ext/tk/sample/demos-en/image1.rb
+++ b/ext/tk/sample/demos-en/image1.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
## image1.rb
#
# This demonstration script displays two image widgets.
diff --git a/ext/tk/sample/demos-en/image2.rb b/ext/tk/sample/demos-en/image2.rb
index 13098af1b6..dfb993e434 100644
--- a/ext/tk/sample/demos-en/image2.rb
+++ b/ext/tk/sample/demos-en/image2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# image2.rb
#
# This demonstration script creates a simple collection of widgets
diff --git a/ext/tk/sample/demos-en/image3.rb b/ext/tk/sample/demos-en/image3.rb
index edb6d231bf..2879cd4bff 100644
--- a/ext/tk/sample/demos-en/image3.rb
+++ b/ext/tk/sample/demos-en/image3.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# image3.rb
#
# This demonstration script creates a simple collection of widgets
diff --git a/ext/tk/sample/demos-en/items.rb b/ext/tk/sample/demos-en/items.rb
index 01a4072cb7..d6de1e557e 100644
--- a/ext/tk/sample/demos-en/items.rb
+++ b/ext/tk/sample/demos-en/items.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# items.rb
#
# This demonstration script creates a canvas that displays the
diff --git a/ext/tk/sample/demos-en/knightstour.rb b/ext/tk/sample/demos-en/knightstour.rb
index 6f96a5be10..1ad82fcc9d 100644
--- a/ext/tk/sample/demos-en/knightstour.rb
+++ b/ext/tk/sample/demos-en/knightstour.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# Based on the widget demo of Tcl/Tk8.5.2
# The following is the original copyright text.
#----------------------------------------------------------------------------
diff --git a/ext/tk/sample/demos-en/label.rb b/ext/tk/sample/demos-en/label.rb
index 5be06eafee..d9cfd92364 100644
--- a/ext/tk/sample/demos-en/label.rb
+++ b/ext/tk/sample/demos-en/label.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# label.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/labelframe.rb b/ext/tk/sample/demos-en/labelframe.rb
index ad968bc061..bd2d8f335e 100644
--- a/ext/tk/sample/demos-en/labelframe.rb
+++ b/ext/tk/sample/demos-en/labelframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# labelframe.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/mclist.rb b/ext/tk/sample/demos-en/mclist.rb
index 17019bb15b..61ebff1805 100644
--- a/ext/tk/sample/demos-en/mclist.rb
+++ b/ext/tk/sample/demos-en/mclist.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# mclist.rb --
#
# This demonstration script creates a toplevel window containing a Ttk
diff --git a/ext/tk/sample/demos-en/menu.rb b/ext/tk/sample/demos-en/menu.rb
index a458dbbc14..8b7a524bc6 100644
--- a/ext/tk/sample/demos-en/menu.rb
+++ b/ext/tk/sample/demos-en/menu.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# menus widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/menu84.rb b/ext/tk/sample/demos-en/menu84.rb
index 4fc53962e7..e6e42cb844 100644
--- a/ext/tk/sample/demos-en/menu84.rb
+++ b/ext/tk/sample/demos-en/menu84.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# menus widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/menubu.rb b/ext/tk/sample/demos-en/menubu.rb
index 6e28e813b3..9ff683d09c 100644
--- a/ext/tk/sample/demos-en/menubu.rb
+++ b/ext/tk/sample/demos-en/menubu.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# menubutton.rb
#
# This demonstration script creates a window with a bunch of menus
diff --git a/ext/tk/sample/demos-en/msgbox.rb b/ext/tk/sample/demos-en/msgbox.rb
index d3d66bfeb0..9a5ff51b4b 100644
--- a/ext/tk/sample/demos-en/msgbox.rb
+++ b/ext/tk/sample/demos-en/msgbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# msgbox.rb
#
# This demonstration script creates message boxes of various type
diff --git a/ext/tk/sample/demos-en/msgbox2.rb b/ext/tk/sample/demos-en/msgbox2.rb
index c227b59bb1..0eb35c486d 100644
--- a/ext/tk/sample/demos-en/msgbox2.rb
+++ b/ext/tk/sample/demos-en/msgbox2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# msgbox2.rb
#
# This demonstration script creates message boxes of various type
diff --git a/ext/tk/sample/demos-en/paned1.rb b/ext/tk/sample/demos-en/paned1.rb
index d3d66d1b16..c14562a962 100644
--- a/ext/tk/sample/demos-en/paned1.rb
+++ b/ext/tk/sample/demos-en/paned1.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# paned1.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/paned2.rb b/ext/tk/sample/demos-en/paned2.rb
index 02293b0309..0c62235112 100644
--- a/ext/tk/sample/demos-en/paned2.rb
+++ b/ext/tk/sample/demos-en/paned2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# paned2.rb --
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/pendulum.rb b/ext/tk/sample/demos-en/pendulum.rb
index 306ac94a21..833a31084f 100644
--- a/ext/tk/sample/demos-en/pendulum.rb
+++ b/ext/tk/sample/demos-en/pendulum.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# This demonstration illustrates how Tcl/Tk can be used to construct
# simulations of physical systems.
diff --git a/ext/tk/sample/demos-en/plot.rb b/ext/tk/sample/demos-en/plot.rb
index f70daa3fb2..786695a85c 100644
--- a/ext/tk/sample/demos-en/plot.rb
+++ b/ext/tk/sample/demos-en/plot.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# plot.rb
#
# This demonstration script creates a canvas widget showing a 2-D
diff --git a/ext/tk/sample/demos-en/puzzle.rb b/ext/tk/sample/demos-en/puzzle.rb
index f16414aa4c..6cf502fcf5 100644
--- a/ext/tk/sample/demos-en/puzzle.rb
+++ b/ext/tk/sample/demos-en/puzzle.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# puzzle.rb
#
# This demonstration script creates a 15-puzzle game using a collection
diff --git a/ext/tk/sample/demos-en/radio.rb b/ext/tk/sample/demos-en/radio.rb
index bde31508e1..d6b3ffbcbe 100644
--- a/ext/tk/sample/demos-en/radio.rb
+++ b/ext/tk/sample/demos-en/radio.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# radio.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/radio2.rb b/ext/tk/sample/demos-en/radio2.rb
index 72fc2c610c..ece7cfdf08 100644
--- a/ext/tk/sample/demos-en/radio2.rb
+++ b/ext/tk/sample/demos-en/radio2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# radio2.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/radio3.rb b/ext/tk/sample/demos-en/radio3.rb
index 8a147edda7..d1629c884e 100644
--- a/ext/tk/sample/demos-en/radio3.rb
+++ b/ext/tk/sample/demos-en/radio3.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# radio3.rb
#
# This demonstration script creates a toplevel window containing
diff --git a/ext/tk/sample/demos-en/rolodex b/ext/tk/sample/demos-en/rolodex
index dfc4b2b245..b4c42b6199 100644
--- a/ext/tk/sample/demos-en/rolodex
+++ b/ext/tk/sample/demos-en/rolodex
@@ -284,7 +284,7 @@ $helpTopics["context"] = <<EOF
Unfortunately, this application doesn't support context-sensitive\
help in the usual way, because when this demo was written Ruby/Tk\
didn't have a grab mechanism and this is needed for context-sensitive\
-help. Instead, you can achive much the same effect by simply moving\
+help. Instead, you can achieve much the same effect by simply moving\
the mouse over the window you're curious about and pressing the\
Help or F1 keys. You can do this anytime.
EOF
diff --git a/ext/tk/sample/demos-en/ruler.rb b/ext/tk/sample/demos-en/ruler.rb
index a9773699f7..d9a2c037b8 100644
--- a/ext/tk/sample/demos-en/ruler.rb
+++ b/ext/tk/sample/demos-en/ruler.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# ruler.rb
#
# This demonstration script creates a canvas widget that displays a ruler
diff --git a/ext/tk/sample/demos-en/sayings.rb b/ext/tk/sample/demos-en/sayings.rb
index a4dcf37cdc..e7ddfe5b5d 100644
--- a/ext/tk/sample/demos-en/sayings.rb
+++ b/ext/tk/sample/demos-en/sayings.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# sayings.rb
#
# This demonstration script creates a listbox that can be scrolled
diff --git a/ext/tk/sample/demos-en/search.rb b/ext/tk/sample/demos-en/search.rb
index 7fb40d88b2..82c0d169a9 100644
--- a/ext/tk/sample/demos-en/search.rb
+++ b/ext/tk/sample/demos-en/search.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# search.rb
#
# This demonstration script creates a collection of widgets that
diff --git a/ext/tk/sample/demos-en/spin.rb b/ext/tk/sample/demos-en/spin.rb
index d51b7e6619..d3558d56d6 100644
--- a/ext/tk/sample/demos-en/spin.rb
+++ b/ext/tk/sample/demos-en/spin.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# spin.rb --
#
# This demonstration script creates several spinbox widgets.
diff --git a/ext/tk/sample/demos-en/states.rb b/ext/tk/sample/demos-en/states.rb
index a5c01a867c..4eac7424e7 100644
--- a/ext/tk/sample/demos-en/states.rb
+++ b/ext/tk/sample/demos-en/states.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# states.rb
#
# This demonstration script creates a listbox widget that displays
diff --git a/ext/tk/sample/demos-en/style.rb b/ext/tk/sample/demos-en/style.rb
index 5c8777379e..a6fd6b328c 100644
--- a/ext/tk/sample/demos-en/style.rb
+++ b/ext/tk/sample/demos-en/style.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# style.rb
#
# This demonstration script creates a text widget that illustrates the
diff --git a/ext/tk/sample/demos-en/text.rb b/ext/tk/sample/demos-en/text.rb
index 2f72de7583..c44be395b6 100644
--- a/ext/tk/sample/demos-en/text.rb
+++ b/ext/tk/sample/demos-en/text.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# text.rb
#
# This demonstration script creates a text widget that describes
diff --git a/ext/tk/sample/demos-en/textpeer.rb b/ext/tk/sample/demos-en/textpeer.rb
index 20192fcd05..c3298e2caa 100644
--- a/ext/tk/sample/demos-en/textpeer.rb
+++ b/ext/tk/sample/demos-en/textpeer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# text widget peering demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/tkencoding.rb b/ext/tk/sample/demos-en/tkencoding.rb
index 727491a6ad..01a11ad7ed 100644
--- a/ext/tk/sample/demos-en/tkencoding.rb
+++ b/ext/tk/sample/demos-en/tkencoding.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# -*- ruby -*-
#
# tkencoding.rb
diff --git a/ext/tk/sample/demos-en/toolbar.rb b/ext/tk/sample/demos-en/toolbar.rb
index e7cbeb4235..1914e6eaad 100644
--- a/ext/tk/sample/demos-en/toolbar.rb
+++ b/ext/tk/sample/demos-en/toolbar.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# toolbar.rb --
#
# This demonstration script creates a toolbar that can be torn off.
diff --git a/ext/tk/sample/demos-en/tree.rb b/ext/tk/sample/demos-en/tree.rb
index 69154ee076..e3e5527f79 100644
--- a/ext/tk/sample/demos-en/tree.rb
+++ b/ext/tk/sample/demos-en/tree.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# tree.rb --
#
# This demonstration script creates a toplevel window containing a Ttk
diff --git a/ext/tk/sample/demos-en/ttkbut.rb b/ext/tk/sample/demos-en/ttkbut.rb
index a784efcc08..f2fcbcc7ba 100644
--- a/ext/tk/sample/demos-en/ttkbut.rb
+++ b/ext/tk/sample/demos-en/ttkbut.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# ttkbut.rb
#
# This demonstration script creates a toplevel window containing several
diff --git a/ext/tk/sample/demos-en/ttkmenu.rb b/ext/tk/sample/demos-en/ttkmenu.rb
index 9399568313..f84c9138d5 100644
--- a/ext/tk/sample/demos-en/ttkmenu.rb
+++ b/ext/tk/sample/demos-en/ttkmenu.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# ttkmenu.rb --
#
# This demonstration script creates a toplevel window containing several Ttk
diff --git a/ext/tk/sample/demos-en/ttknote.rb b/ext/tk/sample/demos-en/ttknote.rb
index bc0c7b369a..7c56252d2d 100644
--- a/ext/tk/sample/demos-en/ttknote.rb
+++ b/ext/tk/sample/demos-en/ttknote.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# ttknote.rb --
#
# This demonstration script creates a toplevel window containing a Ttk
diff --git a/ext/tk/sample/demos-en/ttkpane.rb b/ext/tk/sample/demos-en/ttkpane.rb
index 87c4dedeb2..7eb4c29731 100644
--- a/ext/tk/sample/demos-en/ttkpane.rb
+++ b/ext/tk/sample/demos-en/ttkpane.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# ttkpane.rb --
#
# This demonstration script creates a Ttk pane with some content.
diff --git a/ext/tk/sample/demos-en/ttkprogress.rb b/ext/tk/sample/demos-en/ttkprogress.rb
index c341a9385f..09bf398e17 100644
--- a/ext/tk/sample/demos-en/ttkprogress.rb
+++ b/ext/tk/sample/demos-en/ttkprogress.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# ttkprogress.rb --
#
# This demonstration script creates several progress bar widgets.
diff --git a/ext/tk/sample/demos-en/twind.rb b/ext/tk/sample/demos-en/twind.rb
index 60a345d0b4..a709f0d188 100644
--- a/ext/tk/sample/demos-en/twind.rb
+++ b/ext/tk/sample/demos-en/twind.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# twind.rb
#
# This demonstration script creates a text widget with a bunch of
diff --git a/ext/tk/sample/demos-en/twind2.rb b/ext/tk/sample/demos-en/twind2.rb
index af7313dd82..4a59a2e613 100644
--- a/ext/tk/sample/demos-en/twind2.rb
+++ b/ext/tk/sample/demos-en/twind2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# text (embedded windows) widget demo 2 (called by 'widget')
#
diff --git a/ext/tk/sample/demos-en/unicodeout.rb b/ext/tk/sample/demos-en/unicodeout.rb
index ee7b5afa15..910dff38b7 100644
--- a/ext/tk/sample/demos-en/unicodeout.rb
+++ b/ext/tk/sample/demos-en/unicodeout.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# unicodeout.rb --
#
# This demonstration script shows how you can produce output (in label
diff --git a/ext/tk/sample/demos-en/vscale.rb b/ext/tk/sample/demos-en/vscale.rb
index b05ed12072..2ce522f7be 100644
--- a/ext/tk/sample/demos-en/vscale.rb
+++ b/ext/tk/sample/demos-en/vscale.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# vscale.rb
#
# This demonstration script shows an example with a vertical scale.
diff --git a/ext/tk/sample/demos-jp/anilabel.rb b/ext/tk/sample/demos-jp/anilabel.rb
index c882f43f7e..ccad73ffc6 100644
--- a/ext/tk/sample/demos-jp/anilabel.rb
+++ b/ext/tk/sample/demos-jp/anilabel.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# animated label widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/aniwave.rb b/ext/tk/sample/demos-jp/aniwave.rb
index 866316c331..6973de7f09 100644
--- a/ext/tk/sample/demos-jp/aniwave.rb
+++ b/ext/tk/sample/demos-jp/aniwave.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# animated wave demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/arrow.rb b/ext/tk/sample/demos-jp/arrow.rb
index 2995f96d54..12ab4af2b1 100644
--- a/ext/tk/sample/demos-jp/arrow.rb
+++ b/ext/tk/sample/demos-jp/arrow.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# arrowhead widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb
index efba6e6c01..74ddf0217a 100644
--- a/ext/tk/sample/demos-jp/bind.rb
+++ b/ext/tk/sample/demos-jp/bind.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# text (tag bindings) widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/bitmap.rb b/ext/tk/sample/demos-jp/bitmap.rb
index d84e9a5f09..2cc9c28fbd 100644
--- a/ext/tk/sample/demos-jp/bitmap.rb
+++ b/ext/tk/sample/demos-jp/bitmap.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# bitmap widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/button.rb b/ext/tk/sample/demos-jp/button.rb
index 301100b057..204f5eab86 100644
--- a/ext/tk/sample/demos-jp/button.rb
+++ b/ext/tk/sample/demos-jp/button.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# button widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/check.rb b/ext/tk/sample/demos-jp/check.rb
index 422e898ec9..04a47c8101 100644
--- a/ext/tk/sample/demos-jp/check.rb
+++ b/ext/tk/sample/demos-jp/check.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# checkbutton widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/check2.rb b/ext/tk/sample/demos-jp/check2.rb
index 558e588535..609f6830d8 100644
--- a/ext/tk/sample/demos-jp/check2.rb
+++ b/ext/tk/sample/demos-jp/check2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# checkbutton widget demo2 (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/clrpick.rb b/ext/tk/sample/demos-jp/clrpick.rb
index df8c76a69d..31a3f25b7c 100644
--- a/ext/tk/sample/demos-jp/clrpick.rb
+++ b/ext/tk/sample/demos-jp/clrpick.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# widget demo prompts the user to select a color (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/colors.rb b/ext/tk/sample/demos-jp/colors.rb
index 5e5f47cb04..c0145daaf6 100644
--- a/ext/tk/sample/demos-jp/colors.rb
+++ b/ext/tk/sample/demos-jp/colors.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# listbox widget demo 'colors' (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/combo.rb b/ext/tk/sample/demos-jp/combo.rb
index 8bbe36997d..0f3e808606 100644
--- a/ext/tk/sample/demos-jp/combo.rb
+++ b/ext/tk/sample/demos-jp/combo.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# combo.rb --
#
diff --git a/ext/tk/sample/demos-jp/cscroll.rb b/ext/tk/sample/demos-jp/cscroll.rb
index e993326aa9..6cce3d4369 100644
--- a/ext/tk/sample/demos-jp/cscroll.rb
+++ b/ext/tk/sample/demos-jp/cscroll.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# simple scrollable canvas widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/ctext.rb b/ext/tk/sample/demos-jp/ctext.rb
index bb354c490e..ce7de841e8 100644
--- a/ext/tk/sample/demos-jp/ctext.rb
+++ b/ext/tk/sample/demos-jp/ctext.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# Canvas Text widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/dialog1.rb b/ext/tk/sample/demos-jp/dialog1.rb
index e50c9071e5..9d54f93b35 100644
--- a/ext/tk/sample/demos-jp/dialog1.rb
+++ b/ext/tk/sample/demos-jp/dialog1.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# a dialog box with a local grab (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/dialog2.rb b/ext/tk/sample/demos-jp/dialog2.rb
index 3e7d9619a4..c8506b6cf8 100644
--- a/ext/tk/sample/demos-jp/dialog2.rb
+++ b/ext/tk/sample/demos-jp/dialog2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# a dialog box with a global grab (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/entry1.rb b/ext/tk/sample/demos-jp/entry1.rb
index 9be677d12d..0fbbeb8259 100644
--- a/ext/tk/sample/demos-jp/entry1.rb
+++ b/ext/tk/sample/demos-jp/entry1.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# entry (no scrollbars) widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/entry2.rb b/ext/tk/sample/demos-jp/entry2.rb
index 5476d24ade..294c82490f 100644
--- a/ext/tk/sample/demos-jp/entry2.rb
+++ b/ext/tk/sample/demos-jp/entry2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# entry (with scrollbars) widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/entry3.rb b/ext/tk/sample/demos-jp/entry3.rb
index 59c698de62..6f8ba943e9 100644
--- a/ext/tk/sample/demos-jp/entry3.rb
+++ b/ext/tk/sample/demos-jp/entry3.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
# entry3.rb --
#
# This demonstration script creates several entry widgets whose
diff --git a/ext/tk/sample/demos-jp/filebox.rb b/ext/tk/sample/demos-jp/filebox.rb
index fc014bc282..800dd5ddbf 100644
--- a/ext/tk/sample/demos-jp/filebox.rb
+++ b/ext/tk/sample/demos-jp/filebox.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# widget demo prompts the user to select a file (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/floor.rb b/ext/tk/sample/demos-jp/floor.rb
index 5101a026bb..8a079035c9 100644
--- a/ext/tk/sample/demos-jp/floor.rb
+++ b/ext/tk/sample/demos-jp/floor.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# floorDisplay widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/floor2.rb b/ext/tk/sample/demos-jp/floor2.rb
index 7ca705c7bd..7f294ce82e 100644
--- a/ext/tk/sample/demos-jp/floor2.rb
+++ b/ext/tk/sample/demos-jp/floor2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# floorDisplay widget demo 2 (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/form.rb b/ext/tk/sample/demos-jp/form.rb
index 000fcb5091..751852cbf7 100644
--- a/ext/tk/sample/demos-jp/form.rb
+++ b/ext/tk/sample/demos-jp/form.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# form widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/goldberg.rb b/ext/tk/sample/demos-jp/goldberg.rb
index fc38d877db..cc039b2d62 100644
--- a/ext/tk/sample/demos-jp/goldberg.rb
+++ b/ext/tk/sample/demos-jp/goldberg.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# Ruby/Tk Goldverg demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/hscale.rb b/ext/tk/sample/demos-jp/hscale.rb
index 2dfbf38272..0607792a74 100644
--- a/ext/tk/sample/demos-jp/hscale.rb
+++ b/ext/tk/sample/demos-jp/hscale.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
require "tkcanvas"
if defined?($hscale_demo) && $hscale_deom
diff --git a/ext/tk/sample/demos-jp/icon.rb b/ext/tk/sample/demos-jp/icon.rb
index 6b9e1a570a..7bf6d9731b 100644
--- a/ext/tk/sample/demos-jp/icon.rb
+++ b/ext/tk/sample/demos-jp/icon.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# iconic button widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/image1.rb b/ext/tk/sample/demos-jp/image1.rb
index 0c69b2a45f..e07f1d3afc 100644
--- a/ext/tk/sample/demos-jp/image1.rb
+++ b/ext/tk/sample/demos-jp/image1.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# two image widgets demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/image2.rb b/ext/tk/sample/demos-jp/image2.rb
index aa507c5b9b..312ec41f2a 100644
--- a/ext/tk/sample/demos-jp/image2.rb
+++ b/ext/tk/sample/demos-jp/image2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# widget demo 'load image' (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/image3.rb b/ext/tk/sample/demos-jp/image3.rb
index 5c1ceb2816..3f2b1ad3b9 100644
--- a/ext/tk/sample/demos-jp/image3.rb
+++ b/ext/tk/sample/demos-jp/image3.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
# image3.rb
#
# This demonstration script creates a simple collection of widgets
diff --git a/ext/tk/sample/demos-jp/items.rb b/ext/tk/sample/demos-jp/items.rb
index b1d66f367b..9fef0bedda 100644
--- a/ext/tk/sample/demos-jp/items.rb
+++ b/ext/tk/sample/demos-jp/items.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# canvas item types widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/knightstour.rb b/ext/tk/sample/demos-jp/knightstour.rb
index 835a24c392..f4de10b3b3 100644
--- a/ext/tk/sample/demos-jp/knightstour.rb
+++ b/ext/tk/sample/demos-jp/knightstour.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# Based on the widget demo of Tcl/Tk8.5.2
# The following is the original copyright text.
diff --git a/ext/tk/sample/demos-jp/label.rb b/ext/tk/sample/demos-jp/label.rb
index 700e6a61ce..6164ac1ebc 100644
--- a/ext/tk/sample/demos-jp/label.rb
+++ b/ext/tk/sample/demos-jp/label.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# label widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/labelframe.rb b/ext/tk/sample/demos-jp/labelframe.rb
index 80e106c6e7..3dcd1dc3f1 100644
--- a/ext/tk/sample/demos-jp/labelframe.rb
+++ b/ext/tk/sample/demos-jp/labelframe.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# labelframe.rb
#
diff --git a/ext/tk/sample/demos-jp/mclist.rb b/ext/tk/sample/demos-jp/mclist.rb
index 67cec638eb..e7b71edfdb 100644
--- a/ext/tk/sample/demos-jp/mclist.rb
+++ b/ext/tk/sample/demos-jp/mclist.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# mclist.rb --
#
diff --git a/ext/tk/sample/demos-jp/menu.rb b/ext/tk/sample/demos-jp/menu.rb
index 05ea7a9ec2..30e491d953 100644
--- a/ext/tk/sample/demos-jp/menu.rb
+++ b/ext/tk/sample/demos-jp/menu.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# menus widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/menu84.rb b/ext/tk/sample/demos-jp/menu84.rb
index 6a57279481..3fd879e4f7 100644
--- a/ext/tk/sample/demos-jp/menu84.rb
+++ b/ext/tk/sample/demos-jp/menu84.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# menus widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/menu8x.rb b/ext/tk/sample/demos-jp/menu8x.rb
index 77ecb5bcf3..a1acda4c1b 100644
--- a/ext/tk/sample/demos-jp/menu8x.rb
+++ b/ext/tk/sample/demos-jp/menu8x.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# menus widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/menubu.rb b/ext/tk/sample/demos-jp/menubu.rb
index 06f9eb875e..57b1d41420 100644
--- a/ext/tk/sample/demos-jp/menubu.rb
+++ b/ext/tk/sample/demos-jp/menubu.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
require "tkcanvas"
def optionMenu(menubutton, varName, firstValue, *rest)
diff --git a/ext/tk/sample/demos-jp/msgbox.rb b/ext/tk/sample/demos-jp/msgbox.rb
index ec7b4f2bbc..45d8b8e9f9 100644
--- a/ext/tk/sample/demos-jp/msgbox.rb
+++ b/ext/tk/sample/demos-jp/msgbox.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# message boxes widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/msgbox2.rb b/ext/tk/sample/demos-jp/msgbox2.rb
index ad6d936036..51a0ca9dcc 100644
--- a/ext/tk/sample/demos-jp/msgbox2.rb
+++ b/ext/tk/sample/demos-jp/msgbox2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# message boxes widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/paned1.rb b/ext/tk/sample/demos-jp/paned1.rb
index 53d2e7162b..96e419bec0 100644
--- a/ext/tk/sample/demos-jp/paned1.rb
+++ b/ext/tk/sample/demos-jp/paned1.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# paned1.rb
#
diff --git a/ext/tk/sample/demos-jp/paned2.rb b/ext/tk/sample/demos-jp/paned2.rb
index 65bd41c757..11a02abe73 100644
--- a/ext/tk/sample/demos-jp/paned2.rb
+++ b/ext/tk/sample/demos-jp/paned2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# paned2.rb --
#
diff --git a/ext/tk/sample/demos-jp/pendulum.rb b/ext/tk/sample/demos-jp/pendulum.rb
index 60556fd70a..06e6933548 100644
--- a/ext/tk/sample/demos-jp/pendulum.rb
+++ b/ext/tk/sample/demos-jp/pendulum.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# This demonstration illustrates how Tcl/Tk can be used to construct
# simulations of physical systems.
diff --git a/ext/tk/sample/demos-jp/plot.rb b/ext/tk/sample/demos-jp/plot.rb
index 4147b35399..85970bb5b3 100644
--- a/ext/tk/sample/demos-jp/plot.rb
+++ b/ext/tk/sample/demos-jp/plot.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# 2-D plot widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/puzzle.rb b/ext/tk/sample/demos-jp/puzzle.rb
index dbcb423463..61fb4cbf60 100644
--- a/ext/tk/sample/demos-jp/puzzle.rb
+++ b/ext/tk/sample/demos-jp/puzzle.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# widet demo 'puzzle' (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/radio.rb b/ext/tk/sample/demos-jp/radio.rb
index efb613593d..4d84441687 100644
--- a/ext/tk/sample/demos-jp/radio.rb
+++ b/ext/tk/sample/demos-jp/radio.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# radiobutton widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb
index 0633a8def1..4416122876 100644
--- a/ext/tk/sample/demos-jp/radio2.rb
+++ b/ext/tk/sample/demos-jp/radio2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# radio2.rb
#
diff --git a/ext/tk/sample/demos-jp/radio3.rb b/ext/tk/sample/demos-jp/radio3.rb
index 3356b6945b..3f26ffb847 100644
--- a/ext/tk/sample/demos-jp/radio3.rb
+++ b/ext/tk/sample/demos-jp/radio3.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# radio3.rb
#
diff --git a/ext/tk/sample/demos-jp/rolodex b/ext/tk/sample/demos-jp/rolodex
index 2cc73e128f..95c0e3b869 100644
--- a/ext/tk/sample/demos-jp/rolodex
+++ b/ext/tk/sample/demos-jp/rolodex
@@ -284,7 +284,7 @@ $helpTopics["context"] = <<EOF
Unfortunately, this application doesn't support context-sensitive\
help in the usual way, because when this demo was written Ruby/Tk\
didn't have a grab mechanism and this is needed for context-sensitive\
-help. Instead, you can achive much the same effect by simply moving\
+help. Instead, you can achieve much the same effect by simply moving\
the mouse over the window you're curious about and pressing the\
Help or F1 keys. You can do this anytime.
EOF
diff --git a/ext/tk/sample/demos-jp/ruler.rb b/ext/tk/sample/demos-jp/ruler.rb
index 5c34a5a5da..734f47f142 100644
--- a/ext/tk/sample/demos-jp/ruler.rb
+++ b/ext/tk/sample/demos-jp/ruler.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# ruler widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/sayings.rb b/ext/tk/sample/demos-jp/sayings.rb
index cf4fe7b1b1..a60b0bf2e5 100644
--- a/ext/tk/sample/demos-jp/sayings.rb
+++ b/ext/tk/sample/demos-jp/sayings.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# listbox widget demo 'sayings' (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/search.rb b/ext/tk/sample/demos-jp/search.rb
index 238450ae30..dffccf1a48 100644
--- a/ext/tk/sample/demos-jp/search.rb
+++ b/ext/tk/sample/demos-jp/search.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# Text Search widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/spin.rb b/ext/tk/sample/demos-jp/spin.rb
index fd51a3f457..616a14e9d6 100644
--- a/ext/tk/sample/demos-jp/spin.rb
+++ b/ext/tk/sample/demos-jp/spin.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# spin.rb --
#
diff --git a/ext/tk/sample/demos-jp/states.rb b/ext/tk/sample/demos-jp/states.rb
index 2966e6d834..9f8fb0ef03 100644
--- a/ext/tk/sample/demos-jp/states.rb
+++ b/ext/tk/sample/demos-jp/states.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# listbox widget demo 'states' (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/style.rb b/ext/tk/sample/demos-jp/style.rb
index 813fde7a78..737c9f8994 100644
--- a/ext/tk/sample/demos-jp/style.rb
+++ b/ext/tk/sample/demos-jp/style.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# text (display styles) widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/text.rb b/ext/tk/sample/demos-jp/text.rb
index e698a79246..117f9f105a 100644
--- a/ext/tk/sample/demos-jp/text.rb
+++ b/ext/tk/sample/demos-jp/text.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# text (basic facilities) widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/textpeer.rb b/ext/tk/sample/demos-jp/textpeer.rb
index 4d896d2a12..31e467afef 100644
--- a/ext/tk/sample/demos-jp/textpeer.rb
+++ b/ext/tk/sample/demos-jp/textpeer.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# text widget peering demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/toolbar.rb b/ext/tk/sample/demos-jp/toolbar.rb
index 3ee7a5f9d8..f355e8fef8 100644
--- a/ext/tk/sample/demos-jp/toolbar.rb
+++ b/ext/tk/sample/demos-jp/toolbar.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# toolbar.rb --
#
diff --git a/ext/tk/sample/demos-jp/tree.rb b/ext/tk/sample/demos-jp/tree.rb
index 3f3b18b677..48d5e5407e 100644
--- a/ext/tk/sample/demos-jp/tree.rb
+++ b/ext/tk/sample/demos-jp/tree.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# tree.rb --
#
diff --git a/ext/tk/sample/demos-jp/ttkbut.rb b/ext/tk/sample/demos-jp/ttkbut.rb
index ccde541019..af9321dcd9 100644
--- a/ext/tk/sample/demos-jp/ttkbut.rb
+++ b/ext/tk/sample/demos-jp/ttkbut.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# ttkbut.rb
#
diff --git a/ext/tk/sample/demos-jp/ttkmenu.rb b/ext/tk/sample/demos-jp/ttkmenu.rb
index aa9db5019f..b521a3f101 100644
--- a/ext/tk/sample/demos-jp/ttkmenu.rb
+++ b/ext/tk/sample/demos-jp/ttkmenu.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# ttkmenu.rb --
#
diff --git a/ext/tk/sample/demos-jp/ttknote.rb b/ext/tk/sample/demos-jp/ttknote.rb
index f3b2fa5881..2f82408ba0 100644
--- a/ext/tk/sample/demos-jp/ttknote.rb
+++ b/ext/tk/sample/demos-jp/ttknote.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# ttknote.rb --
#
diff --git a/ext/tk/sample/demos-jp/ttkpane.rb b/ext/tk/sample/demos-jp/ttkpane.rb
index a5c1a08ec9..af7622272c 100644
--- a/ext/tk/sample/demos-jp/ttkpane.rb
+++ b/ext/tk/sample/demos-jp/ttkpane.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# ttkpane.rb --
#
diff --git a/ext/tk/sample/demos-jp/ttkprogress.rb b/ext/tk/sample/demos-jp/ttkprogress.rb
index ec28253a9f..6f0ea4c2df 100644
--- a/ext/tk/sample/demos-jp/ttkprogress.rb
+++ b/ext/tk/sample/demos-jp/ttkprogress.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# ttkprogress.rb --
#
diff --git a/ext/tk/sample/demos-jp/twind.rb b/ext/tk/sample/demos-jp/twind.rb
index f13a137cc3..7db7576c6e 100644
--- a/ext/tk/sample/demos-jp/twind.rb
+++ b/ext/tk/sample/demos-jp/twind.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# text (embedded windows) widget demo (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/twind2.rb b/ext/tk/sample/demos-jp/twind2.rb
index a783ba4738..c5bef5bce0 100644
--- a/ext/tk/sample/demos-jp/twind2.rb
+++ b/ext/tk/sample/demos-jp/twind2.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# text (embedded windows) widget demo 2 (called by 'widget')
#
diff --git a/ext/tk/sample/demos-jp/unicodeout.rb b/ext/tk/sample/demos-jp/unicodeout.rb
index 31596cf8fd..966f85f331 100644
--- a/ext/tk/sample/demos-jp/unicodeout.rb
+++ b/ext/tk/sample/demos-jp/unicodeout.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
#
# unicodeout.rb --
#
diff --git a/ext/tk/sample/demos-jp/vscale.rb b/ext/tk/sample/demos-jp/vscale.rb
index 6ae513bc33..a502634138 100644
--- a/ext/tk/sample/demos-jp/vscale.rb
+++ b/ext/tk/sample/demos-jp/vscale.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
require "tkcanvas"
if defined?($vscale_demo) && $vscale_demo
diff --git a/ext/tk/sample/editable_listbox.rb b/ext/tk/sample/editable_listbox.rb
index 890aec032e..02a3f4aad3 100644
--- a/ext/tk/sample/editable_listbox.rb
+++ b/ext/tk/sample/editable_listbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Tk::RbWidget::Editable_Listbox class
#
diff --git a/ext/tk/sample/encstr_usage.rb b/ext/tk/sample/encstr_usage.rb
index 39dc9c4018..49a29ec19a 100644
--- a/ext/tk/sample/encstr_usage.rb
+++ b/ext/tk/sample/encstr_usage.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'tk'
TkMessage.new(:width=>400, :text=><<EOM).pack
diff --git a/ext/tk/sample/figmemo_sample.rb b/ext/tk/sample/figmemo_sample.rb
index da6c41797e..4e5684fa94 100644
--- a/ext/tk/sample/figmemo_sample.rb
+++ b/ext/tk/sample/figmemo_sample.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
begin
@@ -300,7 +301,7 @@ end
def open_file(canvas, fname)
if canvas.modified?
ret = Tk.messageBox(:icon=>'warning',:type=>'okcancel',:default=>'cancel',
- :message=>'Canvas may be modified. Realy erase? ')
+ :message=>'Canvas may be modified. Really erase? ')
return if ret == 'cancel'
end
diff --git a/ext/tk/sample/irbtk.rb b/ext/tk/sample/irbtk.rb
index 70dd33e4da..8665b20539 100644
--- a/ext/tk/sample/irbtk.rb
+++ b/ext/tk/sample/irbtk.rb
@@ -1,4 +1,5 @@
#!/usr/local/bin/ruby
+# frozen_string_literal: false
#
# irbtk.rb - irb with Ruby/Tk
#
diff --git a/ext/tk/sample/menubar1.rb b/ext/tk/sample/menubar1.rb
index a233c6e088..a468fb6ea4 100644
--- a/ext/tk/sample/menubar1.rb
+++ b/ext/tk/sample/menubar1.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# menubar sample 1 : use frame and menubuttons
#
@@ -43,7 +44,7 @@ menubar = TkMenubar.new(nil, menu_spec,
'tearoff'=>false,
'foreground'=>'grey40',
'activeforeground'=>'red',
- 'font'=>'Helvetia 12 bold')
+ 'font'=>'Helvetica 12 bold')
menubar.pack('side'=>'top', 'fill'=>'x')
TkText.new(:wrap=>'word').pack.insert('1.0', 'Please read the sample source, and check how to override default configure options of menu entries on a menu_spec. Maybe, on windows, this menubar does not work properly about keyboard shortcuts. Then, please use "menu" option of root/toplevel widget (see sample/menubar2.rb).')
diff --git a/ext/tk/sample/menubar2.rb b/ext/tk/sample/menubar2.rb
index e3cd68eaef..e10a282f93 100644
--- a/ext/tk/sample/menubar2.rb
+++ b/ext/tk/sample/menubar2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# menubar sample 2 : use 'menu' option of root/toplevel widget
#
@@ -44,12 +45,12 @@ mbar = Tk.root.add_menubar(menu_spec,
'tearoff'=>'false',
'foreground'=>'grey40',
'activeforeground'=>'red',
- 'font'=>'Helvetia 12 bold')
+ 'font'=>'Helvetica 12 bold')
# This (default configure options) is NOT same the following.
#
# mbar = Tk.root.add_menubar(menu_spec)
# mbar.configure('foreground'=>'grey40', 'activeforeground'=>'red',
-# 'font'=>'Helvetia 12 bold')
+# 'font'=>'Helvetica 12 bold')
TkText.new(:wrap=>'word').pack.insert('1.0', 'Please read the sample source, and check how to override default configure options of menu entries on a menu_spec.')
diff --git a/ext/tk/sample/menubar3.rb b/ext/tk/sample/menubar3.rb
index 4f42f81c88..f8344cc834 100644
--- a/ext/tk/sample/menubar3.rb
+++ b/ext/tk/sample/menubar3.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# menubar sample 3 : vertical layout menubar; use frame and menubuttons
#
@@ -62,7 +63,7 @@ menubar = TkMenubar.new(nil, menu_spec,
'tearoff'=>false,
'foreground'=>'grey40',
'activeforeground'=>'red',
- 'font'=>'Helvetia 12 bold')
+ 'font'=>'Helvetica 12 bold')
menubar.pack('side'=>'left', 'fill'=>'y')
TkText.new(:wrap=>'word').pack.insert('1.0', 'This sample script generates "Menu Sidebar".
diff --git a/ext/tk/sample/multi-ip_sample.rb b/ext/tk/sample/multi-ip_sample.rb
index eccf0201f8..fb7a8afb5b 100644
--- a/ext/tk/sample/multi-ip_sample.rb
+++ b/ext/tk/sample/multi-ip_sample.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
# This script is a sample of MultiTkIp class
require "multi-tk"
diff --git a/ext/tk/sample/multi-ip_sample2.rb b/ext/tk/sample/multi-ip_sample2.rb
index 79c78dec4a..ae2cb35e96 100644
--- a/ext/tk/sample/multi-ip_sample2.rb
+++ b/ext/tk/sample/multi-ip_sample2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'multi-tk.rb'
th = Thread.new{Tk.mainloop}
diff --git a/ext/tk/sample/optobj_sample.rb b/ext/tk/sample/optobj_sample.rb
index a781254a28..5e4806f8fb 100644
--- a/ext/tk/sample/optobj_sample.rb
+++ b/ext/tk/sample/optobj_sample.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# sample script of Tk::OptionObj
#
diff --git a/ext/tk/sample/propagate.rb b/ext/tk/sample/propagate.rb
index 66f14aeb72..10e0ed8236 100644
--- a/ext/tk/sample/propagate.rb
+++ b/ext/tk/sample/propagate.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
TkLabel.new(:text=>"Please click the bottom frame").pack
diff --git a/ext/tk/sample/remote-ip_sample.rb b/ext/tk/sample/remote-ip_sample.rb
index f6eed9e985..d80399f368 100644
--- a/ext/tk/sample/remote-ip_sample.rb
+++ b/ext/tk/sample/remote-ip_sample.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'remote-tk'
puts <<EOM
diff --git a/ext/tk/sample/remote-ip_sample2.rb b/ext/tk/sample/remote-ip_sample2.rb
index d8cf3c7650..919bfd0b67 100644
--- a/ext/tk/sample/remote-ip_sample2.rb
+++ b/ext/tk/sample/remote-ip_sample2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'remote-tk'
diff --git a/ext/tk/sample/safe-tk.rb b/ext/tk/sample/safe-tk.rb
index 38131c0155..a8a85d3288 100644..100755
--- a/ext/tk/sample/safe-tk.rb
+++ b/ext/tk/sample/safe-tk.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
# This script is a sample of MultiTkIp class
require "multi-tk"
@@ -117,9 +118,6 @@ p ip.eval_str("
:padx=>10, :pady=>7)
", bind)
-puts "\n---- change the safe slave IP's safe-level ==> 4 ----------"
-ip.safe_level = 4
-
puts "\n---- call 3rd and 4th eval_proc ----------"
p ip.eval_proc{
TkLabel.new(:text=>"3rd and 4th eval_proc : $SAFE == #{$SAFE}").pack
diff --git a/ext/tk/sample/scrollframe.rb b/ext/tk/sample/scrollframe.rb
index e9d8af7ebf..fda4478055 100644
--- a/ext/tk/sample/scrollframe.rb
+++ b/ext/tk/sample/scrollframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Tk::RbWidget::ScrollFrame class
#
diff --git a/ext/tk/sample/tcltklib/lines1.rb b/ext/tk/sample/tcltklib/lines1.rb
index 9f21ae6377..57e3d33f6f 100644
--- a/ext/tk/sample/tcltklib/lines1.rb
+++ b/ext/tk/sample/tcltklib/lines1.rb
@@ -1,4 +1,5 @@
#! /usr/local/bin/ruby
+# frozen_string_literal: false
require "tcltk"
diff --git a/ext/tk/sample/tcltklib/lines2.rb b/ext/tk/sample/tcltklib/lines2.rb
index e459589f50..7ae54d9ea9 100644
--- a/ext/tk/sample/tcltklib/lines2.rb
+++ b/ext/tk/sample/tcltklib/lines2.rb
@@ -1,4 +1,5 @@
#! /usr/local/bin/ruby
+# frozen_string_literal: false
require "tk"
diff --git a/ext/tk/sample/tcltklib/lines3.rb b/ext/tk/sample/tcltklib/lines3.rb
index caa50f92e7..d79bb12ef3 100644
--- a/ext/tk/sample/tcltklib/lines3.rb
+++ b/ext/tk/sample/tcltklib/lines3.rb
@@ -1,4 +1,5 @@
#! /usr/local/bin/ruby
+# frozen_string_literal: false
require "tk"
diff --git a/ext/tk/sample/tcltklib/lines4.rb b/ext/tk/sample/tcltklib/lines4.rb
index 7a1175bce0..37ffc0ee74 100644
--- a/ext/tk/sample/tcltklib/lines4.rb
+++ b/ext/tk/sample/tcltklib/lines4.rb
@@ -1,4 +1,5 @@
#! /usr/local/bin/ruby
+# frozen_string_literal: false
require "tk"
diff --git a/ext/tk/sample/tcltklib/safeTk.rb b/ext/tk/sample/tcltklib/safeTk.rb
index 5d2c60e700..5fac9e2e23 100644
--- a/ext/tk/sample/tcltklib/safeTk.rb
+++ b/ext/tk/sample/tcltklib/safeTk.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tcltklib'
master = TclTkIp.new
diff --git a/ext/tk/sample/tcltklib/sample0.rb b/ext/tk/sample/tcltklib/sample0.rb
index 0ac303ae9e..0cc2de4878 100644
--- a/ext/tk/sample/tcltklib/sample0.rb
+++ b/ext/tk/sample/tcltklib/sample0.rb
@@ -1,4 +1,5 @@
#! /usr/local/bin/ruby -vd
+# frozen_string_literal: false
# tcltklib ライブラリã®ãƒ†ã‚¹ãƒˆ
diff --git a/ext/tk/sample/tcltklib/sample1.rb b/ext/tk/sample/tcltklib/sample1.rb
index 3235edfe0d..b4ad6436bd 100644
--- a/ext/tk/sample/tcltklib/sample1.rb
+++ b/ext/tk/sample/tcltklib/sample1.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby -d
# -*- encoding: utf-8 -*-
+# frozen_string_literal: false
# -d オプションを付ã‘ã‚‹ã¨, デãƒãƒƒã‚°æƒ…報を表示ã™ã‚‹.
# tcltk ライブラリã®ã‚µãƒ³ãƒ—ル
diff --git a/ext/tk/sample/tcltklib/sample2.rb b/ext/tk/sample/tcltklib/sample2.rb
index 1acc180680..378c2d3eb7 100644
--- a/ext/tk/sample/tcltklib/sample2.rb
+++ b/ext/tk/sample/tcltklib/sample2.rb
@@ -1,4 +1,5 @@
#!/usr/local/bin/ruby
+# frozen_string_literal: false
#----------------------> pretty simple othello game <-----------------------
# othello.rb
#
diff --git a/ext/tk/sample/tkalignbox.rb b/ext/tk/sample/tkalignbox.rb
index f3d083c33d..89aae111b7 100644
--- a/ext/tk/sample/tkalignbox.rb
+++ b/ext/tk/sample/tkalignbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkalignbox.rb : align widgets with same width/height
#
diff --git a/ext/tk/sample/tkballoonhelp.rb b/ext/tk/sample/tkballoonhelp.rb
index 2daa522601..fb811164ab 100644
--- a/ext/tk/sample/tkballoonhelp.rb
+++ b/ext/tk/sample/tkballoonhelp.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkballoonhelp.rb : simple balloon help widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/sample/tkbiff.rb b/ext/tk/sample/tkbiff.rb
index c0953a1b1b..a65e4beaa9 100644
--- a/ext/tk/sample/tkbiff.rb
+++ b/ext/tk/sample/tkbiff.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
if ARGV[0] != '-d'
unless $DEBUG
diff --git a/ext/tk/sample/tkbrowse.rb b/ext/tk/sample/tkbrowse.rb
index 56d5a80fcf..f083a8ac77 100644
--- a/ext/tk/sample/tkbrowse.rb
+++ b/ext/tk/sample/tkbrowse.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# This script generates a directory browser, which lists the working
# directory and allows you to open files or subdirectories by
diff --git a/ext/tk/sample/tkcombobox.rb b/ext/tk/sample/tkcombobox.rb
index c38bde10d4..17adbc9f9e 100644
--- a/ext/tk/sample/tkcombobox.rb
+++ b/ext/tk/sample/tkcombobox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkcombobox.rb : auto scrollbox & combobox
#
diff --git a/ext/tk/sample/tkdialog.rb b/ext/tk/sample/tkdialog.rb
index eb8cd04796..f0f7d2ccb5 100644
--- a/ext/tk/sample/tkdialog.rb
+++ b/ext/tk/sample/tkdialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require "tk"
root = TkFrame.new
diff --git a/ext/tk/sample/tkextlib/ICONS/viewIcons.rb b/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
index 02ba19a629..7ed3c267e4 100644
--- a/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
+++ b/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# viewIcons.rb
#
diff --git a/ext/tk/sample/tkextlib/blt/barchart5.rb b/ext/tk/sample/tkextlib/blt/barchart5.rb
index 86101b200d..f818ffc375 100644
--- a/ext/tk/sample/tkextlib/blt/barchart5.rb
+++ b/ext/tk/sample/tkextlib/blt/barchart5.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/calendar.rb b/ext/tk/sample/tkextlib/blt/calendar.rb
index 86d34043dc..daae5fdcba 100644
--- a/ext/tk/sample/tkextlib/blt/calendar.rb
+++ b/ext/tk/sample/tkextlib/blt/calendar.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/graph6.rb b/ext/tk/sample/tkextlib/blt/graph6.rb
index b3eeb81231..26baa527ef 100644
--- a/ext/tk/sample/tkextlib/blt/graph6.rb
+++ b/ext/tk/sample/tkextlib/blt/graph6.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/graph7.rb b/ext/tk/sample/tkextlib/blt/graph7.rb
index 8b31b28c91..0e68388596 100644
--- a/ext/tk/sample/tkextlib/blt/graph7.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/graph7a.rb b/ext/tk/sample/tkextlib/blt/graph7a.rb
index 8def766060..aa744f1f74 100644
--- a/ext/tk/sample/tkextlib/blt/graph7a.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7a.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/graph7b.rb b/ext/tk/sample/tkextlib/blt/graph7b.rb
index 8b00f154b2..5b30c4bac0 100644
--- a/ext/tk/sample/tkextlib/blt/graph7b.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7b.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/graph7c.rb b/ext/tk/sample/tkextlib/blt/graph7c.rb
index d4ed1a66ad..8cbf3223f1 100644
--- a/ext/tk/sample/tkextlib/blt/graph7c.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7c.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/pareto.rb b/ext/tk/sample/tkextlib/blt/pareto.rb
index bf9a1ec749..e68cde7992 100644
--- a/ext/tk/sample/tkextlib/blt/pareto.rb
+++ b/ext/tk/sample/tkextlib/blt/pareto.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
@@ -67,7 +68,7 @@ xdata.zip(ydata){|x, y|
:foreground=>'red4', :anchor=>:center, :yoffset=>-5)
}
-# Display an auxillary y-axis for percentages.
+# Display an auxiliary y-axis for percentages.
b.axis_configure('y2', :hide=>false, :min=>0.0, :max=>100.0,
:title=>'Percentage')
diff --git a/ext/tk/sample/tkextlib/blt/plot1.rb b/ext/tk/sample/tkextlib/blt/plot1.rb
index 07dff48292..95797c96b7 100644
--- a/ext/tk/sample/tkextlib/blt/plot1.rb
+++ b/ext/tk/sample/tkextlib/blt/plot1.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/plot1b.rb b/ext/tk/sample/tkextlib/blt/plot1b.rb
index 8a3ce8216d..96adbd792b 100644
--- a/ext/tk/sample/tkextlib/blt/plot1b.rb
+++ b/ext/tk/sample/tkextlib/blt/plot1b.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/scripts/stipples.rb b/ext/tk/sample/tkextlib/blt/scripts/stipples.rb
index 47f3c4d063..2a4943e032 100644
--- a/ext/tk/sample/tkextlib/blt/scripts/stipples.rb
+++ b/ext/tk/sample/tkextlib/blt/scripts/stipples.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
$stipples = {} unless $stipples
$stipples['bdiagonal1'] = Tk::BLT::Bitmap.new(<<EOD)
diff --git a/ext/tk/sample/tkextlib/blt/winop1.rb b/ext/tk/sample/tkextlib/blt/winop1.rb
index 97c31aa295..32c01cad6b 100644
--- a/ext/tk/sample/tkextlib/blt/winop1.rb
+++ b/ext/tk/sample/tkextlib/blt/winop1.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/blt/winop2.rb b/ext/tk/sample/tkextlib/blt/winop2.rb
index d59c43ba22..cc708573ab 100644
--- a/ext/tk/sample/tkextlib/blt/winop2.rb
+++ b/ext/tk/sample/tkextlib/blt/winop2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/blt'
diff --git a/ext/tk/sample/tkextlib/bwidget/basic.rb b/ext/tk/sample/tkextlib/bwidget/basic.rb
index 060baf8a6c..6a7bdbc1f6 100644
--- a/ext/tk/sample/tkextlib/bwidget/basic.rb
+++ b/ext/tk/sample/tkextlib/bwidget/basic.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# basic demo --- called from demo.rb
#
diff --git a/ext/tk/sample/tkextlib/bwidget/demo.rb b/ext/tk/sample/tkextlib/bwidget/demo.rb
index 3eb98818f3..0b5578ca68 100644
--- a/ext/tk/sample/tkextlib/bwidget/demo.rb
+++ b/ext/tk/sample/tkextlib/bwidget/demo.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/bwidget'
diff --git a/ext/tk/sample/tkextlib/bwidget/dnd.rb b/ext/tk/sample/tkextlib/bwidget/dnd.rb
index b1b1cf60ff..326288bade 100644
--- a/ext/tk/sample/tkextlib/bwidget/dnd.rb
+++ b/ext/tk/sample/tkextlib/bwidget/dnd.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# dnd demo --- called from demo.rb
#
diff --git a/ext/tk/sample/tkextlib/bwidget/manager.rb b/ext/tk/sample/tkextlib/bwidget/manager.rb
index a59afb8b86..b0371699ad 100644
--- a/ext/tk/sample/tkextlib/bwidget/manager.rb
+++ b/ext/tk/sample/tkextlib/bwidget/manager.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# manager demo --- called from demo.rb
#
diff --git a/ext/tk/sample/tkextlib/bwidget/select.rb b/ext/tk/sample/tkextlib/bwidget/select.rb
index 3a1a810e14..b32a69d837 100644
--- a/ext/tk/sample/tkextlib/bwidget/select.rb
+++ b/ext/tk/sample/tkextlib/bwidget/select.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# select demo --- called from demo.rb
#
diff --git a/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
index da2c9678c0..1496cbce2f 100644
--- a/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
+++ b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# templdlg demo --- called from demo.rb
#
diff --git a/ext/tk/sample/tkextlib/bwidget/tree.rb b/ext/tk/sample/tkextlib/bwidget/tree.rb
index 9ef6569d16..fbccd0d250 100644
--- a/ext/tk/sample/tkextlib/bwidget/tree.rb
+++ b/ext/tk/sample/tkextlib/bwidget/tree.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# templdlg demo --- called from demo.rb
#
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb
index 2b7cd45205..c64c3f0247 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
index bb09b4dfd3..4093997029 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb
index c7c043000a..1680aae695 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb
index ea8d63e6eb..1bedf2c543 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb
index bae0eba73a..bd0a21fd7f 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
index 36847538d6..1ce2c9085e 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb
index 5727879217..873f702cb5 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb b/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb
index 12d498245d..30c72a1351 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb
index 3449cd4b3d..f9ceffb201 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
index 00ee99786c..240768a259 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
index 682c853e47..151a06f8da 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
index 8563a0894d..a063ddc2ce 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#########################################################
#
# use Tk::UTF8_String() for a utf8 charecter
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
index d8ccdf8555..fb7538b278 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#########################################################
#
# set $KCODE to 'utf' for a utf8 charecter
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
index 327f90893c..dc8462096e 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#########################################################
#
# set Tk.encoding = 'utf-8' for a utf8 charecter
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
index 4944c72ea5..fbacebc563 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
index 63e4be2fee..2eb0c7aca0 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb
index c1a9b3defd..24a32da49a 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb b/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb
index 7b87a029ed..27fe625a5d 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
index 3a5b513bde..c87ee27a6c 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb
index ff22b2f643..1585bd4639 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb
index 110efb9b96..a32a08ffbf 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb b/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
index 085070e652..bb65a66b4d 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb b/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb
index f9c92bf6dc..dcda4030f3 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb b/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb
index 4e2e21e727..52bf957208 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
index 577550af55..8b45d2bcb0 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb b/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
index c9677f2270..3e5e511a1e 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
index e01275217d..389a622966 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
index 477c916e07..c3fd8bc35d 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
index 87b2d38907..8f51ab754f 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
index 5278883568..9bb15ebec2 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
index 52799f206c..ca73ed54d2 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb b/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
index 4d460e8802..4305db4f5c 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
index 576a9c18d0..a3b00b2a87 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb b/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
index 2b921ffab9..2dc7eaf411 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
index 88fc401483..ba36319f85 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
index 96987d529c..4abd5f4a45 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
index d92a26ead9..7f011f4833 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb b/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
index e76dda88c6..5d3bdc7efd 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb
index 9cd6a002b0..470ed8cee5 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb
index 92c94b96bb..85e6a47b1a 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
index e5bd90a1cb..91d22131c0 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
index 2b675f802c..f825483b2c 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
index bf2c60191f..3872fb7d40 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
index 41498e67f7..4965039371 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
index 74684974b1..8c0b68a22e 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
index d53391f2f3..9fbf8b7d2a 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
index 6d01280141..4cbf4416c0 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb
index 17197a66b7..38d9b49c86 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
index e2dde01b18..1887f46e05 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb
index 6a20b0eb87..2e64bdfb08 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb
index 2c13884b94..597e7d014c 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
index 382b34d3ce..0c94cd1738 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
index 2689759bde..57f9e46214 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb
index 90be46b40b..99d5ac6071 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb b/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb
index 465939947b..5841f0aadf 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb b/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb
index bb5945048d..e2824b17aa 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
index 608efd0af1..3cbaec210b 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb b/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
index 2af53ba63b..b06f173eee 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/iwidgets'
diff --git a/ext/tk/sample/tkextlib/tcllib/datefield.rb b/ext/tk/sample/tkextlib/tcllib/datefield.rb
index 3550af7d23..cf77ed5e64 100644
--- a/ext/tk/sample/tkextlib/tcllib/datefield.rb
+++ b/ext/tk/sample/tkextlib/tcllib/datefield.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/tcllib/datefield'
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
index 7f35a3833c..89166c1c30 100644
--- a/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/tcllib/plotchart'
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
index cb657a40d8..58c5b1928b 100644
--- a/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/tcllib/plotchart'
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
index 66b8fe706a..816e38b6a6 100644
--- a/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/tcllib/plotchart'
diff --git a/ext/tk/sample/tkextlib/tcllib/xyplot.rb b/ext/tk/sample/tkextlib/tcllib/xyplot.rb
index 2aa101efcb..3d71c3bf9f 100644
--- a/ext/tk/sample/tkextlib/tcllib/xyplot.rb
+++ b/ext/tk/sample/tkextlib/tcllib/xyplot.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/tcllib/plotchart'
diff --git a/ext/tk/sample/tkextlib/tile/demo.rb b/ext/tk/sample/tkextlib/tile/demo.rb
index 260ca00022..8348ecdb58 100644
--- a/ext/tk/sample/tkextlib/tile/demo.rb
+++ b/ext/tk/sample/tkextlib/tile/demo.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# Demo for 'tile' package.
#
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc.rb b/ext/tk/sample/tkextlib/tile/themes/kroc.rb
index 72a7c6901d..3b8569275b 100644
--- a/ext/tk/sample/tkextlib/tile/themes/kroc.rb
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# kroc.rb
#
diff --git a/ext/tk/sample/tkextlib/tkHTML/hv.rb b/ext/tk/sample/tkextlib/tkHTML/hv.rb
index 920eb15f5a..eb3a786c21 100644
--- a/ext/tk/sample/tkextlib/tkHTML/hv.rb
+++ b/ext/tk/sample/tkextlib/tkHTML/hv.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# This script implements the "hv" application. Type "hv FILE" to
# view FILE as HTML.
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/index.html b/ext/tk/sample/tkextlib/tkHTML/page4/index.html
index c7bfde35a5..588ae5ccd7 100644
--- a/ext/tk/sample/tkextlib/tkHTML/page4/index.html
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/index.html
@@ -117,7 +117,7 @@ squelching curiosity."
<B><FONT SIZE="+2">nmpg 1.1.3</FONT></B><BR>
<SMALL><B><A HREF="mailto:narkos@linuxmail.org">Joel Lindau</A> - January 29th 2000, 18:18 EST</B></SMALL>
<DIV ALIGN="justify"><P>nmpg is a small command-driven frontend and network-jukebox for mpg123.</DIV>
-<P><B>Changes:</B> Bugfixes, better memory managment, a new .nmpgrc parser, and new options.
+<P><B>Changes:</B> Bugfixes, better memory management, a new .nmpgrc parser, and new options.
<P><B>Urgency:</B> low
<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949187896.html">comments (0)</A> ]</B>
</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
diff --git a/ext/tk/sample/tkextlib/tkHTML/ss.rb b/ext/tk/sample/tkextlib/tkHTML/ss.rb
index 45d4d87d69..e6ef63bc31 100644
--- a/ext/tk/sample/tkextlib/tkHTML/ss.rb
+++ b/ext/tk/sample/tkextlib/tkHTML/ss.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# This script implements the "ss" application. "ss" implements
# a presentation slide-show based on HTML slides.
diff --git a/ext/tk/sample/tkextlib/tkimg/demo.rb b/ext/tk/sample/tkextlib/tkimg/demo.rb
index 8016c263a6..0f0d585fc7 100644
--- a/ext/tk/sample/tkextlib/tkimg/demo.rb
+++ b/ext/tk/sample/tkextlib/tkimg/demo.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# Tk::Img demo
#
diff --git a/ext/tk/sample/tkextlib/tktable/basic.rb b/ext/tk/sample/tkextlib/tktable/basic.rb
index dddbb776dc..eed5351a8a 100644
--- a/ext/tk/sample/tkextlib/tktable/basic.rb
+++ b/ext/tk/sample/tkextlib/tktable/basic.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## basic.rb
##
diff --git a/ext/tk/sample/tkextlib/tktable/buttons.rb b/ext/tk/sample/tkextlib/tktable/buttons.rb
index e35c137a28..2c3fee7982 100644
--- a/ext/tk/sample/tkextlib/tktable/buttons.rb
+++ b/ext/tk/sample/tkextlib/tktable/buttons.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## buttons.rb
##
diff --git a/ext/tk/sample/tkextlib/tktable/command.rb b/ext/tk/sample/tkextlib/tktable/command.rb
index e697ccf3bf..05ee47aa17 100644
--- a/ext/tk/sample/tkextlib/tktable/command.rb
+++ b/ext/tk/sample/tkextlib/tktable/command.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## command.rb
##
diff --git a/ext/tk/sample/tkextlib/tktable/debug.rb b/ext/tk/sample/tkextlib/tktable/debug.rb
index 016d5b353e..831b3a1846 100644
--- a/ext/tk/sample/tkextlib/tktable/debug.rb
+++ b/ext/tk/sample/tkextlib/tktable/debug.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## debug.rb
##
diff --git a/ext/tk/sample/tkextlib/tktable/dynarows.rb b/ext/tk/sample/tkextlib/tktable/dynarows.rb
index cc72a021cf..ae3349daba 100644
--- a/ext/tk/sample/tkextlib/tktable/dynarows.rb
+++ b/ext/tk/sample/tkextlib/tktable/dynarows.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## dynarows.rb
##
diff --git a/ext/tk/sample/tkextlib/tktable/maxsize.rb b/ext/tk/sample/tkextlib/tktable/maxsize.rb
index 74e136c49c..51aa619126 100644
--- a/ext/tk/sample/tkextlib/tktable/maxsize.rb
+++ b/ext/tk/sample/tkextlib/tktable/maxsize.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## maxsize.rb
##
diff --git a/ext/tk/sample/tkextlib/tktable/spreadsheet.rb b/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
index 2953b2e597..a801045d41 100644
--- a/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
+++ b/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## spreadsheet.rb
##
diff --git a/ext/tk/sample/tkextlib/tktable/valid.rb b/ext/tk/sample/tkextlib/tktable/valid.rb
index 98e9c3855a..f11e511884 100644
--- a/ext/tk/sample/tkextlib/tktable/valid.rb
+++ b/ext/tk/sample/tkextlib/tktable/valid.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
##
## valid.rb
##
diff --git a/ext/tk/sample/tkextlib/treectrl/bitmaps.rb b/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
index 0d8b37b81e..a42e7ac541 100644
--- a/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
+++ b/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Demo: Bitmaps
#
diff --git a/ext/tk/sample/tkextlib/treectrl/demo.rb b/ext/tk/sample/tkextlib/treectrl/demo.rb
index 564a005bdc..cd277cf2a9 100644
--- a/ext/tk/sample/tkextlib/treectrl/demo.rb
+++ b/ext/tk/sample/tkextlib/treectrl/demo.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/treectrl'
diff --git a/ext/tk/sample/tkextlib/treectrl/explorer.rb b/ext/tk/sample/tkextlib/treectrl/explorer.rb
index 1b8c2a8287..3b54bf269c 100644
--- a/ext/tk/sample/tkextlib/treectrl/explorer.rb
+++ b/ext/tk/sample/tkextlib/treectrl/explorer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
def demoExplorerAux(t, dir_proc, file_proc)
base_dir = File.dirname(File.dirname(@ScriptDir))
diff --git a/ext/tk/sample/tkextlib/treectrl/help.rb b/ext/tk/sample/tkextlib/treectrl/help.rb
index 31ec9eb3f8..e3758d00a6 100644
--- a/ext/tk/sample/tkextlib/treectrl/help.rb
+++ b/ext/tk/sample/tkextlib/treectrl/help.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Demo: Help contents
#
diff --git a/ext/tk/sample/tkextlib/treectrl/imovie.rb b/ext/tk/sample/tkextlib/treectrl/imovie.rb
index 72134ebda6..4419496ac4 100644
--- a/ext/tk/sample/tkextlib/treectrl/imovie.rb
+++ b/ext/tk/sample/tkextlib/treectrl/imovie.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Demo: iMovie
#
diff --git a/ext/tk/sample/tkextlib/treectrl/layout.rb b/ext/tk/sample/tkextlib/treectrl/layout.rb
index 488abe2aa9..50c332641b 100644
--- a/ext/tk/sample/tkextlib/treectrl/layout.rb
+++ b/ext/tk/sample/tkextlib/treectrl/layout.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Demo: Layout
#
diff --git a/ext/tk/sample/tkextlib/treectrl/mailwasher.rb b/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
index 1b51bb9b21..81ffe743b6 100644
--- a/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
+++ b/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Demo: MailWasher
#
diff --git a/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb b/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
index d966807866..8707251ee9 100644
--- a/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
+++ b/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Demo: Outlook Express folder list
#
diff --git a/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb b/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
index 3495522e5c..841f330919 100644
--- a/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
+++ b/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# Demo: Outlook Express newsgroup messages
#
diff --git a/ext/tk/sample/tkextlib/treectrl/random.rb b/ext/tk/sample/tkextlib/treectrl/random.rb
index 43aca63283..33bbcc2631 100644
--- a/ext/tk/sample/tkextlib/treectrl/random.rb
+++ b/ext/tk/sample/tkextlib/treectrl/random.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
def random_N
@RandomN[0] || 500
diff --git a/ext/tk/sample/tkextlib/treectrl/www-options.rb b/ext/tk/sample/tkextlib/treectrl/www-options.rb
index 6a3e9c2201..81f5349abc 100644
--- a/ext/tk/sample/tkextlib/treectrl/www-options.rb
+++ b/ext/tk/sample/tkextlib/treectrl/www-options.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
def demoInternetOptions (t)
@Option = TkVarAccess.new_hash('::Option')
diff --git a/ext/tk/sample/tkextlib/vu/canvItems.rb b/ext/tk/sample/tkextlib/vu/canvItems.rb
index 364f87613b..aa9bd5e9f6 100644
--- a/ext/tk/sample/tkextlib/vu/canvItems.rb
+++ b/ext/tk/sample/tkextlib/vu/canvItems.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/vu/charts'
diff --git a/ext/tk/sample/tkextlib/vu/canvSticker.rb b/ext/tk/sample/tkextlib/vu/canvSticker.rb
index 85713ebcf3..a240eb5be2 100644
--- a/ext/tk/sample/tkextlib/vu/canvSticker.rb
+++ b/ext/tk/sample/tkextlib/vu/canvSticker.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/vu/charts'
diff --git a/ext/tk/sample/tkextlib/vu/canvSticker2.rb b/ext/tk/sample/tkextlib/vu/canvSticker2.rb
index 3d9495ffb0..5dec81aed9 100644
--- a/ext/tk/sample/tkextlib/vu/canvSticker2.rb
+++ b/ext/tk/sample/tkextlib/vu/canvSticker2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/vu/charts'
diff --git a/ext/tk/sample/tkextlib/vu/dial_demo.rb b/ext/tk/sample/tkextlib/vu/dial_demo.rb
index f1f2f110b1..409b8d73cf 100644
--- a/ext/tk/sample/tkextlib/vu/dial_demo.rb
+++ b/ext/tk/sample/tkextlib/vu/dial_demo.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/vu/dial'
diff --git a/ext/tk/sample/tkextlib/vu/oscilloscope.rb b/ext/tk/sample/tkextlib/vu/oscilloscope.rb
index 1efe13ce01..0fa779985d 100644
--- a/ext/tk/sample/tkextlib/vu/oscilloscope.rb
+++ b/ext/tk/sample/tkextlib/vu/oscilloscope.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/vu/charts'
diff --git a/ext/tk/sample/tkextlib/vu/pie.rb b/ext/tk/sample/tkextlib/vu/pie.rb
index c8f9276e4e..a61a19188e 100644
--- a/ext/tk/sample/tkextlib/vu/pie.rb
+++ b/ext/tk/sample/tkextlib/vu/pie.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/vu/pie'
diff --git a/ext/tk/sample/tkextlib/vu/vu_demo.rb b/ext/tk/sample/tkextlib/vu/vu_demo.rb
index 358d32495f..7b9741f933 100644
--- a/ext/tk/sample/tkextlib/vu/vu_demo.rb
+++ b/ext/tk/sample/tkextlib/vu/vu_demo.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
require 'tkextlib/vu'
diff --git a/ext/tk/sample/tkfrom.rb b/ext/tk/sample/tkfrom.rb
index f51f7f5d85..4c249884af 100644
--- a/ext/tk/sample/tkfrom.rb
+++ b/ext/tk/sample/tkfrom.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require "parsedate"
require "base64"
diff --git a/ext/tk/sample/tkhello.rb b/ext/tk/sample/tkhello.rb
index 597c1f6242..02de5ff381 100644
--- a/ext/tk/sample/tkhello.rb
+++ b/ext/tk/sample/tkhello.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require "tk"
TkButton.new(nil,
diff --git a/ext/tk/sample/tkline.rb b/ext/tk/sample/tkline.rb
index 3124c2fe0c..c23cb95cbd 100644
--- a/ext/tk/sample/tkline.rb
+++ b/ext/tk/sample/tkline.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require "tkclass"
diff --git a/ext/tk/sample/tkmenubutton.rb b/ext/tk/sample/tkmenubutton.rb
index 8ae1359425..2107e42a75 100644
--- a/ext/tk/sample/tkmenubutton.rb
+++ b/ext/tk/sample/tkmenubutton.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# menubutton sample : based on sample menubuttons on the Tcl/Tk demo script
#
diff --git a/ext/tk/sample/tkmsgcat-load_rb.rb b/ext/tk/sample/tkmsgcat-load_rb.rb
index 98a91fadf4..bacf85de50 100644
--- a/ext/tk/sample/tkmsgcat-load_rb.rb
+++ b/ext/tk/sample/tkmsgcat-load_rb.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
diff --git a/ext/tk/sample/tkmsgcat-load_rb2.rb b/ext/tk/sample/tkmsgcat-load_rb2.rb
index 05512a3131..53e41bc481 100644
--- a/ext/tk/sample/tkmsgcat-load_rb2.rb
+++ b/ext/tk/sample/tkmsgcat-load_rb2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
diff --git a/ext/tk/sample/tkmsgcat-load_tk.rb b/ext/tk/sample/tkmsgcat-load_tk.rb
index 703f471e19..783d03ccf2 100644
--- a/ext/tk/sample/tkmsgcat-load_tk.rb
+++ b/ext/tk/sample/tkmsgcat-load_tk.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'tk'
diff --git a/ext/tk/sample/tkmulticolumnlist.rb b/ext/tk/sample/tkmulticolumnlist.rb
index a1b3a1a2fa..fb0c29d7ff 100644
--- a/ext/tk/sample/tkmulticolumnlist.rb
+++ b/ext/tk/sample/tkmulticolumnlist.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkmulticolumnlist.rb : multiple column list widget on scrollable frame
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/sample/tkmultilistbox.rb b/ext/tk/sample/tkmultilistbox.rb
index 7791649c4b..c8c8118ffe 100644
--- a/ext/tk/sample/tkmultilistbox.rb
+++ b/ext/tk/sample/tkmultilistbox.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkmultilistbox.rb : multiple listbox widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/sample/tkmultilistframe.rb b/ext/tk/sample/tkmultilistframe.rb
index 7c0aac9a9e..229a40023a 100644
--- a/ext/tk/sample/tkmultilistframe.rb
+++ b/ext/tk/sample/tkmultilistframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tkmultilistframe.rb : multiple listbox widget on scrollable frame
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb
index 7502e30667..f14015d15f 100644..100755
--- a/ext/tk/sample/tkoptdb-safeTk.rb
+++ b/ext/tk/sample/tkoptdb-safeTk.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
require 'multi-tk'
@@ -31,7 +32,7 @@ file = File.expand_path('tkoptdb.rb', File.dirname(__FILE__))
ip = MultiTkIp.new_safeTk{
# When a block is given to 'new_safeTk' method,
- # the block is evaluated on $SAFE==4.
+ # the block is evaluated on $SAFE==1.
ent.each{|pat, val| Tk.tk_call('option', 'add', pat, val)}
}
diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb
index 0171e465b3..3fb2464260 100644
--- a/ext/tk/sample/tkoptdb.rb
+++ b/ext/tk/sample/tkoptdb.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# sample script of TkOptionDB
#
diff --git a/ext/tk/sample/tkrttimer.rb b/ext/tk/sample/tkrttimer.rb
index 1f9cbd9eb5..cde15620b6 100644
--- a/ext/tk/sample/tkrttimer.rb
+++ b/ext/tk/sample/tkrttimer.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class.
require "tk"
diff --git a/ext/tk/sample/tksleep_sample.rb b/ext/tk/sample/tksleep_sample.rb
index 23f6eca54e..14ce3a475f 100644
--- a/ext/tk/sample/tksleep_sample.rb
+++ b/ext/tk/sample/tksleep_sample.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'tk'
v = TkVariable.new(0)
diff --git a/ext/tk/sample/tktextframe.rb b/ext/tk/sample/tktextframe.rb
index d6584beeb8..f6d9bbd239 100644
--- a/ext/tk/sample/tktextframe.rb
+++ b/ext/tk/sample/tktextframe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# tktextframe.rb : a sample of TkComposite
#
diff --git a/ext/tk/sample/tktextio.rb b/ext/tk/sample/tktextio.rb
index 679a2b7142..4a1346b38b 100644
--- a/ext/tk/sample/tktextio.rb
+++ b/ext/tk/sample/tktextio.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# TkTextIO class :: handling I/O stream on a TkText widget
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
@@ -935,7 +936,7 @@ if __FILE__ == $0
$stdout = tio
$stderr = tio
- STDOUT.print("\n========= TkTextIO#gets for inital text ========\n\n")
+ STDOUT.print("\n========= TkTextIO#gets for initial text ========\n\n")
while(s = gets)
STDOUT.print(s)
diff --git a/ext/tk/sample/tktimer.rb b/ext/tk/sample/tktimer.rb
index b1adb5b506..4b6abae7e6 100644
--- a/ext/tk/sample/tktimer.rb
+++ b/ext/tk/sample/tktimer.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
# This script generates a counter with start and stop buttons.
require "tk"
diff --git a/ext/tk/sample/tktimer2.rb b/ext/tk/sample/tktimer2.rb
index 125115e863..3f8d722153 100644
--- a/ext/tk/sample/tktimer2.rb
+++ b/ext/tk/sample/tktimer2.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class.
require "tk"
diff --git a/ext/tk/sample/tktimer3.rb b/ext/tk/sample/tktimer3.rb
index 08e8a3cad4..bce3cd6b6c 100644
--- a/ext/tk/sample/tktimer3.rb
+++ b/ext/tk/sample/tktimer3.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class.
require "tk"
diff --git a/ext/tk/sample/tktree.rb b/ext/tk/sample/tktree.rb
index 4eb7f60627..47622973e7 100644
--- a/ext/tk/sample/tktree.rb
+++ b/ext/tk/sample/tktree.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
##########################################################################
# TkTree widget class
#
diff --git a/ext/tk/sample/ttk_wrapper.rb b/ext/tk/sample/ttk_wrapper.rb
index e4eb9c7964..eee9878704 100644
--- a/ext/tk/sample/ttk_wrapper.rb
+++ b/ext/tk/sample/ttk_wrapper.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
#
# ttk_wrapper.rb -- use Ttk widgets as default on old Ruby/Tk scripts
#
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 7398a79ae3..89da88aea4 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -24,7 +24,7 @@
static int call_macinit = 0;
static void
-_macinit()
+_macinit(void)
{
if (!call_macinit) {
tcl_macQdPtr = &qd; /* setup QuickDraw globals */
@@ -83,8 +83,8 @@ _nativethread_consistency_check(ip)
# define DL_SYM GetProcAddress
# define TCL_INDEX 4
# define TK_INDEX 3
-# define TCL_NAME "tcl89%s"
-# define TK_NAME "tk89%s"
+# define TCL_NAME "tcl89"
+# define TK_NAME "tk89"
# undef DLEXT
# define DLEXT ".dll"
#elif defined HAVE_DLOPEN
@@ -94,8 +94,8 @@ _nativethread_consistency_check(ip)
# define DL_SYM dlsym
# define TCL_INDEX 8
# define TK_INDEX 7
-# define TCL_NAME "libtcl8.9%s"
-# define TK_NAME "libtk8.9%s"
+# define TCL_NAME "libtcl8.9"
+# define TK_NAME "libtk8.9"
# ifdef __APPLE__
# undef DLEXT
# define DLEXT ".dylib"
@@ -116,7 +116,6 @@ ruby_open_tcl_dll(appname)
void (*p_Tcl_FindExecutable)(const char *);
int n;
char *ruby_tcl_dll = 0;
- char tcl_name[20];
if (tcl_dll) return TCLTK_STUBS_OK;
@@ -127,7 +126,7 @@ ruby_open_tcl_dll(appname)
if (ruby_tcl_dll) {
tcl_dll = (DL_HANDLE)DL_OPEN(ruby_tcl_dll);
} else {
- snprintf(tcl_name, sizeof tcl_name, TCL_NAME, DLEXT);
+ char tcl_name[] = TCL_NAME DLEXT;
/* examine from 8.9 to 8.1 */
for (n = '9'; n > '0'; n--) {
tcl_name[TCL_INDEX] = n;
@@ -158,11 +157,10 @@ ruby_open_tcl_dll(appname)
}
int
-ruby_open_tk_dll()
+ruby_open_tk_dll(void)
{
int n;
char *ruby_tk_dll = 0;
- char tk_name[20];
if (!tcl_dll) {
/* int ret = ruby_open_tcl_dll(RSTRING_PTR(rb_argv0)); */
@@ -176,7 +174,7 @@ ruby_open_tk_dll()
if (ruby_tk_dll) {
tk_dll = (DL_HANDLE)DL_OPEN(ruby_tk_dll);
} else {
- snprintf(tk_name, sizeof tk_name, TK_NAME, DLEXT);
+ char tk_name[] = TK_NAME DLEXT;
/* examine from 8.9 to 8.1 */
for (n = '9'; n > '0'; n--) {
tk_name[TK_INDEX] = n;
@@ -204,13 +202,13 @@ ruby_open_tcltk_dll(appname)
}
int
-tcl_stubs_init_p()
+tcl_stubs_init_p(void)
{
return(tclStubsPtr != (TclStubs*)NULL);
}
int
-tk_stubs_init_p()
+tk_stubs_init_p(void)
{
return(tkStubsPtr != (TkStubs*)NULL);
}
@@ -287,7 +285,7 @@ ruby_tcl_create_ip_and_stubs_init(st)
}
int
-ruby_tcl_stubs_init()
+ruby_tcl_stubs_init(void)
{
int st;
Tcl_Interp *tcl_ip;
@@ -399,7 +397,7 @@ ruby_tk_stubs_safeinit(tcl_ip)
}
int
-ruby_tcltk_stubs()
+ruby_tcltk_stubs(void)
{
int st;
Tcl_Interp *tcl_ip;
@@ -469,7 +467,7 @@ ruby_open_tcl_dll(appname)
}
int
-ruby_open_tk_dll()
+ruby_open_tk_dll(void)
{
if (!open_tcl_dll) {
/* ruby_open_tcl_dll(RSTRING_PTR(rb_argv0)); */
@@ -491,13 +489,13 @@ ruby_open_tcltk_dll(appname)
}
int
-tcl_stubs_init_p()
+tcl_stubs_init_p(void)
{
return 1;
}
int
-tk_stubs_init_p()
+tk_stubs_init_p(void)
{
return call_tk_stubs_init;
}
@@ -530,7 +528,7 @@ ruby_tcl_create_ip_and_stubs_init(st)
}
int
-ruby_tcl_stubs_init()
+ruby_tcl_stubs_init(void)
{
return TCLTK_STUBS_OK;
}
@@ -584,7 +582,7 @@ ruby_tk_stubs_safeinit(tcl_ip)
}
int
-ruby_tcltk_stubs()
+ruby_tcltk_stubs(void)
{
/* Tcl_FindExecutable(RSTRING_PTR(rb_argv0)); */
Tcl_FindExecutable(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
diff --git a/ext/tk/stubs.h b/ext/tk/stubs.h
index 7c913fb393..b4a85dbd1f 100644
--- a/ext/tk/stubs.h
+++ b/ext/tk/stubs.h
@@ -1,15 +1,15 @@
#include <tcl.h>
extern int ruby_open_tcl_dll(char *);
-extern int ruby_open_tk_dll();
+extern int ruby_open_tk_dll(void);
extern int ruby_open_tcltk_dll(char *);
-extern int tcl_stubs_init_p();
-extern int tk_stubs_init_p();
+extern int tcl_stubs_init_p(void);
+extern int tk_stubs_init_p(void);
extern Tcl_Interp *ruby_tcl_create_ip_and_stubs_init(int*);
-extern int ruby_tcl_stubs_init();
+extern int ruby_tcl_stubs_init(void);
extern int ruby_tk_stubs_init(Tcl_Interp*);
extern int ruby_tk_stubs_safeinit(Tcl_Interp*);
-extern int ruby_tcltk_stubs();
+extern int ruby_tcltk_stubs(void);
/* no error */
#define TCLTK_STUBS_OK (0)
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index d269f9c43e..47dc52a337 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -19,9 +19,12 @@
#define RUBY_RELEASE_DATE "unknown release-date"
#endif
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
+
#ifdef HAVE_RB_THREAD_CHECK_TRAP_PENDING
static int rb_thread_critical; /* dummy */
-int rb_thread_check_trap_pending();
+int rb_thread_check_trap_pending(void);
#else
/* use rb_thread_critical on Ruby 1.8.x */
#include "rubysig.h"
@@ -39,6 +42,12 @@ int rb_thread_check_trap_pending();
#define RARRAY_PTR(s) (RARRAY(s)->ptr)
#define RARRAY_LEN(s) (RARRAY(s)->len)
#endif
+#if !defined(RARRAY_CONST_PTR)
+#define RARRAY_CONST_PTR(s) (const VALUE *)RARRAY_PTR(s)
+#endif
+#if !defined(RARRAY_AREF)
+#define RARRAY_AREF(a, i) RARRAY_CONST_PTR(a)[i]
+#endif
#ifdef OBJ_UNTRUST
#define RbTk_OBJ_UNTRUST(x) do {OBJ_TAINT(x); OBJ_UNTRUST(x);} while (0)
@@ -114,7 +123,7 @@ static struct {
} tcltk_version = {0, 0, 0, 0};
static void
-set_tcltk_version()
+set_tcltk_version(void)
{
if (tcltk_version.major) return;
@@ -182,6 +191,7 @@ static const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE;
static const char finalize_hook_name[] = "INTERP_FINALIZE_HOOK";
static void ip_finalize _((Tcl_Interp*));
+static void ip_free _((void *p));
static int at_exit = 0;
@@ -390,7 +400,7 @@ Tcl_SetVar2Ex(interp, name1, name2, newValObj, flags)
/* from tkAppInit.c */
#if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 4)
-# if !defined __MINGW32__ && !defined __BORLANDC__
+# if !defined __MINGW32__
/*
* The following variable is a special hack that is needed in order for
* Sun shared libraries to be used for Tcl.
@@ -771,13 +781,18 @@ struct tcltkip {
int return_value; /* return value */
};
+static const rb_data_type_t tcltkip_type = {
+ "tcltkip",
+ {0, ip_free, 0,},
+};
+
static struct tcltkip *
get_ip(self)
VALUE self;
{
struct tcltkip *ptr;
- Data_Get_Struct(self, struct tcltkip, ptr);
+ TypedData_Get_Struct(self, struct tcltkip, &tcltkip_type, ptr);
if (ptr == 0) {
/* rb_raise(rb_eTypeError, "uninitialized TclTkIp"); */
return((struct tcltkip *)NULL);
@@ -848,15 +863,14 @@ create_ip_exc(interp, exc, fmt, va_alist)
#endif
{
va_list args;
- char buf[BUFSIZ];
+ VALUE msg;
VALUE einfo;
struct tcltkip *ptr = get_ip(interp);
va_init_list(args,fmt);
- vsnprintf(buf, BUFSIZ, fmt, args);
- buf[BUFSIZ - 1] = '\0';
+ msg = rb_vsprintf(fmt, args);
va_end(args);
- einfo = rb_exc_new2(exc, buf);
+ einfo = rb_exc_new_str(exc, msg);
rb_ivar_set(einfo, ID_at_interp, interp);
if (ptr) {
Tcl_ResetResult(ptr->ip);
@@ -1058,7 +1072,7 @@ set_rubytk_kitpath(const char *kitpath)
#endif
static void
-check_tclkit_std_channels()
+check_tclkit_std_channels(void)
{
Tcl_Channel chan;
@@ -1142,7 +1156,7 @@ rubytk_kitpath_init(Tcl_Interp *interp)
/*--------------------------------------------------------*/
static void
-init_static_tcltk_packages()
+init_static_tcltk_packages(void)
{
/*
* Ensure that std channels exist (creating them if necessary)
@@ -1229,7 +1243,7 @@ void rbtk_win32_SetHINSTANCE(const char *module_name)
/*--------------------------------------------------------*/
static void
-setup_rubytkkit()
+setup_rubytkkit(void)
{
init_static_tcltk_packages();
@@ -1255,10 +1269,17 @@ setup_rubytkkit()
#ifdef __WIN32__
/* rbtk_win32_SetHINSTANCE("tcltklib.so"); */
{
- volatile VALUE basename;
+# ifdef HAVE_RUBY_ENC_FIND_BASENAME
+ const char *base = ruby_enc_find_basename(rb_sourcefile(), NULL, NULL,
+ rb_filesystem_encoding());
+ rbtk_win32_SetHINSTANCE(base);
+# else
+ VALUE basename;
basename = rb_funcall(rb_cFile, rb_intern("basename"), 1,
rb_str_new2(rb_sourcefile()));
rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename));
+ RB_GC_GUARD(basename);
+# endif
}
#endif
set_rubytk_kitpath(rb_sourcefile());
@@ -1282,7 +1303,7 @@ setup_rubytkkit()
/* stub status */
static void
-tcl_stubs_check()
+tcl_stubs_check(void)
{
if (!tcl_stubs_init_p()) {
int st = ruby_tcl_stubs_init();
@@ -1376,14 +1397,14 @@ tcltkip_init_tk(interp)
}
-/* treat excetiopn on Tcl side */
+/* treat exception on Tcl side */
static VALUE rbtk_pending_exception;
static int rbtk_eventloop_depth = 0;
static int rbtk_internal_eventloop_handler = 0;
static int
-pending_exception_check0()
+pending_exception_check0(void)
{
volatile VALUE exc = rbtk_pending_exception;
@@ -1646,7 +1667,7 @@ _timer_for_tcl(clientData)
#ifdef RUBY_USE_NATIVE_THREAD
#if USE_TOGGLE_WINDOW_MODE_FOR_IDLE
static int
-toggle_eventloop_window_mode_for_idle()
+toggle_eventloop_window_mode_for_idle(void)
{
if (window_event_mode & TCL_IDLE_EVENTS) {
/* idle -> event */
@@ -1874,19 +1895,19 @@ set_max_block_time(self, time)
case T_BIGNUM:
/* time is micro-second value */
divmod = rb_funcall(time, rb_intern("divmod"), 1, LONG2NUM(1000000));
- tcl_time.sec = NUM2LONG(RARRAY_PTR(divmod)[0]);
- tcl_time.usec = NUM2LONG(RARRAY_PTR(divmod)[1]);
+ tcl_time.sec = NUM2LONG(RARRAY_AREF(divmod, 0));
+ tcl_time.usec = NUM2LONG(RARRAY_AREF(divmod, 1));
break;
case T_FLOAT:
/* time is second value */
divmod = rb_funcall(time, rb_intern("divmod"), 1, INT2FIX(1));
- tcl_time.sec = NUM2LONG(RARRAY_PTR(divmod)[0]);
- tcl_time.usec = (long)(NUM2DBL(RARRAY_PTR(divmod)[1]) * 1000000);
+ tcl_time.sec = NUM2LONG(RARRAY_AREF(divmod, 0));
+ tcl_time.usec = (long)(NUM2DBL(RARRAY_AREF(divmod, 1)) * 1000000);
default:
{
- VALUE tmp = rb_funcall(time, ID_inspect, 0, 0);
+ VALUE tmp = rb_funcallv(time, ID_inspect, 0, 0);
rb_raise(rb_eArgError, "invalid value for time: '%s'",
StringValuePtr(tmp));
}
@@ -2080,9 +2101,9 @@ eventloop_sleep(dummy)
#endif
#endif
- DUMP2("eventloop_sleep: rb_thread_wait_for() at thread : %lx", rb_thread_current());
+ DUMP2("eventloop_sleep: rb_thread_wait_for() at thread : %"PRIxVALUE, rb_thread_current());
rb_thread_wait_for(t);
- DUMP2("eventloop_sleep: finish at thread : %lx", rb_thread_current());
+ DUMP2("eventloop_sleep: finish at thread : %"PRIxVALUE, rb_thread_current());
#ifdef HAVE_NATIVETHREAD
#ifndef RUBY_USE_NATIVE_THREAD
@@ -2100,7 +2121,7 @@ eventloop_sleep(dummy)
#if USE_EVLOOP_THREAD_ALONE_CHECK_FLAG
static int
-get_thread_alone_check_flag()
+get_thread_alone_check_flag(void)
{
#ifdef RUBY_USE_NATIVE_THREAD
return 0;
@@ -2169,7 +2190,7 @@ trap_check(int *check_var)
}
static int
-check_eventloop_interp()
+check_eventloop_interp(void)
{
DUMP1("check eventloop_interp");
if (eventloop_interp != (Tcl_Interp*)NULL
@@ -2499,8 +2520,8 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
}
} else {
- DUMP2("sleep eventloop %lx", current);
- DUMP2("eventloop thread is %lx", eventloop_thread);
+ DUMP2("sleep eventloop %"PRIxVALUE, current);
+ DUMP2("eventloop thread is %"PRIxVALUE, eventloop_thread);
/* rb_thread_stop(); */
rb_thread_sleep_forever();
}
@@ -2621,10 +2642,10 @@ lib_eventloop_ensure(args)
Tcl_DeleteEventSource(rbtk_EventSetupProc, rbtk_EventCheckProc, (ClientData)args);
- DUMP2("eventloop_ensure: current-thread : %lx", current_evloop);
- DUMP2("eventloop_ensure: eventloop-thread : %lx", eventloop_thread);
+ DUMP2("eventloop_ensure: current-thread : %"PRIxVALUE, current_evloop);
+ DUMP2("eventloop_ensure: eventloop-thread : %"PRIxVALUE, eventloop_thread);
if (eventloop_thread != current_evloop) {
- DUMP2("finish eventloop %lx (NOT current eventloop)", current_evloop);
+ DUMP2("finish eventloop %"PRIxVALUE" (NOT current eventloop)", current_evloop);
rb_thread_critical = ptr->thr_crit_bup;
@@ -2635,12 +2656,12 @@ lib_eventloop_ensure(args)
}
while((eventloop_thread = rb_ary_pop(eventloop_stack))) {
- DUMP2("eventloop-ensure: new eventloop-thread -> %lx",
+ DUMP2("eventloop-ensure: new eventloop-thread -> %"PRIxVALUE,
eventloop_thread);
if (eventloop_thread == current_evloop) {
rbtk_eventloop_depth--;
- DUMP2("eventloop %lx : back from recursive call", current_evloop);
+ DUMP2("eventloop %"PRIxVALUE" : back from recursive call", current_evloop);
break;
}
@@ -2652,7 +2673,7 @@ lib_eventloop_ensure(args)
}
if (RTEST(rb_thread_alive_p(eventloop_thread))) {
- DUMP2("eventloop-enshure: wake up parent %lx", eventloop_thread);
+ DUMP2("eventloop-enshure: wake up parent %"PRIxVALUE, eventloop_thread);
rb_thread_wakeup(eventloop_thread);
break;
@@ -2670,7 +2691,7 @@ lib_eventloop_ensure(args)
xfree(ptr);
/* ckfree((char*)ptr);*/
- DUMP2("finish current eventloop %lx", current_evloop);
+ DUMP2("finish current eventloop %"PRIxVALUE, current_evloop);
return Qnil;
}
@@ -2693,14 +2714,14 @@ lib_eventloop_launcher(check_root, update_flag, check_var, interp)
#endif
if (parent_evloop == eventloop_thread) {
- DUMP2("eventloop: recursive call on %lx", parent_evloop);
+ DUMP2("eventloop: recursive call on %"PRIxVALUE, parent_evloop);
rbtk_eventloop_depth++;
}
if (!NIL_P(parent_evloop) && parent_evloop != eventloop_thread) {
- DUMP2("wait for stop of parent_evloop %lx", parent_evloop);
+ DUMP2("wait for stop of parent_evloop %"PRIxVALUE, parent_evloop);
while(!RTEST(rb_funcall(parent_evloop, ID_stop_p, 0))) {
- DUMP2("parent_evloop %lx doesn't stop", parent_evloop);
+ DUMP2("parent_evloop %"PRIxVALUE" doesn't stop", parent_evloop);
rb_thread_run(parent_evloop);
}
DUMP1("succeed to stop parent");
@@ -2708,7 +2729,7 @@ lib_eventloop_launcher(check_root, update_flag, check_var, interp)
rb_ary_push(eventloop_stack, parent_evloop);
- DUMP3("tcltklib: eventloop-thread : %lx -> %lx\n",
+ DUMP3("tcltklib: eventloop-thread : %"PRIxVALUE" -> %"PRIxVALUE"\n",
parent_evloop, eventloop_thread);
args->check_root = check_root;
@@ -2814,11 +2835,11 @@ lib_watchdog_core(check_rootwidget)
if (NIL_P(eventloop_thread)
|| (loop_counter == prev_val && chance >= EVLOOP_WAKEUP_CHANCE)) {
/* start new eventloop thread */
- DUMP2("eventloop thread %lx is sleeping or dead",
+ DUMP2("eventloop thread %"PRIxVALUE" is sleeping or dead",
eventloop_thread);
evloop = rb_thread_create(watchdog_evloop_launcher,
(void*)&check_rootwidget);
- DUMP2("create new eventloop thread %lx", evloop);
+ DUMP2("create new eventloop thread %"PRIxVALUE, evloop);
loop_counter = -1;
chance = 0;
rb_thread_run(evloop);
@@ -3031,7 +3052,7 @@ lib_do_one_event_core(argc, argv, self, is_ip)
flags = FIX2INT(vflags);
}
- if (rb_safe_level() >= 4 || (rb_safe_level() >=1 && OBJ_TAINTED(vflags))) {
+ if (rb_safe_level() >=1 && OBJ_TAINTED(vflags)) {
flags |= TCL_DONT_WAIT;
}
@@ -3101,7 +3122,7 @@ ip_set_exc_message(interp, exc)
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
- msg = rb_funcall(exc, ID_message, 0, 0);
+ msg = rb_funcallv(exc, ID_message, 0, 0);
StringValue(msg);
#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
@@ -3111,11 +3132,11 @@ ip_set_exc_message(interp, exc)
}
if (NIL_P(enc)) {
encoding = (Tcl_Encoding)NULL;
- } else if (TYPE(enc) == T_STRING) {
+ } else if (RB_TYPE_P(enc, T_STRING)) {
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc));
} else {
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc));
}
@@ -3168,11 +3189,11 @@ TkStringValue(obj)
default:
if (rb_respond_to(obj, ID_to_s)) {
- return rb_funcall(obj, ID_to_s, 0, 0);
+ return rb_funcallv(obj, ID_to_s, 0, 0);
}
}
- return rb_funcall(obj, ID_inspect, 0, 0);
+ return rb_funcallv(obj, ID_inspect, 0, 0);
}
static int
@@ -3290,7 +3311,7 @@ tcl_protect_core(interp, proc, data) /* should not raise exception */
rb_thread_critical = Qtrue;
DUMP1("set backtrace");
- if (!NIL_P(backtrace = rb_funcall(exc, ID_backtrace, 0, 0))) {
+ if (!NIL_P(backtrace = rb_funcallv(exc, ID_backtrace, 0, 0))) {
backtrace = rb_ary_join(backtrace, rb_str_new2("\n"));
Tcl_AddErrorInfo(interp, StringValuePtr(backtrace));
}
@@ -3321,7 +3342,7 @@ tcl_protect_core(interp, proc, data) /* should not raise exception */
if (rb_obj_is_kind_of(exc, eLocalJumpError)) {
VALUE reason = rb_ivar_get(exc, ID_at_reason);
- if (TYPE(reason) == T_SYMBOL) {
+ if (RB_TYPE_P(reason, T_SYMBOL)) {
if (SYM2ID(reason) == ID_return)
return TCL_RETURN;
@@ -3474,65 +3495,18 @@ ip_ruby_cmd_core(arg)
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qfalse;
ret = rb_apply(arg->receiver, arg->method, arg->args);
- DUMP2("rb_apply return:%lx", ret);
+ DUMP2("rb_apply return:%"PRIxVALUE, ret);
rb_thread_critical = thr_crit_bup;
DUMP1("finish ip_ruby_cmd_core");
return ret;
}
-#define SUPPORT_NESTED_CONST_AS_IP_RUBY_CMD_RECEIVER 1
-
static VALUE
ip_ruby_cmd_receiver_const_get(name)
char *name;
{
- volatile VALUE klass = rb_cObject;
-#if 0
- char *head, *tail;
-#endif
- int state;
-
-#if SUPPORT_NESTED_CONST_AS_IP_RUBY_CMD_RECEIVER
- klass = rb_eval_string_protect(name, &state);
- if (state) {
- return Qnil;
- } else {
- return klass;
- }
-#else
- return rb_const_get(klass, rb_intern(name));
-#endif
-
- /* TODO!!!!!! */
- /* support nest of classes/modules */
-
- /* return rb_eval_string(name); */
- /* return rb_eval_string_protect(name, &state); */
-
-#if 0 /* doesn't work!! (fail to autoload?) */
- /* duplicate */
- head = name = strdup(name);
-
- /* has '::' at head ? */
- if (*head == ':') head += 2;
- tail = head;
-
- /* search */
- while(*tail) {
- if (*tail == ':') {
- *tail = '\0';
- klass = rb_const_get(klass, rb_intern(head));
- tail += 2;
- head = tail;
- } else {
- tail++;
- }
- }
-
- free(name);
- return rb_const_get(klass, rb_intern(head));
-#endif
+ return rb_path2class(name);
}
static VALUE
@@ -3540,18 +3514,12 @@ ip_ruby_cmd_receiver_get(str)
char *str;
{
volatile VALUE receiver;
-#if !SUPPORT_NESTED_CONST_AS_IP_RUBY_CMD_RECEIVER
int state;
-#endif
if (str[0] == ':' || ('A' <= str[0] && str[0] <= 'Z')) {
/* class | module | constant */
-#if SUPPORT_NESTED_CONST_AS_IP_RUBY_CMD_RECEIVER
- receiver = ip_ruby_cmd_receiver_const_get(str);
-#else
receiver = rb_protect(ip_ruby_cmd_receiver_const_get, (VALUE)str, &state);
if (state) return Qnil;
-#endif
} else if (str[0] == '$') {
/* global variable */
receiver = rb_gv_get(str);
@@ -3784,7 +3752,7 @@ ip_RubyExitCommand(clientData, interp, argc, argv)
#endif
if (argc < 1 || argc > 2) {
- /* arguemnt error */
+ /* argument error */
Tcl_AppendResult(interp,
"wrong number of arguments: should be \"",
cmd, " ?returnCode?\"", (char *)NULL);
@@ -3795,7 +3763,7 @@ ip_RubyExitCommand(clientData, interp, argc, argv)
Tcl_ResetResult(interp);
- if (rb_safe_level() >= 4 || Tcl_IsSafe(interp)) {
+ if (Tcl_IsSafe(interp)) {
if (!Tcl_InterpDeleted(interp)) {
ip_finalize(interp);
@@ -5088,8 +5056,8 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
if (rb_thread_alone() || eventloop_thread == current_thread) {
#if TCL_MAJOR_VERSION >= 8
DUMP1("call ip_rbTkWaitObjCmd");
- DUMP2("eventloop_thread %lx", eventloop_thread);
- DUMP2("current_thread %lx", current_thread);
+ DUMP2("eventloop_thread %"PRIxVALUE, eventloop_thread);
+ DUMP2("current_thread %"PRIxVALUE, current_thread);
return ip_rbTkWaitObjCmd(clientData, interp, objc, objv);
#else /* TCL_MAJOR_VERSION < 8 */
DUMP1("call rb_VwaitCommand");
@@ -5801,12 +5769,13 @@ ip_finalize(ip)
/* destroy interpreter */
static void
-ip_free(ptr)
- struct tcltkip *ptr;
+ip_free(p)
+ void *p;
{
+ struct tcltkip *ptr = p;
int thr_crit_bup;
- DUMP2("free Tcl Interp %lx", (unsigned long)ptr->ip);
+ DUMP2("free Tcl Interp %p", ptr->ip);
if (ptr) {
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
@@ -5815,10 +5784,10 @@ ip_free(ptr)
&& !Tcl_InterpDeleted(ptr->ip)
&& Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL
&& !Tcl_InterpDeleted(Tcl_GetMaster(ptr->ip)) ) {
- DUMP2("parent IP(%lx) is not deleted",
- (unsigned long)Tcl_GetMaster(ptr->ip));
- DUMP2("slave IP(%lx) should not be deleted",
- (unsigned long)ptr->ip);
+ DUMP2("parent IP(%p) is not deleted",
+ Tcl_GetMaster(ptr->ip));
+ DUMP2("slave IP(%p) should not be deleted",
+ ptr->ip);
xfree(ptr);
/* ckfree((char*)ptr); */
rb_thread_critical = thr_crit_bup;
@@ -5857,7 +5826,7 @@ static VALUE
ip_alloc(self)
VALUE self;
{
- return Data_Wrap_Struct(self, 0, ip_free, 0);
+ return TypedData_Wrap_Struct(self, &tcltkip_type, 0);
}
static void
@@ -5999,6 +5968,9 @@ ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv)
return TCL_OK;
}
+#ifndef ORIG_NAMESPACE_CMD
+#define ORIG_NAMESPACE_CMD "__orig_namespace_command__"
+#endif
#if TCL_MAJOR_VERSION >= 8
static int ip_rbNamespaceObjCmd _((ClientData, Tcl_Interp *, int,
@@ -6013,7 +5985,12 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
Tcl_CmdInfo info;
int ret;
- if (!Tcl_GetCommandInfo(interp, "__orig_namespace_command__", &(info))) {
+ DUMP1("call ip_rbNamespaceObjCmd");
+ DUMP2("objc = %d", objc);
+ DUMP2("objv[0] = '%s'", Tcl_GetString(objv[0]));
+ DUMP2("objv[1] = '%s'", Tcl_GetString(objv[1]));
+ if (!Tcl_GetCommandInfo(interp, ORIG_NAMESPACE_CMD, &(info))) {
+ DUMP1("fail to get "ORIG_NAMESPACE_CMD);
Tcl_ResetResult(interp);
Tcl_AppendResult(interp,
"invalid command name \"namespace\"", (char*)NULL);
@@ -6021,15 +5998,38 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
}
rbtk_eventloop_depth++;
- /* DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth); */
+ DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth);
if (info.isNativeObjectProc) {
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
+ DUMP1("call a native-object-proc");
ret = (*(info.objProc))(info.objClientData, interp, objc, objv);
+#else
+ /* Tcl8.6 or later */
+ int i;
+ Tcl_Obj **cp_objv;
+ char org_ns_cmd_name[] = ORIG_NAMESPACE_CMD;
+
+ DUMP1("call a native-object-proc for tcl8.6 or later");
+ cp_objv = RbTk_ALLOC_N(Tcl_Obj *, (objc + 1));
+
+ cp_objv[0] = Tcl_NewStringObj(org_ns_cmd_name, strlen(org_ns_cmd_name));
+ for(i = 1; i < objc; i++) {
+ cp_objv[i] = objv[i];
+ }
+ cp_objv[objc] = (Tcl_Obj *)NULL;
+
+ /* ret = Tcl_EvalObjv(interp, objc, cp_objv, TCL_EVAL_DIRECT); */
+ ret = Tcl_EvalObjv(interp, objc, cp_objv, 0);
+
+ ckfree((char*)cp_objv);
+#endif
} else {
/* string interface */
int i;
char **argv;
+ DUMP1("call with the string-interface");
/* argv = (char **)Tcl_Alloc(sizeof(char *) * (objc + 1)); */
argv = RbTk_ALLOC_N(char *, (objc + 1));
#if 0 /* use Tcl_Preserve/Release */
@@ -6057,9 +6057,10 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
#endif
}
- /* DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth); */
+ DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth);
rbtk_eventloop_depth--;
+ DUMP1("end of ip_rbNamespaceObjCmd");
return ret;
}
#endif
@@ -6069,6 +6070,8 @@ ip_wrap_namespace_command(interp)
Tcl_Interp *interp;
{
#if TCL_MAJOR_VERSION >= 8
+
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
Tcl_CmdInfo orig_info;
if (!Tcl_GetCommandInfo(interp, "namespace", &(orig_info))) {
@@ -6076,15 +6079,20 @@ ip_wrap_namespace_command(interp)
}
if (orig_info.isNativeObjectProc) {
- Tcl_CreateObjCommand(interp, "__orig_namespace_command__",
+ Tcl_CreateObjCommand(interp, ORIG_NAMESPACE_CMD,
orig_info.objProc, orig_info.objClientData,
orig_info.deleteProc);
} else {
- Tcl_CreateCommand(interp, "__orig_namespace_command__",
+ Tcl_CreateCommand(interp, ORIG_NAMESPACE_CMD,
orig_info.proc, orig_info.clientData,
orig_info.deleteProc);
}
+#else /* tcl8.6 or later */
+ Tcl_Eval(interp, "rename namespace "ORIG_NAMESPACE_CMD);
+
+#endif
+
Tcl_CreateObjCommand(interp, "namespace", ip_rbNamespaceObjCmd,
(ClientData) 0, (Tcl_CmdDeleteProc *)NULL);
#endif
@@ -6130,15 +6138,11 @@ ip_init(argc, argv, self)
int with_tk = 1;
Tk_Window mainWin = (Tk_Window)NULL;
- /* security check */
- if (rb_safe_level() >= 4) {
- rb_raise(rb_eSecurityError,
- "Cannot create a TclTkIp object at level %d",
- rb_safe_level());
- }
-
/* create object */
- Data_Get_Struct(self, struct tcltkip, ptr);
+ TypedData_Get_Struct(self, struct tcltkip, &tcltkip_type, ptr);
+ if (DATA_PTR(self)) {
+ rb_raise(rb_eArgError, "already initialized interpreter");
+ }
ptr = ALLOC(struct tcltkip);
/* ptr = RbTk_ALLOC_N(struct tcltkip, 1); */
DATA_PTR(self) = ptr;
@@ -6246,7 +6250,7 @@ ip_init(argc, argv, self)
/* FIX ME (2010/06/28) */
/* Don't use ::chan command for Mk4tcl + tclvfs-1.4 on Tcl8.5. */
/* It fails to access VFS files because of vfs::zstream. */
- /* So, force to use ::rechan by temporaly hiding ::chan. */
+ /* So, force to use ::rechan by temporarily hiding ::chan. */
/*************************************************************************/
Tcl_Eval(ptr->ip, "catch {rename ::chan ::_tmp_chan}");
if (Tcl_Init(ptr->ip) == TCL_ERROR) {
@@ -6376,10 +6380,11 @@ ip_create_slave_core(interp, argc, argv)
VALUE *argv;
{
struct tcltkip *master = get_ip(interp);
- struct tcltkip *slave = ALLOC(struct tcltkip);
+ struct tcltkip *slave;
/* struct tcltkip *slave = RbTk_ALLOC_N(struct tcltkip, 1); */
VALUE safemode;
VALUE name;
+ VALUE new_ip;
int safe;
int thr_crit_bup;
Tk_Window mainWin;
@@ -6418,6 +6423,8 @@ ip_create_slave_core(interp, argc, argv)
}
#endif
+ new_ip = TypedData_Make_Struct(CLASS_OF(interp), struct tcltkip,
+ &tcltkip_type, slave);
/* create slave-ip */
#ifdef RUBY_USE_NATIVE_THREAD
/* slave->tk_thread_id = 0; */
@@ -6477,7 +6484,7 @@ ip_create_slave_core(interp, argc, argv)
rb_thread_critical = thr_crit_bup;
- return Data_Wrap_Struct(CLASS_OF(interp), 0, ip_free, slave);
+ return new_ip;
}
static VALUE
@@ -6628,7 +6635,7 @@ ip_make_safe_core(interp, argc, argv)
if (Tcl_MakeSafe(ptr->ip) == TCL_ERROR) {
/* return rb_exc_new2(rb_eRuntimeError,
Tcl_GetStringResult(ptr->ip)); */
- return create_ip_exc(interp, rb_eRuntimeError,
+ return create_ip_exc(interp, rb_eRuntimeError, "%s",
Tcl_GetStringResult(ptr->ip));
}
@@ -6982,8 +6989,8 @@ call_queue_handler(evPtr, flags)
struct tcltkip *ptr;
DUMP2("do_call_queue_handler : evPtr = %p", evPtr);
- DUMP2("call_queue_handler thread : %lx", rb_thread_current());
- DUMP2("added by thread : %lx", thread);
+ DUMP2("call_queue_handler thread : %"PRIxVALUE, rb_thread_current());
+ DUMP2("added by thread : %"PRIxVALUE, thread);
if (*(q->done)) {
DUMP1("processed by another event-loop");
@@ -7014,19 +7021,19 @@ call_queue_handler(evPtr, flags)
/* check safe-level */
if (rb_safe_level() != q->safe_level) {
/* q_dat = Data_Wrap_Struct(rb_cData,0,-1,q); */
- q_dat = Data_Wrap_Struct(rb_cData,call_queue_mark,-1,q);
+ q_dat = Data_Wrap_Struct(0,call_queue_mark,-1,q);
ret = rb_funcall(rb_proc_new(callq_safelevel_handler, q_dat),
ID_call, 0);
rb_gc_force_recycle(q_dat);
q_dat = (VALUE)NULL;
} else {
- DUMP2("call function (for caller thread:%lx)", thread);
- DUMP2("call function (current thread:%lx)", rb_thread_current());
+ DUMP2("call function (for caller thread:%"PRIxVALUE")", thread);
+ DUMP2("call function (current thread:%"PRIxVALUE")", rb_thread_current());
ret = (q->func)(q->interp, q->argc, q->argv);
}
/* set result */
- RARRAY_PTR(q->result)[0] = ret;
+ RARRAY_ASET(q->result, 0, ret);
ret = (VALUE)NULL;
/* decr internal handler mark */
@@ -7043,8 +7050,8 @@ call_queue_handler(evPtr, flags)
/* back to caller */
if (RTEST(rb_thread_alive_p(thread))) {
- DUMP2("back to caller (caller thread:%lx)", thread);
- DUMP2(" (current thread:%lx)", rb_thread_current());
+ DUMP2("back to caller (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
have_rb_thread_waiting_for_value = 1;
rb_thread_wakeup(thread);
@@ -7056,8 +7063,8 @@ call_queue_handler(evPtr, flags)
rb_thread_schedule();
#endif
} else {
- DUMP2("caller is dead (caller thread:%lx)", thread);
- DUMP2(" (current thread:%lx)", rb_thread_current());
+ DUMP2("caller is dead (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
}
/* end of handler : remove it */
@@ -7107,9 +7114,9 @@ tk_funcall(func, argc, argv, obj)
&& (NIL_P(eventloop_thread) || current == eventloop_thread)
) {
if (NIL_P(eventloop_thread)) {
- DUMP2("tk_funcall from thread:%lx but no eventloop", current);
+ DUMP2("tk_funcall from thread:%"PRIxVALUE" but no eventloop", current);
} else {
- DUMP2("tk_funcall from current eventloop %lx", current);
+ DUMP2("tk_funcall from current eventloop %"PRIxVALUE, current);
}
result = (func)(ip_obj, argc, argv);
if (rb_obj_is_kind_of(result, rb_eException)) {
@@ -7118,7 +7125,7 @@ tk_funcall(func, argc, argv, obj)
return result;
}
- DUMP2("tk_funcall from thread %lx (NOT current eventloop)", current);
+ DUMP2("tk_funcall from thread %"PRIxVALUE" (NOT current eventloop)", current);
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
@@ -7193,23 +7200,23 @@ tk_funcall(func, argc, argv, obj)
t.tv_sec = 0;
t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
- DUMP2("callq wait for handler (current thread:%lx)", current);
+ DUMP2("callq wait for handler (current thread:%"PRIxVALUE")", current);
while(*alloc_done >= 0) {
- DUMP2("*** callq wait for handler (current thread:%lx)", current);
+ DUMP2("*** callq wait for handler (current thread:%"PRIxVALUE")", current);
/* rb_thread_stop(); */
/* rb_thread_sleep_forever(); */
rb_thread_wait_for(t);
- DUMP2("*** callq wakeup (current thread:%lx)", current);
- DUMP2("*** (eventloop thread:%lx)", eventloop_thread);
+ DUMP2("*** callq wakeup (current thread:%"PRIxVALUE")", current);
+ DUMP2("*** (eventloop thread:%"PRIxVALUE")", eventloop_thread);
if (NIL_P(eventloop_thread)) {
DUMP1("*** callq lost eventloop thread");
break;
}
}
- DUMP2("back from handler (current thread:%lx)", current);
+ DUMP2("back from handler (current thread:%"PRIxVALUE")", current);
/* get result & free allocated memory */
- ret = RARRAY_PTR(result)[0];
+ ret = RARRAY_AREF(result, 0);
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
#else
@@ -7250,7 +7257,7 @@ tk_funcall(func, argc, argv, obj)
DUMP1("raise exception");
/* rb_exc_raise(ret); */
rb_exc_raise(rb_exc_new3(rb_obj_class(ret),
- rb_funcall(ret, ID_to_s, 0, 0)));
+ rb_funcallv(ret, ID_to_s, 0, 0)));
}
DUMP1("exit tk_funcall");
@@ -7469,8 +7476,8 @@ eval_queue_handler(evPtr, flags)
struct tcltkip *ptr;
DUMP2("do_eval_queue_handler : evPtr = %p", evPtr);
- DUMP2("eval_queue_thread : %lx", rb_thread_current());
- DUMP2("added by thread : %lx", thread);
+ DUMP2("eval_queue_thread : %"PRIxVALUE, rb_thread_current());
+ DUMP2("added by thread : %"PRIxVALUE, thread);
if (*(q->done)) {
DUMP1("processed by another event-loop");
@@ -7508,7 +7515,7 @@ eval_queue_handler(evPtr, flags)
#endif
#endif
/* q_dat = Data_Wrap_Struct(rb_cData,0,-1,q); */
- q_dat = Data_Wrap_Struct(rb_cData,eval_queue_mark,-1,q);
+ q_dat = Data_Wrap_Struct(0,eval_queue_mark,-1,q);
ret = rb_funcall(rb_proc_new(evq_safelevel_handler, q_dat),
ID_call, 0);
rb_gc_force_recycle(q_dat);
@@ -7518,7 +7525,7 @@ eval_queue_handler(evPtr, flags)
}
/* set result */
- RARRAY_PTR(q->result)[0] = ret;
+ RARRAY_ASET(q->result, 0, ret);
ret = (VALUE)NULL;
/* decr internal handler mark */
@@ -7534,8 +7541,8 @@ eval_queue_handler(evPtr, flags)
/* back to caller */
if (RTEST(rb_thread_alive_p(thread))) {
- DUMP2("back to caller (caller thread:%lx)", thread);
- DUMP2(" (current thread:%lx)", rb_thread_current());
+ DUMP2("back to caller (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
have_rb_thread_waiting_for_value = 1;
rb_thread_wakeup(thread);
@@ -7547,8 +7554,8 @@ eval_queue_handler(evPtr, flags)
rb_thread_schedule();
#endif
} else {
- DUMP2("caller is dead (caller thread:%lx)", thread);
- DUMP2(" (current thread:%lx)", rb_thread_current());
+ DUMP2("caller is dead (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
}
/* end of handler : remove it */
@@ -7586,7 +7593,7 @@ ip_eval(self, str)
#else
DUMP2("status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread());
#endif
- DUMP2("status: eventloopt_thread %lx", eventloop_thread);
+ DUMP2("status: eventloopt_thread %"PRIxVALUE, eventloop_thread);
if (
#ifdef RUBY_USE_NATIVE_THREAD
@@ -7596,9 +7603,9 @@ ip_eval(self, str)
(NIL_P(eventloop_thread) || current == eventloop_thread)
) {
if (NIL_P(eventloop_thread)) {
- DUMP2("eval from thread:%lx but no eventloop", current);
+ DUMP2("eval from thread:%"PRIxVALUE" but no eventloop", current);
} else {
- DUMP2("eval from current eventloop %lx", current);
+ DUMP2("eval from current eventloop %"PRIxVALUE, current);
}
result = ip_eval_real(self, RSTRING_PTR(str), RSTRING_LENINT(str));
if (rb_obj_is_kind_of(result, rb_eException)) {
@@ -7607,7 +7614,7 @@ ip_eval(self, str)
return result;
}
- DUMP2("eval from thread %lx (NOT current eventloop)", current);
+ DUMP2("eval from thread %"PRIxVALUE" (NOT current eventloop)", current);
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
@@ -7677,23 +7684,23 @@ ip_eval(self, str)
t.tv_sec = 0;
t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
- DUMP2("evq wait for handler (current thread:%lx)", current);
+ DUMP2("evq wait for handler (current thread:%"PRIxVALUE")", current);
while(*alloc_done >= 0) {
- DUMP2("*** evq wait for handler (current thread:%lx)", current);
+ DUMP2("*** evq wait for handler (current thread:%"PRIxVALUE")", current);
/* rb_thread_stop(); */
/* rb_thread_sleep_forever(); */
rb_thread_wait_for(t);
- DUMP2("*** evq wakeup (current thread:%lx)", current);
- DUMP2("*** (eventloop thread:%lx)", eventloop_thread);
+ DUMP2("*** evq wakeup (current thread:%"PRIxVALUE")", current);
+ DUMP2("*** (eventloop thread:%"PRIxVALUE")", eventloop_thread);
if (NIL_P(eventloop_thread)) {
DUMP1("*** evq lost eventloop thread");
break;
}
}
- DUMP2("back from handler (current thread:%lx)", current);
+ DUMP2("back from handler (current thread:%"PRIxVALUE")", current);
/* get result & free allocated memory */
- ret = RARRAY_PTR(result)[0];
+ ret = RARRAY_AREF(result, 0);
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
@@ -7727,7 +7734,7 @@ ip_eval(self, str)
DUMP1("raise exception");
/* rb_exc_raise(ret); */
rb_exc_raise(rb_exc_new3(rb_obj_class(ret),
- rb_funcall(ret, ID_to_s, 0, 0)));
+ rb_funcallv(ret, ID_to_s, 0, 0)));
}
return ret;
@@ -7751,7 +7758,8 @@ ip_cancel_eval_core(interp, msg, flag)
if (NIL_P(msg)) {
msg_obj = NULL;
} else {
- msg_obj = Tcl_NewStringObj(RSTRING_PTR(msg), RSTRING_LEN(msg));
+ char *s = StringValuePtr(msg);
+ msg_obj = Tcl_NewStringObj(s, RSTRING_LENINT(msg));
Tcl_IncrRefCount(msg_obj);
}
@@ -7950,11 +7958,11 @@ lib_toUTF8_core(ip_obj, src, encodename)
rb_thread_critical = Qtrue;
if (NIL_P(encodename)) {
- if (TYPE(str) == T_STRING) {
+ if (RB_TYPE_P(str, T_STRING)) {
volatile VALUE enc;
#ifdef HAVE_RUBY_ENCODING_H
- enc = rb_funcall(rb_obj_encoding(str), ID_to_s, 0, 0);
+ enc = rb_funcallv(rb_obj_encoding(str), ID_to_s, 0, 0);
#else
enc = rb_attr_get(str, ID_at_enc);
#endif
@@ -7967,7 +7975,7 @@ lib_toUTF8_core(ip_obj, src, encodename)
encoding = (Tcl_Encoding)NULL;
} else {
/* StringValue(enc); */
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
if (!RSTRING_LEN(enc)) {
encoding = (Tcl_Encoding)NULL;
@@ -8128,7 +8136,7 @@ lib_fromUTF8_core(ip_obj, src, encodename)
if (NIL_P(encodename)) {
volatile VALUE enc;
- if (TYPE(str) == T_STRING) {
+ if (RB_TYPE_P(str, T_STRING)) {
enc = rb_attr_get(str, ID_at_enc);
if (!NIL_P(enc)) {
StringValue(enc);
@@ -8158,7 +8166,7 @@ lib_fromUTF8_core(ip_obj, src, encodename)
encoding = (Tcl_Encoding)NULL;
} else {
/* StringValue(enc); */
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
if (!RSTRING_LEN(enc)) {
encoding = (Tcl_Encoding)NULL;
@@ -8413,7 +8421,7 @@ lib_set_system_encoding(self, enc_name)
return lib_get_system_encoding(self);
}
- enc_name = rb_funcall(enc_name, ID_to_s, 0, 0);
+ enc_name = rb_funcallv(enc_name, ID_to_s, 0, 0);
if (Tcl_SetSystemEncoding((Tcl_Interp *)NULL,
StringValuePtr(enc_name)) != TCL_OK) {
rb_raise(rb_eArgError, "unknown encoding name '%s'",
@@ -8449,15 +8457,28 @@ invoke_tcl_proc(arg)
#endif
{
struct invoke_info *inf = (struct invoke_info *)arg;
+#if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION < 6
int i, len;
-#if TCL_MAJOR_VERSION >= 8
int argc = inf->objc;
char **argv = (char **)NULL;
#endif
+ DUMP1("call invoke_tcl_proc");
+
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 6)
+ /* Tcl/Tk 8.6 or later */
+
+ /* eval */
+ inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, TCL_EVAL_DIRECT);
+ /* inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, 0); */
+
+#else /* Tcl/Tk 7.x, 8.0 -- 8.5 */
+
/* memory allocation for arguments of this command */
-#if TCL_MAJOR_VERSION >= 8
+#if TCL_MAJOR_VERSION == 8
+ /* Tcl/Tk 8.0 -- 8.5 */
if (!inf->cmdinfo.isNativeObjectProc) {
+ DUMP1("called proc is not a native-obj-proc");
/* string interface */
/* argv = (char **)ALLOC_N(char *, argc+1);*/ /* XXXXXXXXXX */
argv = RbTk_ALLOC_N(char *, (argc+1));
@@ -8471,11 +8492,14 @@ invoke_tcl_proc(arg)
}
#endif
+ DUMP1("reset result of tcl-interp");
Tcl_ResetResult(inf->ptr->ip);
/* Invoke the C procedure */
-#if TCL_MAJOR_VERSION >= 8
+#if TCL_MAJOR_VERSION == 8
+ /* Tcl/Tk 8.0 -- 8.5 */
if (inf->cmdinfo.isNativeObjectProc) {
+ DUMP1("call tcl_proc as a native-obj-proc");
inf->ptr->return_value
= (*(inf->cmdinfo.objProc))(inf->cmdinfo.objClientData,
inf->ptr->ip, inf->objc, inf->objv);
@@ -8483,7 +8507,9 @@ invoke_tcl_proc(arg)
else
#endif
{
-#if TCL_MAJOR_VERSION >= 8
+#if TCL_MAJOR_VERSION == 8
+ /* Tcl/Tk 8.0 -- 8.5 */
+ DUMP1("call tcl_proc as not a native-obj-proc");
inf->ptr->return_value
= (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip,
argc, (CONST84 char **)argv);
@@ -8506,6 +8532,9 @@ invoke_tcl_proc(arg)
#endif
}
+#endif /* Tcl/Tk 8.6 or later || Tcl 7.x, 8.0 -- 8.5 */
+
+ DUMP1("end of invoke_tcl_proc");
return Qnil;
}
@@ -8542,9 +8571,6 @@ ip_invoke_core(interp, argc, argv)
#endif
#endif
- /* get the data struct */
- ptr = get_ip(interp);
-
/* get the command name string */
#if TCL_MAJOR_VERSION >= 8
cmd = Tcl_GetStringFromObj(objv[0], &len);
@@ -8645,7 +8671,9 @@ ip_invoke_core(interp, argc, argv)
#endif
/* invoke tcl-proc */
+ DUMP1("invoke tcl-proc");
rb_protect(invoke_tcl_proc, (VALUE)&inf, &status);
+ DUMP2("status of tcl-proc, %d", status);
switch(status) {
case TAG_RAISE:
if (NIL_P(rb_errinfo())) {
@@ -8905,7 +8933,7 @@ ip_invoke_real(argc, argv, interp)
char **av = (char **)NULL;
#endif
- DUMP2("invoke_real called by thread:%lx", rb_thread_current());
+ DUMP2("invoke_real called by thread:%"PRIxVALUE, rb_thread_current());
/* get the data struct */
ptr = get_ip(interp);
@@ -8954,8 +8982,8 @@ invoke_queue_handler(evPtr, flags)
struct tcltkip *ptr;
DUMP2("do_invoke_queue_handler : evPtr = %p", evPtr);
- DUMP2("invoke queue_thread : %lx", rb_thread_current());
- DUMP2("added by thread : %lx", thread);
+ DUMP2("invoke queue_thread : %"PRIxVALUE, rb_thread_current());
+ DUMP2("added by thread : %"PRIxVALUE, thread);
if (*(q->done)) {
DUMP1("processed by another event-loop");
@@ -8986,19 +9014,19 @@ invoke_queue_handler(evPtr, flags)
/* check safe-level */
if (rb_safe_level() != q->safe_level) {
/* q_dat = Data_Wrap_Struct(rb_cData,0,0,q); */
- q_dat = Data_Wrap_Struct(rb_cData,invoke_queue_mark,-1,q);
+ q_dat = Data_Wrap_Struct(0,invoke_queue_mark,-1,q);
ret = rb_funcall(rb_proc_new(ivq_safelevel_handler, q_dat),
ID_call, 0);
rb_gc_force_recycle(q_dat);
q_dat = (VALUE)NULL;
} else {
- DUMP2("call invoke_real (for caller thread:%lx)", thread);
- DUMP2("call invoke_real (current thread:%lx)", rb_thread_current());
+ DUMP2("call invoke_real (for caller thread:%"PRIxVALUE")", thread);
+ DUMP2("call invoke_real (current thread:%"PRIxVALUE")", rb_thread_current());
ret = ip_invoke_core(q->interp, q->argc, q->argv);
}
/* set result */
- RARRAY_PTR(q->result)[0] = ret;
+ RARRAY_ASET(q->result, 0, ret);
ret = (VALUE)NULL;
/* decr internal handler mark */
@@ -9014,8 +9042,8 @@ invoke_queue_handler(evPtr, flags)
/* back to caller */
if (RTEST(rb_thread_alive_p(thread))) {
- DUMP2("back to caller (caller thread:%lx)", thread);
- DUMP2(" (current thread:%lx)", rb_thread_current());
+ DUMP2("back to caller (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
have_rb_thread_waiting_for_value = 1;
rb_thread_wakeup(thread);
@@ -9027,8 +9055,8 @@ invoke_queue_handler(evPtr, flags)
rb_thread_schedule();
#endif
} else {
- DUMP2("caller is dead (caller thread:%lx)", thread);
- DUMP2(" (current thread:%lx)", rb_thread_current());
+ DUMP2("caller is dead (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
}
/* end of handler : remove it */
@@ -9071,7 +9099,7 @@ ip_invoke_with_position(argc, argv, obj, position)
#else
DUMP2("status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread());
#endif
- DUMP2("status: eventloopt_thread %lx", eventloop_thread);
+ DUMP2("status: eventloopt_thread %"PRIxVALUE, eventloop_thread);
if (
#ifdef RUBY_USE_NATIVE_THREAD
@@ -9081,9 +9109,9 @@ ip_invoke_with_position(argc, argv, obj, position)
(NIL_P(eventloop_thread) || current == eventloop_thread)
) {
if (NIL_P(eventloop_thread)) {
- DUMP2("invoke from thread:%lx but no eventloop", current);
+ DUMP2("invoke from thread:%"PRIxVALUE" but no eventloop", current);
} else {
- DUMP2("invoke from current eventloop %lx", current);
+ DUMP2("invoke from current eventloop %"PRIxVALUE, current);
}
result = ip_invoke_real(argc, argv, ip_obj);
if (rb_obj_is_kind_of(result, rb_eException)) {
@@ -9092,7 +9120,7 @@ ip_invoke_with_position(argc, argv, obj, position)
return result;
}
- DUMP2("invoke from thread %lx (NOT current eventloop)", current);
+ DUMP2("invoke from thread %"PRIxVALUE" (NOT current eventloop)", current);
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
@@ -9156,22 +9184,22 @@ ip_invoke_with_position(argc, argv, obj, position)
t.tv_sec = 0;
t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
- DUMP2("ivq wait for handler (current thread:%lx)", current);
+ DUMP2("ivq wait for handler (current thread:%"PRIxVALUE")", current);
while(*alloc_done >= 0) {
/* rb_thread_stop(); */
/* rb_thread_sleep_forever(); */
rb_thread_wait_for(t);
- DUMP2("*** ivq wakeup (current thread:%lx)", current);
- DUMP2("*** (eventloop thread:%lx)", eventloop_thread);
+ DUMP2("*** ivq wakeup (current thread:%"PRIxVALUE")", current);
+ DUMP2("*** (eventloop thread:%"PRIxVALUE")", eventloop_thread);
if (NIL_P(eventloop_thread)) {
DUMP1("*** ivq lost eventloop thread");
break;
}
}
- DUMP2("back from handler (current thread:%lx)", current);
+ DUMP2("back from handler (current thread:%"PRIxVALUE")", current);
/* get result & free allocated memory */
- ret = RARRAY_PTR(result)[0];
+ ret = RARRAY_AREF(result, 0);
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
#else
@@ -9203,7 +9231,7 @@ ip_invoke_with_position(argc, argv, obj, position)
DUMP1("raise exception");
/* rb_exc_raise(ret); */
rb_exc_raise(rb_exc_new3(rb_obj_class(ret),
- rb_funcall(ret, ID_to_s, 0, 0)));
+ rb_funcallv(ret, ID_to_s, 0, 0)));
}
DUMP1("exit ip_invoke");
@@ -9293,7 +9321,7 @@ ip_get_variable2_core(interp, argc, argv)
volatile VALUE exc;
/* exc = rb_exc_new2(rb_eRuntimeError,
Tcl_GetStringResult(ptr->ip)); */
- exc = create_ip_exc(interp, rb_eRuntimeError,
+ exc = create_ip_exc(interp, rb_eRuntimeError, "%s",
Tcl_GetStringResult(ptr->ip));
/* Tcl_Release(ptr->ip); */
rbtk_release_ip(ptr);
@@ -9432,7 +9460,7 @@ ip_set_variable2_core(interp, argc, argv)
volatile VALUE exc;
/* exc = rb_exc_new2(rb_eRuntimeError,
Tcl_GetStringResult(ptr->ip)); */
- exc = create_ip_exc(interp, rb_eRuntimeError,
+ exc = create_ip_exc(interp, rb_eRuntimeError, "%s",
Tcl_GetStringResult(ptr->ip));
/* Tcl_Release(ptr->ip); */
rbtk_release_ip(ptr);
@@ -9552,7 +9580,7 @@ ip_unset_variable2_core(interp, argc, argv)
if (FIX2INT(flag) & TCL_LEAVE_ERR_MSG) {
/* return rb_exc_new2(rb_eRuntimeError,
Tcl_GetStringResult(ptr->ip)); */
- return create_ip_exc(interp, rb_eRuntimeError,
+ return create_ip_exc(interp, rb_eRuntimeError, "%s",
Tcl_GetStringResult(ptr->ip));
}
return Qfalse;
@@ -9976,7 +10004,7 @@ lib_get_reltype_name(self)
static VALUE
-tcltklib_compile_info()
+tcltklib_compile_info(void)
{
volatile VALUE ret;
size_t size;
@@ -10172,7 +10200,7 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
/* 1st: default encoding setting of interp */
if (ptr && NIL_P(enc)) {
if (rb_respond_to(interp, ID_encoding_name)) {
- enc = rb_funcall(interp, ID_encoding_name, 0, 0);
+ enc = rb_funcallv(interp, ID_encoding_name, 0, 0);
}
}
/* 2nd: Encoding.default_internal */
@@ -10215,7 +10243,7 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
} else {
/* String or Symbol? */
- name = rb_funcall(enc, ID_to_s, 0, 0);
+ name = rb_funcallv(enc, ID_to_s, 0, 0);
if (!NIL_P(rb_hash_lookup(table, name))) {
/* find */
@@ -10249,7 +10277,7 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
}
if (RTEST(error_mode)) {
- enc = rb_funcall(enc_arg, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc_arg, ID_to_s, 0, 0);
rb_raise(rb_eArgError, "unsupported Tk encoding '%s'", RSTRING_PTR(enc));
}
return Qnil;
@@ -10327,7 +10355,7 @@ encoding_table_get_name_core(table, enc, error_mode)
{
volatile VALUE name = Qnil;
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
name = rb_hash_lookup(table, enc);
if (!NIL_P(name)) {
@@ -10715,7 +10743,7 @@ ip_make_menu_embeddable(interp, menu_path)
/*---- initialization ----*/
void
-Init_tcltklib()
+Init_tcltklib(void)
{
int ret;
@@ -11014,7 +11042,7 @@ Init_tcltklib()
/* --------------------------------------------------------------- */
#ifdef HAVE_NATIVETHREAD
- /* if ruby->nativethread-supprt and tcltklib->doen't,
+ /* if ruby->nativethread-support and tcltklib->doesn't,
the following will cause link-error. */
ruby_native_thread_p();
#endif
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb
index 57de973c0a..0b3ce03595 100644
--- a/ext/tk/tkutil/extconf.rb
+++ b/ext/tk/tkutil/extconf.rb
@@ -1,17 +1,13 @@
+# frozen_string_literal: false
begin
- has_tk = compiled?('tk')
-rescue NoMethodError
- # Probably, called manually (NOT from 'extmk.rb'). Force to make Makefile.
- has_tk = true
-end
-
-if has_tk
require 'mkmf'
have_func("rb_obj_instance_exec", "ruby.h")
have_func("rb_obj_untrust", "ruby.h")
have_func("rb_obj_taint", "ruby.h")
- have_func("rb_sym_to_s", "ruby.h")
+ have_func("rb_sym2str", "ruby.h")
+ have_func("rb_id2str", "ruby.h")
+ have_func("rb_ary_cat", "ruby.h")
have_func("strndup", "string.h")
create_makefile('tkutil')
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index fd8972645a..147dfa23d1 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -23,6 +23,9 @@ static int rb_thread_critical; /* dummy */
#include "st.h"
#endif
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 1
+
#if !defined(RHASH_TBL)
#define RHASH_TBL(h) (RHASH(h)->tbl)
#endif
@@ -34,11 +37,25 @@ static int rb_thread_critical; /* dummy */
#define RARRAY_PTR(s) (RARRAY(s)->ptr)
#define RARRAY_LEN(s) (RARRAY(s)->len)
#endif
+#if !defined(RARRAY_CONST_PTR)
+#define RARRAY_CONST_PTR(s) (const VALUE *)RARRAY_PTR(s)
+#endif
+#if !defined(RARRAY_AREF)
+#define RARRAY_AREF(a, i) RARRAY_CONST_PTR(a)[i]
+#endif
#if defined(HAVE_STRNDUP) && !defined(_GNU_SOURCE)
extern char *strndup(const char* _ptr, size_t _len);
#endif
+#ifndef HAVE_RB_SYM2STR
+# define rb_sym2str(obj) rb_id2str(SYM2ID(obj))
+#endif
+
+#ifndef HAVE_RB_ID2STR
+# define rb_id2str(id) rb_str_new2(rb_id2name(id))
+#endif
+
static VALUE cMethod;
static VALUE cTclTkLib;
@@ -76,6 +93,40 @@ static unsigned long CALLBACK_ID_NUM = 0;
/*************************************/
+#ifndef HAVE_STRNDUP
+static char * strndup _((const char *, size_t));
+static char *
+strndup(ptr, len)
+ const char *ptr;
+ size_t len;
+{
+ char *newptr = malloc(len + 1);
+ if (newptr) {
+ memcpy(newptr, ptr, len);
+ newptr[len] = '\0';
+ }
+ return newptr;
+}
+#endif
+
+#ifndef HAVE_RB_ARY_CAT
+static VALUE rb_ary_cat _((VALUE, const VALUE *, long));
+static VALUE
+rb_ary_cat(ary, argv, len)
+ VALUE ary;
+ const VALUE *argv;
+ long len;
+{
+ long i;
+ for (i = 0; i < len; i++) {
+ rb_ary_push(ary, argv[i]);
+ }
+ return ary;
+}
+#endif
+
+/*************************************/
+
#if defined(HAVE_RB_OBJ_INSTANCE_EXEC) && !defined(RUBY_VM)
extern VALUE rb_obj_instance_exec _((int, VALUE*, VALUE));
#endif
@@ -169,7 +220,7 @@ tk_install_cmd_core(cmd)
volatile VALUE id_num;
id_num = ULONG2NUM(CALLBACK_ID_NUM++);
- id_num = rb_funcall(id_num, ID_to_s, 0, 0);
+ id_num = rb_funcallv(id_num, ID_to_s, 0, 0);
id_num = rb_str_append(rb_str_new2(cmd_id_prefix), id_num);
rb_hash_aset(CALLBACK_TABLE, id_num, cmd);
return rb_str_append(rb_str_new2(cmd_id_head), id_num);
@@ -266,7 +317,7 @@ to_strkey(key, value, hash)
VALUE value;
VALUE hash;
{
- rb_hash_aset(hash, rb_funcall(key, ID_to_s, 0, 0), value);
+ rb_hash_aset(hash, rb_funcallv(key, ID_to_s, 0, 0), value);
return ST_CHECK;
}
@@ -303,28 +354,28 @@ ary2list(ary, enc_flag, self)
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
- sys_enc = rb_funcall(cTclTkLib, ID_encoding, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding, 0, 0);
if (NIL_P(sys_enc)) {
- sys_enc = rb_funcall(cTclTkLib, ID_encoding_system, 0, 0);
- sys_enc = rb_funcall(sys_enc, ID_to_s, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding_system, 0, 0);
+ sys_enc = rb_funcallv(sys_enc, ID_to_s, 0, 0);
}
if (NIL_P(enc_flag)) {
dst_enc = sys_enc;
req_chk_flag = 1;
- } else if (TYPE(enc_flag) == T_TRUE || TYPE(enc_flag) == T_FALSE) {
+ } else if (enc_flag == Qtrue || enc_flag == Qfalse) {
dst_enc = enc_flag;
req_chk_flag = 0;
} else {
- dst_enc = rb_funcall(enc_flag, ID_to_s, 0, 0);
+ dst_enc = rb_funcallv(enc_flag, ID_to_s, 0, 0);
req_chk_flag = 0;
}
/* size = RARRAY_LEN(ary); */
size = 0;
for(idx = 0; idx < RARRAY_LEN(ary); idx++) {
- if (TYPE(RARRAY_PTR(ary)[idx]) == T_HASH) {
- size += 2 * RHASH_SIZE(RARRAY_PTR(ary)[idx]);
+ if (RB_TYPE_P(RARRAY_AREF(ary, idx), T_HASH)) {
+ size += 2 * RHASH_SIZE(RARRAY_AREF(ary, idx));
} else {
size++;
}
@@ -332,7 +383,7 @@ ary2list(ary, enc_flag, self)
dst = rb_ary_new2(size);
for(idx = 0; idx < RARRAY_LEN(ary); idx++) {
- val = RARRAY_PTR(ary)[idx];
+ val = RARRAY_AREF(ary, idx);
str_val = Qnil;
switch(TYPE(val)) {
case T_ARRAY:
@@ -342,7 +393,7 @@ ary2list(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -363,7 +414,7 @@ ary2list(ary, enc_flag, self)
}
size2 = RARRAY_LEN(val);
for(idx2 = 0; idx2 < size2; idx2++) {
- val2 = RARRAY_PTR(val)[idx2];
+ val2 = RARRAY_AREF(val, idx2);
switch(TYPE(val2)) {
case T_ARRAY:
str_val = ary2list(val2, enc_flag, self);
@@ -389,7 +440,7 @@ ary2list(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -409,7 +460,7 @@ ary2list(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -424,16 +475,16 @@ ary2list(ary, enc_flag, self)
if (RTEST(dst_enc) && !NIL_P(sys_enc)) {
for(idx = 0; idx < RARRAY_LEN(dst); idx++) {
- str_val = RARRAY_PTR(dst)[idx];
+ str_val = RARRAY_AREF(dst, idx);
if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) {
str_val = rb_funcall(self, ID_toUTF8, 1, str_val);
} else {
str_val = rb_funcall(cTclTkLib, ID_toUTF8, 1, str_val);
}
- RARRAY_PTR(dst)[idx] = str_val;
+ RARRAY_ASET(dst, idx, str_val);
}
val = rb_apply(cTclTkLib, ID_merge_tklist, dst);
- if (TYPE(dst_enc) == T_STRING) {
+ if (RB_TYPE_P(dst_enc, T_STRING)) {
val = rb_funcall(cTclTkLib, ID_fromUTF8, 2, val, dst_enc);
rb_ivar_set(val, ID_at_enc, dst_enc);
} else {
@@ -457,27 +508,27 @@ ary2list2(ary, enc_flag, self)
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
- sys_enc = rb_funcall(cTclTkLib, ID_encoding, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding, 0, 0);
if (NIL_P(sys_enc)) {
- sys_enc = rb_funcall(cTclTkLib, ID_encoding_system, 0, 0);
- sys_enc = rb_funcall(sys_enc, ID_to_s, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding_system, 0, 0);
+ sys_enc = rb_funcallv(sys_enc, ID_to_s, 0, 0);
}
if (NIL_P(enc_flag)) {
dst_enc = sys_enc;
req_chk_flag = 1;
- } else if (TYPE(enc_flag) == T_TRUE || TYPE(enc_flag) == T_FALSE) {
+ } else if (enc_flag == Qtrue || enc_flag == Qfalse) {
dst_enc = enc_flag;
req_chk_flag = 0;
} else {
- dst_enc = rb_funcall(enc_flag, ID_to_s, 0, 0);
+ dst_enc = rb_funcallv(enc_flag, ID_to_s, 0, 0);
req_chk_flag = 0;
}
size = RARRAY_LEN(ary);
dst = rb_ary_new2(size);
for(idx = 0; idx < RARRAY_LEN(ary); idx++) {
- val = RARRAY_PTR(ary)[idx];
+ val = RARRAY_AREF(ary, idx);
str_val = Qnil;
switch(TYPE(val)) {
case T_ARRAY:
@@ -504,7 +555,7 @@ ary2list2(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -518,16 +569,16 @@ ary2list2(ary, enc_flag, self)
if (RTEST(dst_enc) && !NIL_P(sys_enc)) {
for(idx = 0; idx < RARRAY_LEN(dst); idx++) {
- str_val = RARRAY_PTR(dst)[idx];
+ str_val = RARRAY_AREF(dst, idx);
if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) {
str_val = rb_funcall(self, ID_toUTF8, 1, str_val);
} else {
str_val = rb_funcall(cTclTkLib, ID_toUTF8, 1, str_val);
}
- RARRAY_PTR(dst)[idx] = str_val;
+ RARRAY_ASET(dst, idx, str_val);
}
val = rb_apply(cTclTkLib, ID_merge_tklist, dst);
- if (TYPE(dst_enc) == T_STRING) {
+ if (RB_TYPE_P(dst_enc, T_STRING)) {
val = rb_funcall(cTclTkLib, ID_fromUTF8, 2, val, dst_enc);
rb_ivar_set(val, ID_at_enc, dst_enc);
} else {
@@ -543,7 +594,7 @@ static VALUE
key2keyname(key)
VALUE key;
{
- return rb_str_append(rb_str_new2("-"), rb_funcall(key, ID_to_s, 0, 0));
+ return rb_str_append(rb_str_new2("-"), rb_funcallv(key, ID_to_s, 0, 0));
}
static VALUE
@@ -552,7 +603,7 @@ assoc2kv(assoc, ary, self)
VALUE ary;
VALUE self;
{
- long i, j, len;
+ long i, len;
volatile VALUE pair;
volatile VALUE val;
volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
@@ -560,28 +611,26 @@ assoc2kv(assoc, ary, self)
len = RARRAY_LEN(assoc);
for(i = 0; i < len; i++) {
- pair = RARRAY_PTR(assoc)[i];
- if (TYPE(pair) != T_ARRAY) {
+ pair = RARRAY_AREF(assoc, i);
+ if (!RB_TYPE_P(pair, T_ARRAY)) {
rb_ary_push(dst, key2keyname(pair));
continue;
}
switch(RARRAY_LEN(assoc)) {
case 2:
- rb_ary_push(dst, RARRAY_PTR(pair)[2]);
+ rb_ary_push(dst, RARRAY_AREF(pair, 2));
case 1:
- rb_ary_push(dst, key2keyname(RARRAY_PTR(pair)[0]));
+ rb_ary_push(dst, key2keyname(RARRAY_AREF(pair, 0)));
case 0:
continue;
default:
- rb_ary_push(dst, key2keyname(RARRAY_PTR(pair)[0]));
+ rb_ary_push(dst, key2keyname(RARRAY_AREF(pair, 0)));
val = rb_ary_new2(RARRAY_LEN(pair) - 1);
- for(j = 1; j < RARRAY_LEN(pair); j++) {
- rb_ary_push(val, RARRAY_PTR(pair)[j]);
- }
+ rb_ary_cat(val, RARRAY_CONST_PTR(pair) + 1, RARRAY_LEN(pair) - 1);
rb_ary_push(dst, val);
}
@@ -600,7 +649,7 @@ assoc2kv_enc(assoc, ary, self)
VALUE ary;
VALUE self;
{
- long i, j, len;
+ long i, len;
volatile VALUE pair;
volatile VALUE val;
volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
@@ -608,28 +657,26 @@ assoc2kv_enc(assoc, ary, self)
len = RARRAY_LEN(assoc);
for(i = 0; i < len; i++) {
- pair = RARRAY_PTR(assoc)[i];
- if (TYPE(pair) != T_ARRAY) {
+ pair = RARRAY_AREF(assoc, i);
+ if (!RB_TYPE_P(pair, T_ARRAY)) {
rb_ary_push(dst, key2keyname(pair));
continue;
}
switch(RARRAY_LEN(assoc)) {
case 2:
- rb_ary_push(dst, get_eval_string_core(RARRAY_PTR(pair)[2], Qtrue, self));
+ rb_ary_push(dst, get_eval_string_core(RARRAY_AREF(pair, 2), Qtrue, self));
case 1:
- rb_ary_push(dst, key2keyname(RARRAY_PTR(pair)[0]));
+ rb_ary_push(dst, key2keyname(RARRAY_AREF(pair, 0)));
case 0:
continue;
default:
- rb_ary_push(dst, key2keyname(RARRAY_PTR(pair)[0]));
+ rb_ary_push(dst, key2keyname(RARRAY_AREF(pair, 0)));
val = rb_ary_new2(RARRAY_LEN(pair) - 1);
- for(j = 1; j < RARRAY_LEN(pair); j++) {
- rb_ary_push(val, RARRAY_PTR(pair)[j]);
- }
+ rb_ary_cat(val, RARRAY_CONST_PTR(pair) + 1, RARRAY_LEN(pair) - 1);
rb_ary_push(dst, get_eval_string_core(val, Qtrue, self));
}
@@ -650,7 +697,7 @@ push_kv(key, val, args)
{
volatile VALUE ary;
- ary = RARRAY_PTR(args)[0];
+ ary = RARRAY_AREF(args, 0);
#if 0
rb_ary_push(ary, key2keyname(key));
@@ -660,7 +707,7 @@ push_kv(key, val, args)
if (val == TK_None) return ST_CHECK;
- rb_ary_push(ary, get_eval_string_core(val, Qnil, RARRAY_PTR(args)[1]));
+ rb_ary_push(ary, get_eval_string_core(val, Qnil, RARRAY_AREF(args, 1)));
return ST_CHECK;
}
@@ -691,20 +738,20 @@ push_kv_enc(key, val, args)
{
volatile VALUE ary;
- ary = RARRAY_PTR(args)[0];
+ ary = RARRAY_AREF(args, 0);
#if 0
rb_ary_push(ary, key2keyname(key));
if (val != TK_None) {
rb_ary_push(ary, get_eval_string_core(val, Qtrue,
- RARRAY_PTR(args)[1]));
+ RARRAY_AREF(args, 1)));
}
#endif
rb_ary_push(ary, key2keyname(key));
if (val == TK_None) return ST_CHECK;
- rb_ary_push(ary, get_eval_string_core(val, Qtrue, RARRAY_PTR(args)[1]));
+ rb_ary_push(ary, get_eval_string_core(val, Qtrue, RARRAY_AREF(args, 1)));
return ST_CHECK;
}
@@ -757,6 +804,7 @@ tk_hash_kv(argc, argv, self)
switch(argc) {
case 3:
ary = argv[2];
+ Check_Type(ary, T_ARRAY);
case 2:
enc_flag = argv[1];
case 1:
@@ -814,7 +862,7 @@ get_eval_string_core(obj, enc_flag, self)
case T_FLOAT:
case T_FIXNUM:
case T_BIGNUM:
- return rb_funcall(obj, ID_to_s, 0, 0);
+ return rb_funcallv(obj, ID_to_s, 0, 0);
case T_STRING:
if (RTEST(enc_flag)) {
@@ -831,16 +879,12 @@ get_eval_string_core(obj, enc_flag, self)
if (RTEST(enc_flag)) {
if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) {
return rb_funcall(self, ID_toUTF8, 1,
- rb_str_new2(rb_id2name(SYM2ID(obj))));
+ rb_str_dup(rb_sym2str(obj)));
} else {
- return fromDefaultEnc_toUTF8(rb_str_new2(rb_id2name(SYM2ID(obj))), self);
+ return fromDefaultEnc_toUTF8(rb_sym2str(obj), self);
}
} else {
-#ifdef HAVE_RB_SYM_TO_S
- return rb_sym_to_s(obj);
-#else
- return rb_str_new2(rb_id2name(SYM2ID(obj)));
-#endif
+ return rb_sym2str(obj);
}
case T_HASH:
@@ -863,12 +907,12 @@ get_eval_string_core(obj, enc_flag, self)
return rb_str_new2("");
case T_REGEXP:
- return rb_funcall(obj, ID_source, 0, 0);
+ return rb_funcallv(obj, ID_source, 0, 0);
default:
if (rb_obj_is_kind_of(obj, cTkObject)) {
- /* return rb_str_new3(rb_funcall(obj, ID_path, 0, 0)); */
- return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0),
+ /* return rb_str_new3(rb_funcallv(obj, ID_path, 0, 0)); */
+ return get_eval_string_core(rb_funcallv(obj, ID_path, 0, 0),
enc_flag, self);
}
@@ -885,15 +929,15 @@ get_eval_string_core(obj, enc_flag, self)
if (obj == TK_None) return Qnil;
if (rb_obj_respond_to(obj, ID_to_eval, Qtrue)) {
- /* return rb_funcall(obj, ID_to_eval, 0, 0); */
- return get_eval_string_core(rb_funcall(obj, ID_to_eval, 0, 0),
+ /* return rb_funcallv(obj, ID_to_eval, 0, 0); */
+ return get_eval_string_core(rb_funcallv(obj, ID_to_eval, 0, 0),
enc_flag, self);
} else if (rb_obj_respond_to(obj, ID_path, Qtrue)) {
- /* return rb_funcall(obj, ID_path, 0, 0); */
- return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0),
+ /* return rb_funcallv(obj, ID_path, 0, 0); */
+ return get_eval_string_core(rb_funcallv(obj, ID_path, 0, 0),
enc_flag, self);
} else if (rb_obj_respond_to(obj, ID_to_s, Qtrue)) {
- return rb_funcall(obj, ID_to_s, 0, 0);
+ return rb_funcallv(obj, ID_to_s, 0, 0);
}
}
@@ -950,7 +994,7 @@ tk_conv_args(argc, argv, self)
old_gc = rb_gc_disable();
for(size = 0, idx = 2; idx < argc; idx++) {
- if (TYPE(argv[idx]) == T_HASH) {
+ if (RB_TYPE_P(argv[idx], T_HASH)) {
size += 2 * RHASH_SIZE(argv[idx]);
} else {
size++;
@@ -959,7 +1003,7 @@ tk_conv_args(argc, argv, self)
/* dst = rb_ary_new2(argc - 2); */
dst = rb_ary_new2(size);
for(idx = 2; idx < argc; idx++) {
- if (TYPE(argv[idx]) == T_HASH) {
+ if (RB_TYPE_P(argv[idx], T_HASH)) {
if (RTEST(argv[1])) {
hash2kv_enc(argv[idx], dst, self);
} else {
@@ -984,7 +1028,7 @@ tcl2rb_bool(self, value)
VALUE self;
VALUE value;
{
- if (TYPE(value) == T_FIXNUM) {
+ if (RB_TYPE_P(value, T_FIXNUM)) {
if (NUM2INT(value) == 0) {
return Qfalse;
} else {
@@ -992,7 +1036,7 @@ tcl2rb_bool(self, value)
}
}
- if (TYPE(value) == T_TRUE || TYPE(value) == T_FALSE) {
+ if (value == Qtrue || value == Qfalse) {
return value;
}
@@ -1168,6 +1212,23 @@ subst_free(ptr)
}
}
+static size_t
+subst_memsize(ptr)
+ const struct cbsubst_info *ptr;
+{
+ return sizeof(*ptr);
+}
+
+static const rb_data_type_t cbsubst_info_type = {
+ "TkUtil/CallbackSubst/Info",
+ {
+ subst_mark,
+ subst_free,
+ subst_memsize,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
static VALUE
allocate_cbsubst_info(struct cbsubst_info **inf_ptr)
{
@@ -1175,7 +1236,8 @@ allocate_cbsubst_info(struct cbsubst_info **inf_ptr)
volatile VALUE proc, aliases;
int idx;
- inf = ALLOC(struct cbsubst_info);
+ VALUE info = TypedData_Make_Struct(cSUBST_INFO, struct cbsubst_info,
+ &cbsubst_info_type, inf);
inf->full_subst_length = 0;
@@ -1194,16 +1256,23 @@ allocate_cbsubst_info(struct cbsubst_info **inf_ptr)
if (inf_ptr != (struct cbsubst_info **)NULL) *inf_ptr = inf;
- return Data_Wrap_Struct(cSUBST_INFO, subst_mark, subst_free, inf);
+ return info;
}
static void
-cbsubst_init()
+cbsubst_init(void)
{
rb_const_set(cCB_SUBST, ID_SUBST_INFO,
allocate_cbsubst_info((struct cbsubst_info **)NULL));
}
+static struct cbsubst_info *
+cbsubst_get_ptr(klass)
+ VALUE klass;
+{
+ return rb_check_typeddata(rb_const_get(klass, ID_SUBST_INFO), &cbsubst_info_type);
+}
+
static VALUE
cbsubst_initialize(argc, argv, self)
int argc;
@@ -1213,10 +1282,9 @@ cbsubst_initialize(argc, argv, self)
struct cbsubst_info *inf;
int idx, iv_idx;
- Data_Get_Struct(rb_const_get(rb_obj_class(self), ID_SUBST_INFO),
- struct cbsubst_info, inf);
+ inf = cbsubst_get_ptr(rb_obj_class(self));
- idx = 0;
+ idx = 0;
for(iv_idx = 0; iv_idx < CBSUBST_TBL_MAX; iv_idx++) {
if ( inf->ivar[iv_idx] == (ID) 0 ) continue;
rb_ivar_set(self, inf->ivar[iv_idx], argv[idx++]);
@@ -1281,12 +1349,11 @@ cbsubst_def_attr_aliases(self, tbl)
{
struct cbsubst_info *inf;
- if (TYPE(tbl) != T_HASH) {
+ if (!RB_TYPE_P(tbl, T_HASH)) {
rb_raise(rb_eArgError, "expected a Hash");
}
- Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
- struct cbsubst_info, inf);
+ inf = cbsubst_get_ptr(self);
rb_hash_foreach(tbl, each_attr_def, self);
@@ -1294,27 +1361,57 @@ cbsubst_def_attr_aliases(self, tbl)
}
static VALUE
+cbsubst_append_inf_key(str, inf, idx)
+ VALUE str;
+ const struct cbsubst_info *inf;
+ int idx;
+{
+ const long len = inf->keylen[idx];
+ const long olen = RSTRING_LEN(str);
+ char *buf, *ptr;
+
+ rb_str_modify_expand(str, (len ? len : 1) + 2);
+ buf = RSTRING_PTR(str);
+ ptr = buf + olen;
+
+ *(ptr++) = '%';
+
+ if (len != 0) {
+ /* longname */
+ strncpy(ptr, inf->key[idx], len);
+ ptr += len;
+ }
+ else {
+ /* single char */
+ *(ptr++) = (unsigned char)idx;
+ }
+
+ *(ptr++) = ' ';
+
+ rb_str_set_len(str, ptr - buf);
+
+ return str;
+}
+
+static VALUE
cbsubst_sym_to_subst(self, sym)
VALUE self;
VALUE sym;
{
struct cbsubst_info *inf;
VALUE str;
- char *buf, *ptr;
int idx;
- long len;
ID id;
volatile VALUE ret;
- if (TYPE(sym) != T_SYMBOL) return sym;
+ if (!RB_TYPE_P(sym, T_SYMBOL)) return sym;
- Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
- struct cbsubst_info, inf);
+ inf = cbsubst_get_ptr(self);
if (!NIL_P(ret = rb_hash_aref(inf->aliases, sym))) {
- str = rb_id2str(SYM2ID(ret));
+ str = rb_sym2str(ret);
} else {
- str = rb_id2str(SYM2ID(sym));
+ str = rb_sym2str(sym);
}
id = rb_intern_str(rb_sprintf("@%"PRIsVALUE, str));
@@ -1324,27 +1421,7 @@ cbsubst_sym_to_subst(self, sym)
}
if (idx >= CBSUBST_TBL_MAX) return sym;
- ptr = buf = ALLOC_N(char, inf->full_subst_length + 1);
-
- *(ptr++) = '%';
-
- if (len = inf->keylen[idx]) {
- /* longname */
- strncpy(ptr, inf->key[idx], len);
- ptr += len;
- } else {
- /* single char */
- *(ptr++) = (unsigned char)idx;
- }
-
- *(ptr++) = ' ';
- *(ptr++) = '\0';
-
- ret = rb_str_new2(buf);
-
- xfree(buf);
-
- return ret;
+ return cbsubst_append_inf_key(rb_str_new(0, 0), inf, idx);
}
static VALUE
@@ -1355,65 +1432,48 @@ cbsubst_get_subst_arg(argc, argv, self)
{
struct cbsubst_info *inf;
VALUE str;
- char *buf, *ptr;
int i, idx;
- long len;
ID id;
- volatile VALUE arg_sym, ret;
+ VALUE arg_sym, ret, result;
- Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
- struct cbsubst_info, inf);
-
- ptr = buf = ALLOC_N(char, inf->full_subst_length + 1);
+ inf = cbsubst_get_ptr(self);
+ result = rb_str_new(0, 0);
for(i = 0; i < argc; i++) {
switch(TYPE(argv[i])) {
case T_STRING:
str = argv[i];
- arg_sym = ID2SYM(rb_intern_str(argv[i]));
+ arg_sym = rb_check_symbol(&str);
+ if (NIL_P(arg_sym)) goto not_found;
break;
case T_SYMBOL:
arg_sym = argv[i];
- str = rb_id2str(SYM2ID(arg_sym));
+ str = rb_sym2str(arg_sym);
break;
default:
rb_raise(rb_eArgError, "arg #%d is not a String or a Symbol", i);
}
if (!NIL_P(ret = rb_hash_aref(inf->aliases, arg_sym))) {
- str = rb_id2str(SYM2ID(ret));
+ str = rb_sym2str(ret);
}
- id = rb_intern_str(rb_sprintf("@%"PRIsVALUE, str));
+ ret = rb_sprintf("@%"PRIsVALUE, str);
+ id = rb_check_id(&ret);
+ if (!id) goto not_found;
for(idx = 0; idx < CBSUBST_TBL_MAX; idx++) {
if (inf->ivar[idx] == id) break;
}
if (idx >= CBSUBST_TBL_MAX) {
+ not_found:
rb_raise(rb_eArgError, "cannot find attribute :%"PRIsVALUE, str);
}
- *(ptr++) = '%';
-
- if (len = inf->keylen[idx]) {
- /* longname */
- strncpy(ptr, inf->key[idx], len);
- ptr += len;
- } else {
- /* single char */
- *(ptr++) = (unsigned char)idx;
- }
-
- *(ptr++) = ' ';
+ result = cbsubst_append_inf_key(result, inf, idx);
}
- *ptr = '\0';
-
- ret = rb_str_new2(buf);
-
- xfree(buf);
-
- return ret;
+ return result;
}
static VALUE
@@ -1422,24 +1482,24 @@ cbsubst_get_subst_key(self, str)
VALUE str;
{
struct cbsubst_info *inf;
- volatile VALUE list;
- volatile VALUE ret;
- VALUE keyval;
+ VALUE list;
+ VALUE ret;
long i, len, keylen;
int idx;
- char *buf, *ptr, *key;
+ char *buf, *ptr;
list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str);
+ Check_Type(list, T_ARRAY);
len = RARRAY_LEN(list);
- Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
- struct cbsubst_info, inf);
+ inf = cbsubst_get_ptr(self);
- ptr = buf = ALLOC_N(char, inf->full_subst_length + len + 1);
+ ret = rb_str_new(0, len);
+ ptr = buf = RSTRING_PTR(ret);
for(i = 0; i < len; i++) {
- keyval = RARRAY_PTR(list)[i];
- key = RSTRING_PTR(keyval);
+ VALUE keyval = RARRAY_AREF(list, i);
+ const char *key = (Check_Type(keyval, T_STRING), StringValueCStr(keyval));
if (*key == '%') {
if (*(key + 2) == '\0') {
/* single char */
@@ -1463,10 +1523,8 @@ cbsubst_get_subst_key(self, str)
*(ptr++) = ' ';
}
}
- *ptr = '\0';
- ret = rb_str_new2(buf);
- xfree(buf);
+ rb_str_set_len(ret, ptr - buf);
return ret;
}
@@ -1475,46 +1533,26 @@ cbsubst_get_all_subst_keys(self)
VALUE self;
{
struct cbsubst_info *inf;
- char *buf, *ptr;
char *keys_buf, *keys_ptr;
int idx;
- long len;
- volatile VALUE ret;
+ VALUE str, keys_str;
- Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
- struct cbsubst_info, inf);
+ inf = cbsubst_get_ptr(self);
- ptr = buf = ALLOC_N(char, inf->full_subst_length + 1);
- keys_ptr = keys_buf = ALLOC_N(char, CBSUBST_TBL_MAX + 1);
+ str = rb_str_new(0, 0);
+ keys_str = rb_str_new(0, CBSUBST_TBL_MAX);
+ keys_ptr = keys_buf = RSTRING_PTR(keys_str);
for(idx = 0; idx < CBSUBST_TBL_MAX; idx++) {
if (inf->ivar[idx] == (ID) 0) continue;
*(keys_ptr++) = (unsigned char)idx;
- *(ptr++) = '%';
-
- if (len = inf->keylen[idx]) {
- /* longname */
- strncpy(ptr, inf->key[idx], len);
- ptr += len;
- } else {
- /* single char */
- *(ptr++) = (unsigned char)idx;
- }
-
- *(ptr++) = ' ';
+ str = cbsubst_append_inf_key(str, inf, idx);
}
+ rb_str_set_len(keys_str, keys_ptr - keys_buf);
- *ptr = '\0';
- *keys_ptr = '\0';
-
- ret = rb_ary_new3(2, rb_str_new2(keys_buf), rb_str_new2(buf));
-
- xfree(buf);
- xfree(keys_buf);
-
- return ret;
+ return rb_ary_new3(2, keys_str, str);
}
static VALUE
@@ -1527,10 +1565,11 @@ cbsubst_table_setup(argc, argv, self)
volatile VALUE key_inf;
volatile VALUE longkey_inf;
volatile VALUE proc_inf;
- VALUE inf;
+ VALUE inf, subst, name, type, ivar, proc;
+ const VALUE *infp;
ID id;
struct cbsubst_info *subst_inf;
- long idx, len;
+ long idx;
unsigned char chr;
/* accept (key_inf, proc_inf) or (key_inf, longkey_inf, procinf) */
@@ -1538,6 +1577,9 @@ cbsubst_table_setup(argc, argv, self)
proc_inf = longkey_inf;
longkey_inf = rb_ary_new();
}
+ Check_Type(key_inf, T_ARRAY);
+ Check_Type(longkey_inf, T_ARRAY);
+ Check_Type(proc_inf, T_ARRAY);
/* check the number of longkeys */
if (RARRAY_LEN(longkey_inf) > 125 /* from 0x80 to 0xFD */) {
@@ -1553,25 +1595,21 @@ cbsubst_table_setup(argc, argv, self)
* type ==> char code or string
* ivar ==> symbol
*/
- len = RARRAY_LEN(key_inf);
- for(idx = 0; idx < len; idx++) {
- inf = RARRAY_PTR(key_inf)[idx];
- if (TYPE(inf) != T_ARRAY) continue;
-
- if (TYPE(RARRAY_PTR(inf)[0]) == T_STRING) {
- chr = *(RSTRING_PTR(RARRAY_PTR(inf)[0]));
- } else {
- chr = NUM2CHR(RARRAY_PTR(inf)[0]);
- }
- if (TYPE(RARRAY_PTR(inf)[1]) == T_STRING) {
- subst_inf->type[chr] = *(RSTRING_PTR(RARRAY_PTR(inf)[1]));
- } else {
- subst_inf->type[chr] = NUM2CHR(RARRAY_PTR(inf)[1]);
- }
+ for(idx = 0; idx < RARRAY_LEN(key_inf); idx++) {
+ inf = RARRAY_AREF(key_inf, idx);
+ if (!RB_TYPE_P(inf, T_ARRAY)) continue;
+ if (RARRAY_LEN(inf) < 3) continue;
+ infp = RARRAY_CONST_PTR(inf);
+ subst = infp[0];
+ type = infp[1];
+ ivar = infp[2];
+
+ chr = NUM2CHR(subst);
+ subst_inf->type[chr] = NUM2CHR(type);
subst_inf->full_subst_length += 3;
- id = SYM2ID(RARRAY_PTR(inf)[2]);
+ id = SYM2ID(ivar);
subst_inf->ivar[chr] = rb_intern_str(rb_sprintf("@%"PRIsVALUE, rb_id2str(id)));
rb_attr(self, id, 1, 0, Qtrue);
@@ -1584,33 +1622,25 @@ cbsubst_table_setup(argc, argv, self)
* type ==> char code or string
* ivar ==> symbol
*/
- len = RARRAY_LEN(longkey_inf);
- for(idx = 0; idx < len; idx++) {
- inf = RARRAY_PTR(longkey_inf)[idx];
- if (TYPE(inf) != T_ARRAY) continue;
-
+ for(idx = 0; idx < RARRAY_LEN(longkey_inf); idx++) {
+ inf = RARRAY_AREF(longkey_inf, idx);
+ if (!RB_TYPE_P(inf, T_ARRAY)) continue;
+ if (RARRAY_LEN(inf) < 3) continue;
+ infp = RARRAY_CONST_PTR(inf);
+ name = infp[0];
+ type = infp[1];
+ ivar = infp[2];
+
+ Check_Type(name, T_STRING);
chr = (unsigned char)(0x80 + idx);
- subst_inf->keylen[chr] = RSTRING_LEN(RARRAY_PTR(inf)[0]);
-#if HAVE_STRNDUP
- subst_inf->key[chr] = strndup(RSTRING_PTR(RARRAY_PTR(inf)[0]),
- RSTRING_LEN(RARRAY_PTR(inf)[0]));
-#else
- subst_inf->key[chr] = malloc(RSTRING_LEN(RARRAY_PTR(inf)[0]) + 1);
- if (subst_inf->key[chr]) {
- strncpy(subst_inf->key[chr], RSTRING_PTR(RARRAY_PTR(inf)[0]),
- RSTRING_LEN(RARRAY_PTR(inf)[0]) + 1);
- subst_inf->key[chr][RSTRING_LEN(RARRAY_PTR(inf)[0])] = '\0';
- }
-#endif
- if (TYPE(RARRAY_PTR(inf)[1]) == T_STRING) {
- subst_inf->type[chr] = *(RSTRING_PTR(RARRAY_PTR(inf)[1]));
- } else {
- subst_inf->type[chr] = NUM2CHR(RARRAY_PTR(inf)[1]);
- }
+ subst_inf->keylen[chr] = RSTRING_LEN(name);
+ subst_inf->key[chr] = strndup(RSTRING_PTR(name),
+ RSTRING_LEN(name));
+ subst_inf->type[chr] = NUM2CHR(type);
subst_inf->full_subst_length += (subst_inf->keylen[chr] + 2);
- id = SYM2ID(RARRAY_PTR(inf)[2]);
+ id = SYM2ID(ivar);
subst_inf->ivar[chr] = rb_intern_str(rb_sprintf("@%"PRIsVALUE, rb_id2str(id)));
rb_attr(self, id, 1, 0, Qtrue);
@@ -1621,15 +1651,15 @@ cbsubst_table_setup(argc, argv, self)
* type ==> char code or string
* proc ==> proc/method/obj (must respond to 'call')
*/
- len = RARRAY_LEN(proc_inf);
- for(idx = 0; idx < len; idx++) {
- inf = RARRAY_PTR(proc_inf)[idx];
- if (TYPE(inf) != T_ARRAY) continue;
- rb_hash_aset(subst_inf->proc,
- ((TYPE(RARRAY_PTR(inf)[0]) == T_STRING)?
- INT2FIX(*(RSTRING_PTR(RARRAY_PTR(inf)[0]))) :
- RARRAY_PTR(inf)[0]),
- RARRAY_PTR(inf)[1]);
+ for(idx = 0; idx < RARRAY_LEN(proc_inf); idx++) {
+ inf = RARRAY_AREF(proc_inf, idx);
+ if (!RB_TYPE_P(inf, T_ARRAY)) continue;
+ if (RARRAY_LEN(inf) < 2) continue;
+ type = rb_ary_entry(inf, 0);
+ proc = rb_ary_entry(inf, 1);
+ if (RB_TYPE_P(type, T_STRING))
+ type = INT2FIX(*(RSTRING_PTR(type)));
+ rb_hash_aset(subst_inf->proc, type, proc);
}
rb_const_set(self, ID_SUBST_INFO, cbsubst_obj);
@@ -1652,9 +1682,9 @@ cbsubst_scan_args(self, arg_key, val_ary)
{
struct cbsubst_info *inf;
long idx;
- unsigned char *keyptr = (unsigned char*)RSTRING_PTR(arg_key);
+ unsigned char *keyptr = (unsigned char*)StringValueCStr(arg_key);
long keylen = RSTRING_LEN(arg_key);
- long vallen = RARRAY_LEN(val_ary);
+ long vallen = (Check_Type(val_ary, T_ARRAY), RARRAY_LEN(val_ary));
unsigned char type_chr;
volatile VALUE dst = rb_ary_new2(vallen);
volatile VALUE proc;
@@ -1666,8 +1696,7 @@ cbsubst_scan_args(self, arg_key, val_ary)
old_gc = rb_gc_disable();
- Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
- struct cbsubst_info, inf);
+ inf = cbsubst_get_ptr(self);
for(idx = 0; idx < vallen; idx++) {
if (idx >= keylen) {
@@ -1675,7 +1704,7 @@ cbsubst_scan_args(self, arg_key, val_ary)
} else if (*(keyptr + idx) == ' ') {
proc = Qnil;
} else {
- if (type_chr = inf->type[*(keyptr + idx)]) {
+ if ((type_chr = inf->type[*(keyptr + idx)]) != 0) {
proc = rb_hash_aref(inf->proc, INT2FIX((int)type_chr));
} else {
proc = Qnil;
@@ -1683,10 +1712,10 @@ cbsubst_scan_args(self, arg_key, val_ary)
}
if (NIL_P(proc)) {
- rb_ary_push(dst, RARRAY_PTR(val_ary)[idx]);
+ rb_ary_push(dst, RARRAY_AREF(val_ary, idx));
} else {
rb_ary_push(dst, rb_funcall(proc, ID_call, 1,
- RARRAY_PTR(val_ary)[idx]));
+ RARRAY_AREF(val_ary, idx)));
}
}
@@ -1734,7 +1763,7 @@ tkobj_path(self)
const char tkutil_release_date[] = TKUTIL_RELEASE_DATE;
void
-Init_tkutil()
+Init_tkutil(void)
{
VALUE cTK = rb_define_class("TkKernel", rb_cObject);
VALUE mTK = rb_define_module("TkUtil");
diff --git a/ext/win32/extconf.rb b/ext/win32/extconf.rb
index 7aa2c93684..9952274e29 100644
--- a/ext/win32/extconf.rb
+++ b/ext/win32/extconf.rb
@@ -1,3 +1,4 @@
-if (compiled?('dl') or compiled?('fiddle')) and $mswin||$mingw||$cygwin
+# frozen_string_literal: false
+if compiled?('fiddle') and $mswin||$mingw||$cygwin
create_makefile('win32')
end
diff --git a/ext/win32/lib/Win32API.rb b/ext/win32/lib/Win32API.rb
index 4d7d4887a5..43db7db67b 100644
--- a/ext/win32/lib/Win32API.rb
+++ b/ext/win32/lib/Win32API.rb
@@ -1,19 +1,26 @@
+# frozen_string_literal: false
# -*- ruby -*-
# for backward compatibility
-warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use dl directly instead" if $VERBOSE
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead" if $VERBOSE
-require 'dl'
+require 'fiddle/import'
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!*'
+ TYPEMAP = {"0" => Fiddle::TYPE_VOID, "S" => Fiddle::TYPE_VOIDP, "I" => Fiddle::TYPE_LONG}
+ POINTER_TYPE = Fiddle::SIZEOF_VOIDP == Fiddle::SIZEOF_LONG_LONG ? 'q*' : 'l!*'
def initialize(dllname, func, import, export = "0", calltype = :stdcall)
@proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
- handle = DLL[dllname] ||= DL.dlopen(dllname)
- @func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func, calltype)
- rescue DL::DLError => e
+ handle = DLL[dllname] ||= Fiddle.dlopen(dllname)
+
+ @func = Fiddle::Function.new(
+ handle[func],
+ @proto.chars.map { |win_type| TYPEMAP[win_type.tr("VPpNnLlIi", "0SSI")] },
+ TYPEMAP[export.tr("VPpNnLlIi", "0SSI")],
+ Fiddle::Importer.const_get(:CALL_TYPE_TO_ABI)[calltype]
+ )
+ rescue Fiddle::DLError => e
raise LoadError, e.message, e.backtrace
end
@@ -23,7 +30,7 @@ class Win32API
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)
+ ret, = @func.call(*args)
return ret || 0
end
diff --git a/ext/win32/lib/win32/importer.rb b/ext/win32/lib/win32/importer.rb
index 5936bb6900..2bef016c29 100644
--- a/ext/win32/lib/win32/importer.rb
+++ b/ext/win32/lib/win32/importer.rb
@@ -1,14 +1,9 @@
-begin
- require 'fiddle/import'
- importer = Fiddle::Importer
-rescue LoadError
- require 'dl/import'
- importer = DL::Importer
-end
+# frozen_string_literal: false
+require 'fiddle/import'
module Win32
end
Win32.module_eval do
- Importer = importer
+ Importer = Fiddle::Importer
end
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index 74cc77dc9f..a88d7e63d0 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'win32/importer'
module Win32
@@ -66,6 +67,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
WCHAR = Encoding::UTF_16LE
WCHAR_NUL = "\0".encode(WCHAR).freeze
+ WCHAR_CR = "\r".encode(WCHAR).freeze
WCHAR_SIZE = WCHAR_NUL.bytesize
LOCALE = Encoding.find(Encoding.locale_charmap)
@@ -173,10 +175,20 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
FormatMessageW = Kernel32.extern "int FormatMessageW(int, void *, int, int, void *, int, void *)", :stdcall
def initialize(code)
@code = code
- msg = WCHAR_NUL * 1024
- len = FormatMessageW.call(0x1200, 0, code, 0, msg, 1024, 0)
- msg = msg[0, len].encode(LOCALE)
- super msg.tr("\r".encode(msg.encoding), '').chomp
+ buff = WCHAR_NUL * 1024
+ lang = 0
+ begin
+ len = FormatMessageW.call(0x1200, 0, code, lang, buff, 1024, 0)
+ msg = buff.byteslice(0, len * WCHAR_SIZE)
+ msg.delete!(WCHAR_CR)
+ msg.chomp!
+ msg.encode!(LOCALE)
+ rescue EncodingError
+ raise unless lang == 0
+ lang = 0x0409 # en_US
+ retry
+ end
+ super msg
end
attr_reader :code
end
@@ -222,8 +234,8 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
"long RegEnumKeyExW(void *, long, void *, void *, void *, void *, void *, void *)",
"long RegQueryValueExW(void *, void *, void *, void *, void *, void *)",
"long RegSetValueExW(void *, void *, long, long, void *, long)",
- "long RegDeleteValue(void *, void *)",
- "long RegDeleteKey(void *, void *)",
+ "long RegDeleteValueW(void *, void *)",
+ "long RegDeleteKeyW(void *, void *)",
"long RegFlushKey(void *)",
"long RegCloseKey(void *)",
"long RegQueryInfoKey(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *)",
@@ -290,7 +302,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
name = WCHAR_NUL * Constants::MAX_KEY_LENGTH
size = packdw(Constants::MAX_KEY_LENGTH)
check RegEnumValueW.call(hkey, index, name, size, 0, 0, 0, 0)
- name[0, unpackdw(size)]
+ name.byteslice(0, unpackdw(size) * WCHAR_SIZE)
end
def EnumKey(hkey, index)
@@ -298,7 +310,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
size = packdw(Constants::MAX_KEY_LENGTH)
wtime = ' ' * 8
check RegEnumKeyExW.call(hkey, index, name, size, 0, 0, 0, wtime)
- [ name[0, unpackdw(size)], unpackqw(wtime) ]
+ [ name.byteslice(0, unpackdw(size) * WCHAR_SIZE), unpackqw(wtime) ]
end
def QueryValue(hkey, name)
@@ -315,17 +327,17 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
case type
when REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ
data = data.encode(WCHAR)
- size ||= data.size + 1
+ size ||= data.bytesize + WCHAR_SIZE
end
check RegSetValueExW.call(hkey, make_wstr(name), 0, type, data, size)
end
def DeleteValue(hkey, name)
- check RegDeleteValue.call(hkey, make_wstr(name))
+ check RegDeleteValueW.call(hkey, make_wstr(name))
end
def DeleteKey(hkey, name)
- check RegDeleteKey.call(hkey, make_wstr(name))
+ check RegDeleteKeyW.call(hkey, make_wstr(name))
end
def FlushKey(hkey)
@@ -366,15 +378,16 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
}
end
- @@type2name = { }
- %w[
+ @@type2name = %w[
REG_NONE REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD
REG_DWORD_BIG_ENDIAN REG_LINK REG_MULTI_SZ
REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR
REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD
- ].each do |type|
- @@type2name[Constants.const_get(type)] = type
- end
+ ].inject([]) do |ary, type|
+ type.freeze
+ ary[Constants.const_get(type)] = type
+ ary
+ end.freeze
#
# Convert registry type value to readable string.
@@ -630,7 +643,9 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
def read(name, *rtype)
type, data = API.QueryValue(@hkey, name)
unless rtype.empty? or rtype.include?(type)
- raise TypeError, "Type mismatch (expect #{rtype.inspect} but #{type} present)"
+ raise TypeError, "Type mismatch (expect [#{
+ rtype.map{|t|Registry.type2name(t)}.join(', ')}] but #{
+ Registry.type2name(type)} present)"
end
case type
when REG_SZ, REG_EXPAND_SZ
@@ -646,7 +661,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
when REG_QWORD
[ type, API.unpackqw(data) ]
else
- raise TypeError, "Type #{type} is not supported."
+ raise TypeError, "Type #{Registry.type2name(type)} is not supported."
end
end
@@ -669,7 +684,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
when REG_EXPAND_SZ
Registry.expand_environ(data)
else
- raise TypeError, "Type #{type} is not supported."
+ raise TypeError, "Type #{Registry.type2name(type)} is not supported."
end
end
@@ -742,7 +757,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
when REG_QWORD
data = API.packqw(data.to_i)
else
- raise TypeError, "Unsupported type #{type}"
+ raise TypeError, "Unsupported type #{Registry.type2name(type)}"
end
API.SetValue(@hkey, name, type, data, data.bytesize + termsize)
end
diff --git a/ext/win32/lib/win32/resolv.rb b/ext/win32/lib/win32/resolv.rb
index b5c11bf878..d71ed98f78 100644
--- a/ext/win32/lib/win32/resolv.rb
+++ b/ext/win32/lib/win32/resolv.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
=begin
= Win32 DNS and DHCP I/F
@@ -45,6 +46,21 @@ if info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
# Windows NT
#====================================================================
module_eval <<-'__EOS__', __FILE__, __LINE__+1
+ module SZ
+ refine Registry do
+ # ad hoc workaround for broken registry
+ def read_s(key)
+ type, str = read(key)
+ unless type == Registry::REG_SZ
+ warn "Broken registry, #{name}\\#{key} was #{Registry.type2name(type)}, ignored"
+ return String.new
+ end
+ str
+ end
+ end
+ end
+ using SZ
+
TCPIP_NT = 'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
class << self
diff --git a/ext/win32/lib/win32/sspi.rb b/ext/win32/lib/win32/sspi.rb
index 4645e1b306..20441b389c 100644
--- a/ext/win32/lib/win32/sspi.rb
+++ b/ext/win32/lib/win32/sspi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# = win32/sspi.rb
#
diff --git a/ext/win32ole/depend b/ext/win32ole/depend
index 3b1d7e9a97..c8445ad5fa 100644
--- a/ext/win32ole/depend
+++ b/ext/win32ole/depend
@@ -1 +1,12 @@
-win32ole.o : win32ole.c $(hdrdir)/ruby.h $(hdrdir)/config.h $(hdrdir)/defines.h
+WIN32OLE_HEADERS = $(HDRS) $(ruby_headers)
+win32ole.o : win32ole.c $(WIN32OLE_HEADERS)
+win32ole_variant_m.o : win32ole_variant_m.c $(WIN32OLE_HEADERS)
+win32ole_typelib.o : win32ole_typelib.c $(WIN32OLE_HEADERS)
+win32ole_type.o : win32ole_type.c $(WIN32OLE_HEADERS)
+win32ole_variable.o : win32ole_variable.c $(WIN32OLE_HEADERS)
+win32ole_method.o : win32ole_method.c $(WIN32OLE_HEADERS)
+win32ole_param.o : win32ole_param.c $(WIN32OLE_HEADERS)
+win32ole_variant.o : win32ole_variant.c $(WIN32OLE_HEADERS)
+win32ole_event.o : win32ole_event.c $(WIN32OLE_HEADERS)
+win32ole_record.o : win32ole_record.c $(WIN32OLE_HEADERS)
+win32ole_error.o : win32ole_error.c $(WIN32OLE_HEADERS)
diff --git a/ext/win32ole/extconf.rb b/ext/win32ole/extconf.rb
index 52c3d6bdfb..d2044663a9 100644
--- a/ext/win32ole/extconf.rb
+++ b/ext/win32ole/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#----------------------------------
# extconf.rb
# $Revision$
diff --git a/ext/win32ole/lib/win32ole/property.rb b/ext/win32ole/lib/win32ole/property.rb
index a68bad9af8..fea047cd19 100644
--- a/ext/win32ole/lib/win32ole/property.rb
+++ b/ext/win32ole/lib/win32ole/property.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# OLEProperty
# helper class of Property with arguments.
class OLEProperty
diff --git a/ext/win32ole/sample/excel1.rb b/ext/win32ole/sample/excel1.rb
index c8cd38e732..c16c753ccc 100644
--- a/ext/win32ole/sample/excel1.rb
+++ b/ext/win32ole/sample/excel1.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'win32ole'
application = WIN32OLE.new('Excel.Application')
@@ -27,7 +28,10 @@ range.Select
chart = workbook.Charts.Add;
workbook.saved = TRUE;
-sleep 0.5
+
+print "Now quit Excel... Please enter."
+gets
+
application.ActiveWorkbook.Close(0);
application.Quit();
diff --git a/ext/win32ole/sample/excel2.rb b/ext/win32ole/sample/excel2.rb
index dbe4178051..8c4773daba 100644
--- a/ext/win32ole/sample/excel2.rb
+++ b/ext/win32ole/sample/excel2.rb
@@ -1,14 +1,13 @@
+# frozen_string_literal: false
require 'win32ole'
# -4100 is the value for the Excel constant xl3DColumn.
ChartTypeVal = -4100;
# Creates OLE object to Excel
-#excel = WIN32OLE.new("excel.application.5")
excel = WIN32OLE.new("excel.application")
# Create and rotate the chart
-
excel.visible = TRUE;
excel.Workbooks.Add();
excel.Range("a1").value = 3;
@@ -18,13 +17,15 @@ excel.Range("a1:a3").Select();
excelchart = excel.Charts.Add();
excelchart.type = ChartTypeVal;
-i = 30
+i = 0
i.step(180, 10) do |rot|
-# excelchart['Rotation'] = rot;
excelchart.rotation=rot;
+ sleep 0.1
end
# Done, bye
+print "Now quit Excel... Please enter."
+gets
+
excel.ActiveWorkbook.Close(0);
excel.Quit();
-
diff --git a/ext/win32ole/sample/excel3.rb b/ext/win32ole/sample/excel3.rb
index 0f96717063..d66023c2b6 100644
--- a/ext/win32ole/sample/excel3.rb
+++ b/ext/win32ole/sample/excel3.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'win32ole'
#application = WIN32OLE.new('Excel.Application.5')
@@ -11,3 +12,10 @@ puts "The number of sheets is #{sheetS.count}"
puts "Now add 2 sheets after of `#{sheet.name}`"
sheetS.add({'count'=>2, 'after'=>sheet})
puts "The number of sheets is #{sheetS.count}"
+
+print "Now quit Excel... Please enter."
+gets
+
+application.ActiveWorkbook.Close(0);
+application.Quit();
+
diff --git a/ext/win32ole/sample/ie.rb b/ext/win32ole/sample/ie.rb
index 11dc861e0b..dad29b08c8 100644
--- a/ext/win32ole/sample/ie.rb
+++ b/ext/win32ole/sample/ie.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'win32ole'
url = 'http://www.ruby-lang.org/'
ie = WIN32OLE.new('InternetExplorer.Application')
diff --git a/ext/win32ole/sample/ieconst.rb b/ext/win32ole/sample/ieconst.rb
index 2c6a7a383c..363a4f8153 100644
--- a/ext/win32ole/sample/ieconst.rb
+++ b/ext/win32ole/sample/ieconst.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'win32ole'
ie = WIN32OLE.new('InternetExplorer.Application')
diff --git a/ext/win32ole/sample/ienavi.rb b/ext/win32ole/sample/ienavi.rb
index 8b279ddaae..526ef0a5a8 100644
--- a/ext/win32ole/sample/ienavi.rb
+++ b/ext/win32ole/sample/ienavi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'win32ole'
$urls = []
diff --git a/ext/win32ole/sample/ienavi2.rb b/ext/win32ole/sample/ienavi2.rb
index 67977e28ab..3248393077 100644
--- a/ext/win32ole/sample/ienavi2.rb
+++ b/ext/win32ole/sample/ienavi2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'win32ole'
class IEHandler
diff --git a/ext/win32ole/sample/oledirs.rb b/ext/win32ole/sample/oledirs.rb
index dbacc2131d..e52a0fd7ac 100644
--- a/ext/win32ole/sample/oledirs.rb
+++ b/ext/win32ole/sample/oledirs.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# You need WSH(Windows Scripting Host) to run this script.
#
diff --git a/ext/win32ole/sample/olegen.rb b/ext/win32ole/sample/olegen.rb
index aa0288ddbb..4b088a774f 100644
--- a/ext/win32ole/sample/olegen.rb
+++ b/ext/win32ole/sample/olegen.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#-----------------------------
# olegen.rb
# $Revision$
diff --git a/ext/win32ole/sample/xml.rb b/ext/win32ole/sample/xml.rb
index 4b1a54dc75..36c3db32ef 100644
--- a/ext/win32ole/sample/xml.rb
+++ b/ext/win32ole/sample/xml.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# This file created by olegen.rb as following.
# ruby olegen.rb 'Microsoft XML, version 2.0' > xml.rb
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 9765929f34..ac3c2a6a73 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -15,87 +15,7 @@
modified for win32ole (ruby) by Masaki.Suketa <masaki.suketa@nifty.ne.jp>
*/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/encoding.h"
-
-#define GNUC_OLDER_3_4_4 \
- ((__GNUC__ < 3) || \
- ((__GNUC__ <= 3) && (__GNUC_MINOR__ < 4)) || \
- ((__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4)))
-
-#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
-#ifndef NONAMELESSUNION
-#define NONAMELESSUNION 1
-#endif
-#endif
-
-#include <ctype.h>
-
-#include <windows.h>
-#include <ocidl.h>
-#include <olectl.h>
-#include <ole2.h>
-#if defined(HAVE_TYPE_IMULTILANGUAGE2) || defined(HAVE_TYPE_IMULTILANGUAGE)
-#include <mlang.h>
-#endif
-#include <stdlib.h>
-#include <math.h>
-#ifdef HAVE_STDARG_PROTOTYPES
-#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
-#include <objidl.h>
-
-#define DOUT fprintf(stderr,"[%d]\n",__LINE__)
-#define DOUTS(x) fprintf(stderr,"[%d]:" #x "=%s\n",__LINE__,x)
-#define DOUTMSG(x) fprintf(stderr, "[%d]:" #x "\n",__LINE__)
-#define DOUTI(x) fprintf(stderr, "[%ld]:" #x "=%d\n",__LINE__,x)
-#define DOUTD(x) fprintf(stderr, "[%d]:" #x "=%f\n",__LINE__,x)
-
-#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
-#define V_UNION1(X, Y) ((X)->u.Y)
-#else
-#define V_UNION1(X, Y) ((X)->Y)
-#endif
-
-#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
-#undef V_UNION
-#define V_UNION(X,Y) ((X)->n1.n2.n3.Y)
-
-#undef V_VT
-#define V_VT(X) ((X)->n1.n2.vt)
-
-#undef V_BOOL
-#define V_BOOL(X) V_UNION(X,boolVal)
-#endif
-
-#ifndef V_I1REF
-#define V_I1REF(X) V_UNION(X, pcVal)
-#endif
-
-#ifndef V_UI2REF
-#define V_UI2REF(X) V_UNION(X, puiVal)
-#endif
-
-#ifndef V_INT
-#define V_INT(X) V_UNION(X, intVal)
-#endif
-
-#ifndef V_INTREF
-#define V_INTREF(X) V_UNION(X, pintVal)
-#endif
-
-#ifndef V_UINT
-#define V_UINT(X) V_UNION(X, uintVal)
-#endif
-
-#ifndef V_UINTREF
-#define V_UINTREF(X) V_UNION(X, puintVal)
-#endif
+#include "win32ole.h"
/*
* unfortunately IID_IMultiLanguage2 is not included in any libXXX.a
@@ -106,44 +26,7 @@
const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, 0xC0, 0x4F, 0x8F, 0x5D, 0x9A}};
#endif
-#define OLE_RELEASE(X) (X) ? ((X)->lpVtbl->Release(X)) : 0
-
-#define OLE_ADDREF(X) (X) ? ((X)->lpVtbl->AddRef(X)) : 0
-
-#define OLE_GET_TYPEATTR(X, Y) ((X)->lpVtbl->GetTypeAttr((X), (Y)))
-#define OLE_RELEASE_TYPEATTR(X, Y) ((X)->lpVtbl->ReleaseTypeAttr((X), (Y)))
-
-#define OLE_FREE(x) {\
- if(g_ole_initialized == TRUE) {\
- if(x) {\
- OLE_RELEASE(x);\
- (x) = 0;\
- }\
- }\
-}
-
-#define OLEData_Get_Struct(obj, pole) {\
- Data_Get_Struct(obj, struct oledata, pole);\
- if(!pole->pDispatch) {\
- rb_raise(rb_eRuntimeError, "failed to get Dispatch Interface");\
- }\
-}
-
-#ifdef HAVE_LONG_LONG
-#define I8_2_NUM LL2NUM
-#define UI8_2_NUM ULL2NUM
-#define NUM2I8 NUM2LL
-#define NUM2UI8 NUM2ULL
-#else
-#define I8_2_NUM INT2NUM
-#define UI8_2_NUM UINT2NUM
-#define NUM2I8 NUM2INT
-#define NUM2UI8 NUM2UINT
-#endif
-
-#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-
-#define WIN32OLE_VERSION "1.5.5"
+#define WIN32OLE_VERSION "1.8.4"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -151,69 +34,8 @@ typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
typedef HWND (WINAPI FNHTMLHELP)(HWND hwndCaller, LPCSTR pszFile,
UINT uCommand, DWORD dwData);
typedef BOOL (FNENUMSYSEMCODEPAGES) (CODEPAGE_ENUMPROC, DWORD);
-typedef struct {
- struct IEventSinkVtbl * lpVtbl;
-} IEventSink, *PEVENTSINK;
-
-typedef struct IEventSinkVtbl IEventSinkVtbl;
-
-struct IEventSinkVtbl {
- STDMETHOD(QueryInterface)(
- PEVENTSINK,
- REFIID,
- LPVOID *);
- STDMETHOD_(ULONG, AddRef)(PEVENTSINK);
- STDMETHOD_(ULONG, Release)(PEVENTSINK);
-
- STDMETHOD(GetTypeInfoCount)(
- PEVENTSINK,
- UINT *);
- STDMETHOD(GetTypeInfo)(
- PEVENTSINK,
- UINT,
- LCID,
- ITypeInfo **);
- STDMETHOD(GetIDsOfNames)(
- PEVENTSINK,
- REFIID,
- OLECHAR **,
- UINT,
- LCID,
- DISPID *);
- STDMETHOD(Invoke)(
- PEVENTSINK,
- DISPID,
- REFIID,
- LCID,
- WORD,
- DISPPARAMS *,
- VARIANT *,
- EXCEPINFO *,
- UINT *);
-};
-
-typedef struct tagIEVENTSINKOBJ {
- IEventSinkVtbl *lpVtbl;
- DWORD m_cRef;
- IID m_iid;
- int m_event_id;
- ITypeInfo *pTypeInfo;
-}IEVENTSINKOBJ, *PIEVENTSINKOBJ;
-
VALUE cWIN32OLE;
-VALUE cWIN32OLE_TYPELIB;
-VALUE cWIN32OLE_TYPE;
-VALUE cWIN32OLE_VARIABLE;
-VALUE cWIN32OLE_METHOD;
-VALUE cWIN32OLE_PARAM;
-VALUE cWIN32OLE_EVENT;
-VALUE cWIN32OLE_VARIANT;
-VALUE eWIN32OLERuntimeError;
-VALUE mWIN32OLE_VARIANT;
-VALUE cWIN32OLE_PROPERTY;
-
-static VALUE ary_ole_event;
-static ID id_events;
+
#if defined(RB_THREAD_SPECIFIC) && (defined(__CYGWIN__) || defined(__MINGW32__))
static RB_THREAD_SPECIFIC BOOL g_ole_initialized;
# define g_ole_initialized_init() ((void)0)
@@ -224,6 +46,7 @@ static volatile DWORD g_ole_initialized_key = TLS_OUT_OF_INDEXES;
# define g_ole_initialized_init() (g_ole_initialized_key = TlsAlloc())
# define g_ole_initialized_set(val) TlsSetValue(g_ole_initialized_key, (void*)(val))
#endif
+
static BOOL g_uninitialize_hooked = FALSE;
static BOOL g_cp_installed = FALSE;
static BOOL g_lcid_installed = FALSE;
@@ -231,14 +54,13 @@ static HINSTANCE ghhctrl = NULL;
static HINSTANCE gole32 = NULL;
static FNCOCREATEINSTANCEEX *gCoCreateInstanceEx = NULL;
static VALUE com_hash;
+static VALUE enc2cp_hash;
static IDispatchVtbl com_vtbl;
static UINT cWIN32OLE_cp = CP_ACP;
-static LCID cWIN32OLE_lcid = LOCALE_SYSTEM_DEFAULT;
static rb_encoding *cWIN32OLE_enc;
static UINT g_cp_to_check = CP_ACP;
static char g_lcid_to_check[8 + 1];
static VARTYPE g_nil_to = VT_ERROR;
-static st_table *enc2cp_table;
static IMessageFilterVtbl message_filter;
static IMessageFilter imessage_filter = { &message_filter };
static IMessageFilter* previous_filter;
@@ -251,52 +73,11 @@ static IMultiLanguage *pIMultiLanguage = NULL;
#define pIMultiLanguage NULL /* dummy */
#endif
-struct oledata {
- IDispatch *pDispatch;
-};
-
-struct oletypelibdata {
- ITypeLib *pTypeLib;
-};
-
-struct oletypedata {
- ITypeInfo *pTypeInfo;
-};
-
-struct olemethoddata {
- ITypeInfo *pOwnerTypeInfo;
- ITypeInfo *pTypeInfo;
- UINT index;
-};
-
-struct olevariabledata {
- ITypeInfo *pTypeInfo;
- UINT index;
-};
-
-struct oleparamdata {
- ITypeInfo *pTypeInfo;
- UINT method_index;
- UINT index;
-};
-
-struct oleeventdata {
- DWORD dwCookie;
- IConnectionPoint *pConnectionPoint;
- long event_id;
-};
-
struct oleparam {
DISPPARAMS dp;
OLECHAR** pNamedArgs;
};
-struct olevariantdata {
- VARIANT realvar;
- VARIANT var;
-};
-
-
static HRESULT ( STDMETHODCALLTYPE QueryInterface )(IDispatch __RPC_FAR *, REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject);
static ULONG ( STDMETHODCALLTYPE AddRef )(IDispatch __RPC_FAR * This);
static ULONG ( STDMETHODCALLTYPE Release )(IDispatch __RPC_FAR * This);
@@ -314,58 +95,28 @@ NORETURN(static void failed_load_conv51932(void));
static void load_conv_function51932(void);
#endif
static UINT ole_init_cp(void);
-static char *ole_wc2mb(LPWSTR pw);
-static VALUE ole_hresult2msg(HRESULT hr);
static void ole_freeexceptinfo(EXCEPINFO *pExInfo);
static VALUE ole_excepinfo2msg(EXCEPINFO *pExInfo);
-static void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...);
-static void ole_initialize(void);
-static void ole_msg_loop(void);
-static void ole_free(struct oledata *pole);
-static void oletypelib_free(struct oletypelibdata *poletypelib);
-static void oletype_free(struct oletypedata *poletype);
-static void olemethod_free(struct olemethoddata *polemethod);
-static void olevariable_free(struct olevariabledata *polevar);
-static void oleparam_free(struct oleparamdata *pole);
-static LPWSTR ole_vstr2wc(VALUE vstr);
-static LPWSTR ole_mb2wc(char *pm, int len);
-static VALUE ole_wc2vstr(LPWSTR pw, BOOL isfree);
-static VALUE ole_ary_m_entry(VALUE val, long *pid);
+static void ole_free(void *ptr);
+static size_t ole_size(const void *ptr);
+static LPWSTR ole_mb2wc(char *pm, int len, UINT cp);
+static VALUE ole_ary_m_entry(VALUE val, LONG *pid);
+static VALUE is_all_index_under(LONG *pid, long *pub, long dim);
static void * get_ptr_of_variant(VARIANT *pvar);
-static VALUE is_all_index_under(long *pid, long *pub, long dim);
-static void ole_set_safe_array(long n, SAFEARRAY *psa, long *pid, long *pub, VALUE val, long dim, VARTYPE vt);
+static void ole_set_safe_array(long n, SAFEARRAY *psa, LONG *pid, long *pub, VALUE val, long dim, VARTYPE vt);
static long dimension(VALUE val);
static long ary_len_of_dim(VALUE ary, long dim);
-static HRESULT ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt);
-static void ole_val2variant(VALUE val, VARIANT *var);
-static void ole_val2variant_ex(VALUE val, VARIANT *var, VARTYPE vt);
-static void ole_val2ptr_variant(VALUE val, VARIANT *var);
-static void ole_set_byref(VARIANT *realvar, VARIANT *var, VARTYPE vt);
-static void ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar);
-static void ole_val2variant2(VALUE val, VARIANT *var);
-static VALUE make_inspect(const char *class_name, VALUE detail);
-static VALUE default_inspect(VALUE self, const char *class_name);
static VALUE ole_set_member(VALUE self, IDispatch *dispatch);
static VALUE fole_s_allocate(VALUE klass);
static VALUE create_win32ole_object(VALUE klass, IDispatch *pDispatch, int argc, VALUE *argv);
-static VALUE ary_new_dim(VALUE myary, long *pid, long *plb, long dim);
-static void ary_store_dim(VALUE myary, long *pid, long *plb, long dim, VALUE val);
-static VALUE ole_variant2val(VARIANT *pvar);
-static LONG reg_open_key(HKEY hkey, const char *name, HKEY *phkey);
-static LONG reg_open_vkey(HKEY hkey, VALUE key, HKEY *phkey);
-static VALUE reg_enum_key(HKEY hkey, DWORD i);
-static VALUE reg_get_val(HKEY hkey, const char *subkey);
-static VALUE reg_get_typelib_file_path(HKEY hkey);
-static VALUE typelib_file_from_clsid(VALUE ole);
-static VALUE typelib_file_from_typelib(VALUE ole);
-static VALUE typelib_file(VALUE ole);
+static VALUE ary_new_dim(VALUE myary, LONG *pid, LONG *plb, LONG dim);
+static void ary_store_dim(VALUE myary, LONG *pid, LONG *plb, LONG dim, VALUE val);
static void ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self);
static HRESULT clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid);
-static VALUE ole_create_dcom(int argc, VALUE *argv, VALUE self);
+static VALUE ole_create_dcom(VALUE self, VALUE ole, VALUE host, VALUE others);
static VALUE ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self);
static VALUE fole_s_connect(int argc, VALUE *argv, VALUE self);
static VALUE fole_s_const_load(int argc, VALUE *argv, VALUE self);
-static VALUE ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes);
static ULONG reference_count(struct oledata * pole);
static VALUE fole_s_reference_count(VALUE self, VALUE obj);
static VALUE fole_s_free(VALUE self, VALUE obj);
@@ -383,7 +134,7 @@ static VALUE fole_s_create_guid(VALUE self);
static VALUE fole_s_ole_initialize(VALUE self);
static VALUE fole_s_ole_uninitialize(VALUE self);
static VALUE fole_initialize(int argc, VALUE *argv, VALUE self);
-static VALUE hash2named_arg(RB_BLOCK_CALL_FUNC_ARGLIST(pair, op));
+static int hash2named_arg(VALUE key, VALUE val, VALUE pop);
static VALUE set_argv(VARIANTARG* realargs, unsigned int beg, unsigned int end);
static VALUE ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket);
static VALUE fole_invoke(int argc, VALUE *argv, VALUE self);
@@ -400,203 +151,36 @@ static VALUE ole_each_sub(VALUE pEnumV);
static VALUE ole_ienum_free(VALUE pEnumV);
static VALUE fole_each(VALUE self);
static VALUE fole_missing(int argc, VALUE *argv, VALUE self);
-static VALUE ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name);
-static VALUE olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name);
-static VALUE ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, int mask);
-static VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
static HRESULT typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti);
static VALUE ole_methods(VALUE self, int mask);
static VALUE fole_methods(VALUE self);
static VALUE fole_get_methods(VALUE self);
static VALUE fole_put_methods(VALUE self);
static VALUE fole_func_methods(VALUE self);
-static VALUE ole_type_from_itypeinfo(ITypeInfo *pTypeInfo);
static VALUE fole_type(VALUE self);
-static VALUE ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo);
static VALUE fole_typelib(VALUE self);
static VALUE fole_query_interface(VALUE self, VALUE str_iid);
static VALUE fole_respond_to(VALUE self, VALUE method);
-static HRESULT ole_docinfo_from_type(ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile);
static VALUE ole_usertype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails);
static VALUE ole_ptrtype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails);
-static VALUE ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails);
static VALUE fole_method_help(VALUE self, VALUE cmdname);
static VALUE fole_activex_initialize(VALUE self);
-static VALUE foletype_s_ole_classes(VALUE self, VALUE typelib);
-static VALUE foletype_s_typelibs(VALUE self);
-static VALUE foletype_s_progids(VALUE self);
-static VALUE foletype_s_allocate(VALUE klass);
-static VALUE oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name);
-static VALUE oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass);
-static VALUE oletypelib_set_member(VALUE self, ITypeLib *pTypeLib);
-static ITypeLib * oletypelib_get_typelib(VALUE self);
-static void oletypelib_get_libattr(ITypeLib *pTypeLib, TLIBATTR **ppTLibAttr);
-static VALUE foletypelib_s_typelibs(VALUE self);
-static VALUE make_version_str(VALUE major, VALUE minor);
-static VALUE oletypelib_search_registry2(VALUE self, VALUE args);
-static VALUE oletypelib_search_registry(VALUE self, VALUE typelib);
-static VALUE foletypelib_s_allocate(VALUE klass);
-static VALUE foletypelib_initialize(VALUE self, VALUE args);
-static VALUE foletypelib_guid(VALUE self);
-static VALUE foletypelib_name(VALUE self);
-static VALUE foletypelib_version(VALUE self);
-static VALUE foletypelib_major_version(VALUE self);
-static VALUE foletypelib_minor_version(VALUE self);
-static VALUE oletypelib_path(VALUE guid, VALUE version);
-static HRESULT oletypelib_from_guid(VALUE guid, VALUE version, ITypeLib **ppTypeLib);
-static VALUE foletypelib_path(VALUE self);
-static VALUE foletypelib_visible(VALUE self);
-static VALUE foletypelib_library_name(VALUE self);
-static VALUE foletypelib_ole_types(VALUE self);
-static VALUE foletypelib_inspect(VALUE self);
-static VALUE foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass);
-static VALUE foletype_name(VALUE self);
-static VALUE ole_ole_type(ITypeInfo *pTypeInfo);
-static VALUE foletype_ole_type(VALUE self);
-static VALUE ole_type_guid(ITypeInfo *pTypeInfo);
-static VALUE foletype_guid(VALUE self);
-static VALUE ole_type_progid(ITypeInfo *pTypeInfo);
-static VALUE foletype_progid(VALUE self);
-static VALUE ole_type_visible(ITypeInfo *pTypeInfo);
-static VALUE foletype_visible(VALUE self);
-static VALUE ole_type_major_version(ITypeInfo *pTypeInfo);
-static VALUE foletype_major_version(VALUE self);
-static VALUE ole_type_minor_version(ITypeInfo *pTypeInfo);
-static VALUE foletype_minor_version(VALUE self);
-static VALUE ole_type_typekind(ITypeInfo *pTypeInfo);
-static VALUE foletype_typekind(VALUE self);
-static VALUE ole_type_helpstring(ITypeInfo *pTypeInfo);
-static VALUE foletype_helpstring(VALUE self);
-static VALUE ole_type_src_type(ITypeInfo *pTypeInfo);
-static VALUE foletype_src_type(VALUE self);
-static VALUE ole_type_helpfile(ITypeInfo *pTypeInfo);
-static VALUE foletype_helpfile(VALUE self);
-static VALUE ole_type_helpcontext(ITypeInfo *pTypeInfo);
-static VALUE foletype_helpcontext(VALUE self);
-static VALUE foletype_ole_typelib(VALUE self);
-static VALUE ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags);
-static VALUE foletype_impl_ole_types(VALUE self);
-static VALUE foletype_source_ole_types(VALUE self);
-static VALUE foletype_default_event_sources(VALUE self);
-static VALUE foletype_default_ole_types(VALUE self);
-static VALUE foletype_inspect(VALUE self);
-static VALUE ole_variables(ITypeInfo *pTypeInfo);
-static VALUE foletype_variables(VALUE self);
-static VALUE foletype_methods(VALUE self);
-static VALUE folevariable_name(VALUE self);
-static VALUE ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_ole_type(VALUE self);
-static VALUE ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_ole_type_detail(VALUE self);
-static VALUE ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_value(VALUE self);
-static VALUE ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_visible(VALUE self);
-static VALUE ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_variable_kind(VALUE self);
-static VALUE ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_varkind(VALUE self);
-static VALUE folevariable_inspect(VALUE self);
-static VALUE olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo, int index, VALUE name);
-static VALUE folemethod_s_allocate(VALUE klass);
-static VALUE folemethod_initialize(VALUE self, VALUE oletype, VALUE method);
-static VALUE folemethod_name(VALUE self);
-static VALUE ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_return_type(VALUE self);
-static VALUE ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_return_vtype(VALUE self);
-static VALUE ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_return_type_detail(VALUE self);
-static VALUE ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_invkind(VALUE self);
-static VALUE folemethod_invoke_kind(VALUE self);
-static VALUE ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_visible(VALUE self);
-static VALUE ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name);
-static VALUE folemethod_event(VALUE self);
-static VALUE folemethod_event_interface(VALUE self);
-static HRESULT ole_method_docinfo_from_type(ITypeInfo *pTypeInfo, UINT method_index, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile);
-static VALUE ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_helpstring(VALUE self);
-static VALUE ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_helpfile(VALUE self);
-static VALUE ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_helpcontext(VALUE self);
-static VALUE ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_dispid(VALUE self);
-static VALUE ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_offset_vtbl(VALUE self);
-static VALUE ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_size_params(VALUE self);
-static VALUE ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_size_opt_params(VALUE self);
-static VALUE ole_method_params(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_params(VALUE self);
-static VALUE folemethod_inspect(VALUE self);
-static VALUE foleparam_s_allocate(VALUE klass);
-static VALUE oleparam_ole_param_from_index(VALUE self, ITypeInfo *pTypeInfo, UINT method_index, int param_index);
-static VALUE oleparam_ole_param(VALUE self, VALUE olemethod, int n);
-static VALUE foleparam_initialize(VALUE self, VALUE olemethod, VALUE n);
-static VALUE foleparam_name(VALUE self);
-static VALUE ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
-static VALUE foleparam_ole_type(VALUE self);
-static VALUE ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
-static VALUE foleparam_ole_type_detail(VALUE self);
-static VALUE ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT mask);
-static VALUE foleparam_input(VALUE self);
-static VALUE foleparam_output(VALUE self);
-static VALUE foleparam_optional(VALUE self);
-static VALUE foleparam_retval(VALUE self);
-static VALUE ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
-static VALUE foleparam_default(VALUE self);
-static VALUE foleparam_inspect(VALUE self);
-static long ole_search_event_at(VALUE ary, VALUE ev);
-static VALUE ole_search_event(VALUE ary, VALUE ev, BOOL *is_default);
-static VALUE ole_search_handler_method(VALUE handler, VALUE ev, BOOL *is_default_handler);
-static void ole_delete_event(VALUE ary, VALUE ev);
-static void hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams);
-static VALUE hash2result(VALUE hash);
-static void ary2ptr_dispparams(VALUE ary, DISPPARAMS *pdispparams);
-static VALUE exec_callback(VALUE arg);
-static VALUE rescue_callback(VALUE arg);
-static HRESULT find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo);
-static HRESULT find_coclass(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **pTypeInfo2, TYPEATTR **pTypeAttr2);
-static HRESULT find_default_source_from_typeinfo(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **ppTypeInfo);
-static HRESULT find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo);
-static void ole_event_free(struct oleeventdata *poleev);
-static VALUE fev_s_allocate(VALUE klass);
-static VALUE ev_advise(int argc, VALUE *argv, VALUE self);
-static VALUE fev_initialize(int argc, VALUE *argv, VALUE self);
-static VALUE fev_s_msg_loop(VALUE klass);
-static void add_event_call_back(VALUE obj, VALUE event, VALUE data);
-static VALUE ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg);
-static VALUE fev_on_event(int argc, VALUE *argv, VALUE self);
-static VALUE fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self);
-static VALUE fev_off_event(int argc, VALUE *argv, VALUE self);
-static VALUE fev_unadvise(VALUE self);
-static VALUE fev_set_handler(VALUE self, VALUE val);
-static VALUE fev_get_handler(VALUE self);
-static VALUE evs_push(VALUE ev);
-static VALUE evs_delete(long i);
-static VALUE evs_entry(long i);
-static VALUE evs_length(void);
-static void olevariant_free(struct olevariantdata *pvar);
-static VALUE folevariant_s_allocate(VALUE klass);
-static VALUE folevariant_s_array(VALUE klass, VALUE dims, VALUE vvt);
-static void check_type_val2variant(VALUE val);
-static VALUE folevariant_initialize(VALUE self, VALUE args);
-static long *ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa);
-static void unlock_safe_array(SAFEARRAY *psa);
-static SAFEARRAY *get_locked_safe_array(VALUE val);
-static VALUE folevariant_ary_aref(int argc, VALUE *argv, VALUE self);
-static VOID * val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt);
-static VALUE folevariant_ary_aset(int argc, VALUE *argv, VALUE self);
-static VALUE folevariant_value(VALUE self);
-static VALUE folevariant_vartype(VALUE self);
-static VALUE folevariant_set_value(VALUE self, VALUE val);
-static void init_enc2cp(void);
-static void free_enc2cp(void);
+
+static void com_hash_free(void *ptr);
+static void com_hash_mark(void *ptr);
+static size_t com_hash_size(const void *ptr);
+
+static const rb_data_type_t ole_datatype = {
+ "win32ole",
+ {NULL, ole_free, ole_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static const rb_data_type_t win32ole_hash_datatype = {
+ "win32ole_hash",
+ {com_hash_mark, com_hash_free, com_hash_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
static HRESULT (STDMETHODCALLTYPE mf_QueryInterface)(
IMessageFilter __RPC_FAR * This,
@@ -765,7 +349,7 @@ static HRESULT ( STDMETHODCALLTYPE GetIDsOfNames )(
Win32OLEIDispatch* p = (Win32OLEIDispatch*)This;
*/
char* psz = ole_wc2mb(*rgszNames); // support only one method
- ID nameid = rb_intern(psz);
+ ID nameid = rb_check_id_cstr(psz, (long)strlen(psz), cWIN32OLE_enc);
free(psz);
if ((ID)(DISPID)nameid != nameid) return E_NOINTERFACE;
*rgDispId = (DISPID)nameid;
@@ -804,13 +388,18 @@ static /* [local] */ HRESULT ( STDMETHODCALLTYPE Invoke )(
return S_OK;
}
+BOOL
+ole_initialized(void)
+{
+ return g_ole_initialized;
+}
+
static IDispatch*
val2dispatch(VALUE val)
{
struct st_table *tbl = DATA_PTR(com_hash);
Win32OLEIDispatch* pdisp;
st_data_t data;
-
if (st_lookup(tbl, val, &data)) {
pdisp = (Win32OLEIDispatch *)(data & ~FIXNUM_FLAG);
pdisp->refcount++;
@@ -829,17 +418,28 @@ static double
rbtime2vtdate(VALUE tmobj)
{
SYSTEMTIME st;
- double t = 0;
- memset(&st, 0, sizeof(SYSTEMTIME));
+ double t;
+ double nsec;
+
st.wYear = FIX2INT(rb_funcall(tmobj, rb_intern("year"), 0));
st.wMonth = FIX2INT(rb_funcall(tmobj, rb_intern("month"), 0));
st.wDay = FIX2INT(rb_funcall(tmobj, rb_intern("mday"), 0));
st.wHour = FIX2INT(rb_funcall(tmobj, rb_intern("hour"), 0));
st.wMinute = FIX2INT(rb_funcall(tmobj, rb_intern("min"), 0));
st.wSecond = FIX2INT(rb_funcall(tmobj, rb_intern("sec"), 0));
- st.wMilliseconds = FIX2INT(rb_funcall(tmobj, rb_intern("nsec"), 0)) / 1000000;
+ st.wMilliseconds = 0;
SystemTimeToVariantTime(&st, &t);
- return t;
+
+ /*
+ * Unfortunately SystemTimeToVariantTime function always ignores the
+ * wMilliseconds of SYSTEMTIME struct.
+ * So, we need to calculate milliseconds by ourselves.
+ */
+ nsec = FIX2INT(rb_funcall(tmobj, rb_intern("nsec"), 0));
+ nsec /= 1000000.0;
+ nsec /= (24.0 * 3600.0);
+ nsec /= 1000;
+ return t + nsec;
}
static VALUE
@@ -847,8 +447,9 @@ vtdate2rbtime(double date)
{
SYSTEMTIME st;
VALUE v;
+ double msec;
+ double sec;
VariantTimeToSystemTime(date, &st);
-
v = rb_funcall(rb_cTime, rb_intern("new"), 6,
INT2FIX(st.wYear),
INT2FIX(st.wMonth),
@@ -856,8 +457,28 @@ vtdate2rbtime(double date)
INT2FIX(st.wHour),
INT2FIX(st.wMinute),
INT2FIX(st.wSecond));
- if (st.wMilliseconds > 0) {
- return rb_funcall(v, rb_intern("+"), 1, rb_float_new((double)(st.wMilliseconds / 1000.0)));
+ st.wYear = FIX2INT(rb_funcall(v, rb_intern("year"), 0));
+ st.wMonth = FIX2INT(rb_funcall(v, rb_intern("month"), 0));
+ st.wDay = FIX2INT(rb_funcall(v, rb_intern("mday"), 0));
+ st.wHour = FIX2INT(rb_funcall(v, rb_intern("hour"), 0));
+ st.wMinute = FIX2INT(rb_funcall(v, rb_intern("min"), 0));
+ st.wSecond = FIX2INT(rb_funcall(v, rb_intern("sec"), 0));
+ st.wMilliseconds = 0;
+ SystemTimeToVariantTime(&st, &sec);
+ /*
+ * Unfortunately VariantTimeToSystemTime always ignores the
+ * wMilliseconds of SYSTEMTIME struct(The wMilliseconds is 0).
+ * So, we need to calculate milliseconds by ourselves.
+ */
+ msec = date - sec;
+ msec *= 24 * 60;
+ msec -= floor(msec);
+ msec *= 60;
+ if (msec >= 59) {
+ msec -= 60;
+ }
+ if (msec != 0) {
+ return rb_funcall(v, rb_intern("+"), 1, rb_float_new(msec));
}
return v;
}
@@ -955,11 +576,13 @@ load_conv_function51932(void)
pIMultiLanguage = p;
}
}
+#define need_conv_function51932() (load_conv_function51932(), 1)
#else
#define load_conv_function51932() failed_load_conv51932()
+#define need_conv_function51932() (failed_load_conv51932(), 0)
#endif
-#define conv_51932(cp) ((cp) == 51932 && (load_conv_function51932(), 1))
+#define conv_51932(cp) ((cp) == 51932 && need_conv_function51932())
static void
set_ole_codepage(UINT cp)
@@ -1067,6 +690,25 @@ ole_cp2encoding(UINT cp)
return rb_enc_from_index(idx);
}
+#ifndef pIMultiLanguage
+static HRESULT
+ole_ml_wc2mb_conv0(LPWSTR pw, LPSTR pm, UINT *size)
+{
+ DWORD dw = 0;
+ return pIMultiLanguage->lpVtbl->ConvertStringFromUnicode(pIMultiLanguage,
+ &dw, cWIN32OLE_cp, pw, NULL, pm, size);
+}
+#define ole_ml_wc2mb_conv(pw, pm, size, onfailure) do { \
+ HRESULT hr = ole_ml_wc2mb_conv0(pw, pm, &size); \
+ if (FAILED(hr)) { \
+ onfailure; \
+ ole_raise(hr, eWIN32OLERuntimeError, "fail to convert Unicode to CP%d", cWIN32OLE_cp); \
+ } \
+ } while (0)
+#endif
+
+#define ole_wc2mb_conv(pw, pm, size) WideCharToMultiByte(cWIN32OLE_cp, 0, (pw), -1, (pm), (size), NULL, NULL)
+
static char *
ole_wc2mb_alloc(LPWSTR pw, char *(alloc)(UINT size, void *arg), void *arg)
{
@@ -1074,32 +716,17 @@ ole_wc2mb_alloc(LPWSTR pw, char *(alloc)(UINT size, void *arg), void *arg)
UINT size = 0;
if (conv_51932(cWIN32OLE_cp)) {
#ifndef pIMultiLanguage
- DWORD dw = 0;
- HRESULT hr = pIMultiLanguage->lpVtbl->ConvertStringFromUnicode(pIMultiLanguage,
- &dw, cWIN32OLE_cp, pw, NULL, NULL, &size);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert Unicode to CP%d", cWIN32OLE_cp);
- }
+ ole_ml_wc2mb_conv(pw, NULL, size, {});
pm = alloc(size, arg);
- hr = pIMultiLanguage->lpVtbl->ConvertStringFromUnicode(pIMultiLanguage,
- &dw, cWIN32OLE_cp, pw, NULL, pm, &size);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert Unicode to CP%d", cWIN32OLE_cp);
- }
+ if (size) ole_ml_wc2mb_conv(pw, pm, size, xfree(pm));
pm[size] = '\0';
+ return pm;
#endif
- return pm;
- }
- size = WideCharToMultiByte(cWIN32OLE_cp, 0, pw, -1, NULL, 0, NULL, NULL);
- if (size) {
- pm = alloc(size, arg);
- WideCharToMultiByte(cWIN32OLE_cp, 0, pw, -1, pm, size, NULL, NULL);
- pm[size] = '\0';
- }
- else {
- pm = alloc(0, arg);
- *pm = '\0';
}
+ size = ole_wc2mb_conv(pw, NULL, 0);
+ pm = alloc(size, arg);
+ if (size) ole_wc2mb_conv(pw, pm, size);
+ pm[size] = '\0';
return pm;
}
@@ -1109,52 +736,12 @@ ole_alloc_str(UINT size, void *arg)
return ALLOC_N(char, size + 1);
}
-static char *
+char *
ole_wc2mb(LPWSTR pw)
{
return ole_wc2mb_alloc(pw, ole_alloc_str, NULL);
}
-static VALUE
-ole_hresult2msg(HRESULT hr)
-{
- VALUE msg = Qnil;
- char *p_msg = NULL;
- char *term = NULL;
- DWORD dwCount;
-
- char strhr[100];
- sprintf(strhr, " HRESULT error code:0x%08x\n ", (unsigned)hr);
- msg = rb_str_new2(strhr);
- dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, hr,
- MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
- (LPTSTR)&p_msg, 0, NULL);
- if (dwCount == 0) {
- dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, hr, cWIN32OLE_lcid,
- (LPTSTR)&p_msg, 0, NULL);
- }
- if (dwCount > 0) {
- term = p_msg + strlen(p_msg);
- while (p_msg < term) {
- term--;
- if (*term == '\r' || *term == '\n')
- *term = '\0';
- else break;
- }
- if (p_msg[0] != '\0') {
- rb_str_cat2(msg, p_msg);
- }
- }
- LocalFree(p_msg);
- return msg;
-}
-
static void
ole_freeexceptinfo(EXCEPINFO *pExInfo)
{
@@ -1180,7 +767,7 @@ ole_excepinfo2msg(EXCEPINFO *pExInfo)
pDescription = ole_wc2mb(pExInfo->bstrDescription);
}
if(pExInfo->wCode == 0) {
- sprintf(error_code, "\n OLE error code:%lX in ", pExInfo->scode);
+ sprintf(error_code, "\n OLE error code:%lX in ", (unsigned long)pExInfo->scode);
}
else{
sprintf(error_code, "\n OLE error code:%u in ", pExInfo->wCode);
@@ -1205,25 +792,6 @@ ole_excepinfo2msg(EXCEPINFO *pExInfo)
return error_msg;
}
-static void
-ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...)
-{
- va_list args;
- char buf[BUFSIZ];
- VALUE err_msg;
- va_init_list(args, fmt);
- vsnprintf(buf, BUFSIZ, fmt, args);
- va_end(args);
-
- err_msg = ole_hresult2msg(hr);
- if(err_msg != Qnil) {
- rb_raise(ecs, "%s\n%s", buf, StringValuePtr(err_msg));
- }
- else {
- rb_raise(ecs, "%s", buf);
- }
-}
-
void
ole_uninitialize(void)
{
@@ -1238,7 +806,7 @@ ole_uninitialize_hook(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VA
ole_uninitialize();
}
-static void
+void
ole_initialize(void)
{
HRESULT hr;
@@ -1264,70 +832,46 @@ ole_initialize(void)
}
static void
-ole_msg_loop() {
- MSG msg;
- while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-}
-
-static void
-ole_free(struct oledata *pole)
+ole_free(void *ptr)
{
+ struct oledata *pole = ptr;
OLE_FREE(pole->pDispatch);
free(pole);
}
-static void
-oletypelib_free(struct oletypelibdata *poletypelib)
-{
- OLE_FREE(poletypelib->pTypeLib);
- free(poletypelib);
-}
-
-static void
-oletype_free(struct oletypedata *poletype)
-{
- OLE_FREE(poletype->pTypeInfo);
- free(poletype);
-}
-
-static void
-olemethod_free(struct olemethoddata *polemethod)
-{
- OLE_FREE(polemethod->pTypeInfo);
- OLE_FREE(polemethod->pOwnerTypeInfo);
- free(polemethod);
-}
-
-static void
-olevariable_free(struct olevariabledata *polevar)
+static size_t ole_size(const void *ptr)
{
- OLE_FREE(polevar->pTypeInfo);
- free(polevar);
+ return ptr ? sizeof(struct oledata) : 0;
}
-static void
-oleparam_free(struct oleparamdata *pole)
+struct oledata *
+oledata_get_struct(VALUE ole)
{
- OLE_FREE(pole->pTypeInfo);
- free(pole);
+ struct oledata *pole;
+ TypedData_Get_Struct(ole, struct oledata, &ole_datatype, pole);
+ return pole;
}
-
-static LPWSTR
+LPWSTR
ole_vstr2wc(VALUE vstr)
{
rb_encoding *enc;
int cp;
- UINT size = 0;
LPWSTR pw;
st_data_t data;
+ struct st_table *tbl = DATA_PTR(enc2cp_hash);
+
+ /* do not type-conversion here to prevent from other arguments
+ * changing (if exist) */
+ Check_Type(vstr, T_STRING);
+ if (RSTRING_LEN(vstr) == 0) {
+ return NULL;
+ }
+
enc = rb_enc_get(vstr);
- if (st_lookup(enc2cp_table, (st_data_t)enc, &data)) {
- cp = (int)data;
+ if (st_lookup(tbl, (VALUE)enc | FIXNUM_FLAG, &data)) {
+ cp = FIX2INT((VALUE)data);
} else {
cp = ole_encoding2cp(enc);
if (code_page_installed(cp) ||
@@ -1339,63 +883,45 @@ ole_vstr2wc(VALUE vstr)
cp == CP_UTF7 ||
cp == CP_UTF8 ||
cp == 51932) {
- st_insert(enc2cp_table, (st_data_t)enc, (st_data_t)cp);
+ st_insert(tbl, (VALUE)enc | FIXNUM_FLAG, INT2FIX(cp));
} else {
rb_raise(eWIN32OLERuntimeError, "not installed Windows codepage(%d) according to `%s'", cp, rb_enc_name(enc));
}
}
- if (conv_51932(cp)) {
-#ifndef pIMultiLanguage
- DWORD dw = 0;
- UINT len = RSTRING_LENINT(vstr);
- HRESULT hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cp, RSTRING_PTR(vstr), &len, NULL, &size);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cp);
- }
- pw = SysAllocStringLen(NULL, size);
- len = RSTRING_LEN(vstr);
- hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cp, RSTRING_PTR(vstr), &len, pw, &size);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cp);
- }
-#endif
- return pw;
- }
- size = MultiByteToWideChar(cp, 0, RSTRING_PTR(vstr), RSTRING_LEN(vstr), NULL, 0);
- pw = SysAllocStringLen(NULL, size);
- MultiByteToWideChar(cp, 0, RSTRING_PTR(vstr), RSTRING_LEN(vstr), pw, size);
+ pw = ole_mb2wc(RSTRING_PTR(vstr), RSTRING_LENINT(vstr), cp);
+ RB_GC_GUARD(vstr);
return pw;
}
static LPWSTR
-ole_mb2wc(char *pm, int len)
+ole_mb2wc(char *pm, int len, UINT cp)
{
UINT size = 0;
LPWSTR pw;
- if (conv_51932(cWIN32OLE_cp)) {
+ if (conv_51932(cp)) {
#ifndef pIMultiLanguage
DWORD dw = 0;
UINT n = len;
HRESULT hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cWIN32OLE_cp, pm, &n, NULL, &size);
+ &dw, cp, pm, &n, NULL, &size);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cWIN32OLE_cp);
+ ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cp);
}
pw = SysAllocStringLen(NULL, size);
+ n = len;
hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cWIN32OLE_cp, pm, &n, pw, &size);
+ &dw, cp, pm, &n, pw, &size);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cWIN32OLE_cp);
+ ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cp);
}
-#endif
return pw;
+#endif
}
- size = MultiByteToWideChar(cWIN32OLE_cp, 0, pm, len, NULL, 0);
- pw = SysAllocStringLen(NULL, size - 1);
- MultiByteToWideChar(cWIN32OLE_cp, 0, pm, len, pw, size);
+ size = MultiByteToWideChar(cp, 0, pm, len, NULL, 0);
+ pw = SysAllocStringLen(NULL, size);
+ pw[size-1] = 0;
+ MultiByteToWideChar(cp, 0, pm, len, pw, size);
return pw;
}
@@ -1407,7 +933,7 @@ ole_alloc_vstr(UINT size, void *arg)
return RSTRING_PTR(str);
}
-static VALUE
+VALUE
ole_wc2vstr(LPWSTR pw, BOOL isfree)
{
VALUE vstr;
@@ -1419,18 +945,89 @@ ole_wc2vstr(LPWSTR pw, BOOL isfree)
}
static VALUE
-ole_ary_m_entry(VALUE val, long *pid)
+ole_ary_m_entry(VALUE val, LONG *pid)
{
VALUE obj = Qnil;
int i = 0;
obj = val;
- while(TYPE(obj) == T_ARRAY) {
+ while(RB_TYPE_P(obj, T_ARRAY)) {
obj = rb_ary_entry(obj, pid[i]);
i++;
}
return obj;
}
+static VALUE
+is_all_index_under(LONG *pid, long *pub, long dim)
+{
+ long i = 0;
+ for (i = 0; i < dim; i++) {
+ if (pid[i] > pub[i]) {
+ return Qfalse;
+ }
+ }
+ return Qtrue;
+}
+
+void
+ole_val2variant_ex(VALUE val, VARIANT *var, VARTYPE vt)
+{
+ if (val == Qnil) {
+ if (vt == VT_VARIANT) {
+ ole_val2variant2(val, var);
+ } else {
+ V_VT(var) = (vt & ~VT_BYREF);
+ if (V_VT(var) == VT_DISPATCH) {
+ V_DISPATCH(var) = NULL;
+ } else if (V_VT(var) == VT_UNKNOWN) {
+ V_UNKNOWN(var) = NULL;
+ }
+ }
+ return;
+ }
+#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+ switch(vt & ~VT_BYREF) {
+ case VT_I8:
+ V_VT(var) = VT_I8;
+ V_I8(var) = NUM2I8 (val);
+ break;
+ case VT_UI8:
+ V_VT(var) = VT_UI8;
+ V_UI8(var) = NUM2UI8(val);
+ break;
+ default:
+ ole_val2variant2(val, var);
+ break;
+ }
+#else /* (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__) */
+ ole_val2variant2(val, var);
+#endif
+}
+
+VOID *
+val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt)
+{
+ VOID *p = NULL;
+ HRESULT hr = S_OK;
+ ole_val2variant_ex(val, var, vt);
+ if ((vt & ~VT_BYREF) == VT_VARIANT) {
+ p = var;
+ } else {
+ if ( (vt & ~VT_BYREF) != V_VT(var)) {
+ hr = VariantChangeTypeEx(var, var,
+ cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF));
+ if (FAILED(hr)) {
+ ole_raise(hr, rb_eRuntimeError, "failed to change type");
+ }
+ }
+ p = get_ptr_of_variant(var);
+ }
+ if (p == NULL) {
+ rb_raise(rb_eRuntimeError, "failed to get pointer of variant");
+ }
+ return p;
+}
+
static void *
get_ptr_of_variant(VARIANT *pvar)
{
@@ -1500,20 +1097,8 @@ get_ptr_of_variant(VARIANT *pvar)
}
}
-static VALUE
-is_all_index_under(long *pid, long *pub, long dim)
-{
- long i = 0;
- for (i = 0; i < dim; i++) {
- if (pid[i] > pub[i]) {
- return Qfalse;
- }
- }
- return Qtrue;
-}
-
static void
-ole_set_safe_array(long n, SAFEARRAY *psa, long *pid, long *pub, VALUE val, long dim, VARTYPE vt)
+ole_set_safe_array(long n, SAFEARRAY *psa, LONG *pid, long *pub, VALUE val, long dim, VARTYPE vt)
{
VALUE val1;
HRESULT hr = S_OK;
@@ -1550,7 +1135,7 @@ dimension(VALUE val) {
long dim1 = 0;
long len = 0;
long i = 0;
- if (TYPE(val) == T_ARRAY) {
+ if (RB_TYPE_P(val, T_ARRAY)) {
len = RARRAY_LEN(val);
for (i = 0; i < len; i++) {
dim1 = dimension(rb_ary_entry(val, i));
@@ -1571,11 +1156,11 @@ ary_len_of_dim(VALUE ary, long dim) {
long i = 0;
VALUE val;
if (dim == 0) {
- if (TYPE(ary) == T_ARRAY) {
+ if (RB_TYPE_P(ary, T_ARRAY)) {
ary_len = RARRAY_LEN(ary);
}
} else {
- if (TYPE(ary) == T_ARRAY) {
+ if (RB_TYPE_P(ary, T_ARRAY)) {
len = RARRAY_LEN(ary);
for (i = 0; i < len; i++) {
val = rb_ary_entry(ary, i);
@@ -1589,7 +1174,7 @@ ary_len_of_dim(VALUE ary, long dim) {
return ary_len;
}
-static HRESULT
+HRESULT
ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt)
{
long dim = 0;
@@ -1598,7 +1183,8 @@ ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt)
SAFEARRAYBOUND *psab = NULL;
SAFEARRAY *psa = NULL;
- long *pub, *pid;
+ long *pub;
+ LONG *pid;
Check_Type(val, T_ARRAY);
@@ -1606,7 +1192,7 @@ ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt)
psab = ALLOC_N(SAFEARRAYBOUND, dim);
pub = ALLOC_N(long, dim);
- pid = ALLOC_N(long, dim);
+ pid = ALLOC_N(LONG, dim);
if(!psab || !pub || !pid) {
if(pub) free(pub);
@@ -1650,24 +1236,25 @@ ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt)
return hr;
}
-static void
+void
ole_val2variant(VALUE val, VARIANT *var)
{
- struct oledata *pole;
- struct olevariantdata *pvar;
+ struct oledata *pole = NULL;
if(rb_obj_is_kind_of(val, cWIN32OLE)) {
- Data_Get_Struct(val, struct oledata, pole);
+ pole = oledata_get_struct(val);
OLE_ADDREF(pole->pDispatch);
V_VT(var) = VT_DISPATCH;
V_DISPATCH(var) = pole->pDispatch;
return;
}
if (rb_obj_is_kind_of(val, cWIN32OLE_VARIANT)) {
- Data_Get_Struct(val, struct olevariantdata, pvar);
- VariantCopy(var, &(pvar->var));
+ ole_variant2variant(val, var);
+ return;
+ }
+ if (rb_obj_is_kind_of(val, cWIN32OLE_RECORD)) {
+ ole_rec2variant(val, var);
return;
}
-
if (rb_obj_is_kind_of(val, rb_cTime)) {
V_VT(var) = VT_DATE;
V_DATE(var) = rbtime2vtdate(val);
@@ -1716,294 +1303,7 @@ ole_val2variant(VALUE val, VARIANT *var)
}
}
-static void
-ole_val2variant_ex(VALUE val, VARIANT *var, VARTYPE vt)
-{
- if (val == Qnil) {
- if (vt == VT_VARIANT) {
- ole_val2variant2(val, var);
- } else {
- V_VT(var) = (vt & ~VT_BYREF);
- if (V_VT(var) == VT_DISPATCH) {
- V_DISPATCH(var) = NULL;
- } else if (V_VT(var) == VT_UNKNOWN) {
- V_UNKNOWN(var) = NULL;
- }
- }
- return;
- }
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- switch(vt & ~VT_BYREF) {
- case VT_I8:
- V_VT(var) = VT_I8;
- V_I8(var) = NUM2I8 (val);
- break;
- case VT_UI8:
- V_VT(var) = VT_UI8;
- V_UI8(var) = NUM2UI8(val);
- break;
- default:
- ole_val2variant2(val, var);
- break;
- }
-#else /* (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__) */
- ole_val2variant2(val, var);
-#endif
-}
-
-static void
-ole_val2ptr_variant(VALUE val, VARIANT *var)
-{
- switch (TYPE(val)) {
- case T_STRING:
- if (V_VT(var) == (VT_BSTR | VT_BYREF)) {
- *V_BSTRREF(var) = ole_vstr2wc(val);
- }
- break;
- case T_FIXNUM:
- switch(V_VT(var)) {
- case (VT_UI1 | VT_BYREF) :
- *V_UI1REF(var) = NUM2CHR(val);
- break;
- case (VT_I2 | VT_BYREF) :
- *V_I2REF(var) = (short)NUM2INT(val);
- break;
- case (VT_I4 | VT_BYREF) :
- *V_I4REF(var) = NUM2INT(val);
- break;
- case (VT_R4 | VT_BYREF) :
- *V_R4REF(var) = (float)NUM2INT(val);
- break;
- case (VT_R8 | VT_BYREF) :
- *V_R8REF(var) = NUM2INT(val);
- break;
- default:
- break;
- }
- break;
- case T_FLOAT:
- switch(V_VT(var)) {
- case (VT_I2 | VT_BYREF) :
- *V_I2REF(var) = (short)NUM2INT(val);
- break;
- case (VT_I4 | VT_BYREF) :
- *V_I4REF(var) = NUM2INT(val);
- break;
- case (VT_R4 | VT_BYREF) :
- *V_R4REF(var) = (float)NUM2DBL(val);
- break;
- case (VT_R8 | VT_BYREF) :
- *V_R8REF(var) = NUM2DBL(val);
- break;
- default:
- break;
- }
- break;
- case T_BIGNUM:
- if (V_VT(var) == (VT_R8 | VT_BYREF)) {
- *V_R8REF(var) = rb_big2dbl(val);
- }
- break;
- case T_TRUE:
- if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
- *V_BOOLREF(var) = VARIANT_TRUE;
- }
- break;
- case T_FALSE:
- if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
- *V_BOOLREF(var) = VARIANT_FALSE;
- }
- break;
- default:
- break;
- }
-}
-
-static void
-ole_set_byref(VARIANT *realvar, VARIANT *var, VARTYPE vt)
-{
- V_VT(var) = vt;
- if (vt == (VT_VARIANT|VT_BYREF)) {
- V_VARIANTREF(var) = realvar;
- } else {
- if (V_VT(realvar) != (vt & ~VT_BYREF)) {
- rb_raise(eWIN32OLERuntimeError, "variant type mismatch");
- }
- switch(vt & ~VT_BYREF) {
- case VT_I1:
- V_I1REF(var) = &V_I1(realvar);
- break;
- case VT_UI1:
- V_UI1REF(var) = &V_UI1(realvar);
- break;
- case VT_I2:
- V_I2REF(var) = &V_I2(realvar);
- break;
- case VT_UI2:
- V_UI2REF(var) = &V_UI2(realvar);
- break;
- case VT_I4:
- V_I4REF(var) = &V_I4(realvar);
- break;
- case VT_UI4:
- V_UI4REF(var) = &V_UI4(realvar);
- break;
- case VT_R4:
- V_R4REF(var) = &V_R4(realvar);
- break;
- case VT_R8:
- V_R8REF(var) = &V_R8(realvar);
- break;
-
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
-#ifdef V_I8REF
- case VT_I8:
- V_I8REF(var) = &V_I8(realvar);
- break;
-#endif
-#ifdef V_UI8REF
- case VT_UI8:
- V_UI8REF(var) = &V_UI8(realvar);
- break;
-#endif
-#endif
- case VT_INT:
- V_INTREF(var) = &V_INT(realvar);
- break;
-
- case VT_UINT:
- V_UINTREF(var) = &V_UINT(realvar);
- break;
-
- case VT_CY:
- V_CYREF(var) = &V_CY(realvar);
- break;
- case VT_DATE:
- V_DATEREF(var) = &V_DATE(realvar);
- break;
- case VT_BSTR:
- V_BSTRREF(var) = &V_BSTR(realvar);
- break;
- case VT_DISPATCH:
- V_DISPATCHREF(var) = &V_DISPATCH(realvar);
- break;
- case VT_ERROR:
- V_ERRORREF(var) = &V_ERROR(realvar);
- break;
- case VT_BOOL:
- V_BOOLREF(var) = &V_BOOL(realvar);
- break;
- case VT_UNKNOWN:
- V_UNKNOWNREF(var) = &V_UNKNOWN(realvar);
- break;
- case VT_ARRAY:
- V_ARRAYREF(var) = &V_ARRAY(realvar);
- break;
- default:
- rb_raise(eWIN32OLERuntimeError, "unknown type specified(setting BYREF):%d", vt);
- break;
- }
- }
-}
-
-static void
-ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar)
-{
- HRESULT hr = S_OK;
-
- if (((vt & ~VT_BYREF) == (VT_ARRAY | VT_UI1)) && TYPE(val) == T_STRING) {
- long len = RSTRING_LEN(val);
- void *pdest = NULL;
- SAFEARRAY *p = NULL;
- SAFEARRAY *psa = SafeArrayCreateVector(VT_UI1, 0, len);
- if (!psa) {
- rb_raise(rb_eRuntimeError, "fail to SafeArrayCreateVector");
- }
- hr = SafeArrayAccessData(psa, &pdest);
- if (SUCCEEDED(hr)) {
- memcpy(pdest, RSTRING_PTR(val), len);
- SafeArrayUnaccessData(psa);
- V_VT(&(pvar->realvar)) = (vt & ~VT_BYREF);
- p = V_ARRAY(&(pvar->realvar));
- if (p != NULL) {
- SafeArrayDestroy(p);
- }
- V_ARRAY(&(pvar->realvar)) = psa;
- if (vt & VT_BYREF) {
- V_VT(&(pvar->var)) = vt;
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- } else {
- hr = VariantCopy(&(pvar->var), &(pvar->realvar));
- }
- } else {
- if (psa)
- SafeArrayDestroy(psa);
- }
- } else if (vt & VT_ARRAY) {
- if (val == Qnil) {
- V_VT(&(pvar->var)) = vt;
- if (vt & VT_BYREF) {
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- }
- } else {
- hr = ole_val_ary2variant_ary(val, &(pvar->realvar), (VARTYPE)(vt & ~VT_BYREF));
- if (SUCCEEDED(hr)) {
- if (vt & VT_BYREF) {
- V_VT(&(pvar->var)) = vt;
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- } else {
- hr = VariantCopy(&(pvar->var), &(pvar->realvar));
- }
- }
- }
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- } else if ( (vt & ~VT_BYREF) == VT_I8 || (vt & ~VT_BYREF) == VT_UI8) {
- ole_val2variant_ex(val, &(pvar->realvar), (vt & ~VT_BYREF));
- ole_val2variant_ex(val, &(pvar->var), (vt & ~VT_BYREF));
- V_VT(&(pvar->var)) = vt;
- if (vt & VT_BYREF) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- }
-#endif
- } else {
- if (val == Qnil) {
- V_VT(&(pvar->var)) = vt;
- if (vt == (VT_BYREF | VT_VARIANT)) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- } else {
- V_VT(&(pvar->realvar)) = vt & ~VT_BYREF;
- if (vt & VT_BYREF) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- }
- }
- } else {
- ole_val2variant_ex(val, &(pvar->realvar), (VARTYPE)(vt & ~VT_BYREF));
- if (vt == (VT_BYREF | VT_VARIANT)) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- } else if (vt & VT_BYREF) {
- if ( (vt & ~VT_BYREF) != V_VT(&(pvar->realvar))) {
- hr = VariantChangeTypeEx(&(pvar->realvar), &(pvar->realvar),
- cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF));
- }
- if (SUCCEEDED(hr)) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- }
- } else {
- if (vt == V_VT(&(pvar->realvar))) {
- hr = VariantCopy(&(pvar->var), &(pvar->realvar));
- } else {
- hr = VariantChangeTypeEx(&(pvar->var), &(pvar->realvar),
- cWIN32OLE_lcid, 0, vt);
- }
- }
- }
- }
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to change type");
- }
-}
-
-static void
+void
ole_val2variant2(VALUE val, VARIANT *var)
{
g_nil_to = VT_EMPTY;
@@ -2011,7 +1311,7 @@ ole_val2variant2(VALUE val, VARIANT *var)
g_nil_to = VT_ERROR;
}
-static VALUE
+VALUE
make_inspect(const char *class_name, VALUE detail)
{
VALUE str;
@@ -2023,7 +1323,7 @@ make_inspect(const char *class_name, VALUE detail)
return str;
}
-static VALUE
+VALUE
default_inspect(VALUE self, const char *class_name)
{
VALUE detail = rb_funcall(self, rb_intern("to_s"), 0);
@@ -2033,8 +1333,8 @@ default_inspect(VALUE self, const char *class_name)
static VALUE
ole_set_member(VALUE self, IDispatch *dispatch)
{
- struct oledata *pole;
- Data_Get_Struct(self, struct oledata, pole);
+ struct oledata *pole = NULL;
+ pole = oledata_get_struct(self);
if (pole->pDispatch) {
OLE_RELEASE(pole->pDispatch);
pole->pDispatch = NULL;
@@ -2050,7 +1350,7 @@ fole_s_allocate(VALUE klass)
struct oledata *pole;
VALUE obj;
ole_initialize();
- obj = Data_Make_Struct(klass,struct oledata,0,ole_free,pole);
+ obj = TypedData_Make_Struct(klass, struct oledata, &ole_datatype, pole);
pole->pDispatch = NULL;
return obj;
}
@@ -2064,7 +1364,7 @@ create_win32ole_object(VALUE klass, IDispatch *pDispatch, int argc, VALUE *argv)
}
static VALUE
-ary_new_dim(VALUE myary, long *pid, long *plb, long dim) {
+ary_new_dim(VALUE myary, LONG *pid, LONG *plb, LONG dim) {
long i;
VALUE obj = Qnil;
VALUE pobj = Qnil;
@@ -2090,24 +1390,28 @@ ary_new_dim(VALUE myary, long *pid, long *plb, long dim) {
}
static void
-ary_store_dim(VALUE myary, long *pid, long *plb, long dim, VALUE val) {
+ary_store_dim(VALUE myary, LONG *pid, LONG *plb, LONG dim, VALUE val) {
long id = pid[dim - 1] - plb[dim - 1];
VALUE obj = ary_new_dim(myary, pid, plb, dim);
rb_ary_store(obj, id, val);
}
-static VALUE
+VALUE
ole_variant2val(VARIANT *pvar)
{
VALUE obj = Qnil;
+ VARTYPE vt = V_VT(pvar);
HRESULT hr;
- while ( V_VT(pvar) == (VT_BYREF | VT_VARIANT) )
+ while ( vt == (VT_BYREF | VT_VARIANT) ) {
pvar = V_VARIANTREF(pvar);
+ vt = V_VT(pvar);
+ }
if(V_ISARRAY(pvar)) {
+ VARTYPE vt_base = vt & VT_TYPEMASK;
SAFEARRAY *psa = V_ISBYREF(pvar) ? *V_ARRAYREF(pvar) : V_ARRAY(pvar);
UINT i = 0;
- long *pid, *plb, *pub;
+ LONG *pid, *plb, *pub;
VARIANT variant;
VALUE val;
UINT dim = 0;
@@ -2115,12 +1419,9 @@ ole_variant2val(VARIANT *pvar)
return obj;
}
dim = SafeArrayGetDim(psa);
- VariantInit(&variant);
- V_VT(&variant) = (V_VT(pvar) & ~VT_ARRAY) | VT_BYREF;
-
- pid = ALLOC_N(long, dim);
- plb = ALLOC_N(long, dim);
- pub = ALLOC_N(long, dim);
+ pid = ALLOC_N(LONG, dim);
+ plb = ALLOC_N(LONG, dim);
+ pub = ALLOC_N(LONG, dim);
if(!pid || !plb || !pub) {
if(pid) free(pid);
@@ -2138,9 +1439,20 @@ ole_variant2val(VARIANT *pvar)
if (SUCCEEDED(hr)) {
obj = rb_ary_new();
i = 0;
+ VariantInit(&variant);
+ V_VT(&variant) = vt_base | VT_BYREF;
+ if (vt_base == VT_RECORD) {
+ hr = SafeArrayGetRecordInfo(psa, &V_RECORDINFO(&variant));
+ if (SUCCEEDED(hr)) {
+ V_VT(&variant) = VT_RECORD;
+ }
+ }
while (i < dim) {
ary_new_dim(obj, pid, plb, dim);
- hr = SafeArrayPtrOfIndex(psa, pid, &V_BYREF(&variant));
+ if (vt_base == VT_RECORD)
+ hr = SafeArrayPtrOfIndex(psa, pid, &V_RECORD(&variant));
+ else
+ hr = SafeArrayPtrOfIndex(psa, pid, &V_BYREF(&variant));
if (SUCCEEDED(hr)) {
val = ole_variant2val(&variant);
ary_store_dim(obj, pid, plb, dim, val);
@@ -2262,10 +1574,16 @@ ole_variant2val(VARIANT *pvar)
case VT_BSTR:
{
- if(V_ISBYREF(pvar))
- obj = ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
- else
- obj = ole_wc2vstr(V_BSTR(pvar), FALSE);
+ if(V_ISBYREF(pvar)) {
+ obj = (SysStringLen(*V_BSTRREF(pvar)) == 0)
+ ? rb_str_new2("")
+ : ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
+ }
+ else {
+ obj = (SysStringLen(V_BSTR(pvar)) == 0)
+ ? rb_str_new2("")
+ : ole_wc2vstr(V_BSTR(pvar), FALSE);
+ }
break;
}
@@ -2333,6 +1651,15 @@ ole_variant2val(VARIANT *pvar)
obj = vtdate2rbtime(date);
break;
}
+
+ case VT_RECORD:
+ {
+ IRecordInfo *pri = V_RECORDINFO(pvar);
+ void *prec = V_RECORD(pvar);
+ obj = create_win32ole_record(pri, prec);
+ break;
+ }
+
case VT_CY:
default:
{
@@ -2351,19 +1678,19 @@ ole_variant2val(VARIANT *pvar)
return obj;
}
-static LONG
+LONG
reg_open_key(HKEY hkey, const char *name, HKEY *phkey)
{
return RegOpenKeyEx(hkey, name, 0, KEY_READ, phkey);
}
-static LONG
+LONG
reg_open_vkey(HKEY hkey, VALUE key, HKEY *phkey)
{
return reg_open_key(hkey, StringValuePtr(key), phkey);
}
-static VALUE
+VALUE
reg_enum_key(HKEY hkey, DWORD i)
{
char buf[BUFSIZ + 1];
@@ -2378,7 +1705,7 @@ reg_enum_key(HKEY hkey, DWORD i)
return Qnil;
}
-static VALUE
+VALUE
reg_get_val(HKEY hkey, const char *subkey)
{
char *pbuf;
@@ -2406,7 +1733,7 @@ reg_get_val(HKEY hkey, const char *subkey)
return val;
}
-static VALUE
+VALUE
reg_get_val2(HKEY hkey, const char *subkey)
{
HKEY hsubkey;
@@ -2423,118 +1750,6 @@ reg_get_val2(HKEY hkey, const char *subkey)
return val;
}
-static VALUE
-reg_get_typelib_file_path(HKEY hkey)
-{
- VALUE path = Qnil;
- path = reg_get_val2(hkey, "win64");
- if (path != Qnil) {
- return path;
- }
- path = reg_get_val2(hkey, "win32");
- if (path != Qnil) {
- return path;
- }
- path = reg_get_val2(hkey, "win16");
- return path;
-}
-
-static VALUE
-typelib_file_from_clsid(VALUE ole)
-{
- HKEY hroot, hclsid;
- LONG err;
- VALUE typelib;
- char path[MAX_PATH + 1];
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "CLSID", &hroot);
- if (err != ERROR_SUCCESS) {
- return Qnil;
- }
- err = reg_open_key(hroot, StringValuePtr(ole), &hclsid);
- if (err != ERROR_SUCCESS) {
- RegCloseKey(hroot);
- return Qnil;
- }
- typelib = reg_get_val2(hclsid, "InprocServer32");
- RegCloseKey(hroot);
- RegCloseKey(hclsid);
- if (typelib != Qnil) {
- ExpandEnvironmentStrings(StringValuePtr(typelib), path, sizeof(path));
- path[MAX_PATH] = '\0';
- typelib = rb_str_new2(path);
- }
- return typelib;
-}
-
-static VALUE
-typelib_file_from_typelib(VALUE ole)
-{
- HKEY htypelib, hclsid, hversion, hlang;
- double fver;
- DWORD i, j, k;
- LONG err;
- BOOL found = FALSE;
- VALUE typelib;
- VALUE file = Qnil;
- VALUE clsid;
- VALUE ver;
- VALUE lang;
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
- if(err != ERROR_SUCCESS) {
- return Qnil;
- }
- for(i = 0; !found; i++) {
- clsid = reg_enum_key(htypelib, i);
- if (clsid == Qnil)
- break;
- err = reg_open_vkey(htypelib, clsid, &hclsid);
- if (err != ERROR_SUCCESS)
- continue;
- fver = 0;
- for(j = 0; !found; j++) {
- ver = reg_enum_key(hclsid, j);
- if (ver == Qnil)
- break;
- err = reg_open_vkey(hclsid, ver, &hversion);
- if (err != ERROR_SUCCESS || fver > atof(StringValuePtr(ver)))
- continue;
- fver = atof(StringValuePtr(ver));
- typelib = reg_get_val(hversion, NULL);
- if (typelib == Qnil)
- continue;
- if (rb_str_cmp(typelib, ole) == 0) {
- for(k = 0; !found; k++) {
- lang = reg_enum_key(hversion, k);
- if (lang == Qnil)
- break;
- err = reg_open_vkey(hversion, lang, &hlang);
- if (err == ERROR_SUCCESS) {
- if ((file = reg_get_typelib_file_path(hlang)) != Qnil)
- found = TRUE;
- RegCloseKey(hlang);
- }
- }
- }
- RegCloseKey(hversion);
- }
- RegCloseKey(hclsid);
- }
- RegCloseKey(htypelib);
- return file;
-}
-
-static VALUE
-typelib_file(VALUE ole)
-{
- VALUE file = typelib_file_from_clsid(ole);
- if (file != Qnil) {
- return file;
- }
- return typelib_file_from_typelib(ole);
-}
-
static void
ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self)
{
@@ -2623,7 +1838,7 @@ clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid)
len = sizeof(clsid);
err = RegQueryValueEx(hpid, "", NULL, &dwtype, (BYTE *)clsid, &len);
if (err == ERROR_SUCCESS && dwtype == REG_SZ) {
- pbuf = ole_mb2wc(clsid, -1);
+ pbuf = ole_mb2wc(clsid, -1, cWIN32OLE_cp);
hr = CLSIDFromString(pbuf, pclsid);
SysFreeString(pbuf);
}
@@ -2637,9 +1852,8 @@ clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid)
}
static VALUE
-ole_create_dcom(int argc, VALUE *argv, VALUE self)
+ole_create_dcom(VALUE self, VALUE ole, VALUE host, VALUE others)
{
- VALUE ole, host, others;
HRESULT hr;
CLSID clsid;
OLECHAR *pbuf;
@@ -2657,7 +1871,6 @@ ole_create_dcom(int argc, VALUE *argv, VALUE self)
GetProcAddress(gole32, "CoCreateInstanceEx");
if (!gCoCreateInstanceEx)
rb_raise(rb_eRuntimeError, "CoCreateInstanceEx is not supported in this environment");
- rb_scan_args(argc, argv, "2*", &ole, &host, &others);
pbuf = ole_vstr2wc(ole);
hr = CLSIDFromProgID(pbuf, &clsid);
@@ -2753,10 +1966,10 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
ole_initialize();
rb_scan_args(argc, argv, "1*", &svr_name, &others);
- SafeStringValue(svr_name);
+ StringValue(svr_name);
if (rb_safe_level() > 0 && OBJ_TAINTED(svr_name)) {
- rb_raise(rb_eSecurityError, "Insecure Object Connection - %s",
- StringValuePtr(svr_name));
+ rb_raise(rb_eSecurityError, "insecure connection - `%s'",
+ StringValuePtr(svr_name));
}
/* get CLSID from OLE server name */
@@ -2800,7 +2013,7 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
* so constant variable name of WIN32OLE object is capitalized.
* For example, the 'xlTop' constant of Excel is changed to 'XlTop'
* in WIN32OLE.
- * If the first letter of constant variabl is not [A-Z], then
+ * If the first letter of constant variable is not [A-Z], then
* the constant is defined as CONSTANTS hash element.
*
* module EXCEL_CONST
@@ -2823,7 +2036,7 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
{
VALUE ole;
VALUE klass;
- struct oledata *pole;
+ struct oledata *pole = NULL;
ITypeInfo *pTypeInfo;
ITypeLib *pTypeLib;
unsigned int index;
@@ -2833,13 +2046,13 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
LCID lcid = cWIN32OLE_lcid;
rb_scan_args(argc, argv, "11", &ole, &klass);
- if (TYPE(klass) != T_CLASS &&
- TYPE(klass) != T_MODULE &&
- TYPE(klass) != T_NIL) {
+ if (!RB_TYPE_P(klass, T_CLASS) &&
+ !RB_TYPE_P(klass, T_MODULE) &&
+ !RB_TYPE_P(klass, T_NIL)) {
rb_raise(rb_eTypeError, "2nd parameter must be Class or Module");
}
if (rb_obj_is_kind_of(ole, cWIN32OLE)) {
- OLEData_Get_Struct(ole, pole);
+ pole = oledata_get_struct(ole);
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
@@ -2851,7 +2064,7 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
OLE_RELEASE(pTypeInfo);
- if(TYPE(klass) != T_NIL) {
+ if(!RB_TYPE_P(klass, T_NIL)) {
ole_const_load(pTypeLib, klass, self);
}
else {
@@ -2859,7 +2072,7 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
}
OLE_RELEASE(pTypeLib);
}
- else if(TYPE(ole) == T_STRING) {
+ else if(RB_TYPE_P(ole, T_STRING)) {
file = typelib_file(ole);
if (file == Qnil) {
file = ole;
@@ -2869,7 +2082,7 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
SysFreeString(pBuf);
if (FAILED(hr))
ole_raise(hr, eWIN32OLERuntimeError, "failed to LoadTypeLibEx");
- if(TYPE(klass) != T_NIL) {
+ if(!RB_TYPE_P(klass, T_NIL)) {
ole_const_load(pTypeLib, klass, self);
}
else {
@@ -2883,37 +2096,6 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
return Qnil;
}
-static VALUE
-ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes)
-{
-
- long count;
- int i;
- HRESULT hr;
- BSTR bstr;
- ITypeInfo *pTypeInfo;
- VALUE type;
-
- count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
- for (i = 0; i < count; i++) {
- hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i,
- &bstr, NULL, NULL, NULL);
- if (FAILED(hr))
- continue;
-
- hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo);
- if (FAILED(hr))
- continue;
-
- type = foletype_s_allocate(cWIN32OLE_TYPE);
- oletype_set_member(type, pTypeInfo, WC2VSTR(bstr));
-
- rb_ary_push(classes, type);
- OLE_RELEASE(pTypeInfo);
- }
- return classes;
-}
-
static ULONG
reference_count(struct oledata * pole)
{
@@ -2936,8 +2118,8 @@ reference_count(struct oledata * pole)
static VALUE
fole_s_reference_count(VALUE self, VALUE obj)
{
- struct oledata * pole;
- OLEData_Get_Struct(obj, pole);
+ struct oledata * pole = NULL;
+ pole = oledata_get_struct(obj);
return INT2NUM(reference_count(pole));
}
@@ -2954,8 +2136,8 @@ static VALUE
fole_s_free(VALUE self, VALUE obj)
{
ULONG n = 0;
- struct oledata * pole;
- OLEData_Get_Struct(obj, pole);
+ struct oledata * pole = NULL;
+ pole = oledata_get_struct(obj);
if(pole->pDispatch) {
if (reference_count(pole) > 0) {
n = OLE_RELEASE(pole->pDispatch);
@@ -3017,7 +2199,7 @@ fole_s_show_help(int argc, VALUE *argv, VALUE self)
} else {
helpfile = target;
}
- if (TYPE(helpfile) != T_STRING) {
+ if (!RB_TYPE_P(helpfile, T_STRING)) {
rb_raise(rb_eTypeError, "1st parameter must be (String|WIN32OLE_TYPE|WIN32OLE_METHOD)");
}
hwnd = ole_show_help(helpfile, helpcontext);
@@ -3088,7 +2270,7 @@ fole_s_set_code_page(VALUE self, VALUE vcp)
* WIN32OLE.locale -> locale id.
*
* Returns current locale id (lcid). The default locale is
- * LOCALE_SYSTEM_DEFAULT.
+ * WIN32OLE::LOCALE_SYSTEM_DEFAULT.
*
* lcid = WIN32OLE.locale
*/
@@ -3112,7 +2294,7 @@ static BOOL
lcid_installed(LCID lcid)
{
g_lcid_installed = FALSE;
- snprintf(g_lcid_to_check, sizeof(g_lcid_to_check), "%08lx", lcid);
+ snprintf(g_lcid_to_check, sizeof(g_lcid_to_check), "%08lx", (unsigned long)lcid);
EnumSystemLocales(installed_lcid_proc, LCID_INSTALLED);
return g_lcid_installed;
}
@@ -3174,10 +2356,10 @@ fole_s_create_guid(VALUE self)
/*
* WIN32OLE.ole_initialize and WIN32OLE.ole_uninitialize
* are used in win32ole.rb to fix the issue bug #2618 (ruby-core:27634).
- * You must not use thease method.
+ * You must not use these method.
*/
-/* :nodoc */
+/* :nodoc: */
static VALUE
fole_s_ole_initialize(VALUE self)
{
@@ -3185,7 +2367,7 @@ fole_s_ole_initialize(VALUE self)
return Qnil;
}
-/* :nodoc */
+/* :nodoc: */
static VALUE
fole_s_ole_uninitialize(VALUE self)
{
@@ -3222,15 +2404,22 @@ fole_s_ole_uninitialize(VALUE self)
* excel.ActiveWorkbook.Close(0);
* excel.Quit();
*
- * Unfortunately, Win32OLE doesn't support the argument passed by
- * reference directly.
- * Instead, Win32OLE provides WIN32OLE::ARGV.
- * If you want to get the result value of argument passed by reference,
- * you can use WIN32OLE::ARGV.
+ * Unfortunately, Win32OLE doesn't support the argument passed by
+ * reference directly.
+ * Instead, Win32OLE provides WIN32OLE::ARGV or WIN32OLE_VARIANT object.
+ * If you want to get the result value of argument passed by reference,
+ * you can use WIN32OLE::ARGV or WIN32OLE_VARIANT.
*
* oleobj.method(arg1, arg2, refargv3)
* puts WIN32OLE::ARGV[2] # the value of refargv3 after called oleobj.method
*
+ * or
+ *
+ * refargv3 = WIN32OLE_VARIANT.new(XXX,
+ * WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_XXX)
+ * oleobj.method(arg1, arg2, refargv3)
+ * p refargv3.value # the value of refargv3 after called oleobj.method.
+ *
*/
/*
@@ -3260,18 +2449,18 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
rb_call_super(0, 0);
rb_scan_args(argc, argv, "11*", &svr_name, &host, &others);
- SafeStringValue(svr_name);
+ StringValue(svr_name);
if (rb_safe_level() > 0 && OBJ_TAINTED(svr_name)) {
- rb_raise(rb_eSecurityError, "Insecure Object Creation - %s",
+ rb_raise(rb_eSecurityError, "insecure object creation - `%s'",
StringValuePtr(svr_name));
}
if (!NIL_P(host)) {
- SafeStringValue(host);
+ StringValue(host);
if (rb_safe_level() > 0 && OBJ_TAINTED(host)) {
- rb_raise(rb_eSecurityError, "Insecure Object Creation - %s",
- StringValuePtr(svr_name));
+ rb_raise(rb_eSecurityError, "insecure object creation - `%s'",
+ StringValuePtr(host));
}
- return ole_create_dcom(argc, argv, self);
+ return ole_create_dcom(self, svr_name, host, others);
}
/* get CLSID from OLE server name */
@@ -3301,19 +2490,16 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-static VALUE
-hash2named_arg(RB_BLOCK_CALL_FUNC_ARGLIST(pair, op))
+static int
+hash2named_arg(VALUE key, VALUE val, VALUE pop)
{
- struct oleparam* pOp = (struct oleparam *)op;
+ struct oleparam* pOp = (struct oleparam *)pop;
unsigned int index, i;
- VALUE key, value;
index = pOp->dp.cNamedArgs;
-
/*---------------------------------------------
the data-type of key must be String or Symbol
-----------------------------------------------*/
- key = rb_ary_entry(pair, 0);
- if(TYPE(key) != T_STRING && TYPE(key) != T_SYMBOL) {
+ if(!RB_TYPE_P(key, T_STRING) && !RB_TYPE_P(key, T_SYMBOL)) {
/* clear name of dispatch parameters */
for(i = 1; i < index + 1; i++) {
SysFreeString(pOp->pNamedArgs[i]);
@@ -3325,19 +2511,18 @@ hash2named_arg(RB_BLOCK_CALL_FUNC_ARGLIST(pair, op))
/* raise an exception */
rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
}
- if (TYPE(key) == T_SYMBOL) {
- key = rb_sym_to_s(key);
+ if (RB_TYPE_P(key, T_SYMBOL)) {
+ key = rb_sym2str(key);
}
/* pNamedArgs[0] is <method name>, so "index + 1" */
pOp->pNamedArgs[index + 1] = ole_vstr2wc(key);
- value = rb_ary_entry(pair, 1);
VariantInit(&(pOp->dp.rgvarg[index]));
- ole_val2variant(value, &(pOp->dp.rgvarg[index]));
+ ole_val2variant(val, &(pOp->dp.rgvarg[index]));
pOp->dp.cNamedArgs += 1;
- return Qnil;
+ return ST_CONTINUE;
}
static VALUE
@@ -3349,7 +2534,9 @@ set_argv(VARIANTARG* realargs, unsigned int beg, unsigned int end)
rb_ary_clear(argv);
while (end-- > beg) {
rb_ary_push(argv, ole_variant2val(&realargs[end]));
- VariantClear(&realargs[end]);
+ if (V_VT(&realargs[end]) != VT_RECORD) {
+ VariantClear(&realargs[end]);
+ }
}
return argv;
}
@@ -3358,7 +2545,7 @@ static VALUE
ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
{
LCID lcid = cWIN32OLE_lcid;
- struct oledata *pole;
+ struct oledata *pole = NULL;
HRESULT hr;
VALUE cmd;
VALUE paramS;
@@ -3378,7 +2565,6 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
unsigned int cNamedArgs;
int n;
struct oleparam op;
- struct olevariantdata *pvar;
memset(&excepinfo, 0, sizeof(EXCEPINFO));
VariantInit(&result);
@@ -3389,13 +2575,13 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
op.dp.cArgs = 0;
rb_scan_args(argc, argv, "1*", &cmd, &paramS);
- if(TYPE(cmd) != T_STRING && TYPE(cmd) != T_SYMBOL && !is_bracket) {
+ if(!RB_TYPE_P(cmd, T_STRING) && !RB_TYPE_P(cmd, T_SYMBOL) && !is_bracket) {
rb_raise(rb_eTypeError, "method is wrong type (expected String or Symbol)");
}
- if (TYPE(cmd) == T_SYMBOL) {
- cmd = rb_sym_to_s(cmd);
+ if (RB_TYPE_P(cmd, T_SYMBOL)) {
+ cmd = rb_sym2str(cmd);
}
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
if(!pole->pDispatch) {
rb_raise(rb_eRuntimeError, "failed to get dispatch interface");
}
@@ -3421,15 +2607,16 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
op.dp.cNamedArgs = 0;
/* if last arg is hash object */
- if(TYPE(param) == T_HASH) {
+ if(RB_TYPE_P(param, T_HASH)) {
/*------------------------------------------
hash object ==> named dispatch parameters
--------------------------------------------*/
- cNamedArgs = NUM2INT(rb_funcall(param, rb_intern("length"), 0));
+ cNamedArgs = rb_long2int(RHASH_SIZE(param));
op.dp.cArgs = cNamedArgs + argc - 2;
op.pNamedArgs = ALLOCA_N(OLECHAR*, cNamedArgs + 1);
op.dp.rgvarg = ALLOCA_N(VARIANTARG, op.dp.cArgs);
- rb_block_call(param, rb_intern("each"), 0, 0, hash2named_arg, (VALUE)&op);
+
+ rb_hash_foreach(param, hash2named_arg, (VALUE)&op);
pDispID = ALLOCA_N(DISPID, cNamedArgs + 1);
op.pNamedArgs[0] = ole_vstr2wc(cmd);
@@ -3472,8 +2659,11 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
VariantInit(&op.dp.rgvarg[n]);
param = rb_ary_entry(paramS, i-cNamedArgs);
if (rb_obj_is_kind_of(param, cWIN32OLE_VARIANT)) {
- Data_Get_Struct(param, struct olevariantdata, pvar);
- VariantCopy(&op.dp.rgvarg[n], &(pvar->var));
+ ole_variant2variant(param, &op.dp.rgvarg[n]);
+ } else if (rb_obj_is_kind_of(param, cWIN32OLE_RECORD)) {
+ ole_val2variant(param, &realargs[n]);
+ op.dp.rgvarg[n] = realargs[n];
+ V_VT(&op.dp.rgvarg[n]) = VT_RECORD | VT_BYREF;
} else {
ole_val2variant(param, &realargs[n]);
V_VT(&op.dp.rgvarg[n]) = VT_VARIANT | VT_BYREF;
@@ -3490,7 +2680,6 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
op.dp.rgdispidNamedArgs = ALLOCA_N( DISPID, 1 );
op.dp.rgdispidNamedArgs[0] = DISPID_PROPERTYPUT;
}
-
hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID,
&IID_NULL, lcid, wFlags, &op.dp,
&result, &excepinfo, &argErr);
@@ -3530,7 +2719,9 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
}
for(i = cNamedArgs; i < op.dp.cArgs; i++) {
n = op.dp.cArgs - i + cNamedArgs - 1;
- VariantClear(&op.dp.rgvarg[n]);
+ if (V_VT(&op.dp.rgvarg[n]) != VT_RECORD) {
+ VariantClear(&op.dp.rgvarg[n]);
+ }
}
}
@@ -3553,7 +2744,9 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
&excepinfo, &argErr);
for(i = cNamedArgs; i < op.dp.cArgs; i++) {
n = op.dp.cArgs - i + cNamedArgs - 1;
- VariantClear(&op.dp.rgvarg[n]);
+ if (V_VT(&op.dp.rgvarg[n]) != VT_RECORD) {
+ VariantClear(&op.dp.rgvarg[n]);
+ }
}
}
}
@@ -3566,6 +2759,9 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
param = rb_ary_entry(paramS, i-cNamedArgs);
if (rb_obj_is_kind_of(param, cWIN32OLE_VARIANT)) {
ole_val2variant(param, &realargs[n]);
+ } else if ( rb_obj_is_kind_of(param, cWIN32OLE_RECORD) &&
+ V_VT(&realargs[n]) == VT_RECORD ) {
+ olerecord_set_ivar(param, V_RECORDINFO(&realargs[n]), V_RECORD(&realargs[n]));
}
}
set_argv(realargs, cNamedArgs, op.dp.cArgs);
@@ -3610,7 +2806,7 @@ static VALUE
ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
{
HRESULT hr;
- struct oledata *pole;
+ struct oledata *pole = NULL;
unsigned int argErr = 0;
EXCEPINFO excepinfo;
VARIANT result;
@@ -3628,7 +2824,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
memset(&excepinfo, 0, sizeof(EXCEPINFO));
memset(&dispParams, 0, sizeof(DISPPARAMS));
VariantInit(&result);
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
dispParams.cArgs = RARRAY_LEN(args);
dispParams.rgvarg = ALLOCA_N(VARIANTARG, dispParams.cArgs);
@@ -3918,7 +3114,7 @@ fole_getproperty_with_bracket(int argc, VALUE *argv, VALUE self)
static VALUE
ole_propertyput(VALUE self, VALUE property, VALUE value)
{
- struct oledata *pole;
+ struct oledata *pole = NULL;
unsigned argErr;
unsigned int index;
HRESULT hr;
@@ -3940,7 +3136,7 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
VariantInit(&propertyValue[1]);
memset(&excepinfo, 0, sizeof(excepinfo));
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
/* get ID from property name */
pBuf[0] = ole_vstr2wc(property);
@@ -3984,8 +3180,8 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
static VALUE
fole_free(VALUE self)
{
- struct oledata *pole;
- OLEData_Get_Struct(self, pole);
+ struct oledata *pole = NULL;
+ pole = oledata_get_struct(self);
OLE_FREE(pole->pDispatch);
pole->pDispatch = NULL;
return Qnil;
@@ -4034,7 +3230,7 @@ fole_each(VALUE self)
{
LCID lcid = cWIN32OLE_lcid;
- struct oledata *pole;
+ struct oledata *pole = NULL;
unsigned int argErr;
EXCEPINFO excepinfo;
@@ -4053,7 +3249,7 @@ fole_each(VALUE self)
dispParams.cArgs = 0;
memset(&excepinfo, 0, sizeof(excepinfo));
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DISPID_NEWENUM,
&IID_NULL, lcid,
DISPATCH_METHOD | DISPATCH_PROPERTYGET,
@@ -4095,16 +3291,18 @@ fole_each(VALUE self)
static VALUE
fole_missing(int argc, VALUE *argv, VALUE self)
{
- ID id;
+ VALUE mid, sym;
const char* mname;
- size_t n;
+ long n;
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
- id = rb_to_id(argv[0]);
- mname = rb_id2name(id);
+ mid = argv[0];
+ sym = rb_check_symbol(&mid);
+ if (!NIL_P(sym)) mid = rb_sym2str(sym);
+ mname = StringValueCStr(mid);
if(!mname) {
rb_raise(rb_eRuntimeError, "fail: unknown method or property");
}
- n = strlen(mname);
+ n = RSTRING_LEN(mid);
#if SIZEOF_SIZE_T > SIZEOF_LONG
if (n >= LONG_MAX) {
rb_raise(rb_eRuntimeError, "too long method or property name");
@@ -4112,151 +3310,16 @@ fole_missing(int argc, VALUE *argv, VALUE self)
#endif
if(mname[n-1] == '=') {
rb_check_arity(argc, 2, 2);
- argv[0] = rb_enc_str_new(mname, (long)(n-1), cWIN32OLE_enc);
+ argv[0] = rb_enc_str_new(mname, (n-1), cWIN32OLE_enc);
return ole_propertyput(self, argv[0], argv[1]);
}
else {
- argv[0] = rb_enc_str_new(mname, (long)n, cWIN32OLE_enc);
+ argv[0] = rb_enc_str_new(mname, n, cWIN32OLE_enc);
return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
}
}
-static VALUE
-ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- BSTR bstr;
- FUNCDESC *pFuncDesc;
- WORD i;
- VALUE fname;
- VALUE method = Qnil;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- }
- for(i = 0; i < pTypeAttr->cFuncs && method == Qnil; i++) {
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
- if (FAILED(hr))
- continue;
-
- hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, pFuncDesc->memid,
- &bstr, NULL, NULL, NULL);
- if (FAILED(hr)) {
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- continue;
- }
- fname = WC2VSTR(bstr);
- if (strcasecmp(StringValuePtr(name), StringValuePtr(fname)) == 0) {
- olemethod_set_member(self, pTypeInfo, pOwnerTypeInfo, i, fname);
- method = self;
- }
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- pFuncDesc=NULL;
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return method;
-}
-
-static VALUE
-olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- WORD i;
- HREFTYPE href;
- ITypeInfo *pRefTypeInfo;
- VALUE method = Qnil;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- }
- method = ole_method_sub(self, 0, pTypeInfo, name);
- if (method != Qnil) {
- return method;
- }
- for(i=0; i < pTypeAttr->cImplTypes && method == Qnil; i++){
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo, i, &href);
- if(FAILED(hr))
- continue;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo);
- if (FAILED(hr))
- continue;
- method = ole_method_sub(self, pTypeInfo, pRefTypeInfo, name);
- OLE_RELEASE(pRefTypeInfo);
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return method;
-}
-
-static VALUE
-ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, int mask)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- BSTR bstr;
- FUNCDESC *pFuncDesc;
- VALUE method;
- WORD i;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- }
- for(i = 0; i < pTypeAttr->cFuncs; i++) {
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
- if (FAILED(hr))
- continue;
-
- hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, pFuncDesc->memid,
- &bstr, NULL, NULL, NULL);
- if (FAILED(hr)) {
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- continue;
- }
- if(pFuncDesc->invkind & mask) {
- method = folemethod_s_allocate(cWIN32OLE_METHOD);
- olemethod_set_member(method, pTypeInfo, pOwnerTypeInfo,
- i, WC2VSTR(bstr));
- rb_ary_push(methods, method);
- }
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- pFuncDesc=NULL;
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
-
- return methods;
-}
-
-static VALUE
-ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- WORD i;
- HREFTYPE href;
- ITypeInfo *pRefTypeInfo;
- VALUE methods = rb_ary_new();
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- }
-
- ole_methods_sub(0, pTypeInfo, methods, mask);
- for(i=0; i < pTypeAttr->cImplTypes; i++){
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo, i, &href);
- if(FAILED(hr))
- continue;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo);
- if (FAILED(hr))
- continue;
- ole_methods_sub(pTypeInfo, pRefTypeInfo, methods, mask);
- OLE_RELEASE(pRefTypeInfo);
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return methods;
-}
-
static HRESULT
typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
{
@@ -4304,9 +3367,9 @@ ole_methods(VALUE self, int mask)
ITypeInfo *pTypeInfo;
HRESULT hr;
VALUE methods;
- struct oledata *pole;
+ struct oledata *pole = NULL;
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
methods = rb_ary_new();
hr = typeinfo_from_ole(pole, &pTypeInfo);
@@ -4383,30 +3446,6 @@ fole_func_methods(VALUE self)
return ole_methods( self, INVOKE_FUNC);
}
-static VALUE
-ole_type_from_itypeinfo(ITypeInfo *pTypeInfo)
-{
- ITypeLib *pTypeLib;
- VALUE type = Qnil;
- HRESULT hr;
- unsigned int index;
- BSTR bstr;
-
- hr = pTypeInfo->lpVtbl->GetContainingTypeLib( pTypeInfo, &pTypeLib, &index );
- if(FAILED(hr)) {
- return Qnil;
- }
- hr = pTypeLib->lpVtbl->GetDocumentation( pTypeLib, index,
- &bstr, NULL, NULL, NULL);
- OLE_RELEASE(pTypeLib);
- if (FAILED(hr)) {
- return Qnil;
- }
- type = foletype_s_allocate(cWIN32OLE_TYPE);
- oletype_set_member(type, pTypeInfo, WC2VSTR(bstr));
- return type;
-}
-
/*
* call-seq:
* WIN32OLE#ole_type
@@ -4421,11 +3460,11 @@ fole_type(VALUE self)
{
ITypeInfo *pTypeInfo;
HRESULT hr;
- struct oledata *pole;
+ struct oledata *pole = NULL;
LCID lcid = cWIN32OLE_lcid;
VALUE type = Qnil;
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
hr = pole->pDispatch->lpVtbl->GetTypeInfo( pole->pDispatch, 0, lcid, &pTypeInfo );
if(FAILED(hr)) {
@@ -4439,23 +3478,6 @@ fole_type(VALUE self)
return type;
}
-static VALUE
-ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- ITypeLib *pTypeLib;
- unsigned int index;
- VALUE retval = Qnil;
-
- hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
- if(FAILED(hr)) {
- return Qnil;
- }
- retval = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("allocate"), 0);
- oletypelib_set_member(retval, pTypeLib);
- return retval;
-}
-
/*
* call-seq:
* WIN32OLE#ole_typelib -> The WIN32OLE_TYPELIB object
@@ -4470,13 +3492,13 @@ ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo)
static VALUE
fole_typelib(VALUE self)
{
- struct oledata *pole;
+ struct oledata *pole = NULL;
HRESULT hr;
ITypeInfo *pTypeInfo;
LCID lcid = cWIN32OLE_lcid;
VALUE vtlib = Qnil;
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
@@ -4506,7 +3528,7 @@ fole_query_interface(VALUE self, VALUE str_iid)
HRESULT hr;
OLECHAR *pBuf;
IID iid;
- struct oledata *pole;
+ struct oledata *pole = NULL;
IDispatch *pDispatch;
void *p;
@@ -4519,7 +3541,7 @@ fole_query_interface(VALUE self, VALUE str_iid)
StringValuePtr(str_iid));
}
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
if(!pole->pDispatch) {
rb_raise(rb_eRuntimeError, "failed to get dispatch interface");
}
@@ -4548,17 +3570,17 @@ fole_query_interface(VALUE self, VALUE str_iid)
static VALUE
fole_respond_to(VALUE self, VALUE method)
{
- struct oledata *pole;
+ struct oledata *pole = NULL;
BSTR wcmdname;
DISPID DispID;
HRESULT hr;
- if(TYPE(method) != T_STRING && TYPE(method) != T_SYMBOL) {
- rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
+ if(!RB_TYPE_P(method, T_STRING) && !RB_TYPE_P(method, T_SYMBOL)) {
+ rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
}
- if (TYPE(method) == T_SYMBOL) {
- method = rb_sym_to_s(method);
+ if (RB_TYPE_P(method, T_SYMBOL)) {
+ method = rb_sym2str(method);
}
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
wcmdname = ole_vstr2wc(method);
hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
&wcmdname, 1, cWIN32OLE_lcid, &DispID);
@@ -4566,7 +3588,7 @@ fole_respond_to(VALUE self, VALUE method)
return SUCCEEDED(hr) ? Qtrue : Qfalse;
}
-static HRESULT
+HRESULT
ole_docinfo_from_type(ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile)
{
HRESULT hr;
@@ -4627,7 +3649,7 @@ ole_ptrtype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
return type;
}
-static VALUE
+VALUE
ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
{
VALUE str;
@@ -4732,6 +3754,9 @@ ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
case VT_LPSTR:
typestr = rb_str_new2("LPSTR");
break;
+ case VT_RECORD:
+ typestr = rb_str_new2("RECORD");
+ break;
default:
typestr = rb_str_new2("Unknown Type ");
rb_str_concat(typestr, rb_fix2str(INT2FIX(pTypeDesc->vt), 10));
@@ -4758,16 +3783,17 @@ fole_method_help(VALUE self, VALUE cmdname)
{
ITypeInfo *pTypeInfo;
HRESULT hr;
- struct oledata *pole;
- VALUE method, obj;
+ struct oledata *pole = NULL;
+ VALUE obj;
SafeStringValue(cmdname);
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
hr = typeinfo_from_ole(pole, &pTypeInfo);
if(FAILED(hr))
ole_raise(hr, rb_eRuntimeError, "failed to get ITypeInfo");
- method = folemethod_s_allocate(cWIN32OLE_METHOD);
- obj = olemethod_from_typeinfo(method, pTypeInfo, cmdname);
+
+ obj = create_win32ole_method(pTypeInfo, cmdname);
+
OLE_RELEASE(pTypeInfo);
if (obj == Qnil)
rb_raise(eWIN32OLERuntimeError, "not found %s",
@@ -4798,13 +3824,13 @@ fole_method_help(VALUE self, VALUE cmdname)
static VALUE
fole_activex_initialize(VALUE self)
{
- struct oledata *pole;
+ struct oledata *pole = NULL;
IPersistMemory *pPersistMemory;
void *p;
HRESULT hr = S_OK;
- OLEData_Get_Struct(self, pole);
+ pole = oledata_get_struct(self);
hr = pole->pDispatch->lpVtbl->QueryInterface(pole->pDispatch, &IID_IPersistMemory, &p);
pPersistMemory = p;
@@ -4823,4305 +3849,51 @@ fole_activex_initialize(VALUE self)
return Qnil;
}
-/*
- * call-seq:
- * WIN32OLE_TYPE.ole_classes(typelib)
- *
- * Returns array of WIN32OLE_TYPE objects defined by the <i>typelib</i> type library.
- * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.new(typelib).ole_classes instead.
- */
-static VALUE
-foletype_s_ole_classes(VALUE self, VALUE typelib)
+HRESULT
+typelib_from_val(VALUE obj, ITypeLib **pTypeLib)
{
- VALUE obj;
-
- /*
- rb_warn("%s is obsolete; use %s instead.",
- "WIN32OLE_TYPE.ole_classes",
- "WIN32OLE_TYPELIB.new(typelib).ole_types");
- */
- obj = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("new"), 1, typelib);
- return rb_funcall(obj, rb_intern("ole_types"), 0);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE.typelibs
- *
- * Returns array of type libraries.
- * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.typelibs.collect{|t| t.name} instead.
- *
- */
-static VALUE
-foletype_s_typelibs(VALUE self)
-{
- /*
- rb_warn("%s is obsolete. use %s instead.",
- "WIN32OLE_TYPE.typelibs",
- "WIN32OLE_TYPELIB.typelibs.collect{t|t.name}");
- */
- return rb_eval_string("WIN32OLE_TYPELIB.typelibs.collect{|t|t.name}");
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE.progids
- *
- * Returns array of ProgID.
- */
-static VALUE
-foletype_s_progids(VALUE self)
-{
- HKEY hclsids, hclsid;
- DWORD i;
- LONG err;
- VALUE clsid;
- VALUE v = rb_str_new2("");
- VALUE progids = rb_ary_new();
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "CLSID", &hclsids);
- if(err != ERROR_SUCCESS) {
- return progids;
- }
- for(i = 0; ; i++) {
- clsid = reg_enum_key(hclsids, i);
- if (clsid == Qnil)
- break;
- err = reg_open_vkey(hclsids, clsid, &hclsid);
- if (err != ERROR_SUCCESS)
- continue;
- if ((v = reg_get_val2(hclsid, "ProgID")) != Qnil)
- rb_ary_push(progids, v);
- if ((v = reg_get_val2(hclsid, "VersionIndependentProgID")) != Qnil)
- rb_ary_push(progids, v);
- RegCloseKey(hclsid);
- }
- RegCloseKey(hclsids);
- return progids;
-}
-
-static VALUE
-foletype_s_allocate(VALUE klass)
-{
- struct oletypedata *poletype;
- VALUE obj;
- ole_initialize();
- obj = Data_Make_Struct(klass,struct oletypedata,0,oletype_free,poletype);
- poletype->pTypeInfo = NULL;
- return obj;
-}
-
-static VALUE
-oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- rb_ivar_set(self, rb_intern("name"), name);
- ptype->pTypeInfo = pTypeInfo;
- if(pTypeInfo) OLE_ADDREF(pTypeInfo);
- return self;
-}
-
-static VALUE
-oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass)
-{
-
- long count;
- int i;
- HRESULT hr;
- BSTR bstr;
- VALUE typelib;
- ITypeInfo *pTypeInfo;
-
- VALUE found = Qfalse;
-
- count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
- for (i = 0; i < count && found == Qfalse; i++) {
- hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo);
- if (FAILED(hr))
- continue;
- hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i,
- &bstr, NULL, NULL, NULL);
- if (FAILED(hr))
- continue;
- typelib = WC2VSTR(bstr);
- if (rb_str_cmp(oleclass, typelib) == 0) {
- oletype_set_member(self, pTypeInfo, typelib);
- found = Qtrue;
- }
- OLE_RELEASE(pTypeInfo);
- }
- return found;
-}
-
-/*
- * Document-class: WIN32OLE_TYPELIB
- *
- * <code>WIN32OLE_TYPELIB</code> objects represent OLE tyblib information.
- */
-
-static VALUE
-oletypelib_set_member(VALUE self, ITypeLib *pTypeLib)
-{
- struct oletypelibdata *ptlib;
- Data_Get_Struct(self, struct oletypelibdata, ptlib);
- ptlib->pTypeLib = pTypeLib;
- return self;
-}
-
-static ITypeLib *
-oletypelib_get_typelib(VALUE self)
-{
- struct oletypelibdata *ptlib;
- Data_Get_Struct(self, struct oletypelibdata, ptlib);
- return ptlib->pTypeLib;
-}
-
-static void
-oletypelib_get_libattr(ITypeLib *pTypeLib, TLIBATTR **ppTLibAttr)
-{
- HRESULT hr;
- hr = pTypeLib->lpVtbl->GetLibAttr(pTypeLib, ppTLibAttr);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
- "failed to get library attribute(TLIBATTR) from ITypeLib");
- }
-}
-
-/*
- * call-seq:
- *
- * WIN32OLE_TYPELIB.typelibs
- *
- * Returns the array of WIN32OLE_TYPELIB object.
- *
- * tlibs = WIN32OLE_TYPELIB.typelibs
- *
- */
-static VALUE
-foletypelib_s_typelibs(VALUE self)
-{
- HKEY htypelib, hguid;
- DWORD i, j;
- LONG err;
- VALUE guid;
- VALUE version;
- VALUE name = Qnil;
- VALUE typelibs = rb_ary_new();
- VALUE typelib = Qnil;
- HRESULT hr;
- ITypeLib *pTypeLib;
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
- if(err != ERROR_SUCCESS) {
- return typelibs;
- }
- for(i = 0; ; i++) {
- guid = reg_enum_key(htypelib, i);
- if (guid == Qnil)
- break;
- err = reg_open_vkey(htypelib, guid, &hguid);
- if (err != ERROR_SUCCESS)
- continue;
- for(j = 0; ; j++) {
- version = reg_enum_key(hguid, j);
- if (version == Qnil)
- break;
- if ( (name = reg_get_val2(hguid, StringValuePtr(version))) != Qnil ) {
- hr = oletypelib_from_guid(guid, version, &pTypeLib);
- if (SUCCEEDED(hr)) {
- typelib = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("allocate"), 0);
- oletypelib_set_member(typelib, pTypeLib);
- rb_ary_push(typelibs, typelib);
- }
- }
- }
- RegCloseKey(hguid);
- }
- RegCloseKey(htypelib);
- return typelibs;
-}
-
-static VALUE
-make_version_str(VALUE major, VALUE minor)
-{
- VALUE version_str = Qnil;
- VALUE minor_str = Qnil;
- if (major == Qnil) {
- return Qnil;
- }
- version_str = rb_String(major);
- if (minor != Qnil) {
- minor_str = rb_String(minor);
- rb_str_cat2(version_str, ".");
- rb_str_append(version_str, minor_str);
- }
- return version_str;
-}
-
-static VALUE
-oletypelib_search_registry2(VALUE self, VALUE args)
-{
- HKEY htypelib, hguid, hversion;
- double fver;
- DWORD j;
- LONG err;
- VALUE found = Qfalse;
- VALUE tlib;
- VALUE ver;
- VALUE version_str;
- VALUE version = Qnil;
- VALUE typelib = Qnil;
- HRESULT hr;
- ITypeLib *pTypeLib;
-
- VALUE guid = rb_ary_entry(args, 0);
- version_str = make_version_str(rb_ary_entry(args, 1), rb_ary_entry(args, 2));
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
- if(err != ERROR_SUCCESS) {
- return Qfalse;
- }
- err = reg_open_vkey(htypelib, guid, &hguid);
- if (err != ERROR_SUCCESS) {
- RegCloseKey(htypelib);
- return Qfalse;
- }
- if (version_str != Qnil) {
- err = reg_open_vkey(hguid, version_str, &hversion);
- if (err == ERROR_SUCCESS) {
- tlib = reg_get_val(hversion, NULL);
- if (tlib != Qnil) {
- typelib = tlib;
- version = version_str;
- }
- }
- RegCloseKey(hversion);
- } else {
- fver = 0.0;
- for(j = 0; ;j++) {
- ver = reg_enum_key(hguid, j);
- if (ver == Qnil)
- break;
- err = reg_open_vkey(hguid, ver, &hversion);
- if (err != ERROR_SUCCESS)
- continue;
- tlib = reg_get_val(hversion, NULL);
- if (tlib == Qnil) {
- RegCloseKey(hversion);
- continue;
- }
- if (fver < atof(StringValuePtr(ver))) {
- fver = atof(StringValuePtr(ver));
- version = ver;
- typelib = tlib;
- }
- RegCloseKey(hversion);
- }
- }
- RegCloseKey(hguid);
- RegCloseKey(htypelib);
- if (typelib != Qnil) {
- hr = oletypelib_from_guid(guid, version, &pTypeLib);
- if (SUCCEEDED(hr)) {
- found = Qtrue;
- oletypelib_set_member(self, pTypeLib);
- }
- }
- return found;
-}
-
-static VALUE
-oletypelib_search_registry(VALUE self, VALUE typelib)
-{
- HKEY htypelib, hguid, hversion;
- DWORD i, j;
- LONG err;
- VALUE found = Qfalse;
- VALUE tlib;
- VALUE guid;
- VALUE ver;
- HRESULT hr;
- ITypeLib *pTypeLib;
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
- if(err != ERROR_SUCCESS) {
- return Qfalse;
- }
- for(i = 0; !found; i++) {
- guid = reg_enum_key(htypelib, i);
- if (guid == Qnil)
- break;
- err = reg_open_vkey(htypelib, guid, &hguid);
- if (err != ERROR_SUCCESS)
- continue;
- for(j = 0; found == Qfalse; j++) {
- ver = reg_enum_key(hguid, j);
- if (ver == Qnil)
- break;
- err = reg_open_vkey(hguid, ver, &hversion);
- if (err != ERROR_SUCCESS)
- continue;
- tlib = reg_get_val(hversion, NULL);
- if (tlib == Qnil) {
- RegCloseKey(hversion);
- continue;
- }
- if (rb_str_cmp(typelib, tlib) == 0) {
- hr = oletypelib_from_guid(guid, ver, &pTypeLib);
- if (SUCCEEDED(hr)) {
- oletypelib_set_member(self, pTypeLib);
- found = Qtrue;
- }
- }
- RegCloseKey(hversion);
- }
- RegCloseKey(hguid);
- }
- RegCloseKey(htypelib);
- return found;
-}
-
-static VALUE
-foletypelib_s_allocate(VALUE klass)
-{
- struct oletypelibdata *poletypelib;
- VALUE obj;
- ole_initialize();
- obj = Data_Make_Struct(klass, struct oletypelibdata, 0, oletypelib_free, poletypelib);
- poletypelib->pTypeLib = NULL;
- return obj;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB.new(typelib [, version1, version2]) -> WIN32OLE_TYPELIB object
- *
- * Returns a new WIN32OLE_TYPELIB object.
- *
- * The first argument <i>typelib</i> specifies OLE type library name or GUID or
- * OLE library file.
- * The second argument is major version or version of the type library.
- * The third argument is minor version.
- * The second argument and third argument are optional.
- * If the first argument is type library name, then the second and third argument
- * are ignored.
- *
- * tlib1 = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib2 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}')
- * tlib3 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1.3)
- * tlib4 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1, 3)
- * tlib5 = WIN32OLE_TYPELIB.new("C:\\WINNT\\SYSTEM32\\SHELL32.DLL")
- * puts tlib1.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib2.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib3.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib4.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib5.name # -> 'Microsoft Shell Controls And Automation'
- *
- */
-static VALUE
-foletypelib_initialize(VALUE self, VALUE args)
-{
- VALUE found = Qfalse;
- VALUE typelib = Qnil;
- int len = 0;
- OLECHAR * pbuf;
- ITypeLib *pTypeLib;
- HRESULT hr = S_OK;
-
- len = RARRAY_LEN(args);
- if (len < 1 || len > 3) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..3)", len);
- }
-
- typelib = rb_ary_entry(args, 0);
-
- SafeStringValue(typelib);
-
- found = oletypelib_search_registry(self, typelib);
- if (found == Qfalse) {
- found = oletypelib_search_registry2(self, args);
- }
- if (found == Qfalse) {
- pbuf = ole_vstr2wc(typelib);
- hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
- SysFreeString(pbuf);
- if (SUCCEEDED(hr)) {
- found = Qtrue;
- oletypelib_set_member(self, pTypeLib);
- }
- }
-
- if (found == Qfalse) {
- rb_raise(eWIN32OLERuntimeError, "not found type library `%s`",
- StringValuePtr(typelib));
- }
- return self;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#guid -> The guid string.
- *
- * Returns guid string which specifies type library.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * guid = tlib.guid # -> '{00020813-0000-0000-C000-000000000046}'
- */
-static VALUE
-foletypelib_guid(VALUE self)
-{
- ITypeLib *pTypeLib;
- OLECHAR bstr[80];
- VALUE guid = Qnil;
- int len;
- TLIBATTR *pTLibAttr;
-
- pTypeLib = oletypelib_get_typelib(self);
- oletypelib_get_libattr(pTypeLib, &pTLibAttr);
- len = StringFromGUID2(&pTLibAttr->guid, bstr, sizeof(bstr)/sizeof(OLECHAR));
- if (len > 3) {
- guid = ole_wc2vstr(bstr, FALSE);
- }
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- return guid;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#name -> The type library name
- *
- * Returns the type library name.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * name = tlib.name # -> 'Microsoft Excel 9.0 Object Library'
- */
-static VALUE
-foletypelib_name(VALUE self)
-{
- ITypeLib *pTypeLib;
- HRESULT hr;
- BSTR bstr;
- VALUE name;
- pTypeLib = oletypelib_get_typelib(self);
- hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, -1,
- NULL, &bstr, NULL, NULL);
-
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to get name from ITypeLib");
- }
- name = WC2VSTR(bstr);
- return name;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#version -> The type library version.
- *
- * Returns the type library version.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.version #-> 1.3
- */
-static VALUE
-foletypelib_version(VALUE self)
-{
- TLIBATTR *pTLibAttr;
- VALUE major;
- VALUE minor;
- ITypeLib *pTypeLib;
-
- pTypeLib = oletypelib_get_typelib(self);
- oletypelib_get_libattr(pTypeLib, &pTLibAttr);
- major = INT2NUM(pTLibAttr->wMajorVerNum);
- minor = INT2NUM(pTLibAttr->wMinorVerNum);
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- return rb_Float(make_version_str(major, minor));
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#major_version -> The type library major version.
- *
- * Returns the type library major version.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.major_version # -> 1
- */
-static VALUE
-foletypelib_major_version(VALUE self)
-{
- TLIBATTR *pTLibAttr;
- VALUE major;
- ITypeLib *pTypeLib;
- pTypeLib = oletypelib_get_typelib(self);
- oletypelib_get_libattr(pTypeLib, &pTLibAttr);
-
- major = INT2NUM(pTLibAttr->wMajorVerNum);
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- return major;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#minor_version -> The type library minor version.
- *
- * Returns the type library minor version.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.minor_version # -> 3
- */
-static VALUE
-foletypelib_minor_version(VALUE self)
-{
- TLIBATTR *pTLibAttr;
- VALUE minor;
- ITypeLib *pTypeLib;
- pTypeLib = oletypelib_get_typelib(self);
- oletypelib_get_libattr(pTypeLib, &pTLibAttr);
- minor = INT2NUM(pTLibAttr->wMinorVerNum);
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- return minor;
-}
-
-static VALUE
-oletypelib_path(VALUE guid, VALUE version)
-{
- int k;
- LONG err;
- HKEY hkey;
- HKEY hlang;
- VALUE lang;
- VALUE path = Qnil;
-
- VALUE key = rb_str_new2("TypeLib\\");
- rb_str_concat(key, guid);
- rb_str_cat2(key, "\\");
- rb_str_concat(key, version);
-
- err = reg_open_vkey(HKEY_CLASSES_ROOT, key, &hkey);
- if (err != ERROR_SUCCESS) {
- return Qnil;
- }
- for(k = 0; path == Qnil; k++) {
- lang = reg_enum_key(hkey, k);
- if (lang == Qnil)
- break;
- err = reg_open_vkey(hkey, lang, &hlang);
- if (err == ERROR_SUCCESS) {
- path = reg_get_typelib_file_path(hlang);
- RegCloseKey(hlang);
- }
- }
- RegCloseKey(hkey);
- return path;
-}
-
-static HRESULT
-oletypelib_from_guid(VALUE guid, VALUE version, ITypeLib **ppTypeLib)
-{
- VALUE path;
- OLECHAR *pBuf;
- HRESULT hr;
- path = oletypelib_path(guid, version);
- if (path == Qnil) {
- return E_UNEXPECTED;
- }
- pBuf = ole_vstr2wc(path);
- hr = LoadTypeLibEx(pBuf, REGKIND_NONE, ppTypeLib);
- SysFreeString(pBuf);
- return hr;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#path -> The type library file path.
- *
- * Returns the type library file path.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.path #-> 'C:\...\EXCEL9.OLB'
- */
-static VALUE
-foletypelib_path(VALUE self)
-{
- TLIBATTR *pTLibAttr;
- HRESULT hr = S_OK;
- BSTR bstr;
LCID lcid = cWIN32OLE_lcid;
- VALUE path;
- ITypeLib *pTypeLib;
-
- pTypeLib = oletypelib_get_typelib(self);
- oletypelib_get_libattr(pTypeLib, &pTLibAttr);
- hr = QueryPathOfRegTypeLib(&pTLibAttr->guid,
- pTLibAttr->wMajorVerNum,
- pTLibAttr->wMinorVerNum,
- lcid,
- &bstr);
- if (FAILED(hr)) {
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- ole_raise(hr, eWIN32OLERuntimeError, "failed to QueryPathOfRegTypeTypeLib");
- }
-
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- path = WC2VSTR(bstr);
- return path;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#visible?
- *
- * Returns true if the type library information is not hidden.
- * If wLibFlags of TLIBATTR is 0 or LIBFLAG_FRESTRICTED or LIBFLAG_FHIDDEN,
- * the method returns false, otherwise, returns true.
- * If the method fails to access the TLIBATTR information, then
- * WIN32OLERuntimeError is raised.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib.visible? # => true
- */
-static VALUE
-foletypelib_visible(VALUE self)
-{
- ITypeLib *pTypeLib = NULL;
- VALUE visible = Qtrue;
- TLIBATTR *pTLibAttr;
-
- pTypeLib = oletypelib_get_typelib(self);
- oletypelib_get_libattr(pTypeLib, &pTLibAttr);
-
- if ((pTLibAttr->wLibFlags == 0) ||
- (pTLibAttr->wLibFlags & LIBFLAG_FRESTRICTED) ||
- (pTLibAttr->wLibFlags & LIBFLAG_FHIDDEN)) {
- visible = Qfalse;
- }
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- return visible;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#library_name
- *
- * Returns library name.
- * If the method fails to access library name, WIN32OLERuntimeError is raised.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib.library_name # => Excel
- */
-static VALUE
-foletypelib_library_name(VALUE self)
-{
- HRESULT hr;
- ITypeLib *pTypeLib = NULL;
- VALUE libname = Qnil;
- BSTR bstr;
-
- pTypeLib = oletypelib_get_typelib(self);
- hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, -1,
- &bstr, NULL, NULL, NULL);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to get library name");
- }
- libname = WC2VSTR(bstr);
- return libname;
-}
-
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#ole_types -> The array of WIN32OLE_TYPE object included the type library.
- *
- * Returns the type library file path.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...]
- */
-static VALUE
-foletypelib_ole_types(VALUE self)
-{
- ITypeLib *pTypeLib = NULL;
- VALUE classes = rb_ary_new();
- pTypeLib = oletypelib_get_typelib(self);
- ole_types_from_typelib(pTypeLib, classes);
- return classes;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#inspect -> String
- *
- * Returns the type library name with class name.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib.inspect # => "<#WIN32OLE_TYPELIB:Microsoft Excel 9.0 Object Library>"
- */
-static VALUE
-foletypelib_inspect(VALUE self)
-{
- return default_inspect(self, "WIN32OLE_TYPELIB");
-}
-
-/*
- * Document-class: WIN32OLE_TYPE
- *
- * <code>WIN32OLE_TYPE</code> objects represent OLE type libarary information.
- */
-
-/*
- * call-seq:
- * WIN32OLE_TYPE.new(typelib, ole_class) -> WIN32OLE_TYPE object
- *
- * Returns a new WIN32OLE_TYPE object.
- * The first argument <i>typelib</i> specifies OLE type library name.
- * The second argument specifies OLE class name.
- *
- * WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
- * # => WIN32OLE_TYPE object of Application class of Excel.
- */
-static VALUE
-foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass)
-{
- VALUE file;
- OLECHAR * pbuf;
- ITypeLib *pTypeLib;
- HRESULT hr;
-
- SafeStringValue(oleclass);
- SafeStringValue(typelib);
- file = typelib_file(typelib);
- if (file == Qnil) {
- file = typelib;
- }
- pbuf = ole_vstr2wc(file);
- hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to LoadTypeLibEx");
- SysFreeString(pbuf);
- if (oleclass_from_typelib(self, pTypeLib, oleclass) == Qfalse) {
- OLE_RELEASE(pTypeLib);
- rb_raise(eWIN32OLERuntimeError, "not found `%s` in `%s`",
- StringValuePtr(oleclass), StringValuePtr(typelib));
- }
- OLE_RELEASE(pTypeLib);
- return self;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#name #=> OLE type name
- *
- * Returns OLE type name.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
- * puts tobj.name # => Application
- */
-static VALUE
-foletype_name(VALUE self)
-{
- return rb_ivar_get(self, rb_intern("name"));
-}
-
-static VALUE
-ole_ole_type(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- VALUE type = Qnil;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if(FAILED(hr)){
- return type;
- }
- switch(pTypeAttr->typekind) {
- case TKIND_ENUM:
- type = rb_str_new2("Enum");
- break;
- case TKIND_RECORD:
- type = rb_str_new2("Record");
- break;
- case TKIND_MODULE:
- type = rb_str_new2("Module");
- break;
- case TKIND_INTERFACE:
- type = rb_str_new2("Interface");
- break;
- case TKIND_DISPATCH:
- type = rb_str_new2("Dispatch");
- break;
- case TKIND_COCLASS:
- type = rb_str_new2("Class");
- break;
- case TKIND_ALIAS:
- type = rb_str_new2("Alias");
- break;
- case TKIND_UNION:
- type = rb_str_new2("Union");
- break;
- case TKIND_MAX:
- type = rb_str_new2("Max");
- break;
- default:
- type = Qnil;
- break;
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return type;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#ole_type #=> OLE type string.
- *
- * returns type of OLE class.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
- * puts tobj.ole_type # => Class
- */
-static VALUE
-foletype_ole_type(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_ole_type(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_guid(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- int len;
- OLECHAR bstr[80];
- VALUE guid = Qnil;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- return guid;
- len = StringFromGUID2(&pTypeAttr->guid, bstr, sizeof(bstr)/sizeof(OLECHAR));
- if (len > 3) {
- guid = ole_wc2vstr(bstr, FALSE);
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return guid;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#guid #=> GUID
- *
- * Returns GUID.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
- * puts tobj.guid # => {00024500-0000-0000-C000-000000000046}
- */
-static VALUE
-foletype_guid(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_guid(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_progid(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- OLECHAR *pbuf;
- VALUE progid = Qnil;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- return progid;
- hr = ProgIDFromCLSID(&pTypeAttr->guid, &pbuf);
- if (SUCCEEDED(hr)) {
- progid = ole_wc2vstr(pbuf, FALSE);
- CoTaskMemFree(pbuf);
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return progid;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#progid #=> ProgID
- *
- * Returns ProgID if it exists. If not found, then returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
- * puts tobj.progid # => Excel.Application.9
- */
-static VALUE
-foletype_progid(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_progid(ptype->pTypeInfo);
-}
-
-
-static VALUE
-ole_type_visible(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- VALUE visible;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- return Qtrue;
- if (pTypeAttr->wTypeFlags & (TYPEFLAG_FHIDDEN | TYPEFLAG_FRESTRICTED)) {
- visible = Qfalse;
- } else {
- visible = Qtrue;
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return visible;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#visible? #=> true or false
- *
- * Returns true if the OLE class is public.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
- * puts tobj.visible # => true
- */
-static VALUE
-foletype_visible(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_visible(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_major_version(ITypeInfo *pTypeInfo)
-{
- VALUE ver;
- TYPEATTR *pTypeAttr;
- HRESULT hr;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- ver = INT2FIX(pTypeAttr->wMajorVerNum);
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return ver;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#major_version
- *
- * Returns major version.
- * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents')
- * puts tobj.major_version # => 8
- */
-static VALUE
-foletype_major_version(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_major_version(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_minor_version(ITypeInfo *pTypeInfo)
-{
- VALUE ver;
- TYPEATTR *pTypeAttr;
- HRESULT hr;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- ver = INT2FIX(pTypeAttr->wMinorVerNum);
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return ver;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#minor_version #=> OLE minor version
- *
- * Returns minor version.
- * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents')
- * puts tobj.minor_version # => 2
- */
-static VALUE
-foletype_minor_version(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_minor_version(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_typekind(ITypeInfo *pTypeInfo)
-{
- VALUE typekind;
- TYPEATTR *pTypeAttr;
- HRESULT hr;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- typekind = INT2FIX(pTypeAttr->typekind);
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return typekind;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#typekind #=> number of type.
- *
- * Returns number which represents type.
- * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents')
- * puts tobj.typekind # => 4
- *
- */
-static VALUE
-foletype_typekind(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_typekind(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_helpstring(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- BSTR bhelpstr;
- hr = ole_docinfo_from_type(pTypeInfo, NULL, &bhelpstr, NULL, NULL);
- if(FAILED(hr)) {
- return Qnil;
- }
- return WC2VSTR(bhelpstr);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#helpstring #=> help string.
- *
- * Returns help string.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
- * puts tobj.helpstring # => Web Browser interface
- */
-static VALUE
-foletype_helpstring(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_helpstring(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_src_type(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- VALUE alias = Qnil;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- return alias;
- if(pTypeAttr->typekind != TKIND_ALIAS) {
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return alias;
- }
- alias = ole_typedesc2val(pTypeInfo, &(pTypeAttr->tdescAlias), Qnil);
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return alias;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#src_type #=> OLE source class
- *
- * Returns source class when the OLE class is 'Alias'.
- * tobj = WIN32OLE_TYPE.new('Microsoft Office 9.0 Object Library', 'MsoRGBType')
- * puts tobj.src_type # => I4
- *
- */
-static VALUE
-foletype_src_type(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_src_type(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_helpfile(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- BSTR bhelpfile;
- hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL, NULL, &bhelpfile);
- if(FAILED(hr)) {
- return Qnil;
- }
- return WC2VSTR(bhelpfile);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#helpfile
- *
- * Returns helpfile path. If helpfile is not found, then returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
- * puts tobj.helpfile # => C:\...\VBAXL9.CHM
- *
- */
-static VALUE
-foletype_helpfile(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_helpfile(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_helpcontext(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- DWORD helpcontext;
- hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL,
- &helpcontext, NULL);
- if(FAILED(hr))
- return Qnil;
- return INT2FIX(helpcontext);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#helpcontext
- *
- * Returns helpcontext. If helpcontext is not found, then returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
- * puts tobj.helpfile # => 131185
- */
-static VALUE
-foletype_helpcontext(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_helpcontext(ptype->pTypeInfo);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#ole_typelib
- *
- * Returns the WIN32OLE_TYPELIB object which is including the WIN32OLE_TYPE
- * object. If it is not found, then returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
- * puts tobj.ole_typelib # => 'Microsoft Excel 9.0 Object Library'
- */
-static VALUE
-foletype_ole_typelib(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_typelib_from_itypeinfo(ptype->pTypeInfo);
-}
-
-static VALUE
-ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags)
-{
- HRESULT hr;
- ITypeInfo *pRefTypeInfo;
- HREFTYPE href;
- WORD i;
- VALUE type;
- TYPEATTR *pTypeAttr;
- int flags;
-
- VALUE types = rb_ary_new();
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr)) {
- return types;
- }
- for (i = 0; i < pTypeAttr->cImplTypes; i++) {
- hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
- if (FAILED(hr))
- continue;
-
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo, i, &href);
- if (FAILED(hr))
- continue;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo);
- if (FAILED(hr))
- continue;
-
- if ((flags & implflags) == implflags) {
- type = ole_type_from_itypeinfo(pRefTypeInfo);
- if (type != Qnil) {
- rb_ary_push(types, type);
- }
- }
-
- OLE_RELEASE(pRefTypeInfo);
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return types;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#implemented_ole_types
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
- * p tobj.implemented_ole_types # => [_Worksheet, DocEvents]
- */
-static VALUE
-foletype_impl_ole_types(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, 0);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#source_ole_types
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object and having IMPLTYPEFLAG_FSOURCE.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
- * p tobj.source_ole_types
- * # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>, #<WIN32OLE_TYPE:DWebBrowserEvents>]
- */
-static VALUE
-foletype_source_ole_types(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, IMPLTYPEFLAG_FSOURCE);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#default_event_sources
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object and having IMPLTYPEFLAG_FSOURCE and IMPLTYPEFLAG_FDEFAULT.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
- * p tobj.default_event_sources # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>]
- */
-static VALUE
-foletype_default_event_sources(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#default_ole_types
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object and having IMPLTYPEFLAG_FDEFAULT.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
- * p tobj.default_ole_types
- * # => [#<WIN32OLE_TYPE:IWebBrowser2>, #<WIN32OLE_TYPE:DWebBrowserEvents2>]
- */
-static VALUE
-foletype_default_ole_types(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, IMPLTYPEFLAG_FDEFAULT);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#inspect -> String
- *
- * Returns the type name with class name.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ie.ole_type.inspect => #<WIN32OLE_TYPE:IWebBrowser2>
- */
-static VALUE
-foletype_inspect(VALUE self)
-{
- return default_inspect(self, "WIN32OLE_TYPE");
-}
-
-static VALUE
-ole_variables(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- TYPEATTR *pTypeAttr;
- WORD i;
- UINT len;
- BSTR bstr;
- VARDESC *pVarDesc;
- struct olevariabledata *pvar;
- VALUE var;
- VALUE variables = rb_ary_new();
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- }
-
- for(i = 0; i < pTypeAttr->cVars; i++) {
- hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, i, &pVarDesc);
- if(FAILED(hr))
- continue;
- len = 0;
- hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pVarDesc->memid, &bstr,
- 1, &len);
- if(FAILED(hr) || len == 0 || !bstr)
- continue;
-
- var = Data_Make_Struct(cWIN32OLE_VARIABLE, struct olevariabledata,
- 0,olevariable_free,pvar);
- pvar->pTypeInfo = pTypeInfo;
- OLE_ADDREF(pTypeInfo);
- pvar->index = i;
- rb_ivar_set(var, rb_intern("name"), WC2VSTR(bstr));
- rb_ary_push(variables, var);
-
- pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- pVarDesc = NULL;
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return variables;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#variables
- *
- * Returns array of WIN32OLE_VARIABLE objects which represent variables
- * defined in OLE class.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
- * vars = tobj.variables
- * vars.each do |v|
- * puts "#{v.name} = #{v.value}"
- * end
- *
- * The result of above sample script is follows:
- * xlChart = -4109
- * xlDialogSheet = -4116
- * xlExcel4IntlMacroSheet = 4
- * xlExcel4MacroSheet = 3
- * xlWorksheet = -4167
- *
- */
-static VALUE
-foletype_variables(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_variables(ptype->pTypeInfo);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#ole_methods # the array of WIN32OLE_METHOD objects.
- *
- * Returns array of WIN32OLE_METHOD objects which represent OLE method defined in
- * OLE type library.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
- * methods = tobj.ole_methods.collect{|m|
- * m.name
- * }
- * # => ['Activate', 'Copy', 'Delete',....]
- */
-static VALUE
-foletype_methods(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_methods_from_typeinfo(ptype->pTypeInfo, INVOKE_FUNC | INVOKE_PROPERTYGET | INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF);
-}
-
-/*
- * Document-class: WIN32OLE_VARIABLE
- *
- * <code>WIN32OLE_VARIABLE</code> objects represent OLE variable information.
- */
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#name
- *
- * Returns the name of variable.
- *
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
- * variables = tobj.variables
- * variables.each do |variable|
- * puts "#{variable.name}"
- * end
- *
- * The result of above script is following:
- * xlChart
- * xlDialogSheet
- * xlExcel4IntlMacroSheet
- * xlExcel4MacroSheet
- * xlWorksheet
- *
- */
-static VALUE
-folevariable_name(VALUE self)
-{
- return rb_ivar_get(self, rb_intern("name"));
-}
-
-static VALUE
-ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index)
-{
- VARDESC *pVarDesc;
HRESULT hr;
- VALUE type;
- hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetVarDesc");
- type = ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), Qnil);
- pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- return type;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#ole_type
- *
- * Returns OLE type string.
- *
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
- * variables = tobj.variables
- * variables.each do |variable|
- * puts "#{variable.ole_type} #{variable.name}"
- * end
- *
- * The result of above script is following:
- * INT xlChart
- * INT xlDialogSheet
- * INT xlExcel4IntlMacroSheet
- * INT xlExcel4MacroSheet
- * INT xlWorksheet
- *
- */
-static VALUE
-folevariable_ole_type(VALUE self)
-{
- struct olevariabledata *pvar;
- Data_Get_Struct(self, struct olevariabledata, pvar);
- return ole_variable_ole_type(pvar->pTypeInfo, pvar->index);
-}
-
-static VALUE
-ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index)
-{
- VARDESC *pVarDesc;
- HRESULT hr;
- VALUE type = rb_ary_new();
- hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetVarDesc");
- ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), type);
- pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- return type;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#ole_type_detail
- *
- * Returns detail information of type. The information is array of type.
- *
- * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library', 'D3DCLIPSTATUS')
- * variable = tobj.variables.find {|variable| variable.name == 'lFlags'}
- * tdetail = variable.ole_type_detail
- * p tdetail # => ["USERDEFINED", "CONST_D3DCLIPSTATUSFLAGS"]
- *
- */
-static VALUE
-folevariable_ole_type_detail(VALUE self)
-{
- struct olevariabledata *pvar;
- Data_Get_Struct(self, struct olevariabledata, pvar);
- return ole_variable_ole_type_detail(pvar->pTypeInfo, pvar->index);
-}
-
-static VALUE
-ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index)
-{
- VARDESC *pVarDesc;
- HRESULT hr;
- VALUE val = Qnil;
- hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
- if (FAILED(hr))
- return Qnil;
- if(pVarDesc->varkind == VAR_CONST)
- val = ole_variant2val(V_UNION1(pVarDesc, lpvarValue));
- pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- return val;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#value
- *
- * Returns value if value is exists. If the value does not exist,
- * this method returns nil.
- *
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
- * variables = tobj.variables
- * variables.each do |variable|
- * puts "#{variable.name} #{variable.value}"
- * end
- *
- * The result of above script is following:
- * xlChart = -4109
- * xlDialogSheet = -4116
- * xlExcel4IntlMacroSheet = 4
- * xlExcel4MacroSheet = 3
- * xlWorksheet = -4167
- *
- */
-static VALUE
-folevariable_value(VALUE self)
-{
- struct olevariabledata *pvar;
- Data_Get_Struct(self, struct olevariabledata, pvar);
- return ole_variable_value(pvar->pTypeInfo, pvar->index);
-}
-
-static VALUE
-ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index)
-{
- VARDESC *pVarDesc;
- HRESULT hr;
- VALUE visible = Qfalse;
- hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
- if (FAILED(hr))
- return visible;
- if (!(pVarDesc->wVarFlags & (VARFLAG_FHIDDEN |
- VARFLAG_FRESTRICTED |
- VARFLAG_FNONBROWSABLE))) {
- visible = Qtrue;
- }
- pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- return visible;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#visible?
- *
- * Returns true if the variable is public.
- *
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
- * variables = tobj.variables
- * variables.each do |variable|
- * puts "#{variable.name} #{variable.visible?}"
- * end
- *
- * The result of above script is following:
- * xlChart true
- * xlDialogSheet true
- * xlExcel4IntlMacroSheet true
- * xlExcel4MacroSheet true
- * xlWorksheet true
- *
- */
-static VALUE
-folevariable_visible(VALUE self)
-{
- struct olevariabledata *pvar;
- Data_Get_Struct(self, struct olevariabledata, pvar);
- return ole_variable_visible(pvar->pTypeInfo, pvar->index);
-}
-
-static VALUE
-ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index)
-{
- VARDESC *pVarDesc;
- HRESULT hr;
- VALUE kind = rb_str_new2("UNKNOWN");
- hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
- if (FAILED(hr))
- return kind;
- switch(pVarDesc->varkind) {
- case VAR_PERINSTANCE:
- kind = rb_str_new2("PERINSTANCE");
- break;
- case VAR_STATIC:
- kind = rb_str_new2("STATIC");
- break;
- case VAR_CONST:
- kind = rb_str_new2("CONSTANT");
- break;
- case VAR_DISPATCH:
- kind = rb_str_new2("DISPATCH");
- break;
- default:
- break;
- }
- pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- return kind;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#variable_kind
- *
- * Returns variable kind string.
- *
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
- * variables = tobj.variables
- * variables.each do |variable|
- * puts "#{variable.name} #{variable.variable_kind}"
- * end
- *
- * The result of above script is following:
- * xlChart CONSTANT
- * xlDialogSheet CONSTANT
- * xlExcel4IntlMacroSheet CONSTANT
- * xlExcel4MacroSheet CONSTANT
- * xlWorksheet CONSTANT
- */
-static VALUE
-folevariable_variable_kind(VALUE self)
-{
- struct olevariabledata *pvar;
- Data_Get_Struct(self, struct olevariabledata, pvar);
- return ole_variable_kind(pvar->pTypeInfo, pvar->index);
-}
-
-static VALUE
-ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index)
-{
- VARDESC *pVarDesc;
- HRESULT hr;
- VALUE kind = Qnil;
- hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
- if (FAILED(hr))
- return kind;
- pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- kind = INT2FIX(pVarDesc->varkind);
- return kind;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#varkind
- *
- * Returns the number which represents variable kind.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
- * variables = tobj.variables
- * variables.each do |variable|
- * puts "#{variable.name} #{variable.varkind}"
- * end
- *
- * The result of above script is following:
- * xlChart 2
- * xlDialogSheet 2
- * xlExcel4IntlMacroSheet 2
- * xlExcel4MacroSheet 2
- * xlWorksheet 2
- */
-static VALUE
-folevariable_varkind(VALUE self)
-{
- struct olevariabledata *pvar;
- Data_Get_Struct(self, struct olevariabledata, pvar);
- return ole_variable_varkind(pvar->pTypeInfo, pvar->index);
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIABLE#inspect -> String
- *
- * Returns the OLE variable name and the value with class name.
- *
- */
-static VALUE
-folevariable_inspect(VALUE self)
-{
- VALUE detail = rb_funcall(self, rb_intern("to_s"), 0);
- rb_str_cat2(detail, "=");
- rb_str_concat(detail, rb_funcall(rb_funcall(self, rb_intern("value"), 0), rb_intern("inspect"), 0));
- return make_inspect("WIN32OLE_VARIABLE", detail);
-}
-
-/*
- * Document-class: WIN32OLE_METHOD
- *
- * <code>WIN32OLE_METHOD</code> objects represent OLE method information.
- */
-
-static VALUE
-olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo, int index, VALUE name)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- pmethod->pTypeInfo = pTypeInfo;
- OLE_ADDREF(pTypeInfo);
- pmethod->pOwnerTypeInfo = pOwnerTypeInfo;
- if(pOwnerTypeInfo) OLE_ADDREF(pOwnerTypeInfo);
- pmethod->index = index;
- rb_ivar_set(self, rb_intern("name"), name);
- return self;
-}
-
-static VALUE
-folemethod_s_allocate(VALUE klass)
-{
- struct olemethoddata *pmethod;
- VALUE obj;
- obj = Data_Make_Struct(klass,
- struct olemethoddata,
- 0, olemethod_free, pmethod);
- pmethod->pTypeInfo = NULL;
- pmethod->pOwnerTypeInfo = NULL;
- pmethod->index = 0;
- return obj;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD.new(ole_type, method) -> WIN32OLE_METHOD object
- *
- * Returns a new WIN32OLE_METHOD object which represents the information
- * about OLE method.
- * The first argument <i>ole_type</i> specifies WIN32OLE_TYPE object.
- * The second argument <i>method</i> specifies OLE method name defined OLE class
- * which represents WIN32OLE_TYPE object.
- *
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- */
-static VALUE
-folemethod_initialize(VALUE self, VALUE oletype, VALUE method)
-{
- struct oletypedata *ptype;
- VALUE obj = Qnil;
- if (rb_obj_is_kind_of(oletype, cWIN32OLE_TYPE)) {
- SafeStringValue(method);
- Data_Get_Struct(oletype, struct oletypedata, ptype);
- obj = olemethod_from_typeinfo(self, ptype->pTypeInfo, method);
- if (obj == Qnil) {
- rb_raise(eWIN32OLERuntimeError, "not found %s",
- StringValuePtr(method));
- }
- }
- else {
- rb_raise(rb_eTypeError, "1st argument should be WIN32OLE_TYPE object");
- }
- return obj;
-}
-
-/*
- * call-seq
- * WIN32OLE_METHOD#name
- *
- * Returns the name of the method.
- *
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * puts method.name # => SaveAs
- *
- */
-static VALUE
-folemethod_name(VALUE self)
-{
- return rb_ivar_get(self, rb_intern("name"));
-}
-
-static VALUE
-ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE type;
-
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
-
- type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return type;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#return_type
- *
- * Returns string of return value type of method.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.return_type # => Workbook
- *
- */
-static VALUE
-folemethod_return_type(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_return_type(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE vvt;
-
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
-
- vvt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return vvt;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#return_vtype
- *
- * Returns number of return value type of method.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.return_vtype # => 26
- *
- */
-static VALUE
-folemethod_return_vtype(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_return_vtype(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE type = rb_ary_new();
-
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return type;
-
- ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), type);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return type;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#return_type_detail
- *
- * Returns detail information of return value type of method.
- * The information is array.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * p method.return_type_detail # => ["PTR", "USERDEFINED", "Workbook"]
- */
-static VALUE
-folemethod_return_type_detail(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_return_type_detail(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE invkind;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if(FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
- invkind = INT2FIX(pFuncDesc->invkind);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return invkind;
-}
-
-static VALUE
-ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index)
-{
- VALUE type = rb_str_new2("UNKNOWN");
- VALUE invkind = ole_method_invkind(pTypeInfo, method_index);
- if((FIX2INT(invkind) & INVOKE_PROPERTYGET) &&
- (FIX2INT(invkind) & INVOKE_PROPERTYPUT) ) {
- type = rb_str_new2("PROPERTY");
- } else if(FIX2INT(invkind) & INVOKE_PROPERTYGET) {
- type = rb_str_new2("PROPERTYGET");
- } else if(FIX2INT(invkind) & INVOKE_PROPERTYPUT) {
- type = rb_str_new2("PROPERTYPUT");
- } else if(FIX2INT(invkind) & INVOKE_PROPERTYPUTREF) {
- type = rb_str_new2("PROPERTYPUTREF");
- } else if(FIX2INT(invkind) & INVOKE_FUNC) {
- type = rb_str_new2("FUNC");
- }
- return type;
-}
-
-/*
- * call-seq:
- * WIN32OLE_MTHOD#invkind
- *
- * Returns the method invoke kind.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.invkind # => 1
- *
- */
-static VALUE
-folemethod_invkind(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_invkind(pmethod->pTypeInfo, pmethod->index);
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#invoke_kind
- *
- * Returns the method kind string. The string is "UNKNOWN" or "PROPERTY"
- * or "PROPERTY" or "PROPERTYGET" or "PROPERTYPUT" or "PROPERTYPPUTREF"
- * or "FUNC".
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.invoke_kind # => "FUNC"
- */
-static VALUE
-folemethod_invoke_kind(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_invoke_kind(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE visible;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if(FAILED(hr))
- return Qfalse;
- if (pFuncDesc->wFuncFlags & (FUNCFLAG_FRESTRICTED |
- FUNCFLAG_FHIDDEN |
- FUNCFLAG_FNONBROWSABLE)) {
- visible = Qfalse;
- } else {
- visible = Qtrue;
- }
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return visible;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#visible?
- *
- * Returns true if the method is public.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.visible? # => true
- */
-static VALUE
-folemethod_visible(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_visible(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name)
-{
- TYPEATTR *pTypeAttr;
- HRESULT hr;
- WORD i;
- int flags;
- HREFTYPE href;
- ITypeInfo *pRefTypeInfo;
- FUNCDESC *pFuncDesc;
- BSTR bstr;
- VALUE name;
- VALUE event = Qfalse;
-
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr))
- return event;
- if(pTypeAttr->typekind != TKIND_COCLASS) {
- pTypeInfo->lpVtbl->ReleaseTypeAttr(pTypeInfo, pTypeAttr);
- return event;
- }
- for (i = 0; i < pTypeAttr->cImplTypes; i++) {
- hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
- if (FAILED(hr))
- continue;
-
- if (flags & IMPLTYPEFLAG_FSOURCE) {
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
- i, &href);
- if (FAILED(hr))
- continue;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
- href, &pRefTypeInfo);
- if (FAILED(hr))
- continue;
- hr = pRefTypeInfo->lpVtbl->GetFuncDesc(pRefTypeInfo, method_index,
- &pFuncDesc);
- if (FAILED(hr)) {
- OLE_RELEASE(pRefTypeInfo);
- continue;
- }
-
- hr = pRefTypeInfo->lpVtbl->GetDocumentation(pRefTypeInfo,
- pFuncDesc->memid,
- &bstr, NULL, NULL, NULL);
- if (FAILED(hr)) {
- pRefTypeInfo->lpVtbl->ReleaseFuncDesc(pRefTypeInfo, pFuncDesc);
- OLE_RELEASE(pRefTypeInfo);
- continue;
- }
-
- name = WC2VSTR(bstr);
- pRefTypeInfo->lpVtbl->ReleaseFuncDesc(pRefTypeInfo, pFuncDesc);
- OLE_RELEASE(pRefTypeInfo);
- if (rb_str_cmp(method_name, name) == 0) {
- event = Qtrue;
- break;
- }
- }
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return event;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#event?
- *
- * Returns true if the method is event.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
- * puts method.event? # => true
- *
- */
-static VALUE
-folemethod_event(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- if (!pmethod->pOwnerTypeInfo)
- return Qfalse;
- return ole_method_event(pmethod->pOwnerTypeInfo,
- pmethod->index,
- rb_ivar_get(self, rb_intern("name")));
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#event_interface
- *
- * Returns event interface name if the method is event.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
- * puts method.event_interface # => WorkbookEvents
- */
-static VALUE
-folemethod_event_interface(VALUE self)
-{
- BSTR name;
- struct olemethoddata *pmethod;
- HRESULT hr;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- if(folemethod_event(self) == Qtrue) {
- hr = ole_docinfo_from_type(pmethod->pTypeInfo, &name, NULL, NULL, NULL);
- if(SUCCEEDED(hr))
- return WC2VSTR(name);
- }
- return Qnil;
-}
-
-static HRESULT
-ole_method_docinfo_from_type(
- ITypeInfo *pTypeInfo,
- UINT method_index,
- BSTR *name,
- BSTR *helpstr,
- DWORD *helpcontext,
- BSTR *helpfile
- )
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return hr;
- hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, pFuncDesc->memid,
- name, helpstr,
- helpcontext, helpfile);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return hr;
-}
-
-static VALUE
-ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index)
-{
- HRESULT hr;
- BSTR bhelpstring;
- hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, &bhelpstring,
- NULL, NULL);
- if (FAILED(hr))
- return Qnil;
- return WC2VSTR(bhelpstring);
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#helpstring
- *
- * Returns help string of OLE method. If the help string is not found,
- * then the method returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
- * method = WIN32OLE_METHOD.new(tobj, 'Navigate')
- * puts method.helpstring # => Navigates to a URL or file.
- *
- */
-static VALUE
-folemethod_helpstring(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_helpstring(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index)
-{
- HRESULT hr;
- BSTR bhelpfile;
- hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, NULL,
- NULL, &bhelpfile);
- if (FAILED(hr))
- return Qnil;
- return WC2VSTR(bhelpfile);
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#helpfile
- *
- * Returns help file. If help file is not found, then
- * the method returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.helpfile # => C:\...\VBAXL9.CHM
- */
-static VALUE
-folemethod_helpfile(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
-
- return ole_method_helpfile(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index)
-{
- HRESULT hr;
- DWORD helpcontext = 0;
- hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, NULL,
- &helpcontext, NULL);
- if (FAILED(hr))
- return Qnil;
- return INT2FIX(helpcontext);
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#helpcontext
- *
- * Returns help context.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.helpcontext # => 65717
- */
-static VALUE
-folemethod_helpcontext(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_helpcontext(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE dispid = Qnil;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return dispid;
- dispid = INT2NUM(pFuncDesc->memid);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return dispid;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#dispid
- *
- * Returns dispatch ID.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.dispid # => 181
- */
-static VALUE
-folemethod_dispid(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_dispid(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE offset_vtbl = Qnil;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return offset_vtbl;
- offset_vtbl = INT2FIX(pFuncDesc->oVft);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return offset_vtbl;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#offset_vtbl
- *
- * Returns the offset ov VTBL.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
- * method = WIN32OLE_METHOD.new(tobj, 'Add')
- * puts method.offset_vtbl # => 40
- */
-static VALUE
-folemethod_offset_vtbl(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_offset_vtbl(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE size_params = Qnil;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return size_params;
- size_params = INT2FIX(pFuncDesc->cParams);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return size_params;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#size_params
- *
- * Returns the size of arguments of the method.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * puts method.size_params # => 11
- *
- */
-static VALUE
-folemethod_size_params(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_size_params(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE size_opt_params = Qnil;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return size_opt_params;
- size_opt_params = INT2FIX(pFuncDesc->cParamsOpt);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return size_opt_params;
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#size_opt_params
- *
- * Returns the size of optional parameters.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * puts method.size_opt_params # => 4
- */
-static VALUE
-folemethod_size_opt_params(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_size_opt_params(pmethod->pTypeInfo, pmethod->index);
-}
-
-static VALUE
-ole_method_params(ITypeInfo *pTypeInfo, UINT method_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- BSTR *bstrs;
- UINT len, i;
- struct oleparamdata *pparam;
- VALUE param;
- VALUE params = rb_ary_new();
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return params;
-
- len = 0;
- bstrs = ALLOCA_N(BSTR, pFuncDesc->cParams + 1);
- hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pFuncDesc->memid,
- bstrs, pFuncDesc->cParams + 1,
- &len);
- if (FAILED(hr)) {
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return params;
- }
- SysFreeString(bstrs[0]);
- if (pFuncDesc->cParams > 0) {
- for(i = 1; i < len; i++) {
- param = Data_Make_Struct(cWIN32OLE_PARAM, struct oleparamdata, 0,
- oleparam_free, pparam);
- pparam->pTypeInfo = pTypeInfo;
- OLE_ADDREF(pTypeInfo);
- pparam->method_index = method_index;
- pparam->index = i - 1;
- rb_ivar_set(param, rb_intern("name"), WC2VSTR(bstrs[i]));
- rb_ary_push(params, param);
- }
- }
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return params;
-}
-
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#params
- *
- * returns array of WIN32OLE_PARAM object corresponding with method parameters.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * p method.params # => [Filename, FileFormat, Password, WriteResPassword,
- * ReadOnlyRecommended, CreateBackup, AccessMode,
- * ConflictResolution, AddToMru, TextCodepage,
- * TextVisualLayout]
- */
-static VALUE
-folemethod_params(VALUE self)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(self, struct olemethoddata, pmethod);
- return ole_method_params(pmethod->pTypeInfo, pmethod->index);
-}
-
-/*
- * call-seq:
- * WIN32OLE_METHOD#inspect -> String
- *
- * Returns the method name with class name.
- *
- */
-static VALUE
-folemethod_inspect(VALUE self)
-{
- return default_inspect(self, "WIN32OLE_METHOD");
-}
-
-/*
- * Document-class: WIN32OLE_PARAM
- *
- * <code>WIN32OLE_PARAM</code> objects represent param information of
- * the OLE method.
- */
-static VALUE foleparam_s_allocate(VALUE klass)
-{
- struct oleparamdata *pparam;
- VALUE obj;
- obj = Data_Make_Struct(klass,
- struct oleparamdata,
- 0, oleparam_free, pparam);
- pparam->pTypeInfo = NULL;
- pparam->method_index = 0;
- pparam->index = 0;
- return obj;
-}
-
-static VALUE
-oleparam_ole_param_from_index(VALUE self, ITypeInfo *pTypeInfo, UINT method_index, int param_index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- BSTR *bstrs;
- UINT len;
- struct oleparamdata *pparam;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- ole_raise(hr, rb_eRuntimeError, "fail to ITypeInfo::GetFuncDesc");
-
- len = 0;
- bstrs = ALLOCA_N(BSTR, pFuncDesc->cParams + 1);
- hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pFuncDesc->memid,
- bstrs, pFuncDesc->cParams + 1,
- &len);
- if (FAILED(hr)) {
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- ole_raise(hr, rb_eRuntimeError, "fail to ITypeInfo::GetNames");
- }
- SysFreeString(bstrs[0]);
- if (param_index < 1 || len <= (UINT)param_index)
- {
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- rb_raise(rb_eIndexError, "index of param must be in 1..%d", len);
- }
-
- Data_Get_Struct(self, struct oleparamdata, pparam);
- pparam->pTypeInfo = pTypeInfo;
- OLE_ADDREF(pTypeInfo);
- pparam->method_index = method_index;
- pparam->index = param_index - 1;
- rb_ivar_set(self, rb_intern("name"), WC2VSTR(bstrs[param_index]));
-
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return self;
-}
-
-static VALUE oleparam_ole_param(VALUE self, VALUE olemethod, int n)
-{
- struct olemethoddata *pmethod;
- Data_Get_Struct(olemethod, struct olemethoddata, pmethod);
- return oleparam_ole_param_from_index(self, pmethod->pTypeInfo, pmethod->index, n);
-}
-
-static VALUE foleparam_initialize(VALUE self, VALUE olemethod, VALUE n)
-{
- int idx;
- if (!rb_obj_is_kind_of(olemethod, cWIN32OLE_METHOD)) {
- rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE_METHOD object");
- }
- idx = FIX2INT(n);
- return oleparam_ole_param(self, olemethod, idx);
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#name
- *
- * Returns name.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * param1 = method.params[0]
- * puts param1.name # => Filename
- */
-static VALUE
-foleparam_name(VALUE self)
-{
- return rb_ivar_get(self, rb_intern("name"));
-}
-
-static VALUE
-ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE type = rb_str_new2("unknown type");
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return type;
- type = ole_typedesc2val(pTypeInfo,
- &(pFuncDesc->lprgelemdescParam[index].tdesc), Qnil);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return type;
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#ole_type
- *
- * Returns OLE type of WIN32OLE_PARAM object(parameter of OLE method).
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * param1 = method.params[0]
- * puts param1.ole_type # => VARIANT
- */
-static VALUE
-foleparam_ole_type(VALUE self)
-{
- struct oleparamdata *pparam;
- Data_Get_Struct(self, struct oleparamdata, pparam);
- return ole_param_ole_type(pparam->pTypeInfo, pparam->method_index,
- pparam->index);
-}
-
-static VALUE
-ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE typedetail = rb_ary_new();
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return typedetail;
- ole_typedesc2val(pTypeInfo,
- &(pFuncDesc->lprgelemdescParam[index].tdesc), typedetail);
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return typedetail;
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#ole_type_detail
- *
- * Returns detail information of type of argument.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'IWorksheetFunction')
- * method = WIN32OLE_METHOD.new(tobj, 'SumIf')
- * param1 = method.params[0]
- * p param1.ole_type_detail # => ["PTR", "USERDEFINED", "Range"]
- */
-static VALUE
-foleparam_ole_type_detail(VALUE self)
-{
- struct oleparamdata *pparam;
- Data_Get_Struct(self, struct oleparamdata, pparam);
- return ole_param_ole_type_detail(pparam->pTypeInfo, pparam->method_index,
- pparam->index);
-}
-
-static VALUE
-ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT mask)
-{
- FUNCDESC *pFuncDesc;
- HRESULT hr;
- VALUE ret = Qfalse;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if(FAILED(hr))
- return ret;
- if (V_UNION1((&(pFuncDesc->lprgelemdescParam[index])), paramdesc).wParamFlags &mask)
- ret = Qtrue;
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return ret;
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#input?
- *
- * Returns true if the parameter is input.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * param1 = method.params[0]
- * puts param1.input? # => true
- */
-static VALUE foleparam_input(VALUE self)
-{
- struct oleparamdata *pparam;
- Data_Get_Struct(self, struct oleparamdata, pparam);
- return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
- pparam->index, PARAMFLAG_FIN);
-}
-
-/*
- * call-seq:
- * WIN32OLE#output?
- *
- * Returns true if argument is output.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'DWebBrowserEvents')
- * method = WIN32OLE_METHOD.new(tobj, 'NewWindow')
- * method.params.each do |param|
- * puts "#{param.name} #{param.output?}"
- * end
- *
- * The result of above script is following:
- * URL false
- * Flags false
- * TargetFrameName false
- * PostData false
- * Headers false
- * Processed true
- */
-static VALUE foleparam_output(VALUE self)
-{
- struct oleparamdata *pparam;
- Data_Get_Struct(self, struct oleparamdata, pparam);
- return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
- pparam->index, PARAMFLAG_FOUT);
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#optional?
- *
- * Returns true if argument is optional.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * param1 = method.params[0]
- * puts "#{param1.name} #{param1.optional?}" # => Filename true
- */
-static VALUE foleparam_optional(VALUE self)
-{
- struct oleparamdata *pparam;
- Data_Get_Struct(self, struct oleparamdata, pparam);
- return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
- pparam->index, PARAMFLAG_FOPT);
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#retval?
- *
- * Returns true if argument is return value.
- * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library',
- * 'DirectPlayLobbyConnection')
- * method = WIN32OLE_METHOD.new(tobj, 'GetPlayerShortName')
- * param = method.params[0]
- * puts "#{param.name} #{param.retval?}" # => name true
- */
-static VALUE foleparam_retval(VALUE self)
-{
- struct oleparamdata *pparam;
- Data_Get_Struct(self, struct oleparamdata, pparam);
- return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
- pparam->index, PARAMFLAG_FRETVAL);
-}
-
-static VALUE
-ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
-{
- FUNCDESC *pFuncDesc;
- ELEMDESC *pElemDesc;
- PARAMDESCEX * pParamDescEx;
- HRESULT hr;
- USHORT wParamFlags;
- USHORT mask = PARAMFLAG_FOPT|PARAMFLAG_FHASDEFAULT;
- VALUE defval = Qnil;
- hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
- if (FAILED(hr))
- return defval;
- pElemDesc = &pFuncDesc->lprgelemdescParam[index];
- wParamFlags = V_UNION1(pElemDesc, paramdesc).wParamFlags;
- if ((wParamFlags & mask) == mask) {
- pParamDescEx = V_UNION1(pElemDesc, paramdesc).pparamdescex;
- defval = ole_variant2val(&pParamDescEx->varDefaultValue);
- }
- pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return defval;
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#default
- *
- * Returns default value. If the default value does not exist,
- * this method returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
- * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
- * method.params.each do |param|
- * if param.default
- * puts "#{param.name} (= #{param.default})"
- * else
- * puts "#{param}"
- * end
- * end
- *
- * The above script result is following:
- * Filename
- * FileFormat
- * Password
- * WriteResPassword
- * ReadOnlyRecommended
- * CreateBackup
- * AccessMode (= 1)
- * ConflictResolution
- * AddToMru
- * TextCodepage
- * TextVisualLayout
- */
-static VALUE foleparam_default(VALUE self)
-{
- struct oleparamdata *pparam;
- Data_Get_Struct(self, struct oleparamdata, pparam);
- return ole_param_default(pparam->pTypeInfo, pparam->method_index,
- pparam->index);
-}
-
-/*
- * call-seq:
- * WIN32OLE_PARAM#inspect -> String
- *
- * Returns the parameter name with class name. If the parameter has default value,
- * then returns name=value string with class name.
- *
- */
-static VALUE
-foleparam_inspect(VALUE self)
-{
- VALUE detail = foleparam_name(self);
- VALUE defval = foleparam_default(self);
- if (defval != Qnil) {
- rb_str_cat2(detail, "=");
- rb_str_concat(detail, rb_funcall(defval, rb_intern("inspect"), 0));
- }
- return make_inspect("WIN32OLE_PARAM", detail);
-}
-
-/*
- * Document-class: WIN32OLE_EVENT
- *
- * <code>WIN32OLE_EVENT</code> objects controls OLE event.
- */
-
-static IEventSinkVtbl vtEventSink;
-static BOOL g_IsEventSinkVtblInitialized = FALSE;
-
-void EVENTSINK_Destructor(PIEVENTSINKOBJ);
-
-STDMETHODIMP
-EVENTSINK_QueryInterface(
- PEVENTSINK pEV,
- REFIID iid,
- LPVOID* ppv
- ) {
- if (IsEqualIID(iid, &IID_IUnknown) ||
- IsEqualIID(iid, &IID_IDispatch) ||
- IsEqualIID(iid, &((PIEVENTSINKOBJ)pEV)->m_iid)) {
- *ppv = pEV;
- }
- else {
- *ppv = NULL;
- return E_NOINTERFACE;
- }
- ((LPUNKNOWN)*ppv)->lpVtbl->AddRef((LPUNKNOWN)*ppv);
- return NOERROR;
-}
-
-STDMETHODIMP_(ULONG)
-EVENTSINK_AddRef(
- PEVENTSINK pEV
- ){
- PIEVENTSINKOBJ pEVObj = (PIEVENTSINKOBJ)pEV;
- return ++pEVObj->m_cRef;
-}
-
-STDMETHODIMP_(ULONG) EVENTSINK_Release(
- PEVENTSINK pEV
- ) {
- PIEVENTSINKOBJ pEVObj = (PIEVENTSINKOBJ)pEV;
- --pEVObj->m_cRef;
- if(pEVObj->m_cRef != 0)
- return pEVObj->m_cRef;
- EVENTSINK_Destructor(pEVObj);
- return 0;
-}
-
-STDMETHODIMP EVENTSINK_GetTypeInfoCount(
- PEVENTSINK pEV,
- UINT *pct
- ) {
- *pct = 0;
- return NOERROR;
-}
-
-STDMETHODIMP EVENTSINK_GetTypeInfo(
- PEVENTSINK pEV,
- UINT info,
- LCID lcid,
- ITypeInfo **pInfo
- ) {
- *pInfo = NULL;
- return DISP_E_BADINDEX;
-}
-
-STDMETHODIMP EVENTSINK_GetIDsOfNames(
- PEVENTSINK pEventSink,
- REFIID riid,
- OLECHAR **szNames,
- UINT cNames,
- LCID lcid,
- DISPID *pDispID
- ) {
- ITypeInfo *pTypeInfo;
- PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
- pTypeInfo = pEV->pTypeInfo;
- if (pTypeInfo) {
- return pTypeInfo->lpVtbl->GetIDsOfNames(pTypeInfo, szNames, cNames, pDispID);
- }
- return DISP_E_UNKNOWNNAME;
-}
-
-static long
-ole_search_event_at(VALUE ary, VALUE ev)
-{
- VALUE event;
- VALUE event_name;
- long i, len;
- long ret = -1;
- len = RARRAY_LEN(ary);
- for(i = 0; i < len; i++) {
- event = rb_ary_entry(ary, i);
- event_name = rb_ary_entry(event, 1);
- if(NIL_P(event_name) && NIL_P(ev)) {
- ret = i;
- break;
- }
- else if (TYPE(ev) == T_STRING &&
- TYPE(event_name) == T_STRING &&
- rb_str_cmp(ev, event_name) == 0) {
- ret = i;
- break;
- }
- }
- return ret;
-}
-
-static VALUE
-ole_search_event(VALUE ary, VALUE ev, BOOL *is_default)
-{
- VALUE event;
- VALUE def_event;
- VALUE event_name;
- int i, len;
- *is_default = FALSE;
- def_event = Qnil;
- len = RARRAY_LEN(ary);
- for(i = 0; i < len; i++) {
- event = rb_ary_entry(ary, i);
- event_name = rb_ary_entry(event, 1);
- if(NIL_P(event_name)) {
- *is_default = TRUE;
- def_event = event;
- }
- else if (rb_str_cmp(ev, event_name) == 0) {
- *is_default = FALSE;
- return event;
- }
- }
- return def_event;
-}
-static VALUE
-ole_search_handler_method(VALUE handler, VALUE ev, BOOL *is_default_handler)
-{
- VALUE mid;
-
- *is_default_handler = FALSE;
- mid = rb_to_id(rb_sprintf("on%s", StringValuePtr(ev)));
- if (rb_respond_to(handler, mid)) {
- return mid;
- }
- mid = rb_intern("method_missing");
- if (rb_respond_to(handler, mid)) {
- *is_default_handler = TRUE;
- return mid;
- }
- return Qnil;
-}
-
-static void
-ole_delete_event(VALUE ary, VALUE ev)
-{
- long at = -1;
- at = ole_search_event_at(ary, ev);
- if (at >= 0) {
- rb_ary_delete_at(ary, at);
- }
-}
-
-static void
-hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams)
-{
- BSTR *bstrs;
- HRESULT hr;
- UINT len, i;
- VARIANT *pvar;
- VALUE val;
- VALUE key;
- len = 0;
- bstrs = ALLOCA_N(BSTR, pdispparams->cArgs + 1);
- hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, dispid,
- bstrs, pdispparams->cArgs + 1,
- &len);
- if (FAILED(hr))
- return;
-
- for (i = 0; i < len - 1; i++) {
- key = WC2VSTR(bstrs[i + 1]);
- val = rb_hash_aref(hash, INT2FIX(i));
- if (val == Qnil)
- val = rb_hash_aref(hash, key);
- if (val == Qnil)
- val = rb_hash_aref(hash, rb_str_intern(key));
- pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
- ole_val2ptr_variant(val, pvar);
- }
-}
-
-static VALUE
-hash2result(VALUE hash)
-{
- VALUE ret = Qnil;
- ret = rb_hash_aref(hash, rb_str_new2("return"));
- if (ret == Qnil)
- ret = rb_hash_aref(hash, rb_str_intern(rb_str_new2("return")));
- return ret;
-}
-
-static void
-ary2ptr_dispparams(VALUE ary, DISPPARAMS *pdispparams)
-{
- int i;
- VALUE v;
- VARIANT *pvar;
- for(i = 0; i < RARRAY_LEN(ary) && (unsigned int) i < pdispparams->cArgs; i++) {
- v = rb_ary_entry(ary, i);
- pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
- ole_val2ptr_variant(v, pvar);
- }
-}
-
-static VALUE
-exec_callback(VALUE arg)
-{
- VALUE *parg = (VALUE *)arg;
- VALUE handler = parg[0];
- VALUE mid = parg[1];
- VALUE args = parg[2];
- return rb_apply(handler, mid, args);
-}
-
-static VALUE
-rescue_callback(VALUE arg)
-{
-
- VALUE error;
- VALUE e = rb_errinfo();
- VALUE bt = rb_funcall(e, rb_intern("backtrace"), 0);
- VALUE msg = rb_funcall(e, rb_intern("message"), 0);
- bt = rb_ary_entry(bt, 0);
- error = rb_sprintf("%s: %s (%s)\n", StringValuePtr(bt), StringValuePtr(msg), rb_obj_classname(e));
- rb_write_error(StringValuePtr(error));
- rb_backtrace();
- ruby_finalize();
- exit(-1);
-
- return Qnil;
-}
-
-STDMETHODIMP EVENTSINK_Invoke(
- PEVENTSINK pEventSink,
- DISPID dispid,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- DISPPARAMS *pdispparams,
- VARIANT *pvarResult,
- EXCEPINFO *pexcepinfo,
- UINT *puArgErr
- ) {
-
- HRESULT hr;
- BSTR bstr;
- unsigned int count;
- unsigned int i;
- ITypeInfo *pTypeInfo;
- VARIANT *pvar;
- VALUE ary, obj, event, args, outargv, ev, result;
- VALUE handler = Qnil;
- VALUE arg[3];
- VALUE mid;
- VALUE is_outarg = Qfalse;
- BOOL is_default_handler = FALSE;
- int state;
-
- PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
- pTypeInfo = pEV->pTypeInfo;
- obj = evs_entry(pEV->m_event_id);
- if (!rb_obj_is_kind_of(obj, cWIN32OLE_EVENT)) {
- return NOERROR;
- }
-
- ary = rb_ivar_get(obj, id_events);
- if (NIL_P(ary) || TYPE(ary) != T_ARRAY) {
- return NOERROR;
- }
- hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, dispid,
- &bstr, 1, &count);
- if (FAILED(hr)) {
- return NOERROR;
- }
- ev = WC2VSTR(bstr);
- event = ole_search_event(ary, ev, &is_default_handler);
- if (TYPE(event) == T_ARRAY) {
- handler = rb_ary_entry(event, 0);
- mid = rb_intern("call");
- is_outarg = rb_ary_entry(event, 3);
- } else {
- handler = rb_ivar_get(obj, rb_intern("handler"));
- if (handler == Qnil) {
- return NOERROR;
- }
- mid = ole_search_handler_method(handler, ev, &is_default_handler);
- }
- if (handler == Qnil || mid == Qnil) {
- return NOERROR;
- }
-
- args = rb_ary_new();
- if (is_default_handler) {
- rb_ary_push(args, ev);
- }
-
- /* make argument of event handler */
- for (i = 0; i < pdispparams->cArgs; ++i) {
- pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
- rb_ary_push(args, ole_variant2val(pvar));
- }
- outargv = Qnil;
- if (is_outarg == Qtrue) {
- outargv = rb_ary_new();
- rb_ary_push(args, outargv);
- }
-
- /*
- * if exception raised in event callback,
- * then you receive cfp consistency error.
- * to avoid this error we use begin rescue end.
- * and the exception raised then error message print
- * and exit ruby process by Win32OLE itself.
- */
- arg[0] = handler;
- arg[1] = mid;
- arg[2] = args;
- result = rb_protect(exec_callback, (VALUE)arg, &state);
- if (state != 0) {
- rescue_callback(Qnil);
- }
- if(TYPE(result) == T_HASH) {
- hash2ptr_dispparams(result, pTypeInfo, dispid, pdispparams);
- result = hash2result(result);
- }else if (is_outarg == Qtrue && TYPE(outargv) == T_ARRAY) {
- ary2ptr_dispparams(outargv, pdispparams);
- }
-
- if (pvarResult) {
- VariantInit(pvarResult);
- ole_val2variant(result, pvarResult);
- }
-
- return NOERROR;
-}
-
-PIEVENTSINKOBJ
-EVENTSINK_Constructor() {
- PIEVENTSINKOBJ pEv;
- if (!g_IsEventSinkVtblInitialized) {
- vtEventSink.QueryInterface=EVENTSINK_QueryInterface;
- vtEventSink.AddRef = EVENTSINK_AddRef;
- vtEventSink.Release = EVENTSINK_Release;
- vtEventSink.Invoke = EVENTSINK_Invoke;
- vtEventSink.GetIDsOfNames = EVENTSINK_GetIDsOfNames;
- vtEventSink.GetTypeInfoCount = EVENTSINK_GetTypeInfoCount;
- vtEventSink.GetTypeInfo = EVENTSINK_GetTypeInfo;
-
- g_IsEventSinkVtblInitialized = TRUE;
- }
- pEv = ALLOC_N(IEVENTSINKOBJ, 1);
- if(pEv == NULL) return NULL;
- pEv->lpVtbl = &vtEventSink;
- pEv->m_cRef = 0;
- pEv->m_event_id = 0;
- pEv->pTypeInfo = NULL;
- return pEv;
-}
-
-void EVENTSINK_Destructor(
- PIEVENTSINKOBJ pEVObj
- ) {
- if(pEVObj != NULL) {
- OLE_RELEASE(pEVObj->pTypeInfo);
- free(pEVObj);
- pEVObj = NULL;
- }
-}
-
-static HRESULT
-find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
-{
- HRESULT hr;
- IDispatch *pDispatch;
- ITypeInfo *pTypeInfo;
- ITypeLib *pTypeLib;
- TYPEATTR *pTypeAttr;
- HREFTYPE RefType;
- ITypeInfo *pImplTypeInfo;
- TYPEATTR *pImplTypeAttr;
-
- struct oledata *pole;
+ struct oledata *pole = NULL;
unsigned int index;
- unsigned int count;
- int type;
- BSTR bstr;
- char *pstr;
-
- BOOL is_found = FALSE;
- LCID lcid = cWIN32OLE_lcid;
-
- OLEData_Get_Struct(ole, pole);
-
- pDispatch = pole->pDispatch;
-
- hr = pDispatch->lpVtbl->GetTypeInfo(pDispatch, 0, lcid, &pTypeInfo);
- if (FAILED(hr))
- return hr;
-
- hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo,
- &pTypeLib,
- &index);
- OLE_RELEASE(pTypeInfo);
- if (FAILED(hr))
- return hr;
-
- if (!pitf) {
- hr = pTypeLib->lpVtbl->GetTypeInfoOfGuid(pTypeLib,
- piid,
- ppTypeInfo);
- OLE_RELEASE(pTypeLib);
- return hr;
- }
- count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
- for (index = 0; index < count; index++) {
- hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib,
- index,
- &pTypeInfo);
- if (FAILED(hr))
- break;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
-
- if(FAILED(hr)) {
- OLE_RELEASE(pTypeInfo);
- break;
- }
- if(pTypeAttr->typekind == TKIND_COCLASS) {
- for (type = 0; type < pTypeAttr->cImplTypes; type++) {
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
- type,
- &RefType);
- if (FAILED(hr))
- break;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
- RefType,
- &pImplTypeInfo);
- if (FAILED(hr))
- break;
-
- hr = pImplTypeInfo->lpVtbl->GetDocumentation(pImplTypeInfo,
- -1,
- &bstr,
- NULL, NULL, NULL);
- if (FAILED(hr)) {
- OLE_RELEASE(pImplTypeInfo);
- break;
- }
- pstr = ole_wc2mb(bstr);
- if (strcmp(pitf, pstr) == 0) {
- hr = pImplTypeInfo->lpVtbl->GetTypeAttr(pImplTypeInfo,
- &pImplTypeAttr);
- if (SUCCEEDED(hr)) {
- is_found = TRUE;
- *piid = pImplTypeAttr->guid;
- if (ppTypeInfo) {
- *ppTypeInfo = pImplTypeInfo;
- (*ppTypeInfo)->lpVtbl->AddRef((*ppTypeInfo));
- }
- pImplTypeInfo->lpVtbl->ReleaseTypeAttr(pImplTypeInfo,
- pImplTypeAttr);
- }
- }
- free(pstr);
- OLE_RELEASE(pImplTypeInfo);
- if (is_found || FAILED(hr))
- break;
- }
- }
-
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- OLE_RELEASE(pTypeInfo);
- if (is_found || FAILED(hr))
- break;
- }
- OLE_RELEASE(pTypeLib);
- if(!is_found)
- return E_NOINTERFACE;
- return hr;
-}
-
-static HRESULT
-find_coclass(
- ITypeInfo *pTypeInfo,
- TYPEATTR *pTypeAttr,
- ITypeInfo **pCOTypeInfo,
- TYPEATTR **pCOTypeAttr)
-{
- HRESULT hr = E_NOINTERFACE;
- ITypeLib *pTypeLib;
- int count;
- BOOL found = FALSE;
- ITypeInfo *pTypeInfo2;
- TYPEATTR *pTypeAttr2;
- int flags;
- int i,j;
- HREFTYPE href;
- ITypeInfo *pRefTypeInfo;
- TYPEATTR *pRefTypeAttr;
-
- hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, NULL);
- if (FAILED(hr)) {
- return hr;
- }
- count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
- for (i = 0; i < count && !found; i++) {
- hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo2);
- if (FAILED(hr))
- continue;
- hr = OLE_GET_TYPEATTR(pTypeInfo2, &pTypeAttr2);
- if (FAILED(hr)) {
- OLE_RELEASE(pTypeInfo2);
- continue;
- }
- if (pTypeAttr2->typekind != TKIND_COCLASS) {
- OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
- OLE_RELEASE(pTypeInfo2);
- continue;
- }
- for (j = 0; j < pTypeAttr2->cImplTypes && !found; j++) {
- hr = pTypeInfo2->lpVtbl->GetImplTypeFlags(pTypeInfo2, j, &flags);
- if (FAILED(hr))
- continue;
- if (!(flags & IMPLTYPEFLAG_FDEFAULT))
- continue;
- hr = pTypeInfo2->lpVtbl->GetRefTypeOfImplType(pTypeInfo2, j, &href);
- if (FAILED(hr))
- continue;
- hr = pTypeInfo2->lpVtbl->GetRefTypeInfo(pTypeInfo2, href, &pRefTypeInfo);
- if (FAILED(hr))
- continue;
- hr = OLE_GET_TYPEATTR(pRefTypeInfo, &pRefTypeAttr);
- if (FAILED(hr)) {
- OLE_RELEASE(pRefTypeInfo);
- continue;
- }
- if (IsEqualGUID(&(pTypeAttr->guid), &(pRefTypeAttr->guid))) {
- found = TRUE;
- }
- }
- if (!found) {
- OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
- OLE_RELEASE(pTypeInfo2);
- }
- }
- OLE_RELEASE(pTypeLib);
- if (found) {
- *pCOTypeInfo = pTypeInfo2;
- *pCOTypeAttr = pTypeAttr2;
- hr = S_OK;
- } else {
- hr = E_NOINTERFACE;
- }
- return hr;
-}
-
-static HRESULT
-find_default_source_from_typeinfo(
- ITypeInfo *pTypeInfo,
- TYPEATTR *pTypeAttr,
- ITypeInfo **ppTypeInfo)
-{
- int i = 0;
- HRESULT hr = E_NOINTERFACE;
- int flags;
- HREFTYPE hRefType;
- /* Enumerate all implemented types of the COCLASS */
- for (i = 0; i < pTypeAttr->cImplTypes; i++) {
- hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
- if (FAILED(hr))
- continue;
-
- /*
- looking for the [default] [source]
- we just hope that it is a dispinterface :-)
- */
- if ((flags & IMPLTYPEFLAG_FDEFAULT) &&
- (flags & IMPLTYPEFLAG_FSOURCE)) {
-
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
- i, &hRefType);
- if (FAILED(hr))
- continue;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
- hRefType, ppTypeInfo);
- if (SUCCEEDED(hr))
- break;
- }
- }
- return hr;
-}
-
-static HRESULT
-find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo)
-{
- HRESULT hr;
- IProvideClassInfo2 *pProvideClassInfo2;
- IProvideClassInfo *pProvideClassInfo;
- void *p;
-
- IDispatch *pDispatch;
ITypeInfo *pTypeInfo;
- ITypeInfo *pTypeInfo2 = NULL;
- TYPEATTR *pTypeAttr;
- TYPEATTR *pTypeAttr2 = NULL;
-
- struct oledata *pole;
-
- OLEData_Get_Struct(ole, pole);
- pDispatch = pole->pDispatch;
- hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
- &IID_IProvideClassInfo2,
- &p);
- if (SUCCEEDED(hr)) {
- pProvideClassInfo2 = p;
- hr = pProvideClassInfo2->lpVtbl->GetGUID(pProvideClassInfo2,
- GUIDKIND_DEFAULT_SOURCE_DISP_IID,
- piid);
- OLE_RELEASE(pProvideClassInfo2);
- if (SUCCEEDED(hr)) {
- hr = find_iid(ole, NULL, piid, ppTypeInfo);
- }
- }
- if (SUCCEEDED(hr)) {
- return hr;
- }
- hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
- &IID_IProvideClassInfo,
- &p);
- if (SUCCEEDED(hr)) {
- pProvideClassInfo = p;
- hr = pProvideClassInfo->lpVtbl->GetClassInfo(pProvideClassInfo,
- &pTypeInfo);
- OLE_RELEASE(pProvideClassInfo);
- }
- if (FAILED(hr)) {
- hr = pDispatch->lpVtbl->GetTypeInfo(pDispatch, 0, cWIN32OLE_lcid, &pTypeInfo );
- }
- if (FAILED(hr))
- return hr;
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ pole = oledata_get_struct(obj);
+ hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
+ 0, lcid, &pTypeInfo);
if (FAILED(hr)) {
- OLE_RELEASE(pTypeInfo);
return hr;
}
-
- *ppTypeInfo = 0;
- hr = find_default_source_from_typeinfo(pTypeInfo, pTypeAttr, ppTypeInfo);
- if (!*ppTypeInfo) {
- hr = find_coclass(pTypeInfo, pTypeAttr, &pTypeInfo2, &pTypeAttr2);
- if (SUCCEEDED(hr)) {
- hr = find_default_source_from_typeinfo(pTypeInfo2, pTypeAttr2, ppTypeInfo);
- OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
- OLE_RELEASE(pTypeInfo2);
- }
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, pTypeLib, &index);
OLE_RELEASE(pTypeInfo);
- /* Now that would be a bad surprise, if we didn't find it, wouldn't it? */
- if (!*ppTypeInfo) {
- if (SUCCEEDED(hr))
- hr = E_UNEXPECTED;
- return hr;
- }
-
- /* Determine IID of default source interface */
- hr = (*ppTypeInfo)->lpVtbl->GetTypeAttr(*ppTypeInfo, &pTypeAttr);
- if (SUCCEEDED(hr)) {
- *piid = pTypeAttr->guid;
- (*ppTypeInfo)->lpVtbl->ReleaseTypeAttr(*ppTypeInfo, pTypeAttr);
- }
- else
- OLE_RELEASE(*ppTypeInfo);
-
return hr;
-
-}
-
-static void
-ole_event_free(struct oleeventdata *poleev)
-{
- if (poleev->pConnectionPoint) {
- poleev->pConnectionPoint->lpVtbl->Unadvise(poleev->pConnectionPoint, poleev->dwCookie);
- OLE_RELEASE(poleev->pConnectionPoint);
- poleev->pConnectionPoint = NULL;
- }
- free(poleev);
-}
-
-static VALUE
-fev_s_allocate(VALUE klass)
-{
- VALUE obj;
- struct oleeventdata *poleev;
- obj = Data_Make_Struct(klass,struct oleeventdata,0,ole_event_free,poleev);
- poleev->dwCookie = 0;
- poleev->pConnectionPoint = NULL;
- poleev->event_id = 0;
- return obj;
-}
-
-static VALUE
-ev_advise(int argc, VALUE *argv, VALUE self)
-{
-
- VALUE ole, itf;
- struct oledata *pole;
- char *pitf;
- HRESULT hr;
- IID iid;
- ITypeInfo *pTypeInfo = 0;
- IDispatch *pDispatch;
- IConnectionPointContainer *pContainer;
- IConnectionPoint *pConnectionPoint;
- IEVENTSINKOBJ *pIEV;
- DWORD dwCookie;
- struct oleeventdata *poleev;
- void *p;
-
- rb_scan_args(argc, argv, "11", &ole, &itf);
-
- if (!rb_obj_is_kind_of(ole, cWIN32OLE)) {
- rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE object");
- }
-
- if(TYPE(itf) != T_NIL) {
- if (rb_safe_level() > 0 && OBJ_TAINTED(itf)) {
- rb_raise(rb_eSecurityError, "Insecure Event Creation - %s",
- StringValuePtr(itf));
- }
- SafeStringValue(itf);
- pitf = StringValuePtr(itf);
- hr = find_iid(ole, pitf, &iid, &pTypeInfo);
- }
- else {
- hr = find_default_source(ole, &iid, &pTypeInfo);
- }
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "interface not found");
- }
-
- OLEData_Get_Struct(ole, pole);
- pDispatch = pole->pDispatch;
- hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
- &IID_IConnectionPointContainer,
- &p);
- if (FAILED(hr)) {
- OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError,
- "failed to query IConnectionPointContainer");
- }
- pContainer = p;
-
- hr = pContainer->lpVtbl->FindConnectionPoint(pContainer,
- &iid,
- &pConnectionPoint);
- OLE_RELEASE(pContainer);
- if (FAILED(hr)) {
- OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError, "failed to query IConnectionPoint");
- }
- pIEV = EVENTSINK_Constructor();
- pIEV->m_iid = iid;
- hr = pConnectionPoint->lpVtbl->Advise(pConnectionPoint,
- (IUnknown*)pIEV,
- &dwCookie);
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "Advise Error");
- }
-
- Data_Get_Struct(self, struct oleeventdata, poleev);
- pIEV->m_event_id
- = NUM2INT(evs_length());
- pIEV->pTypeInfo = pTypeInfo;
- poleev->dwCookie = dwCookie;
- poleev->pConnectionPoint = pConnectionPoint;
- poleev->event_id = pIEV->m_event_id;
-
- return self;
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT.new(ole, event) #=> WIN32OLE_EVENT object.
- *
- * Returns OLE event object.
- * The first argument specifies WIN32OLE object.
- * The second argument specifies OLE event name.
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
- */
-static VALUE
-fev_initialize(int argc, VALUE *argv, VALUE self)
-{
- ev_advise(argc, argv, self);
- evs_push(self);
- rb_ivar_set(self, id_events, rb_ary_new());
- fev_set_handler(self, Qnil);
- return self;
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT.message_loop
- *
- * Translates and dispatches Windows message.
- */
-static VALUE
-fev_s_msg_loop(VALUE klass)
-{
- ole_msg_loop();
- return Qnil;
-}
-
-
-static void
-add_event_call_back(VALUE obj, VALUE event, VALUE data)
-{
- VALUE events = rb_ivar_get(obj, id_events);
- if (NIL_P(events) || TYPE(events) != T_ARRAY) {
- events = rb_ary_new();
- rb_ivar_set(obj, id_events, events);
- }
- ole_delete_event(events, event);
- rb_ary_push(events, data);
-}
-
-static VALUE
-ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg)
-{
- struct oleeventdata *poleev;
- VALUE event, args, data;
- Data_Get_Struct(self, struct oleeventdata, poleev);
- if (poleev->pConnectionPoint == NULL) {
- rb_raise(eWIN32OLERuntimeError, "IConnectionPoint not found. You must call advise at first.");
- }
- rb_scan_args(argc, argv, "01*", &event, &args);
- if(!NIL_P(event)) {
- if(TYPE(event) != T_STRING && TYPE(event) != T_SYMBOL) {
- rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
- }
- if (TYPE(event) == T_SYMBOL) {
- event = rb_sym_to_s(event);
- }
- }
- data = rb_ary_new3(4, rb_block_proc(), event, args, is_ary_arg);
- add_event_call_back(self, event, data);
- return Qnil;
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#on_event([event]){...}
- *
- * Defines the callback event.
- * If argument is omitted, this method defines the callback of all events.
- * If you want to modify reference argument in callback, return hash in
- * callback. If you want to return value to OLE server as result of callback
- * use `return' or :return.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event("NavigateComplete") {|url| puts url}
- * ev.on_event() {|ev, *args| puts "#{ev} fired"}
- *
- * ev.on_event("BeforeNavigate2") {|*args|
- * ...
- * # set true to BeforeNavigate reference argument `Cancel'.
- * # Cancel is 7-th argument of BeforeNavigate,
- * # so you can use 6 as key of hash instead of 'Cancel'.
- * # The argument is counted from 0.
- * # The hash key of 0 means first argument.)
- * {:Cancel => true} # or {'Cancel' => true} or {6 => true}
- * }
- *
- * ev.on_event(...) {|*args|
- * {:return => 1, :xxx => yyy}
- * }
- */
-static VALUE
-fev_on_event(int argc, VALUE *argv, VALUE self)
-{
- return ev_on_event(argc, argv, self, Qfalse);
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#on_event_with_outargs([event]){...}
- *
- * Defines the callback of event.
- * If you want modify argument in callback,
- * you could use this method instead of WIN32OLE_EVENT#on_event.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event_with_outargs('BeforeNavigate2') {|*args|
- * args.last[6] = true
- * }
- */
-static VALUE
-fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self)
-{
- return ev_on_event(argc, argv, self, Qtrue);
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#off_event([event])
- *
- * removes the callback of event.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event('BeforeNavigate2') {|*args|
- * args.last[6] = true
- * }
- * ...
- * ev.off_event('BeforeNavigate2')
- * ...
- */
-static VALUE
-fev_off_event(int argc, VALUE *argv, VALUE self)
-{
- VALUE event = Qnil;
- VALUE events;
-
- rb_scan_args(argc, argv, "01", &event);
- if(!NIL_P(event)) {
- if(TYPE(event) != T_STRING && TYPE(event) != T_SYMBOL) {
- rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
- }
- if (TYPE(event) == T_SYMBOL) {
- event = rb_sym_to_s(event);
- }
- }
- events = rb_ivar_get(self, id_events);
- if (NIL_P(events)) {
- return Qnil;
- }
- ole_delete_event(events, event);
- return Qnil;
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#unadvise -> nil
- *
- * disconnects OLE server. If this method called, then the WIN32OLE_EVENT object
- * does not receive the OLE server event any more.
- * This method is trial implementation.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event() {...}
- * ...
- * ev.unadvise
- *
- */
-static VALUE
-fev_unadvise(VALUE self)
-{
- struct oleeventdata *poleev;
- Data_Get_Struct(self, struct oleeventdata, poleev);
- if (poleev->pConnectionPoint) {
- ole_msg_loop();
- evs_delete(poleev->event_id);
- poleev->pConnectionPoint->lpVtbl->Unadvise(poleev->pConnectionPoint, poleev->dwCookie);
- OLE_RELEASE(poleev->pConnectionPoint);
- poleev->pConnectionPoint = NULL;
- }
- return Qnil;
-}
-
-static VALUE
-evs_push(VALUE ev)
-{
- return rb_ary_push(ary_ole_event, ev);
-}
-
-static VALUE
-evs_delete(long i)
-{
- rb_ary_store(ary_ole_event, i, Qnil);
- return Qnil;
-}
-
-static VALUE
-evs_entry(long i)
-{
- return rb_ary_entry(ary_ole_event, i);
-}
-
-static VALUE
-evs_length(void)
-{
- return rb_funcall(ary_ole_event, rb_intern("length"), 0);
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#handler=
- *
- * sets event handler object. If handler object has onXXX
- * method according to XXX event, then onXXX method is called
- * when XXX event occurs.
- *
- * If handler object has method_missing and there is no
- * method according to the event, then method_missing
- * called and 1-st argument is event name.
- *
- * If handler object has onXXX method and there is block
- * defined by WIN32OLE_EVENT#on_event('XXX'){},
- * then block is executed but handler object method is not called
- * when XXX event occurs.
- *
- * class Handler
- * def onStatusTextChange(text)
- * puts "StatusTextChanged"
- * end
- * def onPropertyChange(prop)
- * puts "PropertyChanged"
- * end
- * def method_missing(ev, *arg)
- * puts "other event #{ev}"
- * end
- * end
- *
- * handler = Handler.new
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event("StatusTextChange") {|*args|
- * puts "this block executed."
- * puts "handler.onStatusTextChange method is not called."
- * }
- * ev.handler = handler
- *
- */
-static VALUE
-fev_set_handler(VALUE self, VALUE val)
-{
- return rb_ivar_set(self, rb_intern("handler"), val);
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#handler
- *
- * returns handler object.
- *
- */
-static VALUE
-fev_get_handler(VALUE self)
-{
- return rb_ivar_get(self, rb_intern("handler"));
-}
-
-static void
-olevariant_free(struct olevariantdata *pvar)
-{
- VariantClear(&(pvar->realvar));
- VariantClear(&(pvar->var));
- free(pvar);
-}
-
-static VALUE
-folevariant_s_allocate(VALUE klass)
-{
- struct olevariantdata *pvar;
- VALUE obj;
- ole_initialize();
- obj = Data_Make_Struct(klass,struct olevariantdata,0,olevariant_free,pvar);
- VariantInit(&(pvar->var));
- VariantInit(&(pvar->realvar));
- return obj;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.array(ary, vt)
- *
- * Returns Ruby object wrapping OLE variant whose variant type is VT_ARRAY.
- * The first argument should be Array object which specifies dimensions
- * and each size of dimensions of OLE array.
- * The second argument specifies variant type of the element of OLE array.
- *
- * The following create 2 dimensions OLE array. The first dimensions size
- * is 3, and the second is 4.
- *
- * ole_ary = WIN32OLE_VARIANT.array([3,4], VT_I4)
- * ruby_ary = ole_ary.value # => [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
- *
- */
-static VALUE
-folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt)
-{
- VALUE obj = Qnil;
- VARTYPE vt;
- struct olevariantdata *pvar;
- SAFEARRAYBOUND *psab = NULL;
- SAFEARRAY *psa = NULL;
- UINT dim = 0;
- UINT i = 0;
-
- ole_initialize();
-
- vt = NUM2UINT(vvt);
- vt = (vt | VT_ARRAY);
- Check_Type(elems, T_ARRAY);
- obj = folevariant_s_allocate(klass);
-
- Data_Get_Struct(obj, struct olevariantdata, pvar);
- dim = RARRAY_LEN(elems);
-
- psab = ALLOC_N(SAFEARRAYBOUND, dim);
-
- if(!psab) {
- rb_raise(rb_eRuntimeError, "memory allocation error");
- }
-
- for (i = 0; i < dim; i++) {
- psab[i].cElements = FIX2INT(rb_ary_entry(elems, i));
- psab[i].lLbound = 0;
- }
-
- psa = SafeArrayCreate((VARTYPE)(vt & VT_TYPEMASK), dim, psab);
- if (psa == NULL) {
- if (psab) free(psab);
- rb_raise(rb_eRuntimeError, "memory allocation error(SafeArrayCreate)");
- }
-
- V_VT(&(pvar->var)) = vt;
- if (vt & VT_BYREF) {
- V_VT(&(pvar->realvar)) = (vt & ~VT_BYREF);
- V_ARRAY(&(pvar->realvar)) = psa;
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- } else {
- V_ARRAY(&(pvar->var)) = psa;
- }
- if (psab) free(psab);
- return obj;
-}
-
-static void
-check_type_val2variant(VALUE val)
-{
- VALUE elem;
- int len = 0;
- int i = 0;
- if(!rb_obj_is_kind_of(val, cWIN32OLE) &&
- !rb_obj_is_kind_of(val, cWIN32OLE_VARIANT) &&
- !rb_obj_is_kind_of(val, rb_cTime)) {
- switch (TYPE(val)) {
- case T_ARRAY:
- len = RARRAY_LEN(val);
- for(i = 0; i < len; i++) {
- elem = rb_ary_entry(val, i);
- check_type_val2variant(elem);
- }
- break;
- case T_STRING:
- case T_FIXNUM:
- case T_BIGNUM:
- case T_FLOAT:
- case T_TRUE:
- case T_FALSE:
- case T_NIL:
- break;
- default:
- rb_raise(rb_eTypeError, "can not convert WIN32OLE_VARIANT from type %s",
- rb_obj_classname(val));
- }
- }
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.new(val, vartype) #=> WIN32OLE_VARIANT object.
- *
- * Returns Ruby object wrapping OLE variant.
- * The first argument specifies Ruby object to convert OLE variant variable.
- * The second argument specifies VARIANT type.
- * In some situation, you need the WIN32OLE_VARIANT object to pass OLE method
- *
- * shell = WIN32OLE.new("Shell.Application")
- * folder = shell.NameSpace("C:\\Windows")
- * item = folder.ParseName("tmp.txt")
- * # You can't use Ruby String object to call FolderItem.InvokeVerb.
- * # Instead, you have to use WIN32OLE_VARIANT object to call the method.
- * shortcut = WIN32OLE_VARIANT.new("Create Shortcut(\&S)")
- * item.invokeVerb(shortcut)
- *
- */
-static VALUE
-folevariant_initialize(VALUE self, VALUE args)
-{
- int len = 0;
- VARIANT var;
- VALUE val;
- VALUE vvt;
- VARTYPE vt;
- struct olevariantdata *pvar;
-
- len = RARRAY_LEN(args);
- if (len < 1 || len > 3) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..3)", len);
- }
- VariantInit(&var);
- val = rb_ary_entry(args, 0);
-
- check_type_val2variant(val);
-
- Data_Get_Struct(self, struct olevariantdata, pvar);
- if (len == 1) {
- ole_val2variant(val, &(pvar->var));
- } else {
- vvt = rb_ary_entry(args, 1);
- vt = NUM2INT(vvt);
- ole_val2olevariantdata(val, vt, pvar);
- }
- vt = V_VT(&pvar->var);
- return self;
-}
-
-static SAFEARRAY *
-get_locked_safe_array(VALUE val)
-{
- struct olevariantdata *pvar;
- SAFEARRAY *psa = NULL;
- HRESULT hr;
- Data_Get_Struct(val, struct olevariantdata, pvar);
- if (!(V_VT(&(pvar->var)) & VT_ARRAY)) {
- rb_raise(rb_eTypeError, "variant type is not VT_ARRAY.");
- }
- psa = V_ISBYREF(&(pvar->var)) ? *V_ARRAYREF(&(pvar->var)) : V_ARRAY(&(pvar->var));
- if (psa == NULL) {
- return psa;
- }
- hr = SafeArrayLock(psa);
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to SafeArrayLock");
- }
- return psa;
-}
-
-static long *
-ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa)
-{
- long dim;
- long *pid;
- long i;
- dim = SafeArrayGetDim(psa);
- if (dim != ary_size) {
- rb_raise(rb_eArgError, "unmatch number of indices");
- }
- pid = ALLOC_N(long, dim);
- if (pid == NULL) {
- rb_raise(rb_eRuntimeError, "failed to allocate memory for indices");
- }
- for (i = 0; i < dim; i++) {
- pid[i] = NUM2INT(ary[i]);
- }
- return pid;
}
static void
-unlock_safe_array(SAFEARRAY *psa)
-{
- HRESULT hr;
- hr = SafeArrayUnlock(psa);
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to SafeArrayUnlock");
- }
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT[i,j,...] #=> element of OLE array.
- *
- * Returns the element of WIN32OLE_VARIANT object(OLE array).
- * This method is available only when the variant type of
- * WIN32OLE_VARIANT object is VT_ARRAY.
- *
- * REMARK:
- * The all indicies should be 0 or natural number and
- * lower than or equal to max indicies.
- * (This point is different with Ruby Array indicies.)
- *
- * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
- * p obj[0,0] # => 1
- * p obj[1,0] # => 4
- * p obj[2,0] # => WIN32OLERuntimeError
- * p obj[0, -1] # => WIN32OLERuntimeError
- *
- */
-static VALUE
-folevariant_ary_aref(int argc, VALUE *argv, VALUE self)
-{
- struct olevariantdata *pvar;
- SAFEARRAY *psa;
- VALUE val = Qnil;
- VARIANT variant;
- long *pid;
- HRESULT hr;
-
- Data_Get_Struct(self, struct olevariantdata, pvar);
- if (!V_ISARRAY(&(pvar->var))) {
- rb_raise(eWIN32OLERuntimeError,
- "`[]' is not available for this variant type object");
- }
- psa = get_locked_safe_array(self);
- if (psa == NULL) {
- return val;
- }
-
- pid = ary2safe_array_index(argc, argv, psa);
-
- VariantInit(&variant);
- V_VT(&variant) = (V_VT(&(pvar->var)) & ~VT_ARRAY) | VT_BYREF;
- hr = SafeArrayPtrOfIndex(psa, pid, &V_BYREF(&variant));
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to SafeArrayPtrOfIndex");
- }
- val = ole_variant2val(&variant);
-
- unlock_safe_array(psa);
- if (pid) free(pid);
- return val;
-}
-
-static VOID *
-val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt)
-{
- VOID *p = NULL;
- HRESULT hr = S_OK;
- ole_val2variant_ex(val, var, vt);
- if ((vt & ~VT_BYREF) == VT_VARIANT) {
- p = var;
- } else {
- if ( (vt & ~VT_BYREF) != V_VT(var)) {
- hr = VariantChangeTypeEx(var, var,
- cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF));
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to change type");
- }
- }
- p = get_ptr_of_variant(var);
- }
- if (p == NULL) {
- rb_raise(rb_eRuntimeError, "failed to get pointer of variant");
- }
- return p;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT[i,j,...] = val #=> set the element of OLE array
- *
- * Set the element of WIN32OLE_VARIANT object(OLE array) to val.
- * This method is available only when the variant type of
- * WIN32OLE_VARIANT object is VT_ARRAY.
- *
- * REMARK:
- * The all indicies should be 0 or natural number and
- * lower than or equal to max indicies.
- * (This point is different with Ruby Array indicies.)
- *
- * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
- * obj[0,0] = 7
- * obj[1,0] = 8
- * p obj.value # => [[7,2,3], [8,5,6]]
- * obj[2,0] = 9 # => WIN32OLERuntimeError
- * obj[0, -1] = 9 # => WIN32OLERuntimeError
- *
- */
-static VALUE
-folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
-{
- struct olevariantdata *pvar;
- SAFEARRAY *psa;
- VARIANT var;
- VARTYPE vt;
- long *pid;
- HRESULT hr;
- VOID *p = NULL;
-
- Data_Get_Struct(self, struct olevariantdata, pvar);
- if (!V_ISARRAY(&(pvar->var))) {
- rb_raise(eWIN32OLERuntimeError,
- "`[]' is not available for this variant type object");
- }
- psa = get_locked_safe_array(self);
- if (psa == NULL) {
- rb_raise(rb_eRuntimeError, "failed to get SafeArray pointer");
- }
-
- pid = ary2safe_array_index(argc-1, argv, psa);
-
- VariantInit(&var);
- vt = (V_VT(&(pvar->var)) & ~VT_ARRAY);
- p = val2variant_ptr(argv[argc-1], &var, vt);
- if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
- (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
- rb_raise(eWIN32OLERuntimeError, "argument does not have IDispatch or IUnknown Interface");
- }
- hr = SafeArrayPutElement(psa, pid, p);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to SafeArrayPutElement");
- }
-
- unlock_safe_array(psa);
- if (pid) free(pid);
- return argv[argc-1];
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.value #=> Ruby object.
- *
- * Returns Ruby object value from OLE variant.
- * obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR)
- * obj.value # => "1" (not Fixnum object, but String object "1")
- *
- */
-static VALUE
-folevariant_value(VALUE self)
-{
- struct olevariantdata *pvar;
- VALUE val = Qnil;
- VARTYPE vt;
- int dim;
- SAFEARRAY *psa;
- Data_Get_Struct(self, struct olevariantdata, pvar);
-
- val = ole_variant2val(&(pvar->var));
- vt = V_VT(&(pvar->var));
-
- if ((vt & ~VT_BYREF) == (VT_UI1|VT_ARRAY)) {
- if (vt & VT_BYREF) {
- psa = *V_ARRAYREF(&(pvar->var));
- } else {
- psa = V_ARRAY(&(pvar->var));
- }
- if (!psa) {
- return val;
- }
- dim = SafeArrayGetDim(psa);
- if (dim == 1) {
- val = rb_funcall(val, rb_intern("pack"), 1, rb_str_new2("C*"));
- }
- }
- return val;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.vartype #=> OLE variant type.
- *
- * Returns OLE variant type.
- * obj = WIN32OLE_VARIANT.new("string")
- * obj.vartype # => WIN32OLE::VARIANT::VT_BSTR
- *
- */
-static VALUE
-folevariant_vartype(VALUE self)
-{
- struct olevariantdata *pvar;
- Data_Get_Struct(self, struct olevariantdata, pvar);
- return INT2FIX(V_VT(&pvar->var));
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.value = val #=> set WIN32OLE_VARIANT value to val.
- *
- * Sets variant value to val. If the val type does not match variant value
- * type(vartype), then val is changed to match variant value type(vartype)
- * before setting val.
- * Thie method is not available when vartype is VT_ARRAY(except VT_UI1|VT_ARRAY).
- * If the vartype is VT_UI1|VT_ARRAY, the val should be String object.
- *
- * obj = WIN32OLE_VARIANT.new(1) # obj.vartype is WIN32OLE::VARIANT::VT_I4
- * obj.value = 3.2 # 3.2 is changed to 3 when setting value.
- * p obj.value # => 3
- */
-static VALUE
-folevariant_set_value(VALUE self, VALUE val)
+com_hash_free(void *ptr)
{
- struct olevariantdata *pvar;
- VARTYPE vt;
- Data_Get_Struct(self, struct olevariantdata, pvar);
- vt = V_VT(&(pvar->var));
- if (V_ISARRAY(&(pvar->var)) && ((vt & ~VT_BYREF) != (VT_UI1|VT_ARRAY) || TYPE(val) != T_STRING)) {
- rb_raise(eWIN32OLERuntimeError,
- "`value=' is not available for this variant type object");
- }
- ole_val2olevariantdata(val, vt, pvar);
- return Qnil;
+ st_table *tbl = ptr;
+ st_free_table(tbl);
}
static void
-init_enc2cp(void)
+com_hash_mark(void *ptr)
{
- enc2cp_table = st_init_numtable();
+ st_table *tbl = ptr;
+ rb_mark_hash(tbl);
}
-static void
-free_enc2cp(void)
+static size_t
+com_hash_size(const void *ptr)
{
- st_free_table(enc2cp_table);
+ const st_table *tbl = ptr;
+ return st_memsize(tbl);
}
void
Init_win32ole(void)
{
+ cWIN32OLE_lcid = LOCALE_SYSTEM_DEFAULT;
g_ole_initialized_init();
- ary_ole_event = rb_ary_new();
- rb_gc_register_mark_object(ary_ole_event);
- id_events = rb_intern("events");
com_vtbl.QueryInterface = QueryInterface;
com_vtbl.AddRef = AddRef;
@@ -9138,7 +3910,12 @@ Init_win32ole(void)
message_filter.RetryRejectedCall = mf_RetryRejectedCall;
message_filter.MessagePending = mf_MessagePending;
- com_hash = Data_Wrap_Struct(rb_cData, rb_mark_hash, st_free_table, st_init_numtable());
+ enc2cp_hash = TypedData_Wrap_Struct(rb_cData, &win32ole_hash_datatype, 0);
+ RTYPEDDATA_DATA(enc2cp_hash) = st_init_numtable();
+ rb_gc_register_mark_object(enc2cp_hash);
+
+ com_hash = TypedData_Wrap_Struct(rb_cData, &win32ole_hash_datatype, 0);
+ RTYPEDDATA_DATA(com_hash) = st_init_numtable();
rb_gc_register_mark_object(com_hash);
cWIN32OLE = rb_define_class("WIN32OLE", rb_cObject);
@@ -9192,170 +3969,97 @@ Init_win32ole(void)
rb_define_method(cWIN32OLE, "ole_query_interface", fole_query_interface, 1);
rb_define_method(cWIN32OLE, "ole_respond_to?", fole_respond_to, 1);
+ /* Constants definition */
+
+ /*
+ * Version string of WIN32OLE.
+ */
rb_define_const(cWIN32OLE, "VERSION", rb_str_new2(WIN32OLE_VERSION));
+
+ /*
+ * After invoking OLE methods with reference arguments, you can access
+ * the value of arguments by using ARGV.
+ *
+ * If the method of OLE(COM) server written by C#.NET is following:
+ *
+ * void calcsum(int a, int b, out int c) {
+ * c = a + b;
+ * }
+ *
+ * then, the Ruby OLE(COM) client script to retrieve the value of
+ * argument c after invoking calcsum method is following:
+ *
+ * a = 10
+ * b = 20
+ * c = 0
+ * comserver.calcsum(a, b, c)
+ * p c # => 0
+ * p WIN32OLE::ARGV # => [10, 20, 30]
+ *
+ * You can use WIN32OLE_VARIANT object to retrieve the value of reference
+ * arguments instead of referring WIN32OLE::ARGV.
+ *
+ */
rb_define_const(cWIN32OLE, "ARGV", rb_ary_new());
+ /*
+ * 0: ANSI code page. See WIN32OLE.codepage and WIN32OLE.codepage=.
+ */
rb_define_const(cWIN32OLE, "CP_ACP", INT2FIX(CP_ACP));
+
+ /*
+ * 1: OEM code page. See WIN32OLE.codepage and WIN32OLE.codepage=.
+ */
rb_define_const(cWIN32OLE, "CP_OEMCP", INT2FIX(CP_OEMCP));
+
+ /*
+ * 2
+ */
rb_define_const(cWIN32OLE, "CP_MACCP", INT2FIX(CP_MACCP));
+
+ /*
+ * 3: current thread ANSI code page. See WIN32OLE.codepage and
+ * WIN32OLE.codepage=.
+ */
rb_define_const(cWIN32OLE, "CP_THREAD_ACP", INT2FIX(CP_THREAD_ACP));
+
+ /*
+ * 42: symbol code page. See WIN32OLE.codepage and WIN32OLE.codepage=.
+ */
rb_define_const(cWIN32OLE, "CP_SYMBOL", INT2FIX(CP_SYMBOL));
+
+ /*
+ * 65000: UTF-7 code page. See WIN32OLE.codepage and WIN32OLE.codepage=.
+ */
rb_define_const(cWIN32OLE, "CP_UTF7", INT2FIX(CP_UTF7));
+
+ /*
+ * 65001: UTF-8 code page. See WIN32OLE.codepage and WIN32OLE.codepage=.
+ */
rb_define_const(cWIN32OLE, "CP_UTF8", INT2FIX(CP_UTF8));
+ /*
+ * 0x0800: default locale for the operating system. See WIN32OLE.locale
+ * and WIN32OLE.locale=.
+ */
rb_define_const(cWIN32OLE, "LOCALE_SYSTEM_DEFAULT", INT2FIX(LOCALE_SYSTEM_DEFAULT));
+
+ /*
+ * 0x0400: default locale for the user or process. See WIN32OLE.locale
+ * and WIN32OLE.locale=.
+ */
rb_define_const(cWIN32OLE, "LOCALE_USER_DEFAULT", INT2FIX(LOCALE_USER_DEFAULT));
- mWIN32OLE_VARIANT = rb_define_module_under(cWIN32OLE, "VARIANT");
- rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", INT2FIX(VT_EMPTY));
- rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", INT2FIX(VT_NULL));
- rb_define_const(mWIN32OLE_VARIANT, "VT_I2", INT2FIX(VT_I2));
- rb_define_const(mWIN32OLE_VARIANT, "VT_I4", INT2FIX(VT_I4));
- rb_define_const(mWIN32OLE_VARIANT, "VT_R4", INT2FIX(VT_R4));
- rb_define_const(mWIN32OLE_VARIANT, "VT_R8", INT2FIX(VT_R8));
- rb_define_const(mWIN32OLE_VARIANT, "VT_CY", INT2FIX(VT_CY));
- rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", INT2FIX(VT_DATE));
- rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", INT2FIX(VT_BSTR));
- rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", INT2FIX(VT_USERDEFINED));
- rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", INT2FIX(VT_PTR));
- rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", INT2FIX(VT_DISPATCH));
- rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", INT2FIX(VT_ERROR));
- rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", INT2FIX(VT_BOOL));
- rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", INT2FIX(VT_VARIANT));
- rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", INT2FIX(VT_UNKNOWN));
- rb_define_const(mWIN32OLE_VARIANT, "VT_I1", INT2FIX(VT_I1));
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", INT2FIX(VT_UI1));
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", INT2FIX(VT_UI2));
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", INT2FIX(VT_UI4));
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- rb_define_const(mWIN32OLE_VARIANT, "VT_I8", INT2FIX(VT_I8));
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", INT2FIX(VT_UI8));
-#endif
- rb_define_const(mWIN32OLE_VARIANT, "VT_INT", INT2FIX(VT_INT));
- rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", INT2FIX(VT_UINT));
- rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", INT2FIX(VT_ARRAY));
- rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", INT2FIX(VT_BYREF));
-
- cWIN32OLE_TYPELIB = rb_define_class("WIN32OLE_TYPELIB", rb_cObject);
- rb_define_singleton_method(cWIN32OLE_TYPELIB, "typelibs", foletypelib_s_typelibs, 0);
- rb_define_alloc_func(cWIN32OLE_TYPELIB, foletypelib_s_allocate);
- rb_define_method(cWIN32OLE_TYPELIB, "initialize", foletypelib_initialize, -2);
- rb_define_method(cWIN32OLE_TYPELIB, "guid", foletypelib_guid, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "name", foletypelib_name, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "version", foletypelib_version, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "major_version", foletypelib_major_version, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "minor_version", foletypelib_minor_version, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "path", foletypelib_path, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "ole_types", foletypelib_ole_types, 0);
- rb_define_alias(cWIN32OLE_TYPELIB, "ole_classes", "ole_types");
- rb_define_method(cWIN32OLE_TYPELIB, "visible?", foletypelib_visible, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "library_name", foletypelib_library_name, 0);
- rb_define_alias(cWIN32OLE_TYPELIB, "to_s", "name");
- rb_define_method(cWIN32OLE_TYPELIB, "inspect", foletypelib_inspect, 0);
-
- cWIN32OLE_TYPE = rb_define_class("WIN32OLE_TYPE", rb_cObject);
- rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1);
- rb_define_singleton_method(cWIN32OLE_TYPE, "typelibs", foletype_s_typelibs, 0);
- rb_define_singleton_method(cWIN32OLE_TYPE, "progids", foletype_s_progids, 0);
- rb_define_alloc_func(cWIN32OLE_TYPE, foletype_s_allocate);
- rb_define_method(cWIN32OLE_TYPE, "initialize", foletype_initialize, 2);
- rb_define_method(cWIN32OLE_TYPE, "name", foletype_name, 0);
- rb_define_method(cWIN32OLE_TYPE, "ole_type", foletype_ole_type, 0);
- rb_define_method(cWIN32OLE_TYPE, "guid", foletype_guid, 0);
- rb_define_method(cWIN32OLE_TYPE, "progid", foletype_progid, 0);
- rb_define_method(cWIN32OLE_TYPE, "visible?", foletype_visible, 0);
- rb_define_alias(cWIN32OLE_TYPE, "to_s", "name");
- rb_define_method(cWIN32OLE_TYPE, "major_version", foletype_major_version, 0);
- rb_define_method(cWIN32OLE_TYPE, "minor_version", foletype_minor_version, 0);
- rb_define_method(cWIN32OLE_TYPE, "typekind", foletype_typekind, 0);
- rb_define_method(cWIN32OLE_TYPE, "helpstring", foletype_helpstring, 0);
- rb_define_method(cWIN32OLE_TYPE, "src_type", foletype_src_type, 0);
- rb_define_method(cWIN32OLE_TYPE, "helpfile", foletype_helpfile, 0);
- rb_define_method(cWIN32OLE_TYPE, "helpcontext", foletype_helpcontext, 0);
- rb_define_method(cWIN32OLE_TYPE, "variables", foletype_variables, 0);
- rb_define_method(cWIN32OLE_TYPE, "ole_methods", foletype_methods, 0);
- rb_define_method(cWIN32OLE_TYPE, "ole_typelib", foletype_ole_typelib, 0);
- rb_define_method(cWIN32OLE_TYPE, "implemented_ole_types", foletype_impl_ole_types, 0);
- rb_define_method(cWIN32OLE_TYPE, "source_ole_types", foletype_source_ole_types, 0);
- rb_define_method(cWIN32OLE_TYPE, "default_event_sources", foletype_default_event_sources, 0);
- rb_define_method(cWIN32OLE_TYPE, "default_ole_types", foletype_default_ole_types, 0);
- rb_define_method(cWIN32OLE_TYPE, "inspect", foletype_inspect, 0);
-
- cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
- rb_define_method(cWIN32OLE_VARIABLE, "name", folevariable_name, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "ole_type", folevariable_ole_type, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "ole_type_detail", folevariable_ole_type_detail, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "value", folevariable_value, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "visible?", folevariable_visible, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "variable_kind", folevariable_variable_kind, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "varkind", folevariable_varkind, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "inspect", folevariable_inspect, 0);
- rb_define_alias(cWIN32OLE_VARIABLE, "to_s", "name");
-
- cWIN32OLE_METHOD = rb_define_class("WIN32OLE_METHOD", rb_cObject);
- rb_define_alloc_func(cWIN32OLE_METHOD, folemethod_s_allocate);
- rb_define_method(cWIN32OLE_METHOD, "initialize", folemethod_initialize, 2);
- rb_define_method(cWIN32OLE_METHOD, "name", folemethod_name, 0);
- rb_define_method(cWIN32OLE_METHOD, "return_type", folemethod_return_type, 0);
- rb_define_method(cWIN32OLE_METHOD, "return_vtype", folemethod_return_vtype, 0);
- rb_define_method(cWIN32OLE_METHOD, "return_type_detail", folemethod_return_type_detail, 0);
- rb_define_method(cWIN32OLE_METHOD, "invoke_kind", folemethod_invoke_kind, 0);
- rb_define_method(cWIN32OLE_METHOD, "invkind", folemethod_invkind, 0);
- rb_define_method(cWIN32OLE_METHOD, "visible?", folemethod_visible, 0);
- rb_define_method(cWIN32OLE_METHOD, "event?", folemethod_event, 0);
- rb_define_method(cWIN32OLE_METHOD, "event_interface", folemethod_event_interface, 0);
- rb_define_method(cWIN32OLE_METHOD, "helpstring", folemethod_helpstring, 0);
- rb_define_method(cWIN32OLE_METHOD, "helpfile", folemethod_helpfile, 0);
- rb_define_method(cWIN32OLE_METHOD, "helpcontext", folemethod_helpcontext, 0);
- rb_define_method(cWIN32OLE_METHOD, "dispid", folemethod_dispid, 0);
- rb_define_method(cWIN32OLE_METHOD, "offset_vtbl", folemethod_offset_vtbl, 0);
- rb_define_method(cWIN32OLE_METHOD, "size_params", folemethod_size_params, 0);
- rb_define_method(cWIN32OLE_METHOD, "size_opt_params", folemethod_size_opt_params, 0);
- rb_define_method(cWIN32OLE_METHOD, "params", folemethod_params, 0);
- rb_define_alias(cWIN32OLE_METHOD, "to_s", "name");
- rb_define_method(cWIN32OLE_METHOD, "inspect", folemethod_inspect, 0);
-
- cWIN32OLE_PARAM = rb_define_class("WIN32OLE_PARAM", rb_cObject);
- rb_define_alloc_func(cWIN32OLE_PARAM, foleparam_s_allocate);
- rb_define_method(cWIN32OLE_PARAM, "initialize", foleparam_initialize, 2);
- rb_define_method(cWIN32OLE_PARAM, "name", foleparam_name, 0);
- rb_define_method(cWIN32OLE_PARAM, "ole_type", foleparam_ole_type, 0);
- rb_define_method(cWIN32OLE_PARAM, "ole_type_detail", foleparam_ole_type_detail, 0);
- rb_define_method(cWIN32OLE_PARAM, "input?", foleparam_input, 0);
- rb_define_method(cWIN32OLE_PARAM, "output?", foleparam_output, 0);
- rb_define_method(cWIN32OLE_PARAM, "optional?", foleparam_optional, 0);
- rb_define_method(cWIN32OLE_PARAM, "retval?", foleparam_retval, 0);
- rb_define_method(cWIN32OLE_PARAM, "default", foleparam_default, 0);
- rb_define_alias(cWIN32OLE_PARAM, "to_s", "name");
- rb_define_method(cWIN32OLE_PARAM, "inspect", foleparam_inspect, 0);
-
- cWIN32OLE_EVENT = rb_define_class("WIN32OLE_EVENT", rb_cObject);
- rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0);
- rb_define_alloc_func(cWIN32OLE_EVENT, fev_s_allocate);
- rb_define_method(cWIN32OLE_EVENT, "initialize", fev_initialize, -1);
- rb_define_method(cWIN32OLE_EVENT, "on_event", fev_on_event, -1);
- rb_define_method(cWIN32OLE_EVENT, "on_event_with_outargs", fev_on_event_with_outargs, -1);
- rb_define_method(cWIN32OLE_EVENT, "off_event", fev_off_event, -1);
- rb_define_method(cWIN32OLE_EVENT, "unadvise", fev_unadvise, 0);
- rb_define_method(cWIN32OLE_EVENT, "handler=", fev_set_handler, 1);
- rb_define_method(cWIN32OLE_EVENT, "handler", fev_get_handler, 0);
-
- cWIN32OLE_VARIANT = rb_define_class("WIN32OLE_VARIANT", rb_cObject);
- rb_define_alloc_func(cWIN32OLE_VARIANT, folevariant_s_allocate);
- rb_define_singleton_method(cWIN32OLE_VARIANT, "array", folevariant_s_array, 2);
- rb_define_method(cWIN32OLE_VARIANT, "initialize", folevariant_initialize, -2);
- rb_define_method(cWIN32OLE_VARIANT, "value", folevariant_value, 0);
- rb_define_method(cWIN32OLE_VARIANT, "value=", folevariant_set_value, 1);
- rb_define_method(cWIN32OLE_VARIANT, "vartype", folevariant_vartype, 0);
- rb_define_method(cWIN32OLE_VARIANT, "[]", folevariant_ary_aref, -1);
- rb_define_method(cWIN32OLE_VARIANT, "[]=", folevariant_ary_aset, -1);
- rb_define_const(cWIN32OLE_VARIANT, "Empty", rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_EMPTY)));
- rb_define_const(cWIN32OLE_VARIANT, "Null", rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_NULL)));
- rb_define_const(cWIN32OLE_VARIANT, "Nothing", rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_DISPATCH)));
-
- eWIN32OLERuntimeError = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError);
-
- init_enc2cp();
- atexit((void (*)(void))free_enc2cp);
+ Init_win32ole_variant_m();
+ Init_win32ole_typelib();
+ Init_win32ole_type();
+ Init_win32ole_variable();
+ Init_win32ole_method();
+ Init_win32ole_param();
+ Init_win32ole_event();
+ Init_win32ole_variant();
+ Init_win32ole_record();
+ Init_win32ole_error();
+
ole_init_cp();
}
diff --git a/ext/win32ole/win32ole.h b/ext/win32ole/win32ole.h
new file mode 100644
index 0000000000..d61f5e23b4
--- /dev/null
+++ b/ext/win32ole/win32ole.h
@@ -0,0 +1,155 @@
+#ifndef WIN32OLE_H
+#define WIN32OLE_H 1
+#include "ruby/ruby.h"
+#include "ruby/st.h"
+#include "ruby/encoding.h"
+
+#define GNUC_OLDER_3_4_4 \
+ ((__GNUC__ < 3) || \
+ ((__GNUC__ <= 3) && (__GNUC_MINOR__ < 4)) || \
+ ((__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4)))
+
+#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
+#ifndef NONAMELESSUNION
+#define NONAMELESSUNION 1
+#endif
+#endif
+
+#include <ctype.h>
+
+#include <windows.h>
+#include <ocidl.h>
+#include <olectl.h>
+#include <ole2.h>
+#if defined(HAVE_TYPE_IMULTILANGUAGE2) || defined(HAVE_TYPE_IMULTILANGUAGE)
+#include <mlang.h>
+#endif
+#include <stdlib.h>
+#include <math.h>
+#ifdef HAVE_STDARG_PROTOTYPES
+#include <stdarg.h>
+#define va_init_list(a,b) va_start(a,b)
+#else
+#include <varargs.h>
+#define va_init_list(a,b) va_start(a)
+#endif
+#include <objidl.h>
+
+#define DOUT fprintf(stderr,"%s(%d)\n", __FILE__, __LINE__)
+#define DOUTS(x) fprintf(stderr,"%s(%d):" #x "=%s\n",__FILE__, __LINE__,x)
+#define DOUTMSG(x) fprintf(stderr, "%s(%d):" #x "\n",__FILE__, __LINE__)
+#define DOUTI(x) fprintf(stderr, "%s(%d):" #x "=%d\n",__FILE__, __LINE__,x)
+#define DOUTD(x) fprintf(stderr, "%s(%d):" #x "=%f\n",__FILE__, __LINE__,x)
+
+#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
+#define V_UNION1(X, Y) ((X)->u.Y)
+#else
+#define V_UNION1(X, Y) ((X)->Y)
+#endif
+
+#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
+#undef V_UNION
+#define V_UNION(X,Y) ((X)->n1.n2.n3.Y)
+
+#undef V_VT
+#define V_VT(X) ((X)->n1.n2.vt)
+
+#undef V_BOOL
+#define V_BOOL(X) V_UNION(X,boolVal)
+#endif
+
+#ifndef V_I1REF
+#define V_I1REF(X) V_UNION(X, pcVal)
+#endif
+
+#ifndef V_UI2REF
+#define V_UI2REF(X) V_UNION(X, puiVal)
+#endif
+
+#ifndef V_INT
+#define V_INT(X) V_UNION(X, intVal)
+#endif
+
+#ifndef V_INTREF
+#define V_INTREF(X) V_UNION(X, pintVal)
+#endif
+
+#ifndef V_UINT
+#define V_UINT(X) V_UNION(X, uintVal)
+#endif
+
+#ifndef V_UINTREF
+#define V_UINTREF(X) V_UNION(X, puintVal)
+#endif
+
+#ifdef HAVE_LONG_LONG
+#define I8_2_NUM LL2NUM
+#define UI8_2_NUM ULL2NUM
+#define NUM2I8 NUM2LL
+#define NUM2UI8 NUM2ULL
+#else
+#define I8_2_NUM INT2NUM
+#define UI8_2_NUM UINT2NUM
+#define NUM2I8 NUM2INT
+#define NUM2UI8 NUM2UINT
+#endif
+
+#define OLE_ADDREF(X) (X) ? ((X)->lpVtbl->AddRef(X)) : 0
+#define OLE_RELEASE(X) (X) ? ((X)->lpVtbl->Release(X)) : 0
+#define OLE_FREE(x) {\
+ if(ole_initialized() == TRUE) {\
+ if(x) {\
+ OLE_RELEASE(x);\
+ (x) = 0;\
+ }\
+ }\
+}
+
+#define OLE_GET_TYPEATTR(X, Y) ((X)->lpVtbl->GetTypeAttr((X), (Y)))
+#define OLE_RELEASE_TYPEATTR(X, Y) ((X)->lpVtbl->ReleaseTypeAttr((X), (Y)))
+
+struct oledata {
+ IDispatch *pDispatch;
+};
+
+VALUE cWIN32OLE;
+LCID cWIN32OLE_lcid;
+
+struct oledata *oledata_get_struct(VALUE obj);
+LPWSTR ole_vstr2wc(VALUE vstr);
+LONG reg_open_key(HKEY hkey, const char *name, HKEY *phkey);
+LONG reg_open_vkey(HKEY hkey, VALUE key, HKEY *phkey);
+VALUE reg_enum_key(HKEY hkey, DWORD i);
+VALUE reg_get_val(HKEY hkey, const char *subkey);
+VALUE reg_get_val2(HKEY hkey, const char *subkey);
+void ole_initialize(void);
+VALUE default_inspect(VALUE self, const char *class_name);
+char *ole_wc2mb(LPWSTR pw);
+VALUE ole_wc2vstr(LPWSTR pw, BOOL isfree);
+
+#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
+
+BOOL ole_initialized(void);
+HRESULT ole_docinfo_from_type(ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile);
+VALUE ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails);
+VALUE make_inspect(const char *class_name, VALUE detail);
+void ole_val2variant(VALUE val, VARIANT *var);
+void ole_val2variant2(VALUE val, VARIANT *var);
+void ole_val2variant_ex(VALUE val, VARIANT *var, VARTYPE vt);
+VALUE ole_variant2val(VARIANT *pvar);
+HRESULT ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt);
+VOID *val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt);
+HRESULT typelib_from_val(VALUE obj, ITypeLib **pTypeLib);
+
+#include "win32ole_variant_m.h"
+#include "win32ole_typelib.h"
+#include "win32ole_type.h"
+#include "win32ole_variable.h"
+#include "win32ole_method.h"
+#include "win32ole_param.h"
+#include "win32ole_event.h"
+#include "win32ole_variant.h"
+#include "win32ole_record.h"
+#include "win32ole_error.h"
+
+#endif
diff --git a/ext/win32ole/win32ole_error.c b/ext/win32ole/win32ole_error.c
new file mode 100644
index 0000000000..62e69b186c
--- /dev/null
+++ b/ext/win32ole/win32ole_error.c
@@ -0,0 +1,83 @@
+#include "win32ole.h"
+
+static VALUE ole_hresult2msg(HRESULT hr);
+
+static VALUE
+ole_hresult2msg(HRESULT hr)
+{
+ VALUE msg = Qnil;
+ char *p_msg = NULL;
+ char *term = NULL;
+ DWORD dwCount;
+
+ char strhr[100];
+ sprintf(strhr, " HRESULT error code:0x%08x\n ", (unsigned)hr);
+ msg = rb_str_new2(strhr);
+ dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, hr,
+ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
+ (LPTSTR)&p_msg, 0, NULL);
+ if (dwCount == 0) {
+ dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, hr, cWIN32OLE_lcid,
+ (LPTSTR)&p_msg, 0, NULL);
+ }
+ if (dwCount > 0) {
+ term = p_msg + strlen(p_msg);
+ while (p_msg < term) {
+ term--;
+ if (*term == '\r' || *term == '\n')
+ *term = '\0';
+ else break;
+ }
+ if (p_msg[0] != '\0') {
+ rb_str_cat2(msg, p_msg);
+ }
+ }
+ LocalFree(p_msg);
+ return msg;
+}
+
+void
+ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...)
+{
+ va_list args;
+ VALUE msg;
+ VALUE err_msg;
+ va_init_list(args, fmt);
+ msg = rb_vsprintf(fmt, args);
+ va_end(args);
+
+ err_msg = ole_hresult2msg(hr);
+ if(err_msg != Qnil) {
+ rb_str_cat2(msg, "\n");
+ rb_str_append(msg, err_msg);
+ }
+ rb_exc_raise(rb_exc_new_str(ecs, msg));
+}
+
+void
+Init_win32ole_error(void)
+{
+ /*
+ * Document-class: WIN32OLERuntimeError
+ *
+ * Raised when OLE processing failed.
+ *
+ * EX:
+ *
+ * obj = WIN32OLE.new("NonExistProgID")
+ *
+ * raises the exception:
+ *
+ * WIN32OLERuntimeError: unknown OLE server: `NonExistProgID'
+ * HRESULT error code:0x800401f3
+ * Invalid class string
+ *
+ */
+ eWIN32OLERuntimeError = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError);
+}
diff --git a/ext/win32ole/win32ole_error.h b/ext/win32ole/win32ole_error.h
new file mode 100644
index 0000000000..5359646ff1
--- /dev/null
+++ b/ext/win32ole/win32ole_error.h
@@ -0,0 +1,8 @@
+#ifndef WIN32OLE_ERROR_H
+#define WIN32OLE_ERROR_H 1
+
+VALUE eWIN32OLERuntimeError;
+void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...);
+void Init_win32ole_error(void);
+
+#endif
diff --git a/ext/win32ole/win32ole_event.c b/ext/win32ole/win32ole_event.c
new file mode 100644
index 0000000000..8e30732592
--- /dev/null
+++ b/ext/win32ole/win32ole_event.c
@@ -0,0 +1,1278 @@
+#include "win32ole.h"
+
+/*
+ * Document-class: WIN32OLE_EVENT
+ *
+ * <code>WIN32OLE_EVENT</code> objects controls OLE event.
+ */
+
+typedef struct {
+ struct IEventSinkVtbl * lpVtbl;
+} IEventSink, *PEVENTSINK;
+
+typedef struct IEventSinkVtbl IEventSinkVtbl;
+
+struct IEventSinkVtbl {
+ STDMETHOD(QueryInterface)(
+ PEVENTSINK,
+ REFIID,
+ LPVOID *);
+ STDMETHOD_(ULONG, AddRef)(PEVENTSINK);
+ STDMETHOD_(ULONG, Release)(PEVENTSINK);
+
+ STDMETHOD(GetTypeInfoCount)(
+ PEVENTSINK,
+ UINT *);
+ STDMETHOD(GetTypeInfo)(
+ PEVENTSINK,
+ UINT,
+ LCID,
+ ITypeInfo **);
+ STDMETHOD(GetIDsOfNames)(
+ PEVENTSINK,
+ REFIID,
+ OLECHAR **,
+ UINT,
+ LCID,
+ DISPID *);
+ STDMETHOD(Invoke)(
+ PEVENTSINK,
+ DISPID,
+ REFIID,
+ LCID,
+ WORD,
+ DISPPARAMS *,
+ VARIANT *,
+ EXCEPINFO *,
+ UINT *);
+};
+
+typedef struct tagIEVENTSINKOBJ {
+ const IEventSinkVtbl *lpVtbl;
+ DWORD m_cRef;
+ IID m_iid;
+ long m_event_id;
+ ITypeInfo *pTypeInfo;
+}IEVENTSINKOBJ, *PIEVENTSINKOBJ;
+
+struct oleeventdata {
+ DWORD dwCookie;
+ IConnectionPoint *pConnectionPoint;
+ IDispatch *pDispatch;
+ long event_id;
+};
+
+static VALUE ary_ole_event;
+static ID id_events;
+
+VALUE cWIN32OLE_EVENT;
+
+STDMETHODIMP EVENTSINK_QueryInterface(PEVENTSINK, REFIID, LPVOID*);
+STDMETHODIMP_(ULONG) EVENTSINK_AddRef(PEVENTSINK);
+STDMETHODIMP_(ULONG) EVENTSINK_Release(PEVENTSINK);
+STDMETHODIMP EVENTSINK_GetTypeInfoCount(PEVENTSINK, UINT*);
+STDMETHODIMP EVENTSINK_GetTypeInfo(PEVENTSINK, UINT, LCID, ITypeInfo**);
+STDMETHODIMP EVENTSINK_GetIDsOfNames(PEVENTSINK, REFIID, OLECHAR**, UINT, LCID, DISPID*);
+STDMETHODIMP EVENTSINK_Invoke(PEVENTSINK, DISPID, REFIID, LCID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*);
+
+static const IEventSinkVtbl vtEventSink = {
+ EVENTSINK_QueryInterface,
+ EVENTSINK_AddRef,
+ EVENTSINK_Release,
+ EVENTSINK_GetTypeInfoCount,
+ EVENTSINK_GetTypeInfo,
+ EVENTSINK_GetIDsOfNames,
+ EVENTSINK_Invoke,
+};
+
+void EVENTSINK_Destructor(PIEVENTSINKOBJ);
+static void ole_val2ptr_variant(VALUE val, VARIANT *var);
+static void hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams);
+static VALUE hash2result(VALUE hash);
+static void ary2ptr_dispparams(VALUE ary, DISPPARAMS *pdispparams);
+static VALUE exec_callback(VALUE arg);
+static VALUE rescue_callback(VALUE arg);
+static HRESULT find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo);
+static HRESULT find_coclass(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **pTypeInfo2, TYPEATTR **pTypeAttr2);
+static HRESULT find_default_source_from_typeinfo(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **ppTypeInfo);
+static HRESULT find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo);
+static long ole_search_event_at(VALUE ary, VALUE ev);
+static VALUE ole_search_event(VALUE ary, VALUE ev, BOOL *is_default);
+static VALUE ole_search_handler_method(VALUE handler, VALUE ev, BOOL *is_default_handler);
+static void ole_delete_event(VALUE ary, VALUE ev);
+static void oleevent_free(void *ptr);
+static size_t oleevent_size(const void *ptr);
+static VALUE fev_s_allocate(VALUE klass);
+static VALUE ev_advise(int argc, VALUE *argv, VALUE self);
+static VALUE fev_initialize(int argc, VALUE *argv, VALUE self);
+static void ole_msg_loop(void);
+static VALUE fev_s_msg_loop(VALUE klass);
+static void add_event_call_back(VALUE obj, VALUE event, VALUE data);
+static VALUE ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg);
+static VALUE fev_on_event(int argc, VALUE *argv, VALUE self);
+static VALUE fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self);
+static VALUE fev_off_event(int argc, VALUE *argv, VALUE self);
+static VALUE fev_unadvise(VALUE self);
+static VALUE fev_set_handler(VALUE self, VALUE val);
+static VALUE fev_get_handler(VALUE self);
+static VALUE evs_push(VALUE ev);
+static VALUE evs_delete(long i);
+static VALUE evs_entry(long i);
+static long evs_length(void);
+
+
+static const rb_data_type_t oleevent_datatype = {
+ "win32ole_event",
+ {NULL, oleevent_free, oleevent_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+STDMETHODIMP EVENTSINK_Invoke(
+ PEVENTSINK pEventSink,
+ DISPID dispid,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pdispparams,
+ VARIANT *pvarResult,
+ EXCEPINFO *pexcepinfo,
+ UINT *puArgErr
+ ) {
+
+ HRESULT hr;
+ BSTR bstr;
+ unsigned int count;
+ unsigned int i;
+ ITypeInfo *pTypeInfo;
+ VARIANT *pvar;
+ VALUE ary, obj, event, args, outargv, ev, result;
+ VALUE handler = Qnil;
+ VALUE arg[3];
+ VALUE mid;
+ VALUE is_outarg = Qfalse;
+ BOOL is_default_handler = FALSE;
+ int state;
+
+ PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
+ pTypeInfo = pEV->pTypeInfo;
+ obj = evs_entry(pEV->m_event_id);
+ if (!rb_obj_is_kind_of(obj, cWIN32OLE_EVENT)) {
+ return NOERROR;
+ }
+
+ ary = rb_ivar_get(obj, id_events);
+ if (NIL_P(ary) || !RB_TYPE_P(ary, T_ARRAY)) {
+ return NOERROR;
+ }
+ hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, dispid,
+ &bstr, 1, &count);
+ if (FAILED(hr)) {
+ return NOERROR;
+ }
+ ev = WC2VSTR(bstr);
+ event = ole_search_event(ary, ev, &is_default_handler);
+ if (RB_TYPE_P(event, T_ARRAY)) {
+ handler = rb_ary_entry(event, 0);
+ mid = rb_intern("call");
+ is_outarg = rb_ary_entry(event, 3);
+ } else {
+ handler = rb_ivar_get(obj, rb_intern("handler"));
+ if (handler == Qnil) {
+ return NOERROR;
+ }
+ mid = ole_search_handler_method(handler, ev, &is_default_handler);
+ }
+ if (handler == Qnil || mid == Qnil) {
+ return NOERROR;
+ }
+
+ args = rb_ary_new();
+ if (is_default_handler) {
+ rb_ary_push(args, ev);
+ }
+
+ /* make argument of event handler */
+ for (i = 0; i < pdispparams->cArgs; ++i) {
+ pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
+ rb_ary_push(args, ole_variant2val(pvar));
+ }
+ outargv = Qnil;
+ if (is_outarg == Qtrue) {
+ outargv = rb_ary_new();
+ rb_ary_push(args, outargv);
+ }
+
+ /*
+ * if exception raised in event callback,
+ * then you receive cfp consistency error.
+ * to avoid this error we use begin rescue end.
+ * and the exception raised then error message print
+ * and exit ruby process by Win32OLE itself.
+ */
+ arg[0] = handler;
+ arg[1] = mid;
+ arg[2] = args;
+ result = rb_protect(exec_callback, (VALUE)arg, &state);
+ if (state != 0) {
+ rescue_callback(Qnil);
+ }
+ if(RB_TYPE_P(result, T_HASH)) {
+ hash2ptr_dispparams(result, pTypeInfo, dispid, pdispparams);
+ result = hash2result(result);
+ }else if (is_outarg == Qtrue && RB_TYPE_P(outargv, T_ARRAY)) {
+ ary2ptr_dispparams(outargv, pdispparams);
+ }
+
+ if (pvarResult) {
+ VariantInit(pvarResult);
+ ole_val2variant(result, pvarResult);
+ }
+
+ return NOERROR;
+}
+
+STDMETHODIMP
+EVENTSINK_QueryInterface(
+ PEVENTSINK pEV,
+ REFIID iid,
+ LPVOID* ppv
+ ) {
+ if (IsEqualIID(iid, &IID_IUnknown) ||
+ IsEqualIID(iid, &IID_IDispatch) ||
+ IsEqualIID(iid, &((PIEVENTSINKOBJ)pEV)->m_iid)) {
+ *ppv = pEV;
+ }
+ else {
+ *ppv = NULL;
+ return E_NOINTERFACE;
+ }
+ ((LPUNKNOWN)*ppv)->lpVtbl->AddRef((LPUNKNOWN)*ppv);
+ return NOERROR;
+}
+
+STDMETHODIMP_(ULONG)
+EVENTSINK_AddRef(
+ PEVENTSINK pEV
+ ){
+ PIEVENTSINKOBJ pEVObj = (PIEVENTSINKOBJ)pEV;
+ return ++pEVObj->m_cRef;
+}
+
+STDMETHODIMP_(ULONG) EVENTSINK_Release(
+ PEVENTSINK pEV
+ ) {
+ PIEVENTSINKOBJ pEVObj = (PIEVENTSINKOBJ)pEV;
+ --pEVObj->m_cRef;
+ if(pEVObj->m_cRef != 0)
+ return pEVObj->m_cRef;
+ EVENTSINK_Destructor(pEVObj);
+ return 0;
+}
+
+STDMETHODIMP EVENTSINK_GetTypeInfoCount(
+ PEVENTSINK pEV,
+ UINT *pct
+ ) {
+ *pct = 0;
+ return NOERROR;
+}
+
+STDMETHODIMP EVENTSINK_GetTypeInfo(
+ PEVENTSINK pEV,
+ UINT info,
+ LCID lcid,
+ ITypeInfo **pInfo
+ ) {
+ *pInfo = NULL;
+ return DISP_E_BADINDEX;
+}
+
+STDMETHODIMP EVENTSINK_GetIDsOfNames(
+ PEVENTSINK pEventSink,
+ REFIID riid,
+ OLECHAR **szNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *pDispID
+ ) {
+ ITypeInfo *pTypeInfo;
+ PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
+ pTypeInfo = pEV->pTypeInfo;
+ if (pTypeInfo) {
+ return pTypeInfo->lpVtbl->GetIDsOfNames(pTypeInfo, szNames, cNames, pDispID);
+ }
+ return DISP_E_UNKNOWNNAME;
+}
+
+PIEVENTSINKOBJ
+EVENTSINK_Constructor(void)
+{
+ PIEVENTSINKOBJ pEv;
+ pEv = ALLOC_N(IEVENTSINKOBJ, 1);
+ if(pEv == NULL) return NULL;
+ pEv->lpVtbl = &vtEventSink;
+ pEv->m_cRef = 0;
+ pEv->m_event_id = 0;
+ pEv->pTypeInfo = NULL;
+ return pEv;
+}
+
+void
+EVENTSINK_Destructor(
+ PIEVENTSINKOBJ pEVObj
+ ) {
+ if(pEVObj != NULL) {
+ OLE_RELEASE(pEVObj->pTypeInfo);
+ free(pEVObj);
+ pEVObj = NULL;
+ }
+}
+
+static void
+ole_val2ptr_variant(VALUE val, VARIANT *var)
+{
+ switch (TYPE(val)) {
+ case T_STRING:
+ if (V_VT(var) == (VT_BSTR | VT_BYREF)) {
+ *V_BSTRREF(var) = ole_vstr2wc(val);
+ }
+ break;
+ case T_FIXNUM:
+ switch(V_VT(var)) {
+ case (VT_UI1 | VT_BYREF) :
+ *V_UI1REF(var) = NUM2CHR(val);
+ break;
+ case (VT_I2 | VT_BYREF) :
+ *V_I2REF(var) = (short)NUM2INT(val);
+ break;
+ case (VT_I4 | VT_BYREF) :
+ *V_I4REF(var) = NUM2INT(val);
+ break;
+ case (VT_R4 | VT_BYREF) :
+ *V_R4REF(var) = (float)NUM2INT(val);
+ break;
+ case (VT_R8 | VT_BYREF) :
+ *V_R8REF(var) = NUM2INT(val);
+ break;
+ default:
+ break;
+ }
+ break;
+ case T_FLOAT:
+ switch(V_VT(var)) {
+ case (VT_I2 | VT_BYREF) :
+ *V_I2REF(var) = (short)NUM2INT(val);
+ break;
+ case (VT_I4 | VT_BYREF) :
+ *V_I4REF(var) = NUM2INT(val);
+ break;
+ case (VT_R4 | VT_BYREF) :
+ *V_R4REF(var) = (float)NUM2DBL(val);
+ break;
+ case (VT_R8 | VT_BYREF) :
+ *V_R8REF(var) = NUM2DBL(val);
+ break;
+ default:
+ break;
+ }
+ break;
+ case T_BIGNUM:
+ if (V_VT(var) == (VT_R8 | VT_BYREF)) {
+ *V_R8REF(var) = rb_big2dbl(val);
+ }
+ break;
+ case T_TRUE:
+ if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
+ *V_BOOLREF(var) = VARIANT_TRUE;
+ }
+ break;
+ case T_FALSE:
+ if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
+ *V_BOOLREF(var) = VARIANT_FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams)
+{
+ BSTR *bstrs;
+ HRESULT hr;
+ UINT len, i;
+ VARIANT *pvar;
+ VALUE val;
+ VALUE key;
+ len = 0;
+ bstrs = ALLOCA_N(BSTR, pdispparams->cArgs + 1);
+ hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, dispid,
+ bstrs, pdispparams->cArgs + 1,
+ &len);
+ if (FAILED(hr))
+ return;
+
+ for (i = 0; i < len - 1; i++) {
+ key = WC2VSTR(bstrs[i + 1]);
+ val = rb_hash_aref(hash, INT2FIX(i));
+ if (val == Qnil)
+ val = rb_hash_aref(hash, key);
+ if (val == Qnil)
+ val = rb_hash_aref(hash, rb_str_intern(key));
+ pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
+ ole_val2ptr_variant(val, pvar);
+ }
+}
+
+static VALUE
+hash2result(VALUE hash)
+{
+ VALUE ret = Qnil;
+ ret = rb_hash_aref(hash, rb_str_new2("return"));
+ if (ret == Qnil)
+ ret = rb_hash_aref(hash, rb_str_intern(rb_str_new2("return")));
+ return ret;
+}
+
+static void
+ary2ptr_dispparams(VALUE ary, DISPPARAMS *pdispparams)
+{
+ int i;
+ VALUE v;
+ VARIANT *pvar;
+ for(i = 0; i < RARRAY_LEN(ary) && (unsigned int) i < pdispparams->cArgs; i++) {
+ v = rb_ary_entry(ary, i);
+ pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
+ ole_val2ptr_variant(v, pvar);
+ }
+}
+
+static VALUE
+exec_callback(VALUE arg)
+{
+ VALUE *parg = (VALUE *)arg;
+ VALUE handler = parg[0];
+ VALUE mid = parg[1];
+ VALUE args = parg[2];
+ return rb_apply(handler, mid, args);
+}
+
+static VALUE
+rescue_callback(VALUE arg)
+{
+
+ VALUE error;
+ VALUE e = rb_errinfo();
+ VALUE bt = rb_funcall(e, rb_intern("backtrace"), 0);
+ VALUE msg = rb_funcall(e, rb_intern("message"), 0);
+ bt = rb_ary_entry(bt, 0);
+ error = rb_sprintf("%"PRIsVALUE": %"PRIsVALUE" (%s)\n", bt, msg, rb_obj_classname(e));
+ rb_write_error(StringValuePtr(error));
+ rb_backtrace();
+ ruby_finalize();
+ exit(-1);
+
+ return Qnil;
+}
+
+static HRESULT
+find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
+{
+ HRESULT hr;
+ IDispatch *pDispatch;
+ ITypeInfo *pTypeInfo;
+ ITypeLib *pTypeLib;
+ TYPEATTR *pTypeAttr;
+ HREFTYPE RefType;
+ ITypeInfo *pImplTypeInfo;
+ TYPEATTR *pImplTypeAttr;
+
+ struct oledata *pole = NULL;
+ unsigned int index;
+ unsigned int count;
+ int type;
+ BSTR bstr;
+ char *pstr;
+
+ BOOL is_found = FALSE;
+ LCID lcid = cWIN32OLE_lcid;
+
+ pole = oledata_get_struct(ole);
+
+ pDispatch = pole->pDispatch;
+
+ hr = pDispatch->lpVtbl->GetTypeInfo(pDispatch, 0, lcid, &pTypeInfo);
+ if (FAILED(hr))
+ return hr;
+
+ hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo,
+ &pTypeLib,
+ &index);
+ OLE_RELEASE(pTypeInfo);
+ if (FAILED(hr))
+ return hr;
+
+ if (!pitf) {
+ hr = pTypeLib->lpVtbl->GetTypeInfoOfGuid(pTypeLib,
+ piid,
+ ppTypeInfo);
+ OLE_RELEASE(pTypeLib);
+ return hr;
+ }
+ count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
+ for (index = 0; index < count; index++) {
+ hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib,
+ index,
+ &pTypeInfo);
+ if (FAILED(hr))
+ break;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+
+ if(FAILED(hr)) {
+ OLE_RELEASE(pTypeInfo);
+ break;
+ }
+ if(pTypeAttr->typekind == TKIND_COCLASS) {
+ for (type = 0; type < pTypeAttr->cImplTypes; type++) {
+ hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
+ type,
+ &RefType);
+ if (FAILED(hr))
+ break;
+ hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
+ RefType,
+ &pImplTypeInfo);
+ if (FAILED(hr))
+ break;
+
+ hr = pImplTypeInfo->lpVtbl->GetDocumentation(pImplTypeInfo,
+ -1,
+ &bstr,
+ NULL, NULL, NULL);
+ if (FAILED(hr)) {
+ OLE_RELEASE(pImplTypeInfo);
+ break;
+ }
+ pstr = ole_wc2mb(bstr);
+ if (strcmp(pitf, pstr) == 0) {
+ hr = pImplTypeInfo->lpVtbl->GetTypeAttr(pImplTypeInfo,
+ &pImplTypeAttr);
+ if (SUCCEEDED(hr)) {
+ is_found = TRUE;
+ *piid = pImplTypeAttr->guid;
+ if (ppTypeInfo) {
+ *ppTypeInfo = pImplTypeInfo;
+ (*ppTypeInfo)->lpVtbl->AddRef((*ppTypeInfo));
+ }
+ pImplTypeInfo->lpVtbl->ReleaseTypeAttr(pImplTypeInfo,
+ pImplTypeAttr);
+ }
+ }
+ free(pstr);
+ OLE_RELEASE(pImplTypeInfo);
+ if (is_found || FAILED(hr))
+ break;
+ }
+ }
+
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ OLE_RELEASE(pTypeInfo);
+ if (is_found || FAILED(hr))
+ break;
+ }
+ OLE_RELEASE(pTypeLib);
+ if(!is_found)
+ return E_NOINTERFACE;
+ return hr;
+}
+
+static HRESULT
+find_coclass(
+ ITypeInfo *pTypeInfo,
+ TYPEATTR *pTypeAttr,
+ ITypeInfo **pCOTypeInfo,
+ TYPEATTR **pCOTypeAttr)
+{
+ HRESULT hr = E_NOINTERFACE;
+ ITypeLib *pTypeLib;
+ int count;
+ BOOL found = FALSE;
+ ITypeInfo *pTypeInfo2;
+ TYPEATTR *pTypeAttr2;
+ int flags;
+ int i,j;
+ HREFTYPE href;
+ ITypeInfo *pRefTypeInfo;
+ TYPEATTR *pRefTypeAttr;
+
+ hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, NULL);
+ if (FAILED(hr)) {
+ return hr;
+ }
+ count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
+ for (i = 0; i < count && !found; i++) {
+ hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo2);
+ if (FAILED(hr))
+ continue;
+ hr = OLE_GET_TYPEATTR(pTypeInfo2, &pTypeAttr2);
+ if (FAILED(hr)) {
+ OLE_RELEASE(pTypeInfo2);
+ continue;
+ }
+ if (pTypeAttr2->typekind != TKIND_COCLASS) {
+ OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
+ OLE_RELEASE(pTypeInfo2);
+ continue;
+ }
+ for (j = 0; j < pTypeAttr2->cImplTypes && !found; j++) {
+ hr = pTypeInfo2->lpVtbl->GetImplTypeFlags(pTypeInfo2, j, &flags);
+ if (FAILED(hr))
+ continue;
+ if (!(flags & IMPLTYPEFLAG_FDEFAULT))
+ continue;
+ hr = pTypeInfo2->lpVtbl->GetRefTypeOfImplType(pTypeInfo2, j, &href);
+ if (FAILED(hr))
+ continue;
+ hr = pTypeInfo2->lpVtbl->GetRefTypeInfo(pTypeInfo2, href, &pRefTypeInfo);
+ if (FAILED(hr))
+ continue;
+ hr = OLE_GET_TYPEATTR(pRefTypeInfo, &pRefTypeAttr);
+ if (FAILED(hr)) {
+ OLE_RELEASE(pRefTypeInfo);
+ continue;
+ }
+ if (IsEqualGUID(&(pTypeAttr->guid), &(pRefTypeAttr->guid))) {
+ found = TRUE;
+ }
+ }
+ if (!found) {
+ OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
+ OLE_RELEASE(pTypeInfo2);
+ }
+ }
+ OLE_RELEASE(pTypeLib);
+ if (found) {
+ *pCOTypeInfo = pTypeInfo2;
+ *pCOTypeAttr = pTypeAttr2;
+ hr = S_OK;
+ } else {
+ hr = E_NOINTERFACE;
+ }
+ return hr;
+}
+
+static HRESULT
+find_default_source_from_typeinfo(
+ ITypeInfo *pTypeInfo,
+ TYPEATTR *pTypeAttr,
+ ITypeInfo **ppTypeInfo)
+{
+ int i = 0;
+ HRESULT hr = E_NOINTERFACE;
+ int flags;
+ HREFTYPE hRefType;
+ /* Enumerate all implemented types of the COCLASS */
+ for (i = 0; i < pTypeAttr->cImplTypes; i++) {
+ hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
+ if (FAILED(hr))
+ continue;
+
+ /*
+ looking for the [default] [source]
+ we just hope that it is a dispinterface :-)
+ */
+ if ((flags & IMPLTYPEFLAG_FDEFAULT) &&
+ (flags & IMPLTYPEFLAG_FSOURCE)) {
+
+ hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
+ i, &hRefType);
+ if (FAILED(hr))
+ continue;
+ hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
+ hRefType, ppTypeInfo);
+ if (SUCCEEDED(hr))
+ break;
+ }
+ }
+ return hr;
+}
+
+static HRESULT
+find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo)
+{
+ HRESULT hr;
+ IProvideClassInfo2 *pProvideClassInfo2;
+ IProvideClassInfo *pProvideClassInfo;
+ void *p;
+
+ IDispatch *pDispatch;
+ ITypeInfo *pTypeInfo;
+ ITypeInfo *pTypeInfo2 = NULL;
+ TYPEATTR *pTypeAttr;
+ TYPEATTR *pTypeAttr2 = NULL;
+
+ struct oledata *pole = NULL;
+
+ pole = oledata_get_struct(ole);
+ pDispatch = pole->pDispatch;
+ hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
+ &IID_IProvideClassInfo2,
+ &p);
+ if (SUCCEEDED(hr)) {
+ pProvideClassInfo2 = p;
+ hr = pProvideClassInfo2->lpVtbl->GetGUID(pProvideClassInfo2,
+ GUIDKIND_DEFAULT_SOURCE_DISP_IID,
+ piid);
+ OLE_RELEASE(pProvideClassInfo2);
+ if (SUCCEEDED(hr)) {
+ hr = find_iid(ole, NULL, piid, ppTypeInfo);
+ }
+ }
+ if (SUCCEEDED(hr)) {
+ return hr;
+ }
+ hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
+ &IID_IProvideClassInfo,
+ &p);
+ if (SUCCEEDED(hr)) {
+ pProvideClassInfo = p;
+ hr = pProvideClassInfo->lpVtbl->GetClassInfo(pProvideClassInfo,
+ &pTypeInfo);
+ OLE_RELEASE(pProvideClassInfo);
+ }
+ if (FAILED(hr)) {
+ hr = pDispatch->lpVtbl->GetTypeInfo(pDispatch, 0, cWIN32OLE_lcid, &pTypeInfo );
+ }
+ if (FAILED(hr))
+ return hr;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr)) {
+ OLE_RELEASE(pTypeInfo);
+ return hr;
+ }
+
+ *ppTypeInfo = 0;
+ hr = find_default_source_from_typeinfo(pTypeInfo, pTypeAttr, ppTypeInfo);
+ if (!*ppTypeInfo) {
+ hr = find_coclass(pTypeInfo, pTypeAttr, &pTypeInfo2, &pTypeAttr2);
+ if (SUCCEEDED(hr)) {
+ hr = find_default_source_from_typeinfo(pTypeInfo2, pTypeAttr2, ppTypeInfo);
+ OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
+ OLE_RELEASE(pTypeInfo2);
+ }
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ OLE_RELEASE(pTypeInfo);
+ /* Now that would be a bad surprise, if we didn't find it, wouldn't it? */
+ if (!*ppTypeInfo) {
+ if (SUCCEEDED(hr))
+ hr = E_UNEXPECTED;
+ return hr;
+ }
+
+ /* Determine IID of default source interface */
+ hr = (*ppTypeInfo)->lpVtbl->GetTypeAttr(*ppTypeInfo, &pTypeAttr);
+ if (SUCCEEDED(hr)) {
+ *piid = pTypeAttr->guid;
+ (*ppTypeInfo)->lpVtbl->ReleaseTypeAttr(*ppTypeInfo, pTypeAttr);
+ }
+ else
+ OLE_RELEASE(*ppTypeInfo);
+
+ return hr;
+}
+
+static long
+ole_search_event_at(VALUE ary, VALUE ev)
+{
+ VALUE event;
+ VALUE event_name;
+ long i, len;
+ long ret = -1;
+ len = RARRAY_LEN(ary);
+ for(i = 0; i < len; i++) {
+ event = rb_ary_entry(ary, i);
+ event_name = rb_ary_entry(event, 1);
+ if(NIL_P(event_name) && NIL_P(ev)) {
+ ret = i;
+ break;
+ }
+ else if (RB_TYPE_P(ev, T_STRING) &&
+ RB_TYPE_P(event_name, T_STRING) &&
+ rb_str_cmp(ev, event_name) == 0) {
+ ret = i;
+ break;
+ }
+ }
+ return ret;
+}
+
+static VALUE
+ole_search_event(VALUE ary, VALUE ev, BOOL *is_default)
+{
+ VALUE event;
+ VALUE def_event;
+ VALUE event_name;
+ int i, len;
+ *is_default = FALSE;
+ def_event = Qnil;
+ len = RARRAY_LEN(ary);
+ for(i = 0; i < len; i++) {
+ event = rb_ary_entry(ary, i);
+ event_name = rb_ary_entry(event, 1);
+ if(NIL_P(event_name)) {
+ *is_default = TRUE;
+ def_event = event;
+ }
+ else if (rb_str_cmp(ev, event_name) == 0) {
+ *is_default = FALSE;
+ return event;
+ }
+ }
+ return def_event;
+}
+
+static VALUE
+ole_search_handler_method(VALUE handler, VALUE ev, BOOL *is_default_handler)
+{
+ VALUE mid;
+
+ *is_default_handler = FALSE;
+ mid = rb_to_id(rb_sprintf("on%"PRIsVALUE, ev));
+ if (rb_respond_to(handler, mid)) {
+ return mid;
+ }
+ mid = rb_intern("method_missing");
+ if (rb_respond_to(handler, mid)) {
+ *is_default_handler = TRUE;
+ return mid;
+ }
+ return Qnil;
+}
+
+static void
+ole_delete_event(VALUE ary, VALUE ev)
+{
+ long at = -1;
+ at = ole_search_event_at(ary, ev);
+ if (at >= 0) {
+ rb_ary_delete_at(ary, at);
+ }
+}
+
+
+static void
+oleevent_free(void *ptr)
+{
+ struct oleeventdata *poleev = ptr;
+ if (poleev->pConnectionPoint) {
+ poleev->pConnectionPoint->lpVtbl->Unadvise(poleev->pConnectionPoint, poleev->dwCookie);
+ OLE_RELEASE(poleev->pConnectionPoint);
+ poleev->pConnectionPoint = NULL;
+ }
+ OLE_RELEASE(poleev->pDispatch);
+ free(poleev);
+}
+
+static size_t
+oleevent_size(const void *ptr)
+{
+ return ptr ? sizeof(struct oleeventdata) : 0;
+}
+
+static VALUE
+fev_s_allocate(VALUE klass)
+{
+ VALUE obj;
+ struct oleeventdata *poleev;
+ obj = TypedData_Make_Struct(klass, struct oleeventdata, &oleevent_datatype, poleev);
+ poleev->dwCookie = 0;
+ poleev->pConnectionPoint = NULL;
+ poleev->event_id = 0;
+ poleev->pDispatch = NULL;
+ return obj;
+}
+
+static VALUE
+ev_advise(int argc, VALUE *argv, VALUE self)
+{
+
+ VALUE ole, itf;
+ struct oledata *pole = NULL;
+ char *pitf;
+ HRESULT hr;
+ IID iid;
+ ITypeInfo *pTypeInfo = 0;
+ IDispatch *pDispatch;
+ IConnectionPointContainer *pContainer;
+ IConnectionPoint *pConnectionPoint;
+ IEVENTSINKOBJ *pIEV;
+ DWORD dwCookie;
+ struct oleeventdata *poleev;
+ void *p;
+
+ rb_scan_args(argc, argv, "11", &ole, &itf);
+
+ if (!rb_obj_is_kind_of(ole, cWIN32OLE)) {
+ rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE object");
+ }
+
+ if(!RB_TYPE_P(itf, T_NIL)) {
+ pitf = StringValuePtr(itf);
+ if (rb_safe_level() > 0 && OBJ_TAINTED(itf)) {
+ rb_raise(rb_eSecurityError, "insecure event creation - `%s'",
+ StringValuePtr(itf));
+ }
+ hr = find_iid(ole, pitf, &iid, &pTypeInfo);
+ }
+ else {
+ hr = find_default_source(ole, &iid, &pTypeInfo);
+ }
+ if (FAILED(hr)) {
+ ole_raise(hr, rb_eRuntimeError, "interface not found");
+ }
+
+ pole = oledata_get_struct(ole);
+ pDispatch = pole->pDispatch;
+ hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
+ &IID_IConnectionPointContainer,
+ &p);
+ if (FAILED(hr)) {
+ OLE_RELEASE(pTypeInfo);
+ ole_raise(hr, rb_eRuntimeError,
+ "failed to query IConnectionPointContainer");
+ }
+ pContainer = p;
+
+ hr = pContainer->lpVtbl->FindConnectionPoint(pContainer,
+ &iid,
+ &pConnectionPoint);
+ OLE_RELEASE(pContainer);
+ if (FAILED(hr)) {
+ OLE_RELEASE(pTypeInfo);
+ ole_raise(hr, rb_eRuntimeError, "failed to query IConnectionPoint");
+ }
+ pIEV = EVENTSINK_Constructor();
+ pIEV->m_iid = iid;
+ hr = pConnectionPoint->lpVtbl->Advise(pConnectionPoint,
+ (IUnknown*)pIEV,
+ &dwCookie);
+ if (FAILED(hr)) {
+ ole_raise(hr, rb_eRuntimeError, "Advise Error");
+ }
+
+ TypedData_Get_Struct(self, struct oleeventdata, &oleevent_datatype, poleev);
+ pIEV->m_event_id = evs_length();
+ pIEV->pTypeInfo = pTypeInfo;
+ poleev->dwCookie = dwCookie;
+ poleev->pConnectionPoint = pConnectionPoint;
+ poleev->event_id = pIEV->m_event_id;
+ poleev->pDispatch = pDispatch;
+ OLE_ADDREF(pDispatch);
+
+ return self;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT.new(ole, event) #=> WIN32OLE_EVENT object.
+ *
+ * Returns OLE event object.
+ * The first argument specifies WIN32OLE object.
+ * The second argument specifies OLE event name.
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
+ */
+static VALUE
+fev_initialize(int argc, VALUE *argv, VALUE self)
+{
+ ev_advise(argc, argv, self);
+ evs_push(self);
+ rb_ivar_set(self, id_events, rb_ary_new());
+ fev_set_handler(self, Qnil);
+ return self;
+}
+
+static void
+ole_msg_loop(void)
+{
+ MSG msg;
+ while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT.message_loop
+ *
+ * Translates and dispatches Windows message.
+ */
+static VALUE
+fev_s_msg_loop(VALUE klass)
+{
+ ole_msg_loop();
+ return Qnil;
+}
+
+static void
+add_event_call_back(VALUE obj, VALUE event, VALUE data)
+{
+ VALUE events = rb_ivar_get(obj, id_events);
+ if (NIL_P(events) || !RB_TYPE_P(events, T_ARRAY)) {
+ events = rb_ary_new();
+ rb_ivar_set(obj, id_events, events);
+ }
+ ole_delete_event(events, event);
+ rb_ary_push(events, data);
+}
+
+static VALUE
+ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg)
+{
+ struct oleeventdata *poleev;
+ VALUE event, args, data;
+ TypedData_Get_Struct(self, struct oleeventdata, &oleevent_datatype, poleev);
+ if (poleev->pConnectionPoint == NULL) {
+ rb_raise(eWIN32OLERuntimeError, "IConnectionPoint not found. You must call advise at first.");
+ }
+ rb_scan_args(argc, argv, "01*", &event, &args);
+ if(!NIL_P(event)) {
+ if(!RB_TYPE_P(event, T_STRING) && !RB_TYPE_P(event, T_SYMBOL)) {
+ rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
+ }
+ if (RB_TYPE_P(event, T_SYMBOL)) {
+ event = rb_sym2str(event);
+ }
+ }
+ data = rb_ary_new3(4, rb_block_proc(), event, args, is_ary_arg);
+ add_event_call_back(self, event, data);
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT#on_event([event]){...}
+ *
+ * Defines the callback event.
+ * If argument is omitted, this method defines the callback of all events.
+ * If you want to modify reference argument in callback, return hash in
+ * callback. If you want to return value to OLE server as result of callback
+ * use `return' or :return.
+ *
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ev = WIN32OLE_EVENT.new(ie)
+ * ev.on_event("NavigateComplete") {|url| puts url}
+ * ev.on_event() {|ev, *args| puts "#{ev} fired"}
+ *
+ * ev.on_event("BeforeNavigate2") {|*args|
+ * ...
+ * # set true to BeforeNavigate reference argument `Cancel'.
+ * # Cancel is 7-th argument of BeforeNavigate,
+ * # so you can use 6 as key of hash instead of 'Cancel'.
+ * # The argument is counted from 0.
+ * # The hash key of 0 means first argument.)
+ * {:Cancel => true} # or {'Cancel' => true} or {6 => true}
+ * }
+ *
+ * ev.on_event(...) {|*args|
+ * {:return => 1, :xxx => yyy}
+ * }
+ */
+static VALUE
+fev_on_event(int argc, VALUE *argv, VALUE self)
+{
+ return ev_on_event(argc, argv, self, Qfalse);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT#on_event_with_outargs([event]){...}
+ *
+ * Defines the callback of event.
+ * If you want modify argument in callback,
+ * you could use this method instead of WIN32OLE_EVENT#on_event.
+ *
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ev = WIN32OLE_EVENT.new(ie)
+ * ev.on_event_with_outargs('BeforeNavigate2') {|*args|
+ * args.last[6] = true
+ * }
+ */
+static VALUE
+fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self)
+{
+ return ev_on_event(argc, argv, self, Qtrue);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT#off_event([event])
+ *
+ * removes the callback of event.
+ *
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ev = WIN32OLE_EVENT.new(ie)
+ * ev.on_event('BeforeNavigate2') {|*args|
+ * args.last[6] = true
+ * }
+ * ...
+ * ev.off_event('BeforeNavigate2')
+ * ...
+ */
+static VALUE
+fev_off_event(int argc, VALUE *argv, VALUE self)
+{
+ VALUE event = Qnil;
+ VALUE events;
+
+ rb_scan_args(argc, argv, "01", &event);
+ if(!NIL_P(event)) {
+ if(!RB_TYPE_P(event, T_STRING) && !RB_TYPE_P(event, T_SYMBOL)) {
+ rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
+ }
+ if (RB_TYPE_P(event, T_SYMBOL)) {
+ event = rb_sym2str(event);
+ }
+ }
+ events = rb_ivar_get(self, id_events);
+ if (NIL_P(events)) {
+ return Qnil;
+ }
+ ole_delete_event(events, event);
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT#unadvise -> nil
+ *
+ * disconnects OLE server. If this method called, then the WIN32OLE_EVENT object
+ * does not receive the OLE server event any more.
+ * This method is trial implementation.
+ *
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ev = WIN32OLE_EVENT.new(ie)
+ * ev.on_event() {...}
+ * ...
+ * ev.unadvise
+ *
+ */
+static VALUE
+fev_unadvise(VALUE self)
+{
+ struct oleeventdata *poleev;
+ TypedData_Get_Struct(self, struct oleeventdata, &oleevent_datatype, poleev);
+ if (poleev->pConnectionPoint) {
+ ole_msg_loop();
+ evs_delete(poleev->event_id);
+ poleev->pConnectionPoint->lpVtbl->Unadvise(poleev->pConnectionPoint, poleev->dwCookie);
+ OLE_RELEASE(poleev->pConnectionPoint);
+ poleev->pConnectionPoint = NULL;
+ }
+ OLE_FREE(poleev->pDispatch);
+ return Qnil;
+}
+
+static VALUE
+evs_push(VALUE ev)
+{
+ return rb_ary_push(ary_ole_event, ev);
+}
+
+static VALUE
+evs_delete(long i)
+{
+ rb_ary_store(ary_ole_event, i, Qnil);
+ return Qnil;
+}
+
+static VALUE
+evs_entry(long i)
+{
+ return rb_ary_entry(ary_ole_event, i);
+}
+
+static long
+evs_length(void)
+{
+ return RARRAY_LEN(ary_ole_event);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT#handler=
+ *
+ * sets event handler object. If handler object has onXXX
+ * method according to XXX event, then onXXX method is called
+ * when XXX event occurs.
+ *
+ * If handler object has method_missing and there is no
+ * method according to the event, then method_missing
+ * called and 1-st argument is event name.
+ *
+ * If handler object has onXXX method and there is block
+ * defined by WIN32OLE_EVENT#on_event('XXX'){},
+ * then block is executed but handler object method is not called
+ * when XXX event occurs.
+ *
+ * class Handler
+ * def onStatusTextChange(text)
+ * puts "StatusTextChanged"
+ * end
+ * def onPropertyChange(prop)
+ * puts "PropertyChanged"
+ * end
+ * def method_missing(ev, *arg)
+ * puts "other event #{ev}"
+ * end
+ * end
+ *
+ * handler = Handler.new
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ev = WIN32OLE_EVENT.new(ie)
+ * ev.on_event("StatusTextChange") {|*args|
+ * puts "this block executed."
+ * puts "handler.onStatusTextChange method is not called."
+ * }
+ * ev.handler = handler
+ *
+ */
+static VALUE
+fev_set_handler(VALUE self, VALUE val)
+{
+ return rb_ivar_set(self, rb_intern("handler"), val);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_EVENT#handler
+ *
+ * returns handler object.
+ *
+ */
+static VALUE
+fev_get_handler(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("handler"));
+}
+
+void
+Init_win32ole_event(void)
+{
+ ary_ole_event = rb_ary_new();
+ rb_gc_register_mark_object(ary_ole_event);
+ id_events = rb_intern("events");
+ cWIN32OLE_EVENT = rb_define_class("WIN32OLE_EVENT", rb_cObject);
+ rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0);
+ rb_define_alloc_func(cWIN32OLE_EVENT, fev_s_allocate);
+ rb_define_method(cWIN32OLE_EVENT, "initialize", fev_initialize, -1);
+ rb_define_method(cWIN32OLE_EVENT, "on_event", fev_on_event, -1);
+ rb_define_method(cWIN32OLE_EVENT, "on_event_with_outargs", fev_on_event_with_outargs, -1);
+ rb_define_method(cWIN32OLE_EVENT, "off_event", fev_off_event, -1);
+ rb_define_method(cWIN32OLE_EVENT, "unadvise", fev_unadvise, 0);
+ rb_define_method(cWIN32OLE_EVENT, "handler=", fev_set_handler, 1);
+ rb_define_method(cWIN32OLE_EVENT, "handler", fev_get_handler, 0);
+}
diff --git a/ext/win32ole/win32ole_event.h b/ext/win32ole/win32ole_event.h
new file mode 100644
index 0000000000..f1a5aa234d
--- /dev/null
+++ b/ext/win32ole/win32ole_event.h
@@ -0,0 +1,6 @@
+#ifndef WIN32OLE_EVENT_H
+#define WIN32OLE_EVENT_H 1
+
+void Init_win32ole_event(void);
+
+#endif
diff --git a/ext/win32ole/win32ole_method.c b/ext/win32ole/win32ole_method.c
new file mode 100644
index 0000000000..ba8cf78015
--- /dev/null
+++ b/ext/win32ole/win32ole_method.c
@@ -0,0 +1,950 @@
+#include "win32ole.h"
+
+static void olemethod_free(void *ptr);
+static size_t olemethod_size(const void *ptr);
+static VALUE ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name);
+static VALUE olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name);
+static VALUE ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, int mask);
+static VALUE olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo, int index, VALUE name);
+static VALUE folemethod_initialize(VALUE self, VALUE oletype, VALUE method);
+static VALUE folemethod_name(VALUE self);
+static VALUE ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_return_type(VALUE self);
+static VALUE ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_return_vtype(VALUE self);
+static VALUE ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_return_type_detail(VALUE self);
+static VALUE ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_invkind(VALUE self);
+static VALUE folemethod_invoke_kind(VALUE self);
+static VALUE ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_visible(VALUE self);
+static VALUE ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name);
+static VALUE folemethod_event(VALUE self);
+static VALUE folemethod_event_interface(VALUE self);
+static HRESULT ole_method_docinfo_from_type(ITypeInfo *pTypeInfo, UINT method_index, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile);
+static VALUE ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_helpstring(VALUE self);
+static VALUE ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_helpfile(VALUE self);
+static VALUE ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_helpcontext(VALUE self);
+static VALUE ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_dispid(VALUE self);
+static VALUE ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_offset_vtbl(VALUE self);
+static VALUE ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_size_params(VALUE self);
+static VALUE ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_size_opt_params(VALUE self);
+static VALUE ole_method_params(ITypeInfo *pTypeInfo, UINT method_index);
+static VALUE folemethod_params(VALUE self);
+static VALUE folemethod_inspect(VALUE self);
+
+static const rb_data_type_t olemethod_datatype = {
+ "win32ole_method",
+ {NULL, olemethod_free, olemethod_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static void
+olemethod_free(void *ptr)
+{
+ struct olemethoddata *polemethod = ptr;
+ OLE_FREE(polemethod->pTypeInfo);
+ OLE_FREE(polemethod->pOwnerTypeInfo);
+ free(polemethod);
+}
+
+static size_t
+olemethod_size(const void *ptr)
+{
+ return ptr ? sizeof(struct olemethoddata) : 0;
+}
+
+struct olemethoddata *
+olemethod_data_get_struct(VALUE obj)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(obj, struct olemethoddata, &olemethod_datatype, pmethod);
+ return pmethod;
+}
+
+static VALUE
+ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ BSTR bstr;
+ FUNCDESC *pFuncDesc;
+ WORD i;
+ VALUE fname;
+ VALUE method = Qnil;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ }
+ for(i = 0; i < pTypeAttr->cFuncs && method == Qnil; i++) {
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
+ if (FAILED(hr))
+ continue;
+
+ hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, pFuncDesc->memid,
+ &bstr, NULL, NULL, NULL);
+ if (FAILED(hr)) {
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ continue;
+ }
+ fname = WC2VSTR(bstr);
+ if (strcasecmp(StringValuePtr(name), StringValuePtr(fname)) == 0) {
+ olemethod_set_member(self, pTypeInfo, pOwnerTypeInfo, i, fname);
+ method = self;
+ }
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ pFuncDesc=NULL;
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return method;
+}
+
+VALUE
+ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ WORD i;
+ HREFTYPE href;
+ ITypeInfo *pRefTypeInfo;
+ VALUE methods = rb_ary_new();
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ }
+
+ ole_methods_sub(0, pTypeInfo, methods, mask);
+ for(i=0; i < pTypeAttr->cImplTypes; i++){
+ hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo, i, &href);
+ if(FAILED(hr))
+ continue;
+ hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo);
+ if (FAILED(hr))
+ continue;
+ ole_methods_sub(pTypeInfo, pRefTypeInfo, methods, mask);
+ OLE_RELEASE(pRefTypeInfo);
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return methods;
+}
+
+static VALUE
+olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ WORD i;
+ HREFTYPE href;
+ ITypeInfo *pRefTypeInfo;
+ VALUE method = Qnil;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ }
+ method = ole_method_sub(self, 0, pTypeInfo, name);
+ if (method != Qnil) {
+ return method;
+ }
+ for(i=0; i < pTypeAttr->cImplTypes && method == Qnil; i++){
+ hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo, i, &href);
+ if(FAILED(hr))
+ continue;
+ hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo);
+ if (FAILED(hr))
+ continue;
+ method = ole_method_sub(self, pTypeInfo, pRefTypeInfo, name);
+ OLE_RELEASE(pRefTypeInfo);
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return method;
+}
+
+static VALUE
+ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, int mask)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ BSTR bstr;
+ FUNCDESC *pFuncDesc;
+ VALUE method;
+ WORD i;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ }
+ for(i = 0; i < pTypeAttr->cFuncs; i++) {
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
+ if (FAILED(hr))
+ continue;
+
+ hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, pFuncDesc->memid,
+ &bstr, NULL, NULL, NULL);
+ if (FAILED(hr)) {
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ continue;
+ }
+ if(pFuncDesc->invkind & mask) {
+ method = folemethod_s_allocate(cWIN32OLE_METHOD);
+ olemethod_set_member(method, pTypeInfo, pOwnerTypeInfo,
+ i, WC2VSTR(bstr));
+ rb_ary_push(methods, method);
+ }
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ pFuncDesc=NULL;
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+
+ return methods;
+}
+
+VALUE
+create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name)
+{
+
+ VALUE method = folemethod_s_allocate(cWIN32OLE_METHOD);
+ VALUE obj = olemethod_from_typeinfo(method, pTypeInfo, name);
+ return obj;
+}
+
+/*
+ * Document-class: WIN32OLE_METHOD
+ *
+ * <code>WIN32OLE_METHOD</code> objects represent OLE method information.
+ */
+
+static VALUE
+olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo, int index, VALUE name)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ pmethod->pTypeInfo = pTypeInfo;
+ OLE_ADDREF(pTypeInfo);
+ pmethod->pOwnerTypeInfo = pOwnerTypeInfo;
+ OLE_ADDREF(pOwnerTypeInfo);
+ pmethod->index = index;
+ rb_ivar_set(self, rb_intern("name"), name);
+ return self;
+}
+
+VALUE
+folemethod_s_allocate(VALUE klass)
+{
+ struct olemethoddata *pmethod;
+ VALUE obj;
+ obj = TypedData_Make_Struct(klass,
+ struct olemethoddata,
+ &olemethod_datatype, pmethod);
+ pmethod->pTypeInfo = NULL;
+ pmethod->pOwnerTypeInfo = NULL;
+ pmethod->index = 0;
+ return obj;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD.new(ole_type, method) -> WIN32OLE_METHOD object
+ *
+ * Returns a new WIN32OLE_METHOD object which represents the information
+ * about OLE method.
+ * The first argument <i>ole_type</i> specifies WIN32OLE_TYPE object.
+ * The second argument <i>method</i> specifies OLE method name defined OLE class
+ * which represents WIN32OLE_TYPE object.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ */
+static VALUE
+folemethod_initialize(VALUE self, VALUE oletype, VALUE method)
+{
+ VALUE obj = Qnil;
+ ITypeInfo *pTypeInfo;
+ if (rb_obj_is_kind_of(oletype, cWIN32OLE_TYPE)) {
+ SafeStringValue(method);
+ pTypeInfo = itypeinfo(oletype);
+ obj = olemethod_from_typeinfo(self, pTypeInfo, method);
+ if (obj == Qnil) {
+ rb_raise(eWIN32OLERuntimeError, "not found %s",
+ StringValuePtr(method));
+ }
+ }
+ else {
+ rb_raise(rb_eTypeError, "1st argument should be WIN32OLE_TYPE object");
+ }
+ return obj;
+}
+
+/*
+ * call-seq
+ * WIN32OLE_METHOD#name
+ *
+ * Returns the name of the method.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * puts method.name # => SaveAs
+ *
+ */
+static VALUE
+folemethod_name(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("name"));
+}
+
+static VALUE
+ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE type;
+
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
+
+ type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return type;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#return_type
+ *
+ * Returns string of return value type of method.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.return_type # => Workbook
+ *
+ */
+static VALUE
+folemethod_return_type(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_return_type(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE vvt;
+
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
+
+ vvt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return vvt;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#return_vtype
+ *
+ * Returns number of return value type of method.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.return_vtype # => 26
+ *
+ */
+static VALUE
+folemethod_return_vtype(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_return_vtype(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE type = rb_ary_new();
+
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return type;
+
+ ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), type);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return type;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#return_type_detail
+ *
+ * Returns detail information of return value type of method.
+ * The information is array.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * p method.return_type_detail # => ["PTR", "USERDEFINED", "Workbook"]
+ */
+static VALUE
+folemethod_return_type_detail(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_return_type_detail(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE invkind;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if(FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
+ invkind = INT2FIX(pFuncDesc->invkind);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return invkind;
+}
+
+static VALUE
+ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ VALUE type = rb_str_new2("UNKNOWN");
+ VALUE invkind = ole_method_invkind(pTypeInfo, method_index);
+ if((FIX2INT(invkind) & INVOKE_PROPERTYGET) &&
+ (FIX2INT(invkind) & INVOKE_PROPERTYPUT) ) {
+ type = rb_str_new2("PROPERTY");
+ } else if(FIX2INT(invkind) & INVOKE_PROPERTYGET) {
+ type = rb_str_new2("PROPERTYGET");
+ } else if(FIX2INT(invkind) & INVOKE_PROPERTYPUT) {
+ type = rb_str_new2("PROPERTYPUT");
+ } else if(FIX2INT(invkind) & INVOKE_PROPERTYPUTREF) {
+ type = rb_str_new2("PROPERTYPUTREF");
+ } else if(FIX2INT(invkind) & INVOKE_FUNC) {
+ type = rb_str_new2("FUNC");
+ }
+ return type;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_MTHOD#invkind
+ *
+ * Returns the method invoke kind.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.invkind # => 1
+ *
+ */
+static VALUE
+folemethod_invkind(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_invkind(pmethod->pTypeInfo, pmethod->index);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#invoke_kind
+ *
+ * Returns the method kind string. The string is "UNKNOWN" or "PROPERTY"
+ * or "PROPERTY" or "PROPERTYGET" or "PROPERTYPUT" or "PROPERTYPPUTREF"
+ * or "FUNC".
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.invoke_kind # => "FUNC"
+ */
+static VALUE
+folemethod_invoke_kind(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_invoke_kind(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE visible;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if(FAILED(hr))
+ return Qfalse;
+ if (pFuncDesc->wFuncFlags & (FUNCFLAG_FRESTRICTED |
+ FUNCFLAG_FHIDDEN |
+ FUNCFLAG_FNONBROWSABLE)) {
+ visible = Qfalse;
+ } else {
+ visible = Qtrue;
+ }
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return visible;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#visible?
+ *
+ * Returns true if the method is public.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.visible? # => true
+ */
+static VALUE
+folemethod_visible(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_visible(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name)
+{
+ TYPEATTR *pTypeAttr;
+ HRESULT hr;
+ WORD i;
+ int flags;
+ HREFTYPE href;
+ ITypeInfo *pRefTypeInfo;
+ FUNCDESC *pFuncDesc;
+ BSTR bstr;
+ VALUE name;
+ VALUE event = Qfalse;
+
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ return event;
+ if(pTypeAttr->typekind != TKIND_COCLASS) {
+ pTypeInfo->lpVtbl->ReleaseTypeAttr(pTypeInfo, pTypeAttr);
+ return event;
+ }
+ for (i = 0; i < pTypeAttr->cImplTypes; i++) {
+ hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
+ if (FAILED(hr))
+ continue;
+
+ if (flags & IMPLTYPEFLAG_FSOURCE) {
+ hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
+ i, &href);
+ if (FAILED(hr))
+ continue;
+ hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
+ href, &pRefTypeInfo);
+ if (FAILED(hr))
+ continue;
+ hr = pRefTypeInfo->lpVtbl->GetFuncDesc(pRefTypeInfo, method_index,
+ &pFuncDesc);
+ if (FAILED(hr)) {
+ OLE_RELEASE(pRefTypeInfo);
+ continue;
+ }
+
+ hr = pRefTypeInfo->lpVtbl->GetDocumentation(pRefTypeInfo,
+ pFuncDesc->memid,
+ &bstr, NULL, NULL, NULL);
+ if (FAILED(hr)) {
+ pRefTypeInfo->lpVtbl->ReleaseFuncDesc(pRefTypeInfo, pFuncDesc);
+ OLE_RELEASE(pRefTypeInfo);
+ continue;
+ }
+
+ name = WC2VSTR(bstr);
+ pRefTypeInfo->lpVtbl->ReleaseFuncDesc(pRefTypeInfo, pFuncDesc);
+ OLE_RELEASE(pRefTypeInfo);
+ if (rb_str_cmp(method_name, name) == 0) {
+ event = Qtrue;
+ break;
+ }
+ }
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return event;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#event?
+ *
+ * Returns true if the method is event.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
+ * puts method.event? # => true
+ *
+ */
+static VALUE
+folemethod_event(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ if (!pmethod->pOwnerTypeInfo)
+ return Qfalse;
+ return ole_method_event(pmethod->pOwnerTypeInfo,
+ pmethod->index,
+ rb_ivar_get(self, rb_intern("name")));
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#event_interface
+ *
+ * Returns event interface name if the method is event.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
+ * puts method.event_interface # => WorkbookEvents
+ */
+static VALUE
+folemethod_event_interface(VALUE self)
+{
+ BSTR name;
+ struct olemethoddata *pmethod;
+ HRESULT hr;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ if(folemethod_event(self) == Qtrue) {
+ hr = ole_docinfo_from_type(pmethod->pTypeInfo, &name, NULL, NULL, NULL);
+ if(SUCCEEDED(hr))
+ return WC2VSTR(name);
+ }
+ return Qnil;
+}
+
+static HRESULT
+ole_method_docinfo_from_type(
+ ITypeInfo *pTypeInfo,
+ UINT method_index,
+ BSTR *name,
+ BSTR *helpstr,
+ DWORD *helpcontext,
+ BSTR *helpfile
+ )
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return hr;
+ hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, pFuncDesc->memid,
+ name, helpstr,
+ helpcontext, helpfile);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return hr;
+}
+
+static VALUE
+ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ HRESULT hr;
+ BSTR bhelpstring;
+ hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, &bhelpstring,
+ NULL, NULL);
+ if (FAILED(hr))
+ return Qnil;
+ return WC2VSTR(bhelpstring);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#helpstring
+ *
+ * Returns help string of OLE method. If the help string is not found,
+ * then the method returns nil.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
+ * method = WIN32OLE_METHOD.new(tobj, 'Navigate')
+ * puts method.helpstring # => Navigates to a URL or file.
+ *
+ */
+static VALUE
+folemethod_helpstring(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_helpstring(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ HRESULT hr;
+ BSTR bhelpfile;
+ hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, NULL,
+ NULL, &bhelpfile);
+ if (FAILED(hr))
+ return Qnil;
+ return WC2VSTR(bhelpfile);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#helpfile
+ *
+ * Returns help file. If help file is not found, then
+ * the method returns nil.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.helpfile # => C:\...\VBAXL9.CHM
+ */
+static VALUE
+folemethod_helpfile(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+
+ return ole_method_helpfile(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ HRESULT hr;
+ DWORD helpcontext = 0;
+ hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, NULL,
+ &helpcontext, NULL);
+ if (FAILED(hr))
+ return Qnil;
+ return INT2FIX(helpcontext);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#helpcontext
+ *
+ * Returns help context.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.helpcontext # => 65717
+ */
+static VALUE
+folemethod_helpcontext(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_helpcontext(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE dispid = Qnil;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return dispid;
+ dispid = INT2NUM(pFuncDesc->memid);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return dispid;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#dispid
+ *
+ * Returns dispatch ID.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.dispid # => 181
+ */
+static VALUE
+folemethod_dispid(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_dispid(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE offset_vtbl = Qnil;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return offset_vtbl;
+ offset_vtbl = INT2FIX(pFuncDesc->oVft);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return offset_vtbl;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#offset_vtbl
+ *
+ * Returns the offset ov VTBL.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
+ * method = WIN32OLE_METHOD.new(tobj, 'Add')
+ * puts method.offset_vtbl # => 40
+ */
+static VALUE
+folemethod_offset_vtbl(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_offset_vtbl(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE size_params = Qnil;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return size_params;
+ size_params = INT2FIX(pFuncDesc->cParams);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return size_params;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#size_params
+ *
+ * Returns the size of arguments of the method.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * puts method.size_params # => 11
+ *
+ */
+static VALUE
+folemethod_size_params(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_size_params(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE size_opt_params = Qnil;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return size_opt_params;
+ size_opt_params = INT2FIX(pFuncDesc->cParamsOpt);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return size_opt_params;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#size_opt_params
+ *
+ * Returns the size of optional parameters.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * puts method.size_opt_params # => 4
+ */
+static VALUE
+folemethod_size_opt_params(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_size_opt_params(pmethod->pTypeInfo, pmethod->index);
+}
+
+static VALUE
+ole_method_params(ITypeInfo *pTypeInfo, UINT method_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ BSTR *bstrs;
+ UINT len, i;
+ VALUE param;
+ VALUE params = rb_ary_new();
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return params;
+
+ len = 0;
+ bstrs = ALLOCA_N(BSTR, pFuncDesc->cParams + 1);
+ hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pFuncDesc->memid,
+ bstrs, pFuncDesc->cParams + 1,
+ &len);
+ if (FAILED(hr)) {
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return params;
+ }
+ SysFreeString(bstrs[0]);
+ if (pFuncDesc->cParams > 0) {
+ for(i = 1; i < len; i++) {
+ param = create_win32ole_param(pTypeInfo, method_index, i-1, WC2VSTR(bstrs[i]));
+ rb_ary_push(params, param);
+ }
+ }
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return params;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#params
+ *
+ * returns array of WIN32OLE_PARAM object corresponding with method parameters.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * p method.params # => [Filename, FileFormat, Password, WriteResPassword,
+ * ReadOnlyRecommended, CreateBackup, AccessMode,
+ * ConflictResolution, AddToMru, TextCodepage,
+ * TextVisualLayout]
+ */
+static VALUE
+folemethod_params(VALUE self)
+{
+ struct olemethoddata *pmethod;
+ TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ return ole_method_params(pmethod->pTypeInfo, pmethod->index);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_METHOD#inspect -> String
+ *
+ * Returns the method name with class name.
+ *
+ */
+static VALUE
+folemethod_inspect(VALUE self)
+{
+ return default_inspect(self, "WIN32OLE_METHOD");
+}
+
+void Init_win32ole_method(void)
+{
+ cWIN32OLE_METHOD = rb_define_class("WIN32OLE_METHOD", rb_cObject);
+ rb_define_alloc_func(cWIN32OLE_METHOD, folemethod_s_allocate);
+ rb_define_method(cWIN32OLE_METHOD, "initialize", folemethod_initialize, 2);
+ rb_define_method(cWIN32OLE_METHOD, "name", folemethod_name, 0);
+ rb_define_method(cWIN32OLE_METHOD, "return_type", folemethod_return_type, 0);
+ rb_define_method(cWIN32OLE_METHOD, "return_vtype", folemethod_return_vtype, 0);
+ rb_define_method(cWIN32OLE_METHOD, "return_type_detail", folemethod_return_type_detail, 0);
+ rb_define_method(cWIN32OLE_METHOD, "invoke_kind", folemethod_invoke_kind, 0);
+ rb_define_method(cWIN32OLE_METHOD, "invkind", folemethod_invkind, 0);
+ rb_define_method(cWIN32OLE_METHOD, "visible?", folemethod_visible, 0);
+ rb_define_method(cWIN32OLE_METHOD, "event?", folemethod_event, 0);
+ rb_define_method(cWIN32OLE_METHOD, "event_interface", folemethod_event_interface, 0);
+ rb_define_method(cWIN32OLE_METHOD, "helpstring", folemethod_helpstring, 0);
+ rb_define_method(cWIN32OLE_METHOD, "helpfile", folemethod_helpfile, 0);
+ rb_define_method(cWIN32OLE_METHOD, "helpcontext", folemethod_helpcontext, 0);
+ rb_define_method(cWIN32OLE_METHOD, "dispid", folemethod_dispid, 0);
+ rb_define_method(cWIN32OLE_METHOD, "offset_vtbl", folemethod_offset_vtbl, 0);
+ rb_define_method(cWIN32OLE_METHOD, "size_params", folemethod_size_params, 0);
+ rb_define_method(cWIN32OLE_METHOD, "size_opt_params", folemethod_size_opt_params, 0);
+ rb_define_method(cWIN32OLE_METHOD, "params", folemethod_params, 0);
+ rb_define_alias(cWIN32OLE_METHOD, "to_s", "name");
+ rb_define_method(cWIN32OLE_METHOD, "inspect", folemethod_inspect, 0);
+}
diff --git a/ext/win32ole/win32ole_method.h b/ext/win32ole/win32ole_method.h
new file mode 100644
index 0000000000..ff2898ebeb
--- /dev/null
+++ b/ext/win32ole/win32ole_method.h
@@ -0,0 +1,16 @@
+#ifndef WIN32OLE_METHOD_H
+#define WIN32OLE_METHOD_H 1
+
+struct olemethoddata {
+ ITypeInfo *pOwnerTypeInfo;
+ ITypeInfo *pTypeInfo;
+ UINT index;
+};
+
+VALUE cWIN32OLE_METHOD;
+VALUE folemethod_s_allocate(VALUE klass);
+VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
+VALUE create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name);
+struct olemethoddata *olemethod_data_get_struct(VALUE obj);
+void Init_win32ole_method(void);
+#endif
diff --git a/ext/win32ole/win32ole_param.c b/ext/win32ole/win32ole_param.c
new file mode 100644
index 0000000000..31cf853b04
--- /dev/null
+++ b/ext/win32ole/win32ole_param.c
@@ -0,0 +1,438 @@
+#include "win32ole.h"
+
+VALUE cWIN32OLE_PARAM;
+
+struct oleparamdata {
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
+ UINT index;
+};
+
+static void oleparam_free(void *ptr);
+static size_t oleparam_size(const void *ptr);
+static VALUE foleparam_s_allocate(VALUE klass);
+static VALUE oleparam_ole_param_from_index(VALUE self, ITypeInfo *pTypeInfo, UINT method_index, int param_index);
+static VALUE oleparam_ole_param(VALUE self, VALUE olemethod, int n);
+static VALUE foleparam_initialize(VALUE self, VALUE olemethod, VALUE n);
+static VALUE foleparam_name(VALUE self);
+static VALUE ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
+static VALUE foleparam_ole_type(VALUE self);
+static VALUE ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
+static VALUE foleparam_ole_type_detail(VALUE self);
+static VALUE ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT mask);
+static VALUE foleparam_input(VALUE self);
+static VALUE foleparam_output(VALUE self);
+static VALUE foleparam_optional(VALUE self);
+static VALUE foleparam_retval(VALUE self);
+static VALUE ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
+static VALUE foleparam_default(VALUE self);
+static VALUE foleparam_inspect(VALUE self);
+
+static const rb_data_type_t oleparam_datatype = {
+ "win32ole_param",
+ {NULL, oleparam_free, oleparam_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static void
+oleparam_free(void *ptr)
+{
+ struct oleparamdata *pole = ptr;
+ OLE_FREE(pole->pTypeInfo);
+ free(pole);
+}
+
+static size_t
+oleparam_size(const void *ptr)
+{
+ return ptr ? sizeof(struct oleparamdata) : 0;
+}
+
+VALUE
+create_win32ole_param(ITypeInfo *pTypeInfo, UINT method_index, UINT index, VALUE name)
+{
+ struct oleparamdata *pparam;
+ VALUE obj = foleparam_s_allocate(cWIN32OLE_PARAM);
+ TypedData_Get_Struct(obj, struct oleparamdata, &oleparam_datatype, pparam);
+
+ pparam->pTypeInfo = pTypeInfo;
+ OLE_ADDREF(pTypeInfo);
+ pparam->method_index = method_index;
+ pparam->index = index;
+ rb_ivar_set(obj, rb_intern("name"), name);
+ return obj;
+}
+
+/*
+ * Document-class: WIN32OLE_PARAM
+ *
+ * <code>WIN32OLE_PARAM</code> objects represent param information of
+ * the OLE method.
+ */
+static VALUE
+foleparam_s_allocate(VALUE klass)
+{
+ struct oleparamdata *pparam;
+ VALUE obj;
+ obj = TypedData_Make_Struct(klass,
+ struct oleparamdata,
+ &oleparam_datatype, pparam);
+ pparam->pTypeInfo = NULL;
+ pparam->method_index = 0;
+ pparam->index = 0;
+ return obj;
+}
+
+static VALUE
+oleparam_ole_param_from_index(VALUE self, ITypeInfo *pTypeInfo, UINT method_index, int param_index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ BSTR *bstrs;
+ UINT len;
+ struct oleparamdata *pparam;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ ole_raise(hr, rb_eRuntimeError, "fail to ITypeInfo::GetFuncDesc");
+
+ len = 0;
+ bstrs = ALLOCA_N(BSTR, pFuncDesc->cParams + 1);
+ hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pFuncDesc->memid,
+ bstrs, pFuncDesc->cParams + 1,
+ &len);
+ if (FAILED(hr)) {
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ ole_raise(hr, rb_eRuntimeError, "fail to ITypeInfo::GetNames");
+ }
+ SysFreeString(bstrs[0]);
+ if (param_index < 1 || len <= (UINT)param_index)
+ {
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ rb_raise(rb_eIndexError, "index of param must be in 1..%d", len);
+ }
+
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ pparam->pTypeInfo = pTypeInfo;
+ OLE_ADDREF(pTypeInfo);
+ pparam->method_index = method_index;
+ pparam->index = param_index - 1;
+ rb_ivar_set(self, rb_intern("name"), WC2VSTR(bstrs[param_index]));
+
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return self;
+}
+
+static VALUE
+oleparam_ole_param(VALUE self, VALUE olemethod, int n)
+{
+ struct olemethoddata *pmethod = olemethod_data_get_struct(olemethod);
+ return oleparam_ole_param_from_index(self, pmethod->pTypeInfo, pmethod->index, n);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM.new(method, n) -> WIN32OLE_PARAM object
+ *
+ * Returns WIN32OLE_PARAM object which represents OLE parameter information.
+ * 1st argument should be WIN32OLE_METHOD object.
+ * 2nd argument `n' is n-th parameter of the method specified by 1st argument.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Scripting Runtime', 'IFileSystem')
+ * method = WIN32OLE_METHOD.new(tobj, 'CreateTextFile')
+ * param = WIN32OLE_PARAM.new(method, 2) # => #<WIN32OLE_PARAM:Overwrite=true>
+ *
+ */
+static VALUE
+foleparam_initialize(VALUE self, VALUE olemethod, VALUE n)
+{
+ int idx;
+ if (!rb_obj_is_kind_of(olemethod, cWIN32OLE_METHOD)) {
+ rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE_METHOD object");
+ }
+ idx = FIX2INT(n);
+ return oleparam_ole_param(self, olemethod, idx);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#name
+ *
+ * Returns name.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * param1 = method.params[0]
+ * puts param1.name # => Filename
+ */
+static VALUE
+foleparam_name(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("name"));
+}
+
+static VALUE
+ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE type = rb_str_new2("unknown type");
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return type;
+ type = ole_typedesc2val(pTypeInfo,
+ &(pFuncDesc->lprgelemdescParam[index].tdesc), Qnil);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return type;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#ole_type
+ *
+ * Returns OLE type of WIN32OLE_PARAM object(parameter of OLE method).
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * param1 = method.params[0]
+ * puts param1.ole_type # => VARIANT
+ */
+static VALUE
+foleparam_ole_type(VALUE self)
+{
+ struct oleparamdata *pparam;
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ return ole_param_ole_type(pparam->pTypeInfo, pparam->method_index,
+ pparam->index);
+}
+
+static VALUE
+ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE typedetail = rb_ary_new();
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return typedetail;
+ ole_typedesc2val(pTypeInfo,
+ &(pFuncDesc->lprgelemdescParam[index].tdesc), typedetail);
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return typedetail;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#ole_type_detail
+ *
+ * Returns detail information of type of argument.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'IWorksheetFunction')
+ * method = WIN32OLE_METHOD.new(tobj, 'SumIf')
+ * param1 = method.params[0]
+ * p param1.ole_type_detail # => ["PTR", "USERDEFINED", "Range"]
+ */
+static VALUE
+foleparam_ole_type_detail(VALUE self)
+{
+ struct oleparamdata *pparam;
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ return ole_param_ole_type_detail(pparam->pTypeInfo, pparam->method_index,
+ pparam->index);
+}
+
+static VALUE
+ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT mask)
+{
+ FUNCDESC *pFuncDesc;
+ HRESULT hr;
+ VALUE ret = Qfalse;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if(FAILED(hr))
+ return ret;
+ if (V_UNION1((&(pFuncDesc->lprgelemdescParam[index])), paramdesc).wParamFlags &mask)
+ ret = Qtrue;
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return ret;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#input?
+ *
+ * Returns true if the parameter is input.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * param1 = method.params[0]
+ * puts param1.input? # => true
+ */
+static VALUE
+foleparam_input(VALUE self)
+{
+ struct oleparamdata *pparam;
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
+ pparam->index, PARAMFLAG_FIN);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE#output?
+ *
+ * Returns true if argument is output.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'DWebBrowserEvents')
+ * method = WIN32OLE_METHOD.new(tobj, 'NewWindow')
+ * method.params.each do |param|
+ * puts "#{param.name} #{param.output?}"
+ * end
+ *
+ * The result of above script is following:
+ * URL false
+ * Flags false
+ * TargetFrameName false
+ * PostData false
+ * Headers false
+ * Processed true
+ */
+static VALUE
+foleparam_output(VALUE self)
+{
+ struct oleparamdata *pparam;
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
+ pparam->index, PARAMFLAG_FOUT);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#optional?
+ *
+ * Returns true if argument is optional.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * param1 = method.params[0]
+ * puts "#{param1.name} #{param1.optional?}" # => Filename true
+ */
+static VALUE
+foleparam_optional(VALUE self)
+{
+ struct oleparamdata *pparam;
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
+ pparam->index, PARAMFLAG_FOPT);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#retval?
+ *
+ * Returns true if argument is return value.
+ * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library',
+ * 'DirectPlayLobbyConnection')
+ * method = WIN32OLE_METHOD.new(tobj, 'GetPlayerShortName')
+ * param = method.params[0]
+ * puts "#{param.name} #{param.retval?}" # => name true
+ */
+static VALUE
+foleparam_retval(VALUE self)
+{
+ struct oleparamdata *pparam;
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
+ pparam->index, PARAMFLAG_FRETVAL);
+}
+
+static VALUE
+ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
+{
+ FUNCDESC *pFuncDesc;
+ ELEMDESC *pElemDesc;
+ PARAMDESCEX * pParamDescEx;
+ HRESULT hr;
+ USHORT wParamFlags;
+ USHORT mask = PARAMFLAG_FOPT|PARAMFLAG_FHASDEFAULT;
+ VALUE defval = Qnil;
+ hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
+ if (FAILED(hr))
+ return defval;
+ pElemDesc = &pFuncDesc->lprgelemdescParam[index];
+ wParamFlags = V_UNION1(pElemDesc, paramdesc).wParamFlags;
+ if ((wParamFlags & mask) == mask) {
+ pParamDescEx = V_UNION1(pElemDesc, paramdesc).pparamdescex;
+ defval = ole_variant2val(&pParamDescEx->varDefaultValue);
+ }
+ pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
+ return defval;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#default
+ *
+ * Returns default value. If the default value does not exist,
+ * this method returns nil.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
+ * method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
+ * method.params.each do |param|
+ * if param.default
+ * puts "#{param.name} (= #{param.default})"
+ * else
+ * puts "#{param}"
+ * end
+ * end
+ *
+ * The above script result is following:
+ * Filename
+ * FileFormat
+ * Password
+ * WriteResPassword
+ * ReadOnlyRecommended
+ * CreateBackup
+ * AccessMode (= 1)
+ * ConflictResolution
+ * AddToMru
+ * TextCodepage
+ * TextVisualLayout
+ */
+static VALUE
+foleparam_default(VALUE self)
+{
+ struct oleparamdata *pparam;
+ TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ return ole_param_default(pparam->pTypeInfo, pparam->method_index,
+ pparam->index);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_PARAM#inspect -> String
+ *
+ * Returns the parameter name with class name. If the parameter has default value,
+ * then returns name=value string with class name.
+ *
+ */
+static VALUE
+foleparam_inspect(VALUE self)
+{
+ VALUE detail = foleparam_name(self);
+ VALUE defval = foleparam_default(self);
+ if (defval != Qnil) {
+ rb_str_cat2(detail, "=");
+ rb_str_concat(detail, rb_inspect(defval));
+ }
+ return make_inspect("WIN32OLE_PARAM", detail);
+}
+
+void
+Init_win32ole_param(void)
+{
+ cWIN32OLE_PARAM = rb_define_class("WIN32OLE_PARAM", rb_cObject);
+ rb_define_alloc_func(cWIN32OLE_PARAM, foleparam_s_allocate);
+ rb_define_method(cWIN32OLE_PARAM, "initialize", foleparam_initialize, 2);
+ rb_define_method(cWIN32OLE_PARAM, "name", foleparam_name, 0);
+ rb_define_method(cWIN32OLE_PARAM, "ole_type", foleparam_ole_type, 0);
+ rb_define_method(cWIN32OLE_PARAM, "ole_type_detail", foleparam_ole_type_detail, 0);
+ rb_define_method(cWIN32OLE_PARAM, "input?", foleparam_input, 0);
+ rb_define_method(cWIN32OLE_PARAM, "output?", foleparam_output, 0);
+ rb_define_method(cWIN32OLE_PARAM, "optional?", foleparam_optional, 0);
+ rb_define_method(cWIN32OLE_PARAM, "retval?", foleparam_retval, 0);
+ rb_define_method(cWIN32OLE_PARAM, "default", foleparam_default, 0);
+ rb_define_alias(cWIN32OLE_PARAM, "to_s", "name");
+ rb_define_method(cWIN32OLE_PARAM, "inspect", foleparam_inspect, 0);
+}
diff --git a/ext/win32ole/win32ole_param.h b/ext/win32ole/win32ole_param.h
new file mode 100644
index 0000000000..7e2650cb44
--- /dev/null
+++ b/ext/win32ole/win32ole_param.h
@@ -0,0 +1,8 @@
+#ifndef WIN32OLE_PARAM_H
+#define WIN32OLE_PARAM_H
+
+VALUE create_win32ole_param(ITypeInfo *pTypeInfo, UINT method_index, UINT index, VALUE name);
+void Init_win32ole_param(void);
+
+#endif
+
diff --git a/ext/win32ole/win32ole_record.c b/ext/win32ole/win32ole_record.c
new file mode 100644
index 0000000000..e8838832a7
--- /dev/null
+++ b/ext/win32ole/win32ole_record.c
@@ -0,0 +1,604 @@
+#include "win32ole.h"
+
+struct olerecorddata {
+ IRecordInfo *pri;
+ void *pdata;
+};
+
+static HRESULT recordinfo_from_itypelib(ITypeLib *pTypeLib, VALUE name, IRecordInfo **ppri);
+static int hash2olerec(VALUE key, VALUE val, VALUE rec);
+static void olerecord_free(void *pvar);
+static size_t olerecord_size(const void *ptr);
+static VALUE folerecord_s_allocate(VALUE klass);
+static VALUE folerecord_initialize(VALUE self, VALUE typename, VALUE oleobj);
+static VALUE folerecord_to_h(VALUE self);
+static VALUE folerecord_typename(VALUE self);
+static VALUE olerecord_ivar_get(VALUE self, VALUE name);
+static VALUE olerecord_ivar_set(VALUE self, VALUE name, VALUE val);
+static VALUE folerecord_method_missing(int argc, VALUE *argv, VALUE self);
+static VALUE folerecord_ole_instance_variable_get(VALUE self, VALUE name);
+static VALUE folerecord_ole_instance_variable_set(VALUE self, VALUE name, VALUE val);
+static VALUE folerecord_inspect(VALUE self);
+
+static const rb_data_type_t olerecord_datatype = {
+ "win32ole_record",
+ {NULL, olerecord_free, olerecord_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static HRESULT
+recordinfo_from_itypelib(ITypeLib *pTypeLib, VALUE name, IRecordInfo **ppri)
+{
+
+ unsigned int count;
+ unsigned int i;
+ ITypeInfo *pTypeInfo;
+ HRESULT hr = OLE_E_LAST;
+ BSTR bstr;
+
+ count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
+ for (i = 0; i < count; i++) {
+ hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i,
+ &bstr, NULL, NULL, NULL);
+ if (FAILED(hr))
+ continue;
+
+ hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo);
+ if (FAILED(hr))
+ continue;
+
+ if (rb_str_cmp(WC2VSTR(bstr), name) == 0) {
+ hr = GetRecordInfoFromTypeInfo(pTypeInfo, ppri);
+ OLE_RELEASE(pTypeInfo);
+ return hr;
+ }
+ OLE_RELEASE(pTypeInfo);
+ }
+ hr = OLE_E_LAST;
+ return hr;
+}
+
+static int
+hash2olerec(VALUE key, VALUE val, VALUE rec)
+{
+ VARIANT var;
+ OLECHAR *pbuf;
+ struct olerecorddata *prec;
+ IRecordInfo *pri;
+ HRESULT hr;
+
+ if (val != Qnil) {
+ TypedData_Get_Struct(rec, struct olerecorddata, &olerecord_datatype, prec);
+ pri = prec->pri;
+ VariantInit(&var);
+ ole_val2variant(val, &var);
+ pbuf = ole_vstr2wc(key);
+ hr = pri->lpVtbl->PutField(pri, INVOKE_PROPERTYPUT, prec->pdata, pbuf, &var);
+ SysFreeString(pbuf);
+ VariantClear(&var);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to putfield of `%s`", StringValuePtr(key));
+ }
+ }
+ return ST_CONTINUE;
+}
+
+void
+ole_rec2variant(VALUE rec, VARIANT *var)
+{
+ struct olerecorddata *prec;
+ ULONG size = 0;
+ IRecordInfo *pri;
+ HRESULT hr;
+ VALUE fields;
+ TypedData_Get_Struct(rec, struct olerecorddata, &olerecord_datatype, prec);
+ pri = prec->pri;
+ if (pri) {
+ hr = pri->lpVtbl->GetSize(pri, &size);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to get size for allocation of VT_RECORD object");
+ }
+ if (prec->pdata) {
+ free(prec->pdata);
+ }
+ prec->pdata = ALLOC_N(char, size);
+ if (!prec->pdata) {
+ rb_raise(rb_eRuntimeError, "failed to memory allocation of %lu bytes", (unsigned long)size);
+ }
+ hr = pri->lpVtbl->RecordInit(pri, prec->pdata);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to initialize VT_RECORD object");
+ }
+ fields = folerecord_to_h(rec);
+ rb_hash_foreach(fields, hash2olerec, rec);
+ V_RECORDINFO(var) = pri;
+ V_RECORD(var) = prec->pdata;
+ V_VT(var) = VT_RECORD;
+ } else {
+ rb_raise(eWIN32OLERuntimeError, "failed to retrieve IRecordInfo interface");
+ }
+}
+
+void
+olerecord_set_ivar(VALUE obj, IRecordInfo *pri, void *prec)
+{
+ HRESULT hr;
+ BSTR bstr;
+ BSTR *bstrs;
+ ULONG count = 0;
+ ULONG i;
+ VALUE fields;
+ VALUE val;
+ VARIANT var;
+ void *pdata = NULL;
+ struct olerecorddata *pvar;
+
+ TypedData_Get_Struct(obj, struct olerecorddata, &olerecord_datatype, pvar);
+ OLE_ADDREF(pri);
+ OLE_RELEASE(pvar->pri);
+ pvar->pri = pri;
+
+ hr = pri->lpVtbl->GetName(pri, &bstr);
+ if (SUCCEEDED(hr)) {
+ rb_ivar_set(obj, rb_intern("typename"), WC2VSTR(bstr));
+ }
+
+ hr = pri->lpVtbl->GetFieldNames(pri, &count, NULL);
+ if (FAILED(hr) || count == 0)
+ return;
+ bstrs = ALLOCA_N(BSTR, count);
+ hr = pri->lpVtbl->GetFieldNames(pri, &count, bstrs);
+ if (FAILED(hr)) {
+ return;
+ }
+
+ fields = rb_hash_new();
+ rb_ivar_set(obj, rb_intern("fields"), fields);
+ for (i = 0; i < count; i++) {
+ pdata = NULL;
+ VariantInit(&var);
+ val = Qnil;
+ if (prec) {
+ hr = pri->lpVtbl->GetFieldNoCopy(pri, prec, bstrs[i], &var, &pdata);
+ if (SUCCEEDED(hr)) {
+ val = ole_variant2val(&var);
+ }
+ }
+ rb_hash_aset(fields, WC2VSTR(bstrs[i]), val);
+ }
+}
+
+VALUE
+create_win32ole_record(IRecordInfo *pri, void *prec)
+{
+ VALUE obj = folerecord_s_allocate(cWIN32OLE_RECORD);
+ olerecord_set_ivar(obj, pri, prec);
+ return obj;
+}
+
+/*
+ * Document-class: WIN32OLE_RECORD
+ *
+ * <code>WIN32OLE_RECORD</code> objects represents VT_RECORD OLE variant.
+ * Win32OLE returns WIN32OLE_RECORD object if the result value of invoking
+ * OLE methods.
+ *
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * Public Structure Book
+ * <MarshalAs(UnmanagedType.BStr)> _
+ * Public title As String
+ * Public cost As Integer
+ * End Structure
+ * Public Function getBook() As Book
+ * Dim book As New Book
+ * book.title = "The Ruby Book"
+ * book.cost = 20
+ * Return book
+ * End Function
+ * End Class
+ *
+ * then, you can retrieve getBook return value from the following
+ * Ruby script:
+ *
+ * require 'win32ole'
+ * obj = WIN32OLE.new('ComServer.ComClass')
+ * book = obj.getBook
+ * book.class # => WIN32OLE_RECORD
+ * book.title # => "The Ruby Book"
+ * book.cost # => 20
+ *
+ */
+
+static void
+olerecord_free(void *ptr) {
+ struct olerecorddata *pvar = ptr;
+ OLE_FREE(pvar->pri);
+ if (pvar->pdata) {
+ free(pvar->pdata);
+ }
+ free(pvar);
+}
+
+static size_t
+olerecord_size(const void *ptr)
+{
+ const struct olerecorddata *pvar = ptr;
+ size_t s = 0;
+ ULONG size = 0;
+ HRESULT hr;
+ if (ptr) {
+ s += sizeof(struct olerecorddata);
+ if (pvar->pri) {
+ hr = pvar->pri->lpVtbl->GetSize(pvar->pri, &size);
+ if (SUCCEEDED(hr)) {
+ s += size;
+ }
+ }
+ }
+ return s;
+}
+
+static VALUE
+folerecord_s_allocate(VALUE klass) {
+ VALUE obj = Qnil;
+ struct olerecorddata *pvar;
+ obj = TypedData_Make_Struct(klass, struct olerecorddata, &olerecord_datatype, pvar);
+ pvar->pri = NULL;
+ pvar->pdata = NULL;
+ return obj;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_RECORD.new(typename, obj) -> WIN32OLE_RECORD object
+ *
+ * Returns WIN32OLE_RECORD object. The first argument is struct name (String
+ * or Symbol).
+ * The second parameter obj should be WIN32OLE object or WIN32OLE_TYPELIB object.
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * Public Structure Book
+ * <MarshalAs(UnmanagedType.BStr)> _
+ * Public title As String
+ * Public cost As Integer
+ * End Structure
+ * End Class
+ *
+ * then, you can create WIN32OLE_RECORD object is as following:
+ *
+ * require 'win32ole'
+ * obj = WIN32OLE.new('ComServer.ComClass')
+ * book1 = WIN32OLE_RECORD.new('Book', obj) # => WIN32OLE_RECORD object
+ * tlib = obj.ole_typelib
+ * book2 = WIN32OLE_RECORD.new('Book', tlib) # => WIN32OLE_RECORD object
+ *
+ */
+static VALUE
+folerecord_initialize(VALUE self, VALUE typename, VALUE oleobj) {
+ HRESULT hr;
+ ITypeLib *pTypeLib = NULL;
+ IRecordInfo *pri = NULL;
+
+ if (!RB_TYPE_P(typename, T_STRING) && !RB_TYPE_P(typename, T_SYMBOL)) {
+ rb_raise(rb_eArgError, "1st argument should be String or Symbol");
+ }
+ if (RB_TYPE_P(typename, T_SYMBOL)) {
+ typename = rb_sym2str(typename);
+ }
+
+ hr = S_OK;
+ if(rb_obj_is_kind_of(oleobj, cWIN32OLE)) {
+ hr = typelib_from_val(oleobj, &pTypeLib);
+ } else if (rb_obj_is_kind_of(oleobj, cWIN32OLE_TYPELIB)) {
+ pTypeLib = itypelib(oleobj);
+ OLE_ADDREF(pTypeLib);
+ if (pTypeLib) {
+ hr = S_OK;
+ } else {
+ hr = E_FAIL;
+ }
+ } else {
+ rb_raise(rb_eArgError, "2nd argument should be WIN32OLE object or WIN32OLE_TYPELIB object");
+ }
+
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "fail to query ITypeLib interface");
+ }
+
+ hr = recordinfo_from_itypelib(pTypeLib, typename, &pri);
+ OLE_RELEASE(pTypeLib);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "fail to query IRecordInfo interface for `%s'", StringValuePtr(typename));
+ }
+
+ olerecord_set_ivar(self, pri, NULL);
+
+ return self;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_RECORD#to_h #=> Ruby Hash object.
+ *
+ * Returns Ruby Hash object which represents VT_RECORD variable.
+ * The keys of Hash object are member names of VT_RECORD OLE variable and
+ * the values of Hash object are values of VT_RECORD OLE variable.
+ *
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * Public Structure Book
+ * <MarshalAs(UnmanagedType.BStr)> _
+ * Public title As String
+ * Public cost As Integer
+ * End Structure
+ * Public Function getBook() As Book
+ * Dim book As New Book
+ * book.title = "The Ruby Book"
+ * book.cost = 20
+ * Return book
+ * End Function
+ * End Class
+ *
+ * then, the result of WIN32OLE_RECORD#to_h is the following:
+ *
+ * require 'win32ole'
+ * obj = WIN32OLE.new('ComServer.ComClass')
+ * book = obj.getBook
+ * book.to_h # => {"title"=>"The Ruby Book", "cost"=>20}
+ *
+ */
+static VALUE
+folerecord_to_h(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("fields"));
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_RECORD#typename #=> String object
+ *
+ * Returns the type name of VT_RECORD OLE variable.
+ *
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * Public Structure Book
+ * <MarshalAs(UnmanagedType.BStr)> _
+ * Public title As String
+ * Public cost As Integer
+ * End Structure
+ * Public Function getBook() As Book
+ * Dim book As New Book
+ * book.title = "The Ruby Book"
+ * book.cost = 20
+ * Return book
+ * End Function
+ * End Class
+ *
+ * then, the result of WIN32OLE_RECORD#typename is the following:
+ *
+ * require 'win32ole'
+ * obj = WIN32OLE.new('ComServer.ComClass')
+ * book = obj.getBook
+ * book.typename # => "Book"
+ *
+ */
+static VALUE
+folerecord_typename(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("typename"));
+}
+
+static VALUE
+olerecord_ivar_get(VALUE self, VALUE name)
+{
+ VALUE fields;
+ fields = rb_ivar_get(self, rb_intern("fields"));
+ return rb_hash_fetch(fields, name);
+}
+
+static VALUE
+olerecord_ivar_set(VALUE self, VALUE name, VALUE val)
+{
+ long len;
+ char *p;
+ VALUE fields;
+ len = RSTRING_LEN(name);
+ p = RSTRING_PTR(name);
+ if (p[len-1] == '=') {
+ name = rb_str_subseq(name, 0, len-1);
+ }
+ fields = rb_ivar_get(self, rb_intern("fields"));
+ rb_hash_fetch(fields, name);
+ return rb_hash_aset(fields, name, val);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_RECORD#method_missing(name)
+ *
+ * Returns value specified by the member name of VT_RECORD OLE variable.
+ * Or sets value specified by the member name of VT_RECORD OLE variable.
+ * If the member name is not correct, KeyError exception is raised.
+ *
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * Public Structure Book
+ * <MarshalAs(UnmanagedType.BStr)> _
+ * Public title As String
+ * Public cost As Integer
+ * End Structure
+ * End Class
+ *
+ * Then getting/setting value from Ruby is as the following:
+ *
+ * obj = WIN32OLE.new('ComServer.ComClass')
+ * book = WIN32OLE_RECORD.new('Book', obj)
+ * book.title # => nil ( book.method_missing(:title) is invoked. )
+ * book.title = "Ruby" # ( book.method_missing(:title=, "Ruby") is invoked. )
+ */
+static VALUE
+folerecord_method_missing(int argc, VALUE *argv, VALUE self)
+{
+ VALUE name;
+ rb_check_arity(argc, 1, 2);
+ name = rb_sym2str(argv[0]);
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ {
+ size_t n = strlen(StringValueCStr(name));
+ if (n >= LONG_MAX) {
+ rb_raise(rb_eRuntimeError, "too long member name");
+ }
+ }
+#endif
+
+ if (argc == 1) {
+ return olerecord_ivar_get(self, name);
+ } else if (argc == 2) {
+ return olerecord_ivar_set(self, name, argv[1]);
+ }
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_RECORD#ole_instance_variable_get(name)
+ *
+ * Returns value specified by the member name of VT_RECORD OLE object.
+ * If the member name is not correct, KeyError exception is raised.
+ * If you can't access member variable of VT_RECORD OLE object directly,
+ * use this method.
+ *
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * Public Structure ComObject
+ * Public object_id As Ineger
+ * End Structure
+ * End Class
+ *
+ * and Ruby Object class has title attribute:
+ *
+ * then accessing object_id of ComObject from Ruby is as the following:
+ *
+ * srver = WIN32OLE.new('ComServer.ComClass')
+ * obj = WIN32OLE_RECORD.new('ComObject', server)
+ * # obj.object_id returns Ruby Object#object_id
+ * obj.ole_instance_variable_get(:object_id) # => nil
+ *
+ */
+static VALUE
+folerecord_ole_instance_variable_get(VALUE self, VALUE name)
+{
+ VALUE sname;
+ if(!RB_TYPE_P(name, T_STRING) && !RB_TYPE_P(name, T_SYMBOL)) {
+ rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
+ }
+ sname = name;
+ if (RB_TYPE_P(name, T_SYMBOL)) {
+ sname = rb_sym2str(name);
+ }
+ return olerecord_ivar_get(self, sname);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_RECORD#ole_instance_variable_set(name, val)
+ *
+ * Sets value specified by the member name of VT_RECORD OLE object.
+ * If the member name is not correct, KeyError exception is raised.
+ * If you can't set value of member of VT_RECORD OLE object directly,
+ * use this method.
+ *
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * <MarshalAs(UnmanagedType.BStr)> _
+ * Public title As String
+ * Public cost As Integer
+ * End Class
+ *
+ * then setting value of the `title' member is as following:
+ *
+ * srver = WIN32OLE.new('ComServer.ComClass')
+ * obj = WIN32OLE_RECORD.new('Book', server)
+ * obj.ole_instance_variable_set(:title, "The Ruby Book")
+ *
+ */
+static VALUE
+folerecord_ole_instance_variable_set(VALUE self, VALUE name, VALUE val)
+{
+ VALUE sname;
+ if(!RB_TYPE_P(name, T_STRING) && !RB_TYPE_P(name, T_SYMBOL)) {
+ rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
+ }
+ sname = name;
+ if (RB_TYPE_P(name, T_SYMBOL)) {
+ sname = rb_sym2str(name);
+ }
+ return olerecord_ivar_set(self, sname, val);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_RECORD#inspect -> String
+ *
+ * Returns the OLE struct name and member name and the value of member
+ *
+ * If COM server in VB.NET ComServer project is the following:
+ *
+ * Imports System.Runtime.InteropServices
+ * Public Class ComClass
+ * <MarshalAs(UnmanagedType.BStr)> _
+ * Public title As String
+ * Public cost As Integer
+ * End Class
+ *
+ * then
+ *
+ * srver = WIN32OLE.new('ComServer.ComClass')
+ * obj = WIN32OLE_RECORD.new('Book', server)
+ * obj.inspect # => <WIN32OLE_RECORD(ComClass) {"title" => nil, "cost" => nil}>
+ *
+ */
+static VALUE
+folerecord_inspect(VALUE self)
+{
+ VALUE tname;
+ VALUE field;
+ tname = folerecord_typename(self);
+ if (tname == Qnil) {
+ tname = rb_inspect(tname);
+ }
+ field = rb_inspect(folerecord_to_h(self));
+ return rb_sprintf("#<WIN32OLE_RECORD(%"PRIsVALUE") %"PRIsVALUE">",
+ tname,
+ field);
+}
+
+void
+Init_win32ole_record(void)
+{
+ cWIN32OLE_RECORD = rb_define_class("WIN32OLE_RECORD", rb_cObject);
+ rb_define_alloc_func(cWIN32OLE_RECORD, folerecord_s_allocate);
+ rb_define_method(cWIN32OLE_RECORD, "initialize", folerecord_initialize, 2);
+ rb_define_method(cWIN32OLE_RECORD, "to_h", folerecord_to_h, 0);
+ rb_define_method(cWIN32OLE_RECORD, "typename", folerecord_typename, 0);
+ rb_define_method(cWIN32OLE_RECORD, "method_missing", folerecord_method_missing, -1);
+ rb_define_method(cWIN32OLE_RECORD, "ole_instance_variable_get", folerecord_ole_instance_variable_get, 1);
+ rb_define_method(cWIN32OLE_RECORD, "ole_instance_variable_set", folerecord_ole_instance_variable_set, 2);
+ rb_define_method(cWIN32OLE_RECORD, "inspect", folerecord_inspect, 0);
+}
diff --git a/ext/win32ole/win32ole_record.h b/ext/win32ole/win32ole_record.h
new file mode 100644
index 0000000000..ea431e91f7
--- /dev/null
+++ b/ext/win32ole/win32ole_record.h
@@ -0,0 +1,10 @@
+#ifndef WIN32OLE_RECORD_H
+#define WIN32OLE_RECORD_H 1
+
+VALUE cWIN32OLE_RECORD;
+void ole_rec2variant(VALUE rec, VARIANT *var);
+void olerecord_set_ivar(VALUE obj, IRecordInfo *pri, void *prec);
+VALUE create_win32ole_record(IRecordInfo *pri, void *prec);
+void Init_win32ole_record(void);
+
+#endif
diff --git a/ext/win32ole/win32ole_type.c b/ext/win32ole/win32ole_type.c
new file mode 100644
index 0000000000..efcac883df
--- /dev/null
+++ b/ext/win32ole/win32ole_type.c
@@ -0,0 +1,915 @@
+#include "win32ole.h"
+
+struct oletypedata {
+ ITypeInfo *pTypeInfo;
+};
+
+static void oletype_free(void *ptr);
+static size_t oletype_size(const void *ptr);
+static VALUE foletype_s_ole_classes(VALUE self, VALUE typelib);
+static VALUE foletype_s_typelibs(VALUE self);
+static VALUE foletype_s_progids(VALUE self);
+static VALUE oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name);
+static VALUE foletype_s_allocate(VALUE klass);
+static VALUE oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass);
+static VALUE foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass);
+static VALUE foletype_name(VALUE self);
+static VALUE ole_ole_type(ITypeInfo *pTypeInfo);
+static VALUE foletype_ole_type(VALUE self);
+static VALUE ole_type_guid(ITypeInfo *pTypeInfo);
+static VALUE foletype_guid(VALUE self);
+static VALUE ole_type_progid(ITypeInfo *pTypeInfo);
+static VALUE foletype_progid(VALUE self);
+static VALUE ole_type_visible(ITypeInfo *pTypeInfo);
+static VALUE foletype_visible(VALUE self);
+static VALUE ole_type_major_version(ITypeInfo *pTypeInfo);
+static VALUE foletype_major_version(VALUE self);
+static VALUE ole_type_minor_version(ITypeInfo *pTypeInfo);
+static VALUE foletype_minor_version(VALUE self);
+static VALUE ole_type_typekind(ITypeInfo *pTypeInfo);
+static VALUE foletype_typekind(VALUE self);
+static VALUE ole_type_helpstring(ITypeInfo *pTypeInfo);
+static VALUE foletype_helpstring(VALUE self);
+static VALUE ole_type_src_type(ITypeInfo *pTypeInfo);
+static VALUE foletype_src_type(VALUE self);
+static VALUE ole_type_helpfile(ITypeInfo *pTypeInfo);
+static VALUE foletype_helpfile(VALUE self);
+static VALUE ole_type_helpcontext(ITypeInfo *pTypeInfo);
+static VALUE foletype_helpcontext(VALUE self);
+static VALUE ole_variables(ITypeInfo *pTypeInfo);
+static VALUE foletype_variables(VALUE self);
+static VALUE foletype_methods(VALUE self);
+static VALUE foletype_ole_typelib(VALUE self);
+static VALUE ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags);
+static VALUE foletype_impl_ole_types(VALUE self);
+static VALUE foletype_source_ole_types(VALUE self);
+static VALUE foletype_default_event_sources(VALUE self);
+static VALUE foletype_default_ole_types(VALUE self);
+static VALUE foletype_inspect(VALUE self);
+
+static const rb_data_type_t oletype_datatype = {
+ "win32ole_type",
+ {NULL, oletype_free, oletype_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+/*
+ * Document-class: WIN32OLE_TYPE
+ *
+ * <code>WIN32OLE_TYPE</code> objects represent OLE type libarary information.
+ */
+
+static void
+oletype_free(void *ptr)
+{
+ struct oletypedata *poletype = ptr;
+ OLE_FREE(poletype->pTypeInfo);
+ free(poletype);
+}
+
+static size_t
+oletype_size(const void *ptr)
+{
+ return ptr ? sizeof(struct oletypedata) : 0;
+}
+
+ITypeInfo *itypeinfo(VALUE self)
+{
+ struct oletypedata *ptype;
+ TypedData_Get_Struct(self, struct oletypedata, &oletype_datatype, ptype);
+ return ptype->pTypeInfo;
+}
+
+VALUE
+ole_type_from_itypeinfo(ITypeInfo *pTypeInfo)
+{
+ ITypeLib *pTypeLib;
+ VALUE type = Qnil;
+ HRESULT hr;
+ unsigned int index;
+ BSTR bstr;
+
+ hr = pTypeInfo->lpVtbl->GetContainingTypeLib( pTypeInfo, &pTypeLib, &index );
+ if(FAILED(hr)) {
+ return Qnil;
+ }
+ hr = pTypeLib->lpVtbl->GetDocumentation( pTypeLib, index,
+ &bstr, NULL, NULL, NULL);
+ OLE_RELEASE(pTypeLib);
+ if (FAILED(hr)) {
+ return Qnil;
+ }
+ type = create_win32ole_type(pTypeInfo, WC2VSTR(bstr));
+ return type;
+}
+
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE.ole_classes(typelib)
+ *
+ * Returns array of WIN32OLE_TYPE objects defined by the <i>typelib</i> type library.
+ * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.new(typelib).ole_classes instead.
+ */
+static VALUE
+foletype_s_ole_classes(VALUE self, VALUE typelib)
+{
+ VALUE obj;
+
+ /*
+ rb_warn("%s is obsolete; use %s instead.",
+ "WIN32OLE_TYPE.ole_classes",
+ "WIN32OLE_TYPELIB.new(typelib).ole_types");
+ */
+ obj = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("new"), 1, typelib);
+ return rb_funcall(obj, rb_intern("ole_types"), 0);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE.typelibs
+ *
+ * Returns array of type libraries.
+ * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.typelibs.collect{|t| t.name} instead.
+ *
+ */
+static VALUE
+foletype_s_typelibs(VALUE self)
+{
+ /*
+ rb_warn("%s is obsolete. use %s instead.",
+ "WIN32OLE_TYPE.typelibs",
+ "WIN32OLE_TYPELIB.typelibs.collect{t|t.name}");
+ */
+ return rb_eval_string("WIN32OLE_TYPELIB.typelibs.collect{|t|t.name}");
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE.progids
+ *
+ * Returns array of ProgID.
+ */
+static VALUE
+foletype_s_progids(VALUE self)
+{
+ HKEY hclsids, hclsid;
+ DWORD i;
+ LONG err;
+ VALUE clsid;
+ VALUE v = rb_str_new2("");
+ VALUE progids = rb_ary_new();
+
+ err = reg_open_key(HKEY_CLASSES_ROOT, "CLSID", &hclsids);
+ if(err != ERROR_SUCCESS) {
+ return progids;
+ }
+ for(i = 0; ; i++) {
+ clsid = reg_enum_key(hclsids, i);
+ if (clsid == Qnil)
+ break;
+ err = reg_open_vkey(hclsids, clsid, &hclsid);
+ if (err != ERROR_SUCCESS)
+ continue;
+ if ((v = reg_get_val2(hclsid, "ProgID")) != Qnil)
+ rb_ary_push(progids, v);
+ if ((v = reg_get_val2(hclsid, "VersionIndependentProgID")) != Qnil)
+ rb_ary_push(progids, v);
+ RegCloseKey(hclsid);
+ }
+ RegCloseKey(hclsids);
+ return progids;
+}
+
+static VALUE
+oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
+{
+ struct oletypedata *ptype;
+ TypedData_Get_Struct(self, struct oletypedata, &oletype_datatype, ptype);
+ rb_ivar_set(self, rb_intern("name"), name);
+ ptype->pTypeInfo = pTypeInfo;
+ OLE_ADDREF(pTypeInfo);
+ return self;
+}
+
+static VALUE
+foletype_s_allocate(VALUE klass)
+{
+ struct oletypedata *poletype;
+ VALUE obj;
+ ole_initialize();
+ obj = TypedData_Make_Struct(klass,struct oletypedata, &oletype_datatype, poletype);
+ poletype->pTypeInfo = NULL;
+ return obj;
+}
+
+VALUE
+create_win32ole_type(ITypeInfo *pTypeInfo, VALUE name)
+{
+ VALUE obj = foletype_s_allocate(cWIN32OLE_TYPE);
+ oletype_set_member(obj, pTypeInfo, name);
+ return obj;
+}
+
+static VALUE
+oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass)
+{
+
+ long count;
+ int i;
+ HRESULT hr;
+ BSTR bstr;
+ VALUE typelib;
+ ITypeInfo *pTypeInfo;
+
+ VALUE found = Qfalse;
+
+ count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
+ for (i = 0; i < count && found == Qfalse; i++) {
+ hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo);
+ if (FAILED(hr))
+ continue;
+ hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i,
+ &bstr, NULL, NULL, NULL);
+ if (FAILED(hr))
+ continue;
+ typelib = WC2VSTR(bstr);
+ if (rb_str_cmp(oleclass, typelib) == 0) {
+ oletype_set_member(self, pTypeInfo, typelib);
+ found = Qtrue;
+ }
+ OLE_RELEASE(pTypeInfo);
+ }
+ return found;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE.new(typelib, ole_class) -> WIN32OLE_TYPE object
+ *
+ * Returns a new WIN32OLE_TYPE object.
+ * The first argument <i>typelib</i> specifies OLE type library name.
+ * The second argument specifies OLE class name.
+ *
+ * WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
+ * # => WIN32OLE_TYPE object of Application class of Excel.
+ */
+static VALUE
+foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass)
+{
+ VALUE file;
+ OLECHAR * pbuf;
+ ITypeLib *pTypeLib;
+ HRESULT hr;
+
+ SafeStringValue(oleclass);
+ SafeStringValue(typelib);
+ file = typelib_file(typelib);
+ if (file == Qnil) {
+ file = typelib;
+ }
+ pbuf = ole_vstr2wc(file);
+ hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to LoadTypeLibEx");
+ SysFreeString(pbuf);
+ if (oleclass_from_typelib(self, pTypeLib, oleclass) == Qfalse) {
+ OLE_RELEASE(pTypeLib);
+ rb_raise(eWIN32OLERuntimeError, "not found `%s` in `%s`",
+ StringValuePtr(oleclass), StringValuePtr(typelib));
+ }
+ OLE_RELEASE(pTypeLib);
+ return self;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#name #=> OLE type name
+ *
+ * Returns OLE type name.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
+ * puts tobj.name # => Application
+ */
+static VALUE
+foletype_name(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("name"));
+}
+
+static VALUE
+ole_ole_type(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ VALUE type = Qnil;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if(FAILED(hr)){
+ return type;
+ }
+ switch(pTypeAttr->typekind) {
+ case TKIND_ENUM:
+ type = rb_str_new2("Enum");
+ break;
+ case TKIND_RECORD:
+ type = rb_str_new2("Record");
+ break;
+ case TKIND_MODULE:
+ type = rb_str_new2("Module");
+ break;
+ case TKIND_INTERFACE:
+ type = rb_str_new2("Interface");
+ break;
+ case TKIND_DISPATCH:
+ type = rb_str_new2("Dispatch");
+ break;
+ case TKIND_COCLASS:
+ type = rb_str_new2("Class");
+ break;
+ case TKIND_ALIAS:
+ type = rb_str_new2("Alias");
+ break;
+ case TKIND_UNION:
+ type = rb_str_new2("Union");
+ break;
+ case TKIND_MAX:
+ type = rb_str_new2("Max");
+ break;
+ default:
+ type = Qnil;
+ break;
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return type;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#ole_type #=> OLE type string.
+ *
+ * returns type of OLE class.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
+ * puts tobj.ole_type # => Class
+ */
+static VALUE
+foletype_ole_type(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_ole_type(pTypeInfo);
+}
+
+static VALUE
+ole_type_guid(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ int len;
+ OLECHAR bstr[80];
+ VALUE guid = Qnil;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ return guid;
+ len = StringFromGUID2(&pTypeAttr->guid, bstr, sizeof(bstr)/sizeof(OLECHAR));
+ if (len > 3) {
+ guid = ole_wc2vstr(bstr, FALSE);
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return guid;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#guid #=> GUID
+ *
+ * Returns GUID.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
+ * puts tobj.guid # => {00024500-0000-0000-C000-000000000046}
+ */
+static VALUE
+foletype_guid(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_guid(pTypeInfo);
+}
+
+static VALUE
+ole_type_progid(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ OLECHAR *pbuf;
+ VALUE progid = Qnil;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ return progid;
+ hr = ProgIDFromCLSID(&pTypeAttr->guid, &pbuf);
+ if (SUCCEEDED(hr)) {
+ progid = ole_wc2vstr(pbuf, FALSE);
+ CoTaskMemFree(pbuf);
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return progid;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#progid #=> ProgID
+ *
+ * Returns ProgID if it exists. If not found, then returns nil.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
+ * puts tobj.progid # => Excel.Application.9
+ */
+static VALUE
+foletype_progid(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_progid(pTypeInfo);
+}
+
+
+static VALUE
+ole_type_visible(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ VALUE visible;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ return Qtrue;
+ if (pTypeAttr->wTypeFlags & (TYPEFLAG_FHIDDEN | TYPEFLAG_FRESTRICTED)) {
+ visible = Qfalse;
+ } else {
+ visible = Qtrue;
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return visible;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#visible? #=> true or false
+ *
+ * Returns true if the OLE class is public.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
+ * puts tobj.visible # => true
+ */
+static VALUE
+foletype_visible(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_visible(pTypeInfo);
+}
+
+static VALUE
+ole_type_major_version(ITypeInfo *pTypeInfo)
+{
+ VALUE ver;
+ TYPEATTR *pTypeAttr;
+ HRESULT hr;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ver = INT2FIX(pTypeAttr->wMajorVerNum);
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return ver;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#major_version
+ *
+ * Returns major version.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents')
+ * puts tobj.major_version # => 8
+ */
+static VALUE
+foletype_major_version(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_major_version(pTypeInfo);
+}
+
+static VALUE
+ole_type_minor_version(ITypeInfo *pTypeInfo)
+{
+ VALUE ver;
+ TYPEATTR *pTypeAttr;
+ HRESULT hr;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ver = INT2FIX(pTypeAttr->wMinorVerNum);
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return ver;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#minor_version #=> OLE minor version
+ *
+ * Returns minor version.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents')
+ * puts tobj.minor_version # => 2
+ */
+static VALUE
+foletype_minor_version(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_minor_version(pTypeInfo);
+}
+
+static VALUE
+ole_type_typekind(ITypeInfo *pTypeInfo)
+{
+ VALUE typekind;
+ TYPEATTR *pTypeAttr;
+ HRESULT hr;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ typekind = INT2FIX(pTypeAttr->typekind);
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return typekind;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#typekind #=> number of type.
+ *
+ * Returns number which represents type.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents')
+ * puts tobj.typekind # => 4
+ *
+ */
+static VALUE
+foletype_typekind(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_typekind(pTypeInfo);
+}
+
+static VALUE
+ole_type_helpstring(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ BSTR bhelpstr;
+ hr = ole_docinfo_from_type(pTypeInfo, NULL, &bhelpstr, NULL, NULL);
+ if(FAILED(hr)) {
+ return Qnil;
+ }
+ return WC2VSTR(bhelpstr);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#helpstring #=> help string.
+ *
+ * Returns help string.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
+ * puts tobj.helpstring # => Web Browser interface
+ */
+static VALUE
+foletype_helpstring(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_helpstring(pTypeInfo);
+}
+
+static VALUE
+ole_type_src_type(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ VALUE alias = Qnil;
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr))
+ return alias;
+ if(pTypeAttr->typekind != TKIND_ALIAS) {
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return alias;
+ }
+ alias = ole_typedesc2val(pTypeInfo, &(pTypeAttr->tdescAlias), Qnil);
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return alias;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#src_type #=> OLE source class
+ *
+ * Returns source class when the OLE class is 'Alias'.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Office 9.0 Object Library', 'MsoRGBType')
+ * puts tobj.src_type # => I4
+ *
+ */
+static VALUE
+foletype_src_type(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_src_type(pTypeInfo);
+}
+
+static VALUE
+ole_type_helpfile(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ BSTR bhelpfile;
+ hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL, NULL, &bhelpfile);
+ if(FAILED(hr)) {
+ return Qnil;
+ }
+ return WC2VSTR(bhelpfile);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#helpfile
+ *
+ * Returns helpfile path. If helpfile is not found, then returns nil.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
+ * puts tobj.helpfile # => C:\...\VBAXL9.CHM
+ *
+ */
+static VALUE
+foletype_helpfile(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_helpfile(pTypeInfo);
+}
+
+static VALUE
+ole_type_helpcontext(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ DWORD helpcontext;
+ hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL,
+ &helpcontext, NULL);
+ if(FAILED(hr))
+ return Qnil;
+ return INT2FIX(helpcontext);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#helpcontext
+ *
+ * Returns helpcontext. If helpcontext is not found, then returns nil.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
+ * puts tobj.helpfile # => 131185
+ */
+static VALUE
+foletype_helpcontext(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_helpcontext(pTypeInfo);
+}
+
+static VALUE
+ole_variables(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ TYPEATTR *pTypeAttr;
+ WORD i;
+ UINT len;
+ BSTR bstr;
+ VARDESC *pVarDesc;
+ VALUE var;
+ VALUE variables = rb_ary_new();
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ }
+
+ for(i = 0; i < pTypeAttr->cVars; i++) {
+ hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, i, &pVarDesc);
+ if(FAILED(hr))
+ continue;
+ len = 0;
+ hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pVarDesc->memid, &bstr,
+ 1, &len);
+ if(FAILED(hr) || len == 0 || !bstr)
+ continue;
+
+ var = create_win32ole_variable(pTypeInfo, i, WC2VSTR(bstr));
+ rb_ary_push(variables, var);
+
+ pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
+ pVarDesc = NULL;
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return variables;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#variables
+ *
+ * Returns array of WIN32OLE_VARIABLE objects which represent variables
+ * defined in OLE class.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
+ * vars = tobj.variables
+ * vars.each do |v|
+ * puts "#{v.name} = #{v.value}"
+ * end
+ *
+ * The result of above sample script is follows:
+ * xlChart = -4109
+ * xlDialogSheet = -4116
+ * xlExcel4IntlMacroSheet = 4
+ * xlExcel4MacroSheet = 3
+ * xlWorksheet = -4167
+ *
+ */
+static VALUE
+foletype_variables(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_variables(pTypeInfo);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#ole_methods # the array of WIN32OLE_METHOD objects.
+ *
+ * Returns array of WIN32OLE_METHOD objects which represent OLE method defined in
+ * OLE type library.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
+ * methods = tobj.ole_methods.collect{|m|
+ * m.name
+ * }
+ * # => ['Activate', 'Copy', 'Delete',....]
+ */
+static VALUE
+foletype_methods(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_methods_from_typeinfo(pTypeInfo, INVOKE_FUNC | INVOKE_PROPERTYGET | INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#ole_typelib
+ *
+ * Returns the WIN32OLE_TYPELIB object which is including the WIN32OLE_TYPE
+ * object. If it is not found, then returns nil.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
+ * puts tobj.ole_typelib # => 'Microsoft Excel 9.0 Object Library'
+ */
+static VALUE
+foletype_ole_typelib(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_typelib_from_itypeinfo(pTypeInfo);
+}
+
+static VALUE
+ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags)
+{
+ HRESULT hr;
+ ITypeInfo *pRefTypeInfo;
+ HREFTYPE href;
+ WORD i;
+ VALUE type;
+ TYPEATTR *pTypeAttr;
+ int flags;
+
+ VALUE types = rb_ary_new();
+ hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
+ if (FAILED(hr)) {
+ return types;
+ }
+ for (i = 0; i < pTypeAttr->cImplTypes; i++) {
+ hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
+ if (FAILED(hr))
+ continue;
+
+ hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo, i, &href);
+ if (FAILED(hr))
+ continue;
+ hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo);
+ if (FAILED(hr))
+ continue;
+
+ if ((flags & implflags) == implflags) {
+ type = ole_type_from_itypeinfo(pRefTypeInfo);
+ if (type != Qnil) {
+ rb_ary_push(types, type);
+ }
+ }
+
+ OLE_RELEASE(pRefTypeInfo);
+ }
+ OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
+ return types;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#implemented_ole_types
+ *
+ * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
+ * object.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
+ * p tobj.implemented_ole_types # => [_Worksheet, DocEvents]
+ */
+static VALUE
+foletype_impl_ole_types(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_impl_ole_types(pTypeInfo, 0);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#source_ole_types
+ *
+ * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
+ * object and having IMPLTYPEFLAG_FSOURCE.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
+ * p tobj.source_ole_types
+ * # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>, #<WIN32OLE_TYPE:DWebBrowserEvents>]
+ */
+static VALUE
+foletype_source_ole_types(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_impl_ole_types(pTypeInfo, IMPLTYPEFLAG_FSOURCE);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#default_event_sources
+ *
+ * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
+ * object and having IMPLTYPEFLAG_FSOURCE and IMPLTYPEFLAG_FDEFAULT.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
+ * p tobj.default_event_sources # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>]
+ */
+static VALUE
+foletype_default_event_sources(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_impl_ole_types(pTypeInfo, IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#default_ole_types
+ *
+ * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
+ * object and having IMPLTYPEFLAG_FDEFAULT.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
+ * p tobj.default_ole_types
+ * # => [#<WIN32OLE_TYPE:IWebBrowser2>, #<WIN32OLE_TYPE:DWebBrowserEvents2>]
+ */
+static VALUE
+foletype_default_ole_types(VALUE self)
+{
+ ITypeInfo *pTypeInfo = itypeinfo(self);
+ return ole_type_impl_ole_types(pTypeInfo, IMPLTYPEFLAG_FDEFAULT);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPE#inspect -> String
+ *
+ * Returns the type name with class name.
+ *
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ie.ole_type.inspect => #<WIN32OLE_TYPE:IWebBrowser2>
+ */
+static VALUE
+foletype_inspect(VALUE self)
+{
+ return default_inspect(self, "WIN32OLE_TYPE");
+}
+
+void Init_win32ole_type(void)
+{
+ cWIN32OLE_TYPE = rb_define_class("WIN32OLE_TYPE", rb_cObject);
+ rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1);
+ rb_define_singleton_method(cWIN32OLE_TYPE, "typelibs", foletype_s_typelibs, 0);
+ rb_define_singleton_method(cWIN32OLE_TYPE, "progids", foletype_s_progids, 0);
+ rb_define_alloc_func(cWIN32OLE_TYPE, foletype_s_allocate);
+ rb_define_method(cWIN32OLE_TYPE, "initialize", foletype_initialize, 2);
+ rb_define_method(cWIN32OLE_TYPE, "name", foletype_name, 0);
+ rb_define_method(cWIN32OLE_TYPE, "ole_type", foletype_ole_type, 0);
+ rb_define_method(cWIN32OLE_TYPE, "guid", foletype_guid, 0);
+ rb_define_method(cWIN32OLE_TYPE, "progid", foletype_progid, 0);
+ rb_define_method(cWIN32OLE_TYPE, "visible?", foletype_visible, 0);
+ rb_define_alias(cWIN32OLE_TYPE, "to_s", "name");
+ rb_define_method(cWIN32OLE_TYPE, "major_version", foletype_major_version, 0);
+ rb_define_method(cWIN32OLE_TYPE, "minor_version", foletype_minor_version, 0);
+ rb_define_method(cWIN32OLE_TYPE, "typekind", foletype_typekind, 0);
+ rb_define_method(cWIN32OLE_TYPE, "helpstring", foletype_helpstring, 0);
+ rb_define_method(cWIN32OLE_TYPE, "src_type", foletype_src_type, 0);
+ rb_define_method(cWIN32OLE_TYPE, "helpfile", foletype_helpfile, 0);
+ rb_define_method(cWIN32OLE_TYPE, "helpcontext", foletype_helpcontext, 0);
+ rb_define_method(cWIN32OLE_TYPE, "variables", foletype_variables, 0);
+ rb_define_method(cWIN32OLE_TYPE, "ole_methods", foletype_methods, 0);
+ rb_define_method(cWIN32OLE_TYPE, "ole_typelib", foletype_ole_typelib, 0);
+ rb_define_method(cWIN32OLE_TYPE, "implemented_ole_types", foletype_impl_ole_types, 0);
+ rb_define_method(cWIN32OLE_TYPE, "source_ole_types", foletype_source_ole_types, 0);
+ rb_define_method(cWIN32OLE_TYPE, "default_event_sources", foletype_default_event_sources, 0);
+ rb_define_method(cWIN32OLE_TYPE, "default_ole_types", foletype_default_ole_types, 0);
+ rb_define_method(cWIN32OLE_TYPE, "inspect", foletype_inspect, 0);
+}
diff --git a/ext/win32ole/win32ole_type.h b/ext/win32ole/win32ole_type.h
new file mode 100644
index 0000000000..a26bf3e043
--- /dev/null
+++ b/ext/win32ole/win32ole_type.h
@@ -0,0 +1,8 @@
+#ifndef WIN32OLE_TYPE_H
+#define WIN32OLE_TYPE_H 1
+VALUE cWIN32OLE_TYPE;
+VALUE create_win32ole_type(ITypeInfo *pTypeInfo, VALUE name);
+ITypeInfo *itypeinfo(VALUE self);
+VALUE ole_type_from_itypeinfo(ITypeInfo *pTypeInfo);
+void Init_win32ole_type(void);
+#endif
diff --git a/ext/win32ole/win32ole_typelib.c b/ext/win32ole/win32ole_typelib.c
new file mode 100644
index 0000000000..4f2c42fb76
--- /dev/null
+++ b/ext/win32ole/win32ole_typelib.c
@@ -0,0 +1,844 @@
+#include "win32ole.h"
+
+struct oletypelibdata {
+ ITypeLib *pTypeLib;
+};
+
+static VALUE reg_get_typelib_file_path(HKEY hkey);
+static VALUE oletypelib_path(VALUE guid, VALUE version);
+static HRESULT oletypelib_from_guid(VALUE guid, VALUE version, ITypeLib **ppTypeLib);
+static VALUE foletypelib_s_typelibs(VALUE self);
+static VALUE oletypelib_set_member(VALUE self, ITypeLib *pTypeLib);
+static void oletypelib_free(void *ptr);
+static size_t oletypelib_size(const void *ptr);
+static VALUE foletypelib_s_allocate(VALUE klass);
+static VALUE oletypelib_search_registry(VALUE self, VALUE typelib);
+static void oletypelib_get_libattr(ITypeLib *pTypeLib, TLIBATTR **ppTLibAttr);
+static VALUE oletypelib_search_registry2(VALUE self, VALUE args);
+static VALUE foletypelib_initialize(VALUE self, VALUE args);
+static VALUE foletypelib_guid(VALUE self);
+static VALUE foletypelib_name(VALUE self);
+static VALUE make_version_str(VALUE major, VALUE minor);
+static VALUE foletypelib_version(VALUE self);
+static VALUE foletypelib_major_version(VALUE self);
+static VALUE foletypelib_minor_version(VALUE self);
+static VALUE foletypelib_path(VALUE self);
+static VALUE foletypelib_visible(VALUE self);
+static VALUE foletypelib_library_name(VALUE self);
+static VALUE ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes);
+static VALUE typelib_file_from_typelib(VALUE ole);
+static VALUE typelib_file_from_clsid(VALUE ole);
+static VALUE foletypelib_ole_types(VALUE self);
+static VALUE foletypelib_inspect(VALUE self);
+
+static const rb_data_type_t oletypelib_datatype = {
+ "win32ole_typelib",
+ {NULL, oletypelib_free, oletypelib_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static VALUE
+reg_get_typelib_file_path(HKEY hkey)
+{
+ VALUE path = Qnil;
+ path = reg_get_val2(hkey, "win64");
+ if (path != Qnil) {
+ return path;
+ }
+ path = reg_get_val2(hkey, "win32");
+ if (path != Qnil) {
+ return path;
+ }
+ path = reg_get_val2(hkey, "win16");
+ return path;
+}
+
+static VALUE
+oletypelib_path(VALUE guid, VALUE version)
+{
+ int k;
+ LONG err;
+ HKEY hkey;
+ HKEY hlang;
+ VALUE lang;
+ VALUE path = Qnil;
+
+ VALUE key = rb_str_new2("TypeLib\\");
+ rb_str_concat(key, guid);
+ rb_str_cat2(key, "\\");
+ rb_str_concat(key, version);
+
+ err = reg_open_vkey(HKEY_CLASSES_ROOT, key, &hkey);
+ if (err != ERROR_SUCCESS) {
+ return Qnil;
+ }
+ for(k = 0; path == Qnil; k++) {
+ lang = reg_enum_key(hkey, k);
+ if (lang == Qnil)
+ break;
+ err = reg_open_vkey(hkey, lang, &hlang);
+ if (err == ERROR_SUCCESS) {
+ path = reg_get_typelib_file_path(hlang);
+ RegCloseKey(hlang);
+ }
+ }
+ RegCloseKey(hkey);
+ return path;
+}
+
+static HRESULT
+oletypelib_from_guid(VALUE guid, VALUE version, ITypeLib **ppTypeLib)
+{
+ VALUE path;
+ OLECHAR *pBuf;
+ HRESULT hr;
+ path = oletypelib_path(guid, version);
+ if (path == Qnil) {
+ return E_UNEXPECTED;
+ }
+ pBuf = ole_vstr2wc(path);
+ hr = LoadTypeLibEx(pBuf, REGKIND_NONE, ppTypeLib);
+ SysFreeString(pBuf);
+ return hr;
+}
+
+ITypeLib *
+itypelib(VALUE self)
+{
+ struct oletypelibdata *ptlib;
+ TypedData_Get_Struct(self, struct oletypelibdata, &oletypelib_datatype, ptlib);
+ return ptlib->pTypeLib;
+}
+
+VALUE
+ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ ITypeLib *pTypeLib;
+ unsigned int index;
+ VALUE retval = Qnil;
+
+ hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
+ if(FAILED(hr)) {
+ return Qnil;
+ }
+ retval = create_win32ole_typelib(pTypeLib);
+ return retval;
+}
+
+/*
+ * Document-class: WIN32OLE_TYPELIB
+ *
+ * <code>WIN32OLE_TYPELIB</code> objects represent OLE tyblib information.
+ */
+
+/*
+ * call-seq:
+ *
+ * WIN32OLE_TYPELIB.typelibs
+ *
+ * Returns the array of WIN32OLE_TYPELIB object.
+ *
+ * tlibs = WIN32OLE_TYPELIB.typelibs
+ *
+ */
+static VALUE
+foletypelib_s_typelibs(VALUE self)
+{
+ HKEY htypelib, hguid;
+ DWORD i, j;
+ LONG err;
+ VALUE guid;
+ VALUE version;
+ VALUE name = Qnil;
+ VALUE typelibs = rb_ary_new();
+ VALUE typelib = Qnil;
+ HRESULT hr;
+ ITypeLib *pTypeLib;
+
+ err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
+ if(err != ERROR_SUCCESS) {
+ return typelibs;
+ }
+ for(i = 0; ; i++) {
+ guid = reg_enum_key(htypelib, i);
+ if (guid == Qnil)
+ break;
+ err = reg_open_vkey(htypelib, guid, &hguid);
+ if (err != ERROR_SUCCESS)
+ continue;
+ for(j = 0; ; j++) {
+ version = reg_enum_key(hguid, j);
+ if (version == Qnil)
+ break;
+ if ( (name = reg_get_val2(hguid, StringValuePtr(version))) != Qnil ) {
+ hr = oletypelib_from_guid(guid, version, &pTypeLib);
+ if (SUCCEEDED(hr)) {
+ typelib = create_win32ole_typelib(pTypeLib);
+ rb_ary_push(typelibs, typelib);
+ }
+ }
+ }
+ RegCloseKey(hguid);
+ }
+ RegCloseKey(htypelib);
+ return typelibs;
+}
+
+static VALUE
+oletypelib_set_member(VALUE self, ITypeLib *pTypeLib)
+{
+ struct oletypelibdata *ptlib;
+ TypedData_Get_Struct(self, struct oletypelibdata, &oletypelib_datatype, ptlib);
+ ptlib->pTypeLib = pTypeLib;
+ return self;
+}
+
+static void
+oletypelib_free(void *ptr)
+{
+ struct oletypelibdata *poletypelib = ptr;
+ OLE_FREE(poletypelib->pTypeLib);
+ free(poletypelib);
+}
+
+static size_t
+oletypelib_size(const void *ptr)
+{
+ return ptr ? sizeof(struct oletypelibdata) : 0;
+}
+
+static VALUE
+foletypelib_s_allocate(VALUE klass)
+{
+ struct oletypelibdata *poletypelib;
+ VALUE obj;
+ ole_initialize();
+ obj = TypedData_Make_Struct(klass, struct oletypelibdata, &oletypelib_datatype, poletypelib);
+ poletypelib->pTypeLib = NULL;
+ return obj;
+}
+
+VALUE
+create_win32ole_typelib(ITypeLib *pTypeLib)
+{
+ VALUE obj = foletypelib_s_allocate(cWIN32OLE_TYPELIB);
+ oletypelib_set_member(obj, pTypeLib);
+ return obj;
+}
+
+static VALUE
+oletypelib_search_registry(VALUE self, VALUE typelib)
+{
+ HKEY htypelib, hguid, hversion;
+ DWORD i, j;
+ LONG err;
+ VALUE found = Qfalse;
+ VALUE tlib;
+ VALUE guid;
+ VALUE ver;
+ HRESULT hr;
+ ITypeLib *pTypeLib;
+
+ err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
+ if(err != ERROR_SUCCESS) {
+ return Qfalse;
+ }
+ for(i = 0; !found; i++) {
+ guid = reg_enum_key(htypelib, i);
+ if (guid == Qnil)
+ break;
+ err = reg_open_vkey(htypelib, guid, &hguid);
+ if (err != ERROR_SUCCESS)
+ continue;
+ for(j = 0; found == Qfalse; j++) {
+ ver = reg_enum_key(hguid, j);
+ if (ver == Qnil)
+ break;
+ err = reg_open_vkey(hguid, ver, &hversion);
+ if (err != ERROR_SUCCESS)
+ continue;
+ tlib = reg_get_val(hversion, NULL);
+ if (tlib == Qnil) {
+ RegCloseKey(hversion);
+ continue;
+ }
+ if (rb_str_cmp(typelib, tlib) == 0) {
+ hr = oletypelib_from_guid(guid, ver, &pTypeLib);
+ if (SUCCEEDED(hr)) {
+ oletypelib_set_member(self, pTypeLib);
+ found = Qtrue;
+ }
+ }
+ RegCloseKey(hversion);
+ }
+ RegCloseKey(hguid);
+ }
+ RegCloseKey(htypelib);
+ return found;
+}
+
+static void
+oletypelib_get_libattr(ITypeLib *pTypeLib, TLIBATTR **ppTLibAttr)
+{
+ HRESULT hr;
+ hr = pTypeLib->lpVtbl->GetLibAttr(pTypeLib, ppTLibAttr);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError,
+ "failed to get library attribute(TLIBATTR) from ITypeLib");
+ }
+}
+
+static VALUE
+oletypelib_search_registry2(VALUE self, VALUE args)
+{
+ HKEY htypelib, hguid, hversion;
+ double fver;
+ DWORD j;
+ LONG err;
+ VALUE found = Qfalse;
+ VALUE tlib;
+ VALUE ver;
+ VALUE version_str;
+ VALUE version = Qnil;
+ VALUE typelib = Qnil;
+ HRESULT hr;
+ ITypeLib *pTypeLib;
+
+ VALUE guid = rb_ary_entry(args, 0);
+ version_str = make_version_str(rb_ary_entry(args, 1), rb_ary_entry(args, 2));
+
+ err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
+ if(err != ERROR_SUCCESS) {
+ return Qfalse;
+ }
+ err = reg_open_vkey(htypelib, guid, &hguid);
+ if (err != ERROR_SUCCESS) {
+ RegCloseKey(htypelib);
+ return Qfalse;
+ }
+ if (version_str != Qnil) {
+ err = reg_open_vkey(hguid, version_str, &hversion);
+ if (err == ERROR_SUCCESS) {
+ tlib = reg_get_val(hversion, NULL);
+ if (tlib != Qnil) {
+ typelib = tlib;
+ version = version_str;
+ }
+ }
+ RegCloseKey(hversion);
+ } else {
+ fver = 0.0;
+ for(j = 0; ;j++) {
+ ver = reg_enum_key(hguid, j);
+ if (ver == Qnil)
+ break;
+ err = reg_open_vkey(hguid, ver, &hversion);
+ if (err != ERROR_SUCCESS)
+ continue;
+ tlib = reg_get_val(hversion, NULL);
+ if (tlib == Qnil) {
+ RegCloseKey(hversion);
+ continue;
+ }
+ if (fver < atof(StringValuePtr(ver))) {
+ fver = atof(StringValuePtr(ver));
+ version = ver;
+ typelib = tlib;
+ }
+ RegCloseKey(hversion);
+ }
+ }
+ RegCloseKey(hguid);
+ RegCloseKey(htypelib);
+ if (typelib != Qnil) {
+ hr = oletypelib_from_guid(guid, version, &pTypeLib);
+ if (SUCCEEDED(hr)) {
+ found = Qtrue;
+ oletypelib_set_member(self, pTypeLib);
+ }
+ }
+ return found;
+}
+
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB.new(typelib [, version1, version2]) -> WIN32OLE_TYPELIB object
+ *
+ * Returns a new WIN32OLE_TYPELIB object.
+ *
+ * The first argument <i>typelib</i> specifies OLE type library name or GUID or
+ * OLE library file.
+ * The second argument is major version or version of the type library.
+ * The third argument is minor version.
+ * The second argument and third argument are optional.
+ * If the first argument is type library name, then the second and third argument
+ * are ignored.
+ *
+ * tlib1 = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * tlib2 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}')
+ * tlib3 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1.3)
+ * tlib4 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1, 3)
+ * tlib5 = WIN32OLE_TYPELIB.new("C:\\WINNT\\SYSTEM32\\SHELL32.DLL")
+ * puts tlib1.name # -> 'Microsoft Excel 9.0 Object Library'
+ * puts tlib2.name # -> 'Microsoft Excel 9.0 Object Library'
+ * puts tlib3.name # -> 'Microsoft Excel 9.0 Object Library'
+ * puts tlib4.name # -> 'Microsoft Excel 9.0 Object Library'
+ * puts tlib5.name # -> 'Microsoft Shell Controls And Automation'
+ *
+ */
+static VALUE
+foletypelib_initialize(VALUE self, VALUE args)
+{
+ VALUE found = Qfalse;
+ VALUE typelib = Qnil;
+ int len = 0;
+ OLECHAR * pbuf;
+ ITypeLib *pTypeLib;
+ HRESULT hr = S_OK;
+
+ len = RARRAY_LEN(args);
+ rb_check_arity(len, 1, 3);
+
+ typelib = rb_ary_entry(args, 0);
+
+ SafeStringValue(typelib);
+
+ found = oletypelib_search_registry(self, typelib);
+ if (found == Qfalse) {
+ found = oletypelib_search_registry2(self, args);
+ }
+ if (found == Qfalse) {
+ pbuf = ole_vstr2wc(typelib);
+ hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
+ SysFreeString(pbuf);
+ if (SUCCEEDED(hr)) {
+ found = Qtrue;
+ oletypelib_set_member(self, pTypeLib);
+ }
+ }
+
+ if (found == Qfalse) {
+ rb_raise(eWIN32OLERuntimeError, "not found type library `%s`",
+ StringValuePtr(typelib));
+ }
+ return self;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#guid -> The guid string.
+ *
+ * Returns guid string which specifies type library.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * guid = tlib.guid # -> '{00020813-0000-0000-C000-000000000046}'
+ */
+static VALUE
+foletypelib_guid(VALUE self)
+{
+ ITypeLib *pTypeLib;
+ OLECHAR bstr[80];
+ VALUE guid = Qnil;
+ int len;
+ TLIBATTR *pTLibAttr;
+
+ pTypeLib = itypelib(self);
+ oletypelib_get_libattr(pTypeLib, &pTLibAttr);
+ len = StringFromGUID2(&pTLibAttr->guid, bstr, sizeof(bstr)/sizeof(OLECHAR));
+ if (len > 3) {
+ guid = ole_wc2vstr(bstr, FALSE);
+ }
+ pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
+ return guid;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#name -> The type library name
+ *
+ * Returns the type library name.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * name = tlib.name # -> 'Microsoft Excel 9.0 Object Library'
+ */
+static VALUE
+foletypelib_name(VALUE self)
+{
+ ITypeLib *pTypeLib;
+ HRESULT hr;
+ BSTR bstr;
+ VALUE name;
+ pTypeLib = itypelib(self);
+ hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, -1,
+ NULL, &bstr, NULL, NULL);
+
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to get name from ITypeLib");
+ }
+ name = WC2VSTR(bstr);
+ return name;
+}
+
+static VALUE
+make_version_str(VALUE major, VALUE minor)
+{
+ VALUE version_str = Qnil;
+ VALUE minor_str = Qnil;
+ if (major == Qnil) {
+ return Qnil;
+ }
+ version_str = rb_String(major);
+ if (minor != Qnil) {
+ minor_str = rb_String(minor);
+ rb_str_cat2(version_str, ".");
+ rb_str_append(version_str, minor_str);
+ }
+ return version_str;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#version -> The type library version String object.
+ *
+ * Returns the type library version.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * puts tlib.version #-> "1.3"
+ */
+static VALUE
+foletypelib_version(VALUE self)
+{
+ TLIBATTR *pTLibAttr;
+ ITypeLib *pTypeLib;
+ VALUE version;
+
+ pTypeLib = itypelib(self);
+ oletypelib_get_libattr(pTypeLib, &pTLibAttr);
+ version = rb_sprintf("%d.%d", pTLibAttr->wMajorVerNum, pTLibAttr->wMinorVerNum);
+ pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
+ return version;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#major_version -> The type library major version.
+ *
+ * Returns the type library major version.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * puts tlib.major_version # -> 1
+ */
+static VALUE
+foletypelib_major_version(VALUE self)
+{
+ TLIBATTR *pTLibAttr;
+ VALUE major;
+ ITypeLib *pTypeLib;
+ pTypeLib = itypelib(self);
+ oletypelib_get_libattr(pTypeLib, &pTLibAttr);
+
+ major = INT2NUM(pTLibAttr->wMajorVerNum);
+ pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
+ return major;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#minor_version -> The type library minor version.
+ *
+ * Returns the type library minor version.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * puts tlib.minor_version # -> 3
+ */
+static VALUE
+foletypelib_minor_version(VALUE self)
+{
+ TLIBATTR *pTLibAttr;
+ VALUE minor;
+ ITypeLib *pTypeLib;
+ pTypeLib = itypelib(self);
+ oletypelib_get_libattr(pTypeLib, &pTLibAttr);
+ minor = INT2NUM(pTLibAttr->wMinorVerNum);
+ pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
+ return minor;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#path -> The type library file path.
+ *
+ * Returns the type library file path.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * puts tlib.path #-> 'C:\...\EXCEL9.OLB'
+ */
+static VALUE
+foletypelib_path(VALUE self)
+{
+ TLIBATTR *pTLibAttr;
+ HRESULT hr = S_OK;
+ BSTR bstr;
+ LCID lcid = cWIN32OLE_lcid;
+ VALUE path;
+ ITypeLib *pTypeLib;
+
+ pTypeLib = itypelib(self);
+ oletypelib_get_libattr(pTypeLib, &pTLibAttr);
+ hr = QueryPathOfRegTypeLib(&pTLibAttr->guid,
+ pTLibAttr->wMajorVerNum,
+ pTLibAttr->wMinorVerNum,
+ lcid,
+ &bstr);
+ if (FAILED(hr)) {
+ pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to QueryPathOfRegTypeTypeLib");
+ }
+
+ pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
+ path = WC2VSTR(bstr);
+ return path;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#visible?
+ *
+ * Returns true if the type library information is not hidden.
+ * If wLibFlags of TLIBATTR is 0 or LIBFLAG_FRESTRICTED or LIBFLAG_FHIDDEN,
+ * the method returns false, otherwise, returns true.
+ * If the method fails to access the TLIBATTR information, then
+ * WIN32OLERuntimeError is raised.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * tlib.visible? # => true
+ */
+static VALUE
+foletypelib_visible(VALUE self)
+{
+ ITypeLib *pTypeLib = NULL;
+ VALUE visible = Qtrue;
+ TLIBATTR *pTLibAttr;
+
+ pTypeLib = itypelib(self);
+ oletypelib_get_libattr(pTypeLib, &pTLibAttr);
+
+ if ((pTLibAttr->wLibFlags == 0) ||
+ (pTLibAttr->wLibFlags & LIBFLAG_FRESTRICTED) ||
+ (pTLibAttr->wLibFlags & LIBFLAG_FHIDDEN)) {
+ visible = Qfalse;
+ }
+ pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
+ return visible;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#library_name
+ *
+ * Returns library name.
+ * If the method fails to access library name, WIN32OLERuntimeError is raised.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * tlib.library_name # => Excel
+ */
+static VALUE
+foletypelib_library_name(VALUE self)
+{
+ HRESULT hr;
+ ITypeLib *pTypeLib = NULL;
+ VALUE libname = Qnil;
+ BSTR bstr;
+
+ pTypeLib = itypelib(self);
+ hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, -1,
+ &bstr, NULL, NULL, NULL);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to get library name");
+ }
+ libname = WC2VSTR(bstr);
+ return libname;
+}
+
+static VALUE
+ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes)
+{
+ long count;
+ int i;
+ HRESULT hr;
+ BSTR bstr;
+ ITypeInfo *pTypeInfo;
+ VALUE type;
+
+ count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
+ for (i = 0; i < count; i++) {
+ hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i,
+ &bstr, NULL, NULL, NULL);
+ if (FAILED(hr))
+ continue;
+
+ hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo);
+ if (FAILED(hr))
+ continue;
+
+ type = create_win32ole_type(pTypeInfo, WC2VSTR(bstr));
+
+ rb_ary_push(classes, type);
+ OLE_RELEASE(pTypeInfo);
+ }
+ return classes;
+}
+
+static VALUE
+typelib_file_from_typelib(VALUE ole)
+{
+ HKEY htypelib, hclsid, hversion, hlang;
+ double fver;
+ DWORD i, j, k;
+ LONG err;
+ BOOL found = FALSE;
+ VALUE typelib;
+ VALUE file = Qnil;
+ VALUE clsid;
+ VALUE ver;
+ VALUE lang;
+
+ err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
+ if(err != ERROR_SUCCESS) {
+ return Qnil;
+ }
+ for(i = 0; !found; i++) {
+ clsid = reg_enum_key(htypelib, i);
+ if (clsid == Qnil)
+ break;
+ err = reg_open_vkey(htypelib, clsid, &hclsid);
+ if (err != ERROR_SUCCESS)
+ continue;
+ fver = 0;
+ for(j = 0; !found; j++) {
+ ver = reg_enum_key(hclsid, j);
+ if (ver == Qnil)
+ break;
+ err = reg_open_vkey(hclsid, ver, &hversion);
+ if (err != ERROR_SUCCESS || fver > atof(StringValuePtr(ver)))
+ continue;
+ fver = atof(StringValuePtr(ver));
+ typelib = reg_get_val(hversion, NULL);
+ if (typelib == Qnil)
+ continue;
+ if (rb_str_cmp(typelib, ole) == 0) {
+ for(k = 0; !found; k++) {
+ lang = reg_enum_key(hversion, k);
+ if (lang == Qnil)
+ break;
+ err = reg_open_vkey(hversion, lang, &hlang);
+ if (err == ERROR_SUCCESS) {
+ if ((file = reg_get_typelib_file_path(hlang)) != Qnil)
+ found = TRUE;
+ RegCloseKey(hlang);
+ }
+ }
+ }
+ RegCloseKey(hversion);
+ }
+ RegCloseKey(hclsid);
+ }
+ RegCloseKey(htypelib);
+ return file;
+}
+
+static VALUE
+typelib_file_from_clsid(VALUE ole)
+{
+ HKEY hroot, hclsid;
+ LONG err;
+ VALUE typelib;
+ char path[MAX_PATH + 1];
+
+ err = reg_open_key(HKEY_CLASSES_ROOT, "CLSID", &hroot);
+ if (err != ERROR_SUCCESS) {
+ return Qnil;
+ }
+ err = reg_open_key(hroot, StringValuePtr(ole), &hclsid);
+ if (err != ERROR_SUCCESS) {
+ RegCloseKey(hroot);
+ return Qnil;
+ }
+ typelib = reg_get_val2(hclsid, "InprocServer32");
+ RegCloseKey(hroot);
+ RegCloseKey(hclsid);
+ if (typelib != Qnil) {
+ ExpandEnvironmentStrings(StringValuePtr(typelib), path, sizeof(path));
+ path[MAX_PATH] = '\0';
+ typelib = rb_str_new2(path);
+ }
+ return typelib;
+}
+
+VALUE
+typelib_file(VALUE ole)
+{
+ VALUE file = typelib_file_from_clsid(ole);
+ if (file != Qnil) {
+ return file;
+ }
+ return typelib_file_from_typelib(ole);
+}
+
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#ole_types -> The array of WIN32OLE_TYPE object included the type library.
+ *
+ * Returns the type library file path.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...]
+ */
+static VALUE
+foletypelib_ole_types(VALUE self)
+{
+ ITypeLib *pTypeLib = NULL;
+ VALUE classes = rb_ary_new();
+ pTypeLib = itypelib(self);
+ ole_types_from_typelib(pTypeLib, classes);
+ return classes;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_TYPELIB#inspect -> String
+ *
+ * Returns the type library name with class name.
+ *
+ * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
+ * tlib.inspect # => "<#WIN32OLE_TYPELIB:Microsoft Excel 9.0 Object Library>"
+ */
+static VALUE
+foletypelib_inspect(VALUE self)
+{
+ return default_inspect(self, "WIN32OLE_TYPELIB");
+}
+
+void
+Init_win32ole_typelib(void)
+{
+ cWIN32OLE_TYPELIB = rb_define_class("WIN32OLE_TYPELIB", rb_cObject);
+ rb_define_singleton_method(cWIN32OLE_TYPELIB, "typelibs", foletypelib_s_typelibs, 0);
+ rb_define_alloc_func(cWIN32OLE_TYPELIB, foletypelib_s_allocate);
+ rb_define_method(cWIN32OLE_TYPELIB, "initialize", foletypelib_initialize, -2);
+ rb_define_method(cWIN32OLE_TYPELIB, "guid", foletypelib_guid, 0);
+ rb_define_method(cWIN32OLE_TYPELIB, "name", foletypelib_name, 0);
+ rb_define_method(cWIN32OLE_TYPELIB, "version", foletypelib_version, 0);
+ rb_define_method(cWIN32OLE_TYPELIB, "major_version", foletypelib_major_version, 0);
+ rb_define_method(cWIN32OLE_TYPELIB, "minor_version", foletypelib_minor_version, 0);
+ rb_define_method(cWIN32OLE_TYPELIB, "path", foletypelib_path, 0);
+ rb_define_method(cWIN32OLE_TYPELIB, "ole_types", foletypelib_ole_types, 0);
+ rb_define_alias(cWIN32OLE_TYPELIB, "ole_classes", "ole_types");
+ rb_define_method(cWIN32OLE_TYPELIB, "visible?", foletypelib_visible, 0);
+ rb_define_method(cWIN32OLE_TYPELIB, "library_name", foletypelib_library_name, 0);
+ rb_define_alias(cWIN32OLE_TYPELIB, "to_s", "name");
+ rb_define_method(cWIN32OLE_TYPELIB, "inspect", foletypelib_inspect, 0);
+}
diff --git a/ext/win32ole/win32ole_typelib.h b/ext/win32ole/win32ole_typelib.h
new file mode 100644
index 0000000000..9fc117fcb4
--- /dev/null
+++ b/ext/win32ole/win32ole_typelib.h
@@ -0,0 +1,11 @@
+#ifndef WIN32OLE_TYPELIB_H
+#define WIN32OLE_TYPELIB_H 1
+
+VALUE cWIN32OLE_TYPELIB;
+
+void Init_win32ole_typelib(void);
+ITypeLib * itypelib(VALUE self);
+VALUE typelib_file(VALUE ole);
+VALUE create_win32ole_typelib(ITypeLib *pTypeLib);
+VALUE ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo);
+#endif
diff --git a/ext/win32ole/win32ole_variable.c b/ext/win32ole/win32ole_variable.c
new file mode 100644
index 0000000000..dd583828f2
--- /dev/null
+++ b/ext/win32ole/win32ole_variable.c
@@ -0,0 +1,380 @@
+#include "win32ole.h"
+
+struct olevariabledata {
+ ITypeInfo *pTypeInfo;
+ UINT index;
+};
+
+static void olevariable_free(void *ptr);
+static size_t olevariable_size(const void *ptr);
+static VALUE folevariable_name(VALUE self);
+static VALUE ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index);
+static VALUE folevariable_ole_type(VALUE self);
+static VALUE ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index);
+static VALUE folevariable_ole_type_detail(VALUE self);
+static VALUE ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index);
+static VALUE folevariable_value(VALUE self);
+static VALUE ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index);
+static VALUE folevariable_visible(VALUE self);
+static VALUE ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index);
+static VALUE folevariable_variable_kind(VALUE self);
+static VALUE ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index);
+static VALUE folevariable_varkind(VALUE self);
+static VALUE folevariable_inspect(VALUE self);
+
+static const rb_data_type_t olevariable_datatype = {
+ "win32ole_variable",
+ {NULL, olevariable_free, olevariable_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static void
+olevariable_free(void *ptr)
+{
+ struct olevariabledata *polevar = ptr;
+ OLE_FREE(polevar->pTypeInfo);
+ free(polevar);
+}
+
+static size_t
+olevariable_size(const void *ptr)
+{
+ return ptr ? sizeof(struct olevariabledata) : 0;
+}
+
+/*
+ * Document-class: WIN32OLE_VARIABLE
+ *
+ * <code>WIN32OLE_VARIABLE</code> objects represent OLE variable information.
+ */
+
+VALUE
+create_win32ole_variable(ITypeInfo *pTypeInfo, UINT index, VALUE name)
+{
+ struct olevariabledata *pvar;
+ VALUE obj = TypedData_Make_Struct(cWIN32OLE_VARIABLE, struct olevariabledata,
+ &olevariable_datatype, pvar);
+ pvar->pTypeInfo = pTypeInfo;
+ OLE_ADDREF(pTypeInfo);
+ pvar->index = index;
+ rb_ivar_set(obj, rb_intern("name"), name);
+ return obj;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#name
+ *
+ * Returns the name of variable.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
+ * variables = tobj.variables
+ * variables.each do |variable|
+ * puts "#{variable.name}"
+ * end
+ *
+ * The result of above script is following:
+ * xlChart
+ * xlDialogSheet
+ * xlExcel4IntlMacroSheet
+ * xlExcel4MacroSheet
+ * xlWorksheet
+ *
+ */
+static VALUE
+folevariable_name(VALUE self)
+{
+ return rb_ivar_get(self, rb_intern("name"));
+}
+
+static VALUE
+ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index)
+{
+ VARDESC *pVarDesc;
+ HRESULT hr;
+ VALUE type;
+ hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetVarDesc");
+ type = ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), Qnil);
+ pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
+ return type;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#ole_type
+ *
+ * Returns OLE type string.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
+ * variables = tobj.variables
+ * variables.each do |variable|
+ * puts "#{variable.ole_type} #{variable.name}"
+ * end
+ *
+ * The result of above script is following:
+ * INT xlChart
+ * INT xlDialogSheet
+ * INT xlExcel4IntlMacroSheet
+ * INT xlExcel4MacroSheet
+ * INT xlWorksheet
+ *
+ */
+static VALUE
+folevariable_ole_type(VALUE self)
+{
+ struct olevariabledata *pvar;
+ TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ return ole_variable_ole_type(pvar->pTypeInfo, pvar->index);
+}
+
+static VALUE
+ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index)
+{
+ VARDESC *pVarDesc;
+ HRESULT hr;
+ VALUE type = rb_ary_new();
+ hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetVarDesc");
+ ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), type);
+ pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
+ return type;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#ole_type_detail
+ *
+ * Returns detail information of type. The information is array of type.
+ *
+ * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library', 'D3DCLIPSTATUS')
+ * variable = tobj.variables.find {|variable| variable.name == 'lFlags'}
+ * tdetail = variable.ole_type_detail
+ * p tdetail # => ["USERDEFINED", "CONST_D3DCLIPSTATUSFLAGS"]
+ *
+ */
+static VALUE
+folevariable_ole_type_detail(VALUE self)
+{
+ struct olevariabledata *pvar;
+ TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ return ole_variable_ole_type_detail(pvar->pTypeInfo, pvar->index);
+}
+
+static VALUE
+ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index)
+{
+ VARDESC *pVarDesc;
+ HRESULT hr;
+ VALUE val = Qnil;
+ hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
+ if (FAILED(hr))
+ return Qnil;
+ if(pVarDesc->varkind == VAR_CONST)
+ val = ole_variant2val(V_UNION1(pVarDesc, lpvarValue));
+ pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
+ return val;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#value
+ *
+ * Returns value if value is exists. If the value does not exist,
+ * this method returns nil.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
+ * variables = tobj.variables
+ * variables.each do |variable|
+ * puts "#{variable.name} #{variable.value}"
+ * end
+ *
+ * The result of above script is following:
+ * xlChart = -4109
+ * xlDialogSheet = -4116
+ * xlExcel4IntlMacroSheet = 4
+ * xlExcel4MacroSheet = 3
+ * xlWorksheet = -4167
+ *
+ */
+static VALUE
+folevariable_value(VALUE self)
+{
+ struct olevariabledata *pvar;
+ TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ return ole_variable_value(pvar->pTypeInfo, pvar->index);
+}
+
+static VALUE
+ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index)
+{
+ VARDESC *pVarDesc;
+ HRESULT hr;
+ VALUE visible = Qfalse;
+ hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
+ if (FAILED(hr))
+ return visible;
+ if (!(pVarDesc->wVarFlags & (VARFLAG_FHIDDEN |
+ VARFLAG_FRESTRICTED |
+ VARFLAG_FNONBROWSABLE))) {
+ visible = Qtrue;
+ }
+ pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
+ return visible;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#visible?
+ *
+ * Returns true if the variable is public.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
+ * variables = tobj.variables
+ * variables.each do |variable|
+ * puts "#{variable.name} #{variable.visible?}"
+ * end
+ *
+ * The result of above script is following:
+ * xlChart true
+ * xlDialogSheet true
+ * xlExcel4IntlMacroSheet true
+ * xlExcel4MacroSheet true
+ * xlWorksheet true
+ *
+ */
+static VALUE
+folevariable_visible(VALUE self)
+{
+ struct olevariabledata *pvar;
+ TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ return ole_variable_visible(pvar->pTypeInfo, pvar->index);
+}
+
+static VALUE
+ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index)
+{
+ VARDESC *pVarDesc;
+ HRESULT hr;
+ VALUE kind = rb_str_new2("UNKNOWN");
+ hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
+ if (FAILED(hr))
+ return kind;
+ switch(pVarDesc->varkind) {
+ case VAR_PERINSTANCE:
+ kind = rb_str_new2("PERINSTANCE");
+ break;
+ case VAR_STATIC:
+ kind = rb_str_new2("STATIC");
+ break;
+ case VAR_CONST:
+ kind = rb_str_new2("CONSTANT");
+ break;
+ case VAR_DISPATCH:
+ kind = rb_str_new2("DISPATCH");
+ break;
+ default:
+ break;
+ }
+ pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
+ return kind;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#variable_kind
+ *
+ * Returns variable kind string.
+ *
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
+ * variables = tobj.variables
+ * variables.each do |variable|
+ * puts "#{variable.name} #{variable.variable_kind}"
+ * end
+ *
+ * The result of above script is following:
+ * xlChart CONSTANT
+ * xlDialogSheet CONSTANT
+ * xlExcel4IntlMacroSheet CONSTANT
+ * xlExcel4MacroSheet CONSTANT
+ * xlWorksheet CONSTANT
+ */
+static VALUE
+folevariable_variable_kind(VALUE self)
+{
+ struct olevariabledata *pvar;
+ TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ return ole_variable_kind(pvar->pTypeInfo, pvar->index);
+}
+
+static VALUE
+ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index)
+{
+ VARDESC *pVarDesc;
+ HRESULT hr;
+ VALUE kind = Qnil;
+ hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
+ if (FAILED(hr))
+ return kind;
+ pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
+ kind = INT2FIX(pVarDesc->varkind);
+ return kind;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#varkind
+ *
+ * Returns the number which represents variable kind.
+ * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
+ * variables = tobj.variables
+ * variables.each do |variable|
+ * puts "#{variable.name} #{variable.varkind}"
+ * end
+ *
+ * The result of above script is following:
+ * xlChart 2
+ * xlDialogSheet 2
+ * xlExcel4IntlMacroSheet 2
+ * xlExcel4MacroSheet 2
+ * xlWorksheet 2
+ */
+static VALUE
+folevariable_varkind(VALUE self)
+{
+ struct olevariabledata *pvar;
+ TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ return ole_variable_varkind(pvar->pTypeInfo, pvar->index);
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIABLE#inspect -> String
+ *
+ * Returns the OLE variable name and the value with class name.
+ *
+ */
+static VALUE
+folevariable_inspect(VALUE self)
+{
+ VALUE v = rb_inspect(folevariable_value(self));
+ VALUE n = folevariable_name(self);
+ VALUE detail = rb_sprintf("%"PRIsVALUE"=%"PRIsVALUE, n, v);
+ return make_inspect("WIN32OLE_VARIABLE", detail);
+}
+
+void Init_win32ole_variable(void)
+{
+ cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
+ rb_define_method(cWIN32OLE_VARIABLE, "name", folevariable_name, 0);
+ rb_define_method(cWIN32OLE_VARIABLE, "ole_type", folevariable_ole_type, 0);
+ rb_define_method(cWIN32OLE_VARIABLE, "ole_type_detail", folevariable_ole_type_detail, 0);
+ rb_define_method(cWIN32OLE_VARIABLE, "value", folevariable_value, 0);
+ rb_define_method(cWIN32OLE_VARIABLE, "visible?", folevariable_visible, 0);
+ rb_define_method(cWIN32OLE_VARIABLE, "variable_kind", folevariable_variable_kind, 0);
+ rb_define_method(cWIN32OLE_VARIABLE, "varkind", folevariable_varkind, 0);
+ rb_define_method(cWIN32OLE_VARIABLE, "inspect", folevariable_inspect, 0);
+ rb_define_alias(cWIN32OLE_VARIABLE, "to_s", "name");
+}
diff --git a/ext/win32ole/win32ole_variable.h b/ext/win32ole/win32ole_variable.h
new file mode 100644
index 0000000000..704dc13508
--- /dev/null
+++ b/ext/win32ole/win32ole_variable.h
@@ -0,0 +1,8 @@
+#ifndef WIN32OLE_VARIABLE_H
+#define WIN32OLE_VARIABLE_H 1
+
+VALUE cWIN32OLE_VARIABLE;
+VALUE create_win32ole_variable(ITypeInfo *pTypeInfo, UINT index, VALUE name);
+void Init_win32ole_variable(void);
+
+#endif
diff --git a/ext/win32ole/win32ole_variant.c b/ext/win32ole/win32ole_variant.c
new file mode 100644
index 0000000000..f1fdeca038
--- /dev/null
+++ b/ext/win32ole/win32ole_variant.c
@@ -0,0 +1,732 @@
+#include "win32ole.h"
+
+struct olevariantdata {
+ VARIANT realvar;
+ VARIANT var;
+};
+
+static void olevariant_free(void *ptr);
+static size_t olevariant_size(const void *ptr);
+static void ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar);
+static void ole_val2variant_err(VALUE val, VARIANT *var);
+static void ole_set_byref(VARIANT *realvar, VARIANT *var, VARTYPE vt);
+static VALUE folevariant_s_allocate(VALUE klass);
+static VALUE folevariant_s_array(VALUE klass, VALUE dims, VALUE vvt);
+static void check_type_val2variant(VALUE val);
+static VALUE folevariant_initialize(VALUE self, VALUE args);
+static LONG *ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa);
+static void unlock_safe_array(SAFEARRAY *psa);
+static SAFEARRAY *get_locked_safe_array(VALUE val);
+static VALUE folevariant_ary_aref(int argc, VALUE *argv, VALUE self);
+static VALUE folevariant_ary_aset(int argc, VALUE *argv, VALUE self);
+static VALUE folevariant_value(VALUE self);
+static VALUE folevariant_vartype(VALUE self);
+static VALUE folevariant_set_value(VALUE self, VALUE val);
+
+static const rb_data_type_t olevariant_datatype = {
+ "win32ole_variant",
+ {NULL, olevariant_free, olevariant_size,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static void
+olevariant_free(void *ptr)
+{
+ struct olevariantdata *pvar = ptr;
+ VariantClear(&(pvar->realvar));
+ VariantClear(&(pvar->var));
+ free(pvar);
+}
+
+static size_t
+olevariant_size(const void *ptr)
+{
+ return ptr ? sizeof(struct olevariantdata) : 0;
+}
+
+static void
+ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar)
+{
+ HRESULT hr = S_OK;
+
+ if (((vt & ~VT_BYREF) == (VT_ARRAY | VT_UI1)) && RB_TYPE_P(val, T_STRING)) {
+ long len = RSTRING_LEN(val);
+ void *pdest = NULL;
+ SAFEARRAY *p = NULL;
+ SAFEARRAY *psa = SafeArrayCreateVector(VT_UI1, 0, len);
+ if (!psa) {
+ rb_raise(rb_eRuntimeError, "fail to SafeArrayCreateVector");
+ }
+ hr = SafeArrayAccessData(psa, &pdest);
+ if (SUCCEEDED(hr)) {
+ memcpy(pdest, RSTRING_PTR(val), len);
+ SafeArrayUnaccessData(psa);
+ V_VT(&(pvar->realvar)) = (vt & ~VT_BYREF);
+ p = V_ARRAY(&(pvar->realvar));
+ if (p != NULL) {
+ SafeArrayDestroy(p);
+ }
+ V_ARRAY(&(pvar->realvar)) = psa;
+ if (vt & VT_BYREF) {
+ V_VT(&(pvar->var)) = vt;
+ V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
+ } else {
+ hr = VariantCopy(&(pvar->var), &(pvar->realvar));
+ }
+ } else {
+ if (psa)
+ SafeArrayDestroy(psa);
+ }
+ } else if (vt & VT_ARRAY) {
+ if (val == Qnil) {
+ V_VT(&(pvar->var)) = vt;
+ if (vt & VT_BYREF) {
+ V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
+ }
+ } else {
+ hr = ole_val_ary2variant_ary(val, &(pvar->realvar), (VARTYPE)(vt & ~VT_BYREF));
+ if (SUCCEEDED(hr)) {
+ if (vt & VT_BYREF) {
+ V_VT(&(pvar->var)) = vt;
+ V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
+ } else {
+ hr = VariantCopy(&(pvar->var), &(pvar->realvar));
+ }
+ }
+ }
+#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+ } else if ( (vt & ~VT_BYREF) == VT_I8 || (vt & ~VT_BYREF) == VT_UI8) {
+ ole_val2variant_ex(val, &(pvar->realvar), (vt & ~VT_BYREF));
+ ole_val2variant_ex(val, &(pvar->var), (vt & ~VT_BYREF));
+ V_VT(&(pvar->var)) = vt;
+ if (vt & VT_BYREF) {
+ ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
+ }
+#endif
+ } else if ( (vt & ~VT_BYREF) == VT_ERROR) {
+ ole_val2variant_err(val, &(pvar->realvar));
+ if (vt & VT_BYREF) {
+ ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
+ } else {
+ hr = VariantCopy(&(pvar->var), &(pvar->realvar));
+ }
+ } else {
+ if (val == Qnil) {
+ V_VT(&(pvar->var)) = vt;
+ if (vt == (VT_BYREF | VT_VARIANT)) {
+ ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
+ } else {
+ V_VT(&(pvar->realvar)) = vt & ~VT_BYREF;
+ if (vt & VT_BYREF) {
+ ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
+ }
+ }
+ } else {
+ ole_val2variant_ex(val, &(pvar->realvar), (VARTYPE)(vt & ~VT_BYREF));
+ if (vt == (VT_BYREF | VT_VARIANT)) {
+ ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
+ } else if (vt & VT_BYREF) {
+ if ( (vt & ~VT_BYREF) != V_VT(&(pvar->realvar))) {
+ hr = VariantChangeTypeEx(&(pvar->realvar), &(pvar->realvar),
+ cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF));
+ }
+ if (SUCCEEDED(hr)) {
+ ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
+ }
+ } else {
+ if (vt == V_VT(&(pvar->realvar))) {
+ hr = VariantCopy(&(pvar->var), &(pvar->realvar));
+ } else {
+ hr = VariantChangeTypeEx(&(pvar->var), &(pvar->realvar),
+ cWIN32OLE_lcid, 0, vt);
+ }
+ }
+ }
+ }
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to change type");
+ }
+}
+
+static void
+ole_val2variant_err(VALUE val, VARIANT *var)
+{
+ VALUE v = val;
+ if (rb_obj_is_kind_of(v, cWIN32OLE_VARIANT)) {
+ v = folevariant_value(v);
+ }
+ if (TYPE(v) != T_FIXNUM && TYPE(v) != T_BIGNUM && v != Qnil) {
+ rb_raise(eWIN32OLERuntimeError, "failed to convert VT_ERROR VARIANT:`%"PRIsVALUE"'", rb_inspect(v));
+ }
+ V_VT(var) = VT_ERROR;
+ if (v != Qnil) {
+ V_ERROR(var) = NUM2LONG(val);
+ } else {
+ V_ERROR(var) = 0;
+ }
+}
+
+static void
+ole_set_byref(VARIANT *realvar, VARIANT *var, VARTYPE vt)
+{
+ V_VT(var) = vt;
+ if (vt == (VT_VARIANT|VT_BYREF)) {
+ V_VARIANTREF(var) = realvar;
+ } else {
+ if (V_VT(realvar) != (vt & ~VT_BYREF)) {
+ rb_raise(eWIN32OLERuntimeError, "variant type mismatch");
+ }
+ switch(vt & ~VT_BYREF) {
+ case VT_I1:
+ V_I1REF(var) = &V_I1(realvar);
+ break;
+ case VT_UI1:
+ V_UI1REF(var) = &V_UI1(realvar);
+ break;
+ case VT_I2:
+ V_I2REF(var) = &V_I2(realvar);
+ break;
+ case VT_UI2:
+ V_UI2REF(var) = &V_UI2(realvar);
+ break;
+ case VT_I4:
+ V_I4REF(var) = &V_I4(realvar);
+ break;
+ case VT_UI4:
+ V_UI4REF(var) = &V_UI4(realvar);
+ break;
+ case VT_R4:
+ V_R4REF(var) = &V_R4(realvar);
+ break;
+ case VT_R8:
+ V_R8REF(var) = &V_R8(realvar);
+ break;
+
+#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+#ifdef V_I8REF
+ case VT_I8:
+ V_I8REF(var) = &V_I8(realvar);
+ break;
+#endif
+#ifdef V_UI8REF
+ case VT_UI8:
+ V_UI8REF(var) = &V_UI8(realvar);
+ break;
+#endif
+#endif
+ case VT_INT:
+ V_INTREF(var) = &V_INT(realvar);
+ break;
+
+ case VT_UINT:
+ V_UINTREF(var) = &V_UINT(realvar);
+ break;
+
+ case VT_CY:
+ V_CYREF(var) = &V_CY(realvar);
+ break;
+ case VT_DATE:
+ V_DATEREF(var) = &V_DATE(realvar);
+ break;
+ case VT_BSTR:
+ V_BSTRREF(var) = &V_BSTR(realvar);
+ break;
+ case VT_DISPATCH:
+ V_DISPATCHREF(var) = &V_DISPATCH(realvar);
+ break;
+ case VT_ERROR:
+ V_ERRORREF(var) = &V_ERROR(realvar);
+ break;
+ case VT_BOOL:
+ V_BOOLREF(var) = &V_BOOL(realvar);
+ break;
+ case VT_UNKNOWN:
+ V_UNKNOWNREF(var) = &V_UNKNOWN(realvar);
+ break;
+ case VT_ARRAY:
+ V_ARRAYREF(var) = &V_ARRAY(realvar);
+ break;
+ default:
+ rb_raise(eWIN32OLERuntimeError, "unknown type specified(setting BYREF):%d", vt);
+ break;
+ }
+ }
+}
+
+static VALUE
+folevariant_s_allocate(VALUE klass)
+{
+ struct olevariantdata *pvar;
+ VALUE obj;
+ ole_initialize();
+ obj = TypedData_Make_Struct(klass, struct olevariantdata, &olevariant_datatype, pvar);
+ VariantInit(&(pvar->var));
+ VariantInit(&(pvar->realvar));
+ return obj;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIANT.array(ary, vt)
+ *
+ * Returns Ruby object wrapping OLE variant whose variant type is VT_ARRAY.
+ * The first argument should be Array object which specifies dimensions
+ * and each size of dimensions of OLE array.
+ * The second argument specifies variant type of the element of OLE array.
+ *
+ * The following create 2 dimensions OLE array. The first dimensions size
+ * is 3, and the second is 4.
+ *
+ * ole_ary = WIN32OLE_VARIANT.array([3,4], VT_I4)
+ * ruby_ary = ole_ary.value # => [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
+ *
+ */
+static VALUE
+folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt)
+{
+ VALUE obj = Qnil;
+ VARTYPE vt;
+ struct olevariantdata *pvar;
+ SAFEARRAYBOUND *psab = NULL;
+ SAFEARRAY *psa = NULL;
+ UINT dim = 0;
+ UINT i = 0;
+
+ ole_initialize();
+
+ vt = NUM2UINT(vvt);
+ vt = (vt | VT_ARRAY);
+ Check_Type(elems, T_ARRAY);
+ obj = folevariant_s_allocate(klass);
+
+ TypedData_Get_Struct(obj, struct olevariantdata, &olevariant_datatype, pvar);
+ dim = RARRAY_LEN(elems);
+
+ psab = ALLOC_N(SAFEARRAYBOUND, dim);
+
+ if(!psab) {
+ rb_raise(rb_eRuntimeError, "memory allocation error");
+ }
+
+ for (i = 0; i < dim; i++) {
+ psab[i].cElements = FIX2INT(rb_ary_entry(elems, i));
+ psab[i].lLbound = 0;
+ }
+
+ psa = SafeArrayCreate((VARTYPE)(vt & VT_TYPEMASK), dim, psab);
+ if (psa == NULL) {
+ if (psab) free(psab);
+ rb_raise(rb_eRuntimeError, "memory allocation error(SafeArrayCreate)");
+ }
+
+ V_VT(&(pvar->var)) = vt;
+ if (vt & VT_BYREF) {
+ V_VT(&(pvar->realvar)) = (vt & ~VT_BYREF);
+ V_ARRAY(&(pvar->realvar)) = psa;
+ V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
+ } else {
+ V_ARRAY(&(pvar->var)) = psa;
+ }
+ if (psab) free(psab);
+ return obj;
+}
+
+static void
+check_type_val2variant(VALUE val)
+{
+ VALUE elem;
+ int len = 0;
+ int i = 0;
+ if(!rb_obj_is_kind_of(val, cWIN32OLE) &&
+ !rb_obj_is_kind_of(val, cWIN32OLE_VARIANT) &&
+ !rb_obj_is_kind_of(val, rb_cTime)) {
+ switch (TYPE(val)) {
+ case T_ARRAY:
+ len = RARRAY_LEN(val);
+ for(i = 0; i < len; i++) {
+ elem = rb_ary_entry(val, i);
+ check_type_val2variant(elem);
+ }
+ break;
+ case T_STRING:
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_FLOAT:
+ case T_TRUE:
+ case T_FALSE:
+ case T_NIL:
+ break;
+ default:
+ rb_raise(rb_eTypeError, "can not convert WIN32OLE_VARIANT from type %s",
+ rb_obj_classname(val));
+ }
+ }
+}
+
+/*
+ * Document-class: WIN32OLE_VARIANT
+ *
+ * <code>WIN32OLE_VARIANT</code> objects represents OLE variant.
+ *
+ * Win32OLE converts Ruby object into OLE variant automatically when
+ * invoking OLE methods. If OLE method requires the argument which is
+ * different from the variant by automatic conversion of Win32OLE, you
+ * can convert the specfied variant type by using WIN32OLE_VARIANT class.
+ *
+ * param = WIN32OLE_VARIANT.new(10, WIN32OLE::VARIANT::VT_R4)
+ * oleobj.method(param)
+ *
+ * WIN32OLE_VARIANT does not support VT_RECORD variant. Use WIN32OLE_RECORD
+ * class instead of WIN32OLE_VARIANT if the VT_RECORD variant is needed.
+ */
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIANT.new(val, vartype) #=> WIN32OLE_VARIANT object.
+ *
+ * Returns Ruby object wrapping OLE variant.
+ * The first argument specifies Ruby object to convert OLE variant variable.
+ * The second argument specifies VARIANT type.
+ * In some situation, you need the WIN32OLE_VARIANT object to pass OLE method
+ *
+ * shell = WIN32OLE.new("Shell.Application")
+ * folder = shell.NameSpace("C:\\Windows")
+ * item = folder.ParseName("tmp.txt")
+ * # You can't use Ruby String object to call FolderItem.InvokeVerb.
+ * # Instead, you have to use WIN32OLE_VARIANT object to call the method.
+ * shortcut = WIN32OLE_VARIANT.new("Create Shortcut(\&S)")
+ * item.invokeVerb(shortcut)
+ *
+ */
+static VALUE
+folevariant_initialize(VALUE self, VALUE args)
+{
+ int len = 0;
+ VARIANT var;
+ VALUE val;
+ VALUE vvt;
+ VARTYPE vt;
+ struct olevariantdata *pvar;
+
+ len = RARRAY_LEN(args);
+ rb_check_arity(len, 1, 3);
+ VariantInit(&var);
+ val = rb_ary_entry(args, 0);
+
+ check_type_val2variant(val);
+
+ TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ if (len == 1) {
+ ole_val2variant(val, &(pvar->var));
+ } else {
+ vvt = rb_ary_entry(args, 1);
+ vt = NUM2INT(vvt);
+ if ((vt & VT_TYPEMASK) == VT_RECORD) {
+ rb_raise(rb_eArgError, "not supported VT_RECORD WIN32OLE_VARIANT object");
+ }
+ ole_val2olevariantdata(val, vt, pvar);
+ }
+ return self;
+}
+
+static SAFEARRAY *
+get_locked_safe_array(VALUE val)
+{
+ struct olevariantdata *pvar;
+ SAFEARRAY *psa = NULL;
+ HRESULT hr;
+ TypedData_Get_Struct(val, struct olevariantdata, &olevariant_datatype, pvar);
+ if (!(V_VT(&(pvar->var)) & VT_ARRAY)) {
+ rb_raise(rb_eTypeError, "variant type is not VT_ARRAY.");
+ }
+ psa = V_ISBYREF(&(pvar->var)) ? *V_ARRAYREF(&(pvar->var)) : V_ARRAY(&(pvar->var));
+ if (psa == NULL) {
+ return psa;
+ }
+ hr = SafeArrayLock(psa);
+ if (FAILED(hr)) {
+ ole_raise(hr, rb_eRuntimeError, "failed to SafeArrayLock");
+ }
+ return psa;
+}
+
+static LONG *
+ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa)
+{
+ long dim;
+ LONG *pid;
+ long i;
+ dim = SafeArrayGetDim(psa);
+ if (dim != ary_size) {
+ rb_raise(rb_eArgError, "unmatch number of indices");
+ }
+ pid = ALLOC_N(LONG, dim);
+ if (pid == NULL) {
+ rb_raise(rb_eRuntimeError, "failed to allocate memory for indices");
+ }
+ for (i = 0; i < dim; i++) {
+ pid[i] = NUM2INT(ary[i]);
+ }
+ return pid;
+}
+
+static void
+unlock_safe_array(SAFEARRAY *psa)
+{
+ HRESULT hr;
+ hr = SafeArrayUnlock(psa);
+ if (FAILED(hr)) {
+ ole_raise(hr, rb_eRuntimeError, "failed to SafeArrayUnlock");
+ }
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIANT[i,j,...] #=> element of OLE array.
+ *
+ * Returns the element of WIN32OLE_VARIANT object(OLE array).
+ * This method is available only when the variant type of
+ * WIN32OLE_VARIANT object is VT_ARRAY.
+ *
+ * REMARK:
+ * The all indices should be 0 or natural number and
+ * lower than or equal to max indices.
+ * (This point is different with Ruby Array indices.)
+ *
+ * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
+ * p obj[0,0] # => 1
+ * p obj[1,0] # => 4
+ * p obj[2,0] # => WIN32OLERuntimeError
+ * p obj[0, -1] # => WIN32OLERuntimeError
+ *
+ */
+static VALUE
+folevariant_ary_aref(int argc, VALUE *argv, VALUE self)
+{
+ struct olevariantdata *pvar;
+ SAFEARRAY *psa;
+ VALUE val = Qnil;
+ VARIANT variant;
+ LONG *pid;
+ HRESULT hr;
+
+ TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ if (!V_ISARRAY(&(pvar->var))) {
+ rb_raise(eWIN32OLERuntimeError,
+ "`[]' is not available for this variant type object");
+ }
+ psa = get_locked_safe_array(self);
+ if (psa == NULL) {
+ return val;
+ }
+
+ pid = ary2safe_array_index(argc, argv, psa);
+
+ VariantInit(&variant);
+ V_VT(&variant) = (V_VT(&(pvar->var)) & ~VT_ARRAY) | VT_BYREF;
+ hr = SafeArrayPtrOfIndex(psa, pid, &V_BYREF(&variant));
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to SafeArrayPtrOfIndex");
+ }
+ val = ole_variant2val(&variant);
+
+ unlock_safe_array(psa);
+ if (pid) free(pid);
+ return val;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIANT[i,j,...] = val #=> set the element of OLE array
+ *
+ * Set the element of WIN32OLE_VARIANT object(OLE array) to val.
+ * This method is available only when the variant type of
+ * WIN32OLE_VARIANT object is VT_ARRAY.
+ *
+ * REMARK:
+ * The all indices should be 0 or natural number and
+ * lower than or equal to max indices.
+ * (This point is different with Ruby Array indices.)
+ *
+ * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
+ * obj[0,0] = 7
+ * obj[1,0] = 8
+ * p obj.value # => [[7,2,3], [8,5,6]]
+ * obj[2,0] = 9 # => WIN32OLERuntimeError
+ * obj[0, -1] = 9 # => WIN32OLERuntimeError
+ *
+ */
+static VALUE
+folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
+{
+ struct olevariantdata *pvar;
+ SAFEARRAY *psa;
+ VARIANT var;
+ VARTYPE vt;
+ LONG *pid;
+ HRESULT hr;
+ VOID *p = NULL;
+
+ TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ if (!V_ISARRAY(&(pvar->var))) {
+ rb_raise(eWIN32OLERuntimeError,
+ "`[]' is not available for this variant type object");
+ }
+ psa = get_locked_safe_array(self);
+ if (psa == NULL) {
+ rb_raise(rb_eRuntimeError, "failed to get SafeArray pointer");
+ }
+
+ pid = ary2safe_array_index(argc-1, argv, psa);
+
+ VariantInit(&var);
+ vt = (V_VT(&(pvar->var)) & ~VT_ARRAY);
+ p = val2variant_ptr(argv[argc-1], &var, vt);
+ if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
+ (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
+ rb_raise(eWIN32OLERuntimeError, "argument does not have IDispatch or IUnknown Interface");
+ }
+ hr = SafeArrayPutElement(psa, pid, p);
+ if (FAILED(hr)) {
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to SafeArrayPutElement");
+ }
+
+ unlock_safe_array(psa);
+ if (pid) free(pid);
+ return argv[argc-1];
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIANT.value #=> Ruby object.
+ *
+ * Returns Ruby object value from OLE variant.
+ * obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR)
+ * obj.value # => "1" (not Fixnum object, but String object "1")
+ *
+ */
+static VALUE
+folevariant_value(VALUE self)
+{
+ struct olevariantdata *pvar;
+ VALUE val = Qnil;
+ VARTYPE vt;
+ int dim;
+ SAFEARRAY *psa;
+ TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+
+ val = ole_variant2val(&(pvar->var));
+ vt = V_VT(&(pvar->var));
+
+ if ((vt & ~VT_BYREF) == (VT_UI1|VT_ARRAY)) {
+ if (vt & VT_BYREF) {
+ psa = *V_ARRAYREF(&(pvar->var));
+ } else {
+ psa = V_ARRAY(&(pvar->var));
+ }
+ if (!psa) {
+ return val;
+ }
+ dim = SafeArrayGetDim(psa);
+ if (dim == 1) {
+ val = rb_funcall(val, rb_intern("pack"), 1, rb_str_new2("C*"));
+ }
+ }
+ return val;
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIANT.vartype #=> OLE variant type.
+ *
+ * Returns OLE variant type.
+ * obj = WIN32OLE_VARIANT.new("string")
+ * obj.vartype # => WIN32OLE::VARIANT::VT_BSTR
+ *
+ */
+static VALUE
+folevariant_vartype(VALUE self)
+{
+ struct olevariantdata *pvar;
+ TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ return INT2FIX(V_VT(&pvar->var));
+}
+
+/*
+ * call-seq:
+ * WIN32OLE_VARIANT.value = val #=> set WIN32OLE_VARIANT value to val.
+ *
+ * Sets variant value to val. If the val type does not match variant value
+ * type(vartype), then val is changed to match variant value type(vartype)
+ * before setting val.
+ * Thie method is not available when vartype is VT_ARRAY(except VT_UI1|VT_ARRAY).
+ * If the vartype is VT_UI1|VT_ARRAY, the val should be String object.
+ *
+ * obj = WIN32OLE_VARIANT.new(1) # obj.vartype is WIN32OLE::VARIANT::VT_I4
+ * obj.value = 3.2 # 3.2 is changed to 3 when setting value.
+ * p obj.value # => 3
+ */
+static VALUE
+folevariant_set_value(VALUE self, VALUE val)
+{
+ struct olevariantdata *pvar;
+ VARTYPE vt;
+ TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ vt = V_VT(&(pvar->var));
+ if (V_ISARRAY(&(pvar->var)) && ((vt & ~VT_BYREF) != (VT_UI1|VT_ARRAY) || !RB_TYPE_P(val, T_STRING))) {
+ rb_raise(eWIN32OLERuntimeError,
+ "`value=' is not available for this variant type object");
+ }
+ ole_val2olevariantdata(val, vt, pvar);
+ return Qnil;
+}
+
+void
+ole_variant2variant(VALUE val, VARIANT *var)
+{
+ struct olevariantdata *pvar;
+ TypedData_Get_Struct(val, struct olevariantdata, &olevariant_datatype, pvar);
+ VariantCopy(var, &(pvar->var));
+}
+
+void
+Init_win32ole_variant(void)
+{
+ cWIN32OLE_VARIANT = rb_define_class("WIN32OLE_VARIANT", rb_cObject);
+ rb_define_alloc_func(cWIN32OLE_VARIANT, folevariant_s_allocate);
+ rb_define_singleton_method(cWIN32OLE_VARIANT, "array", folevariant_s_array, 2);
+ rb_define_method(cWIN32OLE_VARIANT, "initialize", folevariant_initialize, -2);
+ rb_define_method(cWIN32OLE_VARIANT, "value", folevariant_value, 0);
+ rb_define_method(cWIN32OLE_VARIANT, "value=", folevariant_set_value, 1);
+ rb_define_method(cWIN32OLE_VARIANT, "vartype", folevariant_vartype, 0);
+ rb_define_method(cWIN32OLE_VARIANT, "[]", folevariant_ary_aref, -1);
+ rb_define_method(cWIN32OLE_VARIANT, "[]=", folevariant_ary_aset, -1);
+
+ /*
+ * represents VT_EMPTY OLE object.
+ */
+ rb_define_const(cWIN32OLE_VARIANT, "Empty",
+ rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_EMPTY)));
+
+ /*
+ * represents VT_NULL OLE object.
+ */
+ rb_define_const(cWIN32OLE_VARIANT, "Null",
+ rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_NULL)));
+
+ /*
+ * represents Nothing of VB.NET or VB.
+ */
+ rb_define_const(cWIN32OLE_VARIANT, "Nothing",
+ rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_DISPATCH)));
+
+ /*
+ * represents VT_ERROR variant with DISP_E_PARAMNOTFOUND.
+ * This constants is used for not specified parameter.
+ *
+ * fso = WIN32OLE.new("Scripting.FileSystemObject")
+ * fso.openTextFile(filename, WIN32OLE_VARIANT::NoParam, false)
+ */
+ rb_define_const(cWIN32OLE_VARIANT, "NoParam",
+ rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, INT2NUM(DISP_E_PARAMNOTFOUND), INT2FIX(VT_ERROR)));
+}
diff --git a/ext/win32ole/win32ole_variant.h b/ext/win32ole/win32ole_variant.h
new file mode 100644
index 0000000000..efe7ea8bef
--- /dev/null
+++ b/ext/win32ole/win32ole_variant.h
@@ -0,0 +1,9 @@
+#ifndef WIN32OLE_VARIANT_H
+#define WIN32OLE_VARIANT_H 1
+
+VALUE cWIN32OLE_VARIANT;
+void ole_variant2variant(VALUE val, VARIANT *var);
+void Init_win32ole_variant(void);
+
+#endif
+
diff --git a/ext/win32ole/win32ole_variant_m.c b/ext/win32ole/win32ole_variant_m.c
new file mode 100644
index 0000000000..eb3b0b11bb
--- /dev/null
+++ b/ext/win32ole/win32ole_variant_m.c
@@ -0,0 +1,149 @@
+#include "win32ole.h"
+
+void Init_win32ole_variant_m(void)
+{
+ /*
+ * Document-module: WIN32OLE::VARIANT
+ *
+ * The WIN32OLE::VARIANT module includes constants of VARIANT type constants.
+ * The constants is used when creating WIN32OLE_VARIANT object.
+ *
+ * obj = WIN32OLE_VARIANT.new("2e3", WIN32OLE::VARIANT::VT_R4)
+ * obj.value # => 2000.0
+ *
+ */
+ mWIN32OLE_VARIANT = rb_define_module_under(cWIN32OLE, "VARIANT");
+
+ /*
+ * represents VT_EMPTY type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", INT2FIX(VT_EMPTY));
+
+ /*
+ * represents VT_NULL type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", INT2FIX(VT_NULL));
+
+ /*
+ * represents VT_I2 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I2", INT2FIX(VT_I2));
+
+ /*
+ * represents VT_I4 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I4", INT2FIX(VT_I4));
+
+ /*
+ * represents VT_R4 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_R4", INT2FIX(VT_R4));
+
+ /*
+ * represents VT_R8 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_R8", INT2FIX(VT_R8));
+
+ /*
+ * represents VT_CY type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_CY", INT2FIX(VT_CY));
+
+ /*
+ * represents VT_DATE type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", INT2FIX(VT_DATE));
+
+ /*
+ * represents VT_BSTR type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", INT2FIX(VT_BSTR));
+
+ /*
+ * represents VT_USERDEFINED type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", INT2FIX(VT_USERDEFINED));
+
+ /*
+ * represents VT_PTR type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", INT2FIX(VT_PTR));
+
+ /*
+ * represents VT_DISPATCH type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", INT2FIX(VT_DISPATCH));
+
+ /*
+ * represents VT_ERROR type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", INT2FIX(VT_ERROR));
+
+ /*
+ * represents VT_BOOL type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", INT2FIX(VT_BOOL));
+
+ /*
+ * represents VT_VARIANT type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", INT2FIX(VT_VARIANT));
+
+ /*
+ * represents VT_UNKNOWN type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", INT2FIX(VT_UNKNOWN));
+
+ /*
+ * represents VT_I1 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I1", INT2FIX(VT_I1));
+
+ /*
+ * represents VT_UI1 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", INT2FIX(VT_UI1));
+
+ /*
+ * represents VT_UI2 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", INT2FIX(VT_UI2));
+
+ /*
+ * represents VT_UI4 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", INT2FIX(VT_UI4));
+
+#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+ /*
+ * represents VT_I8 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I8", INT2FIX(VT_I8));
+
+ /*
+ * represents VT_UI8 type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", INT2FIX(VT_UI8));
+#endif
+
+ /*
+ * represents VT_INT type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_INT", INT2FIX(VT_INT));
+
+ /*
+ * represents VT_UINT type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", INT2FIX(VT_UINT));
+
+ /*
+ * represents VT_ARRAY type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", INT2FIX(VT_ARRAY));
+
+ /*
+ * represents VT_BYREF type constant.
+ */
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", INT2FIX(VT_BYREF));
+
+}
diff --git a/ext/win32ole/win32ole_variant_m.h b/ext/win32ole/win32ole_variant_m.h
new file mode 100644
index 0000000000..afbef30218
--- /dev/null
+++ b/ext/win32ole/win32ole_variant_m.h
@@ -0,0 +1,7 @@
+#ifndef WIN32OLE_VARIANT_M_H
+#define WIN32OLE_VARIANT_M_H 1
+
+VALUE mWIN32OLE_VARIANT;
+void Init_win32ole_variant_m(void);
+
+#endif
diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb
index b4348ceca7..8bbede63b2 100644
--- a/ext/zlib/extconf.rb
+++ b/ext/zlib/extconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# extconf.rb
#
@@ -20,8 +21,6 @@ if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')
case RUBY_PLATFORM.split('-',2)[1]
when 'amigaos' then
os_code = 'AMIGA'
- when /\Aos2[\-_]emx\z/ then
- os_code = 'OS2'
when /mswin|mingw|bccwin/ then
# NOTE: cygwin should be regarded as Unix.
os_code = 'WIN32'
@@ -36,7 +35,6 @@ if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')
'OS_VMS' => 'VMS',
'OS_UNIX' => 'Unix',
'OS_ATARI' => 'Atari',
- 'OS_OS2' => 'OS/2',
'OS_MACOS' => 'MacOS',
'OS_TOPS20' => 'TOPS20',
'OS_WIN32' => 'Win32',
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index df2a2501b2..c7604211bb 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -27,9 +27,6 @@
#define RUBY_ZLIB_VERSION "0.6.0"
-
-#define OBJ_IS_FREED(val) (RBASIC(val)->flags == 0)
-
#ifndef GZIP_SUPPORT
#define GZIP_SUPPORT 1
#endif
@@ -91,8 +88,8 @@ static void zstream_reset(struct zstream*);
static VALUE zstream_end(struct zstream*);
static void zstream_run(struct zstream*, Bytef*, long, int);
static VALUE zstream_sync(struct zstream*, Bytef*, long);
-static void zstream_mark(struct zstream*);
-static void zstream_free(struct zstream*);
+static void zstream_mark(void*);
+static void zstream_free(void*);
static VALUE zstream_new(VALUE, const struct zstream_funcs*);
static struct zstream *get_zstream(VALUE);
static void zstream_finalize(struct zstream*);
@@ -137,8 +134,8 @@ static VALUE rb_inflate_set_dictionary(VALUE, VALUE);
#if GZIP_SUPPORT
struct gzfile;
-static void gzfile_mark(struct gzfile*);
-static void gzfile_free(struct gzfile*);
+static void gzfile_mark(void*);
+static void gzfile_free(void*);
static VALUE gzfile_new(VALUE, const struct zstream_funcs*, void (*) _((struct gzfile*)));
static void gzfile_reset(struct gzfile*);
static void gzfile_close(struct gzfile*, int);
@@ -337,11 +334,8 @@ raise_zlib_error(int err, const char *msg)
rb_sys_fail(msg);
/* no return */
default:
- {
- char buf[BUFSIZ];
- snprintf(buf, BUFSIZ, "unknown zlib error %d: %s", err, msg);
- exc = rb_exc_new2(cZError, buf);
- }
+ exc = rb_exc_new_str(cZError,
+ rb_sprintf("unknown zlib error %d: %s", err, msg));
}
rb_exc_raise(exc);
@@ -393,10 +387,7 @@ checksum_long(uLong (*func)(uLong, const Bytef*, uInt), uLong sum, const Bytef *
#endif
static VALUE
-do_checksum(argc, argv, func)
- int argc;
- VALUE *argv;
- uLong (*func)(uLong, const Bytef*, uInt);
+do_checksum(int argc, VALUE *argv, uLong (*func)(uLong, const Bytef*, uInt))
{
VALUE str, vsum;
unsigned long sum;
@@ -432,7 +423,14 @@ do_checksum(argc, argv, func)
* +adler+. If +string+ is omitted, it returns the Adler-32 initial value. If
* +adler+ is omitted, it assumes that the initial value is given to +adler+.
*
- * FIXME: expression.
+ * Example usage:
+ *
+ * require "zlib"
+ *
+ * data = "foo"
+ * puts "Adler32 checksum: #{Zlib.adler32(data).to_s(16)}"
+ * #=> Adler32 checksum: 2820145
+ *
*/
static VALUE
rb_zlib_adler32(int argc, VALUE *argv, VALUE klass)
@@ -464,7 +462,7 @@ rb_zlib_adler32_combine(VALUE klass, VALUE adler1, VALUE adler2, VALUE len2)
/*
* Document-method: Zlib.crc32
*
- * call-seq: Zlib.crc32(string, adler)
+ * call-seq: Zlib.crc32(string, crc)
*
* Calculates CRC checksum for +string+, and returns updated value of +crc+. If
* +string+ is omitted, it returns the CRC initial value. If +crc+ is omitted, it
@@ -583,7 +581,7 @@ struct zstream_run_args {
static voidpf
zlib_mem_alloc(voidpf opaque, uInt items, uInt size)
{
- voidpf p = xmalloc(items * size);
+ voidpf p = xmalloc2(items, size);
/* zlib FAQ: Valgrind (or some similar memory access checker) says that
deflate is performing a conditional jump that depends on an
uninitialized value. Isn't that a bug?
@@ -810,8 +808,7 @@ zstream_shift_buffer(struct zstream *z, long len)
return zstream_detach_buffer(z);
}
- dst = rb_str_subseq(z->buf, 0, len);
- rb_obj_reveal(dst, rb_cString);
+ dst = rb_str_new(RSTRING_PTR(z->buf), len);
z->buf_filled -= len;
memmove(RSTRING_PTR(z->buf), RSTRING_PTR(z->buf) + len,
z->buf_filled);
@@ -1001,7 +998,8 @@ zstream_run_func(void *ptr)
if (args->stream_output) {
state = (int)(VALUE)rb_thread_call_with_gvl(zstream_expand_buffer_protect,
(void *)z);
- } else {
+ }
+ else {
state = zstream_expand_buffer_without_gvl(z);
}
@@ -1031,7 +1029,7 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
{
struct zstream_run_args args;
int err;
- volatile VALUE guard = Qnil;
+ VALUE guard = Qnil;
args.z = z;
args.flush = flush;
@@ -1088,7 +1086,7 @@ loop:
if (z->stream.avail_in > 0) {
zstream_append_input(z, z->stream.next_in, z->stream.avail_in);
- RB_GC_GUARD(guard) = Qnil; /* prevent tail call to make guard effective */
+ RB_GC_GUARD(guard); /* prevent tail call to make guard effective */
}
if (args.jump_state)
@@ -1135,8 +1133,9 @@ zstream_sync(struct zstream *z, Bytef *src, long len)
}
static void
-zstream_mark(struct zstream *z)
+zstream_mark(void *p)
{
+ struct zstream *z = p;
rb_gc_mark(z->buf);
rb_gc_mark(z->input);
}
@@ -1152,22 +1151,36 @@ zstream_finalize(struct zstream *z)
}
static void
-zstream_free(struct zstream *z)
+zstream_free(void *p)
{
+ struct zstream *z = p;
+
if (ZSTREAM_IS_READY(z)) {
zstream_finalize(z);
}
xfree(z);
}
+static size_t
+zstream_memsize(const void *p)
+{
+ /* n.b. this does not track memory managed via zalloc/zfree callbacks */
+ return sizeof(struct zstream);
+}
+
+static const rb_data_type_t zstream_data_type = {
+ "zstream",
+ { zstream_mark, zstream_free, zstream_memsize, },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
static VALUE
zstream_new(VALUE klass, const struct zstream_funcs *funcs)
{
VALUE obj;
struct zstream *z;
- obj = Data_Make_Struct(klass, struct zstream,
- zstream_mark, zstream_free, z);
+ obj = TypedData_Make_Struct(klass, struct zstream, &zstream_data_type, z);
zstream_init(z, funcs);
z->stream.opaque = (voidpf)obj;
return obj;
@@ -1181,7 +1194,7 @@ get_zstream(VALUE obj)
{
struct zstream *z;
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
if (!ZSTREAM_IS_READY(z)) {
rb_raise(cZError, "stream is not ready");
}
@@ -1304,7 +1317,7 @@ rb_zstream_flush_next_in(VALUE obj)
struct zstream *z;
VALUE dst;
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
dst = zstream_detach_input(z);
OBJ_INFECT(dst, obj);
return dst;
@@ -1324,7 +1337,7 @@ rb_zstream_flush_next_out(VALUE obj)
{
struct zstream *z;
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
return zstream_detach_buffer(z);
}
@@ -1337,7 +1350,7 @@ static VALUE
rb_zstream_avail_out(VALUE obj)
{
struct zstream *z;
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
return rb_uint2inum(z->stream.avail_out);
}
@@ -1364,7 +1377,7 @@ static VALUE
rb_zstream_avail_in(VALUE obj)
{
struct zstream *z;
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
return INT2FIX(NIL_P(z->input) ? 0 : (int)(RSTRING_LEN(z->input)));
}
@@ -1422,7 +1435,7 @@ static VALUE
rb_zstream_closed_p(VALUE obj)
{
struct zstream *z;
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
return ZSTREAM_IS_READY(z) ? Qfalse : Qtrue;
}
@@ -1463,13 +1476,15 @@ rb_deflate_s_allocate(VALUE klass)
* the default value of that argument is used.
*
* The +level+ sets the compression level for the deflate stream between 0 (no
- * compression) and 9 (best compression. The following constants have been
+ * compression) and 9 (best compression). The following constants have been
* defined to make code more readable:
*
- * * Zlib::NO_COMPRESSION = 0
- * * Zlib::BEST_SPEED = 1
- * * Zlib::DEFAULT_COMPRESSION = 6
- * * Zlib::BEST_COMPRESSION = 9
+ * * Zlib::DEFAULT_COMPRESSION
+ * * Zlib::NO_COMPRESSION
+ * * Zlib::BEST_SPEED
+ * * Zlib::BEST_COMPRESSION
+ *
+ * See http://www.zlib.net/manual.html#Constants for further information.
*
* 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
@@ -1532,7 +1547,7 @@ rb_deflate_initialize(int argc, VALUE *argv, VALUE obj)
int err;
rb_scan_args(argc, argv, "04", &level, &wbits, &memlevel, &strategy);
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
err = deflateInit2(&z->stream, ARG_LEVEL(level), Z_DEFLATED,
ARG_WBITS(wbits), ARG_MEMLEVEL(memlevel),
@@ -1556,9 +1571,10 @@ rb_deflate_init_copy(VALUE self, VALUE orig)
struct zstream *z1, *z2;
int err;
- Data_Get_Struct(self, struct zstream, z1);
+ TypedData_Get_Struct(self, struct zstream, &zstream_data_type, z1);
z2 = get_zstream(orig);
+ if (z1 == z2) return self;
err = deflateCopy(&z1->stream, &z2->stream);
if (err != Z_OK) {
raise_zlib_error(err, 0);
@@ -1590,7 +1606,7 @@ deflate_run(VALUE args)
*
* Compresses the given +string+. Valid values of level are
* Zlib::NO_COMPRESSION, Zlib::BEST_SPEED, Zlib::BEST_COMPRESSION,
- * Zlib::DEFAULT_COMPRESSION, or an integer from 0 to 9 (the default is 6).
+ * Zlib::DEFAULT_COMPRESSION, or an integer from 0 to 9.
*
* This method is almost equivalent to the following code:
*
@@ -1834,7 +1850,7 @@ rb_inflate_s_allocate(VALUE klass)
* Have inflate use the window size from the zlib header of the compressed
* stream.
*
- * (8..15)
+ * (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.
@@ -1874,7 +1890,7 @@ rb_inflate_initialize(int argc, VALUE *argv, VALUE obj)
int err;
rb_scan_args(argc, argv, "01", &wbits);
- Data_Get_Struct(obj, struct zstream, z);
+ TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
err = inflateInit2(&z->stream, ARG_WBITS(wbits));
if (err != Z_OK) {
@@ -1965,7 +1981,8 @@ do_inflate(struct zstream *z, VALUE src)
* stream's required dictionary.
*/
static VALUE
-rb_inflate_add_dictionary(VALUE obj, VALUE dictionary) {
+rb_inflate_add_dictionary(VALUE obj, VALUE dictionary)
+{
VALUE dictionaries = rb_ivar_get(obj, id_dictionaries);
VALUE checksum = do_checksum(1, &dictionary, adler32);
@@ -2194,18 +2211,18 @@ struct gzfile {
struct zstream z;
VALUE io;
int level;
- time_t mtime; /* for header */
int os_code; /* for header */
+ time_t mtime; /* for header */
VALUE orig_name; /* for header; must be a String */
VALUE comment; /* for header; must be a String */
unsigned long crc;
+ int ecflags;
int lineno;
long ungetc;
void (*end)(struct gzfile *);
rb_encoding *enc;
rb_encoding *enc2;
rb_econv_t *ec;
- int ecflags;
VALUE ecopts;
char *cbuf;
VALUE path;
@@ -2223,8 +2240,10 @@ struct gzfile {
static void
-gzfile_mark(struct gzfile *gz)
+gzfile_mark(void *p)
{
+ struct gzfile *gz = p;
+
rb_gc_mark(gz->io);
rb_gc_mark(gz->orig_name);
rb_gc_mark(gz->comment);
@@ -2234,8 +2253,9 @@ gzfile_mark(struct gzfile *gz)
}
static void
-gzfile_free(struct gzfile *gz)
+gzfile_free(void *p)
{
+ struct gzfile *gz = p;
struct zstream *z = &gz->z;
if (ZSTREAM_IS_READY(z)) {
@@ -2250,6 +2270,24 @@ gzfile_free(struct gzfile *gz)
xfree(gz);
}
+static size_t
+gzfile_memsize(const void *p)
+{
+ const struct gzfile *gz = p;
+ size_t size = sizeof(struct gzfile);
+
+ if (gz->cbuf)
+ size += GZFILE_CBUF_CAPA;
+
+ return size;
+}
+
+static const rb_data_type_t gzfile_data_type = {
+ "gzfile",
+ { gzfile_mark, gzfile_free, gzfile_memsize, },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
static VALUE
gzfile_new(klass, funcs, endfunc)
VALUE klass;
@@ -2259,7 +2297,7 @@ gzfile_new(klass, funcs, endfunc)
VALUE obj;
struct gzfile *gz;
- obj = Data_Make_Struct(klass, struct gzfile, gzfile_mark, gzfile_free, gz);
+ obj = TypedData_Make_Struct(klass, struct gzfile, &gzfile_data_type, gz);
zstream_init(&gz->z, funcs);
gz->z.flags |= ZSTREAM_FLAG_GZFILE;
gz->io = Qnil;
@@ -2290,6 +2328,7 @@ static void
gzfile_reset(struct gzfile *gz)
{
zstream_reset(&gz->z);
+ gz->z.flags |= ZSTREAM_FLAG_GZFILE;
gz->crc = crc32(0, Z_NULL, 0);
gz->lineno = 0;
gz->ungetc = 0;
@@ -2633,7 +2672,7 @@ gzfile_write(struct gzfile *gz, Bytef *str, long len)
static long
gzfile_read_more(struct gzfile *gz)
{
- volatile VALUE str;
+ VALUE str;
while (!ZSTREAM_IS_FINISHED(&gz->z)) {
str = gzfile_read_raw(gz);
@@ -2646,6 +2685,7 @@ gzfile_read_more(struct gzfile *gz)
if (RSTRING_LEN(str) > 0) { /* prevent Z_BUF_ERROR */
zstream_run(&gz->z, (Bytef*)RSTRING_PTR(str), RSTRING_LEN(str),
Z_SYNC_FLUSH);
+ RB_GC_GUARD(str);
}
if (gz->z.buf_filled > 0) break;
}
@@ -2752,6 +2792,7 @@ gzfile_readpartial(struct gzfile *gz, long len, VALUE outbuf)
if (!NIL_P(outbuf)) {
rb_str_resize(outbuf, RSTRING_LEN(dst));
memcpy(RSTRING_PTR(outbuf), RSTRING_PTR(dst), RSTRING_LEN(dst));
+ RB_GC_GUARD(dst);
dst = outbuf;
}
OBJ_TAINT(dst); /* for safe */
@@ -2923,7 +2964,7 @@ get_gzfile(VALUE obj)
{
struct gzfile *gz;
- Data_Get_Struct(obj, struct gzfile, gz);
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
if (!ZSTREAM_IS_READY(&gz->z)) {
rb_raise(cGzError, "closed gzip stream");
}
@@ -2989,7 +3030,7 @@ gzfile_ensure_close(VALUE obj)
{
struct gzfile *gz;
- Data_Get_Struct(obj, struct gzfile, gz);
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
if (ZSTREAM_IS_READY(&gz->z)) {
gzfile_close(gz, 1);
}
@@ -3056,9 +3097,7 @@ gzfile_s_open(int argc, VALUE *argv, VALUE klass, const char *mode)
{
VALUE io, filename;
- if (argc < 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
- }
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
filename = argv[0];
io = rb_file_open_str(filename, mode);
argv[0] = io;
@@ -3257,9 +3296,13 @@ rb_gzfile_set_comment(VALUE obj, VALUE str)
static VALUE
rb_gzfile_close(VALUE obj)
{
- struct gzfile *gz = get_gzfile(obj);
+ struct gzfile *gz;
VALUE io;
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ if (!ZSTREAM_IS_READY(&gz->z)) {
+ return Qnil;
+ }
io = gz->io;
gzfile_close(gz, 1);
return io;
@@ -3293,7 +3336,7 @@ static VALUE
rb_gzfile_closed_p(VALUE obj)
{
struct gzfile *gz;
- Data_Get_Struct(obj, struct gzfile, gz);
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
return NIL_P(gz->io) ? Qtrue : Qfalse;
}
@@ -3364,7 +3407,14 @@ static VALUE
rb_gzfile_total_out(VALUE obj)
{
struct gzfile *gz = get_gzfile(obj);
- return rb_uint2inum(gz->z.stream.total_out - gz->z.buf_filled);
+ uLong total_out = gz->z.stream.total_out;
+ long buf_filled = gz->z.buf_filled;
+
+ if (total_out >= (uLong)buf_filled) {
+ return rb_uint2inum(total_out - buf_filled);
+ } else {
+ return LONG2FIX(-(buf_filled - (long)total_out));
+ }
}
/*
@@ -3379,7 +3429,7 @@ static VALUE
rb_gzfile_path(VALUE obj)
{
struct gzfile *gz;
- Data_Get_Struct(obj, struct gzfile, gz);
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
return gz->path;
}
@@ -3477,7 +3527,7 @@ rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj)
}
rb_scan_args(argc, argv, "12", &io, &level, &strategy);
- Data_Get_Struct(obj, struct gzfile, gz);
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
/* this is undocumented feature of zlib */
gz->level = ARG_LEVEL(level);
@@ -3540,6 +3590,7 @@ rb_gzwriter_write(VALUE obj, VALUE str)
str = rb_str_conv_enc(str, rb_enc_get(str), gz->enc2);
}
gzfile_write(gz, (Bytef*)RSTRING_PTR(str), RSTRING_LEN(str));
+ RB_GC_GUARD(str);
return INT2FIX(RSTRING_LEN(str));
}
@@ -3586,7 +3637,7 @@ rb_gzwriter_putc(VALUE obj, VALUE ch)
* Document-class: Zlib::GzipReader
*
* Zlib::GzipReader is the class for reading a gzipped file. GzipReader should
- * be used an IO, or -IO-like, object.
+ * be used as an IO, or -IO-like, object.
*
* Zlib::GzipReader.open('hoge.gz') {|gz|
* print gz.read
@@ -3679,7 +3730,7 @@ rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj)
struct gzfile *gz;
int err;
- Data_Get_Struct(obj, struct gzfile, gz);
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
rb_scan_args(argc, argv, "1:", &io, &opt);
/* this is undocumented feature of zlib */
@@ -3724,7 +3775,7 @@ static VALUE
rb_gzreader_unused(VALUE obj)
{
struct gzfile *gz;
- Data_Get_Struct(obj, struct gzfile, gz);
+ TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
return gzfile_reader_get_unused(gz);
}
@@ -3913,6 +3964,7 @@ rb_gzreader_ungetc(VALUE obj, VALUE s)
s = rb_str_conv_enc(s, rb_enc_get(s), gz->enc2);
}
gzfile_ungets(gz, (const Bytef*)RSTRING_PTR(s), RSTRING_LEN(s));
+ RB_GC_GUARD(s);
return Qnil;
}
@@ -3992,7 +4044,7 @@ static VALUE
gzreader_gets(int argc, VALUE *argv, VALUE obj)
{
struct gzfile *gz = get_gzfile(obj);
- volatile VALUE rs;
+ VALUE rs;
VALUE dst;
const char *rsptr;
char *p, *res;
@@ -4055,7 +4107,8 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
rsptr = "\n\n";
rslen = 2;
rspara = 1;
- } else {
+ }
+ else {
rsptr = RSTRING_PTR(rs);
rslen = RSTRING_LEN(rs);
rspara = 0;
@@ -4092,7 +4145,8 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
n = filled;
if (limit > 0 && filled >= limit) break;
n++;
- } else {
+ }
+ else {
n += (long)(res - p);
p = res;
if (rslen == 1 || memcmp(p, rsptr, rslen) == 0) break;
@@ -4109,6 +4163,7 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
if (rspara) {
gzreader_skip_linebreaks(gz);
}
+ RB_GC_GUARD(rs);
return gzfile_newstr(gz, dst);
}
@@ -4193,10 +4248,21 @@ rb_gzreader_readlines(int argc, VALUE *argv, VALUE obj)
return dst;
}
+/*
+ * Document-method: Zlib::GzipReader#external_encoding
+ *
+ * See Zlib::GzipReader documentation for a description.
+ */
+static VALUE
+rb_gzreader_external_encoding(VALUE self)
+{
+ return rb_enc_from_encoding(get_gzfile(self)->enc);
+}
+
#endif /* GZIP_SUPPORT */
void
-Init_zlib()
+Init_zlib(void)
{
VALUE mZlib, cZStream, cDeflate, cInflate;
#if GZIP_SUPPORT
@@ -4301,7 +4367,7 @@ Init_zlib()
* pre-compressed data to a deflate stream.
*/
rb_define_const(mZlib, "NO_COMPRESSION", INT2FIX(Z_NO_COMPRESSION));
- /* Fastest compression level, but with with lowest space savings. */
+ /* Fastest compression level, but with the lowest space savings. */
rb_define_const(mZlib, "BEST_SPEED", INT2FIX(Z_BEST_SPEED));
/* Slowest compression level, but with the best space savings. */
rb_define_const(mZlib, "BEST_COMPRESSION", INT2FIX(Z_BEST_COMPRESSION));
@@ -4461,6 +4527,7 @@ Init_zlib()
rb_define_method(cGzipReader, "each_line", rb_gzreader_each, -1);
rb_define_method(cGzipReader, "lines", rb_gzreader_lines, -1);
rb_define_method(cGzipReader, "readlines", rb_gzreader_readlines, -1);
+ rb_define_method(cGzipReader, "external_encoding", rb_gzreader_external_encoding, 0);
/* The OS code of current host */
rb_define_const(mZlib, "OS_CODE", INT2FIX(OS_CODE));
diff --git a/file.c b/file.c
index 77facacfcf..c57447a233 100644
--- a/file.c
+++ b/file.c
@@ -23,15 +23,18 @@
#include <CoreFoundation/CFString.h>
#endif
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/io.h"
#include "ruby/util.h"
#include "dln.h"
-#include "internal.h"
+#include "encindex.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
#ifdef HAVE_SYS_FILE_H
# include <sys/file.h>
@@ -63,13 +66,16 @@ 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"
+#if defined(__native_client__)
+# if defined(NACL_NEWLIB)
+# include "nacl/utime.h"
+# include "nacl/stat.h"
+# include "nacl/unistd.h"
+# else
+# undef HAVE_UTIMENSAT
+# endif
#endif
-
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
@@ -88,15 +94,20 @@ int flock(int, int);
/* define system APIs */
#ifdef _WIN32
+#include "win32/file.h"
#define STAT(p, s) rb_w32_ustati64((p), (s))
#undef lstat
-#define lstat(p, s) rb_w32_ustati64((p), (s))
+#define lstat(p, s) rb_w32_ulstati64((p), (s))
#undef access
#define access(p, m) rb_w32_uaccess((p), (m))
+#undef truncate
+#define truncate(p, n) rb_w32_utruncate((p), (n))
#undef chmod
#define chmod(p, m) rb_w32_uchmod((p), (m))
#undef chown
#define chown(p, o, g) rb_w32_uchown((p), (o), (g))
+#undef lchown
+#define lchown(p, o, g) rb_w32_ulchown((p), (o), (g))
#undef utime
#define utime(p, t) rb_w32_uutime((p), (t))
#undef link
@@ -105,37 +116,12 @@ int flock(int, int);
#define unlink(p) rb_w32_uunlink(p)
#undef rename
#define rename(f, t) rb_w32_urename((f), (t))
+#undef symlink
+#define symlink(s, l) rb_w32_usymlink((s), (l))
#else
#define STAT(p, s) stat((p), (s))
#endif
-#if defined(__BEOS__) || defined(__HAIKU__) /* should not change ID if -1 */
-static int
-be_chown(const char *path, uid_t owner, gid_t group)
-{
- if (owner == (uid_t)-1 || group == (gid_t)-1) {
- struct stat st;
- if (STAT(path, &st) < 0) return -1;
- if (owner == (uid_t)-1) owner = st.st_uid;
- if (group == (gid_t)-1) group = st.st_gid;
- }
- return chown(path, owner, group);
-}
-#define chown be_chown
-static int
-be_fchown(int fd, uid_t owner, gid_t group)
-{
- if (owner == (uid_t)-1 || group == (gid_t)-1) {
- struct stat st;
- if (fstat(fd, &st) < 0) return -1;
- if (owner == (uid_t)-1) owner = st.st_uid;
- if (group == (gid_t)-1) group = st.st_gid;
- }
- return fchown(fd, owner, group);
-}
-#define fchown be_fchown
-#endif /* __BEOS__ || __HAIKU__ */
-
VALUE rb_cFile;
VALUE rb_mFileTest;
VALUE rb_cStat;
@@ -146,15 +132,17 @@ static VALUE
file_path_convert(VALUE name)
{
#ifndef _WIN32 /* non Windows == Unix */
- rb_encoding *fname_encoding = rb_enc_from_index(ENCODING_GET(name));
- rb_encoding *fs_encoding;
- if (rb_default_internal_encoding() != NULL
- && rb_usascii_encoding() != fname_encoding
- && rb_ascii8bit_encoding() != fname_encoding
- && (fs_encoding = rb_filesystem_encoding()) != fname_encoding
- && !rb_enc_str_asciionly_p(name)) {
+ int fname_encidx = ENCODING_GET(name);
+ int fs_encidx;
+ if (ENCINDEX_US_ASCII != fname_encidx &&
+ ENCINDEX_ASCII != fname_encidx &&
+ (fs_encidx = rb_filesystem_encindex()) != fname_encidx &&
+ rb_default_internal_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 */
+ rb_encoding *fname_encoding = rb_enc_from_index(fname_encidx);
+ rb_encoding *fs_encoding = rb_enc_from_index(fs_encidx);
name = rb_str_conv_enc(name, fname_encoding, fs_encoding);
}
#endif
@@ -230,26 +218,27 @@ rb_get_path(VALUE obj)
VALUE
rb_str_encode_ospath(VALUE path)
{
+#if defined _WIN32 || defined __APPLE__
+ int encidx = ENCODING_GET(path);
#ifdef _WIN32
- rb_encoding *enc = rb_enc_get(path);
- rb_encoding *utf8 = rb_utf8_encoding();
- if (enc == rb_ascii8bit_encoding()) {
- enc = rb_filesystem_encoding();
+ if (encidx == ENCINDEX_ASCII) {
+ encidx = rb_filesystem_encindex();
}
- if (enc != utf8) {
+#endif
+ if (encidx != ENCINDEX_UTF_8) {
+ rb_encoding *enc = rb_enc_from_index(encidx);
+ rb_encoding *utf8 = rb_utf8_encoding();
path = rb_str_conv_enc(path, enc, utf8);
}
-#elif defined __APPLE__
- path = rb_str_conv_enc(path, NULL, rb_utf8_encoding());
#endif
return path;
}
#ifdef __APPLE__
+# define NORMALIZE_UTF8PATH 1
static VALUE
-rb_str_normalize_ospath0(const char *ptr, long len)
+rb_str_append_normalized_ospath(VALUE str, const char *ptr, long len)
{
- VALUE str;
CFIndex buflen = 0;
CFRange all;
CFStringRef s = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault,
@@ -257,14 +246,15 @@ rb_str_normalize_ospath0(const char *ptr, long len)
kCFStringEncodingUTF8, FALSE,
kCFAllocatorNull);
CFMutableStringRef m = CFStringCreateMutableCopy(kCFAllocatorDefault, len, s);
+ long oldlen = RSTRING_LEN(str);
CFStringNormalize(m, kCFStringNormalizationFormC);
all = CFRangeMake(0, CFStringGetLength(m));
CFStringGetBytes(m, all, kCFStringEncodingUTF8, '?', FALSE, NULL, 0, &buflen);
- str = rb_enc_str_new(0, buflen, rb_utf8_encoding());
- CFStringGetBytes(m, all, kCFStringEncodingUTF8, '?', FALSE, (UInt8 *)RSTRING_PTR(str),
- buflen, &buflen);
- rb_str_set_len(str, buflen);
+ rb_str_modify_expand(str, buflen);
+ CFStringGetBytes(m, all, kCFStringEncodingUTF8, '?', FALSE,
+ (UInt8 *)(RSTRING_PTR(str) + oldlen), buflen, &buflen);
+ rb_str_set_len(str, oldlen + buflen);
CFRelease(m);
CFRelease(s);
return str;
@@ -285,16 +275,19 @@ rb_str_normalize_ospath(const char *ptr, long len)
int r = rb_enc_precise_mbclen(p, e, enc);
if (!MBCLEN_CHARFOUND_P(r)) {
/* invalid byte shall not happen but */
- rb_str_append(str, rb_str_normalize_ospath0(p1, p-p1));
- rb_str_cat2(str, "\xEF\xBF\xBD");
+ static const char invalid[3] = "\xEF\xBF\xBD";
+ rb_str_append_normalized_ospath(str, p1, p-p1);
+ rb_str_cat(str, invalid, sizeof(invalid));
p += 1;
+ p1 = p;
+ continue;
}
l = MBCLEN_CHARFOUND_LEN(r);
c = rb_enc_mbc_to_codepoint(p, e, enc);
if ((0x2000 <= c && c <= 0x2FFF) || (0xF900 <= c && c <= 0xFAFF) ||
(0x2F800 <= c && c <= 0x2FAFF)) {
if (p - p1 > 0) {
- rb_str_append(str, rb_str_normalize_ospath0(p1, p-p1));
+ rb_str_append_normalized_ospath(str, p1, p-p1);
}
rb_str_cat(str, p, l);
p += l;
@@ -305,11 +298,45 @@ rb_str_normalize_ospath(const char *ptr, long len)
}
}
if (p - p1 > 0) {
- rb_str_append(str, rb_str_normalize_ospath0(p1, p-p1));
+ rb_str_append_normalized_ospath(str, p1, p-p1);
}
return str;
}
+
+static int
+ignored_char_p(const char *p, const char *e, rb_encoding *enc)
+{
+ unsigned char c;
+ if (p+3 > e) return 0;
+ switch ((unsigned char)*p) {
+ case 0xe2:
+ switch ((unsigned char)p[1]) {
+ case 0x80:
+ c = (unsigned char)p[2];
+ /* c >= 0x200c && c <= 0x200f */
+ if (c >= 0x8c && c <= 0x8f) return 3;
+ /* c >= 0x202a && c <= 0x202e */
+ if (c >= 0xaa && c <= 0xae) return 3;
+ return 0;
+ case 0x81:
+ c = (unsigned char)p[2];
+ /* c >= 0x206a && c <= 0x206f */
+ if (c >= 0xaa && c <= 0xaf) return 3;
+ return 0;
+ }
+ break;
+ case 0xef:
+ /* c == 0xfeff */
+ if ((unsigned char)p[1] == 0xbb &&
+ (unsigned char)p[2] == 0xbf)
+ return 3;
+ break;
+ }
+ return 0;
+}
+#else
+# define NORMALIZE_UTF8PATH 0
#endif
static long
@@ -356,25 +383,27 @@ rb_file_path(VALUE obj)
static size_t
stat_memsize(const void *p)
{
- return p ? sizeof(struct stat) : 0;
+ return sizeof(struct stat);
}
static const rb_data_type_t stat_data_type = {
"stat",
{NULL, RUBY_TYPED_DEFAULT_FREE, stat_memsize,},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
stat_new_0(VALUE klass, const struct stat *st)
{
struct stat *nst = 0;
+ VALUE obj = TypedData_Wrap_Struct(klass, &stat_data_type, 0);
if (st) {
nst = ALLOC(struct stat);
*nst = *st;
+ RTYPEDDATA_DATA(obj) = nst;
}
- return TypedData_Wrap_Struct(klass, &stat_data_type, nst);
+ return obj;
}
VALUE
@@ -401,7 +430,7 @@ static struct timespec stat_mtimespec(struct stat *st);
* Compares File::Stat objects by comparing their respective modification
* times.
*
- * +nil+ is returned if the two values are incomparable.
+ * +nil+ is returned if +other_stat+ is not a File::Stat object
*
* f1 = File.new("f1", "w")
* sleep 1
@@ -509,7 +538,18 @@ rb_stat_dev_minor(VALUE self)
static VALUE
rb_stat_ino(VALUE self)
{
-#if SIZEOF_STRUCT_STAT_ST_INO > SIZEOF_LONG
+#ifdef _WIN32
+ struct stat *st = get_stat(self);
+ unsigned short *p2 = (unsigned short *)st;
+ unsigned int *p4 = (unsigned int *)st;
+ uint64_t r;
+ r = p2[2];
+ r <<= 16;
+ r |= p2[7];
+ r <<= 32;
+ r |= p4[5];
+ return ULL2NUM(r);
+#elif SIZEOF_STRUCT_STAT_ST_INO > SIZEOF_LONG
return ULL2NUM(get_stat(self)->st_ino);
#else
return ULONG2NUM(get_stat(self)->st_ino);
@@ -720,7 +760,7 @@ stat_atimespec(struct stat *st)
#elif defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
ts.tv_nsec = st->st_atimespec.tv_nsec;
#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
- ts.tv_nsec = st->st_atimensec;
+ ts.tv_nsec = (long)st->st_atimensec;
#else
ts.tv_nsec = 0;
#endif
@@ -744,7 +784,7 @@ stat_mtimespec(struct stat *st)
#elif defined(HAVE_STRUCT_STAT_ST_MTIMESPEC)
ts.tv_nsec = st->st_mtimespec.tv_nsec;
#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
- ts.tv_nsec = st->st_mtimensec;
+ ts.tv_nsec = (long)st->st_mtimensec;
#else
ts.tv_nsec = 0;
#endif
@@ -768,7 +808,7 @@ stat_ctimespec(struct stat *st)
#elif defined(HAVE_STRUCT_STAT_ST_CTIMESPEC)
ts.tv_nsec = st->st_ctimespec.tv_nsec;
#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC)
- ts.tv_nsec = st->st_ctimensec;
+ ts.tv_nsec = (long)st->st_ctimensec;
#else
ts.tv_nsec = 0;
#endif
@@ -782,6 +822,20 @@ stat_ctime(struct stat *st)
return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
}
+#define HAVE_STAT_BIRTHTIME
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC)
+static VALUE
+stat_birthtime(struct stat *st)
+{
+ struct timespec *ts = &st->st_birthtimespec;
+ return rb_time_nano_new(ts->tv_sec, ts->tv_nsec);
+}
+#elif defined(_WIN32)
+# define stat_birthtime stat_ctime
+#else
+# undef HAVE_STAT_BIRTHTIME
+#endif
+
/*
* call-seq:
* stat.atime -> time
@@ -835,6 +889,38 @@ rb_stat_ctime(VALUE self)
return stat_ctime(get_stat(self));
}
+#if defined(HAVE_STAT_BIRTHTIME)
+/*
+ * call-seq:
+ * stat.birthtime -> aTime
+ *
+ * Returns the birth time for <i>stat</i>.
+ *
+ * If the platform doesn't have birthtime, raises NotImplementedError.
+ *
+ * File.write("testfile", "foo")
+ * sleep 10
+ * File.write("testfile", "bar")
+ * sleep 10
+ * File.chmod(0644, "testfile")
+ * sleep 10
+ * File.read("testfile")
+ * File.stat("testfile").birthtime #=> 2014-02-24 11:19:17 +0900
+ * File.stat("testfile").mtime #=> 2014-02-24 11:19:27 +0900
+ * File.stat("testfile").ctime #=> 2014-02-24 11:19:37 +0900
+ * File.stat("testfile").atime #=> 2014-02-24 11:19:47 +0900
+ *
+ */
+
+static VALUE
+rb_stat_birthtime(VALUE self)
+{
+ return stat_birthtime(get_stat(self));
+}
+#else
+# define rb_stat_birthtime rb_f_notimplement
+#endif
+
/*
* call-seq:
* stat.inspect -> string
@@ -846,7 +932,8 @@ rb_stat_ctime(VALUE self)
* # nlink=1, uid=0, gid=0, rdev=0x0, size=1374, blksize=4096,
* # blocks=8, atime=Wed Dec 10 10:16:12 CST 2003,
* # mtime=Fri Sep 12 15:41:41 CDT 2003,
- * # ctime=Mon Oct 27 11:20:27 CST 2003>"
+ * # ctime=Mon Oct 27 11:20:27 CST 2003,
+ * # birthtime=Mon Aug 04 08:13:49 CDT 2003>"
*/
static VALUE
@@ -871,6 +958,9 @@ rb_stat_inspect(VALUE self)
{"atime", rb_stat_atime},
{"mtime", rb_stat_mtime},
{"ctime", rb_stat_ctime},
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC)
+ {"birthtime", rb_stat_birthtime},
+#endif
};
struct stat* st;
@@ -913,7 +1003,6 @@ rb_stat(VALUE file, struct stat *st)
{
VALUE tmp;
- rb_secure(2);
tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io");
if (!NIL_P(tmp)) {
rb_io_t *fptr;
@@ -966,6 +1055,25 @@ w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
if (ret) CloseHandle(ret);
return INVALID_HANDLE_VALUE;
}
+
+static VALUE
+close_handle(VALUE h)
+{
+ CloseHandle((HANDLE)h);
+ return Qfalse;
+}
+
+struct w32_io_info_args {
+ VALUE *fname;
+ BY_HANDLE_FILE_INFORMATION *st;
+};
+
+static VALUE
+call_w32_io_info(VALUE arg)
+{
+ struct w32_io_info_args *p = (void *)arg;
+ return (VALUE)w32_io_info(p->fname, p->st);
+}
#endif
/*
@@ -1039,7 +1147,6 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
#ifdef HAVE_LSTAT
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
@@ -1073,7 +1180,6 @@ rb_file_lstat(VALUE obj)
struct stat st;
VALUE path;
- rb_secure(2);
GetOpenFile(obj, fptr);
if (NIL_P(fptr->pathv)) return Qnil;
path = rb_str_encode_ospath(fptr->pathv);
@@ -1089,7 +1195,7 @@ rb_file_lstat(VALUE obj)
static int
rb_group_member(GETGROUPS_T gid)
{
-#ifdef _WIN32
+#if defined(_WIN32) || !defined(HAVE_GETGROUPS)
return FALSE;
#else
int rv = FALSE;
@@ -1141,6 +1247,15 @@ rb_group_member(GETGROUPS_T gid)
#define USE_GETEUID 1
#endif
+#ifdef __native_client__
+// Although the NaCl toolchain contain eaccess() is it not yet
+// overridden by nacl_io.
+// TODO(sbc): Remove this once eaccess() is wired up correctly
+// in NaCl.
+# undef HAVE_EACCESS
+# undef USE_GETEUID
+#endif
+
#ifndef HAVE_EACCESS
int
eaccess(const char *path, int mode)
@@ -1278,7 +1393,6 @@ rb_file_symlink_p(VALUE obj, VALUE fname)
#ifdef S_ISLNK
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) < 0) return Qfalse;
@@ -1380,7 +1494,6 @@ rb_file_chardev_p(VALUE obj, VALUE fname)
/*
* call-seq:
* File.exist?(file_name) -> true or false
- * File.exists?(file_name) -> true or false
*
* Return <code>true</code> if the named file exists.
*
@@ -1398,6 +1511,12 @@ rb_file_exist_p(VALUE obj, VALUE fname)
return Qtrue;
}
+/*
+ * call-seq:
+ * File.exists?(file_name) -> true or false
+ *
+ * Deprecated method. Don't use.
+ */
static VALUE
rb_file_exists_p(VALUE obj, VALUE fname)
{
@@ -1419,13 +1538,12 @@ rb_file_exists_p(VALUE obj, VALUE fname)
* File.readable?(file_name) -> true or false
*
* Returns <code>true</code> if the named file is readable by the effective
- * user id of this process.
+ * user and group id of this process. See eaccess(3).
*/
static VALUE
rb_file_readable_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (eaccess(StringValueCStr(fname), R_OK) < 0) return Qfalse;
@@ -1437,13 +1555,12 @@ rb_file_readable_p(VALUE obj, VALUE fname)
* File.readable_real?(file_name) -> true or false
*
* Returns <code>true</code> if the named file is readable by the real
- * user id of this process.
+ * user and group id of this process. See access(3).
*/
static VALUE
rb_file_readable_real_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (access(StringValueCStr(fname), R_OK) < 0) return Qfalse;
@@ -1493,13 +1610,12 @@ rb_file_world_readable_p(VALUE obj, VALUE fname)
* File.writable?(file_name) -> true or false
*
* Returns <code>true</code> if the named file is writable by the effective
- * user id of this process.
+ * user and group id of this process. See eaccess(3).
*/
static VALUE
rb_file_writable_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (eaccess(StringValueCStr(fname), W_OK) < 0) return Qfalse;
@@ -1511,13 +1627,12 @@ rb_file_writable_p(VALUE obj, VALUE fname)
* File.writable_real?(file_name) -> true or false
*
* Returns <code>true</code> if the named file is writable by the real
- * user id of this process.
+ * user and group id of this process. See access(3)
*/
static VALUE
rb_file_writable_real_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (access(StringValueCStr(fname), W_OK) < 0) return Qfalse;
@@ -1559,13 +1674,12 @@ rb_file_world_writable_p(VALUE obj, VALUE fname)
* File.executable?(file_name) -> true or false
*
* Returns <code>true</code> if the named file is executable by the effective
- * user id of this process.
+ * user and group id of this process. See eaccess(3).
*/
static VALUE
rb_file_executable_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (eaccess(StringValueCStr(fname), X_OK) < 0) return Qfalse;
@@ -1577,13 +1691,12 @@ rb_file_executable_p(VALUE obj, VALUE fname)
* File.executable_real?(file_name) -> true or false
*
* Returns <code>true</code> if the named file is executable by the real
- * user id of this process.
+ * user and group id of this process. See access(3).
*/
static VALUE
rb_file_executable_real_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (access(StringValueCStr(fname), X_OK) < 0) return Qfalse;
@@ -1596,12 +1709,14 @@ rb_file_executable_real_p(VALUE obj, VALUE fname)
/*
* call-seq:
- * File.file?(file_name) -> true or false
+ * File.file?(file) -> true or false
*
- * Returns <code>true</code> if the named file exists and is a
- * regular file.
+ * Returns +true+ if the named +file+ exists and is a regular file.
*
- * _file_name_ can be an IO object.
+ * +file+ can be an IO object.
+ *
+ * If the +file+ argument is a symbolic link, it will resolve the symbolic link
+ * and use the file referenced by the link.
*/
static VALUE
@@ -1714,7 +1829,6 @@ check3rdbyte(VALUE fname, int mode)
{
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (STAT(StringValueCStr(fname), &st) < 0) return Qfalse;
@@ -1796,25 +1910,29 @@ rb_file_sticky_p(VALUE obj, VALUE fname)
static VALUE
rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
{
-#ifndef DOSISH
+#ifndef _WIN32
struct stat st1, st2;
if (rb_stat(fname1, &st1) < 0) return Qfalse;
if (rb_stat(fname2, &st2) < 0) return Qfalse;
if (st1.st_dev != st2.st_dev) return Qfalse;
if (st1.st_ino != st2.st_ino) return Qfalse;
+ return Qtrue;
#else
-# ifdef _WIN32
BY_HANDLE_FILE_INFORMATION st1, st2;
HANDLE f1 = 0, f2 = 0;
-# endif
- rb_secure(2);
-# ifdef _WIN32
f1 = w32_io_info(&fname1, &st1);
if (f1 == INVALID_HANDLE_VALUE) return Qfalse;
- f2 = w32_io_info(&fname2, &st2);
- if (f1) CloseHandle(f1);
+ if (f1) {
+ struct w32_io_info_args arg;
+ arg.fname = &fname2;
+ arg.st = &st2;
+ f2 = (HANDLE)rb_ensure(call_w32_io_info, (VALUE)&arg, close_handle, (VALUE)f1);
+ }
+ else {
+ f2 = w32_io_info(&fname2, &st2);
+ }
if (f2 == INVALID_HANDLE_VALUE) return Qfalse;
if (f2) CloseHandle(f2);
@@ -1822,23 +1940,8 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
st1.nFileIndexHigh == st2.nFileIndexHigh &&
st1.nFileIndexLow == st2.nFileIndexLow)
return Qtrue;
- if (!f1 || !f2) return Qfalse;
-# else
- FilePathValue(fname1);
- fname1 = rb_str_new4(fname1);
- fname1 = rb_str_encode_ospath(fname1);
- FilePathValue(fname2);
- fname2 = rb_str_encode_ospath(fname2);
- if (access(RSTRING_PTR(fname1), 0)) return Qfalse;
- if (access(RSTRING_PTR(fname2), 0)) return Qfalse;
-# endif
- fname1 = rb_file_expand_path(fname1, Qnil);
- fname2 = rb_file_expand_path(fname2, Qnil);
- if (RSTRING_LEN(fname1) != RSTRING_LEN(fname2)) return Qfalse;
- if (rb_memcicmp(RSTRING_PTR(fname1), RSTRING_PTR(fname2), RSTRING_LEN(fname1)))
- return Qfalse;
+ return Qfalse;
#endif
- return Qtrue;
}
/*
@@ -1856,8 +1959,9 @@ rb_file_s_size(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
+ int e = errno;
FilePathValue(fname);
- rb_sys_fail_path(fname);
+ rb_syserr_fail_path(e, fname);
}
return OFFT2NUM(st.st_size);
}
@@ -1923,7 +2027,6 @@ rb_file_s_ftype(VALUE klass, VALUE fname)
{
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
@@ -1951,8 +2054,9 @@ rb_file_s_atime(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
+ int e = errno;
FilePathValue(fname);
- rb_sys_fail_path(fname);
+ rb_syserr_fail_path(e, fname);
}
return stat_atime(&st);
}
@@ -1999,8 +2103,9 @@ rb_file_s_mtime(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
+ int e = errno;
FilePathValue(fname);
- rb_sys_fail_path(fname);
+ rb_syserr_fail_path(e, fname);
}
return stat_mtime(&st);
}
@@ -2050,8 +2155,9 @@ rb_file_s_ctime(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
+ int e = errno;
FilePathValue(fname);
- rb_sys_fail_path(fname);
+ rb_syserr_fail_path(e, fname);
}
return stat_ctime(&st);
}
@@ -2082,6 +2188,66 @@ rb_file_ctime(VALUE obj)
return stat_ctime(&st);
}
+#if defined(HAVE_STAT_BIRTHTIME)
+/*
+ * call-seq:
+ * File.birthtime(file_name) -> time
+ *
+ * Returns the birth time for the named file.
+ *
+ * _file_name_ can be an IO object.
+ *
+ * File.birthtime("testfile") #=> Wed Apr 09 08:53:13 CDT 2003
+ *
+ * If the platform doesn't have birthtime, raises NotImplementedError.
+ *
+ */
+
+static VALUE
+rb_file_s_birthtime(VALUE klass, VALUE fname)
+{
+ struct stat st;
+
+ if (rb_stat(fname, &st) < 0) {
+ int e = errno;
+ FilePathValue(fname);
+ rb_syserr_fail_path(e, fname);
+ }
+ return stat_birthtime(&st);
+}
+#else
+# define rb_file_s_birthtime rb_f_notimplement
+#endif
+
+#if defined(HAVE_STAT_BIRTHTIME)
+/*
+ * call-seq:
+ * file.birthtime -> time
+ *
+ * Returns the birth time for <i>file</i>.
+ *
+ * File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
+ *
+ * If the platform doesn't have birthtime, raises NotImplementedError.
+ *
+ */
+
+static VALUE
+rb_file_birthtime(VALUE obj)
+{
+ rb_io_t *fptr;
+ struct stat st;
+
+ GetOpenFile(obj, fptr);
+ if (fstat(fptr->fd, &st) == -1) {
+ rb_sys_fail_path(fptr->pathv);
+ }
+ return stat_birthtime(&st);
+}
+#else
+# define rb_file_birthtime rb_f_notimplement
+#endif
+
/*
* call-seq:
* file.size -> integer
@@ -2136,7 +2302,6 @@ rb_file_s_chmod(int argc, VALUE *argv)
int mode;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "1*", &vmode, &rest);
mode = NUM2INT(vmode);
@@ -2162,18 +2327,23 @@ rb_file_chmod(VALUE obj, VALUE vmode)
{
rb_io_t *fptr;
int mode;
-#ifndef HAVE_FCHMOD
+#if !defined HAVE_FCHMOD || !HAVE_FCHMOD
VALUE path;
#endif
- rb_secure(2);
mode = NUM2INT(vmode);
GetOpenFile(obj, fptr);
#ifdef HAVE_FCHMOD
- if (fchmod(fptr->fd, mode) == -1)
- rb_sys_fail_path(fptr->pathv);
-#else
+ if (fchmod(fptr->fd, mode) == -1) {
+ if (HAVE_FCHMOD || errno != ENOSYS)
+ rb_sys_fail_path(fptr->pathv);
+ }
+ else {
+ if (!HAVE_FCHMOD) return INT2FIX(0);
+ }
+#endif
+#if !defined HAVE_FCHMOD || !HAVE_FCHMOD
if (NIL_P(fptr->pathv)) return Qnil;
path = rb_str_encode_ospath(fptr->pathv);
if (chmod(RSTRING_PTR(path), mode) == -1)
@@ -2208,7 +2378,6 @@ rb_file_s_lchmod(int argc, VALUE *argv)
VALUE rest;
long mode, n;
- rb_secure(2);
rb_scan_args(argc, argv, "1*", &vmode, &rest);
mode = NUM2INT(vmode);
@@ -2219,6 +2388,24 @@ rb_file_s_lchmod(int argc, VALUE *argv)
#define rb_file_s_lchmod rb_f_notimplement
#endif
+static inline rb_uid_t
+to_uid(VALUE u)
+{
+ if (NIL_P(u)) {
+ return (rb_uid_t)-1;
+ }
+ return NUM2UIDT(u);
+}
+
+static inline rb_gid_t
+to_gid(VALUE g)
+{
+ if (NIL_P(g)) {
+ return (rb_gid_t)-1;
+ }
+ return NUM2GIDT(g);
+}
+
struct chown_args {
rb_uid_t owner;
rb_gid_t group;
@@ -2254,20 +2441,9 @@ rb_file_s_chown(int argc, VALUE *argv)
struct chown_args arg;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "2*", &o, &g, &rest);
- if (NIL_P(o)) {
- arg.owner = -1;
- }
- else {
- arg.owner = NUM2UIDT(o);
- }
- if (NIL_P(g)) {
- arg.group = -1;
- }
- else {
- arg.group = NUM2GIDT(g);
- }
+ arg.owner = to_uid(o);
+ arg.group = to_gid(g);
n = apply2files(chown_internal, rest, &arg);
return LONG2FIX(n);
@@ -2292,14 +2468,14 @@ static VALUE
rb_file_chown(VALUE obj, VALUE owner, VALUE group)
{
rb_io_t *fptr;
- int o, g;
+ rb_uid_t o;
+ rb_gid_t g;
#ifndef HAVE_FCHOWN
VALUE path;
#endif
- rb_secure(2);
- o = NIL_P(owner) ? -1 : NUM2INT(owner);
- g = NIL_P(group) ? -1 : NUM2INT(group);
+ o = to_uid(owner);
+ g = to_gid(group);
GetOpenFile(obj, fptr);
#ifndef HAVE_FCHOWN
if (NIL_P(fptr->pathv)) return Qnil;
@@ -2341,20 +2517,9 @@ rb_file_s_lchown(int argc, VALUE *argv)
struct chown_args arg;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "2*", &o, &g, &rest);
- if (NIL_P(o)) {
- arg.owner = -1;
- }
- else {
- arg.owner = NUM2UIDT(o);
- }
- if (NIL_P(g)) {
- arg.group = -1;
- }
- else {
- arg.group = NUM2GIDT(g);
- }
+ arg.owner = to_uid(o);
+ arg.group = to_gid(g);
n = apply2files(lchown_internal, rest, &arg);
return LONG2FIX(n);
@@ -2374,7 +2539,8 @@ NORETURN(static void utime_failed(VALUE, const struct timespec *, VALUE, VALUE))
static void
utime_failed(VALUE path, const struct timespec *tsp, VALUE atime, VALUE mtime)
{
- if (tsp && errno == EINVAL) {
+ int e = errno;
+ if (tsp && e == EINVAL) {
VALUE e[2], a = Qnil, m = Qnil;
int d = 0;
if (!NIL_P(atime)) {
@@ -2398,9 +2564,8 @@ utime_failed(VALUE path, const struct timespec *tsp, VALUE atime, VALUE mtime)
e[1] = INT2FIX(EINVAL);
rb_exc_raise(rb_class_new_instance(2, e, rb_eSystemCallError));
}
- errno = EINVAL;
}
- rb_sys_fail_path(path);
+ rb_syserr_fail_path(e, path);
}
#else
#define utime_failed(path, tsp, atime, mtime) rb_sys_fail_path(path)
@@ -2415,7 +2580,7 @@ utime_internal(const char *path, VALUE pathv, void *arg)
const struct timespec *tsp = v->tsp;
struct timeval tvbuf[2], *tvp = NULL;
-#ifdef HAVE_UTIMENSAT
+#if defined(HAVE_UTIMENSAT)
static int try_utimensat = 1;
if (try_utimensat) {
@@ -2485,13 +2650,15 @@ rb_file_s_utime(int argc, VALUE *argv)
struct timespec tss[2], *tsp = NULL;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "2*", &args.atime, &args.mtime, &rest);
if (!NIL_P(args.atime) || !NIL_P(args.mtime)) {
tsp = tss;
tsp[0] = rb_time_timespec(args.atime);
- tsp[1] = rb_time_timespec(args.mtime);
+ if (args.atime == args.mtime)
+ tsp[1] = tsp[0];
+ else
+ tsp[1] = rb_time_timespec(args.mtime);
}
args.tsp = tsp;
@@ -2499,9 +2666,15 @@ rb_file_s_utime(int argc, VALUE *argv)
return LONG2FIX(n);
}
-NORETURN(static void sys_fail2(VALUE,VALUE));
+#ifdef RUBY_FUNCTION_NAME_STRING
+# define syserr_fail2(e, s1, s2) syserr_fail2_in(RUBY_FUNCTION_NAME_STRING, e, s1, s2)
+#else
+# define syserr_fail2_in(func, e, s1, s2) syserr_fail2(e, s1, s2)
+#endif
+#define sys_fail2(s1, s2) syserr_fail2(errno, s1, s2)
+NORETURN(static void syserr_fail2_in(const char *,int,VALUE,VALUE));
static void
-sys_fail2(VALUE s1, VALUE s2)
+syserr_fail2_in(const char *func, int e, VALUE s1, VALUE s2)
{
VALUE str;
#ifdef MAX_PATH
@@ -2510,12 +2683,19 @@ sys_fail2(VALUE s1, VALUE s2)
const int max_pathlen = MAXPATHLEN;
#endif
+ if (e == EEXIST) {
+ rb_syserr_fail_path(e, rb_str_ellipsize(s2, max_pathlen));
+ }
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 RUBY_FUNCTION_NAME_STRING
+ rb_syserr_fail_path_in(func, e, str);
+#else
+ rb_syserr_fail_path(e, str);
+#endif
}
#ifdef HAVE_LINK
@@ -2534,7 +2714,6 @@ sys_fail2(VALUE s1, VALUE s2)
static VALUE
rb_file_s_link(VALUE klass, VALUE from, VALUE to)
{
- rb_secure(2);
FilePathValue(from);
FilePathValue(to);
from = rb_str_encode_ospath(from);
@@ -2565,7 +2744,6 @@ rb_file_s_link(VALUE klass, VALUE from, VALUE to)
static VALUE
rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
{
- rb_secure(2);
FilePathValue(from);
FilePathValue(to);
from = rb_str_encode_ospath(from);
@@ -2581,8 +2759,6 @@ 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
@@ -2597,20 +2773,20 @@ static VALUE rb_readlink(VALUE path);
static VALUE
rb_file_s_readlink(VALUE klass, VALUE path)
{
- return rb_readlink(path);
+ return rb_readlink(path, rb_filesystem_encoding());
}
-static VALUE
-rb_readlink(VALUE path)
+#ifndef _WIN32
+VALUE
+rb_readlink(VALUE path, rb_encoding *enc)
{
int size = 100;
ssize_t rv;
VALUE v;
- rb_secure(2);
FilePathValue(path);
path = rb_str_encode_ospath(path);
- v = rb_enc_str_new(0, size, rb_filesystem_encoding());
+ v = rb_enc_str_new(0, size, enc);
while ((rv = readlink(RSTRING_PTR(path), RSTRING_PTR(v), size)) == size
#ifdef _AIX
|| (rv < 0 && errno == ERANGE) /* quirky behavior of GPFS */
@@ -2621,13 +2797,15 @@ rb_readlink(VALUE path)
rb_str_set_len(v, size);
}
if (rv < 0) {
+ int e = errno;
rb_str_resize(v, 0);
- rb_sys_fail_path(path);
+ rb_syserr_fail_path(e, path);
}
rb_str_resize(v, rv);
return v;
}
+#endif
#else
#define rb_file_s_readlink rb_f_notimplement
#endif
@@ -2654,7 +2832,6 @@ rb_file_s_unlink(VALUE klass, VALUE args)
{
long n;
- rb_secure(2);
n = apply2files(unlink_internal, args, 0);
return LONG2FIX(n);
}
@@ -2675,7 +2852,6 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
const char *src, *dst;
VALUE f, t;
- rb_secure(2);
FilePathValue(from);
FilePathValue(to);
f = rb_str_encode_ospath(from);
@@ -2686,19 +2862,17 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
errno = 0;
#endif
if (rename(src, dst) < 0) {
+ int e = errno;
#if defined DOSISH
- switch (errno) {
+ switch (e) {
case EEXIST:
-#if defined (__EMX__)
- case EACCES:
-#endif
if (chmod(dst, 0666) == 0 &&
unlink(dst) == 0 &&
rename(src, dst) == 0)
return INT2FIX(0);
}
#endif
- sys_fail2(from, to);
+ syserr_fail2(e, from, to);
}
return INT2FIX(0);
@@ -2724,7 +2898,6 @@ rb_file_s_umask(int argc, VALUE *argv)
{
int omask = 0;
- rb_secure(2);
if (argc == 0) {
omask = umask(0);
umask(omask);
@@ -2972,22 +3145,45 @@ ntfs_tail(const char *path, const char *end, rb_encoding *enc)
buflen = RSTRING_LEN(result),\
pend = p + buflen)
+#ifdef __APPLE__
+# define SKIPPATHSEP(p) ((*(p)) ? 1 : 0)
+#else
+# define SKIPPATHSEP(p) 1
+#endif
+
+#define BUFCOPY(srcptr, srclen) do { \
+ const int skip = SKIPPATHSEP(p); \
+ rb_str_set_len(result, p-buf+skip); \
+ BUFCHECK(bdiff + ((srclen)+skip) >= buflen); \
+ p += skip; \
+ memcpy(p, (srcptr), (srclen)); \
+ p += (srclen); \
+} while (0)
+
+#define WITH_ROOTDIFF(stmt) do { \
+ long rootdiff = root - buf; \
+ stmt; \
+ root = buf + rootdiff; \
+} while (0)
+
static VALUE
copy_home_path(VALUE result, const char *dir)
{
char *buf;
#if defined DOSISH || defined __CYGWIN__
char *p, *bend;
+ rb_encoding *enc;
#endif
long dirlen;
- rb_encoding *enc;
+ int encidx;
dirlen = strlen(dir);
rb_str_resize(result, dirlen);
memcpy(buf = RSTRING_PTR(result), dir, dirlen);
- enc = rb_filesystem_encoding();
- rb_enc_associate(result, enc);
+ encidx = rb_filesystem_encindex();
+ rb_enc_associate_index(result, encidx);
#if defined DOSISH || defined __CYGWIN__
+ enc = rb_enc_from_index(encidx);
for (bend = (p = buf) + dirlen; p < bend; Inc(p, bend, enc)) {
if (*p == '\\') {
*p = '/';
@@ -3025,6 +3221,18 @@ rb_default_home_dir(VALUE result)
}
#ifndef _WIN32
+static VALUE
+ospath_new(const char *ptr, long len, rb_encoding *fsenc)
+{
+#if NORMALIZE_UTF8PATH
+ VALUE path = rb_str_normalize_ospath(ptr, len);
+ rb_enc_associate(path, fsenc);
+ return path;
+#else
+ return rb_enc_str_new(ptr, len, fsenc);
+#endif
+}
+
static char *
append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encoding *fsenc)
{
@@ -3032,12 +3240,15 @@ append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encodi
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 (NORMALIZE_UTF8PATH || *enc != fsenc) {
+ rb_encoding *direnc = rb_enc_check(fname, dirname = ospath_new(dir, dirlen, fsenc));
if (direnc != fsenc) {
dirname = rb_str_conv_enc(dirname, fsenc, direnc);
RSTRING_GETMEM(dirname, cwdp, dirlen);
}
+ else if (NORMALIZE_UTF8PATH) {
+ RSTRING_GETMEM(dirname, cwdp, dirlen);
+ }
*enc = direnc;
}
do {buflen *= 2;} while (dirlen > buflen);
@@ -3243,17 +3454,25 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
case '\\':
#endif
if (s > b) {
- long rootdiff = root - buf;
- rb_str_set_len(result, p-buf+1);
- BUFCHECK(bdiff + (s-b+1) >= buflen);
- root = buf + rootdiff;
- memcpy(++p, b, s-b);
- p += s-b;
+ WITH_ROOTDIFF(BUFCOPY(b, s-b));
*p = '/';
}
b = ++s;
break;
default:
+#ifdef __APPLE__
+ {
+ int n = ignored_char_p(s, fend, enc);
+ if (n) {
+ if (s > b) {
+ WITH_ROOTDIFF(BUFCOPY(b, s-b));
+ *p = '\0';
+ }
+ b = s += n;
+ break;
+ }
+ }
+#endif
Inc(s, fend, enc);
break;
}
@@ -3275,10 +3494,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
}
}
#endif
- rb_str_set_len(result, p-buf+1);
- BUFCHECK(bdiff + (s-b) >= buflen);
- memcpy(++p, b, s-b);
- p += s-b;
+ BUFCOPY(b, s-b);
rb_str_set_len(result, p-buf);
}
if (p == skiproot(buf, p + !!*p, enc) - 1) p++;
@@ -3288,7 +3504,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
if ((s = strrdirsep(b = buf, p, enc)) != 0 && !strpbrk(s, "*?")) {
VALUE tmp, v;
size_t len;
- rb_encoding *enc;
+ int encidx;
WCHAR *wstr;
WIN32_FIND_DATAW wfd;
HANDLE h;
@@ -3341,15 +3557,15 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
*p = '/';
#endif
rb_str_set_len(result, p - buf + strlen(p));
- enc = rb_enc_get(result);
+ encidx = ENCODING_GET(result);
tmp = result;
- if (enc != rb_utf8_encoding() && rb_enc_str_coderange(result) != ENC_CODERANGE_7BIT) {
+ if (encidx != ENCINDEX_UTF_8 && 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);
+ if (tmp != result) rb_str_set_len(tmp, 0);
h = FindFirstFileW(wstr, &wfd);
ALLOCV_END(v);
if (h != INVALID_HANDLE_VALUE) {
@@ -3367,14 +3583,16 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
++p;
wlen = (int)len;
len = WideCharToMultiByte(CP_UTF8, 0, wfd.cFileName, wlen, NULL, 0, NULL, NULL);
- BUFCHECK(bdiff + len >= buflen);
- 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);
+ if (tmp == result) {
BUFCHECK(bdiff + len >= buflen);
- memcpy(p, RSTRING_PTR(tmp), len);
+ WideCharToMultiByte(CP_UTF8, 0, wfd.cFileName, wlen, p, len + 1, NULL, NULL);
+ }
+ else {
+ rb_str_modify_expand(tmp, len);
+ WideCharToMultiByte(CP_UTF8, 0, wfd.cFileName, wlen, RSTRING_PTR(tmp), len + 1, NULL, NULL);
+ rb_str_cat_conv_enc_opts(result, bdiff, RSTRING_PTR(tmp), len,
+ rb_utf8_encoding(), 0, Qnil);
+ BUFINIT();
rb_str_resize(tmp, 0);
}
p += len;
@@ -3397,6 +3615,16 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
#define EXPAND_PATH_BUFFER() rb_usascii_str_new(0, MAXPATHLEN + 2)
+static VALUE
+str_shrink(VALUE str)
+{
+ rb_str_resize(str, RSTRING_LEN(str));
+ return str;
+}
+
+#define expand_path(fname, dname, abs_mode, long_name, result) \
+ str_shrink(rb_file_expand_path_internal(fname, dname, abs_mode, long_name, result))
+
#define check_expand_path_args(fname, dname) \
(((fname) = rb_get_path(fname)), \
(void)(NIL_P(dname) ? (dname) : ((dname) = rb_get_path(dname))))
@@ -3411,13 +3639,13 @@ VALUE
rb_file_expand_path(VALUE fname, VALUE dname)
{
check_expand_path_args(fname, dname);
- return rb_file_expand_path_internal(fname, dname, 0, 1, EXPAND_PATH_BUFFER());
+ return expand_path(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());
+ return expand_path(fname, dname, 0, 0, EXPAND_PATH_BUFFER());
}
/*
@@ -3449,7 +3677,7 @@ rb_file_expand_path_fast(VALUE fname, VALUE dname)
*/
VALUE
-rb_file_s_expand_path(int argc, VALUE *argv)
+rb_file_s_expand_path(int argc, const VALUE *argv)
{
VALUE fname, dname;
@@ -3465,7 +3693,7 @@ VALUE
rb_file_absolute_path(VALUE fname, VALUE dname)
{
check_expand_path_args(fname, dname);
- return rb_file_expand_path_internal(fname, dname, 1, 1, EXPAND_PATH_BUFFER());
+ return expand_path(fname, dname, 1, 1, EXPAND_PATH_BUFFER());
}
/*
@@ -3482,7 +3710,7 @@ rb_file_absolute_path(VALUE fname, VALUE dname)
*/
VALUE
-rb_file_s_absolute_path(int argc, VALUE *argv)
+rb_file_s_absolute_path(int argc, const VALUE *argv)
{
VALUE fname, dname;
@@ -3536,8 +3764,7 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE l
checkval = rb_hash_aref(loopcheck, testpath);
if (!NIL_P(checkval)) {
if (checkval == ID2SYM(resolving)) {
- errno = ELOOP;
- rb_sys_fail_path(testpath);
+ rb_syserr_fail_path(ELOOP, testpath);
}
else {
*resolvedp = rb_str_dup(checkval);
@@ -3553,14 +3780,15 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE l
ret = lstat(RSTRING_PTR(testpath2), &sbuf);
#endif
if (ret == -1) {
- if (errno == ENOENT) {
+ int e = errno;
+ if (e == ENOENT) {
if (strict || !last || *unresolved_firstsep)
- rb_sys_fail_path(testpath);
+ rb_syserr_fail_path(e, testpath);
*resolvedp = testpath;
break;
}
else {
- rb_sys_fail_path(testpath);
+ rb_syserr_fail_path(e, testpath);
}
}
#ifdef HAVE_READLINK
@@ -3570,7 +3798,7 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE l
const char *link_prefix, *link_names;
long link_prefixlen;
rb_hash_aset(loopcheck, testpath, ID2SYM(resolving));
- link = rb_readlink(testpath);
+ link = rb_readlink(testpath, enc);
link_prefix = RSTRING_PTR(link);
link_names = skipprefixroot(link_prefix, link_prefix + RSTRING_LEN(link), rb_enc_get(link));
link_prefixlen = link_names - link_prefix;
@@ -3615,13 +3843,11 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
VALUE loopcheck;
volatile VALUE curdir = Qnil;
- rb_encoding *enc;
+ rb_encoding *enc, *origenc;
char *path_names = NULL, *basedir_names = NULL, *curdir_names = NULL;
char *ptr, *prefixptr = NULL, *pend;
long len;
- rb_secure(2);
-
FilePathValue(path);
unresolved_path = rb_str_dup_frozen(path);
@@ -3669,6 +3895,13 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
}
#endif
+ origenc = enc;
+ switch (rb_enc_to_index(enc)) {
+ case ENCINDEX_ASCII:
+ case ENCINDEX_US_ASCII:
+ rb_enc_associate_index(resolved, rb_filesystem_encindex());
+ }
+
loopcheck = rb_hash_new();
if (curdir_names)
realpath_rec(&prefixlen, &resolved, curdir_names, loopcheck, 1, 0);
@@ -3676,6 +3909,9 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
realpath_rec(&prefixlen, &resolved, basedir_names, loopcheck, 1, 0);
realpath_rec(&prefixlen, &resolved, path_names, loopcheck, strict, 1);
+ if (origenc != enc && rb_enc_str_asciionly_p(resolved))
+ rb_enc_associate(resolved, origenc);
+
OBJ_TAINT(resolved);
return resolved;
}
@@ -3830,10 +4066,12 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin
* <code>File::ALT_SEPARATOR</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.
+ * it is removed. If <i>suffix</i> is ".*", any extension will be
+ * removed.
*
* File.basename("/home/gumby/work/ruby.rb") #=> "ruby.rb"
* File.basename("/home/gumby/work/ruby.rb", ".rb") #=> "ruby"
+ * File.basename("/home/gumby/work/ruby.rb", ".*") #=> "ruby"
*/
static VALUE
@@ -4019,7 +4257,8 @@ ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
*
* File.extname("test.rb") #=> ".rb"
* File.extname("a/b/d/test.rb") #=> ".rb"
- * File.extname("foo.") #=> ""
+ * File.extname(".a/b/d/test.rb") #=> ".rb"
+ * File.extname("foo.") #=> ""
* File.extname("test") #=> ""
* File.extname(".profile") #=> ""
* File.extname(".profile.sh") #=> ".sh"
@@ -4169,7 +4408,7 @@ rb_file_join(VALUE ary, VALUE sep)
/*
* call-seq:
- * File.join(string, ...) -> path
+ * File.join(string, ...) -> string
*
* Returns a new string formed by joining the strings using
* <code>File::SEPARATOR</code>.
@@ -4211,7 +4450,6 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
long pos;
#endif
- rb_secure(2);
pos = NUM2POS(len);
FilePathValue(path);
path = rb_str_encode_ospath(path);
@@ -4227,8 +4465,9 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
}
rb_update_max_fd(tmpfd);
if (chsize(tmpfd, pos) < 0) {
+ int e = errno;
close(tmpfd);
- rb_sys_fail_path(path);
+ rb_syserr_fail_path(e, path);
}
close(tmpfd);
}
@@ -4267,7 +4506,6 @@ rb_file_truncate(VALUE obj, VALUE len)
long pos;
#endif
- rb_secure(2);
pos = NUM2POS(len);
GetOpenFile(obj, fptr);
if (!(fptr->mode & FMODE_WRITABLE)) {
@@ -4373,7 +4611,6 @@ rb_file_flock(VALUE obj, VALUE operation)
int op[2], op1;
struct timeval time;
- rb_secure(2);
op[1] = op1 = NUM2INT(operation);
GetOpenFile(obj, fptr);
op[0] = fptr->fd;
@@ -4382,7 +4619,8 @@ rb_file_flock(VALUE obj, VALUE operation)
rb_io_flush_raw(obj, 0);
}
while ((int)rb_thread_io_blocking_region(rb_thread_flock, op, fptr->fd) < 0) {
- switch (errno) {
+ int e = errno;
+ switch (e) {
case EAGAIN:
case EACCES:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
@@ -4403,19 +4641,17 @@ rb_file_flock(VALUE obj, VALUE operation)
break;
default:
- rb_sys_fail_path(fptr->pathv);
+ rb_syserr_fail_path(e, fptr->pathv);
}
}
return INT2FIX(0);
}
-#undef flock
static void
test_check(int n, int argc, VALUE *argv)
{
int i;
- rb_secure(2);
n+=1;
rb_check_arity(argc, n, n);
for (i=1; i<n; i++) {
@@ -4431,7 +4667,7 @@ test_check(int n, int argc, VALUE *argv)
* call-seq:
* test(cmd, file1 [, file2] ) -> obj
*
- * Uses the integer +cmd+ to perform various tests on +file1+ (first
+ * Uses the character +cmd+ to perform various tests on +file1+ (first
* table below) or on +file1+ and +file2+ (second table).
*
* File tests on a single file:
@@ -4514,7 +4750,6 @@ rb_f_test(int argc, VALUE *argv)
case 'd':
return rb_file_directory_p(0, argv[1]);
- case 'a':
case 'e':
return rb_file_exist_p(0, argv[1]);
@@ -4580,8 +4815,9 @@ rb_f_test(int argc, VALUE *argv)
CHECK(1);
if (rb_stat(fname, &st) == -1) {
+ int e = errno;
FilePathValue(fname);
- rb_sys_fail_path(fname);
+ rb_syserr_fail_path(e, fname);
}
switch (cmd) {
@@ -4601,22 +4837,28 @@ rb_f_test(int argc, VALUE *argv)
if (strchr("=<>", cmd)) {
struct stat st1, st2;
+ struct timespec t1, t2;
CHECK(2);
if (rb_stat(argv[1], &st1) < 0) return Qfalse;
if (rb_stat(argv[2], &st2) < 0) return Qfalse;
+ t1 = stat_mtimespec(&st1);
+ t2 = stat_mtimespec(&st2);
+
switch (cmd) {
case '=':
- if (st1.st_mtime == st2.st_mtime) return Qtrue;
+ if (t1.tv_sec == t2.tv_sec && t1.tv_nsec == t2.tv_nsec) return Qtrue;
return Qfalse;
case '>':
- if (st1.st_mtime > st2.st_mtime) return Qtrue;
+ if (t1.tv_sec > t2.tv_sec) return Qtrue;
+ if (t1.tv_sec == t2.tv_sec && t1.tv_nsec > t2.tv_nsec) return Qtrue;
return Qfalse;
case '<':
- if (st1.st_mtime < st2.st_mtime) return Qtrue;
+ if (t1.tv_sec < t2.tv_sec) return Qtrue;
+ if (t1.tv_sec == t2.tv_sec && t1.tv_nsec < t2.tv_nsec) return Qtrue;
return Qfalse;
}
}
@@ -4658,7 +4900,6 @@ rb_stat_init(VALUE obj, VALUE fname)
{
struct stat st, *nst;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (STAT(StringValueCStr(fname), &st) == -1) {
@@ -4972,8 +5213,9 @@ static VALUE
rb_stat_wr(VALUE obj)
{
#ifdef S_IROTH
- if ((get_stat(obj)->st_mode & (S_IROTH)) == S_IROTH) {
- return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
+ struct stat *st = get_stat(obj);
+ if ((st->st_mode & (S_IROTH)) == S_IROTH) {
+ return UINT2NUM(st->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
}
else {
return Qnil;
@@ -5064,8 +5306,9 @@ static VALUE
rb_stat_ww(VALUE obj)
{
#ifdef S_IROTH
- if ((get_stat(obj)->st_mode & (S_IWOTH)) == S_IWOTH) {
- return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
+ struct stat *st = get_stat(obj);
+ if ((st->st_mode & (S_IWOTH)) == S_IWOTH) {
+ return UINT2NUM(st->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
}
else {
return Qnil;
@@ -5259,6 +5502,44 @@ rb_stat_sticky(VALUE obj)
return Qfalse;
}
+#if !defined HAVE_MKFIFO && defined HAVE_MKNOD && defined S_IFIFO
+#define mkfifo(path, mode) mknod(path, (mode)&~S_IFMT|S_IFIFO, 0)
+#define HAVE_MKFIFO
+#endif
+
+/*
+ * call-seq:
+ * File.mkfifo(file_name, mode=0666) => 0
+ *
+ * Creates a FIFO special file with name _file_name_. _mode_
+ * specifies the FIFO's permissions. It is modified by the process's
+ * umask in the usual way: the permissions of the created file are
+ * (mode & ~umask).
+ */
+
+#ifdef HAVE_MKFIFO
+static VALUE
+rb_file_s_mkfifo(int argc, VALUE *argv)
+{
+ VALUE path;
+ int mode = 0666;
+
+ rb_check_arity(argc, 1, 2);
+ if (argc > 1) {
+ mode = NUM2INT(argv[1]);
+ }
+ path = argv[0];
+ FilePathValue(path);
+ path = rb_str_encode_ospath(path);
+ if (mkfifo(RSTRING_PTR(path), mode)) {
+ rb_sys_fail_path(path);
+ }
+ return INT2FIX(0);
+}
+#else
+#define rb_file_s_mkfifo rb_f_notimplement
+#endif
+
VALUE rb_mFConst;
void
@@ -5373,25 +5654,51 @@ rb_path_check(const char *path)
return 1;
}
-#ifndef _WIN32
-#ifdef __native_client__
-__attribute__((noinline))
+int
+ruby_is_fd_loadable(int fd)
+{
+#ifdef _WIN32
+ return 1;
+#else
+ struct stat st;
+
+ if (fstat(fd, &st) < 0)
+ return 0;
+ if (S_ISREG(st.st_mode))
+ return 1;
+
+ if (S_ISFIFO(st.st_mode))
+ return 1;
+
+ if (S_ISDIR(st.st_mode))
+ errno = EISDIR;
+ else
+ errno = ENXIO;
+
+ return 0;
#endif
+}
+
+#ifndef _WIN32
int
rb_file_load_ok(const char *path)
{
int ret = 1;
- int fd = rb_cloexec_open(path, O_RDONLY, 0);
+ /*
+ open(2) may block if path is FIFO and it's empty. Let's use O_NONBLOCK.
+ FIXME: Why O_NDELAY is checked?
+ */
+ int mode = (O_RDONLY |
+#if defined O_NONBLOCK
+ O_NONBLOCK |
+#elif defined O_NDELAY
+ O_NDELAY |
+#endif
+ 0);
+ int fd = rb_cloexec_open(path, mode, 0);
if (fd == -1) return 0;
rb_update_max_fd(fd);
-#if !defined DOSISH
- {
- struct stat st;
- if (fstat(fd, &st) || !S_ISREG(st.st_mode)) {
- ret = 0;
- }
- }
-#endif
+ ret = ruby_is_fd_loadable(fd);
(void)close(fd);
return ret;
}
@@ -5408,6 +5715,7 @@ is_explicit_relative(const char *path)
static VALUE
copy_path_class(VALUE path, VALUE orig)
{
+ str_shrink(path);
RBASIC_SET_CLASS(path, rb_obj_class(orig));
OBJ_FREEZE(path);
return path;
@@ -5480,6 +5788,7 @@ rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level)
}
rb_str_set_len(fname, fnlen);
}
+ rb_str_resize(tmp, 0);
RB_GC_GUARD(load_path);
return 0;
}
@@ -5532,6 +5841,7 @@ rb_find_file_safe(VALUE path, int safe_level)
if (rb_file_load_ok(f)) goto found;
}
}
+ rb_str_resize(tmp, 0);
return 0;
}
else {
@@ -5567,7 +5877,7 @@ static const char null_device[] =
/*
* A <code>File</code> is an abstraction of any file object accessible
- * by the program and is closely associated with class <code>IO</code>
+ * by the program and is closely associated with class <code>IO</code>.
* <code>File</code> includes the methods of module
* <code>FileTest</code> as class methods, allowing you to write (for
* example) <code>File.exist?("foo")</code>.
@@ -5643,6 +5953,7 @@ Init_File(void)
rb_define_singleton_method(rb_cFile, "atime", rb_file_s_atime, 1);
rb_define_singleton_method(rb_cFile, "mtime", rb_file_s_mtime, 1);
rb_define_singleton_method(rb_cFile, "ctime", rb_file_s_ctime, 1);
+ rb_define_singleton_method(rb_cFile, "birthtime", rb_file_s_birthtime, 1);
rb_define_singleton_method(rb_cFile, "utime", rb_file_s_utime, -1);
rb_define_singleton_method(rb_cFile, "chmod", rb_file_s_chmod, -1);
@@ -5659,6 +5970,7 @@ Init_File(void)
rb_define_singleton_method(rb_cFile, "rename", rb_file_s_rename, 2);
rb_define_singleton_method(rb_cFile, "umask", rb_file_s_umask, -1);
rb_define_singleton_method(rb_cFile, "truncate", rb_file_s_truncate, 2);
+ rb_define_singleton_method(rb_cFile, "mkfifo", rb_file_s_mkfifo, -1);
rb_define_singleton_method(rb_cFile, "expand_path", rb_file_s_expand_path, -1);
rb_define_singleton_method(rb_cFile, "absolute_path", rb_file_s_absolute_path, -1);
rb_define_singleton_method(rb_cFile, "realpath", rb_file_s_realpath, -1);
@@ -5690,6 +6002,7 @@ Init_File(void)
rb_define_method(rb_cFile, "atime", rb_file_atime, 0);
rb_define_method(rb_cFile, "mtime", rb_file_mtime, 0);
rb_define_method(rb_cFile, "ctime", rb_file_ctime, 0);
+ rb_define_method(rb_cFile, "birthtime", rb_file_birthtime, 0);
rb_define_method(rb_cFile, "size", rb_file_size, 0);
rb_define_method(rb_cFile, "chmod", rb_file_chmod, 1);
@@ -5744,6 +6057,11 @@ Init_File(void)
#endif
/* disable line code conversion */
rb_define_const(rb_mFConst, "BINARY", INT2FIX(O_BINARY));
+#ifndef O_SHARE_DELETE
+# define O_SHARE_DELETE 0
+#endif
+ /* can delete opened file */
+ rb_define_const(rb_mFConst, "SHARE_DELETE", INT2FIX(O_SHARE_DELETE));
#ifdef O_SYNC
/* any write operation perform synchronously */
rb_define_const(rb_mFConst, "SYNC", INT2FIX(O_SYNC));
@@ -5768,6 +6086,10 @@ Init_File(void)
/* Try to minimize cache effects of the I/O to and from this file. */
rb_define_const(rb_mFConst, "DIRECT", INT2FIX(O_DIRECT));
#endif
+#ifdef O_TMPFILE
+ /* Create an unnamed temporary file */
+ rb_define_const(rb_mFConst, "TMPFILE", INT2FIX(O_TMPFILE));
+#endif
/* shared lock. see File#flock */
rb_define_const(rb_mFConst, "LOCK_SH", INT2FIX(LOCK_SH));
@@ -5811,6 +6133,7 @@ Init_File(void)
rb_define_method(rb_cStat, "atime", rb_stat_atime, 0);
rb_define_method(rb_cStat, "mtime", rb_stat_mtime, 0);
rb_define_method(rb_cStat, "ctime", rb_stat_ctime, 0);
+ rb_define_method(rb_cStat, "birthtime", rb_stat_birthtime, 0);
rb_define_method(rb_cStat, "inspect", rb_stat_inspect, 0);
diff --git a/gc.c b/gc.c
index 19e942d77d..5d73a7e157 100644
--- a/gc.c
+++ b/gc.c
@@ -11,7 +11,10 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#define rb_data_object_alloc rb_data_object_alloc
+#define rb_data_typed_object_alloc rb_data_typed_object_alloc
+
+#include "internal.h"
#include "ruby/st.h"
#include "ruby/re.h"
#include "ruby/io.h"
@@ -20,20 +23,18 @@
#include "ruby/debug.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 "id_table.h"
#include <stdio.h>
#include <stdarg.h>
#include <setjmp.h>
#include <sys/types.h>
#include <assert.h>
-#ifndef __has_feature
-# define __has_feature(x) 0
-#endif
+#undef rb_data_object_wrap
#ifndef HAVE_MALLOC_USABLE_SIZE
# ifdef _WIN32
@@ -88,26 +89,40 @@
#define rb_setjmp(env) RUBY_SETJMP(env)
#define rb_jmp_buf rb_jmpbuf_t
-#if defined(HAVE_RB_GC_GUARDED_PTR) && HAVE_RB_GC_GUARDED_PTR
+#if defined(HAVE_RB_GC_GUARDED_PTR_VAL) && HAVE_RB_GC_GUARDED_PTR_VAL
+/* trick the compiler into thinking a external signal handler uses this */
+volatile VALUE rb_gc_guarded_val;
volatile VALUE *
-rb_gc_guarded_ptr(volatile VALUE *ptr)
+rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val)
{
+ rb_gc_guarded_val = val;
+
return ptr;
}
#endif
-#ifndef GC_HEAP_FREE_SLOTS
-#define GC_HEAP_FREE_SLOTS 4096
-#endif
#ifndef GC_HEAP_INIT_SLOTS
#define GC_HEAP_INIT_SLOTS 10000
#endif
+#ifndef GC_HEAP_FREE_SLOTS
+#define GC_HEAP_FREE_SLOTS 4096
+#endif
#ifndef GC_HEAP_GROWTH_FACTOR
#define GC_HEAP_GROWTH_FACTOR 1.8
#endif
#ifndef GC_HEAP_GROWTH_MAX_SLOTS
#define GC_HEAP_GROWTH_MAX_SLOTS 0 /* 0 is disable */
#endif
+#ifndef GC_HEAP_OLDOBJECT_LIMIT_FACTOR
+#define GC_HEAP_OLDOBJECT_LIMIT_FACTOR 2.0
+#endif
+
+#ifndef GC_HEAP_FREE_SLOTS_MIN_RATIO
+#define GC_HEAP_FREE_SLOTS_MIN_RATIO 0.3
+#endif
+#ifndef GC_HEAP_FREE_SLOTS_MAX_RATIO
+#define GC_HEAP_FREE_SLOTS_MAX_RATIO 0.8
+#endif
#ifndef GC_MALLOC_LIMIT_MIN
#define GC_MALLOC_LIMIT_MIN (16 * 1024 * 1024 /* 16MB */)
@@ -129,36 +144,47 @@ rb_gc_guarded_ptr(volatile VALUE *ptr)
#define GC_OLDMALLOC_LIMIT_MAX (128 * 1024 * 1024 /* 128MB */)
#endif
+#ifndef PRINT_MEASURE_LINE
+#define PRINT_MEASURE_LINE 0
+#endif
+#ifndef PRINT_ENTER_EXIT_TICK
+#define PRINT_ENTER_EXIT_TICK 0
+#endif
+#ifndef PRINT_ROOT_TICKS
+#define PRINT_ROOT_TICKS 0
+#endif
+
+#define USE_TICK_T (PRINT_ENTER_EXIT_TICK || PRINT_MEASURE_LINE || PRINT_ROOT_TICKS)
+#define TICK_TYPE 1
+
typedef struct {
- unsigned int heap_init_slots;
- unsigned int heap_free_slots;
+ size_t heap_init_slots;
+ size_t heap_free_slots;
double growth_factor;
- unsigned int growth_max_slots;
- unsigned int malloc_limit_min;
- unsigned int malloc_limit_max;
+ size_t growth_max_slots;
+ double oldobject_limit_factor;
+ size_t malloc_limit_min;
+ size_t malloc_limit_max;
double malloc_limit_growth_factor;
- unsigned int oldmalloc_limit_min;
- unsigned int oldmalloc_limit_max;
+ size_t oldmalloc_limit_min;
+ size_t oldmalloc_limit_max;
double oldmalloc_limit_growth_factor;
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
VALUE gc_stress;
-#endif
} ruby_gc_params_t;
static ruby_gc_params_t gc_params = {
- GC_HEAP_FREE_SLOTS,
GC_HEAP_INIT_SLOTS,
+ GC_HEAP_FREE_SLOTS,
GC_HEAP_GROWTH_FACTOR,
GC_HEAP_GROWTH_MAX_SLOTS,
+ GC_HEAP_OLDOBJECT_LIMIT_FACTOR,
GC_MALLOC_LIMIT_MIN,
GC_MALLOC_LIMIT_MAX,
GC_MALLOC_LIMIT_GROWTH_FACTOR,
GC_OLDMALLOC_LIMIT_MIN,
GC_OLDMALLOC_LIMIT_MAX,
GC_OLDMALLOC_LIMIT_GROWTH_FACTOR,
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
FALSE,
-#endif
};
/* GC_DEBUG:
@@ -183,14 +209,25 @@ static ruby_gc_params_t gc_params = {
/* RGENGC_CHECK_MODE
* 0: disable all assertions
* 1: enable assertions (to debug RGenGC)
- * 2: enable generational bits check (for debugging)
- * 3: enable livness check
- * 4: show all references
+ * 2: enable internal consistency check at each GC (for debugging)
+ * 3: enable internal consistency check at each GC steps (for debugging)
+ * 4: enable liveness check
+ * 5: show all references
*/
#ifndef RGENGC_CHECK_MODE
#define RGENGC_CHECK_MODE 0
#endif
+/* RGENGC_OLD_NEWOBJ_CHECK
+ * 0: disable all assertions
+ * >0: make a OLD object when new object creation.
+ *
+ * Make one OLD object per RGENGC_OLD_NEWOBJ_CHECK WB protected objects creation.
+ */
+#ifndef RGENGC_OLD_NEWOBJ_CHECK
+#define RGENGC_OLD_NEWOBJ_CHECK 0
+#endif
+
/* RGENGC_PROFILE
* 0: disable RGenGC profiling
* 1: enable profiling for basic information
@@ -200,18 +237,9 @@ static ruby_gc_params_t gc_params = {
#define RGENGC_PROFILE 0
#endif
-/* RGENGC_THREEGEN
- * Enable/disable three gen GC.
- * 0: Infant gen -> Old gen
- * 1: Infant gen -> Young -> Old gen
- */
-#ifndef RGENGC_THREEGEN
-#define RGENGC_THREEGEN 0
-#endif
-
/* RGENGC_ESTIMATE_OLDMALLOC
* Enable/disable to estimate increase size of malloc'ed size by old objects.
- * If estimation exceeds threashold, then will invoke full GC.
+ * If estimation exceeds threshold, then will invoke full GC.
* 0: disable estimation.
* 1: enable estimation.
*/
@@ -219,13 +247,26 @@ static ruby_gc_params_t gc_params = {
#define RGENGC_ESTIMATE_OLDMALLOC 1
#endif
+/* RGENGC_FORCE_MAJOR_GC
+ * Force major/full GC if this macro is not 0.
+ */
+#ifndef RGENGC_FORCE_MAJOR_GC
+#define RGENGC_FORCE_MAJOR_GC 0
+#endif
+
#else /* USE_RGENGC */
+#ifdef RGENGC_DEBUG
+#undef RGENGC_DEBUG
+#endif
#define RGENGC_DEBUG 0
+#ifdef RGENGC_CHECK_MODE
+#undef RGENGC_CHECK_MODE
+#endif
#define RGENGC_CHECK_MODE 0
#define RGENGC_PROFILE 0
-#define RGENGC_THREEGEN 0
#define RGENGC_ESTIMATE_OLDMALLOC 0
+#define RGENGC_FORCE_MAJOR_GC 0
#endif /* USE_RGENGC */
@@ -235,6 +276,9 @@ static ruby_gc_params_t gc_params = {
#ifndef GC_PROFILE_DETAIL_MEMORY
#define GC_PROFILE_DETAIL_MEMORY 0
#endif
+#ifndef GC_ENABLE_INCREMENTAL_MARK
+#define GC_ENABLE_INCREMENTAL_MARK USE_RINCGC
+#endif
#ifndef GC_ENABLE_LAZY_SWEEP
#define GC_ENABLE_LAZY_SWEEP 1
#endif
@@ -252,14 +296,21 @@ static ruby_gc_params_t gc_params = {
#define MALLOC_ALLOCATED_SIZE_CHECK 0
#endif
+#ifndef GC_DEBUG_STRESS_TO_CLASS
+#define GC_DEBUG_STRESS_TO_CLASS 0
+#endif
+
+#ifndef RGENGC_OBJ_INFO
+#define RGENGC_OBJ_INFO (RGENGC_DEBUG | RGENGC_CHECK_MODE)
+#endif
+
typedef enum {
GPR_FLAG_NONE = 0x000,
/* major reason */
GPR_FLAG_MAJOR_BY_NOFREE = 0x001,
GPR_FLAG_MAJOR_BY_OLDGEN = 0x002,
GPR_FLAG_MAJOR_BY_SHADY = 0x004,
- GPR_FLAG_MAJOR_BY_RESCAN = 0x008,
- GPR_FLAG_MAJOR_BY_STRESS = 0x010,
+ GPR_FLAG_MAJOR_BY_FORCE = 0x008,
#if RGENGC_ESTIMATE_OLDMALLOC
GPR_FLAG_MAJOR_BY_OLDMALLOC = 0x020,
#endif
@@ -318,7 +369,7 @@ typedef struct gc_profile_record {
#endif
} gc_profile_record;
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
+#if defined(_MSC_VER) || defined(__CYGWIN__)
#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
#endif
@@ -345,6 +396,15 @@ typedef struct RVALUE {
struct RMatch match;
struct RRational rational;
struct RComplex complex;
+ union {
+ rb_cref_t cref;
+ struct vm_svar svar;
+ struct vm_throw_data throw_data;
+ struct vm_ifunc ifunc;
+ struct MEMO memo;
+ struct rb_method_entry_struct ment;
+ const rb_iseq_t iseq;
+ } imemo;
struct {
struct RBasic basic;
VALUE v1;
@@ -354,11 +414,11 @@ typedef struct RVALUE {
} as;
#if GC_DEBUG
const char *file;
- VALUE line;
+ int line;
#endif
} RVALUE;
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
+#if defined(_MSC_VER) || defined(__CYGWIN__)
#pragma pack(pop)
#endif
@@ -393,22 +453,32 @@ typedef struct stack_chunk {
typedef struct mark_stack {
stack_chunk_t *chunk;
stack_chunk_t *cache;
- size_t index;
- size_t limit;
+ int index;
+ int limit;
size_t cache_size;
size_t unused_cache_size;
} mark_stack_t;
typedef struct rb_heap_struct {
- struct heap_page *pages;
+ RVALUE *freelist;
+
struct heap_page *free_pages;
struct heap_page *using_page;
+ struct heap_page *pages;
struct heap_page *sweep_pages;
- RVALUE *freelist;
+#if GC_ENABLE_INCREMENTAL_MARK
+ struct heap_page *pooled_pages;
+#endif
size_t page_length; /* total page count in a heap */
size_t total_slots; /* total slot count (page_length * HEAP_OBJ_LIMIT) */
} rb_heap_t;
+enum gc_stat {
+ gc_stat_none,
+ gc_stat_marking,
+ gc_stat_sweeping
+};
+
typedef struct rb_objspace {
struct {
size_t limit;
@@ -419,37 +489,61 @@ typedef struct rb_objspace {
#endif
} malloc_params;
+ struct {
+ enum gc_stat stat : 2;
+ unsigned int immediate_sweep : 1;
+ unsigned int dont_gc : 1;
+ unsigned int dont_incremental : 1;
+ unsigned int during_gc : 1;
+ unsigned int gc_stressful: 1;
+ unsigned int has_hook: 1;
+#if USE_RGENGC
+ unsigned int during_minor_gc : 1;
+#endif
+#if GC_ENABLE_INCREMENTAL_MARK
+ unsigned int during_incremental_marking : 1;
+#endif
+ } flags;
+
+ rb_event_flag_t hook_events;
+ size_t total_allocated_objects;
+
rb_heap_t eden_heap;
rb_heap_t tomb_heap; /* heap for zombies and ghosts */
struct {
+ rb_atomic_t finalizing;
+ } atomic_flags;
+
+ struct mark_func_data_struct {
+ void *data;
+ void (*mark_func)(VALUE v, void *data);
+ } *mark_func_data;
+
+ mark_stack_t mark_stack;
+ size_t marked_slots;
+
+ struct {
struct heap_page **sorted;
- size_t used;
- size_t length;
+ size_t allocated_pages;
+ size_t allocatable_pages;
+ size_t sorted_length;
RVALUE *range[2];
- size_t limit;
- size_t increment;
-
size_t swept_slots;
size_t min_free_slots;
size_t max_free_slots;
/* final */
size_t final_slots;
- RVALUE *deferred_final;
+ VALUE deferred_final;
} heap_pages;
- struct {
- int dont_gc;
- int dont_lazy_sweep;
- int during_gc;
- rb_atomic_t finalizing;
- } flags;
st_table *finalizer_table;
- mark_stack_t mark_stack;
+
struct {
int run;
+ int latest_gc_info;
gc_profile_record *records;
gc_profile_record *current_record;
size_t next_index;
@@ -464,24 +558,18 @@ typedef struct rb_objspace {
size_t minor_gc_count;
size_t major_gc_count;
#if RGENGC_PROFILE > 0
- size_t generated_normal_object_count;
- size_t generated_shady_object_count;
- size_t shade_operation_count;
- size_t promote_infant_count;
-#if RGENGC_THREEGEN
- size_t promote_young_count;
-#endif
- size_t remembered_normal_object_count;
- size_t remembered_shady_object_count;
+ size_t total_generated_normal_object_count;
+ size_t total_generated_shady_object_count;
+ size_t total_shade_operation_count;
+ size_t total_promoted_count;
+ size_t total_remembered_normal_object_count;
+ size_t total_remembered_shady_object_count;
#if RGENGC_PROFILE >= 2
size_t generated_normal_object_count_types[RUBY_T_MASK];
size_t generated_shady_object_count_types[RUBY_T_MASK];
size_t shade_operation_count_types[RUBY_T_MASK];
- size_t promote_infant_types[RUBY_T_MASK];
-#if RGENGC_THREEGEN
- size_t promote_young_types[RUBY_T_MASK];
-#endif
+ size_t promoted_types[RUBY_T_MASK];
size_t remembered_normal_object_count_types[RUBY_T_MASK];
size_t remembered_shady_object_count_types[RUBY_T_MASK];
#endif
@@ -490,37 +578,28 @@ typedef struct rb_objspace {
/* temporary profiling space */
double gc_sweep_start_time;
- size_t total_allocated_object_num_at_gc_start;
+ size_t total_allocated_objects_at_gc_start;
size_t heap_used_at_gc_start;
/* basic statistics */
size_t count;
- size_t total_allocated_object_num;
- size_t total_freed_object_num;
- int latest_gc_info;
+ size_t total_freed_objects;
+ size_t total_allocated_pages;
+ size_t total_freed_pages;
} profile;
struct gc_list *global_list;
- rb_event_flag_t hook_events; /* this place may be affinity with memory cache */
- VALUE gc_stress;
- struct mark_func_data_struct {
- void *data;
- void (*mark_func)(VALUE v, void *data);
- } *mark_func_data;
+ VALUE gc_stress_mode;
#if USE_RGENGC
struct {
- int during_minor_gc;
- int parent_object_is_old;
-
+ VALUE parent_object;
int need_major_gc;
- size_t remembered_shady_object_count;
- size_t remembered_shady_object_limit;
- size_t old_object_count;
- size_t old_object_limit;
-#if RGENGC_THREEGEN
- size_t young_object_count;
-#endif
+ size_t last_major_gc;
+ size_t uncollectible_wb_unprotected_objects;
+ size_t uncollectible_wb_unprotected_objects_limit;
+ size_t old_objects;
+ size_t old_objects_limit;
#if RGENGC_ESTIMATE_OLDMALLOC
size_t oldmalloc_increase;
@@ -532,7 +611,17 @@ typedef struct rb_objspace {
size_t error_count;
#endif
} rgengc;
+#if GC_ENABLE_INCREMENTAL_MARK
+ struct {
+ size_t pooled_slots;
+ size_t step_slots;
+ } rincgc;
+#endif
#endif /* USE_RGENGC */
+
+#if GC_DEBUG_STRESS_TO_CLASS
+ VALUE stress_to_class;
+#endif
} rb_objspace_t;
@@ -554,58 +643,76 @@ enum {
struct heap_page {
struct heap_page_body *body;
- RVALUE *freelist;
- RVALUE *start;
- size_t final_slots;
- size_t limit;
- struct heap_page *next;
struct heap_page *prev;
- struct heap_page *free_next;
rb_heap_t *heap;
- int before_sweep;
+ int total_slots;
+ int free_slots;
+ int final_slots;
+ struct {
+ unsigned int before_sweep : 1;
+ unsigned int has_remembered_objects : 1;
+ unsigned int has_uncollectible_shady_objects : 1;
+ } flags;
+ struct heap_page *free_next;
+ RVALUE *start;
+ RVALUE *freelist;
+ struct heap_page *next;
+
+#if USE_RGENGC
+ bits_t wb_unprotected_bits[HEAP_BITMAP_LIMIT];
+#endif
+ /* the following three bitmaps are cleared at the beginning of full GC */
bits_t mark_bits[HEAP_BITMAP_LIMIT];
#if USE_RGENGC
- bits_t rememberset_bits[HEAP_BITMAP_LIMIT];
- bits_t oldgen_bits[HEAP_BITMAP_LIMIT];
+ bits_t uncollectible_bits[HEAP_BITMAP_LIMIT];
+ bits_t marking_bits[HEAP_BITMAP_LIMIT];
#endif
};
-#define GET_PAGE_BODY(x) ((struct heap_page_body *)((bits_t)(x) & ~(HEAP_ALIGN_MASK)))
-#define GET_PAGE_HEADER(x) (&GET_PAGE_BODY(x)->header)
-#define GET_HEAP_PAGE(x) (GET_PAGE_HEADER(x)->page)
-#define GET_HEAP_MARK_BITS(x) (&GET_HEAP_PAGE(x)->mark_bits[0])
-#define GET_HEAP_REMEMBERSET_BITS(x) (&GET_HEAP_PAGE(x)->rememberset_bits[0])
-#define GET_HEAP_OLDGEN_BITS(x) (&GET_HEAP_PAGE(x)->oldgen_bits[0])
-#define NUM_IN_PAGE(p) (((bits_t)(p) & HEAP_ALIGN_MASK)/sizeof(RVALUE))
-#define BITMAP_INDEX(p) (NUM_IN_PAGE(p) / BITS_BITLENGTH )
-#define BITMAP_OFFSET(p) (NUM_IN_PAGE(p) & (BITS_BITLENGTH-1))
-#define BITMAP_BIT(p) ((bits_t)1 << BITMAP_OFFSET(p))
+#define GET_PAGE_BODY(x) ((struct heap_page_body *)((bits_t)(x) & ~(HEAP_ALIGN_MASK)))
+#define GET_PAGE_HEADER(x) (&GET_PAGE_BODY(x)->header)
+#define GET_HEAP_PAGE(x) (GET_PAGE_HEADER(x)->page)
+
+#define NUM_IN_PAGE(p) (((bits_t)(p) & HEAP_ALIGN_MASK)/sizeof(RVALUE))
+#define BITMAP_INDEX(p) (NUM_IN_PAGE(p) / BITS_BITLENGTH )
+#define BITMAP_OFFSET(p) (NUM_IN_PAGE(p) & (BITS_BITLENGTH-1))
+#define BITMAP_BIT(p) ((bits_t)1 << BITMAP_OFFSET(p))
+
/* Bitmap Operations */
#define MARKED_IN_BITMAP(bits, p) ((bits)[BITMAP_INDEX(p)] & BITMAP_BIT(p))
#define MARK_IN_BITMAP(bits, p) ((bits)[BITMAP_INDEX(p)] = (bits)[BITMAP_INDEX(p)] | BITMAP_BIT(p))
#define CLEAR_IN_BITMAP(bits, p) ((bits)[BITMAP_INDEX(p)] = (bits)[BITMAP_INDEX(p)] & ~BITMAP_BIT(p))
+/* getting bitmap */
+#define GET_HEAP_MARK_BITS(x) (&GET_HEAP_PAGE(x)->mark_bits[0])
+#if USE_RGENGC
+#define GET_HEAP_UNCOLLECTIBLE_BITS(x) (&GET_HEAP_PAGE(x)->uncollectible_bits[0])
+#define GET_HEAP_WB_UNPROTECTED_BITS(x) (&GET_HEAP_PAGE(x)->wb_unprotected_bits[0])
+#define GET_HEAP_MARKING_BITS(x) (&GET_HEAP_PAGE(x)->marking_bits[0])
+#endif
+
/* Aliases */
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
#define rb_objspace (*GET_VM()->objspace)
-#define ruby_initial_gc_stress gc_params.gc_stress
-VALUE *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#else
static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT_MIN}};
-VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#endif
+#define ruby_initial_gc_stress gc_params.gc_stress
+
+VALUE *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
+
#define malloc_limit objspace->malloc_params.limit
#define malloc_increase objspace->malloc_params.increase
#define malloc_allocated_size objspace->malloc_params.allocated_size
#define heap_pages_sorted objspace->heap_pages.sorted
-#define heap_pages_used objspace->heap_pages.used
-#define heap_pages_length objspace->heap_pages.length
+#define heap_allocated_pages objspace->heap_pages.allocated_pages
+#define heap_pages_sorted_length objspace->heap_pages.sorted_length
#define heap_pages_lomem objspace->heap_pages.range[0]
#define heap_pages_himem objspace->heap_pages.range[1]
#define heap_pages_swept_slots objspace->heap_pages.swept_slots
-#define heap_pages_increment objspace->heap_pages.increment
+#define heap_allocatable_pages objspace->heap_pages.allocatable_pages
#define heap_pages_min_free_slots objspace->heap_pages.min_free_slots
#define heap_pages_max_free_slots objspace->heap_pages.max_free_slots
#define heap_pages_final_slots objspace->heap_pages.final_slots
@@ -614,14 +721,37 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#define heap_tomb (&objspace->tomb_heap)
#define dont_gc objspace->flags.dont_gc
#define during_gc objspace->flags.during_gc
-#define finalizing objspace->flags.finalizing
+#define finalizing objspace->atomic_flags.finalizing
#define finalizer_table objspace->finalizer_table
-#define global_List objspace->global_list
-#define ruby_gc_stress objspace->gc_stress
-#define monitor_level objspace->rgengc.monitor_level
-#define monitored_object_table objspace->rgengc.monitored_object_table
+#define global_list objspace->global_list
+#define ruby_gc_stressful objspace->flags.gc_stressful
+#define ruby_gc_stress_mode objspace->gc_stress_mode
+#if GC_DEBUG_STRESS_TO_CLASS
+#define stress_to_class objspace->stress_to_class
+#else
+#define stress_to_class 0
+#endif
+
+#define is_marking(objspace) ((objspace)->flags.stat == gc_stat_marking)
+#define is_sweeping(objspace) ((objspace)->flags.stat == gc_stat_sweeping)
+#if USE_RGENGC
+#define is_full_marking(objspace) ((objspace)->flags.during_minor_gc == FALSE)
+#else
+#define is_full_marking(objspace) TRUE
+#endif
+#if GC_ENABLE_INCREMENTAL_MARK
+#define is_incremental_marking(objspace) ((objspace)->flags.during_incremental_marking != FALSE)
+#else
+#define is_incremental_marking(objspace) FALSE
+#endif
+#if GC_ENABLE_INCREMENTAL_MARK
+#define will_be_incremental_marking(objspace) ((objspace)->rgengc.need_major_gc != GPR_FLAG_NONE)
+#else
+#define will_be_incremental_marking(objspace) FALSE
+#endif
+#define has_sweeping_pages(heap) ((heap)->sweep_pages != 0)
+#define is_lazy_sweeping(heap) (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(heap))
-#define is_lazy_sweeping(heap) ((heap)->sweep_pages != 0)
#if SIZEOF_LONG == SIZEOF_VOIDP
# define nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG)
# define obj_id_to_ref(objid) ((objid) ^ FIXNUM_FLAG) /* unset FIXNUM_FLAG */
@@ -635,11 +765,23 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#define RANY(o) ((RVALUE*)(o))
+struct RZombie {
+ struct RBasic basic;
+ VALUE next;
+ void (*dfree)(void *);
+ void *data;
+};
+
+#define RZOMBIE(o) ((struct RZombie *)(o))
+
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
int ruby_gc_debug_indent = 0;
VALUE rb_mGC;
-int ruby_disable_gc_stress = 0;
+int ruby_disable_gc = 0;
+
+void rb_iseq_mark(const rb_iseq_t *iseq);
+void rb_iseq_free(const rb_iseq_t *iseq);
void rb_gcdebug_print_obj_condition(VALUE obj);
@@ -652,21 +794,56 @@ static void aligned_free(void *);
static void init_mark_stack(mark_stack_t *stack);
-static VALUE lazy_sweep_enable(void);
static int ready_to_gc(rb_objspace_t *objspace);
-static int heap_ready_to_gc(rb_objspace_t *objspace, rb_heap_t *heap);
-static int garbage_collect(rb_objspace_t *, int full_mark, int immediate_sweep, int reason);
-static int garbage_collect_body(rb_objspace_t *, int full_mark, int immediate_sweep, int reason);
-static int gc_heap_lazy_sweep(rb_objspace_t *objspace, rb_heap_t *heap);
-static void gc_rest_sweep(rb_objspace_t *objspace);
-static void gc_heap_rest_sweep(rb_objspace_t *objspace, rb_heap_t *heap);
-
-static void gc_mark_stacked_objects(rb_objspace_t *);
+
+static int garbage_collect(rb_objspace_t *, int full_mark, int immediate_mark, int immediate_sweep, int reason);
+
+static int gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark, const unsigned int immediate_sweep, int reason);
+static void gc_rest(rb_objspace_t *objspace);
+static inline void gc_enter(rb_objspace_t *objspace, const char *event);
+static inline void gc_exit(rb_objspace_t *objspace, const char *event);
+
+static void gc_marks(rb_objspace_t *objspace, int full_mark);
+static void gc_marks_start(rb_objspace_t *objspace, int full);
+static int gc_marks_finish(rb_objspace_t *objspace);
+static void gc_marks_rest(rb_objspace_t *objspace);
+#if GC_ENABLE_INCREMENTAL_MARK
+static void gc_marks_step(rb_objspace_t *objspace, int slots);
+static void gc_marks_continue(rb_objspace_t *objspace, rb_heap_t *heap);
+#endif
+
+static void gc_sweep(rb_objspace_t *objspace);
+static void gc_sweep_start(rb_objspace_t *objspace);
+static void gc_sweep_finish(rb_objspace_t *objspace);
+static int gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap);
+static void gc_sweep_rest(rb_objspace_t *objspace);
+#if GC_ENABLE_LAZY_SWEEP
+static void gc_sweep_continue(rb_objspace_t *objspace, rb_heap_t *heap);
+#endif
+
static void gc_mark(rb_objspace_t *objspace, VALUE ptr);
+static void gc_mark_ptr(rb_objspace_t *objspace, VALUE ptr);
static void gc_mark_maybe(rb_objspace_t *objspace, VALUE ptr);
static void gc_mark_children(rb_objspace_t *objspace, VALUE ptr);
-static size_t obj_memsize_of(VALUE obj, int use_tdata);
+static int gc_mark_stacked_objects_incremental(rb_objspace_t *, size_t count);
+static int gc_mark_stacked_objects_all(rb_objspace_t *);
+static void gc_grey(rb_objspace_t *objspace, VALUE ptr);
+
+static inline int gc_mark_set(rb_objspace_t *objspace, VALUE obj);
+static inline int is_pointer_to_heap(rb_objspace_t *objspace, void *ptr);
+
+static void push_mark_stack(mark_stack_t *, VALUE);
+static int pop_mark_stack(mark_stack_t *, VALUE *);
+static size_t mark_stack_size(mark_stack_t *stack);
+static void shrink_stack_chunk_cache(mark_stack_t *stack);
+
+static size_t obj_memsize_of(VALUE obj, int use_all_types);
+static VALUE gc_verify_internal_consistency(VALUE self);
+static int gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj);
+static int gc_verify_heap_pages(rb_objspace_t *objspace);
+
+static void gc_stress_set(rb_objspace_t *objspace, VALUE flag);
static double getrusage_time(void);
static inline void gc_prof_setup_new_record(rb_objspace_t *objspace, int reason);
@@ -682,176 +859,396 @@ static inline void gc_prof_set_heap_info(rb_objspace_t *);
#define gc_prof_record(objspace) (objspace)->profile.current_record
#define gc_prof_enabled(objspace) ((objspace)->profile.run && (objspace)->profile.current_record)
-#define rgengc_report if (RGENGC_DEBUG) rgengc_report_body
-static void rgengc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...);
-static const char * type_name(int type, VALUE obj);
-static const char *obj_type_name(VALUE obj);
+#ifdef HAVE_VA_ARGS_MACRO
+# define gc_report(level, objspace, fmt, ...) \
+ if ((level) > RGENGC_DEBUG) {} else gc_report_body(level, objspace, fmt, ##__VA_ARGS__)
+#else
+# define gc_report if (!(RGENGC_DEBUG)) {} else gc_report_body
+#endif
+PRINTF_ARGS(static void gc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...), 3, 4);
+static const char *obj_info(VALUE obj);
+
+#define PUSH_MARK_FUNC_DATA(v) do { \
+ struct mark_func_data_struct *prev_mark_func_data = objspace->mark_func_data; \
+ objspace->mark_func_data = (v);
+
+#define POP_MARK_FUNC_DATA() objspace->mark_func_data = prev_mark_func_data;} while (0)
+
+/*
+ * 1 - TSC (H/W Time Stamp Counter)
+ * 2 - getrusage
+ */
+#ifndef TICK_TYPE
+#define TICK_TYPE 1
+#endif
+
+#if USE_TICK_T
+
+#if TICK_TYPE == 1
+/* the following code is only for internal tuning. */
+
+/* Source code to use RDTSC is quoted and modified from
+ * http://www.mcs.anl.gov/~kazutomo/rdtsc.html
+ * written by Kazutomo Yoshii <kazutomo@mcs.anl.gov>
+ */
+
+#if defined(__GNUC__) && defined(__i386__)
+typedef unsigned long long tick_t;
+#define PRItick "llu"
+static inline tick_t
+tick(void)
+{
+ unsigned long long int x;
+ __asm__ __volatile__ ("rdtsc" : "=A" (x));
+ return x;
+}
+
+#elif defined(__GNUC__) && defined(__x86_64__)
+typedef unsigned long long tick_t;
+#define PRItick "llu"
+
+static __inline__ tick_t
+tick(void)
+{
+ unsigned long hi, lo;
+ __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
+ return ((unsigned long long)lo)|( ((unsigned long long)hi)<<32);
+}
+
+#elif defined(_WIN32) && defined(_MSC_VER)
+#include <intrin.h>
+typedef unsigned __int64 tick_t;
+#define PRItick "llu"
+
+static inline tick_t
+tick(void)
+{
+ return __rdtsc();
+}
+
+#else /* use clock */
+typedef clock_t tick_t;
+#define PRItick "llu"
+
+static inline tick_t
+tick(void)
+{
+ return clock();
+}
+#endif /* TSC */
+
+#elif TICK_TYPE == 2
+typedef double tick_t;
+#define PRItick "4.9f"
+
+static inline tick_t
+tick(void)
+{
+ return getrusage_time();
+}
+#else /* TICK_TYPE */
+#error "choose tick type"
+#endif /* TICK_TYPE */
+
+#define MEASURE_LINE(expr) do { \
+ volatile tick_t start_time = tick(); \
+ volatile tick_t end_time; \
+ expr; \
+ end_time = tick(); \
+ fprintf(stderr, "0\t%"PRItick"\t%s\n", end_time - start_time, #expr); \
+} while (0)
+
+#else /* USE_TICK_T */
+#define MEASURE_LINE(expr) expr
+#endif /* USE_TICK_T */
+
+#define FL_TEST2(x,f) ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? (rb_bug("FL_TEST2: SPECIAL_CONST (%p)", (void *)(x)), 0) : FL_TEST_RAW((x),(f)) != 0)
+#define FL_SET2(x,f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_SET2: SPECIAL_CONST"); RBASIC(x)->flags |= (f);} while (0)
+#define FL_UNSET2(x,f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_UNSET2: SPECIAL_CONST"); RBASIC(x)->flags &= ~(f);} while (0)
+
+#define RVALUE_MARK_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), (obj))
+#define RVALUE_PAGE_MARKED(page, obj) MARKED_IN_BITMAP((page)->mark_bits, (obj))
#if USE_RGENGC
+#define RVALUE_WB_UNPROTECTED_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), (obj))
+#define RVALUE_UNCOLLECTIBLE_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS(obj), (obj))
+#define RVALUE_MARKING_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), (obj))
+
+#define RVALUE_PAGE_WB_UNPROTECTED(page, obj) MARKED_IN_BITMAP((page)->wb_unprotected_bits, (obj))
+#define RVALUE_PAGE_UNCOLLECTIBLE(page, obj) MARKED_IN_BITMAP((page)->uncollectible_bits, (obj))
+#define RVALUE_PAGE_MARKING(page, obj) MARKED_IN_BITMAP((page)->marking_bits, (obj))
+
+#define RVALUE_OLD_AGE 3
+#define RVALUE_AGE_SHIFT 5 /* FL_PROMOTED0 bit */
+
static int rgengc_remembered(rb_objspace_t *objspace, VALUE obj);
static int rgengc_remember(rb_objspace_t *objspace, VALUE obj);
static void rgengc_mark_and_rememberset_clear(rb_objspace_t *objspace, rb_heap_t *heap);
static void rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap);
-#define FL_TEST2(x,f) ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? (rb_bug("FL_TEST2: SPECIAL_CONST"), 0) : FL_TEST_RAW((x),(f)) != 0)
-#define FL_SET2(x,f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_SET2: SPECIAL_CONST"); RBASIC(x)->flags |= (f);} while (0)
-#define FL_UNSET2(x,f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_UNSET2: SPECIAL_CONST"); RBASIC(x)->flags &= ~(f);} while (0)
-
-#define RVALUE_WB_PROTECTED_RAW(obj) FL_TEST2((obj), FL_WB_PROTECTED)
-#define RVALUE_WB_PROTECTED(obj) RVALUE_WB_PROTECTED_RAW(check_gen_consistency((VALUE)obj))
+static inline int
+RVALUE_FLAGS_AGE(VALUE flags)
+{
+ return (int)((flags & (FL_PROMOTED0 | FL_PROMOTED1)) >> RVALUE_AGE_SHIFT);
+}
-#define RVALUE_OLDGEN_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), (obj))
+#endif /* USE_RGENGC */
-static inline int is_pointer_to_heap(rb_objspace_t *objspace, void *ptr);
-static inline int gc_marked(rb_objspace_t *objspace, VALUE ptr);
+#if RGENGC_CHECK_MODE == 0
static inline VALUE
-check_gen_consistency(VALUE obj)
+check_rvalue_consistency(const VALUE obj)
{
- if (RGENGC_CHECK_MODE > 0) {
- int old_flag = RVALUE_OLDGEN_BITMAP(obj) != 0;
- int promoted_flag = FL_TEST2(obj, FL_PROMOTED);
- rb_objspace_t *objspace = &rb_objspace;
+ return obj;
+}
+#else
+static VALUE
+check_rvalue_consistency(const VALUE obj)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ if (SPECIAL_CONST_P(obj)) {
+ rb_bug("check_rvalue_consistency: %p is a special const.", (void *)obj);
+ }
+ else if (!is_pointer_to_heap(objspace, (void *)obj)) {
+ rb_bug("check_rvalue_consistency: %p is not a Ruby object.", (void *)obj);
+ }
+ else {
+ const int wb_unprotected_bit = RVALUE_WB_UNPROTECTED_BITMAP(obj) != 0;
+ const int uncollectible_bit = RVALUE_UNCOLLECTIBLE_BITMAP(obj) != 0;
+ const int mark_bit = RVALUE_MARK_BITMAP(obj) != 0;
+ const int marking_bit = RVALUE_MARKING_BITMAP(obj) != 0, remembered_bit = marking_bit;
+ const int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
+
+ if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("check_rvalue_consistency: %s is T_NONE", obj_info(obj));
+ if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("check_rvalue_consistency: %s is T_ZOMBIE", obj_info(obj));
obj_memsize_of((VALUE)obj, FALSE);
- if (!is_pointer_to_heap(objspace, (void *)obj)) {
- rb_bug("check_gen_consistency: %p (%s) is not Ruby object.", (void *)obj, obj_type_name(obj));
+ /* check generation
+ *
+ * OLD == age == 3 && old-bitmap && mark-bit (except incremental marking)
+ */
+ if (age > 0 && wb_unprotected_bit) {
+ rb_bug("check_rvalue_consistency: %s is not WB protected, but age is %d > 0.", obj_info(obj), age);
}
- if (promoted_flag) {
- if (!RVALUE_WB_PROTECTED_RAW(obj)) {
- const char *type = old_flag ? "old" : "young";
- rb_bug("check_gen_consistency: %p (%s) is not WB protected, but %s object.", (void *)obj, obj_type_name(obj), type);
- }
+ if (!is_marking(objspace) && uncollectible_bit && !mark_bit) {
+ rb_bug("check_rvalue_consistency: %s is uncollectible, but is not marked while !gc.", obj_info(obj));
+ }
-#if !RGENGC_THREEGEN
- if (!old_flag) {
- rb_bug("check_gen_consistency: %p (%s) is not infant, but is not old (on 2gen).", (void *)obj, obj_type_name(obj));
+ if (!is_full_marking(objspace)) {
+ if (uncollectible_bit && age != RVALUE_OLD_AGE && !wb_unprotected_bit) {
+ rb_bug("check_rvalue_consistency: %s is uncollectible, but not old (age: %d) and not WB unprotected.", obj_info(obj), age);
}
-#endif
-
- if (old_flag && objspace->rgengc.during_minor_gc && !gc_marked(objspace, obj)) {
- rb_bug("check_gen_consistency: %p (%s) is old, but is not marked while minor marking.", (void *)obj, obj_type_name(obj));
+ if (remembered_bit && age != RVALUE_OLD_AGE) {
+ rb_bug("check_rvalue_consistency: %s is rememberd, but not old (age: %d).", obj_info(obj), age);
}
}
- else {
- if (old_flag) {
- rb_bug("check_gen_consistency: %p (%s) is not infant, but is old.", (void *)obj, obj_type_name(obj));
- }
+
+ /*
+ * check coloring
+ *
+ * marking:false marking:true
+ * marked:false white *invalid*
+ * marked:true black grey
+ */
+ if (is_incremental_marking(objspace) && marking_bit) {
+ if (!is_marking(objspace) && !mark_bit) rb_bug("check_rvalue_consistency: %s is marking, but not marked.", obj_info(obj));
}
}
return obj;
}
+#endif
-static inline VALUE
-RVALUE_INFANT_P(VALUE obj)
+static inline int
+RVALUE_MARKED(VALUE obj)
{
- check_gen_consistency(obj);
- return !FL_TEST2(obj, FL_PROMOTED);
+ check_rvalue_consistency(obj);
+ return RVALUE_MARK_BITMAP(obj) != 0;
}
-static inline VALUE
-RVALUE_OLD_BITMAP_P(VALUE obj)
+#if USE_RGENGC
+static inline int
+RVALUE_WB_UNPROTECTED(VALUE obj)
{
- check_gen_consistency(obj);
- return (RVALUE_OLDGEN_BITMAP(obj) != 0);
+ check_rvalue_consistency(obj);
+ return RVALUE_WB_UNPROTECTED_BITMAP(obj) != 0;
}
-static inline VALUE
-RVALUE_OLD_P(VALUE obj)
+static inline int
+RVALUE_MARKING(VALUE obj)
{
- check_gen_consistency(obj);
-#if RGENGC_THREEGEN
- return FL_TEST2(obj, FL_PROMOTED) && RVALUE_OLD_BITMAP_P(obj);
-#else
- return FL_TEST2(obj, FL_PROMOTED);
-#endif
+ check_rvalue_consistency(obj);
+ return RVALUE_MARKING_BITMAP(obj) != 0;
}
-static inline VALUE
-RVALUE_PROMOTED_P(VALUE obj)
+static inline int
+RVALUE_REMEMBERED(VALUE obj)
{
- check_gen_consistency(obj);
- return FL_TEST2(obj, FL_PROMOTED);
+ check_rvalue_consistency(obj);
+ return RVALUE_MARKING_BITMAP(obj) != 0;
}
-static inline void
-RVALUE_PROMOTE_INFANT(VALUE obj)
+static inline int
+RVALUE_UNCOLLECTIBLE(VALUE obj)
+{
+ check_rvalue_consistency(obj);
+ return RVALUE_UNCOLLECTIBLE_BITMAP(obj) != 0;
+}
+
+static inline int
+RVALUE_OLD_P_RAW(VALUE obj)
{
- check_gen_consistency(obj);
- if (RGENGC_CHECK_MODE && !RVALUE_INFANT_P(obj)) rb_bug("RVALUE_PROMOTE_INFANT: %p (%s) is not infant object.", (void *)obj, obj_type_name(obj));
- FL_SET2(obj, FL_PROMOTED);
-#if !RGENGC_THREEGEN
- MARK_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj);
+ const VALUE promoted = FL_PROMOTED0 | FL_PROMOTED1;
+ return (RBASIC(obj)->flags & promoted) == promoted;
+}
+
+static inline int
+RVALUE_OLD_P(VALUE obj)
+{
+ check_rvalue_consistency(obj);
+ return RVALUE_OLD_P_RAW(obj);
+}
+
+#if RGENGC_CHECK_MODE || GC_DEBUG
+static inline int
+RVALUE_AGE(VALUE obj)
+{
+ check_rvalue_consistency(obj);
+ return RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
+}
#endif
- check_gen_consistency(obj);
-#if RGENGC_PROFILE >= 1
- {
- rb_objspace_t *objspace = &rb_objspace;
- objspace->profile.promote_infant_count++;
+static inline void
+RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
+{
+ MARK_IN_BITMAP(&page->uncollectible_bits[0], obj);
+ objspace->rgengc.old_objects++;
#if RGENGC_PROFILE >= 2
- objspace->profile.promote_infant_types[BUILTIN_TYPE(obj)]++;
-#endif
- }
+ objspace->profile.total_promoted_count++;
+ objspace->profile.promoted_types[BUILTIN_TYPE(obj)]++;
#endif
}
-#if RGENGC_THREEGEN
-/*
- * Two gen: Infant -> Old.
- * Three gen: Infant -> Young -> Old.
- */
+static inline void
+RVALUE_OLD_UNCOLLECTIBLE_SET(rb_objspace_t *objspace, VALUE obj)
+{
+ RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(objspace, GET_HEAP_PAGE(obj), obj);
+}
+
static inline VALUE
-RVALUE_YOUNG_P(VALUE obj)
+RVALUE_FLAGS_AGE_SET(VALUE flags, int age)
{
- check_gen_consistency(obj);
- return FL_TEST2(obj, FL_PROMOTED) && (RVALUE_OLDGEN_BITMAP(obj) == 0);
+ flags &= ~(FL_PROMOTED0 | FL_PROMOTED1);
+ flags |= (age << RVALUE_AGE_SHIFT);
+ return flags;
}
+/* set age to age+1 */
static inline void
-RVALUE_PROMOTE_YOUNG(VALUE obj)
+RVALUE_AGE_INC(rb_objspace_t *objspace, VALUE obj)
{
- check_gen_consistency(obj);
- if (RGENGC_CHECK_MODE && !RVALUE_YOUNG_P(obj)) rb_bug("RVALUE_PROMOTE_YOUNG: %p (%s) is not young object.", (void *)obj, obj_type_name(obj));
- MARK_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj);
- check_gen_consistency(obj);
+ VALUE flags = RBASIC(obj)->flags;
+ int age = RVALUE_FLAGS_AGE(flags);
-#if RGENGC_PROFILE >= 1
- {
- rb_objspace_t *objspace = &rb_objspace;
- objspace->profile.promote_young_count++;
-#if RGENGC_PROFILE >= 2
- objspace->profile.promote_young_types[BUILTIN_TYPE(obj)]++;
-#endif
+ if (RGENGC_CHECK_MODE && age == RVALUE_OLD_AGE) {
+ rb_bug("RVALUE_AGE_INC: can not increment age of OLD object %s.", obj_info(obj));
}
-#endif
+
+ age++;
+ RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(flags, age);
+
+ if (age == RVALUE_OLD_AGE) {
+ RVALUE_OLD_UNCOLLECTIBLE_SET(objspace, obj);
+ }
+ check_rvalue_consistency(obj);
}
+/* set age to RVALUE_OLD_AGE */
static inline void
-RVALUE_DEMOTE_FROM_YOUNG(VALUE obj)
+RVALUE_AGE_SET_OLD(rb_objspace_t *objspace, VALUE obj)
{
- if (RGENGC_CHECK_MODE && !RVALUE_YOUNG_P(obj))
- rb_bug("RVALUE_DEMOTE_FROM_YOUNG: %p (%s) is not young object.", (void *)obj, obj_type_name(obj));
+ check_rvalue_consistency(obj);
+ if (RGENGC_CHECK_MODE) assert(!RVALUE_OLD_P(obj));
- check_gen_consistency(obj);
- FL_UNSET2(obj, FL_PROMOTED);
- check_gen_consistency(obj);
+ RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(RBASIC(obj)->flags, RVALUE_OLD_AGE);
+ RVALUE_OLD_UNCOLLECTIBLE_SET(objspace, obj);
+
+ check_rvalue_consistency(obj);
}
-#endif
+/* set age to RVALUE_OLD_AGE - 1 */
static inline void
-RVALUE_DEMOTE_FROM_OLD(VALUE obj)
+RVALUE_AGE_SET_CANDIDATE(rb_objspace_t *objspace, VALUE obj)
+{
+ check_rvalue_consistency(obj);
+ if (RGENGC_CHECK_MODE) assert(!RVALUE_OLD_P(obj));
+
+ RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(RBASIC(obj)->flags, RVALUE_OLD_AGE - 1);
+
+ check_rvalue_consistency(obj);
+}
+
+static inline void
+RVALUE_DEMOTE_RAW(rb_objspace_t *objspace, VALUE obj)
+{
+ RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(RBASIC(obj)->flags, 0);
+ CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS(obj), obj);
+}
+
+static inline void
+RVALUE_DEMOTE(rb_objspace_t *objspace, VALUE obj)
+{
+ check_rvalue_consistency(obj);
+ if (RGENGC_CHECK_MODE) assert(RVALUE_OLD_P(obj));
+
+ if (!is_incremental_marking(objspace) && RVALUE_REMEMBERED(obj)) {
+ CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
+ }
+
+ RVALUE_DEMOTE_RAW(objspace, obj);
+
+ if (RVALUE_MARKED(obj)) {
+ objspace->rgengc.old_objects--;
+ }
+
+ check_rvalue_consistency(obj);
+}
+
+static inline void
+RVALUE_AGE_RESET_RAW(VALUE obj)
+{
+ RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(RBASIC(obj)->flags, 0);
+}
+
+static inline void
+RVALUE_AGE_RESET(VALUE obj)
+{
+ check_rvalue_consistency(obj);
+ if (RGENGC_CHECK_MODE) assert(!RVALUE_OLD_P(obj));
+ RVALUE_AGE_RESET_RAW(obj);
+ check_rvalue_consistency(obj);
+}
+
+static inline int
+RVALUE_BLACK_P(VALUE obj)
+{
+ return RVALUE_MARKED(obj) && !RVALUE_MARKING(obj);
+}
+
+#if 0
+static inline int
+RVALUE_GREY_P(VALUE obj)
{
- if (RGENGC_CHECK_MODE && !RVALUE_OLD_P(obj))
- rb_bug("RVALUE_DEMOTE_FROM_OLD: %p (%s) is not old object.", (void *)obj, obj_type_name(obj));
+ return RVALUE_MARKED(obj) && RVALUE_MARKING(obj);
+}
+#endif
- check_gen_consistency(obj);
- FL_UNSET2(obj, FL_PROMOTED);
- CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj);
- check_gen_consistency(obj);
+static inline int
+RVALUE_WHITE_P(VALUE obj)
+{
+ return RVALUE_MARKED(obj) == FALSE;
}
#endif /* USE_RGENGC */
@@ -860,49 +1257,48 @@ RVALUE_DEMOTE_FROM_OLD(VALUE obj)
--------------------------- ObjectSpace -----------------------------
*/
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
rb_objspace_t *
rb_objspace_alloc(void)
{
- rb_objspace_t *objspace = malloc(sizeof(rb_objspace_t));
- memset(objspace, 0, sizeof(*objspace));
- ruby_gc_stress = ruby_initial_gc_stress;
-
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
+ rb_objspace_t *objspace = calloc(1, sizeof(rb_objspace_t));
+#else
+ rb_objspace_t *objspace = &rb_objspace;
+#endif
malloc_limit = gc_params.malloc_limit_min;
return objspace;
}
-#endif
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
static void free_stack_chunks(mark_stack_t *);
static void heap_page_free(rb_objspace_t *objspace, struct heap_page *page);
void
rb_objspace_free(rb_objspace_t *objspace)
{
- gc_rest_sweep(objspace);
+ if (is_lazy_sweeping(heap_eden))
+ rb_bug("lazy sweeping underway when freeing object space");
if (objspace->profile.records) {
free(objspace->profile.records);
objspace->profile.records = 0;
}
- if (global_List) {
+ if (global_list) {
struct gc_list *list, *next;
- for (list = global_List; list; list = next) {
+ for (list = global_list; list; list = next) {
next = list->next;
xfree(list);
}
}
if (heap_pages_sorted) {
size_t i;
- for (i = 0; i < heap_pages_used; ++i) {
+ for (i = 0; i < heap_allocated_pages; ++i) {
heap_page_free(objspace, heap_pages_sorted[i]);
}
free(heap_pages_sorted);
- heap_pages_used = 0;
- heap_pages_length = 0;
+ heap_allocated_pages = 0;
+ heap_pages_sorted_length = 0;
heap_pages_lomem = 0;
heap_pages_himem = 0;
@@ -911,37 +1307,44 @@ rb_objspace_free(rb_objspace_t *objspace)
objspace->eden_heap.pages = NULL;
}
free_stack_chunks(&objspace->mark_stack);
+#if !(defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE)
+ if (objspace == &rb_objspace) return;
+#endif
free(objspace);
}
-#endif
static void
-heap_pages_expand_sorted(rb_objspace_t *objspace)
+heap_pages_expand_sorted_to(rb_objspace_t *objspace, size_t next_length)
{
- size_t next_length = heap_pages_increment;
- next_length += heap_eden->page_length;
- next_length += heap_tomb->page_length;
+ struct heap_page **sorted;
+ size_t size = next_length * sizeof(struct heap_page *);
- if (next_length > heap_pages_length) {
- struct heap_page **sorted;
- size_t size = next_length * sizeof(struct heap_page *);
+ gc_report(3, objspace, "heap_pages_expand_sorted: next_length: %d, size: %d\n", (int)next_length, (int)size);
- rgengc_report(3, objspace, "heap_pages_expand_sorted: next_length: %d, size: %d\n", (int)next_length, (int)size);
+ if (heap_pages_sorted_length > 0) {
+ sorted = (struct heap_page **)realloc(heap_pages_sorted, size);
+ if (sorted) heap_pages_sorted = sorted;
+ }
+ else {
+ sorted = heap_pages_sorted = (struct heap_page **)malloc(size);
+ }
- if (heap_pages_length > 0) {
- sorted = (struct heap_page **)realloc(heap_pages_sorted, size);
- if (sorted) heap_pages_sorted = sorted;
- }
- else {
- sorted = heap_pages_sorted = (struct heap_page **)malloc(size);
- }
+ if (sorted == 0) {
+ rb_memerror();
+ }
- if (sorted == 0) {
- during_gc = 0;
- rb_memerror();
- }
+ heap_pages_sorted_length = next_length;
+}
- heap_pages_length = next_length;
+static void
+heap_pages_expand_sorted(rb_objspace_t *objspace)
+{
+ size_t next_length = heap_allocatable_pages;
+ next_length += heap_eden->page_length;
+ next_length += heap_tomb->page_length;
+
+ if (next_length > heap_pages_sorted_length) {
+ heap_pages_expand_sorted_to(objspace, next_length);
}
}
@@ -952,7 +1355,12 @@ heap_page_add_freeobj(rb_objspace_t *objspace, struct heap_page *page, VALUE obj
p->as.free.flags = 0;
p->as.free.next = page->freelist;
page->freelist = p;
- rgengc_report(3, objspace, "heap_page_add_freeobj: %p (%s) is added to freelist\n", p, obj_type_name(obj));
+
+ if (RGENGC_CHECK_MODE && !is_pointer_to_heap(objspace, p)) {
+ rb_bug("heap_page_add_freeobj: %p is not rvalue.", p);
+ }
+
+ gc_report(3, objspace, "heap_page_add_freeobj: add %p to freelist\n", (void *)obj);
}
static inline void
@@ -964,6 +1372,22 @@ heap_add_freepage(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *pa
}
}
+#if GC_ENABLE_INCREMENTAL_MARK
+static inline int
+heap_add_poolpage(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *page)
+{
+ if (page->freelist) {
+ page->free_next = heap->pooled_pages;
+ heap->pooled_pages = page;
+ objspace->rincgc.pooled_slots += page->free_slots;
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+#endif
+
static void
heap_unlink_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *page)
{
@@ -974,13 +1398,14 @@ heap_unlink_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *pag
page->next = NULL;
page->heap = NULL;
heap->page_length--;
- heap->total_slots -= page->limit;
+ heap->total_slots -= page->total_slots;
}
static void
heap_page_free(rb_objspace_t *objspace, struct heap_page *page)
{
- heap_pages_used--;
+ heap_allocated_pages--;
+ objspace->profile.total_freed_pages++;
aligned_free(page->body);
free(page);
}
@@ -990,28 +1415,30 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
{
size_t i, j;
- for (i = j = 1; j < heap_pages_used; i++) {
- struct heap_page *page = heap_pages_sorted[i];
-
- if (page->heap == heap_tomb && page->final_slots == 0) {
- if (heap_pages_swept_slots - page->limit > heap_pages_max_free_slots) {
- if (0) fprintf(stderr, "heap_pages_free_unused_pages: %d free page %p, heap_pages_swept_slots: %d, heap_pages_max_free_slots: %d\n",
- (int)i, page, (int)heap_pages_swept_slots, (int)heap_pages_max_free_slots);
- heap_pages_swept_slots -= page->limit;
- heap_unlink_page(objspace, heap_tomb, page);
- heap_page_free(objspace, page);
- continue;
+ if (heap_tomb->pages && heap_pages_swept_slots > heap_pages_max_free_slots) {
+ for (i = j = 1; j < heap_allocated_pages; i++) {
+ struct heap_page *page = heap_pages_sorted[i];
+
+ if (page->heap == heap_tomb && page->free_slots == page->total_slots) {
+ if (heap_pages_swept_slots - page->total_slots > heap_pages_max_free_slots) {
+ if (0) fprintf(stderr, "heap_pages_free_unused_pages: %d free page %p, heap_pages_swept_slots: %d, heap_pages_max_free_slots: %d\n",
+ (int)i, page, (int)heap_pages_swept_slots, (int)heap_pages_max_free_slots);
+ heap_pages_swept_slots -= page->total_slots;
+ heap_unlink_page(objspace, heap_tomb, page);
+ heap_page_free(objspace, page);
+ continue;
+ }
+ else if (i == j) {
+ return; /* no need to check rest pages */
+ }
}
- else {
- /* fprintf(stderr, "heap_pages_free_unused_pages: remain!!\n"); */
+ if (i != j) {
+ heap_pages_sorted[j] = page;
}
+ j++;
}
- if (i != j) {
- heap_pages_sorted[j] = page;
- }
- j++;
+ if (RGENGC_CHECK_MODE) assert(j == heap_allocated_pages);
}
- assert(j == heap_pages_used);
}
static struct heap_page *
@@ -1021,29 +1448,26 @@ heap_page_allocate(rb_objspace_t *objspace)
struct heap_page *page;
struct heap_page_body *page_body = 0;
size_t hi, lo, mid;
- size_t limit = HEAP_OBJ_LIMIT;
+ int limit = HEAP_OBJ_LIMIT;
/* assign heap_page body (contains heap_page_header and RVALUEs) */
page_body = (struct heap_page_body *)aligned_malloc(HEAP_ALIGN, HEAP_SIZE);
if (page_body == 0) {
- during_gc = 0;
rb_memerror();
}
/* assign heap_page entry */
- page = (struct heap_page *)malloc(sizeof(struct heap_page));
+ page = (struct heap_page *)calloc(1, sizeof(struct heap_page));
if (page == 0) {
aligned_free(page_body);
- during_gc = 0;
rb_memerror();
}
- MEMZERO((void*)page, struct heap_page, 1);
page->body = page_body;
/* setup heap_pages_sorted */
lo = 0;
- hi = heap_pages_used;
+ hi = heap_allocated_pages;
while (lo < hi) {
struct heap_page *mid_page;
@@ -1059,21 +1483,29 @@ heap_page_allocate(rb_objspace_t *objspace)
rb_bug("same heap page is allocated: %p at %"PRIuVALUE, (void *)page_body, (VALUE)mid);
}
}
- if (hi < heap_pages_used) {
- MEMMOVE(&heap_pages_sorted[hi+1], &heap_pages_sorted[hi], struct heap_page_header*, heap_pages_used - hi);
+ if (heap_allocated_pages >= heap_pages_sorted_length) {
+ heap_pages_expand_sorted_to(objspace, heap_allocated_pages + 1);
+ }
+ if (hi < heap_allocated_pages) {
+ MEMMOVE(&heap_pages_sorted[hi+1], &heap_pages_sorted[hi], struct heap_page_header*, heap_allocated_pages - hi);
}
heap_pages_sorted[hi] = page;
- heap_pages_used++;
- assert(heap_pages_used <= heap_pages_length);
+ heap_allocated_pages++;
+ objspace->profile.total_allocated_pages++;
+
+ if (heap_allocated_pages > heap_pages_sorted_length) {
+ rb_bug("heap_page_allocate: allocated(%"PRIdSIZE") > sorted(%"PRIdSIZE")",
+ heap_allocated_pages, heap_pages_sorted_length);
+ }
/* adjust obj_limit (object number available in this page) */
start = (RVALUE*)((VALUE)page_body + sizeof(struct heap_page_header));
if ((VALUE)start % sizeof(RVALUE) != 0) {
int delta = (int)(sizeof(RVALUE) - ((VALUE)start % sizeof(RVALUE)));
start = (RVALUE*)((VALUE)start + delta);
- limit = (HEAP_SIZE - (size_t)((VALUE)start - (VALUE)page_body))/sizeof(RVALUE);
+ limit = (HEAP_SIZE - (int)((VALUE)start - (VALUE)page_body))/(int)sizeof(RVALUE);
}
end = start + limit;
@@ -1081,13 +1513,14 @@ heap_page_allocate(rb_objspace_t *objspace)
if (heap_pages_himem < end) heap_pages_himem = end;
page->start = start;
- page->limit = limit;
+ page->total_slots = limit;
page_body->header.page = page;
for (p = start; p != end; p++) {
- rgengc_report(3, objspace, "assign_heap_page: %p is added to freelist\n");
+ gc_report(3, objspace, "assign_heap_page: %p is added to freelist\n", p);
heap_page_add_freeobj(objspace, page, (VALUE)p);
}
+ page->free_slots = limit;
return page;
}
@@ -1095,12 +1528,16 @@ heap_page_allocate(rb_objspace_t *objspace)
static struct heap_page *
heap_page_resurrect(rb_objspace_t *objspace)
{
- struct heap_page *page;
+ struct heap_page *page = heap_tomb->pages;
- if ((page = heap_tomb->pages) != NULL) {
- heap_unlink_page(objspace, heap_tomb, page);
- return page;
+ while (page) {
+ if (page->freelist != NULL) {
+ heap_unlink_page(objspace, heap_tomb, page);
+ return page;
+ }
+ page = page->next;
}
+
return NULL;
}
@@ -1113,8 +1550,8 @@ heap_page_create(rb_objspace_t *objspace)
page = heap_page_allocate(objspace);
method = "allocate";
}
- if (0) fprintf(stderr, "heap_page_create: %s - %p, heap_pages_used: %d, heap_pages_used: %d, tomb->page_length: %d\n",
- method, page, (int)heap_pages_length, (int)heap_pages_used, (int)heap_tomb->page_length);
+ if (0) fprintf(stderr, "heap_page_create: %s - %p, heap_allocated_pages: %d, heap_allocated_pages: %d, tomb->page_length: %d\n",
+ method, page, (int)heap_pages_sorted_length, (int)heap_allocated_pages, (int)heap_tomb->page_length);
return page;
}
@@ -1126,7 +1563,7 @@ heap_add_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *page)
if (heap->pages) heap->pages->prev = page;
heap->pages = page;
heap->page_length++;
- heap->total_slots += page->limit;
+ heap->total_slots += page->total_slots;
}
static void
@@ -1142,80 +1579,76 @@ heap_add_pages(rb_objspace_t *objspace, rb_heap_t *heap, size_t add)
{
size_t i;
- heap_pages_increment = add;
+ heap_allocatable_pages = add;
heap_pages_expand_sorted(objspace);
for (i = 0; i < add; i++) {
heap_assign_page(objspace, heap);
}
- heap_pages_increment = 0;
+ heap_allocatable_pages = 0;
}
-static void
-heap_set_increment(rb_objspace_t *objspace, size_t minimum_limit)
+static size_t
+heap_extend_pages(rb_objspace_t *objspace)
{
- size_t used = heap_pages_used - heap_tomb->page_length;
+ size_t used = heap_allocated_pages - heap_tomb->page_length;
size_t next_used_limit = (size_t)(used * gc_params.growth_factor);
+
if (gc_params.growth_max_slots > 0) {
size_t max_used_limit = (size_t)(used + gc_params.growth_max_slots/HEAP_OBJ_LIMIT);
if (next_used_limit > max_used_limit) next_used_limit = max_used_limit;
}
- if (next_used_limit == heap_pages_used) next_used_limit++;
- if (next_used_limit < minimum_limit) {
- next_used_limit = minimum_limit;
- }
+ return next_used_limit - used;
+}
- heap_pages_increment = next_used_limit - used;
+static void
+heap_set_increment(rb_objspace_t *objspace, size_t additional_pages)
+{
+ size_t used = heap_eden->page_length;
+ size_t next_used_limit = used + additional_pages;
+
+ if (next_used_limit == heap_allocated_pages) next_used_limit++;
+
+ heap_allocatable_pages = next_used_limit - used;
heap_pages_expand_sorted(objspace);
- if (0) fprintf(stderr, "heap_set_increment: heap_pages_length: %d, heap_pages_used: %d, heap_pages_increment: %d, next_used_limit: %d\n",
- (int)heap_pages_length, (int)heap_pages_used, (int)heap_pages_increment, (int)next_used_limit);
+ gc_report(1, objspace, "heap_set_increment: heap_allocatable_pages is %d\n", (int)heap_allocatable_pages);
}
static int
heap_increment(rb_objspace_t *objspace, rb_heap_t *heap)
{
- rgengc_report(5, objspace, "heap_increment: heap_pages_length: %d, heap_pages_inc: %d, heap->page_length: %d\n",
- (int)heap_pages_length, (int)heap_pages_increment, (int)heap->page_length);
-
- if (heap_pages_increment > 0) {
- heap_pages_increment--;
+ if (heap_allocatable_pages > 0) {
+ gc_report(1, objspace, "heap_increment: heap_pages_sorted_length: %d, heap_pages_inc: %d, heap->page_length: %d\n",
+ (int)heap_pages_sorted_length, (int)heap_allocatable_pages, (int)heap->page_length);
+ heap_allocatable_pages--;
heap_assign_page(objspace, heap);
return TRUE;
}
return FALSE;
}
-static struct heap_page *
-heap_prepare_freepage(rb_objspace_t *objspace, rb_heap_t *heap)
+static void
+heap_prepare(rb_objspace_t *objspace, rb_heap_t *heap)
{
- if (!GC_ENABLE_LAZY_SWEEP && objspace->flags.dont_lazy_sweep) {
- if (heap_increment(objspace, heap) == 0 &&
- garbage_collect(objspace, FALSE, TRUE, GPR_FLAG_NEWOBJ) == 0) {
- goto err;
- }
- goto ok;
- }
+ if (RGENGC_CHECK_MODE) assert(heap->free_pages == NULL);
- if (!heap_ready_to_gc(objspace, heap)) return heap->free_pages;
-
- during_gc++;
-
- if ((is_lazy_sweeping(heap) && gc_heap_lazy_sweep(objspace, heap)) || heap_increment(objspace, heap)) {
- goto ok;
+#if GC_ENABLE_LAZY_SWEEP
+ if (is_lazy_sweeping(heap)) {
+ gc_sweep_continue(objspace, heap);
+ }
+#endif
+#if GC_ENABLE_INCREMENTAL_MARK
+ else if (is_incremental_marking(objspace)) {
+ gc_marks_continue(objspace, heap);
}
-
-#if GC_PROFILE_MORE_DETAIL
- objspace->profile.prepare_time = 0;
#endif
- if (garbage_collect_body(objspace, 0, 0, GPR_FLAG_NEWOBJ) == 0) {
- err:
- during_gc = 0;
+
+ if (heap->free_pages == NULL &&
+ (will_be_incremental_marking(objspace) || heap_increment(objspace, heap) == FALSE) &&
+ gc_start(objspace, FALSE, FALSE, FALSE, GPR_FLAG_NEWOBJ) == FALSE) {
rb_memerror();
}
- ok:
- during_gc = 0;
- return heap->free_pages;
}
static RVALUE *
@@ -1224,26 +1657,37 @@ heap_get_freeobj_from_next_freepage(rb_objspace_t *objspace, rb_heap_t *heap)
struct heap_page *page;
RVALUE *p;
- page = heap->free_pages;
- while (page == NULL) {
- page = heap_prepare_freepage(objspace, heap);
+ while (heap->free_pages == NULL) {
+ heap_prepare(objspace, heap);
}
+ page = heap->free_pages;
heap->free_pages = page->free_next;
heap->using_page = page;
+ if (RGENGC_CHECK_MODE) assert(page->free_slots != 0);
p = page->freelist;
page->freelist = NULL;
-
+ page->free_slots = 0;
return p;
}
static inline VALUE
+heap_get_freeobj_head(rb_objspace_t *objspace, rb_heap_t *heap)
+{
+ RVALUE *p = heap->freelist;
+ if (LIKELY(p != NULL)) {
+ heap->freelist = p->as.free.next;
+ }
+ return (VALUE)p;
+}
+
+static inline VALUE
heap_get_freeobj(rb_objspace_t *objspace, rb_heap_t *heap)
{
RVALUE *p = heap->freelist;
while (1) {
- if (p) {
+ if (LIKELY(p != NULL)) {
heap->freelist = p->as.free.next;
return (VALUE)p;
}
@@ -1258,128 +1702,281 @@ rb_objspace_set_event_hook(const rb_event_flag_t event)
{
rb_objspace_t *objspace = &rb_objspace;
objspace->hook_events = event & RUBY_INTERNAL_EVENT_OBJSPACE_MASK;
+ objspace->flags.has_hook = (objspace->hook_events != 0);
}
static void
-gc_event_hook_body(rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
+gc_event_hook_body(rb_thread_t *th, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
{
- rb_thread_t *th = GET_THREAD();
EXEC_EVENT_HOOK(th, event, th->cfp->self, 0, 0, data);
}
+#define gc_event_hook_available_p(objspace) ((objspace)->flags.has_hook)
+#define gc_event_hook_needed_p(objspace, event) ((objspace)->hook_events & (event))
+
#define gc_event_hook(objspace, event, data) do { \
- if (UNLIKELY((objspace)->hook_events & (event))) { \
- gc_event_hook_body((objspace), (event), (data)); \
+ if (UNLIKELY(gc_event_hook_needed_p(objspace, event))) { \
+ gc_event_hook_body(GET_THREAD(), (objspace), (event), (data)); \
} \
} while (0)
-static VALUE
-newobj_of(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3)
+static inline VALUE
+newobj_init(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_protected, rb_objspace_t *objspace, VALUE obj)
{
- rb_objspace_t *objspace = &rb_objspace;
- VALUE obj;
-
- if (UNLIKELY(during_gc)) {
- dont_gc = 1;
- during_gc = 0;
- rb_bug("object allocation during garbage collection phase");
- }
-
- if (UNLIKELY(ruby_gc_stress && !ruby_disable_gc_stress)) {
- if (!garbage_collect(objspace, FALSE, FALSE, GPR_FLAG_NEWOBJ)) {
- during_gc = 0;
- rb_memerror();
- }
+ if (RGENGC_CHECK_MODE > 0) {
+ assert(BUILTIN_TYPE(obj) == T_NONE);
+ assert((flags & FL_WB_PROTECTED) == 0);
}
- obj = heap_get_freeobj(objspace, heap_eden);
-
/* OBJSETUP */
RBASIC(obj)->flags = flags;
RBASIC_SET_CLASS_RAW(obj, klass);
- if (rb_safe_level() >= 3) FL_SET((obj), FL_TAINT);
RANY(obj)->as.values.v1 = v1;
RANY(obj)->as.values.v2 = v2;
RANY(obj)->as.values.v3 = v3;
-#if GC_DEBUG
- RANY(obj)->file = rb_sourcefile();
- RANY(obj)->line = rb_sourceline();
- assert(!SPECIAL_CONST_P(obj)); /* check alignment */
+#if RGENGC_CHECK_MODE
+ assert(RVALUE_MARKED(obj) == FALSE);
+ assert(RVALUE_MARKING(obj) == FALSE);
+ assert(RVALUE_OLD_P(obj) == FALSE);
+ assert(RVALUE_WB_UNPROTECTED(obj) == FALSE);
+
+ if (flags & FL_PROMOTED1) {
+ if (RVALUE_AGE(obj) != 2) rb_bug("newobj: %s of age (%d) != 2.", obj_info(obj), RVALUE_AGE(obj));
+ }
+ else {
+ if (RVALUE_AGE(obj) > 0) rb_bug("newobj: %s of age (%d) > 0.", obj_info(obj), RVALUE_AGE(obj));
+ }
+ if (rgengc_remembered(objspace, (VALUE)obj)) rb_bug("newobj: %s is remembered.", obj_info(obj));
+#endif
+
+#if USE_RGENGC
+ if (UNLIKELY(wb_protected == FALSE)) {
+ MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
+ }
#endif
#if RGENGC_PROFILE
- if (flags & FL_WB_PROTECTED) {
- objspace->profile.generated_normal_object_count++;
+ if (wb_protected) {
+ objspace->profile.total_generated_normal_object_count++;
#if RGENGC_PROFILE >= 2
objspace->profile.generated_normal_object_count_types[BUILTIN_TYPE(obj)]++;
#endif
}
else {
- objspace->profile.generated_shady_object_count++;
+ objspace->profile.total_generated_shady_object_count++;
#if RGENGC_PROFILE >= 2
objspace->profile.generated_shady_object_count_types[BUILTIN_TYPE(obj)]++;
#endif
}
#endif
- rgengc_report(5, objspace, "newobj: %p (%s)\n", (void *)obj, obj_type_name(obj));
+#if GC_DEBUG
+ RANY(obj)->file = rb_source_loc(&RANY(obj)->line);
+ assert(!SPECIAL_CONST_P(obj)); /* check alignment */
+#endif
+
+ objspace->total_allocated_objects++;
-#if USE_RGENGC && RGENGC_CHECK_MODE
- if (RVALUE_PROMOTED_P(obj)) rb_bug("newobj: %p (%s) is promoted.\n", (void *)obj, obj_type_name(obj));
- if (rgengc_remembered(objspace, (VALUE)obj)) rb_bug("newobj: %p (%s) is remembered.\n", (void *)obj, obj_type_name(obj));
+ gc_report(5, objspace, "newobj: %s\n", obj_info(obj));
+
+#if RGENGC_OLD_NEWOBJ_CHECK > 0
+ {
+ static int newobj_cnt = RGENGC_OLD_NEWOBJ_CHECK;
+
+ if (!is_incremental_marking(objspace) &&
+ flags & FL_WB_PROTECTED && /* do not promote WB unprotected objects */
+ ! RB_TYPE_P(obj, T_ARRAY)) { /* array.c assumes that allocated objects are new */
+ if (--newobj_cnt == 0) {
+ newobj_cnt = RGENGC_OLD_NEWOBJ_CHECK;
+
+ gc_mark_set(objspace, obj);
+ RVALUE_AGE_SET_OLD(objspace, obj);
+
+ rb_gc_writebarrier_remember(obj);
+ }
+ }
+ }
#endif
+ check_rvalue_consistency(obj);
+ return obj;
+}
- objspace->profile.total_allocated_object_num++;
- gc_event_hook(objspace, RUBY_INTERNAL_EVENT_NEWOBJ, obj);
+static inline VALUE
+newobj_slowpath(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, rb_objspace_t *objspace, int wb_protected)
+{
+ VALUE obj;
+
+ if (UNLIKELY(during_gc || ruby_gc_stressful)) {
+ if (during_gc) {
+ dont_gc = 1;
+ during_gc = 0;
+ rb_bug("object allocation during garbage collection phase");
+ }
+
+ if (ruby_gc_stressful) {
+ if (!garbage_collect(objspace, FALSE, FALSE, FALSE, GPR_FLAG_NEWOBJ)) {
+ rb_memerror();
+ }
+ }
+ }
+ obj = heap_get_freeobj(objspace, heap_eden);
+ newobj_init(klass, flags, v1, v2, v3, wb_protected, objspace, obj);
+ gc_event_hook(objspace, RUBY_INTERNAL_EVENT_NEWOBJ, obj);
return obj;
}
+NOINLINE(static VALUE newobj_slowpath_wb_protected(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, rb_objspace_t *objspace));
+NOINLINE(static VALUE newobj_slowpath_wb_unprotected(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, rb_objspace_t *objspace));
+
+static VALUE
+newobj_slowpath_wb_protected(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, rb_objspace_t *objspace)
+{
+ return newobj_slowpath(klass, flags, v1, v2, v3, objspace, TRUE);
+}
+
+static VALUE
+newobj_slowpath_wb_unprotected(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, rb_objspace_t *objspace)
+{
+ return newobj_slowpath(klass, flags, v1, v2, v3, objspace, FALSE);
+}
+
+static inline VALUE
+newobj_of(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_protected)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ VALUE obj;
+
+#if GC_DEBUG_STRESS_TO_CLASS
+ if (UNLIKELY(stress_to_class)) {
+ long i, cnt = RARRAY_LEN(stress_to_class);
+ const VALUE *ptr = RARRAY_CONST_PTR(stress_to_class);
+ for (i = 0; i < cnt; ++i) {
+ if (klass == ptr[i]) rb_memerror();
+ }
+ }
+#endif
+ if (!(during_gc ||
+ ruby_gc_stressful ||
+ gc_event_hook_available_p(objspace)) &&
+ (obj = heap_get_freeobj_head(objspace, heap_eden)) != Qfalse) {
+ return newobj_init(klass, flags, v1, v2, v3, wb_protected, objspace, obj);
+ }
+ else {
+ return wb_protected ?
+ newobj_slowpath_wb_protected(klass, flags, v1, v2, v3, objspace) :
+ newobj_slowpath_wb_unprotected(klass, flags, v1, v2, v3, objspace);
+ }
+}
+
+VALUE
+rb_wb_unprotected_newobj_of(VALUE klass, VALUE flags)
+{
+ if (RGENGC_CHECK_MODE > 0) assert((flags & FL_WB_PROTECTED) == 0);
+ return newobj_of(klass, flags, 0, 0, 0, FALSE);
+}
+
+VALUE
+rb_wb_protected_newobj_of(VALUE klass, VALUE flags)
+{
+ if (RGENGC_CHECK_MODE > 0) assert((flags & FL_WB_PROTECTED) == 0);
+ return newobj_of(klass, flags, 0, 0, 0, TRUE);
+}
+
+/* for compatibility */
+
VALUE
rb_newobj(void)
{
- return newobj_of(0, T_NONE, 0, 0, 0);
+ return newobj_of(0, T_NONE, 0, 0, 0, FALSE);
}
VALUE
rb_newobj_of(VALUE klass, VALUE flags)
{
- return newobj_of(klass, flags, 0, 0, 0);
+ return newobj_of(klass, flags & ~FL_WB_PROTECTED, 0, 0, 0, flags & FL_WB_PROTECTED);
}
NODE*
rb_node_newnode(enum node_type type, VALUE a0, VALUE a1, VALUE a2)
{
- VALUE flags = (RGENGC_WB_PROTECTED_NODE_CREF && type == NODE_CREF ? FL_WB_PROTECTED : 0);
- NODE *n = (NODE *)newobj_of(0, T_NODE | flags, a0, a1, a2);
+ NODE *n = (NODE *)newobj_of(0, T_NODE, a0, a1, a2, FALSE); /* TODO: node also should be wb protected */
nd_set_type(n, type);
return n;
}
+#undef rb_imemo_new
+
+VALUE
+rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
+{
+ VALUE flags = T_IMEMO | (type << FL_USHIFT);
+ return newobj_of(v0, flags, v1, v2, v3, TRUE);
+}
+
+#if IMEMO_DEBUG
VALUE
-rb_data_object_alloc(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
+rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, const char *file, int line)
+{
+ VALUE memo = rb_imemo_new(type, v1, v2, v3, v0);
+ fprintf(stderr, "memo %p (type: %d) @ %s:%d\n", memo, imemo_type(memo), file, line);
+ return memo;
+}
+#endif
+
+VALUE
+rb_data_object_wrap(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
{
if (klass) Check_Type(klass, T_CLASS);
- return newobj_of(klass, T_DATA, (VALUE)dmark, (VALUE)dfree, (VALUE)datap);
+ return newobj_of(klass, T_DATA, (VALUE)dmark, (VALUE)dfree, (VALUE)datap, FALSE);
}
+#undef rb_data_object_alloc
+RUBY_ALIAS_FUNCTION(rb_data_object_alloc(VALUE klass, void *datap,
+ RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree),
+ rb_data_object_wrap, (klass, datap, dmark, dfree))
+
+
VALUE
-rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *type)
+rb_data_object_zalloc(VALUE klass, size_t size, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
+{
+ VALUE obj = rb_data_object_wrap(klass, 0, dmark, dfree);
+ DATA_PTR(obj) = xcalloc(1, size);
+ return obj;
+}
+
+VALUE
+rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *type)
{
if (klass) Check_Type(klass, T_CLASS);
- return newobj_of(klass, T_DATA | (type->flags & ~T_MASK), (VALUE)type, (VALUE)1, (VALUE)datap);
+ return newobj_of(klass, T_DATA, (VALUE)type, (VALUE)1, (VALUE)datap, type->flags & RUBY_FL_WB_PROTECTED);
+}
+
+#undef rb_data_typed_object_alloc
+RUBY_ALIAS_FUNCTION(rb_data_typed_object_alloc(VALUE klass, void *datap,
+ const rb_data_type_t *type),
+ rb_data_typed_object_wrap, (klass, datap, type))
+
+VALUE
+rb_data_typed_object_zalloc(VALUE klass, size_t size, const rb_data_type_t *type)
+{
+ VALUE obj = rb_data_typed_object_wrap(klass, 0, type);
+ DATA_PTR(obj) = xcalloc(1, size);
+ return obj;
}
size_t
rb_objspace_data_type_memsize(VALUE obj)
{
- if (RTYPEDDATA_P(obj) && RTYPEDDATA_TYPE(obj)->function.dsize) {
- return RTYPEDDATA_TYPE(obj)->function.dsize(RTYPEDDATA_DATA(obj));
- }
- else {
- return 0;
+ if (RTYPEDDATA_P(obj)) {
+ const rb_data_type_t *type = RTYPEDDATA_TYPE(obj);
+ const void *ptr = RTYPEDDATA_DATA(obj);
+ if (ptr && type->function.dsize) {
+ return type->function.dsize(ptr);
+ }
}
+ return 0;
}
const char *
@@ -1405,12 +2002,12 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
/* check if p looks like a pointer using bsearch*/
lo = 0;
- hi = heap_pages_used;
+ hi = heap_allocated_pages;
while (lo < hi) {
mid = (lo + hi) / 2;
page = heap_pages_sorted[mid];
if (page->start <= p) {
- if (p < page->start + page->limit) {
+ if (p < page->start + page->total_slots) {
return TRUE;
}
lo = mid + 1;
@@ -1423,33 +2020,9 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
}
static int
-free_method_entry_i(ID key, rb_method_entry_t *me, st_data_t data)
-{
- if (!me->mark) {
- rb_free_method_entry(me);
- }
- return ST_CONTINUE;
-}
-
-void
-rb_free_m_tbl(st_table *tbl)
-{
- st_foreach(tbl, free_method_entry_i, 0);
- st_free_table(tbl);
-}
-
-void
-rb_free_m_tbl_wrapper(struct method_table_wrapper *wrapper)
-{
- if (wrapper->tbl) {
- rb_free_m_tbl(wrapper->tbl);
- }
- xfree(wrapper);
-}
-
-static int
-free_const_entry_i(ID key, rb_const_entry_t *ce, st_data_t data)
+free_const_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
+ rb_const_entry_t *ce = (rb_const_entry_t *)value;
xfree(ce);
return ST_CONTINUE;
}
@@ -1462,20 +2035,21 @@ rb_free_const_table(st_table *tbl)
}
static inline void
-make_deferred(rb_objspace_t *objspace,RVALUE *p)
+make_zombie(rb_objspace_t *objspace, VALUE obj, void (*dfree)(void *), void *data)
{
- p->as.basic.flags = T_ZOMBIE;
- p->as.free.next = heap_pages_deferred_final;
- heap_pages_deferred_final = p;
+ struct RZombie *zombie = RZOMBIE(obj);
+ zombie->basic.flags = T_ZOMBIE;
+ zombie->dfree = dfree;
+ zombie->data = data;
+ zombie->next = heap_pages_deferred_final;
+ heap_pages_deferred_final = (VALUE)zombie;
}
static inline void
-make_io_deferred(rb_objspace_t *objspace,RVALUE *p)
+make_io_zombie(rb_objspace_t *objspace, VALUE obj)
{
- rb_io_t *fptr = p->as.file.fptr;
- make_deferred(objspace, p);
- p->as.data.dfree = (void (*)(void*))rb_io_fptr_finalize;
- p->as.data.data = fptr;
+ rb_io_t *fptr = RANY(obj)->as.file.fptr;
+ make_zombie(objspace, obj, (void (*)(void*))rb_io_fptr_finalize, fptr);
}
static int
@@ -1498,8 +2072,16 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
}
#if USE_RGENGC
- if (MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj),obj))
- CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj),obj);
+ if (RVALUE_WB_UNPROTECTED(obj)) CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
+
+#if RGENGC_CHECK_MODE
+#define CHECK(x) if (x(obj) != FALSE) rb_bug("obj_free: " #x "(%s) != FALSE", obj_info(obj))
+ CHECK(RVALUE_WB_UNPROTECTED);
+ CHECK(RVALUE_MARKED);
+ CHECK(RVALUE_MARKING);
+ CHECK(RVALUE_UNCOLLECTIBLE);
+#undef CHECK
+#endif
#endif
switch (BUILTIN_TYPE(obj)) {
@@ -1511,9 +2093,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
break;
case T_MODULE:
case T_CLASS:
- if (RCLASS_M_TBL_WRAPPER(obj)) {
- rb_free_m_tbl_wrapper(RCLASS_M_TBL_WRAPPER(obj));
- }
+ rb_id_table_free(RCLASS_M_TBL(obj));
if (RCLASS_IV_TBL(obj)) {
st_free_table(RCLASS_IV_TBL(obj));
}
@@ -1557,22 +2137,30 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
case T_DATA:
if (DATA_PTR(obj)) {
int free_immediately = FALSE;
+ void (*dfree)(void *);
+ void *data = DATA_PTR(obj);
if (RTYPEDDATA_P(obj)) {
free_immediately = (RANY(obj)->as.typeddata.type->flags & RUBY_TYPED_FREE_IMMEDIATELY) != 0;
- RDATA(obj)->dfree = RANY(obj)->as.typeddata.type->function.dfree;
- if (0 && free_immediately == 0) /* to expose non-free-immediate T_DATA */
+ dfree = RANY(obj)->as.typeddata.type->function.dfree;
+ if (0 && free_immediately == 0) {
+ /* to expose non-free-immediate T_DATA */
fprintf(stderr, "not immediate -> %s\n", RANY(obj)->as.typeddata.type->wrap_struct_name);
+ }
}
- if (RANY(obj)->as.data.dfree == RUBY_DEFAULT_FREE) {
- xfree(DATA_PTR(obj));
+ else {
+ dfree = RANY(obj)->as.data.dfree;
}
- else if (RANY(obj)->as.data.dfree) {
- if (free_immediately) {
- (RDATA(obj)->dfree)(DATA_PTR(obj));
+
+ if (dfree) {
+ if (dfree == RUBY_DEFAULT_FREE) {
+ xfree(data);
+ }
+ else if (free_immediately) {
+ (*dfree)(data);
}
else {
- make_deferred(objspace, RANY(obj));
+ make_zombie(objspace, obj, dfree, data);
return 1;
}
}
@@ -1589,7 +2177,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
break;
case T_FILE:
if (RANY(obj)->as.file.fptr) {
- make_io_deferred(objspace, RANY(obj));
+ make_io_zombie(objspace, obj);
return 1;
}
break;
@@ -1597,7 +2185,13 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
case T_COMPLEX:
break;
case T_ICLASS:
- /* iClass shares table with the module */
+ /* Basically , T_ICLASS shares table with the module */
+ if (FL_TEST(obj, RICLASS_IS_ORIGIN)) {
+ rb_id_table_free(RCLASS_M_TBL(obj));
+ }
+ if (RCLASS_CALLABLE_M_TBL(obj) != NULL) {
+ rb_id_table_free(RCLASS_CALLABLE_M_TBL(obj));
+ }
if (RCLASS_EXT(obj)->subclasses) {
rb_class_detach_subclasses(obj);
RCLASS_EXT(obj)->subclasses = NULL;
@@ -1612,26 +2206,13 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
break;
case T_BIGNUM:
- if (!(RBASIC(obj)->flags & RBIGNUM_EMBED_FLAG) && RBIGNUM_DIGITS(obj)) {
- xfree(RBIGNUM_DIGITS(obj));
+ if (!(RBASIC(obj)->flags & BIGNUM_EMBED_FLAG) && BIGNUM_DIGITS(obj)) {
+ xfree(BIGNUM_DIGITS(obj));
}
break;
+
case T_NODE:
- switch (nd_type(obj)) {
- case NODE_SCOPE:
- if (RANY(obj)->as.node.u1.tbl) {
- 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;
- }
+ rb_gc_free_node(obj);
break; /* no need to free iv_tbl */
case T_STRUCT:
@@ -1641,12 +2222,39 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
}
break;
+ case T_SYMBOL:
+ {
+ rb_gc_free_dsymbol(obj);
+ }
+ break;
+
+ case T_IMEMO:
+ {
+ switch (imemo_type(obj)) {
+ case imemo_ment:
+ rb_free_method_entry(&RANY(obj)->as.imemo.ment);
+ break;
+ case imemo_iseq:
+ rb_iseq_free(&RANY(obj)->as.imemo.iseq);
+ break;
+ default:
+ break;
+ }
+ }
+ return 0;
+
default:
rb_bug("gc_sweep(): unknown data type 0x%x(%p) 0x%"PRIxVALUE,
BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags);
}
- return 0;
+ if (FL_TEST(obj, FL_FINALIZE)) {
+ make_zombie(objspace, obj, 0, 0);
+ return 1;
+ }
+ else {
+ return 0;
+ }
}
void
@@ -1654,12 +2262,13 @@ Init_heap(void)
{
rb_objspace_t *objspace = &rb_objspace;
+ gc_stress_set(objspace, ruby_initial_gc_stress);
+
#if RGENGC_ESTIMATE_OLDMALLOC
objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_min;
#endif
heap_add_pages(objspace, heap_eden, gc_params.heap_init_slots / HEAP_OBJ_LIMIT);
-
init_mark_stack(&objspace->mark_stack);
#ifdef USE_SIGALTSTACK
@@ -1694,16 +2303,16 @@ objspace_each_objects(VALUE arg)
struct each_obj_args *args = (struct each_obj_args *)arg;
i = 0;
- while (i < heap_pages_used) {
+ while (i < heap_allocated_pages) {
while (0 < i && last_body < heap_pages_sorted[i-1]->body) i--;
- while (i < heap_pages_used && heap_pages_sorted[i]->body <= last_body) i++;
- if (heap_pages_used <= i) break;
+ while (i < heap_allocated_pages && heap_pages_sorted[i]->body <= last_body) i++;
+ if (heap_allocated_pages <= i) break;
page = heap_pages_sorted[i];
last_body = page->body;
pstart = page->start;
- pend = pstart + page->limit;
+ pend = pstart + page->total_slots;
if ((*args->callback)(pstart, pend, sizeof(RVALUE), args->data)) {
break;
@@ -1713,6 +2322,15 @@ objspace_each_objects(VALUE arg)
return Qnil;
}
+static VALUE
+incremental_enable(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ objspace->flags.dont_incremental = FALSE;
+ return Qnil;
+}
+
/*
* rb_objspace_each_objects() is special C API to walk through
* Ruby object space. This C API is too difficult to use it.
@@ -1754,22 +2372,32 @@ rb_objspace_each_objects(each_obj_callback *callback, void *data)
{
struct each_obj_args args;
rb_objspace_t *objspace = &rb_objspace;
- int prev_dont_lazy_sweep = objspace->flags.dont_lazy_sweep;
+ int prev_dont_incremental = objspace->flags.dont_incremental;
- gc_rest_sweep(objspace);
- objspace->flags.dont_lazy_sweep = TRUE;
+ gc_rest(objspace);
+ objspace->flags.dont_incremental = TRUE;
args.callback = callback;
args.data = data;
- if (prev_dont_lazy_sweep) {
+ if (prev_dont_incremental) {
objspace_each_objects((VALUE)&args);
}
else {
- rb_ensure(objspace_each_objects, (VALUE)&args, lazy_sweep_enable, Qnil);
+ rb_ensure(objspace_each_objects, (VALUE)&args, incremental_enable, Qnil);
}
}
+void
+rb_objspace_each_objects_without_setup(each_obj_callback *callback, void *data)
+{
+ struct each_obj_args args;
+ args.callback = callback;
+ args.data = data;
+
+ objspace_each_objects((VALUE)&args);
+}
+
struct os_each_struct {
size_t num;
VALUE of;
@@ -1783,13 +2411,17 @@ internal_object_p(VALUE obj)
if (p->as.basic.flags) {
switch (BUILTIN_TYPE(p)) {
case T_NONE:
+ case T_IMEMO:
case T_ICLASS:
case T_NODE:
case T_ZOMBIE:
break;
case T_CLASS:
- if (FL_TEST(p, FL_SINGLETON))
- break;
+ if (!p->as.basic.klass) break;
+ if (FL_TEST(obj, FL_SINGLETON)) {
+ return rb_singleton_class_internal_p(obj);
+ }
+ return 0;
default:
if (!p->as.basic.klass) break;
return 0;
@@ -1914,18 +2546,18 @@ static void
should_be_callable(VALUE block)
{
if (!rb_obj_respond_to(block, rb_intern("call"), TRUE)) {
- rb_raise(rb_eArgError, "wrong type argument %s (should be callable)",
- rb_obj_classname(block));
+ rb_raise(rb_eArgError, "wrong type argument %"PRIsVALUE" (should be callable)",
+ rb_obj_class(block));
}
}
static void
should_be_finalizable(VALUE obj)
{
- rb_check_frozen(obj);
if (!FL_ABLE(obj)) {
rb_raise(rb_eArgError, "cannot define finalizer for %s",
rb_obj_classname(obj));
}
+ rb_check_frozen(obj);
}
/*
@@ -1933,7 +2565,9 @@ should_be_finalizable(VALUE obj)
* ObjectSpace.define_finalizer(obj, aProc=proc())
*
* Adds <i>aProc</i> as a finalizer, to be called after <i>obj</i>
- * was destroyed.
+ * was destroyed. The object ID of the <i>obj</i> will be passed
+ * as an argument to <i>aProc</i>. If <i>aProc</i> is a lambda or
+ * method, make sure it can be called with a single argument.
*
*/
@@ -1968,6 +2602,20 @@ define_final0(VALUE obj, VALUE block)
if (st_lookup(finalizer_table, obj, &data)) {
table = (VALUE)data;
+
+ /* avoid duplicate block, table is usually small */
+ {
+ const VALUE *ptr = RARRAY_CONST_PTR(table);
+ long len = RARRAY_LEN(table);
+ long i;
+
+ for (i = 0; i < len; i++, ptr++) {
+ if (rb_funcall(*ptr, idEq, 1, block)) {
+ return *ptr;
+ }
+ }
+ }
+
rb_ary_push(table, block);
}
else {
@@ -2005,88 +2653,79 @@ static VALUE
run_single_final(VALUE arg)
{
VALUE *args = (VALUE *)arg;
- rb_eval_cmd(args[0], args[1], (int)args[2]);
- return Qnil;
+
+ return rb_check_funcall(args[0], idCall, 1, args+1);
}
static void
run_finalizer(rb_objspace_t *objspace, VALUE obj, VALUE table)
{
long i;
- int status;
- VALUE args[3];
- VALUE objid = nonspecial_obj_id(obj);
+ VALUE args[2];
+ const int safe = rb_safe_level();
+ const VALUE errinfo = rb_errinfo();
- if (RARRAY_LEN(table) > 0) {
- args[1] = rb_obj_freeze(rb_ary_new3(1, objid));
- }
- else {
- args[1] = 0;
- }
+ args[1] = nonspecial_obj_id(obj);
- args[2] = (VALUE)rb_safe_level();
for (i=0; i<RARRAY_LEN(table); i++) {
- VALUE final = RARRAY_AREF(table, i);
- args[0] = RARRAY_AREF(final, 1);
- args[2] = FIX2INT(RARRAY_AREF(final, 0));
- status = 0;
+ const VALUE final = RARRAY_AREF(table, i);
+ const VALUE cmd = RARRAY_AREF(final, 1);
+ const int level = OBJ_TAINTED(cmd) ?
+ RUBY_SAFE_LEVEL_MAX : FIX2INT(RARRAY_AREF(final, 0));
+ int status = 0;
+
+ args[0] = cmd;
+ rb_set_safe_level_force(level);
rb_protect(run_single_final, (VALUE)args, &status);
- if (status)
- rb_set_errinfo(Qnil);
+ rb_set_safe_level_force(safe);
+ rb_set_errinfo(errinfo);
}
}
static void
-run_final(rb_objspace_t *objspace, VALUE obj)
+run_final(rb_objspace_t *objspace, VALUE zombie)
{
- RUBY_DATA_FUNC free_func = 0;
st_data_t key, table;
- heap_pages_final_slots--;
-
- RBASIC_CLEAR_CLASS(obj);
-
- if (RTYPEDDATA_P(obj)) {
- free_func = RTYPEDDATA_TYPE(obj)->function.dfree;
- }
- else {
- free_func = RDATA(obj)->dfree;
- }
- if (free_func) {
- (*free_func)(DATA_PTR(obj));
+ if (RZOMBIE(zombie)->dfree) {
+ RZOMBIE(zombie)->dfree(RZOMBIE(zombie)->data);
}
- key = (st_data_t)obj;
+ key = (st_data_t)zombie;
if (st_delete(finalizer_table, &key, &table)) {
- run_finalizer(objspace, obj, (VALUE)table);
+ run_finalizer(objspace, zombie, (VALUE)table);
}
}
static void
-finalize_list(rb_objspace_t *objspace, RVALUE *p)
+finalize_list(rb_objspace_t *objspace, VALUE zombie)
{
- while (p) {
- RVALUE *tmp = p->as.free.next;
- struct heap_page *page = GET_HEAP_PAGE(p);
+ while (zombie) {
+ VALUE next_zombie = RZOMBIE(zombie)->next;
+ struct heap_page *page = GET_HEAP_PAGE(zombie);
- run_final(objspace, (VALUE)p);
- objspace->profile.total_freed_object_num++;
+ run_final(objspace, zombie);
+ RZOMBIE(zombie)->basic.flags = 0;
+ heap_pages_final_slots--;
page->final_slots--;
- heap_page_add_freeobj(objspace, GET_HEAP_PAGE(p), (VALUE)p);
+ page->free_slots++;
+ heap_page_add_freeobj(objspace, GET_HEAP_PAGE(zombie), zombie);
+
heap_pages_swept_slots++;
+ objspace->profile.total_freed_objects++;
- p = tmp;
+ zombie = next_zombie;
}
}
static void
finalize_deferred(rb_objspace_t *objspace)
{
- RVALUE *p;
+ VALUE zombie;
- while ((p = ATOMIC_PTR_EXCHANGE(heap_pages_deferred_final, 0)) != 0) {
- finalize_list(objspace, p);
+ while ((zombie = ATOMIC_VALUE_EXCHANGE(heap_pages_deferred_final, 0)) != 0) {
+ finalize_list(objspace, zombie);
}
}
@@ -2135,6 +2774,9 @@ force_chain_object(st_data_t key, st_data_t val, st_data_t arg)
void
rb_gc_call_finalizer_at_exit(void)
{
+#if RGENGC_CHECK_MODE >= 2
+ gc_verify_internal_consistency(Qnil);
+#endif
rb_objspace_call_finalizer(&rb_objspace);
}
@@ -2144,7 +2786,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
RVALUE *p, *pend;
size_t i;
- gc_rest_sweep(objspace);
+ gc_rest(objspace);
if (ATOMIC_EXCHANGE(finalizing, 1)) return;
@@ -2152,6 +2794,10 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
finalize_deferred(objspace);
assert(heap_pages_deferred_final == 0);
+ gc_rest(objspace);
+ /* prohibit incremental GC */
+ objspace->flags.dont_incremental = 1;
+
/* force to run finalizer */
while (finalizer_table->num_entries) {
struct force_finalize_list *list = 0;
@@ -2166,12 +2812,15 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
}
}
- /* finalizers are part of garbage collection */
- during_gc++;
+ /* prohibit GC because force T_DATA finalizers can break an object graph consistency */
+ dont_gc = 1;
- /* run data object's finalizers */
- for (i = 0; i < heap_pages_used; i++) {
- p = heap_pages_sorted[i]->start; pend = p + heap_pages_sorted[i]->limit;
+ /* running data/file finalizers are part of garbage collection */
+ gc_enter(objspace, "rb_objspace_call_finalizer");
+
+ /* run data/file object's finalizers */
+ for (i = 0; i < heap_allocated_pages; i++) {
+ p = heap_pages_sorted[i]->start; pend = p + heap_pages_sorted[i]->total_slots;
while (p < pend) {
switch (BUILTIN_TYPE(p)) {
case T_DATA:
@@ -2187,19 +2836,21 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
xfree(DATA_PTR(p));
}
else if (RANY(p)->as.data.dfree) {
- make_deferred(objspace, RANY(p));
+ make_zombie(objspace, (VALUE)p, RANY(p)->as.data.dfree, RANY(p)->as.data.data);
}
break;
case T_FILE:
if (RANY(p)->as.file.fptr) {
- make_io_deferred(objspace, RANY(p));
+ make_io_zombie(objspace, (VALUE)p);
}
break;
}
p++;
}
}
- during_gc = 0;
+
+ gc_exit(objspace, "rb_objspace_call_finalizer");
+
if (heap_pages_deferred_final) {
finalize_list(objspace, heap_pages_deferred_final);
}
@@ -2222,7 +2873,7 @@ static inline int
heap_is_swept_object(rb_objspace_t *objspace, rb_heap_t *heap, VALUE ptr)
{
struct heap_page *page = GET_HEAP_PAGE(ptr);
- return page->before_sweep ? FALSE : TRUE;
+ return page->flags.before_sweep ? FALSE : TRUE;
}
static inline int
@@ -2236,37 +2887,44 @@ is_swept_object(rb_objspace_t *objspace, VALUE ptr)
}
}
+/* garbage objects will be collected soon. */
static inline int
-is_dead_object(rb_objspace_t *objspace, VALUE ptr)
+is_garbage_object(rb_objspace_t *objspace, VALUE ptr)
{
- if (!is_lazy_sweeping(heap_eden) || MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(ptr), ptr)) return FALSE;
- if (!is_swept_object(objspace, ptr)) return TRUE;
- return FALSE;
+ if (!is_lazy_sweeping(heap_eden) ||
+ is_swept_object(objspace, ptr) ||
+ MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(ptr), ptr)) {
+
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
}
static inline int
is_live_object(rb_objspace_t *objspace, VALUE ptr)
{
switch (BUILTIN_TYPE(ptr)) {
- case 0: case T_ZOMBIE:
+ case T_NONE:
+ case T_ZOMBIE:
+ return FALSE;
+ }
+
+ if (!is_garbage_object(objspace, ptr)) {
+ return TRUE;
+ }
+ else {
return FALSE;
}
- if (is_dead_object(objspace, ptr)) return FALSE;
- return TRUE;
}
static inline int
is_markable_object(rb_objspace_t *objspace, VALUE obj)
{
- if (rb_special_const_p(obj)) return 0; /* special const is not markable */
-
- if (RGENGC_CHECK_MODE) {
- if (!is_pointer_to_heap(objspace, (void *)obj)) rb_bug("is_markable_object: %p is not pointer to heap", (void *)obj);
- if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("is_markable_object: %p is T_NONE", (void *)obj);
- if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("is_markable_object: %p is T_ZOMBIE", (void *)obj);
- }
-
- return 1;
+ if (rb_special_const_p(obj)) return FALSE; /* special const is not markable */
+ check_rvalue_consistency(obj);
+ return TRUE;
}
int
@@ -2276,6 +2934,13 @@ rb_objspace_markable_object_p(VALUE obj)
return is_markable_object(objspace, obj) && is_live_object(objspace, obj);
}
+int
+rb_objspace_garbage_object_p(VALUE obj)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ return is_garbage_object(objspace, obj);
+}
+
/*
* call-seq:
* ObjectSpace._id2ref(object_id) -> an_object
@@ -2313,7 +2978,7 @@ id2ref(VALUE obj, VALUE objid)
if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
ID symid = ptr / sizeof(RVALUE);
- if (rb_id2name(symid) == 0)
+ if (rb_id2str(symid) == 0)
rb_raise(rb_eRangeError, "%p is not symbol id value", p0);
return ID2SYM(symid);
}
@@ -2324,6 +2989,9 @@ id2ref(VALUE obj, VALUE objid)
if (!is_live_object(objspace, ptr)) {
rb_raise(rb_eRangeError, "%p is recycled object", p0);
}
+ if (RBASIC(ptr)->klass == 0) {
+ rb_raise(rb_eRangeError, "%p is internal object", p0);
+ }
return (VALUE)ptr;
}
@@ -2337,28 +3005,19 @@ id2ref(VALUE obj, VALUE objid)
*
* 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+.
+ * The same number will be returned on all calls to +object_id+ for a given
+ * object, and no two active objects will share an id.
*
- * Replaces the deprecated Object#id.
- */
-
-/*
- * call-seq:
- * obj.hash -> fixnum
+ * Note: that some objects of builtin classes are reused for optimization.
+ * This is the case for immediate values and frozen string literals.
*
- * Generates a Fixnum hash value for this object.
+ * Immediate values are not passed by reference but are passed by value:
+ * +nil+, +true+, +false+, Fixnums, Symbols, and some Floats.
*
- * 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.
+ * Object.new.object_id == Object.new.object_id # => false
+ * (21 * 2).object_id == (21 * 2).object_id # => true
+ * "hello".object_id == "hello".object_id # => false
+ * "hi".freeze.object_id == "hi".freeze.object_id # => true
*/
VALUE
@@ -2392,7 +3051,7 @@ rb_obj_id(VALUE obj)
* 24 if 32-bit, double is 8-byte aligned
* 40 if 64-bit
*/
- if (SYMBOL_P(obj)) {
+ if (STATIC_SYM_P(obj)) {
return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG;
}
else if (FLONUM_P(obj)) {
@@ -2408,14 +3067,10 @@ rb_obj_id(VALUE obj)
return nonspecial_obj_id(obj);
}
-size_t rb_str_memsize(VALUE);
-size_t rb_ary_memsize(VALUE);
-size_t rb_io_memsize(const rb_io_t *);
-size_t rb_generic_ivar_memsize(VALUE);
#include "regint.h"
static size_t
-obj_memsize_of(VALUE obj, int use_tdata)
+obj_memsize_of(VALUE obj, int use_all_types)
{
size_t size = 0;
@@ -2436,11 +3091,8 @@ obj_memsize_of(VALUE obj, int use_tdata)
break;
case T_MODULE:
case T_CLASS:
- if (RCLASS_M_TBL_WRAPPER(obj)) {
- size += sizeof(struct method_table_wrapper);
- }
if (RCLASS_M_TBL(obj)) {
- size += st_memsize(RCLASS_M_TBL(obj));
+ size += rb_id_table_memsize(RCLASS_M_TBL(obj));
}
if (RCLASS_EXT(obj)) {
if (RCLASS_IV_TBL(obj)) {
@@ -2458,6 +3110,13 @@ obj_memsize_of(VALUE obj, int use_tdata)
size += sizeof(rb_classext_t);
}
break;
+ case T_ICLASS:
+ if (FL_TEST(obj, RICLASS_IS_ORIGIN)) {
+ if (RCLASS_M_TBL(obj)) {
+ size += rb_id_table_memsize(RCLASS_M_TBL(obj));
+ }
+ }
+ break;
case T_STRING:
size += rb_str_memsize(obj);
break;
@@ -2475,7 +3134,7 @@ obj_memsize_of(VALUE obj, int use_tdata)
}
break;
case T_DATA:
- if (use_tdata) size += rb_objspace_data_type_memsize(obj);
+ if (use_all_types) size += rb_objspace_data_type_memsize(obj);
break;
case T_MATCH:
if (RMATCH(obj)->rmatch) {
@@ -2492,31 +3151,22 @@ obj_memsize_of(VALUE obj, int use_tdata)
break;
case T_RATIONAL:
case T_COMPLEX:
- break;
- case T_ICLASS:
- /* iClass shares table with the module */
+ case T_IMEMO:
break;
case T_FLOAT:
+ case T_SYMBOL:
break;
case T_BIGNUM:
- if (!(RBASIC(obj)->flags & RBIGNUM_EMBED_FLAG) && RBIGNUM_DIGITS(obj)) {
- size += RBIGNUM_LEN(obj) * sizeof(BDIGIT);
+ if (!(RBASIC(obj)->flags & BIGNUM_EMBED_FLAG) && BIGNUM_DIGITS(obj)) {
+ size += BIGNUM_LEN(obj) * sizeof(BDIGIT);
}
break;
+
case T_NODE:
- switch (nd_type(obj)) {
- case NODE_SCOPE:
- if (RNODE(obj)->u1.tbl) {
- /* TODO: xfree(RANY(obj)->as.node.u1.tbl); */
- }
- break;
- case NODE_ALLOCA:
- /* TODO: xfree(RANY(obj)->as.node.u1.node); */
- ;
- }
- break; /* no need to free iv_tbl */
+ if (use_all_types) size += rb_node_memsize(obj);
+ break;
case T_STRUCT:
if ((RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK) == 0 &&
@@ -2533,7 +3183,7 @@ obj_memsize_of(VALUE obj, int use_tdata)
BUILTIN_TYPE(obj), (void*)obj);
}
- return size;
+ return size + sizeof(RVALUE);
}
size_t
@@ -2555,7 +3205,7 @@ set_zero(st_data_t key, st_data_t val, st_data_t arg)
* call-seq:
* ObjectSpace.count_objects([result_hash]) -> hash
*
- * Counts objects for each type.
+ * Counts all objects grouped by type.
*
* It returns a hash, such as:
* {
@@ -2569,9 +3219,19 @@ set_zero(st_data_t key, st_data_t val, st_data_t arg)
* The contents of the returned hash are implementation specific.
* It may be changed in future.
*
+ * The keys starting with +:T_+ means live objects.
+ * For example, +:T_ARRAY+ is the number of arrays.
+ * +:FREE+ means object slots which is not used now.
+ * +:TOTAL+ means sum of above.
+ *
* If the optional argument +result_hash+ is given,
* it is overwritten and returned. This is intended to avoid probe effect.
*
+ * h = {}
+ * ObjectSpace.count_objects(h)
+ * puts h
+ * # => { :TOTAL=>10000, :T_CLASS=>158280, :T_MODULE=>20672, :T_STRING=>527249 }
+ *
* This method is only expected to work on C Ruby.
*
*/
@@ -2595,11 +3255,11 @@ count_objects(int argc, VALUE *argv, VALUE os)
counts[i] = 0;
}
- for (i = 0; i < heap_pages_used; i++) {
+ for (i = 0; i < heap_allocated_pages; i++) {
struct heap_page *page = heap_pages_sorted[i];
RVALUE *p, *pend;
- p = page->start; pend = p + page->limit;
+ p = page->start; pend = p + page->total_slots;
for (;p < pend; p++) {
if (p->as.basic.flags) {
counts[BUILTIN_TYPE(p)]++;
@@ -2608,7 +3268,7 @@ count_objects(int argc, VALUE *argv, VALUE os)
freed++;
}
}
- total += page->limit;
+ total += page->total_slots;
}
if (hash == Qnil) {
@@ -2645,6 +3305,7 @@ count_objects(int argc, VALUE *argv, VALUE os)
COUNT_TYPE(T_FALSE);
COUNT_TYPE(T_SYMBOL);
COUNT_TYPE(T_FIXNUM);
+ COUNT_TYPE(T_IMEMO);
COUNT_TYPE(T_UNDEF);
COUNT_TYPE(T_NODE);
COUNT_TYPE(T_ICLASS);
@@ -2665,31 +3326,22 @@ count_objects(int argc, VALUE *argv, VALUE os)
/* Sweeping */
-static VALUE
-lazy_sweep_enable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
-
- objspace->flags.dont_lazy_sweep = FALSE;
- return Qnil;
-}
-
static size_t
-objspace_live_slot(rb_objspace_t *objspace)
+objspace_available_slots(rb_objspace_t *objspace)
{
- return objspace->profile.total_allocated_object_num - objspace->profile.total_freed_object_num;
+ return heap_eden->total_slots + heap_tomb->total_slots;
}
static size_t
-objspace_total_slot(rb_objspace_t *objspace)
+objspace_live_slots(rb_objspace_t *objspace)
{
- return heap_eden->total_slots + heap_tomb->total_slots;
+ return (objspace->total_allocated_objects - objspace->profile.total_freed_objects) - heap_pages_final_slots;
}
static size_t
-objspace_free_slot(rb_objspace_t *objspace)
+objspace_free_slots(rb_objspace_t *objspace)
{
- return objspace_total_slot(objspace) - (objspace_live_slot(objspace) - heap_pages_final_slots);
+ return objspace_available_slots(objspace) - objspace_live_slots(objspace) - heap_pages_final_slots;
}
static void
@@ -2697,26 +3349,28 @@ gc_setup_mark_bits(struct heap_page *page)
{
#if USE_RGENGC
/* copy oldgen bitmap to mark bitmap */
- memcpy(&page->mark_bits[0], &page->oldgen_bits[0], HEAP_BITMAP_SIZE);
+ memcpy(&page->mark_bits[0], &page->uncollectible_bits[0], HEAP_BITMAP_SIZE);
#else
/* clear mark bitmap */
memset(&page->mark_bits[0], 0, HEAP_BITMAP_SIZE);
#endif
}
+/* TRUE : has empty slots */
+/* FALSE: no empty slots (or move to tomb heap because no live slots) */
static inline void
gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_page)
{
int i;
- size_t empty_slots = 0, freed_slots = 0, final_slots = 0;
+ int empty_slots = 0, freed_slots = 0, final_slots = 0;
RVALUE *p, *pend,*offset;
bits_t *bits, bitset;
- rgengc_report(1, objspace, "page_sweep: start.\n");
+ gc_report(2, objspace, "page_sweep: start.\n");
- sweep_page->before_sweep = 0;
+ sweep_page->flags.before_sweep = FALSE;
- p = sweep_page->start; pend = p + sweep_page->limit;
+ p = sweep_page->start; pend = p + sweep_page->total_slots;
offset = p - NUM_IN_PAGE(p);
bits = sweep_page->mark_bits;
@@ -2729,30 +3383,35 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
if (bitset) {
p = offset + i * BITS_BITLENGTH;
do {
- if ((bitset & 1) && BUILTIN_TYPE(p) != T_ZOMBIE) {
- if (p->as.basic.flags) {
- rgengc_report(3, objspace, "page_sweep: free %p (%s)\n", p, obj_type_name((VALUE)p));
+ if (bitset & 1) {
+ switch (BUILTIN_TYPE(p)) {
+ default: { /* majority case */
+ gc_report(2, objspace, "page_sweep: free %s\n", obj_info((VALUE)p));
#if USE_RGENGC && RGENGC_CHECK_MODE
- if (objspace->rgengc.during_minor_gc && RVALUE_OLD_P((VALUE)p)) rb_bug("page_sweep: %p (%s) is old while minor GC.\n", p, obj_type_name((VALUE)p));
- if (rgengc_remembered(objspace, (VALUE)p)) rb_bug("page_sweep: %p (%s) is remembered.\n", p, obj_type_name((VALUE)p));
-#endif
- if (obj_free(objspace, (VALUE)p)) {
- final_slots++;
- }
- else if (FL_TEST(p, FL_FINALIZE)) {
- RDATA(p)->dfree = 0;
- make_deferred(objspace,p);
- final_slots++;
- }
- else {
- (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)p, sizeof(RVALUE));
- heap_page_add_freeobj(objspace, sweep_page, (VALUE)p);
- rgengc_report(3, objspace, "page_sweep: %p (%s) is added to freelist\n", p, obj_type_name((VALUE)p));
- freed_slots++;
- }
- }
- else {
- empty_slots++;
+ if (!is_full_marking(objspace)) {
+ if (RVALUE_OLD_P((VALUE)p)) rb_bug("page_sweep: %s - old while minor GC.", obj_info((VALUE)p));
+ if (rgengc_remembered(objspace, (VALUE)p)) rb_bug("page_sweep: %s - remembered.", obj_info((VALUE)p));
+ }
+#endif
+ if (obj_free(objspace, (VALUE)p)) {
+ final_slots++;
+ }
+ else {
+ (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)p, sizeof(RVALUE));
+ heap_page_add_freeobj(objspace, sweep_page, (VALUE)p);
+ gc_report(3, objspace, "page_sweep: %s is added to freelist\n", obj_info((VALUE)p));
+ freed_slots++;
+ }
+ break;
+ }
+
+ /* minor cases */
+ case T_ZOMBIE:
+ /* already counted */
+ break;
+ case T_NONE:
+ empty_slots++; /* already freed */
+ break;
}
}
p++;
@@ -2770,29 +3429,15 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
record->empty_objects += empty_slots;
}
#endif
+ if (0) fprintf(stderr, "gc_page_sweep(%d): total_slots: %d, freed_slots: %d, empty_slots: %d, final_slots: %d\n",
+ (int)rb_gc_count(),
+ (int)sweep_page->total_slots,
+ freed_slots, empty_slots, final_slots);
- if (final_slots + freed_slots + empty_slots == sweep_page->limit) {
- /* there are no living objects -> move this page to tomb heap */
- heap_unlink_page(objspace, heap, sweep_page);
- heap_add_page(objspace, heap_tomb, sweep_page);
- }
- else {
- if (freed_slots + empty_slots > 0) {
- heap_add_freepage(objspace, heap, sweep_page);
- }
- else {
- sweep_page->free_next = NULL;
- }
- }
- heap_pages_swept_slots += freed_slots + empty_slots;
- objspace->profile.total_freed_object_num += freed_slots;
+ heap_pages_swept_slots += sweep_page->free_slots = freed_slots + empty_slots;
+ objspace->profile.total_freed_objects += freed_slots;
heap_pages_final_slots += final_slots;
- sweep_page->final_slots = final_slots;
-
- if (0) fprintf(stderr, "gc_page_sweep(%d): freed?: %d, limt: %d, freed_slots: %d, empty_slots: %d, final_slots: %d\n",
- (int)rb_gc_count(),
- final_slots + freed_slots + empty_slots == sweep_page->limit,
- (int)sweep_page->limit, (int)freed_slots, (int)empty_slots, (int)final_slots);
+ sweep_page->final_slots += final_slots;
if (heap_pages_deferred_final && !finalizing) {
rb_thread_t *th = GET_THREAD();
@@ -2801,29 +3446,45 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
}
}
- rgengc_report(1, objspace, "page_sweep: end.\n");
+ gc_report(2, objspace, "page_sweep: end.\n");
}
/* allocate additional minimum page to work */
static void
gc_heap_prepare_minimum_pages(rb_objspace_t *objspace, rb_heap_t *heap)
{
- if (!heap->free_pages) {
+ if (!heap->free_pages && heap_increment(objspace, heap) == FALSE) {
/* there is no free after page_sweep() */
- heap_set_increment(objspace, 0);
+ heap_set_increment(objspace, 1);
if (!heap_increment(objspace, heap)) { /* can't allocate additional free objects */
- during_gc = 0;
rb_memerror();
}
}
}
static void
-gc_before_heap_sweep(rb_objspace_t *objspace, rb_heap_t *heap)
+gc_stat_transition(rb_objspace_t *objspace, enum gc_stat stat)
+{
+#if RGENGC_CHECK_MODE
+ enum gc_stat prev_stat = objspace->flags.stat;
+ switch (prev_stat) {
+ case gc_stat_none: assert(stat == gc_stat_marking); break;
+ case gc_stat_marking: assert(stat == gc_stat_sweeping); break;
+ case gc_stat_sweeping: assert(stat == gc_stat_none); break;
+ }
+#endif
+ objspace->flags.stat = stat;
+}
+
+static void
+gc_sweep_start_heap(rb_objspace_t *objspace, rb_heap_t *heap)
{
heap->sweep_pages = heap->pages;
heap->free_pages = NULL;
-
+#if GC_ENABLE_INCREMENTAL_MARK
+ heap->pooled_pages = NULL;
+ objspace->rincgc.pooled_slots = 0;
+#endif
if (heap->using_page) {
RVALUE **p = &heap->using_page->freelist;
while (*p) {
@@ -2839,26 +3500,22 @@ gc_before_heap_sweep(rb_objspace_t *objspace, rb_heap_t *heap)
__attribute__((noinline))
#endif
static void
-gc_before_sweep(rb_objspace_t *objspace)
+gc_sweep_start(rb_objspace_t *objspace)
{
rb_heap_t *heap;
size_t total_limit_slot;
- rgengc_report(1, objspace, "gc_before_sweep\n");
-
- /* sweep unlinked method entries */
- if (GET_VM()->unlinked_method_entry_list) {
- rb_sweep_method_entry(GET_VM());
- }
+ gc_stat_transition(objspace, gc_stat_sweeping);
- heap_pages_swept_slots = 0;
- total_limit_slot = objspace_total_slot(objspace);
+ /* sometimes heap_allocatable_pages is not 0 */
+ heap_pages_swept_slots = heap_allocatable_pages * HEAP_OBJ_LIMIT;
+ total_limit_slot = objspace_available_slots(objspace);
- heap_pages_min_free_slots = (size_t)(total_limit_slot * 0.30);
+ heap_pages_min_free_slots = (size_t)(total_limit_slot * GC_HEAP_FREE_SLOTS_MIN_RATIO);
if (heap_pages_min_free_slots < gc_params.heap_free_slots) {
heap_pages_min_free_slots = gc_params.heap_free_slots;
}
- heap_pages_max_free_slots = (size_t)(total_limit_slot * 0.80);
+ heap_pages_max_free_slots = (size_t)(total_limit_slot * GC_HEAP_FREE_SLOTS_MAX_RATIO);
if (heap_pages_max_free_slots < gc_params.heap_init_slots) {
heap_pages_max_free_slots = gc_params.heap_init_slots;
}
@@ -2866,203 +3523,151 @@ gc_before_sweep(rb_objspace_t *objspace)
(int)heap_pages_min_free_slots, (int)heap_pages_max_free_slots);
heap = heap_eden;
- gc_before_heap_sweep(objspace, heap);
-
- gc_prof_set_malloc_info(objspace);
-
- /* reset malloc info */
- if (0) fprintf(stderr, "%d\t%d\t%d\n", (int)rb_gc_count(), (int)malloc_increase, (int)malloc_limit);
-
- {
- size_t inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0);
- size_t old_limit = malloc_limit;
-
- if (inc > malloc_limit) {
- malloc_limit = (size_t)(inc * gc_params.malloc_limit_growth_factor);
- if (gc_params.malloc_limit_max > 0 && /* ignore max-check if 0 */
- malloc_limit > gc_params.malloc_limit_max) {
- malloc_limit = inc;
- }
- }
- else {
- malloc_limit = (size_t)(malloc_limit * 0.98); /* magic number */
- if (malloc_limit < gc_params.malloc_limit_min) {
- malloc_limit = gc_params.malloc_limit_min;
- }
- }
-
- if (0) {
- if (old_limit != malloc_limit) {
- fprintf(stderr, "[%"PRIuSIZE"] malloc_limit: %"PRIuSIZE" -> %"PRIuSIZE"\n",
- rb_gc_count(), old_limit, malloc_limit);
- }
- else {
- fprintf(stderr, "[%"PRIuSIZE"] malloc_limit: not changed (%"PRIuSIZE")\n",
- rb_gc_count(), malloc_limit);
- }
- }
- }
-
- /* reset oldmalloc info */
-#if RGENGC_ESTIMATE_OLDMALLOC
- if (objspace->rgengc.during_minor_gc) {
- if (objspace->rgengc.oldmalloc_increase > objspace->rgengc.oldmalloc_increase_limit) {
- objspace->rgengc.need_major_gc = GPR_FLAG_MAJOR_BY_OLDMALLOC;;
- objspace->rgengc.oldmalloc_increase_limit =
- (size_t)(objspace->rgengc.oldmalloc_increase_limit * gc_params.oldmalloc_limit_growth_factor);
-
- if (objspace->rgengc.oldmalloc_increase_limit > gc_params.oldmalloc_limit_max) {
- objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_max;
- }
- }
-
- if (0) fprintf(stderr, "%d\t%d\t%u\t%u\t%d\n", (int)rb_gc_count(), objspace->rgengc.need_major_gc,
- (unsigned int)objspace->rgengc.oldmalloc_increase,
- (unsigned int)objspace->rgengc.oldmalloc_increase_limit,
- (unsigned int)gc_params.oldmalloc_limit_max);
- }
- else {
- /* major GC */
- objspace->rgengc.oldmalloc_increase = 0;
-
- if ((objspace->profile.latest_gc_info & GPR_FLAG_MAJOR_BY_OLDMALLOC) == 0) {
- objspace->rgengc.oldmalloc_increase_limit =
- (size_t)(objspace->rgengc.oldmalloc_increase_limit / ((gc_params.oldmalloc_limit_growth_factor - 1)/10 + 1));
- if (objspace->rgengc.oldmalloc_increase_limit < gc_params.oldmalloc_limit_min) {
- objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_min;
- }
- }
- }
-
-#endif
-
+ gc_sweep_start_heap(objspace, heap);
}
static void
-gc_after_sweep(rb_objspace_t *objspace)
+gc_sweep_finish(rb_objspace_t *objspace)
{
rb_heap_t *heap = heap_eden;
- rgengc_report(1, objspace, "after_gc_sweep: heap->total_slots: %d, heap->swept_slots: %d, min_free_slots: %d\n",
+ gc_report(1, objspace, "gc_sweep_finish: heap->total_slots: %d, heap->swept_slots: %d, min_free_slots: %d\n",
(int)heap->total_slots, (int)heap_pages_swept_slots, (int)heap_pages_min_free_slots);
- if (heap_pages_swept_slots < heap_pages_min_free_slots) {
- heap_set_increment(objspace, (heap_pages_min_free_slots - heap_pages_swept_slots) / HEAP_OBJ_LIMIT);
- heap_increment(objspace, heap);
-
-#if USE_RGENGC
- if (objspace->rgengc.remembered_shady_object_count + objspace->rgengc.old_object_count > (heap_pages_length * HEAP_OBJ_LIMIT) / 2) {
- /* if [old]+[remembered shady] > [all object count]/2, then do major GC */
- objspace->rgengc.need_major_gc = GPR_FLAG_MAJOR_BY_RESCAN;
- }
-#endif
- }
-
gc_prof_set_heap_info(objspace);
heap_pages_free_unused_pages(objspace);
/* if heap_pages has unused pages, then assign them to increment */
- if (heap_pages_increment < heap_tomb->page_length) {
- heap_pages_increment = heap_tomb->page_length;
- heap_pages_expand_sorted(objspace);
+ if (heap_allocatable_pages < heap_tomb->page_length) {
+ heap_allocatable_pages = heap_tomb->page_length;
}
-#if RGENGC_PROFILE > 0
- if (0) {
- fprintf(stderr, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
- (int)rb_gc_count(),
- (int)objspace->profile.major_gc_count,
- (int)objspace->profile.minor_gc_count,
- (int)objspace->profile.promote_infant_count,
-#if RGENGC_THREEGEN
- (int)objspace->profile.promote_young_count,
-#else
- 0,
-#endif
- (int)objspace->profile.remembered_normal_object_count,
- (int)objspace->rgengc.remembered_shady_object_count);
- }
-#endif
-
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_END_SWEEP, 0);
+ gc_stat_transition(objspace, gc_stat_none);
+
+#if RGENGC_CHECK_MODE >= 2
+ gc_verify_internal_consistency(Qnil);
+#endif
}
static int
-gc_heap_lazy_sweep(rb_objspace_t *objspace, rb_heap_t *heap)
+gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
{
- struct heap_page *page = heap->sweep_pages, *next;
- int result = FALSE;
+ struct heap_page *sweep_page = heap->sweep_pages, *next;
+ int unlink_limit = 3;
+#if GC_ENABLE_INCREMENTAL_MARK
+ int need_pool = will_be_incremental_marking(objspace) ? TRUE : FALSE;
- if (page == NULL) return FALSE;
+ gc_report(2, objspace, "gc_sweep_step (need_pool: %d)\n", need_pool);
+#else
+ gc_report(2, objspace, "gc_sweep_step\n");
+#endif
+
+ if (sweep_page == NULL) return FALSE;
#if GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_start(objspace);
#endif
- while (page) {
- heap->sweep_pages = next = page->next;
-
- gc_page_sweep(objspace, heap, page);
-
- if (!next) gc_after_sweep(objspace);
+ while (sweep_page) {
+ heap->sweep_pages = next = sweep_page->next;
+ gc_page_sweep(objspace, heap, sweep_page);
- if (heap->free_pages) {
- result = TRUE;
+ if (sweep_page->final_slots + sweep_page->free_slots == sweep_page->total_slots &&
+ unlink_limit > 0) {
+ unlink_limit--;
+ /* there are no living objects -> move this page to tomb heap */
+ heap_unlink_page(objspace, heap, sweep_page);
+ heap_add_page(objspace, heap_tomb, sweep_page);
+ }
+ else if (sweep_page->free_slots > 0) {
+#if GC_ENABLE_INCREMENTAL_MARK
+ if (need_pool) {
+ if (heap_add_poolpage(objspace, heap, sweep_page)) {
+ need_pool = FALSE;
+ }
+ }
+ else {
+ heap_add_freepage(objspace, heap, sweep_page);
+ break;
+ }
+#else
+ heap_add_freepage(objspace, heap, sweep_page);
break;
- }
+#endif
+ }
+ else {
+ sweep_page->free_next = NULL;
+ }
- page = next;
+ sweep_page = next;
+ }
+
+ if (heap->sweep_pages == NULL) {
+ gc_sweep_finish(objspace);
}
#if GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_stop(objspace);
#endif
- return result;
+ return heap->free_pages != NULL;
}
static void
-gc_heap_rest_sweep(rb_objspace_t *objspace, rb_heap_t *heap)
+gc_sweep_rest(rb_objspace_t *objspace)
{
- if (is_lazy_sweeping(heap)) {
- during_gc++;
- while (is_lazy_sweeping(heap)) {
- gc_heap_lazy_sweep(objspace, heap);
- }
- during_gc = 0;
+ rb_heap_t *heap = heap_eden; /* lazy sweep only for eden */
+
+ while (has_sweeping_pages(heap)) {
+ gc_sweep_step(objspace, heap);
}
}
+#if GC_ENABLE_LAZY_SWEEP
static void
-gc_rest_sweep(rb_objspace_t *objspace)
+gc_sweep_continue(rb_objspace_t *objspace, rb_heap_t *heap)
{
- rb_heap_t *heap = heap_eden; /* lazy sweep only for eden */
- gc_heap_rest_sweep(objspace, heap);
+ if (RGENGC_CHECK_MODE) assert(dont_gc == FALSE);
+
+ gc_enter(objspace, "sweep_continue");
+#if USE_RGENGC
+ if (objspace->rgengc.need_major_gc == GPR_FLAG_NONE && heap_increment(objspace, heap)) {
+ gc_report(3, objspace, "gc_sweep_continue: success heap_increment().\n");
+ }
+#endif
+ gc_sweep_step(objspace, heap);
+ gc_exit(objspace, "sweep_continue");
}
+#endif
static void
-gc_sweep(rb_objspace_t *objspace, int immediate_sweep)
+gc_sweep(rb_objspace_t *objspace)
{
+ const unsigned int immediate_sweep = objspace->flags.immediate_sweep;
+
+ gc_report(1, objspace, "gc_sweep: immediate: %d\n", immediate_sweep);
+
if (immediate_sweep) {
#if !GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_start(objspace);
#endif
- gc_before_sweep(objspace);
- gc_heap_rest_sweep(objspace, heap_eden);
+ gc_sweep_start(objspace);
+ gc_sweep_rest(objspace);
#if !GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_stop(objspace);
#endif
}
else {
struct heap_page *page;
- gc_before_sweep(objspace);
+ gc_sweep_start(objspace);
page = heap_eden->sweep_pages;
while (page) {
- page->before_sweep = 1;
+ page->flags.before_sweep = TRUE;
page = page->next;
}
- gc_heap_lazy_sweep(objspace, heap_eden);
+ gc_sweep_step(objspace, heap_eden);
}
gc_heap_prepare_minimum_pages(objspace, heap_eden);
@@ -3070,10 +3675,6 @@ gc_sweep(rb_objspace_t *objspace, int immediate_sweep)
/* Marking - 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)
{
@@ -3092,6 +3693,19 @@ is_mark_stack_empty(mark_stack_t *stack)
return stack->chunk == NULL;
}
+static size_t
+mark_stack_size(mark_stack_t *stack)
+{
+ size_t size = stack->index;
+ stack_chunk_t *chunk = stack->chunk ? stack->chunk->next : NULL;
+
+ while (chunk) {
+ size += stack->limit;
+ chunk = chunk->next;
+ }
+ return size;
+}
+
static void
add_stack_chunk_cache(mark_stack_t *stack, stack_chunk_t *chunk)
{
@@ -3119,7 +3733,8 @@ push_mark_stack_chunk(mark_stack_t *stack)
{
stack_chunk_t *next;
- assert(stack->index == stack->limit);
+ if (RGENGC_CHECK_MODE) assert(stack->index == stack->limit);
+
if (stack->cache_size > 0) {
next = stack->cache;
stack->cache = stack->cache->next;
@@ -3141,13 +3756,12 @@ pop_mark_stack_chunk(mark_stack_t *stack)
stack_chunk_t *prev;
prev = stack->chunk->next;
- assert(stack->index == 0);
+ if (RGENGC_CHECK_MODE) 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)
{
@@ -3160,7 +3774,6 @@ free_stack_chunks(mark_stack_t *stack)
chunk = next;
}
}
-#endif
static void
push_mark_stack(mark_stack_t *stack, VALUE data)
@@ -3187,13 +3800,43 @@ pop_mark_stack(mark_stack_t *stack, VALUE *data)
return TRUE;
}
+#if GC_ENABLE_INCREMENTAL_MARK
+static int
+invalidate_mark_stack_chunk(stack_chunk_t *chunk, int limit, VALUE obj)
+{
+ int i;
+ for (i=0; i<limit; i++) {
+ if (chunk->data[i] == obj) {
+ chunk->data[i] = Qundef;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static void
+invalidate_mark_stack(mark_stack_t *stack, VALUE obj)
+{
+ stack_chunk_t *chunk = stack->chunk;
+ int limit = stack->index;
+
+ while (chunk) {
+ if (invalidate_mark_stack_chunk(chunk, limit, obj)) return;
+ chunk = chunk->next;
+ limit = stack->limit;
+ }
+ rb_bug("invalid_mark_stack: unreachable");
+}
+#endif
+
static void
init_mark_stack(mark_stack_t *stack)
{
int i;
- if (0) push_mark_stack_chunk(stack);
+ MEMZERO(stack, mark_stack_t, 1);
stack->index = stack->limit = STACK_CHUNK_SIZE;
+ stack->cache_size = 0;
for (i=0; i < 4; i++) {
add_stack_chunk_cache(stack, stack_chunk_alloc());
@@ -3204,14 +3847,14 @@ init_mark_stack(mark_stack_t *stack)
/* Marking */
#ifdef __ia64
-#define SET_STACK_END (SET_MACHINE_STACK_END(&th->machine_stack_end), th->machine_register_stack_end = rb_ia64_bsp())
+#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)
+#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))
+#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)
@@ -3253,8 +3896,8 @@ stack_check(int water_mark)
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;
+ ret = (VALUE*)rb_ia64_bsp() - th->machine.register_stack_start >
+ th->machine.register_stack_maxsize/sizeof(VALUE) - water_mark;
}
#endif
return ret;
@@ -3275,7 +3918,7 @@ ruby_stack_check(void)
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
static void
-mark_locations_array(rb_objspace_t *objspace, register VALUE *x, register long n)
+mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n)
{
VALUE v;
while (n--) {
@@ -3286,7 +3929,7 @@ mark_locations_array(rb_objspace_t *objspace, register VALUE *x, register long n
}
static void
-gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end)
+gc_mark_locations(rb_objspace_t *objspace, const VALUE *start, const VALUE *end)
{
long n;
@@ -3296,49 +3939,52 @@ gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end)
}
void
-rb_gc_mark_locations(VALUE *start, VALUE *end)
+rb_gc_mark_locations(const VALUE *start, const VALUE *end)
{
gc_mark_locations(&rb_objspace, start, end);
}
-#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end))
+void
+rb_gc_mark_values(long n, const VALUE *values)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ long i;
-struct mark_tbl_arg {
- rb_objspace_t *objspace;
-};
+ for (i=0; i<n; i++) {
+ gc_mark(objspace, values[i]);
+ }
+}
+
+#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end))
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);
+ rb_objspace_t *objspace = (rb_objspace_t *)data;
+ gc_mark(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);
+ st_foreach(tbl, mark_entry, (st_data_t)objspace);
}
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);
+ rb_objspace_t *objspace = (rb_objspace_t *)data;
+ gc_mark(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);
+ st_foreach(tbl, mark_key, (st_data_t)objspace);
}
void
@@ -3350,19 +3996,18 @@ rb_mark_set(st_table *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);
+ rb_objspace_t *objspace = (rb_objspace_t *)data;
+
+ gc_mark(objspace, (VALUE)key);
+ gc_mark(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);
+ st_foreach(tbl, mark_keyvalue, (st_data_t)objspace);
}
void
@@ -3376,77 +4021,73 @@ 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);
- again:
- 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;
- case VM_METHOD_TYPE_REFINED:
- if (def->body.orig_me) {
- def = def->body.orig_me->def;
- goto again;
+ gc_mark(objspace, me->owner);
+ gc_mark(objspace, me->defined_class);
+
+ if (def) {
+ switch (def->type) {
+ case VM_METHOD_TYPE_ISEQ:
+ if (def->body.iseq.iseqptr) gc_mark(objspace, (VALUE)def->body.iseq.iseqptr);
+ gc_mark(objspace, (VALUE)def->body.iseq.cref);
+ break;
+ case VM_METHOD_TYPE_ATTRSET:
+ case VM_METHOD_TYPE_IVAR:
+ gc_mark(objspace, def->body.attr.location);
+ break;
+ case VM_METHOD_TYPE_BMETHOD:
+ gc_mark(objspace, def->body.proc);
+ break;
+ case VM_METHOD_TYPE_ALIAS:
+ gc_mark(objspace, (VALUE)def->body.alias.original_me);
+ return;
+ case VM_METHOD_TYPE_REFINED:
+ gc_mark(objspace, (VALUE)def->body.refined.orig_me);
+ gc_mark(objspace, (VALUE)def->body.refined.owner);
+ break;
+ case VM_METHOD_TYPE_CFUNC:
+ case VM_METHOD_TYPE_ZSUPER:
+ case VM_METHOD_TYPE_MISSING:
+ case VM_METHOD_TYPE_OPTIMIZED:
+ case VM_METHOD_TYPE_UNDEF:
+ case VM_METHOD_TYPE_NOTIMPLEMENTED:
+ break;
}
- break;
- default:
- break; /* ignore */
}
}
-void
-rb_mark_method_entry(const rb_method_entry_t *me)
+static enum rb_id_table_iterator_result
+mark_method_entry_i(VALUE me, void *data)
{
- mark_method_entry(&rb_objspace, me);
-}
+ rb_objspace_t *objspace = (rb_objspace_t *)data;
-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;
+ gc_mark(objspace, me);
+ return ID_TABLE_CONTINUE;
}
static void
-mark_m_tbl_wrapper(rb_objspace_t *objspace, struct method_table_wrapper *wrapper)
+mark_m_tbl(rb_objspace_t *objspace, struct rb_id_table *tbl)
{
- struct mark_tbl_arg arg;
- if (!wrapper || !wrapper->tbl) return;
- if (LIKELY(objspace->mark_func_data == 0)) {
- /* prevent multiple marking during same GC cycle,
- * since m_tbl is shared between several T_ICLASS */
- size_t serial = rb_gc_count();
- if (wrapper->serial == serial) return;
- wrapper->serial = serial;
+ if (tbl) {
+ rb_id_table_foreach_values(tbl, mark_method_entry_i, objspace);
}
- arg.objspace = objspace;
- st_foreach(wrapper->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)
+mark_const_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, ce->value);
- gc_mark(arg->objspace, ce->file);
+ const rb_const_entry_t *ce = (const rb_const_entry_t *)value;
+ rb_objspace_t *objspace = (rb_objspace_t *)data;
+
+ gc_mark(objspace, ce->value);
+ gc_mark(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);
+ st_foreach(tbl, mark_const_entry_i, (st_data_t)objspace);
}
#if STACK_GROW_DIRECTION < 0
@@ -3472,17 +4113,21 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
/* This assumes that all registers are saved into the jmp_buf (and stack) */
rb_setjmp(save_regs_gc_mark.j);
+ /* SET_STACK_END must be called in this function because
+ * the stack frame of this function may contain
+ * callee save registers and they should be marked. */
+ 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);
+ 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));
+ rb_gc_mark_locations((VALUE*)((char*)stack_start + 2),
+ (VALUE*)((char*)stack_end - 2));
#endif
}
@@ -3495,7 +4140,11 @@ rb_gc_mark_machine_stack(rb_thread_t *th)
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);
+ rb_gc_mark_locations(th->machine.register_stack_start, th->machine.register_stack_end);
+#endif
+#if defined(__mc68000__)
+ rb_gc_mark_locations((VALUE*)((char*)stack_start + 2),
+ (VALUE*)((char*)stack_end - 2));
#endif
}
@@ -3512,7 +4161,7 @@ gc_mark_maybe(rb_objspace_t *objspace, VALUE obj)
if (is_pointer_to_heap(objspace, (void *)obj)) {
int type = BUILTIN_TYPE(obj);
if (type != T_ZOMBIE && type != T_NONE) {
- gc_mark(objspace, obj);
+ gc_mark_ptr(objspace, obj);
}
}
}
@@ -3524,159 +4173,183 @@ rb_gc_mark_maybe(VALUE obj)
}
static inline int
-gc_marked(rb_objspace_t *objspace, VALUE ptr)
+gc_mark_set(rb_objspace_t *objspace, VALUE obj)
{
- register bits_t *bits = GET_HEAP_MARK_BITS(ptr);
- if (MARKED_IN_BITMAP(bits, ptr)) return 1;
- return 0;
+ if (RVALUE_MARKED(obj)) return 0;
+ MARK_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj);
+ return 1;
}
-static inline int
-gc_mark_ptr(rb_objspace_t *objspace, VALUE ptr)
+#if USE_RGENGC
+static int
+gc_remember_unprotected(rb_objspace_t *objspace, VALUE obj)
{
- register bits_t *bits = GET_HEAP_MARK_BITS(ptr);
- if (gc_marked(objspace, ptr)) return 0;
- MARK_IN_BITMAP(bits, ptr);
- return 1;
+ struct heap_page *page = GET_HEAP_PAGE(obj);
+ bits_t *uncollectible_bits = &page->uncollectible_bits[0];
+
+ if (!MARKED_IN_BITMAP(uncollectible_bits, obj)) {
+ page->flags.has_uncollectible_shady_objects = TRUE;
+ MARK_IN_BITMAP(uncollectible_bits, obj);
+ objspace->rgengc.uncollectible_wb_unprotected_objects++;
+
+#if RGENGC_PROFILE > 0
+ objspace->profile.total_remembered_shady_object_count++;
+#if RGENGC_PROFILE >= 2
+ objspace->profile.remembered_shady_object_count_types[BUILTIN_TYPE(obj)]++;
+#endif
+#endif
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
}
+#endif
static void
rgengc_check_relation(rb_objspace_t *objspace, VALUE obj)
{
#if USE_RGENGC
- if (objspace->rgengc.parent_object_is_old) {
- if (!RVALUE_WB_PROTECTED(obj)) {
- if (rgengc_remember(objspace, obj)) {
- objspace->rgengc.remembered_shady_object_count++;
+ const VALUE old_parent = objspace->rgengc.parent_object;
+
+ if (old_parent) { /* parent object is old */
+ if (RVALUE_WB_UNPROTECTED(obj)) {
+ if (gc_remember_unprotected(objspace, obj)) {
+ gc_report(2, objspace, "relation: (O->S) %s -> %s\n", obj_info(old_parent), obj_info(obj));
}
}
-#if RGENGC_THREEGEN
else {
- if (gc_marked(objspace, obj)) {
- if (!RVALUE_OLD_P(obj)) {
+ if (!RVALUE_OLD_P(obj)) {
+ if (RVALUE_MARKED(obj)) {
/* An object pointed from an OLD object should be OLD. */
- rgengc_remember(objspace, obj);
+ gc_report(2, objspace, "relation: (O->unmarked Y) %s -> %s\n", obj_info(old_parent), obj_info(obj));
+ RVALUE_AGE_SET_OLD(objspace, obj);
+ if (is_incremental_marking(objspace)) {
+ if (!RVALUE_MARKING(obj)) {
+ gc_grey(objspace, obj);
+ }
+ }
+ else {
+ rgengc_remember(objspace, obj);
+ }
}
- }
- else {
- if (RVALUE_INFANT_P(obj)) {
- RVALUE_PROMOTE_INFANT(obj);
+ else {
+ gc_report(2, objspace, "relation: (O->Y) %s -> %s\n", obj_info(old_parent), obj_info(obj));
+ RVALUE_AGE_SET_CANDIDATE(objspace, obj);
}
}
}
+ }
+
+ if (RGENGC_CHECK_MODE) assert(old_parent == objspace->rgengc.parent_object);
#endif
+}
+
+static void
+gc_grey(rb_objspace_t *objspace, VALUE obj)
+{
+#if RGENGC_CHECK_MODE
+ if (RVALUE_MARKED(obj) == FALSE) rb_bug("gc_grey: %s is not marked.", obj_info(obj));
+ if (RVALUE_MARKING(obj) == TRUE) rb_bug("gc_grey: %s is marking/remembered.", obj_info(obj));
+#endif
+
+#if GC_ENABLE_INCREMENTAL_MARK
+ if (is_incremental_marking(objspace)) {
+ MARK_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
}
#endif
+
+ push_mark_stack(&objspace->mark_stack, obj);
}
static void
-gc_mark(rb_objspace_t *objspace, VALUE ptr)
+gc_aging(rb_objspace_t *objspace, VALUE obj)
{
- if (!is_markable_object(objspace, ptr)) return;
+#if USE_RGENGC
+ struct heap_page *page = GET_HEAP_PAGE(obj);
- if (LIKELY(objspace->mark_func_data == 0)) {
- rgengc_check_relation(objspace, ptr);
- if (!gc_mark_ptr(objspace, ptr)) return; /* already marked */
- push_mark_stack(&objspace->mark_stack, ptr);
+#if RGENGC_CHECK_MODE
+ assert(RVALUE_MARKING(obj) == FALSE);
+#endif
+
+ check_rvalue_consistency(obj);
+
+ if (!RVALUE_PAGE_WB_UNPROTECTED(page, obj)) {
+ if (!RVALUE_OLD_P(obj)) {
+ gc_report(3, objspace, "gc_aging: YOUNG: %s\n", obj_info(obj));
+ RVALUE_AGE_INC(objspace, obj);
+ }
+ else if (is_full_marking(objspace)) {
+ if (RGENGC_CHECK_MODE) assert(RVALUE_PAGE_UNCOLLECTIBLE(page, obj) == FALSE);
+ RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(objspace, page, obj);
+ }
+ }
+ check_rvalue_consistency(obj);
+#endif /* USE_RGENGC */
+
+ objspace->marked_slots++;
+}
+
+NOINLINE(static void gc_mark_ptr(rb_objspace_t *objspace, VALUE obj));
+
+static void
+gc_mark_ptr(rb_objspace_t *objspace, VALUE obj)
+{
+ if (LIKELY(objspace->mark_func_data == NULL)) {
+ rgengc_check_relation(objspace, obj);
+ if (!gc_mark_set(objspace, obj)) return; /* already marked */
+ gc_aging(objspace, obj);
+ gc_grey(objspace, obj);
}
else {
- objspace->mark_func_data->mark_func(ptr, objspace->mark_func_data->data);
+ objspace->mark_func_data->mark_func(obj, objspace->mark_func_data->data);
}
}
+static void
+gc_mark(rb_objspace_t *objspace, VALUE obj)
+{
+ if (!is_markable_object(objspace, obj)) return;
+ gc_mark_ptr(objspace, obj);
+}
+
void
rb_gc_mark(VALUE ptr)
{
gc_mark(&rb_objspace, ptr);
}
-/* resurrect non-marked `obj' if obj is before swept */
+/* CAUTION: THIS FUNCTION ENABLE *ONLY BEFORE* SWEEPING.
+ * This function is only for GC_END_MARK timing.
+ */
-void
-rb_gc_resurrect(VALUE obj)
+int
+rb_objspace_marked_object_p(VALUE obj)
{
- rb_objspace_t *objspace = &rb_objspace;
-
- if (is_lazy_sweeping(heap_eden) &&
- !gc_marked(objspace, obj) &&
- !is_swept_object(objspace, obj)) {
- gc_mark_ptr(objspace, obj);
- }
+ return RVALUE_MARKED(obj) ? TRUE : FALSE;
}
-static void
-gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
+static inline void
+gc_mark_set_parent(rb_objspace_t *objspace, VALUE obj)
{
- register RVALUE *obj = RANY(ptr);
-
- goto marking; /* skip */
-
- again:
- if (LIKELY(objspace->mark_func_data == 0)) {
- obj = RANY(ptr);
- if (!is_markable_object(objspace, ptr)) return;
- rgengc_check_relation(objspace, ptr);
- if (!gc_mark_ptr(objspace, ptr)) return; /* already marked */
+#if USE_RGENGC
+ if (RVALUE_OLD_P(obj)) {
+ objspace->rgengc.parent_object = obj;
}
else {
- gc_mark(objspace, ptr);
- return;
+ objspace->rgengc.parent_object = Qfalse;
}
-
- marking:
-
-#if USE_RGENGC
- check_gen_consistency((VALUE)obj);
-
- if (LIKELY(objspace->mark_func_data == 0)) {
- /* minor/major common */
- if (RVALUE_WB_PROTECTED(obj)) {
- if (RVALUE_INFANT_P((VALUE)obj)) {
- /* infant -> young */
- RVALUE_PROMOTE_INFANT((VALUE)obj);
-#if RGENGC_THREEGEN
- /* infant -> young */
- objspace->rgengc.young_object_count++;
- objspace->rgengc.parent_object_is_old = FALSE;
-#else
- /* infant -> old */
- objspace->rgengc.old_object_count++;
- objspace->rgengc.parent_object_is_old = TRUE;
-#endif
- rgengc_report(3, objspace, "gc_mark_children: promote infant -> young %p (%s).\n", (void *)obj, obj_type_name((VALUE)obj));
- }
- else {
- objspace->rgengc.parent_object_is_old = TRUE;
-
-#if RGENGC_THREEGEN
- if (RVALUE_YOUNG_P((VALUE)obj)) {
- /* young -> old */
- RVALUE_PROMOTE_YOUNG((VALUE)obj);
- objspace->rgengc.old_object_count++;
- rgengc_report(3, objspace, "gc_mark_children: promote young -> old %p (%s).\n", (void *)obj, obj_type_name((VALUE)obj));
- }
- else {
#endif
- if (!objspace->rgengc.during_minor_gc) {
- /* major/full GC */
- objspace->rgengc.old_object_count++;
- }
-#if RGENGC_THREEGEN
- }
-#endif
- }
- }
- else {
- rgengc_report(3, objspace, "gc_mark_children: do not promote non-WB-protected %p (%s).\n", (void *)obj, obj_type_name((VALUE)obj));
- objspace->rgengc.parent_object_is_old = FALSE;
- }
- }
+}
- check_gen_consistency((VALUE)obj);
-#endif /* USE_RGENGC */
+static void
+gc_mark_children(rb_objspace_t *objspace, VALUE obj)
+{
+ register RVALUE *any = RANY(obj);
+ gc_mark_set_parent(objspace, obj);
if (FL_TEST(obj, FL_EXIVAR)) {
- rb_mark_generic_ivar(ptr);
+ rb_mark_generic_ivar(obj);
}
switch (BUILTIN_TYPE(obj)) {
@@ -3686,165 +4359,71 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
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.nd_clss);
- ptr = (VALUE)obj->as.node.nd_next;
- goto again;
-
- default: /* unlisted NODE */
- gc_mark_maybe(objspace, (VALUE)obj->as.node.u1.node);
- gc_mark_maybe(objspace, (VALUE)obj->as.node.u2.node);
- gc_mark_maybe(objspace, (VALUE)obj->as.node.u3.node);
- }
+ obj = rb_gc_mark_node(&any->as.node);
+ if (obj) gc_mark(objspace, obj);
return; /* no need to mark class. */
- }
- gc_mark(objspace, obj->as.basic.klass);
+ case T_IMEMO:
+ switch (imemo_type(obj)) {
+ case imemo_none:
+ rb_bug("unreachable");
+ return;
+ case imemo_cref:
+ gc_mark(objspace, RANY(obj)->as.imemo.cref.klass);
+ gc_mark(objspace, (VALUE)RANY(obj)->as.imemo.cref.next);
+ gc_mark(objspace, RANY(obj)->as.imemo.cref.refinements);
+ return;
+ case imemo_svar:
+ gc_mark(objspace, RANY(obj)->as.imemo.svar.cref_or_me);
+ gc_mark(objspace, RANY(obj)->as.imemo.svar.lastline);
+ gc_mark(objspace, RANY(obj)->as.imemo.svar.backref);
+ gc_mark(objspace, RANY(obj)->as.imemo.svar.others);
+ return;
+ case imemo_throw_data:
+ gc_mark(objspace, RANY(obj)->as.imemo.throw_data.throw_obj);
+ return;
+ case imemo_ifunc:
+ gc_mark_maybe(objspace, (VALUE)RANY(obj)->as.imemo.ifunc.data);
+ return;
+ case imemo_memo:
+ gc_mark(objspace, RANY(obj)->as.imemo.memo.v1);
+ gc_mark(objspace, RANY(obj)->as.imemo.memo.v2);
+ gc_mark_maybe(objspace, RANY(obj)->as.imemo.memo.u3.value);
+ return;
+ case imemo_ment:
+ mark_method_entry(objspace, &RANY(obj)->as.imemo.ment);
+ return;
+ case imemo_iseq:
+ rb_iseq_mark((rb_iseq_t *)obj);
+ return;
+ }
+ rb_bug("T_IMEMO: unreachable");
+ }
+
+ gc_mark(objspace, any->as.basic.klass);
+
switch (BUILTIN_TYPE(obj)) {
- case T_ICLASS:
case T_CLASS:
case T_MODULE:
- mark_m_tbl_wrapper(objspace, RCLASS_M_TBL_WRAPPER(obj));
+ 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((VALUE)obj);
- goto again;
+ gc_mark(objspace, RCLASS_SUPER((VALUE)obj));
+ break;
+
+ case T_ICLASS:
+ if (FL_TEST(obj, RICLASS_IS_ORIGIN)) {
+ mark_m_tbl(objspace, RCLASS_M_TBL(obj));
+ }
+ if (!RCLASS_EXT(obj)) break;
+ mark_m_tbl(objspace, RCLASS_CALLABLE_M_TBL(obj));
+ gc_mark(objspace, RCLASS_SUPER((VALUE)obj));
+ break;
case T_ARRAY:
if (FL_TEST(obj, ELTS_SHARED)) {
- ptr = obj->as.array.as.heap.aux.shared;
- goto again;
+ gc_mark(objspace, any->as.array.as.heap.aux.shared);
}
else {
long i, len = RARRAY_LEN(obj);
@@ -3856,25 +4435,25 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
break;
case T_HASH:
- mark_hash(objspace, obj->as.hash.ntbl);
- ptr = obj->as.hash.ifnone;
- goto again;
+ mark_hash(objspace, any->as.hash.ntbl);
+ gc_mark(objspace, any->as.hash.ifnone);
+ break;
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;
+ if (STR_SHARED_P(obj)) {
+ gc_mark(objspace, any->as.string.as.heap.aux.shared);
}
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));
+ {
+ void *const ptr = DATA_PTR(obj);
+ if (ptr) {
+ RUBY_DATA_FUNC mark_func = RTYPEDDATA_P(obj) ?
+ any->as.typeddata.type->function.dmark :
+ any->as.data.dmark;
+ if (mark_func) (*mark_func)(ptr);
+ }
}
break;
@@ -3889,41 +4468,41 @@ gc_mark_children(rb_objspace_t *objspace, VALUE 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);
+ if (any->as.file.fptr) {
+ gc_mark(objspace, any->as.file.fptr->pathv);
+ gc_mark(objspace, any->as.file.fptr->tied_io_for_writing);
+ gc_mark(objspace, any->as.file.fptr->writeconv_asciicompat);
+ gc_mark(objspace, any->as.file.fptr->writeconv_pre_ecopts);
+ gc_mark(objspace, any->as.file.fptr->encs.ecopts);
+ gc_mark(objspace, any->as.file.fptr->write_lock);
}
break;
case T_REGEXP:
- ptr = obj->as.regexp.src;
- goto again;
+ gc_mark(objspace, any->as.regexp.src);
+ break;
case T_FLOAT:
case T_BIGNUM:
+ case T_SYMBOL:
break;
case T_MATCH:
- gc_mark(objspace, obj->as.match.regexp);
- if (obj->as.match.str) {
- ptr = obj->as.match.str;
- goto again;
+ gc_mark(objspace, any->as.match.regexp);
+ if (any->as.match.str) {
+ gc_mark(objspace, any->as.match.str);
}
break;
case T_RATIONAL:
- gc_mark(objspace, obj->as.rational.num);
- ptr = obj->as.rational.den;
- goto again;
+ gc_mark(objspace, any->as.rational.num);
+ gc_mark(objspace, any->as.rational.den);
+ break;
case T_COMPLEX:
- gc_mark(objspace, obj->as.complex.real);
- ptr = obj->as.complex.imag;
- goto again;
+ gc_mark(objspace, any->as.complex.real);
+ gc_mark(objspace, any->as.complex.imag);
+ break;
case T_STRUCT:
{
@@ -3943,79 +4522,75 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("rb_gc_mark(): %p is T_NONE", (void *)obj);
if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("rb_gc_mark(): %p is T_ZOMBIE", (void *)obj);
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");
+ BUILTIN_TYPE(obj), any,
+ is_pointer_to_heap(objspace, any) ? "corrupted object" : "non object");
}
}
-static void
-gc_mark_stacked_objects(rb_objspace_t *objspace)
+/**
+ * incremental: 0 -> not incremental (do all)
+ * incremental: n -> mark at most `n' objects
+ */
+static inline int
+gc_mark_stacked_objects(rb_objspace_t *objspace, int incremental, size_t count)
{
mark_stack_t *mstack = &objspace->mark_stack;
- VALUE obj = 0;
+ VALUE obj;
+#if GC_ENABLE_INCREMENTAL_MARK
+ size_t marked_slots_at_the_beginning = objspace->marked_slots;
+ size_t popped_count = 0;
+#endif
- if (!mstack->index) return;
while (pop_mark_stack(mstack, &obj)) {
- if (RGENGC_CHECK_MODE > 0 && !gc_marked(objspace, obj)) {
- rb_bug("gc_mark_stacked_objects: %p (%s) is infant, but not marked.", (void *)obj, obj_type_name(obj));
+ if (obj == Qundef) continue; /* skip */
+
+ if (RGENGC_CHECK_MODE && !RVALUE_MARKED(obj)) {
+ rb_bug("gc_mark_stacked_objects: %s is not marked.", obj_info(obj));
}
gc_mark_children(objspace, obj);
- }
- shrink_stack_chunk_cache(mstack);
-}
-
-#ifndef RGENGC_PRINT_TICK
-#define RGENGC_PRINT_TICK 0
-#endif
-/* the following code is only for internal tuning. */
-/* Source code to use RDTSC is quoted and modified from
- * http://www.mcs.anl.gov/~kazutomo/rdtsc.html
- * written by Kazutomo Yoshii <kazutomo@mcs.anl.gov>
- */
-
-#if RGENGC_PRINT_TICK
-#if defined(__GNUC__) && defined(__i386__)
-typedef unsigned long long tick_t;
+#if GC_ENABLE_INCREMENTAL_MARK
+ if (incremental) {
+ if (RGENGC_CHECK_MODE && !RVALUE_MARKING(obj)) {
+ rb_bug("gc_mark_stacked_objects: incremental, but marking bit is 0");
+ }
+ CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
+ popped_count++;
-static inline tick_t
-tick(void)
-{
- unsigned long long int x;
- __asm__ __volatile__ ("rdtsc" : "=A" (x));
- return x;
-}
+ if (popped_count + (objspace->marked_slots - marked_slots_at_the_beginning) > count) {
+ break;
+ }
+ }
+ else {
+ /* just ignore marking bits */
+ }
+#endif
+ }
-#elif defined(__GNUC__) && defined(__x86_64__)
-typedef unsigned long long tick_t;
+ if (RGENGC_CHECK_MODE >= 3) gc_verify_internal_consistency(Qnil);
-static __inline__ tick_t
-tick(void)
-{
- unsigned long hi, lo;
- __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
- return ((unsigned long long)lo)|( ((unsigned long long)hi)<<32);
+ if (is_mark_stack_empty(mstack)) {
+ shrink_stack_chunk_cache(mstack);
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
}
-#elif defined(_WIN32) && defined(_MSC_VER)
-#include <intrin.h>
-typedef unsigned __int64 tick_t;
-
-static inline tick_t
-tick(void)
+static int
+gc_mark_stacked_objects_incremental(rb_objspace_t *objspace, size_t count)
{
- return __rdtsc();
+ return gc_mark_stacked_objects(objspace, TRUE, count);
}
-#else /* use clock */
-typedef clock_t tick_t;
-static inline tick_t
-tick(void)
+static int
+gc_mark_stacked_objects_all(rb_objspace_t *objspace)
{
- return clock();
+ return gc_mark_stacked_objects(objspace, FALSE, 0);
}
-#endif
+#if PRINT_ROOT_TICKS
#define MAX_TICKS 0x100
static tick_t mark_ticks[MAX_TICKS];
static const char *mark_ticks_categories[MAX_TICKS];
@@ -4036,16 +4611,15 @@ show_mark_ticks(void)
}
}
-#endif /* RGENGC_PRINT_TICK */
+#endif /* PRITNT_ROOT_TICKS */
static void
-gc_mark_roots(rb_objspace_t *objspace, int full_mark, const char **categoryp)
+gc_mark_roots(rb_objspace_t *objspace, const char **categoryp)
{
struct gc_list *list;
rb_thread_t *th = GET_THREAD();
- if (categoryp) *categoryp = "xxx";
-#if RGENGC_PRINT_TICK
+#if PRINT_ROOT_TICKS
tick_t start_tick = tick();
int tick_count = 0;
const char *prev_category = 0;
@@ -4055,7 +4629,13 @@ gc_mark_roots(rb_objspace_t *objspace, int full_mark, const char **categoryp)
}
#endif
-#if RGENGC_PRINT_TICK
+ if (categoryp) *categoryp = "xxx";
+
+#if USE_RGENGC
+ objspace->rgengc.parent_object = Qfalse;
+#endif
+
+#if PRINT_ROOT_TICKS
#define MARK_CHECKPOINT_PRINT_TICK(category) do { \
if (prev_category) { \
tick_t t = tick(); \
@@ -4066,7 +4646,7 @@ gc_mark_roots(rb_objspace_t *objspace, int full_mark, const char **categoryp)
prev_category = category; \
start_tick = tick(); \
} while (0)
-#else /* RGENGC_PRINT_TICK */
+#else /* PRITNT_ROOT_TICKS */
#define MARK_CHECKPOINT_PRINT_TICK(category)
#endif
@@ -4077,7 +4657,8 @@ gc_mark_roots(rb_objspace_t *objspace, int full_mark, const char **categoryp)
MARK_CHECKPOINT("vm");
SET_STACK_END;
- th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm);
+ rb_vm_mark(th->vm);
+ if (th->vm->self) gc_mark(objspace, th->vm->self);
MARK_CHECKPOINT("finalizers");
mark_tbl(objspace, finalizer_table);
@@ -4085,21 +4666,12 @@ gc_mark_roots(rb_objspace_t *objspace, int full_mark, const char **categoryp)
MARK_CHECKPOINT("machine_context");
mark_current_machine_context(objspace, th);
- MARK_CHECKPOINT("symbols");
-#if USE_RGENGC
- objspace->rgengc.parent_object_is_old = TRUE;
- rb_gc_mark_symbols(full_mark);
- objspace->rgengc.parent_object_is_old = FALSE;
-#else
- rb_gc_mark_symbols(full_mark);
-#endif
-
MARK_CHECKPOINT("encodings");
rb_gc_mark_encodings();
/* mark protected global variables */
MARK_CHECKPOINT("global_list");
- for (list = global_List; list; list = list->next) {
+ for (list = global_list; list; list = list->next) {
rb_gc_mark_maybe(*list->varptr);
}
@@ -4109,123 +4681,13 @@ gc_mark_roots(rb_objspace_t *objspace, int full_mark, const char **categoryp)
MARK_CHECKPOINT("global_tbl");
rb_gc_mark_global_tbl();
- /* mark generic instance variables for special constants */
- MARK_CHECKPOINT("generic_ivars");
- rb_mark_generic_ivar_tbl();
-
- MARK_CHECKPOINT("parser");
- rb_gc_mark_parser();
-
- MARK_CHECKPOINT("live_method_entries");
- rb_gc_mark_unlinked_live_method_entries(th->vm);
+ if (stress_to_class) rb_gc_mark(stress_to_class);
MARK_CHECKPOINT("finish");
#undef MARK_CHECKPOINT
}
-static void
-gc_marks_body(rb_objspace_t *objspace, int full_mark)
-{
- /* start marking */
- rgengc_report(1, objspace, "gc_marks_body: start (%s)\n", full_mark ? "full" : "minor");
-
-#if USE_RGENGC
- objspace->rgengc.parent_object_is_old = FALSE;
- objspace->rgengc.during_minor_gc = full_mark ? FALSE : TRUE;
-
- if (objspace->rgengc.during_minor_gc) {
- objspace->profile.minor_gc_count++;
- rgengc_rememberset_mark(objspace, heap_eden);
- }
- else {
- objspace->profile.major_gc_count++;
- rgengc_mark_and_rememberset_clear(objspace, heap_eden);
- }
-#endif
- gc_mark_roots(objspace, full_mark, 0);
- gc_mark_stacked_objects(objspace);
-
- gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_END_MARK, 0);
- rgengc_report(1, objspace, "gc_marks_body: end (%s)\n", full_mark ? "full" : "minor");
-}
-
-struct verify_internal_consistency_struct {
- rb_objspace_t *objspace;
- int err_count;
- VALUE parent;
-};
-
-#if USE_RGENGC
-static void
-verify_internal_consistency_reachable_i(VALUE child, void *ptr)
-{
- struct verify_internal_consistency_struct *data = (struct verify_internal_consistency_struct *)ptr;
-
- assert(RVALUE_OLD_P(data->parent));
-
- if (!RVALUE_OLD_P(child)) {
- if (!MARKED_IN_BITMAP(GET_HEAP_PAGE(data->parent)->rememberset_bits, data->parent) &&
- !MARKED_IN_BITMAP(GET_HEAP_PAGE(child)->rememberset_bits, child)) {
- fprintf(stderr, "verify_internal_consistency_reachable_i: WB miss %p (%s) -> %p (%s)\n",
- (void *)data->parent, obj_type_name(data->parent),
- (void *)child, obj_type_name(child));
- data->err_count++;
- }
- }
-}
-
-static int
-verify_internal_consistency_i(void *page_start, void *page_end, size_t stride, void *ptr)
-{
- struct verify_internal_consistency_struct *data = (struct verify_internal_consistency_struct *)ptr;
- VALUE v;
-
- for (v = (VALUE)page_start; v != (VALUE)page_end; v += stride) {
- if (is_live_object(data->objspace, v)) {
- if (RVALUE_OLD_P(v)) {
- data->parent = v;
- /* reachable objects from an oldgen object should be old or (young with remember) */
- rb_objspace_reachable_objects_from(v, verify_internal_consistency_reachable_i, (void *)data);
- }
- }
- }
-
- return 0;
-}
-#endif /* USE_RGENGC */
-
-/*
- * call-seq:
- * GC.verify_internal_consistency -> nil
- *
- * Verify internal consistency.
- *
- * This method is implementation specific.
- * Now this method checks generatioanl consistency
- * if RGenGC is supported.
- */
-static VALUE
-gc_verify_internal_consistency(VALUE self)
-{
- struct verify_internal_consistency_struct data;
- data.objspace = &rb_objspace;
- data.err_count = 0;
-
-#if USE_RGENGC
- {
- struct each_obj_args eo_args;
- eo_args.callback = verify_internal_consistency_i;
- eo_args.data = (void *)&data;
- objspace_each_objects((VALUE)&eo_args);
- }
-#endif
- if (data.err_count != 0) {
- rb_bug("gc_verify_internal_consistency: found internal consistency.\n");
- }
- return Qnil;
-}
-
-#if RGENGC_CHECK_MODE >= 3
+#if RGENGC_CHECK_MODE >= 4
#define MAKE_ROOTSIG(obj) (((VALUE)(obj) << 1) | 0x01)
#define IS_ROOTSIG(obj) ((VALUE)(obj) & 0x01)
@@ -4276,13 +4738,12 @@ reflist_dump(struct reflist *refs)
fprintf(stderr, "<root@%s>", GET_ROOTSIG(obj));
}
else {
- fprintf(stderr, "<%p@%s>", (void *)obj, obj_type_name(obj));
+ fprintf(stderr, "<%s>", obj_info(obj));
}
if (i+1 < refs->pos) fprintf(stderr, ", ");
}
}
-#if RGENGC_CHECK_MODE >= 3
static int
reflist_refered_from_machine_context(struct reflist *refs)
{
@@ -4293,7 +4754,6 @@ reflist_refered_from_machine_context(struct reflist *refs)
}
return 0;
}
-#endif
struct allrefs {
rb_objspace_t *objspace;
@@ -4307,6 +4767,7 @@ struct allrefs {
struct st_table *references;
const char *category;
VALUE root_obj;
+ mark_stack_t mark_stack;
};
static int
@@ -4331,7 +4792,7 @@ allrefs_i(VALUE obj, void *ptr)
struct allrefs *data = (struct allrefs *)ptr;
if (allrefs_add(data, obj)) {
- push_mark_stack(&data->objspace->mark_stack, obj);
+ push_mark_stack(&data->mark_stack, obj);
}
}
@@ -4343,7 +4804,7 @@ allrefs_roots_i(VALUE obj, void *ptr)
data->root_obj = MAKE_ROOTSIG(data->category);
if (allrefs_add(data, obj)) {
- push_mark_stack(&data->objspace->mark_stack, obj);
+ push_mark_stack(&data->mark_stack, obj);
}
}
@@ -4353,29 +4814,34 @@ objspace_allrefs(rb_objspace_t *objspace)
struct allrefs data;
struct mark_func_data_struct mfd;
VALUE obj;
+ int prev_dont_gc = dont_gc;
+ dont_gc = TRUE;
data.objspace = objspace;
data.references = st_init_numtable();
+ init_mark_stack(&data.mark_stack);
mfd.mark_func = allrefs_roots_i;
mfd.data = &data;
/* traverse root objects */
+ PUSH_MARK_FUNC_DATA(&mfd);
objspace->mark_func_data = &mfd;
- gc_mark_roots(objspace, TRUE, &data.category);
- objspace->mark_func_data = 0;
+ gc_mark_roots(objspace, &data.category);
+ POP_MARK_FUNC_DATA();
/* traverse rest objects reachable from root objects */
- while (pop_mark_stack(&objspace->mark_stack, &obj)) {
+ while (pop_mark_stack(&data.mark_stack, &obj)) {
rb_objspace_reachable_objects_from(data.root_obj = obj, allrefs_i, &data);
}
- shrink_stack_chunk_cache(&objspace->mark_stack);
+ free_stack_chunks(&data.mark_stack);
+ dont_gc = prev_dont_gc;
return data.references;
}
static int
-objspaec_allrefs_destruct_i(st_data_t key, st_data_t value, void *ptr)
+objspace_allrefs_destruct_i(st_data_t key, st_data_t value, void *ptr)
{
struct reflist *refs = (struct reflist *)value;
reflist_destruct(refs);
@@ -4385,21 +4851,17 @@ objspaec_allrefs_destruct_i(st_data_t key, st_data_t value, void *ptr)
static void
objspace_allrefs_destruct(struct st_table *refs)
{
- st_foreach(refs, objspaec_allrefs_destruct_i, 0);
+ st_foreach(refs, objspace_allrefs_destruct_i, 0);
st_free_table(refs);
}
-#if RGENGC_CHECK_MODE >= 4
+#if RGENGC_CHECK_MODE >= 5
static int
allrefs_dump_i(st_data_t k, st_data_t v, st_data_t ptr)
{
VALUE obj = (VALUE)k;
struct reflist *refs = (struct reflist *)v;
- fprintf(stderr, "[allrefs_dump_i] %p (%s%s%s%s) <- ",
- (void *)obj, obj_type_name(obj),
- RVALUE_OLD_P(obj) ? "[O]" : "[Y]",
- RVALUE_WB_PROTECTED(obj) ? "[W]" : "",
- MARKED_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(obj), obj) ? "[R]" : "");
+ fprintf(stderr, "[allrefs_dump_i] %s <- ", obj_info(obj));
reflist_dump(refs);
fprintf(stderr, "\n");
return ST_CONTINUE;
@@ -4413,7 +4875,6 @@ allrefs_dump(rb_objspace_t *objspace)
}
#endif
-#if RGENGC_CHECK_MODE >= 3
static int
gc_check_after_marks_i(st_data_t k, st_data_t v, void *ptr)
{
@@ -4423,7 +4884,7 @@ gc_check_after_marks_i(st_data_t k, st_data_t v, void *ptr)
/* object should be marked or oldgen */
if (!MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj)) {
- fprintf(stderr, "gc_check_after_marks_i: %p (%s) is not marked and not oldgen.\n", (void *)obj, obj_type_name(obj));
+ fprintf(stderr, "gc_check_after_marks_i: %s is not marked and not oldgen.\n", obj_info(obj));
fprintf(stderr, "gc_check_after_marks_i: %p is referred from ", (void *)obj);
reflist_dump(refs);
@@ -4438,12 +4899,10 @@ gc_check_after_marks_i(st_data_t k, st_data_t v, void *ptr)
}
return ST_CONTINUE;
}
-#endif
static void
gc_marks_check(rb_objspace_t *objspace, int (*checker_func)(ANYARGS), const char *checker_name)
{
-
size_t saved_malloc_increase = objspace->malloc_params.increase;
#if RGENGC_ESTIMATE_OLDMALLOC
size_t saved_oldmalloc_increase = objspace->rgengc.oldmalloc_increase;
@@ -4451,13 +4910,16 @@ gc_marks_check(rb_objspace_t *objspace, int (*checker_func)(ANYARGS), const char
VALUE already_disabled = rb_gc_disable();
objspace->rgengc.allrefs_table = objspace_allrefs(objspace);
- st_foreach(objspace->rgengc.allrefs_table, checker_func, (st_data_t)objspace);
+
+ if (checker_func) {
+ st_foreach(objspace->rgengc.allrefs_table, checker_func, (st_data_t)objspace);
+ }
if (objspace->rgengc.error_count > 0) {
-#if RGENGC_CHECK_MODE >= 4
+#if RGENGC_CHECK_MODE >= 5
allrefs_dump(objspace);
#endif
- rb_bug("%s: GC has problem.", checker_name);
+ if (checker_name) rb_bug("%s: GC has problem.", checker_name);
}
objspace_allrefs_destruct(objspace->rgengc.allrefs_table);
@@ -4469,66 +4931,568 @@ gc_marks_check(rb_objspace_t *objspace, int (*checker_func)(ANYARGS), const char
objspace->rgengc.oldmalloc_increase = saved_oldmalloc_increase;
#endif
}
+#endif /* RGENGC_CHECK_MODE >= 4 */
-#endif /* RGENGC_CHECK_MODE >= 2 */
+struct verify_internal_consistency_struct {
+ rb_objspace_t *objspace;
+ int err_count;
+ size_t live_object_count;
+ size_t zombie_object_count;
+#if USE_RGENGC
+ VALUE parent;
+ size_t old_object_count;
+ size_t remembered_shady_count;
+#endif
+};
+
+#if USE_RGENGC
static void
-gc_marks(rb_objspace_t *objspace, int full_mark)
+check_generation_i(const VALUE child, void *ptr)
{
- struct mark_func_data_struct *prev_mark_func_data;
+ struct verify_internal_consistency_struct *data = (struct verify_internal_consistency_struct *)ptr;
+ const VALUE parent = data->parent;
- gc_prof_mark_timer_start(objspace);
- {
- /* setup marking */
- prev_mark_func_data = objspace->mark_func_data;
- objspace->mark_func_data = 0;
+ if (RGENGC_CHECK_MODE) assert(RVALUE_OLD_P(parent));
+
+ if (!RVALUE_OLD_P(child)) {
+ if (!RVALUE_REMEMBERED(parent) &&
+ !RVALUE_REMEMBERED(child) &&
+ !RVALUE_UNCOLLECTIBLE(child)) {
+ fprintf(stderr, "verify_internal_consistency_reachable_i: WB miss (O->Y) %s -> %s\n", obj_info(parent), obj_info(child));
+ data->err_count++;
+ }
+ }
+}
+
+static void
+check_color_i(const VALUE child, void *ptr)
+{
+ struct verify_internal_consistency_struct *data = (struct verify_internal_consistency_struct *)ptr;
+ const VALUE parent = data->parent;
+
+ if (!RVALUE_WB_UNPROTECTED(parent) && RVALUE_WHITE_P(child)) {
+ fprintf(stderr, "verify_internal_consistency_reachable_i: WB miss (B->W) - %s -> %s\n",
+ obj_info(parent), obj_info(child));
+ data->err_count++;
+ }
+}
+#endif
+
+static void
+check_children_i(const VALUE child, void *ptr)
+{
+ check_rvalue_consistency(child);
+}
+
+static int
+verify_internal_consistency_i(void *page_start, void *page_end, size_t stride, void *ptr)
+{
+ struct verify_internal_consistency_struct *data = (struct verify_internal_consistency_struct *)ptr;
+ VALUE obj;
+ rb_objspace_t *objspace = data->objspace;
+
+ for (obj = (VALUE)page_start; obj != (VALUE)page_end; obj += stride) {
+ if (is_live_object(objspace, obj)) {
+ /* count objects */
+ data->live_object_count++;
+
+ rb_objspace_reachable_objects_from(obj, check_children_i, (void *)data);
#if USE_RGENGC
+ /* check health of children */
+ data->parent = obj;
+
+ if (RVALUE_OLD_P(obj)) data->old_object_count++;
+ if (RVALUE_WB_UNPROTECTED(obj) && RVALUE_UNCOLLECTIBLE(obj)) data->remembered_shady_count++;
+
+ if (!is_marking(objspace) && RVALUE_OLD_P(obj)) {
+ /* reachable objects from an oldgen object should be old or (young with remember) */
+ data->parent = obj;
+ rb_objspace_reachable_objects_from(obj, check_generation_i, (void *)data);
+ }
+
+ if (is_incremental_marking(objspace)) {
+ if (RVALUE_BLACK_P(obj)) {
+ /* reachable objects from black objects should be black or grey objects */
+ data->parent = obj;
+ rb_objspace_reachable_objects_from(obj, check_color_i, (void *)data);
+ }
+ }
+#endif
+ }
+ else {
+ if (BUILTIN_TYPE(obj) == T_ZOMBIE) {
+ if (RGENGC_CHECK_MODE) assert(RBASIC(obj)->flags == T_ZOMBIE);
+ data->zombie_object_count++;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int
+gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
+{
+#if USE_RGENGC
+ int i;
+ unsigned int has_remembered_shady = FALSE;
+ unsigned int has_remembered_old = FALSE;
+ int rememberd_old_objects = 0;
+
+ for (i=0; i<page->total_slots; i++) {
+ VALUE obj = (VALUE)&page->start[i];
+ if (RVALUE_PAGE_UNCOLLECTIBLE(page, obj) && RVALUE_PAGE_WB_UNPROTECTED(page, obj)) has_remembered_shady = TRUE;
+ if (RVALUE_PAGE_MARKING(page, obj)) {
+ has_remembered_old = TRUE;
+ rememberd_old_objects++;
+ }
+ }
+
+ if (!is_incremental_marking(objspace) &&
+ page->flags.has_remembered_objects == FALSE && has_remembered_old == TRUE) {
+
+ for (i=0; i<page->total_slots; i++) {
+ VALUE obj = (VALUE)&page->start[i];
+ if (RVALUE_PAGE_MARKING(page, obj)) {
+ fprintf(stderr, "marking -> %s\n", obj_info(obj));
+ }
+ }
+ rb_bug("page %p's has_remembered_objects should be false, but there are remembered old objects (%d). %s",
+ page, rememberd_old_objects, obj ? obj_info(obj) : "");
+ }
+
+ if (page->flags.has_uncollectible_shady_objects == FALSE && has_remembered_shady == TRUE) {
+ rb_bug("page %p's has_remembered_shady should be false, but there are remembered shady objects. %s",
+ page, obj ? obj_info(obj) : "");
+ }
+
+ return rememberd_old_objects;
+#else
+ return 0;
+#endif
+}
+
+static int
+gc_verify_heap_pages(rb_objspace_t *objspace)
+{
+ int rememberd_old_objects = 0;
+ struct heap_page *page = heap_eden->pages;
+
+ while (page) {
+ if (page->flags.has_remembered_objects == FALSE)
+ rememberd_old_objects += gc_verify_heap_page(objspace, page, Qfalse);
+ page = page->next;
+ }
+
+ return rememberd_old_objects;
+}
+
+/*
+ * call-seq:
+ * GC.verify_internal_consistency -> nil
+ *
+ * Verify internal consistency.
+ *
+ * This method is implementation specific.
+ * Now this method checks generational consistency
+ * if RGenGC is supported.
+ */
+static VALUE
+gc_verify_internal_consistency(VALUE dummy)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ struct verify_internal_consistency_struct data = {0};
+ struct each_obj_args eo_args;
+
+ data.objspace = objspace;
+ gc_report(5, objspace, "gc_verify_internal_consistency: start\n");
+
+ /* check relations */
+
+ eo_args.callback = verify_internal_consistency_i;
+ eo_args.data = (void *)&data;
+ objspace_each_objects((VALUE)&eo_args);
+
+ if (data.err_count != 0) {
+#if RGENGC_CHECK_MODE >= 5
+ objspace->rgengc.error_count = data.err_count;
+ gc_marks_check(objspace, NULL, NULL);
+ allrefs_dump(objspace);
+#endif
+ rb_bug("gc_verify_internal_consistency: found internal inconsistency.");
+ }
+
+ /* check heap_page status */
+ gc_verify_heap_pages(objspace);
+
+ /* check counters */
+
+ if (!is_lazy_sweeping(heap_eden) && !finalizing) {
+ if (objspace_live_slots(objspace) != data.live_object_count) {
+ fprintf(stderr, "heap_pages_final_slots: %d, objspace->profile.total_freed_objects: %d\n",
+ (int)heap_pages_final_slots, (int)objspace->profile.total_freed_objects);
+ rb_bug("inconsistent live slot nubmer: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace_live_slots(objspace), data.live_object_count);
+ }
+ }
+
+#if USE_RGENGC
+ if (!is_marking(objspace)) {
+ if (objspace->rgengc.old_objects != data.old_object_count) {
+ rb_bug("inconsistent old slot nubmer: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace->rgengc.old_objects, data.old_object_count);
+ }
+ if (objspace->rgengc.uncollectible_wb_unprotected_objects != data.remembered_shady_count) {
+ rb_bug("inconsistent old slot nubmer: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace->rgengc.uncollectible_wb_unprotected_objects, data.remembered_shady_count);
+ }
+ }
+#endif
+
+ if (!finalizing) {
+ size_t list_count = 0;
+
+ {
+ VALUE z = heap_pages_deferred_final;
+ while (z) {
+ list_count++;
+ z = RZOMBIE(z)->next;
+ }
+ }
+
+ if (heap_pages_final_slots != data.zombie_object_count ||
+ heap_pages_final_slots != list_count) {
+
+ rb_bug("inconsistent finalizing object count:\n"
+ " expect %"PRIuSIZE"\n"
+ " but %"PRIuSIZE" zombies\n"
+ " heap_pages_deferred_final list has %"PRIuSIZE" items.",
+ heap_pages_final_slots,
+ data.zombie_object_count,
+ list_count);
+ }
+ }
+
+ gc_report(5, objspace, "gc_verify_internal_consistency: OK\n");
+
+ return Qnil;
+}
+
+void
+rb_gc_verify_internal_consistency(void)
+{
+ gc_verify_internal_consistency(Qnil);
+}
+
+/* marks */
+
+static void
+gc_marks_start(rb_objspace_t *objspace, int full_mark)
+{
+ /* start marking */
+ gc_report(1, objspace, "gc_marks_start: (%s)\n", full_mark ? "full" : "minor");
+ gc_stat_transition(objspace, gc_stat_marking);
+
+#if USE_RGENGC
+ if (full_mark) {
+#if GC_ENABLE_INCREMENTAL_MARK
+ objspace->rincgc.step_slots = (objspace->marked_slots * 2) / ((objspace->rincgc.pooled_slots / HEAP_OBJ_LIMIT) + 1);
+
+ if (0) fprintf(stderr, "objspace->marked_slots: %d, objspace->rincgc.pooled_page_num: %d, objspace->rincgc.step_slots: %d, \n",
+ (int)objspace->marked_slots, (int)objspace->rincgc.pooled_slots, (int)objspace->rincgc.step_slots);
+#endif
+ objspace->flags.during_minor_gc = FALSE;
+ objspace->profile.major_gc_count++;
+ objspace->rgengc.uncollectible_wb_unprotected_objects = 0;
+ objspace->rgengc.old_objects = 0;
+ objspace->rgengc.last_major_gc = objspace->profile.count;
+ objspace->marked_slots = 0;
+ rgengc_mark_and_rememberset_clear(objspace, heap_eden);
+ }
+ else {
+ objspace->flags.during_minor_gc = TRUE;
+ objspace->marked_slots =
+ objspace->rgengc.old_objects + objspace->rgengc.uncollectible_wb_unprotected_objects; /* uncollectible objects are marked already */
+ objspace->profile.minor_gc_count++;
+ rgengc_rememberset_mark(objspace, heap_eden);
+ }
+#endif
+
+ gc_mark_roots(objspace, NULL);
+
+ gc_report(1, objspace, "gc_marks_start: (%s) end, stack in %d\n", full_mark ? "full" : "minor", (int)mark_stack_size(&objspace->mark_stack));
+}
+
+#if GC_ENABLE_INCREMENTAL_MARK
+static void
+gc_marks_wb_unprotected_objects(rb_objspace_t *objspace)
+{
+ struct heap_page *page = heap_eden->pages;
+
+ while (page) {
+ bits_t *mark_bits = page->mark_bits;
+ bits_t *wbun_bits = page->wb_unprotected_bits;
+ RVALUE *p = page->start;
+ RVALUE *offset = p - NUM_IN_PAGE(p);
+ size_t j;
+
+ for (j=0; j<HEAP_BITMAP_LIMIT; j++) {
+ bits_t bits = mark_bits[j] & wbun_bits[j];
+
+ if (bits) {
+ p = offset + j * BITS_BITLENGTH;
+
+ do {
+ if (bits & 1) {
+ gc_report(2, objspace, "gc_marks_wb_unprotected_objects: marked shady: %s\n", obj_info((VALUE)p));
+ if (RGENGC_CHECK_MODE > 0) {
+ assert(RVALUE_WB_UNPROTECTED((VALUE)p));
+ assert(RVALUE_MARKED((VALUE)p));
+ }
+ gc_mark_children(objspace, (VALUE)p);
+ }
+ p++;
+ bits >>= 1;
+ } while (bits);
+ }
+ }
+
+ page = page->next;
+ }
+
+ gc_mark_stacked_objects_all(objspace);
+}
+
+static struct heap_page *
+heap_move_pooled_pages_to_free_pages(rb_heap_t *heap)
+{
+ struct heap_page *page = heap->pooled_pages;
+
+ if (page) {
+ heap->pooled_pages = page->free_next;
+ page->free_next = heap->free_pages;
+ heap->free_pages = page;
+ }
+
+ return page;
+}
+#endif
+
+static int
+gc_marks_finish(rb_objspace_t *objspace)
+{
+#if GC_ENABLE_INCREMENTAL_MARK
+ /* finish incremental GC */
+ if (is_incremental_marking(objspace)) {
+ if (heap_eden->pooled_pages) {
+ heap_move_pooled_pages_to_free_pages(heap_eden);
+ gc_report(1, objspace, "gc_marks_finish: pooled pages are exists. retry.\n");
+ return FALSE; /* continue marking phase */
+ }
+
+ if (RGENGC_CHECK_MODE && is_mark_stack_empty(&objspace->mark_stack) == 0) {
+ rb_bug("gc_marks_finish: mark stack is not empty (%d).", (int)mark_stack_size(&objspace->mark_stack));
+ }
+
+ gc_mark_roots(objspace, 0);
+
+ if (is_mark_stack_empty(&objspace->mark_stack) == FALSE) {
+ gc_report(1, objspace, "gc_marks_finish: not empty (%d). retry.\n", (int)mark_stack_size(&objspace->mark_stack));
+ return FALSE;
+ }
#if RGENGC_CHECK_MODE >= 2
- gc_verify_internal_consistency(Qnil);
+ if (gc_verify_heap_pages(objspace) != 0) {
+ rb_bug("gc_marks_finish (incremental): there are remembered old objects.");
+ }
+#endif
+
+ objspace->flags.during_incremental_marking = FALSE;
+ /* check children of all marked wb-unprotected objects */
+ gc_marks_wb_unprotected_objects(objspace);
+ }
+#endif /* GC_ENABLE_INCREMENTAL_MARK */
+
+#if RGENGC_CHECK_MODE >= 2
+ gc_verify_internal_consistency(Qnil);
+#endif
+
+#if USE_RGENGC
+ if (is_full_marking(objspace)) {
+ /* See the comment about RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR */
+ const double r = gc_params.oldobject_limit_factor;
+ objspace->rgengc.uncollectible_wb_unprotected_objects_limit = (size_t)(objspace->rgengc.uncollectible_wb_unprotected_objects * r);
+ objspace->rgengc.old_objects_limit = (size_t)(objspace->rgengc.old_objects * r);
+ }
+#endif
+
+#if RGENGC_CHECK_MODE >= 4
+ gc_marks_check(objspace, gc_check_after_marks_i, "after_marks");
+#endif
+
+ { /* decide full GC is needed or not */
+ rb_heap_t *heap = heap_eden;
+ size_t sweep_slots =
+ (heap_allocatable_pages * HEAP_OBJ_LIMIT) + /* allocatable slots in empty pages */
+ (heap->total_slots - objspace->marked_slots); /* will be sweep slots */
+
+#if RGENGC_CHECK_MODE
+ assert(heap->total_slots >= objspace->marked_slots);
+#endif
+
+ if (sweep_slots < heap_pages_min_free_slots) {
+#if USE_RGENGC
+ if (!is_full_marking(objspace) && objspace->profile.count - objspace->rgengc.last_major_gc > 3 /* magic number */) {
+ gc_report(1, objspace, "gc_marks_finish: next is full GC!!)\n");
+ objspace->rgengc.need_major_gc |= GPR_FLAG_MAJOR_BY_NOFREE;
+ }
+ else {
+ gc_report(1, objspace, "gc_marks_finish: heap_set_increment!!\n");
+ heap_set_increment(objspace, heap_extend_pages(objspace));
+ heap_increment(objspace, heap);
+ }
+#else
+ gc_report(1, objspace, "gc_marks_finish: heap_set_increment!!\n");
+ heap_set_increment(objspace, heap_extend_pages(objspace));
+ heap_increment(objspace, heap);
+#endif
+ }
+
+#if USE_RGENGC
+ if (objspace->rgengc.uncollectible_wb_unprotected_objects > objspace->rgengc.uncollectible_wb_unprotected_objects_limit) {
+ objspace->rgengc.need_major_gc |= GPR_FLAG_MAJOR_BY_SHADY;
+ }
+ if (objspace->rgengc.old_objects > objspace->rgengc.old_objects_limit) {
+ objspace->rgengc.need_major_gc |= GPR_FLAG_MAJOR_BY_OLDGEN;
+ }
+ if (RGENGC_FORCE_MAJOR_GC) {
+ objspace->rgengc.need_major_gc = GPR_FLAG_MAJOR_BY_FORCE;
+ }
+
+ gc_report(1, objspace, "gc_marks_finish (marks %d objects, old %d objects, total %d slots, sweep %d slots, increment: %d, next GC: %s)\n",
+ (int)objspace->marked_slots, (int)objspace->rgengc.old_objects, (int)heap->total_slots, (int)sweep_slots, (int)heap_allocatable_pages,
+ objspace->rgengc.need_major_gc ? "major" : "minor");
+#endif
+ }
+
+ gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_END_MARK, 0);
+
+ return TRUE;
+}
+
+#if GC_ENABLE_INCREMENTAL_MARK
+static void
+gc_marks_step(rb_objspace_t *objspace, int slots)
+{
+ if (RGENGC_CHECK_MODE) assert(is_marking(objspace));
+
+ if (gc_mark_stacked_objects_incremental(objspace, slots)) {
+ if (gc_marks_finish(objspace)) {
+ /* finish */
+ gc_sweep(objspace);
+ }
+ }
+ if (0) fprintf(stderr, "objspace->marked_slots: %d\n", (int)objspace->marked_slots);
+}
#endif
- if (full_mark == TRUE) { /* major/full GC */
- objspace->rgengc.remembered_shady_object_count = 0;
- objspace->rgengc.old_object_count = 0;
-#if RGENGC_THREEGEN
- objspace->rgengc.young_object_count = 0;
+
+static void
+gc_marks_rest(rb_objspace_t *objspace)
+{
+ gc_report(1, objspace, "gc_marks_rest\n");
+
+#if GC_ENABLE_INCREMENTAL_MARK
+ heap_eden->pooled_pages = NULL;
#endif
- gc_marks_body(objspace, TRUE);
+ if (is_incremental_marking(objspace)) {
+ do {
+ while (gc_mark_stacked_objects_incremental(objspace, INT_MAX) == FALSE);
+ } while (gc_marks_finish(objspace) == FALSE);
+ }
+ else {
+ gc_mark_stacked_objects_all(objspace);
+ gc_marks_finish(objspace);
+ }
+
+ /* move to sweep */
+ gc_sweep(objspace);
+}
- /* Do full GC if old/remembered_shady object counts is greater than counts two times at last full GC counts */
- objspace->rgengc.remembered_shady_object_limit = objspace->rgengc.remembered_shady_object_count * 2;
- objspace->rgengc.old_object_limit = objspace->rgengc.old_object_count * 2;
+#if GC_ENABLE_INCREMENTAL_MARK
+static void
+gc_marks_continue(rb_objspace_t *objspace, rb_heap_t *heap)
+{
+ int slots = 0;
+ const char *from;
+
+ if (RGENGC_CHECK_MODE) assert(dont_gc == FALSE);
+
+ gc_enter(objspace, "marks_continue");
+
+ PUSH_MARK_FUNC_DATA(NULL);
+ {
+ if (heap->pooled_pages) {
+ while (heap->pooled_pages && slots < HEAP_OBJ_LIMIT) {
+ struct heap_page *page = heap_move_pooled_pages_to_free_pages(heap);
+ slots += page->free_slots;
+ }
+ from = "pooled-pages";
+ }
+ else if (heap_increment(objspace, heap)) {
+ slots = heap->free_pages->free_slots;
+ from = "incremented-pages";
+ }
+
+ if (slots > 0) {
+ gc_report(2, objspace, "gc_marks_continue: provide %d slots from %s.\n", slots, from);
+ gc_marks_step(objspace, (int)objspace->rincgc.step_slots);
}
- else { /* minor GC */
- gc_marks_body(objspace, FALSE);
+ else {
+ gc_report(2, objspace, "gc_marks_continue: no more pooled pages (stack depth: %d).\n", (int)mark_stack_size(&objspace->mark_stack));
+ gc_marks_rest(objspace);
+ }
+ }
+ POP_MARK_FUNC_DATA();
+
+ gc_exit(objspace, "marks_continue");
+}
+#endif
+
+static void
+gc_marks(rb_objspace_t *objspace, int full_mark)
+{
+ gc_prof_mark_timer_start(objspace);
+
+ PUSH_MARK_FUNC_DATA(NULL);
+ {
+ /* setup marking */
+
+#if USE_RGENGC
+ gc_marks_start(objspace, full_mark);
+ if (!is_incremental_marking(objspace)) {
+ gc_marks_rest(objspace);
}
#if RGENGC_PROFILE > 0
if (gc_prof_record(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);
- record->old_objects = objspace->rgengc.old_object_count;
+ record->old_objects = objspace->rgengc.old_objects;
}
#endif
-#if RGENGC_CHECK_MODE >= 3
- gc_marks_check(objspace, gc_check_after_marks_i, "after_marks");
-#endif
-
#else /* USE_RGENGC */
- gc_marks_body(objspace, TRUE);
+ gc_marks_start(objspace, TRUE);
+ gc_marks_rest(objspace);
#endif
-
- objspace->mark_func_data = prev_mark_func_data;
}
+ POP_MARK_FUNC_DATA();
gc_prof_mark_timer_stop(objspace);
}
/* RGENGC */
static void
-rgengc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...)
+gc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...)
{
if (level <= RGENGC_DEBUG) {
char buf[1024];
@@ -4538,7 +5502,15 @@ rgengc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...)
#if USE_RGENGC
if (during_gc) {
- status = objspace->rgengc.during_minor_gc ? "-" : "+";
+ status = is_full_marking(objspace) ? "+" : "-";
+ }
+ else {
+ if (is_lazy_sweeping(heap_eden)) {
+ status = "S";
+ }
+ if (is_incremental_marking(objspace)) {
+ status = "M";
+ }
}
#endif
@@ -4558,18 +5530,22 @@ rgengc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...)
static int
rgengc_remembersetbits_get(rb_objspace_t *objspace, VALUE obj)
{
- bits_t *bits = GET_HEAP_REMEMBERSET_BITS(obj);
- return MARKED_IN_BITMAP(bits, obj) ? 1 : 0;
+ return RVALUE_REMEMBERED(obj);
}
static int
rgengc_remembersetbits_set(rb_objspace_t *objspace, VALUE obj)
{
- bits_t *bits = GET_HEAP_REMEMBERSET_BITS(obj);
+ struct heap_page *page = GET_HEAP_PAGE(obj);
+ bits_t *bits = &page->marking_bits[0];
+
+ if (RGENGC_CHECK_MODE) assert(!is_incremental_marking(objspace));
+
if (MARKED_IN_BITMAP(bits, obj)) {
return FALSE;
}
else {
+ page->flags.has_remembered_objects = TRUE;
MARK_IN_BITMAP(bits, obj);
return TRUE;
}
@@ -4581,41 +5557,25 @@ rgengc_remembersetbits_set(rb_objspace_t *objspace, VALUE obj)
static int
rgengc_remember(rb_objspace_t *objspace, VALUE obj)
{
- rgengc_report(2, objspace, "rgengc_remember: %p (%s, %s) %s\n", (void *)obj, obj_type_name(obj),
- RVALUE_WB_PROTECTED(obj) ? "WB-protected" : "non-WB-protected",
- rgengc_remembersetbits_get(objspace, obj) ? "was already remembered" : "is remembered now");
+ gc_report(6, objspace, "rgengc_remember: %s %s\n", obj_info(obj),
+ rgengc_remembersetbits_get(objspace, obj) ? "was already remembered" : "is remembered now");
-#if RGENGC_CHECK_MODE > 0
- {
- switch (BUILTIN_TYPE(obj)) {
- case T_NONE:
- case T_ZOMBIE:
- rb_bug("rgengc_remember: should not remember %p (%s)\n",
- (void *)obj, obj_type_name(obj));
- default:
- ;
- }
+ check_rvalue_consistency(obj);
+
+ if (RGENGC_CHECK_MODE) {
+ if (RVALUE_WB_UNPROTECTED(obj)) rb_bug("rgengc_remember: %s is not wb protected.", obj_info(obj));
}
-#endif
- if (RGENGC_PROFILE) {
- if (!rgengc_remembered(objspace, obj)) {
#if RGENGC_PROFILE > 0
- if (RVALUE_WB_PROTECTED(obj)) {
- objspace->profile.remembered_normal_object_count++;
-#if RGENGC_PROFILE >= 2
- objspace->profile.remembered_normal_object_count_types[BUILTIN_TYPE(obj)]++;
-#endif
- }
- else {
- objspace->profile.remembered_shady_object_count++;
+ if (!rgengc_remembered(objspace, obj)) {
+ if (RVALUE_WB_UNPROTECTED(obj) == 0) {
+ objspace->profile.total_remembered_normal_object_count++;
#if RGENGC_PROFILE >= 2
- objspace->profile.remembered_shady_object_count_types[BUILTIN_TYPE(obj)]++;
+ objspace->profile.remembered_normal_object_count_types[BUILTIN_TYPE(obj)]++;
#endif
- }
-#endif /* RGENGC_PROFILE > 0 */
}
}
+#endif /* RGENGC_PROFILE > 0 */
return rgengc_remembersetbits_set(objspace, obj);
}
@@ -4624,75 +5584,81 @@ static int
rgengc_remembered(rb_objspace_t *objspace, VALUE obj)
{
int result = rgengc_remembersetbits_get(objspace, obj);
- check_gen_consistency(obj);
- rgengc_report(6, objspace, "gc_remembered: %p (%s) => %d\n", (void *)obj, obj_type_name(obj), result);
+ check_rvalue_consistency(obj);
+ gc_report(6, objspace, "rgengc_remembered: %s\n", obj_info(obj));
return result;
}
+#ifndef PROFILE_REMEMBERSET_MARK
+#define PROFILE_REMEMBERSET_MARK 0
+#endif
+
static void
rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap)
{
size_t j;
- RVALUE *p, *offset;
- bits_t *bits, bitset;
struct heap_page *page = heap->pages;
-
-#if RGENGC_PROFILE > 0
- size_t shady_object_count = 0, clear_count = 0;
+#if PROFILE_REMEMBERSET_MARK
+ int has_old = 0, has_shady = 0, has_both = 0, skip = 0;
#endif
+ gc_report(1, objspace, "rgengc_rememberset_mark: start\n");
while (page) {
- p = page->start;
- bits = page->rememberset_bits;
- offset = p - NUM_IN_PAGE(p);
+ if (page->flags.has_remembered_objects | page->flags.has_uncollectible_shady_objects) {
+ RVALUE *p = page->start;
+ RVALUE *offset = p - NUM_IN_PAGE(p);
+ bits_t bitset, bits[HEAP_BITMAP_LIMIT];
+ bits_t *marking_bits = page->marking_bits;
+ bits_t *uncollectible_bits = page->uncollectible_bits;
+ bits_t *wb_unprotected_bits = page->wb_unprotected_bits;
+#if PROFILE_REMEMBERSET_MARK
+ if (page->flags.has_remembered_objects && page->flags.has_uncollectible_shady_objects) has_both++;
+ else if (page->flags.has_remembered_objects) has_old++;
+ else if (page->flags.has_uncollectible_shady_objects) has_shady++;
+#endif
+ for (j=0; j<HEAP_BITMAP_LIMIT; j++) {
+ bits[j] = marking_bits[j] | (uncollectible_bits[j] & wb_unprotected_bits[j]);
+ marking_bits[j] = 0;
+ }
+ page->flags.has_remembered_objects = FALSE;
- for (j=0; j < HEAP_BITMAP_LIMIT; j++) {
- if (bits[j]) {
- p = offset + j * BITS_BITLENGTH;
+ for (j=0; j < HEAP_BITMAP_LIMIT; j++) {
bitset = bits[j];
- do {
- if (bitset & 1) {
- /* mark before RVALUE_PROMOTE_... */
- gc_mark_ptr(objspace, (VALUE)p);
- if (RVALUE_WB_PROTECTED(p)) {
- rgengc_report(2, objspace, "rgengc_rememberset_mark: clear %p (%s)\n", p, obj_type_name((VALUE)p));
-#if RGENGC_THREEGEN
- if (RVALUE_INFANT_P((VALUE)p)) RVALUE_PROMOTE_INFANT((VALUE)p);
- if (RVALUE_YOUNG_P((VALUE)p)) RVALUE_PROMOTE_YOUNG((VALUE)p);
-#endif
- CLEAR_IN_BITMAP(bits, p);
-#if RGENGC_PROFILE > 0
- clear_count++;
-#endif
- }
- else {
-#if RGENGC_PROFILE > 0
- shady_object_count++;
-#endif
- }
+ if (bitset) {
+ p = offset + j * BITS_BITLENGTH;
- rgengc_report(2, objspace, "rgengc_rememberset_mark: mark %p (%s)\n", p, obj_type_name((VALUE)p));
- gc_mark_children(objspace, (VALUE) p);
- }
- p++;
- bitset >>= 1;
- } while (bitset);
+ do {
+ if (bitset & 1) {
+ VALUE obj = (VALUE)p;
+ gc_report(2, objspace, "rgengc_rememberset_mark: mark %s\n", obj_info(obj));
+
+ if (RGENGC_CHECK_MODE) {
+ assert(RVALUE_UNCOLLECTIBLE(obj));
+ assert(RVALUE_OLD_P(obj) || RVALUE_WB_UNPROTECTED(obj));
+ }
+
+ gc_mark_children(objspace, obj);
+ }
+ p++;
+ bitset >>= 1;
+ } while (bitset);
+ }
}
}
+#if PROFILE_REMEMBERSET_MARK
+ else {
+ skip++;
+ }
+#endif
+
page = page->next;
}
- rgengc_report(2, objspace, "rgengc_rememberset_mark: finished\n");
-
-#if RGENGC_PROFILE > 0
- rgengc_report(2, objspace, "rgengc_rememberset_mark: clear_count: %"PRIdSIZE", shady_object_count: %"PRIdSIZE"\n", clear_count, shady_object_count);
- if (gc_prof_record(objspace)) {
- gc_profile_record *record = gc_prof_record(objspace);
- record->remembered_normal_objects = clear_count;
- record->remembered_shady_objects = shady_object_count;
- }
+#if PROFILE_REMEMBERSET_MARK
+ fprintf(stderr, "%d\t%d\t%d\t%d\n", has_both, has_old, has_shady, skip);
#endif
+ gc_report(1, objspace, "rgengc_rememberset_mark: finished\n");
}
static void
@@ -4701,87 +5667,177 @@ rgengc_mark_and_rememberset_clear(rb_objspace_t *objspace, rb_heap_t *heap)
struct heap_page *page = heap->pages;
while (page) {
- memset(&page->mark_bits[0], 0, HEAP_BITMAP_SIZE);
- memset(&page->rememberset_bits[0], 0, HEAP_BITMAP_SIZE);
+ memset(&page->mark_bits[0], 0, HEAP_BITMAP_SIZE);
+ memset(&page->marking_bits[0], 0, HEAP_BITMAP_SIZE);
+ memset(&page->uncollectible_bits[0], 0, HEAP_BITMAP_SIZE);
+ page->flags.has_uncollectible_shady_objects = FALSE;
+ page->flags.has_remembered_objects = FALSE;
page = page->next;
}
}
/* RGENGC: APIs */
-void
-rb_gc_writebarrier(VALUE a, VALUE b)
+NOINLINE(static void gc_writebarrier_generational(VALUE a, VALUE b, rb_objspace_t *objspace));
+
+static void
+gc_writebarrier_generational(VALUE a, VALUE b, rb_objspace_t *objspace)
{
if (RGENGC_CHECK_MODE) {
- if (!RVALUE_PROMOTED_P(a)) rb_bug("rb_gc_writebarrier: referer object %p (%s) is not promoted.\n", (void *)a, obj_type_name(a));
+ if (!RVALUE_OLD_P(a)) rb_bug("gc_writebarrier_generational: %s is not an old object.", obj_info(a));
+ if ( RVALUE_OLD_P(b)) rb_bug("gc_writebarrier_generational: %s is an old object.", obj_info(b));
+ if (is_incremental_marking(objspace)) rb_bug("gc_writebarrier_generational: called while incremental marking: %s -> %s", obj_info(a), obj_info(b));
}
- if (!RVALUE_OLD_P(b) && RVALUE_OLD_BITMAP_P(a)) {
- rb_objspace_t *objspace = &rb_objspace;
+#if 1
+ /* mark `a' and remember (default behavior) */
+ if (!rgengc_remembered(objspace, a)) {
+ rgengc_remember(objspace, a);
+ gc_report(1, objspace, "gc_writebarrier_generational: %s (remembered) -> %s\n", obj_info(a), obj_info(b));
+ }
+#else
+ /* mark `b' and remember */
+ MARK_IN_BITMAP(GET_HEAP_MARK_BITS(b), b);
+ if (RVALUE_WB_UNPROTECTED(b)) {
+ gc_remember_unprotected(objspace, b);
+ }
+ else {
+ RVALUE_AGE_SET_OLD(objspace, b);
+ rgengc_remember(objspace, b);
+ }
+
+ gc_report(1, objspace, "gc_writebarrier_generational: %s -> %s (remembered)\n", obj_info(a), obj_info(b));
+#endif
+
+ check_rvalue_consistency(a);
+ check_rvalue_consistency(b);
+}
+
+#if GC_ENABLE_INCREMENTAL_MARK
+static void
+gc_mark_from(rb_objspace_t *objspace, VALUE obj, VALUE parent)
+{
+ gc_mark_set_parent(objspace, parent);
+ rgengc_check_relation(objspace, obj);
+ if (gc_mark_set(objspace, obj) == FALSE) return;
+ gc_aging(objspace, obj);
+ gc_grey(objspace, obj);
+}
+
+NOINLINE(static void gc_writebarrier_incremental(VALUE a, VALUE b, rb_objspace_t *objspace));
+
+static void
+gc_writebarrier_incremental(VALUE a, VALUE b, rb_objspace_t *objspace)
+{
+ gc_report(2, objspace, "gc_writebarrier_incremental: [LG] %s -> %s\n", obj_info(a), obj_info(b));
+
+ if (RVALUE_BLACK_P(a)) {
+ if (RVALUE_WHITE_P(b)) {
+ if (!RVALUE_WB_UNPROTECTED(a)) {
+ gc_report(2, objspace, "gc_writebarrier_incremental: [IN] %s -> %s\n", obj_info(a), obj_info(b));
+ gc_mark_from(objspace, b, a);
+ }
+ }
+ else if (RVALUE_OLD_P(a) && !RVALUE_OLD_P(b)) {
+ if (!RVALUE_WB_UNPROTECTED(b)) {
+ gc_report(1, objspace, "gc_writebarrier_incremental: [GN] %s -> %s\n", obj_info(a), obj_info(b));
+ RVALUE_AGE_SET_OLD(objspace, b);
- if (!rgengc_remembered(objspace, a)) {
- int type = BUILTIN_TYPE(a);
- /* TODO: 2 << 16 is just a magic number. */
- if ((type == T_ARRAY && RARRAY_LEN(a) >= 2 << 16) ||
- (type == T_HASH && RHASH_SIZE(a) >= 2 << 16)) {
- if (!rgengc_remembered(objspace, b)) {
- rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n", (void *)a, obj_type_name(a), (void *)b, obj_type_name(b));
- rgengc_remember(objspace, b);
+ if (RVALUE_BLACK_P(b)) {
+ gc_grey(objspace, b);
}
}
else {
- rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n",
- (void *)a, obj_type_name(a), (void *)b, obj_type_name(b));
- rgengc_remember(objspace, a);
+ gc_report(1, objspace, "gc_writebarrier_incremental: [LL] %s -> %s\n", obj_info(a), obj_info(b));
+ gc_remember_unprotected(objspace, b);
}
}
}
}
+#else
+#define gc_writebarrier_incremental(a, b, objspace)
+#endif
void
-rb_gc_writebarrier_unprotect_promoted(VALUE obj)
+rb_gc_writebarrier(VALUE a, VALUE b)
{
rb_objspace_t *objspace = &rb_objspace;
- if (RGENGC_CHECK_MODE) {
- if (!RVALUE_PROMOTED_P(obj)) rb_bug("rb_gc_writebarrier_unprotect_promoted: called on non-promoted object");
- if (!RVALUE_WB_PROTECTED(obj)) rb_bug("rb_gc_writebarrier_unprotect_promoted: called on shady object");
+ if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(a)) rb_bug("rb_gc_writebarrier: a is special const");
+ if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(b)) rb_bug("rb_gc_writebarrier: b is special const");
+
+ if (!is_incremental_marking(objspace)) {
+ if (!RVALUE_OLD_P(a) || RVALUE_OLD_P(b)) {
+ return;
+ }
+ else {
+ gc_writebarrier_generational(a, b, objspace);
+ }
}
+ else { /* slow path */
+ gc_writebarrier_incremental(a, b, objspace);
+ }
+}
- rgengc_report(0, objspace, "rb_gc_writebarrier_unprotect_promoted: %p (%s)%s\n", (void *)obj, obj_type_name(obj),
- rgengc_remembered(objspace, obj) ? " (already remembered)" : "");
+void
+rb_gc_writebarrier_unprotect(VALUE obj)
+{
+ if (RVALUE_WB_UNPROTECTED(obj)) {
+ return;
+ }
+ else {
+ rb_objspace_t *objspace = &rb_objspace;
- if (RVALUE_OLD_P(obj)) {
- RVALUE_DEMOTE_FROM_OLD(obj);
+ gc_report(2, objspace, "rb_gc_writebarrier_unprotect: %s %s\n", obj_info(obj),
+ rgengc_remembered(objspace, obj) ? " (already remembered)" : "");
- rgengc_remember(objspace, obj);
- objspace->rgengc.remembered_shady_object_count++;
+ if (RVALUE_OLD_P(obj)) {
+ gc_report(1, objspace, "rb_gc_writebarrier_unprotect: %s\n", obj_info(obj));
+ RVALUE_DEMOTE(objspace, obj);
+ gc_mark_set(objspace, obj);
+ gc_remember_unprotected(objspace, obj);
#if RGENGC_PROFILE
- objspace->profile.shade_operation_count++;
+ objspace->profile.total_shade_operation_count++;
#if RGENGC_PROFILE >= 2
- objspace->profile.shade_operation_count_types[BUILTIN_TYPE(obj)]++;
+ objspace->profile.shade_operation_count_types[BUILTIN_TYPE(obj)]++;
#endif /* RGENGC_PROFILE >= 2 */
#endif /* RGENGC_PROFILE */
+ }
+ else {
+ RVALUE_AGE_RESET(obj);
+ }
+
+ MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
}
-#if RGENGC_THREEGEN
- else {
- RVALUE_DEMOTE_FROM_YOUNG(obj);
- }
-#endif
}
+/*
+ * remember `obj' if needed.
+ */
void
-rb_gc_writebarrier_remember_promoted(VALUE obj)
+rb_gc_writebarrier_remember(VALUE obj)
{
rb_objspace_t *objspace = &rb_objspace;
- rgengc_remember(objspace, obj);
+
+ gc_report(1, objspace, "rb_gc_writebarrier_remember: %s\n", obj_info(obj));
+
+ if (is_incremental_marking(objspace)) {
+ if (RVALUE_BLACK_P(obj)) {
+ gc_grey(objspace, obj);
+ }
+ }
+ else {
+ if (RVALUE_OLD_P(obj)) {
+ rgengc_remember(objspace, obj);
+ }
+ }
}
static st_table *rgengc_unprotect_logging_table;
static int
-rgengc_unprotect_logging_exit_func_i(st_data_t key, st_data_t val)
+rgengc_unprotect_logging_exit_func_i(st_data_t key, st_data_t val, st_data_t arg)
{
fprintf(stderr, "%s\t%d\n", (char *)key, (int)val);
return ST_CONTINUE;
@@ -4803,12 +5859,12 @@ rb_gc_unprotect_logging(void *objptr, const char *filename, int line)
atexit(rgengc_unprotect_logging_exit_func);
}
- if (OBJ_WB_PROTECTED(obj)) {
+ if (RVALUE_WB_UNPROTECTED(obj) == 0) {
char buff[0x100];
st_data_t cnt = 1;
char *ptr = buff;
- snprintf(ptr, 0x100 - 1, "%s|%s:%d", obj_type_name(obj), filename, line);
+ snprintf(ptr, 0x100 - 1, "%s|%s:%d", obj_info(obj), filename, line);
if (st_lookup(rgengc_unprotect_logging_table, (st_data_t)ptr, &cnt)) {
cnt++;
@@ -4820,15 +5876,38 @@ rb_gc_unprotect_logging(void *objptr, const char *filename, int line)
st_insert(rgengc_unprotect_logging_table, (st_data_t)ptr, cnt);
}
}
-
#endif /* USE_RGENGC */
+void
+rb_copy_wb_protected_attribute(VALUE dest, VALUE obj)
+{
+#if USE_RGENGC
+ rb_objspace_t *objspace = &rb_objspace;
+
+ if (RVALUE_WB_UNPROTECTED(obj) && !RVALUE_WB_UNPROTECTED(dest)) {
+ if (!RVALUE_OLD_P(dest)) {
+ MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(dest), dest);
+ RVALUE_AGE_RESET_RAW(dest);
+ }
+ else {
+ RVALUE_DEMOTE(objspace, dest);
+ }
+ }
+
+ check_rvalue_consistency(dest);
+#endif
+}
+
/* RGENGC analysis information */
VALUE
rb_obj_rgengc_writebarrier_protected_p(VALUE obj)
{
- return OBJ_WB_PROTECTED(obj) ? Qtrue : Qfalse;
+#if USE_RGENGC
+ return RVALUE_WB_UNPROTECTED(obj) ? Qfalse : Qtrue;
+#else
+ return Qfalse;
+#endif
}
VALUE
@@ -4843,10 +5922,7 @@ rb_obj_gc_flags(VALUE obj, ID* flags, size_t max)
size_t n = 0;
static ID ID_marked;
#if USE_RGENGC
- static ID ID_wb_protected, ID_old, ID_remembered;
-#if RGENGC_THREEGEN
- static ID ID_young, ID_infant;
-#endif
+ static ID ID_wb_protected, ID_old, ID_marking, ID_uncollectible;
#endif
if (!ID_marked) {
@@ -4855,52 +5931,64 @@ rb_obj_gc_flags(VALUE obj, ID* flags, size_t max)
#if USE_RGENGC
I(wb_protected);
I(old);
- I(remembered);
-#if RGENGC_THREEGEN
- I(young);
- I(infant);
-#endif
+ I(marking);
+ I(uncollectible);
#endif
#undef I
}
#if USE_RGENGC
- if (OBJ_WB_PROTECTED(obj) && n<max)
- flags[n++] = ID_wb_protected;
- if (RVALUE_OLD_P(obj) && n<max)
- flags[n++] = ID_old;
-#if RGENGC_THREEGEN
- if (RVALUE_YOUNG_P(obj) && n<max)
- flags[n++] = ID_young;
- if (RVALUE_INFANT_P(obj) && n<max)
- flags[n++] = ID_infant;
-#endif
- if (MARKED_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(obj), obj) && n<max)
- flags[n++] = ID_remembered;
-#endif
- if (MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj) && n<max)
- flags[n++] = ID_marked;
-
+ if (RVALUE_WB_UNPROTECTED(obj) == 0 && n<max) flags[n++] = ID_wb_protected;
+ if (RVALUE_OLD_P(obj) && n<max) flags[n++] = ID_old;
+ if (RVALUE_UNCOLLECTIBLE(obj) && n<max) flags[n++] = ID_uncollectible;
+ if (MARKED_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj) && n<max) flags[n++] = ID_marking;
+#endif
+ if (MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj) && n<max) flags[n++] = ID_marked;
return n;
}
/* GC */
void
-rb_gc_force_recycle(VALUE p)
+rb_gc_force_recycle(VALUE obj)
{
rb_objspace_t *objspace = &rb_objspace;
#if USE_RGENGC
- CLEAR_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(p), p);
- CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(p), p);
- if (!GET_HEAP_PAGE(p)->before_sweep) {
- CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS(p), p);
+ int is_old = RVALUE_OLD_P(obj);
+
+ gc_report(2, objspace, "rb_gc_force_recycle: %s\n", obj_info(obj));
+
+ if (is_old) {
+ if (RVALUE_MARKED(obj)) {
+ objspace->rgengc.old_objects--;
+ }
+ }
+ CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS(obj), obj);
+ CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
+
+#if GC_ENABLE_INCREMENTAL_MARK
+ if (is_incremental_marking(objspace)) {
+ if (MARKED_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj)) {
+ invalidate_mark_stack(&objspace->mark_stack, obj);
+ CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
+ }
+ CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj);
+ }
+ else {
+#endif
+ if (is_old || !GET_HEAP_PAGE(obj)->flags.before_sweep) {
+ CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj);
+ }
+ CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
+#if GC_ENABLE_INCREMENTAL_MARK
}
#endif
+#endif
- objspace->profile.total_freed_object_num++;
- heap_page_add_freeobj(objspace, GET_HEAP_PAGE(p), p);
+ objspace->profile.total_freed_objects++;
+
+ heap_page_add_freeobj(objspace, GET_HEAP_PAGE(obj), obj);
/* Disable counting swept_slots because there are no meaning.
* if (!MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(p), p)) {
@@ -4909,10 +5997,21 @@ rb_gc_force_recycle(VALUE p)
*/
}
+#ifndef MARK_OBJECT_ARY_BUCKET_SIZE
+#define MARK_OBJECT_ARY_BUCKET_SIZE 1024
+#endif
+
void
rb_gc_register_mark_object(VALUE obj)
{
- VALUE ary = GET_THREAD()->vm->mark_object_ary;
+ VALUE ary_ary = GET_THREAD()->vm->mark_object_ary;
+ VALUE ary = rb_ary_last(0, 0, ary_ary);
+
+ if (ary == Qnil || RARRAY_LEN(ary) >= MARK_OBJECT_ARY_BUCKET_SIZE) {
+ ary = rb_ary_tmp_new(MARK_OBJECT_ARY_BUCKET_SIZE);
+ rb_ary_push(ary_ary, ary);
+ }
+
rb_ary_push(ary, obj);
}
@@ -4923,19 +6022,19 @@ rb_gc_register_address(VALUE *addr)
struct gc_list *tmp;
tmp = ALLOC(struct gc_list);
- tmp->next = global_List;
+ tmp->next = global_list;
tmp->varptr = addr;
- global_List = tmp;
+ global_list = tmp;
}
void
rb_gc_unregister_address(VALUE *addr)
{
rb_objspace_t *objspace = &rb_objspace;
- struct gc_list *tmp = global_List;
+ struct gc_list *tmp = global_list;
if (tmp->varptr == addr) {
- global_List = tmp->next;
+ global_list = tmp->next;
xfree(tmp);
return;
}
@@ -4959,134 +6058,356 @@ rb_global_variable(VALUE *var)
#define GC_NOTIFY 0
+enum {
+ gc_stress_no_major,
+ gc_stress_no_immediate_sweep,
+ gc_stress_full_mark_after_malloc,
+ gc_stress_max
+};
+
+#define gc_stress_full_mark_after_malloc_p() \
+ (FIXNUM_P(ruby_gc_stress_mode) && (FIX2LONG(ruby_gc_stress_mode) & (1<<gc_stress_full_mark_after_malloc)))
+
+static void
+heap_ready_to_gc(rb_objspace_t *objspace, rb_heap_t *heap)
+{
+ if (!heap->freelist && !heap->free_pages) {
+ if (!heap_increment(objspace, heap)) {
+ heap_set_increment(objspace, 1);
+ heap_increment(objspace, heap);
+ }
+ }
+}
+
static int
-garbage_collect_body(rb_objspace_t *objspace, int full_mark, int immediate_sweep, int reason)
+ready_to_gc(rb_objspace_t *objspace)
+{
+ if (dont_gc || during_gc || ruby_disable_gc) {
+ heap_ready_to_gc(objspace, heap_eden);
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+}
+
+static void
+gc_reset_malloc_info(rb_objspace_t *objspace)
{
- if (ruby_gc_stress && !ruby_disable_gc_stress) {
- int flag = FIXNUM_P(ruby_gc_stress) ? FIX2INT(ruby_gc_stress) : 0;
+ gc_prof_set_malloc_info(objspace);
+ {
+ size_t inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0);
+ size_t old_limit = malloc_limit;
- if (flag & 0x01)
- reason &= ~GPR_FLAG_MAJOR_MASK;
- else
- reason |= GPR_FLAG_MAJOR_BY_STRESS;
- immediate_sweep = !(flag & 0x02);
+ if (inc > malloc_limit) {
+ malloc_limit = (size_t)(inc * gc_params.malloc_limit_growth_factor);
+ if (gc_params.malloc_limit_max > 0 && /* ignore max-check if 0 */
+ malloc_limit > gc_params.malloc_limit_max) {
+ malloc_limit = gc_params.malloc_limit_max;
+ }
+ }
+ else {
+ malloc_limit = (size_t)(malloc_limit * 0.98); /* magic number */
+ if (malloc_limit < gc_params.malloc_limit_min) {
+ malloc_limit = gc_params.malloc_limit_min;
+ }
+ }
+
+ if (0) {
+ if (old_limit != malloc_limit) {
+ fprintf(stderr, "[%"PRIuSIZE"] malloc_limit: %"PRIuSIZE" -> %"PRIuSIZE"\n",
+ rb_gc_count(), old_limit, malloc_limit);
+ }
+ else {
+ fprintf(stderr, "[%"PRIuSIZE"] malloc_limit: not changed (%"PRIuSIZE")\n",
+ rb_gc_count(), malloc_limit);
+ }
+ }
+ }
+
+ /* reset oldmalloc info */
+#if RGENGC_ESTIMATE_OLDMALLOC
+ if (!is_full_marking(objspace)) {
+ if (objspace->rgengc.oldmalloc_increase > objspace->rgengc.oldmalloc_increase_limit) {
+ objspace->rgengc.need_major_gc |= GPR_FLAG_MAJOR_BY_OLDMALLOC;;
+ objspace->rgengc.oldmalloc_increase_limit =
+ (size_t)(objspace->rgengc.oldmalloc_increase_limit * gc_params.oldmalloc_limit_growth_factor);
+
+ if (objspace->rgengc.oldmalloc_increase_limit > gc_params.oldmalloc_limit_max) {
+ objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_max;
+ }
+ }
+
+ if (0) fprintf(stderr, "%d\t%d\t%u\t%u\t%d\n",
+ (int)rb_gc_count(),
+ (int)objspace->rgengc.need_major_gc,
+ (unsigned int)objspace->rgengc.oldmalloc_increase,
+ (unsigned int)objspace->rgengc.oldmalloc_increase_limit,
+ (unsigned int)gc_params.oldmalloc_limit_max);
}
else {
- if (!GC_ENABLE_LAZY_SWEEP || objspace->flags.dont_lazy_sweep) {
- immediate_sweep = TRUE;
+ /* major GC */
+ objspace->rgengc.oldmalloc_increase = 0;
+
+ if ((objspace->profile.latest_gc_info & GPR_FLAG_MAJOR_BY_OLDMALLOC) == 0) {
+ objspace->rgengc.oldmalloc_increase_limit =
+ (size_t)(objspace->rgengc.oldmalloc_increase_limit / ((gc_params.oldmalloc_limit_growth_factor - 1)/10 + 1));
+ if (objspace->rgengc.oldmalloc_increase_limit < gc_params.oldmalloc_limit_min) {
+ objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_min;
+ }
}
-#if USE_RGENGC
- if (full_mark) {
- reason |= GPR_FLAG_MAJOR_BY_NOFREE;
+ }
+#endif
+}
+
+static int
+garbage_collect(rb_objspace_t *objspace, int full_mark, int immediate_mark, int immediate_sweep, int reason)
+{
+#if GC_PROFILE_MORE_DETAIL
+ objspace->profile.prepare_time = getrusage_time();
+#endif
+
+ gc_rest(objspace);
+
+#if GC_PROFILE_MORE_DETAIL
+ objspace->profile.prepare_time = getrusage_time() - objspace->profile.prepare_time;
+#endif
+
+ return gc_start(objspace, full_mark, immediate_mark, immediate_sweep, reason);
+}
+
+static int
+gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark, const unsigned int immediate_sweep, int reason)
+{
+ int do_full_mark = full_mark;
+ objspace->flags.immediate_sweep = immediate_sweep;
+
+ if (!heap_allocated_pages) return FALSE; /* heap is not ready */
+ if (reason != GPR_FLAG_METHOD && !ready_to_gc(objspace)) return TRUE; /* GC is not allowed */
+
+ if (RGENGC_CHECK_MODE) {
+ assert(objspace->flags.stat == gc_stat_none);
+ assert(!is_lazy_sweeping(heap_eden));
+ assert(!is_incremental_marking(objspace));
+#if RGENGC_CHECK_MODE >= 2
+ gc_verify_internal_consistency(Qnil);
+#endif
+ }
+
+ gc_enter(objspace, "gc_start");
+
+ if (ruby_gc_stressful) {
+ int flag = FIXNUM_P(ruby_gc_stress_mode) ? FIX2INT(ruby_gc_stress_mode) : 0;
+
+ if ((flag & (1<<gc_stress_no_major)) == 0) {
+ do_full_mark = TRUE;
}
+
+ objspace->flags.immediate_sweep = !(flag & (1<<gc_stress_no_immediate_sweep));
+ }
+ else {
+#if USE_RGENGC
if (objspace->rgengc.need_major_gc) {
reason |= objspace->rgengc.need_major_gc;
- objspace->rgengc.need_major_gc = GPR_FLAG_NONE;
- }
- if (objspace->rgengc.remembered_shady_object_count > objspace->rgengc.remembered_shady_object_limit) {
- reason |= GPR_FLAG_MAJOR_BY_SHADY;
+ do_full_mark = TRUE;
}
- if (objspace->rgengc.old_object_count > objspace->rgengc.old_object_limit) {
- reason |= GPR_FLAG_MAJOR_BY_OLDGEN;
+ else if (RGENGC_FORCE_MAJOR_GC) {
+ reason = GPR_FLAG_MAJOR_BY_FORCE;
+ do_full_mark = TRUE;
}
+
+ objspace->rgengc.need_major_gc = GPR_FLAG_NONE;
#endif
}
- if (immediate_sweep) reason |= GPR_FLAG_IMMEDIATE_SWEEP;
- full_mark = (reason & GPR_FLAG_MAJOR_MASK) ? TRUE : FALSE;
+ if (do_full_mark && (reason & GPR_FLAG_MAJOR_MASK) == 0) {
+ reason |= GPR_FLAG_MAJOR_BY_FORCE; /* GC by CAPI, METHOD, and so on. */
+ }
- if (GC_NOTIFY) fprintf(stderr, "start garbage_collect(%d, %d, %d)\n", full_mark, immediate_sweep, reason);
+#if GC_ENABLE_INCREMENTAL_MARK
+ if (!GC_ENABLE_INCREMENTAL_MARK || objspace->flags.dont_incremental || immediate_mark) {
+ objspace->flags.during_incremental_marking = FALSE;
+ }
+ else {
+ objspace->flags.during_incremental_marking = do_full_mark;
+ }
+#endif
+
+ if (!GC_ENABLE_LAZY_SWEEP || objspace->flags.dont_incremental) {
+ objspace->flags.immediate_sweep = TRUE;
+ }
+
+ if (objspace->flags.immediate_sweep) reason |= GPR_FLAG_IMMEDIATE_SWEEP;
+
+ gc_report(1, objspace, "gc_start(%d, %d, %d, reason: %d) => %d, %d, %d\n",
+ full_mark, immediate_mark, immediate_sweep, reason,
+ do_full_mark, !is_incremental_marking(objspace), objspace->flags.immediate_sweep);
objspace->profile.count++;
objspace->profile.latest_gc_info = reason;
+ objspace->profile.total_allocated_objects_at_gc_start = objspace->total_allocated_objects;
+ objspace->profile.heap_used_at_gc_start = heap_allocated_pages;
+ gc_prof_setup_new_record(objspace, reason);
+ gc_reset_malloc_info(objspace);
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_START, 0 /* TODO: pass minor/immediate flag? */);
+ if (RGENGC_CHECK_MODE) assert(during_gc);
- objspace->profile.total_allocated_object_num_at_gc_start = objspace->profile.total_allocated_object_num;
- objspace->profile.heap_used_at_gc_start = heap_pages_used;
-
- gc_prof_setup_new_record(objspace, reason);
gc_prof_timer_start(objspace);
{
- if (during_gc == 0) {
- rb_bug("during_gc should not be 0. RUBY_INTERNAL_EVENT_GC_START user should not cause GC in events.");
- }
- gc_marks(objspace, full_mark);
- gc_sweep(objspace, immediate_sweep);
- during_gc = 0;
+ gc_marks(objspace, do_full_mark);
}
gc_prof_timer_stop(objspace);
- if (GC_NOTIFY) fprintf(stderr, "end garbage_collect()\n");
+ gc_exit(objspace, "gc_start");
return TRUE;
}
-static int
-heap_ready_to_gc(rb_objspace_t *objspace, rb_heap_t *heap)
+static void
+gc_rest(rb_objspace_t *objspace)
{
- if (dont_gc || during_gc) {
- if (!heap->freelist && !heap->free_pages) {
- if (!heap_increment(objspace, heap)) {
- heap_set_increment(objspace, 0);
- heap_increment(objspace, heap);
- }
+ int marking = is_incremental_marking(objspace);
+ int sweeping = is_lazy_sweeping(heap_eden);
+
+ if (marking || sweeping) {
+ gc_enter(objspace, "gc_rest");
+
+ if (RGENGC_CHECK_MODE >= 2) gc_verify_internal_consistency(Qnil);
+
+ if (is_incremental_marking(objspace)) {
+ PUSH_MARK_FUNC_DATA(NULL);
+ gc_marks_rest(objspace);
+ POP_MARK_FUNC_DATA();
}
- return FALSE;
+ if (is_lazy_sweeping(heap_eden)) {
+ gc_sweep_rest(objspace);
+ }
+ gc_exit(objspace, "gc_rest");
}
- return TRUE;
}
-static int
-ready_to_gc(rb_objspace_t *objspace)
-{
- return heap_ready_to_gc(objspace, heap_eden);
-}
+struct objspace_and_reason {
+ rb_objspace_t *objspace;
+ int reason;
+ int full_mark;
+ int immediate_mark;
+ int immediate_sweep;
+};
-static int
-garbage_collect(rb_objspace_t *objspace, int full_mark, int immediate_sweep, int reason)
+static void
+gc_current_status_fill(rb_objspace_t *objspace, char *buff)
{
- if (!heap_pages_used) {
- during_gc = 0;
- return FALSE;
+ int i = 0;
+ if (is_marking(objspace)) {
+ buff[i++] = 'M';
+#if USE_RGENGC
+ if (is_full_marking(objspace)) buff[i++] = 'F';
+#if GC_ENABLE_INCREMENTAL_MARK
+ if (is_incremental_marking(objspace)) buff[i++] = 'I';
+#endif
+#endif
}
- if (!ready_to_gc(objspace)) {
- during_gc = 0;
- return TRUE;
+ else if (is_sweeping(objspace)) {
+ buff[i++] = 'S';
+ if (is_lazy_sweeping(heap_eden)) buff[i++] = 'L';
+ }
+ else {
+ buff[i++] = 'N';
}
+ buff[i] = '\0';
+}
-#if GC_PROFILE_MORE_DETAIL
- objspace->profile.prepare_time = getrusage_time();
-#endif
- gc_rest_sweep(objspace);
-#if GC_PROFILE_MORE_DETAIL
- objspace->profile.prepare_time = getrusage_time() - objspace->profile.prepare_time;
+static const char *
+gc_current_status(rb_objspace_t *objspace)
+{
+ static char buff[0x10];
+ gc_current_status_fill(objspace, buff);
+ return buff;
+}
+
+#if PRINT_ENTER_EXIT_TICK
+
+static tick_t last_exit_tick;
+static tick_t enter_tick;
+static int enter_count = 0;
+static char last_gc_status[0x10];
+
+static inline void
+gc_record(rb_objspace_t *objspace, int direction, const char *event)
+{
+ if (direction == 0) { /* enter */
+ enter_count++;
+ enter_tick = tick();
+ gc_current_status_fill(objspace, last_gc_status);
+ }
+ else { /* exit */
+ tick_t exit_tick = tick();
+ char current_gc_status[0x10];
+ gc_current_status_fill(objspace, current_gc_status);
+#if 1
+ /* [last mutator time] [gc time] [event] */
+ fprintf(stderr, "%"PRItick"\t%"PRItick"\t%s\t[%s->%s|%c]\n",
+ enter_tick - last_exit_tick,
+ exit_tick - enter_tick,
+ event,
+ last_gc_status, current_gc_status,
+ (objspace->profile.latest_gc_info & GPR_FLAG_MAJOR_MASK) ? '+' : '-');
+ last_exit_tick = exit_tick;
+#else
+ /* [enter_tick] [gc time] [event] */
+ fprintf(stderr, "%"PRItick"\t%"PRItick"\t%s\t[%s->%s|%c]\n",
+ enter_tick,
+ exit_tick - enter_tick,
+ event,
+ last_gc_status, current_gc_status,
+ (objspace->profile.latest_gc_info & GPR_FLAG_MAJOR_MASK) ? '+' : '-');
#endif
+ }
+}
+#else /* PRINT_ENTER_EXIT_TICK */
+static inline void
+gc_record(rb_objspace_t *objspace, int direction, const char *event)
+{
+ /* null */
+}
+#endif /* PRINT_ENTER_EXIT_TICK */
- during_gc++;
+static inline void
+gc_enter(rb_objspace_t *objspace, const char *event)
+{
+ if (RGENGC_CHECK_MODE) assert(during_gc == 0);
+ if (RGENGC_CHECK_MODE >= 3) gc_verify_internal_consistency(Qnil);
- return garbage_collect_body(objspace, full_mark, immediate_sweep, reason);
+ during_gc = TRUE;
+ gc_report(1, objspace, "gc_entr: %s [%s]\n", event, gc_current_status(objspace));
+ gc_record(objspace, 0, event);
+ gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_ENTER, 0); /* TODO: which parameter should be passed? */
}
-struct objspace_and_reason {
- rb_objspace_t *objspace;
- int reason;
- int full_mark;
- int immediate_sweep;
-};
+static inline void
+gc_exit(rb_objspace_t *objspace, const char *event)
+{
+ if (RGENGC_CHECK_MODE) assert(during_gc != 0);
+
+ gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_EXIT, 0); /* TODO: which parameter should be passsed? */
+ gc_record(objspace, 1, event);
+ gc_report(1, objspace, "gc_exit: %s [%s]\n", event, gc_current_status(objspace));
+ during_gc = FALSE;
+}
static void *
gc_with_gvl(void *ptr)
{
struct objspace_and_reason *oar = (struct objspace_and_reason *)ptr;
- return (void *)(VALUE)garbage_collect(oar->objspace, oar->full_mark, oar->immediate_sweep, oar->reason);
+ return (void *)(VALUE)garbage_collect(oar->objspace, oar->full_mark, oar->immediate_mark, oar->immediate_sweep, oar->reason);
}
static int
-garbage_collect_with_gvl(rb_objspace_t *objspace, int full_mark, int immediate_sweep, int reason)
+garbage_collect_with_gvl(rb_objspace_t *objspace, int full_mark, int immediate_mark, int immediate_sweep, int reason)
{
if (dont_gc) return TRUE;
if (ruby_thread_has_gvl_p()) {
- return garbage_collect(objspace, full_mark, immediate_sweep, reason);
+ return garbage_collect(objspace, full_mark, immediate_mark, immediate_sweep, reason);
}
else {
if (ruby_native_thread_p()) {
@@ -5094,6 +6415,7 @@ garbage_collect_with_gvl(rb_objspace_t *objspace, int full_mark, int immediate_s
oar.objspace = objspace;
oar.reason = reason;
oar.full_mark = full_mark;
+ oar.immediate_mark = immediate_mark;
oar.immediate_sweep = immediate_sweep;
return (int)(VALUE)rb_thread_call_with_gvl(gc_with_gvl, (void *)&oar);
}
@@ -5108,7 +6430,7 @@ garbage_collect_with_gvl(rb_objspace_t *objspace, int full_mark, int immediate_s
int
rb_garbage_collect(void)
{
- return garbage_collect(&rb_objspace, TRUE, TRUE, GPR_FLAG_CAPI);
+ return garbage_collect(&rb_objspace, TRUE, TRUE, TRUE, GPR_FLAG_CAPI);
}
#undef Init_stack
@@ -5123,14 +6445,14 @@ Init_stack(volatile VALUE *addr)
* call-seq:
* GC.start -> nil
* GC.garbage_collect -> nil
- * ObjectSpace.garbage_collect -> nil
- * GC.start(full_mark: false) -> nil
+ * GC.start(full_mark: true, immediate_sweep: true) -> nil
+ * GC.garbage_collect(full_mark: true, immediate_sweep: true) -> nil
*
* Initiates garbage collection, unless manually disabled.
*
* This method is defined with keyword arguments that default to true:
*
- * def GC.start(full_mark: true, immediate_sweep: true) end
+ * def GC.start(full_mark: true, immediate_sweep: true); end
*
* Use full_mark: false to perform a minor GC.
* Use immediate_sweep: false to defer sweeping (use lazy sweep).
@@ -5144,29 +6466,29 @@ static VALUE
gc_start_internal(int argc, VALUE *argv, VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
- int full_mark = TRUE, immediate_sweep = TRUE;
+ int full_mark = TRUE, immediate_mark = TRUE, immediate_sweep = TRUE;
VALUE opt = Qnil;
- static ID keyword_ids[2];
+ static ID keyword_ids[3];
rb_scan_args(argc, argv, "0:", &opt);
if (!NIL_P(opt)) {
- VALUE kwvals[2];
+ VALUE kwvals[3];
if (!keyword_ids[0]) {
keyword_ids[0] = rb_intern("full_mark");
- keyword_ids[1] = rb_intern("immediate_sweep");
+ keyword_ids[1] = rb_intern("immediate_mark");
+ keyword_ids[2] = rb_intern("immediate_sweep");
}
- rb_get_kwargs(opt, keyword_ids, 0, 2, kwvals);
+ rb_get_kwargs(opt, keyword_ids, 0, 3, kwvals);
- if (kwvals[0] != Qundef)
- full_mark = RTEST(kwvals[0]);
- if (kwvals[1] != Qundef)
- immediate_sweep = RTEST(kwvals[1]);
+ if (kwvals[0] != Qundef) full_mark = RTEST(kwvals[0]);
+ if (kwvals[1] != Qundef) immediate_mark = RTEST(kwvals[1]);
+ if (kwvals[2] != Qundef) immediate_sweep = RTEST(kwvals[2]);
}
- garbage_collect(objspace, full_mark, immediate_sweep, GPR_FLAG_METHOD);
+ garbage_collect(objspace, full_mark, immediate_mark, immediate_sweep, GPR_FLAG_METHOD);
if (!finalizing) finalize_deferred(objspace);
return Qnil;
@@ -5183,7 +6505,7 @@ void
rb_gc(void)
{
rb_objspace_t *objspace = &rb_objspace;
- garbage_collect(objspace, TRUE, TRUE, GPR_FLAG_CAPI);
+ garbage_collect(objspace, TRUE, TRUE, TRUE, GPR_FLAG_CAPI);
if (!finalizing) finalize_deferred(objspace);
}
@@ -5195,6 +6517,9 @@ rb_during_gc(void)
}
#if RGENGC_PROFILE >= 2
+
+static const char *type_name(int type, VALUE obj);
+
static void
gc_count_add_each_types(VALUE hash, const char *name, const size_t *types)
{
@@ -5231,23 +6556,28 @@ gc_count(VALUE self)
}
static VALUE
-gc_info_decode(int flags, VALUE hash_or_key)
+gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const int orig_flags)
{
- static VALUE sym_major_by = Qnil, sym_gc_by, sym_immediate_sweep, sym_have_finalizer;
- static VALUE sym_nofree, sym_oldgen, sym_shady, sym_rescan, sym_stress;
+ static VALUE sym_major_by = Qnil, sym_gc_by, sym_immediate_sweep, sym_have_finalizer, sym_state;
+ static VALUE sym_nofree, sym_oldgen, sym_shady, sym_force, sym_stress;
#if RGENGC_ESTIMATE_OLDMALLOC
static VALUE sym_oldmalloc;
#endif
static VALUE sym_newobj, sym_malloc, sym_method, sym_capi;
+ static VALUE sym_none, sym_marking, sym_sweeping;
VALUE hash = Qnil, key = Qnil;
VALUE major_by;
+ VALUE flags = orig_flags ? orig_flags : objspace->profile.latest_gc_info;
- if (SYMBOL_P(hash_or_key))
+ if (SYMBOL_P(hash_or_key)) {
key = hash_or_key;
- else if (RB_TYPE_P(hash_or_key, T_HASH))
+ }
+ else if (RB_TYPE_P(hash_or_key, T_HASH)) {
hash = hash_or_key;
- else
+ }
+ else {
rb_raise(rb_eTypeError, "non-hash or symbol given");
+ }
if (sym_major_by == Qnil) {
#define S(s) sym_##s = ID2SYM(rb_intern_const(#s))
@@ -5255,11 +6585,13 @@ gc_info_decode(int flags, VALUE hash_or_key)
S(gc_by);
S(immediate_sweep);
S(have_finalizer);
+ S(state);
+
+ S(stress);
S(nofree);
S(oldgen);
S(shady);
- S(rescan);
- S(stress);
+ S(force);
#if RGENGC_ESTIMATE_OLDMALLOC
S(oldmalloc);
#endif
@@ -5267,6 +6599,10 @@ gc_info_decode(int flags, VALUE hash_or_key)
S(malloc);
S(method);
S(capi);
+
+ S(none);
+ S(marking);
+ S(sweeping);
#undef S
}
@@ -5277,14 +6613,13 @@ gc_info_decode(int flags, VALUE hash_or_key)
rb_hash_aset(hash, sym_##name, (attr));
major_by =
+ (flags & GPR_FLAG_MAJOR_BY_NOFREE) ? sym_nofree :
(flags & GPR_FLAG_MAJOR_BY_OLDGEN) ? sym_oldgen :
(flags & GPR_FLAG_MAJOR_BY_SHADY) ? sym_shady :
- (flags & GPR_FLAG_MAJOR_BY_RESCAN) ? sym_rescan :
- (flags & GPR_FLAG_MAJOR_BY_STRESS) ? sym_stress :
+ (flags & GPR_FLAG_MAJOR_BY_FORCE) ? sym_force :
#if RGENGC_ESTIMATE_OLDMALLOC
(flags & GPR_FLAG_MAJOR_BY_OLDMALLOC) ? sym_oldmalloc :
#endif
- (flags & GPR_FLAG_MAJOR_BY_NOFREE) ? sym_nofree :
Qnil;
SET(major_by, major_by);
@@ -5299,10 +6634,16 @@ gc_info_decode(int flags, VALUE hash_or_key)
SET(have_finalizer, (flags & GPR_FLAG_HAVE_FINALIZE) ? Qtrue : Qfalse);
SET(immediate_sweep, (flags & GPR_FLAG_IMMEDIATE_SWEEP) ? Qtrue : Qfalse);
+
+ if (orig_flags == 0) {
+ SET(state, objspace->flags.stat == gc_stat_none ? sym_none :
+ objspace->flags.stat == gc_stat_marking ? sym_marking : sym_sweeping);
+ }
#undef SET
- if (key != Qnil) /* matched key should return above */
- rb_raise(rb_eArgError, "unknown key: %s", RSTRING_PTR(rb_id2str(SYM2ID(key))));
+ if (!NIL_P(key)) {/* matched key should return above */
+ rb_raise(rb_eArgError, "unknown key: %"PRIsVALUE, rb_sym2str(key));
+ }
return hash;
}
@@ -5311,7 +6652,7 @@ VALUE
rb_gc_latest_gc_info(VALUE key)
{
rb_objspace_t *objspace = &rb_objspace;
- return gc_info_decode(objspace->profile.latest_gc_info, key);
+ return gc_info_decode(objspace, key, 0);
}
/*
@@ -5335,151 +6676,327 @@ gc_latest_gc_info(int argc, VALUE *argv, VALUE self)
}
}
- if (arg == Qnil)
- arg = rb_hash_new();
-
- return gc_info_decode(objspace->profile.latest_gc_info, arg);
-}
-
-static VALUE
-gc_stat_internal(VALUE hash_or_sym, size_t *out)
-{
- static VALUE sym_count;
- static VALUE sym_heap_used, sym_heap_length, sym_heap_increment;
- static VALUE sym_heap_live_slot, sym_heap_free_slot, sym_heap_final_slot, sym_heap_swept_slot;
- static VALUE sym_heap_eden_page_length, sym_heap_tomb_page_length;
- static VALUE sym_total_allocated_object, sym_total_freed_object;
- static VALUE sym_malloc_increase, sym_malloc_limit;
+ if (arg == Qnil) {
+ arg = rb_hash_new();
+ }
+
+ return gc_info_decode(objspace, arg, 0);
+}
+
+enum gc_stat_sym {
+ gc_stat_sym_count,
+ gc_stat_sym_heap_allocated_pages,
+ gc_stat_sym_heap_sorted_length,
+ gc_stat_sym_heap_allocatable_pages,
+ gc_stat_sym_heap_available_slots,
+ gc_stat_sym_heap_live_slots,
+ gc_stat_sym_heap_free_slots,
+ gc_stat_sym_heap_final_slots,
+ gc_stat_sym_heap_marked_slots,
+ gc_stat_sym_heap_swept_slots,
+ gc_stat_sym_heap_eden_pages,
+ gc_stat_sym_heap_tomb_pages,
+ gc_stat_sym_total_allocated_pages,
+ gc_stat_sym_total_freed_pages,
+ gc_stat_sym_total_allocated_objects,
+ gc_stat_sym_total_freed_objects,
+ gc_stat_sym_malloc_increase_bytes,
+ gc_stat_sym_malloc_increase_bytes_limit,
#if USE_RGENGC
- static VALUE sym_minor_gc_count, sym_major_gc_count;
- static VALUE sym_remembered_shady_object, sym_remembered_shady_object_limit;
- static VALUE sym_old_object, sym_old_object_limit;
+ gc_stat_sym_minor_gc_count,
+ gc_stat_sym_major_gc_count,
+ gc_stat_sym_remembered_wb_unprotected_objects,
+ gc_stat_sym_remembered_wb_unprotected_objects_limit,
+ gc_stat_sym_old_objects,
+ gc_stat_sym_old_objects_limit,
#if RGENGC_ESTIMATE_OLDMALLOC
- static VALUE sym_oldmalloc_increase, sym_oldmalloc_limit;
+ gc_stat_sym_oldmalloc_increase_bytes,
+ gc_stat_sym_oldmalloc_increase_bytes_limit,
#endif
#if RGENGC_PROFILE
- static VALUE sym_generated_normal_object_count, sym_generated_shady_object_count;
- static VALUE sym_shade_operation_count, sym_promote_infant_count, sym_promote_young_count;
- static VALUE sym_remembered_normal_object_count, sym_remembered_shady_object_count;
-#endif /* RGENGC_PROFILE */
-#endif /* USE_RGENGC */
+ gc_stat_sym_total_generated_normal_object_count,
+ gc_stat_sym_total_generated_shady_object_count,
+ gc_stat_sym_total_shade_operation_count,
+ gc_stat_sym_total_promoted_count,
+ gc_stat_sym_total_remembered_normal_object_count,
+ gc_stat_sym_total_remembered_shady_object_count,
+#endif
+#endif
+ gc_stat_sym_last
+};
- rb_objspace_t *objspace = &rb_objspace;
- VALUE hash = Qnil, key = Qnil;
+enum gc_stat_compat_sym {
+ gc_stat_compat_sym_gc_stat_heap_used,
+ gc_stat_compat_sym_heap_eden_page_length,
+ gc_stat_compat_sym_heap_tomb_page_length,
+ gc_stat_compat_sym_heap_increment,
+ gc_stat_compat_sym_heap_length,
+ gc_stat_compat_sym_heap_live_slot,
+ gc_stat_compat_sym_heap_free_slot,
+ gc_stat_compat_sym_heap_final_slot,
+ gc_stat_compat_sym_heap_swept_slot,
+#if USE_RGENGC
+ gc_stat_compat_sym_remembered_shady_object,
+ gc_stat_compat_sym_remembered_shady_object_limit,
+ gc_stat_compat_sym_old_object,
+ gc_stat_compat_sym_old_object_limit,
+#endif
+ gc_stat_compat_sym_total_allocated_object,
+ gc_stat_compat_sym_total_freed_object,
+ gc_stat_compat_sym_malloc_increase,
+ gc_stat_compat_sym_malloc_limit,
+#if RGENGC_ESTIMATE_OLDMALLOC
+ gc_stat_compat_sym_oldmalloc_increase,
+ gc_stat_compat_sym_oldmalloc_limit,
+#endif
+ gc_stat_compat_sym_last
+};
- if (RB_TYPE_P(hash_or_sym, T_HASH))
- hash = hash_or_sym;
- else if (SYMBOL_P(hash_or_sym) && out)
- key = hash_or_sym;
- else
- rb_raise(rb_eTypeError, "non-hash or symbol argument");
+static VALUE gc_stat_symbols[gc_stat_sym_last];
+static VALUE gc_stat_compat_symbols[gc_stat_compat_sym_last];
+static VALUE gc_stat_compat_table;
- if (sym_count == 0) {
-#define S(s) sym_##s = ID2SYM(rb_intern_const(#s))
+static void
+setup_gc_stat_symbols(void)
+{
+ if (gc_stat_symbols[0] == 0) {
+#define S(s) gc_stat_symbols[gc_stat_sym_##s] = ID2SYM(rb_intern_const(#s))
S(count);
- S(heap_used);
- S(heap_length);
+ S(heap_allocated_pages);
+ S(heap_sorted_length);
+ S(heap_allocatable_pages);
+ S(heap_available_slots);
+ S(heap_live_slots);
+ S(heap_free_slots);
+ S(heap_final_slots);
+ S(heap_marked_slots);
+ S(heap_swept_slots);
+ S(heap_eden_pages);
+ S(heap_tomb_pages);
+ S(total_allocated_pages);
+ S(total_freed_pages);
+ S(total_allocated_objects);
+ S(total_freed_objects);
+ S(malloc_increase_bytes);
+ S(malloc_increase_bytes_limit);
+#if USE_RGENGC
+ S(minor_gc_count);
+ S(major_gc_count);
+ S(remembered_wb_unprotected_objects);
+ S(remembered_wb_unprotected_objects_limit);
+ S(old_objects);
+ S(old_objects_limit);
+#if RGENGC_ESTIMATE_OLDMALLOC
+ S(oldmalloc_increase_bytes);
+ S(oldmalloc_increase_bytes_limit);
+#endif
+#if RGENGC_PROFILE
+ S(total_generated_normal_object_count);
+ S(total_generated_shady_object_count);
+ S(total_shade_operation_count);
+ S(total_promoted_count);
+ S(total_remembered_normal_object_count);
+ S(total_remembered_shady_object_count);
+#endif /* RGENGC_PROFILE */
+#endif /* USE_RGENGC */
+#undef S
+#define S(s) gc_stat_compat_symbols[gc_stat_compat_sym_##s] = ID2SYM(rb_intern_const(#s))
+ S(gc_stat_heap_used);
+ S(heap_eden_page_length);
+ S(heap_tomb_page_length);
S(heap_increment);
+ S(heap_length);
S(heap_live_slot);
S(heap_free_slot);
S(heap_final_slot);
S(heap_swept_slot);
- S(heap_eden_page_length);
- S(heap_tomb_page_length);
- S(total_allocated_object);
- S(total_freed_object);
- S(malloc_increase);
- S(malloc_limit);
-#if USE_RGENGC
- S(minor_gc_count);
- S(major_gc_count);
+#if USE_RGEGC
S(remembered_shady_object);
S(remembered_shady_object_limit);
S(old_object);
S(old_object_limit);
+#endif
+ S(total_allocated_object);
+ S(total_freed_object);
+ S(malloc_increase);
+ S(malloc_limit);
#if RGENGC_ESTIMATE_OLDMALLOC
S(oldmalloc_increase);
S(oldmalloc_limit);
#endif
-#if RGENGC_PROFILE
- S(generated_normal_object_count);
- S(generated_shady_object_count);
- S(shade_operation_count);
- S(promote_infant_count);
- S(promote_young_count);
- S(remembered_normal_object_count);
- S(remembered_shady_object_count);
-#endif /* USE_RGENGC */
-#endif /* RGENGC_PROFILE */
#undef S
+
+ {
+ VALUE table = gc_stat_compat_table = rb_hash_new();
+ rb_obj_hide(table);
+ rb_gc_register_mark_object(table);
+
+ /* compatibility layer for Ruby 2.1 */
+#define OLD_SYM(s) gc_stat_compat_symbols[gc_stat_compat_sym_##s]
+#define NEW_SYM(s) gc_stat_symbols[gc_stat_sym_##s]
+ rb_hash_aset(table, OLD_SYM(gc_stat_heap_used), NEW_SYM(heap_allocated_pages));
+ rb_hash_aset(table, OLD_SYM(heap_eden_page_length), NEW_SYM(heap_eden_pages));
+ rb_hash_aset(table, OLD_SYM(heap_tomb_page_length), NEW_SYM(heap_tomb_pages));
+ rb_hash_aset(table, OLD_SYM(heap_increment), NEW_SYM(heap_allocatable_pages));
+ rb_hash_aset(table, OLD_SYM(heap_length), NEW_SYM(heap_sorted_length));
+ rb_hash_aset(table, OLD_SYM(heap_live_slot), NEW_SYM(heap_live_slots));
+ rb_hash_aset(table, OLD_SYM(heap_free_slot), NEW_SYM(heap_free_slots));
+ rb_hash_aset(table, OLD_SYM(heap_final_slot), NEW_SYM(heap_final_slots));
+ rb_hash_aset(table, OLD_SYM(heap_swept_slot), NEW_SYM(heap_swept_slots));
+#if USE_RGEGC
+ rb_hash_aset(table, OLD_SYM(remembered_shady_object), NEW_SYM(remembered_wb_unprotected_objects));
+ rb_hash_aset(table, OLD_SYM(remembered_shady_object_limit), NEW_SYM(remembered_wb_unprotected_objects_limit));
+ rb_hash_aset(table, OLD_SYM(old_object), NEW_SYM(old_objects));
+ rb_hash_aset(table, OLD_SYM(old_object_limit), NEW_SYM(old_objects_limit));
+#endif
+ rb_hash_aset(table, OLD_SYM(total_allocated_object), NEW_SYM(total_allocated_objects));
+ rb_hash_aset(table, OLD_SYM(total_freed_object), NEW_SYM(total_freed_objects));
+ rb_hash_aset(table, OLD_SYM(malloc_increase), NEW_SYM(malloc_increase_bytes));
+ rb_hash_aset(table, OLD_SYM(malloc_limit), NEW_SYM(malloc_increase_bytes_limit));
+#if RGENGC_ESTIMATE_OLDMALLOC
+ rb_hash_aset(table, OLD_SYM(oldmalloc_increase), NEW_SYM(oldmalloc_increase_bytes));
+ rb_hash_aset(table, OLD_SYM(oldmalloc_limit), NEW_SYM(oldmalloc_increase_bytes_limit));
+#endif
+#undef OLD_SYM
+#undef NEW_SYM
+ rb_obj_freeze(table);
+ }
+ }
+}
+
+static VALUE
+compat_key(VALUE key)
+{
+ VALUE new_key = rb_hash_lookup(gc_stat_compat_table, key);
+
+ if (!NIL_P(new_key)) {
+ static int warned = 0;
+ if (warned == 0) {
+ rb_warn("GC.stat keys were changed from Ruby 2.1. "
+ "In this case, you refer to obsolete `%"PRIsVALUE"' (new key is `%"PRIsVALUE"'). "
+ "Please check <https://bugs.ruby-lang.org/issues/9924> for more information.",
+ key, new_key);
+ warned = 1;
+ }
+ }
+
+ return new_key;
+}
+
+static VALUE
+default_proc_for_compat_func(VALUE hash, VALUE dmy, int argc, VALUE *argv)
+{
+ VALUE key, new_key;
+
+ Check_Type(hash, T_HASH);
+ rb_check_arity(argc, 2, 2);
+ key = argv[1];
+
+ if ((new_key = compat_key(key)) != Qnil) {
+ return rb_hash_lookup(hash, new_key);
+ }
+
+ return Qnil;
+}
+
+static size_t
+gc_stat_internal(VALUE hash_or_sym)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ VALUE hash = Qnil, key = Qnil;
+
+ setup_gc_stat_symbols();
+
+ if (RB_TYPE_P(hash_or_sym, T_HASH)) {
+ hash = hash_or_sym;
+
+ if (NIL_P(RHASH_IFNONE(hash))) {
+ static VALUE default_proc_for_compat = 0;
+ if (default_proc_for_compat == 0) { /* TODO: it should be */
+ default_proc_for_compat = rb_proc_new(default_proc_for_compat_func, Qnil);
+ rb_gc_register_mark_object(default_proc_for_compat);
+ }
+ rb_hash_set_default_proc(hash, default_proc_for_compat);
+ }
+ }
+ else if (SYMBOL_P(hash_or_sym)) {
+ key = hash_or_sym;
+ }
+ else {
+ rb_raise(rb_eTypeError, "non-hash or symbol argument");
}
#define SET(name, attr) \
- if (key == sym_##name) \
- return (*out = attr, Qnil); \
+ if (key == gc_stat_symbols[gc_stat_sym_##name]) \
+ return attr; \
else if (hash != Qnil) \
- rb_hash_aset(hash, sym_##name, SIZET2NUM(attr));
+ rb_hash_aset(hash, gc_stat_symbols[gc_stat_sym_##name], SIZET2NUM(attr));
+ again:
SET(count, objspace->profile.count);
/* implementation dependent counters */
- SET(heap_used, heap_pages_used);
- SET(heap_length, heap_pages_length);
- SET(heap_increment, heap_pages_increment);
- SET(heap_live_slot, objspace_live_slot(objspace));
- SET(heap_free_slot, objspace_free_slot(objspace));
- SET(heap_final_slot, heap_pages_final_slots);
- SET(heap_swept_slot, heap_pages_swept_slots);
- SET(heap_eden_page_length, heap_eden->page_length);
- SET(heap_tomb_page_length, heap_tomb->page_length);
- SET(total_allocated_object, objspace->profile.total_allocated_object_num);
- SET(total_freed_object, objspace->profile.total_freed_object_num);
- SET(malloc_increase, malloc_increase);
- SET(malloc_limit, malloc_limit);
+ SET(heap_allocated_pages, heap_allocated_pages);
+ SET(heap_sorted_length, heap_pages_sorted_length);
+ SET(heap_allocatable_pages, heap_allocatable_pages);
+ SET(heap_available_slots, objspace_available_slots(objspace));
+ SET(heap_live_slots, objspace_live_slots(objspace));
+ SET(heap_free_slots, objspace_free_slots(objspace));
+ SET(heap_final_slots, heap_pages_final_slots);
+ SET(heap_marked_slots, objspace->marked_slots);
+ SET(heap_swept_slots, heap_pages_swept_slots);
+ SET(heap_eden_pages, heap_eden->page_length);
+ SET(heap_tomb_pages, heap_tomb->page_length);
+ SET(total_allocated_pages, objspace->profile.total_allocated_pages);
+ SET(total_freed_pages, objspace->profile.total_freed_pages);
+ SET(total_allocated_objects, objspace->total_allocated_objects);
+ SET(total_freed_objects, objspace->profile.total_freed_objects);
+ SET(malloc_increase_bytes, malloc_increase);
+ SET(malloc_increase_bytes_limit, malloc_limit);
#if USE_RGENGC
SET(minor_gc_count, objspace->profile.minor_gc_count);
SET(major_gc_count, objspace->profile.major_gc_count);
- SET(remembered_shady_object, objspace->rgengc.remembered_shady_object_count);
- SET(remembered_shady_object_limit, objspace->rgengc.remembered_shady_object_limit);
- SET(old_object, objspace->rgengc.old_object_count);
- SET(old_object_limit, objspace->rgengc.old_object_limit);
+ SET(remembered_wb_unprotected_objects, objspace->rgengc.uncollectible_wb_unprotected_objects);
+ SET(remembered_wb_unprotected_objects_limit, objspace->rgengc.uncollectible_wb_unprotected_objects_limit);
+ SET(old_objects, objspace->rgengc.old_objects);
+ SET(old_objects_limit, objspace->rgengc.old_objects_limit);
#if RGENGC_ESTIMATE_OLDMALLOC
- SET(oldmalloc_increase, objspace->rgengc.oldmalloc_increase);
- SET(oldmalloc_limit, objspace->rgengc.oldmalloc_increase_limit);
+ SET(oldmalloc_increase_bytes, objspace->rgengc.oldmalloc_increase);
+ SET(oldmalloc_increase_bytes_limit, objspace->rgengc.oldmalloc_increase_limit);
#endif
#if RGENGC_PROFILE
- SET(generated_normal_object_count, objspace->profile.generated_normal_object_count);
- SET(generated_shady_object_count, objspace->profile.generated_shady_object_count);
- SET(shade_operation_count, objspace->profile.shade_operation_count);
- SET(promote_infant_count, objspace->profile.promote_infant_count);
-#if RGENGC_THREEGEN
- SET(promote_young_count, objspace->profile.promote_young_count);
-#endif
- SET(remembered_normal_object_count, objspace->profile.remembered_normal_object_count);
- SET(remembered_shady_object_count, objspace->profile.remembered_shady_object_count);
+ SET(total_generated_normal_object_count, objspace->profile.total_generated_normal_object_count);
+ SET(total_generated_shady_object_count, objspace->profile.total_generated_shady_object_count);
+ SET(total_shade_operation_count, objspace->profile.total_shade_operation_count);
+ SET(total_promoted_count, objspace->profile.total_promoted_count);
+ SET(total_remembered_normal_object_count, objspace->profile.total_remembered_normal_object_count);
+ SET(total_remembered_shady_object_count, objspace->profile.total_remembered_shady_object_count);
#endif /* RGENGC_PROFILE */
#endif /* USE_RGENGC */
#undef SET
- if (key != Qnil) /* matched key should return above */
- rb_raise(rb_eArgError, "unknown key: %s", RSTRING_PTR(rb_id2str(SYM2ID(key))));
+ if (!NIL_P(key)) { /* matched key should return above */
+ VALUE new_key;
+ if ((new_key = compat_key(key)) != Qnil) {
+ key = new_key;
+ goto again;
+ }
+ rb_raise(rb_eArgError, "unknown key: %"PRIsVALUE, rb_sym2str(key));
+ }
#if defined(RGENGC_PROFILE) && RGENGC_PROFILE >= 2
if (hash != Qnil) {
gc_count_add_each_types(hash, "generated_normal_object_count_types", objspace->profile.generated_normal_object_count_types);
gc_count_add_each_types(hash, "generated_shady_object_count_types", objspace->profile.generated_shady_object_count_types);
gc_count_add_each_types(hash, "shade_operation_count_types", objspace->profile.shade_operation_count_types);
- gc_count_add_each_types(hash, "promote_infant_types", objspace->profile.promote_infant_types);
-#if RGENGC_THREEGEN
- gc_count_add_each_types(hash, "promote_young_types", objspace->profile.promote_young_types);
-#endif
+ gc_count_add_each_types(hash, "promoted_types", objspace->profile.promoted_types);
gc_count_add_each_types(hash, "remembered_normal_object_count_types", objspace->profile.remembered_normal_object_count_types);
gc_count_add_each_types(hash, "remembered_shady_object_count_types", objspace->profile.remembered_shady_object_count_types);
}
#endif
- return hash;
+ return 0;
}
/*
@@ -5492,28 +7009,34 @@ gc_stat_internal(VALUE hash_or_sym, size_t *out)
*
* The hash includes information about internal statistics about GC such as:
*
- * {
- * :count=>2,
- * :heap_used=>9,
- * :heap_length=>11,
- * :heap_increment=>2,
- * :heap_live_slot=>6836,
- * :heap_free_slot=>519,
- * :heap_final_slot=>0,
- * :heap_swept_slot=>818,
- * :total_allocated_object=>7674,
- * :total_freed_object=>838,
- * :malloc_increase=>181034,
- * :malloc_limit=>16777216,
- * :minor_gc_count=>2,
+ * {
+ * :count=>0,
+ * :heap_allocated_pages=>24,
+ * :heap_sorted_length=>24,
+ * :heap_allocatable_pages=>0,
+ * :heap_available_slots=>9783,
+ * :heap_live_slots=>7713,
+ * :heap_free_slots=>2070,
+ * :heap_final_slots=>0,
+ * :heap_marked_slots=>0,
+ * :heap_swept_slots=>0,
+ * :heap_eden_pages=>24,
+ * :heap_tomb_pages=>0,
+ * :total_allocated_pages=>24,
+ * :total_freed_pages=>0,
+ * :total_allocated_objects=>7796,
+ * :total_freed_objects=>83,
+ * :malloc_increase_bytes=>2389312,
+ * :malloc_increase_bytes_limit=>16777216,
+ * :minor_gc_count=>0,
* :major_gc_count=>0,
- * :remembered_shady_object=>55,
- * :remembered_shady_object_limit=>0,
- * :old_object=>2422,
- * :old_object_limit=>0,
- * :oldmalloc_increase=>277386,
- * :oldmalloc_limit=>16777216
- * }
+ * :remembered_wb_unprotected_objects=>0,
+ * :remembered_wb_unprotected_objects_limit=>0,
+ * :old_objects=>0,
+ * :old_objects_limit=>0,
+ * :oldmalloc_increase_bytes=>2389760,
+ * :oldmalloc_increase_bytes_limit=>16777216
+ * }
*
* The contents of the hash are implementation specific and may be changed in
* the future.
@@ -5529,10 +7052,10 @@ gc_stat(int argc, VALUE *argv, VALUE self)
if (rb_scan_args(argc, argv, "01", &arg) == 1) {
if (SYMBOL_P(arg)) {
- size_t value = 0;
- gc_stat_internal(arg, &value);
+ size_t value = gc_stat_internal(arg);
return SIZET2NUM(value);
- } else if (!RB_TYPE_P(arg, T_HASH)) {
+ }
+ else if (!RB_TYPE_P(arg, T_HASH)) {
rb_raise(rb_eTypeError, "non-hash or symbol given");
}
}
@@ -5540,7 +7063,7 @@ gc_stat(int argc, VALUE *argv, VALUE self)
if (arg == Qnil) {
arg = rb_hash_new();
}
- gc_stat_internal(arg, 0);
+ gc_stat_internal(arg);
return arg;
}
@@ -5548,11 +7071,11 @@ size_t
rb_gc_stat(VALUE key)
{
if (SYMBOL_P(key)) {
- size_t value = 0;
- gc_stat_internal(key, &value);
+ size_t value = gc_stat_internal(key);
return value;
- } else {
- gc_stat_internal(key, 0);
+ }
+ else {
+ gc_stat_internal(key);
return 0;
}
}
@@ -5568,12 +7091,19 @@ static VALUE
gc_stress_get(VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
- return ruby_gc_stress;
+ return ruby_gc_stress_mode;
+}
+
+static void
+gc_stress_set(rb_objspace_t *objspace, VALUE flag)
+{
+ objspace->flags.gc_stressful = RTEST(flag);
+ objspace->gc_stress_mode = flag;
}
/*
* call-seq:
- * GC.stress = bool -> bool
+ * GC.stress = flag -> flag
*
* Updates the GC stress mode.
*
@@ -5581,14 +7111,18 @@ gc_stress_get(VALUE self)
* all memory and object allocations.
*
* Enabling stress mode will degrade performance, it is only for debugging.
+ *
+ * flag can be true, false, or a fixnum bit-ORed following flags.
+ * 0x01:: no major GC
+ * 0x02:: no immediate sweep
+ * 0x04:: full mark after malloc/calloc/realloc
*/
static VALUE
-gc_stress_set(VALUE self, VALUE flag)
+gc_stress_set_m(VALUE self, VALUE flag)
{
rb_objspace_t *objspace = &rb_objspace;
- rb_secure(2);
- ruby_gc_stress = FIXNUM_P(flag) ? flag : (RTEST(flag) ? Qtrue : Qfalse);
+ gc_stress_set(objspace, flag);
return flag;
}
@@ -5633,27 +7167,65 @@ rb_gc_disable(void)
rb_objspace_t *objspace = &rb_objspace;
int old = dont_gc;
- gc_rest_sweep(objspace);
+ gc_rest(objspace);
dont_gc = TRUE;
return old ? Qtrue : Qfalse;
}
static int
-get_envparam_int(const char *name, unsigned int *default_value, int lower_bound)
+get_envparam_size(const char *name, size_t *default_value, size_t lower_bound)
{
char *ptr = getenv(name);
- int val;
+ ssize_t val;
- if (ptr != NULL) {
- val = atoi(ptr);
- if (val > lower_bound) {
- if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%d (%d)\n", name, val, *default_value);
- *default_value = val;
+ if (ptr != NULL && *ptr) {
+ size_t unit = 0;
+ char *end;
+#if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
+ val = strtoll(ptr, &end, 0);
+#else
+ val = strtol(ptr, &end, 0);
+#endif
+ switch (*end) {
+ case 'k': case 'K':
+ unit = 1024;
+ ++end;
+ break;
+ case 'm': case 'M':
+ unit = 1024*1024;
+ ++end;
+ break;
+ case 'g': case 'G':
+ unit = 1024*1024*1024;
+ ++end;
+ break;
+ }
+ while (*end && isspace((unsigned char)*end)) end++;
+ if (*end) {
+ if (RTEST(ruby_verbose)) fprintf(stderr, "invalid string for %s: %s\n", name, ptr);
+ return 0;
+ }
+ if (unit > 0) {
+ if (val < -(ssize_t)(SIZE_MAX / 2 / unit) || (ssize_t)(SIZE_MAX / 2 / unit) < val) {
+ if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%s is ignored because it overflows\n", name, ptr);
+ return 0;
+ }
+ val *= unit;
+ }
+ if (val > 0 && (size_t)val > lower_bound) {
+ if (RTEST(ruby_verbose)) {
+ fprintf(stderr, "%s=%"PRIdSIZE" (default value: %"PRIdSIZE")\n", name, val, *default_value);
+ }
+ *default_value = (size_t)val;
return 1;
}
else {
- if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%d (%d), but ignored because lower than %d\n", name, val, *default_value, lower_bound);
+ if (RTEST(ruby_verbose)) {
+ fprintf(stderr, "%s=%"PRIdSIZE" (default value: %"PRIdSIZE") is ignored because it must be greater than %"PRIdSIZE".\n",
+ name, val, *default_value, lower_bound);
+ }
+ return 0;
}
}
return 0;
@@ -5665,15 +7237,20 @@ get_envparam_double(const char *name, double *default_value, double lower_bound)
char *ptr = getenv(name);
double val;
- if (ptr != NULL) {
- val = strtod(ptr, NULL);
+ if (ptr != NULL && *ptr) {
+ char *end;
+ val = strtod(ptr, &end);
+ if (!*ptr || *end) {
+ if (RTEST(ruby_verbose)) fprintf(stderr, "invalid string for %s: %s\n", name, ptr);
+ return 0;
+ }
if (val > lower_bound) {
- if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (%f)\n", name, val, *default_value);
+ if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (default value: %f)\n", name, val, *default_value);
*default_value = val;
return 1;
}
else {
- if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (%f), but ignored because lower than %f\n", name, val, *default_value, lower_bound);
+ if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (default value: %f) is ignored because it must be greater than %f.\n", name, val, *default_value, lower_bound);
}
}
return 0;
@@ -5697,13 +7274,17 @@ gc_set_initial_pages(void)
* * RUBY_GC_HEAP_INIT_SLOTS
* - Initial allocation slots.
* * RUBY_GC_HEAP_FREE_SLOTS
- * - Prepare at least this ammount of slots after GC.
+ * - Prepare at least this amount of slots after GC.
* - Allocate slots if there are not enough slots.
* * RUBY_GC_HEAP_GROWTH_FACTOR (new from 2.1)
* - Allocate slots by this factor.
* - (next slots number) = (current slots number) * (this factor)
* * RUBY_GC_HEAP_GROWTH_MAX_SLOTS (new from 2.1)
- * - Allocation rate is limited to this factor.
+ * - Allocation rate is limited to this number of slots.
+ * * RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR (new from 2.1.1)
+ * - Do full GC when the number of old objects is more than R * N
+ * where R is this factor and
+ * N is the number of old objects just after last full GC.
*
* * obsolete
* * RUBY_FREE_MIN -> RUBY_GC_HEAP_FREE_SLOTS (from 2.1)
@@ -5724,41 +7305,41 @@ ruby_gc_set_params(int safe_level)
if (safe_level > 0) return;
/* RUBY_GC_HEAP_FREE_SLOTS */
- if (get_envparam_int ("RUBY_FREE_MIN", &gc_params.heap_free_slots, 0)) {
+ if (get_envparam_size("RUBY_GC_HEAP_FREE_SLOTS", &gc_params.heap_free_slots, 0)) {
+ /* ok */
+ }
+ else if (get_envparam_size("RUBY_FREE_MIN", &gc_params.heap_free_slots, 0)) {
rb_warn("RUBY_FREE_MIN is obsolete. Use RUBY_GC_HEAP_FREE_SLOTS instead.");
}
- get_envparam_int ("RUBY_GC_HEAP_FREE_SLOTS", &gc_params.heap_free_slots, 0);
/* RUBY_GC_HEAP_INIT_SLOTS */
- if (get_envparam_int("RUBY_HEAP_MIN_SLOTS", &gc_params.heap_init_slots, 0)) {
- rb_warn("RUBY_HEAP_MIN_SLOTS is obsolete. Use RUBY_GC_HEAP_INIT_SLOTS instead.");
+ if (get_envparam_size("RUBY_GC_HEAP_INIT_SLOTS", &gc_params.heap_init_slots, 0)) {
gc_set_initial_pages();
}
- if (get_envparam_int("RUBY_GC_HEAP_INIT_SLOTS", &gc_params.heap_init_slots, 0)) {
+ else if (get_envparam_size("RUBY_HEAP_MIN_SLOTS", &gc_params.heap_init_slots, 0)) {
+ rb_warn("RUBY_HEAP_MIN_SLOTS is obsolete. Use RUBY_GC_HEAP_INIT_SLOTS instead.");
gc_set_initial_pages();
}
get_envparam_double("RUBY_GC_HEAP_GROWTH_FACTOR", &gc_params.growth_factor, 1.0);
- get_envparam_int ("RUBY_GC_HEAP_GROWTH_MAX_SLOTS", &gc_params.growth_max_slots, 0);
+ get_envparam_size ("RUBY_GC_HEAP_GROWTH_MAX_SLOTS", &gc_params.growth_max_slots, 0);
+ get_envparam_double("RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR", &gc_params.oldobject_limit_factor, 0.0);
- get_envparam_int("RUBY_GC_MALLOC_LIMIT", &gc_params.malloc_limit_min, 0);
- get_envparam_int("RUBY_GC_MALLOC_LIMIT_MAX", &gc_params.malloc_limit_max, 0);
+ get_envparam_size ("RUBY_GC_MALLOC_LIMIT", &gc_params.malloc_limit_min, 0);
+ get_envparam_size ("RUBY_GC_MALLOC_LIMIT_MAX", &gc_params.malloc_limit_max, 0);
get_envparam_double("RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR", &gc_params.malloc_limit_growth_factor, 1.0);
-#ifdef RGENGC_ESTIMATE_OLDMALLOC
- get_envparam_int("RUBY_GC_OLDMALLOC_LIMIT", &gc_params.oldmalloc_limit_min, 0);
- get_envparam_int("RUBY_GC_OLDMALLOC_LIMIT_MAX", &gc_params.oldmalloc_limit_max, 0);
+#if RGENGC_ESTIMATE_OLDMALLOC
+ if (get_envparam_size("RUBY_GC_OLDMALLOC_LIMIT", &gc_params.oldmalloc_limit_min, 0)) {
+ rb_objspace_t *objspace = &rb_objspace;
+ objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_min;
+ }
+ get_envparam_size ("RUBY_GC_OLDMALLOC_LIMIT_MAX", &gc_params.oldmalloc_limit_max, 0);
get_envparam_double("RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR", &gc_params.oldmalloc_limit_growth_factor, 1.0);
#endif
}
void
-rb_gc_set_params(void)
-{
- ruby_gc_set_params(rb_safe_level());
-}
-
-void
rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data)
{
rb_objspace_t *objspace = &rb_objspace;
@@ -5767,9 +7348,9 @@ rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *
struct mark_func_data_struct mfd;
mfd.mark_func = func;
mfd.data = data;
- objspace->mark_func_data = &mfd;
+ PUSH_MARK_FUNC_DATA(&mfd);
gc_mark_children(objspace, obj);
- objspace->mark_func_data = 0;
+ POP_MARK_FUNC_DATA();
}
}
@@ -5799,11 +7380,9 @@ rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE,
mfd.mark_func = root_objects_from;
mfd.data = &data;
- objspace->mark_func_data = &mfd;
- {
- gc_mark_roots(objspace, TRUE, &data.category);
- }
- objspace->mark_func_data = 0;
+ PUSH_MARK_FUNC_DATA(&mfd);
+ gc_mark_roots(objspace, &data.category);
+ POP_MARK_FUNC_DATA();
}
/*
@@ -5865,6 +7444,10 @@ void
rb_memerror(void)
{
rb_thread_t *th = GET_THREAD();
+ rb_objspace_t *objspace = &rb_objspace;
+
+ if (during_gc) gc_exit(objspace, "rb_memerror");
+
if (!nomem_error ||
rb_thread_raised_p(th, RAISED_NOMEMORY)) {
fprintf(stderr, "[FATAL] failed to allocate memory\n");
@@ -5886,7 +7469,7 @@ aligned_malloc(size_t alignment, size_t size)
#if defined __MINGW32__
res = __mingw_aligned_malloc(size, alignment);
-#elif defined _WIN32 && !defined __CYGWIN__
+#elif defined _WIN32
void *_aligned_malloc(size_t, size_t);
res = _aligned_malloc(size, alignment);
#elif defined(HAVE_POSIX_MEMALIGN)
@@ -5920,7 +7503,7 @@ aligned_free(void *ptr)
{
#if defined __MINGW32__
__mingw_aligned_free(ptr);
-#elif defined _WIN32 && !defined __CYGWIN__
+#elif defined _WIN32
_aligned_free(ptr);
#elif defined(HAVE_MEMALIGN) || defined(HAVE_POSIX_MEMALIGN)
free(ptr);
@@ -5958,6 +7541,14 @@ atomic_sub_nounderflow(size_t *var, size_t sub)
}
static void
+objspace_malloc_gc_stress(rb_objspace_t *objspace)
+{
+ if (ruby_gc_stressful && ruby_native_thread_p()) {
+ garbage_collect_with_gvl(objspace, gc_stress_full_mark_after_malloc_p(), TRUE, TRUE, GPR_FLAG_STRESS | GPR_FLAG_MALLOC);
+ }
+}
+
+static void
objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, size_t old_size, enum memop_type type)
{
if (new_size > old_size) {
@@ -5974,18 +7565,13 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
}
if (type == MEMOP_TYPE_MALLOC) {
- if (ruby_gc_stress && !ruby_disable_gc_stress) {
- garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC);
- }
- else {
- retry:
- if (malloc_increase > malloc_limit) {
- if (ruby_thread_has_gvl_p() && is_lazy_sweeping(heap_eden)) {
- gc_rest_sweep(objspace); /* rest_sweep can reduce malloc_increase */
- goto retry;
- }
- garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC);
+ retry:
+ if (malloc_increase > malloc_limit && ruby_native_thread_p() && !dont_gc) {
+ if (ruby_thread_has_gvl_p() && is_lazy_sweeping(heap_eden)) {
+ gc_rest(objspace); /* gc_rest can reduce malloc_increase */
+ goto retry;
}
+ garbage_collect_with_gvl(objspace, FALSE, FALSE, FALSE, GPR_FLAG_MALLOC);
}
}
@@ -6002,10 +7588,10 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
rb_bug("objspace_malloc_increase: underflow malloc_params.allocated_size.");
}
#endif
- atomic_sub_nounderflow(objspace->malloc_params.allocated_size, dec_size);
+ atomic_sub_nounderflow(&objspace->malloc_params.allocated_size, dec_size);
}
- if (0) fprintf(stderr, "incraese - ptr: %p, type: %s, new_size: %d, old_size: %d\n",
+ if (0) fprintf(stderr, "increase - ptr: %p, type: %s, new_size: %d, old_size: %d\n",
mem,
type == MEMOP_TYPE_MALLOC ? "malloc" :
type == MEMOP_TYPE_FREE ? "free " :
@@ -6020,11 +7606,11 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
{
size_t allocations = objspace->malloc_params.allocations;
if (allocations > 0) {
- atomic_sub_nounderflow(objspace->malloc_params.allocations, 1);
+ atomic_sub_nounderflow(&objspace->malloc_params.allocations, 1);
}
#if MALLOC_ALLOCATED_SIZE_CHECK
else {
- assert(objspace->malloc_params.allocations > 0);
+ if (RGENGC_CHECK_MODE) assert(objspace->malloc_params.allocations > 0);
}
#endif
}
@@ -6061,8 +7647,9 @@ objspace_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
}
#define TRY_WITH_GC(alloc) do { \
+ objspace_malloc_gc_stress(objspace); \
if (!(alloc) && \
- (!garbage_collect_with_gvl(objspace, 1, 1, GPR_FLAG_MALLOC) || /* full mark && immediate sweep */ \
+ (!garbage_collect_with_gvl(objspace, TRUE, TRUE, TRUE, GPR_FLAG_MALLOC) || /* full/immediate mark && immediate sweep */ \
!(alloc))) { \
ruby_memerror(); \
} \
@@ -6104,7 +7691,7 @@ objspace_xrealloc(rb_objspace_t *objspace, void *ptr, size_t new_size, size_t ol
#if CALC_EXACT_MALLOC_SIZE
new_size += sizeof(size_t);
ptr = (size_t *)ptr - 1;
- oldsize = ((size_t *)ptr)[0];
+ old_size = ((size_t *)ptr)[0];
#endif
old_size = objspace_malloc_size(objspace, ptr, old_size);
@@ -6126,7 +7713,7 @@ objspace_xfree(rb_objspace_t *objspace, void *ptr, size_t old_size)
{
#if CALC_EXACT_MALLOC_SIZE
ptr = ((size_t *)ptr) - 1;
- oldsize = ((size_t*)ptr)[0];
+ old_size = ((size_t*)ptr)[0];
#endif
old_size = objspace_malloc_size(objspace, ptr, old_size);
@@ -6141,16 +7728,16 @@ ruby_xmalloc(size_t size)
return objspace_xmalloc(&rb_objspace, size);
}
-static inline size_t
-xmalloc2_size(size_t n, size_t size)
+void
+ruby_malloc_size_overflow(size_t count, size_t elsize)
{
- size_t len = size * n;
- if (n != 0 && size != len / n) {
- rb_raise(rb_eArgError, "malloc: possible integer overflow");
- }
- return len;
+ rb_raise(rb_eArgError,
+ "malloc: possible integer overflow (%"PRIdSIZE"*%"PRIdSIZE")",
+ count, elsize);
}
+#define xmalloc2_size ruby_xmalloc2_size
+
void *
ruby_xmalloc2(size_t n, size_t size)
{
@@ -6167,6 +7754,8 @@ objspace_xcalloc(rb_objspace_t *objspace, size_t count, size_t elsize)
size = objspace_malloc_prepare(objspace, size);
TRY_WITH_GC(mem = calloc(1, size));
+ size = objspace_malloc_size(objspace, mem, size);
+ objspace_malloc_increase(objspace, mem, size, 0, MEMOP_TYPE_MALLOC);
return objspace_malloc_fixup(objspace, mem, size);
}
@@ -6256,6 +7845,36 @@ ruby_mimfree(void *ptr)
free(mem);
}
+void *
+rb_alloc_tmp_buffer(volatile VALUE *store, long len)
+{
+ NODE *s;
+ long cnt;
+ void *ptr;
+
+ if (len < 0 || (cnt = (long)roomof(len, sizeof(VALUE))) < 0) {
+ rb_raise(rb_eArgError, "negative buffer size (or size too big)");
+ }
+
+ s = rb_node_newnode(NODE_ALLOCA, 0, 0, 0);
+ ptr = ruby_xmalloc(cnt * sizeof(VALUE));
+ s->u1.value = (VALUE)ptr;
+ s->u3.cnt = cnt;
+ *store = (VALUE)s;
+ return ptr;
+}
+
+void
+rb_free_tmp_buffer(volatile VALUE *store)
+{
+ VALUE s = ATOMIC_VALUE_EXCHANGE(*store, 0);
+ if (s) {
+ void *ptr = ATOMIC_PTR_EXCHANGE(RNODE(s)->u1.node, 0);
+ RNODE(s)->u3.cnt = 0;
+ ruby_xfree(ptr);
+ }
+}
+
#if MALLOC_ALLOCATED_SIZE
/*
* call-seq:
@@ -6351,7 +7970,6 @@ 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);
@@ -6366,7 +7984,7 @@ static const rb_data_type_t weakmap_type = {
wmap_free,
wmap_memsize,
},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
@@ -6396,7 +8014,7 @@ wmap_final_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
return ST_DELETE;
}
if (j < i) {
- ptr = ruby_sized_xrealloc2(ptr, j, sizeof(VALUE), i);
+ ptr = ruby_sized_xrealloc2(ptr, j + 1, sizeof(VALUE), i);
ptr[0] = j;
*value = (st_data_t)ptr;
}
@@ -6685,6 +8303,7 @@ wmap_size(VALUE self)
#define GC_PROFILE_RECORD_DEFAULT_SIZE 100
+/* return sec in user time */
static double
getrusage_time(void)
{
@@ -6714,25 +8333,25 @@ getrusage_time(void)
#ifdef _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) {
- memcpy(&ui, &user_time, sizeof(FILETIME));
- q = ui.QuadPart / 10L;
- t = (DWORD)(q % 1000000L) * 1e-6;
- q /= 1000000L;
+ 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) {
+ memcpy(&ui, &user_time, sizeof(FILETIME));
+ q = ui.QuadPart / 10L;
+ t = (DWORD)(q % 1000000L) * 1e-6;
+ q /= 1000000L;
#ifdef __GNUC__
- t += q;
+ t += q;
#else
- t += (double)(DWORD)(q >> 16) * (1 << 16);
- t += (DWORD)q & ~(~0 << 16);
+ t += (double)(DWORD)(q >> 16) * (1 << 16);
+ t += (DWORD)q & ~(~0 << 16);
#endif
- return t;
- }
+ return t;
+ }
}
#endif
@@ -6764,7 +8383,7 @@ gc_prof_setup_new_record(rb_objspace_t *objspace, int reason)
MEMZERO(record, gc_profile_record, 1);
/* setup before-GC parameter */
- record->flags = reason | ((ruby_gc_stress && !ruby_disable_gc_stress) ? GPR_FLAG_STRESS : 0);
+ record->flags = reason | (ruby_gc_stressful ? GPR_FLAG_STRESS : 0);
#if MALLOC_ALLOCATED_SIZE
record->allocated_size = malloc_allocated_size;
#endif
@@ -6818,12 +8437,12 @@ gc_prof_timer_stop(rb_objspace_t *objspace)
}
}
+#define RUBY_DTRACE_GC_HOOK(name) \
+ do {if (RUBY_DTRACE_GC_##name##_ENABLED()) RUBY_DTRACE_GC_##name();} while (0)
static inline void
gc_prof_mark_timer_start(rb_objspace_t *objspace)
{
- if (RUBY_DTRACE_GC_MARK_BEGIN_ENABLED()) {
- RUBY_DTRACE_GC_MARK_BEGIN();
- }
+ RUBY_DTRACE_GC_HOOK(MARK_BEGIN);
#if GC_PROFILE_MORE_DETAIL
if (gc_prof_enabled(objspace)) {
gc_prof_record(objspace)->gc_mark_time = getrusage_time();
@@ -6834,9 +8453,7 @@ gc_prof_mark_timer_start(rb_objspace_t *objspace)
static inline void
gc_prof_mark_timer_stop(rb_objspace_t *objspace)
{
- if (RUBY_DTRACE_GC_MARK_END_ENABLED()) {
- RUBY_DTRACE_GC_MARK_END();
- }
+ RUBY_DTRACE_GC_HOOK(MARK_END);
#if GC_PROFILE_MORE_DETAIL
if (gc_prof_enabled(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);
@@ -6848,9 +8465,7 @@ gc_prof_mark_timer_stop(rb_objspace_t *objspace)
static inline void
gc_prof_sweep_timer_start(rb_objspace_t *objspace)
{
- if (RUBY_DTRACE_GC_SWEEP_BEGIN_ENABLED()) {
- RUBY_DTRACE_GC_SWEEP_BEGIN();
- }
+ RUBY_DTRACE_GC_HOOK(SWEEP_BEGIN);
if (gc_prof_enabled(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);
@@ -6863,9 +8478,7 @@ gc_prof_sweep_timer_start(rb_objspace_t *objspace)
static inline void
gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
{
- if (RUBY_DTRACE_GC_SWEEP_END_ENABLED()) {
- RUBY_DTRACE_GC_SWEEP_END();
- }
+ RUBY_DTRACE_GC_HOOK(SWEEP_END);
if (gc_prof_enabled(objspace)) {
double sweep_time;
@@ -6905,7 +8518,7 @@ gc_prof_set_heap_info(rb_objspace_t *objspace)
{
if (gc_prof_enabled(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);
- size_t live = objspace->profile.total_allocated_object_num_at_gc_start - objspace->profile.total_freed_object_num;
+ size_t live = objspace->profile.total_allocated_objects_at_gc_start - objspace->profile.total_freed_objects;
size_t total = objspace->profile.heap_used_at_gc_start * HEAP_OBJ_LIMIT;
#if GC_PROFILE_MORE_DETAIL
@@ -7011,7 +8624,7 @@ gc_profile_record_get(void)
gc_profile_record *record = &objspace->profile.records[i];
prof = rb_hash_new();
- rb_hash_aset(prof, ID2SYM(rb_intern("GC_FLAGS")), gc_info_decode(record->flags, rb_hash_new()));
+ rb_hash_aset(prof, ID2SYM(rb_intern("GC_FLAGS")), gc_info_decode(0, rb_hash_new(), record->flags));
rb_hash_aset(prof, ID2SYM(rb_intern("GC_TIME")), DBL2NUM(record->gc_time));
rb_hash_aset(prof, ID2SYM(rb_intern("GC_INVOKE_TIME")), DBL2NUM(record->gc_invoke_time));
rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_USE_SIZE")), SIZET2NUM(record->heap_use_size));
@@ -7035,8 +8648,8 @@ gc_profile_record_get(void)
#if RGENGC_PROFILE > 0
rb_hash_aset(prof, ID2SYM(rb_intern("OLD_OBJECTS")), SIZET2NUM(record->old_objects));
- rb_hash_aset(prof, ID2SYM(rb_intern("REMEMBED_NORMAL_OBJECTS")), SIZET2NUM(record->remembered_normal_objects));
- rb_hash_aset(prof, ID2SYM(rb_intern("REMEMBED_SHADY_OBJECTS")), SIZET2NUM(record->remembered_shady_objects));
+ rb_hash_aset(prof, ID2SYM(rb_intern("REMEMBERED_NORMAL_OBJECTS")), SIZET2NUM(record->remembered_normal_objects));
+ rb_hash_aset(prof, ID2SYM(rb_intern("REMEMBERED_SHADY_OBJECTS")), SIZET2NUM(record->remembered_shady_objects));
#endif
rb_ary_push(gc_profile, prof);
}
@@ -7320,6 +8933,7 @@ type_name(int type, VALUE obj)
TYPE_NAME(T_SYMBOL);
TYPE_NAME(T_FIXNUM);
TYPE_NAME(T_UNDEF);
+ TYPE_NAME(T_IMEMO);
TYPE_NAME(T_NODE);
TYPE_NAME(T_ICLASS);
TYPE_NAME(T_ZOMBIE);
@@ -7339,6 +8953,203 @@ obj_type_name(VALUE obj)
return type_name(TYPE(obj), obj);
}
+static const char *
+method_type_name(rb_method_type_t type)
+{
+ switch (type) {
+ case VM_METHOD_TYPE_ISEQ: return "iseq";
+ case VM_METHOD_TYPE_ATTRSET: return "attrest";
+ case VM_METHOD_TYPE_IVAR: return "ivar";
+ case VM_METHOD_TYPE_BMETHOD: return "bmethod";
+ case VM_METHOD_TYPE_ALIAS: return "alias";
+ case VM_METHOD_TYPE_REFINED: return "refined";
+ case VM_METHOD_TYPE_CFUNC: return "cfunc";
+ case VM_METHOD_TYPE_ZSUPER: return "zsuper";
+ case VM_METHOD_TYPE_MISSING: return "missing";
+ case VM_METHOD_TYPE_OPTIMIZED: return "optimized";
+ case VM_METHOD_TYPE_UNDEF: return "undef";
+ case VM_METHOD_TYPE_NOTIMPLEMENTED: return "notimplemented";
+ }
+ rb_bug("method_type_name: unreachable (type: %d)", type);
+}
+
+/* from array.c */
+# define ARY_SHARED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary),ELTS_SHARED)!=0)
+# define ARY_EMBED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary), RARRAY_EMBED_FLAG)!=0)
+
+const char *
+rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
+{
+ if (SPECIAL_CONST_P(obj)) {
+ snprintf(buff, buff_size, "%s", obj_type_name(obj));
+ }
+ else {
+#define TF(c) ((c) != 0 ? "true" : "false")
+#define C(c, s) ((c) != 0 ? (s) : " ")
+ const int type = BUILTIN_TYPE(obj);
+#if USE_RGENGC
+ const int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
+
+ snprintf(buff, buff_size, "%p [%d%s%s%s%s] %s",
+ (void *)obj, age,
+ C(RVALUE_UNCOLLECTIBLE_BITMAP(obj), "L"),
+ C(RVALUE_MARK_BITMAP(obj), "M"),
+ C(RVALUE_MARKING_BITMAP(obj), "R"),
+ C(RVALUE_WB_UNPROTECTED_BITMAP(obj), "U"),
+ obj_type_name(obj));
+#else
+ snprintf(buff, buff_size, "%p [%s] %s",
+ (void *)obj,
+ C(RVALUE_MARK_BITMAP(obj), "M"),
+ obj_type_name(obj));
+#endif
+
+ if (internal_object_p(obj)) {
+ /* ignore */
+ }
+ else if (RBASIC(obj)->klass == 0) {
+ snprintf(buff, buff_size, "%s (temporary internal)", buff);
+ }
+ else {
+ VALUE class_path = rb_class_path_cached(RBASIC(obj)->klass);
+ if (!NIL_P(class_path)) {
+ snprintf(buff, buff_size, "%s (%s)", buff, RSTRING_PTR(class_path));
+ }
+ }
+
+#if GC_DEBUG
+ snprintf(buff, buff_size, "%s @%s:%d", buff, RANY(obj)->file, RANY(obj)->line);
+#endif
+
+ switch (type) {
+ case T_NODE:
+ snprintf(buff, buff_size, "%s (%s)", buff,
+ ruby_node_name(nd_type(obj)));
+ break;
+ case T_ARRAY:
+ snprintf(buff, buff_size, "%s [%s%s] len: %d", buff,
+ C(ARY_EMBED_P(obj), "E"),
+ C(ARY_SHARED_P(obj), "S"),
+ (int)RARRAY_LEN(obj));
+ break;
+ case T_STRING: {
+ snprintf(buff, buff_size, "%s %s", buff, RSTRING_PTR(obj));
+ break;
+ }
+ case T_CLASS: {
+ VALUE class_path = rb_class_path_cached(obj);
+ if (!NIL_P(class_path)) {
+ snprintf(buff, buff_size, "%s %s", buff, RSTRING_PTR(class_path));
+ }
+ break;
+ }
+ case T_DATA: {
+ const char * const type_name = rb_objspace_data_type_name(obj);
+ if (type_name) {
+ snprintf(buff, buff_size, "%s %s", buff, type_name);
+ }
+ break;
+ }
+ case T_IMEMO: {
+ const char *imemo_name;
+ switch (imemo_type(obj)) {
+#define IMEMO_NAME(x) case imemo_##x: imemo_name = #x; break;
+ IMEMO_NAME(none);
+ IMEMO_NAME(cref);
+ IMEMO_NAME(svar);
+ IMEMO_NAME(throw_data);
+ IMEMO_NAME(ifunc);
+ IMEMO_NAME(memo);
+ IMEMO_NAME(ment);
+ IMEMO_NAME(iseq);
+ default: rb_bug("unknown IMEMO");
+#undef IMEMO_NAME
+ }
+ snprintf(buff, buff_size, "%s %s", buff, imemo_name);
+
+ switch (imemo_type(obj)) {
+ case imemo_ment: {
+ const rb_method_entry_t *me = &RANY(obj)->as.imemo.ment;
+ snprintf(buff, buff_size, "%s (called_id: %s, type: %s, alias: %d, owner: %s, defined_class: %s)", buff,
+ rb_id2name(me->called_id),
+ method_type_name(me->def->type),
+ me->def->alias_count,
+ obj_info(me->owner),
+ obj_info(me->defined_class));
+ break;
+ }
+ case imemo_iseq: {
+ const rb_iseq_t *iseq = (const rb_iseq_t *)obj;
+
+ if (iseq->body->location.label) {
+ snprintf(buff, buff_size, "%s %s@%s:%d", buff,
+ RSTRING_PTR(iseq->body->location.label),
+ RSTRING_PTR(iseq->body->location.path),
+ FIX2INT(iseq->body->location.first_lineno));
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ default:
+ break;
+ }
+#undef TF
+#undef C
+ }
+ return buff;
+}
+
+#if RGENGC_OBJ_INFO
+#define OBJ_INFO_BUFFERS_NUM 10
+#define OBJ_INFO_BUFFERS_SIZE 0x100
+static int obj_info_buffers_index = 0;
+static char obj_info_buffers[OBJ_INFO_BUFFERS_NUM][OBJ_INFO_BUFFERS_SIZE];
+
+static const char *
+obj_info(VALUE obj)
+{
+ const int index = obj_info_buffers_index++;
+ char *const buff = &obj_info_buffers[index][0];
+
+ if (obj_info_buffers_index >= OBJ_INFO_BUFFERS_NUM) {
+ obj_info_buffers_index = 0;
+ }
+
+ return rb_raw_obj_info(buff, OBJ_INFO_BUFFERS_SIZE, obj);
+}
+#else
+static const char *
+obj_info(VALUE obj)
+{
+ return obj_type_name(obj);
+}
+#endif
+
+const char *
+rb_obj_info(VALUE obj)
+{
+ if (!rb_special_const_p(obj)) {
+ return obj_info(obj);
+ }
+ else {
+ return obj_type_name(obj);
+ }
+}
+
+void
+rb_obj_info_dump(VALUE obj)
+{
+ char buff[0x100];
+ fprintf(stderr, "rb_obj_info_dump: %s\n", rb_raw_obj_info(buff, 0x100, obj));
+}
+
#if GC_DEBUG
void
@@ -7346,7 +9157,7 @@ rb_gcdebug_print_obj_condition(VALUE obj)
{
rb_objspace_t *objspace = &rb_objspace;
- fprintf(stderr, "created at: %s:%d\n", RSTRING_PTR(RANY(obj)->file), FIX2INT(RANY(obj)->line));
+ fprintf(stderr, "created at: %s:%d\n", RANY(obj)->file, RANY(obj)->line);
if (is_pointer_to_heap(objspace, (void *)obj)) {
fprintf(stderr, "pointer to heap?: true\n");
@@ -7358,12 +9169,10 @@ rb_gcdebug_print_obj_condition(VALUE obj)
fprintf(stderr, "marked? : %s\n", MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj) ? "true" : "false");
#if USE_RGENGC
-#if RGENGC_THREEGEN
- fprintf(stderr, "young? : %s\n", RVALUE_YOUNG_P(obj) ? "true" : "false");
-#endif
+ fprintf(stderr, "age? : %d\n", RVALUE_AGE(obj));
fprintf(stderr, "old? : %s\n", RVALUE_OLD_P(obj) ? "true" : "false");
- fprintf(stderr, "WB-protected?: %s\n", RVALUE_WB_PROTECTED(obj) ? "true" : "false");
- fprintf(stderr, "remembered? : %s\n", MARKED_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(obj), obj) ? "true" : "false");
+ fprintf(stderr, "WB-protected?: %s\n", RVALUE_WB_UNPROTECTED(obj) ? "false" : "true");
+ fprintf(stderr, "remembered? : %s\n", RVALUE_REMEMBERED(obj) ? "true" : "false");
#endif
if (is_lazy_sweeping(heap_eden)) {
@@ -7376,7 +9185,7 @@ rb_gcdebug_print_obj_condition(VALUE obj)
}
static VALUE
-gcdebug_sential(VALUE obj, VALUE name)
+gcdebug_sentinel(VALUE obj, VALUE name)
{
fprintf(stderr, "WARNING: object %s(%p) is inadvertently collected\n", (char *)name, (void *)obj);
return Qnil;
@@ -7385,10 +9194,42 @@ gcdebug_sential(VALUE obj, VALUE name)
void
rb_gcdebug_sentinel(VALUE obj, const char *name)
{
- rb_define_finalizer(obj, rb_proc_new(gcdebug_sential, (VALUE)name));
+ rb_define_finalizer(obj, rb_proc_new(gcdebug_sentinel, (VALUE)name));
}
+
#endif /* GC_DEBUG */
+#if GC_DEBUG_STRESS_TO_CLASS
+static VALUE
+rb_gcdebug_add_stress_to_class(int argc, VALUE *argv, VALUE self)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ if (!stress_to_class) {
+ stress_to_class = rb_ary_tmp_new(argc);
+ }
+ rb_ary_cat(stress_to_class, argv, argc);
+ return self;
+}
+
+static VALUE
+rb_gcdebug_remove_stress_to_class(int argc, VALUE *argv, VALUE self)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ int i;
+
+ if (stress_to_class) {
+ for (i = 0; i < argc; ++i) {
+ rb_ary_delete_same(stress_to_class, argv[i]);
+ }
+ if (RARRAY_LEN(stress_to_class) == 0) {
+ stress_to_class = 0;
+ }
+ }
+ return Qnil;
+}
+#endif
+
/*
* Document-module: ObjectSpace
*
@@ -7400,6 +9241,8 @@ rb_gcdebug_sentinel(VALUE obj, const char *name)
* called when a specific object is about to be destroyed by garbage
* collection.
*
+ * require 'objspace'
+ *
* a = "A"
* b = "B"
*
@@ -7454,6 +9297,7 @@ rb_gcdebug_sentinel(VALUE obj, const char *name)
void
Init_GC(void)
{
+#undef rb_intern
VALUE rb_mObjSpace;
VALUE rb_mProfiler;
VALUE gc_constants;
@@ -7463,7 +9307,7 @@ Init_GC(void)
rb_define_singleton_method(rb_mGC, "enable", rb_gc_enable, 0);
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
rb_define_singleton_method(rb_mGC, "stress", gc_stress_get, 0);
- rb_define_singleton_method(rb_mGC, "stress=", gc_stress_set, 1);
+ rb_define_singleton_method(rb_mGC, "stress=", gc_stress_set_m, 1);
rb_define_singleton_method(rb_mGC, "count", gc_count, 0);
rb_define_singleton_method(rb_mGC, "stat", gc_stat, -1);
rb_define_singleton_method(rb_mGC, "latest_gc_info", gc_latest_gc_info, -1);
@@ -7496,10 +9340,7 @@ Init_GC(void)
rb_define_module_function(rb_mObjSpace, "_id2ref", id2ref, 1);
- nomem_error = rb_exc_new3(rb_eNoMemError,
- rb_obj_freeze(rb_str_new2("failed to allocate memory")));
- OBJ_TAINT(nomem_error);
- OBJ_FREEZE(nomem_error);
+ rb_vm_register_special_exception(ruby_error_nomemory, rb_eNoMemError, "failed to allocate memory");
rb_define_method(rb_cBasicObject, "__id__", rb_obj_id, 0);
rb_define_method(rb_mKernel, "object_id", rb_obj_id, 0);
@@ -7534,17 +9375,21 @@ Init_GC(void)
rb_define_singleton_method(rb_mGC, "malloc_allocations", gc_malloc_allocations, 0);
#endif
+#if GC_DEBUG_STRESS_TO_CLASS
+ rb_define_singleton_method(rb_mGC, "add_stress_to_class", rb_gcdebug_add_stress_to_class, -1);
+ rb_define_singleton_method(rb_mGC, "remove_stress_to_class", rb_gcdebug_remove_stress_to_class, -1);
+#endif
+
/* ::GC::OPTS, which shows GC build options */
{
VALUE opts;
rb_define_const(rb_mGC, "OPTS", opts = rb_ary_new());
-#define OPT(o) if (o) rb_ary_push(opts, rb_str_new2(#o))
+#define OPT(o) if (o) rb_ary_push(opts, rb_fstring_lit(#o))
OPT(GC_DEBUG);
OPT(USE_RGENGC);
OPT(RGENGC_DEBUG);
OPT(RGENGC_CHECK_MODE);
OPT(RGENGC_PROFILE);
- OPT(RGENGC_THREEGEN);
OPT(RGENGC_ESTIMATE_OLDMALLOC);
OPT(GC_PROFILE_MORE_DETAIL);
OPT(GC_ENABLE_LAZY_SWEEP);
@@ -7553,5 +9398,6 @@ Init_GC(void)
OPT(MALLOC_ALLOCATED_SIZE_CHECK);
OPT(GC_PROFILE_DETAIL_MEMORY);
#undef OPT
+ OBJ_FREEZE(opts);
}
}
diff --git a/gc.h b/gc.h
index 09edafa027..c723106137 100644
--- a/gc.h
+++ b/gc.h
@@ -57,7 +57,10 @@ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
#define RUBY_GC_INFO if(0)printf
#endif
-#define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
+#define RUBY_MARK_UNLESS_NULL(ptr) do { \
+ VALUE markobj = (ptr); \
+ if (RTEST(markobj)) {rb_gc_mark(markobj);} \
+} while (0)
#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
#if STACK_GROW_DIRECTION > 0
@@ -83,6 +86,10 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr);
#endif
#define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)
+const char *rb_obj_info(VALUE obj);
+const char *rb_raw_obj_info(char *buff, const int buff_size, VALUE obj);
+void rb_obj_info_dump(VALUE obj);
+
RUBY_SYMBOL_EXPORT_BEGIN
/* exports for objspace module */
@@ -91,11 +98,17 @@ void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), v
void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data);
int rb_objspace_markable_object_p(VALUE obj);
int rb_objspace_internal_object_p(VALUE obj);
+int rb_objspace_marked_object_p(VALUE obj);
+int rb_objspace_garbage_object_p(VALUE obj);
void rb_objspace_each_objects(
int (*callback)(void *start, void *end, size_t stride, void *data),
void *data);
+void rb_objspace_each_objects_without_setup(
+ int (*callback)(void *, void *, size_t, void *),
+ void *data);
+
RUBY_SYMBOL_EXPORT_END
#endif /* RUBY_GC_H */
diff --git a/gem_prelude.rb b/gem_prelude.rb
index 3d4516f341..3f171d1145 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -1 +1,7 @@
-require 'rubygems.rb' if defined?(Gem)
+if defined?(Gem)
+ require 'rubygems.rb'
+ begin
+ require 'did_you_mean'
+ rescue LoadError
+ end if defined?(DidYouMean)
+end
diff --git a/gems/bundled_gems b/gems/bundled_gems
new file mode 100644
index 0000000000..1cdb82884d
--- /dev/null
+++ b/gems/bundled_gems
@@ -0,0 +1,6 @@
+power_assert 0.2.6
+test-unit 3.1.5
+minitest 5.8.5
+rake 10.4.2
+net-telnet 0.1.1
+did_you_mean 1.0.0
diff --git a/goruby.c b/goruby.c
index 8f7cf30be4..99042f8440 100644
--- a/goruby.c
+++ b/goruby.c
@@ -32,12 +32,14 @@ goruby_options(int argc, char **argv)
void *ret;
if ((isatty(0) && isatty(1) && isatty(2)) && (pipe(rw) == 0)) {
+ ssize_t n;
infd = dup(0);
+ if (infd < 0) return NULL;
dup2(rw[0], 0);
close(rw[0]);
- write(rw[1], cmd, sizeof(cmd) - 1);
+ n = write(rw[1], cmd, sizeof(cmd) - 1);
close(rw[1]);
- ret = ruby_options(argc, argv);
+ ret = n > 0 ? ruby_options(argc, argv) : NULL;
dup2(infd, 0);
close(infd);
return ret;
diff --git a/hash.c b/hash.c
index 1fa40b1bba..e418b99c1f 100644
--- a/hash.c
+++ b/hash.c
@@ -11,13 +11,13 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/st.h"
#include "ruby/util.h"
-#include "ruby/encoding.h"
-#include "internal.h"
#include <errno.h>
#include "probes.h"
+#include "id.h"
+#include "symbol.h"
#ifdef __APPLE__
# ifdef HAVE_CRT_EXTERNS_H
@@ -27,12 +27,22 @@
# endif
#endif
-#define HAS_MISC_ATTRIBUTES(hash, klass) ( \
- (klass = rb_obj_class(hash)) != rb_cHash || \
- (klass = 0, \
- FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
- !NIL_P(RHASH_IFNONE(hash))))
-#define HASH_REJECT_COPY_MISC_ATTRIBUTES 1
+#define HAS_EXTRA_STATES(hash, klass) ( \
+ ((klass = has_extra_methods(rb_obj_class(hash))) != 0) || \
+ FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
+ !NIL_P(RHASH_IFNONE(hash)))
+
+static VALUE
+has_extra_methods(VALUE klass)
+{
+ const VALUE base = rb_cHash;
+ VALUE c = klass;
+ while (c != base) {
+ if (rb_class_has_methods(c)) return klass;
+ c = RCLASS_SUPER(c);
+ }
+ return 0;
+}
static VALUE rb_hash_s_try_convert(VALUE, VALUE);
@@ -55,7 +65,13 @@ rb_hash_freeze(VALUE hash)
VALUE rb_cHash;
static VALUE envtbl;
-static ID id_hash, id_yield, id_default;
+static ID id_hash, id_yield, id_default, id_flatten_bang;
+
+VALUE
+rb_hash_ifnone(VALUE h)
+{
+ return RHASH_IFNONE(h);
+}
VALUE
rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
@@ -111,27 +127,110 @@ rb_hash(VALUE obj)
return hval;
}
+long rb_objid_hash(st_index_t index);
+
static st_index_t
-rb_any_hash(VALUE a)
+any_hash(VALUE a, st_index_t (*other_func)(VALUE))
{
VALUE hval;
st_index_t hnum;
if (SPECIAL_CONST_P(a)) {
if (a == Qundef) return 0;
- hnum = rb_hash_start((st_index_t)a);
- hnum = rb_hash_uint(hnum, (st_index_t)rb_any_hash);
- hnum = rb_hash_end(hnum);
+ if (STATIC_SYM_P(a)) {
+ hnum = a >> (RUBY_SPECIAL_SHIFT + ID_SCOPE_SHIFT);
+ hnum = rb_hash_start(hnum);
+ goto out;
+ }
+ else if (FLONUM_P(a)) {
+ /* prevent pathological behavior: [Bug #10761] */
+ goto flt;
+ }
+ hnum = rb_objid_hash((st_index_t)a);
}
else if (BUILTIN_TYPE(a) == T_STRING) {
hnum = rb_str_hash(a);
}
- else {
- hval = rb_hash(a);
+ else if (BUILTIN_TYPE(a) == T_SYMBOL) {
+ hnum = RSYMBOL(a)->hashval;
+ }
+ else if (BUILTIN_TYPE(a) == T_BIGNUM) {
+ hval = rb_big_hash(a);
+ hnum = FIX2LONG(hval);
+ }
+ else if (BUILTIN_TYPE(a) == T_FLOAT) {
+ flt:
+ hval = rb_dbl_hash(rb_float_value(a));
hnum = FIX2LONG(hval);
}
+ else {
+ hnum = other_func(a);
+ }
+ out:
hnum <<= 1;
- return (st_index_t)RSHIFT(hnum, 1);
+ return (long)RSHIFT(hnum, 1);
+}
+
+static st_index_t
+obj_any_hash(VALUE obj)
+{
+ obj = rb_hash(obj);
+ return FIX2LONG(obj);
+}
+
+static st_index_t
+rb_any_hash(VALUE a)
+{
+ return any_hash(a, obj_any_hash);
+}
+
+static st_index_t
+rb_num_hash_start(st_index_t n)
+{
+ /*
+ * This hash function is lightly-tuned for Ruby. Further tuning
+ * should be possible. Notes:
+ *
+ * - (n >> 3) alone is great for heap objects and OK for fixnum,
+ * however symbols perform poorly.
+ * - (n >> (RUBY_SPECIAL_SHIFT+3)) was added to make symbols hash well,
+ * n.b.: +3 to remove most ID scope, +1 worked well initially, too
+ * n.b.: +1 (instead of 3) worked well initially, too
+ * - (n << 16) was finally added to avoid losing bits for fixnums
+ * - avoid expensive modulo instructions, it is currently only
+ * shifts and bitmask operations.
+ */
+ return (n >> (RUBY_SPECIAL_SHIFT + 3) ^ (n << 16)) ^ (n >> 3);
+}
+
+long
+rb_objid_hash(st_index_t index)
+{
+ st_index_t hnum = rb_num_hash_start(index);
+
+ hnum = rb_hash_start(hnum);
+ hnum = rb_hash_uint(hnum, (st_index_t)rb_any_hash);
+ hnum = rb_hash_end(hnum);
+ return hnum;
+}
+
+static st_index_t
+objid_hash(VALUE obj)
+{
+ return rb_objid_hash((st_index_t)obj);
+}
+
+VALUE
+rb_obj_hash(VALUE obj)
+{
+ st_index_t hnum = any_hash(obj, objid_hash);
+ return LONG2FIX(hnum);
+}
+
+int
+rb_hash_iter_lev(VALUE h)
+{
+ return RHASH_ITER_LEV(h);
}
static const struct st_hash_type objhash = {
@@ -139,8 +238,29 @@ static const struct st_hash_type objhash = {
rb_any_hash,
};
-extern const struct st_hash_type st_hashtype_num;
-#define identhash st_hashtype_num
+#define rb_ident_cmp st_numcmp
+
+static st_index_t
+rb_ident_hash(st_data_t n)
+{
+#ifdef USE_FLONUM /* RUBY */
+ /*
+ * - flonum (on 64-bit) is pathologically bad, mix the actual
+ * float value in, but do not use the float value as-is since
+ * many integers get interpreted as 2.0 or -2.0 [Bug #10761]
+ */
+ if (FLONUM_P(n)) {
+ n ^= (st_data_t)rb_float_value(n);
+ }
+#endif
+
+ return (st_index_t)rb_num_hash_start((st_index_t)n);
+}
+
+static const struct st_hash_type identhash = {
+ rb_ident_cmp,
+ rb_ident_hash,
+};
typedef int st_foreach_func(st_data_t, st_data_t, st_data_t);
@@ -266,9 +386,7 @@ hash_alloc(VALUE klass)
static VALUE
empty_hash_alloc(VALUE klass)
{
- if (RUBY_DTRACE_HASH_CREATE_ENABLED()) {
- RUBY_DTRACE_HASH_CREATE(0, rb_sourcefile(), rb_sourceline());
- }
+ RUBY_DTRACE_CREATE_HOOK(HASH, 0);
return hash_alloc(klass);
}
@@ -279,7 +397,7 @@ rb_hash_new(void)
return hash_alloc(rb_cHash);
}
-static VALUE
+static inline VALUE
rb_hash_dup_empty(VALUE hash)
{
NEWOBJ_OF(ret, struct RHash,
@@ -465,7 +583,8 @@ rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
FL_SET(hash, HASH_PROC_DEFAULT);
}
else {
- rb_scan_args(argc, argv, "01", &ifnone);
+ rb_check_arity(argc, 0, 1);
+ ifnone = argc == 0 ? Qnil : argv[0];
RHASH_SET_IFNONE(hash, ifnone);
}
@@ -607,7 +726,7 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
* Rebuilds the hash based on the current hash values for each key. If
* values of key objects have changed since they were inserted, this
* method will reindex <i>hsh</i>. If <code>Hash#rehash</code> is
- * called while an iterator is traversing the hash, an
+ * called while an iterator is traversing the hash, a
* <code>RuntimeError</code> will be raised in the iterator.
*
* a = [ "a", "b" ]
@@ -620,7 +739,7 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
* h[a] #=> 100
*/
-static VALUE
+VALUE
rb_hash_rehash(VALUE hash)
{
VALUE tmp;
@@ -644,8 +763,8 @@ rb_hash_rehash(VALUE hash)
return hash;
}
-static VALUE
-hash_default_value(VALUE hash, VALUE key)
+VALUE
+rb_hash_default_value(VALUE hash, VALUE key)
{
if (rb_method_basic_definition_p(CLASS_OF(hash), id_default)) {
VALUE ifnone = RHASH_IFNONE(hash);
@@ -678,7 +797,7 @@ rb_hash_aref(VALUE hash, VALUE key)
st_data_t val;
if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
- return hash_default_value(hash, key);
+ return rb_hash_default_value(hash, key);
}
return (VALUE)val;
}
@@ -732,11 +851,12 @@ rb_hash_lookup(VALUE hash, VALUE key)
static VALUE
rb_hash_fetch_m(int argc, VALUE *argv, VALUE hash)
{
- VALUE key, if_none;
+ VALUE key;
st_data_t val;
long block_given;
- rb_scan_args(argc, argv, "11", &key, &if_none);
+ rb_check_arity(argc, 1, 2);
+ key = argv[0];
block_given = rb_block_given_p();
if (block_given && argc == 2) {
@@ -745,14 +865,14 @@ rb_hash_fetch_m(int argc, VALUE *argv, VALUE hash)
if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
if (block_given) return rb_yield(key);
if (argc == 1) {
- volatile VALUE desc = rb_protect(rb_inspect, key, 0);
+ VALUE desc = rb_protect(rb_inspect, key, 0);
if (NIL_P(desc)) {
desc = rb_any_to_s(key);
}
desc = rb_str_ellipsize(desc, 65);
rb_raise(rb_eKeyError, "key not found: %"PRIsVALUE, desc);
}
- return if_none;
+ return argv[1];
}
return (VALUE)val;
}
@@ -787,13 +907,15 @@ rb_hash_fetch(VALUE hash, VALUE key)
static VALUE
rb_hash_default(int argc, VALUE *argv, VALUE hash)
{
- VALUE key, ifnone;
+ VALUE args[2], ifnone;
- rb_scan_args(argc, argv, "01", &key);
+ rb_check_arity(argc, 0, 1);
ifnone = RHASH_IFNONE(hash);
if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
if (argc == 0) return Qnil;
- return rb_funcall(ifnone, id_yield, 2, hash, key);
+ args[0] = hash;
+ args[1] = argv[0];
+ return rb_funcallv(ifnone, id_yield, 2, args);
}
return ifnone;
}
@@ -864,7 +986,7 @@ rb_hash_default_proc(VALUE hash)
* h["cat"] #=> "catcat"
*/
-static VALUE
+VALUE
rb_hash_set_default_proc(VALUE hash, VALUE proc)
{
VALUE b;
@@ -935,22 +1057,48 @@ rb_hash_index(VALUE hash, VALUE value)
return rb_hash_key(hash, value);
}
-static VALUE
-rb_hash_delete_key(VALUE hash, VALUE key)
+/*
+ * delete a specified entry a given key.
+ * if there is the corresponding entry, return a value of the entry.
+ * if there is no corresponding entry, return Qundef.
+ */
+VALUE
+rb_hash_delete_entry(VALUE hash, VALUE key)
{
st_data_t ktmp = (st_data_t)key, val;
- if (!RHASH(hash)->ntbl)
- return 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;
- }
+ if (!RHASH(hash)->ntbl) {
+ return Qundef;
}
- else if (st_delete(RHASH(hash)->ntbl, &ktmp, &val))
+ else if (RHASH_ITER_LEV(hash) > 0 &&
+ (st_delete_safe(RHASH(hash)->ntbl, &ktmp, &val, (st_data_t)Qundef))) {
+ FL_SET(hash, HASH_DELETED);
return (VALUE)val;
- return Qundef;
+ }
+ else if (st_delete(RHASH(hash)->ntbl, &ktmp, &val)) {
+ return (VALUE)val;
+ }
+ else {
+ return Qundef;
+ }
+}
+
+/*
+ * delete a specified entry by a given key.
+ * if there is the corresponding entry, return a value of the entry.
+ * if there is no corresponding entry, return Qnil.
+ */
+VALUE
+rb_hash_delete(VALUE hash, VALUE key)
+{
+ VALUE deleted_value = rb_hash_delete_entry(hash, key);
+
+ if (deleted_value != Qundef) { /* likely pass */
+ return deleted_value;
+ }
+ else {
+ return Qnil;
+ }
}
/*
@@ -959,8 +1107,8 @@ rb_hash_delete_key(VALUE hash, VALUE key)
* hsh.delete(key) {| key | block } -> value
*
* 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 equal to <i>key</i>. If the key is not found, it returns
+ * <em>nil</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>.
*
@@ -971,18 +1119,25 @@ rb_hash_delete_key(VALUE hash, VALUE key)
*
*/
-VALUE
-rb_hash_delete(VALUE hash, VALUE key)
+static VALUE
+rb_hash_delete_m(VALUE hash, VALUE key)
{
VALUE val;
rb_hash_modify_check(hash);
- val = rb_hash_delete_key(hash, key);
- if (val != Qundef) return val;
- if (rb_block_given_p()) {
- return rb_yield(key);
+ val = rb_hash_delete_entry(hash, key);
+
+ if (val != Qundef) {
+ return val;
+ }
+ else {
+ if (rb_block_given_p()) {
+ return rb_yield(key);
+ }
+ else {
+ return Qnil;
+ }
}
- return Qnil;
}
struct shift_var {
@@ -1029,12 +1184,12 @@ rb_hash_shift(VALUE hash)
else {
rb_hash_foreach(hash, shift_i_safe, (VALUE)&var);
if (var.key != Qundef) {
- rb_hash_delete_key(hash, var.key);
+ rb_hash_delete_entry(hash, var.key);
return rb_assoc_new(var.key, var.val);
}
}
}
- return hash_default_value(hash, Qnil);
+ return rb_hash_default_value(hash, Qnil);
}
static int
@@ -1046,8 +1201,6 @@ delete_if_i(VALUE key, VALUE value, VALUE hash)
return ST_CONTINUE;
}
-static VALUE rb_hash_size(VALUE hash);
-
static VALUE
hash_enum_size(VALUE hash, VALUE args, VALUE eobj)
{
@@ -1133,36 +1286,11 @@ rb_hash_reject(VALUE hash)
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
if (RTEST(ruby_verbose)) {
VALUE klass;
- if (HAS_MISC_ATTRIBUTES(hash, klass)) {
-#if HASH_REJECT_COPY_MISC_ATTRIBUTES
- rb_warn("copying unguaranteed attributes: %+"PRIsVALUE, hash);
- rb_warn("following atributes will not be copied in the future version:");
- if (klass != rb_cHash) {
- rb_warn(" subclass: %+"PRIsVALUE, klass);
- }
- if (FL_TEST(hash, FL_EXIVAR)) {
- rb_warn(" instance variables: %+"PRIsVALUE,
- rb_obj_instance_variables(hash));
- }
- if (FL_TEST(hash, FL_TAINT)) {
- rb_warn(" taintedness");
- }
- if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
- rb_warn(" default proc: %+"PRIsVALUE, RHASH_IFNONE(hash));
- }
- else if (!NIL_P(RHASH_IFNONE(hash)))
- rb_warn(" default value: %+"PRIsVALUE, RHASH_IFNONE(hash));
-#else
- rb_warn("unguaranteed attributes are not copied: %+"PRIsVALUE, hash);
- rb_warn("following atributes are ignored now:");
-#endif
+ if (HAS_EXTRA_STATES(hash, klass)) {
+ rb_warn("extra states are no longer copied: %+"PRIsVALUE, hash);
}
}
-#if HASH_REJECT_COPY_MISC_ATTRIBUTES
- result = rb_hash_dup_empty(hash);
-#else
result = rb_hash_new();
-#endif
if (!RHASH_EMPTY_P(hash)) {
rb_hash_foreach(hash, reject_i, result);
}
@@ -1192,6 +1320,34 @@ rb_hash_values_at(int argc, VALUE *argv, VALUE hash)
return result;
}
+/*
+ * call-seq:
+ * hsh.fetch_values(key, ...) -> array
+ * hsh.fetch_values(key, ...) { |key| block } -> array
+ *
+ * Returns an array containing the values associated with the given keys
+ * but also raises <code>KeyError</code> when one of keys can't be found.
+ * Also see <code>Hash#values_at</code> and <code>Hash#fetch</code>.
+ *
+ * h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" }
+ *
+ * h.fetch_values("cow", "cat") #=> ["bovine", "feline"]
+ * h.fetch_values("cow", "bird") # raises KeyError
+ * h.fetch_values("cow", "bird") { |k| k.upcase } #=> ["bovine", "BIRD"]
+ */
+
+VALUE
+rb_hash_fetch_values(int argc, VALUE *argv, VALUE hash)
+{
+ VALUE result = rb_ary_new2(argc);
+ long i;
+
+ for (i=0; i<argc; i++) {
+ rb_ary_push(result, rb_hash_fetch(hash, argv[i]));
+ }
+ return result;
+}
+
static int
select_i(VALUE key, VALUE value, VALUE result)
{
@@ -1340,8 +1496,8 @@ hash_aset_str(st_data_t *key, st_data_t *val, struct update_arg *arg, int existi
return hash_aset(key, val, arg, existing);
}
-NOINSERT_UPDATE_CALLBACK(hash_aset);
-NOINSERT_UPDATE_CALLBACK(hash_aset_str);
+NOINSERT_UPDATE_CALLBACK(hash_aset)
+NOINSERT_UPDATE_CALLBACK(hash_aset_str)
/*
* call-seq:
@@ -1356,7 +1512,8 @@ NOINSERT_UPDATE_CALLBACK(hash_aset_str);
* h["a"] = 9
* h["c"] = 4
* h #=> {"a"=>9, "b"=>200, "c"=>4}
- * h.store("d", 42) #=> {"a"=>9, "b"=>200, "c"=>4, "d"=>42}
+ * h.store("d", 42) #=> 42
+ * h #=> {"a"=>9, "b"=>200, "c"=>4, "d"=>42}
*
* +key+ should not have its value changed while it is in use as a key (an
* <tt>unfrozen String</tt> passed as a key will be duplicated and frozen).
@@ -1408,6 +1565,8 @@ rb_hash_initialize_copy(VALUE hash, VALUE hash2)
Check_Type(hash2, T_HASH);
+ if (hash == hash2) return hash;
+
ntbl = RHASH(hash)->ntbl;
if (RHASH(hash2)->ntbl) {
if (ntbl) st_free_table(ntbl);
@@ -1479,7 +1638,7 @@ rb_hash_replace(VALUE hash, VALUE hash2)
* h.length #=> 3
*/
-static VALUE
+VALUE
rb_hash_size(VALUE hash)
{
return INT2FIX(RHASH_SIZE(hash));
@@ -1769,7 +1928,7 @@ rb_hash_keys(VALUE hash)
if (ST_DATA_COMPATIBLE_P(VALUE)) {
st_table *table = RHASH(hash)->ntbl;
- if (OBJ_PROMOTED(keys)) rb_gc_writebarrier_remember_promoted(keys);
+ rb_gc_writebarrier_remember(keys);
RARRAY_PTR_USE(keys, ptr, {
size = st_keys_check(table, ptr, size, Qundef);
});
@@ -1813,7 +1972,7 @@ rb_hash_values(VALUE hash)
if (ST_DATA_COMPATIBLE_P(VALUE)) {
st_table *table = RHASH(hash)->ntbl;
- if (OBJ_PROMOTED(values)) rb_gc_writebarrier_remember_promoted(values);
+ rb_gc_writebarrier_remember(values);
RARRAY_PTR_USE(values, ptr, {
size = st_values_check(table, ptr, size, Qundef);
});
@@ -1839,9 +1998,13 @@ rb_hash_values(VALUE hash)
* h.has_key?("a") #=> true
* h.has_key?("z") #=> false
*
+ * Note that <code>include?</code> and <code>member?</code> do not test member
+ * equality using <code>==</code> as do other Enumerables.
+ *
+ * See also Enumerable#include?
*/
-static VALUE
+VALUE
rb_hash_has_key(VALUE hash, VALUE key)
{
if (!RHASH(hash)->ntbl)
@@ -1931,13 +2094,20 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
if (hash1 == hash2) return Qtrue;
if (!RB_TYPE_P(hash2, T_HASH)) {
- if (!rb_respond_to(hash2, rb_intern("to_hash"))) {
+ if (!rb_respond_to(hash2, idTo_hash)) {
return Qfalse;
}
- if (eql)
- return rb_eql(hash2, hash1);
- else
+ if (eql) {
+ if (rb_eql(hash2, hash1)) {
+ return Qtrue;
+ }
+ else {
+ return Qfalse;
+ }
+ }
+ else {
return rb_equal(hash2, hash1);
+ }
}
if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2))
return Qfalse;
@@ -1973,6 +2143,12 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
* h2 == h3 #=> true
* h3 == h4 #=> false
*
+ * The orders of each hashes are not compared.
+ *
+ * h1 = { "a" => 1, "c" => 2 }
+ * h2 = { "c" => 2, "a" => 1 }
+ * h1 == h2 #=> true
+ *
*/
static VALUE
@@ -1987,6 +2163,7 @@ rb_hash_equal(VALUE hash1, VALUE hash2)
*
* Returns <code>true</code> if <i>hash</i> and <i>other</i> are
* both hashes with the same content.
+ * The orders of each hashes are not compared.
*/
static VALUE
@@ -2013,6 +2190,8 @@ hash_i(VALUE key, VALUE val, VALUE arg)
*
* Compute a hash-code for this hash. Two hashes with the same content
* will have the same hash code (and will compare using <code>eql?</code>).
+ *
+ * See also Object#hash.
*/
static VALUE
@@ -2041,6 +2220,8 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
*
* Returns a new hash created by using <i>hsh</i>'s values as keys, and
* the keys as values.
+ * If a key with the same value already exists in the <i>hsh</i>, then
+ * the last one defined will be used, the earlier value(s) will be discarded.
*
* h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 }
* h.invert #=> {0=>"a", 100=>"m", 200=>"d", 300=>"y"}
@@ -2071,7 +2252,7 @@ rb_hash_update_callback(st_data_t *key, st_data_t *value, struct update_arg *arg
return ST_CONTINUE;
}
-NOINSERT_UPDATE_CALLBACK(rb_hash_update_callback);
+NOINSERT_UPDATE_CALLBACK(rb_hash_update_callback)
static int
rb_hash_update_i(VALUE key, VALUE value, VALUE hash)
@@ -2098,7 +2279,7 @@ rb_hash_update_block_callback(st_data_t *key, st_data_t *value, struct update_ar
return ST_CONTINUE;
}
-NOINSERT_UPDATE_CALLBACK(rb_hash_update_block_callback);
+NOINSERT_UPDATE_CALLBACK(rb_hash_update_block_callback)
static int
rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
@@ -2169,7 +2350,7 @@ rb_hash_update_func_callback(st_data_t *key, st_data_t *value, struct update_arg
return ST_CONTINUE;
}
-NOINSERT_UPDATE_CALLBACK(rb_hash_update_func_callback);
+NOINSERT_UPDATE_CALLBACK(rb_hash_update_func_callback)
static int
rb_hash_update_func_i(VALUE key, VALUE value, VALUE arg0)
@@ -2379,20 +2560,28 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
{
VALUE ary;
- ary = rb_ary_new_capa(RHASH_SIZE(hash) * 2);
- rb_hash_foreach(hash, flatten_i, ary);
if (argc) {
- int level = NUM2INT(*argv) - 1;
- if (level > 0) {
- *argv = INT2FIX(level);
- rb_funcall2(ary, rb_intern("flatten!"), argc, argv);
+ int level = NUM2INT(*argv);
+ if (level == 0) return rb_hash_to_a(hash);
+
+ ary = rb_ary_new_capa(RHASH_SIZE(hash) * 2);
+ rb_hash_foreach(hash, flatten_i, ary);
+ if (level - 1 > 0) {
+ *argv = INT2FIX(level - 1);
+ rb_funcall2(ary, id_flatten_bang, argc, argv);
+ }
+ else if (level < 0) {
+ rb_funcall2(ary, id_flatten_bang, 0, 0);
}
}
+ else {
+ ary = rb_ary_new_capa(RHASH_SIZE(hash) * 2);
+ rb_hash_foreach(hash, flatten_i, ary);
+ }
+
return ary;
}
-static VALUE rb_hash_compare_by_id_p(VALUE hash);
-
/*
* call-seq:
* hsh.compare_by_identity -> hsh
@@ -2404,7 +2593,7 @@ static VALUE rb_hash_compare_by_id_p(VALUE hash);
* h1["a"] #=> 100
* h1.compare_by_identity
* h1.compare_by_identity? #=> true
- * h1["a"] #=> nil # different objects.
+ * h1["a".dup] #=> nil # different objects.
* h1[:c] #=> "c" # same symbols are all same.
*
*/
@@ -2428,7 +2617,7 @@ rb_hash_compare_by_id(VALUE hash)
*
*/
-static VALUE
+VALUE
rb_hash_compare_by_id_p(VALUE hash)
{
if (!RHASH(hash)->ntbl)
@@ -2439,6 +2628,218 @@ rb_hash_compare_by_id_p(VALUE hash)
return Qfalse;
}
+VALUE
+rb_ident_hash_new(void)
+{
+ VALUE hash = rb_hash_new();
+ RHASH(hash)->ntbl = st_init_table(&identhash);
+ return hash;
+}
+
+st_table *
+rb_init_identtable(void)
+{
+ return st_init_table(&identhash);
+}
+
+st_table *
+rb_init_identtable_with_size(st_index_t size)
+{
+ return st_init_table_with_size(&identhash, size);
+}
+
+static int
+any_p_i(VALUE key, VALUE value, VALUE arg)
+{
+ VALUE ret = rb_yield(rb_assoc_new(key, value));
+ if (RTEST(ret)) {
+ *(VALUE *)arg = Qtrue;
+ return ST_STOP;
+ }
+ return ST_CONTINUE;
+}
+
+static int
+any_p_i_fast(VALUE key, VALUE value, VALUE arg)
+{
+ VALUE ret = rb_yield_values(2, key, value);
+ if (RTEST(ret)) {
+ *(VALUE *)arg = Qtrue;
+ return ST_STOP;
+ }
+ return ST_CONTINUE;
+}
+
+/*
+ * call-seq:
+ * hsh.any? [{ |(key, value)| block }] -> true or false
+ *
+ * See also Enumerable#any?
+ */
+
+static VALUE
+rb_hash_any_p(VALUE hash)
+{
+ VALUE ret = Qfalse;
+
+ if (RHASH_EMPTY_P(hash)) return Qfalse;
+ if (!rb_block_given_p()) {
+ /* yields pairs, never false */
+ return Qtrue;
+ }
+ if (rb_block_arity() > 1)
+ rb_hash_foreach(hash, any_p_i_fast, (VALUE)&ret);
+ else
+ rb_hash_foreach(hash, any_p_i, (VALUE)&ret);
+ return ret;
+}
+
+/*
+ * call-seq:
+ * hsh.dig(key, ...) -> object
+ *
+ * Extracts the nested value specified by the sequence of <i>key</i>
+ * objects by calling +dig+ at each step, returning +nil+ if any
+ * intermediate step is +nil+.
+ *
+ * h = { foo: {bar: {baz: 1}}}
+ *
+ * h.dig(:foo, :bar, :baz) #=> 1
+ * h.dig(:foo, :zot, :xyz) #=> nil
+ *
+ * g = { foo: [10, 11, 12] }
+ * g.dig(:foo, 1) #=> 11
+ * g.dig(:foo, 1, 0) #=> TypeError: Fixnum does not have #dig method
+ * g.dig(:foo, :bar) #=> TypeError: no implicit conversion of Symbol into Integer
+ */
+
+VALUE
+rb_hash_dig(int argc, VALUE *argv, VALUE self)
+{
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
+ self = rb_hash_aref(self, *argv);
+ if (!--argc) return self;
+ ++argv;
+ return rb_obj_dig(argc, argv, self, Qnil);
+}
+
+static int
+hash_le_i(VALUE key, VALUE value, VALUE arg)
+{
+ VALUE *args = (VALUE *)arg;
+ VALUE v = rb_hash_lookup2(args[0], key, Qundef);
+ if (v != Qundef && rb_equal(value, v)) return ST_CONTINUE;
+ args[1] = Qfalse;
+ return ST_STOP;
+}
+
+static VALUE
+hash_le(VALUE hash1, VALUE hash2)
+{
+ VALUE args[2];
+ args[0] = hash2;
+ args[1] = Qtrue;
+ rb_hash_foreach(hash1, hash_le_i, (VALUE)args);
+ return args[1];
+}
+
+/*
+ * call-seq:
+ * hash <= other -> true or false
+ *
+ * Returns <code>true</code> if <i>hash</i> is subset of
+ * <i>other</i> or equals to <i>other</i>.
+ *
+ * h1 = {a:1, b:2}
+ * h2 = {a:1, b:2, c:3}
+ * h1 <= h2 #=> true
+ * h2 <= h1 #=> false
+ * h1 <= h1 #=> true
+ */
+static VALUE
+rb_hash_le(VALUE hash, VALUE other)
+{
+ other = to_hash(other);
+ if (RHASH_SIZE(hash) > RHASH_SIZE(other)) return Qfalse;
+ return hash_le(hash, other);
+}
+
+/*
+ * call-seq:
+ * hash < other -> true or false
+ *
+ * Returns <code>true</code> if <i>hash</i> is subset of
+ * <i>other</i>.
+ *
+ * h1 = {a:1, b:2}
+ * h2 = {a:1, b:2, c:3}
+ * h1 < h2 #=> true
+ * h2 < h1 #=> false
+ * h1 < h1 #=> false
+ */
+static VALUE
+rb_hash_lt(VALUE hash, VALUE other)
+{
+ other = to_hash(other);
+ if (RHASH_SIZE(hash) >= RHASH_SIZE(other)) return Qfalse;
+ return hash_le(hash, other);
+}
+
+/*
+ * call-seq:
+ * hash >= other -> true or false
+ *
+ * Returns <code>true</code> if <i>other</i> is subset of
+ * <i>hash</i> or equals to <i>hash</i>.
+ *
+ * h1 = {a:1, b:2}
+ * h2 = {a:1, b:2, c:3}
+ * h1 >= h2 #=> false
+ * h2 >= h1 #=> true
+ * h1 >= h1 #=> true
+ */
+static VALUE
+rb_hash_ge(VALUE hash, VALUE other)
+{
+ other = to_hash(other);
+ if (RHASH_SIZE(hash) < RHASH_SIZE(other)) return Qfalse;
+ return hash_le(other, hash);
+}
+
+/*
+ * call-seq:
+ * hash > other -> true or false
+ *
+ * Returns <code>true</code> if <i>other</i> is subset of
+ * <i>hash</i>.
+ *
+ * h1 = {a:1, b:2}
+ * h2 = {a:1, b:2, c:3}
+ * h1 > h2 #=> false
+ * h2 > h1 #=> true
+ * h1 > h1 #=> false
+ */
+static VALUE
+rb_hash_gt(VALUE hash, VALUE other)
+{
+ other = to_hash(other);
+ if (RHASH_SIZE(hash) <= RHASH_SIZE(other)) return Qfalse;
+ return hash_le(other, hash);
+}
+
+static VALUE
+hash_proc_call(VALUE key, VALUE hash, int argc, const VALUE *argv, VALUE passed_proc)
+{
+ rb_check_arity(argc, 1, 1);
+ return rb_hash_aref(hash, *argv);
+}
+
+static VALUE
+rb_hash_to_proc(VALUE hash)
+{
+ return rb_func_proc_new(hash_proc_call, hash);
+}
+
static int path_tainted = -1;
static char **origenviron;
@@ -2479,11 +2880,20 @@ extern char **environ;
#define ENVNMATCH(s1, s2, n) (memcmp((s1), (s2), (n)) == 0)
#endif
+#ifdef _WIN32
+static VALUE
+env_str_transcode(VALUE str, rb_encoding *enc)
+{
+ return rb_str_conv_enc_opts(str, NULL, enc,
+ ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE, Qnil);
+}
+#endif
+
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());
+ VALUE str = env_str_transcode(rb_utf8_str_new(ptr, len), rb_locale_encoding());
#else
VALUE str = rb_locale_str_new(ptr, len);
#endif
@@ -2493,28 +2903,87 @@ env_str_new(const char *ptr, long len)
}
static VALUE
+env_path_str_new(const char *ptr)
+{
+#ifdef _WIN32
+ VALUE str = env_str_transcode(rb_utf8_str_new_cstr(ptr), rb_filesystem_encoding());
+#else
+ VALUE str = rb_filesystem_str_new_cstr(ptr);
+#endif
+
+ rb_obj_freeze(str);
+ return str;
+}
+
+static VALUE
env_str_new2(const char *ptr)
{
if (!ptr) return Qnil;
return env_str_new(ptr, strlen(ptr));
}
+static void *
+get_env_cstr(
+#ifdef _WIN32
+ volatile VALUE *pstr,
+#else
+ VALUE str,
+#endif
+ const char *name)
+{
+#ifdef _WIN32
+ VALUE str = *pstr;
+#endif
+ char *var;
+ rb_encoding *enc = rb_enc_get(str);
+ if (!rb_enc_asciicompat(enc)) {
+ rb_raise(rb_eArgError, "bad environment variable %s: ASCII incompatible encoding: %s",
+ name, rb_enc_name(enc));
+ }
+#ifdef _WIN32
+ if (!rb_enc_str_asciionly_p(str)) {
+ *pstr = str = rb_str_conv_enc(str, NULL, rb_utf8_encoding());
+ }
+#endif
+ var = RSTRING_PTR(str);
+ if (memchr(var, '\0', RSTRING_LEN(str))) {
+ rb_raise(rb_eArgError, "bad environment variable %s: contains null byte", name);
+ }
+ return var;
+}
+
+#ifdef _WIN32
+#define get_env_ptr(var, val) \
+ (var = get_env_cstr(&(val), #var))
+#else
+#define get_env_ptr(var, val) \
+ (var = get_env_cstr(val, #var))
+#endif
+
+static inline const char *
+env_name(volatile VALUE *s)
+{
+ const char *name;
+ SafeStringValue(*s);
+ get_env_ptr(name, *s);
+ return name;
+}
+
+#define env_name(s) env_name(&(s))
+
static VALUE
env_delete(VALUE obj, VALUE name)
{
- char *nam, *val;
+ const char *nam, *val;
- SafeStringValue(name);
- nam = RSTRING_PTR(name);
- if (memchr(nam, '\0', RSTRING_LEN(name))) {
- rb_raise(rb_eArgError, "bad environment variable name");
- }
+ nam = env_name(name);
val = getenv(nam);
if (val) {
VALUE value = env_str_new2(val);
ruby_setenv(nam, 0);
if (ENVMATCH(nam, PATH_ENV)) {
+ RB_GC_GUARD(name);
path_tainted = 0;
}
return value;
@@ -2553,24 +3022,13 @@ static int env_path_tainted(const char *);
static VALUE
rb_f_getenv(VALUE obj, VALUE name)
{
- char *nam, *env;
+ const char *nam, *env;
- SafeStringValue(name);
- nam = RSTRING_PTR(name);
- if (memchr(nam, '\0', RSTRING_LEN(name))) {
- rb_raise(rb_eArgError, "bad environment variable name");
- }
+ nam = env_name(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;
+ return env_path_str_new(env);
}
return env_str_new2(env);
}
@@ -2594,34 +3052,27 @@ rb_f_getenv(VALUE obj, VALUE name)
static VALUE
env_fetch(int argc, VALUE *argv)
{
- VALUE key, if_none;
+ VALUE key;
long block_given;
- char *nam, *env;
+ const char *nam, *env;
- rb_scan_args(argc, argv, "11", &key, &if_none);
+ rb_check_arity(argc, 1, 2);
+ key = argv[0];
block_given = rb_block_given_p();
if (block_given && argc == 2) {
rb_warn("block supersedes default value argument");
}
- SafeStringValue(key);
- nam = RSTRING_PTR(key);
- if (memchr(nam, '\0', RSTRING_LEN(key))) {
- rb_raise(rb_eArgError, "bad environment variable name");
- }
+ nam = env_name(key);
env = getenv(nam);
if (!env) {
if (block_given) return rb_yield(key);
if (argc == 1) {
rb_raise(rb_eKeyError, "key not found: \"%"PRIsVALUE"\"", key);
}
- return if_none;
+ return argv[1];
}
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_path_str_new(env);
return env_str_new2(env);
}
@@ -2679,20 +3130,22 @@ envix(const char *nam)
#if defined(_WIN32)
static size_t
-getenvsize(const char* p)
+getenvsize(const WCHAR* p)
{
- const char* porg = p;
- while (*p++) p += strlen(p) + 1;
+ const WCHAR* porg = p;
+ while (*p++) p += lstrlenW(p) + 1;
return p - porg + 1;
}
static size_t
-getenvblocksize()
+getenvblocksize(void)
{
return (rb_w32_osver() >= 5) ? 32767 : 5120;
}
#endif
-#if !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV)
+#if defined(_WIN32) || \
+ (defined(__sun) && !(defined(HAVE_SETENV) && defined(HAVE_UNSETENV)))
+
NORETURN(static void invalid_envname(const char *name));
static void
@@ -2715,24 +3168,52 @@ void
ruby_setenv(const char *name, const char *value)
{
#if defined(_WIN32)
+# if defined(MINGW_HAS_SECURE_API) || RUBY_MSVCRT_VERSION >= 80
+# define HAVE__WPUTENV_S 1
+# endif
VALUE buf;
+ WCHAR *wname;
+ WCHAR *wvalue = 0;
int failed = 0;
+ int len;
check_envname(name);
+ len = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0);
if (value) {
- const char* p = GetEnvironmentStringsA();
+ WCHAR* p = GetEnvironmentStringsW();
+ size_t n;
+ int len2;
if (!p) goto fail; /* never happen */
- if (strlen(name) + 2 + strlen(value) + getenvsize(p) >= getenvblocksize()) {
+ n = lstrlen(name) + 2 + strlen(value) + getenvsize(p);
+ FreeEnvironmentStringsW(p);
+ if (n >= getenvblocksize()) {
goto fail; /* 2 for '=' & '\0' */
}
- buf = rb_sprintf("%s=%s", name, value);
+ len2 = MultiByteToWideChar(CP_UTF8, 0, value, -1, NULL, 0);
+ wname = ALLOCV_N(WCHAR, buf, len + len2);
+ wvalue = wname + len;
+ MultiByteToWideChar(CP_UTF8, 0, name, -1, wname, len);
+ MultiByteToWideChar(CP_UTF8, 0, value, -1, wvalue, len2);
+#ifndef HAVE__WPUTENV_S
+ wname[len-1] = L'=';
+#endif
}
else {
- buf = rb_sprintf("%s=", name);
+ wname = ALLOCV_N(WCHAR, buf, len + 1);
+ MultiByteToWideChar(CP_UTF8, 0, name, -1, wname, len);
+ wvalue = wname + len;
+ *wvalue = L'\0';
+#ifndef HAVE__WPUTENV_S
+ wname[len-1] = L'=';
+#endif
}
- failed = putenv(RSTRING_PTR(buf));
+#ifndef HAVE__WPUTENV_S
+ failed = _wputenv(wname);
+#else
+ failed = _wputenv_s(wname, wvalue);
+#endif
+ ALLOCV_END(buf);
/* even if putenv() failed, clean up and try to delete the
* variable from the system area. */
- rb_str_resize(buf, 0);
if (!value || !*value) {
/* putenv() doesn't handle empty value */
if (!SetEnvironmentVariable(name, value) &&
@@ -2758,10 +3239,22 @@ ruby_setenv(const char *name, const char *value)
#endif
}
#elif defined __sun
- size_t len;
- char **env_ptr, *str;
+ /* Solaris 9 (or earlier) does not have setenv(3C) and unsetenv(3C). */
+ /* The below code was tested on Solaris 10 by:
+ % ./configure ac_cv_func_setenv=no ac_cv_func_unsetenv=no
+ */
+ size_t len, mem_size;
+ char **env_ptr, *str, *mem_ptr;
+ check_envname(name);
len = strlen(name);
+ if (value) {
+ mem_size = len + strlen(value) + 2;
+ mem_ptr = malloc(mem_size);
+ if (mem_ptr == NULL)
+ rb_sys_fail_str(rb_sprintf("malloc("PRIuSIZE")", mem_size));
+ snprintf(mem_ptr, mem_size, "%s=%s", name, value);
+ }
for (env_ptr = GET_ENVIRON(environ); (str = *env_ptr) != 0; ++env_ptr) {
if (!strncmp(str, name, len) && str[len] == '=') {
if (!in_origenv(str)) free(str);
@@ -2770,10 +3263,10 @@ ruby_setenv(const char *name, const char *value)
}
}
if (value) {
- str = malloc(len += strlen(value) + 2);
- snprintf(str, len, "%s=%s", name, value);
- if (putenv(str))
+ if (putenv(mem_ptr)) {
+ free(mem_ptr);
rb_sys_fail_str(rb_sprintf("putenv(%s)", name));
+ }
}
#else /* WIN32 */
size_t len;
@@ -2830,6 +3323,7 @@ ruby_unsetenv(const char *name)
*
* Sets the environment variable +name+ to +value+. If the value given is
* +nil+ the environment variable is deleted.
+ * +name+ must be a string.
*
*/
static VALUE
@@ -2841,17 +3335,16 @@ env_aset(VALUE obj, VALUE nm, VALUE val)
env_delete(obj, nm);
return Qnil;
}
- StringValue(nm);
- StringValue(val);
- name = RSTRING_PTR(nm);
- value = RSTRING_PTR(val);
- if (memchr(name, '\0', RSTRING_LEN(nm)))
- rb_raise(rb_eArgError, "bad environment variable name");
- if (memchr(value, '\0', RSTRING_LEN(val)))
- rb_raise(rb_eArgError, "bad environment variable value");
+ SafeStringValue(nm);
+ SafeStringValue(val);
+ /* nm can be modified in `val.to_str`, don't get `name` before
+ * check for `val` */
+ get_env_ptr(name, nm);
+ get_env_ptr(value, val);
ruby_setenv(name, value);
if (ENVMATCH(name, PATH_ENV)) {
+ RB_GC_GUARD(nm);
if (OBJ_TAINTED(val)) {
/* already tainted, no check */
path_tainted = 1;
@@ -3033,7 +3526,7 @@ env_each_pair(VALUE ehash)
static VALUE
env_reject_bang(VALUE ehash)
{
- volatile VALUE keys;
+ VALUE keys;
long i;
int del = 0;
@@ -3050,6 +3543,7 @@ env_reject_bang(VALUE ehash)
}
}
}
+ RB_GC_GUARD(keys);
if (del == 0) return Qnil;
return envtbl;
}
@@ -3104,23 +3598,22 @@ static VALUE
env_select(VALUE ehash)
{
VALUE result;
- char **env;
+ VALUE keys;
+ long i;
RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
result = rb_hash_new();
- env = GET_ENVIRON(environ);
- while (*env) {
- char *s = strchr(*env, '=');
- if (s) {
- VALUE k = env_str_new(*env, s-*env);
- VALUE v = env_str_new2(s+1);
- if (RTEST(rb_yield_values(2, k, v))) {
- rb_hash_aset(result, k, v);
+ keys = env_keys();
+ for (i = 0; i < RARRAY_LEN(keys); ++i) {
+ VALUE key = RARRAY_AREF(keys, i);
+ VALUE val = rb_f_getenv(Qnil, key);
+ if (!NIL_P(val)) {
+ if (RTEST(rb_yield_values(2, key, val))) {
+ rb_hash_aset(result, key, val);
}
}
- env++;
}
- FREE_ENVIRON(environ);
+ RB_GC_GUARD(keys);
return result;
}
@@ -3135,7 +3628,7 @@ env_select(VALUE ehash)
static VALUE
env_select_bang(VALUE ehash)
{
- volatile VALUE keys;
+ VALUE keys;
long i;
int del = 0;
@@ -3152,6 +3645,7 @@ env_select_bang(VALUE ehash)
}
}
}
+ RB_GC_GUARD(keys);
if (del == 0) return Qnil;
return envtbl;
}
@@ -3182,7 +3676,7 @@ env_keep_if(VALUE ehash)
VALUE
rb_env_clear(void)
{
- volatile VALUE keys;
+ VALUE keys;
long i;
keys = env_keys();
@@ -3192,6 +3686,7 @@ rb_env_clear(void)
env_delete(Qnil, RARRAY_AREF(keys, i));
}
}
+ RB_GC_GUARD(keys);
return envtbl;
}
@@ -3337,11 +3832,9 @@ env_empty_p(void)
static VALUE
env_has_key(VALUE env, VALUE key)
{
- char *s;
+ const char *s;
- s = StringValuePtr(key);
- if (memchr(s, '\0', RSTRING_LEN(key)))
- rb_raise(rb_eArgError, "bad environment variable name");
+ s = env_name(key);
if (getenv(s)) return Qtrue;
return Qfalse;
}
@@ -3356,11 +3849,9 @@ env_has_key(VALUE env, VALUE key)
static VALUE
env_assoc(VALUE env, VALUE key)
{
- char *s, *e;
+ const char *s, *e;
- s = StringValuePtr(key);
- if (memchr(s, '\0', RSTRING_LEN(key)))
- rb_raise(rb_eArgError, "bad environment variable name");
+ s = env_name(key);
e = getenv(s);
if (e) return rb_assoc_new(key, rb_tainted_str_new2(e));
return Qnil;
@@ -3380,6 +3871,7 @@ env_has_value(VALUE dmy, VALUE obj)
obj = rb_check_string_type(obj);
if (NIL_P(obj)) return Qnil;
+ rb_check_safe_obj(obj);
env = GET_ENVIRON(environ);
while (*env) {
char *s = strchr(*env, '=');
@@ -3410,6 +3902,7 @@ env_rassoc(VALUE dmy, VALUE obj)
obj = rb_check_string_type(obj);
if (NIL_P(obj)) return Qnil;
+ rb_check_safe_obj(obj);
env = GET_ENVIRON(environ);
while (*env) {
char *s = strchr(*env, '=');
@@ -3440,7 +3933,7 @@ env_key(VALUE dmy, VALUE value)
char **env;
VALUE str;
- StringValue(value);
+ SafeStringValue(value);
env = GET_ENVIRON(environ);
while (*env) {
char *s = strchr(*env, '=');
@@ -3524,6 +4017,7 @@ static VALUE
env_shift(void)
{
char **env;
+ VALUE result = Qnil;
env = GET_ENVIRON(environ);
if (*env) {
@@ -3532,11 +4026,11 @@ env_shift(void)
VALUE key = env_str_new(*env, s-*env);
VALUE val = env_str_new2(getenv(RSTRING_PTR(key)));
env_delete(Qnil, key);
- return rb_assoc_new(key, val);
+ result = rb_assoc_new(key, val);
}
}
FREE_ENVIRON(environ);
- return Qnil;
+ return result;
}
/*
@@ -3572,7 +4066,7 @@ env_replace_i(VALUE key, VALUE val, VALUE keys)
static VALUE
env_replace(VALUE env, VALUE hash)
{
- volatile VALUE keys;
+ VALUE keys;
long i;
keys = env_keys();
@@ -3583,6 +4077,7 @@ env_replace(VALUE env, VALUE hash)
for (i=0; i<RARRAY_LEN(keys); i++) {
env_delete(env, RARRAY_AREF(keys, i));
}
+ RB_GC_GUARD(keys);
return env;
}
@@ -3628,7 +4123,7 @@ env_update(VALUE env, VALUE hash)
*
* grades = { "Jane Doe" => 10, "Jim Doe" => 6 }
*
- * Hashes allow an alternate syntax form when your keys are always symbols.
+ * Hashes allow an alternate syntax for keys that are symbols.
* Instead of
*
* options = { :font_size => 10, :font_family => "Arial" }
@@ -3737,6 +4232,7 @@ Init_Hash(void)
id_hash = rb_intern("hash");
id_yield = rb_intern("yield");
id_default = rb_intern("default");
+ id_flatten_bang = rb_intern("flatten!");
rb_cHash = rb_define_class("Hash", rb_cObject);
@@ -3754,6 +4250,7 @@ Init_Hash(void)
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");
+ rb_define_method(rb_cHash,"to_proc", rb_hash_to_proc, 0);
rb_define_method(rb_cHash,"==", rb_hash_equal, 1);
rb_define_method(rb_cHash,"[]", rb_hash_aref, 1);
@@ -3780,9 +4277,10 @@ Init_Hash(void)
rb_define_method(rb_cHash,"keys", rb_hash_keys, 0);
rb_define_method(rb_cHash,"values", rb_hash_values, 0);
rb_define_method(rb_cHash,"values_at", rb_hash_values_at, -1);
+ rb_define_method(rb_cHash,"fetch_values", rb_hash_fetch_values, -1);
rb_define_method(rb_cHash,"shift", rb_hash_shift, 0);
- rb_define_method(rb_cHash,"delete", rb_hash_delete, 1);
+ rb_define_method(rb_cHash,"delete", rb_hash_delete_m, 1);
rb_define_method(rb_cHash,"delete_if", rb_hash_delete_if, 0);
rb_define_method(rb_cHash,"keep_if", rb_hash_keep_if, 0);
rb_define_method(rb_cHash,"select", rb_hash_select, 0);
@@ -3809,6 +4307,14 @@ Init_Hash(void)
rb_define_method(rb_cHash,"compare_by_identity", rb_hash_compare_by_id, 0);
rb_define_method(rb_cHash,"compare_by_identity?", rb_hash_compare_by_id_p, 0);
+ rb_define_method(rb_cHash, "any?", rb_hash_any_p, 0);
+ rb_define_method(rb_cHash, "dig", rb_hash_dig, -1);
+
+ rb_define_method(rb_cHash, "<=", rb_hash_le, 1);
+ rb_define_method(rb_cHash, "<", rb_hash_lt, 1);
+ rb_define_method(rb_cHash, ">=", rb_hash_ge, 1);
+ rb_define_method(rb_cHash, ">", rb_hash_gt, 1);
+
/* Document-class: ENV
*
* ENV is a hash-like accessor for environment variables.
diff --git a/id_table.c b/id_table.c
new file mode 100644
index 0000000000..423b00669b
--- /dev/null
+++ b/id_table.c
@@ -0,0 +1,1583 @@
+/* This file is included by symbol.c */
+
+#include "id_table.h"
+
+#ifndef ID_TABLE_DEBUG
+#define ID_TABLE_DEBUG 0
+#endif
+
+#if ID_TABLE_DEBUG == 0
+#define NDEBUG
+#endif
+#include <assert.h>
+
+/*
+ * st
+ * 0: using st with debug information.
+ * 1: using st.
+ * array
+ * 11: simple array. ids = [ID1, ID2, ...], values = [val1, val2, ...]
+ * 12: simple array, and use rb_id_serial_t instead of ID.
+ * 13: simple array, and use rb_id_serial_t instead of ID. Swap recent access.
+ * 14: sorted array, and use rb_id_serial_t instead of ID.
+ * 15: sorted array, and use rb_id_serial_t instead of ID, linear small part.
+ * hash
+ * 21: funny falcon's Coalesced Hashing implementation [Feature #6962]
+ * 22: simple open addressing with quadratic probing.
+ * mix (array + hash)
+ * 31: array(12) (capa <= 32) + hash(22)
+ * 32: array(14) (capa <= 32) + hash(22)
+ * 33: array(12) (capa <= 64) + hash(22)
+ * 34: array(14) (capa <= 64) + hash(22)
+ * 34: array(15) (capa <= 64) + hash(22)
+ */
+
+#ifndef ID_TABLE_IMPL
+#define ID_TABLE_IMPL 34
+#endif
+
+#if ID_TABLE_IMPL == 0
+#define ID_TABLE_NAME st
+#define ID_TABLE_IMPL_TYPE struct st_id_table
+
+#define ID_TABLE_USE_ST 1
+#define ID_TABLE_USE_ST_DEBUG 1
+
+#elif ID_TABLE_IMPL == 1
+#define ID_TABLE_NAME st
+#define ID_TABLE_IMPL_TYPE struct st_id_table
+
+#define ID_TABLE_USE_ST 1
+#define ID_TABLE_USE_ST_DEBUG 0
+
+#elif ID_TABLE_IMPL == 11
+#define ID_TABLE_NAME list
+#define ID_TABLE_IMPL_TYPE struct list_id_table
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+
+#elif ID_TABLE_IMPL == 12
+#define ID_TABLE_NAME list
+#define ID_TABLE_IMPL_TYPE struct list_id_table
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#elif ID_TABLE_IMPL == 13
+#define ID_TABLE_NAME list
+#define ID_TABLE_IMPL_TYPE struct list_id_table
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_ID_SERIAL 1
+#define ID_TABLE_SWAP_RECENT_ACCESS 1
+
+#elif ID_TABLE_IMPL == 14
+#define ID_TABLE_NAME list
+#define ID_TABLE_IMPL_TYPE struct list_id_table
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_ID_SERIAL 1
+#define ID_TABLE_USE_LIST_SORTED 1
+
+#elif ID_TABLE_IMPL == 15
+#define ID_TABLE_NAME list
+#define ID_TABLE_IMPL_TYPE struct list_id_table
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_ID_SERIAL 1
+#define ID_TABLE_USE_LIST_SORTED 1
+#define ID_TABLE_USE_LIST_SORTED_LINEAR_SMALL_RANGE 1
+
+#elif ID_TABLE_IMPL == 21
+#define ID_TABLE_NAME hash
+#define ID_TABLE_IMPL_TYPE sa_table
+
+#define ID_TABLE_USE_COALESCED_HASHING 1
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#elif ID_TABLE_IMPL == 22
+#define ID_TABLE_NAME hash
+#define ID_TABLE_IMPL_TYPE struct hash_id_table
+
+#define ID_TABLE_USE_SMALL_HASH 1
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#elif ID_TABLE_IMPL == 31
+#define ID_TABLE_NAME mix
+#define ID_TABLE_IMPL_TYPE struct mix_id_table
+
+#define ID_TABLE_USE_MIX 1
+#define ID_TABLE_USE_MIX_LIST_MAX_CAPA 32
+
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_SMALL_HASH 1
+
+#elif ID_TABLE_IMPL == 32
+#define ID_TABLE_NAME mix
+#define ID_TABLE_IMPL_TYPE struct mix_id_table
+
+#define ID_TABLE_USE_MIX 1
+#define ID_TABLE_USE_MIX_LIST_MAX_CAPA 32
+
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_LIST_SORTED 1
+
+#define ID_TABLE_USE_SMALL_HASH 1
+
+#elif ID_TABLE_IMPL == 33
+#define ID_TABLE_NAME mix
+#define ID_TABLE_IMPL_TYPE struct mix_id_table
+
+#define ID_TABLE_USE_MIX 1
+#define ID_TABLE_USE_MIX_LIST_MAX_CAPA 64
+
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_SMALL_HASH 1
+
+#elif ID_TABLE_IMPL == 34
+#define ID_TABLE_NAME mix
+#define ID_TABLE_IMPL_TYPE struct mix_id_table
+
+#define ID_TABLE_USE_MIX 1
+#define ID_TABLE_USE_MIX_LIST_MAX_CAPA 64
+
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_LIST_SORTED 1
+
+#define ID_TABLE_USE_SMALL_HASH 1
+
+#elif ID_TABLE_IMPL == 35
+#define ID_TABLE_NAME mix
+#define ID_TABLE_IMPL_TYPE struct mix_id_table
+
+#define ID_TABLE_USE_MIX 1
+#define ID_TABLE_USE_MIX_LIST_MAX_CAPA 64
+
+#define ID_TABLE_USE_ID_SERIAL 1
+
+#define ID_TABLE_USE_LIST 1
+#define ID_TABLE_USE_CALC_VALUES 1
+#define ID_TABLE_USE_LIST_SORTED 1
+#define ID_TABLE_USE_LIST_SORTED_LINEAR_SMALL_RANGE 1
+
+#define ID_TABLE_USE_SMALL_HASH 1
+
+#else
+#error
+#endif
+
+#if ID_TABLE_SWAP_RECENT_ACCESS && ID_TABLE_USE_LIST_SORTED
+#error
+#endif
+
+/* IMPL(create) will be "hash_id_table_create" and so on */
+#define IMPL1(name, op) TOKEN_PASTE(name, _id##op) /* expand `name' */
+#define IMPL(op) IMPL1(ID_TABLE_NAME, _table##op) /* but prevent `op' */
+
+#ifdef __GNUC__
+# define UNUSED(func) static func __attribute__((unused))
+#else
+# define UNUSED(func) static func
+#endif
+
+UNUSED(ID_TABLE_IMPL_TYPE *IMPL(_create)(size_t));
+UNUSED(void IMPL(_free)(ID_TABLE_IMPL_TYPE *));
+UNUSED(void IMPL(_clear)(ID_TABLE_IMPL_TYPE *));
+UNUSED(size_t IMPL(_size)(const ID_TABLE_IMPL_TYPE *));
+UNUSED(size_t IMPL(_memsize)(const ID_TABLE_IMPL_TYPE *));
+UNUSED(int IMPL(_insert)(ID_TABLE_IMPL_TYPE *, ID, VALUE));
+UNUSED(int IMPL(_lookup)(ID_TABLE_IMPL_TYPE *, ID, VALUE *));
+UNUSED(int IMPL(_delete)(ID_TABLE_IMPL_TYPE *, ID));
+UNUSED(void IMPL(_foreach)(ID_TABLE_IMPL_TYPE *, rb_id_table_foreach_func_t *, void *));
+UNUSED(void IMPL(_foreach_values)(ID_TABLE_IMPL_TYPE *, rb_id_table_foreach_values_func_t *, void *));
+
+#if ID_TABLE_USE_ID_SERIAL
+typedef rb_id_serial_t id_key_t;
+static inline ID
+key2id(id_key_t key)
+{
+ return rb_id_serial_to_id(key);
+}
+
+static inline id_key_t
+id2key(ID id)
+{
+ return rb_id_to_serial(id);
+}
+#else /* ID_TABLE_USE_ID_SERIAL */
+
+typedef ID id_key_t;
+#define key2id(key) key
+#define id2key(id) id
+
+#endif /* ID_TABLE_USE_ID_SERIAL */
+
+/***************************************************************
+ * 0: using st with debug information.
+ * 1: using st.
+ ***************************************************************/
+#if ID_TABLE_USE_ST
+#if ID_TABLE_USE_ST_DEBUG
+#define ID_TABLE_MARK 0x12345678
+
+struct st_id_table {
+ struct st_table *st;
+ unsigned int check;
+};
+
+static struct st_table *
+tbl2st(struct st_id_table *tbl)
+{
+ if (tbl->check != ID_TABLE_MARK) rb_bug("tbl2st: check error %x", tbl->check);
+ return tbl->st;
+}
+
+static struct st_id_table *
+st_id_table_create(size_t size)
+{
+ struct st_id_table *tbl = ALLOC(struct st_id_table);
+ tbl->st = st_init_numtable_with_size(size);
+ tbl->check = ID_TABLE_MARK;
+ return tbl;
+}
+
+static void
+st_id_table_free(struct st_id_table *tbl)
+{
+ st_free_table(tbl->st);
+ xfree(tbl);
+}
+
+#else /* ID_TABLE_USE_ST_DEBUG */
+
+struct st_id_table {
+ struct st_table st;
+};
+
+static struct st_table *
+tbl2st(struct st_id_table *tbl)
+{
+ return (struct st_table *)tbl;
+}
+
+static struct st_id_table *
+st_id_table_create(size_t size)
+{
+ return (struct st_id_table *)st_init_numtable_with_size(size);
+}
+
+static void
+st_id_table_free(struct st_id_table *tbl)
+{
+ st_free_table((struct st_table*)tbl);
+}
+
+#endif /* ID_TABLE_USE_ST_DEBUG */
+
+static void
+st_id_table_clear(struct st_id_table *tbl)
+{
+ st_clear(tbl2st(tbl));
+}
+
+static size_t
+st_id_table_size(const struct st_id_table *tbl)
+{
+ return tbl2st(tbl)->num_entries;
+}
+
+static size_t
+st_id_table_memsize(const struct st_id_table *tbl)
+{
+ size_t header_size = ID_TABLE_USE_ST_DEBUG ? sizeof(struct st_id_table) : 0;
+ return header_size + st_memsize(tbl2st(tbl));
+}
+
+static int
+st_id_table_lookup(struct st_id_table *tbl, ID id, VALUE *val)
+{
+ return st_lookup(tbl2st(tbl), (st_data_t)id, (st_data_t *)val);
+}
+
+static int
+st_id_table_insert(struct st_id_table *tbl, ID id, VALUE val)
+{
+ return st_insert(tbl2st(tbl), id, val);
+}
+
+static int
+st_id_table_delete(struct st_id_table *tbl, ID id)
+{
+ return st_delete(tbl2st(tbl), (st_data_t *)&id, NULL);
+}
+
+static void
+st_id_table_foreach(struct st_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
+{
+ st_foreach(tbl2st(tbl), (int (*)(ANYARGS))func, (st_data_t)data);
+}
+
+struct values_iter_data {
+ rb_id_table_foreach_values_func_t *values_i;
+ void *data;
+};
+
+static int
+each_values(st_data_t key, st_data_t val, st_data_t ptr)
+{
+ struct values_iter_data *values_iter_data = (struct values_iter_data *)ptr;
+ return values_iter_data->values_i(val, values_iter_data->data);
+}
+
+static void
+st_id_table_foreach_values(struct st_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data)
+{
+ struct values_iter_data values_iter_data;
+ values_iter_data.values_i = func;
+ values_iter_data.data = data;
+ st_foreach(tbl2st(tbl), each_values, (st_data_t)&values_iter_data);
+}
+#endif /* ID_TABLE_USE_ST */
+
+#if ID_TABLE_USE_LIST
+
+#define LIST_MIN_CAPA 4
+
+struct list_id_table {
+ int capa;
+ int num;
+ id_key_t *keys;
+#if ID_TABLE_USE_CALC_VALUES == 0
+ VALUE *values_;
+#endif
+};
+
+#if ID_TABLE_USE_CALC_VALUES
+#define TABLE_VALUES(tbl) ((VALUE *)((tbl)->keys + (tbl)->capa))
+#else
+#define TABLE_VALUES(tbl) (tbl)->values_
+#endif
+
+static struct list_id_table *
+list_id_table_init(struct list_id_table *tbl, size_t capa)
+{
+ if (capa > 0) {
+ tbl->capa = (int)capa;
+#if ID_TABLE_USE_CALC_VALUES
+ tbl->keys = (id_key_t *)xmalloc(sizeof(id_key_t) * capa + sizeof(VALUE) * capa);
+#else
+ tbl->keys = ALLOC_N(id_key_t, capa);
+ tbl->values_ = ALLOC_N(VALUE, capa);
+#endif
+ }
+ return tbl;
+}
+
+#ifndef ID_TABLE_USE_MIX
+static struct list_id_table *
+list_id_table_create(size_t capa)
+{
+ struct list_id_table *tbl = ZALLOC(struct list_id_table);
+ return list_id_table_init(tbl, capa);
+}
+#endif
+
+static void
+list_id_table_free(struct list_id_table *tbl)
+{
+ xfree(tbl->keys);
+#if ID_TABLE_USE_CALC_VALUES == 0
+ xfree(tbl->values_);
+#endif
+ xfree(tbl);
+}
+
+static void
+list_id_table_clear(struct list_id_table *tbl)
+{
+ tbl->num = 0;
+}
+
+static size_t
+list_id_table_size(const struct list_id_table *tbl)
+{
+ return (size_t)tbl->num;
+}
+
+static size_t
+list_id_table_memsize(const struct list_id_table *tbl)
+{
+ return (sizeof(id_key_t) + sizeof(VALUE)) * tbl->capa + sizeof(struct list_id_table);
+}
+
+static void
+list_table_extend(struct list_id_table *tbl)
+{
+ if (tbl->capa == tbl->num) {
+ const int capa = tbl->capa == 0 ? LIST_MIN_CAPA : (tbl->capa * 2);
+
+#if ID_TABLE_USE_CALC_VALUES
+ {
+ VALUE *old_values, *new_values;
+ VALUE *debug_values = NULL;
+ const int num = tbl->num;
+ const int size = sizeof(id_key_t) * capa + sizeof(VALUE) * capa;
+ int i;
+
+ if (num > 0) {
+ VALUE *orig_values = (VALUE *)(tbl->keys + num);
+ debug_values = ALLOC_N(VALUE, num);
+
+ for (i=0; i<num; i++) {
+ debug_values[i] = orig_values[i];
+ }
+
+ if (0)
+ for (i=0; i< 2 * num; i++) {
+ unsigned char *cs = (unsigned char *)&tbl->keys[i];
+ size_t j;
+ fprintf(stderr, ">> %3d | %p - ", i, cs);
+ for (j=0; j<sizeof(VALUE); j++) {
+ fprintf(stderr, "%x ", cs[j]);
+ }
+ fprintf(stderr, "\n");
+ }
+ }
+
+ tbl->keys = (id_key_t *)xrealloc(tbl->keys, size);
+ old_values = (VALUE *)(tbl->keys + num);
+ new_values = (VALUE *)(tbl->keys + capa);
+
+ /* [ keys (num) ] [ values (num) ]
+ * ^ old_values
+ * realloc =>
+ * [ keys (capa = num * 2) ] [ values (capa = num * 2) ]
+ * ^ new_values
+ */
+
+ /* memmove */
+ if (0) {
+ fprintf(stderr, "memmove: %p -> %p (%d, capa: %d)\n",
+ old_values, new_values, num, capa);
+ }
+ assert(num < capa);
+ assert(num == 0 || old_values < new_values);
+
+ for (i=num-1; i>=0; i--) {
+ new_values[i] = old_values[i];
+ }
+
+ if (num > 0) {
+ for (i=0; i<num; i++) {
+ assert(debug_values[i] == new_values[i]);
+ }
+ xfree(debug_values);
+ }
+ }
+
+ tbl->capa = capa;
+#else
+ tbl->capa = capa;
+ tbl->keys = (id_key_t *)xrealloc(tbl->keys, sizeof(id_key_t) * capa);
+ tbl->values_ = (VALUE *)xrealloc(tbl->values_, sizeof(VALUE) * capa);
+#endif
+ }
+}
+
+#if ID_TABLE_DEBUG
+static void
+list_table_show(struct list_id_table *tbl)
+{
+ const id_key_t *keys = tbl->keys;
+ const int num = tbl->num;
+ int i;
+
+ fprintf(stderr, "tbl: %p (num: %d)\n", tbl, num);
+ for (i=0; i<num; i++) {
+ fprintf(stderr, " -> [%d] %s %d\n", i, rb_id2name(key2id(keys[i])), (int)keys[i]);
+ }
+}
+#endif
+
+static void
+tbl_assert(struct list_id_table *tbl)
+{
+#if ID_TABLE_DEBUG
+#if ID_TABLE_USE_LIST_SORTED
+ const id_key_t *keys = tbl->keys;
+ const int num = tbl->num;
+ int i;
+
+ for (i=0; i<num-1; i++) {
+ if (keys[i] >= keys[i+1]) {
+ list_table_show(tbl);
+ rb_bug(": not sorted.");
+ }
+ }
+#endif
+#endif
+}
+
+#if ID_TABLE_USE_LIST_SORTED
+static int
+list_ids_bsearch(const id_key_t *keys, id_key_t key, int num)
+{
+ int p, min = 0, max = num;
+
+#if ID_TABLE_USE_LIST_SORTED_LINEAR_SMALL_RANGE
+ if (num <= 64) {
+ if (num > 32) {
+ if (keys[num/2] <= key) {
+ min = num/2;
+ } else {
+ max = num/2;
+ }
+ }
+ for (p = min; p<num && keys[p] < key; p++) {
+ assert(keys[p] != 0);
+ }
+ return (p<num && keys[p] == key) ? p : -p-1;
+ }
+#endif /* ID_TABLE_USE_LIST_SORTED_LINEAR_SMALL_RANGE */
+
+ while (1) {
+ p = min + (max - min) / 2;
+
+ if (min >= max) {
+ break;
+ }
+ else {
+ id_key_t kp = keys[p];
+ assert(p < max);
+ assert(p >= min);
+
+ if (kp > key) max = p;
+ else if (kp < key) min = p+1;
+ else {
+ assert(kp == key);
+ assert(p >= 0);
+ assert(p < num);
+ return p;
+ }
+ }
+ }
+
+ assert(min == max);
+ assert(min == p);
+ return -p-1;
+}
+#endif /* ID_TABLE_USE_LIST_SORTED */
+
+static int
+list_table_index(struct list_id_table *tbl, id_key_t key)
+{
+ const int num = tbl->num;
+ const id_key_t *keys = tbl->keys;
+
+#if ID_TABLE_USE_LIST_SORTED
+ return list_ids_bsearch(keys, key, num);
+#else /* ID_TABLE_USE_LIST_SORTED */
+ int i;
+
+ for (i=0; i<num; i++) {
+ assert(keys[i] != 0);
+
+ if (keys[i] == key) {
+ return (int)i;
+ }
+ }
+ return -1;
+#endif
+}
+
+static int
+list_id_table_lookup(struct list_id_table *tbl, ID id, VALUE *valp)
+{
+ id_key_t key = id2key(id);
+ int index = list_table_index(tbl, key);
+
+ if (index >= 0) {
+ *valp = TABLE_VALUES(tbl)[index];
+
+#if ID_TABLE_SWAP_RECENT_ACCESS
+ if (index > 0) {
+ VALUE *values = TABLE_VALUES(tbl);
+ id_key_t tk = tbl->keys[index-1];
+ VALUE tv = values[index-1];
+ tbl->keys[index-1] = tbl->keys[index];
+ tbl->keys[index] = tk;
+ values[index-1] = values[index];
+ values[index] = tv;
+ }
+#endif /* ID_TABLE_SWAP_RECENT_ACCESS */
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+static int
+list_id_table_insert(struct list_id_table *tbl, ID id, VALUE val)
+{
+ const id_key_t key = id2key(id);
+ const int index = list_table_index(tbl, key);
+
+ if (index >= 0) {
+ TABLE_VALUES(tbl)[index] = val;
+ }
+ else {
+ list_table_extend(tbl);
+ {
+ const int num = tbl->num++;
+#if ID_TABLE_USE_LIST_SORTED
+ const int insert_index = -(index + 1);
+ id_key_t *keys = tbl->keys;
+ VALUE *values = TABLE_VALUES(tbl);
+ int i;
+
+ if (0) fprintf(stderr, "insert: %d into %d on\n", (int)key, insert_index);
+
+ for (i=num; i>insert_index; i--) {
+ keys[i] = keys[i-1];
+ values[i] = values[i-1];
+ }
+ keys[i] = key;
+ values[i] = val;
+
+ tbl_assert(tbl);
+#else
+ tbl->keys[num] = key;
+ TABLE_VALUES(tbl)[num] = val;
+#endif
+ }
+ }
+
+ return TRUE;
+}
+
+static int
+list_delete_index(struct list_id_table *tbl, id_key_t key, int index)
+{
+ if (index >= 0) {
+ VALUE *values = TABLE_VALUES(tbl);
+
+#if ID_TABLE_USE_LIST_SORTED
+ int i;
+ const int num = tbl->num;
+ id_key_t *keys = tbl->keys;
+
+ for (i=index+1; i<num; i++) { /* compaction */
+ keys[i-1] = keys[i];
+ values[i-1] = values[i];
+ }
+#else
+ tbl->keys[index] = tbl->keys[tbl->num-1];
+ values[index] = values[tbl->num-1];
+#endif
+ tbl->num--;
+ tbl_assert(tbl);
+
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+static int
+list_id_table_delete(struct list_id_table *tbl, ID id)
+{
+ const id_key_t key = id2key(id);
+ int index = list_table_index(tbl, key);
+ return list_delete_index(tbl, key, index);
+}
+
+#define FOREACH_LAST() do { \
+ switch (ret) { \
+ case ID_TABLE_CONTINUE: \
+ case ID_TABLE_STOP: \
+ break; \
+ case ID_TABLE_DELETE: \
+ list_delete_index(tbl, key, i); \
+ values = TABLE_VALUES(tbl); \
+ num = tbl->num; \
+ i--; /* redo same index */ \
+ break; \
+ } \
+} while (0)
+
+static void
+list_id_table_foreach(struct list_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
+{
+ int num = tbl->num;
+ int i;
+ const id_key_t *keys = tbl->keys;
+ const VALUE *values = TABLE_VALUES(tbl);
+
+ for (i=0; i<num; i++) {
+ const id_key_t key = keys[i];
+ enum rb_id_table_iterator_result ret = (*func)(key2id(key), values[i], data);
+ assert(key != 0);
+
+ FOREACH_LAST();
+ if (ret == ID_TABLE_STOP) return;
+ }
+}
+
+static void
+list_id_table_foreach_values(struct list_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data)
+{
+ int num = tbl->num;
+ int i;
+ const id_key_t *keys = tbl->keys;
+ VALUE *values = TABLE_VALUES(tbl);
+
+ for (i=0; i<num; i++) {
+ const id_key_t key = keys[i];
+ enum rb_id_table_iterator_result ret = (*func)(values[i], data);
+ assert(key != 0);
+
+ FOREACH_LAST();
+ if (ret == ID_TABLE_STOP) return;
+ }
+}
+#endif /* ID_TABLE_USE_LIST */
+
+
+#if ID_TABLE_USE_COALESCED_HASHING
+/* implementation is based on
+ * https://bugs.ruby-lang.org/issues/6962 by funny_falcon
+ */
+
+typedef unsigned int sa_index_t;
+
+#define SA_EMPTY 0
+#define SA_LAST 1
+#define SA_OFFSET 2
+#define SA_MIN_SIZE 4
+
+typedef struct sa_entry {
+ sa_index_t next;
+ id_key_t key;
+ VALUE value;
+} sa_entry;
+
+typedef struct {
+ sa_index_t num_bins;
+ sa_index_t num_entries;
+ sa_index_t free_pos;
+ sa_entry *entries;
+} sa_table;
+
+static void
+sa_init_table(register sa_table *table, sa_index_t num_bins)
+{
+ if (num_bins) {
+ table->num_entries = 0;
+ table->entries = ZALLOC_N(sa_entry, num_bins);
+ table->num_bins = num_bins;
+ table->free_pos = num_bins;
+ }
+}
+
+static sa_table*
+hash_id_table_create(size_t size)
+{
+ sa_table* table = ZALLOC(sa_table);
+ sa_init_table(table, (sa_index_t)size);
+ return table;
+}
+
+static void
+hash_id_table_clear(sa_table *table)
+{
+ xfree(table->entries);
+ memset(table, 0, sizeof(sa_table));
+}
+
+static void
+hash_id_table_free(sa_table *table)
+{
+ xfree(table->entries);
+ xfree(table);
+}
+
+static size_t
+hash_id_table_memsize(const sa_table *table)
+{
+ return sizeof(sa_table) + table->num_bins * sizeof (sa_entry);
+}
+
+static inline sa_index_t
+calc_pos(register sa_table* table, id_key_t key)
+{
+ return key & (table->num_bins - 1);
+}
+
+static void
+fix_empty(register sa_table* table)
+{
+ while (--table->free_pos &&
+ table->entries[table->free_pos-1].next != SA_EMPTY);
+}
+
+#define FLOOR_TO_4 ((~((sa_index_t)0)) << 2)
+static sa_index_t
+find_empty(register sa_table* table, register sa_index_t pos)
+{
+ sa_index_t new_pos = table->free_pos-1;
+ sa_entry *entry;
+ static const unsigned offsets[][3] = {
+ {1, 2, 3},
+ {2, 3, 0},
+ {3, 1, 0},
+ {2, 1, 0}
+ };
+ const unsigned *const check = offsets[pos&3];
+ pos &= FLOOR_TO_4;
+ entry = table->entries+pos;
+
+ if (entry[check[0]].next == SA_EMPTY) { new_pos = pos + check[0]; goto check; }
+ if (entry[check[1]].next == SA_EMPTY) { new_pos = pos + check[1]; goto check; }
+ if (entry[check[2]].next == SA_EMPTY) { new_pos = pos + check[2]; goto check; }
+
+ check:
+ if (new_pos+1 == table->free_pos) fix_empty(table);
+ return new_pos;
+}
+
+static void resize(register sa_table* table);
+static int insert_into_chain(register sa_table*, register id_key_t, st_data_t, sa_index_t pos);
+static int insert_into_main(register sa_table*, id_key_t, st_data_t, sa_index_t pos, sa_index_t prev_pos);
+
+static int
+sa_insert(register sa_table* table, id_key_t key, VALUE value)
+{
+ register sa_entry *entry;
+ sa_index_t pos, main_pos;
+
+ if (table->num_bins == 0) {
+ sa_init_table(table, SA_MIN_SIZE);
+ }
+
+ pos = calc_pos(table, key);
+ entry = table->entries + pos;
+
+ if (entry->next == SA_EMPTY) {
+ entry->next = SA_LAST;
+ entry->key = key;
+ entry->value = value;
+ table->num_entries++;
+ if (pos+1 == table->free_pos) fix_empty(table);
+ return 0;
+ }
+
+ if (entry->key == key) {
+ entry->value = value;
+ return 1;
+ }
+
+ if (table->num_entries + (table->num_entries >> 2) > table->num_bins) {
+ resize(table);
+ return sa_insert(table, key, value);
+ }
+
+ main_pos = calc_pos(table, entry->key);
+ if (main_pos == pos) {
+ return insert_into_chain(table, key, value, pos);
+ }
+ else {
+ if (!table->free_pos) {
+ resize(table);
+ return sa_insert(table, key, value);
+ }
+ return insert_into_main(table, key, value, pos, main_pos);
+ }
+}
+
+static int
+hash_id_table_insert(register sa_table* table, ID id, VALUE value)
+{
+ return sa_insert(table, id2key(id), value);
+}
+
+static int
+insert_into_chain(register sa_table* table, id_key_t key, st_data_t value, sa_index_t pos)
+{
+ sa_entry *entry = table->entries + pos, *new_entry;
+ sa_index_t new_pos;
+
+ while (entry->next != SA_LAST) {
+ pos = entry->next - SA_OFFSET;
+ entry = table->entries + pos;
+ if (entry->key == key) {
+ entry->value = value;
+ return 1;
+ }
+ }
+
+ if (!table->free_pos) {
+ resize(table);
+ return sa_insert(table, key, value);
+ }
+
+ new_pos = find_empty(table, pos);
+ new_entry = table->entries + new_pos;
+ entry->next = new_pos + SA_OFFSET;
+
+ new_entry->next = SA_LAST;
+ new_entry->key = key;
+ new_entry->value = value;
+ table->num_entries++;
+ return 0;
+}
+
+static int
+insert_into_main(register sa_table* table, id_key_t key, st_data_t value, sa_index_t pos, sa_index_t prev_pos)
+{
+ sa_entry *entry = table->entries + pos;
+ sa_index_t new_pos = find_empty(table, pos);
+ sa_entry *new_entry = table->entries + new_pos;
+ sa_index_t npos;
+
+ *new_entry = *entry;
+
+ while((npos = table->entries[prev_pos].next - SA_OFFSET) != pos) {
+ prev_pos = npos;
+ }
+ table->entries[prev_pos].next = new_pos + SA_OFFSET;
+
+ entry->next = SA_LAST;
+ entry->key = key;
+ entry->value = value;
+ table->num_entries++;
+ return 0;
+}
+
+static sa_index_t
+new_size(sa_index_t num_entries)
+{
+ sa_index_t size = num_entries >> 3;
+ size |= size >> 1;
+ size |= size >> 2;
+ size |= size >> 4;
+ size |= size >> 8;
+ size |= size >> 16;
+ return (size + 1) << 3;
+}
+
+static void
+resize(register sa_table *table)
+{
+ sa_table tmp_table;
+ sa_entry *entry;
+ sa_index_t i;
+
+ if (table->num_entries == 0) {
+ xfree(table->entries);
+ memset(table, 0, sizeof(sa_table));
+ return;
+ }
+
+ sa_init_table(&tmp_table, new_size(table->num_entries + (table->num_entries >> 2)));
+ entry = table->entries;
+
+ for(i = 0; i < table->num_bins; i++, entry++) {
+ if (entry->next != SA_EMPTY) {
+ sa_insert(&tmp_table, entry->key, entry->value);
+ }
+ }
+ xfree(table->entries);
+ *table = tmp_table;
+}
+
+static int
+hash_id_table_lookup(register sa_table *table, ID id, VALUE *valuep)
+{
+ register sa_entry *entry;
+ id_key_t key = id2key(id);
+
+ if (table->num_entries == 0) return 0;
+
+ entry = table->entries + calc_pos(table, key);
+ if (entry->next == SA_EMPTY) return 0;
+
+ if (entry->key == key) goto found;
+ if (entry->next == SA_LAST) return 0;
+
+ entry = table->entries + (entry->next - SA_OFFSET);
+ if (entry->key == key) goto found;
+
+ while(entry->next != SA_LAST) {
+ entry = table->entries + (entry->next - SA_OFFSET);
+ if (entry->key == key) goto found;
+ }
+ return 0;
+ found:
+ if (valuep) *valuep = entry->value;
+ return 1;
+}
+
+static size_t
+hash_id_table_size(const sa_table *table)
+{
+ return table->num_entries;
+}
+
+static int
+hash_id_table_delete(sa_table *table, ID id)
+{
+ sa_index_t pos, prev_pos = ~0;
+ sa_entry *entry;
+ id_key_t key = id2key(id);
+
+ if (table->num_entries == 0) goto not_found;
+
+ pos = calc_pos(table, key);
+ entry = table->entries + pos;
+
+ if (entry->next == SA_EMPTY) goto not_found;
+
+ do {
+ if (entry->key == key) {
+ if (entry->next != SA_LAST) {
+ sa_index_t npos = entry->next - SA_OFFSET;
+ *entry = table->entries[npos];
+ memset(table->entries + npos, 0, sizeof(sa_entry));
+ }
+ else {
+ memset(table->entries + pos, 0, sizeof(sa_entry));
+ if (~prev_pos) {
+ table->entries[prev_pos].next = SA_LAST;
+ }
+ }
+ table->num_entries--;
+ if (table->num_entries < table->num_bins / 4) {
+ resize(table);
+ }
+ return 1;
+ }
+ if (entry->next == SA_LAST) break;
+ prev_pos = pos;
+ pos = entry->next - SA_OFFSET;
+ entry = table->entries + pos;
+ } while(1);
+
+ not_found:
+ return 0;
+}
+
+enum foreach_type {
+ foreach_key_values,
+ foreach_values
+};
+
+static void
+hash_foreach(sa_table *table, enum rb_id_table_iterator_result (*func)(ANYARGS), void *arg, enum foreach_type type)
+{
+ sa_index_t i;
+
+ if (table->num_bins > 0) {
+ for(i = 0; i < table->num_bins ; i++) {
+ if (table->entries[i].next != SA_EMPTY) {
+ id_key_t key = table->entries[i].key;
+ st_data_t val = table->entries[i].value;
+ enum rb_id_table_iterator_result ret;
+
+ switch (type) {
+ case foreach_key_values:
+ ret = (*func)(key2id(key), val, arg);
+ break;
+ case foreach_values:
+ ret = (*func)(val, arg);
+ break;
+ }
+
+ switch (ret) {
+ case ID_TABLE_DELETE:
+ rb_warn("unsupported yet");
+ break;
+ default:
+ break;
+ }
+ if (ret == ID_TABLE_STOP) break;
+ }
+ }
+ }
+}
+
+static void
+hash_id_table_foreach(sa_table *table, enum rb_id_table_iterator_result (*func)(ID, VALUE, void *), void *arg)
+{
+ hash_foreach(table, func, arg, foreach_key_values);
+}
+
+static void
+hash_id_table_foreach_values(sa_table *table, enum rb_id_table_iterator_result (*func)(VALUE, void *), void *arg)
+{
+ hash_foreach(table, func, arg, foreach_values);
+}
+#endif /* ID_TABLE_USE_COALESCED_HASHING */
+
+#ifdef ID_TABLE_USE_SMALL_HASH
+/* simple open addressing with quadratic probing.
+ uses mark-bit on collisions - need extra 1 bit,
+ ID is strictly 3 bits larger than rb_id_serial_t */
+
+typedef struct rb_id_item {
+ id_key_t key;
+#if SIZEOF_VALUE == 8
+ int collision;
+#endif
+ VALUE val;
+} item_t;
+
+struct hash_id_table {
+ int capa;
+ int num;
+ int used;
+ item_t *items;
+};
+
+#if SIZEOF_VALUE == 8
+#define ITEM_GET_KEY(tbl, i) ((tbl)->items[i].key)
+#define ITEM_KEY_ISSET(tbl, i) ((tbl)->items[i].key)
+#define ITEM_COLLIDED(tbl, i) ((tbl)->items[i].collision)
+#define ITEM_SET_COLLIDED(tbl, i) ((tbl)->items[i].collision = 1)
+static inline void
+ITEM_SET_KEY(struct hash_id_table *tbl, int i, id_key_t key)
+{
+ tbl->items[i].key = key;
+}
+#else
+#define ITEM_GET_KEY(tbl, i) ((tbl)->items[i].key >> 1)
+#define ITEM_KEY_ISSET(tbl, i) ((tbl)->items[i].key > 1)
+#define ITEM_COLLIDED(tbl, i) ((tbl)->items[i].key & 1)
+#define ITEM_SET_COLLIDED(tbl, i) ((tbl)->items[i].key |= 1)
+static inline void
+ITEM_SET_KEY(struct hash_id_table *tbl, int i, id_key_t key)
+{
+ tbl->items[i].key = (key << 1) | ITEM_COLLIDED(tbl, i);
+}
+#endif
+
+static inline int
+round_capa(int capa)
+{
+ /* minsize is 4 */
+ capa >>= 2;
+ capa |= capa >> 1;
+ capa |= capa >> 2;
+ capa |= capa >> 4;
+ capa |= capa >> 8;
+ capa |= capa >> 16;
+ return (capa + 1) << 2;
+}
+
+static struct hash_id_table *
+hash_id_table_init(struct hash_id_table *tbl, int capa)
+{
+ MEMZERO(tbl, struct hash_id_table, 1);
+ if (capa > 0) {
+ capa = round_capa(capa);
+ tbl->capa = (int)capa;
+ tbl->items = ZALLOC_N(item_t, capa);
+ }
+ return tbl;
+}
+
+#ifndef ID_TABLE_USE_MIX
+static struct hash_id_table *
+hash_id_table_create(size_t capa)
+{
+ struct hash_id_table *tbl = ALLOC(struct hash_id_table);
+ return hash_id_table_init(tbl, (int)capa);
+}
+#endif
+
+static void
+hash_id_table_free(struct hash_id_table *tbl)
+{
+ xfree(tbl->items);
+ xfree(tbl);
+}
+
+static void
+hash_id_table_clear(struct hash_id_table *tbl)
+{
+ tbl->num = 0;
+ tbl->used = 0;
+ MEMZERO(tbl->items, item_t, tbl->capa);
+}
+
+static size_t
+hash_id_table_size(const struct hash_id_table *tbl)
+{
+ return (size_t)tbl->num;
+}
+
+static size_t
+hash_id_table_memsize(const struct hash_id_table *tbl)
+{
+ return sizeof(item_t) * tbl->capa + sizeof(struct hash_id_table);
+}
+
+static int
+hash_table_index(struct hash_id_table* tbl, id_key_t key)
+{
+ if (tbl->capa > 0) {
+ int mask = tbl->capa - 1;
+ int ix = key & mask;
+ int d = 1;
+ while (key != ITEM_GET_KEY(tbl, ix)) {
+ if (!ITEM_COLLIDED(tbl, ix))
+ return -1;
+ ix = (ix + d) & mask;
+ d++;
+ }
+ return ix;
+ }
+ return -1;
+}
+
+static void
+hash_table_raw_insert(struct hash_id_table *tbl, id_key_t key, VALUE val)
+{
+ int mask = tbl->capa - 1;
+ int ix = key & mask;
+ int d = 1;
+ assert(key != 0);
+ while (ITEM_KEY_ISSET(tbl, ix)) {
+ ITEM_SET_COLLIDED(tbl, ix);
+ ix = (ix + d) & mask;
+ d++;
+ }
+ tbl->num++;
+ if (!ITEM_COLLIDED(tbl, ix)) {
+ tbl->used++;
+ }
+ ITEM_SET_KEY(tbl, ix, key);
+ tbl->items[ix].val = val;
+}
+
+static int
+hash_delete_index(struct hash_id_table *tbl, int ix)
+{
+ if (ix >= 0) {
+ if (!ITEM_COLLIDED(tbl, ix)) {
+ tbl->used--;
+ }
+ tbl->num--;
+ ITEM_SET_KEY(tbl, ix, 0);
+ tbl->items[ix].val = 0;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static void
+hash_table_extend(struct hash_id_table* tbl)
+{
+ if (tbl->used + (tbl->used >> 1) >= tbl->capa) {
+ int new_cap = round_capa(tbl->num + (tbl->num >> 1));
+ int i;
+ item_t* old;
+ struct hash_id_table tmp_tbl = {0, 0, 0};
+ if (new_cap < tbl->capa) {
+ new_cap = round_capa(tbl->used + (tbl->used >> 1));
+ }
+ tmp_tbl.capa = new_cap;
+ tmp_tbl.items = ZALLOC_N(item_t, new_cap);
+ for (i = 0; i < tbl->capa; i++) {
+ id_key_t key = ITEM_GET_KEY(tbl, i);
+ if (key != 0) {
+ hash_table_raw_insert(&tmp_tbl, key, tbl->items[i].val);
+ }
+ }
+ old = tbl->items;
+ *tbl = tmp_tbl;
+ xfree(old);
+ }
+}
+
+#if ID_TABLE_DEBUG && 0
+static void
+hash_table_show(struct hash_id_table *tbl)
+{
+ const id_key_t *keys = tbl->keys;
+ const int capa = tbl->capa;
+ int i;
+
+ fprintf(stderr, "tbl: %p (capa: %d, num: %d, used: %d)\n", tbl, tbl->capa, tbl->num, tbl->used);
+ for (i=0; i<capa; i++) {
+ if (ITEM_KEY_ISSET(tbl, i)) {
+ fprintf(stderr, " -> [%d] %s %d\n", i, rb_id2name(key2id(keys[i])), (int)keys[i]);
+ }
+ }
+}
+#endif
+
+static int
+hash_id_table_lookup(struct hash_id_table *tbl, ID id, VALUE *valp)
+{
+ id_key_t key = id2key(id);
+ int index = hash_table_index(tbl, key);
+
+ if (index >= 0) {
+ *valp = tbl->items[index].val;
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+static int
+hash_id_table_insert_key(struct hash_id_table *tbl, const id_key_t key, const VALUE val)
+{
+ const int index = hash_table_index(tbl, key);
+
+ if (index >= 0) {
+ tbl->items[index].val = val;
+ }
+ else {
+ hash_table_extend(tbl);
+ hash_table_raw_insert(tbl, key, val);
+ }
+ return TRUE;
+}
+
+static int
+hash_id_table_insert(struct hash_id_table *tbl, ID id, VALUE val)
+{
+ return hash_id_table_insert_key(tbl, id2key(id), val);
+}
+
+static int
+hash_id_table_delete(struct hash_id_table *tbl, ID id)
+{
+ const id_key_t key = id2key(id);
+ int index = hash_table_index(tbl, key);
+ return hash_delete_index(tbl, index);
+}
+
+static void
+hash_id_table_foreach(struct hash_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
+{
+ int i, capa = tbl->capa;
+
+ for (i=0; i<capa; i++) {
+ if (ITEM_KEY_ISSET(tbl, i)) {
+ const id_key_t key = ITEM_GET_KEY(tbl, i);
+ enum rb_id_table_iterator_result ret = (*func)(key2id(key), tbl->items[i].val, data);
+ assert(key != 0);
+
+ if (ret == ID_TABLE_DELETE)
+ hash_delete_index(tbl, i);
+ else if (ret == ID_TABLE_STOP)
+ return;
+ }
+ }
+}
+
+static void
+hash_id_table_foreach_values(struct hash_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data)
+{
+ int i, capa = tbl->capa;
+
+ for (i=0; i<capa; i++) {
+ if (ITEM_KEY_ISSET(tbl, i)) {
+ enum rb_id_table_iterator_result ret = (*func)(tbl->items[i].val, data);
+
+ if (ret == ID_TABLE_DELETE)
+ hash_delete_index(tbl, i);
+ else if (ret == ID_TABLE_STOP)
+ return;
+ }
+ }
+}
+#endif /* ID_TABLE_USE_SMALL_HASH */
+
+#if ID_TABLE_USE_MIX
+
+struct mix_id_table {
+ union {
+ struct {
+ int capa;
+ int num;
+ } size;
+ struct list_id_table list;
+ struct hash_id_table hash;
+ } aux;
+};
+
+#define LIST_LIMIT_P(mix) ((mix)->aux.size.num == ID_TABLE_USE_MIX_LIST_MAX_CAPA)
+#define LIST_P(mix) ((mix)->aux.size.capa <= ID_TABLE_USE_MIX_LIST_MAX_CAPA)
+
+static struct mix_id_table *
+mix_id_table_create(size_t size)
+{
+ struct mix_id_table *mix = ZALLOC(struct mix_id_table);
+ list_id_table_init((struct list_id_table *)mix, size);
+ return mix;
+}
+
+static void
+mix_id_table_free(struct mix_id_table *tbl)
+{
+ if (LIST_P(tbl)) list_id_table_free(&tbl->aux.list);
+ else hash_id_table_free(&tbl->aux.hash);
+}
+
+static void
+mix_id_table_clear(struct mix_id_table *tbl)
+{
+ if (LIST_P(tbl)) list_id_table_clear(&tbl->aux.list);
+ else hash_id_table_clear(&tbl->aux.hash);
+}
+
+static size_t
+mix_id_table_size(const struct mix_id_table *tbl)
+{
+ if (LIST_P(tbl)) return list_id_table_size(&tbl->aux.list);
+ else return hash_id_table_size(&tbl->aux.hash);
+}
+
+static size_t
+mix_id_table_memsize(const struct mix_id_table *tbl)
+{
+ if (LIST_P(tbl)) return list_id_table_memsize(&tbl->aux.list) - sizeof(struct list_id_table) + sizeof(struct mix_id_table);
+ else return hash_id_table_memsize(&tbl->aux.hash);
+}
+
+static int
+mix_id_table_insert(struct mix_id_table *tbl, ID id, VALUE val)
+{
+ int r;
+
+ if (LIST_P(tbl)) {
+ if (!LIST_LIMIT_P(tbl)) {
+ r = list_id_table_insert(&tbl->aux.list, id, val);
+ }
+ else {
+ /* convert to hash */
+ /* overflow. TODO: this promotion should be done in list_extend_table */
+ struct list_id_table *list = &tbl->aux.list;
+ struct hash_id_table hash_body;
+ id_key_t *keys = list->keys;
+ VALUE *values = TABLE_VALUES(list);
+ const int num = list->num;
+ int i;
+
+ hash_id_table_init(&hash_body, 0);
+
+ for (i=0; i<num; i++) {
+ /* note that GC can run */
+ hash_id_table_insert_key(&hash_body, keys[i], values[i]);
+ }
+
+ tbl->aux.hash = hash_body;
+
+ /* free list keys/values */
+ xfree(keys);
+#if ID_TABLE_USE_CALC_VALUES == 0
+ xfree(values);
+#endif
+ goto hash_insert;
+ }
+ }
+ else {
+ hash_insert:
+ r = hash_id_table_insert(&tbl->aux.hash, id, val);
+ assert(!LIST_P(tbl));
+ }
+ return r;
+}
+
+static int
+mix_id_table_lookup(struct mix_id_table *tbl, ID id, VALUE *valp)
+{
+ if (LIST_P(tbl)) return list_id_table_lookup(&tbl->aux.list, id, valp);
+ else return hash_id_table_lookup(&tbl->aux.hash, id, valp);
+}
+
+static int
+mix_id_table_delete(struct mix_id_table *tbl, ID id)
+{
+ if (LIST_P(tbl)) return list_id_table_delete(&tbl->aux.list, id);
+ else return hash_id_table_delete(&tbl->aux.hash, id);
+}
+
+static void
+mix_id_table_foreach(struct mix_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
+{
+ if (LIST_P(tbl)) list_id_table_foreach(&tbl->aux.list, func, data);
+ else hash_id_table_foreach(&tbl->aux.hash, func, data);
+}
+
+static void
+mix_id_table_foreach_values(struct mix_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data)
+{
+ if (LIST_P(tbl)) list_id_table_foreach_values(&tbl->aux.list, func, data);
+ else hash_id_table_foreach_values(&tbl->aux.hash, func, data);
+}
+
+#endif /* ID_TABLE_USE_MIX */
+
+#define IMPL_TYPE1(type, prot, name, args) \
+ RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)
+#define IMPL_TYPE(type, name, prot, args) \
+ IMPL_TYPE1(type, rb_id_table_##name prot, IMPL(_##name), args)
+#define IMPL_VOID1(prot, name, args) \
+ RUBY_ALIAS_FUNCTION_VOID(prot, name, args)
+#define IMPL_VOID(name, prot, args) \
+ IMPL_VOID1(rb_id_table_##name prot, IMPL(_##name), args)
+#define id_tbl (ID_TABLE_IMPL_TYPE *)tbl
+
+IMPL_TYPE(struct rb_id_table *, create, (size_t size), (size))
+IMPL_VOID(free, (struct rb_id_table *tbl), (id_tbl))
+IMPL_VOID(clear, (struct rb_id_table *tbl), (id_tbl))
+IMPL_TYPE(size_t, size, (const struct rb_id_table *tbl), (id_tbl))
+IMPL_TYPE(size_t, memsize, (const struct rb_id_table *tbl), (id_tbl))
+
+IMPL_TYPE(int , insert, (struct rb_id_table *tbl, ID id, VALUE val),
+ (id_tbl, id, val))
+IMPL_TYPE(int, lookup, (struct rb_id_table *tbl, ID id, VALUE *valp),
+ (id_tbl, id, valp))
+IMPL_TYPE(int, delete, (struct rb_id_table *tbl, ID id),
+ (id_tbl, id))
+
+IMPL_VOID(foreach,
+ (struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data),
+ (id_tbl, func, data))
+IMPL_VOID(foreach_values,
+ (struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data),
+ (id_tbl, func, data))
+
+#if ID_TABLE_STARTUP_SIG
+__attribute__((constructor))
+static void
+show_impl(void)
+{
+ fprintf(stderr, "impl: %d\n", ID_TABLE_IMPL);
+}
+#endif
diff --git a/id_table.h b/id_table.h
new file mode 100644
index 0000000000..4b4eb6fd70
--- /dev/null
+++ b/id_table.h
@@ -0,0 +1,30 @@
+#ifndef RUBY_ID_TABLE_H
+#define RUBY_ID_TABLE_H 1
+#include "ruby/ruby.h"
+
+struct rb_id_table;
+
+/* compatible with ST_* */
+enum rb_id_table_iterator_result {
+ ID_TABLE_CONTINUE = ST_CONTINUE,
+ ID_TABLE_STOP = ST_STOP,
+ ID_TABLE_DELETE = ST_DELETE,
+};
+
+struct rb_id_table *rb_id_table_create(size_t size);
+void rb_id_table_free(struct rb_id_table *tbl);
+void rb_id_table_clear(struct rb_id_table *tbl);
+
+size_t rb_id_table_size(const struct rb_id_table *tbl);
+size_t rb_id_table_memsize(const struct rb_id_table *tbl);
+
+int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val);
+int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp);
+int rb_id_table_delete(struct rb_id_table *tbl, ID id);
+
+typedef enum rb_id_table_iterator_result rb_id_table_foreach_func_t(ID id, VALUE val, void *data);
+typedef enum rb_id_table_iterator_result rb_id_table_foreach_values_func_t(VALUE val, void *data);
+void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data);
+void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data);
+
+#endif /* RUBY_ID_TABLE_H */
diff --git a/include/ruby/backward/classext.h b/include/ruby/backward/classext.h
index 33f3b014b8..9d5747316a 100644
--- a/include/ruby/backward/classext.h
+++ b/include/ruby/backward/classext.h
@@ -1,6 +1,6 @@
#if defined __GNUC__
#warning use of RClass internals is deprecated
-#elif defined _MSC_VER || defined __BORLANDC__
+#elif defined _MSC_VER
#pragma message("warning: use of RClass internals is deprecated")
#endif
diff --git a/include/ruby/backward/rubyio.h b/include/ruby/backward/rubyio.h
index d5246db546..a6e3a7c78b 100644
--- a/include/ruby/backward/rubyio.h
+++ b/include/ruby/backward/rubyio.h
@@ -1,6 +1,6 @@
#if defined __GNUC__
#warning use "ruby/io.h" instead of "rubyio.h"
-#elif defined _MSC_VER || defined __BORLANDC__
+#elif defined _MSC_VER
#pragma message("warning: use \"ruby/io.h\" instead of \"rubyio.h\"")
#endif
#include "ruby/io.h"
diff --git a/include/ruby/backward/rubysig.h b/include/ruby/backward/rubysig.h
index 945a09a8c8..58b13cab1c 100644
--- a/include/ruby/backward/rubysig.h
+++ b/include/ruby/backward/rubysig.h
@@ -12,7 +12,7 @@
#if defined __GNUC__
#warning rubysig.h is obsolete
-#elif defined _MSC_VER || defined __BORLANDC__
+#elif defined _MSC_VER
#pragma message("warning: rubysig.h is obsolete")
#endif
@@ -29,11 +29,6 @@ extern "C" {
RUBY_SYMBOL_EXPORT_BEGIN
-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 *));
-#define TRAP_BEG do {struct rb_blocking_region_buffer *__region = rb_thread_blocking_region_begin();
-#define TRAP_END rb_thread_blocking_region_end(__region);} while (0)
#define RUBY_CRITICAL(statements) do {statements;} while (0)
#define DEFER_INTS (0)
#define ENABLE_INTS (1)
diff --git a/include/ruby/backward/st.h b/include/ruby/backward/st.h
index 514128e616..3e36d44cf8 100644
--- a/include/ruby/backward/st.h
+++ b/include/ruby/backward/st.h
@@ -1,6 +1,6 @@
#if defined __GNUC__
#warning use "ruby/st.h" instead of bare "st.h"
-#elif defined _MSC_VER || defined __BORLANDC__
+#elif defined _MSC_VER
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
#endif
#include "ruby/st.h"
diff --git a/include/ruby/backward/util.h b/include/ruby/backward/util.h
index 6b47940ddc..11d32a2da8 100644
--- a/include/ruby/backward/util.h
+++ b/include/ruby/backward/util.h
@@ -1,6 +1,6 @@
#if defined __GNUC__
#warning use "ruby/util.h" instead of bare "util.h"
-#elif defined _MSC_VER || defined __BORLANDC__
+#elif defined _MSC_VER
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
#endif
#include "ruby/util.h"
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 9659db7ef6..b4d75294d4 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -112,7 +112,7 @@ RUBY_SYMBOL_EXPORT_BEGIN
#define xrealloc2 ruby_xrealloc2
#define xfree ruby_xfree
-#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__ ((__alloc_size__ params))
#else
# define RUBY_ATTR_ALLOC_SIZE(params)
@@ -143,65 +143,16 @@ void xfree(void*);
# define SIZEOF_LONG_LONG SIZEOF___INT64
#endif
-#ifndef BDIGIT
-# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned LONG_LONG
-# define BDIGIT_DBL_SIGNED LONG_LONG
-# define PRI_BDIGIT_PREFIX ""
-# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
-# elif SIZEOF_INT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-# define PRI_BDIGIT_PREFIX ""
-# define PRI_BDIGIT_DBL_PREFIX "l"
-# elif SIZEOF_SHORT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS SIZEOF_SHORT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-# define PRI_BDIGIT_PREFIX "h"
-# define PRI_BDIGIT_DBL_PREFIX "l"
-# else
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
-# define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-# define PRI_BDIGIT_PREFIX "h"
-# define PRI_BDIGIT_DBL_PREFIX "l"
-# endif
-#endif
-#ifndef SIZEOF_ACTUAL_BDIGIT
-# define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGITS
-#endif
-
-#ifdef PRI_BDIGIT_PREFIX
-# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
-# define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
-# define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
-# define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
-# define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
-# define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
-#endif
-
-#ifdef PRI_BDIGIT_DBL_PREFIX
-# define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
-# define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
-# define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
-# define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
-# define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
-# define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
-#endif
-
#ifdef __CYGWIN__
#undef _WIN32
#endif
-#if defined(_WIN32) || defined(__EMX__)
+#if defined(_WIN32)
+/*
+ DOSISH mean MS-Windows style filesystem.
+ But you should use more precise macros like DOSISH_DRIVE_LETTER, PATH_SEP,
+ ENV_IGNORECASE or CASEFOLD_FILESYSTEM.
+ */
#define DOSISH 1
# define DOSISH_DRIVE_LETTER
#endif
@@ -217,15 +168,6 @@ void xfree(void*);
#include "ruby/win32.h"
#endif
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
-#include <net/socket.h> /* intern.h needs fd_set definition */
-#endif
-
-#ifdef __SYMBIAN32__
-# define FALSE 0
-# define TRUE 1
-#endif
-
#ifdef RUBY_EXPORT
#undef RUBY_EXTERN
@@ -279,7 +221,7 @@ void rb_ia64_flushrs(void);
#define PATH_ENV "PATH"
-#if defined(DOSISH) && !defined(__EMX__)
+#if defined(DOSISH)
#define ENV_IGNORECASE
#endif
@@ -299,19 +241,46 @@ void rb_ia64_flushrs(void);
#define RUBY_PLATFORM "unknown-unknown"
#endif
+#ifndef FUNC_MINIMIZED
+#define FUNC_MINIMIZED(x) x
+#endif
+#ifndef FUNC_UNOPTIMIZED
+#define FUNC_UNOPTIMIZED(x) x
+#endif
#ifndef RUBY_ALIAS_FUNCTION_TYPE
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
- type prot {return name args;}
+ FUNC_MINIMIZED(type prot) {return (type)name args;}
#endif
#ifndef RUBY_ALIAS_FUNCTION_VOID
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
- void prot {name args;}
+ FUNC_MINIMIZED(void prot) {name args;}
#endif
#ifndef RUBY_ALIAS_FUNCTION
#define RUBY_ALIAS_FUNCTION(prot, name, args) \
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
#endif
+#ifndef UNALIGNED_WORD_ACCESS
+# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
+ defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
+ defined(__powerpc64__) || \
+ defined(__mc68020__)
+# define UNALIGNED_WORD_ACCESS 1
+# else
+# define UNALIGNED_WORD_ACCESS 0
+# endif
+#endif
+#ifndef PACKED_STRUCT
+# define PACKED_STRUCT(x) x
+#endif
+#ifndef PACKED_STRUCT_UNALIGNED
+# if UNALIGNED_WORD_ACCESS
+# define PACKED_STRUCT_UNALIGNED(x) PACKED_STRUCT(x)
+# else
+# define PACKED_STRUCT_UNALIGNED(x) x
+# endif
+#endif
+
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index 1c5d8da015..5ea2cda116 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -24,72 +24,113 @@ extern "C" {
RUBY_SYMBOL_EXPORT_BEGIN
-#define ENCODING_INLINE_MAX 127
-#define ENCODING_SHIFT (FL_USHIFT+10)
-#define ENCODING_MASK (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT) /* FL_USER10|FL_USER11|FL_USER12|FL_USER13|FL_USER14|FL_USER15|FL_USER16 */
-
-#define ENCODING_SET_INLINED(obj,i) do {\
- RBASIC(obj)->flags &= ~ENCODING_MASK;\
- RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
+enum ruby_encoding_consts {
+ RUBY_ENCODING_INLINE_MAX = 127,
+ RUBY_ENCODING_SHIFT = (RUBY_FL_USHIFT+10),
+ RUBY_ENCODING_MASK = (RUBY_ENCODING_INLINE_MAX<<RUBY_ENCODING_SHIFT
+ /* RUBY_FL_USER10..RUBY_FL_USER16 */),
+ RUBY_ENCODING_MAXNAMELEN = 42
+};
+
+#define ENCODING_INLINE_MAX RUBY_ENCODING_INLINE_MAX
+#define ENCODING_SHIFT RUBY_ENCODING_SHIFT
+#define ENCODING_MASK RUBY_ENCODING_MASK
+
+#define RB_ENCODING_SET_INLINED(obj,i) do {\
+ RBASIC(obj)->flags &= ~RUBY_ENCODING_MASK;\
+ RBASIC(obj)->flags |= (VALUE)(i) << RUBY_ENCODING_SHIFT;\
} while (0)
-#define ENCODING_SET(obj,i) rb_enc_set_index((obj), (i))
+#define RB_ENCODING_SET(obj,i) rb_enc_set_index((obj), (i))
-#define ENCODING_GET_INLINED(obj) (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
-#define ENCODING_GET(obj) \
- (ENCODING_GET_INLINED(obj) != ENCODING_INLINE_MAX ? \
- ENCODING_GET_INLINED(obj) : \
+#define RB_ENCODING_GET_INLINED(obj) \
+ (int)((RBASIC(obj)->flags & RUBY_ENCODING_MASK)>>RUBY_ENCODING_SHIFT)
+#define RB_ENCODING_GET(obj) \
+ (RB_ENCODING_GET_INLINED(obj) != RUBY_ENCODING_INLINE_MAX ? \
+ RB_ENCODING_GET_INLINED(obj) : \
rb_enc_get_index(obj))
-#define ENCODING_IS_ASCII8BIT(obj) (ENCODING_GET_INLINED(obj) == 0)
-
-#define ENCODING_MAXNAMELEN 42
+#define RB_ENCODING_IS_ASCII8BIT(obj) (RB_ENCODING_GET_INLINED(obj) == 0)
+
+#define ENCODING_SET_INLINED(obj,i) RB_ENCODING_SET_INLINED(obj,i)
+#define ENCODING_SET(obj,i) RB_ENCODING_SET(obj,i)
+#define ENCODING_GET_INLINED(obj) RB_ENCODING_GET_INLINED(obj)
+#define ENCODING_GET(obj) RB_ENCODING_GET(obj)
+#define ENCODING_IS_ASCII8BIT(obj) RB_ENCODING_IS_ASCII8BIT(obj)
+#define ENCODING_MAXNAMELEN RUBY_ENCODING_MAXNAMELEN
+
+enum ruby_coderange_type {
+ RUBY_ENC_CODERANGE_UNKNOWN = 0,
+ RUBY_ENC_CODERANGE_7BIT = ((int)RUBY_FL_USER8),
+ RUBY_ENC_CODERANGE_VALID = ((int)RUBY_FL_USER9),
+ RUBY_ENC_CODERANGE_BROKEN = ((int)(RUBY_FL_USER8|RUBY_FL_USER9)),
+ RUBY_ENC_CODERANGE_MASK = (RUBY_ENC_CODERANGE_7BIT|
+ RUBY_ENC_CODERANGE_VALID|
+ RUBY_ENC_CODERANGE_BROKEN)
+};
-#define ENC_CODERANGE_MASK ((int)(FL_USER8|FL_USER9))
-#define ENC_CODERANGE_UNKNOWN 0
-#define ENC_CODERANGE_7BIT ((int)FL_USER8)
-#define ENC_CODERANGE_VALID ((int)FL_USER9)
-#define ENC_CODERANGE_BROKEN ((int)(FL_USER8|FL_USER9))
-#define ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
-#define ENC_CODERANGE_ASCIIONLY(obj) (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
-#define ENC_CODERANGE_SET(obj,cr) (RBASIC(obj)->flags = \
- (RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))
-#define ENC_CODERANGE_CLEAR(obj) ENC_CODERANGE_SET((obj),0)
+static inline int
+rb_enc_coderange_clean_p(int cr)
+{
+ return (cr ^ (cr >> 1)) & RUBY_ENC_CODERANGE_7BIT;
+}
+#define RB_ENC_CODERANGE_CLEAN_P(cr) rb_enc_coderange_clean_p(cr)
+#define RB_ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & RUBY_ENC_CODERANGE_MASK)
+#define RB_ENC_CODERANGE_ASCIIONLY(obj) (RB_ENC_CODERANGE(obj) == RUBY_ENC_CODERANGE_7BIT)
+#define RB_ENC_CODERANGE_SET(obj,cr) (\
+ RBASIC(obj)->flags = \
+ (RBASIC(obj)->flags & ~RUBY_ENC_CODERANGE_MASK) | (cr))
+#define RB_ENC_CODERANGE_CLEAR(obj) RB_ENC_CODERANGE_SET((obj),0)
/* assumed ASCII compatibility */
-#define ENC_CODERANGE_AND(a, b) \
- ((a) == ENC_CODERANGE_7BIT ? (b) : \
- (a) == ENC_CODERANGE_VALID ? ((b) == ENC_CODERANGE_7BIT ? ENC_CODERANGE_VALID : (b)) : \
- ENC_CODERANGE_UNKNOWN)
+#define RB_ENC_CODERANGE_AND(a, b) \
+ ((a) == RUBY_ENC_CODERANGE_7BIT ? (b) : \
+ (a) != RUBY_ENC_CODERANGE_VALID ? RUBY_ENC_CODERANGE_UNKNOWN : \
+ (b) == RUBY_ENC_CODERANGE_7BIT ? RUBY_ENC_CODERANGE_VALID : (b))
-#define ENCODING_CODERANGE_SET(obj, encindex, cr) \
+#define RB_ENCODING_CODERANGE_SET(obj, encindex, cr) \
do { \
VALUE rb_encoding_coderange_obj = (obj); \
- ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
- ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
+ RB_ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
+ RB_ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
} while (0)
-typedef OnigEncodingType rb_encoding;
+#define ENC_CODERANGE_MASK RUBY_ENC_CODERANGE_MASK
+#define ENC_CODERANGE_UNKNOWN RUBY_ENC_CODERANGE_UNKNOWN
+#define ENC_CODERANGE_7BIT RUBY_ENC_CODERANGE_7BIT
+#define ENC_CODERANGE_VALID RUBY_ENC_CODERANGE_VALID
+#define ENC_CODERANGE_BROKEN RUBY_ENC_CODERANGE_BROKEN
+#define ENC_CODERANGE_CLEAN_P(cr) RB_ENC_CODERANGE_CLEAN_P(cr)
+#define ENC_CODERANGE(obj) RB_ENC_CODERANGE(obj)
+#define ENC_CODERANGE_ASCIIONLY(obj) RB_ENC_CODERANGE_ASCIIONLY(obj)
+#define ENC_CODERANGE_SET(obj,cr) RB_ENC_CODERANGE_SET(obj,cr)
+#define ENC_CODERANGE_CLEAR(obj) RB_ENC_CODERANGE_CLEAR(obj)
+#define ENC_CODERANGE_AND(a, b) RB_ENC_CODERANGE_AND(a, b)
+#define ENCODING_CODERANGE_SET(obj, encindex, cr) RB_ENCODING_CODERANGE_SET(obj, encindex, cr)
+
+typedef const OnigEncodingType rb_encoding;
int rb_char_to_option_kcode(int c, int *option, int *kcode);
int rb_enc_replicate(const char *, rb_encoding *);
int rb_define_dummy_encoding(const char *);
-#define rb_enc_to_index(enc) ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
+int rb_enc_dummy_p(rb_encoding *enc);
+int rb_enc_to_index(rb_encoding *enc);
int rb_enc_get_index(VALUE obj);
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);
+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);
VALUE rb_enc_associate_index(VALUE, int);
VALUE rb_enc_associate(VALUE, rb_encoding*);
void rb_enc_copy(VALUE dst, VALUE src);
VALUE rb_enc_str_new(const char*, long, rb_encoding*);
VALUE rb_enc_str_new_cstr(const char*, rb_encoding*);
+VALUE rb_enc_str_new_static(const char*, long, rb_encoding*);
VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
@@ -105,10 +146,16 @@ 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);
#if defined(__GNUC__) && !defined(__PCC__)
+#define rb_enc_str_new(str, len, enc) __extension__ ( \
+{ \
+ (__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
+ rb_enc_str_new_static((str), (len), (enc)) : \
+ rb_enc_str_new((str), (len), (enc)); \
+})
#define rb_enc_str_new_cstr(str, enc) __extension__ ( \
{ \
(__builtin_constant_p(str)) ? \
- rb_enc_str_new((str), (long)strlen(str), (enc)) : \
+ rb_enc_str_new_static((str), (long)strlen(str), (enc)) : \
rb_enc_str_new_cstr((str), (enc)); \
})
#endif
@@ -116,10 +163,10 @@ VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ec
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);
+rb_encoding *rb_enc_from_index(int idx);
/* name -> rb_encoding */
-rb_encoding * rb_enc_find(const char *name);
+rb_encoding *rb_enc_find(const char *name);
/* rb_encoding * -> name */
#define rb_enc_name(enc) (enc)->name
@@ -231,21 +278,9 @@ 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);
+VALUE rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc);
RUBY_EXTERN VALUE rb_cEncoding;
-#define ENC_DUMMY_FLAG (1<<24)
-#define ENC_INDEX_MASK (~(~0U<<24))
-
-#define ENC_TO_ENCINDEX(enc) (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
-
-#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
-#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
-
-static inline int
-rb_enc_dummy_p(rb_encoding *enc)
-{
- return ENC_DUMMY_P(enc) != 0;
-}
/* econv stuff */
@@ -313,43 +348,64 @@ VALUE rb_econv_append(rb_econv_t *ec, const char *bytesrc, long bytesize, VALUE
void rb_econv_binmode(rb_econv_t *ec);
+enum ruby_econv_flag_type {
/* flags for rb_econv_open */
+ RUBY_ECONV_ERROR_HANDLER_MASK = 0x000000ff,
-#define ECONV_ERROR_HANDLER_MASK 0x000000ff
-
-#define ECONV_INVALID_MASK 0x0000000f
-#define ECONV_INVALID_REPLACE 0x00000002
+ RUBY_ECONV_INVALID_MASK = 0x0000000f,
+ RUBY_ECONV_INVALID_REPLACE = 0x00000002,
-#define ECONV_UNDEF_MASK 0x000000f0
-#define ECONV_UNDEF_REPLACE 0x00000020
-#define ECONV_UNDEF_HEX_CHARREF 0x00000030
+ RUBY_ECONV_UNDEF_MASK = 0x000000f0,
+ RUBY_ECONV_UNDEF_REPLACE = 0x00000020,
+ RUBY_ECONV_UNDEF_HEX_CHARREF = 0x00000030,
-#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
+ RUBY_ECONV_DECORATOR_MASK = 0x0000ff00,
+ RUBY_ECONV_NEWLINE_DECORATOR_MASK = 0x00003f00,
+ RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK = 0x00000f00,
+ RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK = 0x00003000,
-#define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100
-#define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000
-#define ECONV_CR_NEWLINE_DECORATOR 0x00002000
-#define ECONV_XML_TEXT_DECORATOR 0x00004000
-#define ECONV_XML_ATTR_CONTENT_DECORATOR 0x00008000
+ RUBY_ECONV_UNIVERSAL_NEWLINE_DECORATOR = 0x00000100,
+ RUBY_ECONV_CRLF_NEWLINE_DECORATOR = 0x00001000,
+ RUBY_ECONV_CR_NEWLINE_DECORATOR = 0x00002000,
+ RUBY_ECONV_XML_TEXT_DECORATOR = 0x00004000,
+ RUBY_ECONV_XML_ATTR_CONTENT_DECORATOR = 0x00008000,
-#define ECONV_STATEFUL_DECORATOR_MASK 0x00f00000
-#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000
+ RUBY_ECONV_STATEFUL_DECORATOR_MASK = 0x00f00000,
+ RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR = 0x00100000,
+ RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR =
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
-#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_CRLF_NEWLINE_DECORATOR
+ RUBY_ECONV_CRLF_NEWLINE_DECORATOR,
#else
-#define ECONV_DEFAULT_NEWLINE_DECORATOR 0
+ 0,
#endif
-
+#define ECONV_ERROR_HANDLER_MASK RUBY_ECONV_ERROR_HANDLER_MASK
+#define ECONV_INVALID_MASK RUBY_ECONV_INVALID_MASK
+#define ECONV_INVALID_REPLACE RUBY_ECONV_INVALID_REPLACE
+#define ECONV_UNDEF_MASK RUBY_ECONV_UNDEF_MASK
+#define ECONV_UNDEF_REPLACE RUBY_ECONV_UNDEF_REPLACE
+#define ECONV_UNDEF_HEX_CHARREF RUBY_ECONV_UNDEF_HEX_CHARREF
+#define ECONV_DECORATOR_MASK RUBY_ECONV_DECORATOR_MASK
+#define ECONV_NEWLINE_DECORATOR_MASK RUBY_ECONV_NEWLINE_DECORATOR_MASK
+#define ECONV_NEWLINE_DECORATOR_READ_MASK RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK
+#define ECONV_NEWLINE_DECORATOR_WRITE_MASK RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK
+#define ECONV_UNIVERSAL_NEWLINE_DECORATOR RUBY_ECONV_UNIVERSAL_NEWLINE_DECORATOR
+#define ECONV_CRLF_NEWLINE_DECORATOR RUBY_ECONV_CRLF_NEWLINE_DECORATOR
+#define ECONV_CR_NEWLINE_DECORATOR RUBY_ECONV_CR_NEWLINE_DECORATOR
+#define ECONV_XML_TEXT_DECORATOR RUBY_ECONV_XML_TEXT_DECORATOR
+#define ECONV_XML_ATTR_CONTENT_DECORATOR RUBY_ECONV_XML_ATTR_CONTENT_DECORATOR
+#define ECONV_STATEFUL_DECORATOR_MASK RUBY_ECONV_STATEFUL_DECORATOR_MASK
+#define ECONV_XML_ATTR_QUOTE_DECORATOR RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR
+#define ECONV_DEFAULT_NEWLINE_DECORATOR RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR
/* end of flags for rb_econv_open */
/* flags for rb_econv_convert */
-#define ECONV_PARTIAL_INPUT 0x00010000
-#define ECONV_AFTER_OUTPUT 0x00020000
+ RUBY_ECONV_PARTIAL_INPUT = 0x00010000,
+ RUBY_ECONV_AFTER_OUTPUT = 0x00020000,
+#define ECONV_PARTIAL_INPUT RUBY_ECONV_PARTIAL_INPUT
+#define ECONV_AFTER_OUTPUT RUBY_ECONV_AFTER_OUTPUT
/* end of flags for rb_econv_convert */
+RUBY_ECONV_FLAGS_PLACEHOLDER};
RUBY_SYMBOL_EXPORT_END
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 6200e77a63..aec2d528ca 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -56,7 +56,7 @@ 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_aref(int, const VALUE*, VALUE);
VALUE rb_ary_subseq(VALUE, long, long);
void rb_ary_store(VALUE, long, VALUE);
VALUE rb_ary_dup(VALUE);
@@ -85,35 +85,31 @@ VALUE rb_ary_rassoc(VALUE, VALUE);
VALUE rb_ary_includes(VALUE, VALUE);
VALUE rb_ary_cmp(VALUE, VALUE);
VALUE rb_ary_replace(VALUE copy, VALUE orig);
-VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
+VALUE rb_get_values_at(VALUE, long, int, const VALUE*, VALUE(*)(VALUE,long));
VALUE rb_ary_resize(VALUE ary, long len);
#define rb_ary_new2 rb_ary_new_capa
#define rb_ary_new3 rb_ary_new_from_args
#define rb_ary_new4 rb_ary_new_from_values
/* bignum.c */
-VALUE rb_big_new(long, int);
+VALUE rb_big_new(size_t, int);
int rb_bigzero_p(VALUE x);
VALUE rb_big_clone(VALUE);
void rb_big_2comp(VALUE);
VALUE rb_big_norm(VALUE);
-void rb_big_resize(VALUE big, long len);
+void rb_big_resize(VALUE big, size_t len);
VALUE rb_cstr_to_inum(const char*, int, int);
VALUE rb_str_to_inum(VALUE, int, int);
VALUE rb_cstr2inum(const char*, int);
VALUE rb_str2inum(VALUE, int);
VALUE rb_big2str(VALUE, int);
-DEPRECATED(VALUE rb_big2str0(VALUE, int, int));
-SIGNED_VALUE rb_big2long(VALUE);
+long rb_big2long(VALUE);
#define rb_big2int(x) rb_big2long(x)
-VALUE rb_big2ulong(VALUE);
+unsigned long rb_big2ulong(VALUE);
#define rb_big2uint(x) rb_big2ulong(x)
-DEPRECATED(VALUE rb_big2ulong_pack(VALUE x));
#if HAVE_LONG_LONG
LONG_LONG rb_big2ll(VALUE);
unsigned LONG_LONG rb_big2ull(VALUE);
#endif /* HAVE_LONG_LONG */
-DEPRECATED(void rb_quad_pack(char*,VALUE));
-DEPRECATED(VALUE rb_quad_unpack(const char*,int));
void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
VALUE rb_big_unpack(unsigned long *buf, long num_longs);
int rb_uv_to_utf8(char[6],unsigned long);
@@ -135,6 +131,7 @@ VALUE rb_big_or(VALUE, VALUE);
VALUE rb_big_xor(VALUE, VALUE);
VALUE rb_big_lshift(VALUE, VALUE);
VALUE rb_big_rshift(VALUE, VALUE);
+VALUE rb_big_hash(VALUE);
/* For rb_integer_pack and rb_integer_unpack: */
/* "MS" in MSWORD and MSBYTE means "most significant" */
@@ -172,6 +169,8 @@ VALUE rb_rational_new(VALUE, VALUE);
VALUE rb_Rational(VALUE, VALUE);
#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
#define rb_Rational2(x,y) rb_Rational((x), (y))
+VALUE rb_rational_num(VALUE rat);
+VALUE rb_rational_den(VALUE rat);
VALUE rb_flt_rationalize_with_prec(VALUE, VALUE);
VALUE rb_flt_rationalize(VALUE);
/* complex.c */
@@ -185,6 +184,8 @@ VALUE rb_complex_polar(VALUE, VALUE);
VALUE rb_Complex(VALUE, VALUE);
#define rb_Complex1(x) rb_Complex((x), INT2FIX(0))
#define rb_Complex2(x,y) rb_Complex((x), (y))
+DEPRECATED(VALUE rb_complex_set_real(VALUE, VALUE));
+DEPRECATED(VALUE rb_complex_set_imag(VALUE, VALUE));
/* class.c */
VALUE rb_class_boot(VALUE);
VALUE rb_class_new(VALUE);
@@ -203,11 +204,11 @@ 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);
-VALUE rb_class_instance_methods(int, VALUE*, VALUE);
-VALUE rb_class_public_instance_methods(int, VALUE*, VALUE);
-VALUE rb_class_protected_instance_methods(int, VALUE*, VALUE);
-VALUE rb_class_private_instance_methods(int, VALUE*, VALUE);
-VALUE rb_obj_singleton_methods(int, VALUE*, VALUE);
+VALUE rb_class_instance_methods(int, const VALUE*, VALUE);
+VALUE rb_class_public_instance_methods(int, const VALUE*, VALUE);
+VALUE rb_class_protected_instance_methods(int, const VALUE*, VALUE);
+VALUE rb_class_private_instance_methods(int, const VALUE*, VALUE);
+VALUE rb_obj_singleton_methods(int, const VALUE*, VALUE);
void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
void rb_frozen_class_p(VALUE);
void rb_undef(VALUE, ID);
@@ -220,24 +221,26 @@ int rb_cmpint(VALUE, VALUE, VALUE);
NORETURN(void rb_cmperr(VALUE, VALUE));
/* cont.c */
VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
-VALUE rb_fiber_resume(VALUE fib, int argc, VALUE *args);
-VALUE rb_fiber_yield(int argc, VALUE *args);
+VALUE rb_fiber_resume(VALUE fib, int argc, const VALUE *argv);
+VALUE rb_fiber_yield(int argc, const VALUE *argv);
VALUE rb_fiber_current(void);
VALUE rb_fiber_alive_p(VALUE);
/* enum.c */
VALUE rb_enum_values_pack(int, const VALUE*);
/* enumerator.c */
-VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
+VALUE rb_enumeratorize(VALUE, VALUE, int, const VALUE *);
typedef VALUE rb_enumerator_size_func(VALUE, VALUE, VALUE);
-VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, VALUE *, rb_enumerator_size_func *);
+VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, const VALUE *, rb_enumerator_size_func *);
#ifndef RUBY_EXPORT
#define rb_enumeratorize_with_size(obj, id, argc, argv, size_fn) \
rb_enumeratorize_with_size(obj, id, argc, argv, (rb_enumerator_size_func *)(size_fn))
#endif
+#define SIZED_ENUMERATOR(obj, argc, argv, size_fn) \
+ rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()), \
+ (argc), (argv), (size_fn))
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do { \
if (!rb_block_given_p()) \
- return rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()),\
- (argc), (argv), (size_fn)); \
+ return SIZED_ENUMERATOR(obj, argc, argv, size_fn); \
} while (0)
#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
/* error.c */
@@ -251,17 +254,18 @@ PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)),
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);
+DEPRECATED(PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4));
+DEPRECATED(PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5));
+DEPRECATED(PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2));
NORETURN(void rb_error_frozen(const char*));
+NORETURN(void rb_error_frozen_object(VALUE));
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)); \
+ rb_error_frozen_object(frozen_obj); \
} \
} while (0)
#define rb_check_trusted_internal(obj) ((void) 0)
@@ -284,8 +288,9 @@ rb_check_trusted_inline(VALUE obj)
#endif
void rb_check_copyable(VALUE obj, VALUE orig);
-#define OBJ_INIT_COPY(obj, orig) \
+#define RB_OBJ_INIT_COPY(obj, orig) \
((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
+#define OBJ_INIT_COPY(obj, orig) RB_OBJ_INIT_COPY(obj, orig)
/* eval.c */
int rb_sourceline(void);
@@ -315,6 +320,8 @@ void rb_fd_clr(int, rb_fdset_t *);
int rb_fd_isset(int, const rb_fdset_t *);
void rb_fd_copy(rb_fdset_t *, const fd_set *, int);
void rb_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
+
+struct timeval;
int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
#define rb_fd_ptr(f) ((f)->fdset)
@@ -364,18 +371,28 @@ typedef fd_set rb_fdset_t;
NORETURN(void rb_exc_raise(VALUE));
NORETURN(void rb_exc_fatal(VALUE));
-VALUE rb_f_exit(int,VALUE*);
-VALUE rb_f_abort(int,VALUE*);
+VALUE rb_f_exit(int, const VALUE*);
+VALUE rb_f_abort(int, const VALUE*);
void rb_remove_method(VALUE, const char*);
void rb_remove_method_id(VALUE, ID);
-#define rb_disable_super(klass, name) ((void)0)
-#define rb_enable_super(klass, name) ((void)0)
+DEPRECATED(static inline void rb_disable_super(void));
+DEPRECATED(static inline void rb_enable_super(void));
+static inline void rb_disable_super(void)
+{
+ /* obsolete - no use */
+}
+static inline void rb_enable_super(void)
+{
+ rb_warning("rb_enable_super() is obsolete");
+}
+#define rb_disable_super(klass, name) rb_disable_super()
+#define rb_enable_super(klass, name) rb_enable_super()
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
typedef VALUE (*rb_alloc_func_t)(VALUE);
void rb_define_alloc_func(VALUE, rb_alloc_func_t);
void rb_undef_alloc_func(VALUE);
rb_alloc_func_t rb_get_alloc_func(VALUE);
-void rb_clear_cache(void);
+DEPRECATED(void rb_clear_cache(void));
void rb_clear_constant_cache(void);
void rb_clear_method_cache_by_class(VALUE);
void rb_alias(VALUE, ID, ID);
@@ -385,15 +402,19 @@ int rb_method_basic_definition_p(VALUE, ID);
VALUE rb_eval_cmd(VALUE, VALUE, int);
int rb_obj_respond_to(VALUE, ID, int);
int rb_respond_to(VALUE, ID);
-VALUE rb_f_notimplement(int argc, VALUE *argv, VALUE obj);
+VALUE rb_f_notimplement(int argc, const VALUE *argv, VALUE obj);
+#if !defined(RUBY_EXPORT) && defined(_WIN32)
+RUBY_EXTERN VALUE (*const rb_f_notimplement_)(int, const VALUE *, VALUE);
+#define rb_f_notimplement (*rb_f_notimplement_)
+#endif
void rb_interrupt(void);
VALUE rb_apply(VALUE, ID, VALUE);
void rb_backtrace(void);
ID rb_frame_this_func(void);
-VALUE rb_obj_instance_eval(int, VALUE*, VALUE);
-VALUE rb_obj_instance_exec(int, VALUE*, VALUE);
-VALUE rb_mod_module_eval(int, VALUE*, VALUE);
-VALUE rb_mod_module_exec(int, VALUE*, VALUE);
+VALUE rb_obj_instance_eval(int, const VALUE*, VALUE);
+VALUE rb_obj_instance_exec(int, const VALUE*, VALUE);
+VALUE rb_mod_module_eval(int, const VALUE*, VALUE);
+VALUE rb_mod_module_exec(int, const VALUE*, VALUE);
void rb_load(VALUE, int);
void rb_load_protect(VALUE, int, int*);
NORETURN(void rb_jump_tag(int));
@@ -402,8 +423,8 @@ int rb_feature_provided(const char *, const char **);
void rb_provide(const char*);
VALUE rb_f_require(VALUE, VALUE);
VALUE rb_require_safe(VALUE, int);
-void rb_obj_call_init(VALUE, int, VALUE*);
-VALUE rb_class_new_instance(int, VALUE*, VALUE);
+void rb_obj_call_init(VALUE, int, const VALUE*);
+VALUE rb_class_new_instance(int, const VALUE*, VALUE);
VALUE rb_block_proc(void);
VALUE rb_block_lambda(void);
VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
@@ -415,8 +436,8 @@ VALUE rb_proc_lambda_p(VALUE);
VALUE rb_binding_new(void);
VALUE rb_obj_method(VALUE, VALUE);
VALUE rb_obj_is_method(VALUE);
-VALUE rb_method_call(int, VALUE*, VALUE);
-VALUE rb_method_call_with_block(int, VALUE *, VALUE, VALUE);
+VALUE rb_method_call(int, const VALUE*, VALUE);
+VALUE rb_method_call_with_block(int, const VALUE *, VALUE, VALUE);
int rb_mod_method_arity(VALUE, ID);
int rb_obj_method_arity(VALUE, ID);
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
@@ -427,7 +448,6 @@ void rb_thread_wait_fd(int);
int rb_thread_fd_writable(int);
void rb_thread_fd_close(int);
int rb_thread_alone(void);
-DEPRECATED(void rb_thread_polling(void));
void rb_thread_sleep(int);
void rb_thread_sleep_forever(void);
void rb_thread_sleep_deadly(void);
@@ -437,7 +457,6 @@ VALUE rb_thread_wakeup_alive(VALUE);
VALUE rb_thread_run(VALUE);
VALUE rb_thread_kill(VALUE);
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
-DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *));
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
void rb_thread_wait_for(struct timeval);
VALUE rb_thread_current(void);
@@ -453,9 +472,9 @@ VALUE rb_exec_recursive_paired_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VAL
/* dir.c */
VALUE rb_dir_getwd(void);
/* file.c */
-VALUE rb_file_s_expand_path(int, VALUE *);
+VALUE rb_file_s_expand_path(int, const VALUE *);
VALUE rb_file_expand_path(VALUE, VALUE);
-VALUE rb_file_s_absolute_path(int, VALUE *);
+VALUE rb_file_s_absolute_path(int, const VALUE *);
VALUE rb_file_absolute_path(VALUE, VALUE);
VALUE rb_file_dirname(VALUE fname);
int rb_find_file_ext_safe(VALUE*, const char* const*, int);
@@ -468,7 +487,7 @@ int rb_is_absolute_path(const char *);
/* gc.c */
NORETURN(void rb_memerror(void));
int rb_during_gc(void);
-void rb_gc_mark_locations(VALUE*, VALUE*);
+void rb_gc_mark_locations(const VALUE*, const VALUE*);
void rb_mark_tbl(struct st_table*);
void rb_mark_set(struct st_table*);
void rb_mark_hash(struct st_table*);
@@ -482,7 +501,6 @@ void rb_gc_call_finalizer_at_exit(void);
VALUE rb_gc_enable(void);
VALUE rb_gc_disable(void);
VALUE rb_gc_start(void);
-DEPRECATED(void rb_gc_set_params(void));
VALUE rb_define_finalizer(VALUE, VALUE);
VALUE rb_undefine_finalizer(VALUE);
size_t rb_gc_count(void);
@@ -511,6 +529,9 @@ struct st_table *rb_hash_tbl(VALUE);
int rb_path_check(const char*);
int rb_env_path_tainted(void);
VALUE rb_env_clear(void);
+VALUE rb_hash_size(VALUE);
+DEPRECATED(int rb_hash_iter_lev(VALUE));
+DEPRECATED(VALUE rb_hash_ifnone(VALUE));
/* io.c */
#define rb_defout rb_stdout
RUBY_EXTERN VALUE rb_fs;
@@ -529,9 +550,9 @@ VALUE rb_io_eof(VALUE);
VALUE rb_io_binmode(VALUE);
VALUE rb_io_ascii8bit_binmode(VALUE);
VALUE rb_io_addstr(VALUE, VALUE);
-VALUE rb_io_printf(int, VALUE*, VALUE);
-VALUE rb_io_print(int, VALUE*, VALUE);
-VALUE rb_io_puts(int, VALUE*, VALUE);
+VALUE rb_io_printf(int, const VALUE*, VALUE);
+VALUE rb_io_print(int, const VALUE*, VALUE);
+VALUE rb_io_puts(int, const VALUE*, VALUE);
VALUE rb_io_fdopen(int, int, const char*);
VALUE rb_io_get_io(VALUE);
VALUE rb_file_open(const char*, const char*);
@@ -603,8 +624,6 @@ 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);
int rb_is_const_id(ID);
int rb_is_global_id(ID);
@@ -619,29 +638,15 @@ VALUE rb_backref_get(void);
void rb_backref_set(VALUE);
VALUE rb_lastline_get(void);
void rb_lastline_set(VALUE);
-VALUE rb_sym_all_symbols(void);
/* process.c */
void rb_last_status_set(int status, rb_pid_t pid);
VALUE rb_last_status_get(void);
-struct rb_exec_arg {
- VALUE execarg_obj;
-};
-DEPRECATED(int rb_proc_exec_n(int, VALUE*, const char*));
int rb_proc_exec(const char*);
-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*);
+VALUE rb_f_exec(int, const VALUE*);
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
void rb_syswait(rb_pid_t pid);
-rb_pid_t rb_spawn(int, VALUE*);
-rb_pid_t rb_spawn_err(int, VALUE*, char*, size_t);
+rb_pid_t rb_spawn(int, const VALUE*);
+rb_pid_t rb_spawn_err(int, const VALUE*, char*, size_t);
VALUE rb_proc_times(VALUE);
VALUE rb_detach_process(rb_pid_t pid);
/* range.c */
@@ -684,7 +689,7 @@ VALUE rb_get_argv(void);
void *rb_load_file(const char*);
void *rb_load_file_str(VALUE);
/* signal.c */
-VALUE rb_f_kill(int, VALUE*);
+VALUE rb_f_kill(int, const VALUE*);
#ifdef POSIX_SIGNAL
#define posix_signal ruby_posix_signal
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
@@ -720,6 +725,11 @@ VALUE rb_str_buf_new2(const char*);
VALUE rb_str_tmp_new(long);
VALUE rb_usascii_str_new(const char*, long);
VALUE rb_usascii_str_new_cstr(const char*);
+VALUE rb_utf8_str_new(const char*, long);
+VALUE rb_utf8_str_new_cstr(const char*);
+VALUE rb_str_new_static(const char *, long);
+VALUE rb_usascii_str_new_static(const char *, long);
+VALUE rb_utf8_str_new_static(const char *, long);
void rb_str_free(VALUE);
void rb_str_shared_replace(VALUE, VALUE);
VALUE rb_str_buf_append(VALUE, VALUE);
@@ -747,6 +757,7 @@ VALUE rb_str_freeze(VALUE);
void rb_str_set_len(VALUE, long);
VALUE rb_str_resize(VALUE, long);
VALUE rb_str_cat(VALUE, const char*, long);
+VALUE rb_str_cat_cstr(VALUE, const char*);
VALUE rb_str_cat2(VALUE, const char*);
VALUE rb_str_append(VALUE, VALUE);
VALUE rb_str_concat(VALUE, VALUE);
@@ -769,8 +780,8 @@ VALUE rb_str_replace(VALUE, VALUE);
VALUE rb_str_inspect(VALUE);
VALUE rb_str_dump(VALUE);
VALUE rb_str_split(VALUE, const char*);
-void rb_str_associate(VALUE, VALUE);
-VALUE rb_str_associated(VALUE);
+DEPRECATED(void rb_str_associate(VALUE, VALUE));
+DEPRECATED(VALUE rb_str_associated(VALUE));
void rb_str_setter(VALUE, ID, VALUE*);
VALUE rb_str_intern(VALUE);
VALUE rb_sym_to_s(VALUE);
@@ -780,13 +791,34 @@ long rb_str_offset(VALUE, long);
size_t rb_str_capacity(VALUE);
VALUE rb_str_ellipsize(VALUE, long);
VALUE rb_str_scrub(VALUE, VALUE);
+/* symbol.c */
+VALUE rb_sym_all_symbols(void);
+
#if defined(__GNUC__) && !defined(__PCC__)
+#define rb_str_new(str, len) __extension__ ( \
+{ \
+ (__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
+ rb_str_new_static((str), (len)) : \
+ rb_str_new((str), (len)); \
+})
#define rb_str_new_cstr(str) __extension__ ( \
{ \
(__builtin_constant_p(str)) ? \
- rb_str_new((str), (long)strlen(str)) : \
+ rb_str_new_static((str), (long)strlen(str)) : \
rb_str_new_cstr(str); \
})
+#define rb_usascii_str_new(str, len) __extension__ ( \
+{ \
+ (__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
+ rb_usascii_str_new_static((str), (len)) : \
+ rb_usascii_str_new((str), (len)); \
+})
+#define rb_utf8_str_new(str, len) __extension__ ( \
+{ \
+ (__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
+ rb_utf8_str_new_static((str), (len)) : \
+ rb_utf8_str_new((str), (len)); \
+})
#define rb_tainted_str_new_cstr(str) __extension__ ( \
{ \
(__builtin_constant_p(str)) ? \
@@ -796,9 +828,15 @@ VALUE rb_str_scrub(VALUE, VALUE);
#define rb_usascii_str_new_cstr(str) __extension__ ( \
{ \
(__builtin_constant_p(str)) ? \
- rb_usascii_str_new((str), (long)strlen(str)) : \
+ rb_usascii_str_new_static((str), (long)strlen(str)) : \
rb_usascii_str_new_cstr(str); \
})
+#define rb_utf8_str_new_cstr(str) __extension__ ( \
+{ \
+ (__builtin_constant_p(str)) ? \
+ rb_utf8_str_new_static((str), (long)strlen(str)) : \
+ rb_utf8_str_new_cstr(str); \
+})
#define rb_external_str_new_cstr(str) __extension__ ( \
{ \
(__builtin_constant_p(str)) ? \
@@ -818,17 +856,11 @@ VALUE rb_str_scrub(VALUE, VALUE);
(str), (long)strlen(str)) : \
rb_str_buf_new_cstr(str); \
})
-#define rb_str_buf_cat2(str, ptr) __extension__ ( \
-{ \
- (__builtin_constant_p(ptr)) ? \
- rb_str_buf_cat((str), (ptr), (long)strlen(ptr)) : \
- rb_str_buf_cat2((str), (ptr)); \
-})
-#define rb_str_cat2(str, ptr) __extension__ ( \
+#define rb_str_cat_cstr(str, ptr) __extension__ ( \
{ \
(__builtin_constant_p(ptr)) ? \
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
- rb_str_cat2((str), (ptr)); \
+ rb_str_cat_cstr((str), (ptr)); \
})
#define rb_exc_new_cstr(klass, ptr) __extension__ ( \
{ \
@@ -844,6 +876,19 @@ VALUE rb_str_scrub(VALUE, VALUE);
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
#define rb_str_buf_new2 rb_str_buf_new_cstr
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
+#define rb_str_buf_cat rb_str_cat
+#define rb_str_buf_cat2 rb_str_cat_cstr
+#define rb_str_cat2 rb_str_cat_cstr
+#define rb_strlen_lit(str) (sizeof(str "") - 1)
+#define rb_str_new_lit(str) rb_str_new_static((str), rb_strlen_lit(str))
+#define rb_usascii_str_new_lit(str) rb_usascii_str_new_static((str), rb_strlen_lit(str))
+#define rb_utf8_str_new_lit(str) rb_utf8_str_new_static((str), rb_strlen_lit(str))
+#define rb_enc_str_new_lit(str, enc) rb_enc_str_new_static((str), rb_strlen_lit(str), (enc))
+#define rb_str_new_literal(str) rb_str_new_lit(str)
+#define rb_usascii_str_new_literal(str) rb_usascii_str_new_lit(str)
+#define rb_utf8_str_new_literal(str) rb_utf8_str_new_lit(str)
+#define rb_enc_str_new_literal(str, enc) rb_enc_str_new_lit(str, enc)
+
/* struct.c */
VALUE rb_struct_new(VALUE, ...);
VALUE rb_struct_define(const char*, ...);
@@ -853,7 +898,6 @@ VALUE rb_struct_initialize(VALUE, VALUE);
VALUE rb_struct_aref(VALUE, VALUE);
VALUE rb_struct_aset(VALUE, VALUE, VALUE);
VALUE rb_struct_getmember(VALUE, ID);
-DEPRECATED(VALUE rb_struct_iv_get(VALUE, const char*));
VALUE rb_struct_s_members(VALUE);
VALUE rb_struct_members(VALUE);
VALUE rb_struct_alloc_noinit(VALUE);
@@ -866,9 +910,6 @@ typedef VALUE rb_blocking_function_t(void *);
void rb_thread_check_ints(void);
int rb_thread_interrupted(VALUE thval);
-/* 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);
@@ -879,8 +920,10 @@ 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);
/* time.c */
+void rb_timespec_now(struct timespec *);
VALUE rb_time_new(time_t, long);
VALUE rb_time_nano_new(time_t, long);
+VALUE rb_time_timespec_new(const struct timespec *, int);
VALUE rb_time_num_new(VALUE, VALUE);
struct timeval rb_time_interval(VALUE num);
struct timeval rb_time_timeval(VALUE time);
@@ -895,14 +938,14 @@ VALUE rb_path_to_class(VALUE);
VALUE rb_path2class(const char*);
void rb_name_class(VALUE, ID);
VALUE rb_class_name(VALUE);
-void rb_autoload(VALUE, ID, const char*);
+DEPRECATED(void rb_autoload(VALUE, ID, const char*));
VALUE rb_autoload_load(VALUE, ID);
VALUE rb_autoload_p(VALUE, ID);
-VALUE rb_f_trace_var(int, VALUE*);
-VALUE rb_f_untrace_var(int, VALUE*);
+VALUE rb_f_trace_var(int, const VALUE*);
+VALUE rb_f_untrace_var(int, const VALUE*);
VALUE rb_f_global_variables(void);
void rb_alias_variable(ID, ID);
-struct st_table* rb_generic_ivar_table(VALUE);
+DEPRECATED(struct st_table* rb_generic_ivar_table(VALUE));
void rb_copy_generic_ivar(VALUE,VALUE);
void rb_free_generic_ivar(VALUE);
VALUE rb_ivar_get(VALUE, ID);
@@ -916,7 +959,7 @@ VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
void *rb_mod_const_at(VALUE, void*);
void *rb_mod_const_of(VALUE, void*);
VALUE rb_const_list(void*);
-VALUE rb_mod_constants(int, VALUE *, VALUE);
+VALUE rb_mod_constants(int, const VALUE *, VALUE);
VALUE rb_mod_remove_const(VALUE, VALUE);
int rb_const_defined(VALUE, ID);
int rb_const_defined_at(VALUE, ID);
@@ -933,16 +976,19 @@ 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(int, VALUE*, VALUE);
+VALUE rb_mod_class_variables(int, const VALUE*, VALUE);
VALUE rb_mod_remove_cvar(VALUE, VALUE);
ID rb_frame_callee(void);
VALUE rb_str_succ(VALUE);
VALUE rb_time_succ(VALUE);
-void rb_frame_pop(void);
int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
VALUE rb_make_backtrace(void);
-VALUE rb_make_exception(int, VALUE*);
+VALUE rb_make_exception(int, const VALUE*);
+
+/* deprecated */
+DEPRECATED(void rb_frame_pop(void));
+
RUBY_SYMBOL_EXPORT_END
diff --git a/include/ruby/io.h b/include/ruby/io.h
index 23337679f0..029522bedc 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -51,16 +51,17 @@ extern "C" {
RUBY_SYMBOL_EXPORT_BEGIN
-typedef struct {
+PACKED_STRUCT_UNALIGNED(struct rb_io_buffer_t {
char *ptr; /* off + len <= capa */
int off;
int len;
int capa;
-} rb_io_buffer_t;
+});
+typedef struct rb_io_buffer_t rb_io_buffer_t;
typedef struct rb_io_t {
- int fd; /* file descriptor */
FILE *stdio_file; /* stdio ptr for read/write if available */
+ int fd; /* file descriptor */
int mode; /* mode flags: FMODE_XXXs */
rb_pid_t pid; /* child's pid (for pipes) */
int lineno; /* number of lines read */
@@ -89,9 +90,9 @@ typedef struct rb_io_t {
rb_econv_t *writeconv;
VALUE writeconv_asciicompat;
+ int writeconv_initialized;
int writeconv_pre_ecflags;
VALUE writeconv_pre_ecopts;
- int writeconv_initialized;
VALUE write_lock;
} rb_io_t;
@@ -108,59 +109,30 @@ typedef struct rb_io_t {
#define FMODE_APPEND 0x00000040
#define FMODE_CREATE 0x00000080
/* #define FMODE_NOREVLOOKUP 0x00000100 */
-#define FMODE_WSPLIT 0x00000200
-#define FMODE_WSPLIT_INITIALIZED 0x00000400
#define FMODE_TRUNC 0x00000800
#define FMODE_TEXTMODE 0x00001000
/* #define FMODE_PREP 0x00010000 */
#define FMODE_SETENC_BY_BOM 0x00100000
+/* #define FMODE_UNIX 0x00200000 */
+/* #define FMODE_INET 0x00400000 */
+/* #define FMODE_INET6 0x00800000 */
#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
#define RB_IO_BUFFER_INIT(buf) do {\
- (buf).ptr = NULL;\
- (buf).off = 0;\
- (buf).len = 0;\
- (buf).capa = 0;\
+ [<"internal macro RB_IO_BUFFER_INIT() is used">];\
} while (0)
#define MakeOpenFile(obj, fp) do {\
- if (RFILE(obj)->fptr) {\
- rb_io_close(obj);\
- rb_io_fptr_finalize(RFILE(obj)->fptr);\
- RFILE(obj)->fptr = 0;\
- }\
- (fp) = 0;\
- RB_IO_FPTR_NEW(fp);\
- RFILE(obj)->fptr = (fp);\
+ (fp) = rb_io_make_open_file(obj);\
} while (0)
#define RB_IO_FPTR_NEW(fp) do {\
- (fp) = ALLOC(rb_io_t);\
- (fp)->fd = -1;\
- (fp)->stdio_file = NULL;\
- (fp)->mode = 0;\
- (fp)->pid = 0;\
- (fp)->lineno = 0;\
- (fp)->pathv = Qnil;\
- (fp)->finalize = 0;\
- RB_IO_BUFFER_INIT((fp)->wbuf);\
- RB_IO_BUFFER_INIT((fp)->rbuf);\
- RB_IO_BUFFER_INIT((fp)->cbuf);\
- (fp)->readconv = NULL;\
- (fp)->writeconv = NULL;\
- (fp)->writeconv_asciicompat = Qnil;\
- (fp)->writeconv_pre_ecflags = 0;\
- (fp)->writeconv_pre_ecopts = Qnil;\
- (fp)->writeconv_initialized = 0;\
- (fp)->tied_io_for_writing = 0;\
- (fp)->encs.enc = NULL;\
- (fp)->encs.enc2 = NULL;\
- (fp)->encs.ecflags = 0;\
- (fp)->encs.ecopts = Qnil;\
- (fp)->write_lock = 0;\
+ [<"internal macro RB_IO_FPTR_NEW() is used">];\
} while (0)
+rb_io_t *rb_io_make_open_file(VALUE obj);
+
FILE *rb_io_stdio_file(rb_io_t *fptr);
FILE *rb_fdopen(int, const char*);
@@ -187,15 +159,14 @@ int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
/* compatibility for ruby 1.8 and older */
-#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr)
-#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags)
+#define rb_io_mode_flags(modestr) [<"rb_io_mode_flags() is obsolete; use rb_io_modestr_fmode()">]
+#define rb_io_modenum_flags(oflags) [<"rb_io_modenum_flags() is obsolete; use rb_io_oflags_fmode()">]
VALUE rb_io_taint_check(VALUE);
NORETURN(void rb_eof_error(void));
void rb_io_read_check(rb_io_t*);
int rb_io_read_pending(rb_io_t*);
-DEPRECATED(void rb_read_check(FILE*));
struct stat;
VALUE rb_stat_new(const struct stat *);
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index 5dba4edda7..3474ca256f 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -21,6 +21,9 @@ extern "C" {
#include "ruby/config.h"
#include <stddef.h>
#include <math.h> /* for INFINITY and NAN */
+#ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
+# include RUBY_ALTERNATIVE_MALLOC_HEADER
+#endif
#ifdef RUBY_EXTCONF_H
#include RUBY_EXTCONF_H
#endif
@@ -34,6 +37,13 @@ extern "C" {
#endif
#endif
+#ifndef M_PI
+# define M_PI 3.14159265358979323846
+#endif
+#ifndef M_PI_2
+# define M_PI_2 (M_PI/2)
+#endif
+
#ifndef RUBY_SYMBOL_EXPORT_BEGIN
# define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
# define RUBY_SYMBOL_EXPORT_END /* end */
@@ -126,24 +136,20 @@ RUBY_EXTERN double lgamma_r(double, int *);
RUBY_EXTERN double cbrt(double);
#endif
-#if !defined(INFINITY) || !defined(NAN)
+#if !defined(HAVE_INFINITY) || !defined(HAVE_NAN)
union bytesequence4_or_float {
unsigned char bytesequence[4];
float float_value;
};
#endif
-#ifdef INFINITY
-# define HAVE_INFINITY
-#else
+#ifndef INFINITY
/** @internal */
RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
# define INFINITY (rb_infinity.float_value)
#endif
-#ifdef NAN
-# define HAVE_NAN
-#else
+#ifndef NAN
/** @internal */
RUBY_EXTERN const union bytesequence4_or_float rb_nan;
# define NAN (rb_nan.float_value)
@@ -168,6 +174,17 @@ RUBY_EXTERN int isnan(double);
# endif
#endif
+#ifndef isfinite
+# ifndef HAVE_ISFINITE
+# define HAVE_ISFINITE 1
+# define isfinite(x) finite(x)
+# endif
+#endif
+
+#ifndef HAVE_NEXTAFTER
+RUBY_EXTERN double nextafter(double x, double y);
+#endif
+
/*
#ifndef HAVE_MEMCMP
RUBY_EXTERN int memcmp(const void *, const void *, size_t);
@@ -232,6 +249,13 @@ RUBY_EXTERN int ruby_close(int);
RUBY_EXTERN void setproctitle(const char *fmt, ...);
#endif
+#ifndef HAVE_EXPLICIT_BZERO
+RUBY_EXTERN void explicit_bzero(void *b, size_t len);
+# if defined SecureZeroMemory
+# define explicit_bzero(b, len) SecureZeroMemory(b, len)
+# endif
+#endif
+
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h
index 6a26ee4aaa..519c0ac336 100644
--- a/include/ruby/oniguruma.h
+++ b/include/ruby/oniguruma.h
@@ -5,7 +5,7 @@
**********************************************************************/
/*-
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2013 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2011-2014 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,8 +39,8 @@ extern "C" {
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 5
-#define ONIGURUMA_VERSION_MINOR 13
-#define ONIGURUMA_VERSION_TEENY 5
+#define ONIGURUMA_VERSION_MINOR 15
+#define ONIGURUMA_VERSION_TEENY 0
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
@@ -156,29 +156,29 @@ typedef struct {
typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
typedef struct OnigEncodingTypeST {
- int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc);
+ int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, const struct OnigEncodingTypeST* enc);
const char* name;
int max_enc_len;
int min_enc_len;
- int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
- OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
- int (*code_to_mbclen)(OnigCodePoint code, struct OnigEncodingTypeST* enc);
- int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, struct OnigEncodingTypeST* enc);
- int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, struct OnigEncodingTypeST* enc);
- int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, struct OnigEncodingTypeST* enc);
- int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], struct OnigEncodingTypeST* enc);
- int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
- int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, struct OnigEncodingTypeST* enc);
- int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], struct OnigEncodingTypeST* enc);
- 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 (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc);
+ OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc);
+ int (*code_to_mbclen)(OnigCodePoint code, const struct OnigEncodingTypeST* enc);
+ int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, const struct OnigEncodingTypeST* enc);
+ int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, const struct OnigEncodingTypeST* enc);
+ int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, const struct OnigEncodingTypeST* enc);
+ int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], const struct OnigEncodingTypeST* enc);
+ int (*property_name_to_ctype)(const struct OnigEncodingTypeST* enc, const OnigUChar* p, const OnigUChar* end);
+ int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, const struct OnigEncodingTypeST* enc);
+ int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], const struct OnigEncodingTypeST* enc);
+ OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc);
+ int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc);
int ruby_encoding_index;
unsigned int flags;
} OnigEncodingType;
-typedef OnigEncodingType* OnigEncoding;
+typedef const OnigEncodingType* OnigEncoding;
-ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
+ONIG_EXTERN const OnigEncodingType OnigEncodingASCII;
#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
@@ -256,7 +256,7 @@ ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
#define ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e) (enc)->precise_mbc_enc_len(p,e,enc)
ONIG_EXTERN
-int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc));
+int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, const struct OnigEncodingTypeST* enc));
#define ONIGENC_MBC_ENC_LEN(enc,p,e) onigenc_mbclen_approximate(p,e,enc)
#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)
@@ -338,6 +338,7 @@ int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
/* config parameters */
#define ONIG_NREGION 10
#define ONIG_MAX_BACKREF_NUM 1000
+#define ONIG_MAX_CAPTURE_GROUP_NUM 32767
#define ONIG_MAX_REPEAT_NUM 100000
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
/* constants */
@@ -369,7 +370,9 @@ typedef unsigned int OnigOptionType;
#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_NOTBOS (ONIG_OPTION_NEWLINE_CRLF << 1)
+#define ONIG_OPTION_NOTEOS (ONIG_OPTION_NOTBOS << 1)
+#define ONIG_OPTION_MAXBIT ONIG_OPTION_NOTEOS /* limit */
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
@@ -582,6 +585,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_NEVER_ENDING_RECURSION -221
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
+#define ONIGERR_TOO_MANY_CAPTURE_GROUPS -224
#define ONIGERR_INVALID_CODE_POINT_VALUE -400
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
@@ -670,13 +674,15 @@ typedef struct re_pattern_buffer {
unsigned int bt_mem_end; /* need backtrack flag */
int stack_pop_level;
int repeat_range_alloc;
+
+ OnigOptionType options;
+
OnigRepeatRange* repeat_range;
OnigEncoding enc;
- OnigOptionType options;
const OnigSyntaxType* syntax;
- OnigCaseFoldType case_fold_flag;
void* name_table;
+ OnigCaseFoldType case_fold_flag;
/* optimization info (string search, char-map and anchors) */
int optimize; /* optimize flag */
@@ -708,7 +714,7 @@ typedef struct {
int num_of_elements;
OnigEncoding pattern_enc;
OnigEncoding target_enc;
- OnigSyntaxType* syntax;
+ const OnigSyntaxType* syntax;
OnigOptionType option;
OnigCaseFoldType case_fold_flag;
} OnigCompileInfo;
@@ -807,7 +813,7 @@ void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options)
ONIG_EXTERN
int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));
ONIG_EXTERN
-void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
+void onig_copy_encoding P_((OnigEncodingType *to, OnigEncoding from));
ONIG_EXTERN
OnigCaseFoldType onig_get_default_case_fold_flag P_((void));
ONIG_EXTERN
diff --git a/include/ruby/re.h b/include/ruby/re.h
index 41b3e492f8..166f254aa5 100644
--- a/include/ruby/re.h
+++ b/include/ruby/re.h
@@ -58,6 +58,7 @@ long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
void rb_match_busy(VALUE);
VALUE rb_reg_quote(VALUE);
regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
+int rb_reg_region_copy(struct re_registers *, const struct re_registers *);
RUBY_SYMBOL_EXPORT_END
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 95965d6b6a..dccfdc763a 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -26,6 +26,13 @@ extern "C" {
#include RUBY_EXTCONF_H
#endif
+#if defined(__cplusplus)
+/* __builtin_choose_expr and __builtin_types_compatible aren't available
+ * on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */
+# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
+# undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P
+#endif
+
#include "defines.h"
#define NORETURN_STYLE_NEW 1
@@ -35,11 +42,24 @@ extern "C" {
#ifndef DEPRECATED
# define DEPRECATED(x) x
#endif
+#ifndef DEPRECATED_BY
+# define DEPRECATED_BY(n,x) DEPRECATED(x)
+#endif
+#ifndef DEPRECATED_TYPE
+# define DEPRECATED_TYPE(mesg, decl) decl
+#endif
#ifndef NOINLINE
# define NOINLINE(x) x
#endif
+#ifndef ASSUME
+# ifdef UNREACHABLE
+# define ASSUME(x) (LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
+# else
+# define ASSUME(x) ((void)(x))
+# endif
+#endif
#ifndef UNREACHABLE
-# define UNREACHABLE /* unreachable */
+# define UNREACHABLE ((void)0) /* unreachable */
#endif
#ifdef __GNUC__
@@ -49,6 +69,8 @@ extern "C" {
#define PRINTF_ARGS(decl, string_index, first_to_check) decl
#endif
+#define RUBY_MACRO_SELECT(base, n) TOKEN_PASTE(base, n)
+
#ifdef HAVE_INTRINSICS_H
# include <intrinsics.h>
#endif
@@ -121,20 +143,21 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
#define PRI_64_PREFIX PRI_LL_PREFIX
#endif
+#define RUBY_PRI_VALUE_MARK "\v"
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
#define PRIdVALUE PRIdPTR
#define PRIoVALUE PRIoPTR
#define PRIuVALUE PRIuPTR
#define PRIxVALUE PRIxPTR
#define PRIXVALUE PRIXPTR
-#define PRIsVALUE PRIiPTR
+#define PRIsVALUE PRIiPTR"" RUBY_PRI_VALUE_MARK
#else
#define PRIdVALUE PRI_VALUE_PREFIX"d"
#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"
+#define PRIsVALUE PRI_VALUE_PREFIX"i" RUBY_PRI_VALUE_MARK
#endif
#ifndef PRI_VALUE_PREFIX
# define PRI_VALUE_PREFIX ""
@@ -225,10 +248,12 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
# endif
#endif
-#define FIXNUM_MAX (LONG_MAX>>1)
-#define FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
+#define RUBY_FIXNUM_MAX (LONG_MAX>>1)
+#define RUBY_FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
+#define FIXNUM_MAX RUBY_FIXNUM_MAX
+#define FIXNUM_MIN RUBY_FIXNUM_MIN
-#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
+#define INT2FIX(i) (((VALUE)(i))<<1 | RUBY_FIXNUM_FLAG)
#define LONG2FIX(i) INT2FIX(i)
#define rb_fix_new(v) INT2FIX(v)
VALUE rb_int2inum(SIGNED_VALUE);
@@ -342,18 +367,44 @@ rb_long2int_inline(long n)
#define MODET2NUM(v) INT2NUM(v)
#endif
-#define FIX2LONG(x) ((long)RSHIFT((SIGNED_VALUE)(x),1))
-#define FIX2ULONG(x) ((unsigned long)FIX2LONG(x))
-#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))
-
-#define IMMEDIATE_P(x) ((VALUE)(x) & IMMEDIATE_MASK)
-
-#define SYMBOL_P(x) (((VALUE)(x)&~((~(VALUE)0)<<RUBY_SPECIAL_SHIFT))==SYMBOL_FLAG)
-#define ID2SYM(x) (((VALUE)(x)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
-#define SYM2ID(x) RSHIFT((unsigned long)(x),RUBY_SPECIAL_SHIFT)
+#define RB_FIX2LONG(x) ((long)RSHIFT((SIGNED_VALUE)(x),1))
+static inline long
+rb_fix2long(VALUE x)
+{
+ return RB_FIX2LONG(x);
+}
+#define RB_FIX2ULONG(x) ((unsigned long)RB_FIX2LONG(x))
+static inline unsigned long
+rb_fix2ulong(VALUE x)
+{
+ return RB_FIX2ULONG(x);
+}
+#define RB_FIXNUM_P(f) (((int)(SIGNED_VALUE)(f))&RUBY_FIXNUM_FLAG)
+#define RB_POSFIXABLE(f) ((f) < RUBY_FIXNUM_MAX+1)
+#define RB_NEGFIXABLE(f) ((f) >= RUBY_FIXNUM_MIN)
+#define RB_FIXABLE(f) (RB_POSFIXABLE(f) && RB_NEGFIXABLE(f))
+#define FIX2LONG(x) RB_FIX2LONG(x)
+#define FIX2ULONG(x) RB_FIX2ULONG(x)
+#define FIXNUM_P(f) RB_FIXNUM_P(f)
+#define POSFIXABLE(f) RB_POSFIXABLE(f)
+#define NEGFIXABLE(f) RB_NEGFIXABLE(f)
+#define FIXABLE(f) RB_FIXABLE(f)
+
+#define RB_IMMEDIATE_P(x) ((VALUE)(x) & RUBY_IMMEDIATE_MASK)
+#define IMMEDIATE_P(x) RB_IMMEDIATE_P(x)
+
+ID rb_sym2id(VALUE);
+VALUE rb_id2sym(ID);
+#define RB_STATIC_SYM_P(x) (((VALUE)(x)&~((~(VALUE)0)<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG)
+#define RB_DYNAMIC_SYM_P(x) (!RB_SPECIAL_CONST_P(x) && RB_BUILTIN_TYPE(x) == (RUBY_T_SYMBOL))
+#define RB_SYMBOL_P(x) (RB_STATIC_SYM_P(x)||RB_DYNAMIC_SYM_P(x))
+#define RB_ID2SYM(x) (rb_id2sym(x))
+#define RB_SYM2ID(x) (rb_sym2id(x))
+#define STATIC_SYM_P(x) RB_STATIC_SYM_P(x)
+#define DYNAMIC_SYM_P(x) RB_DYNAMIC_SYM_P(x)
+#define SYMBOL_P(x) RB_SYMBOL_P(x)
+#define ID2SYM(x) RB_ID2SYM(x)
+#define SYM2ID(x) RB_SYM2ID(x)
#ifndef USE_FLONUM
#if SIZEOF_VALUE >= SIZEOF_DOUBLE
@@ -364,62 +415,41 @@ rb_long2int_inline(long n)
#endif
#if USE_FLONUM
-#define FLONUM_P(x) ((((int)(SIGNED_VALUE)(x))&FLONUM_MASK) == FLONUM_FLAG)
+#define RB_FLONUM_P(x) ((((int)(SIGNED_VALUE)(x))&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG)
#else
-#define FLONUM_P(x) 0
+#define RB_FLONUM_P(x) 0
#endif
+#define FLONUM_P(x) RB_FLONUM_P(x)
/* 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_Qfalse = 0x00, /* ...0000 0000 */
+ RUBY_Qtrue = 0x14, /* ...0001 0100 */
+ RUBY_Qnil = 0x08, /* ...0000 1000 */
+ RUBY_Qundef = 0x34, /* ...0011 0100 */
RUBY_IMMEDIATE_MASK = 0x07,
- RUBY_FIXNUM_FLAG = 0x01,
+ RUBY_FIXNUM_FLAG = 0x01, /* ...xxxx xxx1 */
RUBY_FLONUM_MASK = 0x03,
- RUBY_FLONUM_FLAG = 0x02,
- RUBY_SYMBOL_FLAG = 0x0c,
- RUBY_SPECIAL_SHIFT = 8
+ RUBY_FLONUM_FLAG = 0x02, /* ...xxxx xx10 */
+ RUBY_SYMBOL_FLAG = 0x0c, /* ...0000 1100 */
#else
- RUBY_Qfalse = 0,
- RUBY_Qtrue = 2,
- RUBY_Qnil = 4,
- RUBY_Qundef = 6,
+ RUBY_Qfalse = 0, /* ...0000 0000 */
+ RUBY_Qtrue = 2, /* ...0000 0010 */
+ RUBY_Qnil = 4, /* ...0000 0100 */
+ RUBY_Qundef = 6, /* ...0000 0110 */
RUBY_IMMEDIATE_MASK = 0x03,
- RUBY_FIXNUM_FLAG = 0x01,
+ RUBY_FIXNUM_FLAG = 0x01, /* ...xxxx xxx1 */
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
+ RUBY_SYMBOL_FLAG = 0x0e, /* ...0000 1110 */
#endif
+ RUBY_SPECIAL_SHIFT = 8
};
#define Qfalse ((VALUE)RUBY_Qfalse)
@@ -463,11 +493,12 @@ enum ruby_value_type {
RUBY_T_FALSE = 0x13,
RUBY_T_SYMBOL = 0x14,
RUBY_T_FIXNUM = 0x15,
+ RUBY_T_UNDEF = 0x16,
- RUBY_T_UNDEF = 0x1b,
- RUBY_T_NODE = 0x1c,
- RUBY_T_ICLASS = 0x1d,
- RUBY_T_ZOMBIE = 0x1e,
+ RUBY_T_IMEMO = 0x1a,
+ RUBY_T_NODE = 0x1b,
+ RUBY_T_ICLASS = 0x1c,
+ RUBY_T_ZOMBIE = 0x1d,
RUBY_T_MASK = 0x1f
};
@@ -494,33 +525,49 @@ enum ruby_value_type {
#define T_SYMBOL RUBY_T_SYMBOL
#define T_RATIONAL RUBY_T_RATIONAL
#define T_COMPLEX RUBY_T_COMPLEX
+#define T_IMEMO RUBY_T_IMEMO
#define T_UNDEF RUBY_T_UNDEF
#define T_NODE RUBY_T_NODE
#define T_ZOMBIE RUBY_T_ZOMBIE
#define T_MASK RUBY_T_MASK
-#define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
+#define RB_BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & RUBY_T_MASK)
+#define BUILTIN_TYPE(x) RB_BUILTIN_TYPE(x)
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 */
+#define RB_FLOAT_TYPE_P(obj) (\
+ RB_FLONUM_P(obj) || \
+ (!RB_SPECIAL_CONST_P(obj) && RB_BUILTIN_TYPE(obj) == RUBY_T_FLOAT))
+
+#define RB_TYPE_P(obj, type) ( \
+ ((type) == RUBY_T_FIXNUM) ? RB_FIXNUM_P(obj) : \
+ ((type) == RUBY_T_TRUE) ? ((obj) == RUBY_Qtrue) : \
+ ((type) == RUBY_T_FALSE) ? ((obj) == RUBY_Qfalse) : \
+ ((type) == RUBY_T_NIL) ? ((obj) == RUBY_Qnil) : \
+ ((type) == RUBY_T_UNDEF) ? ((obj) == RUBY_Qundef) : \
+ ((type) == RUBY_T_SYMBOL) ? RB_SYMBOL_P(obj) : \
+ ((type) == RUBY_T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \
+ (!RB_SPECIAL_CONST_P(obj) && RB_BUILTIN_TYPE(obj) == (type)))
+
#ifdef __GNUC__
-#define RB_GC_GUARD_PTR(ptr) \
- __extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;})
-#else
-#ifdef _MSC_VER
+#define RB_GC_GUARD(v) \
+ (*__extension__ ({ \
+ volatile VALUE *rb_gc_guarded_ptr = &(v); \
+ __asm__("" : : "m"(rb_gc_guarded_ptr)); \
+ rb_gc_guarded_ptr; \
+ }))
+#elif defined _MSC_VER
#pragma optimize("", off)
static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
#pragma optimize("", on)
+#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr(&(v)))
#else
-volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr);
-#define HAVE_RB_GC_GUARDED_PTR 1
-#endif
-#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
+volatile VALUE *rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val);
+#define HAVE_RB_GC_GUARDED_PTR_VAL 1
+#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr_val(&(v),(v)))
#endif
-#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
#ifdef __GNUC__
#define RB_UNUSED_VAR(x) x __attribute__ ((unused))
@@ -541,13 +588,17 @@ char *rb_string_value_cstr(volatile VALUE*);
#define StringValueCStr(v) rb_string_value_cstr(&(v))
void rb_check_safe_obj(VALUE);
-DEPRECATED(void rb_check_safe_str(VALUE));
#define SafeStringValue(v) do {\
StringValue(v);\
rb_check_safe_obj(v);\
} while (0)
-/* obsolete macro - use SafeStringValue(v) */
-#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+void rb_check_safe_str(VALUE) __attribute__((error("rb_check_safe_str() and Check_SafeStr() are obsolete; use SafeStringValue() instead")));
+# define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
+#else
+# define rb_check_safe_str(x) [<"rb_check_safe_str() is obsolete; use SafeStringValue() instead">]
+# define Check_SafeStr(v) [<"Check_SafeStr() is obsolete; use SafeStringValue() instead">]
+#endif
VALUE rb_str_export(VALUE);
#define ExportStringValue(v) do {\
@@ -562,21 +613,34 @@ VALUE rb_get_path(VALUE);
VALUE rb_get_path_no_checksafe(VALUE);
#define FilePathStringValue(v) ((v) = rb_get_path_no_checksafe(v))
-#define RUBY_SAFE_LEVEL_MAX 3
+#define RUBY_SAFE_LEVEL_MAX 1
void rb_secure(int);
int rb_safe_level(void);
void rb_set_safe_level(int);
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
-int ruby_safe_level_4_error(void) __attribute__((error("$SAFE=4 is obsolete")));
-int ruby_safe_level_4_warning(void) __attribute__((warning("$SAFE=4 is obsolete")));
+int ruby_safe_level_2_error(void) __attribute__((error("$SAFE=2 to 4 are obsolete")));
+int ruby_safe_level_2_warning(void) __attribute__((warning("$SAFE=2 to 4 are obsolete")));
# ifdef RUBY_EXPORT
-# define ruby_safe_level_4_warning() ruby_safe_level_4_error()
+# define ruby_safe_level_2_warning() ruby_safe_level_2_error()
# endif
-#define RUBY_SAFE_LEVEL_INVALID_P(level) \
+#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
+# define RUBY_SAFE_LEVEL_INVALID_P(level) \
+ __extension__(\
+ __builtin_choose_expr(\
+ __builtin_constant_p(level), \
+ ((level) < 0 || RUBY_SAFE_LEVEL_MAX < (level)), 0))
+# define RUBY_SAFE_LEVEL_CHECK(level, type) \
+ __extension__(__builtin_choose_expr(RUBY_SAFE_LEVEL_INVALID_P(level), ruby_safe_level_2_##type(), (level)))
+#else
+/* in gcc 4.8 or earlier, __builtin_choose_expr() does not consider
+ * __builtin_constant_p(variable) a constant expression.
+ */
+# define RUBY_SAFE_LEVEL_INVALID_P(level) \
__extension__(__builtin_constant_p(level) && \
((level) < 0 || RUBY_SAFE_LEVEL_MAX < (level)))
-#define RUBY_SAFE_LEVEL_CHECK(level, type) \
- (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_4_##type() : (level))
+# define RUBY_SAFE_LEVEL_CHECK(level, type) \
+ (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_2_##type() : (level))
+#endif
#define rb_secure(level) rb_secure(RUBY_SAFE_LEVEL_CHECK(level, warning))
#define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level, error))
#endif
@@ -587,68 +651,77 @@ NORETURN(void rb_insecure_operation(void));
VALUE rb_errinfo(void);
void rb_set_errinfo(VALUE);
-SIGNED_VALUE rb_num2long(VALUE);
-VALUE rb_num2ulong(VALUE);
+long rb_num2long(VALUE);
+unsigned long rb_num2ulong(VALUE);
static inline long
rb_num2long_inline(VALUE x)
{
- if (FIXNUM_P(x))
- return FIX2LONG(x);
+ if (RB_FIXNUM_P(x))
+ return RB_FIX2LONG(x);
else
- return (long)rb_num2long(x);
+ return rb_num2long(x);
}
-#define NUM2LONG(x) rb_num2long_inline(x)
+#define RB_NUM2LONG(x) rb_num2long_inline(x)
+#define NUM2LONG(x) RB_NUM2LONG(x)
static inline unsigned long
rb_num2ulong_inline(VALUE x)
{
- if (FIXNUM_P(x))
- return (unsigned long)FIX2LONG(x);
+ if (RB_FIXNUM_P(x))
+ return RB_FIX2ULONG(x);
else
- return (unsigned long)rb_num2ulong(x);
+ return rb_num2ulong(x);
}
-#define NUM2ULONG(x) rb_num2ulong_inline(x)
+#define RB_NUM2ULONG(x) rb_num2ulong_inline(x)
+#define NUM2ULONG(x) RB_NUM2ULONG(x)
#if SIZEOF_INT < SIZEOF_LONG
long rb_num2int(VALUE);
long rb_fix2int(VALUE);
-#define FIX2INT(x) ((int)rb_fix2int((VALUE)(x)))
+#define RB_FIX2INT(x) ((int)rb_fix2int((VALUE)(x)))
static inline int
rb_num2int_inline(VALUE x)
{
- if (FIXNUM_P(x))
- return FIX2INT(x);
+ if (RB_FIXNUM_P(x))
+ return (int)rb_fix2int(x);
else
return (int)rb_num2int(x);
}
-#define NUM2INT(x) rb_num2int_inline(x)
+#define RB_NUM2INT(x) rb_num2int_inline(x)
unsigned long rb_num2uint(VALUE);
-#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
+#define RB_NUM2UINT(x) ((unsigned int)rb_num2uint(x))
unsigned long rb_fix2uint(VALUE);
-#define FIX2UINT(x) ((unsigned int)rb_fix2uint(x))
+#define RB_FIX2UINT(x) ((unsigned int)rb_fix2uint(x))
#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))
+#define RB_NUM2INT(x) ((int)RB_NUM2LONG(x))
+#define RB_NUM2UINT(x) ((unsigned int)RB_NUM2ULONG(x))
+#define RB_FIX2INT(x) ((int)RB_FIX2LONG(x))
+#define RB_FIX2UINT(x) ((unsigned int)RB_FIX2ULONG(x))
#endif /* SIZEOF_INT < SIZEOF_LONG */
+#define NUM2INT(x) RB_NUM2INT(x)
+#define NUM2UINT(x) RB_NUM2UINT(x)
+#define FIX2INT(x) RB_FIX2INT(x)
+#define FIX2UINT(x) RB_FIX2UINT(x)
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)))
+#define RB_FIX2SHORT(x) (rb_fix2short((VALUE)(x)))
+#define FIX2SHORT(x) RB_FIX2SHORT(x)
static inline short
rb_num2short_inline(VALUE x)
{
- if (FIXNUM_P(x))
- return FIX2SHORT(x);
+ if (RB_FIXNUM_P(x))
+ return rb_fix2short(x);
else
return rb_num2short(x);
}
-#define NUM2SHORT(x) rb_num2short_inline(x)
-#define NUM2USHORT(x) rb_num2ushort(x)
+#define RB_NUM2SHORT(x) rb_num2short_inline(x)
+#define RB_NUM2USHORT(x) rb_num2ushort(x)
+#define NUM2SHORT(x) RB_NUM2SHORT(x)
+#define NUM2USHORT(x) RB_NUM2USHORT(x)
#ifdef HAVE_LONG_LONG
LONG_LONG rb_num2ll(VALUE);
@@ -656,13 +729,15 @@ unsigned LONG_LONG rb_num2ull(VALUE);
static inline LONG_LONG
rb_num2ll_inline(VALUE x)
{
- if (FIXNUM_P(x))
- return FIX2LONG(x);
+ if (RB_FIXNUM_P(x))
+ return RB_FIX2LONG(x);
else
return rb_num2ll(x);
}
-# define NUM2LL(x) rb_num2ll_inline(x)
-# define NUM2ULL(x) rb_num2ull(x)
+# define RB_NUM2LL(x) rb_num2ll_inline(x)
+# define RB_NUM2ULL(x) rb_num2ull(x)
+# define NUM2LL(x) RB_NUM2LL(x)
+# define NUM2ULL(x) RB_NUM2ULL(x)
#endif
#if !defined(NUM2OFFT)
@@ -690,21 +765,23 @@ VALUE rb_int2big(SIGNED_VALUE);
VALUE rb_newobj(void);
VALUE rb_newobj_of(VALUE, VALUE);
VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type);
-#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 RB_NEWOBJ(obj,type) type *(obj) = (type*)rb_newobj()
+#define RB_NEWOBJ_OF(obj,type,klass,flags) type *(obj) = (type*)rb_newobj_of(klass, flags)
+#define NEWOBJ(obj,type) RB_NEWOBJ(obj,type)
+#define NEWOBJ_OF(obj,type,klass,flags) RB_NEWOBJ_OF(obj,type,klass,flags) /* core has special NEWOBJ_OF() in internal.h */
#define OBJSETUP(obj,c,t) rb_obj_setup(obj, c, t) /* use NEWOBJ_OF instead of NEWOBJ()+OBJSETUP() */
-#define CLONESETUP(clone,obj) do {\
- OBJSETUP((clone),rb_singleton_class_clone((VALUE)(obj)),RBASIC(obj)->flags);\
- rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)(clone));\
- if (FL_TEST((obj), FL_EXIVAR)) rb_copy_generic_ivar((VALUE)(clone),(VALUE)(obj));\
-} while (0)
-#define DUPSETUP(dup,obj) do {\
- OBJSETUP((dup),rb_obj_class(obj), (RBASIC(obj)->flags)&(T_MASK|FL_EXIVAR|FL_TAINT)); \
- if (FL_TEST((obj), FL_EXIVAR)) rb_copy_generic_ivar((VALUE)(dup),(VALUE)(obj));\
-} while (0)
+#define CLONESETUP(clone,obj) rb_clone_setup(clone,obj)
+#define DUPSETUP(dup,obj) rb_dup_setup(dup,obj)
#ifndef USE_RGENGC
#define USE_RGENGC 1
+#ifndef USE_RINCGC
+#define USE_RINCGC 1
+#endif
+#endif
+
+#if USE_RGENGC == 0
+#define USE_RINCGC 0
#endif
#ifndef RGENGC_WB_PROTECTED_ARRAY
@@ -744,6 +821,50 @@ VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type);
#define RGENGC_WB_PROTECTED_NODE_CREF 1
#endif
+enum ruby_fl_type {
+ RUBY_FL_WB_PROTECTED = (1<<5),
+ RUBY_FL_PROMOTED0 = (1<<5),
+ RUBY_FL_PROMOTED1 = (1<<6),
+ RUBY_FL_PROMOTED = RUBY_FL_PROMOTED0|RUBY_FL_PROMOTED1,
+ RUBY_FL_FINALIZE = (1<<7),
+ RUBY_FL_TAINT = (1<<8),
+ RUBY_FL_UNTRUSTED = RUBY_FL_TAINT,
+ RUBY_FL_EXIVAR = (1<<10),
+ RUBY_FL_FREEZE = (1<<11),
+
+ RUBY_FL_USHIFT = 12,
+
+#define RUBY_FL_USER_N(n) RUBY_FL_USER##n = (1<<(RUBY_FL_USHIFT+n))
+ RUBY_FL_USER_N(0),
+ RUBY_FL_USER_N(1),
+ RUBY_FL_USER_N(2),
+ RUBY_FL_USER_N(3),
+ RUBY_FL_USER_N(4),
+ RUBY_FL_USER_N(5),
+ RUBY_FL_USER_N(6),
+ RUBY_FL_USER_N(7),
+ RUBY_FL_USER_N(8),
+ RUBY_FL_USER_N(9),
+ RUBY_FL_USER_N(10),
+ RUBY_FL_USER_N(11),
+ RUBY_FL_USER_N(12),
+ RUBY_FL_USER_N(13),
+ RUBY_FL_USER_N(14),
+ RUBY_FL_USER_N(15),
+ RUBY_FL_USER_N(16),
+ RUBY_FL_USER_N(17),
+ RUBY_FL_USER_N(18),
+#if defined ENUM_OVER_INT || SIZEOF_INT*CHAR_BIT>12+19+1
+ RUBY_FL_USER_N(19),
+#else
+#define RUBY_FL_USER19 (((VALUE)1)<<(RUBY_FL_USHIFT+19))
+#endif
+
+ RUBY_ELTS_SHARED = RUBY_FL_USER2,
+ RUBY_FL_DUPPED = (RUBY_T_MASK|RUBY_FL_EXIVAR|RUBY_FL_TAINT),
+ RUBY_FL_SINGLETON = RUBY_FL_USER0
+};
+
struct RBasic {
VALUE flags;
const VALUE klass;
@@ -756,21 +877,40 @@ struct RBasic {
VALUE rb_obj_hide(VALUE obj);
VALUE rb_obj_reveal(VALUE obj, VALUE klass); /* do not use this API to change klass information */
+#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
+# define RB_OBJ_WB_UNPROTECT_FOR(type, obj) \
+ __extension__( \
+ __builtin_choose_expr( \
+ RGENGC_WB_PROTECTED_##type, \
+ OBJ_WB_UNPROTECT((VALUE)(obj)), ((VALUE)(obj))))
+#else
+# define RB_OBJ_WB_UNPROTECT_FOR(type, obj) \
+ (RGENGC_WB_PROTECTED_##type ? \
+ OBJ_WB_UNPROTECT((VALUE)(obj)) : ((VALUE)(obj)))
+#endif
+
#define RBASIC_CLASS(obj) (RBASIC(obj)->klass)
-#define ROBJECT_EMBED_LEN_MAX 3
+#define ROBJECT_EMBED_LEN_MAX ROBJECT_EMBED_LEN_MAX
+#define ROBJECT_EMBED ROBJECT_EMBED
+enum {
+ ROBJECT_EMBED_LEN_MAX = 3,
+ ROBJECT_EMBED = RUBY_FL_USER1,
+
+ ROBJECT_ENUM_END
+};
+
struct RObject {
struct RBasic basic;
union {
struct {
- long numiv;
+ long numiv; /* only uses 32-bits */
VALUE *ivptr;
- struct st_table *iv_index_tbl; /* shortcut for RCLASS_IV_INDEX_TBL(rb_obj_class(obj)) */
+ void *iv_index_tbl; /* shortcut for RCLASS_IV_INDEX_TBL(rb_obj_class(obj)) */
} heap;
VALUE ary[ROBJECT_EMBED_LEN_MAX];
} as;
};
-#define ROBJECT_EMBED FL_USER1
#define ROBJECT_NUMIV(o) \
((RBASIC(o)->flags & ROBJECT_EMBED) ? \
ROBJECT_EMBED_LEN_MAX : \
@@ -784,27 +924,27 @@ struct RObject {
RCLASS_IV_INDEX_TBL(rb_obj_class(o)) : \
ROBJECT(o)->as.heap.iv_index_tbl)
-/** @internal */
-typedef struct rb_classext_struct rb_classext_t;
-
+#define RClass RClassDeprecated
+#ifndef __cplusplus
+DEPRECATED_TYPE(("RClass is internal use only"),
struct RClass {
struct RBasic basic;
- VALUE super;
- rb_classext_t *ptr;
- struct method_table_wrapper *m_tbl_wrapper;
-};
+});
+#endif
#define RCLASS_SUPER(c) rb_class_get_superclass(c)
#define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m)
#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
-#define RMODULE_INCLUDED_INTO_REFINEMENT FL_USER4
-
-struct RFloat {
- struct RBasic basic;
- double float_value;
+#define RMODULE_IS_OVERLAID RMODULE_IS_OVERLAID
+#define RMODULE_IS_REFINEMENT RMODULE_IS_REFINEMENT
+#define RMODULE_INCLUDED_INTO_REFINEMENT RMODULE_INCLUDED_INTO_REFINEMENT
+enum {
+ RMODULE_IS_OVERLAID = RUBY_FL_USER2,
+ RMODULE_IS_REFINEMENT = RUBY_FL_USER3,
+ RMODULE_INCLUDED_INTO_REFINEMENT = RUBY_FL_USER4,
+
+ RMODULE_ENUM_END
};
double rb_float_value(VALUE);
@@ -814,9 +954,24 @@ VALUE rb_float_new_in_heap(double);
#define RFLOAT_VALUE(v) rb_float_value(v)
#define DBL2NUM(dbl) rb_float_new(dbl)
-#define ELTS_SHARED FL_USER2
-
-#define RSTRING_EMBED_LEN_MAX ((int)((sizeof(VALUE)*3)/sizeof(char)-1))
+#define RUBY_ELTS_SHARED RUBY_ELTS_SHARED
+#define ELTS_SHARED RUBY_ELTS_SHARED
+
+#define RSTRING_NOEMBED RSTRING_NOEMBED
+#define RSTRING_EMBED_LEN_MASK RSTRING_EMBED_LEN_MASK
+#define RSTRING_EMBED_LEN_SHIFT RSTRING_EMBED_LEN_SHIFT
+#define RSTRING_EMBED_LEN_MAX RSTRING_EMBED_LEN_MAX
+#define RSTRING_FSTR RSTRING_FSTR
+enum {
+ RSTRING_NOEMBED = RUBY_FL_USER1,
+ RSTRING_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|
+ RUBY_FL_USER5|RUBY_FL_USER6),
+ RSTRING_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+2),
+ RSTRING_EMBED_LEN_MAX = (int)((sizeof(VALUE)*3)/sizeof(char)-1),
+ RSTRING_FSTR = RUBY_FL_USER17,
+
+ RSTRING_ENUM_END
+};
struct RString {
struct RBasic basic;
union {
@@ -831,10 +986,6 @@ struct RString {
char ary[RSTRING_EMBED_LEN_MAX + 1];
} as;
};
-#define RSTRING_NOEMBED FL_USER1
-#define RSTRING_FSTR FL_USER17
-#define RSTRING_EMBED_LEN_MASK (FL_USER2|FL_USER3|FL_USER4|FL_USER5|FL_USER6)
-#define RSTRING_EMBED_LEN_SHIFT (FL_USHIFT+2)
#define RSTRING_EMBED_LEN(str) \
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
(RSTRING_EMBED_LEN_MASK >> RSTRING_EMBED_LEN_SHIFT))
@@ -856,7 +1007,19 @@ struct RString {
((ptrvar) = RSTRING(str)->as.ary, (lenvar) = RSTRING_EMBED_LEN(str)) : \
((ptrvar) = RSTRING(str)->as.heap.ptr, (lenvar) = RSTRING(str)->as.heap.len))
-#define RARRAY_EMBED_LEN_MAX 3
+#define RARRAY_EMBED_FLAG RARRAY_EMBED_FLAG
+#define RARRAY_EMBED_LEN_MASK RARRAY_EMBED_LEN_MASK
+#define RARRAY_EMBED_LEN_MAX RARRAY_EMBED_LEN_MAX
+#define RARRAY_EMBED_LEN_SHIFT RARRAY_EMBED_LEN_SHIFT
+enum {
+ RARRAY_EMBED_LEN_MAX = 3,
+ RARRAY_EMBED_FLAG = RUBY_FL_USER1,
+ /* RUBY_FL_USER2 is for ELTS_SHARED */
+ RARRAY_EMBED_LEN_MASK = (RUBY_FL_USER4|RUBY_FL_USER3),
+ RARRAY_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+3),
+
+ RARRAY_ENUM_END
+};
struct RArray {
struct RBasic basic;
union {
@@ -871,22 +1034,12 @@ struct RArray {
const VALUE ary[RARRAY_EMBED_LEN_MAX];
} as;
};
-#define RARRAY_EMBED_FLAG FL_USER1
-/* FL_USER2 is for ELTS_SHARED */
-#define RARRAY_EMBED_LEN_MASK (FL_USER4|FL_USER3)
-#define RARRAY_EMBED_LEN_SHIFT (FL_USHIFT+3)
-#define RARRAY_LEN(a) \
- ((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? \
- (long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
- (RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT)) : \
- RARRAY(a)->as.heap.len)
-
+#define RARRAY_EMBED_LEN(a) \
+ (long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
+ (RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT))
+#define RARRAY_LEN(a) rb_array_len(a)
#define RARRAY_LENINT(ary) rb_long2int(RARRAY_LEN(ary))
-
-#define RARRAY_CONST_PTR(a) \
- ((const VALUE *)((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? \
- RARRAY(a)->as.ary : \
- RARRAY(a)->as.heap.ptr))
+#define RARRAY_CONST_PTR(a) rb_array_const_ptr(a)
#define RARRAY_PTR_USE_START(a) ((VALUE *)RARRAY_CONST_PTR(a))
#define RARRAY_PTR_USE_END(a) /* */
@@ -900,11 +1053,13 @@ struct RArray {
#define RARRAY_AREF(a, i) (RARRAY_CONST_PTR(a)[i])
#define RARRAY_ASET(a, i, v) do { \
- const VALUE _ary_ = (a); \
- RB_OBJ_WRITE(_ary_, &RARRAY_CONST_PTR(_ary_)[i], (v)); \
+ const VALUE _ary = (a); \
+ VALUE *ptr = (VALUE *)RARRAY_PTR_USE_START(_ary); \
+ RB_OBJ_WRITE(_ary, &ptr[i], (v)); \
+ RARRAY_PTR_USE_END(_ary); \
} while (0)
-#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RGENGC_WB_PROTECTED_ARRAY ? OBJ_WB_UNPROTECT((VALUE)a) : ((VALUE)a)))
+#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RB_OBJ_WB_UNPROTECT_FOR(ARRAY, a)))
struct RRegexp {
struct RBasic basic;
@@ -917,17 +1072,11 @@ struct RRegexp {
#define RREGEXP_SRC_LEN(r) RSTRING_LEN(RREGEXP(r)->src)
#define RREGEXP_SRC_END(r) RSTRING_END(RREGEXP(r)->src)
-struct RHash {
- struct RBasic basic;
- struct st_table *ntbl; /* possibly 0 */
- int iter_lev;
- const VALUE ifnone;
-};
/* RHASH_TBL allocates st_table if not available. */
#define RHASH_TBL(h) rb_hash_tbl(h)
-#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
-#define RHASH_IFNONE(h) (RHASH(h)->ifnone)
-#define RHASH_SIZE(h) (RHASH(h)->ntbl ? (st_index_t)RHASH(h)->ntbl->num_entries : 0)
+#define RHASH_ITER_LEV(h) rb_hash_iter_lev(h)
+#define RHASH_IFNONE(h) rb_hash_ifnone(h)
+#define RHASH_SIZE(h) NUM2SIZET(rb_hash_size(h))
#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone)
@@ -936,21 +1085,6 @@ struct RFile {
struct rb_io_t *fptr;
};
-struct RRational {
- struct RBasic basic;
- const VALUE num;
- const VALUE den;
-};
-
-#define RRATIONAL_SET_NUM(rat, n) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->num,(n))
-#define RRATIONAL_SET_DEN(rat, d) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->den,(d))
-
-struct RComplex {
- struct RBasic basic;
- const VALUE real;
- const VALUE imag;
-};
-
#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
@@ -975,7 +1109,7 @@ struct rb_data_type_struct {
const rb_data_type_t *parent;
void *data; /* This area can be used for any purpose
by a programmer who define the type. */
- VALUE flags; /* FL_WB_PROTECTED */
+ VALUE flags; /* RUBY_FL_WB_PROTECTED */
};
#define HAVE_TYPE_RB_DATA_TYPE_T 1
@@ -1000,8 +1134,17 @@ struct RTypedData {
*/
typedef void (*RUBY_DATA_FUNC)(void*);
-VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
-VALUE rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *);
+#ifndef RUBY_UNTYPED_DATA_WARNING
+# if defined RUBY_EXPORT
+# define RUBY_UNTYPED_DATA_WARNING 1
+# else
+# define RUBY_UNTYPED_DATA_WARNING 0
+# endif
+#endif
+VALUE rb_data_object_wrap(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
+VALUE rb_data_object_zalloc(VALUE,size_t,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
+VALUE rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *);
+VALUE rb_data_typed_object_zalloc(VALUE klass, size_t size, const rb_data_type_t *type);
int rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *parent);
int rb_typeddata_is_kind_of(VALUE, const rb_data_type_t *);
void *rb_check_typeddata(VALUE, const rb_data_type_t *);
@@ -1013,36 +1156,64 @@ void *rb_check_typeddata(VALUE, const rb_data_type_t *);
/* bits for rb_data_type_struct::flags */
#define RUBY_TYPED_FREE_IMMEDIATELY 1 /* TYPE field */
-#define RUBY_TYPED_WB_PROTECTED FL_WB_PROTECTED
+#define RUBY_TYPED_WB_PROTECTED RUBY_FL_WB_PROTECTED /* THIS FLAG DEPENDS ON Ruby version */
+#define RUBY_TYPED_PROMOTED1 RUBY_FL_PROMOTED1 /* THIS FLAG DEPENDS ON Ruby version */
#define Data_Wrap_Struct(klass,mark,free,sval)\
- rb_data_object_alloc((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
+ rb_data_object_wrap((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
+#define Data_Make_Struct0(result, klass, type, size, mark, free, sval) \
+ VALUE result = rb_data_object_zalloc((klass), (size), \
+ (RUBY_DATA_FUNC)(mark), \
+ (RUBY_DATA_FUNC)(free)); \
+ (void)((sval) = (type *)DATA_PTR(result));
+
+#ifdef __GNUC__
+#define Data_Make_Struct(klass,type,mark,free,sval) ({\
+ Data_Make_Struct0(data_struct_obj, klass, type, sizeof(type), mark, free, sval); \
+ data_struct_obj; \
+})
+#else
#define Data_Make_Struct(klass,type,mark,free,sval) (\
- (sval) = ALLOC(type),\
- memset((sval), 0, sizeof(type)),\
- Data_Wrap_Struct((klass),(mark),(free),(sval))\
+ rb_data_object_make((klass),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free),(void **)&(sval),sizeof(type)) \
)
+#endif
#define TypedData_Wrap_Struct(klass,data_type,sval)\
- rb_data_typed_object_alloc((klass),(sval),(data_type))
+ rb_data_typed_object_wrap((klass),(sval),(data_type))
+
+#define TypedData_Make_Struct0(result, klass, type, size, data_type, sval) \
+ VALUE result = rb_data_typed_object_zalloc(klass, size, data_type); \
+ (void)((sval) = (type *)DATA_PTR(result));
+#ifdef __GNUC__
+#define TypedData_Make_Struct(klass, type, data_type, sval) ({\
+ TypedData_Make_Struct0(data_struct_obj, klass, type, sizeof(type), data_type, sval); \
+ data_struct_obj; \
+})
+#else
#define TypedData_Make_Struct(klass, type, data_type, sval) (\
- (sval) = ALLOC(type),\
- memset((sval), 0, sizeof(type)),\
- TypedData_Wrap_Struct((klass),(data_type),(sval))\
+ rb_data_typed_object_make((klass),(data_type),(void **)&(sval),sizeof(type)) \
)
+#endif
-#define Data_Get_Struct(obj,type,sval) do {\
- Check_Type((obj), T_DATA); \
- (sval) = (type*)DATA_PTR(obj);\
-} while (0)
+#define Data_Get_Struct(obj,type,sval) \
+ ((sval) = (type*)rb_data_object_get(obj))
-#define TypedData_Get_Struct(obj,type,data_type,sval) do {\
- (sval) = (type*)rb_check_typeddata((obj), (data_type)); \
-} while (0)
+#define TypedData_Get_Struct(obj,type,data_type,sval) \
+ ((sval) = (type*)rb_check_typeddata((obj), (data_type)))
+
+#define RSTRUCT_EMBED_LEN_MAX RSTRUCT_EMBED_LEN_MAX
+#define RSTRUCT_EMBED_LEN_MASK RSTRUCT_EMBED_LEN_MASK
+#define RSTRUCT_EMBED_LEN_SHIFT RSTRUCT_EMBED_LEN_SHIFT
+enum {
+ RSTRUCT_EMBED_LEN_MAX = 3,
+ RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
+ RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1),
+
+ RSTRUCT_ENUM_END
+};
-#define RSTRUCT_EMBED_LEN_MAX 3
struct RStruct {
struct RBasic basic;
union {
@@ -1053,151 +1224,245 @@ struct RStruct {
const VALUE ary[RSTRUCT_EMBED_LEN_MAX];
} as;
};
-#define RSTRUCT_EMBED_LEN_MASK (FL_USER2|FL_USER1)
-#define RSTRUCT_EMBED_LEN_SHIFT (FL_USHIFT+1)
-#define RSTRUCT_LEN(st) \
- ((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? \
- (long)((RBASIC(st)->flags >> RSTRUCT_EMBED_LEN_SHIFT) & \
- (RSTRUCT_EMBED_LEN_MASK >> RSTRUCT_EMBED_LEN_SHIFT)) : \
- RSTRUCT(st)->as.heap.len)
+
+#define RSTRUCT_EMBED_LEN(st) \
+ (long)((RBASIC(st)->flags >> RSTRUCT_EMBED_LEN_SHIFT) & \
+ (RSTRUCT_EMBED_LEN_MASK >> RSTRUCT_EMBED_LEN_SHIFT))
+#define RSTRUCT_LEN(st) rb_struct_len(st)
#define RSTRUCT_LENINT(st) rb_long2int(RSTRUCT_LEN(st))
-#define RSTRUCT_CONST_PTR(st) \
- ((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? \
- RSTRUCT(st)->as.ary : \
- RSTRUCT(st)->as.heap.ptr)
-#define RSTRUCT_PTR(st) ((VALUE *)RSTRUCT_CONST_PTR(RGENGC_WB_PROTECTED_STRUCT ? OBJ_WB_UNPROTECT((VALUE)st) : (VALUE)st))
+#define RSTRUCT_CONST_PTR(st) rb_struct_const_ptr(st)
+#define RSTRUCT_PTR(st) ((VALUE *)RSTRUCT_CONST_PTR(RB_OBJ_WB_UNPROTECT_FOR(STRUCT, st)))
#define RSTRUCT_SET(st, idx, v) RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[idx], (v))
#define RSTRUCT_GET(st, idx) (RSTRUCT_CONST_PTR(st)[idx])
-#define RBIGNUM_EMBED_LEN_NUMBITS 3
-#ifndef RBIGNUM_EMBED_LEN_MAX
-# if (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1
-# define RBIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT)
-# else
-# define RBIGNUM_EMBED_LEN_MAX ((1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
-# endif
-#endif
-struct RBignum {
- struct RBasic basic;
- union {
- struct {
- long len;
- BDIGIT *digits;
- } heap;
- BDIGIT ary[RBIGNUM_EMBED_LEN_MAX];
- } as;
-};
-#define RBIGNUM_SIGN_BIT FL_USER1
-/* sign: positive:1, negative:0 */
-#define RBIGNUM_SIGN(b) ((RBASIC(b)->flags & RBIGNUM_SIGN_BIT) != 0)
-#define RBIGNUM_SET_SIGN(b,sign) \
- ((sign) ? (RBASIC(b)->flags |= RBIGNUM_SIGN_BIT) \
- : (RBASIC(b)->flags &= ~RBIGNUM_SIGN_BIT))
-#define RBIGNUM_POSITIVE_P(b) RBIGNUM_SIGN(b)
-#define RBIGNUM_NEGATIVE_P(b) (!RBIGNUM_SIGN(b))
-
-#define RBIGNUM_EMBED_FLAG FL_USER2
-#define RBIGNUM_EMBED_LEN_MASK (FL_USER5|FL_USER4|FL_USER3)
-#define RBIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+RBIGNUM_EMBED_LEN_NUMBITS)
-#define RBIGNUM_LEN(b) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
- (long)((RBASIC(b)->flags >> RBIGNUM_EMBED_LEN_SHIFT) & \
- (RBIGNUM_EMBED_LEN_MASK >> RBIGNUM_EMBED_LEN_SHIFT)) : \
- RBIGNUM(b)->as.heap.len)
-/* LSB:RBIGNUM_DIGITS(b)[0], MSB:RBIGNUM_DIGITS(b)[RBIGNUM_LEN(b)-1] */
-#define RBIGNUM_DIGITS(b) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
- RBIGNUM(b)->as.ary : \
- RBIGNUM(b)->as.heap.digits)
-#define RBIGNUM_LENINT(b) rb_long2int(RBIGNUM_LEN(b))
+#define RBIGNUM_SIGN(b) (FIX2LONG(rb_big_cmp((b), INT2FIX(0))) >= 0)
+#define RBIGNUM_POSITIVE_P(b) (FIX2LONG(rb_big_cmp((b), INT2FIX(0))) >= 0)
+#define RBIGNUM_NEGATIVE_P(b) (FIX2LONG(rb_big_cmp((b), INT2FIX(0))) < 0)
#define R_CAST(st) (struct st*)
#define RBASIC(obj) (R_CAST(RBasic)(obj))
#define ROBJECT(obj) (R_CAST(RObject)(obj))
#define RCLASS(obj) (R_CAST(RClass)(obj))
#define RMODULE(obj) RCLASS(obj)
-#define RFLOAT(obj) (R_CAST(RFloat)(obj))
#define RSTRING(obj) (R_CAST(RString)(obj))
#define RREGEXP(obj) (R_CAST(RRegexp)(obj))
#define RARRAY(obj) (R_CAST(RArray)(obj))
-#define RHASH(obj) (R_CAST(RHash)(obj))
#define RDATA(obj) (R_CAST(RData)(obj))
#define RTYPEDDATA(obj) (R_CAST(RTypedData)(obj))
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
-#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
#define RFILE(obj) (R_CAST(RFile)(obj))
-#define RRATIONAL(obj) (R_CAST(RRational)(obj))
-#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
-
-#define FL_SINGLETON FL_USER0
-#define FL_WB_PROTECTED (((VALUE)1)<<5)
-#define FL_PROMOTED (((VALUE)1)<<6)
-#define FL_FINALIZE (((VALUE)1)<<7)
-#define FL_TAINT (((VALUE)1)<<8)
-#define FL_UNTRUSTED FL_TAINT
-#define FL_EXIVAR (((VALUE)1)<<10)
-#define FL_FREEZE (((VALUE)1)<<11)
-
-#define FL_USHIFT 12
-
-#define FL_USER0 (((VALUE)1)<<(FL_USHIFT+0))
-#define FL_USER1 (((VALUE)1)<<(FL_USHIFT+1))
-#define FL_USER2 (((VALUE)1)<<(FL_USHIFT+2))
-#define FL_USER3 (((VALUE)1)<<(FL_USHIFT+3))
-#define FL_USER4 (((VALUE)1)<<(FL_USHIFT+4))
-#define FL_USER5 (((VALUE)1)<<(FL_USHIFT+5))
-#define FL_USER6 (((VALUE)1)<<(FL_USHIFT+6))
-#define FL_USER7 (((VALUE)1)<<(FL_USHIFT+7))
-#define FL_USER8 (((VALUE)1)<<(FL_USHIFT+8))
-#define FL_USER9 (((VALUE)1)<<(FL_USHIFT+9))
-#define FL_USER10 (((VALUE)1)<<(FL_USHIFT+10))
-#define FL_USER11 (((VALUE)1)<<(FL_USHIFT+11))
-#define FL_USER12 (((VALUE)1)<<(FL_USHIFT+12))
-#define FL_USER13 (((VALUE)1)<<(FL_USHIFT+13))
-#define FL_USER14 (((VALUE)1)<<(FL_USHIFT+14))
-#define FL_USER15 (((VALUE)1)<<(FL_USHIFT+15))
-#define FL_USER16 (((VALUE)1)<<(FL_USHIFT+16))
-#define FL_USER17 (((VALUE)1)<<(FL_USHIFT+17))
-#define FL_USER18 (((VALUE)1)<<(FL_USHIFT+18))
-#define FL_USER19 (((VALUE)1)<<(FL_USHIFT+19))
-
-#define SPECIAL_CONST_P(x) (IMMEDIATE_P(x) || !RTEST(x))
-
-#define FL_ABLE(x) (!SPECIAL_CONST_P(x) && BUILTIN_TYPE(x) != T_NODE)
-#define FL_TEST_RAW(x,f) (RBASIC(x)->flags&(f))
-#define FL_TEST(x,f) (FL_ABLE(x)?FL_TEST_RAW((x),(f)):0)
-#define FL_ANY(x,f) FL_TEST((x),(f))
-#define FL_ALL(x,f) (FL_TEST((x),(f)) == (f))
-#define FL_SET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags |= (f);} while (0)
-#define FL_UNSET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags &= ~(f);} while (0)
-#define FL_REVERSE(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags ^= (f);} while (0)
-
-#define OBJ_TAINTED(x) (!!FL_TEST((x), FL_TAINT))
-#define OBJ_TAINT(x) FL_SET((x), FL_TAINT)
-#define OBJ_UNTRUSTED(x) OBJ_TAINTED(x)
-#define OBJ_UNTRUST(x) OBJ_TAINT(x)
-#define OBJ_INFECT(x,s) do { \
- if (FL_ABLE(x) && FL_ABLE(s)) \
- RBASIC(x)->flags |= RBASIC(s)->flags & FL_TAINT; \
-} while (0)
-#define OBJ_FROZEN(x) (!!(FL_ABLE(x)?(RBASIC(x)->flags&(FL_FREEZE)):(FIXNUM_P(x)||FLONUM_P(x)||SYMBOL_P(x))))
-#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
+#define FL_SINGLETON RUBY_FL_SINGLETON
+#define FL_WB_PROTECTED RUBY_FL_WB_PROTECTED
+#define FL_PROMOTED0 RUBY_FL_PROMOTED0
+#define FL_PROMOTED1 RUBY_FL_PROMOTED1
+#define FL_FINALIZE RUBY_FL_FINALIZE
+#define FL_TAINT RUBY_FL_TAINT
+#define FL_UNTRUSTED RUBY_FL_UNTRUSTED
+#define FL_EXIVAR RUBY_FL_EXIVAR
+#define FL_FREEZE RUBY_FL_FREEZE
+
+#define FL_USHIFT RUBY_FL_USHIFT
+
+#define FL_USER0 RUBY_FL_USER0
+#define FL_USER1 RUBY_FL_USER1
+#define FL_USER2 RUBY_FL_USER2
+#define FL_USER3 RUBY_FL_USER3
+#define FL_USER4 RUBY_FL_USER4
+#define FL_USER5 RUBY_FL_USER5
+#define FL_USER6 RUBY_FL_USER6
+#define FL_USER7 RUBY_FL_USER7
+#define FL_USER8 RUBY_FL_USER8
+#define FL_USER9 RUBY_FL_USER9
+#define FL_USER10 RUBY_FL_USER10
+#define FL_USER11 RUBY_FL_USER11
+#define FL_USER12 RUBY_FL_USER12
+#define FL_USER13 RUBY_FL_USER13
+#define FL_USER14 RUBY_FL_USER14
+#define FL_USER15 RUBY_FL_USER15
+#define FL_USER16 RUBY_FL_USER16
+#define FL_USER17 RUBY_FL_USER17
+#define FL_USER18 RUBY_FL_USER18
+#define FL_USER19 RUBY_FL_USER19
+
+#define RB_SPECIAL_CONST_P(x) (RB_IMMEDIATE_P(x) || !RTEST(x))
+#define SPECIAL_CONST_P(x) RB_SPECIAL_CONST_P(x)
+
+#define RB_FL_ABLE(x) (!RB_SPECIAL_CONST_P(x) && RB_BUILTIN_TYPE(x) != RUBY_T_NODE)
+#define RB_FL_TEST_RAW(x,f) (RBASIC(x)->flags&(f))
+#define RB_FL_TEST(x,f) (RB_FL_ABLE(x)?RB_FL_TEST_RAW((x),(f)):0)
+#define RB_FL_ANY_RAW(x,f) RB_FL_TEST_RAW((x),(f))
+#define RB_FL_ANY(x,f) RB_FL_TEST((x),(f))
+#define RB_FL_ALL_RAW(x,f) (RB_FL_TEST_RAW((x),(f)) == (f))
+#define RB_FL_ALL(x,f) (RB_FL_TEST((x),(f)) == (f))
+#define RB_FL_SET_RAW(x,f) (void)(RBASIC(x)->flags |= (f))
+#define RB_FL_SET(x,f) (RB_FL_ABLE(x) ? RB_FL_SET_RAW(x, f) : (void)0)
+#define RB_FL_UNSET_RAW(x,f) (void)(RBASIC(x)->flags &= ~(f))
+#define RB_FL_UNSET(x,f) (RB_FL_ABLE(x) ? RB_FL_UNSET_RAW(x, f) : (void)0)
+#define RB_FL_REVERSE_RAW(x,f) (void)(RBASIC(x)->flags ^= (f))
+#define RB_FL_REVERSE(x,f) (RB_FL_ABLE(x) ? RB_FL_REVERSE_RAW(x, f) : (void)0)
+
+#define RB_OBJ_TAINTABLE(x) (RB_FL_ABLE(x) && RB_BUILTIN_TYPE(x) != RUBY_T_BIGNUM && RB_BUILTIN_TYPE(x) != RUBY_T_FLOAT)
+#define RB_OBJ_TAINTED_RAW(x) RB_FL_TEST_RAW(x, RUBY_FL_TAINT)
+#define RB_OBJ_TAINTED(x) (!!RB_FL_TEST((x), RUBY_FL_TAINT))
+#define RB_OBJ_TAINT_RAW(x) RB_FL_SET_RAW(x, RUBY_FL_TAINT)
+#define RB_OBJ_TAINT(x) (RB_OBJ_TAINTABLE(x) ? RB_OBJ_TAINT_RAW(x) : (void)0)
+#define RB_OBJ_UNTRUSTED(x) RB_OBJ_TAINTED(x)
+#define RB_OBJ_UNTRUST(x) RB_OBJ_TAINT(x)
+#define RB_OBJ_INFECT_RAW(x,s) RB_FL_SET_RAW(x, RB_OBJ_TAINTED_RAW(s))
+#define RB_OBJ_INFECT(x,s) ( \
+ (RB_OBJ_TAINTABLE(x) && RB_FL_ABLE(s)) ? \
+ RB_OBJ_INFECT_RAW(x, s) : (void)0)
+
+#define RB_OBJ_FROZEN_RAW(x) (RBASIC(x)->flags&RUBY_FL_FREEZE)
+#define RB_OBJ_FROZEN(x) (!RB_FL_ABLE(x) || RB_OBJ_FROZEN_RAW(x))
+#define RB_OBJ_FREEZE_RAW(x) (void)(RBASIC(x)->flags |= RUBY_FL_FREEZE)
+#define RB_OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)
+
+#define FL_ABLE(x) RB_FL_ABLE(x)
+#define FL_TEST_RAW(x,f) RB_FL_TEST_RAW(x,f)
+#define FL_TEST(x,f) RB_FL_TEST(x,f)
+#define FL_ANY_RAW(x,f) RB_FL_ANY_RAW(x,f)
+#define FL_ANY(x,f) RB_FL_ANY(x,f)
+#define FL_ALL_RAW(x,f) RB_FL_ALL_RAW(x,f)
+#define FL_ALL(x,f) RB_FL_ALL(x,f)
+#define FL_SET_RAW(x,f) RB_FL_SET_RAW(x,f)
+#define FL_SET(x,f) RB_FL_SET(x,f)
+#define FL_UNSET_RAW(x,f) RB_FL_UNSET_RAW(x,f)
+#define FL_UNSET(x,f) RB_FL_UNSET(x,f)
+#define FL_REVERSE_RAW(x,f) RB_FL_REVERSE_RAW(x,f)
+#define FL_REVERSE(x,f) RB_FL_REVERSE(x,f)
+
+#define OBJ_TAINTABLE(x) RB_OBJ_TAINTABLE(x)
+#define OBJ_TAINTED_RAW(x) RB_OBJ_TAINTED_RAW(x)
+#define OBJ_TAINTED(x) RB_OBJ_TAINTED(x)
+#define OBJ_TAINT_RAW(x) RB_OBJ_TAINT_RAW(x)
+#define OBJ_TAINT(x) RB_OBJ_TAINT(x)
+#define OBJ_UNTRUSTED(x) RB_OBJ_UNTRUSTED(x)
+#define OBJ_UNTRUST(x) RB_OBJ_UNTRUST(x)
+#define OBJ_INFECT_RAW(x,s) RB_OBJ_INFECT_RAW(x,s)
+#define OBJ_INFECT(x,s) RB_OBJ_INFECT(x,s)
+#define OBJ_FROZEN_RAW(x) RB_OBJ_FROZEN_RAW(x)
+#define OBJ_FROZEN(x) RB_OBJ_FROZEN(x)
+#define OBJ_FREEZE_RAW(x) RB_OBJ_FREEZE_RAW(x)
+#define OBJ_FREEZE(x) RB_OBJ_FREEZE(x)
+
+void rb_freeze_singleton_class(VALUE klass);
+
+static inline void
+rb_obj_freeze_inline(VALUE x)
+{
+ if (RB_FL_ABLE(x)) {
+ RB_OBJ_FREEZE_RAW(x);
+ if (RBASIC_CLASS(x) && !(RBASIC(x)->flags & RUBY_FL_SINGLETON)) {
+ rb_freeze_singleton_class(x);
+ }
+ }
+}
+
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+# define RUBY_UNTYPED_DATA_FUNC(func) func __attribute__((warning("untyped Data is unsafe; use TypedData instead")))
+#else
+# define RUBY_UNTYPED_DATA_FUNC(func) DEPRECATED(func)
+#endif
+
+#if defined(__GNUC__) && !defined(__NO_INLINE__)
+#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
+RUBY_UNTYPED_DATA_FUNC(static inline VALUE rb_data_object_wrap_warning(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
+#endif
+RUBY_UNTYPED_DATA_FUNC(static inline void *rb_data_object_get_warning(VALUE));
+
+static inline VALUE
+rb_data_object_wrap_warning(VALUE klass, void *ptr, RUBY_DATA_FUNC mark, RUBY_DATA_FUNC free)
+{
+ return rb_data_object_wrap(klass, ptr, mark, free);
+}
+
+#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
+#define rb_data_object_wrap_warning(klass, ptr, mark, free) \
+ __extension__( \
+ __builtin_choose_expr( \
+ __builtin_constant_p(klass) && !(klass), \
+ rb_data_object_wrap(klass, ptr, mark, free), \
+ rb_data_object_wrap_warning(klass, ptr, mark, free)))
+#endif
+#endif
+
+static inline void *
+rb_data_object_get(VALUE obj)
+{
+ Check_Type(obj, RUBY_T_DATA);
+ return ((struct RData *)obj)->data;
+}
+
+#if defined(__GNUC__) && !defined(__NO_INLINE__)
+static inline void *
+rb_data_object_get_warning(VALUE obj)
+{
+ return rb_data_object_get(obj);
+}
+#endif
+
+static inline VALUE
+rb_data_object_make(VALUE klass, RUBY_DATA_FUNC mark_func, RUBY_DATA_FUNC free_func, void **datap, size_t size)
+{
+ Data_Make_Struct0(result, klass, void, size, mark_func, free_func, *datap);
+ return result;
+}
+
+static inline VALUE
+rb_data_typed_object_make(VALUE klass, const rb_data_type_t *type, void **datap, size_t size)
+{
+ TypedData_Make_Struct0(result, klass, void, size, type, *datap);
+ return result;
+}
+
+#ifndef rb_data_object_alloc
+DEPRECATED_BY(rb_data_object_wrap, static inline VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
+static inline VALUE
+rb_data_object_alloc(VALUE klass, void *data, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
+{
+ return rb_data_object_wrap(klass, data, dmark, dfree);
+}
+#endif
+
+#ifndef rb_data_typed_object_alloc
+DEPRECATED_BY(rb_data_typed_object_wrap, static inline VALUE rb_data_typed_object_alloc(VALUE,void*,const rb_data_type_t*));
+static inline VALUE
+rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *type)
+{
+ return rb_data_typed_object_wrap(klass, datap, type);
+}
+#endif
+
+#if defined(__GNUC__) && !defined(__NO_INLINE__)
+#define rb_data_object_wrap_0 rb_data_object_wrap
+#define rb_data_object_wrap_1 rb_data_object_wrap_warning
+#define rb_data_object_wrap RUBY_MACRO_SELECT(rb_data_object_wrap_, RUBY_UNTYPED_DATA_WARNING)
+#define rb_data_object_get_0 rb_data_object_get
+#define rb_data_object_get_1 rb_data_object_get_warning
+#define rb_data_object_get RUBY_MACRO_SELECT(rb_data_object_get_, RUBY_UNTYPED_DATA_WARNING)
+#define rb_data_object_make_0 rb_data_object_make
+#define rb_data_object_make_1 rb_data_object_make_warning
+#define rb_data_object_make RUBY_MACRO_SELECT(rb_data_object_make_, RUBY_UNTYPED_DATA_WARNING)
+#endif
#if USE_RGENGC
-#define OBJ_PROMOTED(x) (SPECIAL_CONST_P(x) ? 0 : FL_TEST_RAW((x), FL_PROMOTED))
-#define OBJ_WB_PROTECTED(x) (SPECIAL_CONST_P(x) ? 1 : FL_TEST_RAW((x), FL_WB_PROTECTED))
-#define OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
+#define RB_OBJ_PROMOTED_RAW(x) RB_FL_ALL_RAW(x, RUBY_FL_PROMOTED)
+#define RB_OBJ_PROMOTED(x) (RB_SPECIAL_CONST_P(x) ? 0 : RB_OBJ_PROMOTED_RAW(x))
+#define RB_OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
void rb_gc_writebarrier(VALUE a, VALUE b);
-void rb_gc_writebarrier_unprotect_promoted(VALUE obj);
+void rb_gc_writebarrier_unprotect(VALUE obj);
#else /* USE_RGENGC */
-#define OBJ_PROMOTED(x) 0
-#define OBJ_WB_PROTECTED(x) 0
-#define OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
+#define RB_OBJ_PROMOTED(x) 0
+#define RB_OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
#endif
+#define OBJ_PROMOTED_RAW(x) RB_OBJ_PROMOTED_RAW(x)
+#define OBJ_PROMOTED(x) RB_OBJ_PROMOTED(x)
+#define OBJ_WB_UNPROTECT(x) RB_OBJ_WB_UNPROTECT(x)
/* Write barrier (WB) interfaces:
* - RB_OBJ_WRITE(a, slot, b): WB for new reference from `a' to `b'.
@@ -1205,7 +1470,7 @@ void rb_gc_writebarrier_unprotect_promoted(VALUE obj);
* - RB_OBJ_WRITTEN(a, oldv, b): WB for new reference from `a' to `b'.
* This doesn't write any values, but only a WB declaration.
* `oldv' is replaced value with `b' (not used in current Ruby).
- *
+ *
* NOTE: The following core interfaces can be changed in the future.
* Please catch up if you want to insert WB into C-extensions
* correctly.
@@ -1228,15 +1493,8 @@ rb_obj_wb_unprotect(VALUE x, RB_UNUSED_VAR(const char *filename), RB_UNUSED_VAR(
#ifdef RGENGC_LOGGING_WB_UNPROTECT
RGENGC_LOGGING_WB_UNPROTECT((void *)x, filename, line);
#endif
-
#if USE_RGENGC
- /* `x' should be an RVALUE object */
- if (FL_TEST_RAW((x), FL_WB_PROTECTED)) {
- if (FL_TEST_RAW((x), FL_PROMOTED)) {
- rb_gc_writebarrier_unprotect_promoted(x);
- }
- RBASIC(x)->flags &= ~FL_WB_PROTECTED;
- }
+ rb_gc_writebarrier_unprotect(x);
#endif
return x;
}
@@ -1249,8 +1507,7 @@ rb_obj_written(VALUE a, RB_UNUSED_VAR(VALUE oldv), VALUE b, RB_UNUSED_VAR(const
#endif
#if USE_RGENGC
- /* `a' should be an RVALUE object */
- if (FL_TEST_RAW((a), FL_PROMOTED) && !SPECIAL_CONST_P(b)) {
+ if (!RB_SPECIAL_CONST_P(b)) {
rb_gc_writebarrier(a, b);
}
#endif
@@ -1274,79 +1531,115 @@ rb_obj_write(VALUE a, VALUE *slot, VALUE b, RB_UNUSED_VAR(const char *filename),
}
#if SIZEOF_INT < SIZEOF_LONG
-# define INT2NUM(v) INT2FIX((int)(v))
-# define UINT2NUM(v) LONG2FIX((unsigned int)(v))
+# define RB_INT2NUM(v) INT2FIX((int)(v))
+# define RB_UINT2NUM(v) LONG2FIX((unsigned int)(v))
#else
static inline VALUE
rb_int2num_inline(int v)
{
- if (FIXABLE(v))
+ if (RB_FIXABLE(v))
return INT2FIX(v);
else
return rb_int2big(v);
}
-#define INT2NUM(x) rb_int2num_inline(x)
+#define RB_INT2NUM(x) rb_int2num_inline(x)
static inline VALUE
rb_uint2num_inline(unsigned int v)
{
- if (POSFIXABLE(v))
+ if (RB_POSFIXABLE(v))
return LONG2FIX(v);
else
return rb_uint2big(v);
}
-#define UINT2NUM(x) rb_uint2num_inline(x)
+#define RB_UINT2NUM(x) rb_uint2num_inline(x)
#endif
+#define INT2NUM(x) RB_INT2NUM(x)
+#define UINT2NUM(x) RB_UINT2NUM(x)
static inline VALUE
rb_long2num_inline(long v)
{
- if (FIXABLE(v))
+ if (RB_FIXABLE(v))
return LONG2FIX(v);
else
return rb_int2big(v);
}
-#define LONG2NUM(x) rb_long2num_inline(x)
+#define RB_LONG2NUM(x) rb_long2num_inline(x)
static inline VALUE
rb_ulong2num_inline(unsigned long v)
{
- if (POSFIXABLE(v))
+ if (RB_POSFIXABLE(v))
return LONG2FIX(v);
else
return rb_uint2big(v);
}
-#define ULONG2NUM(x) rb_ulong2num_inline(x)
+#define RB_ULONG2NUM(x) rb_ulong2num_inline(x)
static inline char
rb_num2char_inline(VALUE x)
{
- if ((TYPE(x) == T_STRING) && (RSTRING_LEN(x)>=1))
+ if (RB_TYPE_P(x, RUBY_T_STRING) && (RSTRING_LEN(x)>=1))
return RSTRING_PTR(x)[0];
else
return (char)(NUM2INT(x) & 0xff);
}
-#define NUM2CHR(x) rb_num2char_inline(x)
+#define RB_NUM2CHR(x) rb_num2char_inline(x)
+
+#define RB_CHR2FIX(x) INT2FIX((long)((x)&0xff))
-#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
+#define LONG2NUM(x) RB_LONG2NUM(x)
+#define ULONG2NUM(x) RB_ULONG2NUM(x)
+#define NUM2CHR(x) RB_NUM2CHR(x)
+#define CHR2FIX(x) RB_CHR2FIX(x)
-#define ALLOC_N(type,n) ((type*)xmalloc2((n),sizeof(type)))
-#define ALLOC(type) ((type*)xmalloc(sizeof(type)))
-#define REALLOC_N(var,type,n) ((var)=(type*)xrealloc2((char*)(var),(n),sizeof(type)))
+#define RB_ALLOC_N(type,n) ((type*)ruby_xmalloc2((n),sizeof(type)))
+#define RB_ALLOC(type) ((type*)ruby_xmalloc(sizeof(type)))
+#define RB_ZALLOC_N(type,n) ((type*)ruby_xcalloc((n),sizeof(type)))
+#define RB_ZALLOC(type) (RB_ZALLOC_N(type,1))
+#define RB_REALLOC_N(var,type,n) ((var)=(type*)ruby_xrealloc2((char*)(var),(n),sizeof(type)))
+
+#define ALLOC_N(type,n) RB_ALLOC_N(type,n)
+#define ALLOC(type) RB_ALLOC(type)
+#define ZALLOC_N(type,n) RB_ZALLOC_N(type,n)
+#define ZALLOC(type) RB_ZALLOC(type)
+#define REALLOC_N(var,type,n) RB_REALLOC_N(var,type,n)
#define ALLOCA_N(type,n) ((type*)alloca(sizeof(type)*(n)))
void *rb_alloc_tmp_buffer(volatile VALUE *store, long len) RUBY_ATTR_ALLOC_SIZE((2));
void rb_free_tmp_buffer(volatile VALUE *store);
+NORETURN(void ruby_malloc_size_overflow(size_t, size_t));
+static inline size_t
+ruby_xmalloc2_size(const size_t count, const size_t elsize)
+{
+ if (count > SIZE_MAX / elsize) {
+ ruby_malloc_size_overflow(count, elsize);
+ }
+ return count * elsize;
+}
/* allocates _n_ bytes temporary buffer and stores VALUE including it
* in _v_. _n_ may be evaluated twice. */
#ifdef C_ALLOCA
-# define ALLOCV(v, n) rb_alloc_tmp_buffer(&(v), (n))
+# define RB_ALLOCV(v, n) rb_alloc_tmp_buffer(&(v), (n))
+# define RB_ALLOCV_N(type, v, n) \
+ ((type*)RB_ALLOCV((v), ruby_xmalloc2_size((n), sizeof(type))))
#else
-# define ALLOCV(v, n) ((n) < 1024 ? (RB_GC_GUARD(v) = 0, alloca(n)) : rb_alloc_tmp_buffer(&(v), (n)))
+# define RUBY_ALLOCV_LIMIT 1024
+# define RB_ALLOCV(v, n) ((n) < RUBY_ALLOCV_LIMIT ? \
+ (RB_GC_GUARD(v) = 0, alloca(n)) : \
+ rb_alloc_tmp_buffer(&(v), (n)))
+# define RB_ALLOCV_N(type, v, n) \
+ ((type*)(ruby_xmalloc2_size((n), sizeof(type)) < RUBY_ALLOCV_LIMIT ? \
+ (RB_GC_GUARD(v) = 0, alloca((n) * sizeof(type))) : \
+ rb_alloc_tmp_buffer(&(v), (n) * sizeof(type))))
#endif
-#define ALLOCV_N(type, v, n) ((type*)ALLOCV((v), sizeof(type)*(n)))
-#define ALLOCV_END(v) rb_free_tmp_buffer(&(v))
+#define RB_ALLOCV_END(v) rb_free_tmp_buffer(&(v))
+
+#define ALLOCV(v, n) RB_ALLOCV(v, n)
+#define ALLOCV_N(type, v, n) RB_ALLOCV_N(type, v, n)
+#define ALLOCV_END(v) RB_ALLOCV_END(v)
#define MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(n))
#define MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(n))
@@ -1392,7 +1685,7 @@ void rb_gvar_readonly_setter(VALUE val, ID id, void *data, struct rb_global_var
void rb_define_variable(const char*,VALUE*);
void rb_define_virtual_variable(const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
void rb_define_hooked_variable(const char*,VALUE*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
-void rb_define_readonly_variable(const char*,VALUE*);
+void rb_define_readonly_variable(const char*,const VALUE*);
void rb_define_const(VALUE,const char*,VALUE);
void rb_define_global_const(const char*,VALUE);
@@ -1417,16 +1710,21 @@ const char *rb_id2name(ID);
ID rb_check_id(volatile VALUE *);
ID rb_to_id(VALUE);
VALUE rb_id2str(ID);
+VALUE rb_sym2str(VALUE);
+VALUE rb_to_symbol(VALUE name);
+VALUE rb_check_symbol(volatile VALUE *namep);
-#define CONST_ID_CACHE(result, str) \
+#define RUBY_CONST_ID_CACHE(result, str) \
{ \
static ID rb_intern_id_cache; \
if (!rb_intern_id_cache) \
rb_intern_id_cache = rb_intern2((str), (long)strlen(str)); \
result rb_intern_id_cache; \
}
-#define CONST_ID(var, str) \
- do CONST_ID_CACHE((var) =, (str)) while (0)
+#define RUBY_CONST_ID(var, str) \
+ do RUBY_CONST_ID_CACHE((var) =, (str)) while (0)
+#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
+#define CONST_ID(var, str) RUBY_CONST_ID(var, str)
#ifdef __GNUC__
/* __builtin_constant_p and statement expression is available
* since gcc-2.7.2.3 at least. */
@@ -1459,6 +1757,9 @@ VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*);
VALUE rb_funcall_with_block(VALUE, ID, int, const VALUE*, VALUE);
int rb_scan_args(int, const VALUE*, const char*, ...);
VALUE rb_call_super(int, const VALUE*);
+VALUE rb_current_receiver(void);
+int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *);
+VALUE rb_extract_keywords(VALUE *orighash);
/* rb_scan_args() format allows ':' for optional hash */
#define HAVE_RB_SCAN_ARGS_OPTIONAL_HASH 1
@@ -1475,6 +1776,11 @@ VALUE *rb_ruby_debug_ptr(void);
#define ruby_verbose (*rb_ruby_verbose_ptr())
#define ruby_debug (*rb_ruby_debug_ptr())
+/* for rb_readwrite_sys_fail first argument */
+enum rb_io_wait_readwrite {RB_IO_WAIT_READABLE, RB_IO_WAIT_WRITABLE};
+#define RB_IO_WAIT_READABLE RB_IO_WAIT_READABLE
+#define RB_IO_WAIT_WRITABLE RB_IO_WAIT_WRITABLE
+
PRINTF_ARGS(NORETURN(void rb_raise(VALUE, const char*, ...)), 2, 3);
PRINTF_ARGS(NORETURN(void rb_fatal(const char*, ...)), 1, 2);
PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
@@ -1483,7 +1789,7 @@ 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_readwrite_sys_fail(int, const char*));
+NORETURN(void rb_readwrite_sys_fail(enum rb_io_wait_readwrite, const char*));
NORETURN(void rb_iter_break(void));
NORETURN(void rb_iter_break_value(VALUE));
NORETURN(void rb_exit(int));
@@ -1494,6 +1800,7 @@ 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));
+NORETURN(void rb_readwrite_syserr_fail(enum rb_io_wait_readwrite, int, const char*));
/* reports if `-W' specified */
PRINTF_ARGS(void rb_warning(const char*, ...), 1, 2);
@@ -1503,10 +1810,6 @@ PRINTF_ARGS(void rb_sys_warning(const char*, ...), 1, 2);
PRINTF_ARGS(void rb_warn(const char*, ...), 1, 2);
PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4);
-/* for rb_readwrite_sys_fail first argument */
-#define RB_IO_WAIT_READABLE 0
-#define RB_IO_WAIT_WRITABLE 1
-
#define RUBY_BLOCK_CALL_FUNC_TAKES_BLOCKARG 1
#define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg) \
VALUE yielded_arg, VALUE callback_arg, int argc, const VALUE *argv, VALUE blockarg
@@ -1629,15 +1932,15 @@ RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
static inline VALUE
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;
+ if (RB_IMMEDIATE_P(obj)) {
+ if (RB_FIXNUM_P(obj)) return rb_cFixnum;
+ if (RB_FLONUM_P(obj)) return rb_cFloat;
+ if (obj == RUBY_Qtrue) return rb_cTrueClass;
+ if (RB_STATIC_SYM_P(obj)) return rb_cSymbol;
}
else if (!RTEST(obj)) {
- if (obj == Qnil) return rb_cNilClass;
- if (obj == Qfalse) return rb_cFalseClass;
+ if (obj == RUBY_Qnil) return rb_cNilClass;
+ if (obj == RUBY_Qfalse) return rb_cFalseClass;
}
return RBASIC(obj)->klass;
}
@@ -1645,32 +1948,20 @@ rb_class_of(VALUE obj)
static inline int
rb_type(VALUE obj)
{
- if (IMMEDIATE_P(obj)) {
- if (FIXNUM_P(obj)) return T_FIXNUM;
- 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;
+ if (RB_IMMEDIATE_P(obj)) {
+ if (RB_FIXNUM_P(obj)) return RUBY_T_FIXNUM;
+ if (RB_FLONUM_P(obj)) return RUBY_T_FLOAT;
+ if (obj == RUBY_Qtrue) return RUBY_T_TRUE;
+ if (RB_STATIC_SYM_P(obj)) return RUBY_T_SYMBOL;
+ if (obj == RUBY_Qundef) return RUBY_T_UNDEF;
}
else if (!RTEST(obj)) {
- if (obj == Qnil) return T_NIL;
- if (obj == Qfalse) return T_FALSE;
+ if (obj == RUBY_Qnil) return RUBY_T_NIL;
+ if (obj == RUBY_Qfalse) return RUBY_T_FALSE;
}
- return BUILTIN_TYPE(obj);
+ return RB_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) : \
- ((type) == T_FALSE) ? ((obj) == Qfalse) : \
- ((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__
#define rb_type_p(obj, type) \
__extension__ (__builtin_constant_p(type) ? RB_TYPE_P((obj), (type)) : \
@@ -1681,18 +1972,72 @@ rb_type(VALUE obj)
#ifdef __GNUC__
#define rb_special_const_p(obj) \
- __extension__ ({VALUE special_const_obj = (obj); (int)(SPECIAL_CONST_P(special_const_obj) ? Qtrue : Qfalse);})
+ __extension__ ({ \
+ VALUE special_const_obj = (obj); \
+ (int)(RB_SPECIAL_CONST_P(special_const_obj) ? RUBY_Qtrue : RUBY_Qfalse); \
+ })
#else
static inline int
rb_special_const_p(VALUE obj)
{
- if (SPECIAL_CONST_P(obj)) return (int)Qtrue;
- return (int)Qfalse;
+ if (RB_SPECIAL_CONST_P(obj)) return (int)RUBY_Qtrue;
+ return (int)RUBY_Qfalse;
}
#endif
#include "ruby/intern.h"
+static inline void
+rb_clone_setup(VALUE clone, VALUE obj)
+{
+ rb_obj_setup(clone, rb_singleton_class_clone(obj), RBASIC(obj)->flags);
+ rb_singleton_class_attached(RBASIC_CLASS(clone), clone);
+ if (RB_FL_TEST(obj, RUBY_FL_EXIVAR)) rb_copy_generic_ivar(clone, obj);
+}
+
+static inline void
+rb_dup_setup(VALUE dup, VALUE obj)
+{
+ rb_obj_setup(dup, rb_obj_class(obj), RB_FL_TEST_RAW(obj, RUBY_FL_DUPPED));
+ if (RB_FL_TEST(obj, RUBY_FL_EXIVAR)) rb_copy_generic_ivar(dup, obj);
+}
+
+static inline long
+rb_array_len(VALUE a)
+{
+ return (RBASIC(a)->flags & RARRAY_EMBED_FLAG) ?
+ RARRAY_EMBED_LEN(a) : RARRAY(a)->as.heap.len;
+}
+
+#if defined(__fcc__) || defined(__fcc_version) || \
+ defined(__FCC__) || defined(__FCC_VERSION)
+/* workaround for old version of Fujitsu C Compiler (fcc) */
+# define FIX_CONST_VALUE_PTR(x) ((const VALUE *)(x))
+#else
+# define FIX_CONST_VALUE_PTR(x) (x)
+#endif
+
+static inline const VALUE *
+rb_array_const_ptr(VALUE a)
+{
+ return FIX_CONST_VALUE_PTR((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ?
+ RARRAY(a)->as.ary : RARRAY(a)->as.heap.ptr);
+}
+
+static inline long
+rb_struct_len(VALUE st)
+{
+ return (RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ?
+ RSTRUCT_EMBED_LEN(st) : RSTRUCT(st)->as.heap.len;
+}
+
+static inline const VALUE *
+rb_struct_const_ptr(VALUE st)
+{
+ return FIX_CONST_VALUE_PTR((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ?
+ RSTRUCT(st)->as.ary : RSTRUCT(st)->as.heap.ptr);
+}
+
#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
/* hook for external modules */
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
@@ -1719,6 +2064,7 @@ int ruby_native_thread_p(void);
#define RUBY_EVENT_B_RETURN 0x0200
#define RUBY_EVENT_THREAD_BEGIN 0x0400
#define RUBY_EVENT_THREAD_END 0x0800
+#define RUBY_EVENT_FIBER_SWITCH 0x1000
#define RUBY_EVENT_TRACEPOINT_ALL 0xffff
/* special events */
@@ -1734,10 +2080,12 @@ int ruby_native_thread_p(void);
#define RUBY_INTERNAL_EVENT_GC_START 0x400000
#define RUBY_INTERNAL_EVENT_GC_END_MARK 0x800000
#define RUBY_INTERNAL_EVENT_GC_END_SWEEP 0x1000000
-#define RUBY_INTERNAL_EVENT_OBJSPACE_MASK 0x1f00000
+#define RUBY_INTERNAL_EVENT_GC_ENTER 0x2000000
+#define RUBY_INTERNAL_EVENT_GC_EXIT 0x4000000
+#define RUBY_INTERNAL_EVENT_OBJSPACE_MASK 0x7f00000
#define RUBY_INTERNAL_EVENT_MASK 0xfffe0000
-typedef unsigned long rb_event_flag_t;
+typedef uint32_t 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
diff --git a/include/ruby/st.h b/include/ruby/st.h
index 975da655bf..190bad2a35 100644
--- a/include/ruby/st.h
+++ b/include/ruby/st.h
@@ -78,7 +78,7 @@ struct st_table {
* implementation-defined type. It is implementation-defined whether
* atomic types are permitted.
* In short, long and long long bit-field are implementation-defined
- * feature. Therefore we want to supress a warning explicitly.
+ * feature. Therefore we want to suppress a warning explicitly.
*/
__extension__
#endif
@@ -86,7 +86,7 @@ struct st_table {
union {
struct {
struct st_table_entry **bins;
- struct st_table_entry *head, *tail;
+ void *private_list_head[2];
} big;
struct {
struct st_packed_entry *entries;
@@ -115,6 +115,9 @@ 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);
+/* *key may be altered, but must equal to the old key, i.e., the
+ * results of hash() are same and compare() returns 0, otherwise the
+ * behavior is undefined */
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);
diff --git a/include/ruby/thread_native.h b/include/ruby/thread_native.h
new file mode 100644
index 0000000000..8e500c5a13
--- /dev/null
+++ b/include/ruby/thread_native.h
@@ -0,0 +1,56 @@
+/**********************************************************************
+
+ thread_native.h -
+
+ $Author: ko1 $
+ created at: Wed May 14 19:37:31 2014
+
+ Copyright (C) 2014 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef RUBY_THREAD_NATIVE_H
+#define RUBY_THREAD_NATIVE_H 1
+
+/*
+ * This file contains wrapper APIs for native thread primitives
+ * which Ruby interpreter uses.
+ *
+ * Now, we only suppors pthread and Windows threads.
+ *
+ * If you want to use Ruby's Mutex and so on to synchronize Ruby Threads,
+ * please use Mutex directly.
+ */
+
+
+#if defined(_WIN32)
+#include <windows.h>
+typedef HANDLE rb_nativethread_id_t;
+
+typedef union rb_thread_lock_union {
+ HANDLE mutex;
+ CRITICAL_SECTION crit;
+} rb_nativethread_lock_t;
+
+#elif defined(HAVE_PTHREAD_H)
+#include <pthread.h>
+typedef pthread_t rb_nativethread_id_t;
+typedef pthread_mutex_t rb_nativethread_lock_t;
+
+#else
+#error "unsupported thread type"
+
+#endif
+
+RUBY_SYMBOL_EXPORT_BEGIN
+
+rb_nativethread_id_t rb_nativethread_self();
+
+void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock);
+void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
+void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock);
+void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock);
+
+RUBY_SYMBOL_EXPORT_END
+
+#endif
diff --git a/include/ruby/util.h b/include/ruby/util.h
index 5be5f2e0b4..e9343b3390 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -47,13 +47,20 @@ extern "C" {
RUBY_SYMBOL_EXPORT_BEGIN
+#define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999)
+/* an approximation of ceil(n * log10(2)), up to 65536 at least */
+
#define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
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 *);
+#ifdef HAVE_GNU_QSORT_R
+# define ruby_qsort qsort_r
+#else
void ruby_qsort(void *, const size_t, const size_t,
int (*)(const void *, const void *, void *), void *);
+#endif
void ruby_setenv(const char *, const char *);
void ruby_unsetenv(const char *);
@@ -73,14 +80,6 @@ double ruby_strtod(const char *, char **);
#undef strtod
#define strtod(s,e) ruby_strtod((s),(e))
-#if defined _MSC_VER && _MSC_VER >= 1300
-#pragma warning(push)
-#pragma warning(disable:4723)
-#endif
-#if defined _MSC_VER && _MSC_VER >= 1300
-#pragma warning(pop)
-#endif
-
void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
RUBY_SYMBOL_EXPORT_END
diff --git a/include/ruby/version.h b/include/ruby/version.h
index 4ffcc7a9ad..bb1926f721 100644
--- a/include/ruby/version.h
+++ b/include/ruby/version.h
@@ -13,7 +13,7 @@
/*
* This file contains only
- * - never-changable informations, and
+ * - never-changeable informations, and
* - interfaces accessible from extension libraries.
*
* Never try to check RUBY_VERSION_CODE etc in extension libraries,
@@ -31,7 +31,7 @@
/* API version */
#define RUBY_API_VERSION_MAJOR 2
-#define RUBY_API_VERSION_MINOR 1
+#define RUBY_API_VERSION_MINOR 3
#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)
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 070bab28f9..7bcd0e9125 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -35,6 +35,9 @@ extern "C++" { /* template without extern "C++" */
#if !defined(_WIN64) && !defined(WIN32)
#define WIN32
#endif
+#if defined(_MSC_VER) && _MSC_VER <= 1200
+#include <windows.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#if !defined(_MSC_VER) || _MSC_VER >= 1400
@@ -77,7 +80,7 @@ extern "C++" { /* template without extern "C++" */
#endif
#include <io.h>
#include <malloc.h>
-#if defined __MINGW32__ || __BORLANDC__ >= 0x0580
+#if defined __MINGW32__
# include <stdint.h>
#else
# if !defined(_INTPTR_T_DEFINED)
@@ -124,31 +127,17 @@ typedef unsigned int uintptr_t;
#define WNOHANG -1
+#define O_SHARE_DELETE 0x20000000 /* for rb_w32_open(), rb_w32_wopen() */
+
typedef int clockid_t;
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
-#undef getc
-#undef putc
-#undef fgetc
-#undef fputc
-#undef getchar
-#undef putchar
-#undef fgetchar
-#undef fputchar
#undef utime
#undef lseek
#undef stat
#undef fstat
-#define getc(_stream) rb_w32_getc(_stream)
-#define getchar() rb_w32_getc(stdin)
-#define putc(_c, _stream) rb_w32_putc(_c, _stream)
-#define putchar(_c) rb_w32_putc(_c, stdout)
#ifdef RUBY_EXPORT
-#define fgetc(_stream) getc(_stream)
-#define fputc(_c, _stream) putc(_c, _stream)
-#define fgetchar() getchar()
-#define fputchar(_c) putchar(_c)
#define utime(_p, _t) rb_w32_utime(_p, _t)
#define lseek(_f, _o, _w) _lseeki64(_f, _o, _w)
@@ -163,28 +152,11 @@ typedef int clockid_t;
#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()
-#define filelength(h) _filelength(h)
-#define mktemp(t) _mktemp(t)
-#define tell(h) _tell(h)
-#define _open _sopen
-#define sopen _sopen
-#undef fopen
-#define fopen(p, m) rb_w32_fopen(p, m)
-#undef fdopen
-#define fdopen(h, m) rb_w32_fdopen(h, m)
-#undef fsopen
-#define fsopen(p, m, sh) rb_w32_fsopen(p, m, sh)
-#endif /* __BORLANDC__ */
#undef execv
#define execv(path,argv) rb_w32_aspawn(P_OVERLAY,path,argv)
-#if !defined(__BORLANDC__)
#undef isatty
#define isatty(h) rb_w32_isatty(h)
-#endif /* __BORLANDC__ */
#undef mkdir
#define mkdir(p, m) rb_w32_mkdir(p, m)
@@ -198,9 +170,7 @@ typedef int clockid_t;
#define off_t __int64
#define stat stati64
#define fstat(fd,st) fstati64(fd,st)
-#if defined(__BORLANDC__)
-#define stati64(path, st) rb_w32_stati64(path, st)
-#elif !defined(_MSC_VER) || RT_VER < 80
+#if !defined(_MSC_VER) || RUBY_MSVCRT_VERSION < 80
#define stati64 _stati64
#ifndef _stati64
#define _stati64(path, st) rb_w32_stati64(path, st)
@@ -215,6 +185,7 @@ typedef int clockid_t;
extern int rb_w32_stat(const char *, struct stat *);
extern int rb_w32_fstat(int, struct stat *);
#endif
+#define lstat(path,st) rb_w32_lstati64(path,st)
#define access(path,mode) rb_w32_access(path,mode)
#define strcasecmp _stricmp
@@ -263,7 +234,6 @@ struct ifaddrs {
#endif
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_io_cancelable_p(int);
@@ -309,12 +279,18 @@ extern char **rb_w32_get_environ(void);
extern void rb_w32_free_environ(char **);
extern int rb_w32_map_errno(DWORD);
extern const char *WSAAPI rb_w32_inet_ntop(int,const void *,char *,size_t);
+extern int WSAAPI rb_w32_inet_pton(int,const char *,void *);
extern DWORD rb_w32_osver(void);
extern int chown(const char *, int, int);
extern int rb_w32_uchown(const char *, int, int);
extern int link(const char *, const char *);
extern int rb_w32_ulink(const char *, const char *);
+extern ssize_t readlink(const char *, char *, size_t);
+extern ssize_t rb_w32_ureadlink(const char *, char *, size_t);
+extern ssize_t rb_w32_wreadlink(const WCHAR *, WCHAR *, size_t);
+extern int symlink(const char *src, const char *link);
+extern int rb_w32_usymlink(const char *src, const char *link);
extern int gettimeofday(struct timeval *, struct timezone *);
extern int clock_gettime(clockid_t, struct timespec *);
extern int clock_getres(clockid_t, struct timespec *);
@@ -327,11 +303,10 @@ extern rb_pid_t rb_w32_uaspawn(int, const char *, char *const *);
extern rb_pid_t rb_w32_uaspawn_flags(int, const char *, char *const *, DWORD);
extern int kill(int, int);
extern int fcntl(int, int, ...);
+extern int rb_w32_set_nonblock(int);
extern rb_pid_t rb_w32_getpid(void);
extern rb_pid_t rb_w32_getppid(void);
-#if !defined(__BORLANDC__)
extern int rb_w32_isatty(int);
-#endif
extern int rb_w32_uchdir(const char *);
extern int rb_w32_mkdir(const char *, int);
extern int rb_w32_umkdir(const char *, int);
@@ -342,19 +317,14 @@ extern int rb_w32_uunlink(const char *);
extern int rb_w32_uchmod(const char *, int);
extern int rb_w32_stati64(const char *, struct stati64 *);
extern int rb_w32_ustati64(const char *, struct stati64 *);
+extern int rb_w32_lstati64(const char *, struct stati64 *);
+extern int rb_w32_ulstati64(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 *);
extern int rb_w32_dup2(int, int);
-#ifdef __BORLANDC__
-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 *);
-extern FILE *rb_w32_fsopen(const char *, const char *, int);
-#endif
-
#include <float.h>
#if defined _MSC_VER && _MSC_VER >= 1800 && defined INFINITY
@@ -395,19 +365,6 @@ __declspec(dllimport) extern int finite(double);
#define S_IFIFO _S_IFIFO
#endif
-#if 0 && defined __BORLANDC__
-#undef S_ISDIR
-#undef S_ISFIFO
-#undef S_ISBLK
-#undef S_ISCHR
-#undef S_ISREG
-#define S_ISDIR(m) (((unsigned short)(m) & S_IFMT) == S_IFDIR)
-#define S_ISFIFO(m) (((unsigned short)(m) & S_IFMT) == S_IFIFO)
-#define S_ISBLK(m) (((unsigned short)(m) & S_IFMT) == S_IFBLK)
-#define S_ISCHR(m) (((unsigned short)(m) & S_IFMT) == S_IFCHR)
-#define S_ISREG(m) (((unsigned short)(m) & S_IFMT) == S_IFREG)
-#endif
-
#if !defined S_IRUSR && !defined __MINGW32__
#define S_IRUSR 0400
#endif
@@ -438,14 +395,17 @@ __declspec(dllimport) extern int finite(double);
#define S_IXOTH 0001
#endif
+#define S_IFLNK 0xa000
+
/*
* define this so we can do inplace editing
*/
#define SUFFIX
-extern int rb_w32_ftruncate(int fd, off_t length);
-extern int rb_w32_truncate(const char *path, off_t length);
+extern int rb_w32_ftruncate(int fd, off_t length);
+extern int rb_w32_truncate(const char *path, off_t length);
+extern int rb_w32_utruncate(const char *path, off_t length);
#undef HAVE_FTRUNCATE
#define HAVE_FTRUNCATE 1
@@ -463,6 +423,11 @@ extern int rb_w32_truncate(const char *path, off_t length);
#define truncate rb_w32_truncate
#endif
+#if defined(_MSC_VER) && _MSC_VER >= 1400 && _MSC_VER < 1800
+#define strtoll _strtoi64
+#define strtoull _strtoui64
+#endif
+
/*
* stubs
*/
@@ -613,15 +578,14 @@ extern char *rb_w32_strerror(int);
#endif
#define F_DUPFD 0
-#if 0
#define F_GETFD 1
#define F_SETFD 2
+#if 0
#define F_GETFL 3
#endif
#define F_SETFL 4
-#if 0
+#define F_DUPFD_CLOEXEC 67
#define FD_CLOEXEC 1 /* F_GETFD, F_SETFD */
-#endif
#define O_NONBLOCK 1
#undef FD_SET
@@ -652,6 +616,9 @@ extern char *rb_w32_strerror(int);
#undef inet_ntop
#define inet_ntop(f,a,n,l) rb_w32_inet_ntop(f,a,n,l)
+#undef inet_pton
+#define inet_pton(f,s,d) rb_w32_inet_pton(f,s,d)
+
#undef accept
#define accept(s, a, l) rb_w32_accept(s, a, l)
@@ -754,8 +721,6 @@ struct tm *localtime_r(const time_t *, struct tm *);
/* thread stuff */
int rb_w32_sleep(unsigned long msec);
-int rb_w32_putc(int, FILE*);
-int rb_w32_getc(FILE*);
int rb_w32_open(const char *, int, ...);
int rb_w32_uopen(const char *, int, ...);
int rb_w32_wopen(const WCHAR *, int, ...);
@@ -772,12 +737,14 @@ 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);
+WCHAR *rb_w32_mbstr_to_wstr(UINT, const char *, int, long *);
+char *rb_w32_wstr_to_mbstr(UINT, const WCHAR *, int, long *);
/*
== ***CAUTION***
Since this function is very dangerous, ((*NEVER*))
* lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or,
-* use anything like TRAP_BEG...TRAP_END block structure,
+* use anything like rb_thread_call_without_gvl,
in asynchronous_func_t.
*/
typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
@@ -785,7 +752,8 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc
RUBY_SYMBOL_EXPORT_END
-#ifdef __MINGW_ATTRIB_PURE
+#if (defined(__MINGW64_VERSION_MAJOR) || defined(__MINGW64__)) && !defined(__cplusplus)
+#ifdef RUBY_MINGW64_BROKEN_FREXP_MODF
/* License: Ruby's */
/* get rid of bugs in math.h of mingw */
#define frexp(_X, _Y) __extension__ ({\
@@ -803,13 +771,6 @@ RUBY_SYMBOL_EXPORT_END
})
#endif
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
#if defined(__MINGW64__)
/*
* Use powl() instead of broken pow() of x86_64-w64-mingw32.
@@ -824,8 +785,14 @@ rb_w32_pow(double x, double y)
#elif defined(__MINGW64_VERSION_MAJOR)
double rb_w32_pow(double x, double y);
#endif
-#if defined(__MINGW64_VERSION_MAJOR) || defined(__MINGW64__)
#define pow rb_w32_pow
#endif
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
#endif /* RUBY_WIN32_H */
diff --git a/inits.c b/inits.c
index fe0aade090..5822f04cab 100644
--- a/inits.c
+++ b/inits.c
@@ -9,7 +9,6 @@
**********************************************************************/
-#include "ruby/ruby.h"
#include "internal.h"
#define CALL(n) {void Init_##n(void); Init_##n();}
@@ -17,7 +16,8 @@
void
rb_call_inits(void)
{
- CALL(RandomSeed);
+ CALL(Method);
+ CALL(RandomSeedCore);
CALL(sym);
CALL(var_tables);
CALL(Object);
@@ -46,7 +46,6 @@ rb_call_inits(void)
CALL(Time);
CALL(Random);
CALL(signal);
- CALL(process);
CALL(load);
CALL(Proc);
CALL(Binding);
@@ -56,6 +55,7 @@ rb_call_inits(void)
CALL(VM);
CALL(ISeq);
CALL(Thread);
+ CALL(process);
CALL(Cont);
CALL(Rational);
CALL(Complex);
diff --git a/insns.def b/insns.def
index ad4bba6912..b6a87734c0 100644
--- a/insns.def
+++ b/insns.def
@@ -60,6 +60,7 @@ getlocal
int i, lev = (int)level;
VALUE *ep = GET_EP();
+ /* optimized insns generated for level == (0|1) in defs/opt_operand.def */
for (i = 0; i < lev; i++) {
ep = GET_PREV_EP(ep);
}
@@ -82,6 +83,7 @@ setlocal
int i, lev = (int)level;
VALUE *ep = GET_EP();
+ /* optimized insns generated for level == (0|1) in defs/opt_operand.def */
for (i = 0; i < lev; i++) {
ep = GET_PREV_EP(ep);
}
@@ -157,8 +159,7 @@ getclassvariable
()
(VALUE val)
{
- NODE *cref = rb_vm_get_cref(GET_ISEQ(), GET_EP());
- val = rb_cvar_get(vm_get_cvar_base(cref, GET_CFP()), id);
+ val = rb_cvar_get(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id);
}
/**
@@ -172,8 +173,7 @@ setclassvariable
(VALUE val)
()
{
- NODE *cref = rb_vm_get_cref(GET_ISEQ(), GET_EP());
- rb_cvar_set(vm_get_cvar_base(cref, GET_CFP()), id, val);
+ rb_cvar_set(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id, val);
}
/**
@@ -194,7 +194,7 @@ getconstant
(VALUE klass)
(VALUE val)
{
- val = vm_get_ev_const(th, GET_ISEQ(), klass, id, 0);
+ val = vm_get_ev_const(th, klass, id, 0);
}
/**
@@ -316,10 +316,10 @@ putspecialobject
val = rb_mRubyVMFrozenCore;
break;
case VM_SPECIAL_OBJECT_CBASE:
- val = vm_get_cbase(GET_ISEQ(), GET_EP());
+ val = vm_get_cbase(GET_EP());
break;
case VM_SPECIAL_OBJECT_CONST_BASE:
- val = vm_get_const_base(GET_ISEQ(), GET_EP());
+ val = vm_get_const_base(GET_EP());
break;
default:
rb_bug("putspecialobject insn: unknown value_type");
@@ -337,7 +337,7 @@ putiseq
()
(VALUE ret)
{
- ret = iseq->self;
+ ret = (VALUE)iseq;
}
/**
@@ -370,7 +370,7 @@ concatstrings
val = rb_str_resurrect(TOPN(i));
while (i-- > 0) {
const VALUE v = TOPN(i);
- rb_str_append(val, v);
+ rb_str_append_literal(val, v);
}
POPN(num);
}
@@ -391,6 +391,23 @@ tostring
/**
@c put
+ @e Freeze (dynamically) created strings.
+ @j (埋ã‚è¾¼ã¿ï¼‰æ–‡å­—列を freeze ã™ã‚‹ã€‚ã‚‚ã—ã€debug_info ãŒä¸Žãˆã‚‰ã‚Œã¦ã„れã°ã€ãれを設定ã™ã‚‹ã€‚
+ */
+DEFINE_INSN
+freezestring
+(VALUE debug_info)
+(VALUE str)
+(VALUE str)
+{
+ if (!NIL_P(debug_info)) {
+ rb_ivar_set(str, id_debug_created_info, debug_info);
+ }
+ rb_str_freeze(str);
+}
+
+/**
+ @c put
@e to Regexp
@j 文字列 str ã‚’æ­£è¦è¡¨ç¾ã«ã‚³ãƒ³ãƒ‘イルã—ã¦ã‚¹ã‚¿ãƒƒã‚¯ã«ãƒ—ッシュã™ã‚‹ã€‚
コンパイル時,opt ã‚’æ­£è¦è¡¨ç¾ã®ã‚ªãƒ—ションã¨ã™ã‚‹ã€‚
@@ -526,9 +543,7 @@ newhash
{
rb_num_t i;
- if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
- RUBY_DTRACE_HASH_CREATE(num, rb_sourcefile(), rb_sourceline());
- }
+ RUBY_DTRACE_CREATE_HOOK(HASH, num);
val = rb_hash_new();
@@ -623,6 +638,28 @@ swap
/**
@c stack
+ @e reverse stack top N order.
+ @j スタックトップ㮠n 個ã®å€¤ã‚’逆転ã™ã‚‹ã€‚
+ */
+DEFINE_INSN
+reverse
+(rb_num_t n)
+(...)
+(...) // inc += 0;
+{
+ rb_num_t i;
+ VALUE *sp = STACK_ADDR_FROM_TOP(n);
+
+ for (i=0; i<n/2; i++) {
+ VALUE v0 = sp[i];
+ VALUE v1 = TOPN(i);
+ sp[i] = v1;
+ TOPN(i) = v0;
+ }
+}
+
+/**
+ @c stack
@e for stack caching.
@j スタックキャッシングã®çŠ¶æ…‹ã‚’èª¿æ•´ã™ã‚‹ãŸã‚ã«å¿…è¦ãªå‘½ä»¤ã€‚
*/
@@ -665,7 +702,7 @@ setn
/**
@c stack
- @e empt current stack
+ @e empty current stack
@j current stack を空ã«ã™ã‚‹ã€‚
*/
DEFINE_INSN
@@ -693,105 +730,7 @@ defined
(VALUE v)
(VALUE val)
{
- VALUE klass;
- enum defined_type expr_type = 0;
- enum defined_type type = (enum defined_type)op_type;
-
- val = Qnil;
-
- switch (type) {
- case DEFINED_IVAR:
- if (rb_ivar_defined(GET_SELF(), SYM2ID(obj))) {
- expr_type = DEFINED_IVAR;
- }
- break;
- case DEFINED_IVAR2:
- klass = vm_get_cbase(GET_ISEQ(), GET_EP());
- break;
- case DEFINED_GVAR:
- if (rb_gvar_defined(rb_global_entry(SYM2ID(obj)))) {
- expr_type = DEFINED_GVAR;
- }
- break;
- case DEFINED_CVAR: {
- 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 = DEFINED_CVAR;
- }
- break;
- }
- case DEFINED_CONST:
- klass = v;
- if (vm_get_ev_const(th, GET_ISEQ(), klass, SYM2ID(obj), 1)) {
- expr_type = DEFINED_CONST;
- }
- break;
- case DEFINED_FUNC:
- klass = CLASS_OF(v);
- if (rb_method_boundp(klass, SYM2ID(obj), 0)) {
- 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), 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 = DEFINED_METHOD;
- }
- }
- }
- {
- VALUE args[2];
- VALUE r;
-
- args[0] = obj; args[1] = Qfalse;
- r = rb_check_funcall(v, idRespond_to_missing, 2, args);
- if (r != Qundef && RTEST(r))
- expr_type = DEFINED_METHOD;
- }
- break;
- }
- case DEFINED_YIELD:
- if (GET_BLOCK_PTR()) {
- expr_type = DEFINED_YIELD;
- }
- break;
- case DEFINED_ZSUPER:{
- rb_call_info_t cit;
- if (vm_search_superclass(GET_CFP(), GET_ISEQ(), Qnil, &cit) == 0) {
- VALUE klass = cit.klass;
- ID id = cit.mid;
- if (rb_method_boundp(klass, id, 0)) {
- expr_type = DEFINED_ZSUPER;
- }
- }
- break;
- }
- case DEFINED_REF:{
- val = vm_getspecial(th, GET_LEP(), Qfalse, FIX2INT(obj));
- if (val != Qnil) {
- expr_type = DEFINED_GVAR;
- }
- break;
- }
- default:
- rb_bug("unimplemented defined? type (VM)");
- break;
- }
- if (expr_type != 0) {
- if (needstr != Qfalse) {
- val = rb_iseq_defined_string(expr_type);
- }
- else {
- val = Qtrue;
- }
- }
+ val = vm_defined(th, GET_CFP(), op_type, obj, needstr, v);
}
/**
@@ -832,6 +771,30 @@ checkmatch
/**
@c setting
+ @e check keywords are specified or not.
+ @j ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹
+ */
+DEFINE_INSN
+checkkeyword
+(lindex_t kw_bits_index, rb_num_t keyword_index)
+()
+(VALUE ret)
+{
+ const VALUE *ep = GET_EP();
+ const VALUE kw_bits = *(ep - kw_bits_index);
+
+ if (FIXNUM_P(kw_bits)) {
+ int bits = FIX2INT(kw_bits);
+ ret = (bits & (0x01 << keyword_index)) ? Qfalse : Qtrue;
+ }
+ else {
+ assert(RB_TYPE_P(kw_bits, T_HASH));
+ ret = rb_hash_has_key(kw_bits, INT2FIX(keyword_index)) ? Qfalse : Qtrue;
+ }
+}
+
+/**
+ @c setting
@e trace
@j trace 用ã®å‘½ä»¤ã€‚
*/
@@ -848,7 +811,7 @@ trace
RUBY_DTRACE_CMETHOD_ENTRY_ENABLED() ||
RUBY_DTRACE_CMETHOD_RETURN_ENABLED()) {
- switch(flag) {
+ switch (flag) {
case RUBY_EVENT_CALL:
RUBY_DTRACE_METHOD_ENTRY_HOOK(th, 0, 0);
break;
@@ -875,7 +838,7 @@ trace
/**
@c class/module
@e
- enter class definition scope. if super is Qfalse, and clsas
+ enter class definition scope. if super is Qfalse, and class
"klass" is defined, it's redefine. otherwise, define "klass" class.
@j クラス定義スコープã¸ç§»è¡Œã™ã‚‹ã€‚
ã‚‚ã— super ㌠Qfalse ã§ klassクラスãŒå®šç¾©ã•れã¦ã„れã°å†å®šç¾©ã§ã‚る。
@@ -896,12 +859,8 @@ defineclass
if (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags) &&
!RB_TYPE_P(super, T_CLASS)) {
- rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
- rb_obj_classname(super));
- }
-
- if (super == Qnil) {
- super = rb_cObject;
+ rb_raise(rb_eTypeError, "superclass must be a Class (%"PRIsVALUE" given)",
+ rb_obj_class(super));
}
vm_check_if_namespace(cbase);
@@ -913,20 +872,23 @@ defineclass
klass = VM_DEFINECLASS_SCOPED_P(flags) ?
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));
+ rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a class", rb_id2str(id));
}
- if (super != rb_cObject) {
+ if (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
VALUE tmp;
tmp = rb_class_real(RCLASS_SUPER(klass));
if (tmp != super) {
- rb_raise(rb_eTypeError, "superclass mismatch for class %s",
- rb_id2name(id));
+ rb_raise(rb_eTypeError, "superclass mismatch for class %"PRIsVALUE"",
+ rb_id2str(id));
}
}
}
else {
+ if (!VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
+ super = rb_cObject;
+ }
/* new class declaration */
klass = rb_define_class_id(id, super);
rb_set_class_path_string(klass, cbase, rb_id2str(id));
@@ -951,7 +913,7 @@ defineclass
rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
/* already exist */
if (!RB_TYPE_P(klass, T_MODULE)) {
- rb_raise(rb_eTypeError, "%s is not a module", rb_id2name(id));
+ rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a module", rb_id2str(id));
}
}
else {
@@ -965,13 +927,15 @@ defineclass
rb_bug("unknown defineclass type: %d", (int)type);
}
- COPY_CREF(class_iseq->cref_stack, vm_cref_push(th, klass, NOEX_PUBLIC, NULL));
+ rb_iseq_check(class_iseq);
/* enter scope */
- 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, class_iseq->stack_max);
+ vm_push_frame(th, class_iseq, VM_FRAME_MAGIC_CLASS, klass,
+ VM_ENVVAL_BLOCK_PTR(GET_BLOCK_PTR()),
+ (VALUE)vm_cref_push(th, klass, NULL, FALSE),
+ class_iseq->body->iseq_encoded, GET_SP(),
+ class_iseq->body->local_size,
+ class_iseq->body->stack_max);
RESTORE_REGS();
NEXT_INSN();
}
@@ -988,15 +952,15 @@ defineclass
*/
DEFINE_INSN
send
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc, ISEQ blockiseq)
(...)
(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- 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);
+ struct rb_calling_info calling;
+
+ vm_caller_setup_arg_block(th, reg_cfp, &calling, ci, blockiseq, FALSE);
+ vm_search_method(ci, cc, calling.recv = TOPN(calling.argc = ci->orig_argc));
+ CALL_METHOD(&calling, ci, cc);
}
DEFINE_INSN
@@ -1015,17 +979,19 @@ opt_str_freeze
/**
@c optimize
- @e Invoke method without block, splat
- @j Invoke method without block, splat
+ @e Invoke method without block
+ @j Invoke method without block
*/
DEFINE_INSN
-opt_send_simple
-(CALL_INFO ci)
+opt_send_without_block
+(CALL_INFO ci, CALL_CACHE cc)
(...)
(VALUE val) // inc += -ci->orig_argc;
{
- vm_search_method(ci, ci->recv = TOPN(ci->argc));
- CALL_METHOD(ci);
+ struct rb_calling_info calling;
+ calling.blockptr = NULL;
+ vm_search_method(ci, cc, calling.recv = TOPN(calling.argc = ci->orig_argc));
+ CALL_METHOD(&calling, ci, cc);
}
/**
@@ -1035,19 +1001,17 @@ opt_send_simple
*/
DEFINE_INSN
invokesuper
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc, ISEQ blockiseq)
(...)
(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- ci->argc = ci->orig_argc;
- ci->blockptr = !(ci->flag & VM_CALL_ARGS_BLOCKARG) ? GET_BLOCK_PTR() : 0;
+ struct rb_calling_info calling;
+ calling.argc = ci->orig_argc;
- if (UNLIKELY(!(ci->flag & VM_CALL_ARGS_SKIP_SETUP))) {
- vm_caller_setup_args(th, reg_cfp, ci);
- }
- ci->recv = GET_SELF();
- vm_search_super_method(th, GET_CFP(), ci);
- CALL_METHOD(ci);
+ vm_caller_setup_arg_block(th, reg_cfp, &calling, ci, blockiseq, TRUE);
+ calling.recv = GET_SELF();
+ vm_search_super_method(th, GET_CFP(), &calling, ci, cc);
+ CALL_METHOD(&calling, ci, cc);
}
/**
@@ -1061,10 +1025,12 @@ invokeblock
(...)
(VALUE val) // inc += 1 - ci->orig_argc;
{
- ci->argc = ci->orig_argc;
- ci->blockptr = 0;
- ci->recv = GET_SELF();
- val = vm_invoke_block(th, GET_CFP(), ci);
+ struct rb_calling_info calling;
+ calling.argc = ci->orig_argc;
+ calling.blockptr = NULL;
+ calling.recv = GET_SELF();
+
+ val = vm_invoke_block(th, GET_CFP(), &calling, ci);
if (val == Qundef) {
RESTORE_REGS();
NEXT_INSN();
@@ -1083,9 +1049,10 @@ leave
(VALUE val)
{
if (OPT_CHECKED_RUN) {
- if (reg_cfp->sp != vm_base_ptr(reg_cfp)) {
+ const VALUE *const bp = vm_base_ptr(reg_cfp);
+ if (reg_cfp->sp != bp) {
rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")",
- VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, vm_base_ptr(reg_cfp)));
+ VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, bp));
}
}
@@ -1181,6 +1148,23 @@ branchunless
}
}
+/**
+ @c jump
+ @e if val is nil, set PC to (PC + dst).
+ @j ã‚‚ã— val ㌠nil ãªã‚‰ã°ã€PC ã‚’ (PC + dst) ã«ã™ã‚‹ã€‚
+ */
+DEFINE_INSN
+branchnil
+(OFFSET dst)
+(VALUE val)
+()
+{
+ if (NIL_P(val)) {
+ RUBY_VM_CHECK_INTS(th);
+ JUMP(dst);
+ }
+}
+
/**********************************************************/
/* for optimize */
@@ -1197,7 +1181,8 @@ getinlinecache
()
(VALUE val)
{
- if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE()) {
+ if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE() &&
+ (ic->ic_cref == NULL || ic->ic_cref == rb_vm_get_cref(GET_EP()))) {
val = ic->ic_value.value;
JUMP(dst);
}
@@ -1218,11 +1203,10 @@ setinlinecache
(VALUE val)
(VALUE val)
{
- if (ic->ic_value.value == Qundef) {
- rb_iseq_add_mark_object(GET_ISEQ(), val);
- }
+ VM_ASSERT(ic->ic_value.value != Qundef);
ic->ic_value.value = val;
ic->ic_serial = GET_GLOBAL_CONSTANT_STATE() - ruby_vm_const_missing_count;
+ ic->ic_cref = vm_get_const_key_cref(GET_EP());
ruby_vm_const_missing_count = 0;
}
@@ -1239,28 +1223,27 @@ once
{
union iseq_inline_storage_entry *is = (union iseq_inline_storage_entry *)ic;
+#define RUNNING_THREAD_ONCE_DONE ((rb_thread_t *)(0x1))
retry:
- if (is->once.done == Qfalse) {
- if (is->once.running_thread == NULL) {
- is->once.running_thread = th;
- val = is->once.value = rb_ensure(vm_once_exec, (VALUE)iseq, vm_once_clear, (VALUE)is);
- /* is->once.running_thread is cleared by vm_once_clear() */
- is->once.done = Qtrue;
- rb_iseq_add_mark_object(GET_ISEQ(), val);
- }
- else if (is->once.running_thread == th) {
- /* recursive once */
- val = vm_once_exec(iseq);
- }
- else {
- /* waiting for finish */
- RUBY_VM_CHECK_INTS(th);
- rb_thread_schedule();
- goto retry;
- }
+ if (is->once.running_thread == RUNNING_THREAD_ONCE_DONE) {
+ val = is->once.value;
+ }
+ else if (is->once.running_thread == NULL) {
+ is->once.running_thread = th;
+ val = is->once.value = rb_ensure(vm_once_exec, (VALUE)iseq, vm_once_clear, (VALUE)is);
+ /* is->once.running_thread is cleared by vm_once_clear() */
+ is->once.running_thread = RUNNING_THREAD_ONCE_DONE; /* success */
+ rb_iseq_add_mark_object(GET_ISEQ(), val);
+ }
+ else if (is->once.running_thread == th) {
+ /* recursive once */
+ val = vm_once_exec((VALUE)iseq);
}
else {
- val = is->once.value;
+ /* waiting for finish */
+ RUBY_VM_CHECK_INTS(th);
+ rb_thread_schedule();
+ goto retry;
}
}
@@ -1278,10 +1261,13 @@ opt_case_dispatch
switch(TYPE(key)) {
case T_FLOAT: {
double ival;
- if (modf(RFLOAT_VALUE(key), &ival) == 0.0) {
+ if (modf(RFLOAT_VALUE(key), &ival) == 0.0 && !isinf(ival)) {
key = FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
}
}
+ case T_TRUE:
+ case T_FALSE:
+ case T_NIL:
case T_SYMBOL: /* fall through */
case T_FIXNUM:
case T_BIGNUM:
@@ -1289,7 +1275,11 @@ opt_case_dispatch
if (BASIC_OP_UNREDEFINED_P(BOP_EQQ,
SYMBOL_REDEFINED_OP_FLAG |
FIXNUM_REDEFINED_OP_FLAG |
+ FLOAT_REDEFINED_OP_FLAG |
BIGNUM_REDEFINED_OP_FLAG |
+ NIL_REDEFINED_OP_FLAG |
+ TRUE_REDEFINED_OP_FLAG |
+ FALSE_REDEFINED_OP_FLAG |
STRING_REDEFINED_OP_FLAG)) {
st_data_t val;
if (st_lookup(RHASH_TBL_RAW(hash), key, &val)) {
@@ -1314,7 +1304,7 @@ opt_case_dispatch
*/
DEFINE_INSN
opt_plus
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1377,7 +1367,7 @@ opt_plus
*/
DEFINE_INSN
opt_minus
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1425,7 +1415,7 @@ opt_minus
*/
DEFINE_INSN
opt_mult
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1475,7 +1465,7 @@ opt_mult
*/
DEFINE_INSN
opt_div
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1538,7 +1528,7 @@ opt_div
*/
DEFINE_INSN
opt_mod
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1550,12 +1540,13 @@ opt_mod
y = FIX2LONG(obj);
if (x > 0 && y > 0) {
val = LONG2FIX(x % y);
- } else {
+ }
+ else {
/* copied from numeric.c#fixdivmod */
long div, mod;
if (y == 0)
- rb_num_zerodiv();
+ goto INSN_LABEL(normal_dispatch);
if (y < 0) {
if (x < 0)
div = -x / -y;
@@ -1604,11 +1595,11 @@ opt_mod
*/
DEFINE_INSN
opt_eq
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = opt_eq_func(recv, obj, ci);
+ val = opt_eq_func(recv, obj, ci, cc);
if (val == Qundef) {
/* other */
@@ -1625,16 +1616,17 @@ opt_eq
*/
DEFINE_INSN
opt_neq
-(CALL_INFO ci, CALL_INFO ci_eq)
+(CALL_INFO ci, CALL_CACHE cc, CALL_INFO ci_eq, CALL_CACHE cc_eq)
(VALUE recv, VALUE obj)
(VALUE val)
{
extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
- vm_search_method(ci, recv);
+ vm_search_method(ci, cc, recv);
+
val = Qundef;
- if (check_cfunc(ci->me, rb_obj_not_equal)) {
- val = opt_eq_func(recv, obj, ci_eq);
+ if (check_cfunc(cc->me, rb_obj_not_equal)) {
+ val = opt_eq_func(recv, obj, ci_eq, cc_eq);
if (val != Qundef) {
val = RTEST(val) ? Qfalse : Qtrue;
@@ -1656,7 +1648,7 @@ opt_neq
*/
DEFINE_INSN
opt_lt
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1700,7 +1692,7 @@ opt_lt
*/
DEFINE_INSN
opt_le
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1735,7 +1727,7 @@ opt_le
*/
DEFINE_INSN
opt_gt
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1779,7 +1771,7 @@ opt_gt
*/
DEFINE_INSN
opt_ge
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1813,7 +1805,7 @@ opt_ge
*/
DEFINE_INSN
opt_ltlt
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1845,7 +1837,7 @@ opt_ltlt
*/
DEFINE_INSN
opt_aref
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj)
(VALUE val)
{
@@ -1875,7 +1867,7 @@ opt_aref
*/
DEFINE_INSN
opt_aset
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv, VALUE obj, VALUE set)
(VALUE val)
{
@@ -1903,12 +1895,59 @@ opt_aset
/**
@c optimize
+ @e recv[str] = set
+ @j 最é©åŒ–ã•れ㟠recv[str] = set。
+ */
+DEFINE_INSN
+opt_aset_with
+(CALL_INFO ci, CALL_CACHE cc, VALUE key)
+(VALUE recv, VALUE val)
+(VALUE val)
+{
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG) &&
+ rb_hash_compare_by_id_p(recv) == Qfalse) {
+ rb_hash_aset(recv, key, val);
+ }
+ else {
+ PUSH(recv);
+ PUSH(rb_str_resurrect(key));
+ PUSH(val);
+ CALL_SIMPLE_METHOD(recv);
+ }
+}
+
+/**
+ @c optimize
+ @e recv[str]
+ @j 最é©åŒ–ã•れ㟠recv[str]。
+ */
+DEFINE_INSN
+opt_aref_with
+(CALL_INFO ci, CALL_CACHE cc, VALUE key)
+(VALUE recv)
+(VALUE val)
+{
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG) &&
+ rb_hash_compare_by_id_p(recv) == Qfalse) {
+ val = rb_hash_aref(recv, key);
+ }
+ else {
+ PUSH(recv);
+ PUSH(rb_str_resurrect(key));
+ CALL_SIMPLE_METHOD(recv);
+ }
+}
+
+/**
+ @c optimize
@e optimized length
@j 最é©åŒ–ã•れ㟠recv.length()。
*/
DEFINE_INSN
opt_length
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv)
(VALUE val)
{
@@ -1943,7 +1982,7 @@ opt_length
*/
DEFINE_INSN
opt_size
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv)
(VALUE val)
{
@@ -1978,7 +2017,7 @@ opt_size
*/
DEFINE_INSN
opt_empty_p
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv)
(VALUE val)
{
@@ -2016,7 +2055,7 @@ opt_empty_p
*/
DEFINE_INSN
opt_succ
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv)
(VALUE val)
{
@@ -2040,12 +2079,7 @@ opt_succ
BASIC_OP_UNREDEFINED_P(BOP_SUCC, STRING_REDEFINED_OP_FLAG)) {
val = rb_str_succ(recv);
}
- else if (RBASIC_CLASS(recv) == rb_cTime &&
- BASIC_OP_UNREDEFINED_P(BOP_SUCC, TIME_REDEFINED_OP_FLAG)) {
- val = rb_time_succ(recv);
- }
- else
- {
+ else {
goto INSN_LABEL(normal_dispatch);
}
}
@@ -2063,14 +2097,15 @@ opt_succ
*/
DEFINE_INSN
opt_not
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE recv)
(VALUE val)
{
extern VALUE rb_obj_not(VALUE obj);
- vm_search_method(ci, recv);
- if (check_cfunc(ci->me, rb_obj_not)) {
+ vm_search_method(ci, cc, recv);
+
+ if (check_cfunc(cc->me, rb_obj_not)) {
val = RTEST(recv) ? Qfalse : Qtrue;
}
else {
@@ -2093,7 +2128,8 @@ opt_regexpmatch1
{
if (BASIC_OP_UNREDEFINED_P(BOP_MATCH, REGEXP_REDEFINED_OP_FLAG)) {
val = rb_reg_match(r, obj);
- } else {
+ }
+ else {
val = rb_funcall(r, idEqTilde, 1, obj);
}
}
@@ -2105,11 +2141,11 @@ opt_regexpmatch1
*/
DEFINE_INSN
opt_regexpmatch2
-(CALL_INFO ci)
+(CALL_INFO ci, CALL_CACHE cc)
(VALUE obj2, VALUE obj1)
(VALUE val)
{
- if (RB_TYPE_P(obj2, T_STRING) &&
+ if (CLASS_OF(obj2) == rb_cString &&
BASIC_OP_UNREDEFINED_P(BOP_MATCH, STRING_REDEFINED_OP_FLAG)) {
val = rb_reg_match(obj1, obj2);
}
diff --git a/internal.h b/internal.h
index 40916a59a2..14af6f0173 100644
--- a/internal.h
+++ b/internal.h
@@ -12,6 +12,10 @@
#ifndef RUBY_INTERNAL_H
#define RUBY_INTERNAL_H 1
+#include "ruby.h"
+#include "ruby/encoding.h"
+#include "ruby/io.h"
+
#if defined(__cplusplus)
extern "C" {
#if 0
@@ -19,6 +23,35 @@ extern "C" {
#endif
#endif
+/* likely */
+#if __GNUC__ >= 3
+#define LIKELY(x) (__builtin_expect(!!(x), 1))
+#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
+#else /* __GNUC__ >= 3 */
+#define LIKELY(x) (x)
+#define UNLIKELY(x) (x)
+#endif /* __GNUC__ >= 3 */
+
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+
+#if __has_attribute(unused)
+#define UNINITIALIZED_VAR(x) x __attribute__((unused))
+#elif defined(__GNUC__) && __GNUC__ >= 3
+#define UNINITIALIZED_VAR(x) x = x
+#else
+#define UNINITIALIZED_VAR(x) x
+#endif
+
+#if __has_attribute(warn_unused_result)
+#define WARN_UNUSED_RESULT(x) x __attribute__((warn_unused_result))
+#elif defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 3004
+#define WARN_UNUSED_RESULT(x) x __attribute__((warn_unused_result))
+#else
+#define WARN_UNUSED_RESULT(x) x
+#endif
+
#ifdef HAVE_VALGRIND_MEMCHECK_H
# include <valgrind/memcheck.h>
# ifndef VALGRIND_MAKE_MEM_DEFINED
@@ -34,14 +67,26 @@ extern "C" {
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
-#define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
-
#define GCC_VERSION_SINCE(major, minor, patchlevel) \
(defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
((__GNUC__ > (major)) || \
(__GNUC__ == (major) && __GNUC_MINOR__ > (minor)) || \
(__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))
+#ifndef __has_feature
+# define __has_feature(x) 0
+#endif
+
+#ifndef __has_extension
+# define __has_extension __has_feature
+#endif
+
+#if GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
+# define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
+#else
+# define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
+#endif
+
#define SIGNED_INTEGER_TYPE_P(int_type) (0 > ((int_type)0)-1)
#define SIGNED_INTEGER_MAX(sint_type) \
(sint_type) \
@@ -238,6 +283,160 @@ nlz_int128(uint128_t x)
SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)))
#endif
+#ifndef BDIGIT
+# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
+# define BDIGIT unsigned int
+# define SIZEOF_BDIGIT SIZEOF_INT
+# define BDIGIT_DBL unsigned LONG_LONG
+# define BDIGIT_DBL_SIGNED LONG_LONG
+# define PRI_BDIGIT_PREFIX ""
+# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
+# elif SIZEOF_INT*2 <= SIZEOF_LONG
+# define BDIGIT unsigned int
+# define SIZEOF_BDIGIT SIZEOF_INT
+# define BDIGIT_DBL unsigned long
+# define BDIGIT_DBL_SIGNED long
+# define PRI_BDIGIT_PREFIX ""
+# define PRI_BDIGIT_DBL_PREFIX "l"
+# elif SIZEOF_SHORT*2 <= SIZEOF_LONG
+# define BDIGIT unsigned short
+# define SIZEOF_BDIGIT SIZEOF_SHORT
+# define BDIGIT_DBL unsigned long
+# define BDIGIT_DBL_SIGNED long
+# define PRI_BDIGIT_PREFIX "h"
+# define PRI_BDIGIT_DBL_PREFIX "l"
+# else
+# define BDIGIT unsigned short
+# define SIZEOF_BDIGIT (SIZEOF_LONG/2)
+# define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG
+# define BDIGIT_DBL unsigned long
+# define BDIGIT_DBL_SIGNED long
+# define PRI_BDIGIT_PREFIX "h"
+# define PRI_BDIGIT_DBL_PREFIX "l"
+# endif
+#endif
+#ifndef SIZEOF_ACTUAL_BDIGIT
+# define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGIT
+#endif
+
+#ifdef PRI_BDIGIT_PREFIX
+# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
+# define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
+# define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
+# define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
+# define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
+# define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
+#endif
+
+#ifdef PRI_BDIGIT_DBL_PREFIX
+# define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
+# define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
+# define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
+# define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
+# define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
+# define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
+#endif
+
+#define BIGNUM_EMBED_LEN_NUMBITS 3
+#ifndef BIGNUM_EMBED_LEN_MAX
+# if (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1
+# define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT)
+# else
+# define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1)
+# endif
+#endif
+
+struct RBignum {
+ struct RBasic basic;
+ union {
+ struct {
+ size_t len;
+ BDIGIT *digits;
+ } heap;
+ BDIGIT ary[BIGNUM_EMBED_LEN_MAX];
+ } as;
+};
+#define BIGNUM_SIGN_BIT FL_USER1
+/* sign: positive:1, negative:0 */
+#define BIGNUM_SIGN(b) ((RBASIC(b)->flags & BIGNUM_SIGN_BIT) != 0)
+#define BIGNUM_SET_SIGN(b,sign) \
+ ((sign) ? (RBASIC(b)->flags |= BIGNUM_SIGN_BIT) \
+ : (RBASIC(b)->flags &= ~BIGNUM_SIGN_BIT))
+#define BIGNUM_POSITIVE_P(b) BIGNUM_SIGN(b)
+#define BIGNUM_NEGATIVE_P(b) (!BIGNUM_SIGN(b))
+
+#define BIGNUM_EMBED_FLAG FL_USER2
+#define BIGNUM_EMBED_LEN_MASK (FL_USER5|FL_USER4|FL_USER3)
+#define BIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+BIGNUM_EMBED_LEN_NUMBITS)
+#define BIGNUM_LEN(b) \
+ ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
+ (long)((RBASIC(b)->flags >> BIGNUM_EMBED_LEN_SHIFT) & \
+ (BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT)) : \
+ RBIGNUM(b)->as.heap.len)
+/* LSB:BIGNUM_DIGITS(b)[0], MSB:BIGNUM_DIGITS(b)[BIGNUM_LEN(b)-1] */
+#define BIGNUM_DIGITS(b) \
+ ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
+ RBIGNUM(b)->as.ary : \
+ RBIGNUM(b)->as.heap.digits)
+#define BIGNUM_LENINT(b) rb_long2int(BIGNUM_LEN(b))
+
+#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
+
+struct RRational {
+ struct RBasic basic;
+ const VALUE num;
+ const VALUE den;
+};
+
+#define RRATIONAL(obj) (R_CAST(RRational)(obj))
+
+struct RFloat {
+ struct RBasic basic;
+ double float_value;
+};
+
+#define RFLOAT(obj) (R_CAST(RFloat)(obj))
+
+struct RComplex {
+ struct RBasic basic;
+ const VALUE real;
+ const VALUE imag;
+};
+
+#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
+
+#ifdef RCOMPLEX_SET_REAL /* shortcut macro for internal only */
+#undef RCOMPLEX_SET_REAL
+#undef RCOMPLEX_SET_IMAG
+#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
+#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
+#endif
+
+struct RHash {
+ struct RBasic basic;
+ struct st_table *ntbl; /* possibly 0 */
+ int iter_lev;
+ const VALUE ifnone;
+};
+
+#define RHASH(obj) (R_CAST(RHash)(obj))
+
+#ifdef RHASH_ITER_LEV
+#undef RHASH_ITER_LEV
+#undef RHASH_IFNONE
+#undef RHASH_SIZE
+#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
+#define RHASH_IFNONE(h) (RHASH(h)->ifnone)
+#define RHASH_SIZE(h) (RHASH(h)->ntbl ? (st_index_t)RHASH(h)->ntbl->num_entries : 0)
+#endif
+
+/* missing/setproctitle.c */
+#ifndef HAVE_SETPROCTITLE
+extern void ruby_init_setproctitle(int argc, char *argv[]);
+#endif
+
+/* class.c */
+
struct rb_deprecated_classext_struct {
char conflict[sizeof(VALUE) * 3];
};
@@ -265,6 +464,7 @@ struct rb_classext_struct {
struct st_table *iv_index_tbl;
struct st_table *iv_tbl;
struct st_table *const_tbl;
+ struct rb_id_table *callable_m_tbl;
rb_subclass_entry_t *subclasses;
rb_subclass_entry_t **parent_subclasses;
/**
@@ -274,38 +474,42 @@ struct rb_classext_struct {
*/
rb_subclass_entry_t **module_subclasses;
rb_serial_t class_serial;
- VALUE origin;
+ const VALUE origin_;
VALUE refined_class;
rb_alloc_func_t allocator;
};
-struct method_table_wrapper {
- st_table *tbl;
- size_t serial;
+typedef struct rb_classext_struct rb_classext_t;
+
+#undef RClass
+struct RClass {
+ struct RBasic basic;
+ VALUE super;
+ rb_classext_t *ptr;
+ struct rb_id_table *m_tbl;
};
-/* class.c */
void rb_class_subclass_add(VALUE super, VALUE klass);
void rb_class_remove_from_super_subclasses(VALUE);
+int rb_singleton_class_internal_p(VALUE sklass);
#define RCLASS_EXT(c) (RCLASS(c)->ptr)
#define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
-#define RCLASS_M_TBL_WRAPPER(c) (RCLASS(c)->m_tbl_wrapper)
-#define RCLASS_M_TBL(c) (RCLASS_M_TBL_WRAPPER(c) ? RCLASS_M_TBL_WRAPPER(c)->tbl : 0)
+#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
+#define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
#define RCLASS_IV_INDEX_TBL(c) (RCLASS_EXT(c)->iv_index_tbl)
-#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin)
+#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
#define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
+#define RICLASS_IS_ORIGIN FL_USER5
+
static inline void
-RCLASS_M_TBL_INIT(VALUE c)
+RCLASS_SET_ORIGIN(VALUE klass, VALUE origin)
{
- struct method_table_wrapper *wrapper;
- wrapper = ALLOC(struct method_table_wrapper);
- wrapper->tbl = st_init_numtable();
- wrapper->serial = 0;
- RCLASS_M_TBL_WRAPPER(c) = wrapper;
+ RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
+ if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN);
}
#undef RCLASS_SUPER
@@ -325,35 +529,170 @@ RCLASS_SET_SUPER(VALUE klass, VALUE super)
RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
return super;
}
+/* IMEMO: Internal memo object */
+
+#ifndef IMEMO_DEBUG
+#define IMEMO_DEBUG 0
+#endif
+
+struct RIMemo {
+ VALUE flags;
+ VALUE v0;
+ VALUE v1;
+ VALUE v2;
+ VALUE v3;
+};
+
+enum imemo_type {
+ imemo_none = 0,
+ imemo_cref = 1,
+ imemo_svar = 2,
+ imemo_throw_data = 3,
+ imemo_ifunc = 4,
+ imemo_memo = 5,
+ imemo_ment = 6,
+ imemo_iseq = 7,
+ imemo_mask = 0x07
+};
+
+static inline enum imemo_type
+imemo_type(VALUE imemo)
+{
+ return (RBASIC(imemo)->flags >> FL_USHIFT) & imemo_mask;
+}
+
+/* FL_USER0 to FL_USER2 is for type */
+#define IMEMO_FL_USHIFT (FL_USHIFT + 3)
+#define IMEMO_FL_USER0 FL_USER3
+#define IMEMO_FL_USER1 FL_USER4
+#define IMEMO_FL_USER2 FL_USER5
+#define IMEMO_FL_USER3 FL_USER6
+#define IMEMO_FL_USER4 FL_USER7
+
+/* CREF in method.h */
+
+/* SVAR */
+
+struct vm_svar {
+ VALUE flags;
+ const VALUE cref_or_me;
+ const VALUE lastline;
+ const VALUE backref;
+ const VALUE others;
+};
+
+/* THROW_DATA */
+
+#define THROW_DATA_CONSUMED IMEMO_FL_USER0
+
+struct vm_throw_data {
+ VALUE flags;
+ VALUE reserved;
+ const VALUE throw_obj;
+ const struct rb_control_frame_struct *catch_frame;
+ VALUE throw_state;
+};
+
+#define THROW_DATA_P(err) RB_TYPE_P((VALUE)(err), T_IMEMO)
+
+/* IFUNC */
+
+struct vm_ifunc {
+ VALUE flags;
+ VALUE reserved;
+ VALUE (*func)(ANYARGS);
+ const void *data;
+ ID id;
+};
+
+#define IFUNC_NEW(a, b, c) ((struct vm_ifunc *)rb_imemo_new(imemo_ifunc, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
+
+/* MEMO */
+
+struct MEMO {
+ VALUE flags;
+ VALUE reserved;
+ const VALUE v1;
+ const VALUE v2;
+ union {
+ long cnt;
+ long state;
+ const VALUE value;
+ VALUE (*func)(ANYARGS);
+ } u3;
+};
+
+#define MEMO_V1_SET(m, v) RB_OBJ_WRITE((memo), &(memo)->v1, (v))
+#define MEMO_V2_SET(m, v) RB_OBJ_WRITE((memo), &(memo)->v2, (v))
+
+#define MEMO_CAST(m) ((struct MEMO *)m)
+
+#define MEMO_NEW(a, b, c) ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
+
+#define roomof(x, y) (((x) + (y) - 1) / (y))
+#define type_roomof(x, y) roomof(sizeof(x), sizeof(y))
+#define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value))
+#define NEW_MEMO_FOR(type, value) \
+ ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value))
+
+/* ment is in method.h */
+
+/* global variable */
+
+struct rb_global_entry {
+ struct rb_global_variable *var;
+ ID id;
+};
+
+struct rb_global_entry *rb_global_entry(ID);
+VALUE rb_gvar_get(struct rb_global_entry *);
+VALUE rb_gvar_set(struct rb_global_entry *, VALUE);
+VALUE rb_gvar_defined(struct rb_global_entry *);
struct vtm; /* defined by timev.h */
/* array.c */
-VALUE rb_ary_last(int, VALUE *, VALUE);
+VALUE rb_ary_last(int, const VALUE *, VALUE);
void rb_ary_set_len(VALUE, long);
void rb_ary_delete_same(VALUE, VALUE);
+VALUE rb_ary_tmp_new_fill(long capa);
+VALUE rb_ary_at(VALUE, VALUE);
+size_t rb_ary_memsize(VALUE);
+#ifdef __GNUC__
+#define rb_ary_new_from_args(n, ...) \
+ __extension__ ({ \
+ const VALUE args_to_new_ary[] = {__VA_ARGS__}; \
+ if (__builtin_constant_p(n)) { \
+ STATIC_ASSERT(rb_ary_new_from_args, numberof(args_to_new_ary) == (n)); \
+ } \
+ rb_ary_new_from_values(numberof(args_to_new_ary), args_to_new_ary); \
+ })
+#endif
/* bignum.c */
+extern const char ruby_digitmap[];
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 */
-void rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE));
+void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
void rb_class_detach_subclasses(VALUE);
void rb_class_detach_module_subclasses(VALUE);
void rb_class_remove_from_module_subclasses(VALUE);
-VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
-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);
+VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj);
+VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj);
+VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj);
+VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj);
int rb_obj_basic_to_s_p(VALUE);
VALUE rb_special_singleton_class(VALUE);
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
VALUE rb_singleton_class_get(VALUE obj);
void Init_class_hierarchy(void);
+int rb_class_has_methods(VALUE c);
+
/* compar.c */
VALUE rb_invcmp(VALUE, VALUE);
@@ -374,43 +713,45 @@ void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(ANYARGS), VALUE
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
/* dmyext.c */
+void Init_enc(void);
void Init_ext(void);
/* encoding.c */
-#ifdef RUBY_ENCODING_H
-enum ruby_preserved_encindex {
- ENCINDEX_ASCII,
- ENCINDEX_UTF_8,
- ENCINDEX_US_ASCII,
-
- /* preserved indexes */
- ENCINDEX_UTF_16BE,
- ENCINDEX_UTF_16LE,
- ENCINDEX_UTF_32BE,
- ENCINDEX_UTF_32LE,
- ENCINDEX_UTF_16,
- ENCINDEX_UTF_32,
- ENCINDEX_UTF8_MAC,
-
- /* for old options of regexp */
- ENCINDEX_EUC_JP,
- ENCINDEX_Windows_31J,
-
- ENCINDEX_BUILTIN_MAX
-};
-#endif
-#define rb_ascii8bit_encindex() ENCINDEX_ASCII
-#define rb_utf8_encindex() ENCINDEX_UTF_8
-#define rb_usascii_encindex() ENCINDEX_US_ASCII
ID rb_id_encoding(void);
void rb_gc_mark_encodings(void);
+rb_encoding *rb_enc_get_from_index(int index);
+rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2);
+int rb_encdb_replicate(const char *alias, const char *orig);
+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);
+int rb_enc_set_dummy(int index);
+void rb_encdb_set_unicode(int index);
+int rb_data_is_encoding(VALUE obj);
+
+/* enum.c */
+VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
/* error.c */
+extern VALUE rb_eEAGAIN;
+extern VALUE rb_eEWOULDBLOCK;
+extern VALUE rb_eEINPROGRESS;
NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
+NORETURN(PRINTF_ARGS(void rb_compile_bug_str(VALUE file, int line, const char *fmt, ...), 3, 4));
+PRINTF_ARGS(void rb_compile_error_str(VALUE file, int line, void *enc, const char *fmt, ...), 4, 5);
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);
+PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
+PRINTF_ARGS(void rb_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
+PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
+VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method);
+#define rb_name_err_raise_str(mesg, recv, name) \
+ rb_exc_raise(rb_name_err_new(mesg, recv, name))
+#define rb_name_err_raise(mesg, recv, name) \
+ rb_name_err_raise_str(rb_fstring_cstr(mesg), (recv), (name))
/* eval.c */
VALUE rb_refinement_module_get_refined_class(VALUE module);
@@ -434,6 +775,7 @@ 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);
+int ruby_is_fd_loadable(int fd);
#ifdef RUBY_FUNCTION_NAME_STRING
# if defined __GNUC__ && __GNUC__ >= 4
@@ -452,12 +794,19 @@ NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path)
#endif
/* gc.c */
+extern VALUE *ruby_initial_gc_stress_ptr;
+extern int ruby_disable_gc;
void Init_heap(void);
void *ruby_mimmalloc(size_t size);
void ruby_mimfree(void *ptr);
void rb_objspace_set_event_hook(const rb_event_flag_t event);
-void rb_gc_writebarrier_remember_promoted(VALUE obj);
+#if USE_RGENGC
+void rb_gc_writebarrier_remember(VALUE obj);
+#else
+#define rb_gc_writebarrier_remember(obj) 0
+#endif
void ruby_gc_set_params(int safe_level);
+void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj);
#if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_SIZE) || defined(_WIN32)
#define ruby_sized_xrealloc(ptr, new_size, old_size) ruby_xrealloc(ptr, new_size)
@@ -473,11 +822,29 @@ void ruby_sized_xfree(void *x, size_t size);
void rb_gc_resurrect(VALUE ptr);
+/* optimized version of NEWOBJ() */
+#undef NEWOBJF_OF
+#undef RB_NEWOBJ_OF
+#define RB_NEWOBJ_OF(obj,type,klass,flags) \
+ type *(obj) = (type*)(((flags) & FL_WB_PROTECTED) ? \
+ rb_wb_protected_newobj_of(klass, (flags) & ~FL_WB_PROTECTED) : \
+ rb_wb_unprotected_newobj_of(klass, flags))
+#define NEWOBJ_OF(obj,type,klass,flags) RB_NEWOBJ_OF(obj,type,klass,flags)
+
/* hash.c */
struct st_table *rb_hash_tbl_raw(VALUE hash);
+VALUE rb_hash_has_key(VALUE hash, VALUE key);
+VALUE rb_hash_default_value(VALUE hash, VALUE key);
+VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc);
+long rb_objid_hash(st_index_t index);
+st_table *rb_init_identtable(void);
+st_table *rb_init_identtable_with_size(st_index_t size);
+VALUE rb_hash_compare_by_id_p(VALUE hash);
+
#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
VALUE rb_hash_keys(VALUE hash);
VALUE rb_hash_values(VALUE hash);
+VALUE rb_hash_rehash(VALUE hash);
#define HASH_DELETED FL_USER1
#define HASH_PROC_DEFAULT FL_USER2
@@ -491,32 +858,33 @@ ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
void rb_stdio_set_default_encoding(void);
void rb_write_error_str(VALUE mesg);
VALUE rb_io_flush_raw(VALUE, int);
-
-/* iseq.c */
-VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
-VALUE rb_iseq_path(VALUE iseqval);
-VALUE rb_iseq_absolute_path(VALUE iseqval);
-VALUE rb_iseq_label(VALUE iseqval);
-VALUE rb_iseq_base_label(VALUE iseqval);
-VALUE rb_iseq_first_lineno(VALUE iseqval);
-VALUE rb_iseq_klass(VALUE iseqval); /* completely temporary fucntion */
-VALUE rb_iseq_method_name(VALUE self);
+size_t rb_io_memsize(const rb_io_t *);
/* load.c */
VALUE rb_get_load_path(void);
VALUE rb_get_expanded_load_path(void);
+int rb_require_internal(VALUE fname, int safe);
NORETURN(void rb_load_fail(VALUE, const char*));
+/* loadpath.c */
+extern const char ruby_exec_prefix[];
+extern const char ruby_initial_load_paths[];
+
+/* localeinit.c */
+int Init_enc_set_filesystem_encoding(void);
+
/* math.c */
VALUE rb_math_atan2(VALUE, VALUE);
VALUE rb_math_cos(VALUE);
VALUE rb_math_cosh(VALUE);
VALUE rb_math_exp(VALUE);
VALUE rb_math_hypot(VALUE, VALUE);
-VALUE rb_math_log(int argc, VALUE *argv);
+VALUE rb_math_log(int argc, const VALUE *argv);
VALUE rb_math_sin(VALUE);
VALUE rb_math_sinh(VALUE);
+#if 0
VALUE rb_math_sqrt(VALUE);
+#endif
/* newline.c */
void Init_newline(void);
@@ -529,6 +897,7 @@ double ruby_float_mod(double x, double y);
int rb_num_negative_p(VALUE);
VALUE rb_int_succ(VALUE num);
VALUE rb_int_pred(VALUE num);
+VALUE rb_dbl_hash(double d);
#if USE_FLONUM
#define RUBY_BIT_ROTL(v, n) (((v) << (n)) | ((v) >> ((sizeof(v) * 8) - n)))
@@ -536,31 +905,41 @@ VALUE rb_int_pred(VALUE num);
#endif
static inline double
-rb_float_value_inline(VALUE v)
+rb_float_flonum_value(VALUE v)
{
#if USE_FLONUM
- 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;
- }
+ 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;
}
#endif
+ return 0.0;
+}
+
+static inline double
+rb_float_noflonum_value(VALUE v)
+{
return ((struct RFloat *)v)->float_value;
}
+static inline double
+rb_float_value_inline(VALUE v)
+{
+ if (FLONUM_P(v)) {
+ return rb_float_flonum_value(v);
+ }
+ return rb_float_noflonum_value(v);
+}
+
static inline VALUE
rb_float_new_inline(double d)
{
@@ -595,7 +974,12 @@ rb_float_new_inline(double d)
#define rb_float_new(d) rb_float_new_inline(d)
/* object.c */
+void rb_obj_copy_ivar(VALUE dest, VALUE obj);
VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
+VALUE rb_class_search_ancestor(VALUE klass, VALUE super);
+NORETURN(void rb_undefined_alloc(VALUE klass));
+double rb_num_to_dbl(VALUE val);
+VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound);
struct RBasicRaw {
VALUE flags;
@@ -610,6 +994,9 @@ struct RBasicRaw {
} while (0)
/* parse.y */
+#ifndef USE_SYMBOL_GC
+#define USE_SYMBOL_GC 1
+#endif
VALUE rb_parser_get_yydebug(VALUE);
VALUE rb_parser_set_yydebug(VALUE, VALUE);
int rb_is_const_name(VALUE name);
@@ -620,19 +1007,29 @@ 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(int full_mark);
+int rb_is_const_sym(VALUE sym);
+int rb_is_class_sym(VALUE sym);
+int rb_is_global_sym(VALUE sym);
+int rb_is_instance_sym(VALUE sym);
+int rb_is_attrset_sym(VALUE sym);
+int rb_is_local_sym(VALUE sym);
+int rb_is_method_sym(VALUE sym);
+int rb_is_junk_sym(VALUE sym);
+ID rb_make_internal_id(void);
+void rb_gc_free_dsymbol(VALUE);
+ID rb_id_attrget(ID id);
/* proc.c */
VALUE rb_proc_location(VALUE self);
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
int rb_block_arity(void);
+VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val);
+VALUE rb_func_lambda_new(rb_block_call_func_t func, VALUE val);
/* process.c */
#define RB_MAX_GROUPS (65536)
struct rb_execarg {
- int use_shell;
union {
struct {
VALUE shell_script;
@@ -648,6 +1045,7 @@ struct rb_execarg {
VALUE envp_str;
VALUE envp_buf;
VALUE dup2_tmpbuf;
+ unsigned use_shell : 1;
unsigned pgroup_given : 1;
unsigned umask_given : 1;
unsigned unsetenv_others_given : 1;
@@ -664,11 +1062,11 @@ struct rb_execarg {
mode_t umask_mask;
rb_uid_t uid;
rb_gid_t gid;
+ int close_others_maxhint;
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;
};
@@ -686,12 +1084,16 @@ void rb_last_status_clear(void);
/* rational.c */
VALUE rb_lcm(VALUE x, VALUE y);
VALUE rb_rational_reciprocal(VALUE x);
+VALUE rb_cstr_to_rat(const char *, int);
/* re.c */
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
VALUE rb_reg_check_preprocess(VALUE);
+long rb_reg_search0(VALUE, VALUE, long, int, int);
+void rb_backref_set_string(VALUE string, long pos, long len);
/* signal.c */
+extern int ruby_enable_coredump;
int rb_get_next_signal(void);
int rb_sigaltstack_size(void);
@@ -705,6 +1107,18 @@ size_t rb_strftime(char *s, size_t maxsize, const char *format, rb_encoding *enc
/* string.c */
VALUE rb_fstring(VALUE);
+VALUE rb_fstring_new(const char *ptr, long len);
+#define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str))
+#define rb_fstring_literal(str) rb_fstring_lit(str)
+VALUE rb_fstring_cstr(const char *str);
+#if defined(__GNUC__) && !defined(__PCC__)
+#define rb_fstring_cstr(str) __extension__ ( \
+{ \
+ (__builtin_constant_p(str)) ? \
+ rb_fstring_new((str), (long)strlen(str)) : \
+ rb_fstring_cstr(str); \
+})
+#endif
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
int rb_str_symname_p(VALUE);
VALUE rb_str_quote_unprintable(VALUE);
@@ -712,23 +1126,51 @@ VALUE rb_id_quote_unprintable(ID);
#define QUOTE(str) rb_str_quote_unprintable(str)
#define QUOTE_ID(id) rb_id_quote_unprintable(id)
void rb_str_fill_terminator(VALUE str, const int termlen);
+void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen);
VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
#ifdef RUBY_ENCODING_H
VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc);
+VALUE rb_str_cat_conv_enc_opts(VALUE newstr, long ofs, const char *ptr, long len,
+ rb_encoding *from, int ecflags, VALUE ecopts);
+VALUE rb_enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl);
#endif
-#define STR_NOEMBED FL_USER1
-#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
-#define STR_ASSOC FL_USER3
-#define STR_SHARED_P(s) FL_ALL((s), STR_NOEMBED|ELTS_SHARED)
-#define STR_ASSOC_P(s) FL_ALL((s), STR_NOEMBED|STR_ASSOC)
-#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC)
-#define STR_NOCAPA_P(s) (FL_TEST((s),STR_NOEMBED) && FL_ANY((s),ELTS_SHARED|STR_ASSOC))
-#define STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED))
+#define STR_NOEMBED FL_USER1
+#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
+#define STR_EMBED_P(str) (!FL_TEST_RAW((str), STR_NOEMBED))
+#define STR_SHARED_P(s) FL_ALL_RAW((s), STR_NOEMBED|ELTS_SHARED)
#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN)
+size_t rb_str_memsize(VALUE);
+VALUE rb_sym_proc_call(VALUE args, VALUE sym, int argc, const VALUE *argv, VALUE passed_proc);
+VALUE rb_sym_to_proc(VALUE sym);
+
+/* symbol.c */
+#ifdef RUBY_ENCODING_H
+VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc);
+VALUE rb_sym_intern_cstr(const char *ptr, rb_encoding *enc);
+#ifdef __GNUC__
+#define rb_sym_intern_cstr(ptr, enc) __extension__ ( \
+{ \
+ (__builtin_constant_p(ptr)) ? \
+ rb_sym_intern((ptr), (long)strlen(ptr), (enc)) : \
+ rb_sym_intern_cstr((ptr), (enc)); \
+})
+#endif
+#endif
+VALUE rb_sym_intern_ascii(const char *ptr, long len);
+VALUE rb_sym_intern_ascii_cstr(const char *ptr);
+#ifdef __GNUC__
+#define rb_sym_intern_ascii_cstr(ptr) __extension__ ( \
+{ \
+ (__builtin_constant_p(ptr)) ? \
+ rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \
+ rb_sym_intern_ascii_cstr(ptr); \
+})
+#endif
/* struct.c */
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
+VALUE rb_struct_lookup(VALUE s, VALUE idx);
/* time.c */
struct timeval rb_time_timeval(VALUE);
@@ -743,6 +1185,7 @@ 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);
+int rb_thread_to_be_killed(VALUE thread);
void rb_mutex_allow_trap(VALUE self, int val);
VALUE rb_uninterruptible(VALUE (*b_proc)(ANYARGS), VALUE data);
VALUE rb_mutex_owned_p(VALUE self);
@@ -750,6 +1193,31 @@ void ruby_kill(rb_pid_t pid, int sig);
/* thread_pthread.c, thread_win32.c */
void Init_native_thread(void);
+int rb_divert_reserved_fd(int fd);
+
+/* transcode.c */
+extern VALUE rb_cEncodingConverter;
+size_t rb_econv_memsize(rb_econv_t *);
+
+/* us_ascii.c */
+extern rb_encoding OnigEncodingUS_ASCII;
+
+/* util.c */
+char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve);
+char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve);
+
+/* utf_8.c */
+extern rb_encoding OnigEncodingUTF_8;
+
+/* variable.c */
+size_t rb_generic_ivar_memsize(VALUE);
+VALUE rb_search_class_path(VALUE);
+VALUE rb_attr_delete(VALUE, ID);
+VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
+void rb_autoload_str(VALUE mod, ID id, VALUE file);
+
+/* version.c */
+extern const char ruby_engine[];
/* vm_insnhelper.h */
rb_serial_t rb_next_class_serial(void);
@@ -758,6 +1226,7 @@ rb_serial_t rb_next_class_serial(void);
VALUE rb_obj_is_thread(VALUE obj);
void rb_vm_mark(void *ptr);
void Init_BareVM(void);
+void Init_vm_objects(void);
VALUE rb_vm_top_self(void);
void rb_thread_recycle_stack_release(VALUE *);
void rb_vm_change_state(void);
@@ -765,9 +1234,15 @@ 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);
+VALUE rb_source_location(int *pline);
+const char *rb_source_loc(int *pline);
+void rb_vm_pop_cfunc_frame(void);
+int rb_vm_add_root_module(ID id, VALUE module);
+void rb_vm_check_redefinition_by_prepend(VALUE klass);
+VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
+VALUE ruby_vm_special_exception_copy(VALUE);
/* vm_dump.c */
-void rb_vm_bugreport(void);
void rb_print_backtrace(void);
/* vm_eval.c */
@@ -777,12 +1252,12 @@ VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, V
typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
rb_check_funcall_hook *hook, VALUE arg);
+VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE);
VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, int *stateptr);
+VALUE rb_yield_1(VALUE val);
/* vm_insnhelper.c */
VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
-int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *);
-VALUE rb_extract_keywords(VALUE *orighash);
/* vm_method.c */
void Init_eval_method(void);
@@ -793,8 +1268,8 @@ void Init_prelude(void);
/* vm_backtrace.c */
void Init_vm_backtrace(void);
-VALUE rb_vm_thread_backtrace(int argc, VALUE *argv, VALUE thval);
-VALUE rb_vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval);
+VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval);
+VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval);
VALUE rb_make_backtrace(void);
void rb_backtrace_print_as_bugreport(void);
@@ -810,7 +1285,7 @@ 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);
-/* bignum.c */
+/* bignum.c (export) */
VALUE rb_big_mul_normal(VALUE x, VALUE y);
VALUE rb_big_mul_balance(VALUE x, VALUE y);
VALUE rb_big_mul_karatsuba(VALUE x, VALUE y);
@@ -829,56 +1304,100 @@ VALUE rb_big2str_gmp(VALUE x, int base);
VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck);
#endif
-/* error.c */
+/* error.c (export) */
int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data);
-/* file.c */
+/* file.c (export) */
+#ifdef HAVE_READLINK
+VALUE rb_readlink(VALUE path, rb_encoding *enc);
+#endif
#ifdef __APPLE__
VALUE rb_str_normalize_ospath(const char *ptr, long len);
#endif
-/* io.c */
+/* hash.c (export) */
+VALUE rb_hash_delete_entry(VALUE hash, VALUE key);
+VALUE rb_ident_hash_new(void);
+
+/* io.c (export) */
void rb_maygvl_fd_fix_cloexec(int fd);
+int rb_gc_for_fd(int err);
-/* numeric.c */
+/* numeric.c (export) */
VALUE rb_int_positive_pow(long x, unsigned long y);
-/* process.c */
+/* process.c (export) */
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);
+VALUE rb_execarg_new(int argc, const 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);
+VALUE rb_execarg_init(int argc, const 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);
+void rb_execarg_parent_start(VALUE execarg_obj);
+void rb_execarg_parent_end(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);
-/* rational.c */
+/* rational.c (export) */
VALUE rb_gcd_normal(VALUE self, VALUE other);
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
VALUE rb_gcd_gmp(VALUE x, VALUE y);
#endif
-/* util.c */
+/* string.c (export) */
+#ifdef RUBY_ENCODING_H
+/* internal use */
+VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc);
+#endif
+
+/* thread.c (export) */
+int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
+
+/* util.c (export) */
extern const signed char ruby_digit36_to_number_table[];
+extern const char ruby_hexdigits[];
+extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
-/* variable.c */
+/* variable.c (export) */
void rb_gc_mark_global_tbl(void);
void rb_mark_generic_ivar(VALUE);
-void rb_mark_generic_ivar_tbl(void);
-
-int rb_st_insert_id_and_value(VALUE obj, st_table *tbl, ID key, VALUE value);
+VALUE rb_const_missing(VALUE klass, VALUE name);
+int rb_class_ivar_set(VALUE klass, ID vid, VALUE value);
st_table *rb_st_copy(VALUE obj, struct st_table *orig_tbl);
-/* gc.c */
+/* gc.c (export) */
+VALUE rb_wb_protected_newobj_of(VALUE, VALUE);
+VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE);
+
size_t rb_obj_memsize_of(VALUE);
+void rb_gc_verify_internal_consistency(void);
+
#define RB_OBJ_GC_FLAGS_MAX 5
size_t rb_obj_gc_flags(VALUE, ID[], size_t);
+void rb_gc_mark_values(long n, const VALUE *values);
+
+#if IMEMO_DEBUG
+VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, const char *file, int line);
+#define rb_imemo_new(type, v1, v2, v3, v0) rb_imemo_new_debug(type, v1, v2, v3, v0, __FILE__, __LINE__)
+#else
+VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
+#endif
RUBY_SYMBOL_EXPORT_END
+#define RUBY_DTRACE_CREATE_HOOK(name, arg) \
+ RUBY_DTRACE_HOOK(name##_CREATE, arg)
+#define RUBY_DTRACE_HOOK(name, arg) \
+do { \
+ if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
+ int dtrace_line; \
+ const char *dtrace_file = rb_source_loc(&dtrace_line); \
+ if (!dtrace_file) dtrace_file = ""; \
+ RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \
+ } \
+} while (0)
+
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
diff --git a/io.c b/io.c
index 5aa720b6a7..aeea680652 100644
--- a/io.c
+++ b/io.c
@@ -11,16 +11,17 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "internal.h"
#include "ruby/io.h"
#include "ruby/thread.h"
#include "dln.h"
-#include "internal.h"
+#include "encindex.h"
#include "id.h"
#include <ctype.h>
#include <errno.h>
#include "ruby_atomic.h"
+#undef free
#define free(x) xfree(x)
#if defined(DOSISH) || defined(__CYGWIN__)
@@ -31,12 +32,10 @@
#if defined HAVE_NET_SOCKET_H
# include <net/socket.h>
#elif defined HAVE_SYS_SOCKET_H
-# ifndef __native_client__
-# include <sys/socket.h>
-# endif
+# include <sys/socket.h>
#endif
-#if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__EMX__) || defined(__BEOS__) || defined(__HAIKU__)
+#if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32)
# define NO_SAFE_RENAME
#endif
@@ -52,9 +51,6 @@
#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)
@@ -64,11 +60,21 @@
#if !HAVE_OFF_T && !defined(off_t)
# define off_t long
#endif
+#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
+# define PRI_OFF_T_PREFIX "ll"
+#elif SIZEOF_OFF_T == SIZEOF_LONG
+# define PRI_OFF_T_PREFIX "l"
+#else
+# define PRI_OFF_T_PREFIX ""
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
#include <sys/stat.h>
-/* EMX has sys/param.h, but.. */
-#if defined(HAVE_SYS_PARAM_H) && !(defined(__EMX__) || defined(__HIUX_MPP__))
+#if defined(HAVE_SYS_PARAM_H) || defined(__HIUX_MPP__)
# include <sys/param.h>
#endif
@@ -86,10 +92,12 @@
#include <sys/syscall.h>
#endif
-#if defined(__BEOS__) || defined(__HAIKU__)
-# ifndef NOFILE
-# define NOFILE (OPEN_MAX)
-# endif
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h> /* for WNOHANG on BSD */
#endif
#include "ruby/util.h"
@@ -119,6 +127,13 @@
off_t __syscall(quad_t number, ...);
#endif
+#ifdef __native_client__
+# undef F_GETFD
+# ifdef NACL_NEWLIB
+# undef HAVE_IOCTL
+# endif
+#endif
+
#define IO_RBUF_CAPA_MIN 8192
#define IO_CBUF_CAPA_MIN (128*1024)
#define IO_RBUF_CAPA_FOR(fptr) (NEED_READCONV(fptr) ? IO_CBUF_CAPA_MIN : IO_RBUF_CAPA_MIN)
@@ -135,9 +150,6 @@ VALUE rb_eEOFError;
VALUE rb_eIOError;
VALUE rb_mWaitReadable;
VALUE rb_mWaitWritable;
-extern VALUE rb_eEAGAIN;
-extern VALUE rb_eEWOULDBLOCK;
-extern VALUE rb_eEINPROGRESS;
static VALUE rb_eEAGAINWaitReadable;
static VALUE rb_eEAGAINWaitWritable;
@@ -157,10 +169,12 @@ VALUE rb_default_rs;
static VALUE argf;
+#define id_exception idException
static ID id_write, id_read, id_getc, id_flush, id_readpartial, id_set_encoding;
-static VALUE sym_mode, sym_perm, sym_extenc, sym_intenc, sym_encoding, sym_open_args;
-static VALUE sym_textmode, sym_binmode, sym_autoclose, sym_exception;
+static VALUE sym_mode, sym_perm, sym_flags, sym_extenc, sym_intenc, sym_encoding, sym_open_args;
+static VALUE sym_textmode, sym_binmode, sym_autoclose;
static VALUE sym_SET, sym_CUR, sym_END;
+static VALUE sym_wait_readable, sym_wait_writable;
#ifdef SEEK_DATA
static VALUE sym_DATA;
#endif
@@ -185,6 +199,9 @@ rb_update_max_fd(int fd)
struct stat buf;
rb_atomic_t afd = (rb_atomic_t)fd;
+ if (afd <= max_file_descriptor)
+ return;
+
if (fstat(fd, &buf) != 0 && errno == EBADF) {
rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
}
@@ -224,10 +241,29 @@ rb_fd_fix_cloexec(int fd)
rb_update_max_fd(fd);
}
+/* this is only called once */
+static int
+rb_fix_detect_o_cloexec(int fd)
+{
+#if defined(O_CLOEXEC) && defined(F_GETFD)
+ int flags = fcntl(fd, F_GETFD);
+
+ if (flags == -1)
+ rb_bug("rb_fix_detect_o_cloexec: fcntl(%d, F_GETFD) failed: %s", fd, strerror(errno));
+
+ if (flags & FD_CLOEXEC)
+ return 1;
+#endif /* fall through if O_CLOEXEC does not work: */
+ rb_maygvl_fd_fix_cloexec(fd);
+ return 0;
+}
+
int
rb_cloexec_open(const char *pathname, int flags, mode_t mode)
{
int ret;
+ static int o_cloexec_state = -1; /* <0: unknown, 0: ignored, >0: working */
+
#ifdef O_CLOEXEC
/* O_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
flags |= O_CLOEXEC;
@@ -236,7 +272,15 @@ rb_cloexec_open(const char *pathname, int flags, mode_t mode)
#endif
ret = open(pathname, flags, mode);
if (ret == -1) return -1;
- rb_maygvl_fd_fix_cloexec(ret);
+ if (ret <= 2 || o_cloexec_state == 0) {
+ rb_maygvl_fd_fix_cloexec(ret);
+ }
+ else if (o_cloexec_state > 0) {
+ return ret;
+ }
+ else {
+ o_cloexec_state = rb_fix_detect_o_cloexec(ret);
+ }
return ret;
}
@@ -365,22 +409,6 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
#define argf_of(obj) (*(struct argf *)DATA_PTR(obj))
#define ARGF argf_of(argf)
-#ifdef _STDIO_USES_IOSTREAM /* GNU libc */
-# ifdef _IO_fpos_t
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end)
-# else
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->_gptr < (fp)->_egptr)
-# endif
-#elif defined(FILE_COUNT)
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0)
-#elif defined(FILE_READEND)
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->FILE_READPTR < (fp)->FILE_READEND)
-#elif defined(__BEOS__) || defined(__HAIKU__)
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->_state._eof == 0)
-#else
-# define STDIO_READ_DATA_PENDING(fp) (!feof(fp))
-#endif
-
#define GetWriteIO(io) rb_io_get_write_io(io)
#define READ_DATA_PENDING(fptr) ((fptr)->rbuf.len)
@@ -403,7 +431,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
if (!READ_DATA_PENDING(fptr)) {\
WAIT_FD_IN_WIN32(fptr);\
rb_io_check_closed(fptr);\
- }\
+ }\
} while(0)
#ifndef S_ISSOCK
@@ -523,8 +551,9 @@ io_unread(rb_io_t *fptr)
}
read_size = _read(fptr->fd, buf, fptr->rbuf.len + newlines);
if (read_size < 0) {
+ int e = errno;
free(buf);
- rb_sys_fail_path(fptr->pathv);
+ rb_syserr_fail_path(e, fptr->pathv);
}
if (read_size == fptr->rbuf.len) {
lseek(fptr->fd, r, SEEK_SET);
@@ -590,6 +619,8 @@ is_socket(int fd, VALUE path)
}
#endif
+static const char closed_stream[] = "closed stream";
+
void
rb_eof_error(void)
{
@@ -616,10 +647,17 @@ rb_io_check_closed(rb_io_t *fptr)
{
rb_io_check_initialized(fptr);
if (fptr->fd < 0) {
- rb_raise(rb_eIOError, "closed stream");
+ rb_raise(rb_eIOError, closed_stream);
}
}
+static rb_io_t *
+rb_io_get_fptr(VALUE io)
+{
+ rb_io_t *fptr = RFILE(io)->fptr;
+ rb_io_check_initialized(fptr);
+ return fptr;
+}
VALUE
rb_io_get_io(VALUE io)
@@ -637,8 +675,7 @@ VALUE
rb_io_get_write_io(VALUE io)
{
VALUE write_io;
- rb_io_check_initialized(RFILE(io)->fptr);
- write_io = RFILE(io)->fptr->tied_io_for_writing;
+ write_io = rb_io_get_fptr(io)->tied_io_for_writing;
if (write_io) {
return write_io;
}
@@ -649,24 +686,24 @@ VALUE
rb_io_set_write_io(VALUE io, VALUE w)
{
VALUE write_io;
- rb_io_check_initialized(RFILE(io)->fptr);
+ rb_io_t *fptr = rb_io_get_fptr(io);
if (!RTEST(w)) {
w = 0;
}
else {
GetWriteIO(w);
}
- write_io = RFILE(io)->fptr->tied_io_for_writing;
- RFILE(io)->fptr->tied_io_for_writing = w;
+ write_io = fptr->tied_io_for_writing;
+ fptr->tied_io_for_writing = w;
return write_io ? write_io : Qnil;
}
/*
* call-seq:
- * IO.try_convert(obj) -> io or nil
+ * IO.try_convert(obj) -> io or nil
*
* Try to convert <i>obj</i> into an IO, using to_io method.
- * Returns converted IO or nil if <i>obj</i> cannot be converted
+ * Returns converted IO or +nil+ if <i>obj</i> cannot be converted
* for any reason.
*
* IO.try_convert(STDOUT) #=> STDOUT
@@ -834,14 +871,6 @@ rb_io_read_pending(rb_io_t *fptr)
}
void
-rb_read_check(FILE *fp)
-{
- if (!STDIO_READ_DATA_PENDING(fp)) {
- rb_thread_wait_fd(fileno(fp));
- }
-}
-
-void
rb_io_read_check(rb_io_t *fptr)
{
if (!READ_DATA_PENDING(fptr)) {
@@ -850,6 +879,16 @@ rb_io_read_check(rb_io_t *fptr)
return;
}
+int
+rb_gc_for_fd(int err)
+{
+ if (err == EMFILE || err == ENFILE || err == ENOMEM) {
+ rb_gc();
+ return 1;
+ }
+ return 0;
+}
+
static int
ruby_dup(int orig)
{
@@ -857,8 +896,7 @@ ruby_dup(int orig)
fd = rb_cloexec_dup(orig);
if (fd < 0) {
- if (errno == EMFILE || errno == ENFILE || errno == ENOMEM) {
- rb_gc();
+ if (rb_gc_for_fd(errno)) {
fd = rb_cloexec_dup(orig);
}
if (fd < 0) {
@@ -883,29 +921,6 @@ io_alloc(VALUE klass)
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
-static int
-wsplit_p(rb_io_t *fptr)
-{
-#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
- int r;
-#endif
-
- if (!(fptr->mode & FMODE_WSPLIT_INITIALIZED)) {
- struct stat buf;
- if (fstat(fptr->fd, &buf) == 0 &&
- !S_ISREG(buf.st_mode)
-#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
- && (r = fcntl(fptr->fd, F_GETFL)) != -1 &&
- !(r & O_NONBLOCK)
-#endif
- ) {
- fptr->mode |= FMODE_WSPLIT;
- }
- fptr->mode |= FMODE_WSPLIT_INITIALIZED;
- }
- return fptr->mode & FMODE_WSPLIT;
-}
-
struct io_internal_read_struct {
int fd;
void *buf;
@@ -918,6 +933,14 @@ struct io_internal_write_struct {
size_t capa;
};
+#ifdef HAVE_WRITEV
+struct io_internal_writev_struct {
+ int fd;
+ int iovcnt;
+ const struct iovec *iov;
+};
+#endif
+
static VALUE
internal_read_func(void *ptr)
{
@@ -939,6 +962,15 @@ internal_write_func2(void *ptr)
return (void*)(intptr_t)write(iis->fd, iis->buf, iis->capa);
}
+#ifdef HAVE_WRITEV
+static VALUE
+internal_writev_func(void *ptr)
+{
+ struct io_internal_writev_struct *iis = ptr;
+ return writev(iis->fd, iis->iov, iis->iovcnt);
+}
+#endif
+
static ssize_t
rb_read_internal(int fd, void *buf, size_t count)
{
@@ -973,22 +1005,24 @@ rb_write_internal2(int fd, const void *buf, size_t count)
RUBY_UBF_IO, NULL);
}
-static long
-io_writable_length(rb_io_t *fptr, long l)
+#ifdef HAVE_WRITEV
+static ssize_t
+rb_writev_internal(int fd, const struct iovec *iov, int iovcnt)
{
- if (PIPE_BUF < l &&
- !rb_thread_alone() &&
- wsplit_p(fptr)) {
- l = PIPE_BUF;
- }
- return l;
+ struct io_internal_writev_struct iis;
+ iis.fd = fd;
+ iis.iov = iov;
+ iis.iovcnt = iovcnt;
+
+ return (ssize_t)rb_thread_io_blocking_region(internal_writev_func, &iis, fd);
}
+#endif
static VALUE
io_flush_buffer_sync(void *arg)
{
rb_io_t *fptr = arg;
- long l = io_writable_length(fptr, fptr->wbuf.len);
+ long l = fptr->wbuf.len;
ssize_t r = write(fptr->fd, fptr->wbuf.ptr+fptr->wbuf.off, (size_t)l);
if (fptr->wbuf.len <= r) {
@@ -1036,10 +1070,11 @@ io_flush_buffer_async2(VALUE arg)
/* pending async interrupt is there. */
errno = EAGAIN;
return -1;
- } else if (ret == 1) {
+ }
+ else if (ret == 1) {
return 0;
- } else
- return ret;
+ }
+ return ret;
}
static inline int
@@ -1075,7 +1110,7 @@ int
rb_io_wait_readable(int f)
{
if (f < 0) {
- rb_raise(rb_eIOError, "closed stream");
+ rb_raise(rb_eIOError, closed_stream);
}
switch (errno) {
case EINTR:
@@ -1101,7 +1136,7 @@ int
rb_io_wait_writable(int f)
{
if (f < 0) {
- rb_raise(rb_eIOError, "closed stream");
+ rb_raise(rb_eIOError, closed_stream);
}
switch (errno) {
case EINTR:
@@ -1201,13 +1236,76 @@ struct write_arg {
int nosync;
};
+#ifdef HAVE_WRITEV
static VALUE
io_binwrite_string(VALUE arg)
{
struct binwrite_arg *p = (struct binwrite_arg *)arg;
- long l = io_writable_length(p->fptr, p->length);
- return rb_write_internal2(p->fptr->fd, p->ptr, l);
+ rb_io_t *fptr = p->fptr;
+ long r;
+
+ if (fptr->wbuf.len) {
+ struct iovec iov[2];
+
+ iov[0].iov_base = fptr->wbuf.ptr+fptr->wbuf.off;
+ iov[0].iov_len = fptr->wbuf.len;
+ iov[1].iov_base = (char *)p->ptr;
+ iov[1].iov_len = p->length;
+
+ r = rb_writev_internal(fptr->fd, iov, 2);
+
+ if (r == -1)
+ return -1;
+
+ if (fptr->wbuf.len <= r) {
+ r -= fptr->wbuf.len;
+ fptr->wbuf.off = 0;
+ fptr->wbuf.len = 0;
+ }
+ else {
+ fptr->wbuf.off += (int)r;
+ fptr->wbuf.len -= (int)r;
+ r = 0L;
+ }
+ }
+ else {
+ r = rb_write_internal(fptr->fd, p->ptr, p->length);
+ }
+
+ return r;
}
+#else
+static VALUE
+io_binwrite_string(VALUE arg)
+{
+ struct binwrite_arg *p = (struct binwrite_arg *)arg;
+ rb_io_t *fptr = p->fptr;
+ long l, len;
+
+ l = len = p->length;
+
+ if (fptr->wbuf.len) {
+ if (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);
+ fptr->wbuf.off = 0;
+ }
+ MEMMOVE(fptr->wbuf.ptr+fptr->wbuf.off+fptr->wbuf.len, p->ptr, char, len);
+ fptr->wbuf.len += (int)len;
+ l = 0;
+ }
+ if (io_fflush(fptr) < 0)
+ return -2L; /* fail in fflush */
+ if (l == 0)
+ return len;
+ }
+
+ if (fptr->stdio_file != stderr && !rb_thread_fd_writable(fptr->fd))
+ rb_io_check_closed(fptr);
+
+ return rb_write_internal(p->fptr->fd, p->ptr, p->length);
+}
+#endif
static long
io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
@@ -1230,27 +1328,6 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
(fptr->wbuf.ptr && fptr->wbuf.capa <= fptr->wbuf.len + len)) {
struct binwrite_arg arg;
- /*
- * 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);
- fptr->wbuf.off = 0;
- }
- MEMMOVE(fptr->wbuf.ptr+fptr->wbuf.off+fptr->wbuf.len, ptr+offset, char, len);
- fptr->wbuf.len += (int)len;
- n = 0;
- }
- if (io_fflush(fptr) < 0)
- return -1L;
- if (n == 0)
- return len;
-
- rb_io_check_closed(fptr);
arg.fptr = fptr;
arg.str = str;
retry:
@@ -1260,8 +1337,7 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
r = rb_mutex_synchronize(fptr->write_lock, io_binwrite_string, (VALUE)&arg);
}
else {
- long l = io_writable_length(fptr, n);
- r = rb_write_internal(fptr->fd, ptr+offset, l);
+ r = io_binwrite_string((VALUE)&arg);
}
/* xxx: other threads may modify given string. */
if (r == n) return len;
@@ -1269,7 +1345,9 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
offset += r;
n -= r;
errno = EAGAIN;
- }
+ }
+ if (r == -2L)
+ return -1L;
if (rb_io_wait_writable(fptr->fd)) {
rb_io_check_closed(fptr);
if (offset < len)
@@ -1291,7 +1369,7 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
# 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)
+do_writeconv(VALUE str, rb_io_t *fptr, int *converted)
{
if (NEED_WRITECONV(fptr)) {
VALUE common_encoding = Qnil;
@@ -1319,10 +1397,12 @@ do_writeconv(VALUE str, rb_io_t *fptr)
if (!NIL_P(common_encoding)) {
str = rb_str_encode(str, common_encoding,
fptr->writeconv_pre_ecflags, fptr->writeconv_pre_ecopts);
+ *converted = 1;
}
if (fptr->writeconv) {
str = rb_econv_str_convert(fptr->writeconv, str, ECONV_PARTIAL_INPUT);
+ *converted = 1;
}
}
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
@@ -1348,13 +1428,19 @@ do_writeconv(VALUE str, rb_io_t *fptr)
static long
io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
{
+ int converted = 0;
#ifdef _WIN32
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);
+ str = do_writeconv(str, fptr, &converted);
+ if (converted)
+ OBJ_FREEZE(str);
+ else
+ str = rb_str_new_frozen(str);
+
return io_binwrite(str, RSTRING_PTR(str), RSTRING_LEN(str),
fptr, nosync);
}
@@ -1386,8 +1472,6 @@ 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);
@@ -1456,6 +1540,10 @@ nogvl_fsync(void *ptr)
{
rb_io_t *fptr = ptr;
+#ifdef _WIN32
+ if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) != FILE_TYPE_DISK)
+ return 0;
+#endif
return (VALUE)fsync(fptr->fd);
}
#endif
@@ -1475,11 +1563,6 @@ rb_io_flush_raw(VALUE io, int sync)
if (fptr->mode & FMODE_WRITABLE) {
if (io_fflush(fptr) < 0)
rb_sys_fail(0);
-#ifdef _WIN32
- if (sync && 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);
@@ -1572,7 +1655,7 @@ interpret_seek_whence(VALUE vwhence)
/*
* call-seq:
- * ios.seek(amount, whence=IO::SEEK_SET) -> 0
+ * ios.seek(amount, whence=IO::SEEK_SET) -> 0
*
* Seeks to a given offset <i>anInteger</i> in the stream according to
* the value of <i>whence</i>:
@@ -1690,13 +1773,15 @@ io_fillbuf(rb_io_t *fptr)
if (rb_io_wait_readable(fptr->fd))
goto retry;
{
+ int e = errno;
VALUE path = rb_sprintf("fd:%d ", fptr->fd);
if (!NIL_P(fptr->pathv)) {
rb_str_append(path, fptr->pathv);
}
- rb_sys_fail_path(path);
+ rb_syserr_fail_path(e, path);
}
}
+ if (r > 0) rb_io_check_closed(fptr);
fptr->rbuf.off = 0;
fptr->rbuf.len = (int)r; /* r should be <= rbuf_capa */
if (r == 0)
@@ -1841,10 +1926,8 @@ rb_io_fsync(VALUE io)
if (io_fflush(fptr) < 0)
rb_sys_fail(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
return INT2FIX(0);
}
#else
@@ -1864,6 +1947,10 @@ nogvl_fdatasync(void *ptr)
{
rb_io_t *fptr = ptr;
+#ifdef _WIN32
+ if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) != FILE_TYPE_DISK)
+ return 0;
+#endif
return (VALUE)fdatasync(fptr->fd);
}
@@ -1914,10 +2001,10 @@ rb_io_fdatasync(VALUE io)
static VALUE
rb_io_fileno(VALUE io)
{
- rb_io_t *fptr;
+ rb_io_t *fptr = RFILE(io)->fptr;
int fd;
- GetOpenFile(io, fptr);
+ rb_io_check_closed(fptr);
fd = fptr->fd;
return INT2FIX(fd);
}
@@ -1969,7 +2056,7 @@ rb_io_inspect(VALUE obj)
VALUE result;
static const char closed[] = " (closed)";
- fptr = RFILE(rb_io_taint_check(obj))->fptr;
+ fptr = RFILE(obj)->fptr;
if (!fptr) return rb_any_to_s(obj);
result = rb_str_new_cstr("#<");
rb_str_append(result, rb_class_name(CLASS_OF(obj)));
@@ -1993,7 +2080,7 @@ rb_io_inspect(VALUE obj)
/*
* call-seq:
- * ios.to_io -> ios
+ * ios.to_io -> ios
*
* Returns <em>ios</em>.
*/
@@ -2098,8 +2185,6 @@ rb_io_bufread(VALUE io, void *buf, size_t size)
return (ssize_t)io_bufread(buf, (long)size, fptr);
}
-#define SMALLBUF 100
-
static long
remain_size(rb_io_t *fptr)
{
@@ -2108,7 +2193,7 @@ remain_size(rb_io_t *fptr)
off_t pos;
if (fstat(fptr->fd, &st) == 0 && S_ISREG(st.st_mode)
-#if defined(__BEOS__) || defined(__HAIKU__)
+#if defined(__HAIKU__)
&& (st.st_dev > 3)
#endif
)
@@ -2290,10 +2375,7 @@ io_setstrbuf(VALUE *str, long 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);
- }
+ rb_str_modify(s);
return;
}
len -= clen;
@@ -2320,23 +2402,27 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
int cr;
if (NEED_READCONV(fptr)) {
+ int first = !NIL_P(str);
SET_BINARY_MODE(fptr);
io_setstrbuf(&str,0);
make_readconv(fptr, 0);
while (1) {
VALUE v;
if (fptr->cbuf.len) {
+ if (first) rb_str_set_len(str, first = 0);
io_shift_cbuf(fptr, fptr->cbuf.len, &str);
}
v = fill_cbuf(fptr, 0);
if (v != MORE_CHAR_SUSPENDED && v != MORE_CHAR_FINISHED) {
if (fptr->cbuf.len) {
+ if (first) rb_str_set_len(str, first = 0);
io_shift_cbuf(fptr, fptr->cbuf.len, &str);
}
rb_exc_raise(v);
}
if (v == MORE_CHAR_FINISHED) {
clear_readconv(fptr);
+ if (first) rb_str_set_len(str, first = 0);
return io_enc_str(str, fptr);
}
}
@@ -2374,6 +2460,11 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
void
rb_io_set_nonblock(rb_io_t *fptr)
{
+#ifdef _WIN32
+ if (rb_w32_set_nonblock(fptr->fd) != 0) {
+ rb_sys_fail_path(fptr->pathv);
+ }
+#else
int oflags;
#ifdef F_GETFL
oflags = fcntl(fptr->fd, F_GETFL);
@@ -2389,11 +2480,9 @@ rb_io_set_nonblock(rb_io_t *fptr)
rb_sys_fail_path(fptr->pathv);
}
}
+#endif
}
-void
-rb_readwrite_sys_fail(int writable, const char *mesg);
-
struct read_internal_arg {
int fd;
char *str_ptr;
@@ -2408,15 +2497,25 @@ read_internal_call(VALUE arg)
return Qundef;
}
+static int
+no_exception_p(VALUE opts)
+{
+ VALUE except;
+ ID id = id_exception;
+
+ rb_get_kwargs(opts, &id, 0, 1, &except);
+ return except == Qfalse;
+}
+
static VALUE
-io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock, int no_exception)
+io_getpartial(int argc, VALUE *argv, VALUE io, VALUE opts, int nonblock)
{
rb_io_t *fptr;
VALUE length, str;
long n, len;
struct read_internal_arg arg;
- rb_scan_args(argc, argv, "11:", &length, &str, NULL);
+ rb_scan_args(argc, argv, "11", &length, &str);
if ((len = NUM2LONG(length)) < 0) {
rb_raise(rb_eArgError, "negative length %ld given", len);
@@ -2446,15 +2545,17 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock, int no_exception)
rb_str_locktmp_ensure(str, read_internal_call, (VALUE)&arg);
n = arg.len;
if (n < 0) {
+ int e = errno;
if (!nonblock && rb_io_wait_readable(fptr->fd))
goto again;
- if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN)) {
- if (no_exception)
- return ID2SYM(rb_intern("wait_readable"));
+ if (nonblock && (e == EWOULDBLOCK || e == EAGAIN)) {
+ if (no_exception_p(opts))
+ return sym_wait_readable;
else
- rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "read would block");
+ rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE,
+ e, "read would block");
}
- rb_sys_fail_path(fptr->pathv);
+ rb_syserr_fail_path(e, fptr->pathv);
}
}
io_set_read_length(str, n);
@@ -2473,10 +2574,12 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock, int no_exception)
* Reads at most <i>maxlen</i> bytes from the I/O stream.
* It blocks only if <em>ios</em> has no data immediately available.
* It doesn't block if some data available.
- * If the optional <i>outbuf</i> argument is present,
+ *
+ * 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
+ * The _outbuf_ 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.
@@ -2519,7 +2622,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock, int no_exception)
* * If the byte buffer is not empty, read from the byte buffer instead of "sysread for buffered IO (IOError)".
* * It doesn't cause Errno::EWOULDBLOCK and Errno::EINTR. When readpartial meets EWOULDBLOCK and EINTR by read system call, readpartial retry the system call.
*
- * The later means that readpartial is nonblocking-flag insensitive.
+ * The latter means that readpartial is nonblocking-flag insensitive.
* It blocks on the situation IO#sysread causes Errno::EWOULDBLOCK as if the fd is blocking mode.
*
*/
@@ -2529,88 +2632,73 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
{
VALUE ret;
- ret = io_getpartial(argc, argv, io, 0, 0);
+ ret = io_getpartial(argc, argv, io, Qnil, 0);
if (NIL_P(ret))
rb_eof_error();
return ret;
}
-/*
- * call-seq:
- * ios.read_nonblock(maxlen) -> string
- * ios.read_nonblock(maxlen, outbuf) -> outbuf
- *
- * Reads at most <i>maxlen</i> bytes from <em>ios</em> using
- * the read(2) system call after O_NONBLOCK is set for
- * the underlying file descriptor.
- *
- * 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.
- * The caller should care such errors.
- *
- * If the exception is Errno::EWOULDBLOCK or Errno::AGAIN,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying read_nonblock.
- *
- * read_nonblock causes EOFError on EOF.
- *
- * If the read byte buffer is not empty,
- * read_nonblock reads from the buffer like readpartial.
- * In this case, the read(2) system call is not called.
- *
- * When read_nonblock raises an exception kind of IO::WaitReadable,
- * read_nonblock should not be called
- * until io is readable for avoiding busy loop.
- * This can be done as follows.
- *
- * # emulates blocking read (readpartial).
- * begin
- * result = io.read_nonblock(maxlen)
- * rescue IO::WaitReadable
- * IO.select([io])
- * retry
- * end
- *
- * Although IO#read_nonblock doesn't raise IO::WaitWritable.
- * OpenSSL::Buffering#read_nonblock can raise IO::WaitWritable.
- * If IO and SSL should be used polymorphically,
- * IO::WaitWritable should be rescued too.
- * See the document of OpenSSL::Buffering#read_nonblock for sample code.
- *
- * Note that this method is identical to readpartial
- * except the non-blocking flag is set.
- */
+static VALUE
+io_nonblock_eof(VALUE opts)
+{
+ if (!no_exception_p(opts)) {
+ rb_eof_error();
+ }
+ return Qnil;
+}
+/* :nodoc: */
static VALUE
-io_read_nonblock(int argc, VALUE *argv, VALUE io)
+io_read_nonblock(VALUE io, VALUE length, VALUE str, VALUE ex)
{
- VALUE ret;
- VALUE opts = Qnil;
- int no_exception = 0;
+ rb_io_t *fptr;
+ long n, len;
+ struct read_internal_arg arg;
- rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
+ if ((len = NUM2LONG(length)) < 0) {
+ rb_raise(rb_eArgError, "negative length %ld given", len);
+ }
- if (!NIL_P(opts) && Qfalse == rb_hash_aref(opts, sym_exception))
- no_exception = 1;
+ io_setstrbuf(&str,len);
+ OBJ_TAINT(str);
+ GetOpenFile(io, fptr);
+ rb_io_check_byte_readable(fptr);
- ret = io_getpartial(argc, argv, io, 1, no_exception);
+ if (len == 0)
+ return str;
- if (NIL_P(ret)) {
- if (no_exception)
- return Qnil;
- else
- rb_eof_error();
+ n = read_buffered_data(RSTRING_PTR(str), len, fptr);
+ if (n <= 0) {
+ rb_io_set_nonblock(fptr);
+ io_setstrbuf(&str, len);
+ arg.fd = fptr->fd;
+ arg.str_ptr = RSTRING_PTR(str);
+ arg.len = len;
+ rb_str_locktmp_ensure(str, read_internal_call, (VALUE)&arg);
+ n = arg.len;
+ if (n < 0) {
+ int e = errno;
+ if ((e == EWOULDBLOCK || e == EAGAIN)) {
+ if (ex == Qfalse) return sym_wait_readable;
+ rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE,
+ e, "read would block");
+ }
+ rb_syserr_fail_path(e, fptr->pathv);
+ }
}
- return ret;
+ io_set_read_length(str, n);
+
+ if (n == 0) {
+ if (ex == Qfalse) return Qnil;
+ rb_eof_error();
+ }
+
+ return str;
}
+/* :nodoc: */
static VALUE
-io_write_nonblock(VALUE io, VALUE str, int no_exception)
+io_write_nonblock(VALUE io, VALUE str, VALUE ex)
{
rb_io_t *fptr;
long n;
@@ -2629,14 +2717,16 @@ io_write_nonblock(VALUE io, VALUE str, int no_exception)
n = write(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
if (n == -1) {
- if (errno == EWOULDBLOCK || errno == EAGAIN) {
- if (no_exception) {
- return ID2SYM(rb_intern("wait_writable"));
- } else {
- rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "write would block");
+ int e = errno;
+ if (e == EWOULDBLOCK || e == EAGAIN) {
+ if (ex == Qfalse) {
+ return sym_wait_writable;
+ }
+ else {
+ rb_readwrite_syserr_fail(RB_IO_WAIT_WRITABLE, e, "write would block");
}
}
- rb_sys_fail_path(fptr->pathv);
+ rb_syserr_fail_path(e, fptr->pathv);
}
return LONG2FIX(n);
@@ -2644,141 +2734,69 @@ io_write_nonblock(VALUE io, VALUE str, int no_exception)
/*
* call-seq:
- * ios.write_nonblock(string) -> integer
- * ios.write_nonblock(string [, options]) -> integer
- *
- * Writes the given string to <em>ios</em> using
- * the write(2) system call after O_NONBLOCK is set for
- * the underlying file descriptor.
- *
- * It returns the number of bytes written.
- *
- * write_nonblock just calls the write(2) system call.
- * It causes all errors the write(2) system call causes: Errno::EWOULDBLOCK, Errno::EINTR, etc.
- * The result may also be smaller than string.length (partial write).
- * The caller should care such errors and partial write.
- *
- * If the exception is Errno::EWOULDBLOCK or Errno::AGAIN,
- * it is extended by IO::WaitWritable.
- * So IO::WaitWritable can be used to rescue the exceptions for retrying write_nonblock.
- *
- * # Creates a pipe.
- * r, w = IO.pipe
- *
- * # write_nonblock writes only 65536 bytes and return 65536.
- * # (The pipe size is 65536 bytes on this environment.)
- * s = "a" * 100000
- * p w.write_nonblock(s) #=> 65536
- *
- * # write_nonblock cannot write a byte and raise EWOULDBLOCK (EAGAIN).
- * p w.write_nonblock("b") # Resource temporarily unavailable (Errno::EAGAIN)
- *
- * If the write buffer is not empty, it is flushed at first.
- *
- * When write_nonblock raises an exception kind of IO::WaitWritable,
- * write_nonblock should not be called
- * until io is writable for avoiding busy loop.
- * This can be done as follows.
- *
- * begin
- * result = io.write_nonblock(string)
- * rescue IO::WaitWritable, Errno::EINTR
- * IO.select(nil, [io])
- * retry
- * end
- *
- * Note that this doesn't guarantee to write all data in string.
- * The length written is reported as result and it should be checked later.
- *
- * On some platforms such as Windows, write_nonblock is not supported
- * according to the kind of the IO object.
- * In such cases, write_nonblock raises <code>Errno::EBADF</code>.
- *
- * By specifying `exception: false`, the options hash allows you to indicate
- * that write_nonblock should not raise an IO::WaitWritable exception, but
- * return the symbol :wait_writable instead.
- *
- */
-
-static VALUE
-rb_io_write_nonblock(int argc, VALUE *argv, VALUE io)
-{
- VALUE str;
- VALUE opts = Qnil;
- int no_exceptions = 0;
-
- rb_scan_args(argc, argv, "10:", &str, &opts);
-
- if (!NIL_P(opts) && Qfalse == rb_hash_aref(opts, sym_exception))
- no_exceptions = 1;
-
- return io_write_nonblock(io, str, no_exceptions);
-}
-
-/*
- * call-seq:
* ios.read([length [, outbuf]]) -> string, outbuf, or nil
*
- * Reads <i>length</i> bytes from the I/O stream.
+ * Reads _length_ bytes from the I/O stream.
*
- * <i>length</i> must be a non-negative integer or <code>nil</code>.
+ * _length_ must be a non-negative integer or +nil+.
*
- * If <i>length</i> is a positive integer,
- * it try to read <i>length</i> bytes without any conversion (binary mode).
- * It returns <code>nil</code> or a string whose length is 1 to <i>length</i> bytes.
- * <code>nil</code> means it met EOF at beginning.
- * The 1 to <i>length</i>-1 bytes string means it met EOF after reading the result.
- * The <i>length</i> bytes string means it doesn't meet EOF.
- * The resulted string is always ASCII-8BIT encoding.
+ * If _length_ is a positive integer, +read+ tries to read
+ * _length_ bytes without any conversion (binary mode).
+ * It returns +nil+ if an EOF is encountered before anything can be read.
+ * Fewer than _length_ bytes are returned if an EOF is encountered during
+ * the read.
+ * In the case of an integer _length_, the resulting string is always
+ * in ASCII-8BIT encoding.
*
- * If <i>length</i> is omitted or is <code>nil</code>,
- * it reads until EOF and the encoding conversion is applied.
- * It returns a string even if EOF is met at beginning.
+ * If _length_ is omitted or is +nil+, it reads until EOF
+ * and the encoding conversion is applied, if applicable.
+ * A string is returned even if EOF is encountered before any data is read.
*
- * If <i>length</i> is zero, it returns <code>""</code>.
+ * If _length_ is zero, it returns an empty string (<code>""</code>).
*
- * 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
+ * If the optional _outbuf_ argument is present,
+ * it must reference a String, which will receive the data.
+ * The _outbuf_ 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>.
- * <code><i>ios</i>.read()</code> and
- * <code><i>ios</i>.read(nil)</code> returns <code>""</code>.
- * <code><i>ios</i>.read(<i>positive-integer</i>)</code> returns <code>nil</code>.
+ * When this method is called at end of file, it returns +nil+
+ * or <code>""</code>, depending on _length_:
+ * +read+, <code>read(nil)</code>, and <code>read(0)</code> return
+ * <code>""</code>,
+ * <code>read(<i>positive_integer</i>)</code> returns +nil+.
*
* f = File.new("testfile")
* f.read(16) #=> "This is line one"
*
- * # reads whole file
- * open("file") {|f|
- * data = f.read # This returns a string even if the file is empty.
- * ...
- * }
+ * # read whole file
+ * open("file") do |f|
+ * data = f.read # This returns a string even if the file is empty.
+ * # ...
+ * end
*
- * # iterate over fixed length records.
- * open("fixed-record-file") {|f|
+ * # iterate over fixed length records
+ * open("fixed-record-file") do |f|
* while record = f.read(256)
- * ...
+ * # ...
* end
- * }
+ * end
*
- * # iterate over variable length records.
- * # record is prefixed by 32-bit length.
- * open("variable-record-file") {|f|
+ * # iterate over variable length records,
+ * # each record is prefixed by its 32-bit length
+ * open("variable-record-file") do |f|
* while len = f.read(4)
- * len = len.unpack("N")[0] # 32-bit length
- * record = f.read(len) # This returns a string even if len is 0.
+ * len = len.unpack("N")[0] # 32-bit length
+ * record = f.read(len) # This returns a string even if len is 0.
* end
- * }
+ * end
*
- * Note that this method behaves like fread() function in C.
- * 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.
+ * Note that this method behaves like the fread() function in C.
+ * This means it retries to invoke read(2) system calls to read data
+ * with the specified length (or until EOF).
+ * This behavior is preserved even if <i>ios</i> is in 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.
+ * If you need the behavior like a single read(2) system call,
+ * consider #readpartial, #read_nonblock, and #sysread.
*/
static VALUE
@@ -2807,7 +2825,10 @@ io_read(int argc, VALUE *argv, VALUE io)
GetOpenFile(io, fptr);
rb_io_check_byte_readable(fptr);
- if (len == 0) return str;
+ if (len == 0) {
+ io_set_read_length(str, 0);
+ return str;
+ }
READ_CHECK(fptr);
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
@@ -3022,6 +3043,7 @@ prepare_getline_args(int argc, VALUE *argv, VALUE *rsp, long *limit, VALUE io)
VALUE rs = rb_rs, lim = Qnil;
rb_io_t *fptr;
+ rb_check_arity(argc, 0, 2);
if (argc == 1) {
VALUE tmp = Qnil;
@@ -3033,7 +3055,7 @@ prepare_getline_args(int argc, VALUE *argv, VALUE *rsp, long *limit, VALUE io)
}
}
else if (2 <= argc) {
- rb_scan_args(argc, argv, "2", &rs, &lim);
+ rs = argv[0], lim = argv[1];
if (!NIL_P(rs))
StringValue(rs);
}
@@ -3115,7 +3137,7 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io)
newline = (unsigned char)rsptr[rslen - 1];
}
- /* MS - Optimisation */
+ /* MS - Optimization */
while ((c = appendline(fptr, newline, &str, &limit)) != EOF) {
const char *s, *p, *pp, *e;
@@ -3190,18 +3212,30 @@ rb_io_gets(VALUE io)
* ios.gets(sep, limit) -> string or nil
*
* Reads the next ``line'' from the I/O stream; lines are separated by
- * <i>sep</i>. A separator of <code>nil</code> reads the entire
+ * <i>sep</i>. A separator of +nil+ reads the entire
* contents, and a zero-length separator reads the input a paragraph at
* a time (two successive newlines in the input separate paragraphs).
* The stream must be opened for reading or an <code>IOError</code>
* will be raised. The line read in will be returned and also assigned
- * to <code>$_</code>. Returns <code>nil</code> if called at end of
+ * to <code>$_</code>. Returns +nil+ if called at end of
* file. If the first argument is an integer, or optional second
* argument is given, the returning string would not be longer than the
* given value in bytes.
*
* File.new("testfile").gets #=> "This is line one\n"
* $_ #=> "This is line one\n"
+ *
+ * File.new("testfile").gets(4)#=> "This"
+ *
+ * If IO contains multibyte characters byte then <code>gets(1)</code>
+ * returns character entirely:
+ *
+ * # Russian characters take 2 bytes
+ * File.write("testfile", "\u{442 435 441 442}")
+ * File.open("testfile") {|f|f.gets(1)} #=> "\u0442"
+ * File.open("testfile") {|f|f.gets(2)} #=> "\u0442"
+ * File.open("testfile") {|f|f.gets(3)} #=> "\u0442\u0435"
+ * File.open("testfile") {|f|f.gets(4)} #=> "\u0442\u0435"
*/
static VALUE
@@ -3304,7 +3338,7 @@ rb_io_readline(int argc, VALUE *argv, VALUE io)
*
* Reads all of the lines in <em>ios</em>, and returns them in
* <i>anArray</i>. Lines are separated by the optional <i>sep</i>. If
- * <i>sep</i> is <code>nil</code>, the rest of the stream is returned
+ * <i>sep</i> is +nil+, the rest of the stream is returned
* as a single record. If the first argument is an integer, or
* optional second argument is given, the returning string would not be
* longer than the given value in bytes. The stream must be opened for
@@ -3332,15 +3366,15 @@ rb_io_readlines(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
- * ios.each(sep=$/) {|line| block } -> ios
- * ios.each(limit) {|line| block } -> ios
- * ios.each(sep,limit) {|line| block } -> ios
- * ios.each(...) -> an_enumerator
+ * ios.each(sep=$/) {|line| block } -> ios
+ * ios.each(limit) {|line| block } -> ios
+ * ios.each(sep, limit) {|line| block } -> ios
+ * ios.each(...) -> an_enumerator
*
- * ios.each_line(sep=$/) {|line| block } -> ios
- * ios.each_line(limit) {|line| block } -> ios
- * ios.each_line(sep,limit) {|line| block } -> ios
- * ios.each_line(...) -> an_enumerator
+ * ios.each_line(sep=$/) {|line| block } -> ios
+ * ios.each_line(limit) {|line| block } -> ios
+ * ios.each_line(sep, limit) {|line| block } -> ios
+ * ios.each_line(...) -> an_enumerator
*
* Executes the block for every line in <em>ios</em>, where lines are
* separated by <i>sep</i>. <em>ios</em> must be opened for
@@ -3624,6 +3658,7 @@ rb_io_each_codepoint(VALUE io)
READ_CHECK(fptr);
if (NEED_READCONV(fptr)) {
SET_BINARY_MODE(fptr);
+ r = 1; /* no invalid char yet */
for (;;) {
make_readconv(fptr, 0);
for (;;) {
@@ -3642,13 +3677,16 @@ rb_io_each_codepoint(VALUE io)
}
if (more_char(fptr) == MORE_CHAR_FINISHED) {
clear_readconv(fptr);
- /* ignore an incomplete character before EOF */
+ if (!MBCLEN_CHARFOUND_P(r)) {
+ enc = fptr->encs.enc;
+ goto invalid;
+ }
return io;
}
}
if (MBCLEN_INVALID_P(r)) {
- rb_raise(rb_eArgError, "invalid byte sequence in %s",
- rb_enc_name(fptr->encs.enc));
+ enc = fptr->encs.enc;
+ goto invalid;
}
n = MBCLEN_CHARFOUND_LEN(r);
if (fptr->encs.enc) {
@@ -3678,8 +3716,25 @@ rb_io_each_codepoint(VALUE io)
rb_yield(UINT2NUM(c));
}
else if (MBCLEN_INVALID_P(r)) {
+ invalid:
rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
}
+ else if (MBCLEN_NEEDMORE_P(r)) {
+ char cbuf[8], *p = cbuf;
+ int more = MBCLEN_NEEDMORE_LEN(r);
+ if (more > numberof(cbuf)) goto invalid;
+ more += n = fptr->rbuf.len;
+ if (more > numberof(cbuf)) goto invalid;
+ while ((n = (int)read_buffered_data(p, more, fptr)) > 0 &&
+ (p += n, (more -= n) > 0)) {
+ if (io_fillbuf(fptr) < 0) goto invalid;
+ if ((n = fptr->rbuf.len) > more) n = more;
+ }
+ r = rb_enc_precise_mbclen(cbuf, p, enc);
+ if (!MBCLEN_CHARFOUND_P(r)) goto invalid;
+ c = rb_enc_codepoint(cbuf, p, enc);
+ rb_yield(UINT2NUM(c));
+ }
else {
continue;
}
@@ -3706,7 +3761,7 @@ rb_io_codepoints(VALUE io)
* ios.getc -> string or nil
*
* Reads a one-character string from <em>ios</em>. Returns
- * <code>nil</code> if called at end of file.
+ * +nil+ if called at end of file.
*
* f = File.new("testfile")
* f.getc #=> "h"
@@ -3755,7 +3810,7 @@ rb_io_readchar(VALUE io)
* ios.getbyte -> fixnum or nil
*
* Gets the next 8-bit byte (0..255) from <em>ios</em>. Returns
- * <code>nil</code> if called at end of file.
+ * +nil+ if called at end of file.
*
* f = File.new("testfile")
* f.getbyte #=> 84
@@ -3809,7 +3864,7 @@ rb_io_readbyte(VALUE io)
/*
* call-seq:
* ios.ungetbyte(string) -> nil
- * ios.ungetbyte(integer) -> nil
+ * ios.ungetbyte(integer) -> nil
*
* Pushes back bytes (passed as a parameter) onto <em>ios</em>,
* such that a subsequent buffered read will return it. Only one byte
@@ -4058,7 +4113,7 @@ finish_writeconv(rb_io_t *fptr, int noalloc)
}
if (rb_io_wait_writable(fptr->fd)) {
if (fptr->fd < 0)
- return noalloc ? Qtrue : rb_exc_new3(rb_eIOError, rb_str_new_cstr("closed stream"));
+ return noalloc ? Qtrue : rb_exc_new3(rb_eIOError, rb_str_new_cstr(closed_stream));
goto retry;
}
return noalloc ? Qtrue : INT2NUM(errno);
@@ -4143,12 +4198,16 @@ maygvl_fclose(FILE *file, int keepgvl)
return (int)(intptr_t)rb_thread_call_without_gvl(nogvl_fclose, file, RUBY_UBF_IO, 0);
}
+static void free_io_buffer(rb_io_buffer_t *buf);
+static void clear_codeconv(rb_io_t *fptr);
+
static void
-fptr_finalize(rb_io_t *fptr, int noraise)
+fptr_finalize_flush(rb_io_t *fptr, int noraise)
{
VALUE err = Qnil;
int fd = fptr->fd;
FILE *stdio_file = fptr->stdio_file;
+ int mode = fptr->mode;
if (fptr->writeconv) {
if (fptr->write_lock && !noraise) {
@@ -4189,7 +4248,11 @@ fptr_finalize(rb_io_t *fptr, int noraise)
/* fptr->fd may be closed even if close fails.
* POSIX doesn't specify it.
* We assumes it is closed. */
- if ((maygvl_close(fd, noraise) < 0) && NIL_P(err))
+
+ /**/
+ int keepgvl = !(mode & FMODE_WRITABLE);
+ keepgvl |= noraise;
+ if ((maygvl_close(fd, keepgvl) < 0) && NIL_P(err))
err = noraise ? Qtrue : INT2NUM(errno);
}
@@ -4197,8 +4260,7 @@ fptr_finalize(rb_io_t *fptr, int noraise)
switch (TYPE(err)) {
case T_FIXNUM:
case T_BIGNUM:
- errno = NUM2INT(err);
- rb_sys_fail_path(fptr->pathv);
+ rb_syserr_fail_path(NUM2INT(err), fptr->pathv);
default:
rb_exc_raise(err);
@@ -4207,6 +4269,15 @@ fptr_finalize(rb_io_t *fptr, int noraise)
}
static void
+fptr_finalize(rb_io_t *fptr, int noraise)
+{
+ fptr_finalize_flush(fptr, noraise);
+ free_io_buffer(&fptr->rbuf);
+ free_io_buffer(&fptr->wbuf);
+ clear_codeconv(fptr);
+}
+
+static void
rb_io_fptr_cleanup(rb_io_t *fptr, int noraise)
{
if (fptr->finalize) {
@@ -4218,16 +4289,22 @@ rb_io_fptr_cleanup(rb_io_t *fptr, int noraise)
}
static void
+free_io_buffer(rb_io_buffer_t *buf)
+{
+ if (buf->ptr) {
+ ruby_sized_xfree(buf->ptr, (size_t)buf->capa);
+ buf->ptr = NULL;
+ }
+}
+
+static void
clear_readconv(rb_io_t *fptr)
{
if (fptr->readconv) {
rb_econv_close(fptr->readconv);
fptr->readconv = NULL;
}
- if (fptr->cbuf.ptr) {
- free(fptr->cbuf.ptr);
- fptr->cbuf.ptr = NULL;
- }
+ free_io_buffer(&fptr->cbuf);
}
static void
@@ -4255,21 +4332,13 @@ rb_io_fptr_finalize(rb_io_t *fptr)
if (0 <= fptr->fd)
rb_io_fptr_cleanup(fptr, TRUE);
fptr->write_lock = 0;
- if (fptr->rbuf.ptr) {
- free(fptr->rbuf.ptr);
- fptr->rbuf.ptr = 0;
- }
- if (fptr->wbuf.ptr) {
- free(fptr->wbuf.ptr);
- fptr->wbuf.ptr = 0;
- }
+ free_io_buffer(&fptr->rbuf);
+ free_io_buffer(&fptr->wbuf);
clear_codeconv(fptr);
free(fptr);
return 1;
}
-size_t rb_econv_memsize(rb_econv_t *);
-
RUBY_FUNC_EXPORTED size_t
rb_io_memsize(const rb_io_t *fptr)
{
@@ -4282,13 +4351,15 @@ rb_io_memsize(const rb_io_t *fptr)
return size;
}
-VALUE
-rb_io_close(VALUE io)
+int rb_notify_fd_close(int fd);
+static rb_io_t *
+io_close_fptr(VALUE io)
{
rb_io_t *fptr;
int fd;
VALUE write_io;
rb_io_t *write_fptr;
+ int busy;
write_io = GetWriteIO(io);
if (io != write_io) {
@@ -4299,19 +4370,35 @@ rb_io_close(VALUE io)
}
fptr = RFILE(io)->fptr;
- if (!fptr) return Qnil;
- if (fptr->fd < 0) return Qnil;
+ if (!fptr) return 0;
+ if (fptr->fd < 0) return 0;
fd = fptr->fd;
- rb_thread_fd_close(fd);
+ busy = rb_notify_fd_close(fd);
+ fptr_finalize_flush(fptr, FALSE);
+ if (busy) {
+ do rb_thread_schedule(); while (rb_notify_fd_close(fd));
+ }
rb_io_fptr_cleanup(fptr, FALSE);
+ return fptr;
+}
+static void
+fptr_waitpid(rb_io_t *fptr, int nohang)
+{
+ int status;
if (fptr->pid) {
- rb_last_status_clear();
- rb_syswait(fptr->pid);
+ rb_last_status_clear();
+ rb_waitpid(fptr->pid, &status, nohang ? WNOHANG : 0);
fptr->pid = 0;
}
+}
+VALUE
+rb_io_close(VALUE io)
+{
+ rb_io_t *fptr = io_close_fptr(io);
+ if (fptr) fptr_waitpid(fptr, 0);
return Qnil;
}
@@ -4327,12 +4414,17 @@ rb_io_close(VALUE io)
*
* If <em>ios</em> is opened by <code>IO.popen</code>,
* <code>close</code> sets <code>$?</code>.
+ *
+ * Calling this method on closed IO object is just ignored since Ruby 2.3.
*/
static VALUE
rb_io_close_m(VALUE io)
{
- rb_io_check_closed(RFILE(io)->fptr);
+ rb_io_t *fptr = rb_io_get_fptr(io);
+ if (fptr->fd < 0) {
+ return Qnil;
+ }
rb_io_close(io);
return Qnil;
}
@@ -4340,13 +4432,31 @@ rb_io_close_m(VALUE io)
static VALUE
io_call_close(VALUE io)
{
- return rb_funcall(io, rb_intern("close"), 0, 0);
+ rb_check_funcall(io, rb_intern("close"), 0, 0);
+ return io;
+}
+
+static VALUE
+ignore_closed_stream(VALUE io, VALUE exc)
+{
+ enum {mesg_len = sizeof(closed_stream)-1};
+ VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
+ if (!RB_TYPE_P(mesg, T_STRING) ||
+ RSTRING_LEN(mesg) != mesg_len ||
+ memcmp(RSTRING_PTR(mesg), closed_stream, mesg_len)) {
+ rb_exc_raise(exc);
+ }
+ return io;
}
static VALUE
io_close(VALUE io)
{
- return rb_rescue(io_call_close, io, 0, 0);
+ VALUE closed = rb_check_funcall(io, rb_intern("closed?"), 0, 0);
+ if (closed != Qundef && RTEST(closed)) return io;
+ rb_rescue2(io_call_close, io, ignore_closed_stream, io,
+ rb_eIOError, (VALUE)0);
+ return io;
}
/*
@@ -4383,8 +4493,7 @@ rb_io_closed(VALUE io)
}
}
- fptr = RFILE(io)->fptr;
- rb_io_check_initialized(fptr);
+ fptr = rb_io_get_fptr(io);
return 0 <= fptr->fd ? Qfalse : Qtrue;
}
@@ -4412,7 +4521,8 @@ rb_io_close_read(VALUE io)
rb_io_t *fptr;
VALUE write_io;
- GetOpenFile(io, fptr);
+ fptr = rb_io_get_fptr(rb_io_taint_check(io));
+ if (fptr->fd < 0) return Qnil;
if (is_socket(fptr->fd, fptr->pathv)) {
#ifndef SHUT_RD
# define SHUT_RD 0
@@ -4428,20 +4538,19 @@ rb_io_close_read(VALUE io)
write_io = GetWriteIO(io);
if (io != write_io) {
rb_io_t *wfptr;
- GetOpenFile(write_io, wfptr);
+ wfptr = rb_io_get_fptr(rb_io_taint_check(write_io));
wfptr->pid = fptr->pid;
fptr->pid = 0;
RFILE(io)->fptr = wfptr;
/* bind to write_io temporarily to get rid of memory/fd leak */
fptr->tied_io_for_writing = 0;
- fptr->mode &= ~FMODE_DUPLEX;
RFILE(write_io)->fptr = fptr;
rb_io_fptr_cleanup(fptr, FALSE);
/* should not finalize fptr because another thread may be reading it */
return Qnil;
}
- if (fptr->mode & FMODE_WRITABLE) {
+ if ((fptr->mode & (FMODE_DUPLEX|FMODE_WRITABLE)) == FMODE_WRITABLE) {
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
return rb_io_close(io);
@@ -4473,7 +4582,8 @@ rb_io_close_write(VALUE io)
VALUE write_io;
write_io = GetWriteIO(io);
- GetOpenFile(write_io, fptr);
+ fptr = rb_io_get_fptr(rb_io_taint_check(write_io));
+ if (fptr->fd < 0) return Qnil;
if (is_socket(fptr->fd, fptr->pathv)) {
#ifndef SHUT_WR
# define SHUT_WR 1
@@ -4486,14 +4596,13 @@ rb_io_close_write(VALUE io)
return Qnil;
}
- if (fptr->mode & FMODE_READABLE) {
+ if ((fptr->mode & (FMODE_DUPLEX|FMODE_READABLE)) == FMODE_READABLE) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
if (io != write_io) {
- GetOpenFile(io, fptr);
+ fptr = rb_io_get_fptr(rb_io_taint_check(io));
fptr->tied_io_for_writing = 0;
- fptr->mode &= ~FMODE_DUPLEX;
}
rb_io_close(write_io);
return Qnil;
@@ -4572,6 +4681,7 @@ rb_io_syswrite(VALUE io, VALUE str)
}
n = rb_write_internal(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
+ RB_GC_GUARD(str);
if (n == -1) rb_sys_fail_path(fptr->pathv);
@@ -4585,10 +4695,12 @@ rb_io_syswrite(VALUE io, VALUE str)
* Reads <i>maxlen</i> bytes from <em>ios</em> using a low-level
* read and returns them as a string. Do not mix with other methods
* 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
+ *
+ * If the optional _outbuf_ argument is present,
+ * it must reference a String, which will receive the data.
+ * The _outbuf_ 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.
*
@@ -4617,8 +4729,6 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
rb_raise(rb_eIOError, "sysread for buffered IO");
}
- n = fptr->fd;
-
/*
* FIXME: removing rb_thread_wait_fd() here changes sysread semantics
* on non-blocking IOs. However, it's still currently possible
@@ -4717,7 +4827,6 @@ rb_io_ascii8bit_binmode(VALUE io)
* - newline conversion disabled
* - encoding conversion disabled
* - content is treated as ASCII-8BIT
- *
*/
static VALUE
@@ -4771,15 +4880,14 @@ rb_io_fmode_modestr(int fmode)
}
}
+static const char bom_prefix[] = "bom|";
+static const char utf_prefix[] = "utf-";
+enum {bom_prefix_len = (int)sizeof(bom_prefix) - 1};
+enum {utf_prefix_len = (int)sizeof(utf_prefix) - 1};
+
static int
io_encname_bom_p(const char *name, long len)
{
- static const char bom_prefix[] = "bom|utf-";
- enum {bom_prefix_len = (int)sizeof(bom_prefix) - 1};
- if (!len) {
- const char *p = strchr(name, ':');
- len = p ? (long)(p - name) : (long)strlen(name);
- }
return len > bom_prefix_len && STRNCASECMP(name, bom_prefix, bom_prefix_len) == 0;
}
@@ -4818,7 +4926,9 @@ rb_io_modestr_fmode(const char *modestr)
default:
goto error;
case ':':
- p = m;
+ p = strchr(m, ':');
+ if (io_encname_bom_p(m, p ? (long)(p - m) : (long)strlen(m)))
+ fmode |= FMODE_SETENC_BY_BOM;
goto finished;
}
}
@@ -4826,8 +4936,6 @@ rb_io_modestr_fmode(const char *modestr)
finished:
if ((fmode & FMODE_BINMODE) && (fmode & FMODE_TEXTMODE))
goto error;
- if (p && io_encname_bom_p(p, 0))
- fmode |= FMODE_SETENC_BY_BOM;
return fmode;
}
@@ -4837,7 +4945,7 @@ rb_io_oflags_fmode(int oflags)
{
int fmode = 0;
- switch (oflags & (O_RDONLY|O_WRONLY|O_RDWR)) {
+ switch (oflags & O_ACCMODE) {
case O_RDONLY:
fmode = FMODE_READABLE;
break;
@@ -4933,6 +5041,9 @@ rb_io_oflags_modestr(int oflags)
case O_WRONLY:
return MODE_BINARY("w", "wb");
case O_RDWR:
+ if (oflags & O_TRUNC) {
+ return MODE_BINARY("w+", "wb+");
+ }
return MODE_BINARY("r+", "rb+");
}
}
@@ -4971,45 +5082,42 @@ rb_io_ext_int_to_encs(rb_encoding *ext, rb_encoding *intern, rb_encoding **enc,
}
static void
-unsupported_encoding(const char *name)
+unsupported_encoding(const char *name, rb_encoding *enc)
{
- rb_warn("Unsupported encoding %s ignored", name);
+ rb_enc_warn(enc, "Unsupported encoding %s ignored", name);
}
static void
-parse_mode_enc(const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
+parse_mode_enc(const char *estr, rb_encoding *estr_enc,
+ rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
{
const char *p;
char encname[ENCODING_MAXNAMELEN+1];
int idx, idx2;
int fmode = fmode_p ? *fmode_p : 0;
rb_encoding *ext_enc, *int_enc;
+ long len;
/* parse estr as "enc" or "enc2:enc" or "enc:-" */
p = strrchr(estr, ':');
- if (p) {
- long len = (p++) - estr;
- if (len == 0 || len > ENCODING_MAXNAMELEN)
- idx = -1;
+ len = p ? (p++ - estr) : (long)strlen(estr);
+ if ((fmode & FMODE_SETENC_BY_BOM) || io_encname_bom_p(estr, len)) {
+ estr += bom_prefix_len;
+ len -= bom_prefix_len;
+ if (!STRNCASECMP(estr, utf_prefix, utf_prefix_len)) {
+ fmode |= FMODE_SETENC_BY_BOM;
+ }
else {
- if (io_encname_bom_p(estr, len)) {
- fmode |= FMODE_SETENC_BY_BOM;
- estr += 4;
- len -= 4;
- }
- memcpy(encname, estr, len);
- encname[len] = '\0';
- estr = encname;
- idx = rb_enc_find_index(encname);
+ rb_enc_warn(estr_enc, "BOM with non-UTF encoding %s is nonsense", estr);
+ fmode &= ~FMODE_SETENC_BY_BOM;
}
}
+ if (len == 0 || len > ENCODING_MAXNAMELEN) {
+ idx = -1;
+ }
else {
- long len = strlen(estr);
- if (io_encname_bom_p(estr, len)) {
- fmode |= FMODE_SETENC_BY_BOM;
- estr += 4;
- len -= 4;
+ if (p) {
memcpy(encname, estr, len);
encname[len] = '\0';
estr = encname;
@@ -5022,7 +5130,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)
- unsupported_encoding(estr);
+ unsupported_encoding(estr, estr_enc);
ext_enc = NULL;
}
@@ -5035,7 +5143,7 @@ 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)
- unsupported_encoding(p);
+ unsupported_encoding(p, estr_enc);
else if (!(fmode & FMODE_SETENC_BY_BOM) && (idx2 == idx)) {
int_enc = (rb_encoding *)Qnil;
}
@@ -5067,9 +5175,9 @@ rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2
if ((extenc != Qundef || intenc != Qundef) && !NIL_P(encoding)) {
if (!NIL_P(ruby_verbose)) {
int idx = rb_to_encoding_index(encoding);
- rb_warn("Ignoring encoding parameter '%s': %s_encoding is used",
- idx < 0 ? StringValueCStr(encoding) : rb_enc_name(rb_enc_from_index(idx)),
- extenc == Qundef ? "internal" : "external");
+ if (idx >= 0) encoding = rb_enc_from_encoding(rb_enc_from_index(idx));
+ rb_warn("Ignoring encoding parameter '%"PRIsVALUE"': %s_encoding is used",
+ encoding, extenc == Qundef ? "internal" : "external");
}
encoding = Qnil;
}
@@ -5102,7 +5210,8 @@ rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2
if (!NIL_P(encoding)) {
extracted = 1;
if (!NIL_P(tmp = rb_check_string_type(encoding))) {
- parse_mode_enc(StringValueCStr(tmp), enc_p, enc2_p, fmode_p);
+ parse_mode_enc(StringValueCStr(tmp), rb_enc_get(tmp),
+ enc_p, enc2_p, fmode_p);
}
else {
rb_io_ext_int_to_encs(rb_to_encoding(encoding), NULL, enc_p, enc2_p, 0);
@@ -5207,7 +5316,7 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
p = strchr(p, ':');
if (p) {
has_enc = 1;
- parse_mode_enc(p+1, &enc, &enc2, &fmode);
+ parse_mode_enc(p+1, rb_enc_get(vmode), &enc, &enc2, &fmode);
}
else {
rb_encoding *e;
@@ -5231,6 +5340,24 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
}
else {
VALUE v;
+ if (!has_vmode) {
+ v = rb_hash_aref(opthash, sym_mode);
+ if (!NIL_P(v)) {
+ if (!NIL_P(vmode)) {
+ rb_raise(rb_eArgError, "mode specified twice");
+ }
+ has_vmode = 1;
+ vmode = v;
+ goto vmode_handle;
+ }
+ }
+ v = rb_hash_aref(opthash, sym_flags);
+ if (!NIL_P(v)) {
+ v = rb_to_int(v);
+ oflags |= NUM2INT(v);
+ vmode = INT2NUM(oflags);
+ fmode = rb_io_oflags_fmode(oflags);
+ }
extract_binmode(opthash, &fmode);
if (fmode & FMODE_BINMODE) {
#ifdef O_BINARY
@@ -5244,17 +5371,6 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
fmode |= DEFAULT_TEXTMODE;
}
#endif
- if (!has_vmode) {
- v = rb_hash_aref(opthash, sym_mode);
- if (!NIL_P(v)) {
- if (!NIL_P(vmode)) {
- rb_raise(rb_eArgError, "mode specified twice");
- }
- has_vmode = 1;
- vmode = v;
- goto vmode_handle;
- }
- }
v = rb_hash_aref(opthash, sym_perm);
if (!NIL_P(v)) {
if (vperm_p) {
@@ -5328,13 +5444,13 @@ rb_sysopen(VALUE fname, int oflags, mode_t perm)
struct sysopen_struct data;
data.fname = rb_str_encode_ospath(fname);
+ StringValueCStr(data.fname);
data.oflags = oflags;
data.perm = perm;
fd = rb_sysopen_internal(&data);
if (fd < 0) {
- if (errno == EMFILE || errno == ENFILE) {
- rb_gc();
+ if (rb_gc_for_fd(errno)) {
fd = rb_sysopen_internal(&data);
}
if (fd < 0) {
@@ -5354,24 +5470,25 @@ rb_fdopen(int fd, const char *modestr)
#endif
file = fdopen(fd, modestr);
if (!file) {
- if (
#if defined(__sun)
- errno == 0 ||
-#endif
- errno == EMFILE || errno == ENFILE) {
+ if (errno == 0) {
rb_gc();
-#if defined(__sun)
errno = 0;
+ file = fdopen(fd, modestr);
+ }
+ else
#endif
+ if (rb_gc_for_fd(errno)) {
file = fdopen(fd, modestr);
}
if (!file) {
+ int e = errno;
#ifdef _WIN32
- if (errno == 0) errno = EINVAL;
+ if (e == 0) e = EINVAL;
#elif defined(__sun)
- if (errno == 0) errno = EMFILE;
+ if (e == 0) e = EMFILE;
#endif
- rb_sys_fail(0);
+ rb_syserr_fail(e, 0);
}
}
@@ -5506,7 +5623,8 @@ rb_file_open_internal(VALUE io, VALUE filename, const char *modestr)
convconfig_t convconfig;
if (p) {
- parse_mode_enc(p+1, &convconfig.enc, &convconfig.enc2, &fmode);
+ parse_mode_enc(p+1, rb_usascii_encoding(),
+ &convconfig.enc, &convconfig.enc2, &fmode);
}
else {
rb_encoding *e;
@@ -5538,7 +5656,7 @@ rb_file_open(const char *fname, const char *modestr)
return rb_file_open_internal(io_alloc(rb_cFile), rb_str_new_cstr(fname), modestr);
}
-#if defined(__CYGWIN__) || !defined(HAVE_FORK)
+#if defined(__CYGWIN__) || !defined(HAVE_WORKING_FORK)
static struct pipe_list {
rb_io_t *fptr;
struct pipe_list *next;
@@ -5578,6 +5696,7 @@ pipe_del_fptr(rb_io_t *fptr)
}
}
+#if defined (_WIN32) || defined(__CYGWIN__)
static void
pipe_atexit(void)
{
@@ -5590,11 +5709,12 @@ pipe_atexit(void)
list = tmp;
}
}
+#endif
static void
pipe_finalize(rb_io_t *fptr, int noraise)
{
-#if !defined(HAVE_FORK) && !defined(_WIN32)
+#if !defined(HAVE_WORKING_FORK) && !defined(_WIN32)
int status = 0;
if (fptr->stdio_file) {
status = pclose(fptr->stdio_file);
@@ -5628,8 +5748,7 @@ rb_pipe(int *pipes)
int ret;
ret = rb_cloexec_pipe(pipes);
if (ret == -1) {
- if (errno == EMFILE || errno == ENFILE) {
- rb_gc();
+ if (rb_gc_for_fd(errno)) {
ret = rb_cloexec_pipe(pipes);
}
}
@@ -5646,7 +5765,7 @@ rb_pipe(int *pipes)
#define spawn(mode, cmd) rb_w32_uspawn((mode), (cmd), 0)
#endif
-#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
+#if defined(HAVE_WORKING_FORK) || defined(HAVE_SPAWNV)
struct popen_arg {
VALUE execarg_obj;
struct rb_execarg *eargp;
@@ -5656,7 +5775,7 @@ struct popen_arg {
};
#endif
-#ifdef HAVE_FORK
+#ifdef HAVE_WORKING_FORK
static void
popen_redirect(struct popen_arg *p)
{
@@ -5734,19 +5853,20 @@ linux_get_maxfd(void)
void
rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds)
{
+#if defined(HAVE_FCNTL) && defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
int fd, ret;
int max = (int)max_file_descriptor;
-#ifdef F_MAXFD
+# 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__)
+# elif defined(__linux__)
ret = linux_get_maxfd();
if (maxhint < ret)
maxhint = ret;
/* maxhint = max = ret; if (ret == -1) abort(); // test */
-#endif
+# endif
if (max < maxhint)
max = maxhint;
for (fd = lowfd; fd <= max; fd++) {
@@ -5757,12 +5877,13 @@ rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds)
if (ret != -1 && !(ret & FD_CLOEXEC)) {
fcntl(fd, F_SETFD, ret|FD_CLOEXEC); /* async-signal-safe */
}
-#define CONTIGUOUS_CLOSED_FDS 20
+# define CONTIGUOUS_CLOSED_FDS 20
if (ret != -1) {
if (max < fd + CONTIGUOUS_CLOSED_FDS)
max = fd + CONTIGUOUS_CLOSED_FDS;
}
}
+#endif
}
static int
@@ -5774,6 +5895,17 @@ popen_exec(void *pp, char *errmsg, size_t errmsg_len)
}
#endif
+#if defined(HAVE_WORKING_FORK) || defined(HAVE_SPAWNV)
+static VALUE
+rb_execarg_fixup_v(VALUE execarg_obj)
+{
+ rb_execarg_parent_start(execarg_obj);
+ return Qnil;
+}
+#else
+char *rb_execarg_commandline(const struct rb_execarg *eargp, VALUE *prog);
+#endif
+
static VALUE
pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convconfig)
{
@@ -5784,14 +5916,15 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
VALUE port;
rb_io_t *write_fptr;
VALUE write_port;
-#if defined(HAVE_FORK)
+#if defined(HAVE_WORKING_FORK)
int status;
char errmsg[80] = { '\0' };
#endif
-#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
+#if defined(HAVE_WORKING_FORK) || defined(HAVE_SPAWNV)
+ int state;
struct popen_arg arg;
- int e = 0;
#endif
+ int e = 0;
#if defined(HAVE_SPAWNV)
# if defined(HAVE_SPAWNVE)
# define DO_SPAWN(cmd, args, envp) ((args) ? \
@@ -5802,37 +5935,33 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
spawnv(P_NOWAIT, (cmd), (args)) : \
spawn(P_NOWAIT, (cmd)))
# endif
-# if !defined(HAVE_FORK)
+# if !defined(HAVE_WORKING_FORK)
char **args = NULL;
# if defined(HAVE_SPAWNVE)
char **envp = NULL;
# endif
# endif
#endif
-#if !defined(HAVE_FORK)
+#if !defined(HAVE_WORKING_FORK)
struct rb_execarg sarg, *sargp = &sarg;
#endif
FILE *fp = 0;
int fd = -1;
int write_fd = -1;
-#if !defined(HAVE_FORK)
+#if !defined(HAVE_WORKING_FORK)
const char *cmd = 0;
-#if !defined(HAVE_SPAWNV)
- int argc;
- VALUE *argv;
-#endif
if (prog)
cmd = StringValueCStr(prog);
#endif
-#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
+#if defined(HAVE_WORKING_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 !defined(HAVE_WORKING_FORK)
if (eargp && !eargp->use_shell) {
args = ARGVSTR2ARGV(eargp->invoke.cmd.argv_str);
}
@@ -5842,11 +5971,10 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
if (rb_pipe(arg.write_pair) < 0)
rb_sys_fail_str(prog);
if (rb_pipe(arg.pair) < 0) {
- int e = errno;
+ e = errno;
close(arg.write_pair[0]);
close(arg.write_pair[1]);
- errno = e;
- rb_sys_fail_str(prog);
+ rb_syserr_fail_str(e, prog);
}
if (eargp) {
rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(arg.write_pair[0]));
@@ -5869,8 +5997,17 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
rb_sys_fail_str(prog);
}
if (!NIL_P(execarg_obj)) {
- rb_execarg_fixup(execarg_obj);
-# if defined(HAVE_FORK)
+ rb_protect(rb_execarg_fixup_v, execarg_obj, &state);
+ if (state) {
+ if (0 <= arg.write_pair[0]) close(arg.write_pair[0]);
+ if (0 <= arg.write_pair[1]) close(arg.write_pair[1]);
+ if (0 <= arg.pair[0]) close(arg.pair[0]);
+ if (0 <= arg.pair[1]) close(arg.pair[1]);
+ rb_execarg_parent_end(execarg_obj);
+ rb_jump_tag(state);
+ }
+
+# if defined(HAVE_WORKING_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);
@@ -5892,9 +6029,10 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
if (eargp)
rb_execarg_run_options(sargp, NULL, NULL, 0);
# endif
+ rb_execarg_parent_end(execarg_obj);
}
else {
-# if defined(HAVE_FORK)
+# if defined(HAVE_WORKING_FORK)
pid = rb_fork_ruby(&status);
if (pid == 0) { /* child */
rb_thread_atfork();
@@ -5910,7 +6048,7 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
/* parent */
if (pid == -1) {
-# if defined(HAVE_FORK)
+# if defined(HAVE_WORKING_FORK)
e = errno;
# endif
close(arg.pair[0]);
@@ -5919,12 +6057,11 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
close(arg.write_pair[0]);
close(arg.write_pair[1]);
}
- errno = e;
-# if defined(HAVE_FORK)
+# if defined(HAVE_WORKING_FORK)
if (errmsg[0])
- rb_sys_fail(errmsg);
+ rb_syserr_fail(e, errmsg);
# endif
- rb_sys_fail_str(prog);
+ rb_syserr_fail_str(e, prog);
}
if ((fmode & FMODE_READABLE) && (fmode & FMODE_WRITABLE)) {
close(arg.pair[1]);
@@ -5941,18 +6078,18 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
fd = arg.pair[1];
}
#else
- if (argc) {
- prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
- cmd = StringValueCStr(prog);
- }
+ cmd = rb_execarg_commandline(eargp, &prog);
if (!NIL_P(execarg_obj)) {
- rb_execarg_fixup(execarg_obj);
+ rb_execarg_parent_start(execarg_obj);
rb_execarg_run_options(eargp, sargp, NULL, 0);
}
fp = popen(cmd, modestr);
- if (eargp)
+ e = errno;
+ if (eargp) {
+ rb_execarg_parent_end(execarg_obj);
rb_execarg_run_options(sargp, NULL, NULL, 0);
- if (!fp) rb_sys_fail_path(prog);
+ }
+ if (!fp) rb_syserr_fail_path(e, prog);
fd = fileno(fp);
#endif
@@ -5991,7 +6128,7 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
rb_ivar_set(port, rb_intern("@tied_io_for_writing"), write_port);
}
-#if defined (__CYGWIN__) || !defined(HAVE_FORK)
+#if defined (__CYGWIN__) || !defined(HAVE_WORKING_FORK)
fptr->finalize = pipe_finalize;
pipe_add_fptr(fptr);
#endif
@@ -6002,7 +6139,7 @@ static int
is_popen_fork(VALUE prog)
{
if (RSTRING_LEN(prog) == 1 && RSTRING_PTR(prog)[0] == '-') {
-#if !defined(HAVE_FORK)
+#if !defined(HAVE_WORKING_FORK)
rb_raise(rb_eNotImpError,
"fork() function is unimplemented on this machine");
#else
@@ -6024,6 +6161,16 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig
return pipe_open(execarg_obj, modestr, fmode, convconfig);
}
+static VALUE
+pipe_close(VALUE io)
+{
+ rb_io_t *fptr = io_close_fptr(io);
+ if (fptr) {
+ fptr_waitpid(fptr, rb_thread_to_be_killed(rb_thread_current()));
+ }
+ return Qnil;
+}
+
/*
* call-seq:
* IO.popen([env,] cmd, mode="r" [, opt]) -> io
@@ -6078,7 +6225,7 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig
* If a block is given, Ruby will run the command as a child connected
* to Ruby with a pipe. Ruby's end of the pipe will be passed as a
* parameter to the block.
- * At the end of block, Ruby close the pipe and sets <code>$?</code>.
+ * At the end of block, Ruby closes the pipe and sets <code>$?</code>.
* In this case <code>IO.popen</code> returns
* the value of the block.
*
@@ -6086,7 +6233,7 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig
* the block will be run in two separate processes: once in the parent,
* and once in a child. The parent process will be passed the pipe
* object as a parameter to the block, the child version of the block
- * will be passed <code>nil</code>, and the child's standard in and
+ * will be passed +nil+, and the child's standard in and
* standard out will be connected to the parent through the pipe. Not
* available on all platforms.
*
@@ -6094,7 +6241,7 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig
* p f.readlines
* f.close
* puts "Parent is #{Process.pid}"
- * IO.popen("date") { |f| puts f.gets }
+ * IO.popen("date") {|f| puts f.gets }
* IO.popen("-") {|f| $stderr.puts "#{Process.pid} is here, f is #{f.inspect}"}
* p $?
* IO.popen(%w"sed -e s|^|<foo>| -e s&$&;zot;&", "r+") {|f|
@@ -6143,10 +6290,8 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
rb_raise(rb_eArgError, "too many arguments");
}
#endif
- tmp = rb_ary_dup(tmp);
- RBASIC_CLEAR_CLASS(tmp);
- execarg_obj = rb_execarg_new((int)len, RARRAY_PTR(tmp), FALSE);
- rb_ary_clear(tmp);
+ execarg_obj = rb_execarg_new((int)len, RARRAY_CONST_PTR(tmp), FALSE);
+ RB_GC_GUARD(tmp);
}
else {
SafeStringValue(pname);
@@ -6176,7 +6321,7 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
}
RBASIC_SET_CLASS(port, klass);
if (rb_block_given_p()) {
- return rb_ensure(rb_yield, port, io_close, port);
+ return rb_ensure(rb_yield, port, pipe_close, port);
}
return port;
}
@@ -6244,7 +6389,7 @@ rb_open_file(int argc, const VALUE *argv, VALUE io)
*
* call-seq:
* IO.open(fd, mode="r" [, opt]) -> io
- * IO.open(fd, mode="r" [, opt]) { |io| block } -> obj
+ * IO.open(fd, mode="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,
@@ -6356,7 +6501,7 @@ check_pipe_command(VALUE filename_or_command)
* parent. If the command is not <code>"-"</code>, the subprocess runs the
* command.
*
- * When the subprocess is ruby (opened via <code>"|-"</code>), the +open+
+ * 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.
*
@@ -6389,7 +6534,7 @@ check_pipe_command(VALUE filename_or_command)
* Open a subprocess running the same Ruby program:
*
* f = open("|-", "w+")
- * if f == nil
+ * if f.nil?
* puts "in Child"
* exit
* else
@@ -6528,7 +6673,7 @@ io_reopen(VALUE io, VALUE nfile)
if (RTEST(orig->pathv)) fptr->pathv = orig->pathv;
else if (!IS_PREP_STDIO(fptr)) fptr->pathv = Qnil;
fptr->finalize = orig->finalize;
-#if defined (__CYGWIN__) || !defined(HAVE_FORK)
+#if defined (__CYGWIN__) || !defined(HAVE_WORKING_FORK)
if (fptr->finalize == pipe_finalize)
pipe_add_fptr(fptr);
#endif
@@ -6551,7 +6696,7 @@ io_reopen(VALUE io, VALUE nfile)
rb_update_max_fd(fd);
fptr->fd = fd;
}
- rb_thread_fd_close(fd);
+ rb_notify_fd_close(fd);
if ((orig->mode & FMODE_READABLE) && pos >= 0) {
if (io_seek(fptr, pos, SEEK_SET) < 0 && errno) {
rb_sys_fail_path(fptr->pathv);
@@ -6570,6 +6715,20 @@ io_reopen(VALUE io, VALUE nfile)
return io;
}
+#ifdef _WIN32
+int rb_freopen(VALUE fname, const char *mode, FILE *fp);
+#else
+static int
+rb_freopen(VALUE fname, const char *mode, FILE *fp)
+{
+ if (!freopen(RSTRING_PTR(fname), mode, fp)) {
+ RB_GC_GUARD(fname);
+ return errno;
+ }
+ return 0;
+}
+#endif
+
/*
* call-seq:
* ios.reopen(other_IO) -> ios
@@ -6604,8 +6763,7 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
rb_io_taint_check(file);
fptr = RFILE(file)->fptr;
if (!fptr) {
- fptr = RFILE(file)->fptr = ALLOC(rb_io_t);
- MEMZERO(fptr, rb_io_t, 1);
+ fptr = RFILE(file)->fptr = ZALLOC(rb_io_t);
}
if (!NIL_P(nmode) || !NIL_P(opt)) {
@@ -6628,7 +6786,7 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
oflags = rb_io_fmode_oflags(fptr->mode);
}
- fptr->pathv = rb_str_new_frozen(fname);
+ fptr->pathv = fname;
if (fptr->fd < 0) {
fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666);
fptr->stdio_file = 0;
@@ -6642,9 +6800,10 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
fptr->rbuf.off = fptr->rbuf.len = 0;
if (fptr->stdio_file) {
- if (freopen(RSTRING_PTR(fptr->pathv), rb_io_oflags_modestr(oflags), fptr->stdio_file) == 0) {
- rb_sys_fail_path(fptr->pathv);
- }
+ int e = rb_freopen(rb_str_encode_ospath(fptr->pathv),
+ rb_io_oflags_modestr(oflags),
+ fptr->stdio_file);
+ if (e) rb_syserr_fail_path(e, fptr->pathv);
fptr->fd = fileno(fptr->stdio_file);
rb_fd_fix_cloexec(fptr->fd);
#ifdef USE_SETVBUF
@@ -6697,7 +6856,7 @@ rb_io_init_copy(VALUE dest, VALUE io)
fptr->lineno = orig->lineno;
if (!NIL_P(orig->pathv)) fptr->pathv = orig->pathv;
fptr->finalize = orig->finalize;
-#if defined (__CYGWIN__) || !defined(HAVE_FORK)
+#if defined (__CYGWIN__) || !defined(HAVE_WORKING_FORK)
if (fptr->finalize == pipe_finalize)
pipe_add_fptr(fptr);
#endif
@@ -6731,7 +6890,7 @@ rb_io_init_copy(VALUE dest, VALUE io)
*/
VALUE
-rb_io_printf(int argc, VALUE *argv, VALUE out)
+rb_io_printf(int argc, const VALUE *argv, VALUE out)
{
rb_io_write(out, rb_f_sprintf(argc, argv));
return Qnil;
@@ -6769,18 +6928,20 @@ rb_f_printf(int argc, VALUE *argv)
/*
* call-seq:
- * ios.print() -> nil
+ * ios.print -> nil
* ios.print(obj, ...) -> nil
*
- * Writes the given object(s) to <em>ios</em>. The stream must be
- * opened for writing. If the output field separator (<code>$,</code>)
- * is not <code>nil</code>, it will be inserted between each object.
- * If the output record separator (<code>$\\</code>)
- * is not <code>nil</code>, it will be appended to the output. If no
- * arguments are given, prints <code>$_</code>. Objects that aren't
- * strings will be converted by calling their <code>to_s</code> method.
- * With no argument, prints the contents of the variable <code>$_</code>.
- * Returns <code>nil</code>.
+ * Writes the given object(s) to <em>ios</em>. Returns +nil+.
+ *
+ * The stream must be opened for writing.
+ * Each given object that isn't a string will be converted by calling
+ * its <code>to_s</code> method.
+ * When called without arguments, prints the contents of <code>$_</code>.
+ *
+ * If the output field separator (<code>$,</code>) is not +nil+,
+ * it is inserted between objects.
+ * If the output record separator (<code>$\\</code>) is not +nil+,
+ * it is appended to the output.
*
* $stdout.print("This is ", 100, " percent.\n")
*
@@ -6790,7 +6951,7 @@ rb_f_printf(int argc, VALUE *argv)
*/
VALUE
-rb_io_print(int argc, VALUE *argv, VALUE out)
+rb_io_print(int argc, const VALUE *argv, VALUE out)
{
int i;
VALUE line;
@@ -6838,7 +6999,7 @@ rb_io_print(int argc, VALUE *argv, VALUE out)
*/
static VALUE
-rb_f_print(int argc, VALUE *argv)
+rb_f_print(int argc, const VALUE *argv)
{
rb_io_print(argc, argv, rb_stdout);
return Qnil;
@@ -6885,8 +7046,8 @@ rb_io_putc(VALUE io, VALUE ch)
*
* $stdout.putc(int)
*
- * Refer to the documentation for IO#putc for important information regarding
- * multi-byte characters.
+ * Refer to the documentation for IO#putc for important information regarding
+ * multi-byte characters.
*/
static VALUE
@@ -6938,13 +7099,17 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
* call-seq:
* ios.puts(obj, ...) -> nil
*
- * Writes the given objects to <em>ios</em> as with
- * <code>IO#print</code>. Writes a record separator (typically a
- * newline) after any that do not already end with a newline sequence.
+ * Writes the given object(s) to <em>ios</em>.
+ * Writes a newline after any that do not already end
+ * with a newline sequence. Returns +nil+.
+ *
+ * The stream must be opened for writing.
* If called with an array argument, writes each element on a new line.
- * If called without arguments, outputs a single record separator.
+ * Each given object that isn't a string or array will be converted
+ * by calling its +to_s+ method.
+ * If called without arguments, outputs a single newline.
*
- * $stdout.puts("this", "is", "a", "test")
+ * $stdout.puts("this", "is", ["a", "test"])
*
* <em>produces:</em>
*
@@ -6952,10 +7117,13 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
* is
* a
* test
+ *
+ * Note that +puts+ always uses newlines and is not affected
+ * by the output record separator (<code>$\\</code>).
*/
VALUE
-rb_io_puts(int argc, VALUE *argv, VALUE out)
+rb_io_puts(int argc, const VALUE *argv, VALUE out)
{
int i;
VALUE line;
@@ -7140,6 +7308,11 @@ rb_write_error_str(VALUE mesg)
/* a stopgap measure for the time being */
if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
size_t len = (size_t)RSTRING_LEN(mesg);
+#ifdef _WIN32
+ if (isatty(fileno(stderr))) {
+ if (rb_w32_write_console(mesg, fileno(stderr)) > 0) return;
+ }
+#endif
if (fwrite(RSTRING_PTR(mesg), sizeof(char), len, stderr) < len) {
RB_GC_GUARD(mesg);
return;
@@ -7155,9 +7328,9 @@ static void
must_respond_to(ID mid, VALUE val, ID id)
{
if (!rb_respond_to(val, mid)) {
- rb_raise(rb_eTypeError, "%s must have %s method, %s given",
- rb_id2name(id), rb_id2name(mid),
- rb_obj_classname(val));
+ rb_raise(rb_eTypeError, "%"PRIsVALUE" must have %"PRIsVALUE" method, %"PRIsVALUE" given",
+ rb_id2str(id), rb_id2str(mid),
+ rb_obj_class(val));
}
}
@@ -7228,6 +7401,60 @@ rb_io_stdio_file(rb_io_t *fptr)
return fptr->stdio_file;
}
+static inline void
+rb_io_buffer_init(rb_io_buffer_t *buf)
+{
+ buf->ptr = NULL;
+ buf->off = 0;
+ buf->len = 0;
+ buf->capa = 0;
+}
+
+static inline rb_io_t *
+rb_io_fptr_new(void)
+{
+ rb_io_t *fp = ALLOC(rb_io_t);
+ fp->fd = -1;
+ fp->stdio_file = NULL;
+ fp->mode = 0;
+ fp->pid = 0;
+ fp->lineno = 0;
+ fp->pathv = Qnil;
+ fp->finalize = 0;
+ rb_io_buffer_init(&fp->wbuf);
+ rb_io_buffer_init(&fp->rbuf);
+ rb_io_buffer_init(&fp->cbuf);
+ fp->readconv = NULL;
+ fp->writeconv = NULL;
+ fp->writeconv_asciicompat = Qnil;
+ fp->writeconv_pre_ecflags = 0;
+ fp->writeconv_pre_ecopts = Qnil;
+ fp->writeconv_initialized = 0;
+ fp->tied_io_for_writing = 0;
+ fp->encs.enc = NULL;
+ fp->encs.enc2 = NULL;
+ fp->encs.ecflags = 0;
+ fp->encs.ecopts = Qnil;
+ fp->write_lock = 0;
+ return fp;
+}
+
+rb_io_t *
+rb_io_make_open_file(VALUE obj)
+{
+ rb_io_t *fp = 0;
+
+ Check_Type(obj, T_FILE);
+ if (RFILE(obj)->fptr) {
+ rb_io_close(obj);
+ rb_io_fptr_finalize(RFILE(obj)->fptr);
+ RFILE(obj)->fptr = 0;
+ }
+ fp = rb_io_fptr_new();
+ RFILE(obj)->fptr = fp;
+ return fp;
+}
+
/*
* call-seq:
* IO.new(fd [, mode] [, opt]) -> io
@@ -7269,12 +7496,12 @@ rb_io_stdio_file(rb_io_t *fptr)
* "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" Write-only, each write call appends data at end of file.
+ * Creates a new file for writing if file does not exist.
*
- * "a+" Read-write, starts at end of file if file exists,
- * otherwise creates a new file for reading and
- * writing.
+ * "a+" Read-write, each write call appends data at end of file.
+ * Creates a new file for reading and writing if file does
+ * not exist.
*
* The following modes must be used separately, and along with one or more of
* the modes seen above.
@@ -7304,7 +7531,7 @@ rb_io_stdio_file(rb_io_t *fptr)
* 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
+ * 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
@@ -7319,6 +7546,10 @@ rb_io_stdio_file(rb_io_t *fptr)
* :mode ::
* Same as +mode+ parameter
*
+ * :flags ::
+ * Specifies file open flags as integer.
+ * If +mode+ parameter is given, this parameter will be bitwise-ORed.
+ *
* :\external_encoding ::
* External encoding for the IO. "-" is a synonym for the default external
* encoding.
@@ -7327,7 +7558,7 @@ rb_io_stdio_file(rb_io_t *fptr)
* Internal encoding for the IO. "-" is a synonym for the default internal
* encoding.
*
- * If the value is nil no conversion occurs.
+ * If the value is +nil+ no conversion occurs.
*
* :encoding ::
* Specifies external and internal encodings as "extern:intern".
@@ -7478,9 +7709,9 @@ static VALUE
rb_io_s_new(int argc, VALUE *argv, VALUE klass)
{
if (rb_block_given_p()) {
- const char *cname = rb_class2name(klass);
+ VALUE cname = rb_obj_as_string(klass);
- rb_warn("%s::new() does not take block; use %s::open() instead",
+ rb_warn("%"PRIsVALUE"::new() does not take block; use %"PRIsVALUE"::open() instead",
cname, cname);
}
return rb_class_new_instance(argc, argv, klass);
@@ -7514,8 +7745,8 @@ rb_io_s_for_fd(int argc, VALUE *argv, VALUE klass)
static VALUE
rb_io_autoclose_p(VALUE io)
{
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
+ rb_io_t *fptr = RFILE(io)->fptr;
+ rb_io_check_closed(fptr);
return (fptr->mode & FMODE_PREP) ? Qfalse : Qtrue;
}
@@ -7571,7 +7802,6 @@ 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;
}
@@ -7579,7 +7809,7 @@ argf_memsize(const void *ptr)
static const rb_data_type_t argf_type = {
"ARGF",
{argf_mark, argf_free, argf_memsize},
- NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static inline void
@@ -7656,7 +7886,7 @@ argf_set_lineno(VALUE argf, VALUE val)
/*
* call-seq:
- * ARGF.lineno -> integer
+ * ARGF.lineno -> integer
*
* Returns the current line number of ARGF as a whole. This value
* can be set manually with +ARGF.lineno=+.
@@ -7738,9 +7968,11 @@ argf_next_argv(VALUE argf)
if (ARGF.next_p == 1) {
retry:
if (RARRAY_LEN(ARGF.argv) > 0) {
- ARGF.filename = rb_ary_shift(ARGF.argv);
- fn = StringValueCStr(ARGF.filename);
- if (strlen(fn) == 1 && fn[0] == '-') {
+ VALUE filename = rb_ary_shift(ARGF.argv);
+ StringValueCStr(filename);
+ ARGF.filename = rb_str_encode_ospath(filename);
+ fn = StringValueCStr(filename);
+ if (RSTRING_LEN(filename) == 1 && fn[0] == '-') {
ARGF.current_file = rb_stdin;
if (ARGF.inplace) {
rb_warn("Can't do inplace edit for stdio; skipping");
@@ -7749,7 +7981,7 @@ argf_next_argv(VALUE argf)
}
else {
VALUE write_io = Qnil;
- int fr = rb_sysopen(ARGF.filename, O_RDONLY, 0);
+ int fr = rb_sysopen(filename, O_RDONLY, 0);
if (ARGF.inplace) {
struct stat st;
@@ -7763,22 +7995,24 @@ argf_next_argv(VALUE argf)
rb_io_close(rb_stdout);
}
fstat(fr, &st);
+ str = filename;
if (*ARGF.inplace) {
- str = rb_str_new2(fn);
+ str = rb_str_dup(str);
rb_str_cat2(str, ARGF.inplace);
+ /* TODO: encoding of ARGF.inplace */
#ifdef NO_SAFE_RENAME
(void)close(fr);
(void)unlink(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));
+ rb_warn("Can't rename %"PRIsVALUE" to %"PRIsVALUE": %s, skipping file",
+ filename, str, strerror(errno));
goto retry;
}
fr = rb_sysopen(str, O_RDONLY, 0);
#else
if (rename(fn, RSTRING_PTR(str)) < 0) {
- rb_warn("Can't rename %s to %s: %s, skipping file",
- fn, RSTRING_PTR(str), strerror(errno));
+ rb_warn("Can't rename %"PRIsVALUE" to %"PRIsVALUE": %s, skipping file",
+ filename, str, strerror(errno));
close(fr);
goto retry;
}
@@ -7789,14 +8023,14 @@ argf_next_argv(VALUE argf)
rb_fatal("Can't do inplace edit without backup");
#else
if (unlink(fn) < 0) {
- rb_warn("Can't remove %s: %s, skipping file",
- fn, strerror(errno));
+ rb_warn("Can't remove %"PRIsVALUE": %s, skipping file",
+ filename, strerror(errno));
close(fr);
goto retry;
}
#endif
}
- fw = rb_sysopen(ARGF.filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
+ fw = rb_sysopen(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
#ifndef NO_SAFE_RENAME
fstat(fw, &st2);
#ifdef HAVE_FCHMOD
@@ -7812,9 +8046,9 @@ argf_next_argv(VALUE argf)
err = chown(fn, st.st_uid, st.st_gid);
#endif
if (err && getuid() == 0 && st2.st_uid == 0) {
- const char *wkfn = RSTRING_PTR(ARGF.filename);
- rb_warn("Can't set owner/group of %s to same as %s: %s, skipping file",
- wkfn, fn, strerror(errno));
+ const char *wkfn = RSTRING_PTR(filename);
+ rb_warn("Can't set owner/group of %"PRIsVALUE" to same as %"PRIsVALUE": %s, skipping file",
+ filename, str, strerror(errno));
(void)close(fr);
(void)close(fw);
(void)unlink(wkfn);
@@ -7919,9 +8153,9 @@ static VALUE argf_gets(int, VALUE *, VALUE);
/*
* call-seq:
- * gets(sep=$/) -> string or nil
- * gets(limit) -> string or nil
- * gets(sep,limit) -> string or nil
+ * gets(sep=$/) -> string or nil
+ * gets(limit) -> string or nil
+ * gets(sep, limit) -> string or nil
*
* Returns (and assigns to <code>$_</code>) the next line from the list
* of files in +ARGV+ (or <code>$*</code>), or from standard input if
@@ -7933,8 +8167,8 @@ static VALUE argf_gets(int, VALUE *, VALUE);
* divided by two consecutive newlines. If the first argument is an
* integer, or optional second argument is given, the returning string
* would not be longer than the given value in bytes. If multiple
- * filenames are present in +ARGV+, +gets(nil)+ will read the contents
- * one file at a time.
+ * filenames are present in +ARGV+, <code>gets(nil)</code> will read
+ * the contents one file at a time.
*
* ARGV << "testfile"
* print while gets
@@ -7967,8 +8201,9 @@ rb_f_gets(int argc, VALUE *argv, VALUE recv)
*
* Returns the next line from the current file in +ARGF+.
*
- * By default lines are assumed to be separated by +$/+; to use a different
- * character as a separator, supply it as a +String+ for the _sep_ argument.
+ * By default lines are assumed to be separated by <code>$/</code>;
+ * to use a different character as a separator, supply it as a +String+
+ * for the _sep_ argument.
*
* The optional _limit_ argument specifies how many characters of each line
* to return. By default all characters are returned.
@@ -8041,10 +8276,11 @@ rb_f_readline(int argc, VALUE *argv, VALUE recv)
*
* Returns the next line from the current file in +ARGF+.
*
- * By default lines are assumed to be separated by +$/+; to use a different
- * character as a separator, supply it as a +String+ for the _sep_ argument.
+ * By default lines are assumed to be separated by <code>$/</code>;
+ * to use a different character as a separator, supply it as a +String+
+ * for the _sep_ argument.
*
- * The optional _limit_ argument specifies how many characters of each line
+ * The optional _limit_ argument specifies how many characters of each line
* to return. By default all characters are returned.
*
* An +EOFError+ is raised at the end of the file.
@@ -8068,9 +8304,9 @@ static VALUE argf_readlines(int, VALUE *, VALUE);
/*
* call-seq:
- * readlines(sep=$/) -> array
- * readlines(limit) -> array
- * readlines(sep,limit) -> array
+ * readlines(sep=$/) -> array
+ * readlines(limit) -> array
+ * readlines(sep, limit) -> array
*
* Returns an array containing the lines returned by calling
* <code>Kernel.gets(<i>sep</i>)</code> until the end of file.
@@ -8142,7 +8378,7 @@ argf_readlines(int argc, VALUE *argv, VALUE argf)
static VALUE
rb_f_backquote(VALUE obj, VALUE str)
{
- volatile VALUE port;
+ VALUE port;
VALUE result;
rb_io_t *fptr;
@@ -8154,6 +8390,8 @@ rb_f_backquote(VALUE obj, VALUE str)
GetOpenFile(port, fptr);
result = read_all(fptr, remain_size(fptr), Qnil);
rb_io_close(port);
+ rb_io_fptr_finalize(fptr);
+ rb_gc_force_recycle(port); /* also guards from premature GC */
return result;
}
@@ -8318,9 +8556,9 @@ static VALUE sym_normal, sym_sequential, sym_random,
#ifdef HAVE_POSIX_FADVISE
struct io_advise_struct {
int fd;
+ int advice;
off_t offset;
off_t len;
- int advice;
};
static VALUE
@@ -8388,10 +8626,15 @@ 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 && rv != ENOSYS) {
/* posix_fadvise(2) doesn't set errno. On success it returns 0; otherwise
it returns the error code. */
- rb_syserr_fail_str(rv, fptr->pathv);
+ VALUE message = rb_sprintf("%"PRIsVALUE" "
+ "(%"PRI_OFF_T_PREFIX"d, "
+ "%"PRI_OFF_T_PREFIX"d, "
+ "%"PRIsVALUE")",
+ fptr->pathv, offset, len, advice);
+ rb_syserr_fail_str(rv, message);
}
return Qnil;
@@ -8411,9 +8654,7 @@ advice_arg_check(VALUE advice)
advice != sym_willneed &&
advice != sym_dontneed &&
advice != sym_noreuse) {
- VALUE symname = rb_inspect(advice);
- rb_raise(rb_eNotImpError, "Unsupported advice: %s",
- StringValuePtr(symname));
+ rb_raise(rb_eNotImpError, "Unsupported advice: %+"PRIsVALUE, advice);
}
}
@@ -8485,28 +8726,25 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
- * IO.select(read_array
- * [, write_array
- * [, error_array
- * [, timeout]]]) -> array or nil
+ * IO.select(read_array [, write_array [, error_array [, timeout]]]) -> array or nil
*
* Calls select(2) system call.
- * It monitors given arrays of <code>IO</code> objects, waits one or more
- * of <code>IO</code> objects ready for reading, are ready for writing,
+ * It monitors given arrays of <code>IO</code> objects, waits until one or more
+ * of <code>IO</code> objects are ready for reading, are ready for writing,
* and have pending exceptions respectively, and returns an array that
- * contains arrays of those IO objects. It will return <code>nil</code>
+ * contains arrays of those IO objects. It will return +nil+
* if optional <i>timeout</i> value is given and no <code>IO</code> object
* is ready in <i>timeout</i> seconds.
*
* <code>IO.select</code> peeks the buffer of <code>IO</code> objects for testing readability.
* If the <code>IO</code> buffer is not empty,
- * <code>IO.select</code> immediately notify readability.
- * This "peek" is only happen for <code>IO</code> objects.
- * It is not happen for IO-like objects such as OpenSSL::SSL::SSLSocket.
+ * <code>IO.select</code> immediately notifies readability.
+ * This "peek" only happens for <code>IO</code> objects.
+ * It does not happen for IO-like objects such as OpenSSL::SSL::SSLSocket.
*
* The best way to use <code>IO.select</code> is invoking it
* after nonblocking methods such as <code>read_nonblock</code>, <code>write_nonblock</code>, etc.
- * The methods raises an exception which is extended by
+ * The methods raise an exception which is extended by
* <code>IO::WaitReadable</code> or <code>IO::WaitWritable</code>.
* The modules notify how the caller should wait with <code>IO.select</code>.
* If <code>IO::WaitReadable</code> is raised, the caller should wait for reading.
@@ -8534,37 +8772,37 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
* This means that readability notified by <code>IO.select</code> doesn't mean
* readability from <code>OpenSSL::SSL::SSLSocket</code> object.
*
- * Most possible situation is <code>OpenSSL::SSL::SSLSocket</code> buffers some data.
+ * The most likely situation is that <code>OpenSSL::SSL::SSLSocket</code> buffers some data.
* <code>IO.select</code> doesn't see the buffer.
* So <code>IO.select</code> can block when <code>OpenSSL::SSL::SSLSocket#readpartial</code> doesn't block.
*
- * However several more complicated situation exists.
+ * However, several more complicated situations exist.
*
* SSL is a protocol which is sequence of records.
- * The record consists multiple bytes.
+ * The record consists of multiple bytes.
* So, the remote side of SSL sends a partial record,
* <code>IO.select</code> notifies readability but
* <code>OpenSSL::SSL::SSLSocket</code> cannot decrypt a byte and
* <code>OpenSSL::SSL::SSLSocket#readpartial</code> will blocks.
*
* Also, the remote side can request SSL renegotiation which forces
- * the local SSL engine writes some data.
+ * the local SSL engine to write some data.
* This means <code>OpenSSL::SSL::SSLSocket#readpartial</code> may
* invoke <code>write</code> system call and it can block.
- * In such situation, <code>OpenSSL::SSL::SSLSocket#read_nonblock</code>
+ * In such a situation, <code>OpenSSL::SSL::SSLSocket#read_nonblock</code>
* raises IO::WaitWritable instead of blocking.
* So, the caller should wait for ready for writability as above example.
*
* The combination of nonblocking methods and <code>IO.select</code> is
* also useful for streams such as tty, pipe socket socket when
- * multiple process read form a stream.
+ * multiple processes read from a stream.
*
- * Finally, Linux kernel developers doesn't guarantee that
+ * Finally, Linux kernel developers don't guarantee that
* readability of select(2) means readability of following read(2) even
- * for single process.
+ * for a single process.
* See select(2) manual on GNU/Linux system.
*
- * Invoking <code>IO.select</code> before <code>IO#readpartial</code> works well in usual.
+ * Invoking <code>IO.select</code> before <code>IO#readpartial</code> works well as usual.
* However it is not the best way to use <code>IO.select</code>.
*
* The writability notified by select(2) doesn't show
@@ -8658,6 +8896,7 @@ rb_f_select(int argc, VALUE *argv, VALUE obj)
# define NUM2IOCTLREQ(num) NUM2INT(num)
#endif
+#ifdef HAVE_IOCTL
struct ioctl_arg {
int fd;
ioctl_req_t cmd;
@@ -8686,6 +8925,7 @@ do_ioctl(int fd, ioctl_req_t cmd, long narg)
return retval;
}
+#endif
#define DEFULT_IOCTL_NARG_LEN (256)
@@ -8740,6 +8980,14 @@ typedef long fcntl_arg_t;
typedef int fcntl_arg_t;
#endif
+#if defined __native_client__ && !defined __GLIBC__
+// struct flock is currently missing the NaCl newlib headers
+// TODO(sbc): remove this once it gets added.
+#undef F_GETLK
+#undef F_SETLK
+#undef F_SETLKW
+#endif
+
static long
fcntl_narg_len(int cmd)
{
@@ -8889,7 +9137,8 @@ setup_narg(ioctl_req_t cmd, VALUE *argp, int io_p)
narg = NUM2LONG(arg);
}
else {
- long len;
+ char *ptr;
+ long len, slen;
*argp = arg = tmp;
if (io_p)
@@ -8898,19 +9147,24 @@ setup_narg(ioctl_req_t cmd, VALUE *argp, int io_p)
len = fcntl_narg_len((int)cmd);
rb_str_modify(arg);
+ slen = RSTRING_LEN(arg);
/* expand for data + sentinel. */
- if (RSTRING_LEN(arg) < len+1) {
+ if (slen < len+1) {
rb_str_resize(arg, len+1);
+ MEMZERO(RSTRING_PTR(arg)+slen, char, len-slen);
+ slen = len+1;
}
/* a little sanity check here */
- RSTRING_PTR(arg)[RSTRING_LEN(arg) - 1] = 17;
- narg = (long)(SIGNED_VALUE)RSTRING_PTR(arg);
+ ptr = RSTRING_PTR(arg);
+ ptr[slen - 1] = 17;
+ narg = (long)(SIGNED_VALUE)ptr;
}
}
return narg;
}
+#ifdef HAVE_IOCTL
static VALUE
rb_ioctl(VALUE io, VALUE req, VALUE arg)
{
@@ -8919,16 +9173,17 @@ rb_ioctl(VALUE io, VALUE req, VALUE arg)
long narg;
int retval;
- rb_secure(2);
-
narg = setup_narg(cmd, &arg, 1);
GetOpenFile(io, fptr);
retval = do_ioctl(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)
+ char *ptr;
+ long slen;
+ RSTRING_GETMEM(arg, ptr, slen);
+ if (ptr[slen-1] != 17)
rb_raise(rb_eArgError, "return value overflowed string");
- RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] = '\0';
+ ptr[slen-1] = '\0';
}
return INT2NUM(retval);
@@ -8954,6 +9209,9 @@ rb_io_ioctl(int argc, VALUE *argv, VALUE io)
rb_scan_args(argc, argv, "11", &req, &arg);
return rb_ioctl(io, req, arg);
}
+#else
+#define rb_io_ioctl rb_f_notimplement
+#endif
#ifdef HAVE_FCNTL
struct fcntl_arg {
@@ -9002,26 +9260,17 @@ rb_fcntl(VALUE io, VALUE req, VALUE arg)
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)
+ char *ptr;
+ long slen;
+ RSTRING_GETMEM(arg, ptr, slen);
+ if (ptr[slen-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);
- }
+ ptr[slen-1] = '\0';
}
return INT2NUM(retval);
@@ -9077,13 +9326,14 @@ rb_io_fcntl(int argc, VALUE *argv, VALUE io)
*
* hello
*
- *
* Calling +syscall+ on a platform which does not have any way to
* an arbitrary system function just fails with NotImplementedError.
*
- * Note::
- * +syscall+ is essentially unsafe and unportable. Feel free to shoot your foot.
- * DL (Fiddle) library is preferred for safer and a bit more portable programming.
+ * *Note:*
+ * +syscall+ is essentially unsafe and unportable.
+ * Feel free to shoot your foot.
+ * The DL (Fiddle) library is preferred for safer and a bit
+ * more portable programming.
*/
static VALUE
@@ -9129,7 +9379,6 @@ rb_f_syscall(int argc, VALUE *argv)
rb_warning("We plan to remove a syscall function at future release. DL(Fiddle) provides safer alternative.");
}
- rb_secure(2);
if (argc == 0)
rb_raise(rb_eArgError, "too few arguments for syscall");
if (argc > numberof(arg))
@@ -9222,7 +9471,7 @@ static rb_encoding *
find_encoding(VALUE v)
{
rb_encoding *enc = rb_find_encoding(v);
- if (!enc) unsupported_encoding(StringValueCStr(v));
+ if (!enc) rb_warn("Unsupported encoding %"PRIsVALUE" ignored", v);
return enc;
}
@@ -9268,8 +9517,8 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
}
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);
+ if (!NIL_P(tmp) && rb_enc_asciicompat(enc = rb_enc_get(tmp))) {
+ parse_mode_enc(RSTRING_PTR(tmp), enc, &enc, &enc2, NULL);
SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
ecflags = rb_econv_prepare_options(opt, &ecopts, ecflags);
}
@@ -9289,6 +9538,21 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
}
+struct io_encoding_set_args {
+ rb_io_t *fptr;
+ VALUE v1;
+ VALUE v2;
+ VALUE opt;
+};
+
+static VALUE
+io_encoding_set_v(VALUE v)
+{
+ struct io_encoding_set_args *arg = (struct io_encoding_set_args *)v;
+ io_encoding_set(arg->fptr, arg->v1, arg->v2, arg->opt);
+ return Qnil;
+}
+
static VALUE
pipe_pair_close(VALUE rw)
{
@@ -9363,6 +9627,7 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
VALUE r, w, args[3], v1, v2;
VALUE opt;
rb_io_t *fptr, *fptr2;
+ struct io_encoding_set_args ies_args;
int fmode = 0;
VALUE ret;
@@ -9380,7 +9645,18 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
rb_jump_tag(state);
}
GetOpenFile(r, fptr);
- io_encoding_set(fptr, v1, v2, opt);
+
+ ies_args.fptr = fptr;
+ ies_args.v1 = v1;
+ ies_args.v2 = v2;
+ ies_args.opt = opt;
+ rb_protect(io_encoding_set_v, (VALUE)&ies_args, &state);
+ if (state) {
+ close(pipes[1]);
+ io_close(r);
+ rb_jump_tag(state);
+ }
+
args[1] = INT2NUM(pipes[1]);
args[2] = INT2FIX(O_WRONLY);
w = rb_protect(io_new_instance, (VALUE)args, &state);
@@ -9575,38 +9851,41 @@ seek_before_access(VALUE argp)
/*
* call-seq:
- * IO.read(name, [length [, offset]] ) -> string
- * IO.read(name, [length [, offset]], open_args) -> string
+ * IO.read(name, [length [, offset]] [, opt] ) -> string
*
* 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.
+ * === Options
+ *
+ * The options hash accepts the following keys:
*
* encoding::
* string or encoding
*
- * specifies encoding of the read string. +encoding+ will be ignored
- * if length is specified.
+ * Specifies the encoding of the read string. +encoding:+ will be ignored
+ * if +length+ is specified. See Encoding.aliases for possible encodings.
*
* mode::
* string
*
- * specifies mode argument for open(). It should start with "r"
- * otherwise it will cause an error.
+ * Specifies the mode argument for open(). It must start with an "r"
+ * otherwise it will cause an error. See IO.new for the list of possible
+ * modes.
*
- * open_args:: array of strings
+ * open_args::
+ * array of strings
*
- * specifies arguments for open() as an array.
+ * Specifies arguments for open() as an array. This key can not be used
+ * in combination with either +encoding:+ or +mode:+.
*
* 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 "
+ * 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 "
+ * IO.read("binfile", mode: "rb") #=> "\xF7\x00\x00\x0E\x12"
*/
static VALUE
@@ -9661,7 +9940,16 @@ rb_io_s_binread(int argc, VALUE *argv, VALUE io)
arg.argv = argv+1;
arg.argc = (argc > 1) ? 1 : 0;
if (!NIL_P(offset)) {
- rb_io_seek(arg.io, offset, SEEK_SET);
+ struct seek_arg sarg;
+ int state = 0;
+ sarg.io = arg.io;
+ sarg.offset = offset;
+ sarg.mode = SEEK_SET;
+ rb_protect(seek_before_access, (VALUE)&sarg, &state);
+ if (state) {
+ rb_io_close(arg.io);
+ rb_jump_tag(state);
+ }
}
return rb_ensure(io_s_read, (VALUE)&arg, rb_io_close, arg.io);
}
@@ -9767,12 +10055,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
+ * IO.binwrite(name, string, [offset] ) -> integer
+ * IO.binwrite(name, string, [offset], open_args ) -> integer
*
* Same as <code>IO.write</code> except opening the file in binary mode
* and ASCII-8BIT encoding ("wb:ASCII-8BIT").
- *
*/
static VALUE
@@ -9831,6 +10118,49 @@ maygvl_copy_stream_continue_p(int has_gvl, struct copy_stream_struct *stp)
return FALSE;
}
+/* non-Linux poll may not work on all FDs */
+#if defined(HAVE_POLL) && defined(__linux__)
+# define USE_POLL 1
+# define IOWAIT_SYSCALL "poll"
+#else
+# define IOWAIT_SYSCALL "select"
+# define USE_POLL 0
+#endif
+
+#if USE_POLL
+static int
+nogvl_wait_for_single_fd(int fd, short events)
+{
+ struct pollfd fds;
+
+ fds.fd = fd;
+ fds.events = events;
+
+ return poll(&fds, 1, -1);
+}
+
+static int
+maygvl_copy_stream_wait_read(int has_gvl, struct copy_stream_struct *stp)
+{
+ int ret;
+
+ do {
+ if (has_gvl) {
+ ret = rb_wait_for_single_fd(stp->src_fd, RB_WAITFD_IN, NULL);
+ }
+ else {
+ ret = nogvl_wait_for_single_fd(stp->src_fd, POLLIN);
+ }
+ } while (ret == -1 && maygvl_copy_stream_continue_p(has_gvl, stp));
+
+ if (ret == -1) {
+ stp->syserr = "poll";
+ stp->error_no = errno;
+ return -1;
+ }
+ return 0;
+}
+#else /* !USE_POLL */
static int
maygvl_select(int has_gvl, int n, rb_fdset_t *rfds, rb_fdset_t *wfds, rb_fdset_t *efds, struct timeval *timeout)
{
@@ -9858,6 +10188,7 @@ maygvl_copy_stream_wait_read(int has_gvl, struct copy_stream_struct *stp)
}
return 0;
}
+#endif /* !USE_POLL */
static int
nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
@@ -9865,13 +10196,17 @@ nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
int ret;
do {
+#if USE_POLL
+ ret = nogvl_wait_for_single_fd(stp->dst_fd, POLLOUT);
+#else
rb_fd_zero(&stp->fds);
rb_fd_set(stp->dst_fd, &stp->fds);
ret = rb_fd_select(rb_fd_max(&stp->fds), NULL, &stp->fds, NULL, NULL);
+#endif
} while (ret == -1 && maygvl_copy_stream_continue_p(0, stp));
if (ret == -1) {
- stp->syserr = "select";
+ stp->syserr = IOWAIT_SYSCALL;
stp->error_no = errno;
return -1;
}
@@ -9899,10 +10234,6 @@ simple_sendfile(int out_fd, int in_fd, off_t *offset, off_t count)
*/
# define USE_SENDFILE
-# ifdef HAVE_SYS_UIO_H
-# include <sys/uio.h>
-# endif
-
static ssize_t
simple_sendfile(int out_fd, int in_fd, off_t *offset, off_t count)
{
@@ -9956,8 +10287,10 @@ nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
stp->error_no = errno;
return -1;
}
+#ifndef __linux__
if ((dst_stat.st_mode & S_IFMT) != S_IFSOCK)
- return 0;
+ return 0;
+#endif
src_offset = stp->src_offset;
use_pread = src_offset != (off_t)-1;
@@ -10076,9 +10409,9 @@ maygvl_copy_stream_read(int has_gvl, struct copy_stream_struct *stp, char *buf,
goto retry_read;
#ifdef ENOSYS
case ENOSYS:
-#endif
stp->notimp = "pread";
return -1;
+#endif
}
stp->syserr = offset == (off_t)-1 ? "read" : "pread";
stp->error_no = errno;
@@ -10230,11 +10563,11 @@ copy_stream_fallback_body(VALUE arg)
ssize_t ss;
rb_str_resize(buf, buflen);
ss = maygvl_copy_stream_read(1, stp, RSTRING_PTR(buf), l, off);
+ rb_str_resize(buf, ss > 0 ? ss : 0);
if (ss == -1)
return Qnil;
if (ss == 0)
rb_eof_error();
- rb_str_resize(buf, ss);
if (off != (off_t)-1)
off += ss;
}
@@ -10280,51 +10613,59 @@ copy_stream_body(VALUE arg)
stp->total = 0;
if (src_io == argf ||
- !(RB_TYPE_P(src_io, T_FILE) ||
- RB_TYPE_P(src_io, T_STRING) ||
- rb_respond_to(src_io, rb_intern("to_path")))) {
- src_fd = -1;
+ !(RB_TYPE_P(src_io, T_FILE) ||
+ RB_TYPE_P(src_io, T_STRING) ||
+ rb_respond_to(src_io, rb_intern("to_path")))) {
+ src_fd = -1;
}
else {
- if (!RB_TYPE_P(src_io, T_FILE)) {
- VALUE args[2];
+ VALUE tmp_io = rb_io_check_io(src_io);
+ if (!NIL_P(tmp_io)) {
+ src_io = tmp_io;
+ }
+ else if (!RB_TYPE_P(src_io, T_FILE)) {
+ VALUE args[2];
FilePathValue(src_io);
args[0] = src_io;
args[1] = INT2NUM(O_RDONLY|common_oflags);
- src_io = rb_class_new_instance(2, args, rb_cFile);
- stp->src = src_io;
- stp->close_src = 1;
- }
- GetOpenFile(src_io, src_fptr);
- rb_io_check_byte_readable(src_fptr);
- src_fd = src_fptr->fd;
+ src_io = rb_class_new_instance(2, args, rb_cFile);
+ stp->src = src_io;
+ stp->close_src = 1;
+ }
+ GetOpenFile(src_io, src_fptr);
+ rb_io_check_byte_readable(src_fptr);
+ src_fd = src_fptr->fd;
}
stp->src_fd = src_fd;
if (dst_io == argf ||
- !(RB_TYPE_P(dst_io, T_FILE) ||
- RB_TYPE_P(dst_io, T_STRING) ||
- rb_respond_to(dst_io, rb_intern("to_path")))) {
- dst_fd = -1;
+ !(RB_TYPE_P(dst_io, T_FILE) ||
+ RB_TYPE_P(dst_io, T_STRING) ||
+ rb_respond_to(dst_io, rb_intern("to_path")))) {
+ dst_fd = -1;
}
else {
- if (!RB_TYPE_P(dst_io, T_FILE)) {
- VALUE args[3];
+ VALUE tmp_io = rb_io_check_io(dst_io);
+ if (!NIL_P(tmp_io)) {
+ dst_io = GetWriteIO(tmp_io);
+ }
+ else if (!RB_TYPE_P(dst_io, T_FILE)) {
+ VALUE args[3];
FilePathValue(dst_io);
args[0] = dst_io;
args[1] = INT2NUM(O_WRONLY|O_CREAT|O_TRUNC|common_oflags);
- args[2] = INT2FIX(0666);
- dst_io = rb_class_new_instance(3, args, rb_cFile);
- stp->dst = dst_io;
- stp->close_dst = 1;
- }
- else {
- dst_io = GetWriteIO(dst_io);
- stp->dst = dst_io;
- }
- GetOpenFile(dst_io, dst_fptr);
- rb_io_check_writable(dst_fptr);
- dst_fd = dst_fptr->fd;
+ args[2] = INT2FIX(0666);
+ dst_io = rb_class_new_instance(3, args, rb_cFile);
+ stp->dst = dst_io;
+ stp->close_dst = 1;
+ }
+ else {
+ dst_io = GetWriteIO(dst_io);
+ stp->dst = dst_io;
+ }
+ GetOpenFile(dst_io, dst_fptr);
+ rb_io_check_writable(dst_fptr);
+ dst_fd = dst_fptr->fd;
}
stp->dst_fd = dst_fd;
@@ -10385,8 +10726,7 @@ copy_stream_finalize(VALUE arg)
}
rb_fd_term(&stp->fds);
if (stp->syserr) {
- errno = stp->error_no;
- rb_sys_fail(stp->syserr);
+ rb_syserr_fail(stp->error_no, stp->syserr);
}
if (stp->notimp) {
rb_raise(rb_eNotImpError, "%s() not implemented", stp->notimp);
@@ -10456,7 +10796,7 @@ rb_io_s_copy_stream(int argc, VALUE *argv, VALUE io)
* io.external_encoding -> encoding
*
* Returns the Encoding object that represents the encoding of the file.
- * If io is write mode and no encoding is specified, returns <code>nil</code>.
+ * If _io_ is in write mode and no encoding is specified, returns +nil+.
*/
static VALUE
@@ -10481,7 +10821,7 @@ rb_io_external_encoding(VALUE io)
* io.internal_encoding -> encoding
*
* Returns the Encoding of the internal string if conversion is
- * specified. Otherwise returns nil.
+ * specified. Otherwise returns +nil+.
*/
static VALUE
@@ -10551,7 +10891,7 @@ rb_stdio_set_default_encoding(void)
*
* To set the external encoding use +ARGF.set_encoding+.
*
- * For example:
+ * For example:
*
* ARGF.external_encoding #=> #<Encoding:UTF-8>
*
@@ -10576,7 +10916,7 @@ argf_external_encoding(VALUE argf)
* is returned. Otherwise, if +Encoding.default_external+ has been set, that
* value is returned. Failing that, if a default external encoding was
* specified on the command-line, that value is used. If the encoding is
- * unknown, nil is returned.
+ * unknown, +nil+ is returned.
*/
static VALUE
argf_internal_encoding(VALUE argf)
@@ -10609,7 +10949,7 @@ argf_internal_encoding(VALUE argf)
*
* If the external encoding and the internal encoding are specified, the
* optional +Hash+ argument can be used to adjust the conversion process. The
- * structure of this hash is explained in the +String#encode+ documentation.
+ * structure of this hash is explained in the String#encode documentation.
*
* For example:
*
@@ -10656,10 +10996,10 @@ argf_tell(VALUE argf)
/*
* call-seq:
- * ARGF.seek(amount, whence=IO::SEEK_SET) -> 0
+ * ARGF.seek(amount, whence=IO::SEEK_SET) -> 0
*
* Seeks to offset _amount_ (an +Integer+) in the +ARGF+ stream according to
- * the value of _whence_. See +IO#seek+ for further details.
+ * the value of _whence_. See IO#seek for further details.
*/
static VALUE
argf_seek_m(int argc, VALUE *argv, VALUE argf)
@@ -10796,22 +11136,28 @@ argf_eof(VALUE argf)
* called without arguments the contents of this pseudo file are returned in
* their entirety.
*
- * _length_ must be a non-negative integer or nil. If it is a positive
- * integer, +read+ tries to read at most _length_ bytes. It returns nil
- * if an EOF was encountered before anything could be read. Fewer than
- * _length_ bytes may be returned if an EOF is encountered during the read.
+ * _length_ must be a non-negative integer or +nil+.
*
- * If _length_ is omitted or is _nil_, it reads until EOF. A String is
- * returned even if EOF is encountered before any data is read.
+ * If _length_ is a positive integer, +read+ tries to read
+ * _length_ bytes without any conversion (binary mode).
+ * It returns +nil+ if an EOF is encountered before anything can be read.
+ * Fewer than _length_ bytes are returned if an EOF is encountered during
+ * the read.
+ * In the case of an integer _length_, the resulting string is always
+ * in ASCII-8BIT encoding.
*
- * If _length_ is zero, it returns _""_.
+ * If _length_ is omitted or is +nil+, it reads until EOF
+ * and the encoding conversion is applied, if applicable.
+ * A string is returned even if EOF is encountered before any data is read.
*
- * 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
+ * If _length_ is zero, it returns an empty string (<code>""</code>).
+ *
+ * If the optional _outbuf_ argument is present,
+ * it must reference a String, which will receive the data.
+ * The _outbuf_ will contain only the received data after the method call
* even if it is not empty at the beginning.
*
- * For example:
+ * For example:
*
* $ echo "small" > small.txt
* $ echo "large" > large.txt
@@ -10822,8 +11168,11 @@ argf_eof(VALUE argf)
* ARGF.read(2) #=> "sm"
* ARGF.read(0) #=> ""
*
- * Note that this method behaves like fread() function in C. If you need the
- * behavior like read(2) system call, consider +ARGF.readpartial+.
+ * Note that this method behaves like the fread() function in C.
+ * This means it retries to invoke read(2) system calls to read data
+ * with the specified length.
+ * If you need the behavior like a single read(2) system call,
+ * consider ARGF#readpartial or ARGF#read_nonblock.
*/
static VALUE
@@ -10862,8 +11211,9 @@ argf_read(int argc, VALUE *argv, VALUE argf)
}
}
else if (argc >= 1) {
- if (RSTRING_LEN(str) < len) {
- len -= RSTRING_LEN(str);
+ long slen = RSTRING_LEN(str);
+ if (slen < len) {
+ len -= slen;
argv[0] = INT2NUM(len);
goto retry;
}
@@ -10885,7 +11235,8 @@ argf_forward_call(VALUE arg)
return Qnil;
}
-static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock);
+static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts,
+ int nonblock);
/*
* call-seq:
@@ -10896,7 +11247,7 @@ static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock);
*
* 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
+ * The _outbuf_ 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 ARGF stream.
@@ -10910,7 +11261,7 @@ static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock);
static VALUE
argf_readpartial(int argc, VALUE *argv, VALUE argf)
{
- return argf_getpartial(argc, argv, argf, 0);
+ return argf_getpartial(argc, argv, argf, Qnil, 0);
}
/*
@@ -10924,11 +11275,18 @@ argf_readpartial(int argc, VALUE *argv, VALUE argf)
static VALUE
argf_read_nonblock(int argc, VALUE *argv, VALUE argf)
{
- return argf_getpartial(argc, argv, argf, 1);
+ VALUE opts;
+
+ rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
+
+ if (!NIL_P(opts))
+ argc--;
+
+ return argf_getpartial(argc, argv, argf, opts, 1);
}
static VALUE
-argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock)
+argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts, int nonblock)
{
VALUE tmp, str, length;
@@ -10939,7 +11297,9 @@ argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock)
}
if (!next_argv()) {
- rb_str_resize(str, 0);
+ if (!NIL_P(str)) {
+ rb_str_resize(str, 0);
+ }
rb_eof_error();
}
if (ARGF_GENERIC_INPUT_P()) {
@@ -10951,16 +11311,17 @@ argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock)
RUBY_METHOD_FUNC(0), Qnil, rb_eEOFError, (VALUE)0);
}
else {
- tmp = io_getpartial(argc, argv, ARGF.current_file, nonblock, 0);
+ tmp = io_getpartial(argc, argv, ARGF.current_file, opts, nonblock);
}
if (NIL_P(tmp)) {
if (ARGF.next_p == -1) {
- rb_eof_error();
+ return io_nonblock_eof(opts);
}
argf_close(argf);
ARGF.next_p = 1;
- if (RARRAY_LEN(ARGF.argv) == 0)
- rb_eof_error();
+ if (RARRAY_LEN(ARGF.argv) == 0) {
+ return io_nonblock_eof(opts);
+ }
if (NIL_P(str))
str = rb_str_new(NULL, 0);
return str;
@@ -11146,13 +11507,13 @@ argf_block_call(ID mid, int argc, VALUE *argv, VALUE argf)
/*
* call-seq:
- * ARGF.each(sep=$/) {|line| block } -> ARGF
- * ARGF.each(sep=$/,limit) {|line| block } -> ARGF
- * ARGF.each(...) -> an_enumerator
+ * ARGF.each(sep=$/) {|line| block } -> ARGF
+ * ARGF.each(sep=$/, limit) {|line| block } -> ARGF
+ * ARGF.each(...) -> an_enumerator
*
- * ARGF.each_line(sep=$/) {|line| block } -> ARGF
- * ARGF.each_line(sep=$/,limit) {|line| block } -> ARGF
- * ARGF.each_line(...) -> an_enumerator
+ * ARGF.each_line(sep=$/) {|line| block } -> ARGF
+ * ARGF.each_line(sep=$/, limit) {|line| block } -> ARGF
+ * ARGF.each_line(...) -> an_enumerator
*
* Returns an enumerator which iterates over each line (separated by _sep_,
* which defaults to your platform's newline character) of each file in
@@ -11171,7 +11532,7 @@ argf_block_call(ID mid, int argc, VALUE *argv, VALUE argf)
* For example, the following code prints out each line of each named file
* prefixed with its line number, displaying the filename once per file:
*
- * ARGF.lines do |line|
+ * ARGF.each_line do |line|
* puts ARGF.filename if ARGF.lineno == 1
* puts "#{ARGF.lineno}: #{line}"
* end
@@ -11218,7 +11579,7 @@ argf_lines(int argc, VALUE *argv, VALUE argf)
*
* If no block is given, an enumerator is returned instead.
*
- * For example:
+ * For example:
*
* ARGF.bytes.to_a #=> [35, 32, ... 95, 10]
*
@@ -11248,8 +11609,8 @@ argf_bytes(VALUE argf)
/*
* call-seq:
- * ARGF.each_char {|char| block } -> ARGF
- * ARGF.each_char -> an_enumerator
+ * ARGF.each_char {|char| block } -> ARGF
+ * ARGF.each_char -> an_enumerator
*
* Iterates over each character of each file in +ARGF+.
*
@@ -11287,8 +11648,8 @@ argf_chars(VALUE argf)
/*
* call-seq:
- * ARGF.each_codepoint {|codepoint| block } -> ARGF
- * ARGF.each_codepoint -> an_enumerator
+ * ARGF.each_codepoint {|codepoint| block } -> ARGF
+ * ARGF.each_codepoint -> an_enumerator
*
* Iterates over each codepoint of each file in +ARGF+.
*
@@ -11363,8 +11724,8 @@ argf_filename_getter(ID id, VALUE *var)
* call-seq:
* ARGF.file -> IO or File object
*
- * Returns the current file as an +IO+ or +File+ object. #<IO:<STDIN>> is
- * returned when the current file is STDIN.
+ * Returns the current file as an +IO+ or +File+ object.
+ * <code>#<IO:<STDIN>></code> is returned when the current file is STDIN.
*
* For example:
*
@@ -11409,10 +11770,10 @@ argf_binmode_m(VALUE argf)
* call-seq:
* ARGF.binmode? -> true or false
*
- * Returns true if +ARGF+ is being read in binary mode; false otherwise. (To
- * enable binary mode use +ARGF.binmode+.
+ * Returns true if +ARGF+ is being read in binary mode; false otherwise.
+ * To enable binary mode use +ARGF.binmode+.
*
- * For example:
+ * For example:
*
* ARGF.binmode? #=> false
* ARGF.binmode
@@ -11431,7 +11792,7 @@ argf_binmode_p(VALUE argf)
* Sets the current file to the next file in ARGV. If there aren't any more
* files it has no effect.
*
- * For example:
+ * For example:
*
* $ ruby argf.rb foo bar
* ARGF.filename #=> "foo"
@@ -11456,7 +11817,7 @@ argf_skip(VALUE argf)
* close a file that has already been closed causes an +IOError+ to be
* raised.
*
- * For example:
+ * For example:
*
* $ ruby argf.rb foo bar
*
@@ -11510,7 +11871,7 @@ argf_to_s(VALUE argf)
* ARGF.inplace_mode -> String
*
* Returns the file extension appended to the names of modified files under
- * inplace-edit mode. This value can be set using +ARGF.inplace_mode=+ or
+ * in-place edit mode. This value can be set using +ARGF.inplace_mode=+ or
* passing the +-i+ switch to the Ruby binary.
*/
static VALUE
@@ -11530,7 +11891,7 @@ opt_i_get(ID id, VALUE *var)
* call-seq:
* ARGF.inplace_mode = ext -> ARGF
*
- * Sets the filename extension for inplace editing mode to the given String.
+ * Sets the filename extension for in-place editing mode to the given String.
* Each file being edited has this value appended to its filename. The
* modified file is saved under this new name.
*
@@ -11539,12 +11900,12 @@ opt_i_get(ID id, VALUE *var)
* $ ruby argf.rb file.txt
*
* ARGF.inplace_mode = '.bak'
- * ARGF.lines do |line|
+ * ARGF.each_line do |line|
* print line.sub("foo","bar")
* end
*
- * Each line of _file.txt_ has the first occurrence of "foo" replaced with
- * "bar", then the new line is written out to _file.txt.bak_.
+ * Each line of _file.txt_ has the first occurrence of "foo" replaced with
+ * "bar", then the new line is written out to _file.txt.bak_.
*/
static VALUE
argf_inplace_mode_set(VALUE argf, VALUE val)
@@ -11646,10 +12007,15 @@ argf_write(VALUE argf, VALUE str)
}
void
-rb_readwrite_sys_fail(int writable, const char *mesg)
+rb_readwrite_sys_fail(enum rb_io_wait_readwrite writable, const char *mesg)
+{
+ rb_readwrite_syserr_fail(writable, errno, mesg);
+}
+
+void
+rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char *mesg)
{
VALUE arg;
- int n = errno;
arg = mesg ? rb_str_new2(mesg) : Qnil;
if (writable == RB_IO_WAIT_WRITABLE) {
switch (n) {
@@ -11701,8 +12067,8 @@ rb_readwrite_sys_fail(int writable, const char *mesg)
* File.open("/etc/hosts") {|f| f.close; f.read }
* #=> IOError: closed stream
*
- * Note that some IO failures raise +SystemCallError+s and these are not
- * subclasses of IOError:
+ * Note that some IO failures raise <code>SystemCallError</code>s
+ * and these are not subclasses of IOError:
*
* File.open("does/not/exist")
* #=> Errno::ENOENT: No such file or directory - does/not/exist
@@ -11715,7 +12081,7 @@ rb_readwrite_sys_fail(int writable, const char *mesg)
* methods exist in two forms,
*
* one that returns +nil+ when the end of file is reached, the other
- * raises EOFError +EOFError+.
+ * raises +EOFError+.
*
* +EOFError+ is a subclass of +IOError+.
*
@@ -11841,7 +12207,7 @@ rb_readwrite_sys_fail(int writable, const char *mesg)
* Example:
*
* require 'io/console'
- * rows, columns = $stdin.winsize
+ * rows, columns = $stdout.winsize
* puts "Your screen is #{columns} wide and #{rows} tall"
*/
@@ -11992,8 +12358,10 @@ Init_IO(void)
rb_define_method(rb_cIO, "readlines", rb_io_readlines, -1);
- rb_define_method(rb_cIO, "read_nonblock", io_read_nonblock, -1);
- rb_define_method(rb_cIO, "write_nonblock", rb_io_write_nonblock, -1);
+ /* for prelude.rb use only: */
+ rb_define_private_method(rb_cIO, "__read_nonblock", io_read_nonblock, 3);
+ rb_define_private_method(rb_cIO, "__write_nonblock", io_write_nonblock, 2);
+
rb_define_method(rb_cIO, "readpartial", io_readpartial, -1);
rb_define_method(rb_cIO, "read", io_read, -1);
rb_define_method(rb_cIO, "write", io_write_m, 1);
@@ -12075,7 +12443,7 @@ Init_IO(void)
#if 0
/* Hack to get rdoc to regard ARGF as a class: */
- rb_cARGF = rb_define_class("ARGF", rb_cObject);
+ rb_cARGF = rb_define_class("ARGF.class", rb_cObject);
#endif
rb_cARGF = rb_class_new(rb_cObject);
@@ -12176,9 +12544,10 @@ Init_IO(void)
sym_mode = ID2SYM(rb_intern("mode"));
sym_perm = ID2SYM(rb_intern("perm"));
+ sym_flags = ID2SYM(rb_intern("flags"));
sym_extenc = ID2SYM(rb_intern("external_encoding"));
sym_intenc = ID2SYM(rb_intern("internal_encoding"));
- sym_encoding = ID2SYM(rb_intern("encoding"));
+ sym_encoding = ID2SYM(rb_id_encoding());
sym_open_args = ID2SYM(rb_intern("open_args"));
sym_textmode = ID2SYM(rb_intern("textmode"));
sym_binmode = ID2SYM(rb_intern("binmode"));
@@ -12198,5 +12567,6 @@ Init_IO(void)
#ifdef SEEK_HOLE
sym_HOLE = ID2SYM(rb_intern("HOLE"));
#endif
- sym_exception = ID2SYM(rb_intern("exception"));
+ sym_wait_readable = ID2SYM(rb_intern("wait_readable"));
+ sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
}
diff --git a/iseq.c b/iseq.c
index 679bdb7a2d..797473e070 100644
--- a/iseq.c
+++ b/iseq.c
@@ -9,10 +9,14 @@
**********************************************************************/
-#include "ruby/ruby.h"
#include "internal.h"
+#include "ruby/util.h"
#include "eval_intern.h"
+#ifdef HAVE_DLADDR
+# include <dlfcn.h>
+#endif
+
/* #define RUBY_MARK_FREE_DEBUG 1 */
#include "gc.h"
#include "vm_core.h"
@@ -21,10 +25,9 @@
#include "insns.inc"
#include "insns_info.inc"
-#define ISEQ_MAJOR_VERSION 2
-#define ISEQ_MINOR_VERSION 1
-
VALUE rb_cISeq;
+static VALUE iseqw_new(const rb_iseq_t *iseq);
+static const rb_iseq_t *iseqw_check(VALUE iseqw);
#define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
@@ -59,256 +62,247 @@ compile_data_free(struct iseq_compile_data *compile_data)
}
}
-static void
-iseq_free(void *ptr)
+void
+rb_iseq_free(const rb_iseq_t *iseq)
{
- rb_iseq_t *iseq;
RUBY_FREE_ENTER("iseq");
- if (ptr) {
- iseq = ptr;
- if (!iseq->orig) {
- /* It's possible that strings are freed */
- if (0) {
- RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label),
- RSTRING_PTR(iseq->location.path));
+ if (iseq) {
+ if (iseq->body) {
+ ruby_xfree((void *)iseq->body->iseq_encoded);
+ ruby_xfree((void *)iseq->body->line_info_table);
+ ruby_xfree((void *)iseq->body->local_table);
+ ruby_xfree((void *)iseq->body->is_entries);
+
+ if (iseq->body->ci_entries) {
+ unsigned int i;
+ struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&iseq->body->ci_entries[iseq->body->ci_size];
+ for (i=0; i<iseq->body->ci_kw_size; i++) {
+ const struct rb_call_info_kw_arg *kw_arg = ci_kw_entries[i].kw_arg;
+ ruby_xfree((void *)kw_arg);
+ }
+ ruby_xfree(iseq->body->ci_entries);
+ ruby_xfree(iseq->body->cc_entries);
}
+ ruby_xfree((void *)iseq->body->catch_table);
+ ruby_xfree((void *)iseq->body->param.opt_table);
- if (iseq->iseq != iseq->iseq_encoded) {
- RUBY_FREE_UNLESS_NULL(iseq->iseq_encoded);
+ if (iseq->body->param.keyword != NULL) {
+ ruby_xfree((void *)iseq->body->param.keyword->default_values);
+ ruby_xfree((void *)iseq->body->param.keyword);
}
-
- RUBY_FREE_UNLESS_NULL(iseq->iseq);
- RUBY_FREE_UNLESS_NULL(iseq->line_info_table);
- RUBY_FREE_UNLESS_NULL(iseq->local_table);
- RUBY_FREE_UNLESS_NULL(iseq->is_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);
+ compile_data_free(ISEQ_COMPILE_DATA(iseq));
+ ruby_xfree(iseq->body);
}
- ruby_xfree(ptr);
}
RUBY_FREE_LEAVE("iseq");
}
-static void
-iseq_mark(void *ptr)
+void
+rb_iseq_mark(const rb_iseq_t *iseq)
{
RUBY_MARK_ENTER("iseq");
- if (ptr) {
- rb_iseq_t *iseq = ptr;
-
- RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
- RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
+ RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(iseq->body->location.path));
- 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);
+ if (iseq->body) {
+ const struct rb_iseq_constant_body *body = iseq->body;
- RUBY_MARK_UNLESS_NULL((VALUE)iseq->cref_stack);
- RUBY_MARK_UNLESS_NULL(iseq->klass);
- RUBY_MARK_UNLESS_NULL(iseq->coverage);
- RUBY_MARK_UNLESS_NULL(iseq->orig);
+ RUBY_MARK_UNLESS_NULL(body->mark_ary);
+ rb_gc_mark(body->location.label);
+ rb_gc_mark(body->location.base_label);
+ rb_gc_mark(body->location.path);
+ RUBY_MARK_UNLESS_NULL(body->location.absolute_path);
+ RUBY_MARK_UNLESS_NULL((VALUE)body->parent_iseq);
+ }
- if (iseq->compile_data != 0) {
- struct iseq_compile_data *const compile_data = iseq->compile_data;
- RUBY_MARK_UNLESS_NULL(compile_data->mark_ary);
- RUBY_MARK_UNLESS_NULL(compile_data->err_info);
- RUBY_MARK_UNLESS_NULL(compile_data->catch_table_ary);
- }
+ if (FL_TEST(iseq, ISEQ_NOT_LOADED_YET)) {
+ rb_gc_mark(iseq->aux.loader.obj);
+ }
+ else if (ISEQ_COMPILE_DATA(iseq) != 0) {
+ const struct iseq_compile_data *const compile_data = ISEQ_COMPILE_DATA(iseq);
+ RUBY_MARK_UNLESS_NULL(compile_data->mark_ary);
+ RUBY_MARK_UNLESS_NULL(compile_data->err_info);
+ RUBY_MARK_UNLESS_NULL(compile_data->catch_table_ary);
}
+
RUBY_MARK_LEAVE("iseq");
}
static size_t
-iseq_memsize(const void *ptr)
+param_keyword_size(const struct rb_iseq_param_keyword *pkw)
{
- size_t size = sizeof(rb_iseq_t);
- const rb_iseq_t *iseq;
+ size_t size = 0;
- if (ptr) {
- iseq = ptr;
- if (!iseq->orig) {
- if (iseq->iseq != iseq->iseq_encoded) {
- size += iseq->iseq_size * sizeof(VALUE);
- }
+ if (!pkw) return size;
+
+ size += sizeof(struct rb_iseq_param_keyword);
+ size += sizeof(VALUE) * (pkw->num - pkw->required_num);
+
+ return size;
+}
+
+static size_t
+iseq_memsize(const rb_iseq_t *iseq)
+{
+ size_t size = 0; /* struct already counted as RVALUE size */
+ const struct rb_iseq_constant_body *body = iseq->body;
+ const struct iseq_compile_data *compile_data;
+
+ /* TODO: should we count original_iseq? */
+
+ if (body) {
+ struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&body->ci_entries[body->ci_size];
+
+ size += sizeof(struct rb_iseq_constant_body);
+ size += body->iseq_size * sizeof(VALUE);
+ size += body->line_info_size * sizeof(struct iseq_line_info_entry);
+ size += body->local_table_size * sizeof(ID);
+ if (body->catch_table) {
+ size += iseq_catch_table_bytes(body->catch_table->size);
+ }
+ size += (body->param.opt_num + 1) * sizeof(VALUE);
+ size += param_keyword_size(body->param.keyword);
- size += iseq->iseq_size * sizeof(VALUE);
- 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->is_size * sizeof(union iseq_inline_storage_entry);
- size += iseq->callinfo_size * sizeof(rb_call_info_t);
-
- if (iseq->compile_data) {
- struct iseq_compile_data_storage *cur;
-
- cur = iseq->compile_data->storage_head;
- while (cur) {
- size += cur->size + sizeof(struct iseq_compile_data_storage);
- cur = cur->next;
+ /* body->is_entries */
+ size += body->is_size * sizeof(union iseq_inline_storage_entry);
+
+ /* body->ci_entries */
+ size += body->ci_size * sizeof(struct rb_call_info);
+ size += body->ci_kw_size * sizeof(struct rb_call_info_with_kwarg);
+
+ /* body->cc_entries */
+ size += body->ci_size * sizeof(struct rb_call_cache);
+ size += body->ci_kw_size * sizeof(struct rb_call_cache);
+
+ if (ci_kw_entries) {
+ unsigned int i;
+
+ for (i = 0; i < body->ci_kw_size; i++) {
+ const struct rb_call_info_kw_arg *kw_arg = ci_kw_entries[i].kw_arg;
+
+ if (kw_arg) {
+ size += rb_call_info_kw_arg_bytes(kw_arg->keyword_len);
}
- size += sizeof(struct iseq_compile_data);
}
}
}
+ compile_data = ISEQ_COMPILE_DATA(iseq);
+ if (compile_data) {
+ struct iseq_compile_data_storage *cur;
+
+ size += sizeof(struct iseq_compile_data);
+
+ cur = compile_data->storage_head;
+ while (cur) {
+ size += cur->size + SIZEOF_ISEQ_COMPILE_DATA_STORAGE;
+ cur = cur->next;
+ }
+ }
+
return size;
}
-static const rb_data_type_t iseq_data_type = {
- "iseq",
- {
- iseq_mark,
- iseq_free,
- iseq_memsize,
- }, /* functions */
- NULL, NULL,
- RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
-};
-
-static VALUE
-iseq_alloc(VALUE klass)
+static rb_iseq_t *
+iseq_alloc(void)
{
- rb_iseq_t *iseq;
- return TypedData_Make_Struct(klass, rb_iseq_t, &iseq_data_type, iseq);
+ rb_iseq_t *iseq = iseq_imemo_alloc();
+ iseq->body = ZALLOC(struct rb_iseq_constant_body);
+ return iseq;
}
static rb_iseq_location_t *
-iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, size_t first_lineno)
+iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, VALUE first_lineno)
{
- rb_iseq_location_t *loc = &iseq->location;
- RB_OBJ_WRITE(iseq->self, &loc->path, path);
+ rb_iseq_location_t *loc = &iseq->body->location;
+ RB_OBJ_WRITE(iseq, &loc->path, path);
if (RTEST(absolute_path) && rb_str_cmp(path, absolute_path) == 0) {
- RB_OBJ_WRITE(iseq->self, &loc->absolute_path, path);
+ RB_OBJ_WRITE(iseq, &loc->absolute_path, path);
}
else {
- RB_OBJ_WRITE(iseq->self, &loc->absolute_path, absolute_path);
+ RB_OBJ_WRITE(iseq, &loc->absolute_path, absolute_path);
}
- RB_OBJ_WRITE(iseq->self, &loc->label, name);
- RB_OBJ_WRITE(iseq->self, &loc->base_label, name);
+ RB_OBJ_WRITE(iseq, &loc->label, name);
+ RB_OBJ_WRITE(iseq, &loc->base_label, name);
loc->first_lineno = first_lineno;
return loc;
}
-#define ISEQ_SET_CREF(iseq, cref) RB_OBJ_WRITE((iseq)->self, &(iseq)->cref_stack, (cref))
-
static void
-set_relation(rb_iseq_t *iseq, const VALUE parent)
+set_relation(rb_iseq_t *iseq, const rb_iseq_t *piseq)
{
- const VALUE type = iseq->type;
- rb_thread_t *th = GET_THREAD();
- rb_iseq_t *piseq;
+ const VALUE type = iseq->body->type;
/* set class nest stack */
if (type == ISEQ_TYPE_TOP) {
- /* toplevel is private */
- RB_OBJ_WRITE(iseq->self, &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_CREF(th->top_wrapper);
- cref->nd_refinements = Qnil;
- cref->nd_visi = NOEX_PRIVATE;
- RB_OBJ_WRITE(cref, &cref->nd_next, iseq->cref_stack);
- ISEQ_SET_CREF(iseq, cref);
- }
- iseq->local_iseq = iseq;
+ iseq->body->local_iseq = iseq;
}
else if (type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
- ISEQ_SET_CREF(iseq, NEW_CREF(0)); /* place holder */
- iseq->cref_stack->nd_refinements = Qnil;
- iseq->local_iseq = iseq;
+ iseq->body->local_iseq = iseq;
}
- else if (RTEST(parent)) {
- GetISeqPtr(parent, piseq);
- ISEQ_SET_CREF(iseq, piseq->cref_stack);
- iseq->local_iseq = piseq->local_iseq;
+ else if (piseq) {
+ iseq->body->local_iseq = piseq->body->local_iseq;
}
- if (RTEST(parent)) {
- GetISeqPtr(parent, piseq);
- iseq->parent_iseq = piseq;
+ if (piseq) {
+ iseq->body->parent_iseq = piseq;
}
if (type == ISEQ_TYPE_MAIN) {
- iseq->local_iseq = iseq;
+ iseq->body->local_iseq = iseq;
}
}
void
-rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj)
+rb_iseq_add_mark_object(const rb_iseq_t *iseq, VALUE obj)
{
- if (!RTEST(iseq->mark_ary)) {
- RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, rb_ary_tmp_new(3));
- RBASIC_CLEAR_CLASS(iseq->mark_ary);
- }
- rb_ary_push(iseq->mark_ary, obj);
+ /* TODO: check dedup */
+ rb_ary_push(ISEQ_MARK_ARY(iseq), obj);
}
static VALUE
prepare_iseq_build(rb_iseq_t *iseq,
VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno,
- VALUE parent, enum iseq_type type, VALUE block_opt,
+ const rb_iseq_t *parent, enum iseq_type type,
const rb_compile_option_t *option)
{
- iseq->type = type;
- iseq->arg_rest = -1;
- iseq->arg_block = -1;
- iseq->arg_keyword = -1;
- RB_OBJ_WRITE(iseq->self, &iseq->klass, 0);
+ iseq->body->type = type;
set_relation(iseq, parent);
name = rb_fstring(name);
path = rb_fstring(path);
- if (RTEST(absolute_path))
- absolute_path = rb_fstring(absolute_path);
-
+ if (RTEST(absolute_path)) absolute_path = rb_fstring(absolute_path);
iseq_location_setup(iseq, path, absolute_path, name, first_lineno);
- if (iseq != iseq->local_iseq) {
- RB_OBJ_WRITE(iseq->self, &iseq->location.base_label, iseq->local_iseq->location.label);
+ if (iseq != iseq->body->local_iseq) {
+ RB_OBJ_WRITE(iseq, &iseq->body->location.base_label, iseq->body->local_iseq->body->location.label);
}
+ RB_OBJ_WRITE(iseq, &iseq->body->mark_ary, iseq_mark_ary_create(0));
- iseq->defined_method_id = 0;
- RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
-
- /*
- * iseq->special_block_builder = GC_GUARDED_PTR_REF(block_opt);
- * iseq->cached_special_block_builder = 0;
- * iseq->cached_special_block = 0;
- */
+ ISEQ_COMPILE_DATA(iseq) = ZALLOC(struct iseq_compile_data);
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, Qnil);
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->mark_ary, rb_ary_tmp_new(3));
- iseq->compile_data = ALLOC(struct iseq_compile_data);
- MEMZERO(iseq->compile_data, struct iseq_compile_data, 1);
- RB_OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, Qnil);
- RB_OBJ_WRITE(iseq->self, &iseq->compile_data->mark_ary, rb_ary_tmp_new(3));
-
- iseq->compile_data->storage_head = iseq->compile_data->storage_current =
+ ISEQ_COMPILE_DATA(iseq)->storage_head = ISEQ_COMPILE_DATA(iseq)->storage_current =
(struct iseq_compile_data_storage *)
ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
- sizeof(struct iseq_compile_data_storage));
+ SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
- RB_OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, rb_ary_new());
- iseq->compile_data->storage_head->pos = 0;
- iseq->compile_data->storage_head->next = 0;
- iseq->compile_data->storage_head->size =
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, rb_ary_tmp_new(3));
+ ISEQ_COMPILE_DATA(iseq)->storage_head->pos = 0;
+ ISEQ_COMPILE_DATA(iseq)->storage_head->next = 0;
+ ISEQ_COMPILE_DATA(iseq)->storage_head->size =
INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE;
- iseq->compile_data->storage_head->buff =
- (char *)(&iseq->compile_data->storage_head->buff + 1);
- iseq->compile_data->option = option;
- iseq->compile_data->last_coverable_line = -1;
+ ISEQ_COMPILE_DATA(iseq)->option = option;
+ ISEQ_COMPILE_DATA(iseq)->last_coverable_line = -1;
+
+ ISEQ_COVERAGE_SET(iseq, Qfalse);
- RB_OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
if (!GET_THREAD()->parse_in_eval) {
VALUE coverages = rb_get_coverages();
if (RTEST(coverages)) {
- RB_OBJ_WRITE(iseq->self, &iseq->coverage, rb_hash_lookup(coverages, path));
- if (NIL_P(iseq->coverage)) RB_OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
+ ISEQ_COVERAGE_SET(iseq, rb_hash_lookup(coverages, path));
+ if (NIL_P(ISEQ_COVERAGE(iseq))) ISEQ_COVERAGE_SET(iseq, Qfalse);
}
}
@@ -318,13 +312,13 @@ prepare_iseq_build(rb_iseq_t *iseq,
static VALUE
cleanup_iseq_build(rb_iseq_t *iseq)
{
- struct iseq_compile_data *data = iseq->compile_data;
+ struct iseq_compile_data *data = ISEQ_COMPILE_DATA(iseq);
VALUE err = data->err_info;
- iseq->compile_data = 0;
+ ISEQ_COMPILE_DATA(iseq) = 0;
compile_data_free(data);
if (RTEST(err)) {
- rb_funcall2(err, rb_intern("set_backtrace"), 1, &iseq->location.path);
+ rb_funcall2(err, rb_intern("set_backtrace"), 1, &iseq->body->location.path);
rb_exc_raise(err);
}
return Qtrue;
@@ -339,10 +333,47 @@ static rb_compile_option_t COMPILE_OPTION_DEFAULT = {
OPT_INSTRUCTIONS_UNIFICATION, /* int instructions_unification; */
OPT_STACK_CACHING, /* int stack_caching; */
OPT_TRACE_INSTRUCTION, /* int trace_instruction */
+ OPT_FROZEN_STRING_LITERAL,
+ OPT_DEBUG_FROZEN_STRING_LITERAL,
};
+
static const rb_compile_option_t COMPILE_OPTION_FALSE = {0};
static void
+set_compile_option_from_hash(rb_compile_option_t *option, VALUE opt)
+{
+#define SET_COMPILE_OPTION(o, h, mem) \
+ { VALUE flag = rb_hash_aref((h), ID2SYM(rb_intern(#mem))); \
+ if (flag == Qtrue) { (o)->mem = 1; } \
+ else if (flag == Qfalse) { (o)->mem = 0; } \
+ }
+#define SET_COMPILE_OPTION_NUM(o, h, mem) \
+ { VALUE num = rb_hash_aref(opt, ID2SYM(rb_intern(#mem))); \
+ if (!NIL_P(num)) (o)->mem = NUM2INT(num); \
+ }
+ SET_COMPILE_OPTION(option, opt, inline_const_cache);
+ SET_COMPILE_OPTION(option, opt, peephole_optimization);
+ SET_COMPILE_OPTION(option, opt, tailcall_optimization);
+ SET_COMPILE_OPTION(option, opt, specialized_instruction);
+ 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(option, opt, frozen_string_literal);
+ SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
+ SET_COMPILE_OPTION_NUM(option, opt, debug_level);
+#undef SET_COMPILE_OPTION
+#undef SET_COMPILE_OPTION_NUM
+}
+
+void
+rb_iseq_make_compile_option(rb_compile_option_t *option, VALUE opt)
+{
+ Check_Type(opt, T_HASH);
+ set_compile_option_from_hash(option, opt);
+}
+
+static void
make_compile_option(rb_compile_option_t *option, VALUE opt)
{
if (opt == Qnil) {
@@ -358,27 +389,7 @@ make_compile_option(rb_compile_option_t *option, VALUE opt)
}
else if (CLASS_OF(opt) == rb_cHash) {
*option = COMPILE_OPTION_DEFAULT;
-
-#define SET_COMPILE_OPTION(o, h, mem) \
- { VALUE flag = rb_hash_aref((h), ID2SYM(rb_intern(#mem))); \
- if (flag == Qtrue) { (o)->mem = 1; } \
- else if (flag == Qfalse) { (o)->mem = 0; } \
- }
-#define SET_COMPILE_OPTION_NUM(o, h, mem) \
- { VALUE num = rb_hash_aref(opt, ID2SYM(rb_intern(#mem))); \
- if (!NIL_P(num)) (o)->mem = NUM2INT(num); \
- }
- SET_COMPILE_OPTION(option, opt, inline_const_cache);
- SET_COMPILE_OPTION(option, opt, peephole_optimization);
- SET_COMPILE_OPTION(option, opt, tailcall_optimization);
- SET_COMPILE_OPTION(option, opt, specialized_instruction);
- 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
-#undef SET_COMPILE_OPTION_NUM
+ set_compile_option_from_hash(option, opt);
}
else {
rb_raise(rb_eTypeError, "Compile option must be Hash/true/false/nil");
@@ -402,6 +413,8 @@ make_compile_option_value(rb_compile_option_t *option)
SET_COMPILE_OPTION(option, opt, instructions_unification);
SET_COMPILE_OPTION(option, opt, stack_caching);
SET_COMPILE_OPTION(option, opt, trace_instruction);
+ SET_COMPILE_OPTION(option, opt, frozen_string_literal);
+ SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
SET_COMPILE_OPTION_NUM(option, opt, debug_level);
}
#undef SET_COMPILE_OPTION
@@ -409,82 +422,116 @@ make_compile_option_value(rb_compile_option_t *option)
return opt;
}
-VALUE
+rb_iseq_t *
rb_iseq_new(NODE *node, VALUE name, VALUE path, VALUE absolute_path,
- VALUE parent, enum iseq_type type)
+ const rb_iseq_t *parent, enum iseq_type 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 path, VALUE absolute_path, VALUE parent)
+rb_iseq_t *
+rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE absolute_path, const rb_iseq_t *parent)
{
return rb_iseq_new_with_opt(node, name, path, absolute_path, INT2FIX(0), parent, ISEQ_TYPE_TOP,
&COMPILE_OPTION_DEFAULT);
}
-VALUE
+rb_iseq_t *
rb_iseq_new_main(NODE *node, VALUE path, VALUE absolute_path)
{
rb_thread_t *th = GET_THREAD();
- VALUE parent = th->base_block->iseq->self;
+ const rb_iseq_t *parent = th->base_block->iseq;
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 path, VALUE absolute_path, VALUE first_lineno,
- VALUE parent, enum iseq_type type, VALUE bopt,
- const rb_compile_option_t *option)
+static inline rb_iseq_t *
+iseq_translate(rb_iseq_t *iseq)
{
- rb_iseq_t *iseq;
- VALUE self = iseq_alloc(rb_cISeq);
-
- GetISeqPtr(self, iseq);
- iseq->self = self;
+ if (rb_respond_to(rb_cISeq, rb_intern("translate"))) {
+ VALUE v1 = iseqw_new(iseq);
+ VALUE v2 = rb_funcall(rb_cISeq, rb_intern("translate"), 1, v1);
+ if (v1 != v2 && CLASS_OF(v2) == rb_cISeq) {
+ iseq = (rb_iseq_t *)iseqw_check(v2);
+ }
+ }
- 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;
+ return iseq;
}
-VALUE
-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)
+rb_iseq_t *
+rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE path, VALUE absolute_path,
+ VALUE first_lineno, const rb_iseq_t *parent,
+ enum iseq_type type, const rb_compile_option_t *option)
{
/* TODO: argument check */
- return rb_iseq_new_with_bopt_and_opt(node, name, path, absolute_path, first_lineno, parent, type,
- Qfalse, option);
+ rb_iseq_t *iseq = iseq_alloc();
+
+ if (!option) option = &COMPILE_OPTION_DEFAULT;
+ prepare_iseq_build(iseq, name, path, absolute_path, first_lineno, parent, type, option);
+
+ rb_iseq_compile_node(iseq, node);
+ cleanup_iseq_build(iseq);
+
+ return iseq_translate(iseq);
}
-VALUE
-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)
+const rb_iseq_t *
+rb_iseq_load_iseq(VALUE fname)
{
- /* TODO: argument check */
- return rb_iseq_new_with_bopt_and_opt(node, name, path, absolute_path, first_lineno, parent, type,
- bopt, &COMPILE_OPTION_DEFAULT);
+ VALUE iseqv = rb_check_funcall(rb_cISeq, rb_intern("load_iseq"), 1, &fname);
+
+ if (!SPECIAL_CONST_P(iseqv) && RBASIC_CLASS(iseqv) == rb_cISeq) {
+ return iseqw_check(iseqv);
+ }
+
+ return NULL;
}
#define CHECK_ARRAY(v) rb_convert_type((v), T_ARRAY, "Array", "to_ary")
+#define CHECK_HASH(v) rb_convert_type((v), T_HASH, "Hash", "to_hash")
#define CHECK_STRING(v) rb_convert_type((v), T_STRING, "String", "to_str")
#define CHECK_SYMBOL(v) rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
static inline VALUE CHECK_INTEGER(VALUE v) {(void)NUM2LONG(v); return v;}
+
+static enum iseq_type
+iseq_type_from_sym(VALUE type)
+{
+ const ID id_top = rb_intern("top");
+ const ID id_method = rb_intern("method");
+ const ID id_block = rb_intern("block");
+ const ID id_class = rb_intern("class");
+ const ID id_rescue = rb_intern("rescue");
+ const ID id_ensure = rb_intern("ensure");
+ const ID id_eval = rb_intern("eval");
+ const ID id_main = rb_intern("main");
+ const ID id_defined_guard = rb_intern("defined_guard");
+ /* ensure all symbols are static or pinned down before
+ * conversion */
+ const ID typeid = rb_check_id(&type);
+ if (typeid == id_top) return ISEQ_TYPE_TOP;
+ if (typeid == id_method) return ISEQ_TYPE_METHOD;
+ if (typeid == id_block) return ISEQ_TYPE_BLOCK;
+ if (typeid == id_class) return ISEQ_TYPE_CLASS;
+ if (typeid == id_rescue) return ISEQ_TYPE_RESCUE;
+ if (typeid == id_ensure) return ISEQ_TYPE_ENSURE;
+ if (typeid == id_eval) return ISEQ_TYPE_EVAL;
+ if (typeid == id_main) return ISEQ_TYPE_MAIN;
+ if (typeid == id_defined_guard) return ISEQ_TYPE_DEFINED_GUARD;
+ return (enum iseq_type)-1;
+}
+
static VALUE
-iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
+iseq_load(VALUE data, const rb_iseq_t *parent, VALUE opt)
{
- VALUE iseqval = iseq_alloc(self);
+ rb_iseq_t *iseq = iseq_alloc();
VALUE magic, version1, version2, format_type, misc;
VALUE name, path, absolute_path, first_lineno;
- VALUE type, body, locals, args, exception;
+ VALUE type, body, locals, params, exception;
st_data_t iseq_type;
- struct st_table *type_map = 0;
- rb_iseq_t *iseq;
rb_compile_option_t option;
int i = 0;
@@ -499,8 +546,8 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
version1 = CHECK_INTEGER(rb_ary_entry(data, i++));
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);
+ misc = CHECK_HASH(rb_ary_entry(data, i++));
+ ((void)magic, (void)version1, (void)version2, (void)format_type);
name = CHECK_STRING(rb_ary_entry(data, i++));
path = CHECK_STRING(rb_ary_entry(data, i++));
@@ -510,53 +557,27 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
type = CHECK_SYMBOL(rb_ary_entry(data, i++));
locals = CHECK_ARRAY(rb_ary_entry(data, i++));
-
- args = rb_ary_entry(data, i++);
- if (FIXNUM_P(args) || (args = CHECK_ARRAY(args))) {
- /* */
- }
-
+ params = CHECK_HASH(rb_ary_entry(data, i++));
exception = CHECK_ARRAY(rb_ary_entry(data, i++));
body = CHECK_ARRAY(rb_ary_entry(data, i++));
- GetISeqPtr(iseqval, iseq);
- iseq->self = iseqval;
- iseq->local_iseq = iseq;
+ iseq->body->local_iseq = iseq;
- if (type_map == 0) {
- type_map = st_init_numtable();
- st_insert(type_map, ID2SYM(rb_intern("top")), ISEQ_TYPE_TOP);
- st_insert(type_map, ID2SYM(rb_intern("method")), ISEQ_TYPE_METHOD);
- st_insert(type_map, ID2SYM(rb_intern("block")), ISEQ_TYPE_BLOCK);
- st_insert(type_map, ID2SYM(rb_intern("class")), ISEQ_TYPE_CLASS);
- st_insert(type_map, ID2SYM(rb_intern("rescue")), ISEQ_TYPE_RESCUE);
- st_insert(type_map, ID2SYM(rb_intern("ensure")), ISEQ_TYPE_ENSURE);
- st_insert(type_map, ID2SYM(rb_intern("eval")), ISEQ_TYPE_EVAL);
- st_insert(type_map, ID2SYM(rb_intern("main")), ISEQ_TYPE_MAIN);
- st_insert(type_map, ID2SYM(rb_intern("defined_guard")), ISEQ_TYPE_DEFINED_GUARD);
- }
-
- if (st_lookup(type_map, type, &iseq_type) == 0) {
- ID typeid = SYM2ID(type);
- VALUE typename = rb_id2str(typeid);
- if (typename)
- rb_raise(rb_eTypeError, "unsupport type: :%"PRIsVALUE, typename);
- else
- rb_raise(rb_eTypeError, "unsupport type: %p", (void *)typeid);
- }
-
- if (parent == Qnil) {
- parent = 0;
+ iseq_type = iseq_type_from_sym(type);
+ if (iseq_type == (enum iseq_type)-1) {
+ rb_raise(rb_eTypeError, "unsupport type: :%"PRIsVALUE, rb_sym2str(type));
}
make_compile_option(&option, opt);
+ option.peephole_optimization = FALSE; /* because peephole optimization can modify original iseq */
prepare_iseq_build(iseq, name, path, absolute_path, first_lineno,
- parent, (enum iseq_type)iseq_type, 0, &option);
+ parent, (enum iseq_type)iseq_type, &option);
- rb_iseq_build_from_ary(iseq, locals, args, exception, body);
+ rb_iseq_build_from_ary(iseq, misc, locals, params, exception, body);
cleanup_iseq_build(iseq);
- return iseqval;
+
+ return iseqw_new(iseq);
}
/*
@@ -567,81 +588,172 @@ iseq_s_load(int argc, VALUE *argv, VALUE self)
{
VALUE data, opt=Qnil;
rb_scan_args(argc, argv, "11", &data, &opt);
-
- return iseq_load(self, data, 0, opt);
+ return iseq_load(data, NULL, opt);
}
VALUE
rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
{
- return iseq_load(rb_cISeq, data, parent, opt);
+ return iseq_load(data, RTEST(parent) ? (rb_iseq_t *)parent : NULL, opt);
}
-VALUE
+rb_iseq_t *
rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt)
{
int state;
rb_thread_t *th = GET_THREAD();
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) {
- VALUE parser;
- int ln = NUM2INT(line);
- NODE *node;
- rb_compile_option_t option;
-
- StringValueCStr(file);
- make_compile_option(&option, opt);
+ rb_iseq_t *iseq = NULL;
+ const rb_iseq_t *parent = NULL;
+ rb_compile_option_t option;
+ VALUE label;
+ enum iseq_type type;
+ NODE *(*parse)(VALUE vparser, VALUE fname, VALUE file, int start);
+ int ln = NUM2INT(line);
- parser = rb_parser_new();
+ StringValueCStr(file);
+ if (RB_TYPE_P(src, T_FILE)) {
+ parse = rb_parser_compile_file_path;
+ }
+ else {
+ StringValue(src);
+ parse = rb_parser_compile_string_path;
+ }
- if (RB_TYPE_P((src), T_FILE))
- node = rb_parser_compile_file_path(parser, file, src, ln);
- else {
- node = rb_parser_compile_string_path(parser, file, src, ln);
+ make_compile_option(&option, opt);
- if (!node) {
- rb_exc_raise(GET_THREAD()->errinfo); /* TODO: check err */
- }
- }
+ if (base_block && (parent = base_block->iseq) != NULL) {
+ label = parent->body->location.label;
+ type = ISEQ_TYPE_EVAL;
+ }
+ else {
+ label = rb_fstring_cstr("<compiled>");
+ type = ISEQ_TYPE_TOP;
+ }
- 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);
+ th->base_block = base_block;
+ TH_PUSH_TAG(th);
+ if ((state = EXEC_TAG()) == 0) {
+ NODE *node = (*parse)(rb_parser_new(), file, src, ln);
+ if (node) { /* TODO: check err */
+ iseq = rb_iseq_new_with_opt(node, label, file, absolute_path, line,
+ parent, type, &option);
}
}
TH_POP_TAG();
th->base_block = prev_base_block;
+ if (!iseq) rb_exc_raise(th->errinfo);
if (state) {
JUMP_TAG(state);
}
- return iseqval;
+ return iseq;
}
-VALUE
+rb_iseq_t *
rb_iseq_compile(VALUE src, VALUE file, VALUE line)
{
return rb_iseq_compile_with_option(src, file, Qnil, line, 0, Qnil);
}
-VALUE
+rb_iseq_t *
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);
}
+VALUE
+rb_iseq_path(const rb_iseq_t *iseq)
+{
+ return iseq->body->location.path;
+}
+
+VALUE
+rb_iseq_absolute_path(const rb_iseq_t *iseq)
+{
+ return iseq->body->location.absolute_path;
+}
+
+VALUE
+rb_iseq_label(const rb_iseq_t *iseq)
+{
+ return iseq->body->location.label;
+}
+
+VALUE
+rb_iseq_base_label(const rb_iseq_t *iseq)
+{
+ return iseq->body->location.base_label;
+}
+
+VALUE
+rb_iseq_first_lineno(const rb_iseq_t *iseq)
+{
+ return iseq->body->location.first_lineno;
+}
+
+VALUE
+rb_iseq_method_name(const rb_iseq_t *iseq)
+{
+ const rb_iseq_t *local_iseq;
+
+ local_iseq = iseq->body->local_iseq;
+
+ if (local_iseq->body->type == ISEQ_TYPE_METHOD) {
+ return local_iseq->body->location.base_label;
+ }
+ else {
+ return Qnil;
+ }
+}
+
+VALUE
+rb_iseq_coverage(const rb_iseq_t *iseq)
+{
+ return ISEQ_COVERAGE(iseq);
+}
+
+/* define wrapper class methods (RubyVM::InstructionSequence) */
+
+static void
+iseqw_mark(void *ptr)
+{
+ rb_gc_mark((VALUE)ptr);
+}
+
+static size_t
+iseqw_memsize(const void *ptr)
+{
+ return iseq_memsize((const rb_iseq_t *)ptr);
+}
+
+static const rb_data_type_t iseqw_data_type = {
+ "T_IMEMO/iseq",
+ {iseqw_mark, NULL, iseqw_memsize,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED
+};
+
+static VALUE
+iseqw_new(const rb_iseq_t *iseq)
+{
+ union { const rb_iseq_t *in; void *out; } deconst;
+ VALUE obj;
+
+ deconst.in = iseq;
+ obj = TypedData_Wrap_Struct(rb_cISeq, &iseqw_data_type, deconst.out);
+ RB_OBJ_WRITTEN(obj, Qundef, iseq);
+
+ return obj;
+}
+
+VALUE
+rb_iseqw_new(const rb_iseq_t *iseq)
+{
+ return iseqw_new(iseq);
+}
+
/*
* call-seq:
* InstructionSequence.compile(source[, file[, path[, line[, options]]]]) -> iseq
@@ -664,17 +776,16 @@ rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, rb_block_t *base_bloc
*
*/
static VALUE
-iseq_s_compile(int argc, VALUE *argv, VALUE self)
+iseqw_s_compile(int argc, VALUE *argv, VALUE self)
{
VALUE src, file = Qnil, path = Qnil, line = INT2FIX(1), opt = Qnil;
-
rb_secure(1);
rb_scan_args(argc, argv, "14", &src, &file, &path, &line, &opt);
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, 0, opt);
+ return iseqw_new(rb_iseq_compile_with_option(src, file, path, line, 0, opt));
}
/*
@@ -698,11 +809,10 @@ iseq_s_compile(int argc, VALUE *argv, VALUE self)
* #=> <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
*/
static VALUE
-iseq_s_compile_file(int argc, VALUE *argv, VALUE self)
+iseqw_s_compile_file(int argc, VALUE *argv, VALUE self)
{
VALUE file, line = INT2FIX(1), opt = Qnil;
- VALUE parser;
- VALUE f;
+ VALUE parser, f, exc = Qnil;
NODE *node;
const char *fname;
rb_compile_option_t option;
@@ -716,10 +826,16 @@ iseq_s_compile_file(int argc, VALUE *argv, VALUE self)
parser = rb_parser_new();
node = rb_parser_compile_file(parser, fname, f, NUM2INT(line));
+ if (!node) exc = GET_THREAD()->errinfo;
+
+ rb_io_close(f);
+ if (!node) rb_exc_raise(exc);
+
make_compile_option(&option, opt);
- return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), file,
- rb_realpath_internal(Qnil, file, 1), line, Qfalse,
- ISEQ_TYPE_TOP, &option);
+
+ return iseqw_new(rb_iseq_new_with_opt(node, rb_str_new2("<main>"), file,
+ rb_realpath_internal(Qnil, file, 1), line, NULL,
+ ISEQ_TYPE_TOP, &option));
}
/*
@@ -755,7 +871,7 @@ iseq_s_compile_file(int argc, VALUE *argv, VALUE self)
* ::new, ::compile and ::compile_file.
*/
static VALUE
-iseq_s_compile_option_set(VALUE self, VALUE opt)
+iseqw_s_compile_option_set(VALUE self, VALUE opt)
{
rb_compile_option_t option;
rb_secure(1);
@@ -773,22 +889,32 @@ iseq_s_compile_option_set(VALUE self, VALUE opt)
* For details, see InstructionSequence.compile_option=.
*/
static VALUE
-iseq_s_compile_option_get(VALUE self)
+iseqw_s_compile_option_get(VALUE self)
{
return make_compile_option_value(&COMPILE_OPTION_DEFAULT);
}
-static rb_iseq_t *
-iseq_check(VALUE val)
+static const rb_iseq_t *
+iseqw_check(VALUE iseqw)
{
- rb_iseq_t *iseq;
- GetISeqPtr(val, iseq);
- if (!iseq->location.label) {
+ rb_iseq_t *iseq = DATA_PTR(iseqw);
+
+ if (!iseq->body) {
+ ibf_load_iseq_complete(iseq);
+ }
+
+ if (!iseq->body->location.label) {
rb_raise(rb_eTypeError, "uninitialized InstructionSequence");
}
return iseq;
}
+const rb_iseq_t *
+rb_iseqw_to_iseq(VALUE iseqw)
+{
+ return iseqw_check(iseqw);
+}
+
/*
* call-seq:
* iseq.eval -> obj
@@ -798,10 +924,10 @@ iseq_check(VALUE val)
* RubyVM::InstructionSequence.compile("1 + 2").eval #=> 3
*/
static VALUE
-iseq_eval(VALUE self)
+iseqw_eval(VALUE self)
{
rb_secure(1);
- return rb_iseq_eval(self);
+ return rb_iseq_eval(iseqw_check(self));
}
/*
@@ -809,17 +935,18 @@ iseq_eval(VALUE self)
* sequence, including the #label and #path.
*/
static VALUE
-iseq_inspect(VALUE self)
+iseqw_inspect(VALUE self)
{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- if (!iseq->location.label) {
+ const rb_iseq_t *iseq = iseqw_check(self);
+
+ if (!iseq->body->location.label) {
return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self));
}
-
- return rb_sprintf("<%s:%s@%s>",
- rb_obj_classname(self),
- RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
+ else {
+ return rb_sprintf("<%s:%s@%s>",
+ rb_obj_classname(self),
+ RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(iseq->body->location.path));
+ }
}
/*
@@ -845,12 +972,10 @@ iseq_inspect(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.path #=> /tmp/method.rb
*/
-VALUE
-rb_iseq_path(VALUE self)
+static VALUE
+iseqw_path(VALUE self)
{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- return iseq->location.path;
+ return rb_iseq_path(iseqw_check(self));
}
/*
@@ -869,12 +994,10 @@ rb_iseq_path(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.absolute_path #=> /tmp/method.rb
*/
-VALUE
-rb_iseq_absolute_path(VALUE self)
+static VALUE
+iseqw_absolute_path(VALUE self)
{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- return iseq->location.absolute_path;
+ return rb_iseq_absolute_path(iseqw_check(self));
}
/* Returns the label of this instruction sequence.
@@ -900,12 +1023,10 @@ rb_iseq_absolute_path(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.label #=> <main>
*/
-VALUE
-rb_iseq_label(VALUE self)
+static VALUE
+iseqw_label(VALUE self)
{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- return iseq->location.label;
+ return rb_iseq_label(iseqw_check(self));
}
/* Returns the base label of this instruction sequence.
@@ -928,12 +1049,10 @@ rb_iseq_label(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.base_label #=> <main>
*/
-VALUE
-rb_iseq_base_label(VALUE self)
+static VALUE
+iseqw_base_label(VALUE self)
{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- return iseq->location.base_label;
+ return rb_iseq_base_label(iseqw_check(self));
}
/* Returns the number of the first source line where the instruction sequence
@@ -946,38 +1065,13 @@ rb_iseq_base_label(VALUE self)
* iseq.first_lineno
* #=> 1
*/
-VALUE
-rb_iseq_first_lineno(VALUE self)
+static VALUE
+iseqw_first_lineno(VALUE self)
{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- return iseq->location.first_lineno;
+ return rb_iseq_first_lineno(iseqw_check(self));
}
-VALUE
-rb_iseq_klass(VALUE self)
-{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- return iseq->local_iseq->klass;
-}
-
-VALUE
-rb_iseq_method_name(VALUE self)
-{
- rb_iseq_t *iseq, *local_iseq;
- GetISeqPtr(self, iseq);
- local_iseq = iseq->local_iseq;
- if (local_iseq->type == ISEQ_TYPE_METHOD) {
- return local_iseq->location.base_label;
- }
- else {
- return Qnil;
- }
-}
-
-static
-VALUE iseq_data_to_ary(rb_iseq_t *iseq);
+static VALUE iseq_data_to_ary(const rb_iseq_t *iseq);
/*
* call-seq:
@@ -1044,14 +1138,8 @@ VALUE iseq_data_to_ary(rb_iseq_t *iseq);
* 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]
+ * [params]
+ * An Hash object containing parameter information.
*
* More info about these values can be found in +vm_core.h+.
*
@@ -1063,11 +1151,13 @@ VALUE iseq_data_to_ary(rb_iseq_t *iseq);
* An array of arrays containing the instruction names and operands that
* make up the body of the instruction sequence.
*
+ * Note that this format is MRI specific and version dependent.
+ *
*/
static VALUE
-iseq_to_a(VALUE self)
+iseqw_to_a(VALUE self)
{
- rb_iseq_t *iseq = iseq_check(self);
+ const rb_iseq_t *iseq = iseqw_check(self);
rb_secure(1);
return iseq_data_to_ary(iseq);
}
@@ -1075,11 +1165,11 @@ iseq_to_a(VALUE self)
/* TODO: search algorithm is brute force.
this should be binary search or so. */
-static struct iseq_line_info_entry *
+static const struct iseq_line_info_entry *
get_line_info(const rb_iseq_t *iseq, size_t pos)
{
- size_t i = 0, size = iseq->line_info_size;
- struct iseq_line_info_entry *table = iseq->line_info_table;
+ size_t i = 0, size = iseq->body->line_info_size;
+ const struct iseq_line_info_entry *table = iseq->body->line_info_table;
const int debug = 0;
if (debug) {
@@ -1113,7 +1203,8 @@ get_line_info(const rb_iseq_t *iseq, size_t pos)
static unsigned int
find_line_no(const rb_iseq_t *iseq, size_t pos)
{
- struct iseq_line_info_entry *entry = get_line_info(iseq, pos);
+ const struct iseq_line_info_entry *entry = get_line_info(iseq, pos);
+
if (entry) {
return entry->line_no;
}
@@ -1147,13 +1238,13 @@ id_to_name(ID id, VALUE default_value)
}
VALUE
-rb_insn_operand_intern(rb_iseq_t *iseq,
+rb_insn_operand_intern(const rb_iseq_t *iseq,
VALUE insn, int op_no, VALUE op,
- int len, size_t pos, VALUE *pnop, VALUE child)
+ int len, size_t pos, const VALUE *pnop, VALUE child)
{
const char *types = insn_op_types(insn);
char type = types[op_no];
- VALUE ret;
+ VALUE ret = Qundef;
switch (type) {
case TS_OFFSET: /* LONG */
@@ -1167,13 +1258,13 @@ rb_insn_operand_intern(rb_iseq_t *iseq,
case TS_LINDEX:{
if (insn == BIN(getlocal) || insn == BIN(setlocal)) {
if (pnop) {
- rb_iseq_t *diseq = iseq;
+ const rb_iseq_t *diseq = iseq;
VALUE level = *pnop, i;
for (i = 0; i < level; i++) {
- diseq = diseq->parent_iseq;
+ diseq = diseq->body->parent_iseq;
}
- ret = id_to_name(diseq->local_table[diseq->local_size - op], INT2FIX('*'));
+ ret = id_to_name(diseq->body->local_table[diseq->body->local_size - op], INT2FIX('*'));
}
else {
ret = rb_sprintf("%"PRIuVALUE, op);
@@ -1199,11 +1290,11 @@ rb_insn_operand_intern(rb_iseq_t *iseq,
case TS_ISEQ: /* iseq */
{
- rb_iseq_t *iseq = (rb_iseq_t *)op;
- if (iseq) {
- ret = iseq->location.label;
+ if (op) {
+ const rb_iseq_t *iseq = rb_iseq_check((rb_iseq_t *)op);
+ ret = iseq->body->location.label;
if (child) {
- rb_ary_push(child, iseq->self);
+ rb_ary_push(child, (VALUE)iseq);
}
}
else {
@@ -1219,25 +1310,24 @@ rb_insn_operand_intern(rb_iseq_t *iseq,
break;
case TS_IC:
- ret = rb_sprintf("<is:%"PRIdPTRDIFF">", (union iseq_inline_storage_entry *)op - iseq->is_entries);
+ ret = rb_sprintf("<is:%"PRIdPTRDIFF">", (union iseq_inline_storage_entry *)op - iseq->body->is_entries);
break;
case TS_CALLINFO:
{
- rb_call_info_t *ci = (rb_call_info_t *)op;
+ struct rb_call_info *ci = (struct rb_call_info *)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("mid:%"PRIsVALUE, rb_id2str(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 & VM_CALL_KWARG) {
+ struct rb_call_info_kw_arg *kw_args = ((struct rb_call_info_with_kwarg *)ci)->kw_arg;
+ VALUE kw_ary = rb_ary_new_from_values(kw_args->keyword_len, kw_args->keywords);
+ rb_ary_push(ary, rb_sprintf("kw:[%"PRIsVALUE"]", rb_ary_join(kw_ary, rb_str_new2(","))));
}
if (ci->flag) {
@@ -1248,20 +1338,34 @@ rb_insn_operand_intern(rb_iseq_t *iseq,
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_KWARG) rb_ary_push(flags, rb_str_new2("KWARG"));
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 */
+ if (ci->flag & VM_CALL_ARGS_SIMPLE) rb_ary_push(flags, rb_str_new2("ARGS_SIMPLE")); /* 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_CALLCACHE:
+ ret = rb_str_new2("<callcache>");
+ break;
+
case TS_CDHASH:
ret = rb_str_new2("<cdhash>");
break;
case TS_FUNCPTR:
- ret = rb_str_new2("<funcptr>");
+ {
+#ifdef HAVE_DLADDR
+ Dl_info info;
+ if (dladdr((void *)op, &info) && info.dli_sname) {
+ ret = rb_str_new_cstr(info.dli_sname);
+ break;
+ }
+#endif
+ ret = rb_str_new2("<funcptr>");
+ }
break;
default:
@@ -1275,10 +1379,10 @@ rb_insn_operand_intern(rb_iseq_t *iseq,
* Iseq -> Iseq inspect object
*/
int
-rb_iseq_disasm_insn(VALUE ret, VALUE *iseq, size_t pos,
- rb_iseq_t *iseqdat, VALUE child)
+rb_iseq_disasm_insn(VALUE ret, const VALUE *code, size_t pos,
+ const rb_iseq_t *iseq, VALUE child)
{
- VALUE insn = iseq[pos];
+ VALUE insn = code[pos];
int len = insn_len(insn);
int j;
const char *types = insn_op_types(insn);
@@ -1296,8 +1400,8 @@ rb_iseq_disasm_insn(VALUE ret, VALUE *iseq, size_t pos,
for (j = 0; types[j]; j++) {
const char *types = insn_op_types(insn);
- VALUE opstr = rb_insn_operand_intern(iseqdat, insn, j, iseq[pos + j + 1],
- len, pos, &iseq[pos + j + 2],
+ VALUE opstr = rb_insn_operand_intern(iseq, insn, j, code[pos + j + 1],
+ len, pos, &code[pos + j + 2],
child);
rb_str_concat(str, opstr);
@@ -1307,8 +1411,8 @@ rb_iseq_disasm_insn(VALUE ret, VALUE *iseq, size_t pos,
}
{
- unsigned int line_no = find_line_no(iseqdat, pos);
- unsigned int prev = pos == 0 ? 0 : find_line_no(iseqdat, pos - 1);
+ unsigned int line_no = find_line_no(iseq, pos);
+ unsigned int prev = pos == 0 ? 0 : find_line_no(iseq, pos - 1);
if (line_no && line_no != prev) {
long slen = RSTRING_LEN(str);
slen = (slen > 70) ? 0 : (70 - slen);
@@ -1348,46 +1452,37 @@ 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
- */
+static VALUE
+iseq_inspect(const rb_iseq_t *iseq)
+{
+ if (!iseq->body->location.label) {
+ return rb_sprintf("#<ISeq: uninitialized>");
+ }
+ else {
+ return rb_sprintf("#<ISeq:%s@%s>", RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(iseq->body->location.path));
+ }
+}
+
VALUE
-rb_iseq_disasm(VALUE self)
+rb_iseq_disasm(const rb_iseq_t *iseq)
{
- rb_iseq_t *iseqdat = iseq_check(self);
- VALUE *iseq;
+ VALUE *code;
VALUE str = rb_str_new(0, 0);
- VALUE child = rb_ary_new();
- unsigned long size;
- int i;
+ VALUE child = rb_ary_tmp_new(3);
+ unsigned int size;
+ unsigned int i;
long l;
- ID *tbl;
+ const ID *tbl;
size_t n;
enum {header_minlen = 72};
rb_secure(1);
- iseq = iseqdat->iseq;
- size = iseqdat->iseq_size;
+ size = iseq->body->iseq_size;
rb_str_cat2(str, "== disasm: ");
- rb_str_concat(str, iseq_inspect(iseqdat->self));
+ rb_str_concat(str, iseq_inspect(iseq));
if ((l = RSTRING_LEN(str)) < header_minlen) {
rb_str_resize(str, header_minlen);
memset(RSTRING_PTR(str) + l, '=', header_minlen - l);
@@ -1395,61 +1490,67 @@ rb_iseq_disasm(VALUE self)
rb_str_cat2(str, "\n");
/* show catch table information */
- if (iseqdat->catch_table_size != 0) {
+ if (iseq->body->catch_table) {
rb_str_cat2(str, "== catch table\n");
}
- for (i = 0; i < iseqdat->catch_table_size; i++) {
- struct iseq_catch_table_entry *entry = &iseqdat->catch_table[i];
- rb_str_catf(str,
- "| catch type: %-6s st: %04d ed: %04d sp: %04d cont: %04d\n",
- catch_type((int)entry->type), (int)entry->start,
- (int)entry->end, (int)entry->sp, (int)entry->cont);
- if (entry->iseq) {
- rb_str_concat(str, rb_iseq_disasm(entry->iseq));
+ if (iseq->body->catch_table) {
+ for (i = 0; i < iseq->body->catch_table->size; i++) {
+ const struct iseq_catch_table_entry *entry = &iseq->body->catch_table->entries[i];
+ rb_str_catf(str,
+ "| catch type: %-6s st: %04d ed: %04d sp: %04d cont: %04d\n",
+ catch_type((int)entry->type), (int)entry->start,
+ (int)entry->end, (int)entry->sp, (int)entry->cont);
+ if (entry->iseq) {
+ rb_str_concat(str, rb_iseq_disasm(rb_iseq_check(entry->iseq)));
+ }
}
}
- if (iseqdat->catch_table_size != 0) {
+ if (iseq->body->catch_table) {
rb_str_cat2(str, "|-------------------------------------"
"-----------------------------------\n");
}
/* show local table information */
- tbl = iseqdat->local_table;
+ tbl = iseq->body->local_table;
if (tbl) {
rb_str_catf(str,
"local table (size: %d, argc: %d "
- "[opts: %d, rest: %d, post: %d, block: %d, keyword: %d@%d] s%d)\n",
- iseqdat->local_size, iseqdat->argc,
- iseqdat->arg_opts, iseqdat->arg_rest,
- iseqdat->arg_post_len, iseqdat->arg_block,
- iseqdat->arg_keywords, iseqdat->local_size-iseqdat->arg_keyword,
- iseqdat->arg_simple);
-
- for (i = 0; i < iseqdat->local_table_size; i++) {
+ "[opts: %d, rest: %d, post: %d, block: %d, kw: %d@%d, kwrest: %d])\n",
+ iseq->body->local_size,
+ iseq->body->param.lead_num,
+ iseq->body->param.opt_num,
+ iseq->body->param.flags.has_rest ? iseq->body->param.rest_start : -1,
+ iseq->body->param.post_num,
+ iseq->body->param.flags.has_block ? iseq->body->param.block_start : -1,
+ iseq->body->param.flags.has_kw ? iseq->body->param.keyword->num : -1,
+ iseq->body->param.flags.has_kw ? iseq->body->param.keyword->required_num : -1,
+ iseq->body->param.flags.has_kwrest ? iseq->body->param.keyword->rest_start : -1);
+
+ for (i = 0; i < iseq->body->local_table_size; i++) {
+ int li = (int)i;
long width;
VALUE name = id_to_name(tbl[i], 0);
char argi[0x100] = "";
char opti[0x100] = "";
- if (iseqdat->arg_opts) {
- int argc = iseqdat->argc;
- int opts = iseqdat->arg_opts;
- if (i >= argc && i < argc + opts - 1) {
+ if (iseq->body->param.flags.has_opt) {
+ int argc = iseq->body->param.lead_num;
+ int opts = iseq->body->param.opt_num;
+ if (li >= argc && li < argc + opts) {
snprintf(opti, sizeof(opti), "Opt=%"PRIdVALUE,
- iseqdat->arg_opt_table[i - argc]);
+ iseq->body->param.opt_table[li - argc]);
}
}
snprintf(argi, sizeof(argi), "%s%s%s%s%s", /* arg, opts, rest, post block */
- iseqdat->argc > i ? "Arg" : "",
+ iseq->body->param.lead_num > li ? "Arg" : "",
opti,
- iseqdat->arg_rest == i ? "Rest" : "",
- (iseqdat->arg_post_start <= i &&
- i < iseqdat->arg_post_start + iseqdat->arg_post_len) ? "Post" : "",
- iseqdat->arg_block == i ? "Block" : "");
+ (iseq->body->param.flags.has_rest && iseq->body->param.rest_start == li) ? "Rest" : "",
+ (iseq->body->param.flags.has_post && iseq->body->param.post_start <= li && li < iseq->body->param.post_start + iseq->body->param.post_num) ? "Post" : "",
+ (iseq->body->param.flags.has_block && iseq->body->param.block_start == li) ? "Block" : "");
- rb_str_catf(str, "[%2d] ", iseqdat->local_size - i);
+ rb_str_catf(str, "[%2d] ", iseq->body->local_size - i);
width = RSTRING_LEN(str) + 11;
if (name)
rb_str_append(str, name);
@@ -1462,19 +1563,44 @@ rb_iseq_disasm(VALUE self)
}
/* show each line */
+ code = rb_iseq_original_iseq(iseq);
for (n = 0; n < size;) {
- n += rb_iseq_disasm_insn(str, iseq, n, iseqdat, child);
+ n += rb_iseq_disasm_insn(str, code, n, iseq, child);
}
- for (i = 0; i < RARRAY_LEN(child); i++) {
- VALUE isv = rb_ary_entry(child, i);
- rb_str_concat(str, rb_iseq_disasm(isv));
+ for (l = 0; l < RARRAY_LEN(child); l++) {
+ VALUE isv = rb_ary_entry(child, l);
+ rb_str_concat(str, rb_iseq_disasm(rb_iseq_check((rb_iseq_t *)isv)));
}
return str;
}
/*
+ * 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
+ */
+static VALUE
+iseqw_disasm(VALUE self)
+{
+ return rb_iseq_disasm(iseqw_check(self));
+}
+
+/*
* Returns the instruction sequence containing the given proc or method.
*
* For example, using irb:
@@ -1510,10 +1636,9 @@ rb_iseq_disasm(VALUE self)
* > #=> #<RubyVM::InstructionSequence:0x007fb73d7caf78>
*/
static VALUE
-iseq_s_of(VALUE klass, VALUE body)
+iseqw_s_of(VALUE klass, VALUE body)
{
- VALUE ret = Qnil;
- rb_iseq_t *iseq;
+ const rb_iseq_t *iseq = NULL;
rb_secure(1);
@@ -1521,14 +1646,16 @@ iseq_s_of(VALUE klass, VALUE body)
rb_proc_t *proc;
GetProcPtr(body, proc);
iseq = proc->block.iseq;
- if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
- ret = iseq->self;
+
+ if (!RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+ iseq = NULL;
}
}
- else if ((iseq = rb_method_get_iseq(body)) != 0) {
- ret = iseq->self;
+ else {
+ iseq = rb_method_iseq(body);
}
- return ret;
+
+ return iseq ? iseqw_new(iseq) : Qnil;
}
/*
@@ -1583,12 +1710,11 @@ iseq_s_of(VALUE klass, VALUE body)
* 0012 leave
*
*/
-
static VALUE
-iseq_s_disasm(VALUE klass, VALUE body)
+iseqw_s_disasm(VALUE klass, VALUE body)
{
- VALUE iseqval = iseq_s_of(klass, body);
- return NIL_P(iseqval) ? Qnil : rb_iseq_disasm(iseqval);
+ VALUE iseqw = iseqw_s_of(klass, body);
+ return NIL_P(iseqw) ? Qnil : rb_iseq_disasm(iseqw_check(iseqw));
}
const char *
@@ -1611,11 +1737,7 @@ ruby_node_name(int node)
static VALUE
register_label(struct st_table *table, unsigned long idx)
{
- VALUE sym;
- char buff[8 + (sizeof(idx) * CHAR_BIT * 32 / 100)];
-
- snprintf(buff, sizeof(buff), "label_%lu", idx);
- sym = ID2SYM(rb_intern(buff));
+ VALUE sym = rb_str_intern(rb_sprintf("label_%lu", idx));
st_insert(table, idx, sym);
return sym;
}
@@ -1632,7 +1754,7 @@ exception_type2symbol(VALUE type)
case CATCH_TYPE_REDO: CONST_ID(id, "redo"); break;
case CATCH_TYPE_NEXT: CONST_ID(id, "next"); break;
default:
- rb_bug("...");
+ rb_bug("exception_type2symbol: unknown type %d", (int)type);
}
return ID2SYM(id);
}
@@ -1646,18 +1768,19 @@ cdhash_each(VALUE key, VALUE value, VALUE ary)
}
static VALUE
-iseq_data_to_ary(rb_iseq_t *iseq)
+iseq_data_to_ary(const rb_iseq_t *iseq)
{
- long i;
+ unsigned int i;
+ long l;
size_t ti;
unsigned int pos;
unsigned int line = 0;
- VALUE *seq;
+ VALUE *seq, *iseq_original;
VALUE val = rb_ary_new();
VALUE type; /* Symbol */
VALUE locals = rb_ary_new();
- VALUE args = rb_ary_new();
+ VALUE params = rb_hash_new();
VALUE body = rb_ary_new(); /* [[:insn1, ...], ...] */
VALUE nbody;
VALUE exception = rb_ary_new(); /* [[....]] */
@@ -1693,7 +1816,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
}
/* type */
- switch (iseq->type) {
+ switch (iseq->body->type) {
case ISEQ_TYPE_TOP: type = sym_top; break;
case ISEQ_TYPE_METHOD: type = sym_method; break;
case ISEQ_TYPE_BLOCK: type = sym_block; break;
@@ -1707,53 +1830,68 @@ iseq_data_to_ary(rb_iseq_t *iseq)
};
/* locals */
- for (i=0; i<iseq->local_table_size; i++) {
- ID lid = iseq->local_table[i];
+ for (i=0; i<iseq->body->local_table_size; i++) {
+ ID lid = iseq->body->local_table[i];
if (lid) {
- if (rb_id2str(lid)) rb_ary_push(locals, ID2SYM(lid));
+ if (rb_id2str(lid)) {
+ rb_ary_push(locals, ID2SYM(lid));
+ }
+ else { /* hidden variable from id_internal() */
+ rb_ary_push(locals, ULONG2NUM(iseq->body->local_table_size-i+1));
+ }
}
else {
rb_ary_push(locals, ID2SYM(rb_intern("#arg_rest")));
}
}
- /* args */
+ /* params */
{
- /*
- * [argc, # argc
- * [label1, label2, ...] # opts
- * rest index,
- * post_len
- * post_start
- * block index,
- * simple,
- * ]
- */
- VALUE arg_opt_labels = rb_ary_new();
int j;
- for (j=0; j<iseq->arg_opts; j++) {
- rb_ary_push(arg_opt_labels,
- register_label(labels_table, iseq->arg_opt_table[j]));
- }
+ if (iseq->body->param.flags.has_opt) {
+ int len = iseq->body->param.opt_num + 1;
+ VALUE arg_opt_labels = rb_ary_new2(len);
+
+ for (j = 0; j < len; j++) {
+ VALUE l = register_label(labels_table, iseq->body->param.opt_table[j]);
+ rb_ary_push(arg_opt_labels, l);
+ }
+ rb_hash_aset(params, ID2SYM(rb_intern("opt")), arg_opt_labels);
+ }
/* commit */
- if (iseq->arg_simple == 1) {
- args = INT2FIX(iseq->argc);
- }
- else {
- rb_ary_push(args, INT2FIX(iseq->argc));
- rb_ary_push(args, arg_opt_labels);
- rb_ary_push(args, INT2FIX(iseq->arg_post_len));
- rb_ary_push(args, INT2FIX(iseq->arg_post_start));
- rb_ary_push(args, INT2FIX(iseq->arg_rest));
- rb_ary_push(args, INT2FIX(iseq->arg_block));
- rb_ary_push(args, INT2FIX(iseq->arg_simple));
+ if (iseq->body->param.flags.has_lead) rb_hash_aset(params, ID2SYM(rb_intern("lead_num")), INT2FIX(iseq->body->param.lead_num));
+ if (iseq->body->param.flags.has_post) rb_hash_aset(params, ID2SYM(rb_intern("post_num")), INT2FIX(iseq->body->param.post_num));
+ if (iseq->body->param.flags.has_post) rb_hash_aset(params, ID2SYM(rb_intern("post_start")), INT2FIX(iseq->body->param.post_start));
+ if (iseq->body->param.flags.has_rest) rb_hash_aset(params, ID2SYM(rb_intern("rest_start")), INT2FIX(iseq->body->param.rest_start));
+ if (iseq->body->param.flags.has_block) rb_hash_aset(params, ID2SYM(rb_intern("block_start")), INT2FIX(iseq->body->param.block_start));
+ if (iseq->body->param.flags.has_kw) {
+ VALUE keywords = rb_ary_new();
+ int i, j;
+ for (i=0; i<iseq->body->param.keyword->required_num; i++) {
+ rb_ary_push(keywords, ID2SYM(iseq->body->param.keyword->table[i]));
+ }
+ for (j=0; i<iseq->body->param.keyword->num; i++, j++) {
+ VALUE key = rb_ary_new_from_args(1, ID2SYM(iseq->body->param.keyword->table[i]));
+ if (iseq->body->param.keyword->default_values[j] != Qundef) {
+ rb_ary_push(key, iseq->body->param.keyword->default_values[j]);
+ }
+ rb_ary_push(keywords, key);
+ }
+
+ rb_hash_aset(params, ID2SYM(rb_intern("kwbits")),
+ INT2FIX(iseq->body->param.keyword->bits_start));
+ rb_hash_aset(params, ID2SYM(rb_intern("keyword")), keywords);
}
+ if (iseq->body->param.flags.has_kwrest) rb_hash_aset(params, ID2SYM(rb_intern("kwrest")), INT2FIX(iseq->body->param.keyword->rest_start));
+ if (iseq->body->param.flags.ambiguous_param0) rb_hash_aset(params, ID2SYM(rb_intern("ambiguous_param0")), Qtrue);
}
/* body */
- for (seq = iseq->iseq; seq < iseq->iseq + iseq->iseq_size; ) {
+ iseq_original = rb_iseq_original_iseq((rb_iseq_t *)iseq);
+
+ for (seq = iseq_original; seq < iseq_original + iseq->body->iseq_size; ) {
VALUE insn = *seq++;
int j, len = insn_len(insn);
VALUE *nseq = seq + len - 1;
@@ -1763,7 +1901,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
for (j=0; j<len-1; j++, seq++) {
switch (insn_op_type(insn, j)) {
case TS_OFFSET: {
- unsigned long idx = nseq - iseq->iseq + *seq;
+ unsigned long idx = nseq - iseq_original + *seq;
rb_ary_push(ary, register_label(labels_table, idx));
break;
}
@@ -1776,9 +1914,9 @@ iseq_data_to_ary(rb_iseq_t *iseq)
break;
case TS_ISEQ:
{
- rb_iseq_t *iseq = (rb_iseq_t *)*seq;
+ const rb_iseq_t *iseq = (rb_iseq_t *)*seq;
if (iseq) {
- VALUE val = iseq_data_to_ary(iseq);
+ VALUE val = iseq_data_to_ary(rb_iseq_check(iseq));
rb_ary_push(ary, val);
}
else {
@@ -1795,20 +1933,38 @@ iseq_data_to_ary(rb_iseq_t *iseq)
case TS_IC:
{
union iseq_inline_storage_entry *is = (union iseq_inline_storage_entry *)*seq;
- rb_ary_push(ary, INT2FIX(is - iseq->is_entries));
+ rb_ary_push(ary, INT2FIX(is - iseq->body->is_entries));
}
break;
case TS_CALLINFO:
{
- rb_call_info_t *ci = (rb_call_info_t *)*seq;
+ struct rb_call_info *ci = (struct rb_call_info *)*seq;
VALUE e = rb_hash_new();
+ int orig_argc = ci->orig_argc;
+
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_hash_aset(e, ID2SYM(rb_intern("flag")), UINT2NUM(ci->flag));
+
+ if (ci->flag & VM_CALL_KWARG) {
+ struct rb_call_info_with_kwarg *ci_kw = (struct rb_call_info_with_kwarg *)ci;
+ int i;
+ VALUE kw = rb_ary_new2((long)ci_kw->kw_arg->keyword_len);
+
+ orig_argc -= ci_kw->kw_arg->keyword_len;
+ for (i = 0; i < ci_kw->kw_arg->keyword_len; i++) {
+ rb_ary_push(kw, ci_kw->kw_arg->keywords[i]);
+ }
+ rb_hash_aset(e, ID2SYM(rb_intern("kw_arg")), kw);
+ }
+
+ rb_hash_aset(e, ID2SYM(rb_intern("orig_argc")),
+ INT2FIX(orig_argc));
rb_ary_push(ary, e);
}
break;
+ case TS_CALLCACHE:
+ rb_ary_push(ary, Qfalse);
+ break;
case TS_ID:
rb_ary_push(ary, ID2SYM(*seq));
break;
@@ -1822,7 +1978,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
for (i=0; i<RARRAY_LEN(val); i+=2) {
VALUE pos = FIX2INT(rb_ary_entry(val, i+1));
- unsigned long idx = nseq - iseq->iseq + pos;
+ unsigned long idx = nseq - iseq_original + pos;
rb_ary_store(val, i+1,
register_label(labels_table, idx));
@@ -1830,6 +1986,16 @@ iseq_data_to_ary(rb_iseq_t *iseq)
rb_ary_push(ary, val);
}
break;
+ case TS_FUNCPTR:
+ {
+#if SIZEOF_VALUE <= SIZEOF_LONG
+ VALUE val = LONG2NUM((SIGNED_VALUE)*seq);
+#else
+ VALUE val = LL2NUM((SIGNED_VALUE)*seq);
+#endif
+ rb_ary_push(ary, val);
+ }
+ break;
default:
rb_bug("unknown operand: %c", insn_op_type(insn, j));
}
@@ -1840,14 +2006,12 @@ iseq_data_to_ary(rb_iseq_t *iseq)
nbody = body;
/* exception */
- for (i=0; i<iseq->catch_table_size; i++) {
+ if (iseq->body->catch_table) for (i=0; i<iseq->body->catch_table->size; i++) {
VALUE ary = rb_ary_new();
- struct iseq_catch_table_entry *entry = &iseq->catch_table[i];
+ const struct iseq_catch_table_entry *entry = &iseq->body->catch_table->entries[i];
rb_ary_push(ary, exception_type2symbol(entry->type));
if (entry->iseq) {
- rb_iseq_t *eiseq;
- GetISeqPtr(entry->iseq, eiseq);
- rb_ary_push(ary, iseq_data_to_ary(eiseq));
+ rb_ary_push(ary, iseq_data_to_ary(rb_iseq_check(entry->iseq)));
}
else {
rb_ary_push(ary, Qnil);
@@ -1855,7 +2019,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
rb_ary_push(ary, register_label(labels_table, entry->start));
rb_ary_push(ary, register_label(labels_table, entry->end));
rb_ary_push(ary, register_label(labels_table, entry->cont));
- rb_ary_push(ary, INT2FIX(entry->sp));
+ rb_ary_push(ary, UINT2NUM(entry->sp));
rb_ary_push(exception, ary);
}
@@ -1863,16 +2027,16 @@ iseq_data_to_ary(rb_iseq_t *iseq)
body = rb_ary_new();
ti = 0;
- for (i=0, pos=0; i<RARRAY_LEN(nbody); i++) {
- VALUE ary = RARRAY_AREF(nbody, i);
+ for (l=0, pos=0; l<RARRAY_LEN(nbody); l++) {
+ VALUE ary = RARRAY_AREF(nbody, l);
st_data_t label;
if (st_lookup(labels_table, pos, &label)) {
rb_ary_push(body, (VALUE)label);
}
- if (ti < iseq->line_info_size && iseq->line_info_table[ti].position == pos) {
- line = iseq->line_info_table[ti].line_no;
+ if (ti < iseq->body->line_info_size && iseq->body->line_info_table[ti].position == pos) {
+ line = iseq->body->line_info_table[ti].line_no;
rb_ary_push(body, INT2FIX(line));
ti++;
}
@@ -1880,12 +2044,13 @@ iseq_data_to_ary(rb_iseq_t *iseq)
rb_ary_push(body, ary);
pos += RARRAY_LENINT(ary); /* reject too huge data */
}
+ RB_GC_GUARD(nbody);
st_free_table(labels_table);
- rb_hash_aset(misc, ID2SYM(rb_intern("arg_size")), INT2FIX(iseq->arg_size));
- 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));
+ rb_hash_aset(misc, ID2SYM(rb_intern("arg_size")), INT2FIX(iseq->body->param.size));
+ rb_hash_aset(misc, ID2SYM(rb_intern("local_size")), INT2FIX(iseq->body->local_size));
+ rb_hash_aset(misc, ID2SYM(rb_intern("stack_max")), INT2FIX(iseq->body->stack_max));
/* TODO: compatibility issue */
/*
@@ -1898,57 +2063,26 @@ 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->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, iseq->body->location.label);
+ rb_ary_push(val, iseq->body->location.path);
+ rb_ary_push(val, iseq->body->location.absolute_path);
+ rb_ary_push(val, iseq->body->location.first_lineno);
rb_ary_push(val, type);
rb_ary_push(val, locals);
- rb_ary_push(val, args);
+ rb_ary_push(val, params);
rb_ary_push(val, exception);
rb_ary_push(val, body);
return val;
}
VALUE
-rb_iseq_clone(VALUE iseqval, VALUE newcbase)
-{
- VALUE newiseq = iseq_alloc(rb_cISeq);
- rb_iseq_t *iseq0, *iseq1;
-
- GetISeqPtr(iseqval, iseq0);
- GetISeqPtr(newiseq, iseq1);
-
- MEMCPY(iseq1, iseq0, rb_iseq_t, 1); /* TODO: write barrier? */
-
- iseq1->self = newiseq;
- if (!iseq1->orig) {
- RB_OBJ_WRITE(iseq1->self, &iseq1->orig, iseqval);
- }
- if (iseq0->local_iseq == iseq0) {
- iseq1->local_iseq = iseq1;
- }
- if (newcbase) {
- ISEQ_SET_CREF(iseq1, NEW_CREF(newcbase));
- RB_OBJ_WRITE(iseq1->cref_stack, &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) {
- RB_OBJ_WRITE(iseq1->cref_stack, &iseq1->cref_stack->nd_next, iseq0->cref_stack->nd_next);
- }
- RB_OBJ_WRITE(iseq1, &iseq1->klass, newcbase);
- }
-
- return newiseq;
-}
-
-VALUE
rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
{
int i, r;
- VALUE a, args = rb_ary_new2(iseq->arg_size);
+ VALUE a, args = rb_ary_new2(iseq->body->param.size);
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_ID(i) iseq->body->local_table[(i)]
#define PARAM(i, type) ( \
PARAM_TYPE(type), \
rb_id2str(PARAM_ID(i)) ? \
@@ -1958,18 +2092,18 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
CONST_ID(req, "req");
CONST_ID(opt, "opt");
if (is_proc) {
- for (i = 0; i < iseq->argc; i++) {
+ for (i = 0; i < iseq->body->param.lead_num; i++) {
PARAM_TYPE(opt);
rb_ary_push(a, rb_id2str(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
rb_ary_push(args, a);
}
}
else {
- for (i = 0; i < iseq->argc; i++) {
+ for (i = 0; i < iseq->body->param.lead_num; i++) {
rb_ary_push(args, PARAM(i, req));
}
}
- r = iseq->argc + iseq->arg_opts - 1;
+ r = iseq->body->param.lead_num + iseq->body->param.opt_num;
for (; i < r; i++) {
PARAM_TYPE(opt);
if (rb_id2str(PARAM_ID(i))) {
@@ -1977,52 +2111,52 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
}
rb_ary_push(args, a);
}
- if (iseq->arg_rest != -1) {
+ if (iseq->body->param.flags.has_rest) {
CONST_ID(rest, "rest");
- rb_ary_push(args, PARAM(iseq->arg_rest, rest));
+ rb_ary_push(args, PARAM(iseq->body->param.rest_start, rest));
}
- r = iseq->arg_post_start + iseq->arg_post_len;
+ r = iseq->body->param.post_start + iseq->body->param.post_num;
if (is_proc) {
- for (i = iseq->arg_post_start; i < r; i++) {
+ for (i = iseq->body->param.post_start; i < r; i++) {
PARAM_TYPE(opt);
rb_ary_push(a, rb_id2str(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
rb_ary_push(args, a);
}
}
else {
- for (i = iseq->arg_post_start; i < r; i++) {
+ for (i = iseq->body->param.post_start; i < r; i++) {
rb_ary_push(args, PARAM(i, req));
}
}
- if (iseq->arg_keyword != -1) {
+ if (iseq->body->param.flags.has_kw) {
i = 0;
- if (iseq->arg_keyword_required) {
+ if (iseq->body->param.keyword->required_num > 0) {
ID keyreq;
CONST_ID(keyreq, "keyreq");
- for (; i < iseq->arg_keyword_required; i++) {
+ for (; i < iseq->body->param.keyword->required_num; i++) {
PARAM_TYPE(keyreq);
- if (rb_id2str(iseq->arg_keyword_table[i])) {
- rb_ary_push(a, ID2SYM(iseq->arg_keyword_table[i]));
+ if (rb_id2str(iseq->body->param.keyword->table[i])) {
+ rb_ary_push(a, ID2SYM(iseq->body->param.keyword->table[i]));
}
rb_ary_push(args, a);
}
}
CONST_ID(key, "key");
- for (; i < iseq->arg_keywords; i++) {
+ for (; i < iseq->body->param.keyword->num; i++) {
PARAM_TYPE(key);
- if (rb_id2str(iseq->arg_keyword_table[i])) {
- rb_ary_push(a, ID2SYM(iseq->arg_keyword_table[i]));
+ if (rb_id2str(iseq->body->param.keyword->table[i])) {
+ rb_ary_push(a, ID2SYM(iseq->body->param.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) {
+ if (iseq->body->param.flags.has_kwrest) {
+ CONST_ID(keyrest, "keyrest");
+ rb_ary_push(args, PARAM(iseq->body->param.keyword->rest_start, keyrest));
+ }
+ if (iseq->body->param.flags.has_block) {
CONST_ID(block, "block");
- rb_ary_push(args, PARAM(iseq->arg_block, block));
+ rb_ary_push(args, PARAM(iseq->body->param.block_start, block));
}
return args;
}
@@ -2059,88 +2193,36 @@ rb_iseq_defined_string(enum defined_type type)
}
str = defs[type-1];
if (!str) {
- str = rb_str_new_cstr(estr);;
+ str = rb_str_new_cstr(estr);
OBJ_FREEZE(str);
defs[type-1] = str;
+ rb_gc_register_mark_object(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_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 *path,
- const unsigned short first_lineno)
-{
- unsigned long i;
- VALUE iseqval = iseq_alloc(rb_cISeq);
- rb_iseq_t *iseq;
- GetISeqPtr(iseqval, iseq);
-
- /* copy iseq */
- MEMCPY(iseq, iseq_template, rb_iseq_t, 1); /* TODO: write barrier, *iseq = *iseq_template; */
- RB_OBJ_WRITE(iseq->self, &iseq->location.label, rb_str_new2(name));
- RB_OBJ_WRITE(iseq->self, &iseq->location.path, rb_str_new2(path));
- iseq->location.first_lineno = first_lineno;
- RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
- iseq->self = iseqval;
-
- iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
-
- for (i=0; i<iseq->iseq_size; i+=2) {
- iseq->iseq[i] = BIN(opt_call_c_function);
- iseq->iseq[i+1] = (VALUE)func;
- }
-
- rb_iseq_translate_threaded_code(iseq);
-
-#define ALLOC_AND_COPY(dst, src, type, size) do { \
- if (size) { \
- (dst) = ALLOC_N(type, (size)); \
- MEMCPY((dst), (src), type, (size)); \
- } \
-} while (0)
-
- 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);
-
- ALLOC_AND_COPY(iseq->arg_opt_table, arg_opt_table,
- VALUE, iseq->arg_opts);
-
- set_relation(iseq, 0);
-
- 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)
+rb_iseqw_line_trace_each(VALUE iseqw, 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;
+ unsigned int pos;
+ size_t insn;
+ const rb_iseq_t *iseq = iseqw_check(iseqw);
int cont = 1;
- GetISeqPtr(iseqval, iseq);
+ VALUE *iseq_original;
- for (pos = 0; cont && pos < iseq->iseq_size; pos += insn_len(insn)) {
- insn = iseq->iseq[pos];
+ iseq_original = rb_iseq_original_iseq(iseq);
+ for (pos = 0; cont && pos < iseq->body->iseq_size; pos += insn_len(insn)) {
+ insn = iseq_original[pos];
if (insn == BIN(trace)) {
- rb_event_flag_t current_events = (VALUE)iseq->iseq[pos+1];
+ rb_event_flag_t current_events;
+
+ current_events = (rb_event_flag_t)iseq_original[pos+1];
if (current_events & RUBY_EVENT_LINE) {
rb_event_flag_t events = current_events & RUBY_EVENT_SPECIFIED_LINE;
@@ -2151,7 +2233,8 @@ rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *ev
/* printf("line: %d\n", line); */
cont = (*func)(line, &events, data);
if (current_events != events) {
- iseq->iseq[pos+1] = iseq->iseq_encoded[pos+1] =
+ VALUE *encoded = (VALUE *)iseq->body->iseq_encoded;
+ iseq_original[pos+1] = encoded[pos+1] =
(VALUE)(current_events | (events & RUBY_EVENT_SPECIFIED_LINE));
}
}
@@ -2175,10 +2258,10 @@ collect_trace(int line, rb_event_flag_t *events_ptr, void *ptr)
* Returns all +specified_line+ events.
*/
VALUE
-rb_iseq_line_trace_all(VALUE iseqval)
+rb_iseqw_line_trace_all(VALUE iseqw)
{
VALUE result = rb_ary_new();
- rb_iseq_line_trace_each(iseqval, collect_trace, (void *)result);
+ rb_iseqw_line_trace_each(iseqw, collect_trace, (void *)result);
return result;
}
@@ -2222,7 +2305,7 @@ line_trace_specify(int line, rb_event_flag_t *events_ptr, void *ptr)
* If +pos+ is a negative integer a TypeError exception is raised.
*/
VALUE
-rb_iseq_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set)
+rb_iseqw_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set)
{
struct set_specifc_data data;
@@ -2237,7 +2320,7 @@ rb_iseq_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set)
rb_raise(rb_eTypeError, "`set' should be true/false");
}
- rb_iseq_line_trace_each(iseqval, line_trace_specify, (void *)&data);
+ rb_iseqw_line_trace_each(iseqval, line_trace_specify, (void *)&data);
if (data.prev == 0) {
rb_raise(rb_eTypeError, "`pos' is out of range.");
@@ -2245,6 +2328,68 @@ rb_iseq_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set)
return data.prev == 1 ? Qtrue : Qfalse;
}
+VALUE
+rb_iseqw_local_variables(VALUE iseqval)
+{
+ return rb_iseq_local_variables(iseqw_check(iseqval));
+}
+
+/*
+ * call-seq:
+ * iseq.to_binary(extra_data = nil) -> binary str
+ *
+ * Returns serialized iseq binary format data as a String object.
+ * A corresponding iseq object is created by
+ * RubyVM::InstructionSequence.load_from_binary() method.
+ *
+ * String extra_data will be saved with binary data.
+ * You can access this data with
+ * RubyVM::InstructionSequence.load_from_binary_extra_data(binary).
+ *
+ * Note that the translated binary data is not portable.
+ * You can not move this binary data to another machine.
+ * You can not use the binary data which is created by another
+ * version/another architecture of Ruby.
+ */
+static VALUE
+iseqw_to_binary(int argc, VALUE *argv, VALUE self)
+{
+ VALUE opt;
+ rb_scan_args(argc, argv, "01", &opt);
+ return iseq_ibf_dump(iseqw_check(self), opt);
+}
+
+/*
+ * call-seq:
+ * RubyVM::InstructionSequence.load_from_binary(binary) -> iseq
+ *
+ * Load an iseq object from binary format String object
+ * created by RubyVM::InstructionSequence.to_binary.
+ *
+ * This loader does not have a verifier, so that loading broken/modified
+ * binary causes critical problem.
+ *
+ * You should not load binary data provided by others.
+ * You should use binary data translated by yourself.
+ */
+static VALUE
+iseqw_s_load_from_binary(VALUE self, VALUE str)
+{
+ return iseqw_new(iseq_ibf_load(str));
+}
+
+/*
+ * call-seq:
+ * RubyVM::InstructionSequence.load_from_binary_extra_data(binary) -> str
+ *
+ * Load extra data embed into binary format String object.
+ */
+static VALUE
+iseqw_s_load_from_binary_extra_data(VALUE self, VALUE str)
+{
+ return iseq_ibf_load_extra_data(str);
+}
+
/*
* Document-class: RubyVM::InstructionSequence
*
@@ -2270,45 +2415,48 @@ Init_ISeq(void)
{
/* 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);
- rb_define_method(rb_cISeq, "disasm", rb_iseq_disasm, 0);
- rb_define_method(rb_cISeq, "disassemble", rb_iseq_disasm, 0);
- rb_define_method(rb_cISeq, "to_a", iseq_to_a, 0);
- rb_define_method(rb_cISeq, "eval", iseq_eval, 0);
+ rb_define_method(rb_cISeq, "inspect", iseqw_inspect, 0);
+ rb_define_method(rb_cISeq, "disasm", iseqw_disasm, 0);
+ rb_define_method(rb_cISeq, "disassemble", iseqw_disasm, 0);
+ rb_define_method(rb_cISeq, "to_a", iseqw_to_a, 0);
+ rb_define_method(rb_cISeq, "eval", iseqw_eval, 0);
+
+ rb_define_method(rb_cISeq, "to_binary", iseqw_to_binary, -1);
+ rb_define_singleton_method(rb_cISeq, "load_from_binary", iseqw_s_load_from_binary, 1);
+ rb_define_singleton_method(rb_cISeq, "load_from_binary_extra_data", iseqw_s_load_from_binary_extra_data, 1);
+
/* location APIs */
- rb_define_method(rb_cISeq, "path", rb_iseq_path, 0);
- rb_define_method(rb_cISeq, "absolute_path", rb_iseq_absolute_path, 0);
- rb_define_method(rb_cISeq, "label", rb_iseq_label, 0);
- rb_define_method(rb_cISeq, "base_label", rb_iseq_base_label, 0);
- rb_define_method(rb_cISeq, "first_lineno", rb_iseq_first_lineno, 0);
+ rb_define_method(rb_cISeq, "path", iseqw_path, 0);
+ rb_define_method(rb_cISeq, "absolute_path", iseqw_absolute_path, 0);
+ rb_define_method(rb_cISeq, "label", iseqw_label, 0);
+ rb_define_method(rb_cISeq, "base_label", iseqw_base_label, 0);
+ rb_define_method(rb_cISeq, "first_lineno", iseqw_first_lineno, 0);
#if 0
/* Now, it is experimental. No discussions, no tests. */
/* They can be used from C level. Please give us feedback. */
- 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);
+ rb_define_method(rb_cISeq, "line_trace_all", rb_iseqw_line_trace_all, 0);
+ rb_define_method(rb_cISeq, "line_trace_specify", rb_iseqw_line_trace_specify, 2);
#else
- (void)rb_iseq_line_trace_all;
- (void)rb_iseq_line_trace_specify;
+ (void)rb_iseqw_line_trace_all;
+ (void)rb_iseqw_line_trace_specify;
#endif
#if 0 /* TBD */
- 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
-
+ rb_define_private_method(rb_cISeq, "marshal_dump", iseqw_marshal_dump, 0);
+ rb_define_private_method(rb_cISeq, "marshal_load", iseqw_marshal_load, 1);
/* disable this feature because there is no verifier. */
- /* rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1); */
+ rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1);
+#endif
(void)iseq_s_load;
- rb_define_singleton_method(rb_cISeq, "compile", iseq_s_compile, -1);
- rb_define_singleton_method(rb_cISeq, "new", iseq_s_compile, -1);
- rb_define_singleton_method(rb_cISeq, "compile_file", iseq_s_compile_file, -1);
- rb_define_singleton_method(rb_cISeq, "compile_option", iseq_s_compile_option_get, 0);
- 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);
+ rb_define_singleton_method(rb_cISeq, "compile", iseqw_s_compile, -1);
+ rb_define_singleton_method(rb_cISeq, "new", iseqw_s_compile, -1);
+ rb_define_singleton_method(rb_cISeq, "compile_file", iseqw_s_compile_file, -1);
+ rb_define_singleton_method(rb_cISeq, "compile_option", iseqw_s_compile_option_get, 0);
+ rb_define_singleton_method(rb_cISeq, "compile_option=", iseqw_s_compile_option_set, 1);
+ rb_define_singleton_method(rb_cISeq, "disasm", iseqw_s_disasm, 1);
+ rb_define_singleton_method(rb_cISeq, "disassemble", iseqw_s_disasm, 1);
+ rb_define_singleton_method(rb_cISeq, "of", iseqw_s_of, 1);
}
diff --git a/iseq.h b/iseq.h
index 5487d86f7b..b316ea41b9 100644
--- a/iseq.h
+++ b/iseq.h
@@ -9,31 +9,118 @@
**********************************************************************/
-#ifndef RUBY_COMPILE_H
-#define RUBY_COMPILE_H
+#ifndef RUBY_ISEQ_H
+#define RUBY_ISEQ_H 1
+
+#define ISEQ_MAJOR_VERSION 2
+#define ISEQ_MINOR_VERSION 3
+
+#ifndef rb_iseq_t
+typedef struct rb_iseq_struct rb_iseq_t;
+#define rb_iseq_t rb_iseq_t
+#endif
+
+static inline size_t
+rb_call_info_kw_arg_bytes(int keyword_len)
+{
+ return sizeof(struct rb_call_info_kw_arg) + sizeof(VALUE) * (keyword_len - 1);
+}
+
+enum iseq_mark_ary_index {
+ ISEQ_MARK_ARY_COVERAGE = 0,
+ ISEQ_MARK_ARY_FLIP_CNT = 1,
+ ISEQ_MARK_ARY_ORIGINAL_ISEQ = 2,
+};
+
+static inline VALUE
+iseq_mark_ary_create(int flip_cnt)
+{
+ VALUE ary = rb_ary_tmp_new(3);
+ rb_ary_push(ary, Qnil); /* ISEQ_MARK_ARY_COVERAGE */
+ rb_ary_push(ary, INT2FIX(flip_cnt)); /* ISEQ_MARK_ARY_FLIP_CNT */
+ rb_ary_push(ary, Qnil); /* ISEQ_MARK_ARY_ORIGINAL_ISEQ */
+ return ary;
+}
+
+#define ISEQ_MARK_ARY(iseq) (iseq)->body->mark_ary
+
+#define ISEQ_COVERAGE(iseq) RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE)
+#define ISEQ_COVERAGE_SET(iseq, cov) RARRAY_ASET(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_COVERAGE, cov)
+
+#define ISEQ_FLIP_CNT(iseq) FIX2INT(RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_FLIP_CNT))
+
+static inline int
+ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq)
+{
+ int cnt = ISEQ_FLIP_CNT(iseq);
+ RARRAY_ASET(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_FLIP_CNT, INT2FIX(cnt+1));
+ return cnt;
+}
+
+static inline VALUE *
+ISEQ_ORIGINAL_ISEQ(const rb_iseq_t *iseq)
+{
+ VALUE str = RARRAY_AREF(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_ORIGINAL_ISEQ);
+ if (RTEST(str)) return (VALUE *)RSTRING_PTR(str);
+ return NULL;
+}
+
+static inline VALUE *
+ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size)
+{
+ VALUE str = rb_str_tmp_new(size * sizeof(VALUE));
+ RARRAY_ASET(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_ORIGINAL_ISEQ, str);
+ return (VALUE *)RSTRING_PTR(str);
+}
+
+#define ISEQ_COMPILE_DATA(iseq) (iseq)->aux.compile_data
+
+static inline rb_iseq_t *
+iseq_imemo_alloc(void)
+{
+ return (rb_iseq_t *)rb_imemo_new(imemo_iseq, 0, 0, 0, 0);
+}
+
+#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1
+
+VALUE iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt);
+void ibf_load_iseq_complete(rb_iseq_t *iseq);
+const rb_iseq_t *iseq_ibf_load(VALUE str);
+VALUE iseq_ibf_load_extra_data(VALUE str);
RUBY_SYMBOL_EXPORT_BEGIN
/* compile.c */
-VALUE rb_iseq_compile_node(VALUE self, NODE *node);
+VALUE rb_iseq_compile_node(rb_iseq_t *iseq, NODE *node);
int rb_iseq_translate_threaded_code(rb_iseq_t *iseq);
-VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
- VALUE exception, VALUE body);
+VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq);
+void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
+ VALUE locals, VALUE args,
+ VALUE exception, VALUE body);
/* iseq.c */
-void rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj);
+void rb_iseq_add_mark_object(const rb_iseq_t *iseq, VALUE obj);
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);
+int rb_iseqw_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data);
+VALUE rb_iseqw_line_trace_all(VALUE iseqval);
+VALUE rb_iseqw_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set);
+VALUE rb_iseqw_new(const rb_iseq_t *iseq);
+const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
+
+VALUE rb_iseq_path(const rb_iseq_t *iseq);
+VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq);
+VALUE rb_iseq_label(const rb_iseq_t *iseq);
+VALUE rb_iseq_base_label(const rb_iseq_t *iseq);
+VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq);
+VALUE rb_iseq_method_name(const rb_iseq_t *iseq);
/* proc.c */
-rb_iseq_t *rb_method_get_iseq(VALUE body);
-rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
+const rb_iseq_t *rb_method_iseq(VALUE body);
+const rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
struct rb_compile_option_struct {
int inline_const_cache;
@@ -44,6 +131,8 @@ struct rb_compile_option_struct {
int instructions_unification;
int stack_caching;
int trace_instruction;
+ int frozen_string_literal;
+ int debug_frozen_string_literal;
int debug_level;
};
@@ -61,22 +150,42 @@ struct iseq_catch_table_entry {
CATCH_TYPE_REDO = INT2FIX(5),
CATCH_TYPE_NEXT = INT2FIX(6)
} type;
- VALUE iseq;
- unsigned long start;
- unsigned long end;
- unsigned long cont;
- unsigned long sp;
+ const rb_iseq_t *iseq;
+ unsigned int start;
+ unsigned int end;
+ unsigned int cont;
+ unsigned int sp;
};
+PACKED_STRUCT_UNALIGNED(struct iseq_catch_table {
+ unsigned int size;
+ struct iseq_catch_table_entry entries[1]; /* flexible array */
+});
+
+static inline int
+iseq_catch_table_bytes(int n)
+{
+ enum {
+ catch_table_entries_max = (INT_MAX - sizeof(struct iseq_catch_table)) / sizeof(struct iseq_catch_table_entry)
+ };
+ if (n > catch_table_entries_max) rb_fatal("too large iseq_catch_table - %d", n);
+ return (int)(sizeof(struct iseq_catch_table) +
+ (n - 1) * sizeof(struct iseq_catch_table_entry));
+}
+
#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
struct iseq_compile_data_storage {
struct iseq_compile_data_storage *next;
- unsigned long pos;
- unsigned long size;
- char *buff;
+ unsigned int pos;
+ unsigned int size;
+ char buff[1]; /* flexible array */
};
+/* account for flexible array */
+#define SIZEOF_ISEQ_COMPILE_DATA_STORAGE \
+ (sizeof(struct iseq_compile_data_storage) - 1)
+
struct iseq_compile_data {
/* GC is needed */
const VALUE err_info;
@@ -87,7 +196,7 @@ struct iseq_compile_data {
struct iseq_label_data *start_label;
struct iseq_label_data *end_label;
struct iseq_label_data *redo_label;
- VALUE current_block;
+ const rb_iseq_t *current_block;
VALUE ensure_node;
VALUE for_iseq;
struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
@@ -99,6 +208,8 @@ struct iseq_compile_data {
int last_coverable_line;
int label_no;
int node_level;
+ unsigned int ci_index;
+ unsigned int ci_kw_index;
const rb_compile_option_t *option;
#if SUPPORT_JOKE
st_table *labels_table;
@@ -128,9 +239,11 @@ enum defined_type {
};
VALUE rb_iseq_defined_string(enum defined_type type);
+void rb_iseq_make_compile_option(struct rb_compile_option_struct *option, VALUE opt);
-#define DEFAULT_SPECIAL_VAR_COUNT 2
+/* vm.c */
+VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
RUBY_SYMBOL_EXPORT_END
-#endif /* RUBY_COMPILE_H */
+#endif /* RUBY_ISEQ_H */
diff --git a/lex.c.blt b/lex.c.blt
index 1ae80990b9..7d8dd5b6e7 100644
--- a/lex.c.blt
+++ b/lex.c.blt
@@ -1,5 +1,5 @@
/* C code produced by gperf version 3.0.4 */
-/* Command-line: gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' defs/keywords */
+/* Command-line: gperf -C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' defs/keywords */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -30,7 +30,7 @@ error "gperf generated tables don't work with this execution character set. Plea
#line 1 "defs/keywords"
-struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
+struct kwtable {int name, id[2], state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
static const struct kwtable *reserved_word(const char *, unsigned int);
@@ -45,12 +45,10 @@ struct kwtable;
#define MAX_HASH_VALUE 50
/* maximum key range = 43, duplicates = 0 */
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__)
inline
-#endif
+#elif defined(__GNUC__)
+__inline
#endif
static unsigned int
hash (str, len)
@@ -101,6 +99,95 @@ hash (str, len)
return hval + asso_values[(unsigned char)str[len - 1]];
}
+struct stringpool_t
+ {
+ char stringpool_str8[sizeof("break")];
+ char stringpool_str9[sizeof("else")];
+ char stringpool_str10[sizeof("nil")];
+ char stringpool_str11[sizeof("ensure")];
+ char stringpool_str12[sizeof("end")];
+ char stringpool_str13[sizeof("then")];
+ char stringpool_str14[sizeof("not")];
+ char stringpool_str15[sizeof("false")];
+ char stringpool_str16[sizeof("self")];
+ char stringpool_str17[sizeof("elsif")];
+ char stringpool_str18[sizeof("rescue")];
+ char stringpool_str19[sizeof("true")];
+ char stringpool_str20[sizeof("until")];
+ char stringpool_str21[sizeof("unless")];
+ char stringpool_str22[sizeof("return")];
+ char stringpool_str23[sizeof("def")];
+ char stringpool_str24[sizeof("and")];
+ char stringpool_str25[sizeof("do")];
+ char stringpool_str26[sizeof("yield")];
+ char stringpool_str27[sizeof("for")];
+ char stringpool_str28[sizeof("undef")];
+ char stringpool_str29[sizeof("or")];
+ char stringpool_str30[sizeof("in")];
+ char stringpool_str31[sizeof("when")];
+ char stringpool_str32[sizeof("retry")];
+ char stringpool_str33[sizeof("if")];
+ char stringpool_str34[sizeof("case")];
+ char stringpool_str35[sizeof("redo")];
+ char stringpool_str36[sizeof("next")];
+ char stringpool_str37[sizeof("super")];
+ char stringpool_str38[sizeof("module")];
+ char stringpool_str39[sizeof("begin")];
+ char stringpool_str40[sizeof("__LINE__")];
+ char stringpool_str41[sizeof("__FILE__")];
+ char stringpool_str42[sizeof("__ENCODING__")];
+ char stringpool_str43[sizeof("END")];
+ char stringpool_str44[sizeof("alias")];
+ char stringpool_str45[sizeof("BEGIN")];
+ char stringpool_str46[sizeof("defined?")];
+ char stringpool_str47[sizeof("class")];
+ char stringpool_str50[sizeof("while")];
+ };
+static const struct stringpool_t stringpool_contents =
+ {
+ "break",
+ "else",
+ "nil",
+ "ensure",
+ "end",
+ "then",
+ "not",
+ "false",
+ "self",
+ "elsif",
+ "rescue",
+ "true",
+ "until",
+ "unless",
+ "return",
+ "def",
+ "and",
+ "do",
+ "yield",
+ "for",
+ "undef",
+ "or",
+ "in",
+ "when",
+ "retry",
+ "if",
+ "case",
+ "redo",
+ "next",
+ "super",
+ "module",
+ "begin",
+ "__LINE__",
+ "__FILE__",
+ "__ENCODING__",
+ "END",
+ "alias",
+ "BEGIN",
+ "defined?",
+ "class",
+ "while"
+ };
+#define stringpool ((const char *) &stringpool_contents)
#ifdef __GNUC__
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
@@ -114,90 +201,90 @@ rb_reserved_word (str, len)
{
static const struct kwtable wordlist[] =
{
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 19 "defs/keywords"
- {"break", {keyword_break, keyword_break}, EXPR_MID},
+ {(int)offsetof(struct stringpool_t, stringpool_str8), {keyword_break, keyword_break}, EXPR_MID},
#line 25 "defs/keywords"
- {"else", {keyword_else, keyword_else}, EXPR_BEG},
+ {(int)offsetof(struct stringpool_t, stringpool_str9), {keyword_else, keyword_else}, EXPR_BEG},
#line 35 "defs/keywords"
- {"nil", {keyword_nil, keyword_nil}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str10), {keyword_nil, keyword_nil}, EXPR_END},
#line 28 "defs/keywords"
- {"ensure", {keyword_ensure, keyword_ensure}, EXPR_BEG},
+ {(int)offsetof(struct stringpool_t, stringpool_str11), {keyword_ensure, keyword_ensure}, EXPR_BEG},
#line 27 "defs/keywords"
- {"end", {keyword_end, keyword_end}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str12), {keyword_end, keyword_end}, EXPR_END},
#line 44 "defs/keywords"
- {"then", {keyword_then, keyword_then}, EXPR_BEG},
+ {(int)offsetof(struct stringpool_t, stringpool_str13), {keyword_then, keyword_then}, EXPR_BEG},
#line 36 "defs/keywords"
- {"not", {keyword_not, keyword_not}, EXPR_ARG},
+ {(int)offsetof(struct stringpool_t, stringpool_str14), {keyword_not, keyword_not}, EXPR_ARG},
#line 29 "defs/keywords"
- {"false", {keyword_false, keyword_false}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str15), {keyword_false, keyword_false}, EXPR_END},
#line 42 "defs/keywords"
- {"self", {keyword_self, keyword_self}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str16), {keyword_self, keyword_self}, EXPR_END},
#line 26 "defs/keywords"
- {"elsif", {keyword_elsif, keyword_elsif}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str17), {keyword_elsif, keyword_elsif}, EXPR_VALUE},
#line 39 "defs/keywords"
- {"rescue", {keyword_rescue, modifier_rescue}, EXPR_MID},
+ {(int)offsetof(struct stringpool_t, stringpool_str18), {keyword_rescue, modifier_rescue}, EXPR_MID},
#line 45 "defs/keywords"
- {"true", {keyword_true, keyword_true}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str19), {keyword_true, keyword_true}, EXPR_END},
#line 48 "defs/keywords"
- {"until", {keyword_until, modifier_until}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str20), {keyword_until, modifier_until}, EXPR_VALUE},
#line 47 "defs/keywords"
- {"unless", {keyword_unless, modifier_unless}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str21), {keyword_unless, modifier_unless}, EXPR_VALUE},
#line 41 "defs/keywords"
- {"return", {keyword_return, keyword_return}, EXPR_MID},
+ {(int)offsetof(struct stringpool_t, stringpool_str22), {keyword_return, keyword_return}, EXPR_MID},
#line 22 "defs/keywords"
- {"def", {keyword_def, keyword_def}, EXPR_FNAME},
+ {(int)offsetof(struct stringpool_t, stringpool_str23), {keyword_def, keyword_def}, EXPR_FNAME},
#line 17 "defs/keywords"
- {"and", {keyword_and, keyword_and}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str24), {keyword_and, keyword_and}, EXPR_VALUE},
#line 24 "defs/keywords"
- {"do", {keyword_do, keyword_do}, EXPR_BEG},
+ {(int)offsetof(struct stringpool_t, stringpool_str25), {keyword_do, keyword_do}, EXPR_BEG},
#line 51 "defs/keywords"
- {"yield", {keyword_yield, keyword_yield}, EXPR_ARG},
+ {(int)offsetof(struct stringpool_t, stringpool_str26), {keyword_yield, keyword_yield}, EXPR_ARG},
#line 30 "defs/keywords"
- {"for", {keyword_for, keyword_for}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str27), {keyword_for, keyword_for}, EXPR_VALUE},
#line 46 "defs/keywords"
- {"undef", {keyword_undef, keyword_undef}, EXPR_FNAME},
+ {(int)offsetof(struct stringpool_t, stringpool_str28), {keyword_undef, keyword_undef}, EXPR_FNAME|EXPR_FITEM},
#line 37 "defs/keywords"
- {"or", {keyword_or, keyword_or}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str29), {keyword_or, keyword_or}, EXPR_VALUE},
#line 32 "defs/keywords"
- {"in", {keyword_in, keyword_in}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str30), {keyword_in, keyword_in}, EXPR_VALUE},
#line 49 "defs/keywords"
- {"when", {keyword_when, keyword_when}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str31), {keyword_when, keyword_when}, EXPR_VALUE},
#line 40 "defs/keywords"
- {"retry", {keyword_retry, keyword_retry}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str32), {keyword_retry, keyword_retry}, EXPR_END},
#line 31 "defs/keywords"
- {"if", {keyword_if, modifier_if}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str33), {keyword_if, modifier_if}, EXPR_VALUE},
#line 20 "defs/keywords"
- {"case", {keyword_case, keyword_case}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str34), {keyword_case, keyword_case}, EXPR_VALUE},
#line 38 "defs/keywords"
- {"redo", {keyword_redo, keyword_redo}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str35), {keyword_redo, keyword_redo}, EXPR_END},
#line 34 "defs/keywords"
- {"next", {keyword_next, keyword_next}, EXPR_MID},
+ {(int)offsetof(struct stringpool_t, stringpool_str36), {keyword_next, keyword_next}, EXPR_MID},
#line 43 "defs/keywords"
- {"super", {keyword_super, keyword_super}, EXPR_ARG},
+ {(int)offsetof(struct stringpool_t, stringpool_str37), {keyword_super, keyword_super}, EXPR_ARG},
#line 33 "defs/keywords"
- {"module", {keyword_module, keyword_module}, EXPR_VALUE},
+ {(int)offsetof(struct stringpool_t, stringpool_str38), {keyword_module, keyword_module}, EXPR_VALUE},
#line 18 "defs/keywords"
- {"begin", {keyword_begin, keyword_begin}, EXPR_BEG},
+ {(int)offsetof(struct stringpool_t, stringpool_str39), {keyword_begin, keyword_begin}, EXPR_BEG},
#line 12 "defs/keywords"
- {"__LINE__", {keyword__LINE__, keyword__LINE__}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str40), {keyword__LINE__, keyword__LINE__}, EXPR_END},
#line 13 "defs/keywords"
- {"__FILE__", {keyword__FILE__, keyword__FILE__}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str41), {keyword__FILE__, keyword__FILE__}, EXPR_END},
#line 11 "defs/keywords"
- {"__ENCODING__", {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str42), {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
#line 15 "defs/keywords"
- {"END", {keyword_END, keyword_END}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str43), {keyword_END, keyword_END}, EXPR_END},
#line 16 "defs/keywords"
- {"alias", {keyword_alias, keyword_alias}, EXPR_FNAME},
+ {(int)offsetof(struct stringpool_t, stringpool_str44), {keyword_alias, keyword_alias}, EXPR_FNAME|EXPR_FITEM},
#line 14 "defs/keywords"
- {"BEGIN", {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
+ {(int)offsetof(struct stringpool_t, stringpool_str45), {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
#line 23 "defs/keywords"
- {"defined?", {keyword_defined, keyword_defined}, EXPR_ARG},
+ {(int)offsetof(struct stringpool_t, stringpool_str46), {keyword_defined, keyword_defined}, EXPR_ARG},
#line 21 "defs/keywords"
- {"class", {keyword_class, keyword_class}, EXPR_CLASS},
- {""}, {""},
+ {(int)offsetof(struct stringpool_t, stringpool_str47), {keyword_class, keyword_class}, EXPR_CLASS},
+ {-1}, {-1},
#line 50 "defs/keywords"
- {"while", {keyword_while, modifier_while}, EXPR_VALUE}
+ {(int)offsetof(struct stringpool_t, stringpool_str50), {keyword_while, modifier_while}, EXPR_VALUE}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -206,10 +293,14 @@ rb_reserved_word (str, len)
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ register int o = wordlist[key].name;
+ if (o >= 0)
+ {
+ register const char *s = o + stringpool;
- if (*str == *s && !strcmp (str + 1, s + 1))
- return &wordlist[key];
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &wordlist[key];
+ }
}
}
return 0;
diff --git a/lib/English.rb b/lib/English.rb
index 32769fb18b..0c17229682 100644
--- a/lib/English.rb
+++ b/lib/English.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# Include the English library file in a Ruby script, and you can
# reference the global variables such as \VAR{\$\_} using less
# cryptic names, listed in the following table.% \vref{tab:english}.
@@ -6,7 +7,7 @@
#
# $\ = ' -- '
# "waterbuffalo" =~ /buff/
-# print $", $', $$, "\n"
+# print $', $$, "\n"
#
# With English:
#
@@ -14,7 +15,7 @@
#
# $OUTPUT_FIELD_SEPARATOR = ' -- '
# "waterbuffalo" =~ /buff/
-# print $LOADED_FEATURES, $POSTMATCH, $PID, "\n"
+# print $POSTMATCH, $PID, "\n"
#
# Below is a full list of descriptive aliases and their associated global
# variable:
diff --git a/lib/abbrev.rb b/lib/abbrev.rb
index 841f6d980e..2eac293c30 100755..100644
--- a/lib/abbrev.rb
+++ b/lib/abbrev.rb
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+# frozen_string_literal: false
#--
# Copyright (c) 2001,2003 Akinori MUSHA <knu@iDaemons.org>
#
@@ -11,43 +11,46 @@
#++
##
-# Calculates the set of unique abbreviations for a given set of strings.
+# Calculates the set of unambiguous abbreviations for a given set of strings.
#
# require 'abbrev'
# require 'pp'
#
-# pp Abbrev.abbrev(['ruby', 'rules'])
+# pp Abbrev.abbrev(['ruby'])
+# #=> {"ruby"=>"ruby", "rub"=>"ruby", "ru"=>"ruby", "r"=>"ruby"}
#
-# Generates:
+# pp Abbrev.abbrev(%w{ ruby rules })
#
-# { "rub" => "ruby",
-# "ruby" => "ruby",
-# "rul" => "rules",
+# _Generates:_
+# { "ruby" => "ruby",
+# "rub" => "ruby",
+# "rules" => "rules",
# "rule" => "rules",
-# "rules" => "rules" }
+# "rul" => "rules" }
#
# 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"}
+# pp %w{ summer winter }.abbrev
+#
+# _Generates:_
+# { "summer" => "summer",
+# "summe" => "summer",
+# "summ" => "summer",
+# "sum" => "summer",
+# "su" => "summer",
+# "s" => "summer",
+# "winter" => "winter",
+# "winte" => "winter",
+# "wint" => "winter",
+# "win" => "winter",
+# "wi" => "winter",
+# "w" => "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.
+ # 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 +words+ is "car" and "cone", the keys pointing to "car" would
# be "ca" and "car", while those pointing to "cone" would be "co", "con", and
@@ -55,15 +58,18 @@ module Abbrev
#
# require 'abbrev'
#
- # Abbrev.abbrev(['car', 'cone'])
+ # Abbrev.abbrev(%w{ car cone })
# #=> {"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.
+ # 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.
+ #
+ # Abbrev.abbrev(%w{car box cone crab}, /b/)
+ # #=> {"box"=>"box", "bo"=>"box", "b"=>"box", "crab" => "crab"}
#
- # Abbrev.abbrev(%w{car box cone}, /b/)
- # #=> {"bo"=>"box", "b"=>"box", "box"=>"box"}
+ # Abbrev.abbrev(%w{car box cone}, 'ca')
+ # #=> {"car"=>"car", "ca"=>"car"}
def abbrev(words, pattern = nil)
table = {}
seen = Hash.new(0)
@@ -103,34 +109,24 @@ module Abbrev
end
class Array
- # Calculates the set of unambiguous abbreviations for the strings in
- # +self+.
+ # Calculates the set of unambiguous abbreviations for the strings in +self+.
#
# require 'abbrev'
# %w{ car cone }.abbrev
- # #=> {"ca" => "car", "con"=>"cone", "co" => "cone",
- # "car"=>"car", "cone" => "cone"}
+ # #=> {"car"=>"car", "ca"=>"car", "cone"=>"cone", "con"=>"cone", "co"=>"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.
+ # 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"}
+ # #=> {"fast"=>"fast", "fas"=>"fast", "fa"=>"fast", "day"=>"day", "da"=>"day"}
+ #
+ # Abbrev.abbrev(%w{car box cone}, "ca")
+ # #=> {"car"=>"car", "ca"=>"car"}
#
# See also Abbrev.abbrev
def abbrev(pattern = nil)
Abbrev::abbrev(self, pattern)
end
end
-
-if $0 == __FILE__
- while line = gets
- hash = line.split.abbrev
-
- hash.sort.each do |k, v|
- puts "#{k} => #{v}"
- end
- end
-end
diff --git a/lib/base64.rb b/lib/base64.rb
index 98829f0d96..a08941af92 100644
--- a/lib/base64.rb
+++ b/lib/base64.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# = base64.rb: methods for base64-encoding and -decoding strings
#
@@ -77,15 +78,30 @@ module Base64
# This method complies with ``Base 64 Encoding with URL and Filename Safe
# Alphabet'' in RFC 4648.
# The alphabet uses '-' instead of '+' and '_' instead of '/'.
- def urlsafe_encode64(bin)
- strict_encode64(bin).tr("+/", "-_")
+ # Note that the result can still contain '='.
+ # You can remove the padding by setting +padding+ as false.
+ def urlsafe_encode64(bin, padding: true)
+ str = strict_encode64(bin).tr("+/", "-_")
+ str = str.delete("=") unless padding
+ str
end
# Returns the Base64-decoded version of +str+.
# This method complies with ``Base 64 Encoding with URL and Filename Safe
# Alphabet'' in RFC 4648.
# The alphabet uses '-' instead of '+' and '_' instead of '/'.
+ #
+ # The padding character is optional.
+ # This method accepts both correctly-padded and unpadded input.
+ # Note that it still rejects incorrectly-padded input.
def urlsafe_decode64(str)
- strict_decode64(str.tr("-_", "+/"))
+ # NOTE: RFC 4648 does say nothing about unpadded input, but says that
+ # "the excess pad characters MAY also be ignored", so it is inferred that
+ # unpadded input is also acceptable.
+ str = str.tr("-_", "+/")
+ if !str.end_with?("=") && str.length % 4 != 0
+ str = str.ljust((str.length + 3) & ~3, "=")
+ end
+ strict_decode64(str)
end
end
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 81ca0bcede..ec1b658cde 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#--
# benchmark.rb - a performance benchmarking library
#
@@ -25,7 +26,7 @@
#
# puts Benchmark.measure { "a"*1_000_000_000 }
#
-# On my machine (OSX 10.8.3 on i5 1.7 Ghz) this generates:
+# On my machine (OSX 10.8.3 on i5 1.7 GHz) this generates:
#
# 0.350000 0.400000 0.750000 ( 0.835234)
#
@@ -131,7 +132,7 @@ module Benchmark
#
# If the block returns an array of
# Benchmark::Tms objects, these will be used to format
- # additional lines of output. If +label+ parameters are
+ # additional lines of output. If +labels+ parameter are
# given, these are used to label these extra lines.
#
# _Note_: Other methods provide a simpler interface to this one, and are
@@ -180,8 +181,8 @@ module Benchmark
# A simple interface to the #benchmark method, #bm generates sequential
- # reports with labels. The parameters have the same meaning as for
- # #benchmark.
+ # reports with labels. +label_width+ and +labels+ parameters have the same
+ # meaning as for #benchmark.
#
# require 'benchmark'
#
@@ -272,12 +273,25 @@ module Benchmark
#
# Returns the time used to execute the given block as a
- # Benchmark::Tms object.
+ # Benchmark::Tms object. Takes +label+ option.
+ #
+ # require 'benchmark'
+ #
+ # n = 1000000
+ #
+ # time = Benchmark.measure do
+ # n.times { a = "1" }
+ # end
+ # puts time
+ #
+ # Generates:
+ #
+ # 0.220000 0.000000 0.220000 ( 0.227313)
#
def measure(label = "") # :yield:
- t0, r0 = Process.times, Time.now
+ t0, r0 = Process.times, Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield
- t1, r1 = Process.times, Time.now
+ t1, r1 = Process.times, Process.clock_gettime(Process::CLOCK_MONOTONIC)
Benchmark::Tms.new(t1.utime - t0.utime,
t1.stime - t0.stime,
t1.cutime - t0.cutime,
@@ -290,9 +304,9 @@ module Benchmark
# Returns the elapsed real time used to execute the given block.
#
def realtime # :yield:
- r0 = Time.now
+ r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield
- Time.now - r0
+ Process.clock_gettime(Process::CLOCK_MONOTONIC) - r0
end
module_function :benchmark, :measure, :realtime, :bm, :bmbm
@@ -466,7 +480,7 @@ module Benchmark
#
# Returns the contents of this Tms object as
- # a formatted string, according to a format string
+ # a formatted string, according to a +format+ string
# like that passed to Kernel.format. In addition, #format
# accepts the following extensions:
#
@@ -478,7 +492,7 @@ module Benchmark
# <tt>%r</tt>:: Replaced by the elapsed real time, as reported by Tms#real
# <tt>%n</tt>:: Replaced by the label string, as reported by Tms#label (Mnemonic: n of "*n*ame")
#
- # If _format_ is not given, FORMAT is used as default value, detailing the
+ # If +format+ is not given, FORMAT is used as default value, detailing the
# user, system and real elapsed time.
#
def format(format = nil, *args)
@@ -546,23 +560,3 @@ module Benchmark
# The default format string used to display times. See also Benchmark::Tms#format.
FORMAT = Benchmark::Tms::FORMAT
end
-
-if __FILE__ == $0
- include Benchmark
-
- n = ARGV[0].to_i.nonzero? || 50000
- puts %Q([#{n} times iterations of `a = "1"'])
- 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}
- end
-
- benchmark do
- [
- measure{for _ in 1..n; _ = "1"; end}, # Benchmark.measure
- measure{n.times do ; _ = "1"; end},
- measure{1.upto(n) do ; _ = "1"; end}
- ]
- end
-end
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 15676eab5f..167b76cef7 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# cgi.rb - cgi support library
#
@@ -10,8 +11,6 @@
# Documentation: Wakou Aoyama (RDoc'd and embellished by William Webber)
#
-raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
-
# == Overview
#
# The Common Gateway Interface (CGI) is a simple protocol for passing an HTTP
@@ -82,7 +81,7 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
#
# For instance, suppose the request contains the parameter
# "favourite_colours" with the multiple values "blue" and "green". The
-# following behaviour would occur:
+# following behavior would occur:
#
# cgi.params["favourite_colours"] # => ["blue", "green"]
# cgi["favourite_colours"] # => "blue"
diff --git a/lib/cgi/cookie.rb b/lib/cgi/cookie.rb
index 3ec884dffb..ffd88b8edb 100644
--- a/lib/cgi/cookie.rb
+++ b/lib/cgi/cookie.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'cgi/util'
class CGI
# Class representing an HTTP cookie.
@@ -10,29 +11,32 @@ class CGI
# == Examples of use
# cookie1 = CGI::Cookie.new("name", "value1", "value2", ...)
# cookie1 = CGI::Cookie.new("name" => "name", "value" => "value")
- # cookie1 = CGI::Cookie.new('name' => 'name',
- # 'value' => ['value1', 'value2', ...],
- # 'path' => 'path', # optional
- # 'domain' => 'domain', # optional
- # 'expires' => Time.now, # optional
- # 'secure' => true # optional
+ # cookie1 = CGI::Cookie.new('name' => 'name',
+ # 'value' => ['value1', 'value2', ...],
+ # 'path' => 'path', # optional
+ # 'domain' => 'domain', # optional
+ # 'expires' => Time.now, # optional
+ # 'secure' => true, # optional
+ # 'httponly' => true # optional
# )
#
# cgi.out("cookie" => [cookie1, cookie2]) { "string" }
#
- # name = cookie1.name
- # values = cookie1.value
- # path = cookie1.path
- # domain = cookie1.domain
- # expires = cookie1.expires
- # secure = cookie1.secure
+ # name = cookie1.name
+ # values = cookie1.value
+ # path = cookie1.path
+ # domain = cookie1.domain
+ # expires = cookie1.expires
+ # secure = cookie1.secure
+ # httponly = cookie1.httponly
#
- # cookie1.name = 'name'
- # cookie1.value = ['value1', 'value2', ...]
- # cookie1.path = 'path'
- # cookie1.domain = 'domain'
- # cookie1.expires = Time.now + 30
- # cookie1.secure = true
+ # cookie1.name = 'name'
+ # cookie1.value = ['value1', 'value2', ...]
+ # cookie1.path = 'path'
+ # cookie1.domain = 'domain'
+ # cookie1.expires = Time.now + 30
+ # cookie1.secure = true
+ # cookie1.httponly = true
class Cookie < Array
@@accept_charset="UTF-8" unless defined?(@@accept_charset)
@@ -60,6 +64,8 @@ class CGI
# secure:: whether this cookie is a secure cookie or not (default to
# false). Secure cookies are only transmitted to HTTPS
# servers.
+ # httponly:: whether this cookie is a HttpOnly cookie or not (default to
+ # false). HttpOnly cookies are not available to javascript.
#
# These keywords correspond to attributes of the cookie object.
def initialize(name = "", *value)
@@ -70,6 +76,7 @@ class CGI
%r|^(.*/)|.match(ENV["SCRIPT_NAME"])
@path = ($1 or "")
@secure = false
+ @httponly = false
return super(value)
end
@@ -89,7 +96,8 @@ class CGI
end
@domain = options["domain"]
@expires = options["expires"]
- @secure = options["secure"] == true ? true : false
+ @secure = options["secure"] == true
+ @httponly = options["httponly"] == true
super(value)
end
@@ -103,7 +111,9 @@ class CGI
# Time at which this cookie expires, as a +Time+
attr_accessor :expires
# True if this cookie is secure; false otherwise
- attr_reader("secure")
+ attr_reader :secure
+ # True if this cookie is httponly; false otherwise
+ attr_reader :httponly
# Returns the value or list of values for this cookie.
def value
@@ -123,6 +133,13 @@ class CGI
@secure
end
+ # Set whether the Cookie is a httponly cookie or not.
+ #
+ # +val+ must be a boolean.
+ def httponly=(val)
+ @httponly = !!val
+ end
+
# Convert the Cookie to its string representation.
def to_s
val = collect{|v| CGI.escape(v) }.join("&")
@@ -130,7 +147,8 @@ class CGI
buf << "; domain=#{@domain}" if @domain
buf << "; path=#{@path}" if @path
buf << "; expires=#{CGI::rfc1123_date(@expires)}" if @expires
- buf << "; secure" if @secure == true
+ buf << "; secure" if @secure
+ buf << "; HttpOnly" if @httponly
buf
end
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb
index 241f817278..1a741dcd76 100644
--- a/lib/cgi/core.rb
+++ b/lib/cgi/core.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#--
# Methods for generating HTML, parsing CGI-related parameters, and
# generating HTTP responses.
@@ -389,9 +390,6 @@ class CGI
# Maximum content length of post data
##MAX_CONTENT_LENGTH = 2 * 1024 * 1024
- # Maximum content length of multipart data
- MAX_MULTIPART_LENGTH = 128 * 1024 * 1024
-
# Maximum number of request parameters when multipart
MAX_MULTIPART_COUNT = 128
@@ -482,7 +480,6 @@ class CGI
@files = {}
boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/
boundary_size = "#{EOL}--#{boundary}#{EOL}".bytesize
- boundary_end = nil
buf = ''
bufsize = 10 * 1024
max_count = MAX_MULTIPART_COUNT
@@ -550,7 +547,7 @@ class CGI
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)
+ body.close! if defined?(Tempfile) && body.kind_of?(Tempfile)
(params[name] ||= []) << value
unless value.valid_encoding?
if @accept_charset_error_block
@@ -578,7 +575,7 @@ class CGI
if tempfiles
tempfiles.each {|t|
if t.path
- t.unlink
+ t.close!
end
}
end
@@ -644,8 +641,9 @@ class CGI
# Reads query parameters in the @params field, and cookies into @cookies.
def initialize_query()
if ("POST" == env_table['REQUEST_METHOD']) and
- %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|.match(env_table['CONTENT_TYPE'])
- raise StandardError.new("too large multipart data.") if env_table['CONTENT_LENGTH'].to_i > MAX_MULTIPART_LENGTH
+ %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|.match(env_table['CONTENT_TYPE'])
+ current_max_multipart_length = @max_multipart_length.respond_to?(:call) ? @max_multipart_length.call : @max_multipart_length
+ raise StandardError.new("too large multipart data.") if env_table['CONTENT_LENGTH'].to_i > current_max_multipart_length
boundary = $1.dup
@multipart = true
@params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
@@ -751,6 +749,16 @@ class CGI
# Return the accept character set for this CGI instance.
attr_reader :accept_charset
+ # @@max_multipart_length is the maximum length of multipart data.
+ # The default value is 128 * 1024 * 1024 bytes
+ #
+ # The default can be set to something else in the CGI constructor,
+ # via the :max_multipart_length key in the option hash.
+ #
+ # See CGI.new documentation.
+ #
+ @@max_multipart_length= 128 * 1024 * 1024
+
# Create a new CGI instance.
#
# :call-seq:
@@ -764,7 +772,7 @@ class CGI
# +options_hash+ form, since it also allows you specify the charset you
# will accept.
# <tt>options_hash</tt>::
- # A Hash that recognizes two options:
+ # A Hash that recognizes three options:
#
# <tt>:accept_charset</tt>::
# specifies encoding of received query string. If omitted,
@@ -793,6 +801,18 @@ class CGI
# "html4Fr":: HTML 4.0 with Framesets
# "html5":: HTML 5
#
+ # <tt>:max_multipart_length</tt>::
+ # Specifies maximum length of multipart data. Can be an Integer scalar or
+ # a lambda, that will be evaluated when the request is parsed. This
+ # allows more complex logic to be set when determining whether to accept
+ # multipart data (e.g. consult a registered users upload allowance)
+ #
+ # Default is 128 * 1024 * 1024 bytes
+ #
+ # cgi=CGI.new(:max_multipart_length => 268435456) # simple scalar
+ #
+ # cgi=CGI.new(:max_multipart_length => -> {check_filesystem}) # lambda
+ #
# <tt>block</tt>::
# If provided, the block is called when an invalid encoding is
# encountered. For example:
@@ -810,7 +830,10 @@ class CGI
# CGI locations, which varies according to the REQUEST_METHOD.
def initialize(options = {}, &block) # :yields: name, value
@accept_charset_error_block = block_given? ? block : nil
- @options={:accept_charset=>@@accept_charset}
+ @options={
+ :accept_charset=>@@accept_charset,
+ :max_multipart_length=>@@max_multipart_length
+ }
case options
when Hash
@options.merge!(options)
@@ -818,6 +841,7 @@ class CGI
@options[:tag_maker]=options
end
@accept_charset=@options[:accept_charset]
+ @max_multipart_length=@options[:max_multipart_length]
if defined?(MOD_RUBY) && !ENV.key?("GATEWAY_INTERFACE")
Apache.request.setup_cgi_env
end
@@ -855,5 +879,3 @@ class CGI
end
end # class CGI
-
-
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb
index 4c4f698a2b..4b9e577b32 100644
--- a/lib/cgi/html.rb
+++ b/lib/cgi/html.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
class CGI
# Base module for HTML-generation mixins.
#
@@ -865,7 +866,7 @@ class CGI
%|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">|
end
- # Initialise the HTML generation methods for this version.
+ # Initialize the HTML generation methods for this version.
# - -
instance_method(:nn_element_def).tap do |m|
for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index 606d5bc541..d44a5f84b0 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# cgi/session.rb - session support for cgi scripts
#
@@ -163,24 +164,26 @@ class CGI
# Create a new session id.
#
- # The session id is an MD5 hash based upon the time,
- # a random number, and a constant string. This routine
- # is used internally for automatically generated
- # session ids.
+ # The session id is a secure random number by SecureRandom
+ # if possible, otherwise an SHA512 hash based upon the time,
+ # a random number, and a constant string. This routine is
+ # used internally for automatically generated session ids.
def create_new_id
require 'securerandom'
begin
+ # by OpenSSL, or system provided entropy pool
session_id = SecureRandom.hex(16)
rescue NotImplementedError
- require 'digest/md5'
- md5 = Digest::MD5::new
+ # never happens on modern systems
+ require 'digest'
+ d = Digest('SHA512').new
now = Time::now
- md5.update(now.to_s)
- md5.update(String(now.usec))
- md5.update(String(rand(0)))
- md5.update(String($$))
- md5.update('foobar')
- session_id = md5.hexdigest
+ d.update(now.to_s)
+ d.update(String(now.usec))
+ d.update(String(rand(0)))
+ d.update(String($$))
+ d.update('foobar')
+ session_id = d.hexdigest[0, 32]
end
session_id
end
@@ -453,7 +456,7 @@ class CGI
#
# +session+ is the session this instance is associated with.
# +option+ is a list of initialisation options. None are
- # currently recognised.
+ # currently recognized.
def initialize(session, option=nil)
@session_id = session.session_id
unless GLOBAL_HASH_TABLE.key?(@session_id)
diff --git a/lib/cgi/session/pstore.rb b/lib/cgi/session/pstore.rb
index a63d7d3984..2dfb72bdce 100644
--- a/lib/cgi/session/pstore.rb
+++ b/lib/cgi/session/pstore.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# cgi/session/pstore.rb - persistent storage of marshalled session data
#
@@ -97,15 +98,4 @@ class CGI
end
end
end
-
-if $0 == __FILE__
- # :enddoc:
- STDIN.reopen("/dev/null")
- cgi = CGI.new
- session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore)
- session['key'] = {'k' => 'v'}
- puts session['key'].class
- fail unless Hash === session['key']
- puts session['key'].inspect
- fail unless session['key'].inspect == '{"k"=>"v"}'
-end
+# :enddoc:
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index 199e17bbbc..83c310b3cb 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
class CGI; module Util; end; extend Util; end
module CGI::Util
@@accept_charset="UTF-8" unless defined?(@@accept_charset)
@@ -37,6 +38,11 @@ module CGI::Util
string.gsub(/['&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
end
+ begin
+ require 'cgi/escape'
+ rescue LoadError
+ end
+
# Unescape a string that has been HTML-escaped
# CGI::unescapeHTML("Usage: foo &quot;bar&quot; &lt;baz&gt;")
# # => "Usage: foo \"bar\" <baz>"
@@ -90,14 +96,10 @@ module CGI::Util
end
# Synonym for CGI::escapeHTML(str)
- def escape_html(str)
- escapeHTML(str)
- end
+ alias escape_html escapeHTML
# Synonym for CGI::unescapeHTML(str)
- def unescape_html(str)
- unescapeHTML(str)
- end
+ alias unescape_html unescapeHTML
# Escape only the tags of certain HTML elements in +string+.
#
@@ -144,14 +146,10 @@ module CGI::Util
end
# Synonym for CGI::escapeElement(str)
- def escape_element(str)
- escapeElement(str)
- end
+ alias escape_element escapeElement
# Synonym for CGI::unescapeElement(str)
- def unescape_element(str)
- unescapeElement(str)
- end
+ alias unescape_element unescapeElement
# Abbreviated day-of-week names specified by RFC 822
RFC822_DAYS = %w[ Sun Mon Tue Wed Thu Fri Sat ]
diff --git a/lib/cmath.rb b/lib/cmath.rb
index 337c2e063a..41ab06e77c 100644
--- a/lib/cmath.rb
+++ b/lib/cmath.rb
@@ -1,60 +1,72 @@
+# frozen_string_literal: false
##
+# = Trigonometric and transcendental functions for complex numbers.
+#
# CMath is a library that provides trigonometric and transcendental
-# functions for complex numbers.
+# functions for complex numbers. The functions in this module accept
+# integers, floating-point numbers or complex numbers as arguments.
#
-# == Usage
+# Note that the selection of functions is similar, but not identical,
+# to that in module math. The reason for having two modules is that
+# some users aren't interested in complex numbers, and perhaps don't
+# even know what they are. They would rather have Math.sqrt(-1) raise
+# an exception than return a complex number.
#
-# To start using this library, simply:
+# For more information you can see Complex class.
#
-# require "cmath"
-#
-# Square root of a negative number is a complex number.
+# == Usage
#
-# CMath.sqrt(-9) #=> 0+3.0i
+# To start using this library, simply require cmath library:
#
+# require "cmath"
module CMath
include Math
- alias exp! exp
- alias log! log
- alias log2! log2
- alias log10! log10
- alias sqrt! sqrt
- alias cbrt! cbrt
-
- alias sin! sin
- alias cos! cos
- alias tan! tan
-
- alias sinh! sinh
- alias cosh! cosh
- alias tanh! tanh
-
- alias asin! asin
- alias acos! acos
- alias atan! atan
- alias atan2! atan2
-
- alias asinh! asinh
- alias acosh! acosh
- alias atanh! atanh
+ # Backup of Math is needed because mathn.rb replaces Math with CMath.
+ RealMath = Math # :nodoc:
+ private_constant :RealMath
+
+ %w[
+ exp
+ log
+ log2
+ log10
+ sqrt
+ cbrt
+ sin
+ cos
+ tan
+ sinh
+ cosh
+ tanh
+ asin
+ acos
+ atan
+ atan2
+ asinh
+ acosh
+ atanh
+ ].each do |meth|
+ define_method(meth + '!') do |*args, &block|
+ warn("CMath##{meth}! is deprecated; use CMath##{meth} or Math##{meth}") if $VERBOSE
+ RealMath.send(meth, *args, &block)
+ end
+ end
##
# Math::E raised to the +z+ power
#
- # exp(Complex(0,0)) #=> 1.0+0.0i
- # exp(Complex(0,PI)) #=> -1.0+1.2246467991473532e-16i
- # exp(Complex(0,PI/2.0)) #=> 6.123233995736766e-17+1.0i
+ # CMath.exp(1.i * Math::PI) #=> (-1.0+1.2246467991473532e-16i)
def exp(z)
begin
if z.real?
- exp!(z)
+ RealMath.exp(z)
else
- ere = exp!(z.real)
- Complex(ere * cos!(z.imag),
- ere * sin!(z.imag))
+ ere = RealMath.exp(z.real)
+ Complex(ere * RealMath.cos(z.imag),
+ ere * RealMath.sin(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -62,24 +74,17 @@ module CMath
end
##
- # Returns the natural logarithm of Complex. If a second argument is given,
+ # Returns the natural logarithm of Complex. If a second argument is given,
# it will be the base of logarithm.
#
- # log(Complex(0,0)) #=> -Infinity+0.0i
- def log(*args)
+ # CMath.log(1 + 4i) #=> (1.416606672028108+1.3258176636680326i)
+ # CMath.log(1 + 4i, 10) #=> (0.6152244606891369+0.5757952953408879i)
+ def log(z, b=::Math::E)
begin
- z, b = args
- unless b.nil? || b.kind_of?(Numeric)
- raise TypeError, "Numeric Number required"
- end
- if z.real? and z >= 0 and (b.nil? or b >= 0)
- log!(*args)
+ if z.real? && z >= 0 && b >= 0
+ RealMath.log(z, b)
else
- a = Complex(log!(z.abs), z.arg)
- if b
- a /= log(b)
- end
- a
+ Complex(RealMath.log(z.abs), z.arg) / log(b)
end
rescue NoMethodError
handle_no_method_error
@@ -87,13 +92,15 @@ module CMath
end
##
- # returns the base 2 logarithm of +z+
+ # Returns the base 2 logarithm of +z+
+ #
+ # CMath.log2(-1) => (0.0+4.532360141827194i)
def log2(z)
begin
if z.real? and z >= 0
- log2!(z)
+ RealMath.log2(z)
else
- log(z) / log!(2)
+ log(z) / RealMath.log(2)
end
rescue NoMethodError
handle_no_method_error
@@ -101,13 +108,15 @@ module CMath
end
##
- # returns the base 10 logarithm of +z+
+ # Returns the base 10 logarithm of +z+
+ #
+ # CMath.log10(-1) #=> (0.0+1.3643763538418412i)
def log10(z)
begin
if z.real? and z >= 0
- log10!(z)
+ RealMath.log10(z)
else
- log(z) / log!(10)
+ log(z) / RealMath.log(10)
end
rescue NoMethodError
handle_no_method_error
@@ -116,26 +125,25 @@ module CMath
##
# Returns the non-negative square root of Complex.
- # sqrt(-1) #=> 0+1.0i
- # sqrt(Complex(-1,0)) #=> 0.0+1.0i
- # sqrt(Complex(0,8)) #=> 2.0+2.0i
+ #
+ # CMath.sqrt(-1 + 0i) #=> 0.0+1.0i
def sqrt(z)
begin
if z.real?
- if z < 0
- Complex(0, sqrt!(-z))
- else
- sqrt!(z)
- end
+ if z < 0
+ Complex(0, RealMath.sqrt(-z))
+ else
+ RealMath.sqrt(z)
+ end
else
- if z.imag < 0 ||
- (z.imag == 0 && z.imag.to_s[0] == '-')
- sqrt(z.conjugate).conjugate
- else
- r = z.abs
- x = z.real
- Complex(sqrt!((r + x) / 2.0), sqrt!((r - x) / 2.0))
- end
+ if z.imag < 0 ||
+ (z.imag == 0 && z.imag.to_s[0] == '-')
+ sqrt(z.conjugate).conjugate
+ else
+ r = z.abs
+ x = z.real
+ Complex(RealMath.sqrt((r + x) / 2.0), RealMath.sqrt((r - x) / 2.0))
+ end
end
rescue NoMethodError
handle_no_method_error
@@ -143,20 +151,24 @@ module CMath
end
##
- # returns the principal value of the cube root of +z+
+ # Returns the principal value of the cube root of +z+
+ #
+ # CMath.cbrt(1 + 4i) #=> (1.449461632813119+0.6858152562177092i)
def cbrt(z)
z ** (1.0/3)
end
##
- # returns the sine of +z+, where +z+ is given in radians
+ # Returns the sine of +z+, where +z+ is given in radians
+ #
+ # CMath.sin(1 + 1i) #=> (1.2984575814159773+0.6349639147847361i)
def sin(z)
begin
if z.real?
- sin!(z)
+ RealMath.sin(z)
else
- Complex(sin!(z.real) * cosh!(z.imag),
- cos!(z.real) * sinh!(z.imag))
+ Complex(RealMath.sin(z.real) * RealMath.cosh(z.imag),
+ RealMath.cos(z.real) * RealMath.sinh(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -164,14 +176,16 @@ module CMath
end
##
- # returns the cosine of +z+, where +z+ is given in radians
+ # Returns the cosine of +z+, where +z+ is given in radians
+ #
+ # CMath.cos(1 + 1i) #=> (0.8337300251311491-0.9888977057628651i)
def cos(z)
begin
if z.real?
- cos!(z)
+ RealMath.cos(z)
else
- Complex(cos!(z.real) * cosh!(z.imag),
- -sin!(z.real) * sinh!(z.imag))
+ Complex(RealMath.cos(z.real) * RealMath.cosh(z.imag),
+ -RealMath.sin(z.real) * RealMath.sinh(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -179,13 +193,15 @@ module CMath
end
##
- # returns the tangent of +z+, where +z+ is given in radians
+ # Returns the tangent of +z+, where +z+ is given in radians
+ #
+ # CMath.tan(1 + 1i) #=> (0.27175258531951174+1.0839233273386943i)
def tan(z)
begin
if z.real?
- tan!(z)
+ RealMath.tan(z)
else
- sin(z) / cos(z)
+ sin(z) / cos(z)
end
rescue NoMethodError
handle_no_method_error
@@ -193,14 +209,16 @@ module CMath
end
##
- # returns the hyperbolic sine of +z+, where +z+ is given in radians
+ # Returns the hyperbolic sine of +z+, where +z+ is given in radians
+ #
+ # CMath.sinh(1 + 1i) #=> (0.6349639147847361+1.2984575814159773i)
def sinh(z)
begin
if z.real?
- sinh!(z)
+ RealMath.sinh(z)
else
- Complex(sinh!(z.real) * cos!(z.imag),
- cosh!(z.real) * sin!(z.imag))
+ Complex(RealMath.sinh(z.real) * RealMath.cos(z.imag),
+ RealMath.cosh(z.real) * RealMath.sin(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -208,14 +226,16 @@ module CMath
end
##
- # returns the hyperbolic cosine of +z+, where +z+ is given in radians
+ # Returns the hyperbolic cosine of +z+, where +z+ is given in radians
+ #
+ # CMath.cosh(1 + 1i) #=> (0.8337300251311491+0.9888977057628651i)
def cosh(z)
begin
if z.real?
- cosh!(z)
+ RealMath.cosh(z)
else
- Complex(cosh!(z.real) * cos!(z.imag),
- sinh!(z.real) * sin!(z.imag))
+ Complex(RealMath.cosh(z.real) * RealMath.cos(z.imag),
+ RealMath.sinh(z.real) * RealMath.sin(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -223,13 +243,15 @@ module CMath
end
##
- # returns the hyperbolic tangent of +z+, where +z+ is given in radians
+ # Returns the hyperbolic tangent of +z+, where +z+ is given in radians
+ #
+ # CMath.tanh(1 + 1i) #=> (1.0839233273386943+0.27175258531951174i)
def tanh(z)
begin
if z.real?
- tanh!(z)
+ RealMath.tanh(z)
else
- sinh(z) / cosh(z)
+ sinh(z) / cosh(z)
end
rescue NoMethodError
handle_no_method_error
@@ -237,13 +259,15 @@ module CMath
end
##
- # returns the arc sine of +z+
+ # Returns the arc sine of +z+
+ #
+ # CMath.asin(1 + 1i) #=> (0.6662394324925153+1.0612750619050355i)
def asin(z)
begin
if z.real? and z >= -1 and z <= 1
- asin!(z)
+ RealMath.asin(z)
else
- (-1.0).i * log(1.0.i * z + sqrt(1.0 - z * z))
+ (-1.0).i * log(1.0.i * z + sqrt(1.0 - z * z))
end
rescue NoMethodError
handle_no_method_error
@@ -251,13 +275,15 @@ module CMath
end
##
- # returns the arc cosine of +z+
+ # Returns the arc cosine of +z+
+ #
+ # CMath.acos(1 + 1i) #=> (0.9045568943023813-1.0612750619050357i)
def acos(z)
begin
if z.real? and z >= -1 and z <= 1
- acos!(z)
+ RealMath.acos(z)
else
- (-1.0).i * log(z + 1.0.i * sqrt(1.0 - z * z))
+ (-1.0).i * log(z + 1.0.i * sqrt(1.0 - z * z))
end
rescue NoMethodError
handle_no_method_error
@@ -265,13 +291,15 @@ module CMath
end
##
- # returns the arc tangent of +z+
+ # Returns the arc tangent of +z+
+ #
+ # CMath.atan(1 + 1i) #=> (1.0172219678978514+0.4023594781085251i)
def atan(z)
begin
if z.real?
- atan!(z)
+ RealMath.atan(z)
else
- 1.0.i * log((1.0.i + z) / (1.0.i - z)) / 2.0
+ 1.0.i * log((1.0.i + z) / (1.0.i - z)) / 2.0
end
rescue NoMethodError
handle_no_method_error
@@ -281,12 +309,14 @@ module CMath
##
# returns the arc tangent of +y+ divided by +x+ using the signs of +y+ and
# +x+ to determine the quadrant
+ #
+ # CMath.atan2(1 + 1i, 0) #=> (1.5707963267948966+0.0i)
def atan2(y,x)
begin
if y.real? and x.real?
- atan2!(y,x)
+ RealMath.atan2(y,x)
else
- (-1.0).i * log((x + 1.0.i * y) / sqrt(x * x + y * y))
+ (-1.0).i * log((x + 1.0.i * y) / sqrt(x * x + y * y))
end
rescue NoMethodError
handle_no_method_error
@@ -295,12 +325,14 @@ module CMath
##
# returns the inverse hyperbolic sine of +z+
+ #
+ # CMath.asinh(1 + 1i) #=> (1.0612750619050357+0.6662394324925153i)
def asinh(z)
begin
if z.real?
- asinh!(z)
+ RealMath.asinh(z)
else
- log(z + sqrt(1.0 + z * z))
+ log(z + sqrt(1.0 + z * z))
end
rescue NoMethodError
handle_no_method_error
@@ -309,12 +341,14 @@ module CMath
##
# returns the inverse hyperbolic cosine of +z+
+ #
+ # CMath.acosh(1 + 1i) #=> (1.0612750619050357+0.9045568943023813i)
def acosh(z)
begin
if z.real? and z >= 1
- acosh!(z)
+ RealMath.acosh(z)
else
- log(z + sqrt(z * z - 1.0))
+ log(z + sqrt(z * z - 1.0))
end
rescue NoMethodError
handle_no_method_error
@@ -323,12 +357,14 @@ module CMath
##
# returns the inverse hyperbolic tangent of +z+
+ #
+ # CMath.atanh(1 + 1i) #=> (0.4023594781085251+1.0172219678978514i)
def atanh(z)
begin
if z.real? and z >= -1 and z <= 1
- atanh!(z)
+ RealMath.atanh(z)
else
- log((1.0 + z) / (1.0 - z)) / 2.0
+ log((1.0 + z) / (1.0 - z)) / 2.0
end
rescue NoMethodError
handle_no_method_error
@@ -397,4 +433,3 @@ module CMath
module_function :handle_no_method_error
end
-
diff --git a/lib/complex.rb b/lib/complex.rb
deleted file mode 100644
index 9c57ecdf7a..0000000000
--- a/lib/complex.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# :enddoc:
-
-warn('lib/complex.rb is deprecated') if $VERBOSE
-
-require 'cmath'
-
-unless defined?(Math.exp!)
- Object.instance_eval{remove_const :Math}
- Math = CMath
-end
-
-def Complex.generic? (other)
- other.kind_of?(Integer) ||
- other.kind_of?(Float) ||
- other.kind_of?(Rational)
-end
-
-class Complex
-
- alias image imag
-
-end
-
-class Numeric
-
- def im() Complex(0, self) end
-
-end
diff --git a/lib/csv.rb b/lib/csv.rb
index e5ecf5c9a8..ba9d62c706 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1,4 +1,5 @@
# encoding: US-ASCII
+# frozen_string_literal: true
# = csv.rb -- CSV Reading and Writing
#
# Created by James Edward Gray II on 2005-10-31.
@@ -176,7 +177,7 @@ require "stringio"
# support. For example, <tt>:col_sep</tt>, <tt>:row_sep</tt>, and
# <tt>:quote_char</tt> must be transcoded to match your data. Hopefully this
# makes the entire process feel transparent, since CSV's defaults should just
-# magically work for you data. However, you can set these values manually in
+# magically work for your data. However, you can set these values manually in
# the target Encoding to avoid the translation.
#
# It's also important to note that while all of CSV's core parser is now
@@ -207,7 +208,7 @@ require "stringio"
#
class CSV
# The version of the installed library.
- VERSION = "2.4.8".freeze
+ VERSION = "2.4.8"
#
# A CSV::Row is part Array and part Hash. It retains an order for the fields
@@ -238,10 +239,10 @@ class CSV
headers.each { |h| h.freeze if h.is_a? String }
# handle extra headers or fields
- @row = if headers.size > fields.size
+ @row = if headers.size >= fields.size
headers.zip(fields)
else
- fields.zip(headers).map { |pair| pair.reverse }
+ fields.zip(headers).map { |pair| pair.reverse! }
end
end
@@ -284,11 +285,15 @@ class CSV
#
def field(header_or_index, minimum_index = 0)
# locate the pair
- finder = header_or_index.is_a?(Integer) ? :[] : :assoc
+ finder = (header_or_index.is_a?(Integer) || header_or_index.is_a?(Range)) ? :[] : :assoc
pair = @row[minimum_index..-1].send(finder, header_or_index)
# return the field if we have a pair
- pair.nil? ? nil : pair.last
+ if pair.nil?
+ nil
+ else
+ header_or_index.is_a?(Range) ? pair.map(&:last) : pair.last
+ end
end
alias_method :[], :field
@@ -517,7 +522,7 @@ class CSV
end
#
- # Collapses the row into a simple Hash. Be warning that this discards field
+ # Collapses the row into a simple Hash. Be warned that this discards field
# order and clobbers duplicate fields.
#
def to_hash
@@ -690,7 +695,7 @@ class CSV
#
def [](index_or_header)
if @mode == :row or # by index
- (@mode == :col_or_row and index_or_header.is_a? Integer)
+ (@mode == :col_or_row and (index_or_header.is_a?(Integer) or index_or_header.is_a?(Range)))
@table[index_or_header]
else # by header
@table.map { |row| row[index_or_header] }
@@ -944,30 +949,32 @@ class CSV
# To add a combo field, the value should be an Array of names. Combo fields
# can be nested with other combo fields.
#
- Converters = { integer: lambda { |f|
- Integer(f.encode(ConverterEncoding)) rescue f
- },
- float: lambda { |f|
- Float(f.encode(ConverterEncoding)) rescue f
- },
- numeric: [:integer, :float],
- date: lambda { |f|
- begin
- e = f.encode(ConverterEncoding)
- e =~ DateMatcher ? Date.parse(e) : f
- rescue # encoding conversion or date parse errors
- f
- end
- },
- date_time: lambda { |f|
- begin
- e = f.encode(ConverterEncoding)
- e =~ DateTimeMatcher ? DateTime.parse(e) : f
- rescue # encoding conversion or date parse errors
- f
- end
- },
- all: [:date_time, :numeric] }
+ Converters = {
+ integer: lambda { |f|
+ Integer(f.encode(ConverterEncoding)) rescue f
+ },
+ float: lambda { |f|
+ Float(f.encode(ConverterEncoding)) rescue f
+ },
+ numeric: [:integer, :float],
+ date: lambda { |f|
+ begin
+ e = f.encode(ConverterEncoding)
+ e =~ DateMatcher ? Date.parse(e) : f
+ rescue # encoding conversion or date parse errors
+ f
+ end
+ },
+ date_time: lambda { |f|
+ begin
+ e = f.encode(ConverterEncoding)
+ e =~ DateTimeMatcher ? DateTime.parse(e) : f
+ rescue # encoding conversion or date parse errors
+ f
+ end
+ },
+ all: [:date_time, :numeric],
+ }
#
# This Hash holds the built-in header converters of CSV that can be accessed
@@ -992,8 +999,8 @@ class CSV
HeaderConverters = {
downcase: lambda { |h| h.encode(ConverterEncoding).downcase },
symbol: lambda { |h|
- h.encode(ConverterEncoding).downcase.gsub(/\s+/, "_").
- gsub(/\W+/, "").to_sym
+ h.encode(ConverterEncoding).downcase.strip.gsub(/\s+/, "_").
+ gsub(/\W+/, "").to_sym
}
}
@@ -1013,18 +1020,20 @@ class CSV
# <b><tt>:force_quotes</tt></b>:: +false+
# <b><tt>:skip_lines</tt></b>:: +nil+
#
- DEFAULT_OPTIONS = { col_sep: ",",
- row_sep: :auto,
- quote_char: '"',
- field_size_limit: nil,
- converters: nil,
- unconverted_fields: nil,
- headers: false,
- return_headers: false,
- header_converters: nil,
- skip_blanks: false,
- force_quotes: false,
- skip_lines: nil }.freeze
+ DEFAULT_OPTIONS = {
+ col_sep: ",",
+ row_sep: :auto,
+ quote_char: '"',
+ field_size_limit: nil,
+ converters: nil,
+ unconverted_fields: nil,
+ headers: false,
+ return_headers: false,
+ header_converters: nil,
+ skip_blanks: false,
+ force_quotes: false,
+ skip_lines: nil,
+ }.freeze
#
# This method will return a CSV instance, just like CSV::new(), but the
@@ -1148,9 +1157,9 @@ class CSV
io.seek(0, IO::SEEK_END)
args.unshift(io)
else
- encoding = (args[-1] = args[-1].dup).delete(:encoding) if args.last.is_a?(Hash)
- str = ""
- str.encode!(encoding) if encoding
+ encoding = args[-1][:encoding] if args.last.is_a?(Hash)
+ str = String.new
+ str.force_encoding(encoding) if encoding
args.unshift(str)
end
csv = new(*args) # wrap
@@ -1174,7 +1183,7 @@ class CSV
def self.generate_line(row, options = Hash.new)
options = {row_sep: $INPUT_RECORD_SEPARATOR}.merge(options)
encoding = options.delete(:encoding)
- str = ""
+ str = String.new
if encoding
str.force_encoding(encoding)
elsif field = row.find { |f| not f.nil? }
@@ -1260,7 +1269,12 @@ class CSV
file_opts = {encoding: Encoding.default_external}.merge(file_opts)
retry
end
- csv = new(f, options)
+ begin
+ csv = new(f, options)
+ rescue Exception
+ f.close
+ raise
+ end
# handle blocks like Ruby's open(), not like the CSV library
if block_given?
@@ -1350,7 +1364,7 @@ class CSV
# a String for +data+, you can later retrieve it (after writing to it, for
# example) with CSV.string().
#
- # Note that a wrapped String will be positioned at at the beginning (for
+ # Note that a wrapped String will be positioned at the beginning (for
# reading). If you want it at the end (for writing), use CSV::generate().
# If you want any other positioning, pass a preset StringIO object instead.
#
@@ -1396,7 +1410,7 @@ class CSV
# <tt>'</tt> as the quote character
# instead of the correct <tt>"</tt>.
# CSV will always consider a double
- # sequence this character to be an
+ # sequence of this character to be an
# escaped quote. This String will be
# transcoded into the data's Encoding
# before parsing.
@@ -1465,7 +1479,15 @@ class CSV
# if the data cannot be transcoded,
# leaving the header unchanged.
# <b><tt>:skip_blanks</tt></b>:: When set to a +true+ value, CSV will
- # skip over any rows with no content.
+ # skip over any empty rows. Note that
+ # this setting will not skip rows that
+ # contain column separators, even if
+ # the rows contain no actual data. If
+ # you want to skip rows that contain
+ # separators but no content, consider
+ # using <tt>:skip_lines</tt>, or
+ # inspecting fields.compact.empty? on
+ # each row.
# <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
@@ -1484,6 +1506,10 @@ class CSV
# so be sure to set what you want here.
#
def initialize(data, options = Hash.new)
+ if data.nil?
+ raise ArgumentError.new("Cannot parse nil as CSV")
+ end
+
# build the options for this read/write
options = DEFAULT_OPTIONS.merge(options)
@@ -1506,9 +1532,8 @@ class CSV
# prepare for building safe regular expressions in the target encoding,
# if we can transcode the needed characters
#
- @re_esc = "\\".encode(@encoding) rescue ""
- @re_chars = /#{%"[-][\\.^$?*+{}()|# \r\n\t\f\v]".encode(@encoding)}/
- # @re_chars = /#{%"[-][\\.^$?*+{}()|# \r\n\t\f\v]".encode(@encoding, fallback: proc{""})}/
+ @re_esc = "\\".encode(@encoding).freeze rescue ""
+ @re_chars = /#{%"[-\\]\\[\\.^$?*+{}()|# \r\n\t\f\v]".encode(@encoding)}/
init_separators(options)
init_parsers(options)
@@ -1516,7 +1541,7 @@ class CSV
init_headers(options)
init_comments(options)
- options.delete(:encoding)
+ @force_encoding = !!(encoding || options.delete(:encoding))
options.delete(:internal_encoding)
options.delete(:external_encoding)
unless options.empty?
@@ -1656,10 +1681,13 @@ class CSV
output = row.map(&@quote).join(@col_sep) + @row_sep # quote and separate
if @io.is_a?(StringIO) and
- output.encoding != raw_encoding and
- (compatible_encoding = Encoding.compatible?(@io.string, output))
- @io.set_encoding(compatible_encoding)
- @io.seek(0, IO::SEEK_END)
+ output.encoding != (encoding = raw_encoding)
+ if @force_encoding
+ output = output.encode(encoding)
+ elsif (compatible_encoding = Encoding.compatible?(@io.string, output))
+ @io.set_encoding(compatible_encoding)
+ @io.seek(0, IO::SEEK_END)
+ end
end
@io << output
@@ -1831,7 +1859,7 @@ class CSV
csv.last << @col_sep
end
elsif part[0] == @quote_char
- # If we are staring a new quoted column
+ # If we are starting a new quoted column
if part[-1] != @quote_char || part.count(@quote_char) % 2 != 0
# start an extended column
csv << part[1..-1]
@@ -2075,7 +2103,7 @@ class CSV
# are set. When +field_name+ is <tt>:header_converters</tt> header converters
# are added instead.
#
- # The <tt>:unconverted_fields</tt> option is also actived for
+ # The <tt>:unconverted_fields</tt> option is also activated for
# <tt>:converters</tt> calls, if requested.
#
def init_converters(options, field_name = :converters)
@@ -2169,6 +2197,7 @@ class CSV
fields.map.with_index do |field, index|
converters.each do |converter|
+ break if field.nil?
field = if converter.arity == 1 # straight field converter
converter[field]
else # FieldInfo converter
diff --git a/lib/debug.rb b/lib/debug.rb
index fcbf849f0d..5d754d8ebb 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
# Copyright (C) 2000-2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
@@ -1008,6 +1009,29 @@ EOHELP
@stdout.print "\n"
end
+ # Prints all threads in @thread_list to @stdout. Returns a sorted array of
+ # values from the @thread_list hash.
+ #
+ # While in the debugger you can list all of
+ # the threads with: <b>DEBUGGER__.thread_list_all</b>
+ #
+ # (rdb:1) DEBUGGER__.thread_list_all
+ # +1 #<Thread:0x007fb2320c03f0 run> debug_me.rb.rb:3
+ # 2 #<Thread:0x007fb23218a538@debug_me.rb.rb:3 sleep>
+ # 3 #<Thread:0x007fb23218b0f0@debug_me.rb.rb:3 sleep>
+ # [1, 2, 3]
+ #
+ # Your current thread is indicated by a <b>+</b>
+ #
+ # Additionally you can list all threads with <b>th l</b>
+ #
+ # (rdb:1) th l
+ # +1 #<Thread:0x007f99328c0410 run> debug_me.rb:3
+ # 2 #<Thread:0x007f9932938230@debug_me.rb:3 sleep> debug_me.rb:3
+ # 3 #<Thread:0x007f9932938e10@debug_me.rb:3 sleep> debug_me.rb:3
+ #
+ # See DEBUGGER__ for more usage.
+
def thread_list_all
for th in @thread_list.values.sort
thread_list(th)
diff --git a/lib/delegate.rb b/lib/delegate.rb
index c33f7e40df..4ce3c53cc9 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# = delegate -- Support for the Delegation Pattern
#
# Documentation by James Edward Gray II and Gavin Sinclair
@@ -17,15 +18,10 @@
# yourself needing this control, have a look at Forwardable which is also in
# the standard library. It may suit your needs better.)
#
-# SimpleDelegator's implementation serves as a nice example if the use of
+# SimpleDelegator's implementation serves as a nice example of the use of
# Delegator:
#
# class SimpleDelegator < Delegator
-# def initialize(obj)
-# super # pass obj to Delegator constructor, required
-# @delegate_sd_obj = obj # store obj for future use
-# end
-#
# def __getobj__
# @delegate_sd_obj # return object we are delegating to, required
# end
@@ -48,7 +44,7 @@ class Delegator < BasicObject
undef_method m
end
private_instance_methods.each do |m|
- if /\Ablock_given\?\z|iterator\?\z|\A__raise__\z/ =~ m
+ if /\Ablock_given\?\z|iterator\?\z|\A__.*__\z/ =~ m
next
end
undef_method m
@@ -62,6 +58,12 @@ class Delegator < BasicObject
end
# :startdoc:
+ ##
+ # :method: raise
+ # Use __raise__ if your Delegator does not have a object to delegate the
+ # raise method call.
+ #
+
#
# Pass in the _obj_ to delegate method calls to. All methods supported by
# _obj_ will be delegated to.
@@ -76,16 +78,13 @@ class Delegator < BasicObject
def method_missing(m, *args, &block)
r = true
target = self.__getobj__ {r = false}
- begin
- if r && target.respond_to?(m)
- target.__send__(m, *args, &block)
- elsif ::Kernel.respond_to?(m, true)
- ::Kernel.instance_method(m).bind(self).(*args, &block)
- else
- super(m, *args, &block)
- end
- ensure
- $@.delete_if {|t| %r"\A#{Regexp.quote(__FILE__)}:(?:#{[__LINE__-7, __LINE__-5, __LINE__-3].join('|')}):"o =~ t} if $@
+
+ if r && target.respond_to?(m)
+ target.__send__(m, *args, &block)
+ elsif ::Kernel.respond_to?(m, true)
+ ::Kernel.instance_method(m).bind(self).(*args, &block)
+ else
+ super(m, *args, &block)
end
end
@@ -248,7 +247,7 @@ end
#
# class User
# def born_on
-# Date.new(1989, 09, 10)
+# Date.new(1989, 9, 10)
# end
# end
#
@@ -339,11 +338,7 @@ end
def Delegator.delegating_block(mid) # :nodoc:
lambda do |*args, &block|
target = self.__getobj__
- begin
- target.__send__(mid, *args, &block)
- ensure
- $@.delete_if {|t| /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}:/o =~ t} if $@
- end
+ target.__send__(mid, *args, &block)
end
end
@@ -409,37 +404,3 @@ def DelegateClass(superclass)
end
return klass
end
-
-# :enddoc:
-
-if __FILE__ == $0
- class ExtArray<DelegateClass(Array)
- def initialize()
- super([])
- end
- end
-
- ary = ExtArray.new
- p ary.class
- ary.push 25
- p ary
- ary.push 42
- ary.each {|x| p x}
-
- foo = Object.new
- def foo.test
- 25
- end
- def foo.iter
- yield self
- end
- def foo.error
- raise 'this is OK'
- end
- foo2 = SimpleDelegator.new(foo)
- p foo2
- foo2.instance_eval{print "foo\n"}
- p foo.test == foo2.test # => true
- p foo2.iter{[55,true]} # => true
- foo2.error # raise error!
-end
diff --git a/lib/drb.rb b/lib/drb.rb
index 93cc811e14..2bb4716fa2 100644
--- a/lib/drb.rb
+++ b/lib/drb.rb
@@ -1,2 +1,3 @@
+# frozen_string_literal: false
require 'drb/drb'
diff --git a/lib/drb/acl.rb b/lib/drb/acl.rb
index 29a378199f..520b7df71d 100644
--- a/lib/drb/acl.rb
+++ b/lib/drb/acl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# Copyright (c) 2000,2002,2003 Masatoshi SEKI
#
# acl.rb is copyrighted free software by Masatoshi SEKI.
@@ -223,28 +224,10 @@ class ACL
when 'deny'
@deny.add(domain)
else
- raise "Invalid ACL entry #{list.to_s}"
+ raise "Invalid ACL entry #{list}"
end
i += 2
end
end
end
-
-if __FILE__ == $0
- # example
- list = %w(deny all
- allow 192.168.1.1
- allow ::ffff:192.168.1.2
- allow 192.168.1.3
- )
-
- addr = ["AF_INET", 10, "lc630", "192.168.1.3"]
-
- acl = ACL.new
- p acl.allow_addr?(addr)
-
- acl = ACL.new(list, ACL::DENY_ALLOW)
- p acl.allow_addr?(addr)
-end
-
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 97965228bb..8011660156 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# = drb/drb.rb
#
@@ -47,7 +48,7 @@
require 'socket'
require 'thread'
-require 'fcntl'
+require 'io/wait'
require 'drb/eq'
#
@@ -177,6 +178,9 @@ require 'drb/eq'
# # Not necessary for this small example, but will be required
# # as soon as we pass a non-marshallable object as an argument
# # to a dRuby call.
+# #
+# # Note: this must be called at least once per process to take any effect.
+# # This is particularly important if your application forks.
# DRb.start_service
#
# timeserver = DRbObject.new_with_uri(SERVER_URI)
@@ -742,7 +746,7 @@ module DRb
end
end
if first && (config[:auto_load] != false)
- auto_load(uri, config)
+ auto_load(uri)
return open(uri, config, false)
end
raise DRbBadURI, 'can\'t parse uri:' + uri
@@ -766,7 +770,7 @@ module DRb
end
end
if first && (config[:auto_load] != false)
- auto_load(uri, config)
+ auto_load(uri)
return open_server(uri, config, false)
end
raise DRbBadURI, 'can\'t parse uri:' + uri
@@ -789,14 +793,14 @@ module DRb
end
end
if first && (config[:auto_load] != false)
- auto_load(uri, config)
+ auto_load(uri)
return uri_option(uri, config, false)
end
raise DRbBadURI, 'can\'t parse uri:' + uri
end
module_function :uri_option
- def auto_load(uri, config) # :nodoc:
+ def auto_load(uri) # :nodoc:
if uri =~ /^drb([a-z0-9]+):/
require("drb/#{$1}") rescue nil
end
@@ -902,6 +906,7 @@ module DRb
@acl = config[:tcp_acl]
@msg = DRbMessage.new(config)
set_sockopt(@socket)
+ @shutdown_pipe_r, @shutdown_pipe_w = IO.pipe
end
# Get the URI that we are connected to.
@@ -949,14 +954,28 @@ module DRb
@socket.close
@socket = nil
end
+ close_shutdown_pipe
end
+ def close_shutdown_pipe
+ if @shutdown_pipe_r && !@shutdown_pipe_r.closed?
+ @shutdown_pipe_r.close
+ @shutdown_pipe_r = nil
+ end
+ if @shutdown_pipe_w && !@shutdown_pipe_w.closed?
+ @shutdown_pipe_w.close
+ @shutdown_pipe_w = nil
+ end
+ end
+ private :close_shutdown_pipe
+
# On the server side, for an instance returned by #open_server,
# accept a client connection and return a new instance to handle
# the server's side of this client-server session.
def accept
while true
- s = @socket.accept
+ s = accept_or_shutdown
+ return nil unless s
break if (@acl ? @acl.allow_socket?(s) : true)
s.close
end
@@ -968,10 +987,24 @@ module DRb
self.class.new(uri, s, @config)
end
+ def accept_or_shutdown
+ readables, = IO.select([@socket, @shutdown_pipe_r])
+ if readables.include? @shutdown_pipe_r
+ return nil
+ end
+ @socket.accept
+ end
+ private :accept_or_shutdown
+
+ # Graceful shutdown
+ def shutdown
+ @shutdown_pipe_w.close if @shutdown_pipe_w && !@shutdown_pipe_w.closed?
+ end
+
# Check to see if this connection is alive.
def alive?
return false unless @socket
- if IO.select([@socket], nil, nil, 0)
+ if @socket.to_io.wait_readable(0)
close
return false
end
@@ -980,7 +1013,6 @@ module DRb
def set_sockopt(soc) # :nodoc:
soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
- soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
end
end
@@ -992,7 +1024,7 @@ module DRb
def initialize(option)
@option = option.to_s
end
- attr :option
+ attr_reader :option
def to_s; @option; end
def ==(other)
@@ -1435,7 +1467,12 @@ module DRb
if Thread.current['DRb'] && Thread.current['DRb']['server'] == self
Thread.current['DRb']['stop_service'] = true
else
- @thread.kill.join
+ if @protocol.respond_to? :shutdown
+ @protocol.shutdown
+ else
+ [@thread, *@grp.list].each {|thread| thread.kill} # xxx: Thread#kill
+ end
+ @thread.join
end
end
@@ -1460,8 +1497,7 @@ module DRb
def run
Thread.start do
begin
- while true
- main_loop
+ while main_loop
end
ensure
@protocol.close if @protocol
@@ -1591,16 +1627,9 @@ module DRb
end
- if RUBY_VERSION >= '1.8'
- require 'drb/invokemethod'
- class InvokeMethod
- include InvokeMethod18Mixin
- end
- else
- require 'drb/invokemethod16'
- class InvokeMethod
- include InvokeMethod16Mixin
- end
+ require 'drb/invokemethod'
+ class InvokeMethod
+ include InvokeMethod18Mixin
end
# The main loop performed by a DRbServer's internal thread.
@@ -1611,7 +1640,9 @@ module DRb
# returning responses, until the client closes the connection
# or a local method call fails.
def main_loop
- Thread.start(@protocol.accept) do |client|
+ client0 = @protocol.accept
+ return nil if !client0
+ Thread.start(client0) do |client|
@grp.add Thread.current
Thread.current['DRb'] = { 'client' => client ,
'server' => self }
diff --git a/lib/drb/eq.rb b/lib/drb/eq.rb
index 553f30c598..15ca5cae42 100644
--- a/lib/drb/eq.rb
+++ b/lib/drb/eq.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module DRb
class DRbObject # :nodoc:
def ==(other)
diff --git a/lib/drb/extserv.rb b/lib/drb/extserv.rb
index c70ced877c..1cb1be4709 100644
--- a/lib/drb/extserv.rb
+++ b/lib/drb/extserv.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
=begin
external service
Copyright (c) 2000,2002 Masatoshi SEKI
@@ -41,33 +42,3 @@ module DRb
end
end
end
-
-# :stopdoc:
-
-if __FILE__ == $0
- class Foo
- include DRbUndumped
-
- def initialize(str)
- @str = str
- end
-
- def hello(it)
- "#{it}: #{self}"
- end
-
- def to_s
- @str
- end
- end
-
- cmd = ARGV.shift
- case cmd
- when 'itest1', 'itest2'
- front = Foo.new(cmd)
- manager = DRb::DRbServer.new(nil, front)
- es = DRb::ExtServ.new(ARGV.shift, ARGV.shift, manager)
- es.server.thread.join
- end
-end
-
diff --git a/lib/drb/extservm.rb b/lib/drb/extservm.rb
index 8a7fc316af..e2637aa62c 100644
--- a/lib/drb/extservm.rb
+++ b/lib/drb/extservm.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
=begin
external service manager
Copyright (c) 2000 Masatoshi SEKI
@@ -37,7 +38,7 @@ module DRb
synchronize do
while true
server = @servers[name]
- return server if server && server.alive?
+ return server if server&.alive?
invoke_service(name)
@cond.wait
end
diff --git a/lib/drb/gw.rb b/lib/drb/gw.rb
index b3568ab08d..d000507644 100644
--- a/lib/drb/gw.rb
+++ b/lib/drb/gw.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'drb/drb'
require 'monitor'
diff --git a/lib/drb/invokemethod.rb b/lib/drb/invokemethod.rb
index 71ebec11f6..0fae6d52b6 100644
--- a/lib/drb/invokemethod.rb
+++ b/lib/drb/invokemethod.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# for ruby-1.8.0
module DRb # :nodoc: all
diff --git a/lib/drb/observer.rb b/lib/drb/observer.rb
index cab9ebc60b..3ee15331a1 100644
--- a/lib/drb/observer.rb
+++ b/lib/drb/observer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'observer'
module DRb
diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb
index 78c0038abc..8d2724e736 100644
--- a/lib/drb/ssl.rb
+++ b/lib/drb/ssl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'socket'
require 'openssl'
require 'drb/drb'
@@ -322,12 +323,13 @@ module DRb
def accept # :nodoc:
begin
while true
- soc = @socket.accept
+ soc = accept_or_shutdown
+ return nil unless soc
break if (@acl ? @acl.allow_socket?(soc) : true)
soc.close
end
begin
- ssl = @config.accept(soc)
+ ssl = @config.accept(soc)
rescue Exception
soc.close
raise
diff --git a/lib/drb/timeridconv.rb b/lib/drb/timeridconv.rb
index 4ea3035f39..7e2a6cf998 100644
--- a/lib/drb/timeridconv.rb
+++ b/lib/drb/timeridconv.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'drb/drb'
require 'monitor'
@@ -17,26 +18,27 @@ module DRb
class InvalidIndexError < RuntimeError; end
- def initialize(timeout=600)
+ def initialize(keeping=600)
super()
@sentinel = Object.new
@gc = {}
- @curr = {}
@renew = {}
- @timeout = timeout
- @keeper = keeper
+ @keeping = keeping
+ @expires = Time.now + @keeping
end
def add(obj)
synchronize do
+ rotate
key = obj.__id__
- @curr[key] = obj
+ @renew[key] = obj
return key
end
end
def fetch(key, dv=@sentinel)
synchronize do
+ rotate
obj = peek(key)
if obj == @sentinel
return dv unless dv == @sentinel
@@ -47,42 +49,35 @@ module DRb
end
end
- def include?(key)
- synchronize do
- obj = peek(key)
- return false if obj == @sentinel
- true
- end
- end
-
+ private
def peek(key)
synchronize do
- return @curr.fetch(key, @renew.fetch(key, @gc.fetch(key, @sentinel)))
+ return @renew.fetch(key) { @gc.fetch(key, @sentinel) }
end
end
- private
- def alternate
+ def rotate
synchronize do
- @gc = @curr # GCed
- @curr = @renew
+ return if @expires > Time.now
+ @gc = @renew # GCed
@renew = {}
+ @expires = Time.now + @keeping
end
end
def keeper
Thread.new do
loop do
- alternate
- sleep(@timeout)
+ rotate
+ sleep(@keeping)
end
end
end
end
- # Creates a new TimerIdConv which will hold objects for +timeout+ seconds.
- def initialize(timeout=600)
- @holder = TimerHolder2.new(timeout)
+ # Creates a new TimerIdConv which will hold objects for +keeping+ seconds.
+ def initialize(keeping=600)
+ @holder = TimerHolder2.new(keeping)
end
def to_obj(ref) # :nodoc:
diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb
index 4d245780a5..adacf6df5b 100644
--- a/lib/drb/unix.rb
+++ b/lib/drb/unix.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'socket'
require 'drb/drb'
require 'tmpdir'
@@ -98,15 +99,17 @@ module DRb
@socket.close
File.unlink(path) if @server_mode
@socket = nil
+ close_shutdown_pipe
end
def accept
- s = @socket.accept
+ s = accept_or_shutdown
+ return nil unless s
self.class.new(nil, s, @config)
end
def set_sockopt(soc)
- soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
+ # no-op for now
end
end
diff --git a/lib/e2mmap.rb b/lib/e2mmap.rb
index b75c431f92..a9990b5ec5 100644
--- a/lib/e2mmap.rb
+++ b/lib/e2mmap.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
#--
# e2mmap.rb - for Ruby 1.1
@@ -52,7 +53,6 @@
#
#
module Exception2MessageMapper
- @RCS_ID='-$Id: e2mmap.rb,v 1.10 1999/02/17 12:33:17 keiju Exp keiju $-'
E2MM = Exception2MessageMapper # :nodoc:
@@ -142,8 +142,6 @@ module Exception2MessageMapper
def E2MM.Raise(klass = E2MM, err = nil, *rest)
if form = e2mm_message(klass, err)
b = $@.nil? ? caller(1) : $@
- #p $@
- #p __FILE__
b.shift if b[0] =~ /^#{Regexp.quote(__FILE__)}:/
raise err, sprintf(form, *rest), b
else
@@ -157,7 +155,6 @@ module Exception2MessageMapper
def E2MM.e2mm_message(klass, exp)
for c in klass.ancestors
if mes = @MessageMap[[c,exp]]
- #p mes
m = klass.instance_eval('"' + mes + '"')
return m
end
diff --git a/lib/erb.rb b/lib/erb.rb
index 5d32c47774..e89d9c1fd0 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -1,4 +1,5 @@
# -*- coding: us-ascii -*-
+# frozen_string_literal: false
# = ERB -- Ruby Templating
#
# Author:: Masatoshi SEKI
@@ -68,7 +69,7 @@ require "cgi/util"
# a magic comment, however, it returns a string in the encoding specified
# by the magic comment.
#
-# # -*- coding: UTF-8 -*-
+# # -*- coding: utf-8 -*-
# require 'erb'
#
# template = ERB.new <<EOF
@@ -428,10 +429,10 @@ class ERB
end
def trim_line1(line)
- line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\n|%>|\n|\z)/m) do |tokens|
+ line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\r?\n|%>|\n|\z)/m) do |tokens|
tokens.each do |token|
next if token.empty?
- if token == "%>\n"
+ if token == "%>\n" || token == "%>\r\n"
yield('%>')
yield(:cr)
else
@@ -443,11 +444,11 @@ class ERB
def trim_line2(line)
head = nil
- line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\n|%>|\n|\z)/m) do |tokens|
+ line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\r?\n|%>|\n|\z)/m) do |tokens|
tokens.each do |token|
next if token.empty?
head = token unless head
- if token == "%>\n"
+ if token == "%>\n" || token == "%>\r\n"
yield('%>')
if is_erb_stag?(head)
yield(:cr)
@@ -464,12 +465,12 @@ class ERB
end
def explicit_trim_line(line)
- line.scan(/(.*?)(^[ \t]*<%\-|<%\-|<%%|%%>|<%=|<%#|<%|-%>\n|-%>|%>|\z)/m) do |tokens|
+ line.scan(/(.*?)(^[ \t]*<%\-|<%\-|<%%|%%>|<%=|<%#|<%|-%>\r?\n|-%>|%>|\z)/m) do |tokens|
tokens.each do |token|
next if token.empty?
if @stag.nil? && /[ \t]*<%-/ =~ token
yield('<%')
- elsif @stag && token == "-%>\n"
+ elsif @stag && token == "-%>\n" || token == "-%>\r\n"
yield('%>')
yield(:cr)
elsif @stag && token == '-%>'
@@ -506,8 +507,8 @@ class ERB
require 'strscan'
class SimpleScanner2 < Scanner # :nodoc:
def scan
- stag_reg = /(.*?)(<%%|<%=|<%#|<%|\z)/m
- etag_reg = /(.*?)(%%>|%>|\z)/m
+ stag_reg = /(.*?)(<%[%=#]?|\z)/m
+ etag_reg = /(.*?)(%%?>|\z)/m
scanner = StringScanner.new(@src)
while ! scanner.eos?
scanner.scan(@stag ? etag_reg : stag_reg)
@@ -532,7 +533,7 @@ class ERB
yield('<%')
elsif elem == '-%>'
yield('%>')
- yield(:cr) if scanner.scan(/(\n|\z)/)
+ yield(:cr) if scanner.scan(/(\r?\n|\z)/)
else
yield(elem)
end
@@ -548,7 +549,7 @@ class ERB
def initialize(compiler, enc=nil)
@compiler = compiler
@line = []
- @script = enc ? "#coding:#{enc.to_s}\n" : ""
+ @script = enc ? "#coding:#{enc}\n" : ""
@compiler.pre_cmd.each do |x|
push(x)
end
@@ -717,7 +718,7 @@ class ERB
comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
if %r"coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
enc = $1.sub(/-(?:mac|dos|unix)/i, '')
- enc = Encoding.find(enc)
+ Encoding.find(enc)
end
end
end
@@ -797,8 +798,9 @@ class ERB
@safe_level = safe_level
compiler = make_compiler(trim_mode)
set_eoutvar(compiler, eoutvar)
- @src, @enc = *compiler.compile(str)
+ @src, @encoding = *compiler.compile(str)
@filename = nil
+ @lineno = 0
end
##
@@ -811,10 +813,22 @@ class ERB
# The Ruby code generated by ERB
attr_reader :src
+ # The encoding to eval
+ attr_reader :encoding
+
# The optional _filename_ argument passed to Kernel#eval when the ERB code
# is run
attr_accessor :filename
+ # The optional _lineno_ argument passed to Kernel#eval when the ERB code
+ # is run
+ attr_accessor :lineno
+
+ def location=((filename, lineno))
+ @filename = filename
+ @lineno = lineno if lineno
+ end
+
#
# Can be used to set _eoutvar_ as described in ERB::new. It's probably
# easier to just use the constructor though, since calling this method
@@ -837,17 +851,17 @@ class ERB
# the results of that code. (See ERB::new for details on how this process
# can be affected by _safe_level_.)
#
- # _b_ accepts a Binding or Proc object which is used to set the context of
+ # _b_ accepts a Binding object which is used to set the context of
# code evaluation.
#
def result(b=new_toplevel)
if @safe_level
proc {
$SAFE = @safe_level
- eval(@src, b, (@filename || '(erb)'), 0)
+ eval(@src, b, (@filename || '(erb)'), @lineno)
}.call
else
- eval(@src, b, (@filename || '(erb)'), 0)
+ eval(@src, b, (@filename || '(erb)'), @lineno)
end
end
@@ -869,7 +883,7 @@ class ERB
# print MyClass.new.render('foo', 123)
def def_method(mod, methodname, fname='(ERB)')
src = self.src
- magic_comment = "#coding:#{@enc}\n"
+ magic_comment = "#coding:#{@encoding}\n"
mod.module_eval do
eval(magic_comment + "def #{methodname}\n" + src + "\nend\n", binding, fname, -2)
end
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 3b4e30213e..bc9e959fab 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# = fileutils.rb
#
@@ -12,35 +13,37 @@
#
# === Module Functions
#
-# cd(dir, options)
-# cd(dir, options) {|dir| .... }
-# pwd()
-# mkdir(dir, options)
-# mkdir(list, options)
-# mkdir_p(dir, options)
-# mkdir_p(list, options)
-# rmdir(dir, options)
-# rmdir(list, options)
-# ln(old, new, options)
-# ln(list, destdir, options)
-# ln_s(old, new, options)
-# ln_s(list, destdir, options)
-# ln_sf(src, dest, options)
-# cp(src, dest, options)
-# cp(list, dir, options)
-# cp_r(src, dest, options)
-# cp_r(list, dir, options)
-# mv(src, dest, options)
-# mv(list, dir, options)
-# rm(list, options)
-# rm_r(list, options)
-# rm_rf(list, options)
-# install(src, dest, mode = <src's>, options)
-# chmod(mode, list, options)
-# chmod_R(mode, list, options)
-# chown(user, group, list, options)
-# chown_R(user, group, list, options)
-# touch(list, options)
+# require 'fileutils'
+#
+# FileUtils.cd(dir, options)
+# FileUtils.cd(dir, options) {|dir| .... }
+# FileUtils.pwd()
+# FileUtils.mkdir(dir, options)
+# FileUtils.mkdir(list, options)
+# FileUtils.mkdir_p(dir, options)
+# FileUtils.mkdir_p(list, options)
+# FileUtils.rmdir(dir, options)
+# FileUtils.rmdir(list, options)
+# FileUtils.ln(old, new, options)
+# FileUtils.ln(list, destdir, options)
+# FileUtils.ln_s(old, new, options)
+# FileUtils.ln_s(list, destdir, options)
+# FileUtils.ln_sf(src, dest, options)
+# FileUtils.cp(src, dest, options)
+# FileUtils.cp(list, dir, options)
+# FileUtils.cp_r(src, dest, options)
+# FileUtils.cp_r(list, dir, options)
+# FileUtils.mv(src, dest, options)
+# FileUtils.mv(list, dir, options)
+# FileUtils.rm(list, options)
+# FileUtils.rm_r(list, options)
+# FileUtils.rm_rf(list, options)
+# FileUtils.install(src, dest, mode = <src's>, options)
+# FileUtils.chmod(mode, list, options)
+# FileUtils.chmod_R(mode, list, options)
+# FileUtils.chown(user, group, list, options)
+# FileUtils.chown_R(user, group, list, options)
+# FileUtils.touch(list, options)
#
# The <tt>options</tt> parameter is a hash of options, taken from the list
# <tt>:force</tt>, <tt>:noop</tt>, <tt>:preserve</tt>, and <tt>:verbose</tt>.
@@ -53,15 +56,15 @@
#
# There are some `low level' methods, which do not accept any option:
#
-# copy_entry(src, dest, preserve = false, dereference = false)
-# copy_file(src, dest, preserve = false, dereference = true)
-# copy_stream(srcstream, deststream)
-# remove_entry(path, force = false)
-# remove_entry_secure(path, force = false)
-# remove_file(path, force = false)
-# compare_file(path_a, path_b)
-# compare_stream(stream_a, stream_b)
-# uptodate?(file, cmp_list)
+# FileUtils.copy_entry(src, dest, preserve = false, dereference = false)
+# FileUtils.copy_file(src, dest, preserve = false, dereference = true)
+# FileUtils.copy_stream(srcstream, deststream)
+# FileUtils.remove_entry(path, force = false)
+# FileUtils.remove_entry_secure(path, force = false)
+# FileUtils.remove_file(path, force = false)
+# FileUtils.compare_file(path_a, path_b)
+# FileUtils.compare_stream(stream_a, stream_b)
+# FileUtils.uptodate?(file, cmp_list)
#
# == module FileUtils::Verbose
#
@@ -136,7 +139,7 @@ module FileUtils
#
# Options: (none)
#
- # Returns true if +newer+ is newer than all +old_list+.
+ # Returns true if +new+ is newer than all +old_list+.
# Non-existent files are older than any file.
#
# FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \
@@ -154,10 +157,10 @@ module FileUtils
end
module_function :uptodate?
- def remove_tailing_slash(dir)
+ def remove_trailing_slash(dir)
dir == '/' ? dir : dir.chomp(?/)
end
- private_module_function :remove_tailing_slash
+ private_module_function :remove_trailing_slash
#
# Options: mode noop verbose
@@ -205,7 +208,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| remove_tailing_slash(path)}.each do |path|
+ list.map {|path| remove_trailing_slash(path)}.each do |path|
# optimize for the most common case
begin
fu_mkdir path, options[:mode]
@@ -219,6 +222,7 @@ module FileUtils
stack.push path
path = File.dirname(path)
end
+ stack.pop # root directory should exist
stack.reverse_each do |dir|
begin
fu_mkdir dir, options[:mode]
@@ -242,7 +246,7 @@ module FileUtils
OPT_TABLE['makedirs'] = [:mode, :noop, :verbose]
def fu_mkdir(path, mode) #:nodoc:
- path = remove_tailing_slash(path)
+ path = remove_trailing_slash(path)
if mode
Dir.mkdir path, mode
File.chmod mode, path
@@ -253,7 +257,7 @@ module FileUtils
private_module_function :fu_mkdir
#
- # Options: noop, verbose
+ # Options: parents, noop, verbose
#
# Removes one or more directories.
#
@@ -270,14 +274,14 @@ module FileUtils
return if options[:noop]
list.each do |dir|
begin
- Dir.rmdir(dir = remove_tailing_slash(dir))
+ Dir.rmdir(dir = remove_trailing_slash(dir))
if parents
until (parent = File.dirname(dir)) == '.' or parent == dir
dir = parent
Dir.rmdir(dir)
end
end
- rescue Errno::ENOTEMPTY, Errno::ENOENT
+ rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
end
end
end
@@ -455,8 +459,8 @@ module FileUtils
# Both of +src+ and +dest+ must be a path name.
# +src+ must exist, +dest+ must not exist.
#
- # If +preserve+ is true, this method preserves owner, group, permissions
- # and modified time.
+ # If +preserve+ is true, this method preserves owner, group, and
+ # modified time. Permissions are copied regardless +preserve+.
#
# If +dereference_root+ is true, this method dereference tree root.
#
@@ -516,7 +520,7 @@ module FileUtils
begin
if destent.exist?
if destent.directory?
- raise Errno::EEXIST, dest
+ raise Errno::EEXIST, d
else
destent.remove_file if rename_cannot_overwrite_file?
end
@@ -545,7 +549,7 @@ module FileUtils
OPT_TABLE['move'] = [:force, :noop, :verbose, :secure]
def rename_cannot_overwrite_file? #:nodoc:
- /cygwin|mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
+ /emx/ =~ RUBY_PLATFORM
end
private_module_function :rename_cannot_overwrite_file?
@@ -854,7 +858,8 @@ module FileUtils
fu_check_options options, OPT_TABLE['install']
fu_output_message "install -c#{options[:preserve] && ' -p'}#{options[:mode] ? (' -m 0%o' % options[:mode]) : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
return if options[:noop]
- fu_each_src_dest(src, dest) do |s, d, st|
+ fu_each_src_dest(src, dest) do |s, d|
+ st = File.stat(s)
unless File.exist?(d) and compare_file(s, d)
remove_file d, true
copy_file s, d
@@ -1097,49 +1102,37 @@ module FileUtils
begin
require 'etc'
+ rescue LoadError # rescue LoadError for miniruby
+ end
- def fu_get_uid(user) #:nodoc:
- return nil unless user
- case user
- when Integer
- user
- when /\A\d+\z/
- user.to_i
- else
- Etc.getpwnam(user).uid
- end
- end
- private_module_function :fu_get_uid
-
- def fu_get_gid(group) #:nodoc:
- return nil unless group
- case group
- when Integer
- group
- when /\A\d+\z/
- group.to_i
- else
- Etc.getgrnam(group).gid
- end
- end
- private_module_function :fu_get_gid
-
- rescue LoadError
- # need Win32 support???
-
- def fu_get_uid(user) #:nodoc:
- user # FIXME
+ def fu_get_uid(user) #:nodoc:
+ return nil unless user
+ case user
+ when Integer
+ user
+ when /\A\d+\z/
+ user.to_i
+ else
+ Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil
end
- private_module_function :fu_get_uid
-
- def fu_get_gid(group) #:nodoc:
- group # FIXME
+ end
+ private_module_function :fu_get_uid
+
+ def fu_get_gid(group) #:nodoc:
+ return nil unless group
+ case group
+ when Integer
+ group
+ when /\A\d+\z/
+ group.to_i
+ else
+ Etc.getgrnam(group) ? Etc.getgrnam(group).gid : nil
end
- private_module_function :fu_get_gid
end
+ private_module_function :fu_get_gid
#
- # Options: noop verbose
+ # Options: noop verbose mtime nocreate
#
# Updates modification time (mtime) and access time (atime) of file(s) in
# +list+. Files are created if they don't exist.
@@ -1252,7 +1245,12 @@ module FileUtils
end
def exist?
- lstat! ? true : false
+ begin
+ lstat
+ true
+ rescue Errno::ENOENT
+ false
+ end
end
def file?
@@ -1362,7 +1360,7 @@ module FileUtils
when file?
copy_file dest
when directory?
- if !File.exist?(dest) and descendant_diretory?(dest, path)
+ if !File.exist?(dest) and descendant_directory?(dest, path)
raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest]
end
begin
@@ -1493,6 +1491,7 @@ module FileUtils
end
end
end
+ ensure
yield self
end
@@ -1557,7 +1556,7 @@ module FileUtils
end
SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : ""
- def descendant_diretory?(descendant, ascendant)
+ def descendant_directory?(descendant, ascendant)
/\A(?#{SYSCASE}:#{Regexp.quote(ascendant)})#{DIRECTORY_TERM}/ =~ File.dirname(descendant)
end
end # class Entry_
@@ -1570,7 +1569,7 @@ module FileUtils
def fu_each_src_dest(src, dest) #:nodoc:
fu_each_src_dest0(src, dest) do |s, d|
raise ArgumentError, "same file: #{s} and #{d}" if fu_same?(s, d)
- yield s, d, File.stat(s)
+ yield s, d
end
end
private_module_function :fu_each_src_dest
@@ -1659,7 +1658,7 @@ module FileUtils
#
# Returns an Array of option names of the method +mid+.
#
- # p FileUtils.options(:rm) #=> ["noop", "verbose", "force"]
+ # p FileUtils.options_of(:rm) #=> ["noop", "verbose", "force"]
#
def FileUtils.options_of(mid)
OPT_TABLE[mid.to_s].map {|sym| sym.to_s }
diff --git a/lib/find.rb b/lib/find.rb
index 6f3e4282ed..aa7a3c082b 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# find.rb: the Find module for processing all files under a given directory.
#
@@ -34,12 +35,13 @@ module Find
#
# See the +Find+ module documentation for an example.
#
- def find(*paths) # :yield: path
- block_given? or return enum_for(__method__, *paths)
+ def find(*paths, ignore_error: true) # :yield: path
+ block_given? or return enum_for(__method__, *paths, ignore_error: ignore_error)
fs_encoding = Encoding.find("filesystem")
paths.collect!{|d| raise Errno::ENOENT unless File.exist?(d); d.dup}.each do |path|
+ path = path.to_path if path.respond_to? :to_path
enc = path.encoding == Encoding::US_ASCII ? fs_encoding : path.encoding
ps = [path]
while file = ps.shift
@@ -48,12 +50,14 @@ module Find
begin
s = File.lstat(file)
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
+ raise unless ignore_error
next
end
if s.directory? then
begin
fs = Dir.entries(file, encoding: enc)
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
+ raise unless ignore_error
next
end
fs.sort!
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index ecc5f03843..e78b9ed1e0 100644
--- a/lib/forwardable.rb
+++ b/lib/forwardable.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# forwardable.rb -
# $Release Version: 1.1$
@@ -177,28 +178,44 @@ module Forwardable
# q.push 23 #=> NoMethodError
#
def def_instance_delegator(accessor, method, ali = method)
- line_no = __LINE__; str = %{
- def #{ali}(*args, &block)
- begin
- #{accessor}.__send__(:#{method}, *args, &block)
- rescue Exception
- $@.delete_if{|s| Forwardable::FILE_REGEXP =~ s} unless Forwardable::debug
- ::Kernel::raise
- end
- end
- }
- # If it's not a class or module, it's an instance
- begin
- module_eval(str, __FILE__, line_no)
- rescue
- instance_eval(str, __FILE__, line_no)
- end
+ gen = Forwardable._delegator_method(self, accessor, method, ali)
+ # If it's not a class or module, it's an instance
+ (Module === self ? self : singleton_class).module_eval(&gen)
end
alias delegate instance_delegate
alias def_delegators def_instance_delegators
alias def_delegator def_instance_delegator
+
+ def self._delegator_method(obj, accessor, method, ali)
+ accessor = accessor.to_s unless Symbol === accessor
+
+ if Module === obj ?
+ obj.method_defined?(accessor) || obj.private_method_defined?(accessor) :
+ obj.respond_to?(accessor, true)
+ accessor = "#{accessor}()"
+ end
+
+ line_no = __LINE__+1; str = "#{<<-"begin;"}\n#{<<-"end;"}"
+ begin;
+ proc do
+ def #{ali}(*args, &block)
+ begin
+ #{accessor}
+ ensure
+ $@.delete_if {|s| ::Forwardable::FILE_REGEXP =~ s} if $@ and !::Forwardable::debug
+ end.__send__ :#{method}, *args, &block
+ end
+ end
+ end;
+
+ RubyVM::InstructionSequence
+ .compile(str, __FILE__, __FILE__, line_no,
+ trace_instruction: false,
+ tailcall_optimization: true)
+ .eval
+ end
end
# SingleForwardable can be used to setup delegation at the object level as well.
@@ -269,18 +286,9 @@ module SingleForwardable
# the method of the same name in _accessor_). If _new_name_ is
# provided, it is used as the name for the delegate method.
def def_single_delegator(accessor, method, ali = method)
- str = %{
- def #{ali}(*args, &block)
- begin
- #{accessor}.__send__(:#{method}, *args, &block)
- rescue Exception
- $@.delete_if{|s| Forwardable::FILE_REGEXP =~ s} unless Forwardable::debug
- ::Kernel::raise
- end
- end
- }
+ gen = Forwardable._delegator_method(self, accessor, method, ali)
- instance_eval(str, __FILE__, __LINE__)
+ instance_eval(&gen)
end
alias delegate single_delegate
diff --git a/lib/getoptlong.rb b/lib/getoptlong.rb
index cf635f0438..8aa91b82e0 100644
--- a/lib/getoptlong.rb
+++ b/lib/getoptlong.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# GetoptLong for Ruby
#
@@ -574,7 +575,7 @@ class GetoptLong
else
#
# This is a non-option argument.
- # Only RETURN_IN_ORDER falled into here.
+ # Only RETURN_IN_ORDER fell into here.
#
return '', argument
end
diff --git a/lib/gserver.rb b/lib/gserver.rb
deleted file mode 100644
index 4d566fcf2e..0000000000
--- a/lib/gserver.rb
+++ /dev/null
@@ -1,310 +0,0 @@
-#
-# Copyright (C) 2001 John W. Small All Rights Reserved
-#
-# Author:: John W. Small
-# Documentation:: Gavin Sinclair
-# Licence:: Ruby License
-
-require "socket"
-require "thread"
-
-#
-# GServer implements a generic server, featuring thread pool management,
-# simple logging, and multi-server management. See HttpServer in
-# <tt>xmlrpc/httpserver.rb</tt> in the Ruby standard library for an example of
-# GServer in action.
-#
-# Any kind of application-level server can be implemented using this class.
-# It accepts multiple simultaneous connections from clients, up to an optional
-# maximum number. Several _services_ (i.e. one service per TCP port) can be
-# run simultaneously, and stopped at any time through the class method
-# <tt>GServer.stop(port)</tt>. All the threading issues are handled, saving
-# you the effort. All events are optionally logged, but you can provide your
-# own event handlers if you wish.
-#
-# == Example
-#
-# Using GServer is simple. Below we implement a simple time server, run it,
-# query it, and shut it down. Try this code in +irb+:
-#
-# require 'gserver'
-#
-# #
-# # A server that returns the time in seconds since 1970.
-# #
-# class TimeServer < GServer
-# def initialize(port=10001, *args)
-# super(port, *args)
-# end
-# def serve(io)
-# io.puts(Time.now.to_s)
-# end
-# end
-#
-# # Run the server with logging enabled (it's a separate thread).
-# server = TimeServer.new
-# server.audit = true # Turn logging on.
-# server.start
-#
-# # *** Now point your browser to http://localhost:10001 to see it working ***
-#
-# # See if it's still running.
-# GServer.in_service?(10001) # -> true
-# server.stopped? # -> false
-#
-# # Shut the server down gracefully.
-# server.shutdown
-#
-# # Alternatively, stop it immediately.
-# GServer.stop(10001)
-# # or, of course, "server.stop".
-#
-# All the business of accepting connections and exception handling is taken
-# care of. All we have to do is implement the method that actually serves the
-# client.
-#
-# === Advanced
-#
-# As the example above shows, the way to use GServer is to subclass it to
-# create a specific server, overriding the +serve+ method. You can override
-# other methods as well if you wish, perhaps to collect statistics, or emit
-# more detailed logging.
-#
-# * #connecting
-# * #disconnecting
-# * #starting
-# * #stopping
-#
-# The above methods are only called if auditing is enabled, via #audit=.
-#
-# You can also override #log and #error if, for example, you wish to use a
-# more sophisticated logging system.
-#
-class GServer
-
- DEFAULT_HOST = "127.0.0.1"
-
- def serve(io)
- end
-
- @@services = {} # Hash of opened ports, i.e. services
- @@servicesMutex = Mutex.new
-
- # Stop the server running on the given port, bound to the given host
- #
- # +port+:: port, as a Fixnum, of the server to stop
- # +host+:: host on which to find the server to stop
- def GServer.stop(port, host = DEFAULT_HOST)
- @@servicesMutex.synchronize {
- @@services[host][port].stop
- }
- end
-
- # Check if a server is running on the given port and host
- #
- # +port+:: port, as a Fixnum, of the server to check
- # +host+:: host on which to find the server to check
- #
- # Returns true if a server is running on that port and host.
- def GServer.in_service?(port, host = DEFAULT_HOST)
- @@services.has_key?(host) and
- @@services[host].has_key?(port)
- end
-
- # Stop the server
- def stop
- @connectionsMutex.synchronize {
- if @tcpServerThread
- @tcpServerThread.raise "stop"
- end
- }
- end
-
- # Returns true if the server has stopped.
- def stopped?
- @tcpServerThread == nil
- end
-
- # Schedule a shutdown for the server
- def shutdown
- @shutdown = true
- end
-
- # Return the current number of connected clients
- def connections
- @connections.size
- end
-
- # Join with the server thread
- def join
- @tcpServerThread.join if @tcpServerThread
- end
-
- # Port on which to listen, as a Fixnum
- attr_reader :port
- # Host on which to bind, as a String
- attr_reader :host
- # Maximum number of connections to accept at at ime, as a Fixnum
- attr_reader :maxConnections
- # IO Device on which log messages should be written
- attr_accessor :stdlog
- # Set to true to cause the callbacks #connecting, #disconnecting, #starting,
- # and #stopping to be called during the server's lifecycle
- attr_accessor :audit
- # Set to true to show more detailed logging
- attr_accessor :debug
-
- # Called when a client connects, if auditing is enabled.
- #
- # +client+:: a TCPSocket instances representing the client that connected
- #
- # Return true to allow this client to connect, false to prevent it.
- def connecting(client)
- addr = client.peeraddr
- log("#{self.class.to_s} #{@host}:#{@port} client:#{addr[1]} " +
- "#{addr[2]}<#{addr[3]}> connect")
- true
- end
-
-
- # Called when a client disconnects, if audition is enabled.
- #
- # +clientPort+:: the port of the client that is connecting
- def disconnecting(clientPort)
- log("#{self.class.to_s} #{@host}:#{@port} " +
- "client:#{clientPort} disconnect")
- end
-
- protected :connecting, :disconnecting
-
- # Called when the server is starting up, if auditing is enabled.
- def starting()
- log("#{self.class.to_s} #{@host}:#{@port} start")
- end
-
- # Called when the server is shutting down, if auditing is enabled.
- def stopping()
- log("#{self.class.to_s} #{@host}:#{@port} stop")
- end
-
- protected :starting, :stopping
-
- # Called if #debug is true whenever an unhandled exception is raised.
- # This implementation simply logs the backtrace.
- #
- # +detail+:: The Exception that was caught
- def error(detail)
- log(detail.backtrace.join("\n"))
- end
-
- # Log a message to #stdlog, if it's defined. This implementation
- # outputs the timestamp and message to the log.
- #
- # +msg+:: the message to log
- def log(msg)
- if @stdlog
- @stdlog.puts("[#{Time.new.ctime}] %s" % msg)
- @stdlog.flush
- end
- end
-
- protected :error, :log
-
- # Create a new server
- #
- # +port+:: the port, as a Fixnum, on which to listen.
- # +host+:: the host to bind to
- # +maxConnections+:: The maximum number of simultaneous connections to
- # accept
- # +stdlog+:: IO device on which to log messages
- # +audit+:: if true, lifecycle callbacks will be called. See #audit
- # +debug+:: if true, error messages are logged. See #debug
- def initialize(port, host = DEFAULT_HOST, maxConnections = 4,
- stdlog = $stderr, audit = false, debug = false)
- @tcpServerThread = nil
- @port = port
- @host = host
- @maxConnections = maxConnections
- @connections = []
- @connectionsMutex = Mutex.new
- @connectionsCV = ConditionVariable.new
- @stdlog = stdlog
- @audit = audit
- @debug = debug
- end
-
- # Start the server if it isn't already running
- #
- # +maxConnections+::
- # override +maxConnections+ given to the constructor. A negative
- # value indicates that the value from the constructor should be used.
- def start(maxConnections = -1)
- raise "server is already running" if !stopped?
- @shutdown = false
- @maxConnections = maxConnections if maxConnections > 0
- @@servicesMutex.synchronize {
- if GServer.in_service?(@port,@host)
- raise "Port already in use: #{host}:#{@port}!"
- end
- @tcpServer = TCPServer.new(@host,@port)
- @port = @tcpServer.addr[1]
- @@services[@host] = {} unless @@services.has_key?(@host)
- @@services[@host][@port] = self;
- }
- @tcpServerThread = Thread.new {
- begin
- starting if @audit
- while !@shutdown
- @connectionsMutex.synchronize {
- while @connections.size >= @maxConnections
- @connectionsCV.wait(@connectionsMutex)
- end
- }
- client = @tcpServer.accept
- Thread.new(client) { |myClient|
- @connections << Thread.current
- begin
- myPort = myClient.peeraddr[1]
- serve(myClient) if !@audit or connecting(myClient)
- rescue => detail
- error(detail) if @debug
- ensure
- begin
- myClient.close
- rescue
- end
- @connectionsMutex.synchronize {
- @connections.delete(Thread.current)
- @connectionsCV.signal
- }
- disconnecting(myPort) if @audit
- end
- }
- end
- rescue => detail
- error(detail) if @debug
- ensure
- begin
- @tcpServer.close
- rescue
- end
- if @shutdown
- @connectionsMutex.synchronize {
- while @connections.size > 0
- @connectionsCV.wait(@connectionsMutex)
- end
- }
- else
- @connections.each { |c| c.raise "stop" }
- end
- @tcpServerThread = nil
- @@servicesMutex.synchronize {
- @@services[@host].delete(@port)
- }
- stopping if @audit
- end
- }
- self
- end
-
-end
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb
index 13016fcbba..64d2a8162d 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# ipaddr.rb - A class to manipulate an IP address
#
@@ -410,7 +411,7 @@ class IPAddr
# Set current netmask to given mask.
def mask!(mask)
if mask.kind_of?(String)
- if mask =~ /^\d+$/
+ if mask =~ /\A\d+\z/
prefixlen = mask.to_i
else
m = IPAddr.new(mask)
@@ -478,7 +479,7 @@ class IPAddr
end
end
prefix, prefixlen = addr.split('/')
- if prefix =~ /^\[(.*)\]$/i
+ if prefix =~ /\A\[(.*)\]\z/i
prefix = $1
family = Socket::AF_INET6
end
@@ -656,280 +657,3 @@ unless Socket.const_defined? :AF_INET6
end
end
end
-
-if $0 == __FILE__
- eval DATA.read, nil, $0, __LINE__+4
-end
-
-__END__
-
-require 'test/unit'
-
-class TC_IPAddr < Test::Unit::TestCase
- def test_s_new
- [
- ["3FFE:505:ffff::/48"],
- ["0:0:0:1::"],
- ["2001:200:300::/48"],
- ["2001:200:300::192.168.1.2/48"],
- ["1:2:3:4:5:6:7::"],
- ["::2:3:4:5:6:7:8"],
- ].each { |args|
- assert_nothing_raised {
- IPAddr.new(*args)
- }
- }
-
- a = IPAddr.new
- assert_equal("::", a.to_s)
- assert_equal("0000:0000:0000:0000:0000:0000:0000:0000", a.to_string)
- assert_equal(Socket::AF_INET6, a.family)
-
- a = IPAddr.new("0123:4567:89ab:cdef:0ABC:DEF0:1234:5678")
- assert_equal("123:4567:89ab:cdef:abc:def0:1234:5678", a.to_s)
- assert_equal("0123:4567:89ab:cdef:0abc:def0:1234:5678", a.to_string)
- assert_equal(Socket::AF_INET6, a.family)
-
- a = IPAddr.new("3ffe:505:2::/48")
- assert_equal("3ffe:505:2::", a.to_s)
- assert_equal("3ffe:0505:0002:0000:0000:0000:0000:0000", a.to_string)
- assert_equal(Socket::AF_INET6, a.family)
- assert_equal(false, a.ipv4?)
- assert_equal(true, a.ipv6?)
- assert_equal("#<IPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0000/ffff:ffff:ffff:0000:0000:0000:0000:0000>", a.inspect)
-
- a = IPAddr.new("3ffe:505:2::/ffff:ffff:ffff::")
- assert_equal("3ffe:505:2::", a.to_s)
- assert_equal("3ffe:0505:0002:0000:0000:0000:0000:0000", a.to_string)
- assert_equal(Socket::AF_INET6, a.family)
-
- a = IPAddr.new("0.0.0.0")
- assert_equal("0.0.0.0", a.to_s)
- assert_equal("0.0.0.0", a.to_string)
- assert_equal(Socket::AF_INET, a.family)
-
- a = IPAddr.new("192.168.1.2")
- assert_equal("192.168.1.2", a.to_s)
- assert_equal("192.168.1.2", a.to_string)
- assert_equal(Socket::AF_INET, a.family)
- assert_equal(true, a.ipv4?)
- assert_equal(false, a.ipv6?)
-
- a = IPAddr.new("192.168.1.2/24")
- assert_equal("192.168.1.0", a.to_s)
- assert_equal("192.168.1.0", a.to_string)
- assert_equal(Socket::AF_INET, a.family)
- assert_equal("#<IPAddr: IPv4:192.168.1.0/255.255.255.0>", a.inspect)
-
- a = IPAddr.new("192.168.1.2/255.255.255.0")
- assert_equal("192.168.1.0", a.to_s)
- assert_equal("192.168.1.0", a.to_string)
- assert_equal(Socket::AF_INET, a.family)
-
- assert_equal("0:0:0:1::", IPAddr.new("0:0:0:1::").to_s)
- assert_equal("2001:200:300::", IPAddr.new("2001:200:300::/48").to_s)
-
- assert_equal("2001:200:300::", IPAddr.new("[2001:200:300::]/48").to_s)
- assert_equal("1:2:3:4:5:6:7:0", IPAddr.new("1:2:3:4:5:6:7::").to_s)
- assert_equal("0:2:3:4:5:6:7:8", IPAddr.new("::2:3:4:5:6:7:8").to_s)
-
- 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
- addr = ''
- IPAddr.new("1234:5678:9abc:def0:1234:5678:9abc:def0").hton.each_byte { |c|
- addr += sprintf("%02x", c)
- }
- assert_equal("123456789abcdef0123456789abcdef0", addr)
- addr = ''
- IPAddr.new("123.45.67.89").hton.each_byte { |c|
- addr += sprintf("%02x", c)
- }
- assert_equal(sprintf("%02x%02x%02x%02x", 123, 45, 67, 89), addr)
- a = IPAddr.new("3ffe:505:2::")
- assert_equal("3ffe:505:2::", IPAddr.new_ntoh(a.hton).to_s)
- a = IPAddr.new("192.168.2.1")
- assert_equal("192.168.2.1", IPAddr.new_ntoh(a.hton).to_s)
- end
-
- def test_ipv4_compat
- a = IPAddr.new("::192.168.1.2")
- assert_equal("::192.168.1.2", a.to_s)
- assert_equal("0000:0000:0000:0000:0000:0000:c0a8:0102", a.to_string)
- assert_equal(Socket::AF_INET6, a.family)
- assert_equal(true, a.ipv4_compat?)
- b = a.native
- assert_equal("192.168.1.2", b.to_s)
- assert_equal(Socket::AF_INET, b.family)
- assert_equal(false, b.ipv4_compat?)
-
- a = IPAddr.new("192.168.1.2")
- b = a.ipv4_compat
- assert_equal("::192.168.1.2", b.to_s)
- assert_equal(Socket::AF_INET6, b.family)
- end
-
- def test_ipv4_mapped
- a = IPAddr.new("::ffff:192.168.1.2")
- assert_equal("::ffff:192.168.1.2", a.to_s)
- assert_equal("0000:0000:0000:0000:0000:ffff:c0a8:0102", a.to_string)
- assert_equal(Socket::AF_INET6, a.family)
- assert_equal(true, a.ipv4_mapped?)
- b = a.native
- assert_equal("192.168.1.2", b.to_s)
- assert_equal(Socket::AF_INET, b.family)
- assert_equal(false, b.ipv4_mapped?)
-
- a = IPAddr.new("192.168.1.2")
- b = a.ipv4_mapped
- assert_equal("::ffff:192.168.1.2", b.to_s)
- assert_equal(Socket::AF_INET6, b.family)
- end
-
- def test_reverse
- 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").reverse)
- assert_equal("1.2.168.192.in-addr.arpa", IPAddr.new("192.168.2.1").reverse)
- end
-
- 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(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(IPAddr::InvalidAddressError) {
- IPAddr.new("192.168.2.1").ip6_int
- }
- end
-
- def test_to_s
- assert_equal("3ffe:0505:0002:0000:0000:0000:0000:0001", IPAddr.new("3ffe:505:2::1").to_string)
- assert_equal("3ffe:505:2::1", IPAddr.new("3ffe:505:2::1").to_s)
- end
-end
-
-class TC_Operator < Test::Unit::TestCase
-
- IN6MASK32 = "ffff:ffff::"
- IN6MASK128 = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
-
- def setup
- @in6_addr_any = IPAddr.new()
- @a = IPAddr.new("3ffe:505:2::/48")
- @b = IPAddr.new("0:0:0:1::")
- @c = IPAddr.new(IN6MASK32)
- end
- alias set_up setup
-
- def test_or
- assert_equal("3ffe:505:2:1::", (@a | @b).to_s)
- a = @a
- a |= @b
- assert_equal("3ffe:505:2:1::", a.to_s)
- assert_equal("3ffe:505:2::", @a.to_s)
- assert_equal("3ffe:505:2:1::",
- (@a | 0x00000000000000010000000000000000).to_s)
- end
-
- def test_and
- assert_equal("3ffe:505::", (@a & @c).to_s)
- a = @a
- a &= @c
- assert_equal("3ffe:505::", a.to_s)
- assert_equal("3ffe:505:2::", @a.to_s)
- assert_equal("3ffe:505::", (@a & 0xffffffff000000000000000000000000).to_s)
- end
-
- def test_shift_right
- assert_equal("0:3ffe:505:2::", (@a >> 16).to_s)
- a = @a
- a >>= 16
- assert_equal("0:3ffe:505:2::", a.to_s)
- assert_equal("3ffe:505:2::", @a.to_s)
- end
-
- def test_shift_left
- assert_equal("505:2::", (@a << 16).to_s)
- a = @a
- a <<= 16
- assert_equal("505:2::", a.to_s)
- assert_equal("3ffe:505:2::", @a.to_s)
- end
-
- def test_carrot
- a = ~@in6_addr_any
- assert_equal(IN6MASK128, a.to_s)
- assert_equal("::", @in6_addr_any.to_s)
- end
-
- def test_equal
- 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::"))
- end
-
- def test_mask
- a = @a.mask(32)
- assert_equal("3ffe:505::", a.to_s)
- assert_equal("3ffe:505:2::", @a.to_s)
- end
-
- def test_include?
- assert_equal(true, @a.include?(IPAddr.new("3ffe:505:2::")))
- assert_equal(true, @a.include?(IPAddr.new("3ffe:505:2::1")))
- assert_equal(false, @a.include?(IPAddr.new("3ffe:505:3::")))
- net1 = IPAddr.new("192.168.2.0/24")
- assert_equal(true, net1.include?(IPAddr.new("192.168.2.0")))
- assert_equal(true, net1.include?(IPAddr.new("192.168.2.255")))
- assert_equal(false, net1.include?(IPAddr.new("192.168.3.0")))
- # test with integer parameter
- int = (192 << 24) + (168 << 16) + (2 << 8) + 13
-
- assert_equal(true, net1.include?(int))
- assert_equal(false, net1.include?(int+255))
-
- end
-
- def test_hash
- a1 = IPAddr.new('192.168.2.0')
- a2 = IPAddr.new('192.168.2.0')
- a3 = IPAddr.new('3ffe:505:2::1')
- a4 = IPAddr.new('3ffe:505:2::1')
- a5 = IPAddr.new('127.0.0.1')
- a6 = IPAddr.new('::1')
- a7 = IPAddr.new('192.168.2.0/25')
- a8 = IPAddr.new('192.168.2.0/25')
-
- h = { a1 => 'ipv4', a2 => 'ipv4', a3 => 'ipv6', a4 => 'ipv6', a5 => 'ipv4', a6 => 'ipv6', a7 => 'ipv4', a8 => 'ipv4'}
- assert_equal(5, h.size)
- assert_equal('ipv4', h[a1])
- assert_equal('ipv4', h[a2])
- assert_equal('ipv6', h[a3])
- assert_equal('ipv6', h[a4])
-
- require 'set'
- s = Set[a1, a2, a3, a4, a5, a6, a7, a8]
- assert_equal(5, s.size)
- assert_equal(true, s.include?(a1))
- assert_equal(true, s.include?(a2))
- assert_equal(true, s.include?(a3))
- assert_equal(true, s.include?(a4))
- assert_equal(true, s.include?(a5))
- assert_equal(true, s.include?(a6))
- end
-end
diff --git a/lib/irb.rb b/lib/irb.rb
index 20390d2205..92b79b3301 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb.rb - irb main module
# $Release Version: 0.9.6 $
@@ -13,14 +14,11 @@ require "e2mmap"
require "irb/init"
require "irb/context"
require "irb/extend-command"
-#require "irb/workspace"
require "irb/ruby-lex"
require "irb/input-method"
require "irb/locale"
-STDOUT.sync = true
-
# IRB stands for "interactive Ruby" and is a tool to interactively execute Ruby
# expressions read from the standard input.
#
@@ -138,8 +136,8 @@ STDOUT.sync = true
# This example can be used in your +.irbrc+
#
# IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode
-# :AUTO_INDENT => true # enables auto-indent mode
-# :PROMPT_I => nil, # normal prompt
+# :AUTO_INDENT => true, # enables auto-indent mode
+# :PROMPT_I => ">> ", # simple prompt
# :PROMPT_S => nil, # prompt for continuated strings
# :PROMPT_C => nil, # prompt for continuated statement
# :RETURN => " ==>%s\n" # format to return value
@@ -158,8 +156,8 @@ STDOUT.sync = true
# %m # to_s of main object (self)
# %M # inspect of main object (self)
# %l # type of string(", ', /, ]), `]' is inner %w[...]
-# %NNi # indent level. NN is degits and means as same as printf("%NNd").
-# # It can be ommited
+# %NNi # indent level. NN is digits and means as same as printf("%NNd").
+# # It can be omitted
# %NNn # line number.
# %% # %
#
@@ -331,13 +329,12 @@ STDOUT.sync = true
# irb.3(<Foo:0x4010af3c>):003:0> bar #=> bar => nil
# # kill jobs 1, 2, and 3
# irb.3(<Foo:0x4010af3c>):004:0> kill 1, 2, 3
-# # list open sesssions, should only include main session
+# # list open sessions, should only include main session
# irb(main):009:0> jobs
# #0->irb on main (#<Thread:0x400fb7e4> : running)
# # quit irb
# irb(main):010:0> exit
module IRB
- @RCS_ID='-$Id$-'
# An exception raised by IRB.irb_abort
class Abort < Exception;end
@@ -347,7 +344,7 @@ module IRB
# Displays current configuration.
#
- # Modifing the configuration is achieved by sending a message to IRB.conf.
+ # Modifying the configuration is achieved by sending a message to IRB.conf.
#
# See IRB@Configuration for more information.
def IRB.conf
@@ -375,6 +372,7 @@ module IRB
# Initializes IRB and creates a new Irb.irb object at the +TOPLEVEL_BINDING+
def IRB.start(ap_path = nil)
+ STDOUT.sync = true
$0 = File::basename(ap_path, ".rb") if ap_path
IRB.setup(ap_path)
@@ -399,7 +397,6 @@ module IRB
ensure
irb_at_exit
end
-# print "\n"
end
# Calls each event hook of IRB.conf[:AT_EXIT] when the current session quits.
@@ -499,7 +496,7 @@ module IRB
end
if exc
print exc.class, ": ", exc, "\n"
- if exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
+ if exc.backtrace && exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
!(SyntaxError === exc)
irb_bug = true
else
@@ -509,16 +506,18 @@ module IRB
messages = []
lasts = []
levels = 0
- for m in exc.backtrace
- m = @context.workspace.filter_backtrace(m) unless irb_bug
- if m
- if messages.size < @context.back_trace_limit
- messages.push "\tfrom "+m
- else
- lasts.push "\tfrom "+m
- if lasts.size > @context.back_trace_limit
- lasts.shift
- levels += 1
+ if exc.backtrace
+ for m in exc.backtrace
+ m = @context.workspace.filter_backtrace(m) unless irb_bug
+ if m
+ if messages.size < @context.back_trace_limit
+ messages.push "\tfrom "+m
+ else
+ lasts.push "\tfrom "+m
+ if lasts.size > @context.back_trace_limit
+ lasts.shift
+ levels += 1
+ end
end
end
end
@@ -526,7 +525,7 @@ module IRB
print messages.join("\n"), "\n"
unless lasts.empty?
printf "... %d levels...\n", levels if levels > 0
- print lasts.join("\n")
+ print lasts.join("\n"), "\n"
end
print "Maybe IRB bug!\n" if irb_bug
end
diff --git a/lib/irb/cmd/chws.rb b/lib/irb/cmd/chws.rb
index 1889e75d5e..606e0c52a9 100644
--- a/lib/irb/cmd/chws.rb
+++ b/lib/irb/cmd/chws.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# change-ws.rb -
# $Release Version: 0.9.6$
@@ -18,14 +19,14 @@ module IRB
class CurrentWorkingWorkspace<Nop
def execute(*obj)
- irb_context.main
+ irb_context.main
end
end
class ChangeWorkspace<Nop
def execute(*obj)
- irb_context.change_workspace(*obj)
- irb_context.main
+ irb_context.change_workspace(*obj)
+ irb_context.main
end
end
end
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb
index fbe5126c85..552c3962f6 100644
--- a/lib/irb/cmd/fork.rb
+++ b/lib/irb/cmd/fork.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# fork.rb -
# $Release Version: 0.9.6 $
@@ -9,27 +10,26 @@
#
#
-@RCS_ID='-$Id$-'
# :stopdoc:
module IRB
module ExtendCommand
class Fork<Nop
def execute
- pid = send ExtendCommand.irb_original_method_name("fork")
- unless pid
- class << self
- alias_method :exit, ExtendCommand.irb_original_method_name('exit')
- end
- if iterator?
- begin
- yield
- ensure
- exit
- end
- end
- end
- pid
+ pid = send ExtendCommand.irb_original_method_name("fork")
+ unless pid
+ class << self
+ alias_method :exit, ExtendCommand.irb_original_method_name('exit')
+ end
+ if iterator?
+ begin
+ yield
+ ensure
+ exit
+ end
+ end
+ end
+ pid
end
end
end
diff --git a/lib/irb/cmd/help.rb b/lib/irb/cmd/help.rb
index 76e299fc20..7a09c396e1 100644
--- a/lib/irb/cmd/help.rb
+++ b/lib/irb/cmd/help.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# help.rb - helper using ri
# $Release Version: 0.9.6$
diff --git a/lib/irb/cmd/load.rb b/lib/irb/cmd/load.rb
index 6c9e9f67ce..e3b84dad79 100644
--- a/lib/irb/cmd/load.rb
+++ b/lib/irb/cmd/load.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# load.rb -
# $Release Version: 0.9.6$
@@ -19,8 +20,7 @@ module IRB
include IrbLoader
def execute(file_name, priv = nil)
-# return ruby_load(file_name) unless IRB.conf[:USE_LOADER]
- return irb_load(file_name, priv)
+ return irb_load(file_name, priv)
end
end
@@ -28,38 +28,37 @@ module IRB
include IrbLoader
def execute(file_name)
-# return ruby_require(file_name) unless IRB.conf[:USE_LOADER]
- rex = Regexp.new("#{Regexp.quote(file_name)}(\.o|\.rb)?")
- return false if $".find{|f| f =~ rex}
+ rex = Regexp.new("#{Regexp.quote(file_name)}(\.o|\.rb)?")
+ return false if $".find{|f| f =~ rex}
- case file_name
- when /\.rb$/
- begin
- if irb_load(file_name)
- $".push file_name
- return true
- end
- rescue LoadError
- end
- when /\.(so|o|sl)$/
- return ruby_require(file_name)
- end
+ case file_name
+ when /\.rb$/
+ begin
+ if irb_load(file_name)
+ $".push file_name
+ return true
+ end
+ rescue LoadError
+ end
+ when /\.(so|o|sl)$/
+ return ruby_require(file_name)
+ end
- begin
- irb_load(f = file_name + ".rb")
- $".push f
- return true
- rescue LoadError
- return ruby_require(file_name)
- end
+ begin
+ irb_load(f = file_name + ".rb")
+ $".push f
+ return true
+ rescue LoadError
+ return ruby_require(file_name)
+ end
end
end
class Source<Nop
include IrbLoader
def execute(file_name)
- source_file(file_name)
+ source_file(file_name)
end
end
end
diff --git a/lib/irb/cmd/nop.rb b/lib/irb/cmd/nop.rb
index 7bd443121e..9cf4337c28 100644
--- a/lib/irb/cmd/nop.rb
+++ b/lib/irb/cmd/nop.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# nop.rb -
# $Release Version: 0.9.6$
@@ -13,25 +14,24 @@ module IRB
module ExtendCommand
class Nop
- @RCS_ID='-$Id$-'
def self.execute(conf, *opts)
- command = new(conf)
- command.execute(*opts)
+ command = new(conf)
+ command.execute(*opts)
end
def initialize(conf)
- @irb_context = conf
+ @irb_context = conf
end
attr_reader :irb_context
def irb
- @irb_context.irb
+ @irb_context.irb
end
def execute(*opts)
- #nop
+ #nop
end
end
end
diff --git a/lib/irb/cmd/pushws.rb b/lib/irb/cmd/pushws.rb
index cee8538e3e..aa14430ce4 100644
--- a/lib/irb/cmd/pushws.rb
+++ b/lib/irb/cmd/pushws.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# change-ws.rb -
# $Release Version: 0.9.6$
@@ -17,21 +18,21 @@ module IRB
module ExtendCommand
class Workspaces<Nop
def execute(*obj)
- irb_context.workspaces.collect{|ws| ws.main}
+ irb_context.workspaces.collect{|ws| ws.main}
end
end
class PushWorkspace<Workspaces
def execute(*obj)
- irb_context.push_workspace(*obj)
- super
+ irb_context.push_workspace(*obj)
+ super
end
end
class PopWorkspace<Workspaces
def execute(*obj)
- irb_context.pop_workspace(*obj)
- super
+ irb_context.pop_workspace(*obj)
+ super
end
end
end
diff --git a/lib/irb/cmd/subirb.rb b/lib/irb/cmd/subirb.rb
index 7363d64769..f29548b88f 100644
--- a/lib/irb/cmd/subirb.rb
+++ b/lib/irb/cmd/subirb.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# multi.rb -
# $Release Version: 0.9.6$
# $Revision$
@@ -16,25 +17,25 @@ module IRB
module ExtendCommand
class IrbCommand<Nop
def execute(*obj)
- IRB.irb(nil, *obj)
+ IRB.irb(nil, *obj)
end
end
class Jobs<Nop
def execute
- IRB.JobManager
+ IRB.JobManager
end
end
class Foreground<Nop
def execute(key)
- IRB.JobManager.switch(key)
+ IRB.JobManager.switch(key)
end
end
class Kill<Nop
def execute(*keys)
- IRB.JobManager.kill(*keys)
+ IRB.JobManager.kill(*keys)
end
end
end
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index c6f8a5889f..e7499a8e2b 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/completor.rb -
# $Release Version: 0.9$
@@ -11,7 +12,6 @@ require "readline"
module IRB
module InputCompletor # :nodoc:
- @RCS_ID='-$Id$-'
# Set of reserved words used by Ruby, you should not use these for
# constants or variables
@@ -38,175 +38,169 @@ module IRB
CompletionProc = proc { |input|
bind = IRB.conf[:MAIN_CONTEXT].workspace.binding
-# puts "input: #{input}"
-
case input
when /^((["'`]).*\2)\.([^.]*)$/
- # String
- receiver = $1
- message = Regexp.quote($3)
+ # String
+ receiver = $1
+ message = Regexp.quote($3)
- candidates = String.instance_methods.collect{|m| m.to_s}
- select_message(receiver, message, candidates)
+ candidates = String.instance_methods.collect{|m| m.to_s}
+ select_message(receiver, message, candidates)
when /^(\/[^\/]*\/)\.([^.]*)$/
- # Regexp
- receiver = $1
- message = Regexp.quote($2)
+ # Regexp
+ receiver = $1
+ message = Regexp.quote($2)
- candidates = Regexp.instance_methods.collect{|m| m.to_s}
- select_message(receiver, message, candidates)
+ candidates = Regexp.instance_methods.collect{|m| m.to_s}
+ select_message(receiver, message, candidates)
when /^([^\]]*\])\.([^.]*)$/
- # Array
- receiver = $1
- message = Regexp.quote($2)
+ # Array
+ receiver = $1
+ message = Regexp.quote($2)
- candidates = Array.instance_methods.collect{|m| m.to_s}
- select_message(receiver, message, candidates)
+ candidates = Array.instance_methods.collect{|m| m.to_s}
+ select_message(receiver, message, candidates)
when /^([^\}]*\})\.([^.]*)$/
- # Proc or Hash
- receiver = $1
- message = Regexp.quote($2)
+ # Proc or Hash
+ receiver = $1
+ message = Regexp.quote($2)
- candidates = Proc.instance_methods.collect{|m| m.to_s}
- candidates |= Hash.instance_methods.collect{|m| m.to_s}
- select_message(receiver, message, candidates)
+ candidates = Proc.instance_methods.collect{|m| m.to_s}
+ candidates |= Hash.instance_methods.collect{|m| m.to_s}
+ select_message(receiver, message, candidates)
when /^(:[^:.]*)$/
- # Symbol
- if Symbol.respond_to?(:all_symbols)
- sym = $1
- candidates = Symbol.all_symbols.collect{|s| ":" + s.id2name}
- candidates.grep(/^#{Regexp.quote(sym)}/)
- else
- []
- end
+ # Symbol
+ if Symbol.respond_to?(:all_symbols)
+ sym = $1
+ candidates = Symbol.all_symbols.collect{|s| ":" + s.id2name}
+ candidates.grep(/^#{Regexp.quote(sym)}/)
+ else
+ []
+ end
when /^::([A-Z][^:\.\(]*)$/
- # Absolute Constant or class methods
- receiver = $1
- candidates = Object.constants.collect{|m| m.to_s}
- candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
+ # Absolute Constant or class methods
+ receiver = $1
+ candidates = Object.constants.collect{|m| m.to_s}
+ candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
-# when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/
when /^([A-Z].*)::([^:.]*)$/
- # Constant or class methods
- receiver = $1
- message = Regexp.quote($2)
- begin
- candidates = eval("#{receiver}.constants.collect{|m| m.to_s}", bind)
- candidates |= eval("#{receiver}.methods.collect{|m| m.to_s}", bind)
- rescue Exception
- candidates = []
- end
- select_message(receiver, message, candidates, "::")
+ # Constant or class methods
+ receiver = $1
+ message = Regexp.quote($2)
+ begin
+ candidates = eval("#{receiver}.constants.collect{|m| m.to_s}", bind)
+ candidates |= eval("#{receiver}.methods.collect{|m| m.to_s}", bind)
+ rescue Exception
+ candidates = []
+ end
+ select_message(receiver, message, candidates, "::")
when /^(:[^:.]+)(\.|::)([^.]*)$/
- # Symbol
- receiver = $1
- sep = $2
- message = Regexp.quote($3)
+ # Symbol
+ receiver = $1
+ sep = $2
+ message = Regexp.quote($3)
- candidates = Symbol.instance_methods.collect{|m| m.to_s}
- select_message(receiver, message, candidates, sep)
+ candidates = Symbol.instance_methods.collect{|m| m.to_s}
+ select_message(receiver, message, candidates, sep)
when /^(-?(0[dbo])?[0-9_]+(\.[0-9_]+)?([eE]-?[0-9]+)?)(\.|::)([^.]*)$/
- # Numeric
- receiver = $1
- sep = $5
- message = Regexp.quote($6)
-
- begin
- candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
- rescue Exception
- candidates = []
- end
- select_message(receiver, message, candidates, sep)
+ # Numeric
+ receiver = $1
+ sep = $5
+ message = Regexp.quote($6)
+
+ begin
+ candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
+ rescue Exception
+ candidates = []
+ end
+ select_message(receiver, message, candidates, sep)
when /^(-?0x[0-9a-fA-F_]+)(\.|::)([^.]*)$/
- # Numeric(0xFFFF)
- receiver = $1
- sep = $2
- message = Regexp.quote($3)
-
- begin
- candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
- rescue Exception
- candidates = []
- end
- select_message(receiver, message, candidates, sep)
+ # Numeric(0xFFFF)
+ receiver = $1
+ sep = $2
+ message = Regexp.quote($3)
+
+ begin
+ candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
+ rescue Exception
+ candidates = []
+ end
+ select_message(receiver, message, candidates, sep)
when /^(\$[^.]*)$/
- # global var
- regmessage = Regexp.new(Regexp.quote($1))
- candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
+ # global var
+ regmessage = Regexp.new(Regexp.quote($1))
+ candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
-# when /^(\$?(\.?[^.]+)+)\.([^.]*)$/
-# when /^((\.?[^.]+)+)\.([^.]*)$/
-# when /^([^."].*)\.([^.]*)$/
when /^([^."].*)(\.|::)([^.]*)$/
- # variable.func or func.func
- receiver = $1
- sep = $2
- message = Regexp.quote($3)
-
- gv = eval("global_variables", bind).collect{|m| m.to_s}
- lv = eval("local_variables", bind).collect{|m| m.to_s}
- iv = eval("instance_variables", bind).collect{|m| m.to_s}
- cv = eval("self.class.constants", bind).collect{|m| m.to_s}
-
- if (gv | lv | iv | cv).include?(receiver) or /^[A-Z]/ =~ receiver && /\./ !~ receiver
- # foo.func and foo is var. OR
- # foo::func and foo is var. OR
- # foo::Const and foo is var. OR
- # Foo::Bar.func
- begin
- candidates = []
- rec = eval(receiver, bind)
- if sep == "::" and rec.kind_of?(Module)
- candidates = rec.constants.collect{|m| m.to_s}
- end
- candidates |= rec.methods.collect{|m| m.to_s}
- rescue Exception
- candidates = []
- end
- else
- # func1.func2
- candidates = []
- ObjectSpace.each_object(Module){|m|
- begin
- name = m.name
- rescue Exception
- name = ""
- end
+ # variable.func or func.func
+ receiver = $1
+ sep = $2
+ message = Regexp.quote($3)
+
+ gv = eval("global_variables", bind).collect{|m| m.to_s}
+ lv = eval("local_variables", bind).collect{|m| m.to_s}
+ iv = eval("instance_variables", bind).collect{|m| m.to_s}
+ cv = eval("self.class.constants", bind).collect{|m| m.to_s}
+
+ if (gv | lv | iv | cv).include?(receiver) or /^[A-Z]/ =~ receiver && /\./ !~ receiver
+ # foo.func and foo is var. OR
+ # foo::func and foo is var. OR
+ # foo::Const and foo is var. OR
+ # Foo::Bar.func
+ begin
+ candidates = []
+ rec = eval(receiver, bind)
+ if sep == "::" and rec.kind_of?(Module)
+ candidates = rec.constants.collect{|m| m.to_s}
+ end
+ candidates |= rec.methods.collect{|m| m.to_s}
+ rescue Exception
+ candidates = []
+ end
+ else
+ # func1.func2
+ candidates = []
+ ObjectSpace.each_object(Module){|m|
+ begin
+ name = m.name
+ rescue Exception
+ name = ""
+ end
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!
- candidates.uniq!
- end
- select_message(receiver, message, candidates, sep)
+ candidates.concat m.instance_methods(false).collect{|x| x.to_s}
+ }
+ candidates.sort!
+ candidates.uniq!
+ end
+ select_message(receiver, message, candidates, sep)
when /^\.([^.]*)$/
- # unknown(maybe String)
+ # unknown(maybe String)
- receiver = ""
- message = Regexp.quote($1)
+ receiver = ""
+ message = Regexp.quote($1)
- candidates = String.instance_methods(true).collect{|m| m.to_s}
- select_message(receiver, message, candidates)
+ candidates = String.instance_methods(true).collect{|m| m.to_s}
+ select_message(receiver, message, candidates)
else
- candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s}
+ candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s}
- (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
+ (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
end
}
@@ -215,20 +209,19 @@ module IRB
def self.select_message(receiver, message, candidates, sep = ".")
candidates.grep(/^#{message}/).collect do |e|
- case e
- when /^[a-zA-Z_]/
- receiver + sep + e
- when /^[0-9]/
- when *Operators
- #receiver + " " + e
- end
+ case e
+ when /^[a-zA-Z_]/
+ receiver + sep + e
+ when /^[0-9]/
+ when *Operators
+ #receiver + " " + e
+ end
end
end
end
end
if Readline.respond_to?("basic_word_break_characters=")
-# Readline.basic_word_break_characters= " \t\n\"\\'`><=;|&{("
Readline.basic_word_break_characters= " \t\n`><=;|&{("
end
Readline.completion_append_character = nil
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 72b36307d5..4cf6128930 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/context.rb - irb context
# $Release Version: 0.9.6$
@@ -25,12 +26,11 @@ module IRB
def initialize(irb, workspace = nil, input_method = nil, output_method = nil)
@irb = irb
if workspace
- @workspace = workspace
+ @workspace = workspace
else
- @workspace = WorkSpace.new
+ @workspace = WorkSpace.new
end
@thread = Thread.current if defined? Thread
-# @irb_level = 0
# copy of default configuration
@ap_name = IRB.conf[:AP_NAME]
@@ -55,50 +55,50 @@ module IRB
self.prompt_mode = IRB.conf[:PROMPT_MODE]
if IRB.conf[:SINGLE_IRB] or !defined?(IRB::JobManager)
- @irb_name = IRB.conf[:IRB_NAME]
+ @irb_name = IRB.conf[:IRB_NAME]
else
- @irb_name = IRB.conf[:IRB_NAME]+"#"+IRB.JobManager.n_jobs.to_s
+ @irb_name = IRB.conf[:IRB_NAME]+"#"+IRB.JobManager.n_jobs.to_s
end
@irb_path = "(" + @irb_name + ")"
case input_method
when nil
- case use_readline?
- when nil
- if (defined?(ReadlineInputMethod) && STDIN.tty? &&
- IRB.conf[:PROMPT_MODE] != :INF_RUBY)
- @io = ReadlineInputMethod.new
- else
- @io = StdioInputMethod.new
- end
- when false
- @io = StdioInputMethod.new
- when true
- if defined?(ReadlineInputMethod)
- @io = ReadlineInputMethod.new
- else
- @io = StdioInputMethod.new
- end
- end
+ case use_readline?
+ when nil
+ if (defined?(ReadlineInputMethod) && STDIN.tty? &&
+ IRB.conf[:PROMPT_MODE] != :INF_RUBY)
+ @io = ReadlineInputMethod.new
+ else
+ @io = StdioInputMethod.new
+ end
+ when false
+ @io = StdioInputMethod.new
+ when true
+ if defined?(ReadlineInputMethod)
+ @io = ReadlineInputMethod.new
+ else
+ @io = StdioInputMethod.new
+ end
+ end
when String
- @io = FileInputMethod.new(input_method)
- @irb_name = File.basename(input_method)
- @irb_path = input_method
+ @io = FileInputMethod.new(input_method)
+ @irb_name = File.basename(input_method)
+ @irb_path = input_method
else
- @io = input_method
+ @io = input_method
end
self.save_history = IRB.conf[:SAVE_HISTORY] if IRB.conf[:SAVE_HISTORY]
if output_method
- @output_method = output_method
+ @output_method = output_method
else
- @output_method = StdioOutputMethod.new
+ @output_method = StdioOutputMethod.new
end
@echo = IRB.conf[:ECHO]
if @echo.nil?
- @echo = true
+ @echo = true
end
self.debug_level = IRB.conf[:DEBUG_LEVEL]
end
@@ -235,15 +235,15 @@ module IRB
# Returns whether messages are displayed or not.
def verbose?
if @verbose.nil?
- if defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)
- false
- elsif !STDIN.tty? or @io.kind_of?(FileInputMethod)
- true
- else
- false
- end
+ if defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)
+ false
+ elsif !STDIN.tty? or @io.kind_of?(FileInputMethod)
+ true
+ else
+ false
+ end
else
- @verbose
+ @verbose
end
end
@@ -251,7 +251,7 @@ module IRB
# StdioInputMethod or ReadlineInputMethod, see #io for more information.
def prompting?
verbose? || (STDIN.tty? && @io.kind_of?(StdioInputMethod) ||
- (defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)))
+ (defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)))
end
# The return value of the last statement evaluated.
@@ -276,9 +276,9 @@ module IRB
@prompt_n = pconf[:PROMPT_N]
@return_format = pconf[:RETURN]
if ai = pconf.include?(:AUTO_INDENT)
- @auto_indent_mode = ai
+ @auto_indent_mode = ai
else
- @auto_indent_mode = IRB.conf[:AUTO_INDENT]
+ @auto_indent_mode = IRB.conf[:AUTO_INDENT]
end
end
@@ -309,41 +309,41 @@ module IRB
def inspect_mode=(opt)
if i = Inspector::INSPECTORS[opt]
- @inspect_mode = opt
- @inspect_method = i
- i.init
+ @inspect_mode = opt
+ @inspect_method = i
+ i.init
else
- case opt
- when nil
- if Inspector.keys_with_inspector(Inspector::INSPECTORS[true]).include?(@inspect_mode)
- self.inspect_mode = false
- elsif Inspector.keys_with_inspector(Inspector::INSPECTORS[false]).include?(@inspect_mode)
- self.inspect_mode = true
- else
- puts "Can't switch inspect mode."
- return
- end
- when /^\s*\{.*\}\s*$/
- begin
- inspector = eval "proc#{opt}"
- rescue Exception
- puts "Can't switch inspect mode(#{opt})."
- return
- end
- self.inspect_mode = inspector
- when Proc
- self.inspect_mode = IRB::Inspector(opt)
- when Inspector
- prefix = "usr%d"
- i = 1
- while Inspector::INSPECTORS[format(prefix, i)]; i += 1; end
- @inspect_mode = format(prefix, i)
- @inspect_method = opt
- Inspector.def_inspector(format(prefix, i), @inspect_method)
- else
- puts "Can't switch inspect mode(#{opt})."
- return
- end
+ case opt
+ when nil
+ if Inspector.keys_with_inspector(Inspector::INSPECTORS[true]).include?(@inspect_mode)
+ self.inspect_mode = false
+ elsif Inspector.keys_with_inspector(Inspector::INSPECTORS[false]).include?(@inspect_mode)
+ self.inspect_mode = true
+ else
+ puts "Can't switch inspect mode."
+ return
+ end
+ when /^\s*\{.*\}\s*$/
+ begin
+ inspector = eval "proc#{opt}"
+ rescue Exception
+ puts "Can't switch inspect mode(#{opt})."
+ return
+ end
+ self.inspect_mode = inspector
+ when Proc
+ self.inspect_mode = IRB::Inspector(opt)
+ when Inspector
+ prefix = "usr%d"
+ i = 1
+ while Inspector::INSPECTORS[format(prefix, i)]; i += 1; end
+ @inspect_mode = format(prefix, i)
+ @inspect_method = opt
+ Inspector.def_inspector(format(prefix, i), @inspect_method)
+ else
+ puts "Can't switch inspect mode(#{opt})."
+ return
+ end
end
print "Switch to#{unless @inspect_mode; ' non';end} inspect mode.\n" if verbose?
@inspect_mode
@@ -378,8 +378,6 @@ module IRB
def evaluate(line, line_no) # :nodoc:
@line_no = line_no
set_last_value(@workspace.evaluate(self, line, irb_path, line_no))
-# @workspace.evaluate("_ = IRB.conf[:MAIN_CONTEXT]._")
-# @_ = @workspace.evaluate(line, irb_path, line_no)
end
def inspect_last_value # :nodoc:
@@ -400,19 +398,19 @@ module IRB
def inspect # :nodoc:
array = []
for ivar in instance_variables.sort{|e1, e2| e1 <=> e2}
- ivar = ivar.to_s
- name = ivar.sub(/^@(.*)$/, '\1')
- val = instance_eval(ivar)
- case ivar
- when *NOPRINTING_IVARS
- array.push format("conf.%s=%s", name, "...")
- when *NO_INSPECTING_IVARS
- array.push format("conf.%s=%s", name, val.to_s)
- when *IDNAME_IVARS
- array.push format("conf.%s=:%s", name, val.id2name)
- else
- array.push format("conf.%s=%s", name, val.inspect)
- end
+ ivar = ivar.to_s
+ name = ivar.sub(/^@(.*)$/, '\1')
+ val = instance_eval(ivar)
+ case ivar
+ when *NOPRINTING_IVARS
+ array.push format("conf.%s=%s", name, "...")
+ when *NO_INSPECTING_IVARS
+ array.push format("conf.%s=%s", name, val.to_s)
+ when *IDNAME_IVARS
+ array.push format("conf.%s=:%s", name, val.id2name)
+ else
+ array.push format("conf.%s=%s", name, val.inspect)
+ end
end
array.join("\n")
end
diff --git a/lib/irb/ext/change-ws.rb b/lib/irb/ext/change-ws.rb
index ce921eb5e3..94bfe62bc0 100644
--- a/lib/irb/ext/change-ws.rb
+++ b/lib/irb/ext/change-ws.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/ext/cb.rb -
# $Release Version: 0.9.6$
@@ -15,9 +16,9 @@ module IRB # :nodoc:
# Inherited from +TOPLEVEL_BINDING+.
def home_workspace
if defined? @home_workspace
- @home_workspace
+ @home_workspace
else
- @home_workspace = @workspace
+ @home_workspace = @workspace
end
end
@@ -30,40 +31,16 @@ module IRB # :nodoc:
# See IRB::WorkSpace.new for more information.
def change_workspace(*_main)
if _main.empty?
- @workspace = home_workspace
- return main
+ @workspace = home_workspace
+ return main
end
@workspace = WorkSpace.new(_main[0])
if !(class<<main;ancestors;end).include?(ExtendCommandBundle)
- main.extend ExtendCommandBundle
+ main.extend ExtendCommandBundle
end
end
-
-# def change_binding(*_main)
-# back = @workspace
-# @workspace = WorkSpace.new(*_main)
-# unless _main.empty?
-# begin
-# main.extend ExtendCommandBundle
-# rescue
-# print "can't change binding to: ", main.inspect, "\n"
-# @workspace = back
-# return nil
-# end
-# end
-# @irb_level += 1
-# begin
-# catch(:SU_EXIT) do
-# @irb.eval_input
-# end
-# ensure
-# @irb_level -= 1
-# @workspace = back
-# end
-# end
-# alias change_workspace change_binding
end
end
diff --git a/lib/irb/ext/history.rb b/lib/irb/ext/history.rb
index 3239c57a6c..62363b13f4 100644
--- a/lib/irb/ext/history.rb
+++ b/lib/irb/ext/history.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# history.rb -
# $Release Version: 0.9.6$
@@ -21,10 +22,9 @@ module IRB # :nodoc:
def set_last_value(value)
_set_last_value(value)
-# @workspace.evaluate self, "_ = IRB.CurrentContext.last_value"
- if @eval_history #and !@eval_history_values.equal?(llv)
- @eval_history_values.push @line_no, @last_value
- @workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
+ if @eval_history
+ @eval_history_values.push @line_no, @last_value
+ @workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
end
@last_value
@@ -43,23 +43,22 @@ module IRB # :nodoc:
# If +no+ is +nil+, execution result history isn't used (default).
def eval_history=(no)
if no
- if defined?(@eval_history) && @eval_history
- @eval_history_values.size(no)
- else
- @eval_history_values = History.new(no)
- IRB.conf[:__TMP__EHV__] = @eval_history_values
- @workspace.evaluate(self, "__ = IRB.conf[:__TMP__EHV__]")
- IRB.conf.delete(:__TMP_EHV__)
- end
+ if defined?(@eval_history) && @eval_history
+ @eval_history_values.size(no)
+ else
+ @eval_history_values = History.new(no)
+ IRB.conf[:__TMP__EHV__] = @eval_history_values
+ @workspace.evaluate(self, "__ = IRB.conf[:__TMP__EHV__]")
+ IRB.conf.delete(:__TMP_EHV__)
+ end
else
- @eval_history_values = nil
+ @eval_history_values = nil
end
@eval_history = no
end
end
class History # :nodoc:
- @RCS_ID='-$Id$-'
def initialize(size = 16)
@size = size
@@ -68,20 +67,20 @@ module IRB # :nodoc:
def size(size)
if size != 0 && size < @size
- @contents = @contents[@size - size .. @size]
+ @contents = @contents[@size - size .. @size]
end
@size = size
end
def [](idx)
begin
- if idx >= 0
- @contents.find{|no, val| no == idx}[1]
- else
- @contents[idx][1]
- end
+ if idx >= 0
+ @contents.find{|no, val| no == idx}[1]
+ else
+ @contents[idx][1]
+ end
rescue NameError
- nil
+ nil
end
end
@@ -94,22 +93,22 @@ module IRB # :nodoc:
def inspect
if @contents.empty?
- return real_inspect
+ return real_inspect
end
unless (last = @contents.pop)[1].equal?(self)
- @contents.push last
- last = nil
+ @contents.push last
+ last = nil
end
str = @contents.collect{|no, val|
- if val.equal?(self)
- "#{no} ...self-history..."
- else
- "#{no} #{val.inspect}"
- end
+ if val.equal?(self)
+ "#{no} ...self-history..."
+ else
+ "#{no} #{val.inspect}"
+ end
}.join("\n")
if str == ""
- str = "Empty."
+ str = "Empty."
end
@contents.push last if last
str
diff --git a/lib/irb/ext/loader.rb b/lib/irb/ext/loader.rb
index 6cdc8ec898..840226db30 100644
--- a/lib/irb/ext/loader.rb
+++ b/lib/irb/ext/loader.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# loader.rb -
# $Release Version: 0.9.6$
@@ -18,7 +19,6 @@ module IRB # :nodoc:
#
# See ExtendCommandBundle for more information.
module IrbLoader
- @RCS_ID='-$Id$-'
alias ruby_load load
alias ruby_require require
@@ -33,14 +33,14 @@ module IRB # :nodoc:
def search_file_from_ruby_path(fn) # :nodoc:
if /^#{Regexp.quote(File::Separator)}/ =~ fn
- return fn if File.exist?(fn)
- return nil
+ return fn if File.exist?(fn)
+ return nil
end
for path in $:
- if File.exist?(f = File.join(path, fn))
- return f
- end
+ if File.exist?(f = File.join(path, fn))
+ return f
+ end
end
return nil
end
@@ -50,20 +50,20 @@ module IRB # :nodoc:
# See Irb#suspend_input_method for more information.
def source_file(path)
irb.suspend_name(path, File.basename(path)) do
- irb.suspend_input_method(FileInputMethod.new(path)) do
- |back_io|
- irb.signal_status(:IN_LOAD) do
- if back_io.kind_of?(FileInputMethod)
- irb.eval_input
- else
- begin
- irb.eval_input
- rescue LoadAbort
- print "load abort!!\n"
- end
- end
- end
- end
+ irb.suspend_input_method(FileInputMethod.new(path)) do
+ |back_io|
+ irb.signal_status(:IN_LOAD) do
+ if back_io.kind_of?(FileInputMethod)
+ irb.eval_input
+ else
+ begin
+ irb.eval_input
+ rescue LoadAbort
+ print "load abort!!\n"
+ end
+ end
+ end
+ end
end
end
@@ -73,28 +73,27 @@ module IRB # :nodoc:
def load_file(path, priv = nil)
irb.suspend_name(path, File.basename(path)) do
- if priv
- ws = WorkSpace.new(Module.new)
- else
- ws = WorkSpace.new
- end
- irb.suspend_workspace(ws) do
- irb.suspend_input_method(FileInputMethod.new(path)) do
- |back_io|
- irb.signal_status(:IN_LOAD) do
-# p irb.conf
- if back_io.kind_of?(FileInputMethod)
- irb.eval_input
- else
- begin
- irb.eval_input
- rescue LoadAbort
- print "load abort!!\n"
- end
- end
- end
- end
- end
+ if priv
+ ws = WorkSpace.new(Module.new)
+ else
+ ws = WorkSpace.new
+ end
+ irb.suspend_workspace(ws) do
+ irb.suspend_input_method(FileInputMethod.new(path)) do
+ |back_io|
+ irb.signal_status(:IN_LOAD) do
+ if back_io.kind_of?(FileInputMethod)
+ irb.eval_input
+ else
+ begin
+ irb.eval_input
+ rescue LoadAbort
+ print "load abort!!\n"
+ end
+ end
+ end
+ end
+ end
end
end
@@ -104,25 +103,25 @@ module IRB # :nodoc:
back_name = @irb_name
back_scanner = @irb.scanner
begin
- @io = FileInputMethod.new(path)
- @irb_name = File.basename(path)
- @irb_path = path
- @irb.signal_status(:IN_LOAD) do
- if back_io.kind_of?(FileInputMethod)
- @irb.eval_input
- else
- begin
- @irb.eval_input
- rescue LoadAbort
- print "load abort!!\n"
- end
- end
- end
+ @io = FileInputMethod.new(path)
+ @irb_name = File.basename(path)
+ @irb_path = path
+ @irb.signal_status(:IN_LOAD) do
+ if back_io.kind_of?(FileInputMethod)
+ @irb.eval_input
+ else
+ begin
+ @irb.eval_input
+ rescue LoadAbort
+ print "load abort!!\n"
+ end
+ end
+ end
ensure
- @io = back_io
- @irb_name = back_name
- @irb_path = back_path
- @irb.scanner = back_scanner
+ @io = back_io
+ @irb_name = back_name
+ @irb_path = back_path
+ @irb.scanner = back_scanner
end
end
end
diff --git a/lib/irb/ext/math-mode.rb b/lib/irb/ext/math-mode.rb
index 067eb1e7fa..e409dbdc6a 100644
--- a/lib/irb/ext/math-mode.rb
+++ b/lib/irb/ext/math-mode.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# math-mode.rb -
# $Release Version: 0.9.6$
@@ -28,14 +29,14 @@ module IRB
# more information.
def math_mode=(opt)
if @math_mode == true && !opt
- IRB.fail CantReturnToNormalMode
- return
+ IRB.fail CantReturnToNormalMode
+ return
end
@math_mode = opt
if math_mode
- main.extend Math
- print "start math mode\n" if verbose?
+ main.extend Math
+ print "start math mode\n" if verbose?
end
end
diff --git a/lib/irb/ext/multi-irb.rb b/lib/irb/ext/multi-irb.rb
index e49a158fa3..982a319611 100644
--- a/lib/irb/ext/multi-irb.rb
+++ b/lib/irb/ext/multi-irb.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/multi-irb.rb - multiple irb module
# $Release Version: 0.9.6$
@@ -13,11 +14,9 @@ require "thread"
module IRB
class JobManager
- @RCS_ID='-$Id$-'
# Creates a new JobManager object
def initialize
- # @jobs = [[thread, irb],...]
@jobs = []
@current_job = nil
end
@@ -85,9 +84,9 @@ module IRB
# See Thread#exit for more information.
def kill(*keys)
for key in keys
- th, _ = search(key)
- IRB.fail IrbAlreadyDead unless th.alive?
- th.exit
+ th, _ = search(key)
+ IRB.fail IrbAlreadyDead unless th.alive?
+ th.exit
end
end
@@ -107,15 +106,15 @@ module IRB
# Raises a NoSuchJob exception if no job can be found with the given +key+.
def search(key)
job = case key
- when Integer
- @jobs[key]
- when Irb
- @jobs.find{|k, v| v.equal?(key)}
- when Thread
- @jobs.assoc(key)
- else
- @jobs.find{|k, v| v.context.main.equal?(key)}
- end
+ when Integer
+ @jobs[key]
+ when Irb
+ @jobs.find{|k, v| v.equal?(key)}
+ when Thread
+ @jobs.assoc(key)
+ else
+ @jobs.find{|k, v| v.context.main.equal?(key)}
+ end
IRB.fail NoSuchJob, key if job.nil?
job
end
@@ -124,21 +123,21 @@ module IRB
def delete(key)
case key
when Integer
- IRB.fail NoSuchJob, key unless @jobs[key]
- @jobs[key] = nil
+ IRB.fail NoSuchJob, key unless @jobs[key]
+ @jobs[key] = nil
else
- catch(:EXISTS) do
- @jobs.each_index do
- |i|
- if @jobs[i] and (@jobs[i][0] == key ||
- @jobs[i][1] == key ||
- @jobs[i][1].context.main.equal?(key))
- @jobs[i] = nil
- throw :EXISTS
- end
- end
- IRB.fail NoSuchJob, key
- end
+ catch(:EXISTS) do
+ @jobs.each_index do
+ |i|
+ if @jobs[i] and (@jobs[i][0] == key ||
+ @jobs[i][1] == key ||
+ @jobs[i][1].context.main.equal?(key))
+ @jobs[i] = nil
+ throw :EXISTS
+ end
+ end
+ IRB.fail NoSuchJob, key
+ end
end
until assoc = @jobs.pop; end unless @jobs.empty?
@jobs.push assoc
@@ -148,25 +147,25 @@ module IRB
def inspect
ary = []
@jobs.each_index do
- |i|
- th, irb = @jobs[i]
- next if th.nil?
+ |i|
+ th, irb = @jobs[i]
+ next if th.nil?
- if th.alive?
- if th.stop?
- t_status = "stop"
- else
- t_status = "running"
- end
- else
- t_status = "exited"
- end
- ary.push format("#%d->%s on %s (%s: %s)",
- i,
- irb.context.irb_name,
- irb.context.main,
- th,
- t_status)
+ if th.alive?
+ if th.stop?
+ t_status = "stop"
+ else
+ t_status = "running"
+ end
+ else
+ t_status = "exited"
+ end
+ ary.push format("#%d->%s on %s (%s: %s)",
+ i,
+ irb.context.irb_name,
+ irb.context.main,
+ th,
+ t_status)
end
ary.join("\n")
end
@@ -193,64 +192,45 @@ module IRB
parent_thread = Thread.current
Thread.start do
begin
- irb = Irb.new(workspace, file)
+ irb = Irb.new(workspace, file)
rescue
- print "Subirb can't start with context(self): ", workspace.main.inspect, "\n"
- print "return to main irb\n"
- Thread.pass
- Thread.main.wakeup
- Thread.exit
+ print "Subirb can't start with context(self): ", workspace.main.inspect, "\n"
+ print "return to main irb\n"
+ Thread.pass
+ Thread.main.wakeup
+ Thread.exit
end
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
@JobManager.insert(irb)
@JobManager.current_job = irb
begin
- system_exit = false
- catch(:IRB_EXIT) do
- irb.eval_input
- end
+ system_exit = false
+ catch(:IRB_EXIT) do
+ irb.eval_input
+ end
rescue SystemExit
- system_exit = true
- raise
- #fail
+ system_exit = true
+ raise
+ #fail
ensure
- unless system_exit
- @JobManager.delete(irb)
- if @JobManager.current_job == irb
- if parent_thread.alive?
- @JobManager.current_job = @JobManager.irb(parent_thread)
- parent_thread.run
- else
- @JobManager.current_job = @JobManager.main_irb
- @JobManager.main_thread.run
- end
- end
- end
+ unless system_exit
+ @JobManager.delete(irb)
+ if @JobManager.current_job == irb
+ if parent_thread.alive?
+ @JobManager.current_job = @JobManager.irb(parent_thread)
+ parent_thread.run
+ else
+ @JobManager.current_job = @JobManager.main_irb
+ @JobManager.main_thread.run
+ end
+ end
+ end
end
end
Thread.stop
@JobManager.current_job = @JobManager.irb(Thread.current)
end
-# class Context
-# def set_last_value(value)
-# @last_value = value
-# @workspace.evaluate "_ = IRB.JobManager.irb(Thread.current).context.last_value"
-# if @eval_history #and !@__.equal?(@last_value)
-# @eval_history_values.push @line_no, @last_value
-# @workspace.evaluate "__ = IRB.JobManager.irb(Thread.current).context.instance_eval{@eval_history_values}"
-# end
-# @last_value
-# end
-# end
-
-# module ExtendCommand
-# def irb_context
-# IRB.JobManager.irb(Thread.current).context
-# end
-# # alias conf irb_context
-# end
-
@CONF[:SINGLE_IRB_MODE] = false
@JobManager.insert(@CONF[:MAIN_CONTEXT].irb)
@JobManager.current_job = @CONF[:MAIN_CONTEXT].irb
@@ -258,22 +238,22 @@ module IRB
class Irb
def signal_handle
unless @context.ignore_sigint?
- print "\nabort!!\n" if @context.verbose?
- exit
+ print "\nabort!!\n" if @context.verbose?
+ exit
end
case @signal_status
when :IN_INPUT
- print "^C\n"
- IRB.JobManager.thread(self).raise RubyLex::TerminateLineInput
+ print "^C\n"
+ IRB.JobManager.thread(self).raise RubyLex::TerminateLineInput
when :IN_EVAL
- IRB.irb_abort(self)
+ IRB.irb_abort(self)
when :IN_LOAD
- IRB.irb_abort(self, LoadAbort)
+ IRB.irb_abort(self, LoadAbort)
when :IN_IRB
- # ignore
+ # ignore
else
- # ignore other cases as well
+ # ignore other cases as well
end
end
end
diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb
index 7b3fcbbeec..ab64cf543d 100644
--- a/lib/irb/ext/save-history.rb
+++ b/lib/irb/ext/save-history.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# save-history.rb -
# $Release Version: 0.9.6$
# $Revision$
@@ -12,13 +13,12 @@ require "readline"
module IRB
module HistorySavingAbility # :nodoc:
- @RCS_ID='-$Id$-'
end
class Context
def init_save_history# :nodoc:
unless (class<<@io;self;end).include?(HistorySavingAbility)
- @io.extend(HistorySavingAbility)
+ @io.extend(HistorySavingAbility)
end
end
@@ -27,6 +27,7 @@ module IRB
IRB.conf[:SAVE_HISTORY]
end
+ remove_method :save_history= if respond_to?(:save_history=)
# Sets <code>IRB.conf[:SAVE_HISTORY]</code> to the given +val+ and calls
# #init_save_history with this context.
#
@@ -39,9 +40,9 @@ module IRB
def save_history=(val)
IRB.conf[:SAVE_HISTORY] = val
if val
- main_context = IRB.conf[:MAIN_CONTEXT]
- main_context = self unless main_context
- main_context.init_save_history
+ main_context = IRB.conf[:MAIN_CONTEXT]
+ main_context = self unless main_context
+ main_context.init_save_history
end
end
@@ -59,23 +60,7 @@ module IRB
module HistorySavingAbility # :nodoc:
include Readline
-# def HistorySavingAbility.create_finalizer
-# proc do
-# if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0
-# if hf = IRB.conf[:HISTORY_FILE]
-# file = File.expand_path(hf)
-# end
-# file = IRB.rc_file("_history") unless file
-# open(file, 'w' ) do |f|
-# hist = HISTORY.to_a
-# f.puts(hist[-num..-1] || hist)
-# end
-# end
-# end
-# end
-
def HistorySavingAbility.extended(obj)
-# ObjectSpace.define_finalizer(obj, HistorySavingAbility.create_finalizer)
IRB.conf[:AT_EXIT].push proc{obj.save_history}
obj.load_history
obj
@@ -83,37 +68,37 @@ module IRB
def load_history
if history_file = IRB.conf[:HISTORY_FILE]
- history_file = File.expand_path(history_file)
+ history_file = File.expand_path(history_file)
end
history_file = IRB.rc_file("_history") unless history_file
if File.exist?(history_file)
- open(history_file) do |f|
- f.each {|l| HISTORY << l.chomp}
- end
+ open(history_file) do |f|
+ f.each {|l| HISTORY << l.chomp}
+ end
end
end
def save_history
if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0
- if history_file = IRB.conf[:HISTORY_FILE]
- history_file = File.expand_path(history_file)
- end
- history_file = IRB.rc_file("_history") unless history_file
+ if history_file = IRB.conf[:HISTORY_FILE]
+ history_file = File.expand_path(history_file)
+ end
+ history_file = IRB.rc_file("_history") unless history_file
- # Change the permission of a file that already exists[BUG #7694]
- begin
- if File.stat(history_file).mode & 066 != 0
- File.chmod(0600, history_file)
- end
- rescue Errno::ENOENT
- rescue
- raise
- end
+ # Change the permission of a file that already exists[BUG #7694]
+ begin
+ if File.stat(history_file).mode & 066 != 0
+ File.chmod(0600, history_file)
+ end
+ rescue Errno::ENOENT
+ rescue
+ raise
+ end
- open(history_file, 'w', 0600 ) do |f|
- hist = HISTORY.to_a
- f.puts(hist[-num..-1] || hist)
- end
+ open(history_file, 'w', 0600 ) do |f|
+ hist = HISTORY.to_a
+ f.puts(hist[-num..-1] || hist)
+ end
end
end
end
diff --git a/lib/irb/ext/tracer.rb b/lib/irb/ext/tracer.rb
index 8c9083dbad..200f77e341 100644
--- a/lib/irb/ext/tracer.rb
+++ b/lib/irb/ext/tracer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/lib/tracer.rb -
# $Release Version: 0.9.6$
@@ -18,7 +19,7 @@ module IRB
Tracer.add_filter {
|event, file, line, id, binding, *rests|
/^#{Regexp.quote(@CONF[:IRB_LIB_PATH])}/ !~ file and
- File::basename(file) != "irb.rb"
+ File::basename(file) != "irb.rb"
}
end
@@ -35,12 +36,12 @@ module IRB
# See +lib/tracer.rb+ for more information.
def use_tracer=(opt)
if opt
- Tracer.set_get_line_procs(@irb_path) {
- |line_no, *rests|
- @io.line(line_no)
- }
+ Tracer.set_get_line_procs(@irb_path) {
+ |line_no, *rests|
+ @io.line(line_no)
+ }
elsif !opt && @use_tracer
- Tracer.off
+ Tracer.off
end
@use_tracer=opt
end
@@ -54,14 +55,14 @@ module IRB
# See +lib/tracer.rb+ for more information.
def evaluate(context, statements, file = nil, line = nil)
if context.use_tracer? && file != nil && line != nil
- Tracer.on
- begin
- __evaluate__(context, statements, file, line)
- ensure
- Tracer.off
- end
+ Tracer.on
+ begin
+ __evaluate__(context, statements, file, line)
+ ensure
+ Tracer.off
+ end
else
- __evaluate__(context, statements, file || __FILE__, line || __LINE__)
+ __evaluate__(context, statements, file || __FILE__, line || __LINE__)
end
end
end
diff --git a/lib/irb/ext/use-loader.rb b/lib/irb/ext/use-loader.rb
index 4e98f5b7a2..571dd25d17 100644
--- a/lib/irb/ext/use-loader.rb
+++ b/lib/irb/ext/use-loader.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# use-loader.rb -
# $Release Version: 0.9.6$
@@ -49,20 +50,20 @@ module IRB
def use_loader=(opt)
if IRB.conf[:USE_LOADER] != opt
- IRB.conf[:USE_LOADER] = opt
- if opt
- if !$".include?("irb/cmd/load")
- end
- (class<<@workspace.main;self;end).instance_eval {
- alias_method :load, :irb_load
- alias_method :require, :irb_require
- }
- else
- (class<<@workspace.main;self;end).instance_eval {
- alias_method :load, :__original__load__IRB_use_loader__
- alias_method :require, :__original__require__IRB_use_loader__
- }
- end
+ IRB.conf[:USE_LOADER] = opt
+ if opt
+ if !$".include?("irb/cmd/load")
+ end
+ (class<<@workspace.main;self;end).instance_eval {
+ alias_method :load, :irb_load
+ alias_method :require, :irb_require
+ }
+ else
+ (class<<@workspace.main;self;end).instance_eval {
+ alias_method :load, :__original__load__IRB_use_loader__
+ alias_method :require, :__original__require__IRB_use_loader__
+ }
+ end
end
print "Switch to load/require#{unless use_loader; ' non';end} trace mode.\n" if verbose?
opt
diff --git a/lib/irb/ext/workspaces.rb b/lib/irb/ext/workspaces.rb
index 641befbdf3..5bd72c194f 100644
--- a/lib/irb/ext/workspaces.rb
+++ b/lib/irb/ext/workspaces.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# push-ws.rb -
# $Release Version: 0.9.6$
@@ -20,9 +21,9 @@ module IRB # :nodoc:
# WorkSpaces in the current stack
def workspaces
if defined? @workspaces
- @workspaces
+ @workspaces
else
- @workspaces = []
+ @workspaces = []
end
end
@@ -33,20 +34,20 @@ module IRB # :nodoc:
# information.
def push_workspace(*_main)
if _main.empty?
- if workspaces.empty?
- print "No other workspace\n"
- return nil
- end
- ws = workspaces.pop
- workspaces.push @workspace
- @workspace = ws
- return workspaces
+ if workspaces.empty?
+ print "No other workspace\n"
+ return nil
+ end
+ ws = workspaces.pop
+ workspaces.push @workspace
+ @workspace = ws
+ return workspaces
end
workspaces.push @workspace
@workspace = WorkSpace.new(@workspace.binding, _main[0])
if !(class<<main;ancestors;end).include?(ExtendCommandBundle)
- main.extend ExtendCommandBundle
+ main.extend ExtendCommandBundle
end
end
@@ -56,8 +57,8 @@ module IRB # :nodoc:
# Also, see #push_workspace.
def pop_workspace
if workspaces.empty?
- print "workspace stack empty\n"
- return
+ print "workspace stack empty\n"
+ return
end
@workspace = workspaces.pop
end
diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb
index 487c0bbeff..6f15e6403a 100644
--- a/lib/irb/extend-command.rb
+++ b/lib/irb/extend-command.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/extend-command.rb - irb extend command
# $Release Version: 0.9.6$
@@ -46,71 +47,57 @@ module IRB # :nodoc:
@EXTEND_COMMANDS = [
[:irb_current_working_workspace, :CurrentWorkingWorkspace, "irb/cmd/chws",
- [:irb_print_working_workspace, OVERRIDE_ALL],
- [:irb_cwws, OVERRIDE_ALL],
- [:irb_pwws, OVERRIDE_ALL],
-# [:irb_cww, OVERRIDE_ALL],
-# [:irb_pww, OVERRIDE_ALL],
- [:cwws, NO_OVERRIDE],
- [:pwws, NO_OVERRIDE],
-# [:cww, NO_OVERRIDE],
-# [:pww, NO_OVERRIDE],
- [:irb_current_working_binding, OVERRIDE_ALL],
- [:irb_print_working_binding, OVERRIDE_ALL],
- [:irb_cwb, OVERRIDE_ALL],
- [:irb_pwb, OVERRIDE_ALL],
-# [:cwb, NO_OVERRIDE],
-# [:pwb, NO_OVERRIDE]
- ],
- [:irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
- [:irb_chws, OVERRIDE_ALL],
-# [:irb_chw, OVERRIDE_ALL],
- [:irb_cws, OVERRIDE_ALL],
-# [:irb_cw, OVERRIDE_ALL],
- [:chws, NO_OVERRIDE],
-# [:chw, NO_OVERRIDE],
- [:cws, NO_OVERRIDE],
-# [:cw, NO_OVERRIDE],
- [:irb_change_binding, OVERRIDE_ALL],
- [:irb_cb, OVERRIDE_ALL],
- [:cb, NO_OVERRIDE]],
+ [:irb_print_working_workspace, OVERRIDE_ALL],
+ [:irb_cwws, OVERRIDE_ALL],
+ [:irb_pwws, OVERRIDE_ALL],
+ [:cwws, NO_OVERRIDE],
+ [:pwws, NO_OVERRIDE],
+ [:irb_current_working_binding, OVERRIDE_ALL],
+ [:irb_print_working_binding, OVERRIDE_ALL],
+ [:irb_cwb, OVERRIDE_ALL],
+ [:irb_pwb, OVERRIDE_ALL],
+ ],
+ [:irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
+ [:irb_chws, OVERRIDE_ALL],
+ [:irb_cws, OVERRIDE_ALL],
+ [:chws, NO_OVERRIDE],
+ [:cws, NO_OVERRIDE],
+ [:irb_change_binding, OVERRIDE_ALL],
+ [:irb_cb, OVERRIDE_ALL],
+ [:cb, NO_OVERRIDE]],
- [:irb_workspaces, :Workspaces, "irb/cmd/pushws",
- [:workspaces, NO_OVERRIDE],
- [:irb_bindings, OVERRIDE_ALL],
- [:bindings, NO_OVERRIDE]],
- [:irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
- [:irb_pushws, OVERRIDE_ALL],
-# [:irb_pushw, OVERRIDE_ALL],
- [:pushws, NO_OVERRIDE],
-# [:pushw, NO_OVERRIDE],
- [:irb_push_binding, OVERRIDE_ALL],
- [:irb_pushb, OVERRIDE_ALL],
- [:pushb, NO_OVERRIDE]],
- [:irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
- [:irb_popws, OVERRIDE_ALL],
-# [:irb_popw, OVERRIDE_ALL],
- [:popws, NO_OVERRIDE],
-# [:popw, NO_OVERRIDE],
- [:irb_pop_binding, OVERRIDE_ALL],
- [:irb_popb, OVERRIDE_ALL],
- [:popb, NO_OVERRIDE]],
+ [:irb_workspaces, :Workspaces, "irb/cmd/pushws",
+ [:workspaces, NO_OVERRIDE],
+ [:irb_bindings, OVERRIDE_ALL],
+ [:bindings, NO_OVERRIDE]],
+ [:irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
+ [:irb_pushws, OVERRIDE_ALL],
+ [:pushws, NO_OVERRIDE],
+ [:irb_push_binding, OVERRIDE_ALL],
+ [:irb_pushb, OVERRIDE_ALL],
+ [:pushb, NO_OVERRIDE]],
+ [:irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
+ [:irb_popws, OVERRIDE_ALL],
+ [:popws, NO_OVERRIDE],
+ [:irb_pop_binding, OVERRIDE_ALL],
+ [:irb_popb, OVERRIDE_ALL],
+ [:popb, NO_OVERRIDE]],
- [:irb_load, :Load, "irb/cmd/load"],
- [:irb_require, :Require, "irb/cmd/load"],
- [:irb_source, :Source, "irb/cmd/load",
- [:source, NO_OVERRIDE]],
+ [:irb_load, :Load, "irb/cmd/load"],
+ [:irb_require, :Require, "irb/cmd/load"],
+ [:irb_source, :Source, "irb/cmd/load",
+ [:source, NO_OVERRIDE]],
- [:irb, :IrbCommand, "irb/cmd/subirb"],
- [:irb_jobs, :Jobs, "irb/cmd/subirb",
- [:jobs, NO_OVERRIDE]],
- [:irb_fg, :Foreground, "irb/cmd/subirb",
- [:fg, NO_OVERRIDE]],
- [:irb_kill, :Kill, "irb/cmd/subirb",
- [:kill, OVERRIDE_PRIVATE_ONLY]],
+ [:irb, :IrbCommand, "irb/cmd/subirb"],
+ [:irb_jobs, :Jobs, "irb/cmd/subirb",
+ [:jobs, NO_OVERRIDE]],
+ [:irb_fg, :Foreground, "irb/cmd/subirb",
+ [:fg, NO_OVERRIDE]],
+ [:irb_kill, :Kill, "irb/cmd/subirb",
+ [:kill, OVERRIDE_PRIVATE_ONLY]],
- [:irb_help, :Help, "irb/cmd/help",
- [:help, NO_OVERRIDE]],
+ [:irb_help, :Help, "irb/cmd/help",
+ [:help, NO_OVERRIDE]],
]
@@ -131,7 +118,7 @@ module IRB # :nodoc:
# +irb_help+:: IRB@Command+line+options
def self.install_extend_commands
for args in @EXTEND_COMMANDS
- def_extend_command(*args)
+ def_extend_command(*args)
end
end
@@ -144,39 +131,39 @@ module IRB # :nodoc:
def self.def_extend_command(cmd_name, cmd_class, load_file = nil, *aliases)
case cmd_class
when Symbol
- cmd_class = cmd_class.id2name
+ cmd_class = cmd_class.id2name
when String
when Class
- cmd_class = cmd_class.name
+ cmd_class = cmd_class.name
end
if load_file
- line = __LINE__; eval %[
- def #{cmd_name}(*opts, &b)
- require "#{load_file}"
- arity = ExtendCommand::#{cmd_class}.instance_method(:execute).arity
- args = (1..(arity < 0 ? ~arity : arity)).map {|i| "arg" + i.to_s }
- args << "*opts" if arity < 0
- args << "&block"
- args = args.join(", ")
- line = __LINE__; eval %[
- def #{cmd_name}(\#{args})
- ExtendCommand::#{cmd_class}.execute(irb_context, \#{args})
- end
- ], nil, __FILE__, line
- send :#{cmd_name}, *opts, &b
- end
- ], nil, __FILE__, line
+ line = __LINE__; eval %[
+ def #{cmd_name}(*opts, &b)
+ require "#{load_file}"
+ arity = ExtendCommand::#{cmd_class}.instance_method(:execute).arity
+ args = (1..(arity < 0 ? ~arity : arity)).map {|i| "arg" + i.to_s }
+ args << "*opts" if arity < 0
+ args << "&block"
+ args = args.join(", ")
+ line = __LINE__; eval %[
+ def #{cmd_name}(\#{args})
+ ExtendCommand::#{cmd_class}.execute(irb_context, \#{args})
+ end
+ ], nil, __FILE__, line
+ send :#{cmd_name}, *opts, &b
+ end
+ ], nil, __FILE__, line
else
- line = __LINE__; eval %[
- def #{cmd_name}(*opts, &b)
- ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b)
- end
- ], nil, __FILE__, line
+ line = __LINE__; eval %[
+ def #{cmd_name}(*opts, &b)
+ ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b)
+ end
+ ], nil, __FILE__, line
end
for ali, flag in aliases
- @ALIASES.push [ali, cmd_name, flag]
+ @ALIASES.push [ali, cmd_name, flag]
end
end
@@ -187,18 +174,18 @@ module IRB # :nodoc:
from = from.id2name unless from.kind_of?(String)
if override == OVERRIDE_ALL or
- (override == OVERRIDE_PRIVATE_ONLY) && !respond_to?(to) or
- (override == NO_OVERRIDE) && !respond_to?(to, true)
- target = self
- (class << self; self; end).instance_eval{
- if target.respond_to?(to, true) &&
- !target.respond_to?(EXCB.irb_original_method_name(to), true)
- alias_method(EXCB.irb_original_method_name(to), to)
- end
- alias_method to, from
- }
+ (override == OVERRIDE_PRIVATE_ONLY) && !respond_to?(to) or
+ (override == NO_OVERRIDE) && !respond_to?(to, true)
+ target = self
+ (class << self; self; end).instance_eval{
+ if target.respond_to?(to, true) &&
+ !target.respond_to?(EXCB.irb_original_method_name(to), true)
+ alias_method(EXCB.irb_original_method_name(to), to)
+ end
+ alias_method to, from
+ }
else
- print "irb: warn: can't alias #{to} from #{from}.\n"
+ print "irb: warn: can't alias #{to} from #{from}.\n"
end
end
@@ -210,10 +197,10 @@ module IRB # :nodoc:
# using #install_alias_method.
def self.extend_object(obj)
unless (class << obj; ancestors; end).include?(EXCB)
- super
- for ali, com, flg in @ALIASES
- obj.install_alias_method(ali, com, flg)
- end
+ super
+ for ali, com, flg in @ALIASES
+ obj.install_alias_method(ali, com, flg)
+ end
end
end
@@ -241,7 +228,7 @@ module IRB # :nodoc:
# Context#save_history=:: +irb/ext/save-history.rb+
def self.install_extend_commands
for args in @EXTEND_COMMANDS
- def_extend_command(*args)
+ def_extend_command(*args)
end
end
@@ -252,13 +239,13 @@ module IRB # :nodoc:
def self.def_extend_command(cmd_name, load_file, *aliases)
line = __LINE__; Context.module_eval %[
def #{cmd_name}(*opts, &b)
- Context.module_eval {remove_method(:#{cmd_name})}
- require "#{load_file}"
- send :#{cmd_name}, *opts, &b
- end
- for ali in aliases
- alias_method ali, cmd_name
- end
+ Context.module_eval {remove_method(:#{cmd_name})}
+ require "#{load_file}"
+ send :#{cmd_name}, *opts, &b
+ end
+ for ali in aliases
+ alias_method ali, cmd_name
+ end
], __FILE__, line
end
@@ -277,9 +264,9 @@ module IRB # :nodoc:
module_eval %[
alias_method alias_name, base_method
def #{base_method}(*opts)
- send :#{extend_method}, *opts
- send :#{alias_name}, *opts
- end
+ send :#{extend_method}, *opts
+ send :#{alias_name}, *opts
+ end
]
end
@@ -293,9 +280,9 @@ module IRB # :nodoc:
module_eval %[
alias_method alias_name, base_method
def #{base_method}(*opts)
- send :#{alias_name}, *opts
- send :#{extend_method}, *opts
- end
+ send :#{alias_name}, *opts
+ send :#{extend_method}, *opts
+ end
]
end
@@ -313,7 +300,7 @@ module IRB # :nodoc:
return base_name if same_methods.empty?
no = same_methods.size
while !same_methods.include?(alias_name = base_name + no)
- no += 1
+ no += 1
end
alias_name
end
diff --git a/lib/irb/frame.rb b/lib/irb/frame.rb
index bcfa3a3140..6073809249 100644
--- a/lib/irb/frame.rb
+++ b/lib/irb/frame.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# frame.rb -
# $Release Version: 0.9$
@@ -31,9 +32,9 @@ module IRB
def trace_func(event, file, line, id, binding)
case event
when 'call', 'class'
- @frames.push binding
+ @frames.push binding
when 'return', 'end'
- @frames.pop
+ @frames.pop
end
end
diff --git a/lib/irb/help.rb b/lib/irb/help.rb
index 9fd734038f..a4264ab4ab 100644
--- a/lib/irb/help.rb
+++ b/lib/irb/help.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/help.rb - print usage module
# $Release Version: 0.9.6$
@@ -19,16 +20,16 @@ module IRB
space_line = false
IRB::MagicFile.open(path){|f|
f.each_line do |l|
- if /^\s*$/ =~ l
- lc.puts l unless space_line
- space_line = true
- next
- end
- space_line = false
+ if /^\s*$/ =~ l
+ lc.puts l unless space_line
+ space_line = true
+ next
+ end
+ space_line = false
- l.sub!(/#.*$/, "")
- next if /^\s*$/ =~ l
- lc.puts l
+ l.sub!(/#.*$/, "")
+ next if /^\s*$/ =~ l
+ lc.puts l
end
}
end
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index 826bcaf3ac..1184db15ea 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/init.rb - irb initialize module
# $Release Version: 0.9.6$
@@ -59,48 +60,47 @@ module IRB # :nodoc:
@CONF[:PROMPT] = {
:NULL => {
- :PROMPT_I => nil,
- :PROMPT_N => nil,
- :PROMPT_S => nil,
- :PROMPT_C => nil,
- :RETURN => "%s\n"
+ :PROMPT_I => nil,
+ :PROMPT_N => nil,
+ :PROMPT_S => nil,
+ :PROMPT_C => nil,
+ :RETURN => "%s\n"
},
:DEFAULT => {
- :PROMPT_I => "%N(%m):%03n:%i> ",
- :PROMPT_N => "%N(%m):%03n:%i> ",
- :PROMPT_S => "%N(%m):%03n:%i%l ",
- :PROMPT_C => "%N(%m):%03n:%i* ",
- :RETURN => "=> %s\n"
+ :PROMPT_I => "%N(%m):%03n:%i> ",
+ :PROMPT_N => "%N(%m):%03n:%i> ",
+ :PROMPT_S => "%N(%m):%03n:%i%l ",
+ :PROMPT_C => "%N(%m):%03n:%i* ",
+ :RETURN => "=> %s\n"
},
:CLASSIC => {
- :PROMPT_I => "%N(%m):%03n:%i> ",
- :PROMPT_N => "%N(%m):%03n:%i> ",
- :PROMPT_S => "%N(%m):%03n:%i%l ",
- :PROMPT_C => "%N(%m):%03n:%i* ",
- :RETURN => "%s\n"
+ :PROMPT_I => "%N(%m):%03n:%i> ",
+ :PROMPT_N => "%N(%m):%03n:%i> ",
+ :PROMPT_S => "%N(%m):%03n:%i%l ",
+ :PROMPT_C => "%N(%m):%03n:%i* ",
+ :RETURN => "%s\n"
},
:SIMPLE => {
- :PROMPT_I => ">> ",
- :PROMPT_N => ">> ",
- :PROMPT_S => nil,
- :PROMPT_C => "?> ",
- :RETURN => "=> %s\n"
+ :PROMPT_I => ">> ",
+ :PROMPT_N => ">> ",
+ :PROMPT_S => nil,
+ :PROMPT_C => "?> ",
+ :RETURN => "=> %s\n"
},
:INF_RUBY => {
- :PROMPT_I => "%N(%m):%03n:%i> ",
-# :PROMPT_N => "%N(%m):%03n:%i> ",
- :PROMPT_N => nil,
- :PROMPT_S => nil,
- :PROMPT_C => nil,
- :RETURN => "%s\n",
- :AUTO_INDENT => true
+ :PROMPT_I => "%N(%m):%03n:%i> ",
+ :PROMPT_N => nil,
+ :PROMPT_S => nil,
+ :PROMPT_C => nil,
+ :RETURN => "%s\n",
+ :AUTO_INDENT => true
},
:XMP => {
- :PROMPT_I => nil,
- :PROMPT_N => nil,
- :PROMPT_S => nil,
- :PROMPT_C => nil,
- :RETURN => " ==>%s\n"
+ :PROMPT_I => nil,
+ :PROMPT_N => nil,
+ :PROMPT_S => nil,
+ :PROMPT_C => nil,
+ :RETURN => " ==>%s\n"
}
}
@@ -110,7 +110,6 @@ module IRB # :nodoc:
@CONF[:CONTEXT_MODE] = 3 # use binding in function on TOPLEVEL_BINDING
@CONF[:SINGLE_IRB] = false
-# @CONF[:LC_MESSAGES] = "en"
@CONF[:LC_MESSAGES] = Locale.new
@CONF[:AT_EXIT] = []
@@ -122,108 +121,104 @@ module IRB # :nodoc:
@CONF[:LC_MESSAGES].load("irb/error.rb")
end
- FEATURE_IOPT_CHANGE_VERSION = "1.9.0"
-
# option analyzing
def IRB.parse_opts
load_path = []
while opt = ARGV.shift
case opt
when "-f"
- @CONF[:RC] = false
+ @CONF[:RC] = false
when "-m"
- @CONF[:MATH_MODE] = true
+ @CONF[:MATH_MODE] = true
when "-d"
- $DEBUG = true
- $VERBOSE = true
+ $DEBUG = true
+ $VERBOSE = true
when "-w"
- $VERBOSE = true
+ $VERBOSE = true
when /^-W(.+)?/
- opt = $1 || ARGV.shift
- case opt
- when "0"
- $VERBOSE = nil
- when "1"
- $VERBOSE = false
- else
- $VERBOSE = true
- end
+ opt = $1 || ARGV.shift
+ case opt
+ when "0"
+ $VERBOSE = nil
+ when "1"
+ $VERBOSE = false
+ else
+ $VERBOSE = true
+ end
when /^-r(.+)?/
- opt = $1 || ARGV.shift
- @CONF[:LOAD_MODULES].push opt if opt
+ opt = $1 || ARGV.shift
+ @CONF[:LOAD_MODULES].push opt if opt
when /^-I(.+)?/
opt = $1 || ARGV.shift
- load_path.concat(opt.split(File::PATH_SEPARATOR)) if opt
+ load_path.concat(opt.split(File::PATH_SEPARATOR)) if opt
when '-U'
- set_encoding("UTF-8", "UTF-8")
+ set_encoding("UTF-8", "UTF-8")
when /^-E(.+)?/, /^--encoding(?:=(.+))?/
- opt = $1 || ARGV.shift
- set_encoding(*opt.split(':', 2))
+ opt = $1 || ARGV.shift
+ set_encoding(*opt.split(':', 2))
when "--inspect"
- if /^-/ !~ ARGV.first
- @CONF[:INSPECT_MODE] = ARGV.shift
- else
- @CONF[:INSPECT_MODE] = true
- end
+ if /^-/ !~ ARGV.first
+ @CONF[:INSPECT_MODE] = ARGV.shift
+ else
+ @CONF[:INSPECT_MODE] = true
+ end
when "--noinspect"
- @CONF[:INSPECT_MODE] = false
+ @CONF[:INSPECT_MODE] = false
when "--readline"
- @CONF[:USE_READLINE] = true
+ @CONF[:USE_READLINE] = true
when "--noreadline"
- @CONF[:USE_READLINE] = false
+ @CONF[:USE_READLINE] = false
when "--echo"
- @CONF[:ECHO] = true
+ @CONF[:ECHO] = true
when "--noecho"
- @CONF[:ECHO] = false
+ @CONF[:ECHO] = false
when "--verbose"
- @CONF[:VERBOSE] = true
+ @CONF[:VERBOSE] = true
when "--noverbose"
- @CONF[:VERBOSE] = false
+ @CONF[:VERBOSE] = false
when /^--prompt-mode(?:=(.+))?/, /^--prompt(?:=(.+))?/
- opt = $1 || ARGV.shift
- prompt_mode = opt.upcase.tr("-", "_").intern
- @CONF[:PROMPT_MODE] = prompt_mode
+ opt = $1 || ARGV.shift
+ prompt_mode = opt.upcase.tr("-", "_").intern
+ @CONF[:PROMPT_MODE] = prompt_mode
when "--noprompt"
- @CONF[:PROMPT_MODE] = :NULL
+ @CONF[:PROMPT_MODE] = :NULL
when "--inf-ruby-mode"
- @CONF[:PROMPT_MODE] = :INF_RUBY
+ @CONF[:PROMPT_MODE] = :INF_RUBY
when "--sample-book-mode", "--simple-prompt"
- @CONF[:PROMPT_MODE] = :SIMPLE
+ @CONF[:PROMPT_MODE] = :SIMPLE
when "--tracer"
- @CONF[:USE_TRACER] = true
+ @CONF[:USE_TRACER] = true
when /^--back-trace-limit(?:=(.+))?/
- @CONF[:BACK_TRACE_LIMIT] = ($1 || ARGV.shift).to_i
+ @CONF[:BACK_TRACE_LIMIT] = ($1 || ARGV.shift).to_i
when /^--context-mode(?:=(.+))?/
- @CONF[:CONTEXT_MODE] = ($1 || ARGV.shift).to_i
+ @CONF[:CONTEXT_MODE] = ($1 || ARGV.shift).to_i
when "--single-irb"
- @CONF[:SINGLE_IRB] = true
+ @CONF[:SINGLE_IRB] = true
when /^--irb_debug(?:=(.+))?/
- @CONF[:DEBUG_LEVEL] = ($1 || ARGV.shift).to_i
+ @CONF[:DEBUG_LEVEL] = ($1 || ARGV.shift).to_i
when "-v", "--version"
- print IRB.version, "\n"
- exit 0
+ print IRB.version, "\n"
+ exit 0
when "-h", "--help"
- require "irb/help"
- IRB.print_usage
- exit 0
+ require "irb/help"
+ IRB.print_usage
+ exit 0
when "--"
- if opt = ARGV.shift
- @CONF[:SCRIPT] = opt
- $0 = opt
- end
+ if opt = ARGV.shift
+ @CONF[:SCRIPT] = opt
+ $0 = opt
+ end
break
when /^-/
- IRB.fail UnrecognizedSwitch, opt
+ IRB.fail UnrecognizedSwitch, opt
else
- @CONF[:SCRIPT] = opt
- $0 = opt
- break
+ @CONF[:SCRIPT] = opt
+ $0 = opt
+ break
end
end
- if RUBY_VERSION >= FEATURE_IOPT_CHANGE_VERSION
- load_path.collect! do |path|
- /\A\.\// =~ path ? path : File.expand_path(path)
- end
+ load_path.collect! do |path|
+ /\A\.\// =~ path ? path : File.expand_path(path)
end
$LOAD_PATH.unshift(*load_path)
@@ -233,14 +228,14 @@ module IRB # :nodoc:
def IRB.run_config
if @CONF[:RC]
begin
- load rc_file
+ load rc_file
rescue LoadError, Errno::ENOENT
rescue # StandardError, ScriptError
- print "load error: #{rc_file}\n"
- print $!.class, ": ", $!, "\n"
- for err in $@[0, $@.size - 2]
- print "\t", err, "\n"
- end
+ print "load error: #{rc_file}\n"
+ print $!.class, ": ", $!, "\n"
+ for err in $@[0, $@.size - 2]
+ print "\t", err, "\n"
+ end
end
end
end
@@ -249,11 +244,11 @@ module IRB # :nodoc:
def IRB.rc_file(ext = IRBRC_EXT)
if !@CONF[:RC_NAME_GENERATOR]
rc_file_generators do |rcgen|
- @CONF[:RC_NAME_GENERATOR] ||= rcgen
- if File.exist?(rcgen.call(IRBRC_EXT))
- @CONF[:RC_NAME_GENERATOR] = rcgen
- break
- end
+ @CONF[:RC_NAME_GENERATOR] ||= rcgen
+ if File.exist?(rcgen.call(IRBRC_EXT))
+ @CONF[:RC_NAME_GENERATOR] = rcgen
+ break
+ end
end
end
case rc_file = @CONF[:RC_NAME_GENERATOR].call(ext)
@@ -283,9 +278,9 @@ module IRB # :nodoc:
def IRB.load_modules
for m in @CONF[:LOAD_MODULES]
begin
- require m
+ require m
rescue LoadError => err
- warn err.backtrace[0] << ":#{err.class}: #{err}"
+ warn err.backtrace[0] << ":#{err.class}: #{err}"
end
end
end
@@ -300,7 +295,7 @@ module IRB # :nodoc:
Encoding.default_internal = intern unless intern.nil? || intern.empty?
@CONF[:ENCODINGS] = IRB::DefaultEncodings.new(extern, intern)
[$stdin, $stdout, $stderr].each do |io|
- io.set_encoding(extern, intern)
+ io.set_encoding(extern, intern)
end
@CONF[:LC_MESSAGES].instance_variable_set(:@encoding, extern)
ensure
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index 55363fe0c4..f7b1aac3bf 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/input-method.rb - input methods used irb
# $Release Version: 0.9.6$
@@ -14,7 +15,6 @@ require 'irb/magic-file'
module IRB
STDIN_FILE_NAME = "(line)" # :nodoc:
class InputMethod
- @RCS_ID='-$Id$-'
# Creates a new input method object
def initialize(file = STDIN_FILE_NAME)
@@ -117,7 +117,6 @@ module IRB
def gets
print @prompt
l = @io.gets
-# print @prompt, l
l
end
@@ -133,14 +132,14 @@ module IRB
include Readline
# Creates a new input method object using Readline
def initialize
- super
+ super
- @line_no = 0
- @line = []
- @eof = false
+ @line_no = 0
+ @line = []
+ @eof = false
- @stdin = IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
- @stdout = IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
+ @stdin = IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
+ @stdout = IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
end
# Reads the next line from this input method.
@@ -149,13 +148,13 @@ module IRB
def gets
Readline.input = @stdin
Readline.output = @stdout
- if l = readline(@prompt, false)
- HISTORY.push(l) if !l.empty?
- @line[@line_no += 1] = l + "\n"
- else
- @eof = true
- l
- end
+ if l = readline(@prompt, false)
+ HISTORY.push(l) if !l.empty?
+ @line[@line_no += 1] = l + "\n"
+ else
+ @eof = true
+ l
+ end
end
# Whether the end of this input method has been reached, returns +true+
@@ -163,7 +162,7 @@ module IRB
#
# See IO#eof? for more information.
def eof?
- @eof
+ @eof
end
# Whether this input method is still readable when there is no more data to
@@ -171,7 +170,7 @@ module IRB
#
# See IO#eof for more information.
def readable_after_eof?
- true
+ true
end
# Returns the current line number for #io.
@@ -180,12 +179,12 @@ module IRB
#
# See IO#lineno for more information.
def line(line_no)
- @line[line_no]
+ @line[line_no]
end
# The external encoding for standard input.
def encoding
- @stdin.external_encoding
+ @stdin.external_encoding
end
end
rescue LoadError
diff --git a/lib/irb/inspector.rb b/lib/irb/inspector.rb
index cdd90d4081..f6f76712b8 100644
--- a/lib/irb/inspector.rb
+++ b/lib/irb/inspector.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/inspector.rb - inspect methods
# $Release Version: 0.9.6$
@@ -61,20 +62,6 @@ module IRB # :nodoc:
# Inspector.def_inspector(key, inspector)
# Inspector.def_inspector([key1,...], inspector)
def self.def_inspector(key, arg=nil, &block)
- # if !block_given?
- # case arg
- # when nil, Proc
- # inspector = IRB::Inspector(init_p)
- # when Inspector
- # inspector = init_p
- # else
- # IRB.Raise IllegalParameter, init_p
- # end
- # init_p = nil
- # else
- # inspector = IRB::Inspector(block, init_p)
- # end
-
if block_given?
inspector = IRB::Inspector(block, arg)
else
diff --git a/lib/irb/lc/error.rb b/lib/irb/lc/error.rb
index c0c6c30d79..6623f82d84 100644
--- a/lib/irb/lc/error.rb
+++ b/lib/irb/lc/error.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/lc/error.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/lc/ja/encoding_aliases.rb b/lib/irb/lc/ja/encoding_aliases.rb
index 5bef32e20e..c534bf0fef 100644
--- a/lib/irb/lc/ja/encoding_aliases.rb
+++ b/lib/irb/lc/ja/encoding_aliases.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# :stopdoc:
module IRB
class Locale
diff --git a/lib/irb/lc/ja/error.rb b/lib/irb/lc/ja/error.rb
index 4f09d781cb..919363154c 100644
--- a/lib/irb/lc/ja/error.rb
+++ b/lib/irb/lc/ja/error.rb
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+# frozen_string_literal: false
# irb/lc/ja/error.rb -
# $Release Version: 0.9.6$
# $Revision$
diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb
index accce9e13f..df540c8cbb 100644
--- a/lib/irb/locale.rb
+++ b/lib/irb/locale.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/locale.rb - internationalization module
# $Release Version: 0.9.6$
@@ -10,7 +11,6 @@
#
module IRB # :nodoc:
class Locale
- @RCS_ID='-$Id$-'
LOCALE_NAME_RE = %r[
(?<language>[[:alpha:]]{2,3})
@@ -26,27 +26,27 @@ module IRB # :nodoc:
@lang = @territory = @encoding_name = @modifier = nil
@locale = locale || ENV["IRB_LANG"] || ENV["LC_MESSAGES"] || ENV["LC_ALL"] || ENV["LANG"] || "C"
if m = LOCALE_NAME_RE.match(@locale)
- @lang, @territory, @encoding_name, @modifier = m[:language], m[:territory], m[:codeset], m[:modifier]
-
- if @encoding_name
- begin load 'irb/encoding_aliases.rb'; rescue LoadError; end
- if @encoding = @@legacy_encoding_alias_map[@encoding_name]
- warn "%s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"]
- end
- @encoding = Encoding.find(@encoding_name) rescue nil
- end
+ @lang, @territory, @encoding_name, @modifier = m[:language], m[:territory], m[:codeset], m[:modifier]
+
+ if @encoding_name
+ begin load 'irb/encoding_aliases.rb'; rescue LoadError; end
+ if @encoding = @@legacy_encoding_alias_map[@encoding_name]
+ warn "%s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"]
+ end
+ @encoding = Encoding.find(@encoding_name) rescue nil
+ end
end
@encoding ||= (Encoding.find('locale') rescue Encoding::ASCII_8BIT)
end
- attr_reader :lang, :territory, :encoding, :modifieer
+ attr_reader :lang, :territory, :encoding, :modifier
def String(mes)
mes = super(mes)
if @encoding
- mes.encode(@encoding, undef: :replace)
+ mes.encode(@encoding, undef: :replace)
else
- mes
+ mes
end
end
@@ -83,22 +83,22 @@ module IRB # :nodoc:
case file
when /\.rb$/
- begin
- load(file, priv)
- $".push file
- return true
- rescue LoadError
- end
+ begin
+ load(file, priv)
+ $".push file
+ return true
+ rescue LoadError
+ end
when /\.(so|o|sl)$/
- return super
+ return super
end
begin
- load(f = file + ".rb")
- $".push f #"
- return true
+ load(f = file + ".rb")
+ $".push f #"
+ return true
rescue LoadError
- return ruby_require(file)
+ return ruby_require(file)
end
end
@@ -129,9 +129,9 @@ module IRB # :nodoc:
def real_load(path, priv)
src = MagicFile.open(path){|f| f.read}
if priv
- eval("self", TOPLEVEL_BINDING).extend(Module.new {eval(src, nil, path)})
+ eval("self", TOPLEVEL_BINDING).extend(Module.new {eval(src, nil, path)})
else
- eval(src, TOPLEVEL_BINDING, path)
+ eval(src, TOPLEVEL_BINDING, path)
end
end
@@ -161,20 +161,20 @@ module IRB # :nodoc:
def each_sublocale
if @lang
- if @territory
- if @encoding_name
- yield "#{@lang}_#{@territory}.#{@encoding_name}@#{@modifier}" if @modifier
- yield "#{@lang}_#{@territory}.#{@encoding_name}"
- end
- yield "#{@lang}_#{@territory}@#{@modifier}" if @modifier
- yield "#{@lang}_#{@territory}"
- end
+ if @territory
+ if @encoding_name
+ yield "#{@lang}_#{@territory}.#{@encoding_name}@#{@modifier}" if @modifier
+ yield "#{@lang}_#{@territory}.#{@encoding_name}"
+ end
+ yield "#{@lang}_#{@territory}@#{@modifier}" if @modifier
+ yield "#{@lang}_#{@territory}"
+ end
if @encoding_name
yield "#{@lang}.#{@encoding_name}@#{@modifier}" if @modifier
yield "#{@lang}.#{@encoding_name}"
end
- yield "#{@lang}@#{@modifier}" if @modifier
- yield "#{@lang}"
+ yield "#{@lang}@#{@modifier}" if @modifier
+ yield "#{@lang}"
end
yield nil
end
diff --git a/lib/irb/magic-file.rb b/lib/irb/magic-file.rb
index 339ed60b6b..2dee684657 100644
--- a/lib/irb/magic-file.rb
+++ b/lib/irb/magic-file.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
module IRB
class << (MagicFile = Object.new)
# see parser_magic_comment in parse.y
diff --git a/lib/irb/notifier.rb b/lib/irb/notifier.rb
index 8207c6c06a..9d8de82e69 100644
--- a/lib/irb/notifier.rb
+++ b/lib/irb/notifier.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# notifier.rb - output methods used by irb
# $Release Version: 0.9.6$
@@ -40,8 +41,8 @@ module IRB
class AbstractNotifier
# Creates a new Notifier object
def initialize(prefix, base_notifier)
- @prefix = prefix
- @base_notifier = base_notifier
+ @prefix = prefix
+ @base_notifier = base_notifier
end
# The +prefix+ for this Notifier, which is appended to all objects being
@@ -52,38 +53,38 @@ module IRB
#
# Defaults to +true+.
def notify?
- true
+ true
end
# See OutputMethod#print for more detail.
def print(*opts)
- @base_notifier.print prefix, *opts if notify?
+ @base_notifier.print prefix, *opts if notify?
end
# See OutputMethod#printn for more detail.
def printn(*opts)
- @base_notifier.printn prefix, *opts if notify?
+ @base_notifier.printn prefix, *opts if notify?
end
# See OutputMethod#printf for more detail.
def printf(format, *opts)
- @base_notifier.printf(prefix + format, *opts) if notify?
+ @base_notifier.printf(prefix + format, *opts) if notify?
end
# See OutputMethod#puts for more detail.
def puts(*objs)
- if notify?
- @base_notifier.puts(*objs.collect{|obj| prefix + obj.to_s})
- end
+ if notify?
+ @base_notifier.puts(*objs.collect{|obj| prefix + obj.to_s})
+ end
end
# Same as #ppx, except it uses the #prefix given during object
# initialization.
# See OutputMethod#ppx for more detail.
def pp(*objs)
- if notify?
- @base_notifier.ppx @prefix, *objs
- end
+ if notify?
+ @base_notifier.ppx @prefix, *objs
+ end
end
# Same as #pp, except it concatenates the given +prefix+ with the #prefix
@@ -91,14 +92,14 @@ module IRB
#
# See OutputMethod#ppx for more detail.
def ppx(prefix, *objs)
- if notify?
- @base_notifier.ppx @prefix+prefix, *objs
- end
+ if notify?
+ @base_notifier.ppx @prefix+prefix, *objs
+ end
end
# Execute the given block if notifications are enabled.
def exec_if
- yield(@base_notifier) if notify?
+ yield(@base_notifier) if notify?
end
end
@@ -116,10 +117,10 @@ module IRB
# Create a new composite notifier object with the given +prefix+, and
# +base_notifier+ to use for output.
def initialize(prefix, base_notifier)
- super
+ super
- @notifiers = [D_NOMSG]
- @level_notifier = D_NOMSG
+ @notifiers = [D_NOMSG]
+ @level_notifier = D_NOMSG
end
# List of notifiers in the group
@@ -132,9 +133,9 @@ module IRB
#
# This method returns the newly created instance.
def def_notifier(level, prefix = "")
- notifier = LeveledNotifier.new(self, level, prefix)
- @notifiers[level] = notifier
- notifier
+ notifier = LeveledNotifier.new(self, level, prefix)
+ @notifiers[level] = notifier
+ notifier
end
# Returns the leveled notifier for this object
@@ -156,16 +157,16 @@ module IRB
# found in the existing #notifiers Array, or an instance of
# AbstractNotifier
def level_notifier=(value)
- case value
- when AbstractNotifier
- @level_notifier = value
- when Integer
- l = @notifiers[value]
- Notifier.Raise ErrUndefinedNotifier, value unless l
- @level_notifier = l
- else
- Notifier.Raise ErrUnrecognizedLevel, value unless l
- end
+ case value
+ when AbstractNotifier
+ @level_notifier = value
+ when Integer
+ l = @notifiers[value]
+ Notifier.Raise ErrUndefinedNotifier, value unless l
+ @level_notifier = l
+ else
+ Notifier.Raise ErrUnrecognizedLevel, value unless l
+ end
end
alias level= level_notifier=
@@ -183,9 +184,9 @@ module IRB
# CompositeNotifier group to determine whether or not to output
# notifications.
def initialize(base, level, prefix)
- super(prefix, base)
+ super(prefix, base)
- @level = level
+ @level = level
end
# The current level of this notifier object
@@ -196,13 +197,13 @@ module IRB
#
# See the Comparable module for more information.
def <=>(other)
- @level <=> other.level
+ @level <=> other.level
end
# Whether to output messages to the output method, depending on the level
# of this notifier object.
def notify?
- @base_notifier.level >= self
+ @base_notifier.level >= self
end
end
@@ -214,15 +215,15 @@ module IRB
class NoMsgNotifier<LeveledNotifier
# Creates a new notifier that should not be used to output messages.
def initialize
- @base_notifier = nil
- @level = 0
- @prefix = ""
+ @base_notifier = nil
+ @level = 0
+ @prefix = ""
end
# Ensures notifications are ignored, see AbstractNotifier#notify? for
# more information.
def notify?
- false
+ false
end
end
diff --git a/lib/irb/output-method.rb b/lib/irb/output-method.rb
index aae9e2294d..7d64851698 100644
--- a/lib/irb/output-method.rb
+++ b/lib/irb/output-method.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# output-method.rb - output methods used by irb
# $Release Version: 0.9.6$
@@ -35,7 +36,7 @@ module IRB
# #parse_printf_format
def printf(format, *opts)
if /(%*)%I/ =~ format
- format, opts = parse_printf_format(format, opts)
+ format, opts = parse_printf_format(format, opts)
end
print sprintf(format, *opts)
end
@@ -58,8 +59,8 @@ module IRB
# character.
def puts(*objs)
for obj in objs
- print(*obj)
- print "\n"
+ print(*obj)
+ print "\n"
end
end
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 4a700b3324..ca01662eee 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/ruby-lex.rb - ruby lexcal analyzer
# $Release Version: 0.9.6$
@@ -15,14 +16,13 @@ require "irb/ruby-token"
# :stopdoc:
class RubyLex
- @RCS_ID='-$Id$-'
extend Exception2MessageMapper
def_exception(:AlreadyDefinedToken, "Already defined token(%s)")
def_exception(:TkReading2TokenNoKey, "key nothing(key='%s')")
def_exception(:TkSymbol2TokenNoKey, "key nothing(key='%s')")
def_exception(:TkReading2TokenDuplicateError,
- "key duplicate(token_n='%s', key='%s')")
+ "key duplicate(token_n='%s', key='%s')")
def_exception(:SyntaxError, "%s")
def_exception(:TerminateLineInput, "Terminate Line Input")
@@ -101,7 +101,6 @@ class RubyLex
def getc
while @rests.empty?
-# return nil unless buf_input
@rests.push nil unless buf_input
end
c = @rests.shift
@@ -154,9 +153,9 @@ class RubyLex
if c == "\n"
@line_no -= 1
if idx = @readed.rindex("\n")
- @char_no = idx + 1
+ @char_no = idx + 1
else
- @char_no = @base_char_no + @readed.size
+ @char_no = @base_char_no + @readed.size
end
else
@char_no -= 1
@@ -231,47 +230,43 @@ class RubyLex
initialize_input
catch(:TERM_INPUT) do
loop do
- begin
- @continue = false
- prompt
- unless l = lex
- throw :TERM_INPUT if @line == ''
- else
- @line.concat l
- if @ltype or @continue or @indent > 0
- next
- end
- end
- if @line != "\n"
+ begin
+ @continue = false
+ prompt
+ unless l = lex
+ throw :TERM_INPUT if @line == ''
+ else
+ @line.concat l
+ if @ltype or @continue or @indent > 0
+ next
+ end
+ end
+ if @line != "\n"
@line.force_encoding(@io.encoding)
- yield @line, @exp_line_no
- end
- break unless l
- @line = ''
- @exp_line_no = @line_no
-
- @indent = 0
- @indent_stack = []
- prompt
- rescue TerminateLineInput
- initialize_input
- prompt
- get_readed
- end
+ yield @line, @exp_line_no
+ end
+ break unless l
+ @line = ''
+ @exp_line_no = @line_no
+
+ @indent = 0
+ @indent_stack = []
+ prompt
+ rescue TerminateLineInput
+ initialize_input
+ prompt
+ get_readed
+ end
end
end
end
def lex
until (((tk = token).kind_of?(TkNL) || tk.kind_of?(TkEND_OF_SCRIPT)) &&
- !@continue or
- tk.nil?)
- #p tk
- #p @lex_state
- #p self
+ !@continue or
+ tk.nil?)
end
line = get_readed
- # print self.inspect
if line == "" and tk.kind_of?(TkEND_OF_SCRIPT) || tk.nil?
nil
else
@@ -280,34 +275,31 @@ class RubyLex
end
def token
- # require "tracer"
- # Tracer.on
@prev_seek = @seek
@prev_line_no = @line_no
@prev_char_no = @char_no
begin
begin
- tk = @OP.match(self)
- @space_seen = tk.kind_of?(TkSPACE)
- @lex_state = EXPR_END if @post_symbeg && tk.kind_of?(TkOp)
- @post_symbeg = tk.kind_of?(TkSYMBEG)
+ tk = @OP.match(self)
+ @space_seen = tk.kind_of?(TkSPACE)
+ @lex_state = EXPR_END if @post_symbeg && tk.kind_of?(TkOp)
+ @post_symbeg = tk.kind_of?(TkSYMBEG)
rescue SyntaxError
- raise if @exception_on_syntax_error
- tk = TkError.new(@seek, @line_no, @char_no)
+ raise if @exception_on_syntax_error
+ tk = TkError.new(@seek, @line_no, @char_no)
end
end while @skip_space and tk.kind_of?(TkSPACE)
if @readed_auto_clean_up
get_readed
end
- # Tracer.off
tk
end
ENINDENT_CLAUSE = [
"case", "class", "def", "do", "for", "if",
- "module", "unless", "until", "while", "begin" #, "when"
+ "module", "unless", "until", "while", "begin"
]
- DEINDENT_CLAUSE = ["end" #, "when"
+ DEINDENT_CLAUSE = ["end"
]
PERCENT_LTYPE = {
@@ -361,12 +353,12 @@ class RubyLex
end
@OP.def_rule("=begin",
- proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do
+ proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do
|op, io|
@ltype = "="
until getc == "\n"; end
until peek_equal?("=end") && peek(4) =~ /\s/
- until getc == "\n"; end
+ until getc == "\n"; end
end
gets
@ltype = nil
@@ -377,15 +369,15 @@ class RubyLex
print "\\n\n" if RubyLex.debug?
case @lex_state
when EXPR_BEG, EXPR_FNAME, EXPR_DOT
- @continue = true
+ @continue = true
else
- @continue = false
- @lex_state = EXPR_BEG
- until (@indent_stack.empty? ||
- [TkLPAREN, TkLBRACK, TkLBRACE,
- TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
- @indent_stack.pop
- end
+ @continue = false
+ @lex_state = EXPR_BEG
+ until (@indent_stack.empty? ||
+ [TkLPAREN, TkLBRACK, TkLBRACE,
+ TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
+ @indent_stack.pop
+ end
end
@here_header = false
@here_readed = []
@@ -393,17 +385,17 @@ class RubyLex
end
@OP.def_rules("*", "**",
- "=", "==", "===",
- "=~", "<=>",
- "<", "<=",
- ">", ">=", ">>",
- "!", "!=", "!~") do
+ "=", "==", "===",
+ "=~", "<=>",
+ "<", "<=",
+ ">", ">=", ">>",
+ "!", "!=", "!~") do
|op, io|
case @lex_state
when EXPR_FNAME, EXPR_DOT
- @lex_state = EXPR_ARG
+ @lex_state = EXPR_ARG
else
- @lex_state = EXPR_BEG
+ @lex_state = EXPR_BEG
end
Token(op)
end
@@ -412,20 +404,20 @@ class RubyLex
|op, io|
tk = nil
if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
- (@lex_state != EXPR_ARG || @space_seen)
- c = peek(0)
- if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-")
- tk = identify_here_document
- end
+ (@lex_state != EXPR_ARG || @space_seen)
+ c = peek(0)
+ if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-" || c == "~")
+ tk = identify_here_document
+ end
end
unless tk
- tk = Token(op)
- case @lex_state
- when EXPR_FNAME, EXPR_DOT
- @lex_state = EXPR_ARG
- else
- @lex_state = EXPR_BEG
- end
+ tk = Token(op)
+ case @lex_state
+ when EXPR_FNAME, EXPR_DOT
+ @lex_state = EXPR_ARG
+ else
+ @lex_state = EXPR_BEG
+ end
end
tk
end
@@ -438,31 +430,31 @@ class RubyLex
@OP.def_rules("`") do
|op, io|
if @lex_state == EXPR_FNAME
- @lex_state = EXPR_END
- Token(op)
+ @lex_state = EXPR_END
+ Token(op)
else
- identify_string(op)
+ identify_string(op)
end
end
@OP.def_rules('?') do
|op, io|
if @lex_state == EXPR_END
- @lex_state = EXPR_BEG
- Token(TkQUESTION)
+ @lex_state = EXPR_BEG
+ Token(TkQUESTION)
else
- ch = getc
- if @lex_state == EXPR_ARG && ch =~ /\s/
- ungetc
- @lex_state = EXPR_BEG;
- Token(TkQUESTION)
- else
- if (ch == '\\')
- read_escape
- end
- @lex_state = EXPR_END
- Token(TkINTEGER)
- end
+ ch = getc
+ if @lex_state == EXPR_ARG && ch =~ /\s/
+ ungetc
+ @lex_state = EXPR_BEG;
+ Token(TkQUESTION)
+ else
+ if (ch == '\\')
+ read_escape
+ end
+ @lex_state = EXPR_END
+ Token(TkINTEGER)
+ end
end
end
@@ -473,7 +465,7 @@ class RubyLex
end
@OP.def_rules("+=", "-=", "*=", "**=",
- "&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do
+ "&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do
|op, io|
@lex_state = EXPR_BEG
op =~ /^(.*)=$/
@@ -495,18 +487,18 @@ class RubyLex
@OP.def_rules("+", "-") do
|op, io|
catch(:RET) do
- if @lex_state == EXPR_ARG
- if @space_seen and peek(0) =~ /[0-9]/
- throw :RET, identify_number
- else
- @lex_state = EXPR_BEG
- end
- elsif @lex_state != EXPR_END and peek(0) =~ /[0-9]/
- throw :RET, identify_number
- else
- @lex_state = EXPR_BEG
- end
- Token(op)
+ if @lex_state == EXPR_ARG
+ if @space_seen and peek(0) =~ /[0-9]/
+ throw :RET, identify_number
+ else
+ @lex_state = EXPR_BEG
+ end
+ elsif @lex_state != EXPR_END and peek(0) =~ /[0-9]/
+ throw :RET, identify_number
+ else
+ @lex_state = EXPR_BEG
+ end
+ Token(op)
end
end
@@ -514,12 +506,12 @@ class RubyLex
|op, io|
@lex_state = EXPR_BEG
if peek(0) =~ /[0-9]/
- ungetc
- identify_number
+ ungetc
+ identify_number
else
- # for "obj.if" etc.
- @lex_state = EXPR_DOT
- Token(TkDOT)
+ # for "obj.if" etc.
+ @lex_state = EXPR_DOT
+ Token(TkDOT)
end
end
@@ -544,39 +536,38 @@ class RubyLex
@OP.def_rule(":") do
|op, io|
if @lex_state == EXPR_END || peek(0) =~ /\s/
- @lex_state = EXPR_BEG
- Token(TkCOLON)
+ @lex_state = EXPR_BEG
+ Token(TkCOLON)
else
- @lex_state = EXPR_FNAME
- Token(TkSYMBEG)
+ @lex_state = EXPR_FNAME
+ Token(TkSYMBEG)
end
end
@OP.def_rule("::") do
|op, io|
-# p @lex_state.id2name, @space_seen
if @lex_state == EXPR_BEG or @lex_state == EXPR_ARG && @space_seen
- @lex_state = EXPR_BEG
- Token(TkCOLON3)
+ @lex_state = EXPR_BEG
+ Token(TkCOLON3)
else
- @lex_state = EXPR_DOT
- Token(TkCOLON2)
+ @lex_state = EXPR_DOT
+ Token(TkCOLON2)
end
end
@OP.def_rule("/") do
|op, io|
if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
- identify_string(op)
+ identify_string(op)
elsif peek(0) == '='
- getc
- @lex_state = EXPR_BEG
- Token(TkOPASGN, "/") #/)
+ getc
+ @lex_state = EXPR_BEG
+ Token(TkOPASGN, "/") #/)
elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
- identify_string(op)
+ identify_string(op)
else
- @lex_state = EXPR_BEG
- Token("/") #/)
+ @lex_state = EXPR_BEG
+ Token("/") #/)
end
end
@@ -586,11 +577,6 @@ class RubyLex
Token("^")
end
- # @OP.def_rules("^=") do
- # @lex_state = EXPR_BEG
- # Token(OP_ASGN, :^)
- # end
-
@OP.def_rules(",") do
|op, io|
@lex_state = EXPR_BEG
@@ -601,9 +587,9 @@ class RubyLex
|op, io|
@lex_state = EXPR_BEG
until (@indent_stack.empty? ||
- [TkLPAREN, TkLBRACK, TkLBRACE,
- TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
- @indent_stack.pop
+ [TkLPAREN, TkLBRACK, TkLBRACE,
+ TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
+ @indent_stack.pop
end
Token(op)
end
@@ -624,11 +610,11 @@ class RubyLex
|op, io|
@indent += 1
if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
- @lex_state = EXPR_BEG
- tk_c = TkfLPAREN
+ @lex_state = EXPR_BEG
+ tk_c = TkfLPAREN
else
- @lex_state = EXPR_BEG
- tk_c = TkLPAREN
+ @lex_state = EXPR_BEG
+ tk_c = TkLPAREN
end
@indent_stack.push tk_c
Token(tk_c)
@@ -650,16 +636,16 @@ class RubyLex
|op, io|
@indent += 1
if @lex_state == EXPR_FNAME
- tk_c = TkfLBRACK
+ tk_c = TkfLBRACK
else
- if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
- tk_c = TkLBRACK
- elsif @lex_state == EXPR_ARG && @space_seen
- tk_c = TkLBRACK
- else
- tk_c = TkfLBRACK
- end
- @lex_state = EXPR_BEG
+ if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
+ tk_c = TkLBRACK
+ elsif @lex_state == EXPR_ARG && @space_seen
+ tk_c = TkLBRACK
+ else
+ tk_c = TkfLBRACK
+ end
+ @lex_state = EXPR_BEG
end
@indent_stack.push tk_c
Token(tk_c)
@@ -669,9 +655,9 @@ class RubyLex
|op, io|
@indent += 1
if @lex_state != EXPR_END && @lex_state != EXPR_ARG
- tk_c = TkLBRACE
+ tk_c = TkLBRACE
else
- tk_c = TkfLBRACE
+ tk_c = TkfLBRACE
end
@lex_state = EXPR_BEG
@indent_stack.push tk_c
@@ -681,27 +667,27 @@ class RubyLex
@OP.def_rule('\\') do
|op, io|
if getc == "\n"
- @space_seen = true
- @continue = true
- Token(TkSPACE)
+ @space_seen = true
+ @continue = true
+ Token(TkSPACE)
else
- read_escape
- Token("\\")
+ read_escape
+ Token("\\")
end
end
@OP.def_rule('%') do
|op, io|
if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
- identify_quotation
+ identify_quotation
elsif peek(0) == '='
- getc
- Token(TkOPASGN, :%)
+ getc
+ Token(TkOPASGN, :%)
elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
- identify_quotation
+ identify_quotation
else
- @lex_state = EXPR_BEG
- Token("%") #))
+ @lex_state = EXPR_BEG
+ Token("%") #))
end
end
@@ -713,30 +699,20 @@ class RubyLex
@OP.def_rule('@') do
|op, io|
if peek(0) =~ /[\w@]/
- ungetc
- identify_identifier
+ ungetc
+ identify_identifier
else
- Token("@")
+ Token("@")
end
end
- # @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
- # |op, io|
- # @indent += 1
- # @lex_state = EXPR_FNAME
- # # @lex_state = EXPR_END
- # # until @rests[0] == "\n" or @rests[0] == ";"
- # # rests.shift
- # # end
- # end
-
@OP.def_rule("") do
|op, io|
printf "MATCH: start %s: %s\n", op, io.inspect if RubyLex.debug?
if peek(0) =~ /[0-9]/
- t = identify_number
+ t = identify_number
elsif peek(0) =~ /[^\x00-\/:-@\[-^`{-\x7F]/
- t = identify_identifier
+ t = identify_identifier
end
printf "MATCH: end %s: %s\n", op, io.inspect if RubyLex.debug?
t
@@ -774,7 +750,7 @@ class RubyLex
if peek(0) =~ /[$@]/
token.concat(c = getc)
if c == "@" and peek(0) == "@"
- token.concat getc
+ token.concat getc
end
end
@@ -807,61 +783,60 @@ class RubyLex
token_c, *trans = TkReading2Token[token]
if token_c
- # reserved word?
-
- if (@lex_state != EXPR_BEG &&
- @lex_state != EXPR_FNAME &&
- trans[1])
- # modifiers
- token_c = TkSymbol2Token[trans[1]]
- @lex_state = trans[0]
- else
- if @lex_state != EXPR_FNAME
- if ENINDENT_CLAUSE.include?(token)
- # check for ``class = val'' etc.
- valid = true
- case token
- when "class"
- valid = false unless peek_match?(/^\s*(<<|\w|::)/)
- when "def"
- valid = false if peek_match?(/^\s*(([+\-\/*&\|^]|<<|>>|\|\||\&\&)=|\&\&|\|\|)/)
- when "do"
- valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&)/)
- when *ENINDENT_CLAUSE
- valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&|\|)/)
- else
- # no nothing
- end
- if valid
- if token == "do"
- if ![TkFOR, TkWHILE, TkUNTIL].include?(@indent_stack.last)
- @indent += 1
- @indent_stack.push token_c
- end
- else
- @indent += 1
- @indent_stack.push token_c
- end
-# p @indent_stack
- end
-
- elsif DEINDENT_CLAUSE.include?(token)
- @indent -= 1
- @indent_stack.pop
- end
- @lex_state = trans[0]
- else
- @lex_state = EXPR_END
- end
- end
- return Token(token_c, token)
+ # reserved word?
+
+ if (@lex_state != EXPR_BEG &&
+ @lex_state != EXPR_FNAME &&
+ trans[1])
+ # modifiers
+ token_c = TkSymbol2Token[trans[1]]
+ @lex_state = trans[0]
+ else
+ if @lex_state != EXPR_FNAME and peek(0) != ':'
+ if ENINDENT_CLAUSE.include?(token)
+ # check for ``class = val'' etc.
+ valid = true
+ case token
+ when "class"
+ valid = false unless peek_match?(/^\s*(<<|\w|::)/)
+ when "def"
+ valid = false if peek_match?(/^\s*(([+\-\/*&\|^]|<<|>>|\|\||\&\&)=|\&\&|\|\|)/)
+ when "do"
+ valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&)/)
+ when *ENINDENT_CLAUSE
+ valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&|\|)/)
+ else
+ # no nothing
+ end
+ if valid
+ if token == "do"
+ if ![TkFOR, TkWHILE, TkUNTIL].include?(@indent_stack.last)
+ @indent += 1
+ @indent_stack.push token_c
+ end
+ else
+ @indent += 1
+ @indent_stack.push token_c
+ end
+ end
+
+ elsif DEINDENT_CLAUSE.include?(token)
+ @indent -= 1
+ @indent_stack.pop
+ end
+ @lex_state = trans[0]
+ else
+ @lex_state = EXPR_END
+ end
+ end
+ return Token(token_c, token)
end
end
if @lex_state == EXPR_FNAME
@lex_state = EXPR_END
if peek(0) == '='
- token.concat getc
+ token.concat getc
end
elsif @lex_state == EXPR_BEG || @lex_state == EXPR_DOT
@lex_state = EXPR_ARG
@@ -880,8 +855,7 @@ class RubyLex
def identify_here_document
ch = getc
-# if lt = PERCENT_LTYPE[ch]
- if ch == "-"
+ if ch == "-" || ch == "~"
ch = getc
indent = true
end
@@ -889,13 +863,13 @@ class RubyLex
lt = ch
quoted = ""
while (c = getc) && c != lt
- quoted.concat c
+ quoted.concat c
end
else
lt = '"'
quoted = ch.dup
while (c = getc) && c =~ /\w/
- quoted.concat c
+ quoted.concat c
end
ungetc
end
@@ -905,32 +879,26 @@ class RubyLex
while ch = getc
reserve.push ch
if ch == "\\"
- reserve.push ch = getc
+ reserve.push ch = getc
elsif ch == "\n"
- break
+ break
end
end
@here_header = false
-# while l = gets
-# l = l.sub(/(:?\r)?\n\z/, '')
-# if (indent ? l.strip : l) == quoted
-# break
-# end
-# end
line = ""
while ch = getc
if ch == "\n"
- if line == quoted
- break
- end
- line = ""
+ if line == quoted
+ break
+ end
+ line = ""
else
- line.concat ch unless indent && line == "" && /\s/ =~ ch
- if @ltype != "'" && ch == "#" && peek(0) == "{"
- identify_string_dvar
- end
+ line.concat ch unless indent && line == "" && /\s/ =~ ch
+ if @ltype != "'" && ch == "#" && peek(0) == "{"
+ identify_string_dvar
+ end
end
end
@@ -954,11 +922,6 @@ class RubyLex
else
RubyLex.fail SyntaxError, "unknown type of %string"
end
-# if ch !~ /\W/
-# ungetc
-# next
-# end
- #@ltype = lt
@quoted = ch unless @quoted = PERCENT_PAREN[ch]
identify_string(lt, @quoted)
end
@@ -970,49 +933,49 @@ class RubyLex
getc
case peek(0)
when /[xX]/
- ch = getc
- match = /[0-9a-fA-F_]/
+ ch = getc
+ match = /[0-9a-fA-F_]/
when /[bB]/
- ch = getc
- match = /[01_]/
+ ch = getc
+ match = /[01_]/
when /[oO]/
- ch = getc
- match = /[0-7_]/
+ ch = getc
+ match = /[0-7_]/
when /[dD]/
- ch = getc
- match = /[0-9_]/
+ ch = getc
+ match = /[0-9_]/
when /[0-7]/
- match = /[0-7_]/
+ match = /[0-7_]/
when /[89]/
- RubyLex.fail SyntaxError, "Invalid octal digit"
+ RubyLex.fail SyntaxError, "Invalid octal digit"
else
- return Token(TkINTEGER)
+ return Token(TkINTEGER)
end
len0 = true
non_digit = false
while ch = getc
- if match =~ ch
- if ch == "_"
- if non_digit
- RubyLex.fail SyntaxError, "trailing `#{ch}' in number"
- else
- non_digit = ch
- end
- else
- non_digit = false
- len0 = false
- end
- else
- ungetc
- if len0
- RubyLex.fail SyntaxError, "numeric literal without digits"
- end
- if non_digit
- RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
- end
- break
- end
+ if match =~ ch
+ if ch == "_"
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{ch}' in number"
+ else
+ non_digit = ch
+ end
+ else
+ non_digit = false
+ len0 = false
+ end
+ else
+ ungetc
+ if len0
+ RubyLex.fail SyntaxError, "numeric literal without digits"
+ end
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ break
+ end
end
return Token(TkINTEGER)
end
@@ -1024,37 +987,37 @@ class RubyLex
while ch = getc
case ch
when /[0-9]/
- non_digit = false
+ non_digit = false
when "_"
- non_digit = ch
+ non_digit = ch
when allow_point && "."
- if non_digit
- RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
- end
- type = TkFLOAT
- if peek(0) !~ /[0-9]/
- type = TkINTEGER
- ungetc
- break
- end
- allow_point = false
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ type = TkFLOAT
+ if peek(0) !~ /[0-9]/
+ type = TkINTEGER
+ ungetc
+ break
+ end
+ allow_point = false
when allow_e && "e", allow_e && "E"
- if non_digit
- RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
- end
- type = TkFLOAT
- if peek(0) =~ /[+-]/
- getc
- end
- allow_e = false
- allow_point = false
- non_digit = ch
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ type = TkFLOAT
+ if peek(0) =~ /[+-]/
+ getc
+ end
+ allow_e = false
+ allow_point = false
+ non_digit = ch
else
- if non_digit
- RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
- end
- ungetc
- break
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ ungetc
+ break
end
end
Token(type)
@@ -1067,38 +1030,38 @@ class RubyLex
begin
nest = 0
while ch = getc
- if @quoted == ch and nest == 0
- break
- elsif @ltype != "'" && ch == "#" && peek(0) == "{"
- identify_string_dvar
- elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#"
- subtype = true
- elsif ch == '\\' and @ltype == "'" #'
- case ch = getc
- when "\\", "\n", "'"
- else
- ungetc
- end
- elsif ch == '\\' #'
- read_escape
- end
- if PERCENT_PAREN.values.include?(@quoted)
- if PERCENT_PAREN[ch] == @quoted
- nest += 1
- elsif ch == @quoted
- nest -= 1
- end
- end
+ if @quoted == ch and nest == 0
+ break
+ elsif @ltype != "'" && ch == "#" && peek(0) == "{"
+ identify_string_dvar
+ elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#"
+ subtype = true
+ elsif ch == '\\' and @ltype == "'" #'
+ case ch = getc
+ when "\\", "\n", "'"
+ else
+ ungetc
+ end
+ elsif ch == '\\' #'
+ read_escape
+ end
+ if PERCENT_PAREN.values.include?(@quoted)
+ if PERCENT_PAREN[ch] == @quoted
+ nest += 1
+ elsif ch == @quoted
+ nest -= 1
+ end
+ end
end
if @ltype == "/"
while /[imxoesun]/ =~ peek(0)
- getc
- end
+ getc
+ end
end
if subtype
- Token(DLtype2Token[ltype])
+ Token(DLtype2Token[ltype])
else
- Token(Ltype2Token[ltype])
+ Token(Ltype2Token[ltype])
end
ensure
@ltype = nil
@@ -1125,13 +1088,13 @@ class RubyLex
@lex_state = EXPR_BEG
loop do
- @continue = false
- prompt
- tk = token
- if @ltype or @continue or @indent > 0
- next
- end
- break if tk.kind_of?(TkRBRACE)
+ @continue = false
+ prompt
+ tk = token
+ if @ltype or @continue or @indent >= 0
+ next
+ end
+ break if tk.kind_of?(TkRBRACE)
end
ensure
@continue = reserve_continue
@@ -1147,13 +1110,10 @@ class RubyLex
@ltype = "#"
while ch = getc
-# if ch == "\\" #"
-# read_escape
-# end
if ch == "\n"
- @ltype = nil
- ungetc
- break
+ @ltype = nil
+ ungetc
+ break
end
end
return Token(TkCOMMENT)
@@ -1166,42 +1126,42 @@ class RubyLex
when /[0-7]/
ungetc ch
3.times do
- case ch = getc
- when /[0-7]/
- when nil
- break
- else
- ungetc
- break
- end
+ case ch = getc
+ when /[0-7]/
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
end
when "x"
2.times do
- case ch = getc
- when /[0-9a-fA-F]/
- when nil
- break
- else
- ungetc
- break
- end
+ case ch = getc
+ when /[0-9a-fA-F]/
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
end
when "M"
if (ch = getc) != '-'
- ungetc
+ ungetc
else
- if (ch = getc) == "\\" #"
- read_escape
- end
+ if (ch = getc) == "\\" #"
+ read_escape
+ end
end
when "C", "c" #, "^"
if ch == "C" and (ch = getc) != "-"
- ungetc
+ ungetc
elsif (ch = getc) == "\\" #"
- read_escape
+ read_escape
end
else
# other characters
diff --git a/lib/irb/ruby-token.rb b/lib/irb/ruby-token.rb
index 2c7565dbfc..af53d3c93b 100644
--- a/lib/irb/ruby-token.rb
+++ b/lib/irb/ruby-token.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/ruby-token.rb - ruby tokens
# $Release Version: 0.9.6$
@@ -24,14 +25,14 @@ module RubyToken
@line_no = line_no
@char_no = char_no
end
- attr :seek, :line_no, :char_no
+ attr_reader :seek, :line_no, :char_no
end
class TkNode < Token
def initialize(seek, line_no, char_no)
super
end
- attr :node
+ attr_reader :node
end
class TkId < Token
@@ -39,7 +40,7 @@ module RubyToken
super(seek, line_no, char_no)
@name = name
end
- attr :name
+ attr_reader :name
end
class TkVal < Token
@@ -47,7 +48,7 @@ module RubyToken
super(seek, line_no, char_no)
@value = value
end
- attr :value
+ attr_reader :value
end
class TkOp < Token
@@ -60,7 +61,7 @@ module RubyToken
op = TkReading2Token[op][0] unless op.kind_of?(Symbol)
@op = op
end
- attr :op
+ attr_reader :op
end
class TkUnknownChar < Token
@@ -68,7 +69,7 @@ module RubyToken
super(seek, line_no, char_no)
@name = name
end
- attr :name
+ attr_reader :name
end
class TkError < Token
@@ -78,23 +79,23 @@ module RubyToken
case token
when String
if (tk = TkReading2Token[token]).nil?
- IRB.fail TkReading2TokenNoKey, token
+ IRB.fail TkReading2TokenNoKey, token
end
tk = Token(tk[0], value)
if tk.kind_of?(TkOp)
- tk.name = token
+ tk.name = token
end
return tk
when Symbol
if (tk = TkSymbol2Token[token]).nil?
- IRB.fail TkSymbol2TokenNoKey, token
+ IRB.fail TkSymbol2TokenNoKey, token
end
return Token(tk[0], value)
else
if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
- token.new(@prev_seek, @prev_line_no, @prev_char_no)
+ token.new(@prev_seek, @prev_line_no, @prev_char_no)
else
- token.new(@prev_seek, @prev_line_no, @prev_char_no, value)
+ token.new(@prev_seek, @prev_line_no, @prev_char_no, value)
end
end
end
@@ -186,7 +187,6 @@ module RubyToken
[:TkRSHFT, TkOp, ">>"],
[:TkCOLON2, TkOp],
[:TkCOLON3, TkOp],
-# [:OPASGN, TkOp], # +=, -= etc. #
[:TkASSOC, TkOp, "=>"],
[:TkQUESTION, TkOp, "?"], #?
[:TkCOLON, TkOp, ":"], #:
@@ -249,12 +249,12 @@ module RubyToken
if reading
if TkReading2Token[reading]
- IRB.fail TkReading2TokenDuplicateError, token_n, reading
+ IRB.fail TkReading2TokenDuplicateError, token_n, reading
end
if opts.empty?
- TkReading2Token[reading] = [token_c]
+ TkReading2Token[reading] = [token_c]
else
- TkReading2Token[reading] = [token_c].concat(opts)
+ TkReading2Token[reading] = [token_c].concat(opts)
end
end
TkSymbol2Token[token_n.intern] = token_c
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb
index 09c1c02ebc..68174771a7 100644
--- a/lib/irb/slex.rb
+++ b/lib/irb/slex.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/slex.rb - simple lex analyzer
# $Release Version: 0.9.6$
@@ -15,7 +16,6 @@ require "irb/notifier"
# :stopdoc:
module IRB
class SLex
- @RCS_ID='-$Id$-'
extend Exception2MessageMapper
def_exception :ErrNodeNothing, "node nothing"
@@ -41,10 +41,10 @@ module IRB
def def_rules(*tokens, &block)
if block_given?
- p = block
+ p = block
end
for token in tokens
- def_rule(token, nil, p)
+ def_rule(token, nil, p)
end
end
@@ -71,9 +71,9 @@ module IRB
case token
when Array
when String
- return match(token.split(//))
+ return match(token.split(//))
else
- return @head.match_io(token)
+ return @head.match_io(token)
end
ret = @head.match(token)
D_DETAIL.exec_if{D_DETAIL.printf "match end: %s:%s\n", ret, token.inspect}
@@ -93,69 +93,69 @@ module IRB
# if postproc is nil, this node is an abstract node.
# if postproc is non-nil, this node is a real node.
def initialize(preproc = nil, postproc = nil)
- @Tree = {}
- @preproc = preproc
- @postproc = postproc
+ @Tree = {}
+ @preproc = preproc
+ @postproc = postproc
end
attr_accessor :preproc
attr_accessor :postproc
def search(chrs, opt = nil)
- return self if chrs.empty?
- ch = chrs.shift
- if node = @Tree[ch]
- node.search(chrs, opt)
- else
- if opt
- chrs.unshift ch
- self.create_subnode(chrs)
- else
- SLex.fail ErrNodeNothing
- end
- end
+ return self if chrs.empty?
+ ch = chrs.shift
+ if node = @Tree[ch]
+ node.search(chrs, opt)
+ else
+ if opt
+ chrs.unshift ch
+ self.create_subnode(chrs)
+ else
+ SLex.fail ErrNodeNothing
+ end
+ end
end
def create_subnode(chrs, preproc = nil, postproc = nil)
- if chrs.empty?
- if @postproc
- D_DETAIL.pp node
- SLex.fail ErrNodeAlreadyExists
- else
- D_DEBUG.puts "change abstract node to real node."
- @preproc = preproc
- @postproc = postproc
- end
- return self
- end
+ if chrs.empty?
+ if @postproc
+ D_DETAIL.pp node
+ SLex.fail ErrNodeAlreadyExists
+ else
+ D_DEBUG.puts "change abstract node to real node."
+ @preproc = preproc
+ @postproc = postproc
+ end
+ return self
+ end
- ch = chrs.shift
- if node = @Tree[ch]
- if chrs.empty?
- if node.postproc
- DebugLogger.pp node
- DebugLogger.pp self
- DebugLogger.pp ch
- DebugLogger.pp chrs
- SLex.fail ErrNodeAlreadyExists
- else
- D_WARN.puts "change abstract node to real node"
- node.preproc = preproc
- node.postproc = postproc
- end
- else
- node.create_subnode(chrs, preproc, postproc)
- end
- else
- if chrs.empty?
- node = Node.new(preproc, postproc)
- else
- node = Node.new
- node.create_subnode(chrs, preproc, postproc)
- end
- @Tree[ch] = node
- end
- node
+ ch = chrs.shift
+ if node = @Tree[ch]
+ if chrs.empty?
+ if node.postproc
+ DebugLogger.pp node
+ DebugLogger.pp self
+ DebugLogger.pp ch
+ DebugLogger.pp chrs
+ SLex.fail ErrNodeAlreadyExists
+ else
+ D_WARN.puts "change abstract node to real node"
+ node.preproc = preproc
+ node.postproc = postproc
+ end
+ else
+ node.create_subnode(chrs, preproc, postproc)
+ end
+ else
+ if chrs.empty?
+ node = Node.new(preproc, postproc)
+ else
+ node = Node.new
+ node.create_subnode(chrs, preproc, postproc)
+ end
+ @Tree[ch] = node
+ end
+ node
end
#
@@ -165,81 +165,81 @@ module IRB
# able to be called arbitrary number of times.
#
def match(chrs, op = "")
- D_DETAIL.print "match>: ", chrs, "op:", op, "\n"
- if chrs.empty?
- if @preproc.nil? || @preproc.call(op, chrs)
- DOUT.printf(D_DETAIL, "op1: %s\n", op)
- @postproc.call(op, chrs)
- else
- nil
- end
- else
- ch = chrs.shift
- if node = @Tree[ch]
- if ret = node.match(chrs, op+ch)
- return ret
- else
- chrs.unshift ch
- if @postproc and @preproc.nil? || @preproc.call(op, chrs)
- DOUT.printf(D_DETAIL, "op2: %s\n", op.inspect)
- ret = @postproc.call(op, chrs)
- return ret
- else
- return nil
- end
- end
- else
- chrs.unshift ch
- if @postproc and @preproc.nil? || @preproc.call(op, chrs)
- DOUT.printf(D_DETAIL, "op3: %s\n", op)
- @postproc.call(op, chrs)
- return ""
- else
- return nil
- end
- end
- end
+ D_DETAIL.print "match>: ", chrs, "op:", op, "\n"
+ if chrs.empty?
+ if @preproc.nil? || @preproc.call(op, chrs)
+ DOUT.printf(D_DETAIL, "op1: %s\n", op)
+ @postproc.call(op, chrs)
+ else
+ nil
+ end
+ else
+ ch = chrs.shift
+ if node = @Tree[ch]
+ if ret = node.match(chrs, op+ch)
+ return ret
+ else
+ chrs.unshift ch
+ if @postproc and @preproc.nil? || @preproc.call(op, chrs)
+ DOUT.printf(D_DETAIL, "op2: %s\n", op.inspect)
+ ret = @postproc.call(op, chrs)
+ return ret
+ else
+ return nil
+ end
+ end
+ else
+ chrs.unshift ch
+ if @postproc and @preproc.nil? || @preproc.call(op, chrs)
+ DOUT.printf(D_DETAIL, "op3: %s\n", op)
+ @postproc.call(op, chrs)
+ return ""
+ else
+ return nil
+ end
+ end
+ end
end
def match_io(io, op = "")
- if op == ""
- ch = io.getc
- if ch == nil
- return nil
- end
- else
- ch = io.getc_of_rests
- end
- if ch.nil?
- if @preproc.nil? || @preproc.call(op, io)
- D_DETAIL.printf("op1: %s\n", op)
- @postproc.call(op, io)
- else
- nil
- end
- else
- if node = @Tree[ch]
- if ret = node.match_io(io, op+ch)
- ret
- else
- io.ungetc ch
- if @postproc and @preproc.nil? || @preproc.call(op, io)
- DOUT.exec_if{D_DETAIL.printf "op2: %s\n", op.inspect}
- @postproc.call(op, io)
- else
- nil
- end
- end
- else
- io.ungetc ch
- if @postproc and @preproc.nil? || @preproc.call(op, io)
- D_DETAIL.printf("op3: %s\n", op)
- @postproc.call(op, io)
- else
- nil
- end
- end
- end
+ if op == ""
+ ch = io.getc
+ if ch == nil
+ return nil
+ end
+ else
+ ch = io.getc_of_rests
+ end
+ if ch.nil?
+ if @preproc.nil? || @preproc.call(op, io)
+ D_DETAIL.printf("op1: %s\n", op)
+ @postproc.call(op, io)
+ else
+ nil
+ end
+ else
+ if node = @Tree[ch]
+ if ret = node.match_io(io, op+ch)
+ ret
+ else
+ io.ungetc ch
+ if @postproc and @preproc.nil? || @preproc.call(op, io)
+ DOUT.exec_if{D_DETAIL.printf "op2: %s\n", op.inspect}
+ @postproc.call(op, io)
+ else
+ nil
+ end
+ end
+ else
+ io.ungetc ch
+ if @postproc and @preproc.nil? || @preproc.call(op, io)
+ D_DETAIL.printf("op3: %s\n", op)
+ @postproc.call(op, io)
+ else
+ nil
+ end
+ end
+ end
end
end
end
@@ -247,7 +247,6 @@ end
# :startdoc:
if $0 == __FILE__
- # Tracer.on
case $1
when "1"
tr = SLex.new
@@ -281,4 +280,3 @@ if $0 == __FILE__
end
exit
end
-
diff --git a/lib/irb/src_encoding.rb b/lib/irb/src_encoding.rb
index 958cef104c..32f997fc7c 100644
--- a/lib/irb/src_encoding.rb
+++ b/lib/irb/src_encoding.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
# DO NOT WRITE ANY MAGIC COMMENT HERE.
def default_src_encoding
return __ENCODING__
diff --git a/lib/irb/version.rb b/lib/irb/version.rb
index bb998db3dd..094cb33c05 100644
--- a/lib/irb/version.rb
+++ b/lib/irb/version.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
#
# irb/version.rb - irb version definition file
# $Release Version: 0.9.6$
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb
index a627e7f3c2..ac3e369430